Changes between Initial Version and Version 1 of readwrite_obs


Ignore:
Timestamp:
Feb 9, 2019, 1:15:09 PM (6 years ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • readwrite_obs

    v1 v1  
     1= readwrite_obs =
     2
     3The page documents the template routines in `readwrite_obs.F90`: `init_file_syn_obs`, `write_syn_obs`, and `read_syn_obs`.
     4
     5This routine can be used when one uses PDAF's functionality for generating synthetic observations with [wiki:PDAF_generate_obs PDAF_generate_obs] or [wiki:PDAF_put_state_generate_obs PDAF_put_state_generate_obs]. The routines are not called directly by PDAF, but in the user code.
     6
     7The routines are provided as a template in the PDAF package. Usually, they can be used directly without modifications. Their purpose is to write synthetic observations generated by PDAF into a file holdig these synthetic observation, and to read them from this file in a twin data assimilation experiment. The routines use netCDF as the file format, because it allows for structured and efficient file writing and reading. However, one could also modify this cuntionality to e.g. use Fortran binary files.
     8
     9The routines are the following
     10
     11== init_file_syn_obs ==
     12
     13This routine initializes the file(s) holding the synthetic observations. It is usually called at the initialization stage in ```init_pdaf```.
     14
     15The interface is the following:
     16{{{
     17SUBROUTINE init_file_syn_obs(dim_obs_max, file_obs, screen)
     18}}}
     19with
     20 * `dim_obs_max` : `integer, intent(in)`[[BR]] Maximum dimension of an observation vector
     21 * `file_obs` : `character(len=*), intent(in)`[[BR]] Name of the file
     22 * `screen` : `integer, intent(in)`[[BR]] Flag whether the routine should write screen output: (>0) for output
     23
     24Hints:
     25 * If the full vector of synthetic observations is identical for each process in a parallel configuration, only a single process (e.g. rank=0) should call this routine. With parallelization each process might hold a different vector of full synthetic observations. In this case each process should call this routine with a distinct file name.
     26
     27
     28
     29== write_syn_obs ==
     30
     31This routine writes the full vector of synthetic observations into the file. It is usually called in ```get_obs_f_pdaf``` when observations are generated with PDAF.
     32
     33The interface is the following:
     34{{{
     35SUBROUTINE write_syn_obs(step, file_obs, dim_obs_f, observation_f, screen)
     36}}}
     37with
     38 * `step` : `integer, intent(in)`[[BR]] Current time step
     39 * `file_obs` : `character(len=*), intent(in)`[[BR]] Name of the file
     40 * `dim_obs_f` : `integer, intent(in)`[[BR]] Dimension of full observation vector
     41 * `observation_f` : `real, intent(in), dimsion(dim_obs_f)`[[BR]] Full vector of synthetic observations to be writting into file
     42 * `screen` : `integer, intent(in)`[[BR]] Flag whether the routine should write screen output: (>0) for output
     43
     44Hints:
     45 * If the full vector of synthetic observations is identical for each process in a parallel configuration, only a single process (e.g. rank=0) should call this routine. With parallelization each process might hold a different vector of full synthetic observations. In this case each process should call this routine with a distinct file name and observation vector
     46 * The routine has an internal counter for the index at which a vector is written into the file. This counter is independent for each process and is incremented each time the routine is called.
     47
     48== read_syn_obs ==
     49
     50This routine reads the full vector of synthetic observations from the file. It is usually called in ```init_dim_obs_f_pdaf``` when a twin experiment is computed.
     51
     52The interface is the following:
     53{{{
     54SUBROUTINE read_syn_obs(file_obs, dim_obs_f, observation_f, offset, screen)
     55}}}
     56with
     57 * `step` : `integer, intent(in)`[[BR]] Current time step
     58 * `file_obs` : `character(len=*), intent(in)`[[BR]] Name of the file
     59 * `dim_obs_f` : `integer, intent(in)`[[BR]] Dimension of full observation vector
     60 * `observation_f` : `real, intent(out), dimsion(dim_obs_f)`[[BR]] Full vector of synthetic observations to be writting into file
     61 * `offset` : `integer, intent(in)`[[BR]] Offset in the file index at which the observation vector sould be read
     62 * `screen` : `integer, intent(in)`[[BR]] Flag whether the routine should write screen output: (>0) for output
     63
     64Hints:
     65 * If the full vector of synthetic observations is identical for each process in a parallel configuration, only a single process (e.g. rank=0) should call this routine. With parallelization each process might hold a different vector of full synthetic observations. In this case each process should call this routine with a distinct file name and observation vector
     66 * The routine has an internal counter for the index at which a vector from the file is read. Thus at the first call, the vector at the index `offset+1` is read. Accordingly, `offset` should be 0 if the observations are read from file index 1 (i.e. the beginning of the file). If one wants to use the observations with an offset, as for example in the example of the Lorenz-96 model, one sets `offset` to the value of this offset.
     67