LatLonGridFactory Derived Type

type, public, extends(AbstractGridFactory) :: LatLonGridFactory


Inherits

type~~latlongridfactory~~InheritsGraph type~latlongridfactory LatLonGridFactory ESMF_DELayout ESMF_DELayout type~latlongridfactory->ESMF_DELayout layout type~abstractgridfactory AbstractGridFactory type~latlongridfactory->type~abstractgridfactory type~realminmax RealMinMax type~latlongridfactory->type~realminmax lon_range, lat_range ESMF_Grid ESMF_Grid type~abstractgridfactory->ESMF_Grid grid

Inherited by

type~~latlongridfactory~~InheritedByGraph type~latlongridfactory LatLonGridFactory type~test_latloncorners Test_LatLonCorners type~test_latloncorners->type~latlongridfactory factory type~test_latlongridfactory Test_LatLonGridFactory type~test_latlongridfactory->type~latlongridfactory factory

Constructor

public interface LatLonGridFactory

  • private function LatLonGridFactory_from_parameters(unusable, grid_name, im_world, jm_world, lm, nx, ny, ims, jms, pole, dateline, lon_range, lat_range, force_decomposition, rc) result(factory)

    Arguments

    Type IntentOptional Attributes Name
    class(KeywordEnforcer), intent(in), optional :: unusable
    character(len=*), intent(in), optional :: grid_name
    integer, intent(in), optional :: im_world
    integer, intent(in), optional :: jm_world
    integer, intent(in), optional :: lm
    integer, intent(in), optional :: nx
    integer, intent(in), optional :: ny
    integer, intent(in), optional :: ims(:)
    integer, intent(in), optional :: jms(:)
    character(len=2), intent(in), optional :: pole
    character(len=2), intent(in), optional :: dateline
    type(RealMinMax), intent(in), optional :: lon_range
    type(RealMinMax), intent(in), optional :: lat_range
    logical, intent(in), optional :: force_decomposition
    integer, intent(out), optional :: rc

    Return Value type(LatLonGridFactory)


Type-Bound Procedures

procedure, public :: add_horz_coordinates

  • private subroutine add_horz_coordinates(this, grid, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(in) :: this
    type(ESMF_Grid), intent(inout) :: grid
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

procedure, public :: append_metadata

  • private subroutine append_metadata(this, metadata)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(inout) :: this
    type(FileMetadata), intent(inout) :: metadata

procedure, public :: append_variable_metadata

  • private subroutine append_variable_metadata(this, var)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(inout) :: this
    type(Variable), intent(inout) :: var

generic, public :: cartesian_to_spherical => cartesian_to_spherical_2d_real32

  • private subroutine cartesian_to_spherical_2d_real32(this, xyz, u, v, basis, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout), target :: this
    real(kind=REAL32), intent(in) :: xyz(:,:,:,:)
    real(kind=REAL32), intent(out) :: u(:,:)
    real(kind=REAL32), intent(out) :: v(:,:)
    character(len=*), intent(in) :: basis
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

generic, public :: cartesian_to_spherical => cartesian_to_spherical_2d_real64

  • private subroutine cartesian_to_spherical_2d_real64(this, xyz, u, v, basis, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout), target :: this
    real(kind=REAL64), intent(in) :: xyz(:,:,:,:)
    real(kind=REAL64), intent(out) :: u(:,:)
    real(kind=REAL64), intent(out) :: v(:,:)
    character(len=*), intent(in) :: basis
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

generic, public :: cartesian_to_spherical => cartesian_to_spherical_3d_real32

  • private subroutine cartesian_to_spherical_3d_real32(this, xyz, u, v, basis, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout), target :: this
    real(kind=REAL32), intent(in) :: xyz(:,:,:,:)
    real(kind=REAL32), intent(out) :: u(:,:,:)
    real(kind=REAL32), intent(out) :: v(:,:,:)
    character(len=*), intent(in) :: basis
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

generic, public :: cartesian_to_spherical => cartesian_to_spherical_3d_real64

  • private subroutine cartesian_to_spherical_3d_real64(this, xyz, u, v, basis, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout), target :: this
    real(kind=REAL64), intent(in) :: xyz(:,:,:,:)
    real(kind=REAL64), intent(out) :: u(:,:,:)
    real(kind=REAL64), intent(out) :: v(:,:,:)
    character(len=*), intent(in) :: basis
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

procedure, public :: cartesian_to_spherical_2d_real32

  • private subroutine cartesian_to_spherical_2d_real32(this, xyz, u, v, basis, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout), target :: this
    real(kind=REAL32), intent(in) :: xyz(:,:,:,:)
    real(kind=REAL32), intent(out) :: u(:,:)
    real(kind=REAL32), intent(out) :: v(:,:)
    character(len=*), intent(in) :: basis
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

procedure, public :: cartesian_to_spherical_2d_real64

  • private subroutine cartesian_to_spherical_2d_real64(this, xyz, u, v, basis, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout), target :: this
    real(kind=REAL64), intent(in) :: xyz(:,:,:,:)
    real(kind=REAL64), intent(out) :: u(:,:)
    real(kind=REAL64), intent(out) :: v(:,:)
    character(len=*), intent(in) :: basis
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

procedure, public :: cartesian_to_spherical_3d_real32

  • private subroutine cartesian_to_spherical_3d_real32(this, xyz, u, v, basis, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout), target :: this
    real(kind=REAL32), intent(in) :: xyz(:,:,:,:)
    real(kind=REAL32), intent(out) :: u(:,:,:)
    real(kind=REAL32), intent(out) :: v(:,:,:)
    character(len=*), intent(in) :: basis
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

procedure, public :: cartesian_to_spherical_3d_real64

  • private subroutine cartesian_to_spherical_3d_real64(this, xyz, u, v, basis, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout), target :: this
    real(kind=REAL64), intent(in) :: xyz(:,:,:,:)
    real(kind=REAL64), intent(out) :: u(:,:,:)
    real(kind=REAL64), intent(out) :: v(:,:,:)
    character(len=*), intent(in) :: basis
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

procedure, public :: check_and_fill_consistency

  • private subroutine check_and_fill_consistency(this, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(inout) :: this
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

procedure, public :: check_decomposition

  • private function check_decomposition(this, unusable, rc) result(can_decomp)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(inout), target :: this
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

    Return Value logical

procedure, public :: clone

procedure, public :: compute_lat_centers

  • private function compute_lat_centers(this, pole, unusable, convert_to_radians, rc) result(lat_centers)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(in) :: this
    character(len=2), intent(in) :: pole
    class(KeywordEnforcer), intent(in), optional :: unusable
    logical, intent(in), optional :: convert_to_radians
    integer, intent(out), optional :: rc

    Return Value real(kind=REAL64), allocatable, (:)

procedure, public :: compute_lat_corners

  • private function compute_lat_corners(this, pole, unusable, rc) result(lat_corners)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(in) :: this
    character(len=2), intent(in) :: pole
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

    Return Value real(kind=REAL64), allocatable, (:)

procedure, public :: compute_lon_centers

  • private function compute_lon_centers(this, dateline, unusable, convert_to_radians, rc) result(lon_centers)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(in) :: this
    character(len=2), intent(in) :: dateline
    class(KeywordEnforcer), intent(in), optional :: unusable
    logical, intent(in), optional :: convert_to_radians
    integer, intent(out), optional :: rc

    Return Value real(kind=REAL64), allocatable, (:)

procedure, public :: compute_lon_corners

  • private function compute_lon_corners(this, dateline, unusable, rc) result(lon_corners)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(in) :: this
    character(len=2), intent(in) :: dateline
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

    Return Value real(kind=REAL64), allocatable, (:)

procedure, public :: create_basic_grid

  • private function create_basic_grid(this, unusable, rc) result(grid)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(in) :: this
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

    Return Value type(ESMF_Grid)

procedure, public :: decomps_are_equal

  • private function decomps_are_equal(this, a) result(equal)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(in) :: this
    class(AbstractGridFactory), intent(in) :: a

    Return Value logical

procedure, public :: destroy

  • private subroutine destroy(this, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout) :: this
    integer, intent(out), optional :: rc

procedure, public :: equals

  • private function equals(a, b)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(in) :: a
    class(AbstractGridFactory), intent(in) :: b

    Return Value logical

procedure, public :: generate_file_bounds

  • private subroutine generate_file_bounds(this, grid, local_start, global_start, global_count, metaData, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(inout) :: this
    type(ESMF_Grid), intent(inout) :: grid
    integer, intent(out), allocatable :: local_start(:)
    integer, intent(out), allocatable :: global_start(:)
    integer, intent(out), allocatable :: global_count(:)
    type(FileMetadata), intent(in), optional :: metaData
    integer, intent(out), optional :: rc

procedure, public :: generate_file_corner_bounds

  • private subroutine generate_file_corner_bounds(this, grid, local_start, global_start, global_count, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(inout) :: this
    type(ESMF_Grid), intent(inout) :: grid
    integer, intent(out), allocatable :: local_start(:)
    integer, intent(out), allocatable :: global_start(:)
    integer, intent(out), allocatable :: global_count(:)
    integer, intent(out), optional :: rc

procedure, public :: generate_file_reference2D

  • private function generate_file_reference2D(this, fpointer) result(ref)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(inout) :: this
    real, intent(in), pointer :: fpointer(:,:)

    Return Value type(ArrayReference)

procedure, public :: generate_file_reference3D

  • private function generate_file_reference3D(this, fpointer, metaData) result(ref)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(inout) :: this
    real, intent(in), pointer :: fpointer(:,:,:)
    type(FileMetadata), intent(in), optional :: metaData

    Return Value type(ArrayReference)

procedure, public :: generate_grid_name

  • private function generate_grid_name(this) result(name)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(in) :: this

    Return Value character(len=:), allocatable

procedure, public :: generate_newnxy

  • private subroutine generate_newnxy(this, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(inout), target :: this
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

procedure, public :: get_basis

  • private function get_basis(this, basis, unusable, rc) result(basis_vectors)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout), target :: this
    character(len=*), intent(in) :: basis
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

    Return Value real(kind=REAL64), pointer, (:,:,:,:)

procedure, public :: get_file_format_vars

  • private function get_file_format_vars(this) result(vars)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(inout) :: this

    Return Value character(len=:), allocatable

procedure, public :: get_grid

  • private function get_grid(this, unusable, rc) result(grid)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), target :: this
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

    Return Value type(ESMF_Grid), pointer

procedure, public :: get_grid_vars

  • private function get_grid_vars(this) result(vars)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(inout) :: this

    Return Value character(len=:), allocatable

procedure, public :: get_lat_corners

  • private function get_lat_corners(this, unusable, rc) result(lat_corners)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(in) :: this
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

    Return Value real(kind=REAL64), allocatable, (:)

procedure, public :: get_latitudes

  • private function get_latitudes(this, unusable, rc) result(latitudes)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(in) :: this
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

    Return Value real(kind=REAL64), allocatable, (:)

procedure, public :: get_latitudes_degrees

  • private function get_latitudes_degrees(this, unusable, rc) result(latitudes)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(in) :: this
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

    Return Value real(kind=REAL64), allocatable, (:)

procedure, public :: get_lon_corners

  • private function get_lon_corners(this, unusable, rc) result(lon_corners)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(in) :: this
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

    Return Value real(kind=REAL64), allocatable, (:)

procedure, public :: get_longitudes

  • private function get_longitudes(this, unusable, rc) result(longitudes)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(in) :: this
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

    Return Value real(kind=REAL64), allocatable, (:)

procedure, public :: get_longitudes_degrees

  • private function get_longitudes_degrees(this, unusable, rc) result(longitudes)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(in) :: this
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

    Return Value real(kind=REAL64), allocatable, (:)

procedure, public :: get_obs_time

  • private subroutine get_obs_time(this, grid, obs_time, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout) :: this
    type(ESMF_Grid), intent(in) :: grid
    real(kind=ESMF_KIND_R4), intent(out) :: obs_time(:,:)
    integer, intent(out), optional :: rc

procedure, public :: get_xy_mask

  • private subroutine get_xy_mask(this, interval, xy_mask, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout) :: this
    type(ESMF_Time), intent(in) :: interval(2)
    integer, intent(out), allocatable :: xy_mask(:,:)
    integer, intent(out), optional :: rc

procedure, public :: get_xy_subset

  • private subroutine get_xy_subset(this, interval, xy_subset, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(in) :: this
    type(ESMF_Time), intent(in) :: interval(2)
    integer, intent(out) :: xy_subset(2,2)
    integer, intent(out), optional :: rc

procedure, public :: halo

  • private subroutine halo(this, array, unusable, halo_width, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(inout) :: this
    real(kind=REAL32), intent(inout) :: array(:,:)
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(in), optional :: halo_width
    integer, intent(out), optional :: rc

procedure, public :: init_halo

  • private subroutine init_halo(this, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(inout), target :: this
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

generic, public :: initialize => initialize_from_config

  • private subroutine initialize_from_config(this, config, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout) :: this
    type(ESMF_Config), intent(inout) :: config
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

generic, public :: initialize => initialize_from_file_metadata

  • private subroutine initialize_from_file_metadata(this, file_metadata, unusable, force_file_coordinates, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(XYGridFactory), intent(inout) :: this
    type(FileMetadata), intent(in), target :: file_metadata
    class(KeywordEnforcer), intent(in), optional :: unusable
    logical, intent(in), optional :: force_file_coordinates
    integer, intent(out), optional :: rc

generic, public :: initialize => initialize_from_config_with_prefix

  • private subroutine initialize_from_config_with_prefix(this, config, prefix, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(XYGridFactory), intent(inout) :: this
    type(ESMF_Config), intent(inout) :: config
    character(len=*), intent(in) :: prefix
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

generic, public :: initialize => initialize_from_esmf_distGrid

  • private subroutine initialize_from_esmf_distGrid(this, dist_grid, lon_array, lat_array, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(XYGridFactory), intent(inout) :: this
    type(ESMF_DistGrid), intent(in) :: dist_grid
    type(ESMF_LocalArray), intent(in) :: lon_array
    type(ESMF_LocalArray), intent(in) :: lat_array
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

procedure, public :: initialize_from_config

  • private subroutine initialize_from_config(this, config, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout) :: this
    type(ESMF_Config), intent(inout) :: config
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

procedure, public :: initialize_from_config_with_prefix

  • private subroutine initialize_from_config_with_prefix(this, config, prefix, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(inout) :: this
    type(ESMF_Config), intent(inout) :: config
    character(len=*), intent(in) :: prefix
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

procedure, public :: initialize_from_esmf_distGrid

  • private subroutine initialize_from_esmf_distGrid(this, dist_grid, lon_array, lat_array, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(inout) :: this
    type(ESMF_DistGrid), intent(in) :: dist_grid
    type(ESMF_LocalArray), intent(in) :: lon_array
    type(ESMF_LocalArray), intent(in) :: lat_array
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

procedure, public :: initialize_from_file_metadata

  • private subroutine initialize_from_file_metadata(this, file_metadata, unusable, force_file_coordinates, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(inout) :: this
    type(FileMetadata), intent(in), target :: file_metadata
    class(KeywordEnforcer), intent(in), optional :: unusable
    logical, intent(in), optional :: force_file_coordinates
    integer, intent(out), optional :: rc

procedure, public :: make_arbitrary_decomposition

  • private subroutine make_arbitrary_decomposition(this, nx, ny, unusable, reduceFactor, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(in) :: this
    integer, intent(out) :: nx
    integer, intent(out) :: ny
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(in), optional :: reduceFactor
    integer, intent(out), optional :: rc

procedure, public :: make_grid

  • private function make_grid(this, unusable, rc) result(grid)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout) :: this
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

    Return Value type(ESMF_Grid)

procedure, public :: make_new_grid

  • private function make_new_grid(this, unusable, rc) result(grid)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(in) :: this
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

    Return Value type(ESMF_Grid)

generic, public :: operator(==) => equals

  • private function equals(a, b)

    Arguments

    Type IntentOptional Attributes Name
    class(XYGridFactory), intent(in) :: a
    class(AbstractGridFactory), intent(in) :: b

    Return Value logical

procedure, public :: physical_params_are_equal

  • private function physical_params_are_equal(this, a) result(equal)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(in) :: this
    class(AbstractGridFactory), intent(in) :: a

    Return Value logical

generic, public :: spherical_to_cartesian => spherical_to_cartesian_2d_real32

  • private subroutine spherical_to_cartesian_2d_real32(this, u, v, xyz, basis, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout), target :: this
    real(kind=REAL32), intent(in) :: u(:,:)
    real(kind=REAL32), intent(in) :: v(:,:)
    real(kind=REAL32), intent(out) :: xyz(:,:,:,:)
    character(len=*), intent(in) :: basis
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

generic, public :: spherical_to_cartesian => spherical_to_cartesian_2d_real64

  • private subroutine spherical_to_cartesian_2d_real64(this, u, v, xyz, basis, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout), target :: this
    real(kind=REAL64), intent(in) :: u(:,:)
    real(kind=REAL64), intent(in) :: v(:,:)
    real(kind=REAL64), intent(out) :: xyz(:,:,:,:)
    character(len=*), intent(in) :: basis
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

generic, public :: spherical_to_cartesian => spherical_to_cartesian_3d_real32

  • private subroutine spherical_to_cartesian_3d_real32(this, u, v, xyz, basis, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout), target :: this
    real(kind=REAL32), intent(in) :: u(:,:,:)
    real(kind=REAL32), intent(in) :: v(:,:,:)
    real(kind=REAL32), intent(out) :: xyz(:,:,:,:)
    character(len=*), intent(in) :: basis
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

generic, public :: spherical_to_cartesian => spherical_to_cartesian_3d_real64

  • private subroutine spherical_to_cartesian_3d_real64(this, u, v, xyz, basis, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout), target :: this
    real(kind=REAL64), intent(in) :: u(:,:,:)
    real(kind=REAL64), intent(in) :: v(:,:,:)
    real(kind=REAL64), intent(out) :: xyz(:,:,:,:)
    character(len=*), intent(in) :: basis
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

procedure, public :: spherical_to_cartesian_2d_real32

  • private subroutine spherical_to_cartesian_2d_real32(this, u, v, xyz, basis, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout), target :: this
    real(kind=REAL32), intent(in) :: u(:,:)
    real(kind=REAL32), intent(in) :: v(:,:)
    real(kind=REAL32), intent(out) :: xyz(:,:,:,:)
    character(len=*), intent(in) :: basis
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

procedure, public :: spherical_to_cartesian_2d_real64

  • private subroutine spherical_to_cartesian_2d_real64(this, u, v, xyz, basis, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout), target :: this
    real(kind=REAL64), intent(in) :: u(:,:)
    real(kind=REAL64), intent(in) :: v(:,:)
    real(kind=REAL64), intent(out) :: xyz(:,:,:,:)
    character(len=*), intent(in) :: basis
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

procedure, public :: spherical_to_cartesian_3d_real32

  • private subroutine spherical_to_cartesian_3d_real32(this, u, v, xyz, basis, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout), target :: this
    real(kind=REAL32), intent(in) :: u(:,:,:)
    real(kind=REAL32), intent(in) :: v(:,:,:)
    real(kind=REAL32), intent(out) :: xyz(:,:,:,:)
    character(len=*), intent(in) :: basis
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

procedure, public :: spherical_to_cartesian_3d_real64

  • private subroutine spherical_to_cartesian_3d_real64(this, u, v, xyz, basis, unusable, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(AbstractGridFactory), intent(inout), target :: this
    real(kind=REAL64), intent(in) :: u(:,:,:)
    real(kind=REAL64), intent(in) :: v(:,:,:)
    real(kind=REAL64), intent(out) :: xyz(:,:,:,:)
    character(len=*), intent(in) :: basis
    class(KeywordEnforcer), intent(in), optional :: unusable
    integer, intent(out), optional :: rc

procedure, public :: to_string

  • private function to_string(this) result(string)

    Arguments

    Type IntentOptional Attributes Name
    class(LatLonGridFactory), intent(in) :: this

    Return Value character(len=:), allocatable

Source Code

   type, extends(AbstractGridFactory) :: LatLonGridFactory
      private
      logical :: is_regular = .false.
      character(len=:), allocatable :: grid_name
      ! Grid dimensions
      integer :: im_world = MAPL_UNDEFINED_INTEGER
      integer :: jm_world = MAPL_UNDEFINED_INTEGER
      integer :: lm = MAPL_UNDEFINED_INTEGER
      real(kind=REAL64), allocatable :: lon_centers(:)
      real(kind=REAL64), allocatable :: lat_centers(:)
      real(kind=REAL64), allocatable :: lon_centers_degrees(:)
      real(kind=REAL64), allocatable :: lat_centers_degrees(:)
      real(kind=REAL64), allocatable :: lon_corners(:)
      real(kind=REAL64), allocatable :: lat_corners(:)
      logical :: force_decomposition = .false.

      ! Domain decomposition:
      integer :: nx = MAPL_UNDEFINED_INTEGER
      integer :: ny = MAPL_UNDEFINED_INTEGER
      integer, allocatable :: ims(:)
      integer, allocatable :: jms(:)
      ! Grid conventions:
      character(len=:), allocatable :: pole
      character(len=:), allocatable :: dateline
      ! Regional vs global:
      type (RealMinMax) :: lon_range = RealMinMax(MAPL_UNDEFINED_REAL,MAPL_UNDEFINED_REAL)
      type (RealMinMax) :: lat_range = RealMinMax(MAPL_UNDEFINED_REAL,MAPL_UNDEFINED_REAL)
      ! Used for halo
      type (ESMF_DELayout) :: layout
      integer :: px, py
      logical :: is_halo_initialized = .false.
      logical :: periodic = .true.
   contains
      procedure :: make_new_grid
      procedure :: create_basic_grid
      procedure :: get_longitudes_degrees
      procedure :: get_longitudes
      procedure :: get_latitudes_degrees
      procedure :: get_latitudes
      procedure :: compute_lon_centers
      procedure :: compute_lat_centers
      procedure :: get_lon_corners
      procedure :: get_lat_corners
      procedure :: compute_lon_corners
      procedure :: compute_lat_corners
      procedure :: add_horz_coordinates
      procedure :: init_halo
      procedure :: halo


      procedure :: initialize_from_file_metadata
      procedure :: initialize_from_config_with_prefix
      procedure :: initialize_from_esmf_distGrid

      procedure :: equals

      procedure :: check_and_fill_consistency
      procedure :: generate_grid_name
      procedure :: to_string

      procedure :: append_metadata
      procedure :: get_grid_vars
      procedure :: get_file_format_vars
      procedure :: append_variable_metadata
      procedure :: check_decomposition
      procedure :: generate_newnxy
      procedure :: generate_file_bounds
      procedure :: generate_file_corner_bounds
      procedure :: generate_file_reference2D
      procedure :: generate_file_reference3D
      procedure :: decomps_are_equal
      procedure :: physical_params_are_equal
   end type LatLonGridFactory