FMS 2025.01-dev
Flexible Modeling System
|
This module computes and outputs global and / or hemispheric physics integrals. More...
Data Types | |
interface | sum_diag_integral_field |
Perform a summation of the named integral field. More... | |
Functions/Subroutines | |
logical function, private | diag_integral_alarm (time) |
Function to check if it is time to write integrals. if not writing integrals, return. | |
subroutine, public | diag_integral_end (time) |
diag_integral_end is the destructor for diag_integral_mod. | |
subroutine, public | diag_integral_field_init (name, format) |
diag_integral_field_init registers and intializes an integral field | |
subroutine, public | diag_integral_init (time_init, time, blon, blat, area_in) |
diag_integral_init is the constructor for diag_integral_mod. | |
subroutine, public | diag_integral_output (time) |
diag_integral_output determines if this is a timestep on which integrals are to be written. if not, it returns; if so, it calls write_field_averages. | |
character(len=fms_file_len) function | ensemble_file_name (fname) |
Adds .ens_## to the diag_integral.out file name. | |
subroutine, private | format_data_init (nst_in, nend_in, use_exp_format) |
format_text_init generates the format to be output in the integrals file. | |
subroutine, private | format_text_init (nst_in, nend_in) |
format_text_init generates the header records to be output in the integrals file. | |
real(r8_kind) function, private | get_axis_time (time, units) |
Function to convert the time_type input variable into units of units and returns it in atime. | |
integer function, private | get_field_index (name) |
get_field_index returns returns the index associated with an integral name. | |
type(time_type) function, private | set_axis_time (atime, units) |
Function to convert input time to a time_type. | |
real(r8_kind) function, dimension(size(field_data, 1), size(field_data, 2)), private | vert_diag_integral (field_data, wt) |
Function to perform a weighted integral in the vertical direction of a 3d data field. | |
subroutine, private | write_field_averages (time) |
Subroutine to sum multiple fields, average them and then write the result to an output file. | |
Variables | |
type(time_type) | alarm_interval |
time interval between writing integrals | |
real(r8_kind), dimension(:,:), allocatable | area |
area of each grid box | |
integer | diag_unit = 0 |
unit number for output file | |
integer, dimension(max_num_field) | field_count |
number of values in integrand i | |
character(len=16), dimension(max_num_field) | field_format |
output format for integral i | |
character(len=max_len_name), dimension(max_num_field) | field_name |
name associated with integral i | |
integer | field_size |
number of columns on global domain | |
real(r8_kind), dimension(max_num_field) | field_sum |
integrand for integral i | |
integer | fields_per_print_line = 4 |
number of fields to write per line | |
character(len=fms_file_len) | file_name = ' ' |
optional integrals output file name | |
character(len=160) | format_data |
format statement for data output | |
character(len=160) | format_text |
format statement for header | |
integer | idim |
x dimension of grid on local processor | |
integer | jdim |
y dimension of grid on local processor | |
integer, parameter | max_len_name = 12 |
maximum length of name associated with integral | |
integer, parameter | max_num_field = 32 |
maximum number of integrals allowed | |
logical | module_is_initialized = .false. |
module is initialized ? | |
integer | nd |
number of characters in data format statement | |
type(time_type) | next_alarm_time |
next time at which integrals are to be written | |
integer | nt |
number of characters in text format statement | |
integer | num_field = 0 |
number of integrals that have been activated | |
real(r8_kind) | output_interval = -1.0_r8_kind |
time interval at which integrals | |
logical | print_header = .true. |
print a header for the integrals | |
real(r8_kind) | sum_area |
surface area of globe | |
type(time_type) | time_init_save |
initial time associated with experiment; used as a base for defining time | |
character(len=8) | time_units = 'hours' |
time units associated with | |
type(time_type) | zero_time |
time_type variable set to (0,0); used as flag to indicate integrals are not being output | |
This module computes and outputs global and / or hemispheric physics integrals.
interface diag_integral_mod::sum_diag_integral_field |
Perform a summation of the named integral field.
This interface can be called in any one of three ways:
in the first option above, data
may be either
Parameters:
[in] | <name> | name associated with integral |
[in] | <data> | field of integrands to be summed over |
[in] | <wt> | vertical weighting factor to be applied to integrands when summing |
[in] | <is,ie,js,je> | starting/ending i,j indices over which summation is to occur |
Definition at line 103 of file diag_integral.F90.
Public Member Functions | |
sum_field_2d_hemi_r4 | |
sum_field_2d_hemi_r8 | |
sum_field_2d_r4 | |
sum_field_2d_r8 | |
sum_field_3d_r4 | |
sum_field_3d_r8 | |
sum_field_wght_3d_r4 | |
sum_field_wght_3d_r8 | |
|
private |
Function to check if it is time to write integrals. if not writing integrals, return.
Template:
Parameters:
[in] | <Time> | current time |
[out] | <answer> |
[in] | time | current time |
Definition at line 1033 of file diag_integral.F90.
subroutine, public diag_integral_end | ( | type (time_type), intent(in) | time | ) |
diag_integral_end is the destructor for diag_integral_mod.
Template:
Parameters:
[in] | <Time> | integral time stamp at the current time |
Definition at line 513 of file diag_integral.F90.
subroutine, public diag_integral_field_init | ( | character(len=*), intent(in) | name, |
character(len=*), intent(in) | format | ||
) |
diag_integral_field_init registers and intializes an integral field
Template:
Parameters:
[in] | <name> | Name of the field to be integrated |
[in] | <format> | Output format of the field to be integrated |
[in] | name | Name of the field to be integrated |
[in] | format | Output format of the field to be integrated |
Definition at line 392 of file diag_integral.F90.
subroutine, public diag_integral_init | ( | type (time_type), intent(in), optional | time_init, |
type (time_type), intent(in), optional | time, | ||
class(*), dimension(:,:), intent(in), optional | blon, | ||
class(*), dimension(:,:), intent(in), optional | blat, | ||
class(*), dimension(:,:), intent(in), optional | area_in | ||
) |
diag_integral_init is the constructor for diag_integral_mod.
Template:
Parameters:
[in] | <Time_init> | Initial time to start the integral |
[in] | <Time> | current time |
[in] | <latb> | array of model latitudes at cell boundaries [radians] |
[in] | <lonb> | array of model longitudes at cell boundaries [radians] |
[in] | time_init | Initial time to start the integral |
[in] | time | current time |
[in] | blon | array of model latitudes at cell boundaries [radians] |
[in] | blat | array of model longitudes at cell boundaries [radians] |
Definition at line 239 of file diag_integral.F90.
subroutine, public diag_integral_output | ( | type (time_type), intent(in) | time | ) |
diag_integral_output determines if this is a timestep on which integrals are to be written. if not, it returns; if so, it calls write_field_averages.
Template:
Parameters:
[in] | <Time> | integral time stamp at the current time |
Definition at line 468 of file diag_integral.F90.
|
private |
Adds .ens_## to the diag_integral.out file name.
Make sure the file name short enough to handle adding the ensemble number
Get the ensemble ID and convert it to a string
Add a 0 if the ensemble is less than 10 (2 digit)
Insert the ens_ string in the correct location Loop through to find the last period
Add to the end if there is no period in the file name
Definition at line 1090 of file diag_integral.F90.
|
private |
format_text_init generates the format to be output in the integrals file.
Template:
Parameters:
[in] | <nst_in,nend_in> | starting/ending integral index which will be included in this format statement |
[in] | <use_exp_format> | if true, uses exponent notation for the first format code to avoid overflow with larger time values |
[in] | nst_in | starting/ending integral index which will be included in this format statement |
[in] | nend_in | starting/ending integral index which will be included in this format statement |
[in] | use_exp_format | if true, uses exponent notation for the first format code to avoid overflow with larger time values |
Definition at line 908 of file diag_integral.F90.
|
private |
format_text_init generates the header records to be output in the integrals file.
Template:
Parameters:
[in] | <nst_in,nend_in> | starting/ending integral index which will be included in this format statement |
[in] | nst_in | starting/ending integral index which will be included in this format statement |
[in] | nend_in | starting/ending integral index which will be included in this format statement |
Definition at line 817 of file diag_integral.F90.
|
private |
Function to convert the time_type input variable into units of units and returns it in atime.
Template:
Parameters:
[in] | <Time> | integral time stamp |
[in] | <units> | input units of time_type |
[out] | <atime> |
[in] | time | integral time stamp |
[in] | units | input units of time_type |
Definition at line 986 of file diag_integral.F90.
|
private |
get_field_index returns returns the index associated with an integral name.
Template:
Parameters:
[in] | <name> | Name associated with an integral |
[out] | <index> | |
[in] | name | Name associated with an integral |
Definition at line 638 of file diag_integral.F90.
|
private |
Function to convert input time to a time_type.
Template:
Parameters:
[in] | <atime> | integral time stamp at the current time |
[in] | <units> | input units, not used |
[out] | <Time> | |
[in] | atime | integral time stamp at the current time |
[in] | units | input units, not used |
Definition at line 580 of file diag_integral.F90.
|
private |
Function to perform a weighted integral in the vertical direction of a 3d data field.
Template:
Parameters:
[in] | <field_data> | integral field data arrays |
[in] | <wt> | integral field weighting functions |
[out] | <data2> |
[in] | field_data | integral field data arrays |
[in] | wt | integral field weighting functions |
Definition at line 1067 of file diag_integral.F90.
|
private |
Subroutine to sum multiple fields, average them and then write the result to an output file.
Template:
Parameters:
[in] | <Time> | integral time stamp at the current time |
[in] | time | integral time stamp at the current time |
Definition at line 691 of file diag_integral.F90.
|
private |
time interval between writing integrals
Definition at line 166 of file diag_integral.F90.
|
private |
area of each grid box
Definition at line 176 of file diag_integral.F90.
|
private |
unit number for output file
Definition at line 204 of file diag_integral.F90.
|
private |
number of values in integrand i
Definition at line 191 of file diag_integral.F90.
|
private |
output format for integral i
Definition at line 189 of file diag_integral.F90.
|
private |
name associated with integral i
Definition at line 188 of file diag_integral.F90.
|
private |
number of columns on global domain
Definition at line 179 of file diag_integral.F90.
|
private |
integrand for integral i
Definition at line 190 of file diag_integral.F90.
|
private |
number of fields to write per line
Definition at line 149 of file diag_integral.F90.
|
private |
optional integrals output file name
Definition at line 144 of file diag_integral.F90.
|
private |
format statement for data output
Definition at line 197 of file diag_integral.F90.
|
private |
format statement for header
Definition at line 196 of file diag_integral.F90.
|
private |
x dimension of grid on local processor
Definition at line 177 of file diag_integral.F90.
|
private |
y dimension of grid on local processor
Definition at line 178 of file diag_integral.F90.
|
private |
maximum length of name associated with integral
Definition at line 185 of file diag_integral.F90.
|
private |
maximum number of integrals allowed
Definition at line 186 of file diag_integral.F90.
|
private |
module is initialized ?
Definition at line 205 of file diag_integral.F90.
|
private |
number of characters in data format statement
Definition at line 198 of file diag_integral.F90.
|
private |
next time at which integrals are to be written
Definition at line 165 of file diag_integral.F90.
|
private |
number of characters in text format statement
Definition at line 199 of file diag_integral.F90.
|
private |
number of integrals that have been activated
Definition at line 187 of file diag_integral.F90.
|
private |
time interval at which integrals
Definition at line 138 of file diag_integral.F90.
|
private |
print a header for the integrals
Definition at line 146 of file diag_integral.F90.
|
private |
surface area of globe
Definition at line 180 of file diag_integral.F90.
|
private |
initial time associated with experiment; used as a base for defining time
Definition at line 169 of file diag_integral.F90.
|
private |
time units associated with
Definition at line 141 of file diag_integral.F90.
|
private |
time_type variable set to (0,0); used as flag to indicate integrals are not being output
Definition at line 167 of file diag_integral.F90.