83 | | * `cradius`: Localization cut-off radius (here in grid points) for the local observation domain |
84 | | * `sradius`: support radius, if the observation errors are weighted with distance (for `locweight>0`) |
85 | | * `locweight`: Type of localizing weight |
86 | | It is useful to define variables like these at this central position. Of course, this definition has to be adapted to the particular model used. |
87 | | |
88 | | Apart from the generic variables for localization, we also specify variables that are specific for each obseration type, for example |
| 83 | * `cradius`: Localization cut-off radius in grid points for the observation domain |
| 84 | * `sradius`: support radius, if observation errors are weighted (i.e. `locweight>0`) |
| 85 | * `locweight`: Type of localizing weight (see further below) |
| 86 | These localization parameters are used later in the subroutines called by `init_dim_obs_l_pdafomi`. |
| 87 | |
| 88 | We recommend to define such configuration variables at this central position, so that all configuration is done at one place. Of course, their definition should be adapted to the particular model used. |
| 89 | |
| 90 | The setting of `locweight` influences the weight function for the localization. With the PDAF3 interface (and generally with PDAF-OMI), the choices are standardized as follows |
| 91 | |
| 92 | ||= '''locweight''' =||= '''0''' =||= '''1''' =||= '''2''' =||= '''3''' =||= '''4''' =|| |
| 93 | ||= function =|| unit weight || exponential || 5-th order[[BR]]polynomial || 5-th order[[BR]]polynomial || 5-th order[[BR]]polynomial || |
| 94 | ||= regulation =|| - || - || - || regulation using[[BR]]mean variance || regulation using variance[[BR]]of single observation point || |
| 95 | ||= '''cradius''' =|||||||||||| weight=0 if distance > cradius || |
| 96 | ||= '''sradius''' =|| no impact || weight = exp(-d / sradius) |||||||| weight = 0 if d >= sradius[[BR]] else[[BR]] weight = f(sradius, distance) || |
| 97 | |
| 98 | Here, 'regulation' refers to the regulated localization introduced in Nerger, L., Janjić, T., Schröter, J., Hiller, W. (2012). A regulated localization scheme for ensemble-based Kalman filters. Quarterly Journal of the Royal Meteorological Society, 138, 802-812. [https://doi.org/10.1002/qj.945 doi:10.1002/qj.945]. |
| 99 | |
| 100 | |
| 101 | Apart from the generic variables for localization, we also specify variables that are specific for each observation type, for example in the tutorial code, we specify |
102 | | * `filtertype`:[[BR]] The integer defining the type of filter algorithm as given in the call to `PDAF_init` |
103 | | * `dim_p`:[[BR]] An integer holding the size of the state dimension for the calling process as specified in the call to `PDAF_init` |
104 | | * `dim_ens`:[[BR]] An integer holding the size of the ensemble |
105 | | * `state_p`:[[BR]] A real array of size (`dim_p`) for the local model state of the calling process (can be used freely for ensemble-based methods) |
106 | | * `Uinv`:[[BR]] A real array of size (`dim_ens-1`, `dim_ens-1`) for the inverse of matrix '''U''' from the decomposition of the state error covariance matrix '''P''' = '''VUV^T^''' (Not relevant for ensemble-based methods) |
107 | | * `ens_p`:[[BR]] A real array of size (`dim_p`, `dim_ens`), which has to be filled with the ensemble of model states. |
108 | | * `flag`:[[BR]] Status flag for PDAF. It is 0 upon entry and can be set by in the user-supplied routine, depending on the success of the ensemble initialization. Preferably, values above 102 should be used for failures to avoid conflicts with the error codes defined within PDAF_init. |
| 115 | * `filtertype`, `integer, intent(in)`:[[BR]]The type of filter algorithm as given in the call to `PDAF_init` |
| 116 | * `dim_p`, `integer, intent(in)`:[[BR]] The size of the state dimension for the calling process as specified in the call to `PDAF_init` |
| 117 | * `dim_ens`, `integer, intent(in)`:[[BR]]The size of the ensemble |
| 118 | * `state_p`, `real, dimension(dim_p), intent(inout)`:[[BR]]Array for the local model state of the calling process (can be used freely for ensemble-based methods) |
| 119 | * `Uinv`, `real, dimension(dim_ens-1, dim_ens-1), intent(inout)`:[[BR]]A possible weight matrix (Not relevant for ensemble-based methods) |
| 120 | * `ens_p`, `real, dimension(dim_p, dim_ens), intent(inout)`:[[BR]] The ensemble array, which has to be filled with the ensemble of model states. |
| 121 | * `flag`, `integer, intent(inout)`:[[BR]]Status flag for PDAF. It is 0 upon entry and can be set by in the user-supplied routine, depending on the success of the ensemble initialization. Preferably, values above 102 should be used for failures to avoid conflicts with the error codes defined within PDAF_init. |
| 122 | |
| 123 | === Defining the state vector === |
| 124 | |
| 125 | The ensemble initialization routine `init_ens_pdaf` is the first location at which the user has to fill a state vector (or array of state vectors). A state vector is the collection of all model fields that are handled in the analysis step of the assimilation procedure into a single vector. Usually one concatenates the different model fields as complete fields. Thus, the vector could contain a full 3-dimensional temperature field, followed by the salinity field (in case of an ocean model), and then followed by the 3 fields of the velocity components. |
| 126 | |
| 127 | The logical definition of the state vector will also be utilized in several other user-supplied routines. E.g. in routines that fill model fields from a state vector or in the routine providing the observation operator. |
| 128 | |
| 129 | The actual setup of the state vector should be done in `init_pdaf`. The tutorial example `tutorial/online_2D_serialmodel_2fields` demonstrates a possible setup of the state vector for 2 fields. Here, one defines the number of fields, the dimension of each included field as well as the offset of each field in the state vector. |