FMS
2024.03
Flexible Modeling System
|
An integral part of diag_manager_mod. It helps to create axis IDs that are used in register_diag_field. More...
Data Types | |
interface | diag_axis_add_attribute |
Add an arbitrary attribute and value to the diagnostic axis. More... | |
Functions/Subroutines | |
subroutine | attribute_init_axis (out_axis, err_msg) |
Allocates memory in out_file for the attributes. Will FATAL if err_msg is not included in the subroutine call. More... | |
integer(i4_kind) function, public | axis_compatible_check (id, varname) |
Checks if the axes are compatible. More... | |
logical function, public | axis_is_compressed (id) |
given an axis, returns TRUE if the axis uses compression-by-gathering: that is, if this is an axis for fields on unstructured grid More... | |
subroutine | diag_axis_add_attribute_i1d (diag_axis_id, att_name, att_value) |
subroutine | diag_axis_add_attribute_r1d (diag_axis_id, att_name, att_value) |
subroutine | diag_axis_add_attribute_scalar_c (diag_axis_id, att_name, att_value) |
subroutine | diag_axis_add_attribute_scalar_i (diag_axis_id, att_name, att_value) |
subroutine | diag_axis_add_attribute_scalar_r (diag_axis_id, att_name, att_value) |
subroutine | diag_axis_attribute_init (diag_axis_id, name, type, cval, ival, rval) |
integer function, public | diag_axis_init (name, array_data, units, cart_name, long_name, direction, set_name, edges, Domain, Domain2, DomainU, aux, req, tile_count, domain_position) |
Initialize the axis, and return the axis ID. More... | |
integer function, public | diag_subaxes_init (axis, subdata, start_indx, end_indx, domain_2d) |
Create a subaxis on a parent axis. More... | |
subroutine, public | get_axes_shift (ids, ishift, jshift) |
Return the value of the shift for the axis IDs given. More... | |
character(len=128) function, public | get_axis_aux (id) |
Return the auxiliary name for the axis. More... | |
integer function, public | get_axis_global_length (id) |
Return the global length of the axis. More... | |
integer function, public | get_axis_length (id) |
Return the length of the axis. More... | |
integer function, public | get_axis_num (axis_name, set_name) |
Returns index into axis table corresponding to a given axis name. More... | |
character(len=128) function, public | get_axis_reqfld (id) |
Return the required field names for the axis. More... | |
integer function | get_axis_set_num (set_name) |
Returns index in axis set table corresponding to a given axis set name. More... | |
subroutine, public | get_compressed_axes_ids (id, r) |
given an index of compressed-by-gathering axis, return an array of axes used in compression. It is a fatal error to call it on axis that is not compressed | |
subroutine, public | get_diag_axis (id, name, units, long_name, cart_name, direction, edges, Domain, DomainU, array_data, num_attributes, attributes, domain_position) |
Return information about the axis with index ID. More... | |
subroutine, public | get_diag_axis_cart (id, cart_name) |
Return the axis cartesian. More... | |
subroutine, public | get_diag_axis_data (id, axis_data) |
Return the axis data. More... | |
subroutine, public | get_diag_axis_domain_name (id, name) |
Return the name of the axis' domain. More... | |
subroutine, public | get_diag_axis_name (id, axis_name) |
Return the short name of the axis. More... | |
type(domain1d) function, public | get_domain1d (id) |
Retrun the 1D domain for the axis ID given. More... | |
type(domain2d) function, public | get_domain2d (ids) |
Return the 2D domain for the axis IDs given. More... | |
type(domainug) function, public | get_domainug (id) |
Retrun the 1D domain for the axis ID given. More... | |
integer function, public | get_tile_count (ids) |
Return the tile count for the axis. More... | |
subroutine | prepend_attribute_axis (out_axis, att_name, prepend_value, err_msg) |
Prepends the attribute value to an already existing attribute. If the attribute isn't yet defined, then creates a new attribute. More... | |
subroutine | valid_id_check (id, routine_name) |
Check to see if the given axis id is a valid id. If the axis id is invalid, call a FATAL error. If the ID is valid, just return. More... | |
Variables | |
type(diag_axis_type), dimension(:), allocatable, save | axes |
global storage for all defined axes | |
character(len=128), dimension(:), allocatable, save | axis_sets |
storage for axis set names | |
integer(i4_kind), parameter, public | diag_axis_2ddomain = 1 |
For unstructured grid support. | |
integer(i4_kind), parameter, public | diag_axis_ugdomain = 2 |
For unstructured grid support. | |
logical | module_is_initialized = .FALSE. |
integer | num_axis_sets = 0 |
integer | num_def_axes = 0 |
integer, dimension(:), allocatable | num_subaxes |
counter of number of axes defined | |
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.
interface diag_axis_mod::diag_axis_add_attribute |
Add an arbitrary attribute and value to the diagnostic axis.
Any number of attributes can be added to a given axis. All attribute addition must be done before first send_data
call.
If a real or integer attribute is already defined, a FATAL error will be called. If a character attribute is already defined, then it will be prepended to the existing attribute value.
Example usage:
Definition at line 89 of file diag_axis.F90.
|
private |
Allocates memory in out_file for the attributes. Will FATAL
if err_msg is not included in the subroutine call.
[in,out] | out_axis | output file to allocate memory for attribute |
[out] | err_msg | Error message, passed back to calling function |
Definition at line 1122 of file diag_axis.F90.
integer(i4_kind) function, public diag_axis_mod::axis_compatible_check | ( | integer, dimension(:), intent(in) | id, |
character(*), intent(in), optional | varname | ||
) |
Checks if the axes are compatible.
[in] | id | The array of axis IDs |
[in] | varname | The name of the variable |
Definition at line 744 of file diag_axis.F90.
logical function, public diag_axis_mod::axis_is_compressed | ( | integer, intent(in) | id | ) |
given an axis, returns TRUE if the axis uses compression-by-gathering: that is, if this is an axis for fields on unstructured grid
Definition at line 1241 of file diag_axis.F90.
|
private |
[in] | diag_axis_id | input field ID, obtained from diag_axis_mod::diag_axis_init. |
name | Name of the attribute | |
[in] | type | NetCDF type (NF_FLOAT, NF_INT, NF_CHAR) |
[in] | cval | Character string attribute value |
[in] | ival | Integer attribute value(s) |
[in] | rval | Real attribute value(s) |
Definition at line 900 of file diag_axis.F90.
integer function, public diag_axis_mod::diag_axis_init | ( | character(len=*), intent(in) | name, |
class(*), dimension(:), intent(in) | array_data, | ||
character(len=*), intent(in) | units, | ||
character(len=*), intent(in) | cart_name, | ||
character(len=*), intent(in), optional | long_name, | ||
integer, intent(in), optional | direction, | ||
character(len=*), intent(in), optional | set_name, | ||
integer, intent(in), optional | edges, | ||
type(domain1d), intent(in), optional | Domain, | ||
type(domain2d), intent(in), optional | Domain2, | ||
type(domainug), intent(in), optional | DomainU, | ||
character(len=*), intent(in), optional | aux, | ||
character(len=*), intent(in), optional | req, | ||
integer, intent(in), optional | tile_count, | ||
integer, intent(in), optional | domain_position | ||
) |
Initialize the axis, and return the axis ID.
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
[in] | name | Short name for axis |
[in] | array_data | Array of coordinate values |
[in] | units | Units for the axis |
[in] | cart_name | Cartesian axis ("X", "Y", "Z", "T") |
[in] | long_name | Long name for the axis. |
[in] | direction | Indicates the direction of the axis |
[in] | edges | Axis ID for the previously defined "edges axis" |
[in] | aux | Auxiliary name, can only be geolon_t or geolat_t |
[in] | req | Required field names. |
Definition at line 109 of file diag_axis.F90.
integer function, public diag_axis_mod::diag_subaxes_init | ( | integer, intent(in) | axis, |
real, dimension(:), intent(in) | subdata, | ||
integer, intent(in) | start_indx, | ||
integer, intent(in) | end_indx, | ||
type(domain2d), intent(in), optional | domain_2d | ||
) |
Create a subaxis on a parent axis.
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
.
[in] | axis | ID of the parent axis |
[in] | subdata | Data of the subaxis |
[in] | start_indx | Start index of the subaxis |
[in] | end_indx | End index of the subaxis |
Definition at line 382 of file diag_axis.F90.
subroutine, public diag_axis_mod::get_axes_shift | ( | integer, dimension(:), intent(in) | ids, |
integer, intent(out) | ishift, | ||
integer, intent(out) | jshift | ||
) |
Return the value of the shift for the axis IDs given.
[out] | ishift | X shift value. |
[out] | jshift | Y shift value. |
Definition at line 822 of file diag_axis.F90.
character(len=128) function, public diag_axis_mod::get_axis_aux | ( | integer, intent(in) | id | ) |
Return the auxiliary name for the axis.
[in] | id | Axis ID |
Definition at line 631 of file diag_axis.F90.
integer function, public diag_axis_mod::get_axis_global_length | ( | integer, intent(in) | id | ) |
Return the global length of the axis.
[in] | id | Axis ID |
Definition at line 649 of file diag_axis.F90.
integer function, public diag_axis_mod::get_axis_length | ( | integer, intent(in) | id | ) |
Return the length of the axis.
[in] | id | Axis ID |
Definition at line 611 of file diag_axis.F90.
integer function, public diag_axis_mod::get_axis_num | ( | character(len=*), intent(in) | axis_name, |
character(len=*), intent(in), optional | set_name | ||
) |
Returns index into axis table corresponding to a given axis name.
[in] | axis_name | Axis name |
[in] | set_name | Set name |
Definition at line 846 of file diag_axis.F90.
character(len=128) function, public diag_axis_mod::get_axis_reqfld | ( | integer, intent(in) | id | ) |
Return the required field names for the axis.
[in] | id | Axis ID |
Definition at line 640 of file diag_axis.F90.
|
private |
Returns index in axis set table corresponding to a given axis set name.
[in] | set_name | Set name |
Definition at line 868 of file diag_axis.F90.
subroutine, public diag_axis_mod::get_diag_axis | ( | integer, intent(in) | id, |
character(len=*), intent(out) | name, | ||
character(len=*), intent(out) | units, | ||
character(len=*), intent(out) | long_name, | ||
character(len=*), intent(out) | cart_name, | ||
integer, intent(out) | direction, | ||
integer, intent(out) | edges, | ||
type(domain1d), intent(out) | Domain, | ||
type(domainug), intent(out) | DomainU, | ||
class(*), dimension(:), intent(out) | array_data, | ||
integer, intent(out), optional | num_attributes, | ||
type(diag_atttype), dimension(:), intent(out), optional, allocatable | attributes, | ||
integer, intent(out), optional | domain_position | ||
) |
Return information about the axis with index ID.
[in] | id | Axis ID |
[out] | direction | Direction of data. (See diag_axis_init for a description of allowed values) |
[out] | edges | Axis ID for the previously defined "edges axis". |
[out] | array_data | Array of coordinate values for this axis. |
Definition at line 466 of file diag_axis.F90.
subroutine, public diag_axis_mod::get_diag_axis_cart | ( | integer, intent(in) | id, |
character(len=*), intent(out) | cart_name | ||
) |
Return the axis cartesian.
[in] | id | Axis ID |
[out] | cart_name | Cartesian axis |
Definition at line 565 of file diag_axis.F90.
subroutine, public diag_axis_mod::get_diag_axis_data | ( | integer, intent(in) | id, |
real, dimension(:), intent(out) | axis_data | ||
) |
Return the axis data.
[in] | id | Axis ID |
[out] | axis_data | Axis data |
Definition at line 574 of file diag_axis.F90.
subroutine, public diag_axis_mod::get_diag_axis_domain_name | ( | integer, intent(in) | id, |
character(len=*), intent(out) | name | ||
) |
Return the name of the axis' domain.
[in] | id | Axis ID |
[out] | name | Axis' domain name |
Definition at line 601 of file diag_axis.F90.
subroutine, public diag_axis_mod::get_diag_axis_name | ( | integer, intent(in) | id, |
character(len=*), intent(out) | axis_name | ||
) |
Return the short name of the axis.
[in] | id | Axis ID |
[out] | axis_name | Axis short name |
Definition at line 588 of file diag_axis.F90.
type(domain1d) function, public diag_axis_mod::get_domain1d | ( | integer, intent(in) | id | ) |
Retrun the 1D domain for the axis ID given.
[in] | id | Axis ID |
Definition at line 685 of file diag_axis.F90.
type(domain2d) function, public diag_axis_mod::get_domain2d | ( | integer, dimension(:), intent(in) | ids | ) |
Return the 2D domain for the axis IDs given.
[in] | ids | Axis IDs. Possible dimensions: 1 <= size(ids(:)) <= 4. |
Definition at line 698 of file diag_axis.F90.
type(domainug) function, public diag_axis_mod::get_domainug | ( | integer, intent(in) | id | ) |
Retrun the 1D domain for the axis ID given.
[in] | id | Axis ID |
Definition at line 730 of file diag_axis.F90.
integer function, public diag_axis_mod::get_tile_count | ( | integer, dimension(:), intent(in) | ids | ) |
Return the tile count for the axis.
[in] | ids | Axis IDs. Possible dimensions: 1 <= size(ids(:)) <= 4. |
Definition at line 658 of file diag_axis.F90.
|
private |
Prepends the attribute value to an already existing attribute. If the attribute isn't yet defined, then creates a new attribute.
[in,out] | out_axis | diagnostic axis that will get the attribute |
[in] | att_name | Name of the attribute |
[in] | prepend_value | Value to prepend |
[out] | err_msg | Error message, passed back to calling routine |
Definition at line 1151 of file diag_axis.F90.
|
private |
Check to see if the given axis id is a valid id. If the axis id is invalid, call a FATAL error. If the ID is valid, just return.
[in] | id | Axis is to check for validity |
[in] | routine_name | Name of the subroutine checking for a valid axis id |
Definition at line 884 of file diag_axis.F90.