GridManager Derived Type

type, public :: GridManager


Inherits

type~~gridmanager~~InheritsGraph type~gridmanager GridManager type~integer64gridfactorymap Integer64GridFactoryMap type~gridmanager->type~integer64gridfactorymap factories type~stringgridfactorymap StringGridFactoryMap type~gridmanager->type~stringgridfactorymap prototypes type~set2~13 set2 type~integer64gridfactorymap->type~set2~13 tree type~set2~14 set2 type~stringgridfactorymap->type~set2~14 tree type~ivector~12 iVector type~set2~13->type~ivector~12 parents, lefts, rights, heights type~tvector~12 tVector type~set2~13->type~tvector~12 items type~ivector~13 iVector type~set2~14->type~ivector~13 parents, lefts, rights, heights type~tvector~13 tVector type~set2~14->type~tvector~13 items type~pair~12 pair type~tvector~12->type~pair~12 elements type~pair~13 pair type~tvector~13->type~pair~13 elements

Type-Bound Procedures

procedure, public :: add_factory

  • private subroutine add_factory(this, factory, id)

    Arguments

    Type IntentOptional Attributes Name
    class(GridManager), intent(inout), target :: this
    class(AbstractGridFactory), intent(in) :: factory
    integer(kind=ESMF_KIND_I8), intent(out), optional :: id

procedure, public :: add_prototype

  • private subroutine add_prototype(this, grid_type, prototype)

    Arguments

    Type IntentOptional Attributes Name
    class(GridManager), intent(inout) :: this
    character(len=*), intent(in) :: grid_type
    class(AbstractGridFactory), intent(in) :: prototype

procedure, public :: delete

$ procedure :: make_field $ procedure :: delete_field

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

    Arguments

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

generic, public :: destroy => destroy_grid

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

    Arguments

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

procedure, public :: destroy_grid

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

    Arguments

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

procedure, public :: get_factory

  • private function get_factory(this, grid, unusable, rc) result(factory)

    Arguments

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

    Return Value class(AbstractGridFactory), pointer

procedure, public :: get_id

  • private function get_id(this, factory) result(id)

    Arguments

    Type IntentOptional Attributes Name
    class(GridManager), intent(inout) :: this
    class(AbstractGridFactory), intent(in) :: factory

    Return Value integer(kind=INT64)

procedure, public :: is_valid_prototype

  • private function is_valid_prototype(this, prototype_name, unusable, rc)

    Arguments

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

    Return Value logical

procedure, public :: make_clone

  • private function make_clone(this, grid_type, unusable, rc) result(factory)

    Arguments

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

    Return Value class(AbstractGridFactory), allocatable

generic, public :: make_factory => make_factory_from_config

  • private function make_factory_from_config(this, grid_type, config, unusable, prefix, rc) result(factory)

    Arguments

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

    Return Value class(AbstractGridFactory), allocatable

generic, public :: make_factory => make_factory_from_file

  • private function make_factory_from_file(this, file_name, unused, force_file_coordinates, rc) result(factory)

    $ elseif (…) then ! something that is true for tripolar? $ factory = this%make_clone(‘tripolar’)

    Arguments

    Type IntentOptional Attributes Name
    class(GridManager), intent(inout) :: this
    character(len=*), intent(in) :: file_name
    class(KeywordEnforcer), intent(in), optional :: unused
    logical, intent(in), optional :: force_file_coordinates
    integer, intent(out), optional :: rc

    Return Value class(AbstractGridFactory), allocatable

generic, public :: make_factory => make_factory_from_distGrid

  • private function make_factory_from_distGrid(this, grid_type, dist_grid, lon_array, lat_array, unusable, rc) result(factory)

    Arguments

    Type IntentOptional Attributes Name
    class(GridManager), intent(inout) :: this
    character(len=*), intent(in) :: grid_type
    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

    Return Value class(AbstractGridFactory), allocatable

procedure, public :: make_factory_from_config

  • private function make_factory_from_config(this, grid_type, config, unusable, prefix, rc) result(factory)

    Arguments

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

    Return Value class(AbstractGridFactory), allocatable

procedure, public :: make_factory_from_distGrid

  • private function make_factory_from_distGrid(this, grid_type, dist_grid, lon_array, lat_array, unusable, rc) result(factory)

    Arguments

    Type IntentOptional Attributes Name
    class(GridManager), intent(inout) :: this
    character(len=*), intent(in) :: grid_type
    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

    Return Value class(AbstractGridFactory), allocatable

procedure, public :: make_factory_from_file

  • private function make_factory_from_file(this, file_name, unused, force_file_coordinates, rc) result(factory)

    $ elseif (…) then ! something that is true for tripolar? $ factory = this%make_clone(‘tripolar’)

    Arguments

    Type IntentOptional Attributes Name
    class(GridManager), intent(inout) :: this
    character(len=*), intent(in) :: file_name
    class(KeywordEnforcer), intent(in), optional :: unused
    logical, intent(in), optional :: force_file_coordinates
    integer, intent(out), optional :: rc

    Return Value class(AbstractGridFactory), allocatable

generic, public :: make_grid => make_grid_from_factory

  • private function make_grid_from_factory(this, factory, unusable, rc) result(grid)

    Arguments

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

    Return Value type(ESMF_Grid)

generic, public :: make_grid => make_grid_from_config

  • private function make_grid_from_config(this, config, unusable, prefix, rc) result(grid)

    Arguments

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

    Return Value type(ESMF_Grid)

generic, public :: make_grid => make_grid_from_distGrid

  • private function make_grid_from_distGrid(this, grid_type, dist_grid, lon_array, lat_array, unusable, rc) result(grid)

    Arguments

    Type IntentOptional Attributes Name
    class(GridManager), intent(inout) :: this
    character(len=*), intent(in) :: grid_type
    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

    Return Value type(ESMF_Grid)

procedure, public :: make_grid_from_config

  • private function make_grid_from_config(this, config, unusable, prefix, rc) result(grid)

    Arguments

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

    Return Value type(ESMF_Grid)

procedure, public :: make_grid_from_distGrid

  • private function make_grid_from_distGrid(this, grid_type, dist_grid, lon_array, lat_array, unusable, rc) result(grid)

    Arguments

    Type IntentOptional Attributes Name
    class(GridManager), intent(inout) :: this
    character(len=*), intent(in) :: grid_type
    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

    Return Value type(ESMF_Grid)

procedure, public :: make_grid_from_factory

  • private function make_grid_from_factory(this, factory, unusable, rc) result(grid)

    Arguments

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

    Return Value type(ESMF_Grid)

Source Code

   type :: GridManager
      private
      logical :: keep_grids = .false.
      integer(kind=ESMF_KIND_I8) :: counter = 0
      type (StringGridFactoryMap) :: prototypes
      type (Integer64GridFactoryMap) :: factories
   contains
      procedure :: add_prototype
      procedure :: destroy_grid
      generic :: destroy => destroy_grid

      procedure :: delete
!!$   procedure :: make_field
!!$   procedure :: delete_field

      procedure :: make_factory_from_config
      procedure :: make_factory_from_distGrid
      procedure :: make_factory_from_file

      procedure :: make_grid_from_factory
      procedure :: make_grid_from_config
      procedure :: make_grid_from_distGrid

      generic :: make_factory => make_factory_from_config
      generic :: make_factory => make_factory_from_file
      generic :: make_factory => make_factory_from_distGrid

      generic :: make_grid => make_grid_from_factory
      generic :: make_grid => make_grid_from_config
      generic :: make_grid => make_grid_from_distGrid

      procedure :: get_factory ! from grid

      ! helper procedures
      procedure :: make_clone
      procedure :: get_id
      procedure :: add_factory
      procedure :: is_valid_prototype

   end type GridManager