GeomFactory.F90 Source File


Files dependent on this one

sourcefile~~geomfactory.f90~~AfferentGraph sourcefile~geomfactory.f90 GeomFactory.F90 sourcefile~cubedspheregeomfactory.f90 CubedSphereGeomFactory.F90 sourcefile~cubedspheregeomfactory.f90->sourcefile~geomfactory.f90 sourcefile~geomfactoryvector.f90 GeomFactoryVector.F90 sourcefile~geomfactoryvector.f90->sourcefile~geomfactory.f90 sourcefile~latlongeomfactory.f90 LatLonGeomFactory.F90 sourcefile~latlongeomfactory.f90->sourcefile~geomfactory.f90 sourcefile~create_basic_grid.f90 create_basic_grid.F90 sourcefile~create_basic_grid.f90->sourcefile~latlongeomfactory.f90 sourcefile~cubedspheregeomfactory_smod.f90 CubedSphereGeomFactory_smod.F90 sourcefile~cubedspheregeomfactory_smod.f90->sourcefile~cubedspheregeomfactory.f90 sourcefile~fill_coordinates.f90 fill_coordinates.F90 sourcefile~fill_coordinates.f90->sourcefile~latlongeomfactory.f90 sourcefile~make_file_metadata.f90 make_file_metadata.F90 sourcefile~make_file_metadata.f90->sourcefile~latlongeomfactory.f90 sourcefile~make_geom.f90 make_geom.F90 sourcefile~make_geom.f90->sourcefile~latlongeomfactory.f90 sourcefile~make_gridded_dims.f90 make_gridded_dims.F90 sourcefile~make_gridded_dims.f90->sourcefile~latlongeomfactory.f90 sourcefile~test_cubedspheregeomfactory.pf Test_CubedSphereGeomFactory.pf sourcefile~test_cubedspheregeomfactory.pf->sourcefile~cubedspheregeomfactory.f90 sourcefile~test_latlongeomfactory.pf Test_LatLonGeomFactory.pf sourcefile~test_latlongeomfactory.pf->sourcefile~latlongeomfactory.f90 sourcefile~typesafe_make_file_metadata.f90 typesafe_make_file_metadata.F90 sourcefile~typesafe_make_file_metadata.f90->sourcefile~latlongeomfactory.f90 sourcefile~typesafe_make_geom.f90 typesafe_make_geom.F90 sourcefile~typesafe_make_geom.f90->sourcefile~latlongeomfactory.f90

Source Code

#include "MAPL_Generic.h"

module mapl3g_GeomFactory
   implicit none
   private

   public :: GeomFactory

   type, abstract :: GeomFactory
      private
   contains
      procedure(I_make_geom_spec_from_hconfig),  deferred :: make_geom_spec_from_hconfig
      procedure(I_make_geom_spec_from_metadata), deferred :: make_geom_spec_from_metadata
      generic :: make_spec => make_geom_spec_from_hconfig
      generic :: make_spec => make_geom_spec_from_metadata
      procedure(I_supports_spec), deferred :: supports_spec
      procedure(I_supports_hconfig), deferred :: supports_hconfig
      procedure(I_supports_metadata), deferred :: supports_metadata
      generic :: supports => supports_spec
      generic :: supports => supports_hconfig
      generic :: supports => supports_metadata

      procedure(I_make_geom), deferred :: make_geom
      procedure(I_make_file_metadata), deferred :: make_file_metadata
      procedure(I_make_gridded_dims), deferred :: make_gridded_dims
   end type GeomFactory


   abstract interface

      function I_make_geom_spec_from_hconfig(this, hconfig, rc) result(spec)
         use esmf, only: ESMF_HConfig
         use mapl3g_GeomSpec
         import GeomFactory
         implicit none

         class(GeomSpec), allocatable :: spec
         class(GeomFactory), intent(in) :: this
         type(ESMF_HConfig), intent(in) :: hconfig
         integer, optional, intent(out) :: rc
      end function I_make_geom_spec_from_hconfig

      function I_make_geom_spec_from_metadata(this, file_metadata, rc) result(spec)
         use pfio_FileMetadataMod
         use mapl3g_GeomSpec
         import GeomFactory
         implicit none

         class(GeomSpec), allocatable :: spec
         class(GeomFactory), intent(in) :: this
         type(FileMetadata), intent(in) :: file_metadata
         integer, optional, intent(out) :: rc
      end function I_make_geom_spec_from_metadata

      function I_make_geom(this, geom_spec, rc) result(geom)
         use esmf, only: ESMF_Geom
         use mapl3g_GeomSpec
         import GeomFactory
         implicit none

         type(ESMF_Geom) :: geom
         class(GeomFactory), intent(in) :: this
         class(GeomSpec), intent(in) :: geom_spec
         integer, optional, intent(out) :: rc
      end function I_make_geom

      function I_make_file_metadata(this, geom_spec, unusable, chunksizes, rc) result(file_metadata)
         use mapl3g_GeomSpec
         use pfio_FileMetadataMod
         use mapl_KeywordEnforcerMod
         import GeomFactory
         implicit none

         type(FileMetadata) :: file_metadata
         class(GeomFactory), intent(in) :: this
         class(GeomSpec), intent(in) :: geom_spec
         class(KeywordEnforcer), optional, intent(in) :: unusable
         integer, optional, intent(in) :: chunksizes(:)
         integer, optional, intent(out) :: rc
      end function I_make_file_metadata

      function I_make_gridded_dims(this, geom_spec, rc) result(gridded_dims)
         use mapl3g_GeomSpec
         use gFTL2_StringVector
         import GeomFactory
         implicit none

         type(StringVector) :: gridded_dims
         class(GeomFactory), intent(in) :: this
         class(GeomSpec), intent(in) :: geom_spec
         integer, optional, intent(out) :: rc
      end function I_make_gridded_dims

      logical function I_supports_spec(this, geom_spec) result(supports)
         use mapl3g_GeomSpec
         import GeomFactory
         class(GeomFactory), intent(in) :: this
         class(GeomSpec), intent(in) :: geom_spec
      end function I_supports_spec

      logical function I_supports_hconfig(this, hconfig, rc) result(supports)
         use esmf, only: ESMF_HConfig
         import GeomFactory
         class(GeomFactory), intent(in) :: this
         type(ESMF_HConfig), intent(in) :: hconfig
         integer, optional, intent(out) :: rc
      end function I_supports_hconfig

      logical function I_supports_metadata(this, file_metadata, rc) result(supports)
         use pfio_FileMetadataMod
         import GeomFactory
         class(GeomFactory), intent(in) :: this
         type(FileMetadata), intent(in) :: file_metadata
         integer, optional, intent(out) :: rc
      end function I_supports_metadata

   end interface

end module mapl3g_GeomFactory