-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathdriver.F90
50 lines (37 loc) · 1.54 KB
/
driver.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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