IndexListDepot_mod

link to source code

Dependency Diagrams:

No Direct Dependency

IndexListDepot_mod_rev.svg

Reverse Dependency Diagram

Description

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.

Quick access

Types

struct_index_list, struct_index_list_depot

Variables

ild_get_next_index, number_of_lists

Routines

ild_finalize(), ild_get_empty_index_list(), ild_get_next_index_depot(), ild_get_next_index_private(), ild_initialize()

Types

  • type  indexlistdepot_mod/struct_index_list

    a list of integers, not to say indices into a struct_obs

    Type fields
    • % current_element [integer ] :: the element that has just been returned

    • % family [character ] :: current_element’s belong to this family

    • % header [integer ] :: current_element’s belong to this header

    • % indices (*) [integer ,allocatable]

  • type  indexlistdepot_mod/struct_index_list_depot

    A collection of lists, either empty or populated the collection of lists

    Type fields
    • % current_list [struct_index_list ,pointer]

    • % index_lists (number_of_lists) [struct_index_list ]

    • % list_last_attributed [integer ] :: list that was populated most recently

Variables

  • indexlistdepot_mod/ild_get_next_index [public]

    return the next element in the list

  • indexlistdepot_mod/number_of_lists [integer,public/parameter]

Subroutines and functions

subroutine  indexlistdepot_mod/ild_finalize(depot)
Purpose

Finalize the indicated list depot

Arguments

depot [struct_index_list_depot ,inout] :: the depot to be finalized

Called from

obs_deallocate()

function  indexlistdepot_mod/ild_get_empty_index_list(depot[, private_list_opt])
Purpose

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

Called from

obs_set_current_body_list_from_family(), obs_set_current_body_list_from_header(), obs_set_current_body_list_all(), obs_set_current_header_list_from_family(), obs_set_current_header_list_all()

function  indexlistdepot_mod/ild_get_next_index_depot(depot[, no_advance_opt])
Purpose

From the given depot, increment the index to the current element, and return the element itself, the new current element.

Arguments

depot [struct_index_list_depot ,inout,target] :: the depot containing the list

Options

no_advance_opt [logical ,in,] :: current_element, just return next one

Return

next_index [integer ] :: the returned index

function  indexlistdepot_mod/ild_get_next_index_private(private_list[, no_advance_opt])
Purpose

From the given list, increment the index to the current element, and return the element itself, the new current element.

Arguments

private_list [struct_index_list ,inout,pointer] :: the list of interest

Options

no_advance_opt [logical ,in,] :: current_element, just return next one

Return

next_index [integer ] :: the returned index

subroutine  indexlistdepot_mod/ild_initialize(depot, numheaderbody_max)
Purpose

Initialize the indicated list depot

Note

indices is allocated with 2 extra elements to make room for the end-of-list flag that is set in obs_set_current_header/body_list

Arguments
  • depot [struct_index_list_depot ,inout] :: the depot to be initialized

  • numheaderbody_max [integer ,in]

Called from

obs_allocate()