MODULE indexListDepot_mod (prefix=’ild’ category=’7. Low-level data objects and utilities’)
Purpose
The raison d’etre of this module is to support ObsSpaceData_mod in
facilitating the traversal of a selection of the rows in its table.
The selection of rows could be from either the header table or the
body table. ObsSpaceData_mod currently populates the list with one
of:
all header members of a given family
all body members of a given family
all body members of a given header row index
Usage
An ObsSpaceData_mod client must first call either
obs_set_current_body_list or obs_set_current_header_list, specifying
either the family of interest or the header row index of interest.
This does not return the list directly to the caller, but rather writes
the list, as a struct_index_list, to the private contents of the obs
oject that is returned to the caller but which cannot be examined by the
caller. Two lists can be active simultaneously: one header list and
one body list.
In order to access the indices that are in the list, the
ObsSpaceData_mod client must call either obs_getHeaderIndex or
obs_getBodyIndex, giving the ObsSpaceData object as the only argument.
On each call, one index is returned. On calls after the last index in
the list, a value of -1 is returned.
This is not a fully fledged module. It is better described as a
structure definition with a couple of helpful methods. It is intended
that the client, ObsSpaceData_mod, read/write directly from/to instances
of these structures.
From the given depot, return an index-list structure that contains
no data, as a pointer.
In other words, clear data from the (cyclicly) next (i.e. oldest)
list and return a pointer to it.
If the list is being used within an OMP block, the ObsSpaceData
client is responsible for holding a pointer to its own list. This
is supplied as the parameter, private_list_opt.
Arguments
depot [struct_index_list_depot ,inout,target] :: the depot containing the list
Options
private_list_opt [struct_index_list ,inout,pointer] :: used instead of depot (for OMP blocks)
Return
empty_index_list [struct_index_list ,pointer] :: the returned list