RegridderTypeSpec.F90 Source File


This file depends on

sourcefile~~regriddertypespec.f90~~EfferentGraph sourcefile~regriddertypespec.f90 RegridderTypeSpec.F90 sourcefile~constants.f90 Constants.F90 sourcefile~regriddertypespec.f90->sourcefile~constants.f90 sourcefile~mapl_keywordenforcer.f90 MAPL_KeywordEnforcer.F90 sourcefile~regriddertypespec.f90->sourcefile~mapl_keywordenforcer.f90 sourcefile~regridmethods.f90 RegridMethods.F90 sourcefile~regriddertypespec.f90->sourcefile~regridmethods.f90 sourcefile~internalconstants.f90 InternalConstants.F90 sourcefile~constants.f90->sourcefile~internalconstants.f90 sourcefile~mathconstants.f90 MathConstants.F90 sourcefile~constants.f90->sourcefile~mathconstants.f90 sourcefile~physicalconstants.f90 PhysicalConstants.F90 sourcefile~constants.f90->sourcefile~physicalconstants.f90 sourcefile~physicalconstants.f90->sourcefile~mathconstants.f90

Files dependent on this one

sourcefile~~regriddertypespec.f90~~AfferentGraph sourcefile~regriddertypespec.f90 RegridderTypeSpec.F90 sourcefile~base.f90 Base.F90 sourcefile~base.f90->sourcefile~regriddertypespec.f90 sourcefile~mapl_regriddermanager.f90 MAPL_RegridderManager.F90 sourcefile~base.f90->sourcefile~mapl_regriddermanager.f90 sourcefile~mapl_cfio.f90 MAPL_CFIO.F90 sourcefile~base.f90->sourcefile~mapl_cfio.f90 sourcefile~mapl_simplebundlemod.f90 MAPL_SimpleBundleMod.F90 sourcefile~base.f90->sourcefile~mapl_simplebundlemod.f90 sourcefile~mapl_regriddermanager.f90->sourcefile~regriddertypespec.f90 sourcefile~mapl_regriddertypespecregriddermap.f90 MAPL_RegridderTypeSpecRegridderMap.F90 sourcefile~mapl_regriddermanager.f90->sourcefile~mapl_regriddertypespecregriddermap.f90 sourcefile~mapl_regriddertypespecregriddermap.f90->sourcefile~regriddertypespec.f90 sourcefile~mapl.f90 MAPL.F90 sourcefile~mapl.f90->sourcefile~base.f90 sourcefile~mapl_cfio.f90->sourcefile~mapl_regriddermanager.f90 sourcefile~mapl_nuopcwrappermod.f90 MAPL_NUOPCWrapperMod.F90 sourcefile~mapl_nuopcwrappermod.f90->sourcefile~base.f90 sourcefile~mapl_cap.f90 MAPL_Cap.F90 sourcefile~mapl_nuopcwrappermod.f90->sourcefile~mapl_cap.f90 sourcefile~test_cfio_bundle.pf Test_CFIO_Bundle.pf sourcefile~test_cfio_bundle.pf->sourcefile~base.f90 sourcefile~tstqsat.f90 tstqsat.F90 sourcefile~tstqsat.f90->sourcefile~base.f90 sourcefile~ut_extdata.f90 ut_ExtData.F90 sourcefile~ut_extdata.f90->sourcefile~base.f90 sourcefile~extdatagridcompmod.f90 ExtDataGridCompMod.F90 sourcefile~ut_extdata.f90->sourcefile~extdatagridcompmod.f90 sourcefile~utcfio_bundle.f90 utCFIO_Bundle.F90 sourcefile~utcfio_bundle.f90->sourcefile~base.f90 sourcefile~capdriver.f90 CapDriver.F90 sourcefile~capdriver.f90->sourcefile~mapl.f90 sourcefile~extdataroot_gridcomp.f90 ExtDataRoot_GridComp.F90 sourcefile~capdriver.f90->sourcefile~extdataroot_gridcomp.f90 sourcefile~comp_testing_driver.f90 Comp_Testing_Driver.F90 sourcefile~comp_testing_driver.f90->sourcefile~mapl.f90 sourcefile~extdatadriver.f90 ExtDataDriver.F90 sourcefile~extdatadriver.f90->sourcefile~mapl.f90 sourcefile~extdatadrivergridcomp.f90 ExtDataDriverGridComp.F90 sourcefile~extdatadriver.f90->sourcefile~extdatadrivergridcomp.f90 sourcefile~extdatadrivermod.f90 ExtDataDriverMod.F90 sourcefile~extdatadriver.f90->sourcefile~extdatadrivermod.f90 sourcefile~extdatadriver.f90->sourcefile~extdataroot_gridcomp.f90 sourcefile~extdatadrivergridcomp.f90->sourcefile~mapl.f90 sourcefile~extdatadrivergridcomp.f90->sourcefile~extdatagridcompmod.f90 sourcefile~extdatagridcompng.f90 ExtDataGridCompNG.F90 sourcefile~extdatadrivergridcomp.f90->sourcefile~extdatagridcompng.f90 sourcefile~mapl_historygridcomp.f90 MAPL_HistoryGridComp.F90 sourcefile~extdatadrivergridcomp.f90->sourcefile~mapl_historygridcomp.f90 sourcefile~extdatadrivermod.f90->sourcefile~mapl.f90 sourcefile~extdatadrivermod.f90->sourcefile~mapl_cfio.f90 sourcefile~extdatadrivermod.f90->sourcefile~extdatadrivergridcomp.f90 sourcefile~extdatadrivermod.f90->sourcefile~extdataroot_gridcomp.f90 sourcefile~extdatagridcompmod.f90->sourcefile~mapl_cfio.f90 sourcefile~extdatagridcompng.f90->sourcefile~mapl_cfio.f90 sourcefile~extdataroot_gridcomp.f90->sourcefile~mapl.f90 sourcefile~varspecdescription.f90 VarspecDescription.F90 sourcefile~extdataroot_gridcomp.f90->sourcefile~varspecdescription.f90 sourcefile~mapl_cap.f90->sourcefile~mapl_cfio.f90 sourcefile~mapl_demo_fargparse.f90 MAPL_demo_fargparse.F90 sourcefile~mapl_demo_fargparse.f90->sourcefile~mapl.f90 sourcefile~mapl_historycollection.f90 MAPL_HistoryCollection.F90 sourcefile~mapl_historycollection.f90->sourcefile~mapl_cfio.f90 sourcefile~mapl_historygridcomp.f90->sourcefile~mapl_cfio.f90 sourcefile~mapl_historygridcomp.f90->sourcefile~mapl_historycollection.f90 sourcefile~mapl_simplebundlemod.f90->sourcefile~mapl_cfio.f90 sourcefile~pfio_mapl_demo.f90 pfio_MAPL_demo.F90 sourcefile~pfio_mapl_demo.f90->sourcefile~mapl.f90 sourcefile~regrid_util.f90 Regrid_Util.F90 sourcefile~regrid_util.f90->sourcefile~mapl.f90 sourcefile~regrid_util.f90->sourcefile~mapl_cfio.f90 sourcefile~time_ave_util.f90 time_ave_util.F90 sourcefile~time_ave_util.f90->sourcefile~mapl.f90 sourcefile~utcfio_array.f90 utCFIO_Array.F90 sourcefile~utcfio_array.f90->sourcefile~mapl_cfio.f90 sourcefile~utcfio_nbits.f90 utCFIO_Nbits.F90 sourcefile~utcfio_nbits.f90->sourcefile~mapl_cfio.f90 sourcefile~varspecdescription.f90->sourcefile~mapl.f90 sourcefile~mapl_capgridcomp.f90 MAPL_CapGridComp.F90 sourcefile~mapl_capgridcomp.f90->sourcefile~extdatagridcompmod.f90 sourcefile~mapl_capgridcomp.f90->sourcefile~extdatagridcompng.f90 sourcefile~mapl_capgridcomp.f90->sourcefile~mapl_historygridcomp.f90 sourcefile~mapl_gridcomps.f90 MAPL_GridComps.F90 sourcefile~mapl_gridcomps.f90->sourcefile~mapl_cap.f90

Source Code

#include "MAPL_Generic.h"
! A RegridderSpec is used to indicate which subclass of regridder will be used.
module mapl_RegridderTypeSpec
   use MAPL_Constants
   use MAPL_KeywordEnforcerMod
   use mapl_RegridMethods
   use ESMF
   use, intrinsic :: iso_fortran_env, only: INT64
   implicit none
   private

   public :: RegridderTypeSpec 

   type :: RegridderTypeSpec
      character(len=:), allocatable :: grid_type_in
      character(len=:), allocatable :: grid_type_out
      integer :: regrid_method = UNSPECIFIED_REGRID_METHOD
   contains
      procedure :: less_than
      generic :: operator (<) => less_Than
   end type RegridderTypeSpec

   interface RegridderTypeSpec
      module procedure new_RegridderTypeSpec
   end interface RegridderTypeSpec


contains


   function new_RegridderTypeSpec(grid_type_in, grid_type_out, regrid_method, unusable, rc) result(spec)
      type (RegridderTypeSpec) :: spec
      character(len=*), intent(in) :: grid_type_in
      character(len=*), intent(in) :: grid_type_out
      integer, intent(in) :: regrid_method
      class (KeywordEnforcer), optional, intent(in) :: unusable
      integer, optional, intent(out) :: rc

      _UNUSED_DUMMY(unusable)
      _UNUSED_DUMMY(rc)

      spec%grid_type_in = grid_type_in
      spec%grid_type_out = grid_type_out
      spec%regrid_method = regrid_method

   end function new_RegridderTypeSpec

   logical function less_than(a, b)
      class (RegridderTypeSpec), intent(in) :: a
      type (RegridderTypeSpec), intent(in) :: b

      ! Compare methods

      if (a%regrid_method /= b%regrid_method) then
         less_than = (a%regrid_method < b%regrid_method) ! strictly less than
         return
      end if ! else tie
         
      ! To get here, methods are the same for a and b.
      if (any(a%regrid_method == TILING_METHODS)) then
         less_than = .false.
         ! do not care about grid types in this case
         return
      end if

      ! Compare grid types
      if (a%grid_type_in /= b%grid_type_in) then
         less_than = (a%grid_type_in < b%grid_type_in) ! strictly less than
         return
      end if ! else tie

      ! Compare out grid types
      less_than = (a%grid_type_out < b%grid_type_out)
      return
      
   end function less_than


end module mapl_RegridderTypeSpec
#undef _UNUSED_DUMMY