Test_ExtDataGridComp.pf Source File


This file depends on

sourcefile~~test_extdatagridcomp.pf~~EfferentGraph sourcefile~test_extdatagridcomp.pf Test_ExtDataGridComp.pf sourcefile~extdatagridcomp_private.f90 ExtDataGridComp_private.F90 sourcefile~test_extdatagridcomp.pf->sourcefile~extdatagridcomp_private.f90 sourcefile~generic3g.f90 Generic3g.F90 sourcefile~test_extdatagridcomp.pf->sourcefile~generic3g.f90 sourcefile~errorhandling.f90 ErrorHandling.F90 sourcefile~extdatagridcomp_private.f90->sourcefile~errorhandling.f90 sourcefile~keywordenforcer.f90 KeywordEnforcer.F90 sourcefile~extdatagridcomp_private.f90->sourcefile~keywordenforcer.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 MAPL_Generic.F90 sourcefile~generic3g.f90->sourcefile~mapl_generic.f90 sourcefile~outermetacomponent.f90 OuterMetaComponent.F90 sourcefile~generic3g.f90->sourcefile~outermetacomponent.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

Source Code

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

   private

   public :: test_merge_hconfig

contains


   @test
   subroutine test_merge_hconfig()
      type(ESMF_HConfig) :: hc_main, hc_1, hc_2, expected_config, merged_config
      integer :: status

      hc_main = ESMF_HConfigCreate( content=&
           '{subconfigs: [hc1.yaml, hc2.yaml]}', _RC)
      hc_1 = ESMF_HConfigCreate(content='{Collections: {foo: {template: filea}}}', _RC)
      call ESMF_HConfigFileSave(hc_1, "hc1.yaml", _RC)
      hc_2 = ESMF_HConfigCreate(content='{Collections: {bar: {template: fileb}}}', _RC)
      call ESMF_HConfigFileSave(hc_2, "hc2.yaml", _RC)


      expected_config = ESMF_HConfigCreate(content= &
          '{Collections: {foo: {template: filea}, bar: {template: fileb}}}', _RC)

      merged_config = ESMF_HConfigCreate(_RC)
      call merge_config(merged_config, hc_main, _RC)
      @assertTrue(MAPL_HConfigMatch(merged_config, expected_config))
      
      call ESMF_HConfigDestroy(hc_main, _RC)
      call ESMF_HConfigDestroy(hc_1, _RC)
      call ESMF_HConfigDestroy(hc_2, _RC)
      call ESMF_HConfigDestroy(expected_config, _RC)
      call ESMF_HConfigDestroy(merged_config, _RC)

   end subroutine test_merge_hconfig

end module Test_ExtDataGridComp