-
Notifications
You must be signed in to change notification settings - Fork 155
/
Copy pathIPD_driver.F90
160 lines (127 loc) · 6.33 KB
/
IPD_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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
module IPD_driver
use IPD_typedefs, only: IPD_init_type, &
IPD_control_type, IPD_data_type, &
IPD_diag_type, IPD_restart_type, &
IPD_interstitial_type
#ifdef CCPP
use physics_abstraction_layer, only: initialize, time_vary_step, &
finalize
#else
use physics_abstraction_layer, only: initialize, time_vary_step, &
radiation_step1, physics_step1, &
physics_step2, finalize
#endif
use physics_diag_layer, only: diag_populate
use physics_restart_layer, only: restart_populate
implicit none
!------------------------------------------------------!
! IPD containers !
!------------------------------------------------------!
! type(GFS_control_type) :: IPD_Control !
! type(IPD_data_type) allocatable :: IPD_Data(:) !
! type(IPD_diag_type), :: IPD_Diag(:) !
! type(IPD_restart_type), :: IPD_Restart !
!------------------------------------------------------!
!----------------
! Public Entities
!----------------
! functions
public IPD_initialize
public IPD_setup_step
#ifndef CCPP
public IPD_radiation_step
public IPD_physics_step1
public IPD_physics_step2
#endif
public IPD_finalize
CONTAINS
!*******************************************************************************************
!----------------
! IPD initialize
!----------------
subroutine IPD_initialize (IPD_control, IPD_Data, IPD_Diag, IPD_Restart, IPD_Interstitial, IPD_init_parm)
type(IPD_control_type), intent(inout) :: IPD_Control
type(IPD_data_type), intent(inout) :: IPD_Data(:)
type(IPD_diag_type), intent(inout) :: IPD_Diag(:)
type(IPD_restart_type), intent(inout) :: IPD_Restart
type(IPD_interstitial_type), intent(inout) :: IPD_Interstitial(:)
type(IPD_init_type), intent(in) :: IPD_init_parm
!--- initialize the physics suite
call initialize (IPD_Control, IPD_Data(:)%Statein, IPD_Data(:)%Stateout, &
IPD_Data(:)%Sfcprop, IPD_Data(:)%Coupling, IPD_Data(:)%Grid, &
IPD_Data(:)%Tbd, IPD_Data(:)%Cldprop, IPD_Data(:)%Radtend, &
IPD_Data(:)%Intdiag, IPD_Interstitial(:), IPD_init_parm)
!--- populate/associate the Diag container elements
call diag_populate (IPD_Diag(:), IPD_control, IPD_Data%Statein, IPD_Data(:)%Stateout, &
IPD_Data(:)%Sfcprop, IPD_Data(:)%Coupling, IPD_Data(:)%Grid, &
IPD_Data(:)%Tbd, IPD_Data(:)%Cldprop, IPD_Data(:)%Radtend, &
IPD_Data(:)%Intdiag, IPD_init_parm)
!--- allocate and populate/associate the Restart container elements
call restart_populate (IPD_Restart, IPD_control, IPD_Data(:)%Statein, IPD_Data(:)%Stateout, &
IPD_Data(:)%Sfcprop, IPD_Data(:)%Coupling, IPD_Data(:)%Grid, &
IPD_Data(:)%Tbd, IPD_Data(:)%Cldprop, IPD_Data(:)%Radtend, &
IPD_Data(:)%Intdiag, IPD_init_parm)
end subroutine IPD_initialize
!---------------------------------------------
! IPD setup step
! surface data cycling, random streams, etc
!---------------------------------------------
subroutine IPD_setup_step (IPD_Control, IPD_Data, IPD_Diag, IPD_Restart)
type(IPD_control_type), intent(inout) :: IPD_Control
type(IPD_data_type), intent(inout) :: IPD_Data(:)
type(IPD_diag_type), intent(inout) :: IPD_Diag(:)
type(IPD_restart_type), intent(inout) :: IPD_Restart
call time_vary_step (IPD_Control, IPD_Data(:)%Statein, IPD_Data(:)%Stateout, &
IPD_Data(:)%Sfcprop, IPD_Data(:)%Coupling, IPD_Data(:)%Grid, &
IPD_Data(:)%Tbd, IPD_Data(:)%Cldprop, IPD_Data(:)%Radtend, &
IPD_Data(:)%Intdiag)
end subroutine IPD_setup_step
#ifndef CCPP
!--------------------
! IPD radiation step
!--------------------
subroutine IPD_radiation_step (IPD_Control, IPD_Data, IPD_Diag, IPD_Restart)
type(IPD_control_type), intent(inout) :: IPD_Control
type(IPD_data_type), intent(inout) :: IPD_Data
type(IPD_diag_type), intent(inout) :: IPD_Diag(:)
type(IPD_restart_type), intent(inout) :: IPD_Restart
call radiation_step1 (IPD_control, IPD_Data%Statein, IPD_Data%Stateout, &
IPD_Data%Sfcprop, IPD_Data%Coupling, IPD_Data%Grid, &
IPD_Data%Tbd, IPD_Data%Cldprop, IPD_Data%Radtend, &
IPD_Data%Intdiag)
end subroutine IPD_radiation_step
!-------------------
! IPD physics step1
!-------------------
subroutine IPD_physics_step1 (IPD_Control, IPD_Data, IPD_Diag, IPD_Restart)
type(IPD_control_type), intent(inout) :: IPD_Control
type(IPD_data_type), intent(inout) :: IPD_Data
type(IPD_diag_type), intent(inout) :: IPD_Diag(:)
type(IPD_restart_type), intent(inout) :: IPD_Restart
call physics_step1 (IPD_control, IPD_Data%Statein, IPD_Data%Stateout, &
IPD_Data%Sfcprop, IPD_Data%Coupling, IPD_Data%Grid, &
IPD_Data%Tbd, IPD_Data%Cldprop, IPD_Data%Radtend, &
IPD_Data%Intdiag)
end subroutine IPD_physics_step1
!-------------------
! IPD physics step2
!-------------------
subroutine IPD_physics_step2 (IPD_Control, IPD_Data, IPD_Diag, IPD_Restart)
type(IPD_control_type), intent(inout) :: IPD_Control
type(IPD_data_type), intent(inout) :: IPD_Data
type(IPD_diag_type), intent(inout) :: IPD_Diag(:)
type(IPD_restart_type), intent(inout) :: IPD_Restart
call physics_step2 (IPD_control, IPD_Data%Statein, IPD_Data%Stateout, &
IPD_Data%Sfcprop, IPD_Data%Coupling, IPD_Data%Grid, &
IPD_Data%Tbd, IPD_Data%Cldprop, IPD_Data%Radtend, &
IPD_Data%Intdiag)
end subroutine IPD_physics_step2
#endif
!----------------
! IPD finalize
!----------------
subroutine IPD_finalize ()
!--- finalize the physics suite
call finalize ()
end subroutine IPD_finalize
end module IPD_driver