FMS  2024.01.00
Flexible Modeling System
diag_util_mod

Functions and subroutines necessary for the diag_manager_mod. More...

Data Types

interface  attribute_init
 Allocates the atttype in out_file. More...
 
interface  prepend_attribute
 Prepend a value to a string attribute in the output field or output file. More...
 

Functions/Subroutines

logical function a_greaterthan_b (a, b)
 return true iff a>b. More...
 
logical function a_lessthan_b (a, b)
 return true iff a<b. More...
 
logical function a_noteq_b (a, b)
 return true iff a /= b More...
 
subroutine attribute_init_field (out_field, err_msg)
 Allocates the atttype in out_field. More...
 
subroutine attribute_init_file (out_file, err_msg)
 Allocates the atttype in out_file. More...
 
subroutine check_and_open (file, time, do_write, filename_time)
 Checks if it is time to open a new file. More...
 
subroutine, public check_bounds_are_exact_dynamic (out_num, diag_field_id, Time, err_msg)
 This is an adaptor to the check_bounds_are_exact_dynamic_modern function to maintain an interface servicing the legacy diag_manager. More...
 
subroutine, public check_bounds_are_exact_static (out_num, diag_field_id, err_msg)
 Check if the array indices for output_fields(out_num) are equal to the output_fields(out_num)buffer upper and lower bounds. More...
 
subroutine, public check_duplicate_output_fields (err_msg)
 Checks to see if output_name and output_file are unique in output_fields. More...
 
subroutine, public check_out_of_bounds (out_num, diag_field_id, err_msg)
 Checks if the array indices for output_fields(out_num) are outside the output_fields(out_num)buffer upper and lower bounds. If there is an error then error message will be filled. More...
 
logical function compare_buffer_bounds_to_size (current_bounds, bounds, error_str, lowerb_comp, upperb_comp)
 Compares the bounding indices of an array specified in "current_bounds" to the corresponding lower and upper bounds specified in "bounds" Comparison is done by the two user specified input functions lowerb_comp and upperb_comp. If any compariosn function returns true, then, after filling error_str, this routine also returns true. The suplied comparison functions should return true for errors : for indices out of bounds, or indices are not equal when expected to be equal. More...
 
subroutine, public diag_data_out (file, field, dat, time, final_call_in, static_write_in, filename_time)
 Write data out to file, and if necessary flush the buffers. More...
 
subroutine, public diag_util_init ()
 Write the version number of this file to the log file.
 
integer function find_file (name, tile_count)
 Return the file number for file name and tile. More...
 
integer function, public find_input_field (module_name, field_name, tile_count)
 Return the field number for the given module name, field name, and tile number. More...
 
subroutine, public fms_diag_check_bounds_are_exact_dynamic (current_bounds, bounds, output_name, module_name, Time, field_prev_Time, err_msg)
 Checks that array indices specified in the bounding box "current_bounds" are identical to those in the bounding box "bounds" match exactly. The check occurs only when the time changed. If there is an error then error message will be filled. More...
 
subroutine, public fms_diag_check_bounds_are_exact_static (current_bounds, bounds, output_name, module_name, err_msg)
 Check if the array indices specified in the bounding box "current_bounds" are equal to those specified in the bounding box "bounds" output_fields are equal to the buffer upper and lower bounds. If there is an error then error message will be filled. More...
 
subroutine fms_diag_check_out_of_bounds_r4 (ofb, bounds, output_name, module_name, err_msg)
 Checks if the array indices for output_fields(out_num) are outside the output_fields(out_num)buffer upper and lower bounds. If there is an error then error message will be filled. More...
 
subroutine fms_diag_check_out_of_bounds_r8 (ofb, bounds, output_name, module_name, err_msg)
 Checks if the array indices for output_field buffer (ofb) are outside the are outside the bounding box (bounds). If there is an error then error message will be filled. More...
 
type(time_type) function, public get_file_start_time (file_num)
 Get the a diag_file's start_time as it is defined in the diag_table. More...
 
integer function get_index (number, array)
 Find index i of array such that array(i) is closest to number.
 
subroutine, public get_subfield_size (axes, outnum)
 Get the size, start, and end indices for output fields. More...
 
subroutine, public get_subfield_vert_size (axes, outnum)
 Get size, start and end indices for output fields. More...
 
subroutine, public init_file (name, output_freq, output_units, format, time_units, long_name, tile_count, new_file_freq, new_file_freq_units, start_time, file_duration, file_duration_units, filename_time_bounds)
 Initialize the output file. More...
 
subroutine, public init_input_field (module_name, field_name, tile_count)
 Initialize the input field. More...
 
subroutine, public init_output_field (module_name, field_name, output_name, output_file, time_method, pack, tile_count, local_coord)
 Initialize the output field. More...
 
subroutine, public log_diag_field_info (module_name, field_name, axes, long_name, units, missing_value, range, dynamic)
 Writes brief diagnostic field info to the log file. More...
 
subroutine opening_file (file, time, filename_time)
 Open file for output, and write the meta data. More...
 
subroutine prepend_attribute_field (out_field, 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 prepend_attribute_file (out_file, 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, public sync_file_times (file_id, init_time, err_msg)
 Synchronize the file's start and close times with the model start and end times. More...
 
subroutine, public update_bounds (out_num, lower_i, upper_i, lower_j, upper_j, lower_k, upper_k)
 Update the output_fields x, y, and z min and max boundaries (array indices) with the six specified bounds values. More...
 
subroutine, public write_static (file)
 Output all static fields in this file. More...
 

Variables

character(len=1), public field_log_separator = '|'
 separator used for csv-style log of registered fields set by nml in diag_manager init
 
logical module_initialized = .FALSE.
 

Detailed Description

Functions and subroutines necessary for the diag_manager_mod.

Author
Seth Underwood

Data Type Documentation

◆ diag_util_mod::attribute_init

interface diag_util_mod::attribute_init

Allocates the atttype in out_file.

Definition at line 98 of file diag_util.F90.

Private Member Functions

subroutine attribute_init_field (out_field, err_msg)
 Allocates the atttype in out_field. More...
 
subroutine attribute_init_file (out_file, err_msg)
 Allocates the atttype in out_file. More...
 

Member Function/Subroutine Documentation

◆ attribute_init_field()

subroutine attribute_init_field ( type(output_field_type), intent(inout)  out_field,
character(len=*), intent(out), optional  err_msg 
)
private

Allocates the atttype in out_field.

Parameters
[in,out]out_fieldoutput field to allocate memory for attribute
[out]err_msgError message, passed back to calling function

Definition at line 2267 of file diag_util.F90.

◆ attribute_init_file()

subroutine attribute_init_file ( type(file_type), intent(inout)  out_file,
character(len=*), intent(out), optional  err_msg 
)
private

Allocates the atttype in out_file.

Parameters
[in,out]out_fileoutput file to allocate memory for attribute
[out]err_msgError message, passed back to calling function

Definition at line 2383 of file diag_util.F90.

◆ diag_util_mod::prepend_attribute

interface diag_util_mod::prepend_attribute

Prepend a value to a string attribute in the output field or output file.

Definition at line 91 of file diag_util.F90.

Private Member Functions

subroutine prepend_attribute_field (out_field, 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 prepend_attribute_file (out_file, 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...
 

Member Function/Subroutine Documentation

◆ prepend_attribute_field()

subroutine prepend_attribute_field ( type(output_field_type), intent(inout)  out_field,
character(len=*), intent(in)  att_name,
character(len=*), intent(in)  prepend_value,
character(len=*), intent(out), optional  err_msg 
)
private

Prepends the attribute value to an already existing attribute. If the attribute isn't yet defined, then creates a new attribute.

Parameters
[in,out]out_fieldoutput field that will get the attribute
[in]att_nameName of the attribute
[in]prepend_valueValue to prepend
[out]err_msgError message, passed back to calling routine

Definition at line 2296 of file diag_util.F90.

◆ prepend_attribute_file()

subroutine prepend_attribute_file ( type(file_type), intent(inout)  out_file,
character(len=*), intent(in)  att_name,
character(len=*), intent(in)  prepend_value,
character(len=*), intent(out), optional  err_msg 
)
private

Prepends the attribute value to an already existing attribute. If the attribute isn't yet defined, then creates a new attribute.

Parameters
[in,out]out_fileoutput file that will get the attribute
[in]att_nameName of the attribute
[in]prepend_valueValue to prepend
[out]err_msgError message, passed back to calling routine

Definition at line 2412 of file diag_util.F90.

Function/Subroutine Documentation

◆ a_greaterthan_b()

logical function diag_util_mod::a_greaterthan_b ( integer, intent(in)  a,
integer, intent(in)  b 
)
private

return true iff a>b.

Parameters
[in]aThe first of the two integer args that are to be compared to each other.
[in]bThe first of the two integer args that are to be compared to each other.

Definition at line 826 of file diag_util.F90.

◆ a_lessthan_b()

logical function diag_util_mod::a_lessthan_b ( integer, intent(in)  a,
integer, intent(in)  b 
)
private

return true iff a<b.

Parameters
[in]aThe first of the two integer args that are to be compared to each other.
[in]bThe first of the two integer args that are to be compared to each other.

Definition at line 819 of file diag_util.F90.

◆ a_noteq_b()

logical function diag_util_mod::a_noteq_b ( integer, intent(in)  a,
integer, intent(in)  b 
)
private

return true iff a /= b

Parameters
[in]aThe first of the two integer args that are to be compared to each other.
[in]bThe first of the two integer args that are to be compared to each other.

Definition at line 833 of file diag_util.F90.

◆ attribute_init_field()

subroutine diag_util_mod::attribute_init_field ( type(output_field_type), intent(inout)  out_field,
character(len=*), intent(out), optional  err_msg 
)
private

Allocates the atttype in out_field.

Parameters
[in,out]out_fieldoutput field to allocate memory for attribute
[out]err_msgError message, passed back to calling function

Definition at line 2267 of file diag_util.F90.

◆ attribute_init_file()

subroutine diag_util_mod::attribute_init_file ( type(file_type), intent(inout)  out_file,
character(len=*), intent(out), optional  err_msg 
)
private

Allocates the atttype in out_file.

Parameters
[in,out]out_fileoutput file to allocate memory for attribute
[out]err_msgError message, passed back to calling function

Definition at line 2383 of file diag_util.F90.

◆ check_and_open()

subroutine diag_util_mod::check_and_open ( integer, intent(in)  file,
type(time_type), intent(in)  time,
logical, intent(out)  do_write,
type(time_type), intent(in), optional  filename_time 
)
private

Checks if it is time to open a new file.

Checks if it is time to open a new file. If yes, it first closes the current file, opens a new file and returns file_unit previous diag_manager_end is replaced by closing_file and output_setup by opening_file.

Parameters
[in]fileFile ID.
[in]timeCurrent model time.
[out]do_write.TRUE. if file is expecting more data to write, .FALSE. otherwise.
[in]filename_timeTime used in setting the filename when writting periodic files
[in]filename_timeReset the number of times in the files back to 0

Definition at line 2163 of file diag_util.F90.

◆ check_bounds_are_exact_dynamic()

subroutine, public diag_util_mod::check_bounds_are_exact_dynamic ( integer, intent(in)  out_num,
integer, intent(in)  diag_field_id,
type(time_type), intent(in)  Time,
character(len=*), intent(out)  err_msg 
)

This is an adaptor to the check_bounds_are_exact_dynamic_modern function to maintain an interface servicing the legacy diag_manager.

Parameters
[in]out_numOutput field ID number.
[in]diag_field_idInput field ID number.
[in]timeTime to use in check. The check is only performed if output_fields(out_num)Time_of_prev_field_data is not equal to Time or Time_zero.
[out]err_msgReturn status of check_bounds_are_exact_dynamic. An empty error string indicates the x, y, and z indices are equal to the buffer array boundaries.

Definition at line 990 of file diag_util.F90.

◆ check_bounds_are_exact_static()

subroutine, public diag_util_mod::check_bounds_are_exact_static ( integer, intent(in)  out_num,
integer, intent(in)  diag_field_id,
character(len=*), intent(out)  err_msg 
)

Check if the array indices for output_fields(out_num) are equal to the output_fields(out_num)buffer upper and lower bounds.

Parameters
[in]out_numOutput field ID
[in]diag_field_idInput field ID.
[out]err_msgThe return status, which is set to non-empty message if the check fails.

Definition at line 1017 of file diag_util.F90.

◆ check_duplicate_output_fields()

subroutine, public diag_util_mod::check_duplicate_output_fields ( character(len=*), intent(out), optional  err_msg)

Checks to see if output_name and output_file are unique in output_fields.

Parameters
[out]err_msgError message. If empty, then no duplicates found.

Definition at line 2237 of file diag_util.F90.

◆ check_out_of_bounds()

subroutine, public diag_util_mod::check_out_of_bounds ( integer, intent(in)  out_num,
integer, intent(in)  diag_field_id,
character(len=*), intent(out)  err_msg 
)

Checks if the array indices for output_fields(out_num) are outside the output_fields(out_num)buffer upper and lower bounds. If there is an error then error message will be filled.

Parameters
[in]out_numOutput field ID number.
[in]diag_field_idInput field ID number.
[out]err_msgReturn status of check_out_of_bounds. An empty error string indicates the x, y, and z indices are not outside the

Definition at line 842 of file diag_util.F90.

◆ compare_buffer_bounds_to_size()

logical function diag_util_mod::compare_buffer_bounds_to_size ( type (fmsdiagibounds_type), intent(in)  current_bounds,
type (fmsdiagibounds_type), intent(in)  bounds,
character(*), intent(out)  error_str,
  lowerb_comp,
  upperb_comp 
)
private

Compares the bounding indices of an array specified in "current_bounds" to the corresponding lower and upper bounds specified in "bounds" Comparison is done by the two user specified input functions lowerb_comp and upperb_comp. If any compariosn function returns true, then, after filling error_str, this routine also returns true. The suplied comparison functions should return true for errors : for indices out of bounds, or indices are not equal when expected to be equal.

Parameters
[in]current_boundsA bounding box holding the current bounds of an array.
[in]boundsThe bounding box to check against.
[out]error_strThe return status, which is set to non-empty message if the check fails.

Interface lowerb_comp should be used for comparison to lower bounds of buffer.

Interface lowerb_comp should be used for comparison to upper bounds of buffer.

Definition at line 767 of file diag_util.F90.

◆ diag_data_out()

subroutine, public diag_util_mod::diag_data_out ( integer, intent(in)  file,
integer, intent(in)  field,
real, dimension(:,:,:,:), intent(inout)  dat,
type(time_type), intent(in)  time,
logical, intent(in), optional  final_call_in,
logical, intent(in), optional  static_write_in,
type(time_type), intent(in), optional  filename_time 
)

Write data out to file, and if necessary flush the buffers.

Parameters
[in]fileFile ID.
[in]fieldField ID.
[in,out]datData to write out.
[in]timeCurrent model time.
[in]final_call_in.TRUE. if this is the last write for file.
[in]static_write_in.TRUE. if static fields are to be written to file.
[in]filename_timeTime used in setting the filename when writting periodic files

dif is the time as a real that is evaluated

Set up the time index and write the correct time value to the time array

Write data

Definition at line 2056 of file diag_util.F90.

◆ find_file()

integer function diag_util_mod::find_file ( character(len=*), intent(in)  name,
integer, intent(in)  tile_count 
)
private

Return the file number for file name and tile.

Returns
Integer find_file
Parameters
[in]tile_countTile number.
[in]nameFile name.

Definition at line 1274 of file diag_util.F90.

◆ find_input_field()

integer function, public diag_util_mod::find_input_field ( character(len=*), intent(in)  module_name,
character(len=*), intent(in)  field_name,
integer, intent(in)  tile_count 
)

Return the field number for the given module name, field name, and tile number.

Returns
Integer find_input_field
Parameters
[in]module_nameModule name.
[in]field_namefield name.
[in]tile_countTile number.

Definition at line 1291 of file diag_util.F90.

◆ fms_diag_check_bounds_are_exact_dynamic()

subroutine, public diag_util_mod::fms_diag_check_bounds_are_exact_dynamic ( type (fmsdiagibounds_type), intent(in)  current_bounds,
type (fmsdiagibounds_type), intent(inout)  bounds,
character(:), intent(in), allocatable  output_name,
character(:), intent(in), allocatable  module_name,
type(time_type), intent(in)  Time,
type(time_type), intent(inout)  field_prev_Time,
character(len=*), intent(out)  err_msg 
)

Checks that array indices specified in the bounding box "current_bounds" are identical to those in the bounding box "bounds" match exactly. The check occurs only when the time changed. If there is an error then error message will be filled.

Parameters
[in]current_boundsA bounding box holding the current bounds of an array.
[in,out]boundsThe bounding box to check against
[in]output_nameoutput name for placing in error message
[in]module_namemodule name for placing in error message
[in]timeTime to use in check. The check is only performed if output_fields(out_num)Time_of_prev_field_data is not equal to Time or Time_zero.
[in,out]field_prev_timeoutput_fields(out_num)Time_of_prev_field_data
[out]err_msgReturn status of check_bounds_are_exact_dynamic. An empty error string indicates the x, y, and z indices are equal to the buffer array boundaries.

Definition at line 939 of file diag_util.F90.

◆ fms_diag_check_bounds_are_exact_static()

subroutine, public diag_util_mod::fms_diag_check_bounds_are_exact_static ( type (fmsdiagibounds_type), intent(in)  current_bounds,
type (fmsdiagibounds_type), intent(inout)  bounds,
character(:), intent(in), allocatable  output_name,
character(:), intent(in), allocatable  module_name,
character(len=*), intent(out)  err_msg 
)

Check if the array indices specified in the bounding box "current_bounds" are equal to those specified in the bounding box "bounds" output_fields are equal to the buffer upper and lower bounds. If there is an error then error message will be filled.

Parameters
[in]current_boundsA bounding box holding the current bounds of the array.
[in,out]boundsThe bounding box to check against
[in]output_nameoutput name for placing in error message
[in]module_namemodule name for placing in error message
[out]err_msgThe return status, which is set to non-empty message if the check fails.

Definition at line 1039 of file diag_util.F90.

◆ fms_diag_check_out_of_bounds_r4()

subroutine diag_util_mod::fms_diag_check_out_of_bounds_r4 ( real(kind=r4_kind), dimension(:,:,:,:,:), intent(in)  ofb,
type (fmsdiagibounds_type), intent(inout)  bounds,
character(:), intent(in), allocatable  output_name,
character(:), intent(in), allocatable  module_name,
character(len=*), intent(inout)  err_msg 
)
private

Checks if the array indices for output_fields(out_num) are outside the output_fields(out_num)buffer upper and lower bounds. If there is an error then error message will be filled.

Parameters
[in]ofbThe output field buffer to check
[in,out]boundsThe bounding box to check against
[in]output_nameoutput name for placing in error message
[in]module_namemodule name for placing in error message
[in,out]err_msgReturn status of check_out_of_bounds. An empty error string indicates the x, y, and z indices are not outside the

Definition at line 874 of file diag_util.F90.

◆ fms_diag_check_out_of_bounds_r8()

subroutine diag_util_mod::fms_diag_check_out_of_bounds_r8 ( real(kind=r8_kind), dimension(:,:,:,:,:), intent(in)  ofb,
type (fmsdiagibounds_type), intent(inout)  bounds,
character(:), intent(in), allocatable  output_name,
character(:), intent(in), allocatable  module_name,
character(len=*), intent(out)  err_msg 
)
private

Checks if the array indices for output_field buffer (ofb) are outside the are outside the bounding box (bounds). If there is an error then error message will be filled.

Parameters
[in]ofbThe output field buffer to check
[in,out]boundsThe bounding box to check against
[in]output_nameoutput name for placing in error message
[in]module_namemodule name for placing in error message
[out]err_msgReturn status of check_out_of_bounds. An empty error string indicates the x, y, and z indices are not outside the

Definition at line 906 of file diag_util.F90.

◆ get_file_start_time()

type(time_type) function, public diag_util_mod::get_file_start_time ( integer, intent(in)  file_num)

Get the a diag_file's start_time as it is defined in the diag_table.

Returns
the start_time for the file
Parameters
[in]file_numFile number of the file to get the start_time from
Returns
The start_time to return

Definition at line 2501 of file diag_util.F90.

◆ get_subfield_size()

subroutine, public diag_util_mod::get_subfield_size ( integer, dimension(:), intent(in)  axes,
integer, intent(in)  outnum 
)

Get the size, start, and end indices for output fields.

Parameters
[in]axesaxes of the input_field
[in]outnumposition in array output_fields

Definition at line 134 of file diag_util.F90.

◆ get_subfield_vert_size()

subroutine, public diag_util_mod::get_subfield_vert_size ( integer, dimension(:), intent(in)  axes,
integer, intent(in)  outnum 
)

Get size, start and end indices for output fields.

Parameters
[in]axesaxes of the input_field
[in]outnumposition in array output_fields

Definition at line 416 of file diag_util.F90.

◆ init_file()

subroutine, public diag_util_mod::init_file ( character(len=*), intent(in)  name,
integer, intent(in)  output_freq,
integer, intent(in)  output_units,
integer, intent(in)  format,
integer, intent(in)  time_units,
character(len=*), intent(in)  long_name,
integer, intent(in)  tile_count,
integer, intent(in), optional  new_file_freq,
integer, intent(in), optional  new_file_freq_units,
type(time_type), intent(in), optional  start_time,
integer, intent(in), optional  file_duration,
integer, intent(in), optional  file_duration_units,
character(len=*), intent(in), optional  filename_time_bounds 
)

Initialize the output file.

Parameters
[in]nameFile name.
[in]long_nameLong name for time axis.
[in]output_freqHow often data is to be written to the file.
[in]output_unitsThe output frequency unit. (MIN, HOURS, DAYS, etc.)
[in]formatNumber type/kind the data is to be written out to the file.
[in]time_unitsTime axis units.
[in]tile_countTile number.
[in]new_file_freqHow often a new file is to be created.
[in]new_file_freq_unitsThe new file frequency unit. (MIN, HOURS, DAYS, etc.)</IN>
[in]file_durationHow long file is to be used.
[in]file_duration_unitsFile duration unit. (MIN, HOURS, DAYS, etc.)
[in]start_timeTime when the file is to start
[in]filename_time_boundsSet time bound file name to

Initialize the times to 0

Definition at line 1063 of file diag_util.F90.

◆ init_input_field()

subroutine, public diag_util_mod::init_input_field ( character(len=*), intent(in)  module_name,
character(len=*), intent(in)  field_name,
integer, intent(in)  tile_count 
)

Initialize the input field.

Parameters
[in]module_nameModule name.
[in]field_nameInput field name.
[in]tile_countTile number.

Definition at line 1310 of file diag_util.F90.

◆ init_output_field()

subroutine, public diag_util_mod::init_output_field ( character(len=*), intent(in)  module_name,
character(len=*), intent(in)  field_name,
character(len=*), intent(in)  output_name,
character(len=*), intent(in)  output_file,
character(len=*), intent(in)  time_method,
integer, intent(in)  pack,
integer, intent(in)  tile_count,
type(coord_type), intent(in), optional  local_coord 
)

Initialize the output field.

Parameters
[in]module_nameModule name.
[in]field_nameOutput field name.
[in]output_nameOutput name written to file.
[in]output_fileFile where field should be written.
[in]time_methodData reduction method. See <LINK SRC="diag_manager.html">diag_manager_mod</LINK> for valid methods.</IN>
[in]packPacking method.
[in]tile_countTile number.
[in]local_coordRegion to be written. If missing, then all data to be written.</IN>

Definition at line 1342 of file diag_util.F90.

◆ log_diag_field_info()

subroutine, public diag_util_mod::log_diag_field_info ( character(len=*), intent(in)  module_name,
character(len=*), intent(in)  field_name,
integer, dimension(:), intent(in)  axes,
character(len=*), intent(in), optional  long_name,
character(len=*), intent(in), optional  units,
class(*), intent(in), optional  missing_value,
class(*), dimension(:), intent(in), optional  range,
logical, intent(in), optional  dynamic 
)

Writes brief diagnostic field info to the log file.

If the do_diag_field_log namelist parameter is .TRUE., then a line briefly describing diagnostic field is added to the log file. Normally users should not call this subroutine directly, since it is called by register_static_field and register_diag_field if do_not_log is not set to .TRUE.. It is used, however, in LM3 to avoid excessive logs due to the number of fields registered for each of the tile types. LM3 code uses a do_not_log parameter in the registration calls, and subsequently calls this subroutine to log field information under a generic name.

Parameters
[in]module_nameModule name
[in]field_nameField name
[in]axesAxis IDs
[in]long_nameLong name for field.
[in]unitsUnit of field.
[in]missing_valueMissing value value.
[in]rangeValid range of values for field.
[in]dynamic.TRUE. if field is not static.

Definition at line 635 of file diag_util.F90.

◆ opening_file()

subroutine diag_util_mod::opening_file ( integer, intent(in)  file,
type(time_type), intent(in)  time,
type(time_type), intent(in), optional  filename_time 
)
private

Open file for output, and write the meta data.

Parameters
[in]fileFile ID.
[in]timeTime for the file time stamp
[in]filename_timeTime used in setting the filename when writting periodic files

update fnum_for_domain with the correct domain

Allocate the is_time_axis_registered field and set it to false for the first trip

Use the correct file object

Definition at line 1635 of file diag_util.F90.

◆ prepend_attribute_field()

subroutine diag_util_mod::prepend_attribute_field ( type(output_field_type), intent(inout)  out_field,
character(len=*), intent(in)  att_name,
character(len=*), intent(in)  prepend_value,
character(len=*), intent(out), optional  err_msg 
)
private

Prepends the attribute value to an already existing attribute. If the attribute isn't yet defined, then creates a new attribute.

Parameters
[in,out]out_fieldoutput field that will get the attribute
[in]att_nameName of the attribute
[in]prepend_valueValue to prepend
[out]err_msgError message, passed back to calling routine

Definition at line 2296 of file diag_util.F90.

◆ prepend_attribute_file()

subroutine diag_util_mod::prepend_attribute_file ( type(file_type), intent(inout)  out_file,
character(len=*), intent(in)  att_name,
character(len=*), intent(in)  prepend_value,
character(len=*), intent(out), optional  err_msg 
)
private

Prepends the attribute value to an already existing attribute. If the attribute isn't yet defined, then creates a new attribute.

Parameters
[in,out]out_fileoutput file that will get the attribute
[in]att_nameName of the attribute
[in]prepend_valueValue to prepend
[out]err_msgError message, passed back to calling routine

Definition at line 2412 of file diag_util.F90.

◆ sync_file_times()

subroutine, public diag_util_mod::sync_file_times ( integer, intent(in)  file_id,
type(time_type), intent(in)  init_time,
character(len=*), intent(out), optional  err_msg 
)

Synchronize the file's start and close times with the model start and end times.

sync_file_times checks to see if the file start time is less than the model's init time (passed in as the only argument). If it is less, then the both the file start time and end time are synchronized using the passed in initial time and the duration as calculated by the diag_time_inc function. sync_file_times will also increase the next_open until it is greater than the init_time.

Parameters
[in]file_idThe file ID
[in]init_timeInitial time use for the synchronization.
[out]err_msgReturn error message

Definition at line 1244 of file diag_util.F90.

◆ update_bounds()

subroutine, public diag_util_mod::update_bounds ( integer, intent(in)  out_num,
integer, intent(in)  lower_i,
integer, intent(in)  upper_i,
integer, intent(in)  lower_j,
integer, intent(in)  upper_j,
integer, intent(in)  lower_k,
integer, intent(in)  upper_k 
)

Update the output_fields x, y, and z min and max boundaries (array indices) with the six specified bounds values.

Parameters
[in]out_numoutput field ID
[in]lower_iLower i bound.
[in]upper_iUpper i bound.
[in]lower_jLower j bound.
[in]upper_jUpper j bound.
[in]lower_kLower k bound.
[in]upper_kUpper k bound.

Definition at line 747 of file diag_util.F90.

◆ write_static()

subroutine, public diag_util_mod::write_static ( integer, intent(in)  file)

Output all static fields in this file.

Parameters
[in]fileFile ID.

Definition at line 2206 of file diag_util.F90.