FMS
2024.03
Flexible Modeling System
|
Contains buffer types and routines for the diag manager. More...
Data Types | |
type | fmsdiagoutputbuffer_type |
holds an allocated buffer0-5d object More... | |
Functions/Subroutines | |
subroutine | add_axis_ids (this, axis_ids) |
Adds the axis ids to the buffer object. More... | |
subroutine | allocate_buffer (this, buff_type, ndim, buff_sizes, mask_variant, field_name, diurnal_samples) |
Allocates a 5D buffer to given buff_type. More... | |
character(len=51) function | diag_reduction_done_wrapper (this, reduction_method, missing_value, has_mask, mask_variant) |
Finishes calculations for any reductions that use an average (avg, rms, pow) TODO add mask and any other needed args for adjustment, and pass in the adjusted mask to time_update_done. More... | |
character(len=50) function | do_time_max_wrapper (this, field_data, mask, is_masked, bounds_in, bounds_out, missing_value) |
Does the time_min reduction method on the buffer object. More... | |
character(len=50) function | do_time_min_wrapper (this, field_data, mask, is_masked, bounds_in, bounds_out, missing_value) |
Does the time_min reduction method on the buffer object. More... | |
character(len=50) function | do_time_none_wrapper (this, field_data, mask, is_masked, bounds_in, bounds_out, missing_value) |
Does the time_none reduction method on the buffer object. More... | |
character(len=150) function | do_time_sum_wrapper (this, field_data, mask, is_masked, mask_variant, bounds_in, bounds_out, missing_value, has_missing_value, pow_value, weight) |
Does the time_sum reduction method on the buffer object. More... | |
subroutine | flush_buffer (this) |
Deallocates data fields from a buffer object. More... | |
logical function, public | fms_diag_output_buffer_init (buffobjs, buff_list_size) |
Initializes a list of diag buffers. More... | |
subroutine | get_axis_ids (this, res) |
Get the axis_ids for the buffer. More... | |
subroutine | get_buffer (this, buff_out, field_name) |
Get routine for 5D buffers. Sets the buff_out argument to the integer or real array currently stored in the buffer. More... | |
pure integer function, dimension(4) | get_buffer_dims (this) |
this leaves out the diurnal index cause its only used for tmp mask allocation More... | |
character(len=:) function, allocatable | get_buffer_name (this) |
Get the name of the field for the output buffer. More... | |
type(time_type) function | get_buffer_time (this) |
Get the buffer_time from a output buffer object. More... | |
pure integer function | get_diurnal_sample_size (this) |
Get diurnal sample size (amount of diurnal sections) More... | |
integer function | get_field_id (this) |
Get the field id of the buffer. More... | |
subroutine | get_remapped_diurnal_data (this, res) |
Remaps the output buffer array when using the diurnal reduction moves the diurnal index to the left-most unused dimension for the io. More... | |
integer function | get_unlim_dim (this) |
Get the unlim dimension index of the buffer object. More... | |
integer function | get_yaml_id (this) |
Get the yaml id of the buffer. More... | |
subroutine | increase_unlim_dim (this) |
Increase the unlim dimension index of the buffer object. More... | |
subroutine | init_buffer_time (this, time) |
inits the buffer time for the buffer More... | |
subroutine | init_buffer_unlim_dim (this) |
Init the unlim dimension index of the buffer object to 0. More... | |
subroutine | initialize_buffer (this, reduction_method, field_name) |
Initializes a buffer based on the reduction method. More... | |
logical function | is_done_with_math (this) |
Determine if finished with math. More... | |
logical function | is_there_data_to_write (this) |
Determine if there is any data to write (i.e send_data has been called) More... | |
logical function | is_time_to_finish_reduction (this, end_time) |
Determine if it is time to finish the reduction method. More... | |
subroutine | set_buffer_id (this, id) |
Setter for buffer_id for any buffer objects. More... | |
subroutine | set_diurnal_sample_size (this, sample_size) |
Set diurnal sample size (amount of diurnal sections) More... | |
subroutine | set_diurnal_section_index (this, time) |
Set diurnal section index based off the current time and previously set diurnal_samplesize Calculates which diurnal section of daily data the current time is in. More... | |
subroutine | set_done_with_math (this) |
Set done_with_math to .true. More... | |
subroutine | set_field_id (this, field_id) |
set the field id of the buffer More... | |
subroutine | set_next_output (this, next_output, next_next_output, is_static) |
Sets the next output. More... | |
subroutine | set_send_data_called (this) |
Sets send_data_called to .true. More... | |
subroutine | set_yaml_id (this, yaml_id) |
set the field id of the buffer More... | |
subroutine | update_buffer_time (this, time) |
Update the buffer time if it is a new time. More... | |
subroutine | write_buffer (this, fms2io_fileobj, unlim_dim_level, is_diurnal) |
Write the buffer to the file. More... | |
subroutine | write_buffer_wrapper_domain (this, fms2io_fileobj, unlim_dim_level, is_diurnal) |
Write the buffer to the FmsNetcdfDomainFile_t fms2io_fileobj. More... | |
subroutine | write_buffer_wrapper_netcdf (this, fms2io_fileobj, unlim_dim_level, is_diurnal) |
Write the buffer to the FmsNetcdfFile_t fms2io_fileobj. More... | |
subroutine | write_buffer_wrapper_u (this, fms2io_fileobj, unlim_dim_level, is_diurnal) |
Write the buffer to the FmsNetcdfUnstructuredDomainFile_t fms2io_fileobj. More... | |
Contains buffer types and routines for the diag manager.
@description Holds buffered data for fmsDiagVars_type objects buffer0-5d types extend fmsDiagBuffer_class, and upon allocation are added to the module's buffer_lists depending on it's dimension
|
private |
Adds the axis ids to the buffer object.
[in,out] | this | Buffer object |
[in] | axis_ids | Axis ids to add |
Definition at line 318 of file fms_diag_output_buffer.F90.
|
private |
Allocates a 5D buffer to given buff_type.
[in,out] | this | 5D buffer object |
[in] | buff_type | allocates to the type of buff_type |
[in] | ndim | Number of dimension |
[in] | buff_sizes | dimension buff_sizes |
[in] | mask_variant | Mask changes over time |
[in] | field_name | field name for error output |
[in] | diurnal_samples | number of diurnal samples |
Definition at line 159 of file fms_diag_output_buffer.F90.
|
private |
Finishes calculations for any reductions that use an average (avg, rms, pow) TODO add mask and any other needed args for adjustment, and pass in the adjusted mask to time_update_done.
[in,out] | this | Updated buffer object |
[in] | reduction_method | enumerated reduction type from diag_data |
[in] | missing_value | missing_value for masked data points |
[in] | has_mask | indicates if there was a mask used during buffer updates |
[in] | mask_variant | Indicates if the mask changes over time |
Definition at line 774 of file fms_diag_output_buffer.F90.
|
private |
Does the time_min reduction method on the buffer object.
[in,out] | this | buffer object to write |
[in] | field_data | Buffer data for current time |
[in] | bounds_in | Indicies for the buffer passed in |
[in] | bounds_out | Indicies for the output buffer |
[in] | mask | Mask for the field |
[in] | is_masked | .True. if the field has a mask |
[in] | missing_value | Missing_value for data points that are masked |
Definition at line 684 of file fms_diag_output_buffer.F90.
|
private |
Does the time_min reduction method on the buffer object.
[in,out] | this | buffer object to write |
[in] | field_data | Buffer data for current time |
[in] | bounds_in | Indicies for the buffer passed in |
[in] | bounds_out | Indicies for the output buffer |
[in] | mask | Mask for the field |
[in] | is_masked | .True. if the field has a mask |
[in] | missing_value | Missing_value for data points that are masked |
Definition at line 650 of file fms_diag_output_buffer.F90.
|
private |
Does the time_none reduction method on the buffer object.
[in,out] | this | buffer object to write |
[in] | field_data | Buffer data for current time |
[in] | bounds_in | Indicies for the buffer passed in |
[in] | bounds_out | Indicies for the output buffer |
[in] | mask | Mask for the field |
[in] | is_masked | .True. if the field has a mask |
[in] | missing_value | Missing_value for data points that are masked |
Definition at line 616 of file fms_diag_output_buffer.F90.
|
private |
Does the time_sum reduction method on the buffer object.
[in,out] | this | buffer object to write |
[in] | field_data | Buffer data for current time |
[in] | bounds_in | Indicies for the buffer passed in |
[in] | bounds_out | Indicies for the output buffer |
[in] | mask | Mask for the field |
[in] | is_masked | .True. if the field has a mask |
[in] | mask_variant | .True. if the mask changes over time |
[in] | missing_value | Missing_value for data points that are masked |
[in] | has_missing_value | .True. if the field was registered with a missing value |
[in] | pow_value | power value, will calculate field_data^pow before adding to buffer should only be present if using pow reduction method |
[in] | weight | The weight to use when suming |
Definition at line 718 of file fms_diag_output_buffer.F90.
|
private |
Deallocates data fields from a buffer object.
[in,out] | this | any buffer object |
Definition at line 143 of file fms_diag_output_buffer.F90.
logical function, public fms_diag_output_buffer_mod::fms_diag_output_buffer_init | ( | type(fmsdiagoutputbuffer_type), dimension(:), intent(out), allocatable | buffobjs, |
integer, intent(in) | buff_list_size | ||
) |
Initializes a list of diag buffers.
[out] | buffobjs | an array of buffer container types to allocate |
[in] | buff_list_size | size of buffer array to allocate |
Definition at line 122 of file fms_diag_output_buffer.F90.
|
private |
Get the axis_ids for the buffer.
[in,out] | this | Buffer object |
Definition at line 327 of file fms_diag_output_buffer.F90.
|
private |
Get routine for 5D buffers. Sets the buff_out argument to the integer or real array currently stored in the buffer.
[in] | this | 5d allocated buffer object |
[out] | buff_out | output of copied buffer data must be the same size as the allocated buffer |
[in] | field_name | field name for error output |
Definition at line 219 of file fms_diag_output_buffer.F90.
|
private |
this leaves out the diurnal index cause its only used for tmp mask allocation
[in] | this | buffer object to get from |
Definition at line 799 of file fms_diag_output_buffer.F90.
|
private |
Get the name of the field for the output buffer.
[in] | this | Buffer object |
Definition at line 308 of file fms_diag_output_buffer.F90.
|
private |
Get the buffer_time from a output buffer object.
[in] | this | Buffer object |
Definition at line 418 of file fms_diag_output_buffer.F90.
|
private |
Get diurnal sample size (amount of diurnal sections)
[in] | this | buffer object to get from |
Definition at line 806 of file fms_diag_output_buffer.F90.
|
private |
Get the field id of the buffer.
[in] | this | Buffer object |
Definition at line 341 of file fms_diag_output_buffer.F90.
|
private |
Remaps the output buffer array when using the diurnal reduction moves the diurnal index to the left-most unused dimension for the io.
[in] | this | output buffer object |
[out] | res | resulting remapped data |
Definition at line 837 of file fms_diag_output_buffer.F90.
|
private |
Get the unlim dimension index of the buffer object.
[in] | this | buffer object to write |
Definition at line 457 of file fms_diag_output_buffer.F90.
|
private |
Get the yaml id of the buffer.
[in] | this | Buffer object |
Definition at line 446 of file fms_diag_output_buffer.F90.
|
private |
Increase the unlim dimension index of the buffer object.
[in,out] | this | buffer object to write |
Definition at line 466 of file fms_diag_output_buffer.F90.
|
private |
inits the buffer time for the buffer
[in,out] | this | Buffer object |
[in] | time | time to add to the buffer |
Definition at line 366 of file fms_diag_output_buffer.F90.
|
private |
Init the unlim dimension index of the buffer object to 0.
[in,out] | this | buffer object to write |
Definition at line 473 of file fms_diag_output_buffer.F90.
|
private |
Initializes a buffer based on the reduction method.
[in,out] | this | allocated 5D buffer object |
[in] | reduction_method | The reduction method for the field |
[in] | field_name | field name for error output |
Definition at line 255 of file fms_diag_output_buffer.F90.
|
private |
Determine if finished with math.
[in] | this | Buffer object |
Definition at line 428 of file fms_diag_output_buffer.F90.
|
private |
Determine if there is any data to write (i.e send_data has been called)
[in] | this | Buffer object |
Definition at line 894 of file fms_diag_output_buffer.F90.
|
private |
Determine if it is time to finish the reduction method.
[in,out] | this | Buffer object |
[in] | end_time | The time at the end of the run |
Definition at line 909 of file fms_diag_output_buffer.F90.
|
private |
Setter for buffer_id for any buffer objects.
[in,out] | this | buffer object to set id for |
[in] | id | positive integer id to set |
Definition at line 135 of file fms_diag_output_buffer.F90.
|
private |
Set diurnal sample size (amount of diurnal sections)
[in,out] | this | buffer object to set sample size for |
[in] | sample_size | sample size to used to split daily data into given amount of sections |
Definition at line 812 of file fms_diag_output_buffer.F90.
|
private |
Set diurnal section index based off the current time and previously set diurnal_samplesize Calculates which diurnal section of daily data the current time is in.
[in,out] | this | buffer object to set diurnal index for |
[in] | time | current model time |
Definition at line 821 of file fms_diag_output_buffer.F90.
|
private |
Set done_with_math to .true.
[in,out] | this | Buffer object |
Definition at line 437 of file fms_diag_output_buffer.F90.
|
private |
set the field id of the buffer
[in,out] | this | Buffer object |
[in] | field_id | field id of the buffer |
Definition at line 350 of file fms_diag_output_buffer.F90.
|
private |
Sets the next output.
[in,out] | this | Buffer object |
[in] | next_output | The current next_output in the file obj |
[in] | next_next_output | The current next_next_output in the file obj |
[in] | is_static | .True. if the field is static |
[in] | is_static | If the field is static set the next_output to be equal to time this should only be used in the init, so next_output will be equal to the the init time |
[in] | is_static | If the file's next_output is greater than the buffer's next output set the buffer's next output to the file's next_ouput, otherwise use the file's next_next_output This is needed for when file have fields that get data send data sent at different frequencies |
Definition at line 380 of file fms_diag_output_buffer.F90.
|
private |
Sets send_data_called to .true.
[in,out] | this | Buffer object |
Definition at line 925 of file fms_diag_output_buffer.F90.
|
private |
set the field id of the buffer
[in,out] | this | Buffer object |
[in] | yaml_id | yaml id of the buffer |
Definition at line 358 of file fms_diag_output_buffer.F90.
|
private |
Update the buffer time if it is a new time.
[in,out] | this | Buffer object |
[in] | time | Current model time |
Definition at line 407 of file fms_diag_output_buffer.F90.
|
private |
Write the buffer to the file.
[in,out] | this | buffer object to write |
[in] | fms2io_fileobj | fileobj to write to |
[in] | unlim_dim_level | unlimited dimension |
[in] | is_diurnal | should be set if using diurnal reductions so buffer data can be remapped |
Definition at line 480 of file fms_diag_output_buffer.F90.
|
private |
Write the buffer to the FmsNetcdfDomainFile_t fms2io_fileobj.
[in] | this | buffer object to write |
[in] | fms2io_fileobj | fileobj to write to |
[in] | unlim_dim_level | unlimited dimension |
[in] | is_diurnal | should be set if using diurnal reductions so buffer data can be remapped |
Definition at line 541 of file fms_diag_output_buffer.F90.
|
private |
Write the buffer to the FmsNetcdfFile_t fms2io_fileobj.
[in] | this | buffer object to write |
[in] | fms2io_fileobj | fileobj to write to |
[in] | unlim_dim_level | unlimited dimension |
[in] | is_diurnal | should be set if using diurnal reductions so buffer data can be remapped |
Definition at line 505 of file fms_diag_output_buffer.F90.
|
private |
Write the buffer to the FmsNetcdfUnstructuredDomainFile_t fms2io_fileobj.
[in] | this | buffer object to write |
[in] | fms2io_fileobj | fileobj to write to |
[in] | unlim_dim_level | unlimited dimension |
[in] | is_diurnal | should be set if using diurnal reductions so buffer data can be remapped |
Definition at line 578 of file fms_diag_output_buffer.F90.