1 ! Generated by TAPENADE (INRIA, Tropics team)
2 ! Tapenade 3.6 (r4343) - 10 Feb 2012 10:52
4 !WRF:MODEL_LAYER:INITIALIZATION
6 ! This MODULE holds the routines which are used to perform model start-up operations
7 ! for the individual domains. This is the stage after inputting wrfinput and before
9 ! This MODULE CONTAINS the following routines:
10 MODULE G_MODULE_PHYSICS_INIT
12 USE module_state_description
13 USE module_model_constants
14 USE module_configure, ONLY : grid_config_rec_type
15 USE module_physics_init, ONLY : landuse_init
18 ! Differentiation of phy_init in forward (tangent) mode:
19 ! variations of useful results: rublten raincv rqccuten rthcuten
20 ! rainnc rainc rqvblten w0avg snownc rvblten
21 ! graupelnc rthblten graupelncv snowncv rqvcuten
23 ! with respect to varying inputs: rublten raincv rqccuten rthcuten
24 ! rainnc rainc rqvblten w0avg snownc rvblten
25 ! graupelnc rthblten graupelncv snowncv rqvcuten
27 ! RW status of diff variables: rublten:in-out raincv:in-out rqccuten:in-out
28 ! rthcuten:in-out rainnc:in-out rainc:in-out rqvblten:in-out
29 ! w0avg:in-out snownc:in-out rvblten:in-out
30 ! graupelnc:in-out rthblten:in-out graupelncv:in-out
31 ! snowncv:in-out rqvcuten:in-out rainncv:in-out
32 !=================================================================
35 ! num_roof_layers,num_wall_layers, &
40 SUBROUTINE G_PHY_INIT(id, config_flags, dt, restart, zfull, zhalf, &
41 & p_top, tsk, radt, bldt, cudt, mpdt, rucuten, rvcuten, rthcuten&
42 & , rthcutend, rqvcuten, rqvcutend, rqrcuten, rqccuten, rqccutend, &
43 & rqscuten, rqicuten, rushten, rvshten, rthshten, rqvshten, rqrshten, &
44 & rqcshten, rqsshten, rqishten, rqgshten, rublten, rubltend, rvblten, &
45 & rvbltend, rthblten, rthbltend, rqvblten, rqvbltend, rqcblten, &
46 & rqiblten, rthraten, rthratenlw, rthratensw, stepbl, stepra, stepcu, &
47 & w0avg, w0avgd, rainnc, rainncd, rainc, raincd, raincv, raincvd, &
48 & rainncv, rainncvd, snownc, snowncd, snowncv, snowncvd, graupelnc, &
49 & graupelncd, graupelncv, graupelncvd, nca, swrad_scat, cldefi, lowlyr&
50 & , mass_flux, rthften, rqvften, cldfra, cldfra_old, glw, gsw, emiss, &
51 & embck, lu_index, landuse_isice, landuse_lucats, landuse_luseas, &
52 & landuse_isn, lu_state, xlat, xlong, albedo, albbck, gmt, julyr, &
53 & julday, levsiz, n_ozmixm, n_aerosolc, paerlev, alevsiz, no_src_types, tmn, xland, znt, z0, &
54 & ust, mol, pblh, tke_pbl, exch_h, thc, snowc, mavail, hfx, qfx, &
55 & rainbl, tslb, zs, dzs, num_soil_layers, warm_rain, adv_moist_cond, &
56 & apr_gr, apr_w, apr_mc, apr_st, apr_as, apr_capma, apr_capme, &
57 & apr_capmi, xice, xicem, vegfra, snow, canwat, smstav, smstot, &
58 & sfcrunoff, udrunoff, grdflx, acsnow, acsnom, ivgtyp, isltyp, sfcevp&
59 & , smois, sh2o, snowh, smfr3d, snoalb, dx, dy, f_ice_phy, f_rain_phy&
60 & , f_rimef_phy, mp_restart_state, tbpvs_state, tbpvs0_state, &
61 & allowed_to_read, moved, start_of_simulation, lagday, ids, ide, jds, &
62 & jde, kds, kde, ims, ime, jms, jme, kms, kme, its, ite, jts, jte, kts&
63 & , kte, num_urban_ndm,urban_map_zrd,urban_map_zwd,urban_map_gd,urban_map_zd,&
64 & urban_map_zdf,urban_map_bd,urban_map_wd,urban_map_gbd,urban_map_fbd, &
65 & NUM_URBAN_HI, raincv_a, raincv_b, gd_cloud, gd_cloud2, &
66 & gd_cloud_a, gd_cloud2_a, gd_cloud_b, gd_cloud2_b, ozmixm, pin, &
67 & m_ps_1, m_ps_2, m_hybi, aerosolc_1, aerosolc_2, rundgdten, rvndgdten&
68 & , rthndgdten, rphndgdten, rqvndgdten, rmundgdten, fgdt, stepfg, &
69 & cugd_tten, cugd_ttens, cugd_qvten, cugd_qvtens, cugd_qcten, isnowxy&
70 & , zsnsoxy, tsnoxy, snicexy, snliqxy, tvxy, tgxy, canicexy, canliqxy&
71 & , eahxy, tahxy, cmxy, chxy, fwetxy, sneqvoxy, alboldxy, qsnowxy, qrainxy,&
72 & wslakexy, zwtxy, waxy, wtxy, lfmassxy, rtmassxy, stmassxy, woodxy, &
73 & stblcpxy, fastcpxy, xsaixy, t2mvxy, t2mbxy, chstarxy, dzr, dzb, dzg&
74 & , tr_urb2d, tb_urb2d, tg_urb2d, tc_urb2d, qc_urb2d, xxxr_urb2d, &
75 & xxxb_urb2d, xxxg_urb2d, xxxc_urb2d, trl_urb3d, tbl_urb3d, tgl_urb3d&
76 & , sh_urb2d, lh_urb2d, g_urb2d, rn_urb2d, ts_urb2d, frc_urb2d, &
77 & utype_urb2d, trb_urb4d, tw1_urb4d, tw2_urb4d, tgb_urb4d, tlev_urb3d&
78 & , qlev_urb3d, tw1lev_urb3d, tw2lev_urb3d, tglev_urb3d, tflev_urb3d, &
79 & sf_ac_urb3d, lf_ac_urb3d, cm_ac_urb3d, sfvent_urb3d, lfvent_urb3d, &
80 & sfwin1_urb3d, sfwin2_urb3d, sfw1_urb3d, sfw2_urb3d, sfr_urb3d, &
81 & sfg_urb3d, a_u_bep, a_v_bep, a_t_bep, a_q_bep, a_e_bep, b_u_bep, &
82 & b_v_bep, b_t_bep, b_q_bep, b_e_bep, dlg_bep, dl_u_bep, sf_bep, &
83 & vl_bep, tml, t0ml, hml, h0ml, huml, hvml, tmoml, itimestep, fdob, &
84 & t00, p00, tlp, tyr, tyra, tdly, tlag, nyear, nday, tmn_update, achfx&
85 & , aclhf, acgrdflx, te_temf, cf3d_temf, wm_temf, massflux_edkf, &
86 & entr_edkf, detr_edkf, thl_up, thv_up, rt_up, rv_up, rc_up, u_up, &
93 !-----------------------------------------------------------------
94 !-----------------------------------------------------------------
95 TYPE(GRID_CONFIG_REC_TYPE) :: config_flags
96 INTEGER, INTENT(IN) :: id
97 INTEGER, INTENT(IN), OPTIONAL :: tmn_update
98 LOGICAL, INTENT(OUT) :: warm_rain, adv_moist_cond
99 ! LOGICAL , INTENT (IN) :: FNDSOILW, FNDSNOWH
100 LOGICAL, PARAMETER :: fndsoilw=.true., fndsnowh=.true.
101 INTEGER, INTENT(IN) :: ids, ide, jds, jde, kds, kde, ims, ime, jms, &
102 & jme, kms, kme, its, ite, jts, jte, kts, kte
103 INTEGER, INTENT(IN) :: num_soil_layers
104 INTEGER, INTENT(IN) :: lagday
105 INTEGER, INTENT(OUT), OPTIONAL :: nyear
106 REAL, INTENT(OUT), OPTIONAL :: nday
107 LOGICAL, INTENT(IN) :: start_of_simulation
108 REAL, INTENT(IN) :: dt, p_top, dx, dy
109 LOGICAL, INTENT(IN) :: restart
110 REAL, INTENT(IN) :: radt, bldt, cudt, mpdt
111 REAL, INTENT(IN) :: swrad_scat
112 REAL, DIMENSION(kms:kme), INTENT(IN) :: zfull, zhalf
113 REAL, DIMENSION(ims:ime, jms:jme), INTENT(IN) :: tsk, xlat, xlong
114 INTEGER, INTENT(IN) :: levsiz, n_ozmixm
115 INTEGER, INTENT(IN) :: paerlev, n_aerosolc
116 INTEGER, INTENT(IN ) :: alevsiz, no_src_types
117 REAL, DIMENSION(ims:ime, levsiz, jms:jme, n_ozmixm), OPTIONAL, &
118 & INTENT(INOUT) :: ozmixm
119 REAL, DIMENSION(levsiz), OPTIONAL, INTENT(INOUT) :: pin
120 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: m_ps_1&
122 REAL, DIMENSION(paerlev), OPTIONAL, INTENT(INOUT) :: m_hybi
123 REAL, DIMENSION(ims:ime, paerlev, jms:jme, n_aerosolc), OPTIONAL, &
124 & INTENT(INOUT) :: aerosolc_1, aerosolc_2
125 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), INTENT(INOUT) ::&
127 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), INTENT(OUT) :: &
129 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: snow, snowc, &
130 & snowh, canwat, smstav, smstot, sfcrunoff, udrunoff, sfcevp, grdflx, &
131 & acsnow, xice, xicem, vegfra, acsnom
132 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: achfx&
134 INTEGER, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: ivgtyp, &
137 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: rthraten&
138 & , rthratenlw, rthratensw, cldfra
139 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) ::&
142 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: gsw, albedo, &
143 & albbck, glw, emiss, embck
144 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: snoalb
145 REAL, INTENT(IN) :: gmt
146 INTEGER, INTENT(OUT) :: stepra, stepbl, stepcu
147 INTEGER, INTENT(IN) :: julyr, julday
149 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: rucuten, &
150 & rvcuten, rthcuten, rqvcuten, rqrcuten, rqccuten, rqscuten, rqicuten&
151 & , rushten, rvshten, rthshten, rqvshten, rqrshten, rqcshten, rqsshten&
152 & , rqishten, rqgshten
153 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: rthcutend&
154 & , rqvcutend, rqccutend
155 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(OUT) :: w0avg
156 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(OUT) :: w0avgd
157 REAL, DIMENSION(ims:ime, jms:jme), INTENT(OUT) :: mass_flux, apr_gr&
158 & , apr_w, apr_mc, apr_st, apr_as, apr_capma, apr_capme, apr_capmi
159 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: rthften, &
161 REAL, DIMENSION(ims:ime, jms:jme), INTENT(OUT) :: rainnc, rainc, &
162 & raincv, rainncv, snownc, snowncv, graupelnc, graupelncv
163 REAL, DIMENSION(ims:ime, jms:jme), INTENT(OUT) :: rainncd, raincd, &
164 & raincvd, rainncvd, snowncd, snowncvd, graupelncd, graupelncvd
165 REAL, DIMENSION(ims:ime, jms:jme), INTENT(OUT) :: cldefi, nca
166 INTEGER, DIMENSION(ims:ime, jms:jme), INTENT(OUT) :: lowlyr
169 REAL, DIMENSION(num_soil_layers), INTENT(INOUT) :: zs, dzs
170 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: rublten, &
171 & rvblten, rthblten, rqvblten, rqcblten, rqiblten, exch_h, tke_pbl
172 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: rubltend&
173 & , rvbltend, rthbltend, rqvbltend
174 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(OUT), OPTIONAL ::&
175 & massflux_edkf, entr_edkf, detr_edkf, thl_up, thv_up, rt_up, rv_up, &
176 & rc_up, u_up, v_up, frac_up
177 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(OUT) ::&
178 & cugd_tten, cugd_ttens, cugd_qvten, cugd_qvtens, cugd_qcten
179 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: xland, znt, z0, &
180 & ust, mol, lu_index, pblh, thc, mavail, hfx, qfx, rainbl
181 INTEGER, INTENT(INOUT) :: landuse_isice, landuse_lucats
182 INTEGER, INTENT(INOUT) :: landuse_luseas, landuse_isn
183 REAL, DIMENSION(:), INTENT(INOUT) :: lu_state
184 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: tmn
185 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT), OPTIONAL :: tyr
186 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT), OPTIONAL :: tyra
187 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT), OPTIONAL :: tdly
188 REAL, DIMENSION(ims:ime, lagday, jms:jme), INTENT(INOUT), OPTIONAL &
190 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
191 & :: gd_cloud, gd_cloud2, gd_cloud_a, gd_cloud2_a, gd_cloud_b, &
193 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: raincv_a, &
196 INTEGER, DIMENSION(ims:ime, jms:jme), OPTIONAL :: isnowxy
197 REAL, DIMENSION(ims:ime, -2:num_soil_layers, jms:jme), OPTIONAL :: &
199 REAL, DIMENSION(ims:ime, -2:0, jms:jme), OPTIONAL :: tsnoxy
200 REAL, DIMENSION(ims:ime, -2:0, jms:jme), OPTIONAL :: snicexy
201 REAL, DIMENSION(ims:ime, -2:0, jms:jme), OPTIONAL :: snliqxy
202 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: tvxy
203 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: tgxy
204 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: canicexy
205 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: canliqxy
206 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: eahxy
207 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: tahxy
208 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: cmxy
209 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: chxy
210 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: fwetxy
211 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: sneqvoxy
212 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: alboldxy
213 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: qsnowxy
214 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: qrainxy
215 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: wslakexy
216 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: zwtxy
217 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: waxy
218 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: wtxy
219 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: lfmassxy
220 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: rtmassxy
221 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: stmassxy
222 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: woodxy
223 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: stblcpxy
224 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: fastcpxy
225 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: xsaixy
226 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: t2mvxy
227 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: t2mbxy
228 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: chstarxy
230 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(OUT) :: f_ice_phy&
231 & , f_rain_phy, f_rimef_phy
232 REAL, DIMENSION(:), INTENT(INOUT) :: mp_restart_state, tbpvs_state, &
234 LOGICAL, INTENT(IN) :: allowed_to_read, moved
236 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: tml, &
237 & t0ml, hml, h0ml, huml, hvml, tmoml
239 REAL, OPTIONAL, INTENT(IN) :: fgdt
240 INTEGER, OPTIONAL, INTENT(OUT) :: stepfg
241 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(OUT) ::&
242 & rundgdten, rvndgdten, rthndgdten, rphndgdten, rqvndgdten
243 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(OUT) :: &
246 ! REAL, DIMENSION(1:num_roof_layers), INTENT(INOUT) :: DZR !urban
247 ! REAL, DIMENSION(1:num_wall_layers), INTENT(INOUT) :: DZB !urban
248 ! REAL, DIMENSION(1:num_road_layers), INTENT(INOUT) :: DZG !urban
250 REAL, DIMENSION(num_soil_layers), OPTIONAL, INTENT(INOUT) :: dzr
252 REAL, DIMENSION(num_soil_layers), OPTIONAL, INTENT(INOUT) :: dzb
254 REAL, DIMENSION(num_soil_layers), OPTIONAL, INTENT(INOUT) :: dzg
256 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
259 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
262 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
265 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
268 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
271 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
274 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
277 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
280 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
282 ! REAL, DIMENSION(ims:ime, 1:num_roof_layers, jms:jme), INTENT(INOUT) :: TRL_URB3D !urban
283 ! REAL, DIMENSION(ims:ime, 1:num_wall_layers, jms:jme), INTENT(INOUT) :: TBL_URB3D !urban
284 ! REAL, DIMENSION(ims:ime, 1:num_road_layers, jms:jme), INTENT(INOUT) :: TGL_URB3D !urban
286 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), OPTIONAL, &
287 & INTENT(INOUT) :: trl_urb3d
289 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), OPTIONAL, &
290 & INTENT(INOUT) :: tbl_urb3d
292 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), OPTIONAL, &
293 & INTENT(INOUT) :: tgl_urb3d
295 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
298 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
301 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
304 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
307 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
310 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
313 INTEGER, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
315 INTEGER, INTENT(IN) :: num_urban_ndm
316 INTEGER, INTENT(IN) :: urban_map_zrd
317 INTEGER, INTENT(IN) :: urban_map_zwd
318 INTEGER, INTENT(IN) :: urban_map_gd
319 INTEGER, INTENT(IN) :: urban_map_zd
320 INTEGER, INTENT(IN) :: urban_map_zdf
321 INTEGER, INTENT(IN) :: urban_map_bd
322 INTEGER, INTENT(IN) :: urban_map_wd
323 INTEGER, INTENT(IN) :: urban_map_gbd
324 INTEGER, INTENT(IN) :: urban_map_fbd
325 INTEGER, INTENT(IN) :: num_urban_hi
327 REAL, DIMENSION(ims:ime, urban_map_zrd, jms:jme), OPTIONAL, &
328 & INTENT(INOUT) :: trb_urb4d
330 REAL, DIMENSION(ims:ime, urban_map_zwd, jms:jme), OPTIONAL, &
331 & INTENT(INOUT) :: tw1_urb4d
333 REAL, DIMENSION(ims:ime, urban_map_zwd, jms:jme), OPTIONAL, &
334 & INTENT(INOUT) :: tw2_urb4d
336 REAL, DIMENSION(ims:ime, urban_map_gd, jms:jme), OPTIONAL, &
337 & INTENT(INOUT) :: tgb_urb4d
339 REAL, DIMENSION(ims:ime, urban_map_bd, jms:jme), OPTIONAL, &
340 & INTENT(INOUT) :: tlev_urb3d
342 REAL, DIMENSION(ims:ime, urban_map_bd, jms:jme), OPTIONAL, &
343 & INTENT(INOUT) :: qlev_urb3d
345 REAL, DIMENSION(ims:ime, urban_map_wd, jms:jme), OPTIONAL, &
346 & INTENT(INOUT) :: tw1lev_urb3d
348 REAL, DIMENSION(ims:ime, urban_map_wd, jms:jme), OPTIONAL, &
349 & INTENT(INOUT) :: tw2lev_urb3d
351 REAL, DIMENSION(ims:ime, urban_map_gbd, jms:jme), OPTIONAL, &
352 & INTENT(INOUT) :: tglev_urb3d
354 REAL, DIMENSION(ims:ime, urban_map_fbd, jms:jme), OPTIONAL, &
355 & INTENT(INOUT) :: tflev_urb3d
357 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
360 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
363 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
366 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
369 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
372 REAL, DIMENSION(ims:ime, urban_map_wd, jms:jme), OPTIONAL, &
373 & INTENT(INOUT) :: sfwin1_urb3d
375 REAL, DIMENSION(ims:ime, urban_map_wd, jms:jme), OPTIONAL, &
376 & INTENT(INOUT) :: sfwin2_urb3d
378 REAL, DIMENSION(ims:ime, num_urban_ndm, jms:jme), OPTIONAL, &
379 & INTENT(INOUT) :: sfg_urb3d
381 REAL, DIMENSION(ims:ime, urban_map_zdf, jms:jme), OPTIONAL, &
382 & INTENT(INOUT) :: sfr_urb3d
384 REAL, DIMENSION(ims:ime, urban_map_zd, jms:jme), OPTIONAL, &
385 & INTENT(INOUT) :: sfw1_urb3d
387 REAL, DIMENSION(ims:ime, urban_map_zd, jms:jme), OPTIONAL, &
388 & INTENT(INOUT) :: sfw2_urb3d
389 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
391 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
393 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
395 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
397 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
399 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
401 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
403 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
405 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
407 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
409 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
411 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
413 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
415 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
418 INTEGER, OPTIONAL, INTENT(IN) :: itimestep
419 TYPE(FDOB_TYPE), OPTIONAL, INTENT(INOUT) :: fdob
420 ! for obs-nudging base-state calcn
421 REAL, OPTIONAL, INTENT(IN) :: p00, t00, tlp
423 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(OUT) ::&
426 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(OUT) :: wm_temf
428 REAL :: alblnd, zzlnd, zzwtr, thinld, xmava, cen_lat, pptop
429 REAL, DIMENSION(kms:kme) :: sfull, shalf
430 REAL :: obs_twindo_cg, obs_twindo
431 CHARACTER(len=256) :: mminlu_loc
432 CHARACTER(len=512) :: message
436 INTEGER :: sf_urban_physics
437 INTEGER :: sf_ocean_physics
442 INTEGER :: i, j, k, itf, jtf, ktf, n
447 !-----------------------------------------------------------------
448 sf_urban_physics = config_flags%sf_urban_physics
449 usemonalb = config_flags%usemonalb
450 rdmaxalb = config_flags%rdmaxalb
451 mfshconv = config_flags%mfshconv
452 obs_twindo_cg = model_config_rec%obs_twindo(1)
453 obs_twindo = config_flags%obs_twindo
454 oml_hml0 = config_flags%oml_hml0
455 sf_ocean_physics=config_flags%sf_ocean_physics
456 !-- should be from the namelist
459 CALL WRF_DEBUG(100, 'top of phy_init')
460 WRITE(wrf_err_message, *) 'phy_init: start_of_simulation = ', &
461 & start_of_simulation
462 CALL WRF_DEBUG(100, TRIM(wrf_err_message))
463 IF (ite .GT. ide - 1) THEN
468 IF (jte .GT. jde - 1) THEN
473 IF (kte .GT. kde - 1) THEN
483 CALL NL_GET_CEN_LAT(id, cen_lat)
484 CALL WRF_DEBUG(100, &
485 & 'calling nl_get_iswater, nl_get_isice, nl_get_mminlu_loc')
486 CALL NL_GET_ISWATER(id, iswater)
487 CALL NL_GET_ISICE(id, isice)
488 CALL NL_GET_ISURBAN(id, isurban)
489 CALL NL_GET_MMINLU(1, mminlu_loc)
490 CALL WRF_DEBUG(100, &
491 & 'after nl_get_iswater, nl_get_isice, nl_get_mminlu_loc')
492 !-- temporary fix by ww
493 landuse_isice = isice
494 IF (.NOT.restart) THEN
495 !-- initialize common variables
502 !-- initialize ust to a small value
513 graupelncvd(i, j) = 0.0
514 graupelncv(i, j) = 0.
516 !wig, 17-May-2006: Added for idealized chem. runs
524 IF (PRESENT(tmn_update)) THEN
525 IF (tmn_update .EQ. 1) THEN
530 tyr(i, j) = tmn(i, j)
534 tlag(i, n, j) = tmn(i, j)
544 IF (xland(i, j) .LT. 1.5) THEN
545 IF (mminlu_loc .EQ. ' ') albbck(i, j) = alblnd
547 albedo(i, j) = albbck(i, j)
548 emiss(i, j) = embck(i, j)
554 IF (mminlu_loc .EQ. ' ') albbck(i, j) = 0.08
555 albedo(i, j) = albbck(i, j)
557 emiss(i, j) = embck(i, j)
565 IF (config_flags%cu_diag .EQ. 1) THEN
569 gd_cloud(i, k, j) = 0.
570 gd_cloud2(i, k, j) = 0.
571 gd_cloud_a(i, k, j) = 0.
572 gd_cloud2_a(i, k, j) = 0.
583 CALL WRF_DEBUG(200, &
584 & 'module_start: phy_init: Before call to landuse_init')
585 IF (mminlu_loc .NE. ' ') CALL LANDUSE_INIT(lu_index, snowc, &
586 & albedo, albbck, snoalb, &
587 & mavail, emiss, embck, znt&
588 & , z0, thc, xland, xice, &
589 & xicem, julday, cen_lat, &
590 & iswater, TRIM(mminlu_loc)&
594 & landuse_isn, config_flags%&
595 & fractional_seaice, &
596 & lu_state, allowed_to_read&
597 & , usemonalb, ids, ide, jds&
598 & , jde, kds, kde, ims, ime&
599 & , jms, jme, kms, kme, its&
600 & , ite, jts, jte, kts, kte)
601 !-- initialize surface properties
603 !-- initialize physics
608 CALL WRF_DEBUG(200, 'module_start: phy_init: Before call to bl_init'&
617 !Optional multi-layer urban
618 !Optional multi-layer urban
619 !Optional multi-layer urban
620 !Optional multi-layer urban
621 !Optional multi-layer urban
622 !Optional multi-layer urban
623 !Optional multi-layer urban
624 !Optional multi-layer urban
625 !Optional multi-layer urban
626 !Optional multi-layer urban
627 !Optional multi-layer urban
628 !Optional multi-layer urban
629 !Optional multi-layer urban
630 !Optional multi-layer urban
632 CALL BL_INIT_D(stepbl, bldt, dt, rublten, rubltend, rvblten, &
633 & rvbltend, rthblten, rthbltend, rqvblten, rqvbltend, &
634 & rqcblten, rqiblten, tsk, tmn, config_flags, restart, &
635 & ust, lowlyr, tslb, zs, dzs, num_soil_layers, tke_pbl, &
636 & mfshconv, massflux_edkf, entr_edkf, detr_edkf, thl_up, &
637 & thv_up, rt_up, rv_up, rc_up, u_up, v_up, frac_up, exch_h, &
638 & vegfra, snow, snowc, canwat, smstav, smstot, sfcrunoff, &
639 & udrunoff, acsnow, acsnom, ivgtyp, isltyp, isurban, smois, &
640 & smfr3d, mavail, snowh, sh2o, snoalb, fndsoilw, fndsnowh, &
641 & rdmaxalb, znt, xland, xice, sfcevp, grdflx, TRIM(mminlu_loc&
642 & ), isnowxy, zsnsoxy, tsnoxy, snicexy, snliqxy, tvxy, tgxy, &
643 & canicexy, canliqxy, eahxy, tahxy, cmxy, chxy, fwetxy, &
644 & sneqvoxy, alboldxy, qsnowxy, qrainxy, wslakexy, zwtxy, waxy, wtxy, &
645 & lfmassxy, rtmassxy, stmassxy, woodxy, stblcpxy, fastcpxy, &
646 & xsaixy, t2mvxy, t2mbxy, chstarxy, allowed_to_read, &
647 & start_of_simulation, te_temf, cf3d_temf, wm_temf, dzr, dzb&
648 & , dzg, tr_urb2d, tb_urb2d, tg_urb2d, tc_urb2d, qc_urb2d, &
649 & xxxr_urb2d, xxxb_urb2d, xxxg_urb2d, xxxc_urb2d, trl_urb3d, &
650 & tbl_urb3d, tgl_urb3d, sh_urb2d, lh_urb2d, g_urb2d, rn_urb2d&
651 & , ts_urb2d, frc_urb2d, utype_urb2d, sf_urban_physics, &
652 & num_urban_ndm, urban_map_zrd, urban_map_zwd, urban_map_gd,&
653 & urban_map_zd, urban_map_zdf, urban_map_bd, urban_map_wd, urban_map_gbd,&
654 & urban_map_fbd, trb_urb4d, tw1_urb4d, tw2_urb4d, &
655 & tgb_urb4d, tlev_urb3d, qlev_urb3d, tw1lev_urb3d, &
656 & tw2lev_urb3d, tglev_urb3d, tflev_urb3d, sf_ac_urb3d, &
657 & lf_ac_urb3d, cm_ac_urb3d, sfvent_urb3d, lfvent_urb3d, &
658 & sfwin1_urb3d, sfwin2_urb3d, sfw1_urb3d, sfw2_urb3d, &
659 & sfr_urb3d, sfg_urb3d, a_u_bep, a_v_bep, a_t_bep, a_q_bep, &
660 & a_e_bep, b_u_bep, b_v_bep, b_t_bep, b_q_bep, b_e_bep, &
661 & dlg_bep, dl_u_bep, sf_bep, vl_bep, ids, ide, jds, jde, kds&
662 & , kde, ims, ime, jms, jme, kms, kme, its, ite, jts, jte, &
663 & kts, kte, achfx, aclhf, acgrdflx, oml_hml0, sf_ocean_physics, tml, &
664 & t0ml, hml, h0ml, huml, hvml, tmoml)
666 CALL WRF_DEBUG(200, 'module_start: phy_init: Before call to cu_init'&
668 CALL CU_INIT_D(dx, stepcu, cudt, dt, rucuten, rvcuten, rthcuten, &
669 & rthcutend, rqvcuten, rqvcutend, rqrcuten, rqccuten, &
670 & rqccutend, rqscuten, rqicuten, nca, rainc, raincd, raincv, &
671 & raincvd, w0avg, w0avgd, config_flags, restart, cldefi, &
672 & lowlyr, mass_flux, rthften, rqvften, apr_gr, apr_w, apr_mc&
673 & , apr_st, apr_as, apr_capma, apr_capme, apr_capmi, &
674 & cugd_tten, cugd_ttens, cugd_qvten, cugd_qvtens, cugd_qcten&
675 & , allowed_to_read, start_of_simulation, ids, ide, jds, jde&
676 & , kds, kde, ims, ime, jms, jme, kms, kme, its, ite, jts, &
678 CALL WRF_DEBUG(200, 'module_start: phy_init: Before call to mp_init'&
680 CALL MP_INIT_D(rainnc, rainncd, snownc, snowncd, graupelnc, &
681 & graupelncd, config_flags, restart, warm_rain, &
682 & adv_moist_cond, mpdt, dt, dx, dy, lowlyr, f_ice_phy, &
683 & f_rain_phy, f_rimef_phy, mp_restart_state, tbpvs_state, &
684 & tbpvs0_state, allowed_to_read, start_of_simulation, ids, &
685 & ide, jds, jde, kds, kde, ims, ime, jms, jme, kms, kme, its&
686 & , ite, jts, jte, kts, kte)
687 END SUBROUTINE G_PHY_INIT
688 !=================================================================
689 ! Differentiation of bl_init in forward (tangent) mode:
690 ! variations of useful results: rublten rqvblten rvblten
692 ! with respect to varying inputs: rublten rqvblten rvblten
694 !=====================================================================
696 ! num_roof_layers,num_wall_layers,num_road_layers,& !Optional urban
703 !Optional multi-layer urban
704 !Optional multi-layer urban
705 !Optional multi-layer urban
706 !Optional multi-layer urban
707 !Optional multi-layer urban
708 !Optional multi-layer urban
709 !Optional multi-layer urban
710 !Optional multi-layer urban
711 !Optional multi-layer urban
712 !Optional multi-layer urban
713 !Optional multi-layer urban
714 !Optional multi-layer urban
715 !Optional multi-layer urban
716 !Optional multi-layer urban
718 SUBROUTINE BL_INIT_D(stepbl, bldt, dt, rublten, rubltend, rvblten, &
719 & rvbltend, rthblten, rthbltend, rqvblten, rqvbltend, rqcblten, &
720 & rqiblten, tsk, tmn, config_flags, restart, ust, lowlyr, tslb, &
721 & zs, dzs, num_soil_layers, tke_pbl, mfshconv, massflux_edkf, &
722 & entr_edkf, detr_edkf, thl_up, thv_up, rt_up, rv_up, rc_up, u_up, &
723 & v_up, frac_up, exch_h, vegfra, snow, snowc, canwat, smstav, smstot, &
724 & sfcrunoff, udrunoff, acsnow, acsnom, ivgtyp, isltyp, isurban, smois&
725 & , smfr3d, mavail, snowh, sh2o, snoalb, fndsoilw, fndsnowh, rdmaxalb&
726 & , znt, xland, xice, sfcevp, grdflx, mminlu, isnowxy, zsnsoxy, tsnoxy&
727 & , snicexy, snliqxy, tvxy, tgxy, canicexy, canliqxy, eahxy, tahxy, &
728 & cmxy, chxy, fwetxy, sneqvoxy, alboldxy, qsnowxy, qrainxy, wslakexy, zwtxy,&
729 & waxy, wtxy, lfmassxy, rtmassxy, stmassxy, woodxy, stblcpxy, fastcpxy&
730 & , xsaixy, t2mvxy, t2mbxy, chstarxy, allowed_to_read, &
731 & start_of_simulation, te_temf, cf3d_temf, wm_temf, dzr, dzb, dzg, &
732 & tr_urb2d, tb_urb2d, tg_urb2d, tc_urb2d, qc_urb2d, xxxr_urb2d, &
733 & xxxb_urb2d, xxxg_urb2d, xxxc_urb2d, trl_urb3d, tbl_urb3d, tgl_urb3d&
734 & , sh_urb2d, lh_urb2d, g_urb2d, rn_urb2d, ts_urb2d, frc_urb2d, &
735 & utype_urb2d, sf_urban_physics, num_urban_ndm, urban_map_zrd,&
736 & urban_map_zwd, urban_map_gd, urban_map_zd, urban_map_zdf, urban_map_bd,&
737 & urban_map_wd, urban_map_gbd, urban_map_fbd, trb_urb4d, &
738 & tw1_urb4d, tw2_urb4d, tgb_urb4d, tlev_urb3d, qlev_urb3d, &
739 & tw1lev_urb3d, tw2lev_urb3d, tglev_urb3d, tflev_urb3d, sf_ac_urb3d, &
740 & lf_ac_urb3d, cm_ac_urb3d, sfvent_urb3d, lfvent_urb3d, sfwin1_urb3d, &
741 & sfwin2_urb3d, sfw1_urb3d, sfw2_urb3d, sfr_urb3d, sfg_urb3d, a_u_bep&
742 & , a_v_bep, a_t_bep, a_q_bep, a_e_bep, b_u_bep, b_v_bep, b_t_bep, &
743 & b_q_bep, b_e_bep, dlg_bep, dl_u_bep, sf_bep, vl_bep, ids, ide, jds, &
744 & jde, kds, kde, ims, ime, jms, jme, kms, kme, its, ite, jts, jte, kts&
745 & , kte, achfx, aclhf, acgrdflx, oml_hml0, sf_ocean_physics, tml, t0ml, hml, &
746 & h0ml, huml, hvml, tmoml)
749 USE g_module_bl_surface_drag, ONLY : surface_drag_init_d
753 !--------------------------------------------------------------------
754 !--------------------------------------------------------------------
755 TYPE(GRID_CONFIG_REC_TYPE) :: config_flags
756 LOGICAL, INTENT(IN) :: restart
757 LOGICAL, INTENT(IN) :: fndsoilw, fndsnowh
758 LOGICAL, INTENT(IN) :: rdmaxalb
759 INTEGER, INTENT(IN) :: ids, ide, jds, jde, kds, kde, ims, ime, jms, &
760 & jme, kms, kme, its, ite, jts, jte, kts, kte
761 INTEGER, INTENT(IN) :: num_soil_layers
762 INTEGER, INTENT(IN) :: sf_urban_physics
763 REAL, INTENT(IN) :: dt, bldt
764 INTEGER, INTENT(INOUT) :: stepbl
765 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), INTENT(OUT) :: &
767 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), INTENT(INOUT) ::&
769 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: snow, snowh, &
770 & snowc, snoalb, canwat, mavail, smstav, smstot, sfcrunoff, udrunoff, &
771 & acsnow, vegfra, acsnom, sfcevp, grdflx, ust, znt, xland, xice
772 INTEGER, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: ivgtyp, &
774 REAL, DIMENSION(num_soil_layers), INTENT(INOUT) :: zs, dzs
775 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: rublten, &
776 & rvblten, exch_h, rthblten, rqvblten, rqcblten, rqiblten, tke_pbl
777 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: rubltend&
778 & , rvbltend, rthbltend, rqvbltend
779 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(OUT), OPTIONAL ::&
780 & massflux_edkf, entr_edkf, detr_edkf, thl_up, thv_up, rt_up, rv_up, &
781 & rc_up, u_up, v_up, frac_up
783 INTEGER, INTENT(IN) :: mfshconv
784 REAL, DIMENSION(ims:ime, jms:jme), INTENT(IN) :: tsk
785 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: tmn
786 CHARACTER(len=*), INTENT(IN) :: mminlu
787 LOGICAL, INTENT(IN) :: allowed_to_read
788 INTEGER, INTENT(IN) :: isurban
792 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(OUT) ::&
794 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(OUT) :: wm_temf
796 INTEGER, DIMENSION(ims:ime, jms:jme), OPTIONAL :: isnowxy
797 REAL, DIMENSION(ims:ime, -2:num_soil_layers, jms:jme), OPTIONAL :: &
799 REAL, DIMENSION(ims:ime, -2:0, jms:jme), OPTIONAL :: tsnoxy
800 REAL, DIMENSION(ims:ime, -2:0, jms:jme), OPTIONAL :: snicexy
801 REAL, DIMENSION(ims:ime, -2:0, jms:jme), OPTIONAL :: snliqxy
802 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: tvxy
803 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: tgxy
804 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: canicexy
805 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: canliqxy
806 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: eahxy
807 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: tahxy
808 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: cmxy
809 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: chxy
810 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: fwetxy
811 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: sneqvoxy
812 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: alboldxy
813 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: qsnowxy
814 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: qrainxy
815 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: wslakexy
816 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: zwtxy
817 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: waxy
818 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: wtxy
819 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: lfmassxy
820 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: rtmassxy
821 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: stmassxy
822 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: woodxy
823 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: stblcpxy
824 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: fastcpxy
825 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: xsaixy
826 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: t2mvxy
827 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: t2mbxy
828 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: chstarxy
830 ! REAL, DIMENSION(1:num_roof_layers), INTENT(INOUT) :: DZR !Optional urban
831 ! REAL, DIMENSION(1:num_wall_layers), INTENT(INOUT) :: DZB !Optional urban
832 ! REAL, DIMENSION(1:num_road_layers), INTENT(INOUT) :: DZG !Optional urban
834 REAL, DIMENSION(num_soil_layers), OPTIONAL, INTENT(INOUT) :: dzr
836 REAL, DIMENSION(num_soil_layers), OPTIONAL, INTENT(INOUT) :: dzb
838 REAL, DIMENSION(num_soil_layers), OPTIONAL, INTENT(INOUT) :: dzg
840 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
843 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
846 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
849 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
852 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
855 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
858 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
861 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
864 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
867 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
870 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
873 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
876 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
879 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
882 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
885 INTEGER, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
887 ! REAL, DIMENSION( ims:ime, 1:num_roof_layers, jms:jme ), INTENT(INOUT) :: TRL_URB3D !Optional urban
888 ! REAL, DIMENSION( ims:ime, 1:num_wall_layers, jms:jme ), INTENT(INOUT) :: TBL_URB3D !Optional urban
889 ! REAL, DIMENSION( ims:ime, 1:num_road_layers, jms:jme ), INTENT(INOUT) :: TGL_URB3D !Optional urban
891 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), OPTIONAL, &
892 & INTENT(INOUT) :: trl_urb3d
894 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), OPTIONAL, &
895 & INTENT(INOUT) :: tbl_urb3d
897 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), OPTIONAL, &
898 & INTENT(INOUT) :: tgl_urb3d
899 INTEGER, INTENT(IN) :: num_urban_ndm
900 INTEGER, INTENT(IN) :: urban_map_zrd
901 INTEGER, INTENT(IN) :: urban_map_zwd
902 INTEGER, INTENT(IN) :: urban_map_gd
903 INTEGER, INTENT(IN) :: urban_map_zd
904 INTEGER, INTENT(IN) :: urban_map_zdf
905 INTEGER, INTENT(IN) :: urban_map_bd
906 INTEGER, INTENT(IN) :: urban_map_wd
907 INTEGER, INTENT(IN) :: urban_map_gbd
908 INTEGER, INTENT(IN) :: urban_map_fbd
910 REAL, DIMENSION(ims:ime, urban_map_zrd, jms:jme), OPTIONAL, &
911 & INTENT(INOUT) :: trb_urb4d
913 REAL, DIMENSION(ims:ime, urban_map_zwd, jms:jme), OPTIONAL, &
914 & INTENT(INOUT) :: tw1_urb4d
916 REAL, DIMENSION(ims:ime, urban_map_zwd, jms:jme), OPTIONAL, &
917 & INTENT(INOUT) :: tw2_urb4d
919 REAL, DIMENSION(ims:ime, urban_map_gd, jms:jme), OPTIONAL, &
920 & INTENT(INOUT) :: tgb_urb4d
922 REAL, DIMENSION(ims:ime, urban_map_bd, jms:jme), OPTIONAL, &
923 & INTENT(INOUT) :: tlev_urb3d
925 REAL, DIMENSION(ims:ime, urban_map_bd, jms:jme), OPTIONAL, &
926 & INTENT(INOUT) :: qlev_urb3d
928 REAL, DIMENSION(ims:ime, urban_map_wd, jms:jme), OPTIONAL, &
929 & INTENT(INOUT) :: tw1lev_urb3d
931 REAL, DIMENSION(ims:ime, urban_map_wd, jms:jme), OPTIONAL, &
932 & INTENT(INOUT) :: tw2lev_urb3d
934 REAL, DIMENSION(ims:ime, urban_map_gbd, jms:jme), OPTIONAL, &
935 & INTENT(INOUT) :: tglev_urb3d
937 REAL, DIMENSION(ims:ime, urban_map_fbd, jms:jme), OPTIONAL, &
938 & INTENT(INOUT) :: tflev_urb3d
940 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
943 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
946 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
949 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
952 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
955 REAL, DIMENSION(ims:ime, urban_map_wd, jms:jme), OPTIONAL, &
956 & INTENT(INOUT) :: sfwin1_urb3d
958 REAL, DIMENSION(ims:ime, urban_map_wd, jms:jme), OPTIONAL, &
959 & INTENT(INOUT) :: sfwin2_urb3d
961 REAL, DIMENSION(ims:ime, urban_map_zd, jms:jme), OPTIONAL, &
962 & INTENT(INOUT) :: sfw1_urb3d
964 REAL, DIMENSION(ims:ime, urban_map_zd, jms:jme), OPTIONAL, &
965 & INTENT(INOUT) :: sfw2_urb3d
967 REAL, DIMENSION(ims:ime, urban_map_zdf, jms:jme), OPTIONAL, &
968 & INTENT(INOUT) :: sfr_urb3d
970 REAL, DIMENSION(ims:ime, num_urban_ndm, jms:jme), OPTIONAL, &
971 & INTENT(INOUT) :: sfg_urb3d
972 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
974 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
976 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
978 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
980 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
982 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
984 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
986 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
988 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
990 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
992 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
994 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
996 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
998 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
1000 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: achfx&
1002 ! Optional OML variables
1003 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: tml, &
1004 & t0ml, hml, h0ml, huml, hvml, tmoml
1005 INTEGER, OPTIONAL, INTENT(IN) :: sf_ocean_physics
1006 REAL, OPTIONAL, INTENT(IN) :: oml_hml0
1007 LOGICAL, INTENT(IN) :: start_of_simulation
1010 INTEGER :: mynn_closure_level
1014 !-- calculate pbl time step
1015 stepbl = NINT(bldt*60./dt)
1016 IF (stepbl .LT. 1) THEN
1022 IF (PRESENT(achfx)) THEN
1023 IF (.NOT.restart) THEN
1034 !-- initialize surface layer scheme
1035 SELECT CASE (config_flags%sf_sfclay_physics)
1037 CALL SFCLAYINIT(allowed_to_read)
1041 !-- initialize pbl scheme
1042 SELECT CASE (config_flags%bl_pbl_physics)
1043 CASE (surfdragscheme)
1044 CALL SURFACE_DRAG_INIT_D(rublten, rubltend, rvblten, rvbltend, &
1045 & rthblten, rthbltend, rqvblten, rqvbltend, &
1046 & restart, ids, ide, jds, jde, kds, kde, ims, &
1047 & ime, jms, jme, kms, kme, its, ite, jts, jte, &
1051 END SUBROUTINE BL_INIT_D
1052 !=====================================================================
1053 ! Differentiation of cu_init in forward (tangent) mode:
1054 ! variations of useful results: raincv rqccuten rthcuten rainc
1056 ! with respect to varying inputs: raincv rqccuten rthcuten rainc
1058 !==================================================================
1059 SUBROUTINE CU_INIT_D(dx, stepcu, cudt, dt, rucuten, rvcuten, rthcuten, &
1060 & rthcutend, rqvcuten, rqvcutend, rqrcuten, rqccuten, rqccutend, &
1061 & rqscuten, rqicuten, nca, rainc, raincd, raincv, raincvd, w0avg, &
1062 & w0avgd, config_flags, restart, cldefi, lowlyr, mass_flux, rthften, &
1063 & rqvften, apr_gr, apr_w, apr_mc, apr_st, apr_as, apr_capma, apr_capme&
1064 & , apr_capmi, cugd_tten, cugd_ttens, cugd_qvten, cugd_qvtens, &
1065 & cugd_qcten, allowed_to_read, start_of_simulation, ids, ide, jds, jde&
1066 & , kds, kde, ims, ime, jms, jme, kms, kme, its, ite, jts, jte, kts, &
1069 USE g_module_cu_du, ONLY : ducuinit_d
1072 !------------------------------------------------------------------
1073 !------------------------------------------------------------------
1074 TYPE(GRID_CONFIG_REC_TYPE) :: config_flags
1075 LOGICAL, INTENT(IN) :: restart
1076 INTEGER, INTENT(IN) :: ids, ide, jds, jde, kds, kde, ims, ime, jms, &
1077 & jme, kms, kme, its, ite, jts, jte, kts, kte
1078 REAL, INTENT(IN) :: dt, cudt, dx
1079 LOGICAL, INTENT(IN) :: start_of_simulation
1080 LOGICAL, INTENT(IN) :: allowed_to_read
1081 INTEGER, INTENT(INOUT) :: stepcu
1082 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: rucuten&
1083 & , rvcuten, rthcuten, rqvcuten, rqccuten, rqrcuten, rqicuten, &
1085 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: &
1086 & rthcutend, rqvcutend, rqccutend
1087 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
1088 & :: cugd_tten, cugd_ttens, cugd_qvten, cugd_qvtens, cugd_qcten
1089 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(OUT) :: w0avg
1090 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(OUT) :: w0avgd
1091 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: rthften, &
1093 REAL, DIMENSION(ims:ime, jms:jme), INTENT(OUT) :: rainc, raincv
1094 REAL, DIMENSION(ims:ime, jms:jme), INTENT(OUT) :: raincd, raincvd
1095 REAL, DIMENSION(ims:ime, jms:jme), INTENT(OUT) :: cldefi
1096 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: nca
1097 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: mass_flux, &
1098 & apr_gr, apr_w, apr_mc, apr_st, apr_as, apr_capma, apr_capme, &
1100 INTEGER, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: lowlyr
1102 INTEGER :: i, j, itf, jtf
1106 IF (ite .GT. ide - 1) THEN
1111 IF (jte .GT. jde - 1) THEN
1117 stepcu = NINT(cudt*60./dt)
1118 IF (stepcu .LT. 1) THEN
1124 IF (start_of_simulation) THEN
1134 !-- deep convection and hybrid deep-shallow convection schemes
1135 SELECT CASE (config_flags%cu_physics)
1137 CALL DUCUINIT_D(rthcuten, rthcutend, rqvcuten, rqvcutend, rqccuten&
1138 & , rqccutend, rqrcuten, rqicuten, rqscuten, nca, w0avg, &
1139 & w0avgd, p_qc, p_qr, svp1, svp2, svp3, svpt0, &
1140 & param_first_scalar, restart, allowed_to_read, ids, ide, &
1141 & jds, jde, kds, kde, ims, ime, jms, jme, kms, kme, its, &
1142 & ite, jts, jte, kts, kte)
1144 END SUBROUTINE CU_INIT_D
1145 !==================================================================
1146 ! Differentiation of mp_init in forward (tangent) mode:
1147 ! variations of useful results: rainnc snownc graupelnc
1148 ! with respect to varying inputs: rainnc snownc graupelnc
1149 !==================================================================
1153 SUBROUTINE MP_INIT_D(rainnc, rainncd, snownc, snowncd, graupelnc, &
1154 & graupelncd, config_flags, restart, warm_rain, adv_moist_cond, mpdt, &
1155 & dt, dx, dy, lowlyr, f_ice_phy, f_rain_phy, f_rimef_phy, &
1156 & mp_restart_state, tbpvs_state, tbpvs0_state, allowed_to_read, &
1157 & start_of_simulation, ids, ide, jds, jde, kds, kde, ims, ime, jms, &
1158 & jme, kms, kme, its, ite, jts, jte, kts, kte)
1160 !------------------------------------------------------------------
1162 TYPE(GRID_CONFIG_REC_TYPE) :: config_flags
1163 LOGICAL, INTENT(IN) :: restart
1164 LOGICAL, INTENT(OUT) :: warm_rain, adv_moist_cond
1165 REAL, INTENT(IN) :: mpdt, dt, dx, dy
1166 LOGICAL, INTENT(IN) :: start_of_simulation
1167 INTEGER, INTENT(IN) :: ids, ide, jds, jde, kds, kde, ims, ime, jms, &
1168 & jme, kms, kme, its, ite, jts, jte, kts, kte
1169 INTEGER, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: lowlyr
1170 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: rainnc, snownc, &
1172 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: rainncd, snowncd&
1174 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: &
1175 & f_ice_phy, f_rain_phy, f_rimef_phy
1176 REAL, DIMENSION(:), INTENT(INOUT) :: mp_restart_state, tbpvs_state, &
1178 LOGICAL, INTENT(IN) :: allowed_to_read
1180 INTEGER :: i, j, itf, jtf
1183 adv_moist_cond = .true.
1184 IF (ite .GT. ide - 1) THEN
1189 IF (jte .GT. jde - 1) THEN
1194 IF (start_of_simulation) THEN
1201 graupelncd(i, j) = 0.0
1202 graupelnc(i, j) = 0.
1206 SELECT CASE (config_flags%mp_physics)
1209 END SUBROUTINE MP_INIT_D
1210 !==================================================================
1211 SUBROUTINE Z2SIGMA(zf, zh, sf, sh, p_top, pptop, config_flags, &
1212 & allowed_to_read, kds, kde, kms, kme, kts, kte)
1215 INTEGER, INTENT(IN) :: kds, kde, kms, kme, kts, kte
1216 REAL, DIMENSION(kms:kme), INTENT(IN) :: zf, zh
1217 REAL, DIMENSION(kms:kme), INTENT(OUT) :: sf, sh
1218 REAL, INTENT(IN) :: p_top
1219 REAL, INTENT(OUT) :: pptop
1220 TYPE(GRID_CONFIG_REC_TYPE) :: config_flags
1221 LOGICAL, INTENT(IN) :: allowed_to_read
1223 REAL :: r, g, ts, gamma, ps, ztrop, tstrat, ptrop, z, t, p, ztop, &
1231 IF (zf(kde/2) .GT. 1.0) THEN
1232 ! Height levels assumed (zeta coordinate)
1233 ! Convert to sigma using standard atmosphere for pressure-height relation
1234 ! constants for standard atmosphere definition
1238 gamma = -(6.5/1000.)
1241 tstrat = ts + gamma*ztrop
1243 pwy1 = -(g/(gamma*r))
1249 IF (z .LE. ztrop) THEN
1252 pwy1 = -(g/(gamma*r))
1257 arg1 = -(g*(z-ztrop)/(r*tstrat))
1260 IF (k .EQ. kde) THEN
1264 sf(k) = (p-ptop)/(ps-ptop)
1266 IF (k .NE. kds) THEN
1267 z = 0.5*(zf(k)+zf(k-1))
1268 IF (z .LE. ztrop) THEN
1271 pwy1 = -(g/(gamma*r))
1276 arg1 = -(g*(z-ztrop)/(r*tstrat))
1279 sh(k-1) = (p-ptop)/(ps-ptop)
1284 ! Levels are already sigma/eta
1286 ! sf(k)=zf(kde-k+kds)
1287 ! if(k .ne. kde)sh(k)=zh(kde-1-k+kds)
1289 IF (k .NE. kde) sh(k) = zh(k)
1293 END SUBROUTINE Z2SIGMA
1294 END MODULE G_MODULE_PHYSICS_INIT