Changes between Version 36 and Version 37 of ModifyModelforEnsembleIntegration


Ignore:
Timestamp:
May 24, 2025, 11:09:23 AM (11 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ModifyModelforEnsembleIntegration

    v36 v37  
    3939== Calling `PDAF_init_forecast` ==
    4040
    41 The routine `PDAF_init_forecast` is called at the end of the routine `init_pdaf` that was discussed on the [InitPdaf page on initializing PDAF]. The main purpose of this routine is to initialize the model fields for all model tasks from the ensemlbe of state vectors. This is done in the call-back routine `distribute_state_pdaf`. Further, the routine calls the call-back-routine `prepoststep_pdaf`. This pre/postep routine provides the user access to the initial ensemble. The routine also returns the number of time steps for the initial forecast phase, and an exit flag. These variables are usually not used in the user code in the `fully parallel` variant, but only internally by PDAF.
     41The routine `PDAF_init_forecast` is called at the end of the routine `init_pdaf` that was discussed on the [InitPdaf page on initializing PDAF]. The main purpose of this routine is to initialize the model fields for all model tasks from the ensemlbe of state vectors. This is done in the call-back routine `distribute_state_pdaf`. The routine also calls the call-back routine `next_observation_pdaf` to set the number of time steps for the initial forecast phase and an exit flag. These values used are internally by PDAF to control the forecast phase. Further, the routine calls the call-back-routine `prepoststep_pdaf`. This pre/postep routine provides the user access to the initial ensemble.
    4242
    4343The interface of `PDAF_init_forecast` is:
    4444{{{
    45   SUBROUTINE PDAF_init_forecast(nsteps, timenow, doexit, &
    46                                 next_observation_pdaf, distribute_state_pdaf, &
     45  SUBROUTINE PDAF_init_forecast(next_observation_pdaf, distribute_state_pdaf, &
    4746                                prepoststep_pdaf, status)
    4847}}}
    4948with the arguments (where the bold names show the arguments relevant to the user for the ''fully-parallel'' variant):
    50  * `nsteps`, `integer, intent(inout)`:[[BR]] The return value for the number of time steps to be performed
    51  * `timenow`, `real, intent(out)`:[[BR]] The current model time in a user-defined definition
    52  * `doexit`, `integer, intent(inout)`:[[BR]] The exit flag defining whether the assimilation process is completed. (1: exit, 0: continue).
    53  * **[#next_observation_pdafnext_observation_pdaf.F90 next_observation_pdaf]**:[[BR]] The name of a user supplied routine that initializes the variables `nsteps`, `timenow`, and `doexit`
     49 * **[#next_observation_pdafnext_observation_pdaf.F90 next_observation_pdaf]**:[[BR]] The name of a user supplied routine that initializes the number of time steps of the forecast phase.
    5450 * **[#distribute_state_pdafdistribute_state_pdaf.F90 distribute_state_pdaf]**:[[BR]] The name of a user supplied routine that initializes the model fields from the array holding the ensemble of model state vectors
    5551 * **[#prepoststep_pdafprepoststep_ens_pdaf.F90 prepoststep_pdaf]**:[[BR]] The name of a user supplied routine that is called before and after the analysis step. Here the user has the possibility to access the state ensemble and can e.g. compute estimated variances or can write the ensemble states the state estimate into files.
     
    9793For the ``fully parallel`` implementation variant, the main variable to be returned is the number of time steps in the next forecast phase.
    9894
    99 Based on the information of the current time step, the routine has to define the number of time steps `nsteps` for the next forecast phase. For the 'fully parallel' data assimilation variant, the flag `doexit` is only used inside PDAF.
     95Based on the information of the current time step, the routine has to define the number of time steps `nsteps` for the next forecast phase. For the ''fully parallel'' implementation variant, the flag `doexit` is only used inside PDAF.
    10096
    10197Some hints:
    10298 * We assume that the time interval between successive observations is known. Then, `nsteps` can be simply initialized by dividing the time interval by the size of the time step.
    103  * It is up to the user to define `timenow` because it is only used in the user-code. The user can either ignore it (setting to to 0.0), or could use it freely to indicate the model time. At the first call to `next_observation_pdaf` the variable `timenow` can be initialized with the current model time. At the next call a forecast phase has been completed. Thus, the new value of `timenow` follows from the timer interval for the previous forecast phase and can be incremented accordingly.
     99 * It is up to the user to define `timenow` because it is only used in the user-code. The user can either ignore it (setting to to 0.0), or could use it freely to indicate the model time. At the first call to `next_observation_pdaf` the variable `timenow` can be initialized with the current model time. At the next call a forecast phase has been completed. Thus, the new value of `timenow` follows from the timer interval for the previous forecast phase and can be incremented accordingly. In the user code, one can access `timenow` with a call to [wiki:PDAF_get_fcst_info].
    104100 * In the ''fully-parallel'' implementation discussed here, `doexit` is not used in the user-code. One can safely just set it to 0.
    105  * `doexit` is used as follows inside PDAF. If `nsteps=0` or `doexit=1` is set, the ensemble state will not be distributed by PDAF (thus `distribute_state`, see below, is not called). If one intends to proceed with ensemble forecasting, one has to set `nsteps` to a value >0 and `doexit=0`. 
     101 * Inside PDAF, `doexit` is used as follows: If `nsteps=0` or `doexit=1` is set, the ensemble state will not be distributed by PDAF (thus `distribute_state`, see below, is not called). If one intends to proceed with ensemble forecasting, one has to set `nsteps` to a value >0 and `doexit=0`. 
    106102 * The total number of time steps set for the assimilation experiment (variable `isteps` in Fig. 1) defines when the model integrations end. If `nsteps` is set so that it specifies a time step larger than `isteps` not all of these steps will be computed.
    107103