SFEMaNS  version 4.1 (work in progress)
Reference documentation for SFEMaNS
 All Classes Files Functions Variables Groups Pages
Fortran file read_user_data.f90

The file read_user_data.f90 allows to add new datas in the code SFEMaNS. These datas are stocked in the derived data type called user. As the datas defined in the code SFEMaNS, these user datas are read in the data file described in this section. A template is provided in the following directory: ($SFEMaNS_DIR)/TEMPLATE.

To add new data, that will be read by the code SFEMaNS in the data file, you need to edit the file read_user_data.f90 as follows.

  1. The new data has to be declared in the module user_data_module. For example to define a real number called my_real, the following line is added.
    REAL(KIND=8) :: my_real
    We note that the user should only modify the module user_data_module between the following code lines:
    !===I declare my own data here==================================================
    LOGICAL :: if_my_stuff
    !.......Continue here ................................
    !===End I declare my own data here==============================================
  2. The new data needs to be read by the code SFEMaNS. This is done in the subroutine read_user_data of the module user_data. To do so, we use the function find_string as follows:

    CALL find_string(unit_file, '===Value of my_real', test)
    IF (test) THEN
    READ (unit_file, *) user%my_real
    ELSE
    user%my_real=0.d0
    END IF

    The inputs are unit_file (that represents the data file) and the line that is read by the code SFEMaNS in the data file (here it is '===Value of my_real'). The ouput is a logical denoted test. It is true if the line '===Value of my_real' is present in the data file and false otherwise.

    We note that the user should only modify the subroutine read_user_data between the following code lines:

    !===I add lines that the code SFEMaNS reads in the data file=========================
    !.......Continue here ................................
    !===End I add lines that the code SFEMaNS reads in the data file=====================

Remarks:

  1. The real number my_real is stocked in user%my_real.
  2. To have acces to the derived data type user in a function or a subroutine, you need to add the following module: