Test_HistoryGridComp.pf Source File


This file depends on

sourcefile~~test_historygridcomp.pf~~EfferentGraph sourcefile~test_historygridcomp.pf Test_HistoryGridComp.pf sourcefile~generic3g.f90 Generic3g.F90 sourcefile~test_historygridcomp.pf->sourcefile~generic3g.f90 sourcefile~historygridcomp_private.f90 HistoryGridComp_private.F90 sourcefile~test_historygridcomp.pf->sourcefile~historygridcomp_private.f90 sourcefile~componentdriver.f90 ComponentDriver.F90 sourcefile~generic3g.f90->sourcefile~componentdriver.f90 sourcefile~esmf_hconfigutilities.f90 ESMF_HConfigUtilities.F90 sourcefile~generic3g.f90->sourcefile~esmf_hconfigutilities.f90 sourcefile~esmf_interfaces.f90 ESMF_Interfaces.F90 sourcefile~generic3g.f90->sourcefile~esmf_interfaces.f90 sourcefile~genericgridcomp.f90 GenericGridComp.F90 sourcefile~generic3g.f90->sourcefile~genericgridcomp.f90 sourcefile~griddedcomponentdriver.f90 GriddedComponentDriver.F90 sourcefile~generic3g.f90->sourcefile~griddedcomponentdriver.f90 sourcefile~mapl_generic.f90~2 MAPL_Generic.F90 sourcefile~generic3g.f90->sourcefile~mapl_generic.f90~2 sourcefile~outermetacomponent.f90 OuterMetaComponent.F90 sourcefile~generic3g.f90->sourcefile~outermetacomponent.f90 sourcefile~outputinfo.f90 OutputInfo.F90 sourcefile~generic3g.f90->sourcefile~outputinfo.f90 sourcefile~usersetservices.f90 UserSetServices.F90 sourcefile~generic3g.f90->sourcefile~usersetservices.f90 sourcefile~verticaldimspec.f90 VerticalDimSpec.F90 sourcefile~generic3g.f90->sourcefile~verticaldimspec.f90 sourcefile~verticalgrid.f90 VerticalGrid.F90 sourcefile~generic3g.f90->sourcefile~verticalgrid.f90 sourcefile~errorhandling.f90 ErrorHandling.F90 sourcefile~historygridcomp_private.f90->sourcefile~errorhandling.f90 sourcefile~keywordenforcer.f90 KeywordEnforcer.F90 sourcefile~historygridcomp_private.f90->sourcefile~keywordenforcer.f90

Source Code

#include "MAPL_TestErr.h"
module Test_HistoryGridComp
   use pfunit
   use mapl3g_HistoryGridComp_private
   use generic3g, only: MAPL_HConfigMatch
   use esmf
   implicit none

   private

   public :: test_make_child_name
   public :: test_make_child_hconfig

contains

   @test
   subroutine test_make_child_name()

      @assertEqual(expected='a', found=make_child_name('a'))
      @assertEqual(expected='a\.b', found=make_child_name('a.b'))
      @assertEqual(expected='a\.b\.c', found=make_child_name('a.b.c'))
      
   end subroutine test_make_child_name

   @test
   subroutine test_make_child_hconfig()
      type(ESMF_HConfig) :: hconfig
      type(ESMF_HConfig) :: expected_child_hconfig, found_child_hconfig
      integer :: status

      hconfig = ESMF_HConfigCreate( content=&
           '{geoms: {geom1: &geom1 {class: latlon}}, collections: {c1: {geom: *geom1}}}', _RC)
      expected_child_hconfig = ESMF_HConfigCreate(content=&
           '{collection_name: c1, geom: {class: latlon}}', rc=status)

      found_child_hconfig = make_child_hconfig(hconfig, 'c1', _RC)
       @assertTrue(MAPL_HConfigMatch(found_child_hconfig, expected_child_hconfig))
      
      call ESMF_HConfigDestroy(hconfig, _RC)
      call ESMF_HConfigDestroy(expected_child_hconfig, _RC)
      call ESMF_HConfigDestroy(found_child_hconfig, _RC)

   end subroutine test_make_child_hconfig

end module Test_HistoryGridComp