Changes between Initial Version and Version 1 of IncrementalAnalysisUpdates


Ignore:
Timestamp:
Mar 26, 2025, 6:09:37 PM (7 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IncrementalAnalysisUpdates

    v1 v1  
     1= Incremental Analysis Updates (IAU) with PDAF =
     2
     3
     4{{{
     5#!html
     6<div class="wiki-toc">
     7<h4>Implementation Guide</h4>
     8<ol><li><a href="ImplementationGuide">Main page</a></li>
     9<li><a href="AdaptParallelization">Adaptation of the parallelization</a></li>
     10<li><a href="InitPdaf">Initialization of PDAF</a></li>
     11<li><a href="ModifyModelforEnsembleIntegration">Modifications for ensemble integration</a></li>
     12<li><a href="ImplementationofAnalysisStep">Implementation of the analysis step</a></li>
     13<li><a href="PDAF_OMI_Overview">PDAF-OMI, the Observation Module Infrastructure</a></li>
     14<li><a href="AddingMemoryandTimingInformation">Memory and timing information</a></li>
     15<li><a href="EnsembleGeneration">Ensemble Generation</a></li>
     16<li><a href="DataAssimilationDiagnostics">Ensemble Diagnostics</a></li>
     17<li><a href="AuxiliaryRoutines">Auxiliary routines</a></li>
     18<li>Incremental Analysis Updates (IAU)</li>
     19<li><a href="ImplementGenerateObs">Generate synthetic observations</a></li>
     20<li><a href="AvailableOptionsforInitPDAF">Filter-specific options</a></li>
     21</ol>
     22</div>
     23}}}
     24
     25[[PageOutline(2-3,Contents of this page)]]
     26
     27|| IAU (Incremental Analysis Updates) was re-coded for PDAF V3.0 and now offers full functionality ||
     28
     29Incremental Analysis Updates (IAU) are a method to avoid shocks to the model dynamics that could result from the increment computed in an analysis step. Instead of an instantaneous change of the model fields, IAU applies the analysis increment stepwise distributes over a number of time steps.
     30
     31There are different approaches to IAU. One is what we call //forward IAU//. In this case the ensmeble is integrated by the model forard in time starting from the analysis time. Thus, the analysis increment is applied in the future of the analysis step. The other approach is //retrospective IAU//. This approach usually assimilates observation in the middle of a time window. Then, the model is restarted at the beginning of the time window and the IAU is applied over the full time window. In this approach the distributed increments are usually weighted to that they incremental changes increase toward the analysis time in the middle of the time window and decrease afterwards. An example would be for daily assimilation to compute the analysis increment in the middle of the day and then restart the ensemble integration from midnight and integrating over 24 hours.
     32
     33PDAF supports both //forward IAU// and //retrospective IAU//, however, for //retrospective IAU// with online coupled DA the user would need to ensure that the model steps back in time consistently.
     34
     35If one uses the PDAF_assimilate interface routines, one can activate IAU with a single call to `PDAF_iau_init`, which will be explained below. Apart from the standard settings, there are further routines that can be called for particular cases.
     36
     37== Activation and configuration of IAU ==
     38
     39=== PDAF_iau_init ===
     40
     41This routine initializes parameters for IAU and activates it. The routine further allocates the array in which the ensemble increments are stored. This array exists on all processes that are part of model tasks.
     42
     43The routine is usually called in `init_pdaf` after the initialization of PDAF in `PDAF_init`. it is important that the routine is called by all model processes because all these processes need the information on the IAU configuration and need to allocate the increment array.
     44
     45The interface is:
     46{{{
     47SUBROUTINE PDAF_iau_init(type_iau, nsteps_iau, flag)
     48
     49    INTEGER, INTENT(in) :: type_iau     ! Type of IAU
     50                                        !   (0) no IAU
     51                                        !   (1) constant increment weight 1/nsteps_iau
     52                                        !   (2) Linear IAU weight with maximum in middle of IAU period
     53                                        !   (3) Zero weights for null mode (can be used to apply IAU on user side)
     54    INTEGER, INTENT(in) :: nsteps_iau   ! Number of time steps in IAU
     55    INTEGER, INTENT(out) :: flag        ! Status flag
     56}}}
     57
     58Hints:
     59  * type_iau=2 is linearly increasing and decreasing similar to what is used in the ocean model NEMO. This type is usually used if the IAU is applied in re-running over the previous observation period.
     60  * type_iau=3 stores the increment information, but does not apply the increment. This permits to apply the increment in user-provided code. For this, the routine [wiki:PDAF_iau_set_pointer] can be used to assess the increment array within PDAF.
     61
     62An example implementation can be found in `tests/online_2D_parallelmodel/`.
     63
     64
     65
     66== Set the increment array ==
     67
     68=== PDAF_iau_init_inc ===
     69
     70`PDAF_iau_init_inc` can be used by a user to fill the process-local increment array.
     71A common use is when the IAU should be applied from the initial time of an assimilation run, for example if the increment was computed in a previous assimilation run and then stored for restarting. Since PDAF can only compute an increment in an analysis step, the user needs to provide the increment.
     72
     73The routine is usually called in `init_pdaf` after the initialization of IAU with `PDAF_iau_init`. It has to be called by all processes that are model processes and one needs to provide the task-local ensemble (i.e. with local ensemble size `dim_ens_l=1` for the fully parallel mode, and usually `dim_ens_l>1` for the flexible parallelization mode). The routine can usually not be called in `init_ens_pdaf` since this routine is only executed by filter processes and not all model processes.
     74
     75The interface is:
     76{{{
     77  SUBROUTINE PDAF_iau_init_inc(dim_p, dim_ens_l, ens_inc, flag)
     78
     79    INTEGER, INTENT(in) :: dim_p                    ! PE-local dimension of model state
     80    INTEGER, INTENT(in) :: dim_ens_l                ! Task-local size of ensemble
     81    REAL, INTENT(in) :: ens_inc(dim_p, dim_ens_l)   ! PE-local increment ensemble
     82    INTEGER, INTENT(out) :: flag                    ! Status flag
     83}}}
     84
     85
     86
     87== Change the IAU configuration ==
     88
     89=== PDAF_iau_reset ===
     90
     91`PDAF_iau_reset` is used to modify the IAU type and the number of IAU time steps during a run. While [wiki:PDAF_iau_init `PDAF_iau_init`] sets the IAU type and number of IAU steps initially, one can change these settings during an assimilation run.
     92
     93The routine has to be called by all processes that are model processes. A common place is to call the routine in `assimilate_pdaf` after an analysis step or in `distribute_state_pdaf`.
     94
     95The interface is:
     96{{{
     97  SUBROUTINE PDAF_iau_reset(type_iau, nsteps_iau, flag)
     98
     99    INTEGER, INTENT(in) :: type_iau     ! Type of IAU
     100                                        !   (0) no IAU
     101                                        !   (1) constant increment weight 1/nsteps_iau
     102                                        !   (2) Linear IAU weight with maximum in middle of IAU period
     103                                        !   (3) Zero weights for null mode (can be used to apply IAU on user side)
     104    INTEGER, INTENT(in) :: nsteps_iau   ! number of time steps in IAU
     105    INTEGER, INTENT(out) :: flag        ! Status flag
     106
     107}}}
     108
     109Hints:
     110 * It is recommended to only call this routine after or just before a forecast phase.
     111 * Calling this routine during a forecast phase will change the IAU weights and might stop the application of IAU if `nsteps_iau` is below the number of time steps performed in the current forecast phase.
     112
     113
     114== Set user-defined IAU weights ==
     115
     116=== PDAF_iau_set_weights ===
     117
     118This routine allows the user to provide a user-specified vector of increment weights. While `PDAF_iau_init` allows to choose among pre-defined weight functions, one might like to use a different function and the corresponding weights can be set here.
     119
     120The routine has to be called by all processes that are model processes. A common place is to call the routine in `assimilate_pdaf` after an analysis step or in `distribute_state_pdaf`.
     121
     122
     123The interface is:
     124{{{
     125  SUBROUTINE PDAF_iau_set_weights(iweights, weights)
     126
     127    INTEGER, INTENT(in) :: iweights        ! Length of weights input vector
     128    REAL, INTENT(in) :: weights(iweights)  ! Input weight vector
     129}}}
     130
     131Hints:
     132 * If `iweights` is different from the number of IAU steps set in `PDAF_iau_init` or `PDAF_iau_reset` only the minimum of `iweights` and the set IAU steps is filled with the provided weights vector.
     133 * We recommend to only change the weights vector before a forecast phase.
     134 * While setting different weight functions for different processes or model tasks is possible this likely leads to inconsistencies.
     135
     136
     137== Set a pointer to the IAU array ==
     138
     139=== PDAF_iau_set_pointer ===
     140
     141With this routine the user can set a pointer to the PDAF-internal array of ensemble increments. This gives direct access to the increment array e.g. to analyze it or to write it into a file for restarting. The routine is different from `PDAF_iau_set_inc` in that here the user obtains access to the internal IAU array, while in `PDAF_iau_set_inc` one can only overwrite the internal array.
     142
     143The routine can be called by each single process, but it only provides a pointer to the process-local part of the increment array. For domain-decomposed models, this array only includes the state vector part for the process domain. In addition, it usually only contains a sub-ensemble unless one uses the flexible parallelization mode with a single model task. For the fully parallel mode, the process(es) of a single model task only hold a single ensemble state.
     144
     145The interface is:
     146{{{
     147  SUBROUTINE PDAF_iau_set_pointer(iau_ptr, flag)
     148
     149    REAL, POINTER, INTENT(out) :: iau_ptr(:,:)  ! Pointer to IAU ensemble array
     150    INTEGER, INTENT(out)       :: flag          ! Status flag
     151}}}
     152
     153Hints:
     154 * In Fortran user code one has to declare[[BR]]`REAL, POINTER :: iau_ptr(:,:) `[[BR]] and provide this as the first argument. One does not need to allocate this pointer.
     155
     156== Apply the IAU increment ==
     157
     158=== PDAF_iau_add_inc ===
     159
     160This routine is only used with the flexible parallelization mode if a routine `PDAF3_put_state_X` (or any other PDAF*_put_state_X) routine is used. Since `PDAF*_put_state_X` is only called after a model state is integrated over the full forecast period, this routine cannot apply the increment. Hence, the routine `PDAF_iau_add_inc` has to be called at each model time step in the time stepping loop of the model to apply the increment. This routine adds the increment for the currently integrated ensemble member according to the specified IAU type and number of IAU steps.
     161
     162|| **Note:** Starting from PDAF V3.0 we recommend to use the `PDAF*_assimilate_X` routines also for the flexible parallelization mode. Since `PDAF*_assimilate_X` is called at each time step, the additional call of `PDAF_iau_add_inc` is not required. ||
     163
     164The routine has to be inserted in time stepping loop of the model code. It has to be called at each time step.
     165
     166The interface is the following:
     167{{{
     168  SUBROUTINE PDAF_iau_add_inc(U_collect_state, U_distribute_state)
     169
     170    EXTERNAL :: U_collect_state, &      ! Routine to collect a state vector
     171         U_distribute_state             ! Routine to distribute a state vector
     172}}}