Version 39 (modified by suehring, 14 years ago) (diff) |
---|
Interfaces for user-defined code
Description: The following table describes the available interfaces for user-defined code in the model, the names and possible arguments of the subroutines involved as well as actions which can be accomplished in these subroutines. The respective name of a source code files is the subroutine name followed by ".f90". Exception: the file containing the module user has the name user_module.f90.
Call location | Subroutine name and argument(s) | Possible actions |
---|---|---|
--- | MODULE user | All user-defined variables which are used outside the respective local scopes of the user-defined subroutines have to be declared here. |
End of parin.f90 | user_parin | Declaration of user-defined parameters in the NAMELIST group &userpar. These parameters can be read from the local file PARIN and be used for steering the user-defined code (see chapter 4.0?). The user-defined parameter region is already pre-defined in &userpar and must not be changed. Additional NAMELIST groups may be declared if desired. The CPU time needed for executing user_parin is included in the local file CPU_MEASURES within the category "initialisation". |
End of header.f90 | user_header( io ) | Output of the values of the user-defined parameters to the local files HEADER and RUN_CONTROL. This output should be made anyway in order to subsequently check the parameter values used for the respective run. The number of the output unit is passed as an argument and must be used in each WRITE statement (e.g.: "WRITE ( io,…)"). By default, this subroutine only creates output if a user-defined NAMELIST is found in file PARIN (in this case the variable user_defined_namelist_found is set .TRUE. in user_parin). The names of any user-defined subdomains are displayed by default (see statistic_regions). |
End of init_3d_model.f90 | user_init |
Here, user-defined initialization actions which should be accomplished before the start of the 3D-model can be implemented (e.g. inhomogenous change of the surface temperature, the roughness length, or similar). At this point, all default parameter initializations of the model (chapter 4.1?) have already been carried out at all. |
End of read_3d_binary.f90 |
user_read_restart_data( |
Reading of user-defined 2d- and 3d-arrays from the restart file. |
DEFAULT case of SELECT CASE( TRIM(canopy_mode) ) command in the middle of init_3d_model.f90 | user_init_plant_canopy |
User-defined initilisation of the plant canopy model. |
DEFAULT case of SELECT CASE( TRIM(topography) ) command in the middle of init_grid.f90 | user_init_grid |
Execution of user-defined grid initializing actions. |
End of check_parameters | user_check_parameters | Check &userpar control parameters and deduce further quantities. |
In the middle of init_3d_model.f90 | user_init_3d_model |
Initialization of the 3d-model. |
In the middle of init_particles.f90 | user_init_particles | With this routine e.g. size and color of particles, which have been released initially from a source, can be specified. Like the calling routine init_particles, this routine is only called if particle advection is switched on (see package parameter dt_prel). |
End of advec_particles.f90 | user_particle _attributes | Here the particles can be assigned new attributes (diameter, color etc.) after each time step. Like the calling routine advec_particles, this routine is only called if particle advection is switched on (see package parameter dt_prel) |
Before the plot of particles and cross-sections in dvrp_plot.f90 |
user_dvrp_coltab | With this routine, color tables can be adjusted which should be used for output with the dvrp software. Individuell color tables for particles and cross-sections are possible. For this purpose the two arrays interval_values_dvrp and interval_h_dvrp (declared in the module dvrp_variables) have to be preset with appropriate values. The number of color table entries must be assigned to the variable of dvrp_colourtable_entries. The value of the subroutine argument mode defines, whether the color table is valid for particles or for cross-sections (i.e. mode can have the values particles or slicer). This routine only becomes active if dvrp-graphics is switched on (see package parameter dt_dvrp). |
Beginning and end of the time integration loop of time_integration.f90 |
user_actions |
In this routine user actions can be implemented which are to be executed either at each time step or at certain times (defined by the user). Since in each case the routine is called at the beginning and at the end of a time step as well as after each prognostic equation it must be defined at which place (and/or at which places) the respective actions are supposed to be executed. For this purpose an appropriate CASE structure is already inserted in this routine. The location of the calling routine is passed to this routine via the argument location. For example, if called at the beginning of a time step, location = 'before_timestep' and if called at the end, location = 'after_timestep'. |
SUBROUTINE preprocess_spectra | user_spectra |
Computation of user-defined spectra. |
flow_statistics.f90 before the summation of array hom (horizontal averages) | user_statistics( sr ) |
Horizontal averages of vertical profiles of user-defined quantities can be computed here. Also, additional time series quantities can be calculated. They have to be defined before in routine user_init. The routine is called once for each defined statistic_region (see statistic_regions). |
Middle of advec_particles.f90, after particle reflection from walls. | user_advec_particles | User-defined actions after the calculation of the new particle position. |
End of check_parameters.f90 where 2d/3d output quantities are checked |
user_check_data_output |
Here the physical unit(s) of user-defined 2d/3d output quantities (see data_output_user) have to be set. Input parameter variable contains the string identifier of the respective variable. For those variables not recognized by the user, the parameter unit is set to illegal, which tells the calling routine that the output variable is not defined and leads to a program abort. |
End of check_parameters.f90 where vertical profile output quantities are checked |
user_check_data_output _pr(variable, |
Here the physical unit(s) and vertical grid (u- or w-grid) of user-defined vertical profile output quantities (see data_output_pr_user) have to be set. Input parameter variable contains the string identifier of the respective variable. Parameter var_count contains the internal profile number and must not be changed by the user. For those variables not recognized by the user, the parameter unit is set to "illegal", which tells the calling routine that the output variable is not defined and leads to a program abort. |
netcdf.f90 (4 times) where the vertical grid coordinates for cross sections and volume data are defined |
user_define_netcdf_grid |
Set the grid on which user-defined output quantities (see data_output_user) are defined. Input parameter variable contains the string identifier of the respective variable. Allowed values are 'x' and 'xu' for grid_x, 'y' and 'yv' for grid_y, and 'zu' and 'zw' for grid_z. The output parameter found has to be set .TRUE. by the user, otherwise an error message will appear in the job protocol for the respective output quantity. Example: If an output quantity is defined at the center of the grid boxes, the following settings have to be used: grid_x = 'x' grid_y = 'y' grid_z = 'zu' found = .TRUE. For defining an output quantity at the grid points where the u-velocity-component is defined, please use grid_x = 'xu' grid_y = 'y' grid_z = 'zu' found = .TRUE. See chapter 3.5.4? about creating user-defined output quantities. |
Middle of data_output_2d.f90 |
user_data_output_2d | Resorts user-defined quantities (to be output as cross-section data; see data_output_user) with indices (k,j,i) to a temporary array local_pf with indices (i,j,k) and sets the grid on which they are defined. Depending on the value of input parameter av resorting is done for instantaneous (av=0) or time averaged data (av=1). Input parameter variable contains the string identifier of the respective variable. Allowed values for grid are 'zu' and 'zw'. The output parameter found has to be set .TRUE. by the user, otherwise an error message will appear in the job protocol for the respective output quantity. See chapter 3.5.4? about creating user-defined output quantities. |