RoutehandleSpec.F90 Source File


This file depends on

sourcefile~~routehandlespec.f90~~EfferentGraph sourcefile~routehandlespec.f90 RoutehandleSpec.F90 sourcefile~errorhandling.f90 ErrorHandling.F90 sourcefile~routehandlespec.f90->sourcefile~errorhandling.f90 sourcefile~geom_mgr.f90 geom_mgr.F90 sourcefile~routehandlespec.f90->sourcefile~geom_mgr.f90 sourcefile~routehandleparam.f90 RoutehandleParam.F90 sourcefile~routehandlespec.f90->sourcefile~routehandleparam.f90 sourcefile~mapl_throw.f90 MAPL_Throw.F90 sourcefile~errorhandling.f90->sourcefile~mapl_throw.f90 sourcefile~geomspec.f90 GeomSpec.F90 sourcefile~geom_mgr.f90->sourcefile~geomspec.f90 sourcefile~geomutilities.f90 GeomUtilities.F90 sourcefile~geom_mgr.f90->sourcefile~geomutilities.f90 sourcefile~routehandleparam.f90->sourcefile~errorhandling.f90 sourcefile~routehandleparam.f90->sourcefile~geom_mgr.f90 sourcefile~geomutilities.f90->sourcefile~errorhandling.f90

Files dependent on this one

sourcefile~~routehandlespec.f90~~AfferentGraph sourcefile~routehandlespec.f90 RoutehandleSpec.F90 sourcefile~routehandlemanager.f90 RoutehandleManager.F90 sourcefile~routehandlemanager.f90->sourcefile~routehandlespec.f90 sourcefile~routehandlespecvector.f90 RoutehandleSpecVector.F90 sourcefile~routehandlemanager.f90->sourcefile~routehandlespecvector.f90 sourcefile~routehandlespecvector.f90->sourcefile~routehandlespec.f90 sourcefile~esmfregridderfactory.f90 EsmfRegridderFactory.F90 sourcefile~esmfregridderfactory.f90->sourcefile~routehandlemanager.f90 sourcefile~regriddermanager.f90 RegridderManager.F90 sourcefile~regriddermanager.f90->sourcefile~esmfregridderfactory.f90 sourcefile~regridder_mgr.f90 regridder_mgr.F90 sourcefile~regridder_mgr.f90->sourcefile~regriddermanager.f90

Source Code

#include "MAPL_Generic.h"

module mapl3g_RoutehandleSpec
   use esmf
   use mapl3g_RoutehandleParam
   use mapl_ErrorHandlingMod
   use mapl3g_geom_mgr, only: MAPL_SameGeom
   implicit none
   private

   public :: RoutehandleSpec
   public :: make_routehandle
   public :: operator(==)

   ! If an argument to FieldRegridStore is optional _and_ has no default
   ! value, then we use the ALLOCATABLE attribute.  This allows us to
   ! treate the optional argument as not present in the call.
   type :: RoutehandleSpec
      private
      type(ESMF_Geom) :: geom_in
      type(ESMF_Geom) :: geom_out
      type(RoutehandleParam) :: rh_param
   end type RoutehandleSpec


   interface make_routehandle
      module procedure make_routehandle_from_spec
   end interface make_routehandle

   interface operator(==)
      module procedure equal_to
   end interface operator(==)

   interface RoutehandleSpec
      module procedure new_RoutehandleSpec
   end interface RoutehandleSpec

contains

   function new_RoutehandleSpec( geom_in, geom_out, rh_param) result(spec)
      type(RoutehandleSpec) :: spec
      type(ESMF_Geom), intent(in) :: geom_in
      type(ESMF_Geom), intent(in) :: geom_out
      type(RoutehandleParam), intent(in) :: rh_param

      spec%geom_in = geom_in
      spec%geom_out = geom_out
      spec%rh_param = rh_param

   end function new_RoutehandleSpec

   function make_routehandle_from_spec(spec, rc) result(routehandle)
      type(ESMF_Routehandle) :: routehandle
      type(RoutehandleSpec), intent(in) :: spec
      integer, optional, intent(out) :: rc

      integer :: status
      
      routehandle = make_routehandle(spec%geom_in, spec%geom_out, spec%rh_param, _RC)
      
      _RETURN(_SUCCESS)
   end function make_routehandle_from_spec

   logical function equal_to(a, b) result(eq)
      type(RoutehandleSpec), intent(in) :: a
      type(RoutehandleSpec), intent(in) :: b

      eq = a%rh_param == b%rh_param
      if (.not. eq) return

      eq = MAPL_SameGeom(a%geom_in, b%geom_in)
      if (.not. eq) return
      
      eq = MAPL_SameGeom(a%geom_out, b%geom_out)
      if (.not. eq) return

   end function equal_to


end module mapl3g_RoutehandleSpec