FMS  2024.01.00
Flexible Modeling System
fms_diag_outfield_mod

fms_diag_outfield_mod defines data types and utility or auxiliary routines useful in updating the output buffer. More...

Data Types

type  fmsdiagoutfield_type
 Class fmsDiagOutfield_type (along with class ms_diag_outfield_index_type ) contain information used in updating the output buffers by the diag_manager send_data routines. In some sense they can be seen as encapsulating related information in a convenient way (e.g. to pass to functions and for do loop controls.) More...
 
type  fmsdiagoutfieldindex_type
 Class fms_diag_outfield_index_type which (along with class fmsDiagOutfield_type) encapsulate related information used in updating the output buffers by the diag_manager send_data routines. This class in particular focuses on do loop index controls or settings. Note that the index names in this class should be indentical to the names used in the diag_manager send_data functions and in the "math" buffer update functions. The purpose of this class is also to allow for a smaller call function signature for the math/buffer update functions. More...
 

Functions/Subroutines

procedure get_f1
 
pure integer function get_f1 (this)
 Gets f1. More...
 
procedure get_f2
 
pure integer function get_f2 (this)
 Gets f2. More...
 
procedure get_f3
 
pure integer function get_f3 (this)
 Gets f3. More...
 
procedure get_f4
 
pure integer function get_f4 (this)
 Gets f4. More...
 
procedure get_field_name
 
pure character(len=:) function, allocatable get_field_name (this)
 Gets field_name. More...
 
procedure get_hi
 
pure integer function get_hi (this)
 Gets hi. More...
 
procedure get_hj
 
pure integer function get_hj (this)
 Gets hj. More...
 
procedure get_ie
 
pure integer function get_ie (this)
 Gets ie. More...
 
procedure get_is
 
pure integer function get_is (this)
 Gets is. More...
 
procedure get_je
 
pure integer function get_je (this)
 Gets je. More...
 
procedure get_js
 
pure integer function get_js (this)
 Gets js. More...
 
procedure get_ke
 
pure integer function get_ke (this)
 Gets ke. More...
 
procedure get_ks
 
pure integer function get_ks (this)
 Gets ks. More...
 
procedure get_mask_present
 
pure logical function get_mask_present (this)
 Gets mask_present. More...
 
procedure get_mask_variant
 
pure logical function get_mask_variant (this)
 Gets mask_variant. More...
 
procedure get_missvalue_present
 
pure logical function get_missvalue_present (this)
 Gets missvalue_present. More...
 
procedure get_module_name
 
pure character(len=:) function, allocatable get_module_name (this)
 Gets module_name. More...
 
procedure get_need_compute
 
pure logical function get_need_compute (this)
 Gets need_compute. More...
 
integer function get_output_field_time_reduction (ofield)
 Get the time reduction from a legacy output field. More...
 
procedure get_output_file
 
pure character(len=:) function, allocatable get_output_file (this)
 Gets output_file. More...
 
procedure get_output_name
 
pure character(len=:) function, allocatable get_output_name (this)
 Gets output_name. More...
 
procedure get_phys_window
 
pure logical function get_phys_window (this)
 Gets phys_window. More...
 
procedure get_pow_value
 
pure integer function get_pow_value (this)
 Gets pow_value. More...
 
procedure get_reduced_k_range
 
pure logical function get_reduced_k_range (this)
 Gets reduced_k_range. More...
 
procedure get_time_reduction
 
type(fmsdiagtimereduction_type) function, allocatable get_time_reduction (this)
 Gets the time_reduction object. More...
 
procedure, public initialize => initialize_outfield_imp
 
procedure initialize => initialize_outfield_index_type
 
procedure initialize_for_ut
 
subroutine initialize_for_ut (this, module_name, field_name, output_name, power_val, phys_window, need_compute, mask_variant, reduced_k_range, num_elems, time_reduction_type, output_freq)
 Initialized an fmsDiagOutfield_type as needed for unit tests. More...
 
subroutine initialize_outfield_imp (this, input_field, output_field, mask_present, freq)
 Update the fmsDiagOutfield_type instance with those fields used in the legacy diag manager. Note that this is initializing from the legacy structures. Note that output_frequency came from file_type;. More...
 
subroutine initialize_outfield_index_type (this, is, js, ks, ie, je, ke, hi, hj, f1, f2, f3, f4)
 #brief initialize all the members of the class. More...
 
subroutine reset_time_reduction_ut (this, source)
 Reset the time reduction member field. Intended for use in unit tests only. More...
 

Variables

integer f1
 
integer f2
 Indecies used specify 1st dim bounds of field, mask and rmask.
 
integer f3
 
integer f4
 Indecies used specify 2st dim bounds of field, mask and rmask.
 
character(len=:), allocatable field_name
 Output field name.
 
integer hi
 halo size in x direction. Same name as in send_data
 
integer hj
 halo size in y direction. Same
 
integer ie
 
integer is
 
integer je
 
integer js
 
integer ke
 End indecies in each spatial dim of the field_data; and may be user provided in send_data.
 
integer ks
 Start indecies in each spatial dim of the field_data; and may be user provided in send_data.
 
logical mask_present
 True iff mask argument is present in user-facing send function call. Note this field exists since the actual mask argument in the send function call may be downstream replaced by a null pointer which is considered present.
 
logical mask_variant
 
logical missvalue_present
 
character(len=:), allocatable module_name
 Module name.
 
logical need_compute
 True iff is local_output and current PE take part in send_data.
 
character(len=:), allocatable output_file
 File where field should be written.
 
character(len=:), allocatable output_name
 Output name written to file.
 
logical phys_window
 TODO: Rename? OMP subsetted data, See output_fields.
 
integer pow_value
 Power value for rms or pow(x) calculations.
 
logical reduced_k_range
 If true, the local start and end indecies are used in k (i.e. 3rd) dim.
 
type(fmsdiagtimereduction_typetime_reduction
 Instance of the fmsDiagTimeTeduction_type.
 

Detailed Description

fms_diag_outfield_mod defines data types and utility or auxiliary routines useful in updating the output buffer.

Author
Miguel Zuniga

fms_diag_outfield_mod The output buffer updating routines are passed configuration and control data with types defined in this module; and some utility functions called by the updating routines are defined here.


Data Type Documentation

◆ fms_diag_outfield_mod::fmsdiagoutfield_type

type fms_diag_outfield_mod::fmsdiagoutfield_type

Class fmsDiagOutfield_type (along with class ms_diag_outfield_index_type ) contain information used in updating the output buffers by the diag_manager send_data routines. In some sense they can be seen as encapsulating related information in a convenient way (e.g. to pass to functions and for do loop controls.)

Class fmsDiagOutfield_type also contains a significant subset of the fields and routines of of the legacy class output_field_type TODO: (MDM) This class will need further development for the modern_diag effort. For its development, consider the legacy diag_util::init_output_field already in place. Fields added so are used the the field buffer math/dmUpdate functions. TODO (MDM) : Should the MDM have pow_value be type REAL?

Definition at line 64 of file fms_diag_outfield.F90.

Collaboration diagram for fmsdiagoutfield_type:
[legend]

Public Member Functions

procedure get_field_name
 
procedure get_mask_present
 
procedure get_mask_variant
 
procedure get_missvalue_present
 
procedure get_module_name
 
procedure get_need_compute
 
procedure get_output_file
 
procedure get_output_name
 
procedure get_phys_window
 
procedure get_pow_value
 
procedure get_reduced_k_range
 
procedure get_time_reduction
 
procedure, public initialize => initialize_outfield_imp
 
procedure initialize_for_ut
 

Public Attributes

character(len=:), allocatable field_name
 Output field name.
 
logical mask_present
 True iff mask argument is present in user-facing send function call. Note this field exists since the actual mask argument in the send function call may be downstream replaced by a null pointer which is considered present.
 
logical mask_variant
 
logical missvalue_present
 
character(len=:), allocatable module_name
 Module name.
 
logical need_compute
 True iff is local_output and current PE take part in send_data.
 
character(len=:), allocatable output_file
 File where field should be written.
 
character(len=:), allocatable output_name
 Output name written to file.
 
logical phys_window
 TODO: Rename? OMP subsetted data, See output_fields.
 
integer pow_value
 Power value for rms or pow(x) calculations.
 
logical reduced_k_range
 If true, the local start and end indecies are used in k (i.e. 3rd) dim.
 
type(fmsdiagtimereduction_typetime_reduction
 Instance of the fmsDiagTimeTeduction_type.
 

◆ fms_diag_outfield_mod::fmsdiagoutfieldindex_type

type fms_diag_outfield_mod::fmsdiagoutfieldindex_type

Class fms_diag_outfield_index_type which (along with class fmsDiagOutfield_type) encapsulate related information used in updating the output buffers by the diag_manager send_data routines. This class in particular focuses on do loop index controls or settings. Note that the index names in this class should be indentical to the names used in the diag_manager send_data functions and in the "math" buffer update functions. The purpose of this class is also to allow for a smaller call function signature for the math/buffer update functions.

Definition at line 118 of file fms_diag_outfield.F90.

Collaboration diagram for fmsdiagoutfieldindex_type:
[legend]

Public Member Functions

procedure get_f1
 
procedure get_f2
 
procedure get_f3
 
procedure get_f4
 
procedure get_hi
 
procedure get_hj
 
procedure get_ie
 
procedure get_is
 
procedure get_je
 
procedure get_js
 
procedure get_ke
 
procedure get_ks
 
procedure initialize => initialize_outfield_index_type
 

Public Attributes

integer f1
 
integer f2
 Indecies used specify 1st dim bounds of field, mask and rmask.
 
integer f3
 
integer f4
 Indecies used specify 2st dim bounds of field, mask and rmask.
 
integer hi
 halo size in x direction. Same name as in send_data
 
integer hj
 halo size in y direction. Same
 
integer ie
 
integer is
 
integer je
 
integer js
 
integer ke
 End indecies in each spatial dim of the field_data; and may be user provided in send_data.
 
integer ks
 Start indecies in each spatial dim of the field_data; and may be user provided in send_data.
 

Function/Subroutine Documentation

◆ get_f1()

pure integer function fms_diag_outfield_mod::get_f1 ( class (fmsdiagoutfieldindex_type), intent(in)  this)

Gets f1.

Returns
copy of integer member f1
Parameters
[in]thisThe fmsDiagOutfieldIndex_type object

Definition at line 242 of file fms_diag_outfield.F90.

◆ get_f2()

pure integer function fms_diag_outfield_mod::get_f2 ( class (fmsdiagoutfieldindex_type), intent(in)  this)

Gets f2.

Returns
copy of integer member f2
Parameters
[in]thisThe fmsDiagOutfieldIndex_type object

Definition at line 249 of file fms_diag_outfield.F90.

◆ get_f3()

pure integer function fms_diag_outfield_mod::get_f3 ( class (fmsdiagoutfieldindex_type), intent(in)  this)

Gets f3.

Returns
copy of integer member f3
Parameters
[in]thisThe fmsDiagOutfieldIndex_type object

Definition at line 256 of file fms_diag_outfield.F90.

◆ get_f4()

pure integer function fms_diag_outfield_mod::get_f4 ( class (fmsdiagoutfieldindex_type), intent(in)  this)

Gets f4.

Returns
copy of integer member f4
Parameters
[in]thisThe fmsDiagOutfieldIndex_type object

Definition at line 263 of file fms_diag_outfield.F90.

◆ get_field_name()

pure character(len=:) function, allocatable fms_diag_outfield_mod::get_field_name ( class (fmsdiagoutfield_type), intent(in)  this)

Gets field_name.

Returns
copy of the field_name character array
Parameters
[in]thisdiag object

Definition at line 157 of file fms_diag_outfield.F90.

◆ get_hi()

pure integer function fms_diag_outfield_mod::get_hi ( class (fmsdiagoutfieldindex_type), intent(in)  this)

Gets hi.

Returns
copy of integer member hi
Parameters
[in]thisThe fmsDiagOutfieldIndex_type object

Definition at line 312 of file fms_diag_outfield.F90.

◆ get_hj()

pure integer function fms_diag_outfield_mod::get_hj ( class (fmsdiagoutfieldindex_type), intent(in)  this)

Gets hj.

Returns
copy of integer member hj
Parameters
[in]thisThe fmsDiagOutfieldIndex_type object

Definition at line 319 of file fms_diag_outfield.F90.

◆ get_ie()

pure integer function fms_diag_outfield_mod::get_ie ( class (fmsdiagoutfieldindex_type), intent(in)  this)

Gets ie.

Returns
copy of integer member ie
Parameters
[in]thisThe fmsDiagOutfieldIndex_type object

Definition at line 291 of file fms_diag_outfield.F90.

◆ get_is()

pure integer function fms_diag_outfield_mod::get_is ( class (fmsdiagoutfieldindex_type), intent(in)  this)

Gets is.

Returns
copy of integer member is
Parameters
[in]thisThe fmsDiagOutfieldIndex_type object

Definition at line 270 of file fms_diag_outfield.F90.

◆ get_je()

pure integer function fms_diag_outfield_mod::get_je ( class (fmsdiagoutfieldindex_type), intent(in)  this)

Gets je.

Returns
copy of integer member je
Parameters
[in]thisThe fmsDiagOutfieldIndex_type object

Definition at line 298 of file fms_diag_outfield.F90.

◆ get_js()

pure integer function fms_diag_outfield_mod::get_js ( class (fmsdiagoutfieldindex_type), intent(in)  this)

Gets js.

Returns
copy of integer member js
Parameters
[in]thisThe fmsDiagOutfieldIndex_type object

Definition at line 277 of file fms_diag_outfield.F90.

◆ get_ke()

pure integer function fms_diag_outfield_mod::get_ke ( class (fmsdiagoutfieldindex_type), intent(in)  this)

Gets ke.

Returns
copy of integer member ke
Parameters
[in]thisThe fmsDiagOutfieldIndex_type object

Definition at line 305 of file fms_diag_outfield.F90.

◆ get_ks()

pure integer function fms_diag_outfield_mod::get_ks ( class (fmsdiagoutfieldindex_type), intent(in)  this)

Gets ks.

Returns
copy of integer member ks
Parameters
[in]thisThe fmsDiagOutfieldIndex_type object

Definition at line 284 of file fms_diag_outfield.F90.

◆ get_mask_present()

pure logical function fms_diag_outfield_mod::get_mask_present ( class (fmsdiagoutfield_type), intent(in)  this)

Gets mask_present.

Returns
copy of integer member mask_present
Parameters
[in]thisThe fmsDiagOutfield_type object

Definition at line 226 of file fms_diag_outfield.F90.

◆ get_mask_variant()

pure logical function fms_diag_outfield_mod::get_mask_variant ( class (fmsdiagoutfield_type), intent(in)  this)

Gets mask_variant.

Returns
copy of integer member mask_variant
Parameters
[in]thisThe fmsDiagOutfield_type object

Definition at line 219 of file fms_diag_outfield.F90.

◆ get_missvalue_present()

pure logical function fms_diag_outfield_mod::get_missvalue_present ( class (fmsdiagoutfield_type), intent(in)  this)

Gets missvalue_present.

Returns
copy of integer member missvalue_present
Parameters
[in]thisThe fmsDiagOutfield_type object

Definition at line 212 of file fms_diag_outfield.F90.

◆ get_module_name()

pure character(len=:) function, allocatable fms_diag_outfield_mod::get_module_name ( class (fmsdiagoutfield_type), intent(in)  this)

Gets module_name.

Returns
copy of the module_name character array
Parameters
[in]thisdiag object

Definition at line 148 of file fms_diag_outfield.F90.

◆ get_need_compute()

pure logical function fms_diag_outfield_mod::get_need_compute ( class (fmsdiagoutfield_type), intent(in)  this)

Gets need_compute.

Returns
copy of integer member need_compute
Parameters
[in]thisThe fmsDiagOutfield_type object

Definition at line 198 of file fms_diag_outfield.F90.

◆ get_output_field_time_reduction()

integer function fms_diag_outfield_mod::get_output_field_time_reduction ( type(output_field_type), intent(in)  ofield)

Get the time reduction from a legacy output field.

Parameters
[in]ofieldAn instance of the output_field_type
Returns
The result integer which is the time reduction.

Definition at line 423 of file fms_diag_outfield.F90.

◆ get_output_file()

pure character(len=:) function, allocatable fms_diag_outfield_mod::get_output_file ( class (fmsdiagoutfield_type), intent(in)  this)

Gets output_file.

Returns
copy of the output_file character array
Parameters
[in]thisdiag object

Definition at line 175 of file fms_diag_outfield.F90.

◆ get_output_name()

pure character(len=:) function, allocatable fms_diag_outfield_mod::get_output_name ( class (fmsdiagoutfield_type), intent(in)  this)

Gets output_name.

Returns
copy of the output_name character array
Parameters
[in]thisdiag object

Definition at line 166 of file fms_diag_outfield.F90.

◆ get_phys_window()

pure logical function fms_diag_outfield_mod::get_phys_window ( class (fmsdiagoutfield_type), intent(in)  this)

Gets phys_window.

Returns
copy of integer member phys_window
Parameters
[in]thisThe fmsDiagOutfield_type object

Definition at line 191 of file fms_diag_outfield.F90.

◆ get_pow_value()

pure integer function fms_diag_outfield_mod::get_pow_value ( class (fmsdiagoutfield_type), intent(in)  this)

Gets pow_value.

Returns
copy of integer member pow_value
Parameters
[in]thisThe fmsDiagOutfield_type object

Definition at line 184 of file fms_diag_outfield.F90.

◆ get_reduced_k_range()

pure logical function fms_diag_outfield_mod::get_reduced_k_range ( class (fmsdiagoutfield_type), intent(in)  this)

Gets reduced_k_range.

Returns
copy of integer member reduced_k_range
Parameters
[in]thisThe fmsDiagOutfield_type object

Definition at line 205 of file fms_diag_outfield.F90.

◆ get_time_reduction()

type(fmsdiagtimereduction_type) function, allocatable fms_diag_outfield_mod::get_time_reduction ( class (fmsdiagoutfield_type), intent(in)  this)

Gets the time_reduction object.

Returns
copy of the memeber object time_reduction
Parameters
[in]thisdiag object

Definition at line 233 of file fms_diag_outfield.F90.

◆ initialize_for_ut()

subroutine fms_diag_outfield_mod::initialize_for_ut ( class(fmsdiagoutfield_type), intent(inout)  this,
character(len=*), intent(in)  module_name,
character(len=*), intent(in)  field_name,
character(len=*), intent(in)  output_name,
integer, intent(in)  power_val,
logical, intent(in)  phys_window,
logical, intent(in)  need_compute,
logical, intent(in)  mask_variant,
logical, intent(in)  reduced_k_range,
integer, intent(in)  num_elems,
integer, intent(in)  time_reduction_type,
integer, intent(in)  output_freq 
)

Initialized an fmsDiagOutfield_type as needed for unit tests.

Parameters
[in]module_nameVar with same name in fmsDiagOutfield_type
[in]field_nameVar with same name in fmsDiagOutfield_type
[in]output_nameVar with same name in fmsDiagOutfield_type
[in]power_valVar with same name in fmsDiagOutfield_type
[in]phys_windowVar with same name in fmsDiagOutfield_type
[in]need_computeVar with same name in fmsDiagOutfield_type
[in]mask_variantVar with same name in fmsDiagOutfield_type
[in]reduced_k_rangeVar with same name in fmsDiagOutfield_type
[in]num_elemsVar with same name in fmsDiagOutfield_type
[in]time_reduction_typeVar with same name in fmsDiagOutfield_type
[in]output_freqThe output_freq need in initaliztion of time_reduction_type

Definition at line 385 of file fms_diag_outfield.F90.

◆ initialize_outfield_imp()

subroutine fms_diag_outfield_mod::initialize_outfield_imp ( class(fmsdiagoutfield_type), intent(inout)  this,
type(input_field_type), intent(in)  input_field,
type(output_field_type), intent(in)  output_field,
logical, intent(in)  mask_present,
integer, intent(in)  freq 
)

Update the fmsDiagOutfield_type instance with those fields used in the legacy diag manager. Note that this is initializing from the legacy structures. Note that output_frequency came from file_type;.

Parameters
[in,out]thisAn instance of the fmsDiagOutfield_type
[in]input_fieldAn instance of the input_field_type
[in]output_fieldAn instance of the output_field_type
[in]mask_presentWas the mask present in the call to send_data?
[in]freqThe output frequency.

Definition at line 353 of file fms_diag_outfield.F90.

◆ initialize_outfield_index_type()

subroutine fms_diag_outfield_mod::initialize_outfield_index_type ( class(fmsdiagoutfieldindex_type), intent(inout)  this,
integer, intent(in)  is,
integer, intent(in)  js,
integer, intent(in)  ks,
integer, intent(in)  ie,
integer, intent(in)  je,
integer, intent(in)  ke,
integer, intent(in)  hi,
integer, intent(in)  hj,
integer, intent(in)  f1,
integer, intent(in)  f2,
integer, intent(in)  f3,
integer, intent(in)  f4 
)

#brief initialize all the members of the class.

Parameters
[in]ksVariable used to update class member of same names.
[in]keVariable used to update class member of same names.
[in]hjVariable used to update class member of same names.
[in]f4Variable used to update class member of same names.

Definition at line 326 of file fms_diag_outfield.F90.

◆ reset_time_reduction_ut()

subroutine fms_diag_outfield_mod::reset_time_reduction_ut ( class(fmsdiagoutfield_type), intent(inout)  this,
type(fmsdiagtimereduction_type source 
)

Reset the time reduction member field. Intended for use in unit tests only.

Parameters
[in,out]thisAn instance of the fmsDiagOutfield_type
sourceThe fmsDiagTimeReduction_type to copy from

Definition at line 413 of file fms_diag_outfield.F90.