PUBLIC INTERFACE ~ PUBLIC ROUTINES ~ ERROR MESSAGES

## Module diag_axis_mod

Contact: Seth Underwood
Reviewers:
Change History: WebCVS Log

#### OVERVIEW

`diag_axis_mod` is an integral part of diag_manager_mod. It helps to create axis IDs that are used in register_diag_field.

Users first create axis ID by calling diag_axis_init, then use this axis ID in register_diag_field.

#### OTHER MODULES USED

    mpp_domains_mod
            fms_mod
      diag_data_mod

#### PUBLIC INTERFACE

diag_axis_init:
  Initialize the axis, and return the axis ID.
diag_subaxes_init:
  Create a subaxis on a parent axis.
get_diag_axis:
  Return information about the axis with index ID
get_diag_axis_cart:
  Return the axis cartesian.
get_diag_axis_data:
  Return the axis data.
get_diag_axis_name:
  Return the short name of the axis.
get_diag_axis_domain_name:
  Return the name of the axis' domain
get_axis_length:
  Return the length of the axis.
get_axis_aux:
  Return the auxiliary name for the axis.
get_axis_global_length:
  Return the global length of the axis.
get_tile_count:
  Return the tile count for the axis.
get_domain1d:
  Return the 1D domain.
get_domain2d:
  Return the 2D domain.
get_axes_shift:
  Return the value of the shift.

#### PUBLIC ROUTINES

1. #### diag_axis_init

       INTEGER FUNCTION diag_axis_init (name, data, units, cart_name, long_name, direction, set_name, edges, Domain, Domain2, aux, tile_count)

   DESCRIPTION
     `diag_axis_init` initializes an axis and returns the axis ID that is to be used with `register_diag_field`. This function also increments the axis counter and fills in the axes
   INPUT

     `name` | Short name for axis [CHARACTER(len=*)]
     `data` | Array of coordinate values [REAL, DIMENSION(:)]
     `units` | Units for the axis [CHARACTER(len=*)]
     `cart_name` | Cartesian axis ("X", "Y", "Z", "T") [CHARACTER(len=*)]
     `direction` | Indicates the direction of the axis: Up if +1 Down if -1 Neither up or down if 0 [INTEGER, OPTIONAL] [Default: 0]
     `long_name` | Long name for the axis. [CHARACTER(len=*), OPTIONAL] [Default: name]
     `edges` | Axis ID for the previously defined "edges axis" [INTEGER, OPTIONAL]
     `Domain` | [TYPE(domain1d), OPTIONAL]
     `Domain2` | [TYPE(domain2d), OPTIONAL]
     `aux` | Auxiliary name, can only be `geolon_t` or `geolat_t` [CHARACTER(len=*), OPTIONAL]
     `tile_count` | [INTEGER, OPTIONAL]

2. #### diag_subaxes_init

       INTEGER FUNCTION diag_subaxes_init (axis, subdata, start_indx, end_indx, domain_1d, domain_2d)

   DESCRIPTION
     Given the ID of a parent axis, create a subaxis and fill it with data, and return the ID of the corresponding subaxis.
     The subaxis is defined on the parent axis from `start_indx` to `end_indx`.
   INPUT

     `axis` | ID of the parent axis [INTEGER]
     `subdata` | Data of the subaxis [REAL, DIMENSION(:)]
     `start_indx` | Start index of the subaxis [INTEGER]
     `end_indx` | End index of the subaxis [INTEGER]
     `domain_1d` | [TYPE(domain1d), OPTIONAL]
     `domain_2d` | [TYPE(domain2d), OPTIONAL]

3. #### get_diag_axis

       SUBROUTINE get_diag_axis (id, name, units, long_name, cart_name, direction, edges, Domain, data)

   DESCRIPTION
     Return information about the axis with index ID
   INPUT

     `id` | Axis ID [INTEGER]

   OUTPUT

     `name` | Short name for axis [CHARACTER(len=*)]
     `units` | Units for axis [CHARACTER(len=*)]
     `long_name` | Long name for axis [CHARACTER(len=*)]
     `cart_name` | Cartesian axis ("x", "y", "z", "t"). [CHARACTER(len=*)]
     `direction` | Direction of data. (See `diag_axis_init` for a description of allowed values) [INTEGER]
     `edges` | Axis ID for the previously defined "edges axis". [INTEGER]
     `Domain` | [TYPE(domain1d)]
     `data` | Array of coordinate values for this axis. [REAL, DIMENSION(:)]

4. #### get_diag_axis_cart

       SUBROUTINE get_diag_axis_cart (id, cart_name)

   DESCRIPTION
     Return the axis cartesian ('X', 'Y', 'Z' or 'T') for the axis ID given.
   INPUT

     `id` | Axis ID [INTEGER]

   OUTPUT

     `cart_name` | Cartesian axis [CHARACTER(len=*)]

5. #### get_diag_axis_data

       SUBROUTINE get_diag_axis_data (id, data)

   DESCRIPTION
     Return the axis data for the axis ID given.
   INPUT

     `id` | Axis ID [INTEGER]

   OUTPUT

     `data` | Axis data [REAL, DIMENSION(:)]

6. #### get_diag_axis_name

       SUBROUTINE get_diag_axis_name (id, name)

   DESCRIPTION
     Return the short name for the axis ID given.
   INPUT

     `id` | Axis ID [INTEGER]

   OUTPUT

     `name` | Axis short name [CHARACTER(len=*)]

7. #### get_diag_axis_domain_name

       SUBROUTINE get_diag_axis_domain_name (id, name)

   DESCRIPTION
     Retruns the name of the axis' domain.
   INPUT

     `id` | Axis ID [INTEGER]

   OUTPUT

     `name` | Axis' domain name [CHARACTER(len=*)]

8. #### get_axis_length

       INTEGER FUNCTION get_axis_length (id)

   DESCRIPTION
     Return the length of the axis ID given.
   INPUT

     `id` | Axis ID [INTEGER]

9. #### get_axis_aux

       CHARACTER(len=128) FUNCTION get_axis_aux (id)

   DESCRIPTION
     Returns the auxiliary name for the axis. The only possible values for the auxiliary names is `geolon_t` or `geolat_t`.
   INPUT

     `id` | Axis ID [INTEGER]

10. #### get_axis_global_length

        INTEGER FUNCTION get_axis_global_length (id)

    DESCRIPTION
      Returns the global length of the axis ID given.
    INPUT

      `id` | Axis ID [INTEGER]

11. #### get_tile_count

        INTEGER FUNCTION get_tile_count (ids)

    DESCRIPTION
      Return the tile count for the axis IDs given.
    INPUT

      `ids` | Axis IDs. Possible dimensions: 1 <= `size(ids(:))` <= 4. [INTEGER, DIMENSION(:)]

12. #### get_domain1d

        TYPE(domain1d) FUNCTION get_domain1d (id)

    DESCRIPTION
      Retrun the 1D domain for the axis ID given.
    INPUT

      `id` | Axis ID [INTEGER]

13. #### get_domain2d

        TYPE(domain2d) FUNCTION get_domain2d (ids)

    DESCRIPTION
      Return the 2D domain for the axis IDs given.
    INPUT

      `ids` | Axis IDs. Possible dimensions: 1 <= `size(ids(:))` <= 4. [INTEGER, DIMENSION(:)]

14. #### get_axes_shift

        SUBROUTINE get_axes_shift (ids, ishift, jshift)

    DESCRIPTION
      Return the value of the shift for the axis IDs given.
    INPUT

      `ids` | Axis IDs. Possible dimensions: 1 <= `size(ids(:))` <= 4 [INTEGER, DIMENSION(:)]

    OUTPUT

      `ishift` | X shift value. [INTEGER]
      `jshift` | Y shift value. [INTEGER]

#### ERROR MESSAGES

FATAL in diag_axis_init
  num_axis_sets (<num_axis_sets>) exceeds max_num_axis_sets(<num_axis_sets>). Increase max_num_axis_sets via diag_manager_nml.
FATAL in diag_axis_init
  axis_name <NAME> and axis_set already exist.
FATAL in diag_axis_init
  max_axes exceeded, increase it via diag_manager_nml
FATAL in diag_axis_init
  Invalid cart_name name.
FATAL in diag_axis_init
  direction must be 0, +1, or -1
FATAL in diag_axis_init
  Presence of both Domain and Domain2 at the same time is prohibited
FATAL in diag_axis_init
  Domain must not be present for an axis which is not in the X or Y direction.
FATAL in diag_axis_init
  Edges axis does not match axis (code <CODE>).
FATAL in diag_axis_init
  Edges axis is not defined.
FATAL in diag_subaxes_init
  max_subaxes (value <VALUE>) is too small. Consider increasing max_subaxes.
FATAL in get_diag_axis
  array data is too small.
FATAL in get_diag_axis_data
  array data is too small
FATAL in get_tile_count
  input argument has incorrect size.
FATAL in get_domain2d
  input argument has incorrect size.

top