Version 4 (modified by 4 years ago) (diff) | ,
---|
PDAF-OMI: The file callback_obs_pdafomi.F90
Contents of this page
The file callback_obs_pdafomi.F90
contains are those routines that are directly called by PDAF as call-back routines. In the example codes we use all routines with the suffix _pdafomi to distinguish them from routine from existing implementation where the suffix is typically _pdaf.
The file templates/omi/callback_obs_pdafomi.F90
provides a template for implementing the routines. A compact example canbe found in tutorial/online_2D_serialmodel_omi/
.
As mentioned in the OMI introduction, the routines are mainly pass-through routines. Thus, one typically includes the observation-specific routine with ‘use’ and then calls this routine. However, the is small additional functionality in the different routines which has to be handles when implementing the routine or adding an observation type
init_dim_obs_pdafomi
In this routine we declare a dimension variable
dim_obs_TYPE
for each observation type. This is initialized by the corresponding routine init_dim_obs_f_TYPE. The sum of these individual dimension yields the total number of observations, which is returned to PDAF.
The implementation steps are:
- Include the observation-specific routine
init_dim_obs_TYPE
and the variableassim_TYPE
from the observation-module with 'use' - Declare a dimension variable
dim_obs_TYPE
and initialize it to 0 - Add a call to the observation-specific routine init_dim_obs_TYPE with the condition
IF (assim_TYPE)
- add
dim_obs_TYPE
to the final sum computingdim_obs
.
Notes:
- The variable
assim_TYPE
indicates whether a particular observation type is assimilated. It is usually defined in init_pdaf, or by reading from the command line or a namelist file. - The observation-module can have either a specific name for
init_dim_obs_TYPE
or a generic name. If the generic nameinit_dim_obs
is used one can apply a name conversioninit_dim_obs_TYPE => init_dim_obs
.
obs_op_pdafomi
In this routine one has to use the offset variable
offset_obs
. It is initialized to zero and then used as an argument in each call to the observation-specific obs_op_TYPE routine. This offset defines the order in which the observations are treated in the full observation vector.
The implementation steps are:
- Include the observation-specific routine
obs_op_TYPE
from the observation-module with 'use' - Ensure that the integer variable
offset_obs
is declared and initialized to 0 - Add a call to the observation-specific routine obs_op_TYPE
Notes:
- The order of the calls to
obs_op_TYPE
determine how the different observations are ordered in the full observation vector containing all observation types.
init_dim_obs_l_pdafomi
In this routine two offset variables
offset_obs_f
andoffset_obs_l
are used to ensure a consistent order of the calls.
The implementation steps are:
- Include the observation-specific routine
init_dim_obs_l_TYPE
from the observation-module with 'use' - Ensure that the integer variables
offset_obs
andoffset_obs_l
are declared and initialized to 0 - Add a call to the observation-specific routine init_dim_obs_l_TYPE
deallocate_obs_pdafomi
The file callback_obs_pdafomi.F90 also contains a routine deallocate_obs_pdafomi. Each obs-module allocates arrays in the observation type obs_f
and deallocate_obs_pdafomi
is used to deallocate the different observation-specific arrays after the analysis step.
The implementation steps are:
- Include the observation-specific type
thisobs
from the observation-module with 'use' apply a name conversion likeobs_TYPE => thisobs
- add a call to
PDAFomi_deallocate_obs
giving the observation-specificobs_TYPE
as argument. - To perform the deallocation, insert a call to deallocate_obs_pdafomi at the end of the routine
prepoststep_pdaf
.