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.

More…

Data Types

buffer_base

<undocumented>

buffer_2d

Holds a 2d field.

buffer_3d

Holds a 3d field.

diag_buffer_base

The base class for the diagnostic buffers in this module.

diag_buffer_2d

Dynamically growing buffer for 2D arrays.

diag_buffer_3d

Dynamically growing buffer for 3D arrays.

Functions/Subroutines

a_grow()

Signature for the grow methods on n-dimension diagnostic buffer types.

set_fill_value()

Set the fill value to use when growing the buffer.

mark_available()

Mark a slot in the buffer as unused based on a diagnostic id.

find_buffer_slot()

Return the slot of the buffer corresponding to the diagnostic id.

grow_ids()

Grow the ids array by one.

check_capacity_by_id()

Check whether the id already has a slot reserved.

set_horizontal_extents()

Set the horizontal extents of the buffer.

set_vertical_extent()

Set the vertical extent of the buffer.

set_extents_from_array_2d()

Set the extents of a 2D buffer from the bounds of a 2D array.

set_extents_from_array_3d()

Set the extents of a 3D buffer from the bounds of a 3D array.

grow_2d()

Grow a 2d diagnostic buffer.

store_2d()

Store a 2D array into this buffer.

grow_3d()

Grow a 2d diagnostic buffer.

store_3d()

Store a 3d array into this buffer.

diag_buffer_unit_tests_2d()

Unit tests for the 2d version of the diag buffer.

diag_buffer_unit_tests_3d()

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_base

[source]

type  mom_diag_buffers/buffer_2d

Holds a 2d field.

Type fields:
  • % field :: real, dimension(:,:), allocatable, private The actual 2d field to be stored [arbitrary].

[source]

type  mom_diag_buffers/buffer_3d

Holds a 3d field.

Type fields:
  • % field :: real, dimension(:,:,:), allocatable, private The actual 3d field to be stored [arbitrary].

[source]

type  mom_diag_buffers/diag_buffer_base

The base class for the diagnostic buffers in this module.

Type fields:
  • % is :: integer, private The start slot of the array i-direction.

  • % js :: integer, private The start slot of the array j-direction.

  • % ie :: integer, private The end slot of the array i-direction.

  • % je :: integer, private The end slot of the array j-direction.

  • % fill_value :: real, private Set the fill value to use when growing the buffer [arbitrary].

  • % ids :: integer, dimension(:), allocatable, private List of diagnostic ids whose slot corresponds to the row in the buffer.

  • % length :: integer, private The number of slots in the buffer.

  • % grow :: procedure(a_grow), deferred, private Increase the size of the buffer.

  • % set_fill_value :: procedure, public Set the fill value to use when growing the buffer.

  • % check_capacity_by_id :: procedure, public Check the size size of the buffer and increase if necessary.

  • % set_horizontal_extents :: procedure, public Define the horizontal extents of the arrays.

  • % mark_available :: procedure, public Mark that a slot in the buffer can be reused.

  • % grow_ids :: procedure, public Increase the size of the vector storing diagnostic ids.

  • % find_buffer_slot :: procedure, public Find the slot corresponding to a specific diagnostic id.

[source]

type  mom_diag_buffers/diag_buffer_2d

Dynamically growing buffer for 2D arrays.

Type fields:
  • % buffer :: type(buffer_2d), dimension(:), allocatable, public The actual 2D buffer which will dynamically grow.

  • % grow :: procedure, public Increase the size of the buffer.

  • % store :: procedure, public Store a field in the buffer, increasing as necessary.

  • % set_extents_from_array :: procedure, public Set extents from array bounds.

[source]

type  mom_diag_buffers/diag_buffer_3d

Dynamically growing buffer for 3D arrays.

Type fields:
  • % buffer :: type(buffer_3d), dimension(:), allocatable, public The actual 2D buffer which will dynamically grow.

  • % ks :: integer The start slot in the k-dimension.

  • % ke :: integer The last slot in the k-dimension.

  • % set_vertical_extent :: procedure, public Set the vertical extents of the buffer.

  • % grow :: procedure, public Increase the size of the buffer.

  • % store :: procedure, public Store a field in the buffer, increasing as necessary.

  • % set_extents_from_array :: procedure, public Set extents from array bounds.

[source]

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

[source]

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 buffer

  • fill_value :: fill_value [in] The fill value to use when growing the buffer [arbitrary]

[source]

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 buffer

  • id :: id [in] The diagnostic id

[source]

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 buffer

  • id :: id [in] The diagnostic id

Return:

undefined :: The slot in the buffer corresponding to the diagnostic id

[source]

subroutine mom_diag_buffers/grow_ids(this)

Grow the ids array by one.

Parameters:

this :: this [inout] This buffer

[source]

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 buffer

  • id :: id [in] The diagnostic id

[source]

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 buffer

  • is :: is [in] The start slot of the array i-direction

  • ie :: ie [in] The end slot of the array i-direction

  • js :: js [in] The start slot of the array j-direction

  • je :: je [in] The end slot of the array j-direction

[source]

subroutine mom_diag_buffers/set_vertical_extent(this, ks, ke)

Set the vertical extent of the buffer.

Parameters:
  • this :: this [inout] The diagnostic buffer

  • ks :: ks [in] The start slot of the array i-direction

  • ke :: ke [in] The end slot of the array i-direction

[source]

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 buffer

  • array :: array [in] The array whose bounds define the buffer extents

  • fill_value_in :: fill_value_in [in] Optional fill value

[source]

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 buffer

  • array :: array [in] The array whose bounds define the buffer extents

  • fill_value_in :: fill_value_in [in] Optional fill value

[source]

subroutine mom_diag_buffers/grow_2d(this)

Grow a 2d diagnostic buffer.

[source]

subroutine mom_diag_buffers/store_2d(this, data, id)

Store a 2D array into this buffer.

Parameters:
  • this :: this [inout] This 2d buffer

  • data :: data [in] The data to be stored in the buffer [arbitrary]

  • id :: id [in] The diagnostic id

[source]

subroutine mom_diag_buffers/grow_3d(this)

Grow a 2d diagnostic buffer.

[source]

subroutine mom_diag_buffers/store_3d(this, data, id)

Store a 3d array into this buffer.

Parameters:
  • this :: this [inout] This 3d buffer

  • data :: data [in] The data to be stored in the buffer [arbitrary]

  • id :: id [in] The diagnostic id

[source]

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_2d grow_buffer_2d new_buffer_2d reuse_buffer_2d mom_io::stdout store_buffer_2d

Called from:

mom_unit_tests::unit_tests

[source]

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_3d grow_buffer_3d new_buffer_3d reuse_buffer_3d mom_io::stdout store_buffer_3d

Called from:

mom_unit_tests::unit_tests

[source]

[source]