mom_diag_buffers module reference
Provides buffers that can dynamically grow as needed. These are primarily intended for the diagnostics which need to store intermediate or partial states of state variables.
Data Types
<undocumented> |
|
Holds a 2d field. |
|
Holds a 3d field. |
|
The base class for the diagnostic buffers in this module. |
|
Dynamically growing buffer for 2D arrays. |
|
Dynamically growing buffer for 3D arrays. |
Functions/Subroutines
Signature for the grow methods on n-dimension diagnostic buffer types. |
|
Set the fill value to use when growing the buffer. |
|
Mark a slot in the buffer as unused based on a diagnostic id. |
|
Return the slot of the buffer corresponding to the diagnostic id. |
|
Grow the ids array by one. |
|
Check whether the id already has a slot reserved. |
|
Set the horizontal extents of the buffer. |
|
Set the vertical extent of the buffer. |
|
Set the extents of a 2D buffer from the bounds of a 2D array. |
|
Set the extents of a 3D buffer from the bounds of a 3D array. |
|
Grow a 2d diagnostic buffer. |
|
Store a 2D array into this buffer. |
|
Grow a 2d diagnostic buffer. |
|
Store a 3d array into this buffer. |
|
Unit tests for the 2d version of the diag buffer. |
|
Test the 3d version of the buffer. |
Detailed Description
Provides buffers that can dynamically grow as needed. These are primarily intended for the diagnostics which need to store intermediate or partial states of state variables.
Type Documentation
- type mom_diag_buffers/buffer_2d
Holds a 2d field.
- Type fields:
% field ::
real, dimension(:,:), allocatable, privateThe actual 2d field to be stored [arbitrary].
- type mom_diag_buffers/buffer_3d
Holds a 3d field.
- Type fields:
% field ::
real, dimension(:,:,:), allocatable, privateThe actual 3d field to be stored [arbitrary].
- type mom_diag_buffers/diag_buffer_base
The base class for the diagnostic buffers in this module.
- Type fields:
% is ::
integer, privateThe start slot of the array i-direction.% js ::
integer, privateThe start slot of the array j-direction.% ie ::
integer, privateThe end slot of the array i-direction.% je ::
integer, privateThe end slot of the array j-direction.% fill_value ::
real, privateSet the fill value to use when growing the buffer [arbitrary].% ids ::
integer, dimension(:), allocatable, privateList of diagnostic ids whose slot corresponds to the row in the buffer.% length ::
integer, privateThe number of slots in the buffer.% grow ::
procedure(a_grow), deferred, privateIncrease the size of the buffer.% set_fill_value ::
procedure, publicSet the fill value to use when growing the buffer.% check_capacity_by_id ::
procedure, publicCheck the size size of the buffer and increase if necessary.% set_horizontal_extents ::
procedure, publicDefine the horizontal extents of the arrays.% mark_available ::
procedure, publicMark that a slot in the buffer can be reused.% grow_ids ::
procedure, publicIncrease the size of the vector storing diagnostic ids.% find_buffer_slot ::
procedure, publicFind the slot corresponding to a specific diagnostic id.
- type mom_diag_buffers/diag_buffer_2d
Dynamically growing buffer for 2D arrays.
- Type fields:
% buffer ::
type(buffer_2d), dimension(:), allocatable, publicThe actual 2D buffer which will dynamically grow.% grow ::
procedure, publicIncrease the size of the buffer.% store ::
procedure, publicStore a field in the buffer, increasing as necessary.% set_extents_from_array ::
procedure, publicSet extents from array bounds.
- type mom_diag_buffers/diag_buffer_3d
Dynamically growing buffer for 3D arrays.
- Type fields:
% buffer ::
type(buffer_3d), dimension(:), allocatable, publicThe actual 2D buffer which will dynamically grow.% ks ::
integerThe start slot in the k-dimension.% ke ::
integerThe last slot in the k-dimension.% set_vertical_extent ::
procedure, publicSet the vertical extents of the buffer.% grow ::
procedure, publicIncrease the size of the buffer.% store ::
procedure, publicStore a field in the buffer, increasing as necessary.% set_extents_from_array ::
procedure, publicSet extents from array bounds.
Function/Subroutine Documentation
- subroutine mom_diag_buffers/a_grow(this)
Signature for the grow methods on n-dimension diagnostic buffer types.
- Parameters:
this ::
this[inout] The diagnostic buffer
- subroutine mom_diag_buffers/set_fill_value(this, fill_value)
Set the fill value to use when growing the buffer.
- Parameters:
this ::
this[inout] The diagnostic bufferfill_value ::
fill_value[in] The fill value to use when growing the buffer [arbitrary]
- subroutine mom_diag_buffers/mark_available(this, id)
Mark a slot in the buffer as unused based on a diagnostic id. For example, the data in that slot has already been consumed and can thus be overwritten.
- Parameters:
this ::
this[inout] The diagnostic bufferid ::
id[in] The diagnostic id
- function mom_diag_buffers/find_buffer_slot(this, id)
Return the slot of the buffer corresponding to the diagnostic id.
- Parameters:
this ::
this[in] The diagnostic bufferid ::
id[in] The diagnostic id
- Return:
undefined :: The slot in the buffer corresponding to the diagnostic id
- subroutine mom_diag_buffers/grow_ids(this)
Grow the ids array by one.
- Parameters:
this ::
this[inout] This buffer
- function mom_diag_buffers/check_capacity_by_id(this, id)
Check whether the id already has a slot reserved. If not, find a new empty slot and if need be, grow the buffer.
- Parameters:
this ::
this[inout] This 2d bufferid ::
id[in] The diagnostic id
- subroutine mom_diag_buffers/set_horizontal_extents(this, is, ie, js, je)
Set the horizontal extents of the buffer.
- Parameters:
this ::
this[inout] The diagnostic bufferis ::
is[in] The start slot of the array i-directionie ::
ie[in] The end slot of the array i-directionjs ::
js[in] The start slot of the array j-directionje ::
je[in] The end slot of the array j-direction
- subroutine mom_diag_buffers/set_vertical_extent(this, ks, ke)
Set the vertical extent of the buffer.
- Parameters:
this ::
this[inout] The diagnostic bufferks ::
ks[in] The start slot of the array i-directionke ::
ke[in] The end slot of the array i-direction
- subroutine mom_diag_buffers/set_extents_from_array_2d(this, array, fill_value_in)
Set the extents of a 2D buffer from the bounds of a 2D array.
- Parameters:
this ::
this[inout] The diagnostic bufferarray ::
array[in] The array whose bounds define the buffer extentsfill_value_in ::
fill_value_in[in] Optional fill value
- subroutine mom_diag_buffers/set_extents_from_array_3d(this, array, fill_value_in)
Set the extents of a 3D buffer from the bounds of a 3D array.
- Parameters:
this ::
this[inout] The diagnostic bufferarray ::
array[in] The array whose bounds define the buffer extentsfill_value_in ::
fill_value_in[in] Optional fill value
- subroutine mom_diag_buffers/store_2d(this, data, id)
Store a 2D array into this buffer.
- Parameters:
this ::
this[inout] This 2d bufferdata ::
data[in] The data to be stored in the buffer [arbitrary]id ::
id[in] The diagnostic id
- subroutine mom_diag_buffers/store_3d(this, data, id)
Store a 3d array into this buffer.
- Parameters:
this ::
this[inout] This 3d bufferdata ::
data[in] The data to be stored in the buffer [arbitrary]id ::
id[in] The diagnostic id
- function mom_diag_buffers/diag_buffer_unit_tests_2d(verbose)
Unit tests for the 2d version of the diag buffer.
- Parameters:
verbose ::
verbose[in] If true, write results to stdout- Return:
undefined :: True if any of the unit tests fail
- Call to:
fill_value_2dgrow_buffer_2dnew_buffer_2dreuse_buffer_2dmom_io::stdoutstore_buffer_2d- Called from:
- function mom_diag_buffers/diag_buffer_unit_tests_3d(verbose)
Test the 3d version of the buffer.
- Parameters:
verbose ::
verbose[in] If true, write results to stdout- Return:
undefined :: True if any of the unit tests fail
- Call to:
fill_value_3dgrow_buffer_3dnew_buffer_3dreuse_buffer_3dmom_io::stdoutstore_buffer_3d- Called from: