DISPATCH
|
This is a bare minimum interface to the new extras module, showing how to interface with a pre-existing force_modselected() function. More...
Data Types | |
type | forces_t |
Functions/Subroutines | |
subroutine | init (self, link) |
Initialize forces_t interface to force_t. | |
This is a bare minimum interface to the new extras module, showing how to interface with a pre-existing force_modselected() function.
In this version, the force_per_unit_mass array is allocated in init, and its values are set by a call to the previous standard force_t interface, in order for the new arrangement to be as non-intrusive as possible, relative to pre- existing experiments.
In the future, external forces should NOT use this interface. Instead, each type of force should use its own data type (primarily to hold parameters specific to that force), while the resulting force should be addded to (not overwrite) the generic patch_tforce_per_unit_mass or _volume arrays.
To comply with that policy, this interface also adds the force, and thus assumes that the generic array is set to zero elsewhere, before each timestep. The proper place to do that is in the extras_t data type, which is where the user chooses which forces to include and combine.