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
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. For example, the data in that slot has already been consumed and can thus be overwritten |
|
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. If not, find a new empty slot and if need be, grow the buffer. |
|
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 |
Type Documentation
type, abstract :: buffer_base
- type, extends(buffer_base) :: buffer_2d
Holds a 2d field
- Parameters
field
The actual 2d field to be stored [arbitrary]
- type, extends(buffer_base) :: buffer_3d
Holds a 3d field
- Parameters
field
The actual 3d field to be stored [arbitrary]
- type, abstract :: diag_buffer_base
The base class for the diagnostic buffers in this module
- Parameters
is
The start slot of the array i-direction
js
The start slot of the array j-direction
ie
The end slot of the array i-direction
je
The end slot of the array j-direction
fill_value
Set the fill value to use when growing the buffer [arbitrary]
ids
List of diagnostic ids whose slot corresponds to the row in the buffer
length
The number of slots in the buffer
- type, extends(diag_buffer_base), public :: diag_buffer_2d
Dynamically growing buffer for 2D arrays.
- Parameters
buffer
The actual 2D buffer which will dynamically grow
- type, extends(diag_buffer_base), public :: diag_buffer_3d
Dynamically growing buffer for 3D arrays.
- Parameters
buffer
The actual 2D buffer which will dynamically grow
ks
The start slot in the k-dimension
ke
The last slot in the k-dimension
Functions/Subroutine Documentation
- subroutine a_grow(this)
Signature for the grow methods on n-dimension diagnostic buffer types
- Parameters
this [inout]
The diagnostic buffer
- subroutine set_fill_value(this, fill_value)
Set the fill value to use when growing the buffer
- Parameters
this [inout]
The diagnostic buffer
fill_value [in]
The fill value to use when growing the buffer [arbitrary]
- subroutine 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 [inout]
The diagnostic buffer
id [in]
The diagnostic id
- pure function find_buffer_slot(this, id) result(slot)
Return the slot of the buffer corresponding to the diagnostic id
- Parameters
this [in]
The diagnostic buffer
id [in]
The diagnostic id
slot
The slot in the buffer corresponding to the diagnostic id
- subroutine grow_ids(this)
Grow the ids array by one
- Parameters
this [inout]
This buffer
- impure function check_capacity_by_id(this, id) result(slot)
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 [inout]
This 2d buffer
id [in]
The diagnostic id
- subroutine set_horizontal_extents(this, is, ie, js, je)
Set the horizontal extents of the buffer
- Parameters
this [inout]
The diagnostic buffer
is [in]
The start slot of the array i-direction
ie [in]
The end slot of the array i-direction
js [in]
The start slot of the array j-direction
je [in]
The end slot of the array j-direction
- subroutine set_vertical_extent(this, ks, ke)
Set the vertical extent of the buffer
- Parameters
this [inout]
The diagnostic buffer
ks [in]
The start slot of the array k-direction
ke [in]
The end slot of the array k-direction
- subroutine 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 [inout]
The diagnostic buffer
array [in]
The array whose bounds define the buffer extents
fill_value_in [in]
Optional fill value
- subroutine 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 [inout]
The diagnostic buffer
array [in]
The array whose bounds define the buffer extents
fill_value_in [in]
Optional fill value
- subroutine grow_2d(this)
Grow a 2d diagnostic buffer
- subroutine store_2d(this, data, id)
Store a 2D array into this buffer
- Parameters
this [inout]
This 2d buffer
data [in]
The data to be stored in the buffer [arbitrary]
id [in]
The diagnostic id
- subroutine grow_3d(this)
Grow a 2d diagnostic buffer
- subroutine store_3d(this, data, id)
Store a 3d array into this buffer
- Parameters
this [inout]
This 3d buffer
data [in]
The data to be stored in the buffer [arbitrary]
id [in]
The diagnostic id
- function diag_buffer_unit_tests_2d(verbose) result(fail)
Unit tests for the 2d version of the diag buffer
- Parameters
verbose [in]
If true, write results to stdout
fail
True if any of the unit tests fail
Callees call graph
Text view
mom_diag_buffers::diag_buffer_unit_tests_2d → mom_diag_buffers::diag_buffer_unit_tests_2d::fill_value_2d
mom_diag_buffers::diag_buffer_unit_tests_2d → mom_diag_buffers::diag_buffer_unit_tests_2d::grow_buffer_2d
mom_diag_buffers::diag_buffer_unit_tests_2d → mom_diag_buffers::diag_buffer_unit_tests_2d::new_buffer_2d
mom_diag_buffers::diag_buffer_unit_tests_2d → mom_diag_buffers::diag_buffer_unit_tests_2d::reuse_buffer_2d
mom_diag_buffers::diag_buffer_unit_tests_2d → mom_diag_buffers::diag_buffer_unit_tests_2d::store_buffer_2d
Callers call graph
- function new_buffer_2d() result(local_fail)
Ensure properties of a newly initialized buffer
- Parameters
local_fail
True if any of the unit tests fail
Callers call graph
- function grow_buffer_2d() result(local_fail)
Test the growing of a buffer
- Parameters
local_fail
True if any of the unit tests fail
Callers call graph
- function fill_value_2d() result(local_fail)
Test that growing new buffer fills the array with a set fill value
- Parameters
local_fail
True if any of the unit tests fail
Callers call graph
- function store_buffer_2d() result(local_fail)
Test storing a buffer based on a unique id
- Parameters
local_fail
True if any of the unit tests fail
Callers call graph
- function reuse_buffer_2d() result(local_fail)
Test the reuse of a buffer. Fill it first like store_buffer_2d. Then, loop through again, but use the slots of the buffer in the following order: 2, 1, 3
- Parameters
local_fail
True if any of the unit tests fail
Callers call graph
- function diag_buffer_unit_tests_3d(verbose) result(fail)
Test the 3d version of the buffer
- Parameters
verbose [in]
If true, write results to stdout
fail
True if any of the unit tests fail
Callees call graph
Text view
mom_diag_buffers::diag_buffer_unit_tests_3d → mom_diag_buffers::diag_buffer_unit_tests_3d::fill_value_3d
mom_diag_buffers::diag_buffer_unit_tests_3d → mom_diag_buffers::diag_buffer_unit_tests_3d::grow_buffer_3d
mom_diag_buffers::diag_buffer_unit_tests_3d → mom_diag_buffers::diag_buffer_unit_tests_3d::new_buffer_3d
mom_diag_buffers::diag_buffer_unit_tests_3d → mom_diag_buffers::diag_buffer_unit_tests_3d::reuse_buffer_3d
mom_diag_buffers::diag_buffer_unit_tests_3d → mom_diag_buffers::diag_buffer_unit_tests_3d::store_buffer_3d
Callers call graph
- function new_buffer_3d() result(local_fail)
Ensure properties of a newly initialized buffer
- Parameters
local_fail
True if any of the unit tests fail
Callers call graph
- function grow_buffer_3d() result(local_fail)
Test the growing of a buffer
- Parameters
local_fail
True if any of the unit tests fail
Callers call graph
- function fill_value_3d() result(local_fail)
Test that growing new buffer fills the array with a set fill value
- Parameters
local_fail
True if any of the unit tests fail
Callers call graph
- function store_buffer_3d() result(local_fail)
Test storing a buffer based on a unique id
- Parameters
local_fail
True if any of the unit tests fail
Callers call graph
- function reuse_buffer_3d() result(local_fail)
Test the reuse of a buffer. Fill it first like store_buffer_3d. Then, loop through again, but use the slots of the buffer in the following order: 2, 1, 3
- Parameters
local_fail
True if any of the unit tests fail
Callers call graph