hconfig_params.F90 Source File


This file depends on

sourcefile~~hconfig_params.f90~~EfferentGraph sourcefile~hconfig_params.f90 hconfig_params.F90 sourcefile~errorhandling.f90 ErrorHandling.F90 sourcefile~hconfig_params.f90->sourcefile~errorhandling.f90 sourcefile~pflogger_stub.f90 pflogger_stub.F90 sourcefile~hconfig_params.f90->sourcefile~pflogger_stub.f90 sourcefile~mapl_throw.f90 MAPL_Throw.F90 sourcefile~errorhandling.f90->sourcefile~mapl_throw.f90 sourcefile~pfl_keywordenforcer.f90 PFL_KeywordEnforcer.F90 sourcefile~pflogger_stub.f90->sourcefile~pfl_keywordenforcer.f90 sourcefile~wraparray.f90 WrapArray.F90 sourcefile~pflogger_stub.f90->sourcefile~wraparray.f90

Files dependent on this one

sourcefile~~hconfig_params.f90~~AfferentGraph sourcefile~hconfig_params.f90 hconfig_params.F90 sourcefile~get_hconfig.f90~2 get_hconfig.F90 sourcefile~get_hconfig.f90~2->sourcefile~hconfig_params.f90 sourcefile~hconfig_get.f90 hconfig_get.F90 sourcefile~hconfig_get.f90->sourcefile~hconfig_params.f90 sourcefile~hconfig_get_private.f90 hconfig_get_private.F90 sourcefile~hconfig_get.f90->sourcefile~hconfig_get_private.f90 sourcefile~hconfig_get_private.f90->sourcefile~hconfig_params.f90 sourcefile~hconfig_get_private.f90->sourcefile~get_hconfig.f90~2 sourcefile~hconfig3g.f90 HConfig3G.F90 sourcefile~hconfig3g.f90->sourcefile~hconfig_get.f90 sourcefile~mapl_generic.f90 MAPL_Generic.F90 sourcefile~mapl_generic.f90->sourcefile~hconfig_get.f90 sourcefile~test_hconfig_get_private.pf Test_hconfig_get_private.pf sourcefile~test_hconfig_get_private.pf->sourcefile~hconfig_get_private.f90 sourcefile~generic3g.f90 Generic3g.F90 sourcefile~generic3g.f90->sourcefile~mapl_generic.f90 sourcefile~mapl3_deprecated.f90 MAPL3_Deprecated.F90 sourcefile~mapl3_deprecated.f90->sourcefile~mapl_generic.f90 sourcefile~protoextdatagc.f90 ProtoExtDataGC.F90 sourcefile~protoextdatagc.f90->sourcefile~mapl_generic.f90 sourcefile~simpleleafgridcomp.f90 SimpleLeafGridComp.F90 sourcefile~simpleleafgridcomp.f90->sourcefile~mapl_generic.f90 sourcefile~simpleparentgridcomp.f90 SimpleParentGridComp.F90 sourcefile~simpleparentgridcomp.f90->sourcefile~mapl_generic.f90 sourcefile~test_runchild.pf Test_RunChild.pf sourcefile~test_runchild.pf->sourcefile~mapl_generic.f90 sourcefile~test_scenarios.pf Test_Scenarios.pf sourcefile~test_scenarios.pf->sourcefile~mapl_generic.f90 sourcefile~test_simpleleafgridcomp.pf Test_SimpleLeafGridComp.pf sourcefile~test_simpleleafgridcomp.pf->sourcefile~mapl_generic.f90 sourcefile~test_simpleparentgridcomp.pf Test_SimpleParentGridComp.pf sourcefile~test_simpleparentgridcomp.pf->sourcefile~mapl_generic.f90 sourcefile~cap.f90 Cap.F90 sourcefile~cap.f90->sourcefile~generic3g.f90 sourcefile~capgridcomp.f90 CapGridComp.F90 sourcefile~capgridcomp.f90->sourcefile~generic3g.f90 sourcefile~configurableleafgridcomp.f90 ConfigurableLeafGridComp.F90 sourcefile~configurableleafgridcomp.f90->sourcefile~generic3g.f90 sourcefile~configurableparentgridcomp.f90 ConfigurableParentGridComp.F90 sourcefile~configurableparentgridcomp.f90->sourcefile~generic3g.f90 sourcefile~extdatagridcomp.f90 ExtDataGridComp.F90 sourcefile~extdatagridcomp.f90->sourcefile~generic3g.f90 sourcefile~fakedyngridcomp.f90 FakeDynGridComp.F90 sourcefile~fakedyngridcomp.f90->sourcefile~generic3g.f90 sourcefile~historycollectiongridcomp.f90 HistoryCollectionGridComp.F90 sourcefile~historycollectiongridcomp.f90->sourcefile~generic3g.f90 sourcefile~historycollectiongridcomp_private.f90 HistoryCollectionGridComp_private.F90 sourcefile~historycollectiongridcomp_private.f90->sourcefile~generic3g.f90 sourcefile~historygridcomp.f90 HistoryGridComp.F90 sourcefile~historygridcomp.f90->sourcefile~generic3g.f90 sourcefile~mapl3g.f90 mapl3g.F90 sourcefile~mapl3g.f90->sourcefile~generic3g.f90 sourcefile~test_extdatagridcomp.pf Test_ExtDataGridComp.pf sourcefile~test_extdatagridcomp.pf->sourcefile~generic3g.f90 sourcefile~test_historygridcomp.pf Test_HistoryGridComp.pf sourcefile~test_historygridcomp.pf->sourcefile~generic3g.f90

Source Code

#include "MAPL_ErrLog.h"
module mapl3g_hconfig_params

   use :: esmf, only: ESMF_HConfig
   use :: pflogger, only: logger_t => logger
   use mapl_ErrorHandling

   implicit none
   private

   public :: HConfigParams

   type :: HConfigParams
      type(ESMF_HConfig) :: hconfig
      character(len=:), allocatable :: label
      logical :: check_value_set = .FALSE.
      logical :: value_set = .FALSE.
      class(Logger_t), pointer :: logger => null()
   contains
      procedure :: log_message
      procedure :: has_logger
   end type HConfigParams

   interface HConfigParams
      module procedure :: construct_hconfig_params
   end interface HConfigParams

contains

   function construct_hconfig_params(hconfig, label, check_value_set, logger) result(params)
      type(HConfigParams) :: params
      type(ESMF_HConfig), intent(in) :: hconfig
      character(len=*), intent(in) :: label
      logical, optional, intent(in):: check_value_set
      class(Logger_t), pointer, optional, intent(in) :: logger

      params%hconfig = hconfig
      params%label = label
      if(present(check_value_set)) params%check_value_set = check_value_set
      if(present(logger)) params%logger => logger

   end function construct_hconfig_params

   logical function has_logger(this)
      class(HConfigParams), intent(in) :: this

      has_logger = associated(this%logger) 

   end function has_logger

   subroutine log_message(this, typestring, valuestring, rc)
      class(HConfigParams), intent(in) :: this
      character(len=*), intent(in) :: typestring
      character(len=*), intent(in) :: valuestring
      integer, optional, intent(out) :: rc
      integer :: status
      character(len=:), allocatable :: message

      _ASSERT(this%has_logger(), 'There is no logger.')
      message = typestring //' '// this%label //' = '// valuestring
      call this%logger%info(message)
      _RETURN(_SUCCESS)

   end subroutine log_message

end module mapl3g_hconfig_params