a physics module goes in its own folder (EQUATION/MYPHYSMODEL/).
All its internal routines arePRIVATE and cannot be
seen from wabbit. Only a handful of interface routines are made PUBLIC
with an explicit statement. The parameter struct is a
module global (and of course not visible in wabbit).
Every module has at least the following PUBLIC routines:
READ_PARAMETERS_MYPHYSMODEL -- main level wrapper routine to read parameters in
the physics module. It reads from the same ini-file as wabbit what it
needs to know. caled only once. note in physics modules the parameter
struct for wabbit is not available.
PREPARE_SAVE_DATA_MYPHYSMODEL -- save data. Since you might want to save
derived data, such as the vorticity, the divergence etc., which are not
in your state vector, this routine has to copy and compute what you want
to save to the work array. In the main code, save_fields than saves the
first N_fields_saved components of the work array to file.
FIELD_NAMES_MYPHYSMODEL -- the main routine save_fields has to know how you
label the stuff you want to store from the work array, and this routine
returns those strings
RHS_MYPHYSMODEL -- main RHS. it must be valid for all dimensions (2d/3d). The
idea is that the physics modules are not aware of the GRID. that's for
wabbit. physics modules see only blocks. that's their deal. Now, it is
possible for the RHS to depend on global stuff, such as integrals, for
example for forcing terms. therefore, I suggest a staging concept for
the RHS calls, see RHS_wrapper.f90 and the new module. RHS's that do not
require such integrals can just skip the steps internally.
GET_DT_BLOCK_MYPHYSMODEL -- returns the dt for a block. wabbit selects the
smallest dt of all blocks.
INICOND_MYPHYSMODEL -- sets on one block the initial condition.
All additional routines accessible from WABBIT can be found in module_physics_metamodule
The major structure in a nutshell:
(EQUATION/MYPHYSMODEL/)
.PRIVATE
and cannot be seen from wabbit. Only a handful of interface routines are madePUBLIC
with an explicit statement. The parameter struct is a module global (and of course not visible in wabbit).Every module has at least the following
PUBLIC
routines:READ_PARAMETERS_MYPHYSMODEL -- main level wrapper routine to read parameters in the physics module. It reads from the same ini-file as wabbit what it needs to know. caled only once. note in physics modules the parameter struct for wabbit is not available.
PREPARE_SAVE_DATA_MYPHYSMODEL -- save data. Since you might want to save derived data, such as the vorticity, the divergence etc., which are not in your state vector, this routine has to copy and compute what you want to save to the work array. In the main code, save_fields than saves the first N_fields_saved components of the work array to file.
FIELD_NAMES_MYPHYSMODEL -- the main routine save_fields has to know how you label the stuff you want to store from the work array, and this routine returns those strings
RHS_MYPHYSMODEL -- main RHS. it must be valid for all dimensions (2d/3d). The idea is that the physics modules are not aware of the GRID. that's for wabbit. physics modules see only blocks. that's their deal. Now, it is possible for the RHS to depend on global stuff, such as integrals, for example for forcing terms. therefore, I suggest a staging concept for the RHS calls, see RHS_wrapper.f90 and the new module. RHS's that do not require such integrals can just skip the steps internally.
GET_DT_BLOCK_MYPHYSMODEL -- returns the dt for a block. wabbit selects the smallest dt of all blocks.
INICOND_MYPHYSMODEL -- sets on one block the initial condition.
All additional routines accessible from WABBIT can be found in
module_physics_metamodule