PUBLIC INTERFACE ~ PUBLIC DATA ~ PUBLIC ROUTINES

## Module diag_data_mod

Contact: Seth Underwood
Reviewers:
Change History: WebCVS Log

#### OVERVIEW

Type descriptions and global variables for the diag_manager modules.

Notation:

input field
  The data structure describing the field as registered by the model code.
output field
  The data structure describing the actual diagnostic output with requested frequency and other options.

Input fields, output fields, and output files are gathered in arrays called "input_fields", "output_fields", and "files", respectively. Indices in these arrays are used as pointers to create associations between various data structures.
Each input field associated with one or several output fields via array of indices output_fields; each output field points to the single "parent" input field with the input_field index, and to the output file with the output_file index

#### OTHER MODULES USED

    time_manager_mod
     mpp_domains_mod
          mpp_io_mod
             fms_mod
              netcdf

#### PUBLIC INTERFACE

#### PUBLIC DATA

Name | Type | Value | Units | Description
--- | --- | --- | --- | ---
MAX_FIELDS_PER_FILE | INTEGER, PARAMETER | 300 | --- | Maximum number of fields per file.
MAX_OUT_PER_IN_FIELD | INTEGER, PARAMETER | 150 | --- | Maximum number of output_fields per input_field.
DIAG_OTHER | INTEGER, PARAMETER | 0 | --- | ---
DIAG_OCEAN | INTEGER, PARAMETER | 1 | --- | ---
DIAG_ALL | INTEGER, PARAMETER | 2 | --- | ---
VERY_LARGE_FILE_FREQ | INTEGER, PARAMETER | 100000 | --- | ---
VERY_LARGE_AXIS_LENGTH | INTEGER, PARAMETER | --- | --- | ---
EVERY_TIME | INTEGER, PARAMETER | 0 | --- | ---
END_OF_RUN | INTEGER, PARAMETER | -1 | --- | ---
DIAG_SECONDS | INTEGER, PARAMETER | 1 | --- | ---
DIAG_MINUTES | INTEGER, PARAMETER | 2 | --- | ---
DIAG_HOURS | INTEGER, PARAMETER | 3 | --- | ---
DIAG_DAYS | INTEGER, PARAMETER | 4 | --- | ---
DIAG_MONTHS | INTEGER, PARAMETER | 5 | --- | ---
DIAG_YEARS | INTEGER, PARAMETER | 6 | --- | ---
MAX_SUBAXES | INTEGER, PARAMETER | 10 | --- | ---
CMOR_MISSING_VALUE | REAL, PARAMETER | 1.0e20 | --- | ---
num_files | INTEGER | 0 | --- | Number of output files currenly in use by the diag_manager.
num_input_fields | INTEGER | 0 | --- | Number of input fields in use.
num_output_fields | INTEGER | 0 | --- | Number of output fields in use.
null_axis_id | INTEGER | --- | --- | ---
append_pelist_name | LOGICAL | .FALSE. | --- | ---
mix_snapshot_average_fields | LOGICAL | .FALSE. | --- | ---
max_files | INTEGER | 31 | --- | Maximum number of output files allowed. Increase via the diag_manager_nml namelist.
max_output_fields | INTEGER | 300 | --- | Maximum number of output fields. Increase via the diag_manager_nml namelist.
max_input_fields | INTEGER | 300 | --- | Maximum number of input fields. Increase via the diag_manager_nml namelist.
max_axes | INTEGER | 60 | --- | Maximum number of independent axes.
do_diag_field_log | LOGICAL | .FALSE. | --- | ---
write_bytes_in_file | LOGICAL | .FALSE. | --- | ---
debug_diag_manager | LOGICAL | .FALSE. | --- | ---
max_num_axis_sets | INTEGER | 25 | --- | ---
use_cmor | LOGICAL | .FALSE. | --- | Indicates if we should overwrite the MISSING_VALUE to use the CMOR missing value.
ISSUE_OOR_WARNINGS | LOGICAL | .TRUE. | --- | Issue warnings if the output field has values outside the given range for a variable.
OOR_WARNINGS_FATAL | LOGICAL | .FALSE. | --- | Cause a fatal error if the output field has a value outside the given range for a variable.
FILL_VALUE | REAL | NF90_FILL_REAL | --- | Fill value used. Value will be if using the netCDF module, otherwise will be 9.9692099683868690e+36.
EMPTY | REAL | 0.0 | --- | ---
MAX_VALUE | REAL | --- | --- | ---
MIN_VALUE | REAL | --- | --- | ---
base_time | TYPE(time_type) | --- | --- | ---
base_year | INTEGER | --- | --- | ---
base_month | INTEGER | --- | --- | ---
base_day | INTEGER | --- | --- | ---
base_hour | INTEGER | --- | --- | ---
base_minute | INTEGER | --- | --- | ---
base_second | INTEGER | --- | --- | ---
global_descriptor | CHARACTER(len=256) | --- | --- | ---
files | TYPE(file_type), DIMENSION(:), SAVE, ALLOCATABLE | --- | --- | ---
input_fields | TYPE(input_field_type), DIMENSION(:), ALLOCATABLE | --- | --- | ---
output_fields | TYPE(output_field_type), DIMENSION(:), ALLOCATABLE | --- | --- | ---
time_zero | TYPE(time_type) | --- | --- | ---
first_send_data_call | LOGICAL | .TRUE. | --- | ---
module_is_initialized | LOGICAL | .FALSE. | --- | ---
diag_log_unit | INTEGER | --- | --- | ---
time_unit_list | CHARACTER(len=10), DIMENSION(6) | (/'seconds ', 'minutes ', 'hours ', 'days ', 'months ', 'years '/) | --- | ---
filename_appendix | CHARACTER(len=32) |  | --- | ---
pelist_name | CHARACTER(len=32) | --- | --- | ---

#### PUBLIC ROUTINES

#### PUBLIC TYPES

diag_grid

Contains the coordinates of the local domain to output.
`start`

Start coordinates (Lat, Lon, Depth) of the local domain to output.
[REAL, DIMENSION(3)]

`end`

End coordinates (Lat, Lon, Depth) of the local domain to output.
[REAL, DIMENSION(3)]

`l_start_indx`

Start indices at each local PE.
[INTEGER, DIMENSION(3)]

`l_end_indx`

End indices at each local PE.
[INTEGER, DIMENSION(3)]

`subaxes`

ID returned from diag_subaxes_init of 3 subaces.
[INTEGER, DIMENSION(3)]

diag_fieldtype

Diagnostic field type
`Field`

[TYPE(fieldtype)]

`Domain`

[TYPE(domain2d)]

`miss`

[REAL]

`miss_pack`

[REAL]

`miss_present`

[LOGICAL]

`miss_pack_present`

[LOGICAL]

`tile_count`

[INTEGER]

coord_type

Define the region for field output.
`xbegin`

[REAL]

`xend`

[REAL]

`ybegin`

[REAL]

`yend`

[REAL]

`zbegin`

[REAL]

`zend`

[REAL]

file_type

Type to define the diagnostic files that will be written as defined by the diagnostic table.
`name`

Name of the output file.
[CHARACTER(len=128)]

`long_name`

[CHARACTER(len=128)]

`fields`

[INTEGER, dimension(max_fields_per_file)]

`num_fields`

[INTEGER]

`output_freq`

[INTEGER]

`output_units`

[INTEGER]

`format`

[INTEGER]

`time_units`

[INTEGER]

`file_unit`

[INTEGER]

`bytes_written`

[INTEGER]

`time_axis_id`

[INTEGER]

`time_bounds_id`

[INTEGER]

`new_file_freq`

Frequency to create a new file.
[INTEGER]

`new_file_freq_units`

Time units of new_file_freq ( days, hours, years, ...)
[INTEGER]

`duration`

[INTEGER]

`duration_units`

[INTEGER]

`tile_count`

[INTEGER]

`local`

[LOGICAL]

`last_flush`

[TYPE(time_type)]

`next_open`

Time to open next file.
[TYPE(time_type)]

`start_time`

Time file opened
[TYPE(time_type)]

`close_time`

Time file closed. File does not allow data after close time
[TYPE(time_type)]

`f_avg_start`

[TYPE(diag_fieldtype)]

`f_avg_end`

[TYPE(diag_fieldtype)]

`f_avg_nitems`

[TYPE(diag_fieldtype)]

`f_bounds`

[TYPE(diag_fieldtype)]

input_field_type

Type to hold the input field description
`module_name`

[CHARACTER(len=128)]

`field_name`

[CHARACTER(len=128)]

`long_name`

[CHARACTER(len=128)]

`units`

[CHARACTER(len=128)]

`standard_name`

[CHARACTER(len=128)]

`interp_method`

[CHARACTER(len=64)]

`axes`

[INTEGER, DIMENSION(3)]

`num_axes`

[INTEGER]

`missing_value_present`

[LOGICAL]

`range_present`

[LOGICAL]

`missing_value`

[REAL]

`range`

[REAL, DIMENSION(2)]

`output_fields`

[INTEGER, DIMENSION(max_out_per_in_field)]

`num_output_fields`

[INTEGER]

`size`

[INTEGER, DIMENSION(3)]

`static`

[LOGICAL]

`register`

[LOGICAL]

`mask_variant`

[LOGICAL]

`local`

[LOGICAL]

`tile_count`

[INTEGER]

`local_coord`

[TYPE(coord_type)]

output_field_type

Type to hold the output field description.
`input_field`

Index of the corresponding input field in the table
[INTEGER]

`output_file`

Index of the output file in the table
[INTEGER]

`output_name`

[CHARACTER(len=128)]

`static`

[LOGICAL]

`time_max`

.TRUE. if the output field is maximum over time interval
[LOGICAL]

`time_min`

.TRUE. if the output field is minimum over time interval
[LOGICAL]

`time_average`

.TRUE. if the output field is averaged over time interval.
[LOGICAL]

`time_ops`

.TRUE. if any of time_min, time_max, or time_average is true
[LOGICAL]

`pack`

[INTEGER]

`time_method`

Time method field from the input file
[CHARACTER(len=50)]

`buffer`

Coordinates of buffer are (x, y, z, time-of-day)
[REAL, _ALLOCATABLE, DIMENSION(:,:,:,:), default: _NULL]

`counter`

Coordinates of buffer are (x, y, z, time-of-day)
[REAL, _ALLOCATABLE, DIMENSION(:,:,:,:), default: _NULL]

`count_0d`

[REAL, _ALLOCATABLE, DIMENSION(:)]

`num_elements`

[REAL, _ALLOCATABLE, DIMENSION(:)]

`last_output`

[TYPE(time_type)]

`next_output`

[TYPE(time_type)]

`next_next_output`

[TYPE(time_type)]

`f_type`

[TYPE(diag_fieldtype)]

`axes`

[INTEGER, DIMENSION(4)]

`num_axes`

[INTEGER]

`total_elements`

[INTEGER]

`region_elements`

[INTEGER]

`n_diurnal_samples`

Number of diurnal sample intervals, 1 or more
[INTEGER]

`output_grid`

[TYPE(diag_grid)]

`local_output`

.TRUE. if this field is written out on a region and not globally.
[LOGICAL]

`need_compute`

.TRUE. if this field is written out on a region, not global.
[LOGICAL]

`phys_window`

[LOGICAL]

`written_once`

[LOGICAL]

`reduced_k_range`

.TRUE. if dealing with vertical sub-level output.
[LOGICAL]

`imin`

[INTEGER]

`imax`

[INTEGER]

`jmin`

[INTEGER]

`jmax`

[INTEGER]

`kmin`

[INTEGER]

`kmax`

[INTEGER]

`Time_of_prev_field_data`

[TYPE(time_type)]

diag_axis_type

Type to hold the diagnostic axis description.
`name`

[CHARACTER(len=128)]

`units`

[CHARACTER(len=256)]

`long_name`

[CHARACTER(len=256)]

`cart_name`

[CHARACTER(len=1)]

`data`

[REAL, DIMENSION(:), POINTER]

`start`

[INTEGER, DIMENSION(MAX_SUBAXES)]

`end`

[INTEGER, DIMENSION(MAX_SUBAXES)]

`subaxis_name`

[CHARACTER(len=128), DIMENSION(MAX_SUBAXES)]

`length`

[INTEGER]

`direction`

[INTEGER]

`edges`

[INTEGER]

`set`

[INTEGER]

`shift`

[INTEGER]

`Domain`

[TYPE(domain1d)]

`Domain2`

[TYPE(domain2d)]

`subaxis_domain2`

[TYPE(domain2d), dimension(MAX_SUBAXES)]

`aux`

[CHARACTER(len=128)]

`tile_count`

[INTEGER]

diag_global_att_type

`grid_type`

[CHARACTER(len=128), default: regular]

`tile_name`

[CHARACTER(len=128), default: N/A]

top