MODULE obsSubSpaceData_mod (prefix=’oss’ category=’6. High-level data objects’)
Purpose
Repository of obs space structures, arrays, and routines specific
to obs data pertinent to subspaces of the overall ObsSpaceData.
Most tools are independent of ObsSpaceData and can be used by
themselves for the users’ application(s).
Allocates memory for structure struct_oss_obsdata to hold obs data file information.
If dim2 is specified, then the data array associated with each observation/report
will be 2D array. will be a 1D array if dim2 is not specified.
Arguments
Arguments
obsdata [struct_oss_obsdata ,inout] :: data structure to allocate
nrep [integer ,in] :: max number of associated observations/reports for data
dim1 [integer ,in] :: first dimension length of the array associated to each observation/report
:dim2: second dimension length of the array associated to each observation/report (optional)
Sets the position variable (irep) in struct_oss_obsdata to reference the record
that matches the input identifying code.
Arguments
Arguments
obsdata [struct_oss_obsdata ,inout] :: irep: current index position for the observation/report
:index: obs index
code [character ,in] :: code for comparison to those in obsdata
obsdata :: irep: current index position for the observation/report
Options
stat_opt [integer ,out,] :: status of call (optional)
:0: no errors
:1: no reports available
:2: report not found
Comments
If the optional argument stat_opt is provided and an error occurs, the error code will
be returned and the abort will not be called to allow for error handling.
Test matching of code values accounting for rare differences
in stored lat (and lon) value(s) when codes are stored as strings in the form
LAT–LON–YYYYMMDDHHMM* (ie. with >= oss_code_sublen characters).
Caveat
The current version assumes the only source of difference would stem from
a shift to the nearest latitude of the analysis grid from points near the pole.
(this source of difference identified by M. Sitwell)
Also currently assumes that most poleward analysis grid latitudes are within 1 degree
away from a pole.
Arguments
Arguments
test_code [character ,in] :: code for comparison to ref_code
ref_lat [integer ,in] :: latitude (x100) part of reference code
ref_code [character ,in] :: reference code
Return
found [logical ] :: logical indicating if a match has been found.
functionobssubspacedata_mod/obsdata_get_header_code_i(ilon, ilat, date, time, stnid)¶
Purpose
Generates a string code to identify an obervation by the header information in
a BURP report. The BURP header information is saved as a string in the form
LAT–LON–YYYYMMDDHHMMSTNID—-. Intention of this function is to be used for
setting the unique identifier ‘code’ in struct_oss_obsdata. Can be called under
the interface oss_obsdata_get_header_code.
functionobssubspacedata_mod/obsdata_get_header_code_r(lon, lat, date, time, stnid)¶
Purpose
Generates a string code to identify an obervation by the header information in
a BURP report. The BURP header information is saved as a string in the form
LAT–LON–YYYYMMDDHHMMSTNID—-. Intention of this function is to be used for
setting the unique identifier ‘code’ in struct_oss_obsdata. Can be called under
the interface oss_obsdata_get_header_code.
val (*) [real ,in] :: data array to store in obsdata%data1d
code [character ,in] :: identifying code based on (lat,long,date,hhmm) if not also stnid
maxsize [integer ,in] :: max allowed size for obsdata
dim1 value() dimension (optional)
obsdata :: Updated obsdata
Comments
Retrieval of values from obsdata%data1d to be done via oss_obsdata_get_element (or oss_obsdata_get_array1d).
If obsdata allocation is required for all processors (such as for use later with obsdata_MPIGather),
allocation and/or initialization of arrays needs to be done at a corresponding appropriate location
outside the obs operations such as in oss_setup to ensure allocation is done for all processors,
including those without associated data. This is to ensure that rpn_comm_allgather will work
in routine obsdata_MPIGather.
Uses the subroutine oss_comboIdlist to compile a unique list of stnid,
(stnid,varno) or (stnid,varno,multi/uni-level) combinations to be used in searches.
Arguments
obsSpaceData
Observation space data
Arguments
stnid_list (100) [character ,out] :: List of unique stnids
varno_list (100) [integer ,out] :: List of unique varno
unilev_list (100) [logical ,out] :: List of unique uni/multi-level identifications
num_elements [integer ,out] :: Number of unique elements in *_list arrrays
nset [integer ,out] ::
Integer indicating grouping, with values indicating
Provide list of fixed or accumulated stnid, (stnid,varno) or
(stnid,varno,multi/uni-level) combinations to be used in searches.
Can be used for both single processor and MPI mode, where ‘gather_mpi’ must be set
to .true. at some point for use with MPI.
Called from osd_chem_diagnmostics in file obspacediag_mod.ftn90.
Arguments
Options
stnid_add_opt [character ,in,] :: stnid to add to stnid_list if part of unique set
varno_add_opt [integer ,in,] :: varno to add to varno_list if part of unique set
unilev_add_opt [logical ,in,] :: unilev logical to add to unilev_list if part of unique set
initialize_opt [logical ,in,] :: Initialize internal arrays and counters
gather_mpi_opt [logical ,in,] :: Gather all local MPI process and recompile unique lists
nset_opt [integer ,inout,] ::
Integer indicating grouping of diagnostics. Input variable
if initialize=.true., output variable otherwise.
Values indicate
1: group by stnid
2: group by (stnid,bufr)
3: group by (stnid,bufr,multi/uni-level)
all combos_opt
Indicates if all combinations specified by nset are to
be use, or only those specified in the namelist NAMCHEM
Input variable if initialize=.true., output variable otherwise.
stnid_list_opt (100) [character ,out,] :: List of unique stnids
varno_list_opt (100) [integer ,out,] :: List of unique varno
unilev_list_opt (100) [logical ,out,] :: List of unique uni/multi-level identifications
num_elements_opt [integer ,out,] :: Number of unique elements in *_list arrrays