io_decomp_patch_to_land_patch Function

public function io_decomp_patch_to_land_patch(land_decomp_start, cstart, nap, mem_shape_spec, var_shape_spec, type) result(decomp)

Returns a parallel I/O decomposition mapping from a memory layout with a local 'patch' dimension to a netCDF variable layout with a global 'land' dimension and a 'patch' dimension.

Note that the 'patch' dimension in the memory layout represents the index in the 1-dimensional vector of patches, and in the netCDF variable layout, the 'patch' dimension represents the index of the patch on a particular land point. The mapping from patch index to land point is determined by cstart and nap, and the mapping from land point to global land index is determined by land_decomp_start.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: land_decomp_start

The starting index of the first local 'land' index along global 'land' dimension.

integer, intent(in) :: cstart(:)

The starting patch index for each land point.

integer, intent(in) :: nap(:)

The number of active patches for each land point.

type(dim_spec_t), intent(in) :: mem_shape_spec(:)

An array of dim_spec_t describing the shape and dimension names of the in-memory array. mem_shape_spec must include a dimension with name 'patch' which is used to map to the global land and patch dimensions.

type(dim_spec_t), intent(in) :: var_shape_spec(:)

An array of dim_spec_t describing the shape and dimension names of the netCDF variable. var_shape_spec must include dimensions with names land and patch which are used to map from the 'patch' dimension described by mem_shape_spec.

integer, intent(in) :: type

The data type of the variable for which the decomposition is being created using CABLE_NETCDF_TYPE_* constants from cable_netcdf_mod.

Return Value class(cable_netcdf_decomp_t), allocatable