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 A_MODULE_PHYSICS_INIT
12 USE module_state_description
13 USE module_model_constants
14 USE module_configure, ONLY : grid_config_rec_type
17 ! Differentiation of phy_init in reverse (adjoint) mode:
18 ! gradient of useful results: rublten raincv rqccuten rthcuten
19 ! rainnc rainc rqvblten w0avg snownc rvblten graupelnc
20 ! rthblten graupelncv snowncv rqvcuten rainncv
21 ! with respect to varying inputs: rublten raincv rqccuten rthcuten
22 ! rainnc rainc rqvblten w0avg snownc rvblten graupelnc
23 ! rthblten graupelncv snowncv rqvcuten rainncv
24 ! RW status of diff variables: rublten:in-out raincv:in-out rqccuten:in-out
25 ! rthcuten:in-out rainnc:in-out rainc:in-out rqvblten:in-out
26 ! w0avg:in-out snownc:in-out rvblten:in-out graupelnc:in-out
27 ! rthblten:in-out graupelncv:in-out snowncv:in-out
28 ! rqvcuten:in-out rainncv:in-out
29 !=================================================================
32 ! num_roof_layers,num_wall_layers, &
37 SUBROUTINE A_PHY_INIT(id, config_flags, dt, restart, zfull, zhalf, &
38 & p_top, tsk, radt, bldt, cudt, mpdt, rucuten, rvcuten, rthcuten, &
39 & rthcutenb, rqvcuten, rqvcutenb, rqrcuten, rqccuten, rqccutenb, &
40 & rqscuten, rqicuten, rushten, rvshten, rthshten, rqvshten, rqrshten, &
41 & rqcshten, rqsshten, rqishten, rqgshten, rublten, rubltenb, rvblten, &
42 & rvbltenb, rthblten, rthbltenb, rqvblten, rqvbltenb, rqcblten, &
43 & rqiblten, rthraten, rthratenlw, rthratensw, stepbl, stepra, stepcu, &
44 & w0avg, w0avgb, rainnc, rainncb, rainc, raincb, raincv, raincvb, &
45 & rainncv, rainncvb, snownc, snowncb, snowncv, snowncvb, graupelnc, &
46 & graupelncb, graupelncv, graupelncvb, nca, swrad_scat, cldefi, lowlyr&
47 & , mass_flux, rthften, rqvften, cldfra, cldfra_old, glw, gsw, emiss, &
48 & embck, lu_index, landuse_isice, landuse_lucats, landuse_luseas, &
49 & landuse_isn, lu_state, xlat, xlong, albedo, albbck, gmt, julyr, &
50 & julday, levsiz, n_ozmixm, n_aerosolc, paerlev, alevsiz, no_src_types, tmn, xland, znt, z0, &
51 & ust, mol, pblh, tke_pbl, exch_h, thc, snowc, mavail, hfx, qfx, &
52 & rainbl, tslb, zs, dzs, num_soil_layers, warm_rain, adv_moist_cond, &
53 & apr_gr, apr_w, apr_mc, apr_st, apr_as, apr_capma, apr_capme, &
54 & apr_capmi, xice, xicem, vegfra, snow, canwat, smstav, smstot, &
55 & sfcrunoff, udrunoff, grdflx, acsnow, acsnom, ivgtyp, isltyp, sfcevp&
56 & , smois, sh2o, snowh, smfr3d, snoalb, dx, dy, f_ice_phy, f_rain_phy&
57 & , f_rimef_phy, mp_restart_state, tbpvs_state, tbpvs0_state, &
58 & allowed_to_read, moved, start_of_simulation, lagday, ids, ide, jds, &
59 & jde, kds, kde, ims, ime, jms, jme, kms, kme, its, ite, jts, jte, kts&
60 & , kte, num_urban_ndm,urban_map_zrd,urban_map_zwd,urban_map_gd,urban_map_zd,&
61 & urban_map_zdf,urban_map_bd,urban_map_wd,urban_map_gbd,urban_map_fbd, &
62 & NUM_URBAN_HI, raincv_a, raincv_b, gd_cloud, gd_cloud2, &
63 & gd_cloud_a, gd_cloud2_a, gd_cloud_b, gd_cloud2_b, ozmixm, pin, &
64 & m_ps_1, m_ps_2, m_hybi, aerosolc_1, aerosolc_2, rundgdten, rvndgdten&
65 & , rthndgdten, rphndgdten, rqvndgdten, rmundgdten, fgdt, stepfg, &
66 & cugd_tten, cugd_ttens, cugd_qvten, cugd_qvtens, cugd_qcten, isnowxy&
67 & , zsnsoxy, tsnoxy, snicexy, snliqxy, tvxy, tgxy, canicexy, canliqxy&
68 & , eahxy, tahxy, cmxy, chxy, fwetxy, sneqvoxy, alboldxy, qsnowxy, qrainxy,&
69 & wslakexy, zwtxy, waxy, wtxy, lfmassxy, rtmassxy, stmassxy, woodxy, &
70 & stblcpxy, fastcpxy, xsaixy, t2mvxy, t2mbxy, chstarxy, dzr, dzb, dzg&
71 & , tr_urb2d, tb_urb2d, tg_urb2d, tc_urb2d, qc_urb2d, xxxr_urb2d, &
72 & xxxb_urb2d, xxxg_urb2d, xxxc_urb2d, trl_urb3d, tbl_urb3d, tgl_urb3d&
73 & , sh_urb2d, lh_urb2d, g_urb2d, rn_urb2d, ts_urb2d, frc_urb2d, &
74 & utype_urb2d, trb_urb4d, tw1_urb4d, tw2_urb4d, tgb_urb4d, tlev_urb3d&
75 & , qlev_urb3d, tw1lev_urb3d, tw2lev_urb3d, tglev_urb3d, tflev_urb3d, &
76 & sf_ac_urb3d, lf_ac_urb3d, cm_ac_urb3d, sfvent_urb3d, lfvent_urb3d, &
77 & sfwin1_urb3d, sfwin2_urb3d, sfw1_urb3d, sfw2_urb3d, sfr_urb3d, &
78 & sfg_urb3d, a_u_bep, a_v_bep, a_t_bep, a_q_bep, a_e_bep, b_u_bep, &
79 & b_v_bep, b_t_bep, b_q_bep, b_e_bep, dlg_bep, dl_u_bep, sf_bep, &
80 & vl_bep, tml, t0ml, hml, h0ml, huml, hvml, tmoml, itimestep, fdob, &
81 & t00, p00, tlp, tyr, tyra, tdly, tlag, nyear, nday, tmn_update, achfx&
82 & , aclhf, acgrdflx, te_temf, cf3d_temf, wm_temf, massflux_edkf, &
83 & entr_edkf, detr_edkf, thl_up, thv_up, rt_up, rv_up, rc_up, u_up, &
90 !-----------------------------------------------------------------
91 !-----------------------------------------------------------------
92 TYPE(GRID_CONFIG_REC_TYPE) :: config_flags
93 INTEGER, INTENT(IN) :: id
94 INTEGER, INTENT(IN), OPTIONAL :: tmn_update
95 LOGICAL, INTENT(OUT) :: warm_rain, adv_moist_cond
96 ! LOGICAL , INTENT (IN) :: FNDSOILW, FNDSNOWH
97 LOGICAL, PARAMETER :: fndsoilw=.true., fndsnowh=.true.
98 INTEGER, INTENT(IN) :: ids, ide, jds, jde, kds, kde, ims, ime, jms, &
99 & jme, kms, kme, its, ite, jts, jte, kts, kte
100 INTEGER, INTENT(IN) :: num_soil_layers
101 INTEGER, INTENT(IN) :: lagday
102 INTEGER, INTENT(OUT), OPTIONAL :: nyear
103 REAL, INTENT(OUT), OPTIONAL :: nday
104 LOGICAL, INTENT(IN) :: start_of_simulation
105 REAL, INTENT(IN) :: dt, p_top, dx, dy
106 LOGICAL, INTENT(IN) :: restart
107 REAL, INTENT(IN) :: radt, bldt, cudt, mpdt
108 REAL, INTENT(IN) :: swrad_scat
109 REAL, DIMENSION(kms:kme), INTENT(IN) :: zfull, zhalf
110 REAL, DIMENSION(ims:ime, jms:jme), INTENT(IN) :: tsk, xlat, xlong
111 INTEGER, INTENT(IN) :: levsiz, n_ozmixm
112 INTEGER, INTENT(IN) :: paerlev, n_aerosolc
113 INTEGER, INTENT(IN ) :: alevsiz, no_src_types
114 REAL, DIMENSION(ims:ime, levsiz, jms:jme, n_ozmixm), OPTIONAL, &
115 & INTENT(INOUT) :: ozmixm
116 REAL, DIMENSION(levsiz), OPTIONAL, INTENT(INOUT) :: pin
117 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: m_ps_1&
119 REAL, DIMENSION(paerlev), OPTIONAL, INTENT(INOUT) :: m_hybi
120 REAL, DIMENSION(ims:ime, paerlev, jms:jme, n_aerosolc), OPTIONAL, &
121 & INTENT(INOUT) :: aerosolc_1, aerosolc_2
122 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), INTENT(INOUT) ::&
124 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), INTENT(OUT) :: &
126 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: snow, snowc, &
127 & snowh, canwat, smstav, smstot, sfcrunoff, udrunoff, sfcevp, grdflx, &
128 & acsnow, xice, xicem, vegfra, acsnom
129 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: achfx&
131 INTEGER, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: ivgtyp, &
134 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: rthraten&
135 & , rthratenlw, rthratensw, cldfra
136 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) ::&
139 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: gsw, albedo, &
140 & albbck, glw, emiss, embck
141 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: snoalb
142 REAL, INTENT(IN) :: gmt
143 INTEGER, INTENT(OUT) :: stepra, stepbl, stepcu
144 INTEGER, INTENT(IN) :: julyr, julday
146 REAL, DIMENSION(ims:ime, kms:kme, jms:jme) :: rucuten, rvcuten, &
147 & rthcuten, rqvcuten, rqrcuten, rqccuten, rqscuten, rqicuten, rushten&
148 & , rvshten, rthshten, rqvshten, rqrshten, rqcshten, rqsshten, &
150 REAL, DIMENSION(ims:ime, kms:kme, jms:jme) :: rthcutenb, rqvcutenb, &
152 REAL, DIMENSION(ims:ime, kms:kme, jms:jme) :: w0avg
153 REAL, DIMENSION(ims:ime, kms:kme, jms:jme) :: w0avgb
154 REAL, DIMENSION(ims:ime, jms:jme), INTENT(OUT) :: mass_flux, apr_gr&
155 & , apr_w, apr_mc, apr_st, apr_as, apr_capma, apr_capme, apr_capmi
156 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(OUT) :: rthften, &
158 REAL, DIMENSION(ims:ime, jms:jme) :: rainnc, rainc, raincv, rainncv&
159 & , snownc, snowncv, graupelnc, graupelncv
160 REAL, DIMENSION(ims:ime, jms:jme) :: rainncb, raincb, raincvb, &
161 & rainncvb, snowncb, snowncvb, graupelncb, graupelncvb
162 REAL, DIMENSION(ims:ime, jms:jme), INTENT(OUT) :: cldefi, nca
163 INTEGER, DIMENSION(ims:ime, jms:jme), INTENT(OUT) :: lowlyr
166 REAL, DIMENSION(num_soil_layers), INTENT(INOUT) :: zs, dzs
167 REAL, DIMENSION(ims:ime, kms:kme, jms:jme) :: rublten, rvblten, &
168 & rthblten, rqvblten, rqcblten, rqiblten, exch_h, tke_pbl
169 REAL, DIMENSION(ims:ime, kms:kme, jms:jme) :: rubltenb, rvbltenb, &
170 & rthbltenb, rqvbltenb
171 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(OUT), OPTIONAL ::&
172 & massflux_edkf, entr_edkf, detr_edkf, thl_up, thv_up, rt_up, rv_up, &
173 & rc_up, u_up, v_up, frac_up
174 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(OUT) ::&
175 & cugd_tten, cugd_ttens, cugd_qvten, cugd_qvtens, cugd_qcten
176 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: xland, znt, z0, &
177 & ust, mol, lu_index, pblh, thc, mavail, hfx, qfx, rainbl
178 INTEGER, INTENT(INOUT) :: landuse_isice, landuse_lucats
179 INTEGER, INTENT(INOUT) :: landuse_luseas, landuse_isn
180 REAL, DIMENSION(:), INTENT(INOUT) :: lu_state
181 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: tmn
182 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT), OPTIONAL :: tyr
183 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT), OPTIONAL :: tyra
184 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT), OPTIONAL :: tdly
185 REAL, DIMENSION(ims:ime, lagday, jms:jme), INTENT(INOUT), OPTIONAL &
187 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
188 & :: gd_cloud, gd_cloud2, gd_cloud_a, gd_cloud2_a, gd_cloud_b, &
190 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: raincv_a, &
193 INTEGER, DIMENSION(ims:ime, jms:jme), OPTIONAL :: isnowxy
194 REAL, DIMENSION(ims:ime, -2:num_soil_layers, jms:jme), OPTIONAL :: &
196 REAL, DIMENSION(ims:ime, -2:0, jms:jme), OPTIONAL :: tsnoxy
197 REAL, DIMENSION(ims:ime, -2:0, jms:jme), OPTIONAL :: snicexy
198 REAL, DIMENSION(ims:ime, -2:0, jms:jme), OPTIONAL :: snliqxy
199 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: tvxy
200 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: tgxy
201 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: canicexy
202 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: canliqxy
203 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: eahxy
204 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: tahxy
205 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: cmxy
206 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: chxy
207 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: fwetxy
208 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: sneqvoxy
209 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: alboldxy
210 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: qsnowxy
211 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: qrainxy
212 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: wslakexy
213 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: zwtxy
214 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: waxy
215 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: wtxy
216 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: lfmassxy
217 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: rtmassxy
218 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: stmassxy
219 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: woodxy
220 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: stblcpxy
221 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: fastcpxy
222 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: xsaixy
223 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: t2mvxy
224 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: t2mbxy
225 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: chstarxy
227 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(OUT) :: f_ice_phy&
228 & , f_rain_phy, f_rimef_phy
229 REAL, DIMENSION(:), INTENT(INOUT) :: mp_restart_state, tbpvs_state, &
231 LOGICAL, INTENT(IN) :: allowed_to_read, moved
233 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: tml, &
234 & t0ml, hml, h0ml, huml, hvml, tmoml
236 REAL, OPTIONAL, INTENT(IN) :: fgdt
237 INTEGER, OPTIONAL, INTENT(OUT) :: stepfg
238 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) ::&
239 & rundgdten, rvndgdten, rthndgdten, rphndgdten, rqvndgdten
240 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
243 ! REAL, DIMENSION(1:num_roof_layers), INTENT(INOUT) :: DZR !urban
244 ! REAL, DIMENSION(1:num_wall_layers), INTENT(INOUT) :: DZB !urban
245 ! REAL, DIMENSION(1:num_road_layers), INTENT(INOUT) :: DZG !urban
247 REAL, DIMENSION(num_soil_layers), OPTIONAL, INTENT(INOUT) :: dzr
249 REAL, DIMENSION(num_soil_layers), OPTIONAL, INTENT(INOUT) :: dzb
251 REAL, DIMENSION(num_soil_layers), OPTIONAL, INTENT(INOUT) :: dzg
253 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
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) :: &
279 ! REAL, DIMENSION(ims:ime, 1:num_roof_layers, jms:jme), INTENT(INOUT) :: TRL_URB3D !urban
280 ! REAL, DIMENSION(ims:ime, 1:num_wall_layers, jms:jme), INTENT(INOUT) :: TBL_URB3D !urban
281 ! REAL, DIMENSION(ims:ime, 1:num_road_layers, jms:jme), INTENT(INOUT) :: TGL_URB3D !urban
283 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), OPTIONAL, &
284 & INTENT(INOUT) :: trl_urb3d
286 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), OPTIONAL, &
287 & INTENT(INOUT) :: tbl_urb3d
289 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), OPTIONAL, &
290 & INTENT(INOUT) :: tgl_urb3d
292 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
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 INTEGER, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
312 INTEGER , INTENT(IN) :: num_urban_ndm
313 INTEGER , INTENT(IN) :: urban_map_zrd
314 INTEGER , INTENT(IN) :: urban_map_zwd
315 INTEGER , INTENT(IN) :: urban_map_gd
316 INTEGER , INTENT(IN) :: urban_map_zd
317 INTEGER , INTENT(IN) :: urban_map_zdf
318 INTEGER , INTENT(IN) :: urban_map_bd
319 INTEGER , INTENT(IN) :: urban_map_wd
320 INTEGER , INTENT(IN) :: urban_map_gbd
321 INTEGER , INTENT(IN) :: urban_map_fbd
322 INTEGER , INTENT(IN) :: num_urban_hi
324 REAL, DIMENSION(ims:ime, urban_map_zrd, jms:jme), OPTIONAL, &
325 & INTENT(INOUT) :: trb_urb4d
327 REAL, DIMENSION(ims:ime, urban_map_zwd, jms:jme), OPTIONAL, &
328 & INTENT(INOUT) :: tw1_urb4d
330 REAL, DIMENSION(ims:ime, urban_map_zwd, jms:jme), OPTIONAL, &
331 & INTENT(INOUT) :: tw2_urb4d
333 REAL, DIMENSION(ims:ime, urban_map_gd, jms:jme), OPTIONAL, &
334 & INTENT(INOUT) :: tgb_urb4d
336 REAL, DIMENSION(ims:ime, urban_map_bd, jms:jme), OPTIONAL, &
337 & INTENT(INOUT) :: tlev_urb3d
339 REAL, DIMENSION(ims:ime, urban_map_bd, jms:jme), OPTIONAL, &
340 & INTENT(INOUT) :: qlev_urb3d
342 REAL, DIMENSION(ims:ime, urban_map_wd, jms:jme), OPTIONAL, &
343 & INTENT(INOUT) :: tw1lev_urb3d
345 REAL, DIMENSION(ims:ime, urban_map_wd, jms:jme), OPTIONAL, &
346 & INTENT(INOUT) :: tw2lev_urb3d
348 REAL, DIMENSION(ims:ime, urban_map_gbd, jms:jme), OPTIONAL, &
349 & INTENT(INOUT) :: tglev_urb3d
351 REAL, DIMENSION(ims:ime, urban_map_fbd, jms:jme), OPTIONAL, &
352 & INTENT(INOUT) :: tflev_urb3d
354 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
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, urban_map_wd, jms:jme), OPTIONAL, &
370 & INTENT(INOUT) :: sfwin1_urb3d
372 REAL, DIMENSION(ims:ime, urban_map_wd, jms:jme), OPTIONAL, &
373 & INTENT(INOUT) :: sfwin2_urb3d
375 REAL, DIMENSION(ims:ime, num_urban_ndm, jms:jme), OPTIONAL, &
376 & INTENT(INOUT) :: sfg_urb3d
378 REAL, DIMENSION(ims:ime, urban_map_zdf, jms:jme), OPTIONAL, &
379 & INTENT(INOUT) :: sfr_urb3d
381 REAL, DIMENSION(ims:ime, urban_map_zd, jms:jme), OPTIONAL, &
382 & INTENT(INOUT) :: sfw1_urb3d
384 REAL, DIMENSION(ims:ime, urban_map_zd, jms:jme), OPTIONAL, &
385 & INTENT(INOUT) :: sfw2_urb3d
386 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
388 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
390 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
392 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
394 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
396 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
398 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
400 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
402 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
404 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
406 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
408 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
410 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
412 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
415 INTEGER, OPTIONAL, INTENT(IN) :: itimestep
416 TYPE(FDOB_TYPE), OPTIONAL, INTENT(INOUT) :: fdob
417 ! for obs-nudging base-state calcn
418 REAL, OPTIONAL, INTENT(IN) :: p00, t00, tlp
420 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(OUT) ::&
423 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(OUT) :: wm_temf
425 REAL :: alblnd, zzlnd, zzwtr, thinld, xmava, cen_lat, pptop
426 REAL, DIMENSION(kms:kme) :: sfull, shalf
427 REAL :: obs_twindo_cg, obs_twindo
428 CHARACTER(len=256) :: mminlu_loc
429 CHARACTER(len=512) :: message
433 INTEGER :: sf_urban_physics
434 INTEGER :: sf_ocean_physics
439 INTEGER :: i, j, k, itf, jtf, ktf, n
445 !-----------------------------------------------------------------
446 !-- should be from the namelist
447 IF (ite .GT. ide - 1) THEN
452 IF (jte .GT. jde - 1) THEN
457 !-- temporary fix by ww
458 IF (.NOT.restart) THEN
459 !-- initialize common variables
461 CALL PUSHCONTROL2B(0)
463 CALL PUSHCONTROL2B(1)
466 CALL PUSHCONTROL2B(2)
468 CALL MP_INIT_B(rainnc, rainncb, snownc, snowncb, graupelnc, &
469 & graupelncb, config_flags, restart, warm_rain, &
470 & adv_moist_cond, mpdt, dt, dx, dy, lowlyr, f_ice_phy, &
471 & f_rain_phy, f_rimef_phy, mp_restart_state, tbpvs_state, &
472 & tbpvs0_state, allowed_to_read, start_of_simulation, ids, &
473 & ide, jds, jde, kds, kde, ims, ime, jms, jme, kms, kme, its&
474 & , ite, jts, jte, kts, kte)
475 CALL CU_INIT_B(dx, stepcu, cudt, dt, rucuten, rvcuten, rthcuten, &
476 & rthcutenb, rqvcuten, rqvcutenb, rqrcuten, rqccuten, &
477 & rqccutenb, rqscuten, rqicuten, nca, rainc, raincb, raincv, &
478 & raincvb, w0avg, w0avgb, config_flags, restart, cldefi, &
479 & lowlyr, mass_flux, rthften, rqvften, apr_gr, apr_w, apr_mc&
480 & , apr_st, apr_as, apr_capma, apr_capme, apr_capmi, &
481 & cugd_tten, cugd_ttens, cugd_qvten, cugd_qvtens, cugd_qcten&
482 & , allowed_to_read, start_of_simulation, ids, ide, jds, jde&
483 & , kds, kde, ims, ime, jms, jme, kms, kme, its, ite, jts, &
485 CALL BL_INIT_B(stepbl, bldt, dt, rublten, rubltenb, rvblten, &
486 & rvbltenb, rthblten, rthbltenb, rqvblten, rqvbltenb, &
487 & rqcblten, rqiblten, tsk, tmn, config_flags, restart, ust, &
488 & lowlyr, tslb, zs, dzs, num_soil_layers, tke_pbl, mfshconv, &
489 & massflux_edkf, entr_edkf, detr_edkf, thl_up, thv_up, rt_up&
490 & , rv_up, rc_up, u_up, v_up, frac_up, exch_h, vegfra, snow, &
491 & snowc, canwat, smstav, smstot, sfcrunoff, udrunoff, acsnow&
492 & , acsnom, ivgtyp, isltyp, isurban, smois, smfr3d, mavail, &
493 & snowh, sh2o, snoalb, fndsoilw, fndsnowh, rdmaxalb, znt, &
494 & xland, xice, sfcevp, grdflx, TRIM(mminlu_loc), isnowxy, &
495 & zsnsoxy, tsnoxy, snicexy, snliqxy, tvxy, tgxy, canicexy, &
496 & canliqxy, eahxy, tahxy, cmxy, chxy, fwetxy, sneqvoxy, &
497 & alboldxy, qsnowxy, qrainxy, wslakexy, zwtxy, waxy, wtxy, lfmassxy,&
498 & rtmassxy, stmassxy, woodxy, stblcpxy, fastcpxy, xsaixy, &
499 & t2mvxy, t2mbxy, chstarxy, allowed_to_read, &
500 & start_of_simulation, te_temf, cf3d_temf, wm_temf, dzr, dzb&
501 & , dzg, tr_urb2d, tb_urb2d, tg_urb2d, tc_urb2d, qc_urb2d, &
502 & xxxr_urb2d, xxxb_urb2d, xxxg_urb2d, xxxc_urb2d, trl_urb3d, &
503 & tbl_urb3d, tgl_urb3d, sh_urb2d, lh_urb2d, g_urb2d, rn_urb2d&
504 & , ts_urb2d, frc_urb2d, utype_urb2d, sf_urban_physics, &
505 & num_urban_ndm, urban_map_zrd, urban_map_zwd, urban_map_gd, &
506 & urban_map_zd, urban_map_zdf, urban_map_bd, urban_map_wd, &
507 & urban_map_gbd, urban_map_fbd, trb_urb4d, tw1_urb4d, tw2_urb4d, &
508 & tgb_urb4d, tlev_urb3d, qlev_urb3d, tw1lev_urb3d, &
509 & tw2lev_urb3d, tglev_urb3d, tflev_urb3d, sf_ac_urb3d, &
510 & lf_ac_urb3d, cm_ac_urb3d, sfvent_urb3d, lfvent_urb3d, &
511 & sfwin1_urb3d, sfwin2_urb3d, sfw1_urb3d, sfw2_urb3d, &
512 & sfr_urb3d, sfg_urb3d, a_u_bep, a_v_bep, a_t_bep, a_q_bep, &
513 & a_e_bep, b_u_bep, b_v_bep, b_t_bep, b_q_bep, b_e_bep, &
514 & dlg_bep, dl_u_bep, sf_bep, vl_bep, ids, ide, jds, jde, kds&
515 & , kde, ims, ime, jms, jme, kms, kme, its, ite, jts, jte, &
516 & kts, kte, achfx, aclhf, acgrdflx, oml_hml0, sf_ocean_physics, tml, &
517 & t0ml, hml, h0ml, huml, hvml, tmoml)
518 CALL POPCONTROL2B(branch)
519 IF (branch .EQ. 0) THEN
522 graupelncvb(i, j) = 0.0
528 END SUBROUTINE A_PHY_INIT
529 !=================================================================
531 ! num_roof_layers,num_wall_layers,num_road_layers,& !Optional urban
538 !Optional multi-layer urban
539 !Optional multi-layer urban
540 !Optional multi-layer urban
541 !Optional multi-layer urban
542 !Optional multi-layer urban
543 !Optional multi-layer urban
544 !Optional multi-layer urban
545 !Optional multi-layer urban
546 !Optional multi-layer urban
547 !Optional multi-layer urban
548 !Optional multi-layer urban
549 !Optional multi-layer urban
550 !Optional multi-layer urban
551 !Optional multi-layer urban
553 SUBROUTINE BL_INIT_B(stepbl, bldt, dt, rublten, rubltenb, rvblten, &
554 & rvbltenb, rthblten, rthbltenb, rqvblten, rqvbltenb, rqcblten, &
555 & rqiblten, tsk, tmn, config_flags, restart, ust, lowlyr, tslb, zs, &
556 & dzs, num_soil_layers, tke_pbl, mfshconv, massflux_edkf, entr_edkf, &
557 & detr_edkf, thl_up, thv_up, rt_up, rv_up, rc_up, u_up, v_up, frac_up&
558 & , exch_h, vegfra, snow, snowc, canwat, smstav, smstot, sfcrunoff, &
559 & udrunoff, acsnow, acsnom, ivgtyp, isltyp, isurban, smois, smfr3d, &
560 & mavail, snowh, sh2o, snoalb, fndsoilw, fndsnowh, rdmaxalb, znt, &
561 & xland, xice, sfcevp, grdflx, mminlu, isnowxy, zsnsoxy, tsnoxy, &
562 & snicexy, snliqxy, tvxy, tgxy, canicexy, canliqxy, eahxy, tahxy, cmxy&
563 & , chxy, fwetxy, sneqvoxy, alboldxy, qsnowxy, qrainxy, wslakexy, zwtxy, waxy,&
564 & wtxy, lfmassxy, rtmassxy, stmassxy, woodxy, stblcpxy, fastcpxy, &
565 & xsaixy, t2mvxy, t2mbxy, chstarxy, allowed_to_read, &
566 & start_of_simulation, te_temf, cf3d_temf, wm_temf, dzr, dzb, dzg, &
567 & tr_urb2d, tb_urb2d, tg_urb2d, tc_urb2d, qc_urb2d, xxxr_urb2d, &
568 & xxxb_urb2d, xxxg_urb2d, xxxc_urb2d, trl_urb3d, tbl_urb3d, tgl_urb3d&
569 & , sh_urb2d, lh_urb2d, g_urb2d, rn_urb2d, ts_urb2d, frc_urb2d, &
570 & utype_urb2d, sf_urban_physics, num_urban_ndm, urban_map_zrd,&
571 & urban_map_zwd, urban_map_gd, urban_map_zd, urban_map_zdf,urban_map_bd,&
572 & urban_map_wd, urban_map_gbd, urban_map_fbd, trb_urb4d, &
573 & tw1_urb4d, tw2_urb4d, tgb_urb4d, tlev_urb3d, qlev_urb3d, &
574 & tw1lev_urb3d, tw2lev_urb3d, tglev_urb3d, tflev_urb3d, sf_ac_urb3d, &
575 & lf_ac_urb3d, cm_ac_urb3d, sfvent_urb3d, lfvent_urb3d, sfwin1_urb3d, &
576 & sfwin2_urb3d, sfw1_urb3d, sfw2_urb3d, sfr_urb3d, sfg_urb3d, a_u_bep&
577 & , a_v_bep, a_t_bep, a_q_bep, a_e_bep, b_u_bep, b_v_bep, b_t_bep, &
578 & b_q_bep, b_e_bep, dlg_bep, dl_u_bep, sf_bep, vl_bep, ids, ide, jds, &
579 & jde, kds, kde, ims, ime, jms, jme, kms, kme, its, ite, jts, jte, kts&
580 & , kte, achfx, aclhf, acgrdflx, oml_hml0, sf_ocean_physics, tml, t0ml, hml, &
581 & h0ml, huml, hvml, tmoml)
583 USE a_module_bl_surface_drag, ONLY : surface_drag_init_b
587 !--------------------------------------------------------------------
588 !--------------------------------------------------------------------
589 TYPE(GRID_CONFIG_REC_TYPE) :: config_flags
590 LOGICAL, INTENT(IN) :: restart
591 LOGICAL, INTENT(IN) :: fndsoilw, fndsnowh
592 LOGICAL, INTENT(IN) :: rdmaxalb
593 INTEGER, INTENT(IN) :: ids, ide, jds, jde, kds, kde, ims, ime, jms, &
594 & jme, kms, kme, its, ite, jts, jte, kts, kte
595 INTEGER, INTENT(IN) :: num_soil_layers
596 INTEGER, INTENT(IN) :: sf_urban_physics
597 REAL, INTENT(IN) :: dt, bldt
598 INTEGER, INTENT(INOUT) :: stepbl
599 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), INTENT(OUT) :: &
601 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), INTENT(INOUT) ::&
603 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: snow, snowh, &
604 & snowc, snoalb, canwat, mavail, smstav, smstot, sfcrunoff, udrunoff, &
605 & acsnow, vegfra, acsnom, sfcevp, grdflx, ust, znt, xland, xice
606 INTEGER, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: ivgtyp, &
608 REAL, DIMENSION(num_soil_layers), INTENT(INOUT) :: zs, dzs
609 REAL, DIMENSION(ims:ime, kms:kme, jms:jme) :: rublten, rvblten, &
610 & exch_h, rthblten, rqvblten, rqcblten, rqiblten, tke_pbl
611 REAL, DIMENSION(ims:ime, kms:kme, jms:jme) :: rubltenb, rvbltenb, &
612 & rthbltenb, rqvbltenb
613 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(OUT), OPTIONAL ::&
614 & massflux_edkf, entr_edkf, detr_edkf, thl_up, thv_up, rt_up, rv_up, &
615 & rc_up, u_up, v_up, frac_up
617 INTEGER, INTENT(IN) :: mfshconv
618 REAL, DIMENSION(ims:ime, jms:jme), INTENT(IN) :: tsk
619 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: tmn
620 CHARACTER(len=*), INTENT(IN) :: mminlu
621 LOGICAL, INTENT(IN) :: allowed_to_read
622 INTEGER, INTENT(IN) :: isurban
626 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(OUT) ::&
628 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(OUT) :: wm_temf
630 INTEGER, DIMENSION(ims:ime, jms:jme), OPTIONAL :: isnowxy
631 REAL, DIMENSION(ims:ime, -2:num_soil_layers, jms:jme), OPTIONAL :: &
633 REAL, DIMENSION(ims:ime, -2:0, jms:jme), OPTIONAL :: tsnoxy
634 REAL, DIMENSION(ims:ime, -2:0, jms:jme), OPTIONAL :: snicexy
635 REAL, DIMENSION(ims:ime, -2:0, jms:jme), OPTIONAL :: snliqxy
636 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: tvxy
637 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: tgxy
638 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: canicexy
639 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: canliqxy
640 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: eahxy
641 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: tahxy
642 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: cmxy
643 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: chxy
644 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: fwetxy
645 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: sneqvoxy
646 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: alboldxy
647 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: qsnowxy
648 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: qrainxy
649 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: wslakexy
650 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: zwtxy
651 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: waxy
652 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: wtxy
653 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: lfmassxy
654 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: rtmassxy
655 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: stmassxy
656 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: woodxy
657 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: stblcpxy
658 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: fastcpxy
659 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: xsaixy
660 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: t2mvxy
661 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: t2mbxy
662 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL :: chstarxy
664 ! REAL, DIMENSION(1:num_roof_layers), INTENT(INOUT) :: DZR !Optional urban
665 ! REAL, DIMENSION(1:num_wall_layers), INTENT(INOUT) :: DZB !Optional urban
666 ! REAL, DIMENSION(1:num_road_layers), INTENT(INOUT) :: DZG !Optional urban
668 REAL, DIMENSION(num_soil_layers), OPTIONAL, INTENT(INOUT) :: dzr
670 REAL, DIMENSION(num_soil_layers), OPTIONAL, INTENT(INOUT) :: dzb
672 REAL, DIMENSION(num_soil_layers), OPTIONAL, INTENT(INOUT) :: dzg
674 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
677 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
680 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
683 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
686 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
689 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
692 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
695 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
698 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
701 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
704 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
707 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
710 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
713 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
716 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
719 INTEGER, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
721 ! REAL, DIMENSION( ims:ime, 1:num_roof_layers, jms:jme ), INTENT(INOUT) :: TRL_URB3D !Optional urban
722 ! REAL, DIMENSION( ims:ime, 1:num_wall_layers, jms:jme ), INTENT(INOUT) :: TBL_URB3D !Optional urban
723 ! REAL, DIMENSION( ims:ime, 1:num_road_layers, jms:jme ), INTENT(INOUT) :: TGL_URB3D !Optional urban
725 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), OPTIONAL, &
726 & INTENT(INOUT) :: trl_urb3d
728 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), OPTIONAL, &
729 & INTENT(INOUT) :: tbl_urb3d
731 REAL, DIMENSION(ims:ime, num_soil_layers, jms:jme), OPTIONAL, &
732 & INTENT(INOUT) :: tgl_urb3d
733 INTEGER, INTENT(IN) :: num_urban_ndm
734 INTEGER, INTENT(IN) :: urban_map_zrd
735 INTEGER, INTENT(IN) :: urban_map_zwd
736 INTEGER, INTENT(IN) :: urban_map_gd
737 INTEGER, INTENT(IN) :: urban_map_zd
738 INTEGER, INTENT(IN) :: urban_map_zdf
739 INTEGER, INTENT(IN) :: urban_map_bd
740 INTEGER, INTENT(IN) :: urban_map_wd
741 INTEGER, INTENT(IN) :: urban_map_gbd
742 INTEGER, INTENT(IN) :: urban_map_fbd
744 REAL, DIMENSION(ims:ime, urban_map_zrd, jms:jme), OPTIONAL, &
745 & INTENT(INOUT) :: trb_urb4d
747 REAL, DIMENSION(ims:ime, urban_map_zwd, jms:jme), OPTIONAL, &
748 & INTENT(INOUT) :: tw1_urb4d
750 REAL, DIMENSION(ims:ime, urban_map_zwd, jms:jme), OPTIONAL, &
751 & INTENT(INOUT) :: tw2_urb4d
753 REAL, DIMENSION(ims:ime, urban_map_gd, jms:jme), OPTIONAL, &
754 & INTENT(INOUT) :: tgb_urb4d
756 REAL, DIMENSION(ims:ime, urban_map_bd, jms:jme), OPTIONAL, &
757 & INTENT(INOUT) :: tlev_urb3d
759 REAL, DIMENSION(ims:ime, urban_map_bd, jms:jme), OPTIONAL, &
760 & INTENT(INOUT) :: qlev_urb3d
762 REAL, DIMENSION(ims:ime, urban_map_wd, jms:jme), OPTIONAL, &
763 & INTENT(INOUT) :: tw1lev_urb3d
765 REAL, DIMENSION(ims:ime, urban_map_wd, jms:jme), OPTIONAL, &
766 & INTENT(INOUT) :: tw2lev_urb3d
768 REAL, DIMENSION(ims:ime, urban_map_gbd, jms:jme), OPTIONAL, &
769 & INTENT(INOUT) :: tglev_urb3d
771 REAL, DIMENSION(ims:ime, urban_map_fbd, jms:jme), OPTIONAL, &
772 & INTENT(INOUT) :: tflev_urb3d
774 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
777 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
780 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
783 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
786 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: &
789 REAL, DIMENSION(ims:ime, urban_map_wd, jms:jme), OPTIONAL, &
790 & INTENT(INOUT) :: sfwin1_urb3d
792 REAL, DIMENSION(ims:ime, urban_map_wd, jms:jme), OPTIONAL, &
793 & INTENT(INOUT) :: sfwin2_urb3d
795 REAL, DIMENSION(ims:ime, urban_map_zd, jms:jme), OPTIONAL, &
796 & INTENT(INOUT) :: sfw1_urb3d
798 REAL, DIMENSION(ims:ime, urban_map_zd, jms:jme), OPTIONAL, &
799 & INTENT(INOUT) :: sfw2_urb3d
801 REAL, DIMENSION(ims:ime, urban_map_zdf, jms:jme), OPTIONAL, &
802 & INTENT(INOUT) :: sfr_urb3d
804 REAL, DIMENSION(ims:ime, num_urban_ndm, jms:jme), OPTIONAL, &
805 & INTENT(INOUT) :: sfg_urb3d
806 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
808 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
810 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
812 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
814 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
816 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
818 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
820 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
822 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
824 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
826 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
828 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
830 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
832 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
834 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: achfx&
836 ! Optional OML variables
837 REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(INOUT) :: tml, &
838 & t0ml, hml, h0ml, huml, hvml, tmoml
839 INTEGER, OPTIONAL, INTENT(IN) :: sf_ocean_physics
840 REAL, OPTIONAL, INTENT(IN) :: oml_hml0
841 LOGICAL, INTENT(IN) :: start_of_simulation
844 INTEGER :: mynn_closure_level
845 !-- calculate pbl time step
850 !-- initialize pbl scheme
851 SELECT CASE (config_flags%bl_pbl_physics)
852 CASE (surfdragscheme)
853 CALL SURFACE_DRAG_INIT_B(rublten, rubltenb, rvblten, rvbltenb, &
854 & rthblten, rthbltenb, rqvblten, rqvbltenb, &
855 & restart, ids, ide, jds, jde, kds, kde, ims, ime&
856 & , jms, jme, kms, kme, its, ite, jts, jte, kts, &
859 END SUBROUTINE BL_INIT_B
860 !=====================================================================
861 ! Differentiation of cu_init in reverse (adjoint) mode:
862 ! gradient of useful results: raincv rqccuten rthcuten rainc
864 ! with respect to varying inputs: raincv rqccuten rthcuten rainc
866 !==================================================================
867 SUBROUTINE CU_INIT_B(dx, stepcu, cudt, dt, rucuten, rvcuten, rthcuten, &
868 & rthcutenb, rqvcuten, rqvcutenb, rqrcuten, rqccuten, rqccutenb, &
869 & rqscuten, rqicuten, nca, rainc, raincb, raincv, raincvb, w0avg, &
870 & w0avgb, config_flags, restart, cldefi, lowlyr, mass_flux, rthften, &
871 & rqvften, apr_gr, apr_w, apr_mc, apr_st, apr_as, apr_capma, apr_capme&
872 & , apr_capmi, cugd_tten, cugd_ttens, cugd_qvten, cugd_qvtens, &
873 & cugd_qcten, allowed_to_read, start_of_simulation, ids, ide, jds, jde&
874 & , kds, kde, ims, ime, jms, jme, kms, kme, its, ite, jts, jte, kts, &
877 USE a_module_cu_du, ONLY : ducuinit_b
880 !------------------------------------------------------------------
881 !------------------------------------------------------------------
882 TYPE(GRID_CONFIG_REC_TYPE) :: config_flags
883 LOGICAL, INTENT(IN) :: restart
884 INTEGER, INTENT(IN) :: ids, ide, jds, jde, kds, kde, ims, ime, jms, &
885 & jme, kms, kme, its, ite, jts, jte, kts, kte
886 REAL, INTENT(IN) :: dt, cudt, dx
887 LOGICAL, INTENT(IN) :: start_of_simulation
888 LOGICAL, INTENT(IN) :: allowed_to_read
889 INTEGER, INTENT(INOUT) :: stepcu
890 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: rucuten&
891 & , rvcuten, rthcuten, rqvcuten, rqccuten, rqrcuten, rqicuten, &
893 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: &
895 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT) &
896 & :: cugd_tten, cugd_ttens, cugd_qvten, cugd_qvtens, cugd_qcten
897 REAL, DIMENSION(ims:ime, kms:kme, jms:jme) :: w0avg
898 REAL, DIMENSION(ims:ime, kms:kme, jms:jme) :: w0avgb
899 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: rthften, &
901 REAL, DIMENSION(ims:ime, jms:jme) :: rainc, raincv
902 REAL, DIMENSION(ims:ime, jms:jme) :: raincb, raincvb
903 REAL, DIMENSION(ims:ime, jms:jme), INTENT(OUT) :: cldefi
904 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: nca
905 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: mass_flux, &
906 & apr_gr, apr_w, apr_mc, apr_st, apr_as, apr_capma, apr_capme, &
908 INTEGER, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: lowlyr
910 INTEGER :: i, j, itf, jtf
912 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: &
914 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: &
919 IF (ite .GT. ide - 1) THEN
924 IF (jte .GT. jde - 1) THEN
930 IF (start_of_simulation) THEN
931 CALL PUSHCONTROL1B(0)
933 CALL PUSHCONTROL1B(1)
935 !-- deep convection and hybrid deep-shallow convection schemes
936 SELECT CASE (config_flags%cu_physics)
938 CALL DUCUINIT_B(rthcuten, rthcutenb, rqvcuten, rqvcutenb, rqccuten&
939 & , rqccutenb, rqrcuten, rqicuten, rqscuten, nca, w0avg, &
940 & w0avgb, p_qc, p_qr, svp1, svp2, svp3, svpt0, &
941 & param_first_scalar, restart, allowed_to_read, ids, ide, &
942 & jds, jde, kds, kde, ims, ime, jms, jme, kms, kme, its, &
943 & ite, jts, jte, kts, kte)
945 CALL POPCONTROL1B(branch)
946 IF (branch .EQ. 0) THEN
954 END SUBROUTINE CU_INIT_B
955 !==================================================================
956 ! Differentiation of mp_init in reverse (adjoint) mode:
957 ! gradient of useful results: rainnc snownc graupelnc
958 ! with respect to varying inputs: rainnc snownc graupelnc
959 !==================================================================
963 SUBROUTINE MP_INIT_B(rainnc, rainncb, snownc, snowncb, graupelnc, &
964 & graupelncb, config_flags, restart, warm_rain, adv_moist_cond, mpdt, &
965 & dt, dx, dy, lowlyr, f_ice_phy, f_rain_phy, f_rimef_phy, &
966 & mp_restart_state, tbpvs_state, tbpvs0_state, allowed_to_read, &
967 & start_of_simulation, ids, ide, jds, jde, kds, kde, ims, ime, jms, &
968 & jme, kms, kme, its, ite, jts, jte, kts, kte)
970 !------------------------------------------------------------------
972 TYPE(GRID_CONFIG_REC_TYPE) :: config_flags
973 LOGICAL, INTENT(IN) :: restart
974 LOGICAL, INTENT(OUT) :: warm_rain, adv_moist_cond
975 REAL, INTENT(IN) :: mpdt, dt, dx, dy
976 LOGICAL, INTENT(IN) :: start_of_simulation
977 INTEGER, INTENT(IN) :: ids, ide, jds, jde, kds, kde, ims, ime, jms, &
978 & jme, kms, kme, its, ite, jts, jte, kts, kte
979 INTEGER, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: lowlyr
980 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: rainnc, snownc, &
982 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: rainncb
983 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: &
984 & f_ice_phy, f_rain_phy, f_rimef_phy
985 REAL, DIMENSION(:), INTENT(INOUT) :: mp_restart_state, tbpvs_state, &
987 LOGICAL, INTENT(IN) :: allowed_to_read
989 INTEGER :: i, j, itf, jtf
990 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: graupelncb
991 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: snowncb
993 IF (ite .GT. ide - 1) THEN
998 IF (jte .GT. jde - 1) THEN
1003 IF (start_of_simulation) THEN
1006 graupelncb(i, j) = 0.0
1012 END SUBROUTINE MP_INIT_B
1013 !==================================================================
1014 END MODULE A_MODULE_PHYSICS_INIT