Changes between Version 9 and Version 10 of ModifyModelforEnsembleIntegration


Ignore:
Timestamp:
Aug 26, 2010, 3:21:03 PM (14 years ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ModifyModelforEnsembleIntegration

    v9 v10  
    4747The interface of `PDAF_get_state` is the following:
    4848{{{
    49   SUBROUTINE PDAF_get_state(nsteps, timenow, doexit, U_next_obs, U_distribute_state, &
     49  SUBROUTINE PDAF_get_state(nsteps, timenow, doexit, U_next_observation, U_distribute_state, &
    5050                            U_prepoststep, status)
    5151}}}
     
    5454 * `timenow`: A real specifying upon exit the current model time. 
    5555 * `doexit`: An integer variable defining whether the assimilation process is completed and the program should exit the while loop. For compatibility 1 should be used for exit, 0 for continuing in the loop.
    56  * `U_next_obs`: The name of a user supplied routine that initializes the variables `nsteps`, `timenow`, and `doexit`
     56 * `U_next_observation`: The name of a user supplied routine that initializes the variables `nsteps`, `timenow`, and `doexit`
    5757 * `U_distributed_state`: The name of a user supplied routine that initializes the model fields from the array holding the ensemble of model state vectors
    5858 * `U_prepoststep`: 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.
     
    7676 * `status`: The integer status flag. It is zero, if PDAF_get_state is exited without errors.
    7777
     78== User-supplied routines ==
     79
     80To indicate user-supplied routines we use the prefix `U_`. In the template directory `templates/` these routines are provided in files with the routines name without this prefix. In the example implementation in `testsuite/src/dummymodel_1D` the routines exist without the prefix, but with the extension `_dummy_D.F90`. In the section titles below we provide the name of the template file in parentheses.
     81
     82=== `U_next_observation` (next_observation.F90) ===
     83
     84The interface for this routine is
     85{{{
     86SUBROUTINE U_next_obs(stepnow, nsteps, doexit, timenow)
     87
     88  INTEGER, INTENT(in)  :: stepnow  ! Number of the current time step
     89  INTEGER, INTENT(out) :: nsteps   ! Number of time steps until next obs
     90  INTEGER, INTENT(out) :: doexit   ! Whether to exit forecasting (1 for exit)
     91  REAL, INTENT(out)    :: timenow  ! Current model (physical) time
     92}}}
     93
     94The routine is called once at the beginning of each forecast phase. It is executed by all processes that participate in the model integrations.
     95
     96Based on the information of the current time step, the routine has to define the number of time steps `nsteps` for the next forecast phase. In addition, the flag `doexit` has to be initialized to provide the information if the external ensemble loop can be exited. `timenow` is the current model time. This variable should also be initialized. It is particularly important, if an ensemble task integrates more than one model state. In this case `timenow` can be used to correctly jump back in time.
     97
     98Some hints:
     99 * If the time interval between successive observations is known, `nsteps` can be simply initialized by dividing the time interval by the size of the time step
     100 * `doexit` should be 0 to continue the assimilation process. In most cases `doexit` is set to 1, when `PDAF_get_state` is called after the last analysis for which observations are available.
     101 * At the first call to `U_next_obs` the variable `timenow` should 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.
     102
     103=== `U_distribute_state` (distributed_state.F90) ===
     104
     105The interface for this routine is
     106{{{
     107SUBROUTINE distribute_state(dim_p, state_p)
     108
     109  INTEGER, INTENT(in) :: dim_p           ! State dimension for PE-local model sub-domain
     110  REAL, INTENT(inout) :: state_p(dim_p)  ! State vector for PE-local model sub-domain
     111}}}
     112
     113This routine is called during the forecast phase as many times as there are states to be integrated by a model task. Again, the routine is executed by all processes that belong to model tasks.
     114
     115When the routine is called a state vector `state_p` and its size `dim_p` are provided. As the user has defines how the model fields are stored in the state vector, one can initialize the model fields from this information. If the model is not parallelized, `state_p` will contain a full state vector. If the model is parallelized using domain decomposition, `state_p` will contain the part of the state vector that corresponds to the model sub-domain for the calling process.
     116
     117Some hints:
     118 * If the state vector does not include all model fields, it can be useful to keep a separate array to store those additional fields. This array has to be kept separate from PDAF, but can be defined using a module like `mod_assimilation`.
     119
     120=== U_prepoststep (prepoststep_seik.F90) ===
     121
     122
    78123== Simulating model errors ==
    79124