main Program

Uses

  • program~~main~18~~UsesGraph program~main~18 main ESMF ESMF program~main~18->ESMF module~mapl_abstractcomponent mapl_AbstractComponent program~main~18->module~mapl_abstractcomponent module~mapl_abstractframeworkcomponent mapl_AbstractFrameworkComponent program~main~18->module~mapl_abstractframeworkcomponent module~mapl_compositecomponent mapl_CompositeComponent program~main~18->module~mapl_compositecomponent module~mapl_concretecomposite mapl_ConcreteComposite program~main~18->module~mapl_concretecomposite module~mapl_maplgenericcomponent mapl_MaplGenericComponent program~main~18->module~mapl_maplgenericcomponent module~usercomponent_mod UserComponent_mod program~main~18->module~usercomponent_mod module~pflogger pflogger module~mapl_abstractcomponent->module~pflogger module~mapl_surrogateframeworkcomponent mapl_SurrogateFrameworkComponent module~mapl_abstractframeworkcomponent->module~mapl_surrogateframeworkcomponent module~mapl_compositecomponent->module~mapl_abstractframeworkcomponent module~mapl_compositecomponent->module~mapl_concretecomposite module~mapl_abstractcomposite mapl_AbstractComposite module~mapl_compositecomponent->module~mapl_abstractcomposite module~mapl_concretecomposite->module~mapl_abstractframeworkcomponent gFTL_StringVector gFTL_StringVector module~mapl_concretecomposite->gFTL_StringVector module~mapl_concretecomposite->module~mapl_abstractcomposite module~mapl_stringcompositemap mapl_StringCompositeMap module~mapl_concretecomposite->module~mapl_stringcompositemap module~mapl_maplgenericcomponent->ESMF module~mapl_maplgenericcomponent->module~mapl_abstractcomponent module~mapl_maplgenericcomponent->module~mapl_abstractframeworkcomponent module~mapl_maplgenericcomponent->module~mapl_compositecomponent module~mapl_maplgenericcomponent->module~mapl_concretecomposite module~mapl_baseframeworkcomponent mapl_BaseFrameworkComponent module~mapl_maplgenericcomponent->module~mapl_baseframeworkcomponent module~mapl_entrypointvector MAPL_EntryPointVector module~mapl_maplgenericcomponent->module~mapl_entrypointvector module~mapl_errorhandlingmod MAPL_ErrorHandlingMod module~mapl_maplgenericcomponent->module~mapl_errorhandlingmod module~mapl_keywordenforcermod MAPL_KeywordEnforcerMod module~mapl_maplgenericcomponent->module~mapl_keywordenforcermod module~mapl_maplcomponent mapl_MaplComponent module~mapl_maplgenericcomponent->module~mapl_maplcomponent module~mapl_maplgrid mapl_MaplGrid module~mapl_maplgenericcomponent->module~mapl_maplgrid module~mapl_openmp_support MAPL_OpenMP_Support module~mapl_maplgenericcomponent->module~mapl_openmp_support module~mapl_runentrypoint MAPL_RunEntryPoint module~mapl_maplgenericcomponent->module~mapl_runentrypoint module~mapl_maplgenericcomponent->module~pflogger module~usercomponent_mod->ESMF module~usercomponent_mod->module~mapl_errorhandlingmod module~usercomponent_mod->module~mapl_keywordenforcermod module~usercomponent_mod->module~mapl_maplcomponent

Calls

program~~main~18~~CallsGraph program~main~18 main add_child_component add_child_component program~main~18->add_child_component none~get_component ConcreteComposite%get_component program~main~18->none~get_component none~set_name~3 BaseComponent%set_name program~main~18->none~set_name~3 run_child run_child program~main~18->run_child set_composite set_composite program~main~18->set_composite

Variables

Type Attributes Name Initial
integer :: status
type(ESMF_Clock) :: clock
class(AbstractFrameworkComponent), pointer :: child_a => null()
class(AbstractFrameworkComponent), pointer :: child_o => null()
class(AbstractFrameworkComponent), pointer :: grandchild
class(AbstractFrameworkComponent), pointer :: root
type(ConcreteComposite), target :: root_composite
type(MaplGenericComponent), target :: tmp
type(UserComponent) :: agcm
type(UserComponent) :: dynamics
type(UserComponent) :: gcm
type(UserComponent) :: ogcm
type(UserComponent) :: physics

Source Code

program main
   use ESMF
   use mapl_MaplGenericComponent
   use mapl_ConcreteComposite
   use UserComponent_mod
   use mapl_AbstractComponent
   use mapl_AbstractFrameworkComponent
   use mapl_CompositeComponent
   implicit none

   type(MaplGenericComponent), target :: tmp
   class(AbstractFrameworkComponent), pointer :: child_o => null()
   class(AbstractFrameworkComponent), pointer :: child_a => null()
   class(AbstractFrameworkComponent), pointer :: grandchild
   type(UserComponent) :: gcm
   type(UserComponent) :: agcm, ogcm
   type(UserComponent) :: dynamics, physics
   type(ESMF_Clock) :: clock
   integer :: status

   type(ConcreteComposite), target :: root_composite
   class(AbstractFrameworkComponent), pointer :: root

   call gcm%set_name('GCM')
   call agcm%set_name('AGCM')
   call ogcm%set_name('OGCM')
   call dynamics%set_name('DYN')
   call physics%set_name('PHYSICS')


   root_composite = ConcreteComposite(tmp)
   root => root_composite%get_component()
   call root%set_composite(root_composite) ! close the circular structure

   child_a => root%add_child_component('agcm', agcm)
   grandchild => child_a%add_child_component('dynamics', dynamics)
   grandchild => child_a%add_child_component('physics', physics)

   child_o => root%add_child_component('ogcm', ogcm)

   call root%run_child('agcm', clock, 'phase', rc=status)

   call child_a%run_child('dynamics', clock, 'phase', rc=status)
   call child_a%run_child('physics', clock, 'phase', rc=status)

   call root%run_child('ogcm', clock, 'phase', rc=status)
   
end program main