cable_output_common_smod Submodule

Internal interfaces and procedures for cable_output_mod.

This module declares interfaces for the procedures that are used by cable_output_impl, as well as various utilities used in other parts of the output system.



Interfaces

interface

Interfaces for procedures used by cable_output_impl.

  • module subroutine cable_output_decomp_init()

    Intialises I/O decompositions used in the output system.

    Arguments

    None

interface

Interfaces for procedures used by cable_output_impl.

  • module subroutine cable_output_decomp_free()

    Deallocates I/O decompositions used in the output system.

    Arguments

    None

interface

Interfaces for procedures used by cable_output_impl.

  • module subroutine cable_output_decomp_associate(output_stream, output_var, decomp)

    Associates an I/O decomposition pointer with the appropriate I/O decomposition, taking into account the output variable shape and type, and the output stream grid type.

    Arguments

    Type IntentOptional Attributes Name
    type(cable_output_stream_t), intent(in) :: output_stream

    The output stream for which to associate the decomposition.

    type(cable_output_variable_t), intent(in) :: output_var

    The output variable for which to associate the decomposition.

    class(cable_netcdf_decomp_t), intent(inout), pointer :: decomp

    The decomposition pointer to associate.

interface

Interfaces for procedures used by cable_output_impl.

  • module subroutine cable_output_define_stream(output_stream, restart)

    Defines all variables, dimensions and attributes for a given output stream.

    Arguments

    Type IntentOptional Attributes Name
    type(cable_output_stream_t), intent(inout) :: output_stream

    The output stream to define.

    logical, intent(in), optional :: restart

    Whether this is a restart stream definition. Set to .false. by default.

interface

Interfaces for procedures used by cable_output_impl.

  • module subroutine cable_output_reduction_buffers_init()

    Initialises the buffers used for performing grid reductions in the output system.

    Arguments

    None

interface

Interfaces for procedures used by cable_output_impl.

  • module subroutine cable_output_reduction_buffers_free()

    Deallocates the buffers used for performing grid reductions in the output system.

    Arguments

    None

interface

Interfaces for procedures used by cable_output_impl.

  • module subroutine cable_output_write_variable(output_stream, output_variable, patch, landpt, frame, restart)

    Writes a variable to the output stream.

    Arguments

    Type IntentOptional Attributes Name
    type(cable_output_stream_t), intent(inout) :: output_stream

    The output stream to write to.

    type(cable_output_variable_t), intent(inout), target :: output_variable

    The variable to write.

    type(patch_type), intent(in), optional :: patch(:)

    The patch type instance for performing grid reductions over the patch dimension if required.

    type(land_type), intent(in), optional :: landpt(:)

    The land type instance for performing grid reductions over the patch dimension if required.

    integer, intent(in), optional :: frame

    The frame or unlimited dimension index to write at.

    logical, intent(in), optional :: restart

    Whether this is a restart stream write.

Interface for associating a pointer array with the the appropriate reduction buffer, taking into account the output variable shape, type and reduction method.

  • module subroutine cable_output_reduction_buffers_associate_1d_int32(output_var, temp_buffer)

    The reduction buffer association subroutine for 1D 32-bit integer variables.

    Arguments

    Type IntentOptional Attributes Name
    type(cable_output_variable_t), intent(inout) :: output_var

    The output variable for which to associate the reduction buffer.

    integer(kind=int32), intent(inout), pointer :: temp_buffer(:)

    The pointer array to associate with the appropriate reduction buffer.

  • module subroutine cable_output_reduction_buffers_associate_1d_real32(output_var, temp_buffer)

    The reduction buffer association subroutine for 1D 32-bit real variables.

    Arguments

    Type IntentOptional Attributes Name
    type(cable_output_variable_t), intent(inout) :: output_var

    The output variable for which to associate the reduction buffer.

    real(kind=real32), intent(inout), pointer :: temp_buffer(:)

    The pointer array to associate with the appropriate reduction buffer.

  • module subroutine cable_output_reduction_buffers_associate_1d_real64(output_var, temp_buffer)

    The reduction buffer association subroutine for 1D 64-bit real variables.

    Arguments

    Type IntentOptional Attributes Name
    type(cable_output_variable_t), intent(inout) :: output_var

    The output variable for which to associate the reduction buffer.

    real(kind=real64), intent(inout), pointer :: temp_buffer(:)

    The pointer array to associate with the appropriate reduction buffer.

  • module subroutine cable_output_reduction_buffers_associate_2d_int32(output_var, temp_buffer)

    The reduction buffer association subroutine for 2D 32-bit integer variables.

    Arguments

    Type IntentOptional Attributes Name
    type(cable_output_variable_t), intent(inout) :: output_var

    The output variable for which to associate the reduction buffer.

    integer(kind=int32), intent(inout), pointer :: temp_buffer(:,:)

    The pointer array to associate with the appropriate reduction buffer.

  • module subroutine cable_output_reduction_buffers_associate_2d_real32(output_var, temp_buffer)

    The reduction buffer association subroutine for 2D 32-bit real variables.

    Arguments

    Type IntentOptional Attributes Name
    type(cable_output_variable_t), intent(inout) :: output_var

    The output variable for which to associate the reduction buffer.

    real(kind=real32), intent(inout), pointer :: temp_buffer(:,:)

    The pointer array to associate with the appropriate reduction buffer.

  • module subroutine cable_output_reduction_buffers_associate_2d_real64(output_var, temp_buffer)

    The reduction buffer association subroutine for 2D 64-bit real variables.

    Arguments

    Type IntentOptional Attributes Name
    type(cable_output_variable_t), intent(inout) :: output_var

    The output variable for which to associate the reduction buffer.

    real(kind=real64), intent(inout), pointer :: temp_buffer(:,:)

    The pointer array to associate with the appropriate reduction buffer.

  • module subroutine cable_output_reduction_buffers_associate_3d_int32(output_var, temp_buffer)

    The reduction buffer association subroutine for 3D 32-bit integer variables.

    Arguments

    Type IntentOptional Attributes Name
    type(cable_output_variable_t), intent(inout) :: output_var

    The output variable for which to associate the reduction buffer.

    integer(kind=int32), intent(inout), pointer :: temp_buffer(:,:,:)

    The pointer array to associate with the appropriate reduction buffer.

  • module subroutine cable_output_reduction_buffers_associate_3d_real32(output_var, temp_buffer)

    The reduction buffer association subroutine for 3D 32-bit real variables.

    Arguments

    Type IntentOptional Attributes Name
    type(cable_output_variable_t), intent(inout) :: output_var

    The output variable for which to associate the reduction buffer.

    real(kind=real32), intent(inout), pointer :: temp_buffer(:,:,:)

    The pointer array to associate with the appropriate reduction buffer.

  • module subroutine cable_output_reduction_buffers_associate_3d_real64(output_var, temp_buffer)

    The reduction buffer association subroutine for 3D 64-bit real variables.

    Arguments

    Type IntentOptional Attributes Name
    type(cable_output_variable_t), intent(inout) :: output_var

    The output variable for which to associate the reduction buffer.

    real(kind=real64), intent(inout), pointer :: temp_buffer(:,:,:)

    The pointer array to associate with the appropriate reduction buffer.


Functions

function native_to_netcdf_dimensions(native_dimension, grid_type, reduction_method) result(netcdf_dimensions)

Returns the netCDF dimension(s) corresponding to a given output variable dimension, taking into account the output grid type and reduction method. This function is used to determine the dimensions of netCDF variables based on the in-memory data shapes of CABLE variables as described by cable_output_dim_t instances.

Arguments

Type IntentOptional Attributes Name
type(cable_output_dim_t), intent(in) :: native_dimension

The in-memory dimension.

character(len=*), intent(in) :: grid_type

The output grid type. See allowed_grid_types for the available grid types.

character(len=*), intent(in) :: reduction_method

The reduction method applied to the variable. See allowed_reduction_methods for the available reduction methods.

Return Value type(cable_output_dim_t), allocatable, (:)

function coordinate_variables_list(grid_type) result(coord_variables)

Returns a list of coordinate variables to be included in an output stream based on the output grid type.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: grid_type

The output grid type. See allowed_grid_types for the available grid types.

Return Value type(cable_output_variable_t), allocatable, (:)


Subroutines

subroutine check_variable_range(output_variable, time_index, met)

Checks whether the value(s) of an output variable are within their specified range of physical values.

Read more…

Arguments

Type IntentOptional Attributes Name
type(cable_output_variable_t), intent(in) :: output_variable

The output variable for which to check the range.

integer, intent(in) :: time_index

The current time step index, used for error messages.

type(met_type), intent(in), optional :: met

The met_type instance containing the current meteorological conditions, used for error messages.