RegridAction.F90 Source File


This file depends on

sourcefile~~regridaction.f90~~EfferentGraph sourcefile~regridaction.f90 RegridAction.F90 sourcefile~errorhandling.f90 ErrorHandling.F90 sourcefile~regridaction.f90->sourcefile~errorhandling.f90 sourcefile~extensionaction.f90 ExtensionAction.F90 sourcefile~regridaction.f90->sourcefile~extensionaction.f90 sourcefile~regridder_mgr.f90 regridder_mgr.F90 sourcefile~regridaction.f90->sourcefile~regridder_mgr.f90 sourcefile~mapl_throw.f90 MAPL_Throw.F90 sourcefile~errorhandling.f90->sourcefile~mapl_throw.f90 sourcefile~extensionaction.f90->sourcefile~errorhandling.f90 sourcefile~dynamicmask.f90 DynamicMask.F90 sourcefile~regridder_mgr.f90->sourcefile~dynamicmask.f90 sourcefile~regriddermanager.f90 RegridderManager.F90 sourcefile~regridder_mgr.f90->sourcefile~regriddermanager.f90 sourcefile~regridderspec.f90 RegridderSpec.F90 sourcefile~regridder_mgr.f90->sourcefile~regridderspec.f90 sourcefile~dynamicmask.f90->sourcefile~errorhandling.f90 sourcefile~base_base.f90 Base_Base.F90 sourcefile~dynamicmask.f90->sourcefile~base_base.f90 sourcefile~regriddermanager.f90->sourcefile~errorhandling.f90 sourcefile~regriddermanager.f90->sourcefile~regridderspec.f90 sourcefile~esmfregridderfactory.f90 EsmfRegridderFactory.F90 sourcefile~regriddermanager.f90->sourcefile~esmfregridderfactory.f90 sourcefile~nullregridder.f90 NullRegridder.F90 sourcefile~regriddermanager.f90->sourcefile~nullregridder.f90 sourcefile~regridderfactory.f90 RegridderFactory.F90 sourcefile~regriddermanager.f90->sourcefile~regridderfactory.f90 sourcefile~regridderfactoryvector.f90 RegridderFactoryVector.F90 sourcefile~regriddermanager.f90->sourcefile~regridderfactoryvector.f90 sourcefile~regridderspecvector.f90 RegridderSpecVector.F90 sourcefile~regriddermanager.f90->sourcefile~regridderspecvector.f90 sourcefile~regriddervector.f90 RegridderVector.F90 sourcefile~regriddermanager.f90->sourcefile~regriddervector.f90 sourcefile~geom_mgr.f90 geom_mgr.F90 sourcefile~regridderspec.f90->sourcefile~geom_mgr.f90 sourcefile~regridderparam.f90 RegridderParam.F90 sourcefile~regridderspec.f90->sourcefile~regridderparam.f90 sourcefile~constants.f90 Constants.F90 sourcefile~base_base.f90->sourcefile~constants.f90 sourcefile~keywordenforcer.f90 KeywordEnforcer.F90 sourcefile~base_base.f90->sourcefile~keywordenforcer.f90 sourcefile~mapl_range.f90 MAPL_Range.F90 sourcefile~base_base.f90->sourcefile~mapl_range.f90 sourcefile~maplgrid.f90 MaplGrid.F90 sourcefile~base_base.f90->sourcefile~maplgrid.f90 sourcefile~esmfregridderfactory.f90->sourcefile~errorhandling.f90 sourcefile~esmfregridderfactory.f90->sourcefile~regridderspec.f90 sourcefile~esmfregridderfactory.f90->sourcefile~nullregridder.f90 sourcefile~esmfregridderfactory.f90->sourcefile~regridderfactory.f90 sourcefile~esmfregridderfactory.f90->sourcefile~regridderparam.f90 sourcefile~routehandlemanager.f90 RoutehandleManager.F90 sourcefile~esmfregridderfactory.f90->sourcefile~routehandlemanager.f90 sourcefile~routehandleparam.f90 RoutehandleParam.F90 sourcefile~esmfregridderfactory.f90->sourcefile~routehandleparam.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~nullregridder.f90->sourcefile~errorhandling.f90 sourcefile~regridderfactoryvector.f90->sourcefile~regridderfactory.f90 sourcefile~regridderspecvector.f90->sourcefile~regridderspec.f90

Files dependent on this one

sourcefile~~regridaction.f90~~AfferentGraph sourcefile~regridaction.f90 RegridAction.F90 sourcefile~fieldspec.f90 FieldSpec.F90 sourcefile~fieldspec.f90->sourcefile~regridaction.f90 sourcefile~bracketspec.f90 BracketSpec.F90 sourcefile~bracketspec.f90->sourcefile~fieldspec.f90 sourcefile~make_itemspec.f90 make_itemSpec.F90 sourcefile~make_itemspec.f90->sourcefile~fieldspec.f90 sourcefile~make_itemspec.f90->sourcefile~bracketspec.f90 sourcefile~modelverticalgrid.f90 ModelVerticalGrid.F90 sourcefile~modelverticalgrid.f90->sourcefile~fieldspec.f90 sourcefile~test_addfieldspec.pf Test_AddFieldSpec.pf sourcefile~test_addfieldspec.pf->sourcefile~fieldspec.f90 sourcefile~test_bracketspec.pf Test_BracketSpec.pf sourcefile~test_bracketspec.pf->sourcefile~fieldspec.f90 sourcefile~test_bracketspec.pf->sourcefile~bracketspec.f90 sourcefile~test_fieldspec.pf Test_FieldSpec.pf sourcefile~test_fieldspec.pf->sourcefile~fieldspec.f90 sourcefile~can_connect_to.f90 can_connect_to.F90 sourcefile~can_connect_to.f90->sourcefile~modelverticalgrid.f90 sourcefile~can_connect_to.f90~2 can_connect_to.F90 sourcefile~can_connect_to.f90~2->sourcefile~modelverticalgrid.f90 sourcefile~can_connect_to.f90~3 can_connect_to.F90 sourcefile~can_connect_to.f90~3->sourcefile~modelverticalgrid.f90 sourcefile~initialize_advertise.f90 initialize_advertise.F90 sourcefile~initialize_advertise.f90->sourcefile~make_itemspec.f90 sourcefile~parse_geometry_spec.f90 parse_geometry_spec.F90 sourcefile~parse_geometry_spec.f90->sourcefile~modelverticalgrid.f90 sourcefile~test_modelverticalgrid.pf Test_ModelVerticalGrid.pf sourcefile~test_modelverticalgrid.pf->sourcefile~make_itemspec.f90 sourcefile~test_modelverticalgrid.pf->sourcefile~modelverticalgrid.f90

Source Code

#include "MAPL_Generic.h"

module mapl3g_RegridAction

   use mapl3g_ExtensionAction
   use mapl3g_regridder_mgr
   use mapl_ErrorHandling
   use esmf

   implicit none
   private

   public :: RegridAction

   type, extends(ExtensionAction) :: ScalarRegridAction
      type(ESMF_Geom) :: src_geom
      type(ESMF_Geom) :: dst_geom
      type(EsmfRegridderParam) :: dst_param

      class(Regridder), pointer :: regrdr
   contains
      procedure :: initialize
      procedure :: update
   end type ScalarRegridAction

   interface RegridAction
      module procedure :: new_ScalarRegridAction
   end interface RegridAction

contains

   function new_ScalarRegridAction(src_geom, dst_geom, dst_param) result(action)
      type(ScalarRegridAction) :: action
      type(ESMF_Geom), intent(in) :: src_geom
      type(ESMF_Geom), intent(in) :: dst_geom
      type(EsmfRegridderParam), intent(in) :: dst_param

      type(RegridderSpec) :: spec
      type(RegridderManager), pointer :: regridder_manager

      action%src_geom = src_geom
      action%dst_geom = dst_geom
      action%dst_param = dst_param

   end function new_ScalarRegridAction

   subroutine initialize(this, importState, exportState, clock, rc)
      class(ScalarRegridAction), intent(inout) :: this
      type(ESMF_State)      :: importState
      type(ESMF_State)      :: exportState
      type(ESMF_Clock)      :: clock      
      integer, optional, intent(out) :: rc

      integer :: status
      type(RegridderSpec) :: spec
      type(RegridderManager), pointer :: regridder_manager

      regridder_manager => get_regridder_manager()
      spec = RegridderSpec(this%dst_param, this%src_geom, this%dst_geom)
      this%regrdr => regridder_manager%get_regridder(spec, _RC)

      _RETURN(_SUCCESS)
      _UNUSED_DUMMY(this)
      _UNUSED_DUMMY(importState)
      _UNUSED_DUMMY(exportState)
      _UNUSED_DUMMY(clock)
   end subroutine initialize


   subroutine update(this, importState, exportState, clock, rc)
      class(ScalarRegridAction), intent(inout) :: this
      type(ESMF_State)      :: importState
      type(ESMF_State)      :: exportState
      type(ESMF_Clock)      :: clock      
      integer, optional, intent(out) :: rc

      integer :: status
      type(ESMF_Field) :: f_in, f_out

      call ESMF_StateGet(importState, itemName='import[1]', field=f_in, _RC)
      call ESMF_StateGet(exportState, itemName='export[1]', field=f_out, _RC)
      call this%regrdr%regrid(f_in, f_out, _RC)


      _RETURN(_SUCCESS)
      _UNUSED_DUMMY(clock)
   end subroutine update

end module mapl3g_RegridAction