1 !WRF:MODEL_LAYER:INITIALIZATION
4 ! This MODULE holds the routines which are used to perform model start-up operations
5 ! for the individual domains. This is the stage after inputting wrfinput and before
8 ! This MODULE CONTAINS the following routines:
10 MODULE module_physics_init
12 USE module_state_description
13 USE module_model_constants
14 USE module_configure, ONLY : grid_config_rec_type
15 #if ( defined( DM_PARALLEL ) && ( ! defined( STUBMPI ) ) )
16 USE module_dm, ONLY : wrf_dm_max_real
18 USE module_ra_clWRF_support
20 ! USE module_ssib_veg , ONLY : init_module_ssib_veg !fds (SSiB constants)
21 !Local data for CAM's MG MP scheme
22 integer :: ixcldliq, ixcldice, ixnumliq, ixnumice
23 LOGICAL :: CAM_INITIALIZED = .FALSE.
24 LOGICAL :: WINDFARM_INITIALIZED = .FALSE.
30 !=================================================================
31 SUBROUTINE phy_init ( id, config_flags, DT, restart, zfull, zhalf, &
32 p_top, TSK,RADT,BLDT,CUDT,MPDT, &
34 RTHCUTEN, RQVCUTEN, RQRCUTEN, &
35 RQCCUTEN, RQSCUTEN, RQICUTEN, &
36 RUSHTEN, RVSHTEN, RTHSHTEN, &
37 RQVSHTEN, RQRSHTEN, RQCSHTEN, &
38 RQSSHTEN, RQISHTEN, RQGSHTEN, &
39 RUBLTEN,RVBLTEN,RTHBLTEN, &
40 RQVBLTEN,RQCBLTEN,RQIBLTEN, &
41 RTHRATEN,RTHRATENLW,RTHRATENSW, &
42 this_is_an_ideal_run, &
44 !BSINGH - For WRFCuP scheme(11/12/2013)
45 cupflag,cldfra_cup,cldfratend_cup, & !wig, 18-Sep-2006
46 shall, & !wig, 18-Sep-2006
47 tcloud_cup, & !rce, 18-apr-2012
50 STEPBL,STEPRA,STEPCU, &
51 W0AVG, RAINNC, RAINC, RAINCV, RAINNCV, &
52 SNOWNC, SNOWNCV, GRAUPELNC, GRAUPELNCV, &
53 z_at_q, inv_dens, qnwfa2d, qnbca2d, & ! G. Thompson
54 scalar, num_sc, & ! G. Thompson
55 re_cloud, re_ice, re_snow, & ! G. Thompson
56 has_reqc, has_reqi, has_reqs, & ! G. Thompson
58 PHB,PH,P,PB,QV,CCNTY,QDCN,QTCN,QCCN, & ! for ntu3m
59 QRCN,QNIN, & ! for ntu3m
60 re_cloud_gsfc, re_ice_gsfc, &
61 re_snow_gsfc, & ! Goddard
62 re_graupel_gsfc, re_hail_gsfc, &
63 re_rain_gsfc, & ! Goddard
69 #if (WRF_USE_CLM == 1) && ( WRF_CHEM == 1 )
70 megan_specifier, megan_factors_file, &
71 megan_mapped_emisfctrs, &
73 CLDFRA,CLDFRA_OLD,GLW,GSW,EMISS,EMBCK, & !EMBCK new
75 landuse_ISICE, landuse_LUCATS, &
76 landuse_LUSEAS, landuse_ISN, &
78 XLAT,XLONG,xlong_u,xlat_v,ALBEDO,ALBBCK,GMT,JULYR,JULDAY,&
79 levsiz, n_ozmixm, n_aerosolc, paerlev, &
80 alevsiz, no_src_types, &
81 TMN,XLAND,ZNT,Z0,UST,MOL,PBLH,TKE_PBL, &
82 EXCH_H,THC,SNOWC,MAVAIL,HFX,QFX,RAINBL, &
83 TSLB,ZS,DZS,num_soil_layers,warm_rain, &
84 adv_moist_cond,is_CAMMGMP_used, &
85 APR_GR,APR_W,APR_MC,APR_ST,APR_AS, &
86 APR_CAPMA,APR_CAPME,APR_CAPMI, &
87 XICE,XICEM,VEGFRA,SNOW,CANWAT,SMSTAV, &
88 SMSTOT, SFCRUNOFF,UDRUNOFF,GRDFLX,ACSNOW,&
89 ACSNOM,IVGTYP,ISLTYP, SFCEVP, SMOIS, &
90 SH2O, SNOWH, SMFR3D, & ! temporary
93 F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, &
94 mp_restart_state,tbpvs_state,tbpvs0_state,&
95 allowed_to_read, moved, start_of_simulation,&
98 ids, ide, jds, jde, kds, kde, &
99 ims, ime, jms, jme, kms, kme, &
100 its, ite, jts, jte, kts, kte, &
114 gd_cloud,gd_cloud2, &
115 gd_cloud_a,gd_cloud2_a, &
117 ozmixm,pin, & ! Optional
118 aerodm,pina, & ! Optional
119 m_ps_1,m_ps_2,m_hybi,aerosolc_1,aerosolc_2,& ! Optional
120 RUNDGDTEN,RVNDGDTEN,RTHNDGDTEN, & ! Optional
121 RPHNDGDTEN,RQVNDGDTEN,RMUNDGDTEN, & ! Optional
122 SDA_HFX, SDA_QFX, QNORM, HFX_BOTH, QFX_BOTH, & ! fasdas
124 FGDT,STEPFG, & ! Optional
125 cugd_tten,cugd_ttens,cugd_qvten, & ! Optional
126 cugd_qvtens,cugd_qcten, & ! Optional
127 ISNOWXY, ZSNSOXY, TSNOXY, & ! Optional Noah-MP
128 SNICEXY, SNLIQXY, TVXY, TGXY, CANICEXY, & ! Optional Noah-MP
129 CANLIQXY, EAHXY, TAHXY, CMXY, & ! Optional Noah-MP
130 CHXY, FWETXY, SNEQVOXY, ALBOLDXY,QSNOWXY,QRAINXY,& ! Optional Noah-MP
131 WSLAKEXY, ZWTXY, WAXY, WTXY, LFMASSXY, RTMASSXY, & ! Optional Noah-MP
132 STMASSXY, WOODXY, STBLCPXY, FASTCPXY, & ! Optional Noah-MP
133 GRAINXY, GDDXY, & ! Optional Noah-MP
134 croptype, cropcat, & ! Noah-MP Crop model
136 iopt_irr, iopt_irrm, &
137 IRNUMSI, IRNUMMI, IRNUMFI, IRWATSI, IRWATMI, & ! Optional Noah-MP
138 IRWATFI, IRELOSS, IRSIVOL, IRMIVOL, IRFIVOL, & ! Optional Noah-MP
140 gecros_state, & ! Optional gecros crop
141 XSAIXY, LAI, & ! Optional Noah-MP
142 T2MVXY, T2MBXY, CHSTARXY , & ! Optional Noah-MP
143 SMOISEQ ,SMCWTDXY ,RECHXY, DEEPRECHXY, AREAXY, & ! Optional Noah-MP
144 WTDDT , STEPWTD ,QRFSXY ,QSPRINGSXY ,QSLATXY, & ! Optional Noah-MP
145 FDEPTHXY, RIVERBEDXY, EQZWT, RIVERCONDXY, PEXPXY, & ! Optional Noah-MP
146 rechclim , & ! Optional Noah-MP
147 msftx, msfty, & ! Optional Noah-MP
148 ! num_roof_layers,num_wall_layers, & !Optional urban
149 ! num_road_layers, & !Optional urban
150 DZR, DZB, DZG, & !Optional urban
151 TR_URB2D,TB_URB2D,TG_URB2D,TC_URB2D, & !Optional urban
152 QC_URB2D, XXXR_URB2D,XXXB_URB2D, & !Optional urban
153 XXXG_URB2D, XXXC_URB2D, & !Optional urban
154 TRL_URB3D, TBL_URB3D, TGL_URB3D, & !Optional urban
155 SH_URB2D, LH_URB2D, G_URB2D, RN_URB2D, & !Optional urban
156 TS_URB2D, FRC_URB2D, UTYPE_URB2D, & !Optional urban
157 CMCR_URB2D,TGR_URB2D,TGRL_URB3D,SMR_URB3D, & !Optional urban
158 DRELR_URB2D,DRELB_URB2D,DRELG_URB2D, & !Optional urban
159 FLXHUMR_URB2D,FLXHUMB_URB2D, & !Optional urban
160 FLXHUMG_URB2D, & !Optional urban
161 TRB_URB4D,TW1_URB4D,TW2_URB4D, & !Optional multi-layer urban
162 TGB_URB4D,TLEV_URB3D,QLEV_URB3D, & !Optional multi-layer urban
163 TW1LEV_URB3D,TW2LEV_URB3D, & !Optional multi-layer urban
164 TGLEV_URB3D,TFLEV_URB3D, & !Optional multi-layer urban
165 SF_AC_URB3D,LF_AC_URB3D,CM_AC_URB3D, & !Optional multi-layer urban
166 SFVENT_URB3D,LFVENT_URB3D, & !Optional multi-layer urban
167 SFWIN1_URB3D,SFWIN2_URB3D, & !Optional multi-layer urban
168 SFW1_URB3D,SFW2_URB3D, & !Optional multi-layer urban
169 SFR_URB3D,SFG_URB3D, & !Optional multi-layer urban
170 EP_PV_URB3D,T_PV_URB3D, & !GRZ
171 TRV_URB4D,QR_URB4D,QGR_URB3D,TGR_URB3D, & !GRZ
172 DRAIN_URB4D,DRAINGR_URB3D,SFRV_URB3D, & !GRZ
173 LFRV_URB3D,DGR_URB3D,DG_URB3D,LFR_URB3D,LFG_URB3D,&!GRZ
174 LP_URB2D,HI_URB2D,LB_URB2D, & !Optional multi-layer urban
175 HGT_URB2D,MH_URB2D,STDH_URB2D, & !Optional multi-layer urban
176 LF_URB2D, & !Optional multi-layer urban
177 A_U_BEP,A_V_BEP,A_T_BEP,A_Q_BEP, & !Optional multi-layer urban
178 A_E_BEP,B_U_BEP,B_V_BEP, & !Optional multi-layer urban
179 B_T_BEP,B_Q_BEP,B_E_BEP,DLG_BEP, & !Optional multi-layer urban
180 DL_U_BEP,SF_BEP,VL_BEP, & !Optional multi-layer urban
181 TML,T0ML,HML,H0ML,HUML,HVML,TMOML, & !Optional oml
182 lakedepth2d, savedtke12d, snowdp2d, h2osno2d, & !lake
183 snl2d, t_grnd2d, t_lake3d, lake_icefrac3d, & !lake
184 z_lake3d, dz_lake3d, t_soisno3d, h2osoi_ice3d, & !lake
185 h2osoi_liq3d, h2osoi_vol3d, z3d, dz3d, & !lake
186 zi3d, watsat3d, csol3d, tkmg3d, & !lake
187 tkdry3d, tksatu3d, lake2d, lakedepth_default, & !lake
188 lake_min_elev, lake_depth, & !lake
190 lakemask, lakeflag, & !lake
192 lake_depth_flag, use_lakedepth, & !lake
193 water_depth, bathymetry_flag, shalwater_z0, & ! bathymetry
194 shalwater_depth, & ! bathymetry
195 sf_surface_mosaic, mosaic_cat, NLCAT, & ! Noah tiling
199 snowdp,wtc,wtp,h2osno,t_grnd,t_veg, &
200 h2ocan,h2ocan_col,t2m_max,t2m_min,t_ref2m, &
202 h2osoi_liq_s2,h2osoi_liq_s3,h2osoi_liq_s4, &
203 h2osoi_liq_s5,h2osoi_liq1,h2osoi_liq2, &
204 h2osoi_liq3,h2osoi_liq4,h2osoi_liq5,h2osoi_liq6, &
205 h2osoi_liq7,h2osoi_liq8,h2osoi_liq9,h2osoi_liq10, &
206 h2osoi_ice_s1,h2osoi_ice_s2, &
207 h2osoi_ice_s3,h2osoi_ice_s4,h2osoi_ice_s5, &
208 h2osoi_ice1,h2osoi_ice2,h2osoi_ice3,h2osoi_ice4, &
209 h2osoi_ice5,h2osoi_ice6,h2osoi_ice7, &
210 h2osoi_ice8,h2osoi_ice9,h2osoi_ice10, &
211 t_soisno_s1,t_soisno_s2,t_soisno_s3,t_soisno_s4, &
212 t_soisno_s5,t_soisno1,t_soisno2,t_soisno3, &
213 t_soisno4,t_soisno5,t_soisno6,t_soisno7, &
214 t_soisno8,t_soisno9,t_soisno10, &
215 dzsnow1,dzsnow2,dzsnow3,dzsnow4,dzsnow5, &
216 snowrds1,snowrds2,snowrds3,snowrds4,snowrds5, &
217 t_lake1,t_lake2,t_lake3,t_lake4,t_lake5, &
218 t_lake6,t_lake7,t_lake8,t_lake9,t_lake10, &
219 h2osoi_vol1,h2osoi_vol2,h2osoi_vol3, &
220 h2osoi_vol4,h2osoi_vol5,h2osoi_vol6, &
221 h2osoi_vol7,h2osoi_vol8, &
222 h2osoi_vol9,h2osoi_vol10, &
224 ALBEDOsubgrid,LHsubgrid,HFXsubgrid,LWUPsubgrid, &
225 Q2subgrid,SABVsubgrid,SABGsubgrid,NRAsubgrid, &
226 SWUPsubgrid,lhsoi,lhveg,lhtran, &
227 ! end of CLM variables
228 TSK_SAVE, & !Optional for fractional seaice
229 itimestep, & !Optional obs fdda
231 fdob, & !Optional obs fdda
233 t00, p00, tlp, & !for obs-nudging
234 TYR,TYRA,TDLY,TLAG,NYEAR,NDAY,tmn_update, &
235 ACHFX,ACLHF,ACGRDFLX, &
237 RQCNCUTEN, RQINCUTEN, &
238 rliq, & !BSINGH:01/31/2013 - Added rliq and is_CAMMGMP_used for CAM5 physics
239 cldfra_dp,cldfra_sh & !ckay for subgrid cloud
240 ,te_temf & ! WA 12/21/09
241 ,cf3d_temf & ! WA 9/27/10
242 ,wm_temf & ! WA 2/22/11
243 ,massflux_EDKF, entr_EDKF, detr_EDKF & ! Optional for qnse
244 ,thl_up, thv_up, rt_up & ! Optional for qnse
245 ,rv_up, rc_up, u_up, v_up, frac_up & ! Optional for qnse
246 ,RDCASHTEN, RQCDCSHTEN &
247 ,cldareaa, cldareab, cldliqa, cldliqb &
249 ,pblmax, wub, ltopb, clddpthb, cldtopb &
250 ,capesave, ainckfsa, radsave &
251 ,rainsh, rainshvb, kdcldtop, kdcldbas &
252 ,xtime1, PBLHAVG, TKEAVG &
256 ,ghi_accum & ! Solar diagnostics
257 ,landusef,landusef2,mosaic_cat_index & ! danli mosaic
258 ,TSK_mosaic,TSLB_mosaic,SMOIS_mosaic,SH2O_mosaic & ! danli mosaic
259 ,CANWAT_mosaic,SNOW_mosaic,SNOWH_mosaic,SNOWC_mosaic & ! danli mosaic
260 ,ALBEDO_mosaic,ALBBCK_mosaic, EMISS_mosaic, EMBCK_mosaic, ZNT_mosaic, Z0_mosaic & ! danli mosaic
261 ,TR_URB2D_mosaic,TB_URB2D_mosaic & ! danli mosaic
262 ,TG_URB2D_mosaic,TC_URB2D_mosaic & ! danli mosaic
263 ,QC_URB2D_mosaic & ! danli mosaic
264 ,TRL_URB3D_mosaic,TBL_URB3D_mosaic & ! danli mosaic
265 ,TGL_URB3D_mosaic & ! danli mosaic
266 ,SH_URB2D_mosaic,LH_URB2D_mosaic & ! danli mosaic
267 ,G_URB2D_mosaic,RN_URB2D_mosaic & ! danli mosaic
268 ,TS_URB2D_mosaic & ! danli mosaic
269 ,TS_RUL2D_mosaic & ! danli mosaic
270 ,irr_rand_field,irr_ph,irr_freq &
272 ,QR_CU,QS_CU,NC_CU,NI_CU,NR_CU,NS_CU,CCN_CU & ! TWG
273 ,alevsiz_cu,num_months,no_src_types_cu,aeromcu,aeropcu & ! PSH/TWG 06/10/16
274 ,EFCG,EFCS,EFIG,EFIS,EFSG,EFSS & ! TWG
278 !-----------------------------------------------------------------
281 use module_sf_lake, only : nlevsoil,nlevsnow,nlevlake
282 #if ( WRF_CHEM == 1 )
283 USE module_gocart_coupling, ONLY : makelut_ccn_icn
284 USE module_cam_support, ONLY : cam_mam_aerosols
286 USE module_wind_fitch
287 USE module_wind_mav ! Yulong add for WLM
289 !-----------------------------------------------------------------
290 TYPE (grid_config_rec_type) :: config_flags
292 INTEGER , INTENT(IN) :: id
293 INTEGER , INTENT(IN) ,OPTIONAL :: tmn_update
294 LOGICAL , INTENT(OUT) :: warm_rain,adv_moist_cond
295 LOGICAL , INTENT(OUT) :: is_CAMMGMP_used !BSINGH:01/31/2013 - Added for CAM5 physics
296 ! LOGICAL , INTENT (IN) :: FNDSOILW, FNDSNOWH
297 LOGICAL, PARAMETER :: FNDSOILW=.true., FNDSNOWH=.true.
298 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
299 ims, ime, jms, jme, kms, kme, &
300 its, ite, jts, jte, kts, kte
302 INTEGER , INTENT(IN) :: num_soil_layers
303 INTEGER , INTENT(IN) :: lagday
304 INTEGER , INTENT(OUT) ,OPTIONAL :: nyear
305 REAL , INTENT(OUT) ,OPTIONAL :: nday
307 LOGICAL, INTENT(IN) :: start_of_simulation, this_is_an_ideal_run
308 REAL, INTENT(IN) :: DT, p_top, DX, DY
309 REAL, DIMENSION(ims:ime,jms:jme), INTENT(INOUT), OPTIONAL :: DX2D, AREA2D
310 LOGICAL, INTENT(IN) :: restart
311 REAL, INTENT(IN) :: RADT,BLDT,CUDT,MPDT
312 REAL, INTENT(IN) :: swrad_scat
314 REAL, DIMENSION( kms:kme ) , INTENT(IN) :: zfull, zhalf
315 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(IN) :: TSK, XLAT, XLONG,xlong_u,xlat_v
316 REAL, DIMENSION(ims:ime,jms:jme), INTENT(IN) , OPTIONAL :: msftx,msfty
318 INTEGER, INTENT(IN ) :: levsiz, n_ozmixm
319 INTEGER, INTENT(IN ) :: paerlev, n_aerosolc
320 INTEGER, INTENT(IN ) :: alevsiz, no_src_types
322 REAL, DIMENSION( ims:ime, levsiz, jms:jme, n_ozmixm ), OPTIONAL, &
323 INTENT(INOUT) :: OZMIXM
324 REAL, DIMENSION( ims:ime, alevsiz, jms:jme, n_ozmixm-1, no_src_types ), OPTIONAL, &
325 INTENT(INOUT) :: aerodm
329 INTEGER, INTENT(IN ) :: alevsiz_cu, num_months, no_src_types_cu !PSH/TWG 06/10/16
330 REAL, DIMENSION( ims:ime, alevsiz_cu, jms:jme, num_months, no_src_types_cu), OPTIONAL, &
331 INTENT(INOUT) :: aeromcu
332 REAL, DIMENSION( ims:ime, alevsiz_cu, jms:jme, num_months), OPTIONAL,INTENT(INOUT) :: aeropcu
334 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , &
335 OPTIONAL, INTENT(INOUT ) :: &
337 NC_CU, NI_CU, NR_CU, NS_CU, & !TWG
338 CCN_CU, EFCG, EFCS, EFIG, & !TWG
343 REAL, DIMENSION(levsiz), OPTIONAL, INTENT(INOUT) :: PIN
344 REAL, DIMENSION(alevsiz), OPTIONAL, INTENT(INOUT) :: PINA
346 REAL, DIMENSION(ims:ime,jms:jme), OPTIONAL, INTENT(INOUT) :: m_ps_1,m_ps_2
347 REAL, DIMENSION(paerlev), OPTIONAL,INTENT(INOUT) :: m_hybi
348 REAL, DIMENSION( ims:ime, paerlev, jms:jme, n_aerosolc ), OPTIONAL, &
349 INTENT(INOUT) :: aerosolc_1, aerosolc_2
351 REAL, DIMENSION( ims:ime , 1:num_soil_layers , jms:jme ),&
352 INTENT(INOUT) :: SMOIS, SH2O,TSLB
353 REAL, DIMENSION( ims:ime , 1:num_soil_layers , jms:jme ), INTENT(OUT) :: SMFR3D
355 REAL, DIMENSION( ims:ime, jms:jme ) , &
356 INTENT(INOUT) :: SNOW, &
371 REAL, DIMENSION( ims:ime, jms:jme ), OPTIONAL, INTENT(INOUT) :: rliq
373 REAL, DIMENSION( ims:ime, jms:jme ) , &
374 OPTIONAL, INTENT(INOUT) :: ACHFX, &
378 INTEGER, DIMENSION( ims:ime, jms:jme ) , &
379 INTENT(INOUT) :: IVGTYP, &
381 REAL, DIMENSION( ims:ime, jms:jme ) , &
382 OPTIONAL, INTENT(IN) :: U10, &
384 REAL, DIMENSION( ims:ime, jms:jme ) , &
385 OPTIONAL, INTENT(OUT) :: U10E, &
388 !BSINGH - For WRFCuP scheme
389 REAL, DIMENSION( ims:ime, jms:jme ) , &
390 INTENT(INOUT) :: shall, & !CuP, wig 18-Sep-2006
391 tcloud_cup !CuP, rce 18-apr-2012
396 !..Added by G. Thompson to couple cloud physics variables with RRTMG radiation.
397 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: re_cloud, &
399 INTEGER, INTENT(INOUT):: has_reqc, has_reqi, has_reqs
401 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: re_cloud_gsfc, &
402 re_ice_gsfc, re_snow_gsfc, re_graupel_gsfc, re_hail_gsfc, re_rain_gsfc
405 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: &!BSINGH(PNNL)- should be declared inout
406 RTHRATEN, RTHRATENLW, RTHRATENSW, CLDFRA
408 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , OPTIONAL, INTENT(INOUT) :: &!BSINGH(PNNL)- should be declared inout
411 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , OPTIONAL, INTENT(INOUT) :: & ! ckay for subgrid cloud
414 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: &
415 GSW,ALBEDO,ALBBCK,GLW,EMISS,EMBCK !EMBCK new
416 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: SNOALB
419 REAL, INTENT(IN) :: GMT
421 INTEGER , INTENT(OUT) :: STEPRA, STEPBL, STEPCU
422 INTEGER , INTENT(IN) :: JULYR, JULDAY
426 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: & !BSINGH(PNNL)- should be declared inout
427 RUCUTEN, RVCUTEN, RTHCUTEN, RQVCUTEN, RQRCUTEN, RQCCUTEN, &
428 RQSCUTEN, RQICUTEN, &
429 RUSHTEN, RVSHTEN, RTHSHTEN, RQVSHTEN, RQRSHTEN, RQCSHTEN, &
430 RQSSHTEN, RQISHTEN, RQGSHTEN
432 !BSINGH - For WRFCuP scheme
433 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: &
434 cldfra_cup,cldfratend_cup !CuP, wig 18-Sep-2006
436 LOGICAL, DIMENSION( ims:ime , jms:jme ) , INTENT(OUT) :: cupflag !CuP, wig 9-Oct-2006
440 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT), OPTIONAL :: RQCNCUTEN, RQINCUTEN
442 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: W0AVG
444 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(OUT) :: MASS_FLUX, &
445 APR_GR,APR_W,APR_MC,APR_ST,APR_AS, &
446 APR_CAPMA,APR_CAPME,APR_CAPMI
448 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: & !BSINGH(PNNL)- should be declared inout
451 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(OUT) :: &
452 RAINNC, RAINC, RAINCV, RAINNCV, &
453 SNOWNC, SNOWNCV, GRAUPELNC, GRAUPELNCV
454 REAL, DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(IN) :: z_at_q ! G. Thompson
455 REAL, DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(IN) :: inv_dens ! G. Thompson
456 REAL, DIMENSION(ims:ime,jms:jme), INTENT(INOUT) :: qnwfa2d, qnbca2d ! G. Thompson
457 INTEGER, INTENT(IN) :: num_sc ! G. Thompson
458 REAL, DIMENSION(ims:ime,kms:kme,jms:jme,num_sc), INTENT(INOUT) :: scalar ! G. Thompson
460 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(OUT) :: CLDEFI, NCA
462 INTEGER, DIMENSION( ims:ime , jms:jme ) , INTENT(OUT) :: LOWLYR
468 REAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: ZS,DZS
470 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: & !BSINGH(PNNL)- should be declared inout
471 RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN,RQCBLTEN,RQIBLTEN,EXCH_H,TKE_PBL
472 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT), OPTIONAL :: QKE,pek,pep
474 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT), OPTIONAL :: &
475 massflux_EDKF, entr_EDKF, detr_EDKF &
476 ,thl_up, thv_up, rt_up &
477 ,rv_up, rc_up, u_up, v_up &
481 REAL, DIMENSION(ims:ime,jms:jme), OPTIONAL, INTENT(INOUT) :: ghi_accum
483 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , OPTIONAL, INTENT(OUT) :: &
484 cugd_tten,cugd_ttens,cugd_qvten, &
485 cugd_qvtens,cugd_qcten
486 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: &
487 XLAND,ZNT,Z0,UST,MOL,LU_INDEX, &
488 PBLH,THC,MAVAIL,HFX,QFX,RAINBL
489 INTEGER , INTENT(INOUT) :: landuse_ISICE, landuse_LUCATS
490 INTEGER , INTENT(INOUT) :: landuse_LUSEAS, landuse_ISN
491 REAL , INTENT(INOUT) , DIMENSION( : ) :: lu_state
493 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: TMN
494 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT),OPTIONAL :: TYR
495 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT),OPTIONAL :: TYRA
496 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT),OPTIONAL :: TDLY
497 REAL, DIMENSION( ims:ime , 1:lagday , jms:jme ) , INTENT(INOUT),OPTIONAL :: TLAG
499 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , &
500 OPTIONAL, INTENT(INOUT ) :: &
501 gd_cloud, gd_cloud2, &
502 gd_cloud_a, gd_cloud2_a, &
505 REAL, DIMENSION( ims:ime , jms:jme ) , &
511 INTEGER, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: ISNOWXY
512 REAL, OPTIONAL, DIMENSION(ims:ime,-2:num_soil_layers, jms:jme) :: ZSNSOXY
513 REAL, OPTIONAL, DIMENSION(ims:ime,-2:0, jms:jme) :: TSNOXY
514 REAL, OPTIONAL, DIMENSION(ims:ime,-2:0, jms:jme) :: SNICEXY
515 REAL, OPTIONAL, DIMENSION(ims:ime,-2:0, jms:jme) :: SNLIQXY
516 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: TVXY
517 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: TGXY
518 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: CANICEXY
519 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: CANLIQXY
520 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: EAHXY
521 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: TAHXY
522 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: CMXY
523 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: CHXY
524 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: FWETXY
525 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: SNEQVOXY
526 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: ALBOLDXY
527 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: QSNOWXY
528 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: QRAINXY
529 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: WSLAKEXY
530 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: ZWTXY
531 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: WAXY
532 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: WTXY
533 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: LFMASSXY
534 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: RTMASSXY
535 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: STMASSXY
536 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: WOODXY
537 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: GRAINXY
538 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: GDDXY
539 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: STBLCPXY
540 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: FASTCPXY
541 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: XSAIXY
542 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: LAI
543 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: T2MVXY
544 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: T2MBXY
545 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: CHSTARXY
546 REAL, OPTIONAL, DIMENSION(ims:ime,1:num_soil_layers,jms:jme) :: SMOISEQ
547 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: SMCWTDXY
548 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: DEEPRECHXY
549 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: RECHXY
550 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: QRFSXY
551 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: QSPRINGSXY
552 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: QSLATXY
553 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: AREAXY
554 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme), INTENT(IN) :: FDEPTHXY
555 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme), INTENT(IN) :: RIVERBEDXY
556 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme), INTENT(IN) :: EQZWT
557 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: RIVERCONDXY
558 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: PEXPXY
559 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme), INTENT(IN) :: rechclim
560 INTEGER, OPTIONAL, DIMENSION(ims:ime, jms:jme), INTENT(OUT) :: CROPCAT
561 REAL, OPTIONAL, DIMENSION(ims:ime,5,jms:jme), INTENT(IN ) :: CROPTYPE
562 INTEGER, INTENT(IN ) :: iopt_crop, iopt_irr, iopt_irrm
563 REAL, OPTIONAL, DIMENSION(ims:ime,60,jms:jme) :: gecros_state ! Optional gecros crop
566 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRWATSI
567 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRWATMI
568 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRWATFI
569 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRELOSS
570 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRSIVOL
571 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRMIVOL
572 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRFIVOL
573 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRRSPLH
574 INTEGER, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRNUMSI
575 INTEGER, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRNUMMI
576 INTEGER, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRNUMFI
578 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: qtdrain
580 ! REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), OPTIONAL, INTENT(INOUT ) :: qnn_curr
582 INTEGER , OPTIONAL, INTENT(OUT) :: STEPWTD
583 REAL , OPTIONAL, INTENT(IN) :: WTDDT
586 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: &
587 F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY
588 REAL, DIMENSION(:), INTENT(INOUT) :: mp_restart_state,tbpvs_state,tbpvs0_state
589 LOGICAL, INTENT(IN) :: allowed_to_read, moved
590 REAL, INTENT(INOUT) :: ccn_conc ! RAS
594 REAL, DIMENSION( ims:ime , jms:jme ) , OPTIONAL, INTENT(INOUT) :: &
595 TML,T0ML,HML,H0ML,HUML,HVML,TMOML
597 REAL, DIMENSION( ims:ime , jms:jme ) , OPTIONAL, INTENT(INOUT) :: &
600 REAL, OPTIONAL, INTENT(IN) :: FGDT
601 INTEGER , OPTIONAL, INTENT(OUT) :: STEPFG
602 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , OPTIONAL, INTENT(INOUT) :: &!BSINGH(PNNL)- should be declared inout
603 RUNDGDTEN, RVNDGDTEN, RTHNDGDTEN, RPHNDGDTEN, RQVNDGDTEN
607 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT), OPTIONAL :: &
608 SDA_HFX, SDA_QFX, QNORM, HFX_BOTH, QFX_BOTH
609 ! INTEGER, INTENT(IN ) :: fasdas
610 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , OPTIONAL, INTENT(INOUT) :: &
613 REAL, DIMENSION( ims:ime , jms:jme ) , OPTIONAL, INTENT(INOUT) :: &
617 ! REAL, DIMENSION(1:num_roof_layers), INTENT(INOUT) :: DZR !urban
618 ! REAL, DIMENSION(1:num_wall_layers), INTENT(INOUT) :: DZB !urban
619 ! REAL, DIMENSION(1:num_road_layers), INTENT(INOUT) :: DZG !urban
620 REAL, OPTIONAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: DZR !urban
621 REAL, OPTIONAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: DZB !urban
622 REAL, OPTIONAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: DZG !urban
624 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TR_URB2D !urban
625 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TB_URB2D !urban
626 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TG_URB2D !urban
627 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TC_URB2D !urban
628 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: QC_URB2D !urban
629 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXR_URB2D !urban
630 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXB_URB2D !urban
631 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXG_URB2D !urban
632 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXC_URB2D !urban
634 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: DRELR_URB2D
635 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: DRELB_URB2D
636 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: DRELG_URB2D
637 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: FLXHUMR_URB2D
638 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: FLXHUMB_URB2D
639 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: FLXHUMG_URB2D
640 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: CMCR_URB2D
641 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TGR_URB2D
643 ! REAL, DIMENSION(ims:ime, 1:num_roof_layers, jms:jme), INTENT(INOUT) :: TRL_URB3D !urban
644 ! REAL, DIMENSION(ims:ime, 1:num_wall_layers, jms:jme), INTENT(INOUT) :: TBL_URB3D !urban
645 ! REAL, DIMENSION(ims:ime, 1:num_road_layers, jms:jme), INTENT(INOUT) :: TGL_URB3D !urban
646 REAL, OPTIONAL, DIMENSION(ims:ime, 1:num_soil_layers, jms:jme), INTENT(INOUT) :: TRL_URB3D !urban
647 REAL, OPTIONAL, DIMENSION(ims:ime, 1:num_soil_layers, jms:jme), INTENT(INOUT) :: TBL_URB3D !urban
648 REAL, OPTIONAL, DIMENSION(ims:ime, 1:num_soil_layers, jms:jme), INTENT(INOUT) :: TGL_URB3D !urban
649 REAL, OPTIONAL, DIMENSION(ims:ime, 1:num_soil_layers, jms:jme), INTENT(INOUT) :: TGRL_URB3D !urban
650 REAL, OPTIONAL, DIMENSION(ims:ime, 1:num_soil_layers, jms:jme), INTENT(INOUT) :: SMR_URB3D !urban
652 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: SH_URB2D !urban
653 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: LH_URB2D !urban
654 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: G_URB2D !urban
655 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: RN_URB2D !urban
656 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TS_URB2D !urban
657 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: FRC_URB2D !urban
658 INTEGER, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: UTYPE_URB2D !urban
660 INTEGER , INTENT(IN) :: num_urban_ndm
661 INTEGER , INTENT(IN) :: urban_map_zrd
662 INTEGER , INTENT(IN) :: urban_map_zwd
663 INTEGER , INTENT(IN) :: urban_map_gd
664 INTEGER , INTENT(IN) :: urban_map_zd
665 INTEGER , INTENT(IN) :: urban_map_zdf
666 INTEGER , INTENT(IN) :: urban_map_bd
667 INTEGER , INTENT(IN) :: urban_map_wd
668 INTEGER , INTENT(IN) :: urban_map_gbd
669 INTEGER , INTENT(IN) :: urban_map_fbd
670 INTEGER , INTENT(IN) :: urban_map_zgrd
671 INTEGER , INTENT(IN) :: num_urban_hi
672 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zrd, jms:jme ), INTENT(INOUT) :: TRB_URB4D ! multi-layer UCM
673 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zwd, jms:jme ), INTENT(INOUT) :: TW1_URB4D ! multi-layer UCM
674 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zwd, jms:jme ), INTENT(INOUT) :: TW2_URB4D ! multi-layer UCM
675 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_gd , jms:jme ), INTENT(INOUT) :: TGB_URB4D ! multi-layer UCM
676 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_bd , jms:jme ), INTENT(INOUT) :: TLEV_URB3D ! multi-layer UCM
677 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_bd , jms:jme ), INTENT(INOUT) :: QLEV_URB3D ! multi-layer UCM
678 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_wd , jms:jme ), INTENT(INOUT) :: TW1LEV_URB3D ! multi-layer UCM
679 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_wd , jms:jme ), INTENT(INOUT) :: TW2LEV_URB3D ! multi-layer UCM
680 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_gbd, jms:jme ), INTENT(INOUT) :: TGLEV_URB3D ! multi-layer UCM
681 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_fbd, jms:jme ), INTENT(INOUT) :: TFLEV_URB3D ! multi-layer UCM
682 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: LF_AC_URB3D !multi-layer UCM
683 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: SF_AC_URB3D !multi-layer UCM
684 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: CM_AC_URB3D !multi-layer UCM
685 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: SFVENT_URB3D !multi-layer UCM
686 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: LFVENT_URB3D !multi-layer UCM
687 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_wd , jms:jme ), INTENT(INOUT) :: SFWIN1_URB3D ! multi-layer UCM
688 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_wd , jms:jme ), INTENT(INOUT) :: SFWIN2_URB3D ! multi-layer UCM
689 REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_ndm, jms:jme ), INTENT(INOUT) :: SFG_URB3D ! multi-layer UCM
690 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zdf, jms:jme ), INTENT(INOUT) :: SFR_URB3D ! multi-layer UCM
691 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zd , jms:jme ), INTENT(INOUT) :: SFW1_URB3D ! multi-layer UCM
692 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zd , jms:jme ), INTENT(INOUT) :: SFW2_URB3D ! multi-layer UCM
693 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: EP_PV_URB3D!GRZ
694 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zdf,jms:jme ), INTENT(INOUT) :: T_PV_URB3D!GRZ
695 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zgrd, jms:jme),INTENT(INOUT) :: TRV_URB4D ! GRZ
696 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zgrd, jms:jme),INTENT(INOUT) :: QR_URB4D ! GRZ
697 REAL, OPTIONAL, DIMENSION( ims:ime,jms:jme), INTENT(INOUT) :: QGR_URB3D ! GRZ
698 REAL, OPTIONAL, DIMENSION( ims:ime,jms:jme), INTENT(INOUT) :: TGR_URB3D ! GRZ
699 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zdf, jms:jme),INTENT(INOUT) :: DRAIN_URB4D !GRZ
700 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: DRAINGR_URB3D !GRZ
701 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zdf, jms:jme),INTENT(INOUT) :: SFRV_URB3D !GRZ
702 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zdf, jms:jme),INTENT(INOUT) :: LFRV_URB3D ! GRZ
703 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zdf, jms:jme ),INTENT(INOUT) :: DGR_URB3D !GRZ
704 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zdf, jms:jme ),INTENT(INOUT) :: DG_URB3D !GRZ
705 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zdf, jms:jme ),INTENT(INOUT) :: LFR_URB3D !GRZ
706 REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_ndm, jms:jme ), INTENT(INOUT) :: LFG_URB3D !GRZ
707 REAL, OPTIONAL, DIMENSION( ims:ime,1:num_urban_hi, jms:jme), INTENT(INOUT) :: HI_URB2D !multi-layer UCM
708 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: LP_URB2D !multi-layer UCM
709 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: LB_URB2D !multi-layer UCM
710 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: HGT_URB2D !multi-layer UCM
711 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: MH_URB2D !SLUCM
712 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: STDH_URB2D !SLUCM
713 REAL, OPTIONAL, DIMENSION( ims:ime, 4, jms:jme ), INTENT(INOUT) :: LF_URB2D !SLUCM
714 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_U_BEP
715 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_V_BEP
716 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_T_BEP
717 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_Q_BEP
718 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_E_BEP
719 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_U_BEP
720 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_V_BEP
721 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_T_BEP
722 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_Q_BEP
723 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_E_BEP
724 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: VL_BEP
725 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: DLG_BEP
726 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme,jms:jme), INTENT(INOUT) :: SF_BEP
727 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: DL_U_BEP
729 INTEGER, OPTIONAL, INTENT(IN) :: CCNTY ! for ntu3m
730 REAL, OPTIONAL, INTENT(IN), DIMENSION(ims:ime,kms:kme,jms:jme) :: PHB,PH,P,PB,QV ! for ntu3m
731 REAL, INTENT(INOUT), DIMENSION(ims:ime,kms:kme,jms:jme) :: QDCN,QTCN,QCCN,QRCN,QNIN ! for ntu3m
734 real, dimension(ims:ime,jms:jme ),intent(out) :: lakedepth2d, &
736 real, dimension(ims:ime,jms:jme ),intent(inout) :: snowdp2d, &
741 real, dimension( ims:ime,1:nlevlake, jms:jme ),INTENT(out) :: t_lake3d, &
745 real, dimension( ims:ime,-nlevsnow+1:nlevsoil, jms:jme ),INTENT(inout) :: t_soisno3d, &
751 real, dimension( ims:ime,1:nlevsoil, jms:jme ),INTENT(out) :: watsat3d, &
756 real, dimension( ims:ime,-nlevsnow+0:nlevsoil, jms:jme ),INTENT(inout) :: zi3d
757 LOGICAL, DIMENSION( ims:ime, jms:jme ),intent(out) :: lake2d
758 ! REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: HT
759 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: lake_depth
760 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: water_depth
761 real, intent(in) :: lakedepth_default, lake_min_elev
763 REAL, dimension(ims:ime,jms:jme ) :: lakemask
764 INTEGER, INTENT(IN) :: lakeflag
766 INTEGER, INTENT(INOUT) :: lake_depth_flag
767 INTEGER, INTENT(IN) :: use_lakedepth
768 INTEGER, INTENT(INOUT) :: bathymetry_flag
769 INTEGER, INTENT(IN) :: shalwater_z0
770 REAL, INTENT(IN) :: shalwater_depth
774 INTEGER, INTENT(IN) :: maxpatch
775 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: HT
776 integer, OPTIONAL, dimension(ims:ime,jms:jme ),intent(inout) :: numc,nump
777 integer, OPTIONAL, dimension(ims:ime,1:maxpatch,jms:jme ),intent(inout) :: snl
778 real, OPTIONAL, dimension(ims:ime,1:maxpatch,jms:jme ),intent(inout) :: &
779 snowdp,wtc,wtp,h2osno,t_grnd,t_veg, &
780 h2ocan,h2ocan_col,t2m_max,t2m_min, &
781 t_ref2m,h2osoi_liq_s1, &
782 h2osoi_liq_s2,h2osoi_liq_s3,h2osoi_liq_s4, &
783 h2osoi_liq_s5,h2osoi_liq1,h2osoi_liq2, &
784 h2osoi_liq3,h2osoi_liq4,h2osoi_liq5,h2osoi_liq6, &
785 h2osoi_liq7,h2osoi_liq8,h2osoi_liq9,h2osoi_liq10, &
786 h2osoi_ice_s1,h2osoi_ice_s2, &
787 h2osoi_ice_s3,h2osoi_ice_s4,h2osoi_ice_s5, &
788 h2osoi_ice1,h2osoi_ice2,h2osoi_ice3,h2osoi_ice4, &
789 h2osoi_ice5,h2osoi_ice6,h2osoi_ice7, &
790 h2osoi_ice8,h2osoi_ice9,h2osoi_ice10, &
791 t_soisno_s1,t_soisno_s2,t_soisno_s3,t_soisno_s4, &
792 t_soisno_s5,t_soisno1,t_soisno2,t_soisno3, &
793 t_soisno4,t_soisno5,t_soisno6,t_soisno7, &
794 t_soisno8,t_soisno9,t_soisno10, &
795 dzsnow1,dzsnow2,dzsnow3,dzsnow4,dzsnow5, &
796 snowrds1,snowrds2,snowrds3,snowrds4,snowrds5, &
797 t_lake1,t_lake2,t_lake3,t_lake4,t_lake5, &
798 t_lake6,t_lake7,t_lake8,t_lake9,t_lake10, &
799 h2osoi_vol1,h2osoi_vol2,h2osoi_vol3, &
800 h2osoi_vol4,h2osoi_vol5,h2osoi_vol6, &
801 h2osoi_vol7,h2osoi_vol8, &
802 h2osoi_vol9,h2osoi_vol10, &
803 ALBEDOsubgrid,LHsubgrid,HFXsubgrid,LWUPsubgrid, &
804 Q2subgrid,SABVsubgrid,SABGsubgrid,NRAsubgrid, &
805 SWUPsubgrid,lhsoi,lhtran,lhveg
806 #if (WRF_USE_CLM == 1) && ( WRF_CHEM == 1 )
807 LOGICAL, INTENT(IN) :: megan_mapped_emisfctrs
808 CHARACTER(LEN=*), INTENT(IN) :: megan_factors_file
809 CHARACTER(LEN=*), INTENT(IN) :: megan_specifier(:)
815 INTEGER, OPTIONAL, INTENT(IN) :: itimestep
817 TYPE(fdob_type), OPTIONAL, INTENT(INOUT) :: fdob
819 REAL, OPTIONAL, INTENT(IN) :: p00, t00, tlp ! for obs-nudging base-state calcn
822 REAL,OPTIONAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , &
823 INTENT(OUT) :: te_temf, cf3d_temf
825 REAL,OPTIONAL, DIMENSION( ims:ime , jms:jme ) , &
826 INTENT(OUT) :: wm_temf
828 REAL, OPTIONAL, DIMENSION( ims:ime , jms:jme ) , &
829 INTENT( OUT) :: pblmax, clddpthb, cldtopb, rainsh, rainshvb, &
830 capesave, radsave, xtime1, PBLHAVG
832 REAL, OPTIONAL, DIMENSION( ims:ime , 1:100, jms:jme ) , &
833 INTENT( OUT) :: ainckfsa
835 INTEGER, OPTIONAL, DIMENSION( ims:ime , jms:jme ) , &
836 INTENT( OUT) :: kdcldtop, kdcldbas, ltopb
838 REAL, OPTIONAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , &
839 INTENT( OUT) :: wub, cldareaa, cldareab, &
840 cldliqa, cldliqb, TKEAVG, &
843 REAL, OPTIONAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: &
844 RDCASHTEN, RQCDCSHTEN
848 REAL :: ALBLND,ZZLND,ZZWTR,THINLD,XMAVA,CEN_LAT,pptop
849 REAL, DIMENSION( kms:kme ) :: sfull, shalf
850 REAL :: obs_twindo_cg, obs_twindo
852 CHARACTER*256 :: MMINLU_loc
853 CHARACTER*80 :: message
857 INTEGER :: sf_urban_physics
858 INTEGER :: sf_ocean_physics
866 INTEGER :: aercu_opt !PSH/TWG
867 REAL :: aercu_fct !PSH/TWG
870 INTEGER :: i, j, k, itf, jtf, ktf, n
873 !-------------------------------------------------
874 ! Noah-mosaic related variables are added to declaration (danli)
875 !-------------------------------------------------
877 INTEGER, INTENT(IN) :: sf_surface_mosaic, NLCAT
878 INTEGER, INTENT(IN) :: mosaic_cat
879 REAL, DIMENSION( ims:ime, NLCAT, jms:jme ) , INTENT(IN) , OPTIONAL:: LANDUSEF
880 REAL, DIMENSION( ims:ime, NLCAT, jms:jme ) , INTENT(INOUT) , OPTIONAL:: LANDUSEF2
881 INTEGER, DIMENSION( ims:ime, NLCAT, jms:jme ), INTENT(INOUT), OPTIONAL :: mosaic_cat_index
883 REAL, DIMENSION( ims:ime, 1:mosaic_cat, jms:jme ) , OPTIONAL, INTENT(INOUT):: &
884 TSK_mosaic, CANWAT_mosaic, SNOW_mosaic,SNOWH_mosaic, SNOWC_mosaic
885 REAL, DIMENSION( ims:ime, 1:mosaic_cat, jms:jme ) , OPTIONAL, INTENT(INOUT):: &
886 ALBEDO_mosaic,ALBBCK_mosaic, EMISS_mosaic, EMBCK_mosaic, ZNT_mosaic, Z0_mosaic
887 REAL, DIMENSION( ims:ime, 1:num_soil_layers*mosaic_cat, jms:jme ), OPTIONAL, INTENT(INOUT):: &
888 TSLB_mosaic,SMOIS_mosaic,SH2O_mosaic
889 REAL, DIMENSION( ims:ime, 1:mosaic_cat, jms:jme ) , OPTIONAL, INTENT(INOUT):: &
890 TR_URB2D_mosaic, TB_URB2D_mosaic, TG_URB2D_mosaic, TC_URB2D_mosaic,QC_URB2D_mosaic, &
891 SH_URB2D_mosaic,LH_URB2D_mosaic,G_URB2D_mosaic,RN_URB2D_mosaic,TS_URB2D_mosaic, TS_RUL2D_mosaic
893 REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers*mosaic_cat, jms:jme ), INTENT(INOUT) :: TRL_URB3D_mosaic
894 REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers*mosaic_cat, jms:jme ), INTENT(INOUT) :: TBL_URB3D_mosaic
895 REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers*mosaic_cat, jms:jme ), INTENT(INOUT) :: TGL_URB3D_mosaic
897 REAL :: max_utype_urb2d
899 !-------------------------------------------------
901 !-------------------------------------------------
904 INTEGER,OPTIONAL,INTENT(OUT), DIMENSION( ims:ime,jms:jme):: irr_rand_field
905 INTEGER, OPTIONAL :: irr_ph,irr_freq
906 !-----------------------------------------------------------------
908 ! Climate GHG file read for radiation
909 REAL(KIND=8) :: co2dum,n2odum,ch4dum,f11dum,f12dum
910 CHARACTER(LEN=8) :: name
911 !-----------------------------------------------------------------
915 ! Compute 2d grid distance and 2d grid cell area. For use with
916 ! physics schemes that have a grid distance (area) as input for
917 ! scale-aware capability.
919 if ( .not. restart) then
920 if ( present(dx2d) .and. present(area2d) ) then
921 call compute_2d_dx_area(dx, dy, msftx, msfty, dx2d, area2d, &
922 ids, ide, jds, jde, kds, kde, &
923 ims, ime, jms, jme, kms, kme, &
924 its, ite, jts, jte, kts, kte)
930 IF ( ( config_flags%ghg_input .EQ. 1 ) .AND. &
931 ( .NOT. this_is_an_ideal_run ) ) THEN
932 IF ( config_flags%ra_lw_physics .EQ. RRTMSCHEME ) THEN
934 ELSE IF ( config_flags%ra_lw_physics .EQ. CAMLWSCHEME ) THEN
936 ELSE IF ( config_flags%ra_lw_physics .EQ. RRTMG_LWSCHEME ) THEN
938 ELSE IF ( config_flags%ra_lw_physics .EQ. RRTMG_LWSCHEME_FAST ) THEN
941 CALL read_CAMgases(julyr,float(julday),.true.,TRIM(name),co2dum,n2odum,ch4dum,f11dum,f12dum)
942 WRITE(message,*) 'GHG annual values from CAM trace gas file'
943 CALL wrf_message(TRIM(message))
944 WRITE(message,*) 'Year = ',julyr,', Julian day = ',julday
945 CALL wrf_message(TRIM(message))
946 WRITE(message,*) 'CO2 = ',co2dum,' volume mixing ratio'
947 CALL wrf_message(TRIM(message))
948 WRITE(message,*) 'N2O = ',n2odum,' volume mixing ratio'
949 CALL wrf_message(TRIM(message))
950 WRITE(message,*) 'CH4 = ',ch4dum,' volume mixing ratio'
951 CALL wrf_message(TRIM(message))
952 WRITE(message,*) 'CFC11 = ',f11dum,' volume mixing ratio'
953 CALL wrf_message(TRIM(message))
954 WRITE(message,*) 'CFC12 = ',f12dum,' volume mixing ratio'
955 CALL wrf_message(TRIM(message))
958 aercu_opt=config_flags%aercu_opt !PSH/TWG 06/10/16
959 aercu_fct=config_flags%aercu_fct !PSH/TWG 06/10/16
960 sf_urban_physics=config_flags%sf_urban_physics
961 usemonalb=config_flags%usemonalb
962 rdmaxalb=config_flags%rdmaxalb
963 LakeModel = config_flags%sf_lake_physics
964 mfshconv=config_flags%mfshconv
965 IF(PRESENT(SMOISEQ)) THEN
966 iopt_run=config_flags%opt_run
971 obs_twindo_cg=model_config_rec%obs_twindo(1)
972 obs_twindo=config_flags%obs_twindo
973 oml_hml0=config_flags%oml_hml0
974 sf_ocean_physics=config_flags%sf_ocean_physics
981 !..Added G. Thompson to determine if we will compute and pass radiative
982 !.. effective radii of cloud water, ice, and snow. Currently ONLY properly
983 !.. connected if using Physics options Thompson-MP and RRTMG-LW/SW.
984 ! 10/2014: T. Mansell added support for NSSL_2MOM options
988 IF ( config_flags%use_mp_re .EQ. 1 ) THEN
989 if (( (config_flags%ra_lw_physics .eq. RRTMG_LWSCHEME ) .or. &
990 #if( BUILD_RRTMG_FAST == 1)
991 (config_flags%ra_lw_physics .eq. RRTMG_LWSCHEME_FAST ) .or. &
993 #if( BUILD_RRTMK == 1)
994 (config_flags%ra_lw_physics .eq. RRTMK_LWSCHEME ) .or. &
996 (config_flags%ra_lw_physics .eq. goddardlwscheme ) ) .and. &
997 ( (config_flags%ra_sw_physics .eq. RRTMG_SWSCHEME ) .or. &
998 #if( BUILD_RRTMG_FAST == 1)
999 (config_flags%ra_sw_physics .eq. RRTMG_SWSCHEME_FAST ) .or. &
1001 #if( BUILD_RRTMK == 1)
1002 (config_flags%ra_sw_physics .eq. RRTMK_SWSCHEME ) .or. &
1004 (config_flags%ra_sw_physics .eq. goddardswscheme ) ) .and. &
1005 (config_flags%mp_physics .eq. THOMPSON .or. &
1006 config_flags%mp_physics .eq. THOMPSONAERO .or. &
1007 (config_flags%mp_physics .eq. NSSL_2MOM .and. config_flags%nssl_2moment_on == 1) .or. &
1008 config_flags%mp_physics .eq. WSM3SCHEME .or. &
1009 config_flags%mp_physics .eq. WSM5SCHEME .or. &
1010 config_flags%mp_physics .eq. WSM6SCHEME .or. &
1011 config_flags%mp_physics .eq. WSM7SCHEME .or. &
1012 config_flags%mp_physics .eq. WDM5SCHEME .or. &
1013 config_flags%mp_physics .eq. WDM6SCHEME .or. &
1014 config_flags%mp_physics .eq. WDM7SCHEME .or. &
1015 config_flags%mp_physics .eq. nuwrf4icescheme .or. &
1016 config_flags%mp_physics .eq. JENSEN_ISHMAEL .or. &
1017 config_flags%mp_physics .eq. P3_1CATEGORY .or. &
1018 config_flags%mp_physics .eq. P3_1CATEGORY_NC .or. &
1019 config_flags%mp_physics .eq. P3_2CATEGORY .or. &
1020 config_flags%mp_physics .eq. P3_1CAT_3MOM ) ) then ! P3
1026 ! for P3, to ensure correct coupling with predicted effective radii
1027 if (config_flags%mp_physics .eq. P3_1CATEGORY .or. &
1028 config_flags%mp_physics .eq. P3_1CATEGORY_NC .or. &
1029 config_flags%mp_physics .eq. JENSEN_ISHMAEL .or. &
1030 config_flags%mp_physics .eq. P3_1CAT_3MOM .or. &
1031 config_flags%mp_physics .eq. P3_2CATEGORY ) then
1035 ! If using FARMS (swint_opt==2), we need both effective radii and the mass
1036 ! for cloud, ice, and snow.
1038 IF ( config_flags%swint_opt .eq. 2 ) THEN
1039 IF (( config_flags%mp_physics == THOMPSON .OR. &
1040 config_flags%mp_physics == THOMPSONAERO .OR. &
1041 config_flags%mp_physics == WSM3SCHEME .OR. &
1042 config_flags%mp_physics == WSM5SCHEME .OR. &
1043 config_flags%mp_physics == WSM6SCHEME .OR. &
1044 config_flags%mp_physics == WSM7SCHEME .OR. &
1045 config_flags%mp_physics == WDM5SCHEME .OR. &
1046 config_flags%mp_physics == WDM6SCHEME .OR. &
1047 config_flags%mp_physics == WDM7SCHEME ).OR. &
1048 (( has_reqc .EQ. 0 .AND. has_reqi .EQ. 0 .and. has_reqs .EQ. 0 ) .AND. &
1052 ! everything is A-OK for FARMS
1054 CALL wrf_error_fatal ('--- ERROR: FARMS (swint_opt==2) requires a different MP scheme (Please see the module_physics_init')
1058 ENDIF ! use_mp_re .EQ. 1
1060 !-- should be from the namelist
1065 CALL wrf_debug(100,'top of phy_init')
1067 WRITE(wrf_err_message,*) 'phy_init: start_of_simulation = ',start_of_simulation
1068 CALL wrf_debug ( 100, TRIM(wrf_err_message) )
1081 if (.not.usemonalb) CALL wrf_error_fatal('usemonalb should always be true for NMM')
1084 CALL nl_get_cen_lat(id,cen_lat)
1085 CALL wrf_debug(100,'calling nl_get_iswater, nl_get_isice, nl_get_mminlu_loc')
1086 CALL nl_get_iswater(id,iswater)
1087 CALL nl_get_isice(id,isice)
1088 CALL nl_get_isurban(id,isurban)
1089 !jm CALL nl_get_mminlu( 1, mminlu_loc )
1090 CALL nl_get_mminlu( id, mminlu_loc )
1091 #if (NMM_CORE == 1 && HWRF == 1 )
1092 IF ( trim(mminlu_loc) .eq. "" ) THEN
1093 CALL wrf_message('WARNING: MMINLU NOT SET, USING USGS')
1097 CALL wrf_debug(100,'after nl_get_iswater, nl_get_isice, nl_get_mminlu_loc')
1098 !-- temporary fix by ww
1099 landuse_ISICE = isice
1101 !..Determine which cu_rad_feedback option to use
1104 IF ( config_flags%cu_rad_feedback ) THEN
1105 IF ( config_flags%cu_physics == kfetascheme ) THEN
1107 ELSE IF ( config_flags%cu_physics == gfscheme .OR. &
1108 config_flags%cu_physics == g3scheme .OR. &
1109 config_flags%cu_physics == gdscheme ) THEN
1114 IF ( config_flags%cu_physics == mskfscheme) THEN
1118 !--------------------INPUT FOR AEROSOL DATA-----------------------
1119 !-----------------------------PSH/TWG-----------------------------
1120 IF ( aercu_opt .GT. 0 .AND. id .EQ. 1 ) THEN
1121 CALL aerosol_in_cu(aeromcu,alevsiz_cu,num_months,no_src_types_cu,XLAT,XLONG,aeropcu,&
1122 ids, ide, jds, jde, kds, kde, &
1123 ims, ime, jms, jme, kms, kme, &
1124 its, ite, jts, jte, kts, kte)
1126 !-----------------------------PSH/TWG-----------------------------
1128 ! Initialize Cumulus Hydrometeors
1129 if (config_flags%aercu_opt == 1 )then
1154 CALL nl_set_icloud_cu ( id , icloud_cu )
1156 IF(.not.restart)THEN !{
1157 !-- initialize common variables
1158 !BSINGH - When all the CAM parameterizations are not executed in WRF,
1159 !rliq can have undefined behaviour
1160 IF (config_flags%cu_physics == CAMZMSCHEME .or. config_flags%shcu_physics == CAMUWSHCUSCHEME ) THEN
1161 IF(PRESENT(rliq)) THEN
1165 IF ( .NOT. moved ) THEN
1168 XLAND(i,j)=float(config_flags%ideal_xland)
1171 !-- initialize ust to a small value
1182 DO k=kms,kme !wig, 17-May-2006: Added for idealized chem. runs
1191 IVGTYP(i,j) = NINT(LU_INDEX(i,j))
1196 IF(PRESENT(TMN_UPDATE))THEN
1197 if(tmn_update.eq.1) then
1206 TLAG(i,n,j)=TMN(i,j)
1217 IF(XLAND(i,j) .LT. 1.5)THEN
1218 IF(mminlu_loc .EQ. ' ') ALBBCK(i,j)=ALBLND
1220 ALBEDO(i,j)=ALBBCK(i,j)
1221 EMISS(i,j)=EMBCK(i,j)
1224 #if ! ( NMM_CORE == 1 )
1229 IF(mminlu_loc .EQ. ' ') ALBBCK(i,j)=0.08
1230 ALBEDO(i,j)=ALBBCK(i,j)
1232 EMISS(i,j)=EMBCK(i,j)
1235 #if ! ( NMM_CORE == 1 )
1244 if (config_flags%cu_diag == 1 )then
1248 gd_cloud(i,k,j) = 0.
1249 gd_cloud2(i,k,j) = 0.
1250 gd_cloud_a(i,k,j) = 0.
1251 gd_cloud2_a(i,k,j) = 0.
1266 !..Fill initial starting values of radiative effective radii for
1267 !.. cloud water (2.49 microns), cloud ice (4.99 microns), and
1268 !.. snow (9.99 microns).
1269 if (has_reqc.ne.0) then
1273 re_cloud(i,k,j) = RE_QC_BG
1278 if (has_reqi.ne.0) then
1282 re_ice(i,k,j) = RE_QI_BG
1287 if (has_reqs.ne.0) then
1291 re_snow(i,k,j) = RE_QS_BG
1297 ! Initialize cloud droplet effective radii for Goddard MP and/or Radiation
1298 #if ( EM_CORE == 1 )
1300 if ( config_flags%ra_lw_physics .EQ. GODDARDLWSCHEME .OR. &
1301 config_flags%ra_sw_physics .EQ. GODDARDSWSCHEME .OR. &
1302 config_flags%mp_physics .EQ. NUWRF4ICESCHEME ) THEN
1306 re_cloud_gsfc(i,k,j) = 0.
1307 re_rain_gsfc(i,k,j) = 0.
1308 re_snow_gsfc(i,k,j) = 0.
1309 re_ice_gsfc(i,k,j) = 0.
1310 re_graupel_gsfc(i,k,j) = 0.
1311 re_hail_gsfc(i,k,j) = 0.
1318 ! Initializing special output from myjsfc and qnsesfc
1320 if ( config_flags%sf_sfclay_physics .EQ. MYJSFCSCHEME .OR. &
1321 config_flags%sf_sfclay_physics .EQ. QNSESFCSCHEME ) THEN
1324 u10e(i,j) = u10(i,j)
1325 v10e(i,j) = v10(i,j)
1330 CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to landuse_init' )
1332 IF(mminlu_loc .ne. ' ')THEN
1333 !-- initialize surface properties
1335 CALL landuse_init(lu_index, snowc, albedo, albbck, snoalb, mavail, emiss, embck, &
1336 znt, Z0, thc, xland, xice, xicem, julday, cen_lat, iswater, &
1337 TRIM ( mminlu_loc ) , &
1338 landuse_ISICE, landuse_LUCATS, &
1339 landuse_LUSEAS, landuse_ISN, &
1340 config_flags%fractional_seaice, &
1342 allowed_to_read , usemonalb , &
1343 ids, ide, jds, jde, kds, kde, &
1344 ims, ime, jms, jme, kms, kme, &
1345 its, ite, jts, jte, kts, kte )
1350 !-- convert zfull and zhalf to sigma values for ra_init (Eta CO2 needs these)
1351 !-- zfull/zhalf may be either zeta or eta
1352 !-- what is done here depends on coordinate (check this code if adding new coordinates)
1353 CALL z2sigma(zfull,zhalf,sfull,shalf,p_top,pptop,config_flags, &
1355 kds,kde,kms,kme,kts,kte)
1357 ! CAM parameterizations specific initializations [Currently incorporates initializations for CAMZM, CAMUWPBL, CAMUWSHCU and CAMMGMP parameterizations]
1359 !Findout whether CAMMGMP scheme is used used or not in this simulation
1360 is_CAMMGMP_used = .FALSE.
1362 if(config_flags%mp_physics == CAMMGMPSCHEME) is_CAMMGMP_used = .TRUE.
1365 #if ( WRF_CHEM == 1 )
1366 !BSINGH:02/01/2013 - For WRF_CHEM simulations, initialize cam_mam_aerosols variable
1367 cam_mam_aerosols = .FALSE.
1368 if(config_flags%chem_opt == CBMZ_CAM_MAM3_NOAQ .OR. config_flags%chem_opt == CBMZ_CAM_MAM3_AQ &
1369 .OR. config_flags%chem_opt == CBMZ_CAM_MAM7_NOAQ .OR. config_flags%chem_opt == CBMZ_CAM_MAM7_AQ) cam_mam_aerosols = .TRUE.
1374 if( config_flags%bl_pbl_physics == CAMUWPBLSCHEME .OR. config_flags%cu_physics == CAMZMSCHEME &
1375 .OR. config_flags%shcu_physics == CAMUWSHCUSCHEME &
1377 .OR. config_flags%mp_physics == CAMMGMPSCHEME &
1379 #if ( WRF_CHEM == 1 )
1380 !For WRF_CHEM simulations, first five constituents are added in CAM_INIT and rest are added in the MODULE_CAM_MAM_INIT in chem/
1381 .OR. config_flags%chem_opt == CBMZ_CAM_MAM3_NOAQ .OR. config_flags%chem_opt == CBMZ_CAM_MAM3_AQ &
1382 .OR. config_flags%chem_opt == CBMZ_CAM_MAM7_NOAQ .OR. config_flags%chem_opt == CBMZ_CAM_MAM7_AQ &
1385 CALL CAM_INIT(ixcldliq, ixcldice, ixnumliq, ixnumice, config_flags)
1387 !-- initialize physics
1391 !-- mp: microphysics
1394 ! .... paj ... initialize wind farm ...
1396 IF ( config_flags%windfarm_opt .EQ. 1 ) THEN
1397 CALL init_module_wind_fitch(id,config_flags,xlong,xlat,windfarm_initialized,ims,ime,jms,jme,its,ite,jts,jte,ids,ide,jds,jde)
1399 ELSEIF ( config_flags%windfarm_opt .EQ. 2 ) THEN
1400 CALL init_module_wind_mav(id,config_flags,xlong,xlat,windfarm_initialized, &
1401 dx,ims,ime,jms,jme,its,ite,jts,jte,ids,ide,jds,jde)
1404 CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to ra_init' )
1406 CALL ra_init(id=id,STEPRA=STEPRA,RADT=RADT,DT=DT,RTHRATEN=RTHRATEN,RTHRATENLW=RTHRATENLW, &
1407 RTHRATENSW=RTHRATENSW,CLDFRA=CLDFRA,EMISS=EMISS,cen_lat=cen_lat,JULYR=JULYR,JULDAY=JULDAY,GMT=GMT, &
1408 levsiz=levsiz,XLAT=XLAT,XLONG=XLONG,n_ozmixm=n_ozmixm, &
1409 alevsiz=alevsiz,no_src_types=no_src_types, &
1410 cldfra_dp=cldfra_dp,cldfra_sh=cldfra_sh, & ! optional for subgrid cloud by ckay
1411 cldfra_old=cldfra_old, & ! Optional
1412 ozmixm=ozmixm,pin=pin, & ! Optional
1413 aerodm=aerodm,pina=pina, & ! Optional
1414 m_ps_1=m_ps_1,m_ps_2=m_ps_2,m_hybi=m_hybi,aerosolc_1=aerosolc_1,aerosolc_2=aerosolc_2, & ! Optional
1415 paerlev=paerlev,n_aerosolc=n_aerosolc, &
1416 sfull=sfull,shalf=shalf,pptop=pptop,swrad_scat=swrad_scat,p_top=p_top, &
1417 config_flags=config_flags,restart=restart, &
1418 allowed_to_read=allowed_to_read, start_of_simulation=start_of_simulation, &
1419 ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, &
1420 ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, &
1421 its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte )
1423 CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to bl_init' )
1424 CALL bl_init(STEPBL,BLDT,DT,RUBLTEN,RVBLTEN,RTHBLTEN, &
1425 RQVBLTEN,RQCBLTEN,RQIBLTEN,TSK,TMN, &
1426 config_flags,restart,UST,LOWLYR,TSLB,ZS,DZS, &
1427 num_soil_layers,TKE_PBL,mfshconv,pek,pep, &
1428 massflux_EDKF, entr_EDKF, detr_EDKF, &
1429 thl_up, thv_up, rt_up, &
1430 rv_up, rc_up, u_up, v_up, &
1431 frac_up, itimestep,id, &
1433 SNOW,SNOWC, CANWAT,SMSTAV, &
1434 SMSTOT, SFCRUNOFF,UDRUNOFF,ACSNOW,ACSNOM, &
1435 IVGTYP,ISLTYP,ISURBAN,SMOIS,SMFR3D,MAVAIL, &
1436 SNOWH,SH2O,SNOALB,FNDSOILW,FNDSNOWH,RDMAXALB, &
1442 DX, DY, MSFTX, MSFTY, &
1446 TRIM (MMINLU_LOC), &
1448 ISNOWXY, ZSNSOXY, TSNOXY, &
1449 SNICEXY, SNLIQXY, TVXY, TGXY, CANICEXY, &
1450 CANLIQXY, EAHXY, TAHXY, CMXY, &
1451 CHXY, FWETXY, SNEQVOXY,ALBOLDXY,QSNOWXY,QRAINXY,&
1452 WSLAKEXY, ZWTXY, WAXY, WTXY, LFMASSXY, RTMASSXY,&
1453 STMASSXY, WOODXY, STBLCPXY, FASTCPXY, &
1454 GRAINXY, GDDXY, & ! Noah-MP Crop model
1455 croptype, cropcat, & ! Noah-MP Crop model
1457 iopt_irr, iopt_irrm, &
1458 IRNUMSI, IRNUMMI, IRNUMFI, IRWATSI, IRWATMI, & ! Noah-MP Irrigation
1459 IRWATFI, IRELOSS, IRSIVOL, IRMIVOL, IRFIVOL, & ! Noah-MP Irrigation
1460 IRRSPLH, qtdrain, & ! Noah-MP Irrigation
1461 gecros_state, & ! Optional gecros crop
1463 SMOISEQ, SMCWTDXY, RECHXY, DEEPRECHXY, AREAXY, &
1464 WTDDT, STEPWTD, QRFSXY ,QSPRINGSXY ,QSLATXY, &
1465 FDEPTHXY, RIVERBEDXY, EQZWT, RIVERCONDXY, PEXPXY, &
1468 T2MVXY,T2MBXY,CHSTARXY , &
1469 allowed_to_read , iopt_run , &
1470 start_of_simulation , &
1471 lakedepth2d, savedtke12d, snowdp2d, h2osno2d, & !lake
1472 snl2d, t_grnd2d, t_lake3d, lake_icefrac3d, & !lake
1473 z_lake3d, dz_lake3d, t_soisno3d, h2osoi_ice3d, & !lake
1474 h2osoi_liq3d, h2osoi_vol3d, z3d, dz3d, & !lake
1475 zi3d, watsat3d, csol3d, tkmg3d, & !lake
1476 tkdry3d, tksatu3d, LakeModel, lake2d, & !lake
1477 lakedepth_default, lake_min_elev, lake_depth, & !lake
1479 lakemask, lakeflag, & !lake
1481 lake_depth_flag, use_lakedepth, & !lake
1482 water_depth, bathymetry_flag, shalwater_z0, &
1484 te_temf,cf3d_temf,wm_temf, & ! WA
1485 DZR, DZB, DZG, & !Optional urban
1486 TR_URB2D,TB_URB2D,TG_URB2D,TC_URB2D,QC_URB2D, & !Optional urban
1487 XXXR_URB2D,XXXB_URB2D,XXXG_URB2D,XXXC_URB2D, & !Optional urban
1488 TRL_URB3D, TBL_URB3D, TGL_URB3D, & !Optional urban
1489 SH_URB2D, LH_URB2D, G_URB2D, RN_URB2D, & !Optional urban
1490 TS_URB2D, FRC_URB2D, UTYPE_URB2D, &
1491 SF_URBAN_PHYSICS, & !Optional urban
1492 CMCR_URB2D,TGR_URB2D,TGRL_URB3D,SMR_URB3D, & !Optional urban
1493 DRELR_URB2D,DRELB_URB2D,DRELG_URB2D, & !Optional urban
1494 FLXHUMR_URB2D,FLXHUMB_URB2D,FLXHUMG_URB2D, & !Optional urban
1495 num_urban_ndm, & !Optional multi-layer urban
1496 urban_map_zrd, & !Optional multi-layer urban
1497 urban_map_zwd, & !Optional multi-layer urban
1498 urban_map_gd , & !Optional multi-layer urban
1499 urban_map_zd , & !Optional multi-layer urban
1500 urban_map_zdf, & !Optional multi-layer urban
1501 urban_map_bd , & !Optional multi-layer urban
1502 urban_map_wd , & !Optional multi-layer urban
1503 urban_map_gbd, & !Optional multi-layer urban
1504 urban_map_fbd, & !Optional multi-layer urban
1505 urban_map_zgrd, & !Optional multi-layer urban
1506 NUM_URBAN_HI, & !Optional multi-layer urban
1507 TRB_URB4D,TW1_URB4D,TW2_URB4D, & !Optional multi-layer urban
1508 TGB_URB4D,TLEV_URB3D,QLEV_URB3D, & !Optional multi-layer urban
1509 TW1LEV_URB3D,TW2LEV_URB3D, & !Optional multi-layer urban
1510 TGLEV_URB3D,TFLEV_URB3D, & !Optional multi-layer urban
1511 SF_AC_URB3D,LF_AC_URB3D,CM_AC_URB3D, & !Optional multi-layer urban
1512 SFVENT_URB3D,LFVENT_URB3D, & !Optional multi-layer urban
1513 SFWIN1_URB3D,SFWIN2_URB3D, & !Optional multi-layer urban
1514 SFW1_URB3D,SFW2_URB3D, & !Optional multi-layer urban
1515 SFR_URB3D,SFG_URB3D, & !Optional multi-layer urban
1516 EP_PV_URB3D,T_PV_URB3D, & !GRZ
1517 TRV_URB4D,QR_URB4D,QGR_URB3D,TGR_URB3D, & !GRZ
1518 DRAIN_URB4D,DRAINGR_URB3D,SFRV_URB3D, & !GRZ
1519 LFRV_URB3D,DGR_URB3D,DG_URB3D,LFR_URB3D,LFG_URB3D,&!GRZ
1520 LP_URB2D,HI_URB2D,LB_URB2D, & !Optional multi-layer urban
1521 HGT_URB2D,MH_URB2D,STDH_URB2D, & !Optional multi-layer urban
1522 LF_URB2D, & !Optional multi-layer urban
1523 A_U_BEP,A_V_BEP,A_T_BEP,A_Q_BEP, & !Optional multi-layer urban
1524 A_E_BEP,B_U_BEP,B_V_BEP, & !Optional multi-layer urban
1525 B_T_BEP,B_Q_BEP,B_E_BEP,DLG_BEP, & !Optional multi-layer urban
1526 DL_U_BEP,SF_BEP,VL_BEP, & !Optional multi-layer urban
1527 ids, ide, jds, jde, kds, kde, &
1528 ims, ime, jms, jme, kms, kme, &
1529 its, ite, jts, jte, kts, kte, &
1530 ACHFX,ACLHF,ACGRDFLX, &
1531 oml_hml0, sf_ocean_physics, & !Optional oml
1532 TML,T0ML,HML,H0ML,HUML,HVML,TMOML, & !Optional oml
1534 ,TSK_SAVE & !Optional fractional seaice
1537 snowdp,wtc,wtp,h2osno,t_grnd,t_veg, &
1538 h2ocan,h2ocan_col,t2m_max,t2m_min,t_ref2m, &
1540 h2osoi_liq_s2,h2osoi_liq_s3,h2osoi_liq_s4, &
1541 h2osoi_liq_s5,h2osoi_liq1,h2osoi_liq2, &
1542 h2osoi_liq3,h2osoi_liq4,h2osoi_liq5,h2osoi_liq6, &
1543 h2osoi_liq7,h2osoi_liq8,h2osoi_liq9,h2osoi_liq10, &
1544 h2osoi_ice_s1,h2osoi_ice_s2, &
1545 h2osoi_ice_s3,h2osoi_ice_s4,h2osoi_ice_s5, &
1546 h2osoi_ice1,h2osoi_ice2,h2osoi_ice3,h2osoi_ice4, &
1547 h2osoi_ice5,h2osoi_ice6,h2osoi_ice7, &
1548 h2osoi_ice8,h2osoi_ice9,h2osoi_ice10, &
1549 t_soisno_s1,t_soisno_s2,t_soisno_s3,t_soisno_s4, &
1550 t_soisno_s5,t_soisno1,t_soisno2,t_soisno3, &
1551 t_soisno4,t_soisno5,t_soisno6,t_soisno7, &
1552 t_soisno8,t_soisno9,t_soisno10, &
1553 dzsnow1,dzsnow2,dzsnow3,dzsnow4,dzsnow5, &
1554 snowrds1,snowrds2,snowrds3,snowrds4,snowrds5, &
1555 t_lake1,t_lake2,t_lake3,t_lake4,t_lake5, &
1556 t_lake6,t_lake7,t_lake8,t_lake9,t_lake10, &
1557 h2osoi_vol1,h2osoi_vol2,h2osoi_vol3, &
1558 h2osoi_vol4,h2osoi_vol5,h2osoi_vol6, &
1559 h2osoi_vol7,h2osoi_vol8, &
1560 h2osoi_vol9,h2osoi_vol10, &
1562 ALBEDOsubgrid,LHsubgrid,HFXsubgrid,LWUPsubgrid, &
1563 Q2subgrid,SABVsubgrid,SABGsubgrid,NRAsubgrid, &
1564 SWUPsubgrid,lhsoi,lhveg,lhtran &
1565 #if (WRF_USE_CLM == 1) && ( WRF_CHEM == 1)
1566 ,megan_specifier, megan_factors_file &
1567 ,megan_mapped_emisfctrs &
1569 ! end of CLM vraiables
1570 ,landusef,landusef2,NLCAT & ! danli mosaic
1571 ,sf_surface_mosaic, mosaic_cat & ! danli mosaic
1572 ,mosaic_cat_index & ! danli mosaic
1573 ,TSK_mosaic,TSLB_mosaic & ! danli mosaic
1574 ,SMOIS_mosaic,SH2O_mosaic & ! danli mosaic
1575 ,CANWAT_mosaic,SNOW_mosaic & ! danli mosaic
1576 ,SNOWH_mosaic,SNOWC_mosaic & ! danli mosaic
1577 ,ALBEDO,ALBBCK, EMISS, EMBCK & ! danli mosaic
1578 ,ALBEDO_mosaic,ALBBCK_mosaic, EMISS_mosaic, EMBCK_mosaic, ZNT_mosaic, Z0_mosaic & ! danli mosaic
1579 ,TR_URB2D_mosaic,TB_URB2D_mosaic & !danli mosaic
1580 ,TG_URB2D_mosaic,TC_URB2D_mosaic & !danli mosaic
1581 ,QC_URB2D_mosaic & !danli mosaic
1582 ,TRL_URB3D_mosaic,TBL_URB3D_mosaic & !danli mosaic
1583 ,TGL_URB3D_mosaic & !danli mosaic
1584 ,SH_URB2D_mosaic,LH_URB2D_mosaic & !danli mosaic
1585 ,G_URB2D_mosaic,RN_URB2D_mosaic & !danli mosaic
1586 ,TS_URB2D_mosaic & !danli mosaic
1587 ,TS_RUL2D_mosaic & !danli mosaic
1588 ,irr_rand_field,irr_ph,irr_freq &
1591 CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to cu_init' )
1593 CALL cu_init(DX,STEPCU,CUDT,DT,RUCUTEN,RVCUTEN,RTHCUTEN, &
1594 RQVCUTEN,RQRCUTEN,RQCCUTEN,RQSCUTEN,RQICUTEN, &
1595 NCA,RAINC,RAINCV,W0AVG,config_flags,restart, &
1597 MASS_FLUX,RTHFTEN,RQVFTEN, &
1598 #if ( EM_CORE == 1 )
1599 !BSINGH - For WRFCuP Scheme
1600 cupflag,cldfra_cup,cldfratend_cup, & !CuP, wig 18-Sep-2006
1601 shall, & !CuP, wig 18-Sep-2006
1602 tcloud_cup, & !CuP, rce 18-apr-2012
1605 APR_GR,APR_W,APR_MC,APR_ST,APR_AS, &
1606 APR_CAPMA,APR_CAPME,APR_CAPMI, &
1607 cugd_tten,cugd_ttens,cugd_qvten, &
1608 cugd_qvtens,cugd_qcten, &
1609 allowed_to_read, start_of_simulation, &
1610 ids, ide, jds, jde, kds, kde, &
1611 ims, ime, jms, jme, kms, kme, &
1612 its, ite, jts, jte, kts, kte, &
1613 RQCNCUTEN,RQINCUTEN)
1615 CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to shcu_init' )
1617 CALL shcu_init(STEPCU,CUDT,DT,RUSHTEN,RVSHTEN,RTHSHTEN, &
1618 RQVSHTEN,RQRSHTEN,RQCSHTEN, &
1619 RQSSHTEN,RQISHTEN,RQGSHTEN, &
1620 NCA,RAINC,RAINCV,config_flags,restart, &
1621 allowed_to_read, start_of_simulation, &
1622 RDCASHTEN, RQCDCSHTEN, W0AVG &
1623 ,cldareaa, cldareab, cldliqa, cldliqb &
1625 ,pblmax, wub, ltopb, clddpthb, cldtopb &
1626 ,capesave, ainckfsa, radsave &
1627 ,rainsh, rainshvb, kdcldtop, kdcldbas &
1628 ,xtime1, PBLHAVG, TKEAVG, &
1629 ids, ide, jds, jde, kds, kde, &
1630 ims, ime, jms, jme, kms, kme, &
1631 its, ite, jts, jte, kts, kte )
1633 CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to mp_init' )
1635 CALL mp_init(RAINNC,SNOWNC,GRAUPELNC,config_flags,restart,warm_rain, &
1637 MPDT, DT, DX, DY, LOWLYR, &
1638 F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, &
1639 #if ( EM_CORE == 1 )
1640 PHB,PH,P,PB,QV,XLAND,CCNTY,QDCN,QTCN,QCCN,QRCN, & ! for ntu3m
1643 mp_restart_state,tbpvs_state,tbpvs0_state, &
1644 allowed_to_read, start_of_simulation, &
1645 !CAMMGMP specific variables
1646 ixcldliq, ixcldice, ixnumliq, ixnumice, &
1648 z_at_q, inv_dens, qnwfa2d, qnbca2d, & ! G. Thompson
1649 frc_urb2d, scalar, num_sc, & ! G. Thompson
1650 ids, ide, jds, jde, kds, kde, &
1651 ims, ime, jms, jme, kms, kme, &
1652 its, ite, jts, jte, kts, kte )
1654 #if ( EM_CORE == 1 )
1655 CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to fg_init' )
1657 CALL fg_init(STEPFG,FGDT,DT,id,RUNDGDTEN,RVNDGDTEN, &
1658 RTHNDGDTEN,RPHNDGDTEN,RQVNDGDTEN,RMUNDGDTEN, &
1659 SDA_HFX, SDA_QFX, QNORM, HFX_BOTH, QFX_BOTH, & ! fasdas
1660 HFX_FDDA, & ! fasdas
1661 config_flags,restart, &
1663 ids, ide, jds, jde, kds, kde, &
1664 ims, ime, jms, jme, kms, kme, &
1665 its, ite, jts, jte, kts, kte )
1667 CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to fdob_init' )
1669 CALL fdob_init(model_config_rec%obs_nudge_opt, &
1670 model_config_rec%max_dom, &
1672 model_config_rec%parent_id, &
1673 model_config_rec%obs_idynin, &
1674 model_config_rec%obs_dtramp, &
1675 model_config_rec%fdda_end, &
1676 model_config_rec%restart, &
1677 obs_twindo_cg, obs_twindo, &
1679 model_config_rec%obs_no_pbl_nudge_uv, &
1680 model_config_rec%obs_no_pbl_nudge_t, &
1681 model_config_rec%obs_no_pbl_nudge_q, &
1682 model_config_rec%obs_sfc_scheme_horiz, &
1683 model_config_rec%obs_sfc_scheme_vert, &
1684 model_config_rec%obs_max_sndng_gap, &
1685 model_config_rec%obs_sfcfact, &
1686 model_config_rec%obs_sfcfacr, &
1687 model_config_rec%obs_dpsmx, &
1688 model_config_rec%obs_nudge_wind, &
1689 model_config_rec%obs_nudge_temp, &
1690 model_config_rec%obs_nudge_mois, &
1691 model_config_rec%obs_nudgezfullr1_uv, &
1692 model_config_rec%obs_nudgezrampr1_uv, &
1693 model_config_rec%obs_nudgezfullr2_uv, &
1694 model_config_rec%obs_nudgezrampr2_uv, &
1695 model_config_rec%obs_nudgezfullr4_uv, &
1696 model_config_rec%obs_nudgezrampr4_uv, &
1697 model_config_rec%obs_nudgezfullr1_t, &
1698 model_config_rec%obs_nudgezrampr1_t, &
1699 model_config_rec%obs_nudgezfullr2_t, &
1700 model_config_rec%obs_nudgezrampr2_t, &
1701 model_config_rec%obs_nudgezfullr4_t, &
1702 model_config_rec%obs_nudgezrampr4_t, &
1703 model_config_rec%obs_nudgezfullr1_q, &
1704 model_config_rec%obs_nudgezrampr1_q, &
1705 model_config_rec%obs_nudgezfullr2_q, &
1706 model_config_rec%obs_nudgezrampr2_q, &
1707 model_config_rec%obs_nudgezfullr4_q, &
1708 model_config_rec%obs_nudgezrampr4_q, &
1709 model_config_rec%obs_nudgezfullmin, &
1710 model_config_rec%obs_nudgezrampmin, &
1711 model_config_rec%obs_nudgezmax, &
1714 model_config_rec%start_year(id), &
1715 model_config_rec%start_month(id), &
1716 model_config_rec%start_day(id), &
1717 model_config_rec%start_hour(id), &
1718 model_config_rec%start_minute(id), &
1719 model_config_rec%start_second(id), &
1723 model_config_rec%obs_ipf_init, &
1724 ids, ide, jds, jde, kds, kde, &
1725 ims, ime, jms, jme, kms, kme, &
1726 its, ite, jts, jte, kts, kte )
1729 #if ( WRF_CHEM == 1)
1730 if ((config_flags%chem_opt == gocart_simple .or. &
1731 config_flags%chem_opt == gocartracm_kpp .or. &
1732 config_flags%chem_opt == 302 .or. &
1733 config_flags%chem_opt == gocartradm2) .and. &
1734 config_flags%gsfcgce_gocart_coupling == 1) then
1735 CALL wrf_debug(200 , 'phy_init: Before call to makelut_ccn_icn')
1736 call makelut_ccn_icn
1740 END SUBROUTINE phy_init
1742 !=====================================================================
1743 SUBROUTINE landuse_init(lu_index, snowc, albedo, albbck, snoalb, mavail, emiss, embck, &
1744 znt,Z0,thc,xland, xice, xicem, julday, cen_lat, iswater, mminlu, &
1745 ISICE, LUCATS, LUSEAS, ISN, &
1746 fractional_seaice, &
1748 allowed_to_read , usemonalb , &
1749 ids, ide, jds, jde, kds, kde, &
1750 ims, ime, jms, jme, kms, kme, &
1751 its, ite, jts, jte, kts, kte )
1753 USE module_wrf_error
1756 !---------------------------------------------------------------------
1757 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
1758 ims, ime, jms, jme, kms, kme, &
1759 its, ite, jts, jte, kts, kte
1761 INTEGER , INTENT(IN) :: iswater, julday
1762 REAL , INTENT(IN) :: cen_lat
1763 CHARACTER(LEN=*), INTENT(IN) :: mminlu
1764 LOGICAL, INTENT(IN) :: allowed_to_read , usemonalb
1765 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(IN ) :: lu_index, snowc, xice, snoalb
1766 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(OUT ) :: albedo, albbck, mavail, emiss, &
1768 znt, Z0, thc, xland, xicem
1769 INTEGER , INTENT(INOUT) :: ISICE, LUCATS, LUSEAS, ISN, fractional_seaice
1770 REAL , INTENT(INOUT) , DIMENSION( : ) :: lu_state
1772 REAL :: xice_threshold
1773 !---------------------------------------------------------------------
1775 ! Input Variable Description:
1776 ! ALBD: Surface albedo
1777 ! SLMO: Moisture availability
1779 ! SFZ0: Roughness length
1780 ! THERIN: Thermal inertia (only used in SLAB)
1781 ! SFHC: Soil heat capacity (not used)
1782 ! SCFX: Snow cover effect (dependent on SNOWC)
1785 CHARACTER*256 LUTYPE
1786 CHARACTER*512 :: message
1787 INTEGER :: landuse_unit, LS, LC, LI, LUN, NSN
1788 INTEGER :: i, j, itf, jtf, is, cats, seas, curs
1789 INTEGER , PARAMETER :: OPEN_OK = 0
1791 INTEGER , PARAMETER :: max_cats = 100 , max_seas = 12
1792 REAL , DIMENSION( max_cats, max_seas ) :: ALBD, SLMO, SFEM, SFZ0, THERIN, SFHC
1793 REAL , DIMENSION( max_cats ) :: SCFX
1794 ! save these fields in case nest moves or has to be reinitialized
1795 ! and this routine is called with allowed_to_read set to false
1796 ! note that by saving these, we're locking in the same landuse for
1797 ! the duration of a run; possible implications for long climate runs
1798 LOGICAL :: found_lu, end_of_file
1799 LOGICAL, EXTERNAL :: wrf_dm_on_monitor
1801 !---------------------------------------------------------------------
1803 CALL wrf_debug( 100 , 'top of landuse_init' )
1805 NSN=-1 ! set this to suppress uninitalized data messages from tools
1807 if ( fractional_seaice == 0 ) then
1808 xice_threshold = 0.5
1809 else if ( fractional_seaice == 1 ) then
1810 xice_threshold = 0.02
1813 ! recover LU variables from state
1814 IF ( 6*(max_cats*max_seas)+1*max_cats .GT. 7501 ) THEN
1815 WRITE(message,*)'landuse_init: lu_state overflow. Make Registry dimspec p > ',6*(max_cats*max_seas)+1*max_cats
1818 DO cats = 1, max_cats
1819 SCFX(cats) = lu_state(curs) ; curs = curs + 1
1820 DO seas = 1, max_seas
1821 ALBD(cats,seas) = lu_state(curs) ; curs = curs + 1
1822 SLMO(cats,seas) = lu_state(curs) ; curs = curs + 1
1823 SFEM(cats,seas) = lu_state(curs) ; curs = curs + 1
1824 SFZ0(cats,seas) = lu_state(curs) ; curs = curs + 1
1825 SFHC(cats,seas) = lu_state(curs) ; curs = curs + 1
1826 THERIN(cats,seas) = lu_state(curs) ; curs = curs + 1
1830 ! Determine season (summer=1, winter=2)
1832 IF(JULDAY.LT.105.OR.JULDAY.GT.288)ISN=2
1833 IF(CEN_LAT.LT.0.0)ISN=3-ISN
1836 IF ( allowed_to_read ) THEN
1838 IF ( wrf_dm_on_monitor() ) THEN
1839 OPEN(landuse_unit, FILE='LANDUSE.TBL',FORM='FORMATTED',STATUS='OLD',IOSTAT=ierr)
1840 IF ( ierr .NE. OPEN_OK ) THEN
1841 WRITE(message,FMT='(A)') &
1842 'module_physics_init.F: LANDUSE_INIT: open failure for LANDUSE.TBL'
1843 CALL wrf_error_fatal ( message )
1845 REWIND(landuse_unit)
1848 ! Read info from file LANDUSE.TBL
1849 ! IF(MMINLU.EQ.'OLD ')THEN
1852 ! ELSE IF(MMINLU.EQ.'USGS')THEN
1855 ! ELSE IF(MMINLU.EQ.'SiB ')THEN
1858 ! ELSE IF(MMINLU.EQ.'LW12')THEN
1861 ! ELSE IF (MMINLU .EQ. 'MODIFIED_IGBP_MODIS_NOAH') THEN
1864 ! call wrf_error_fatal ("INPUT LandUse not found: "//TRIM(MMINLU))
1866 call wrf_message ( 'INPUT LandUse = "' // TRIM(MMINLU) // '"' )
1868 end_of_file = .FALSE.
1869 !!! BEGINNING OF 1999 LOOP
1871 IF ( wrf_dm_on_monitor() ) THEN
1872 READ (landuse_unit,*,END=2002)LUTYPE
1875 CALL wrf_message( 'INPUT FILE FOR LANDUSE REACHED END OF FILE' )
1876 end_of_file = .TRUE.
1878 IF ( .NOT. end_of_file ) READ (landuse_unit,*)LUCATS,LUSEAS
1879 FOUND_LU = LUTYPE.EQ.MMINLU
1881 CALL wrf_dm_bcast_bytes (end_of_file, LWORDSIZE )
1882 IF ( .NOT. end_of_file ) THEN
1883 CALL wrf_dm_bcast_string(lutype, 256)
1884 CALL wrf_dm_bcast_bytes (lucats, IWORDSIZE )
1885 CALL wrf_dm_bcast_bytes (luseas, IWORDSIZE )
1886 CALL wrf_dm_bcast_bytes (found_lu, LWORDSIZE )
1890 IF(LUTYPE.NE.'SSIB') THEN !this is not really true for ssib lsm (fds)
1891 write(message,*) 'LANDUSE TYPE = "' // TRIM (LUTYPE) // '" FOUND', &
1892 LUCATS,' CATEGORIES',LUSEAS,' SEASONS', &
1893 ' WATER CATEGORY = ',ISWATER, &
1894 ' SNOW CATEGORY = ',ISICE
1895 call wrf_message(message)
1899 if ( wrf_dm_on_monitor() ) then
1900 READ (landuse_unit,*)
1904 IF ( wrf_dm_on_monitor() ) THEN
1905 READ (landuse_unit,*)LI,ALBD(LC,LS),SLMO(LC,LS),SFEM(LC,LS), &
1906 SFZ0(LC,LS),THERIN(LC,LS),SCFX(LC),SFHC(LC,LS)
1908 CALL wrf_dm_bcast_bytes (LI, IWORDSIZE )
1909 IF(LC.NE.LI)CALL wrf_error_fatal ( 'module_start: MISSING LANDUSE UNIT ' )
1911 IF ( wrf_dm_on_monitor() ) THEN
1912 READ (landuse_unit,*)
1917 IF(NSN.EQ.1.AND.FOUND_LU) THEN
1920 CALL wrf_dm_bcast_bytes (albd, max_cats * max_seas * RWORDSIZE )
1921 CALL wrf_dm_bcast_bytes (slmo, max_cats * max_seas * RWORDSIZE )
1922 CALL wrf_dm_bcast_bytes (sfem, max_cats * max_seas * RWORDSIZE )
1923 CALL wrf_dm_bcast_bytes (sfz0, max_cats * max_seas * RWORDSIZE )
1924 CALL wrf_dm_bcast_bytes (therin, max_cats * max_seas * RWORDSIZE )
1925 CALL wrf_dm_bcast_bytes (sfhc, max_cats * max_seas * RWORDSIZE )
1926 CALL wrf_dm_bcast_bytes (scfx, max_cats * RWORDSIZE )
1929 IF(.NOT. found_lu .AND. .NOT. end_of_file ) GOTO 1999
1930 !!! END OF 1999 LOOP
1932 IF(.NOT. found_lu .OR. end_of_file )THEN
1933 CALL wrf_message ( 'LANDUSE IN INPUT FILE DOES NOT MATCH LUTABLE: TABLE NOT USED' )
1935 ENDIF ! allowed_to_read
1938 ! Set arrays according to lu_index
1939 itf = min0(ite, ide-1)
1940 jtf = min0(jte, jde-1)
1941 IF(usemonalb)CALL wrf_message ( 'Climatological albedo is used instead of table values' )
1944 IS=nint(lu_index(i,j))
1945 ! only do this check on read-in data
1946 IF(allowed_to_read)THEN
1947 IF(IS.LT.0.OR.IS.GT.LUN)THEN
1948 WRITE ( wrf_err_message , * ) 'ERROR: LANDUSE OUTSIDE RANGE =',IS,' AT ',I,J,' LUN= ',LUN
1949 CALL wrf_error_fatal ( TRIM ( wrf_err_message ) )
1952 ! SET NO-DATA POINTS (IS=0) TO WATER
1956 IF(.NOT.usemonalb)ALBBCK(I,J)=ALBD(IS,ISN)/100.
1957 ALBEDO(I,J)=ALBBCK(I,J)
1958 IF(SNOWC(I,J) .GT. 0.5) THEN
1960 ALBEDO(I,J)=SNOALB(I,J)
1962 ALBEDO(I,J)=ALBBCK(I,J)*(1.+SCFX(IS))
1965 THC(I,J)=THERIN(IS,ISN)/100.
1966 Z0(I,J)=SFZ0(IS,ISN)/100.
1968 EMBCK(I,J)=SFEM(IS,ISN)
1969 EMISS(I,J)=EMBCK(I,J)
1970 MAVAIL(I,J)=SLMO(IS,ISN)
1971 IF(IS.NE.ISWATER)THEN
1976 ! SET SEA-ICE POINTS TO LAND WITH ICE/SNOW SURFACE PROPERTIES
1977 XICEM(I,J)=XICE(I,J)
1978 IF(XICE(I,J).GE.xice_threshold)THEN
1980 ALBBCK(I,J)=ALBD(ISICE,ISN)/100.
1981 EMBCK(I,J)=SFEM(ISICE,ISN)
1982 IF (FRACTIONAL_SEAICE == 1) THEN
1983 ! The 0.08 value is the albedo over open water.
1984 ! The 0.98 value is the emissivity over open water.
1985 ALBEDO(I,J) = ( XICE(I,J) * ALBBCK(I,J) ) + ( (1.0-XICE(I,J)) * 0.08 )
1986 EMISS(I,J) = ( XICE(I,J) * EMBCK(I,J) ) + ( (1.0-XICE(I,J)) * 0.98 )
1988 ALBEDO(I,J)=ALBBCK(I,J)
1989 EMISS(I,J)=EMBCK(I,J)
1991 THC(I,J)=THERIN(ISICE,ISN)/100.
1992 Z0(I,J)=SFZ0(ISICE,ISN)/100.
1994 MAVAIL(I,J)=SLMO(ISICE,ISN)
1999 if ( wrf_dm_on_monitor() .and. allowed_to_read ) then
2000 CLOSE (landuse_unit)
2002 CALL wrf_debug( 100 , 'returning from of landuse_init' )
2004 ! restore LU variables from state
2006 DO cats = 1, max_cats
2007 lu_state(curs) = SCFX(cats) ; curs = curs + 1
2008 DO seas = 1, max_seas
2009 lu_state(curs) = ALBD(cats,seas) ; curs = curs + 1
2010 lu_state(curs) = SLMO(cats,seas) ; curs = curs + 1
2011 lu_state(curs) = SFEM(cats,seas) ; curs = curs + 1
2012 lu_state(curs) = SFZ0(cats,seas) ; curs = curs + 1
2013 lu_state(curs) = SFHC(cats,seas) ; curs = curs + 1
2014 lu_state(curs) = THERIN(cats,seas) ; curs = curs + 1
2019 !-- SSIB's 12-category vegetation parameters are defined in module_ssib_veg
2020 !-- Data in LANDUSE.TBL is only used temporarily until the first
2021 !-- call to SSIB, and also to set water/ice points properties
2022 ! IF(MMINLU.EQ.'SSIB')THEN
2023 ! CALL init_module_ssib_veg
2024 ! CALL wrf_message ( 'READING SSIB VEGETATION PARAMETERS' )
2028 END SUBROUTINE landuse_init
2030 !=====================================================================
2031 SUBROUTINE ra_init(id,STEPRA,RADT,DT,RTHRATEN,RTHRATENLW, &
2032 RTHRATENSW,CLDFRA,EMISS,cen_lat,JULYR,JULDAY,GMT, &
2033 levsiz,XLAT,XLONG,n_ozmixm, &
2034 alevsiz,no_src_types, &
2035 cldfra_dp,cldfra_sh, & ! Optional for subgrid cloud by ckay
2036 cldfra_old, & ! Optional
2037 ghi_accum, & ! Optional
2038 ozmixm,pin, & ! Optional
2039 aerodm,pina, & ! Optional
2040 m_ps_1,m_ps_2,m_hybi,aerosolc_1,aerosolc_2, & ! Optional
2041 paerlev,n_aerosolc, &
2042 sfull,shalf,pptop,swrad_scat,p_top, &
2043 config_flags,restart, &
2044 allowed_to_read, start_of_simulation, &
2045 ids, ide, jds, jde, kds, kde, &
2046 ims, ime, jms, jme, kms, kme, &
2047 its, ite, jts, jte, kts, kte )
2048 !---------------------------------------------------------------------
2049 USE module_ra_rrtm , ONLY : rrtminit
2050 USE module_ra_rrtmg_lw , ONLY : rrtmg_lwinit
2051 USE module_ra_rrtmg_sw , ONLY : rrtmg_swinit
2052 #if( BUILD_RRTMG_FAST == 1)
2053 USE module_ra_rrtmg_lwf , ONLY : rrtmg_lwinit_fast
2054 USE module_ra_rrtmg_swf , ONLY : rrtmg_swinit_fast
2057 # if( BUILD_RRTMK == 1)
2058 USE module_ra_rrtmg_lwk , ONLY : rrtmg_lwinit_k
2059 USE module_ra_rrtmg_swk , ONLY : rrtmg_swinit_k
2062 USE module_ra_cam , ONLY : camradinit
2063 USE module_ra_cam_support , ONLY : oznini
2064 USE module_ra_sw , ONLY : swinit
2065 USE module_ra_gsfcsw , ONLY : gsfc_swinit
2066 USE module_ra_gfdleta , ONLY : gfdletainit
2067 USE module_ra_goddard , ONLY : init_goddardrad
2069 USE module_ra_hwrf , ONLY : hwrfrainit
2071 USE module_ra_hs , ONLY : hsinit
2073 !---------------------------------------------------------------------
2075 !---------------------------------------------------------------------
2076 INTEGER, INTENT(IN) :: id
2077 TYPE (grid_config_rec_type) :: config_flags
2078 LOGICAL , INTENT(IN) :: restart
2079 LOGICAL, INTENT(IN) :: allowed_to_read
2081 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
2082 ims, ime, jms, jme, kms, kme, &
2083 its, ite, jts, jte, kts, kte
2085 INTEGER , INTENT(IN) :: JULDAY,JULYR
2086 REAL , INTENT(IN) :: DT, RADT, cen_lat, GMT, pptop, &
2088 LOGICAL, INTENT(IN) :: start_of_simulation
2090 INTEGER, INTENT(IN ) :: levsiz, n_ozmixm
2091 INTEGER, INTENT(IN ) :: paerlev, n_aerosolc
2092 INTEGER, INTENT(IN ) :: alevsiz, no_src_types
2094 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(IN) :: XLAT, XLONG
2096 REAL, DIMENSION( ims:ime, levsiz, jms:jme, n_ozmixm ), OPTIONAL, &
2097 INTENT(INOUT) :: OZMIXM
2098 REAL, DIMENSION( ims:ime, alevsiz, jms:jme, n_ozmixm-1, no_src_types ), OPTIONAL, &
2099 INTENT(INOUT) :: aerodm
2101 REAL, DIMENSION(ims:ime,jms:jme), OPTIONAL, INTENT(INOUT) :: m_ps_1,m_ps_2
2102 REAL, DIMENSION(paerlev), OPTIONAL, INTENT(INOUT) :: m_hybi
2103 REAL, DIMENSION( ims:ime, paerlev, jms:jme, n_aerosolc ), OPTIONAL, &
2104 INTENT(INOUT) :: aerosolc_1, aerosolc_2
2106 REAL, DIMENSION(levsiz), OPTIONAL, INTENT(INOUT) :: PIN
2107 REAL, DIMENSION(alevsiz), OPTIONAL, INTENT(INOUT) :: PINA
2109 INTEGER , INTENT(INOUT) :: STEPRA
2112 REAL , DIMENSION( kms:kme ) , INTENT(IN) :: sfull, shalf
2113 REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: &!BSINGH(PNNL)- should be declared inout
2119 REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) , & ! ckay for subgrid cloud
2124 REAL , DIMENSION( ims:ime ,jms:jme ) , OPTIONAL, INTENT(INOUT) :: ghi_accum ! Solar diagnostics
2126 REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , OPTIONAL, INTENT(INOUT) :: &!BSINGH(PNNL)- should be declared inout
2129 REAL , DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: EMISS
2130 LOGICAL :: etalw = .false.
2131 LOGICAL :: hwrflw= .false.
2132 LOGICAL :: camlw = .false.
2133 ! LOGICAL :: etamp = .false.
2134 LOGICAL :: acswalloc = .false.
2135 LOGICAL :: aclwalloc = .false.
2136 integer :: month,iday
2137 INTEGER :: i, j, k, itf, jtf, ktf
2138 !---------------------------------------------------------------------
2144 !---------------------------------------------------------------------
2146 !-- calculate radiation time step
2148 STEPRA = nint(RADT*60./DT)
2149 STEPRA = max(STEPRA,1)
2153 IF(start_of_simulation)THEN
2158 RTHRATENLW(i,k,j)=0.
2159 RTHRATENSW(i,k,j)=0.
2165 IF( PRESENT(cldfra_dp) ) THEN
2176 if( present(cldfra_old) ) then
2180 cldfra_old(i,k,j) = 0.
2186 IF( PRESENT(ghi_accum) ) THEN
2195 !-- ww: attempt to use CAM ozone and some aerosol profiles in all rad schemes
2196 ! note that CAM option will still do the same.
2197 ! n_ozmixm: no of months; levsiz: = 59, vertical dim
2198 ! Read in CAM ozone data, and interpolate data to model grid
2199 ! Interpolation is done on domain 1 only
2202 IF ( config_flags%o3input .EQ. 2 .AND. id .EQ. 1 ) THEN
2204 IF ( config_flags%o3input .EQ. 2 ) THEN
2206 CALL oznini(ozmixm,pin,levsiz,n_ozmixm,XLAT, &
2207 ids, ide, jds, jde, kds, kde, &
2208 ims, ime, jms, jme, kms, kme, &
2209 its, ite, jts, jte, kts, kte)
2212 IF ( config_flags%aer_opt .EQ. 1 .AND. id .EQ. 1 ) THEN
2213 CALL aerosol_in(aerodm,pina,alevsiz,n_ozmixm-1,no_src_types,XLAT,XLONG, &
2214 ids, ide, jds, jde, kds, kde, &
2215 ims, ime, jms, jme, kms, kme, &
2216 its, ite, jts, jte, kts, kte)
2219 !-- find out which microphysics option is used first
2221 ! mp_select: SELECT CASE(config_flags%mp_physics)
2226 ! END SELECT mp_select
2228 !-- chose long wave radiation scheme
2230 lwrad_select: SELECT CASE(config_flags%ra_lw_physics)
2232 CASE (goddardlwscheme)
2233 CALL init_goddardrad( &
2235 ids, ide, jds, jde, kds, kde, &
2236 ims, ime, jms, jme, kms, kme, &
2237 its, ite, jts, jte, kts, kte )
2242 p_top, allowed_to_read , &
2243 ids, ide, jds, jde, kds, kde, &
2244 ims, ime, jms, jme, kms, kme, &
2245 its, ite, jts, jte, kts, kte )
2249 CALL wrf_error_fatal ( 'CAM radiation scheme not supported under the chosen build configuration' )
2251 IF ( PRESENT( OZMIXM ) .AND. PRESENT( PIN ) .AND. &
2252 PRESENT(M_PS_1) .AND. PRESENT(M_PS_2) .AND. &
2253 PRESENT(M_HYBI) .AND. PRESENT(AEROSOLC_1) &
2254 .AND. PRESENT(AEROSOLC_2)) THEN
2256 R_D,R_V,CP,G,STBOLT,EP_2,shalf,pptop, &
2257 ozmixm,pin,levsiz,XLAT,n_ozmixm, &
2258 m_ps_1,m_ps_2,m_hybi,aerosolc_1,aerosolc_2,&
2259 paerlev, n_aerosolc, &
2260 ids, ide, jds, jde, kds, kde, &
2261 ims, ime, jms, jme, kms, kme, &
2262 its, ite, jts, jte, kts, kte )
2264 CALL wrf_error_fatal ( 'arguments not present for calling cam radiation' )
2270 CASE (RRTMG_LWSCHEME)
2271 CALL rrtmg_lwinit( &
2272 p_top, allowed_to_read , &
2273 ids, ide, jds, jde, kds, kde, &
2274 ims, ime, jms, jme, kms, kme, &
2275 its, ite, jts, jte, kts, kte )
2278 #if ( EM_CORE == 1 )
2279 # if( BUILD_RRTMK == 1)
2280 CASE (RRTMK_LWSCHEME)
2282 CALL rrtmg_lwinit_k( &
2284 ids, ide, jds, jde, kds, kde, &
2285 ims, ime, jms, jme, kms, kme, &
2286 its, ite, jts, jte, kts, kte )
2292 #if( BUILD_RRTMG_FAST == 1)
2293 CASE (RRTMG_LWSCHEME_FAST)
2294 CALL rrtmg_lwinit_fast( &
2295 p_top, allowed_to_read , &
2296 ids, ide, jds, jde, kds, kde, &
2297 ims, ime, jms, jme, kms, kme, &
2298 its, ite, jts, jte, kts, kte )
2304 CALL nl_get_start_month(id,month)
2305 CALL nl_get_start_day(id,iday)
2306 CALL gfdletainit(emiss,sfull,shalf,pptop, &
2307 julyr,month,iday,gmt, &
2308 config_flags,allowed_to_read, &
2309 ids, ide, jds, jde, kds, kde, &
2310 ims, ime, jms, jme, kms, kme, &
2311 its, ite, jts, jte, kts, kte )
2315 CALL nl_get_start_month(id,month)
2316 CALL nl_get_start_day(id,iday)
2317 ! test this with standard jul-day calls
2318 ! CALL nl_get_start_year(id,start_year)
2319 ! CALL nl_get_start_month(id,start_month)
2320 ! CALL nl_get_start_day(id,start_day)
2321 ! CALL nl_get_start_hour(id,start_hour)
2322 ! CALL nl_get_start_minute(id,start_minute)
2323 ! CALL nl_get_start_second(id,start_second)
2324 ! CALL jdn_sec(day_in_sec,start_year,start_month,start_day,0,0,0)
2325 ! CALL jdn_sec(day_in_sec_ref,start_year,1,1,0,0,0)
2326 ! julyr_start=start_year
2327 ! julday_start=(day_in_sec-day_in_sec_ref)/(3600.*24.)+1
2328 ! gmt_start=start_hour+real(start_minute)/60.+real(start_second)/3600.
2329 CALL hwrfrainit(sfull,shalf,pptop,JULYR,MONTH,IDAY,GMT,&
2330 ! CALL hwrfrainit(sfull,shalf,pptop,JULYR_start,MONTH,IDAY,GMT_start,&
2331 config_flags,allowed_to_read , &
2332 kds, kde, kms, kme, kts, kte )
2336 CALL hsinit(RTHRATEN,restart, &
2337 ids, ide, jds, jde, kds, kde, &
2338 ims, ime, jms, jme, kms, kme, &
2339 its, ite, jts, jte, kts, kte )
2345 END SELECT lwrad_select
2346 !-- initialize short wave radiation scheme
2348 swrad_select: SELECT CASE(config_flags%ra_sw_physics)
2350 CASE (goddardswscheme)
2351 CALL init_goddardrad( &
2353 ids, ide, jds, jde, kds, kde, &
2354 ims, ime, jms, jme, kms, kme, &
2355 its, ite, jts, jte, kts, kte )
2361 ids, ide, jds, jde, kds, kde, &
2362 ims, ime, jms, jme, kms, kme, &
2363 its, ite, jts, jte, kts, kte )
2367 CALL wrf_error_fatal ( 'CAM radiation scheme not supported under the chosen build configuration' )
2371 R_D,R_V,CP,G,STBOLT,EP_2,shalf,pptop, &
2372 ozmixm,pin,levsiz,XLAT,n_ozmixm, &
2373 m_ps_1,m_ps_2,m_hybi,aerosolc_1,aerosolc_2,&
2374 paerlev, n_aerosolc, &
2375 ids, ide, jds, jde, kds, kde, &
2376 ims, ime, jms, jme, kms, kme, &
2377 its, ite, jts, jte, kts, kte )
2382 CALL gsfc_swinit(cen_lat, allowed_to_read )
2384 CASE (RRTMG_SWSCHEME)
2385 CALL rrtmg_swinit( &
2387 ids, ide, jds, jde, kds, kde, &
2388 ims, ime, jms, jme, kms, kme, &
2389 its, ite, jts, jte, kts, kte )
2393 #if ( EM_CORE == 1 )
2394 # if( BUILD_RRTMK == 1)
2395 CASE (RRTMK_SWSCHEME)
2397 CALL rrtmg_swinit_k( &
2399 ids, ide, jds, jde, kds, kde, &
2400 ims, ime, jms, jme, kms, kme, &
2401 its, ite, jts, jte, kts, kte )
2408 #if( BUILD_RRTMG_FAST == 1)
2409 CASE (RRTMG_SWSCHEME_FAST)
2410 CALL rrtmg_swinit_fast( &
2412 ids, ide, jds, jde, kds, kde, &
2413 ims, ime, jms, jme, kms, kme, &
2414 its, ite, jts, jte, kts, kte )
2422 CALL nl_get_start_month(id,month)
2423 CALL nl_get_start_day(id,iday)
2424 CALL gfdletainit(emiss,sfull,shalf,pptop, &
2425 julyr,month,iday,gmt, &
2426 config_flags,allowed_to_read, &
2427 ids, ide, jds, jde, kds, kde, &
2428 ims, ime, jms, jme, kms, kme, &
2429 its, ite, jts, jte, kts, kte )
2434 CALL nl_get_start_month(id,month)
2435 CALL nl_get_start_day(id,iday)
2436 CALL hwrfrainit(sfull,shalf,pptop,JULYR,MONTH,IDAY,GMT,&
2437 config_flags,allowed_to_read, &
2438 kds, kde, kms, kme, kts, kte )
2445 END SELECT swrad_select
2447 #if ( EM_CORE == 1 )
2448 ! test for conditionally allocated arrays when using bucket_J
2450 IF(config_flags%bucket_J .gt. 0.0)THEN
2451 IF(.not. (acswalloc .and. aclwalloc))THEN
2452 CALL wrf_error_fatal ( 'Need CAM or RRTMG radiation for bucket_J option')
2457 END SUBROUTINE ra_init
2459 SUBROUTINE bl_init(STEPBL,BLDT,DT,RUBLTEN,RVBLTEN,RTHBLTEN, &
2460 RQVBLTEN,RQCBLTEN,RQIBLTEN,TSK,TMN, &
2461 config_flags,restart,UST,LOWLYR,TSLB,ZS,DZS, &
2462 num_soil_layers,TKE_PBL,mfshconv,pek,pep, &
2463 massflux_EDKF, entr_EDKF, detr_EDKF, &
2464 thl_up, thv_up, rt_up, &
2465 rv_up, rc_up, u_up, v_up, &
2466 frac_up, itimestep, id, &
2468 SNOW,SNOWC, CANWAT,SMSTAV, &
2469 SMSTOT, SFCRUNOFF,UDRUNOFF,ACSNOW,ACSNOM, &
2470 IVGTYP,ISLTYP,ISURBAN,SMOIS,SMFR3D,mavail, &
2471 SNOWH,SH2O,SNOALB,FNDSOILW,FNDSNOWH,RDMAXALB, &
2472 #if ( NMM_CORE == 1 )
2473 Z0,XLAND,XICE,DX,DY, &
2475 ZNT,XLAND,XICE,DX, DY, MSFTX, MSFTY, &
2477 QKE, SFCEVP,GRDFLX, &
2480 ISNOWXY, ZSNSOXY, TSNOXY, &
2481 SNICEXY, SNLIQXY, TVXY, TGXY, CANICEXY, &
2482 CANLIQXY, EAHXY, TAHXY, CMXY, &
2483 CHXY, FWETXY, SNEQVOXY,ALBOLDXY,QSNOWXY,QRAINXY,&
2484 WSLAKEXY, ZWTXY, WAXY, WTXY, LFMASSXY, RTMASSXY,&
2485 STMASSXY, WOODXY, STBLCPXY, FASTCPXY, &
2486 GRAINXY, GDDXY, & ! Noah-MP Crop model
2487 croptype, cropcat, & ! Noah-MP Crop model
2489 iopt_irr, iopt_irrm, &
2490 IRNUMSI, IRNUMMI, IRNUMFI, IRWATSI, IRWATMI, & ! Noah-MP Irrigation
2491 IRWATFI, IRELOSS, IRSIVOL, IRMIVOL, IRFIVOL, & ! Noah-MP Irrigation
2493 gecros_state, & ! Optional gecros crop
2495 SMOISEQ, SMCWTDXY, RECHXY, DEEPRECHXY, AREAXY, &
2496 WTDDT, STEPWTD,QRFSXY ,QSPRINGSXY ,QSLATXY, &
2497 FDEPTHXY, RIVERBEDXY, EQZWT, RIVERCONDXY, PEXPXY, &
2500 T2MVXY, T2MBXY ,CHSTARXY, &
2501 allowed_to_read, iopt_run , &
2502 start_of_simulation, &
2503 lakedepth2d, savedtke12d, snowdp2d, h2osno2d, & !lake
2504 snl2d, t_grnd2d, t_lake3d, lake_icefrac3d, & !lake
2505 z_lake3d, dz_lake3d, t_soisno3d, h2osoi_ice3d, & !lake
2506 h2osoi_liq3d, h2osoi_vol3d, z3d, dz3d, & !lake
2507 zi3d, watsat3d, csol3d, tkmg3d, & !lake
2508 tkdry3d, tksatu3d, LakeModel, lake2d, & !lake
2509 lakedepth_default, lake_min_elev, lake_depth, & !lake
2511 lakemask, lakeflag, & !lake
2513 lake_depth_flag, use_lakedepth, & !lake
2514 water_depth,bathymetry_flag, shalwater_z0, &
2516 te_temf,cf3d_temf,wm_temf, & ! WA
2517 ! num_roof_layers,num_wall_layers,num_road_layers,& !Optional urban
2518 DZR, DZB, DZG, & !Optional urban
2519 TR_URB2D,TB_URB2D,TG_URB2D,TC_URB2D,QC_URB2D, & !Optional urban
2520 XXXR_URB2D,XXXB_URB2D,XXXG_URB2D,XXXC_URB2D, & !Optional urban
2521 TRL_URB3D, TBL_URB3D, TGL_URB3D, & !Optional urban
2522 SH_URB2D,LH_URB2D,G_URB2D,RN_URB2D, & !Optional urban
2523 TS_URB2D, FRC_URB2D, UTYPE_URB2D, &
2524 SF_URBAN_PHYSICS, & !Optional urban
2525 CMCR_URB2D,TGR_URB2D,TGRL_URB3D,SMR_URB3D, & !Optional urban
2526 DRELR_URB2D,DRELB_URB2D,DRELG_URB2D, & !Optional urban
2527 FLXHUMR_URB2D,FLXHUMB_URB2D,FLXHUMG_URB2D, & !Optional urban
2528 num_urban_ndm, & !Optional multi-layer urban
2529 urban_map_zrd, & !Optional multi-layer urban
2530 urban_map_zwd, & !Optional multi-layer urban
2531 urban_map_gd, & !Optional multi-layer urban
2532 urban_map_zd, & !Optional multi-layer urban
2533 urban_map_zdf, & !Optional multi-layer urban
2534 urban_map_bd, & !Optional multi-layer urban
2535 urban_map_wd, & !Optional multi-layer urban
2536 urban_map_gbd, & !Optional multi-layer urban
2537 urban_map_fbd, & !Optional multi-layer urban
2538 urban_map_zgrd, & !Optional multi-layer urban
2539 NUM_URBAN_HI, & !Optional multi-layer urban
2540 TRB_URB4D,TW1_URB4D,TW2_URB4D, & !Optional multi-layer urban
2541 TGB_URB4D,TLEV_URB3D,QLEV_URB3D, & !Optional multi-layer urban
2542 TW1LEV_URB3D,TW2LEV_URB3D, & !Optional multi-layer urban
2543 TGLEV_URB3D,TFLEV_URB3D, & !Optional multi-layer urban
2544 SF_AC_URB3D,LF_AC_URB3D,CM_AC_URB3D, & !Optional multi-layer urban
2545 SFVENT_URB3D,LFVENT_URB3D, & !Optional multi-layer urban
2546 SFWIN1_URB3D,SFWIN2_URB3D, & !Optional multi-layer urban
2547 SFW1_URB3D,SFW2_URB3D, & !Optional multi-layer urban
2548 SFR_URB3D,SFG_URB3D, & !Optional multi-layer urban
2549 EP_PV_URB3D,T_PV_URB3D, & !GRZ
2550 TRV_URB4D,QR_URB4D,QGR_URB3D,TGR_URB3D, & !GRZ
2551 DRAIN_URB4D,DRAINGR_URB3D,SFRV_URB3D, & !GRZ
2552 LFRV_URB3D,DGR_URB3D,DG_URB3D,LFR_URB3D,LFG_URB3D,&!GRZ
2553 LP_URB2D,HI_URB2D,LB_URB2D, & !Optional multi-layer urban
2554 HGT_URB2D,MH_URB2D,STDH_URB2D, & !Optional multi-layer urban
2555 LF_URB2D, & !Optional multi-layer urban
2556 A_U_BEP,A_V_BEP,A_T_BEP,A_Q_BEP, & !Optional multi-layer urban
2557 A_E_BEP,B_U_BEP,B_V_BEP, & !Optional multi-layer urban
2558 B_T_BEP,B_Q_BEP,B_E_BEP,DLG_BEP, & !Optional multi-layer urban
2559 DL_U_BEP,SF_BEP,VL_BEP, & !Optional multi-layer urban
2560 ids, ide, jds, jde, kds, kde, &
2561 ims, ime, jms, jme, kms, kme, &
2562 its, ite, jts, jte, kts, kte, &
2563 ACHFX,ACLHF,ACGRDFLX, &
2564 oml_hml0, sf_ocean_physics, & !Optional oml
2565 TML,T0ML,HML,H0ML,HUML,HVML,TMOML, &
2567 ,TSK_SAVE & !Optional fractional seaice
2570 snowdp,wtc,wtp,h2osno,t_grnd,t_veg, &
2571 h2ocan,h2ocan_col,t2m_max,t2m_min,t_ref2m, &
2573 h2osoi_liq_s2,h2osoi_liq_s3,h2osoi_liq_s4, &
2574 h2osoi_liq_s5,h2osoi_liq1,h2osoi_liq2, &
2575 h2osoi_liq3,h2osoi_liq4,h2osoi_liq5,h2osoi_liq6, &
2576 h2osoi_liq7,h2osoi_liq8,h2osoi_liq9,h2osoi_liq10, &
2577 h2osoi_ice_s1,h2osoi_ice_s2, &
2578 h2osoi_ice_s3,h2osoi_ice_s4,h2osoi_ice_s5, &
2579 h2osoi_ice1,h2osoi_ice2,h2osoi_ice3,h2osoi_ice4, &
2580 h2osoi_ice5,h2osoi_ice6,h2osoi_ice7, &
2581 h2osoi_ice8,h2osoi_ice9,h2osoi_ice10, &
2582 t_soisno_s1,t_soisno_s2,t_soisno_s3,t_soisno_s4, &
2583 t_soisno_s5,t_soisno1,t_soisno2,t_soisno3, &
2584 t_soisno4,t_soisno5,t_soisno6,t_soisno7, &
2585 t_soisno8,t_soisno9,t_soisno10, &
2586 dzsnow1,dzsnow2,dzsnow3,dzsnow4,dzsnow5, &
2587 snowrds1,snowrds2,snowrds3,snowrds4,snowrds5, &
2588 t_lake1,t_lake2,t_lake3,t_lake4,t_lake5, &
2589 t_lake6,t_lake7,t_lake8,t_lake9,t_lake10, &
2590 h2osoi_vol1,h2osoi_vol2,h2osoi_vol3, &
2591 h2osoi_vol4,h2osoi_vol5,h2osoi_vol6, &
2592 h2osoi_vol7,h2osoi_vol8, &
2593 h2osoi_vol9,h2osoi_vol10, &
2595 ALBEDOsubgrid,LHsubgrid,HFXsubgrid,LWUPsubgrid, &
2596 Q2subgrid,SABVsubgrid,SABGsubgrid,NRAsubgrid, &
2597 SWUPsubgrid,lhsoi,lhveg,lhtran &
2598 #if (WRF_USE_CLM == 1) && ( WRF_CHEM == 1 )
2599 ,megan_specifier, megan_factors_file &
2600 ,megan_mapped_emisfctrs &
2602 ! end of CLM vraiables
2603 ,landusef,landusef2,NLCAT & ! danli mosaic
2604 ,sf_surface_mosaic, mosaic_cat & ! danli mosaic
2605 ,mosaic_cat_index & ! danli mosaic
2606 ,TSK_mosaic,TSLB_mosaic & ! danli mosaic
2607 ,SMOIS_mosaic,SH2O_mosaic & ! danli mosaic
2608 ,CANWAT_mosaic,SNOW_mosaic & ! danli mosaic
2609 ,SNOWH_mosaic,SNOWC_mosaic & ! danli mosaic
2610 ,ALBEDO,ALBBCK, EMISS, EMBCK & ! danli mosaic
2611 ,ALBEDO_mosaic,ALBBCK_mosaic, EMISS_mosaic, EMBCK_mosaic, ZNT_mosaic, Z0_mosaic & ! danli mosaic
2612 ,TR_URB2D_mosaic,TB_URB2D_mosaic & !danli mosaic
2613 ,TG_URB2D_mosaic,TC_URB2D_mosaic & !danli mosaic
2614 ,QC_URB2D_mosaic & !danli mosaic
2615 ,TRL_URB3D_mosaic,TBL_URB3D_mosaic & !danli mosaic
2616 ,TGL_URB3D_mosaic & !danli mosaic
2617 ,SH_URB2D_mosaic,LH_URB2D_mosaic & !danli mosaic
2618 ,G_URB2D_mosaic,RN_URB2D_mosaic & !danli mosaic
2619 ,TS_URB2D_mosaic & !danli mosaic
2620 ,TS_RUL2D_mosaic & !danli mosaic
2621 ,irr_rand_field,irr_ph,irr_freq &
2623 !--------------------------------------------------------------------
2624 USE module_sf_sfclay
2627 USE module_sf_pxsfclay
2629 USE module_bl_shinhong
2633 USE module_bl_gfsedmf, only : gfsedmfinit
2636 USE module_sf_myjsfc
2637 USE module_sf_qnsesfc
2638 USE module_sf_noahdrv
2639 USE module_sf_noahlsm, only : LCZ_1,LCZ_2,LCZ_3,LCZ_4,LCZ_5,LCZ_6,LCZ_7,LCZ_8,LCZ_9,LCZ_10,LCZ_11
2640 USE module_sf_noahmpdrv
2641 USE noahmp_tables, ONLY: LCZ_1_TABLE,LCZ_2_TABLE,LCZ_3_TABLE,LCZ_4_TABLE,LCZ_5_TABLE,LCZ_6_TABLE,LCZ_7_TABLE,LCZ_8_TABLE,LCZ_9_TABLE,LCZ_10_TABLE,LCZ_11_TABLE
2643 USE module_sf_clm, only : clminit
2646 USE module_sf_ctsm, only : ctsm_init
2649 USE module_sf_bep !BEP
2650 USE module_sf_bep_bem
2651 USE module_sf_ruclsm
2654 USE module_bl_myjpbl
2655 USE module_bl_myjurb
2656 USE module_bl_boulac
2657 USE module_bl_camuwpbl_driver, ONLY : camuwpblinit
2658 USE module_bl_qnsepbl
2660 USE module_bl_mfshconvpbl
2661 USE module_bl_gbmpbl
2662 #if ( EM_CORE == 1 )
2663 USE module_bl_mynn_wrapper
2666 #if ( WRFPLUS == 1 )
2667 USE module_bl_surface_drag
2669 USE module_sf_temfsfclay
2676 !--------------------------------------------------------------------
2678 !--------------------------------------------------------------------
2679 TYPE (grid_config_rec_type) :: config_flags
2680 LOGICAL , INTENT(IN) :: restart
2681 LOGICAL, INTENT(IN) :: FNDSOILW, FNDSNOWH
2682 LOGICAL, INTENT(IN) :: RDMAXALB
2683 LOGICAL, INTENT(IN) :: is_CAMMGMP_used !BSINGH:02/01/2013: For CAMUWPBL scheme
2685 INTEGER , INTENT(IN) :: id
2686 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
2687 ims, ime, jms, jme, kms, kme, &
2688 its, ite, jts, jte, kts, kte
2689 INTEGER , INTENT(IN) :: num_soil_layers
2690 INTEGER , INTENT(IN) :: SF_URBAN_PHYSICS
2691 INTEGER , INTENT(IN) :: IOPT_RUN
2692 INTEGER , INTENT(IN) :: itimestep
2694 ! INTEGER , INTENT(IN) :: LakeModel
2695 INTEGER :: LakeModel
2696 real, intent(in) :: lakedepth_default,lake_min_elev
2697 REAL , INTENT(IN) :: DT, BLDT
2698 REAL , INTENT(IN) :: DX, DY
2700 REAL, DIMENSION( ims:ime, jms:jme ) , INTENT(IN) :: MSFTX,MSFTY
2702 INTEGER , INTENT(INOUT) :: STEPBL
2704 REAL, DIMENSION( ims:ime , 1:num_soil_layers , jms:jme ), &
2705 INTENT(OUT) :: SMFR3D
2707 REAL, DIMENSION( ims:ime , 1:num_soil_layers , jms:jme ),&
2708 INTENT(INOUT) :: SMOIS,SH2O,TSLB
2710 REAL, DIMENSION( ims:ime, jms:jme ) , &
2711 INTENT(INOUT) :: SNOW, &
2727 #if ( NMM_CORE == 1 )
2735 INTEGER, DIMENSION( ims:ime, jms:jme ) , &
2736 INTENT(INOUT) :: IVGTYP, &
2741 REAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: ZS,DZS
2743 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: &!BSINGH(PNNL)- should be declared inout
2753 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT), OPTIONAL :: QKE, pek, pep
2755 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT), OPTIONAL :: &
2756 massflux_EDKF, entr_EDKF, detr_EDKF &
2757 ,thl_up, thv_up, rt_up &
2758 ,rv_up, rc_up, u_up, v_up &
2761 INTEGER, INTENT(IN) :: mfshconv ! WRF JP
2763 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(IN) :: TSK
2764 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: TMN
2765 CHARACTER(LEN=*), INTENT(IN) :: MMINLU
2766 LOGICAL, INTENT(IN) :: allowed_to_read
2767 INTEGER, INTENT(IN) :: ISURBAN
2768 INTEGER :: isn, isfc
2771 REAL, OPTIONAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , &
2772 INTENT(OUT) :: te_temf, cf3d_temf !WA
2773 REAL, OPTIONAL, DIMENSION( ims:ime , jms:jme ) , &
2774 INTENT(OUT) :: wm_temf
2778 REAL, DIMENSION(ims:ime, jms:jme) :: XLAT
2779 REAL, DIMENSION(ims:ime, jms:jme) :: XLONG
2780 INTEGER, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: ISNOWXY
2781 REAL, OPTIONAL, DIMENSION(ims:ime,-2:num_soil_layers, jms:jme) :: ZSNSOXY
2782 REAL, OPTIONAL, DIMENSION(ims:ime,-2:0, jms:jme) :: TSNOXY
2783 REAL, OPTIONAL, DIMENSION(ims:ime,-2:0, jms:jme) :: SNICEXY
2784 REAL, OPTIONAL, DIMENSION(ims:ime,-2:0, jms:jme) :: SNLIQXY
2785 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: TVXY
2786 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: TGXY
2787 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: CANICEXY
2788 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: CANLIQXY
2789 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: EAHXY
2790 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: TAHXY
2791 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: CMXY
2792 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: CHXY
2793 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: FWETXY
2794 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: SNEQVOXY
2795 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: ALBOLDXY
2796 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: QSNOWXY
2797 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: QRAINXY
2798 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: WSLAKEXY
2799 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: ZWTXY
2800 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: WAXY
2801 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: WTXY
2802 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: LFMASSXY
2803 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: RTMASSXY
2804 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: STMASSXY
2805 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: WOODXY
2806 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: GRAINXY
2807 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: GDDXY
2808 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: STBLCPXY
2809 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: FASTCPXY
2810 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: XSAIXY
2811 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: LAI
2812 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: T2MVXY
2813 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: T2MBXY
2814 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: CHSTARXY
2815 REAL, OPTIONAL, DIMENSION(ims:ime,1:num_soil_layers,jms:jme) :: SMOISEQ
2816 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: SMCWTDXY
2817 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: DEEPRECHXY
2818 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: RECHXY
2819 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: QRFSXY
2820 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: QSPRINGSXY
2821 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: QSLATXY
2822 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: AREAXY
2823 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme), INTENT(IN) :: FDEPTHXY
2824 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: RIVERBEDXY
2825 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: EQZWT
2826 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: RIVERCONDXY
2827 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: PEXPXY
2828 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme), INTENT(IN) :: rechclim
2829 INTEGER, OPTIONAL, DIMENSION(ims:ime, jms:jme), INTENT(OUT) :: CROPCAT
2830 REAL, OPTIONAL, DIMENSION(ims:ime,5,jms:jme), INTENT(IN ) :: CROPTYPE
2831 INTEGER , INTENT(IN) :: iopt_crop, iopt_irr, iopt_irrm
2832 REAL, OPTIONAL, DIMENSION(ims:ime,60,jms:jme) :: gecros_state ! Optional gecros crop
2833 INTEGER, OPTIONAL, INTENT(IN) :: ISICE
2834 INTEGER , OPTIONAL, INTENT(OUT) :: STEPWTD
2835 REAL , OPTIONAL, INTENT(IN) :: WTDDT
2838 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRWATSI
2839 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRWATMI
2840 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRWATFI
2841 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRELOSS
2842 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRSIVOL
2843 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRMIVOL
2844 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRFIVOL
2845 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRRSPLH
2846 INTEGER, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRNUMSI
2847 INTEGER, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRNUMMI
2848 INTEGER, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: IRNUMFI
2850 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme) :: qtdrain
2853 ! REAL, DIMENSION(1:num_roof_layers), INTENT(INOUT) :: DZR !Optional urban
2854 ! REAL, DIMENSION(1:num_wall_layers), INTENT(INOUT) :: DZB !Optional urban
2855 ! REAL, DIMENSION(1:num_road_layers), INTENT(INOUT) :: DZG !Optional urban
2856 REAL, OPTIONAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: DZR !Optional urban
2857 REAL, OPTIONAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: DZB !Optional urban
2858 REAL, OPTIONAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: DZG !Optional urban
2859 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TR_URB2D !Optional urban
2860 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TB_URB2D !Optional urban
2861 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TG_URB2D !Optional urban
2862 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TC_URB2D !Optional urban
2863 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: QC_URB2D !Optional urban
2864 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXR_URB2D !Optional urban
2865 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXB_URB2D !Optional urban
2866 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXG_URB2D !Optional urban
2867 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXC_URB2D !Optional urban
2868 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: DRELR_URB2D !Optional urban
2869 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: DRELB_URB2D !Optional urban
2870 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: DRELG_URB2D !Optional urban
2871 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: FLXHUMR_URB2D !Optional urban
2872 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: FLXHUMB_URB2D !Optional urban
2873 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: FLXHUMG_URB2D !Optional urban
2874 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: CMCR_URB2D !Optional urban
2875 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TGR_URB2D !Optional urban
2876 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: SH_URB2D !Optional urban
2877 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: LH_URB2D !Optional urban
2878 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: G_URB2D !Optional urban
2879 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: RN_URB2D !Optional urban
2880 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TS_URB2D !Optional urban
2881 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: FRC_URB2D !Optional urban
2882 INTEGER, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: UTYPE_URB2D !Optional urban
2883 ! REAL, DIMENSION( ims:ime, 1:num_roof_layers, jms:jme ), INTENT(INOUT) :: TRL_URB3D !Optional urban
2884 ! REAL, DIMENSION( ims:ime, 1:num_wall_layers, jms:jme ), INTENT(INOUT) :: TBL_URB3D !Optional urban
2885 ! REAL, DIMENSION( ims:ime, 1:num_road_layers, jms:jme ), INTENT(INOUT) :: TGL_URB3D !Optional urban
2886 REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers, jms:jme ), INTENT(INOUT) :: TRL_URB3D !Optional urban
2887 REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers, jms:jme ), INTENT(INOUT) :: TBL_URB3D !Optional urban
2888 REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers, jms:jme ), INTENT(INOUT) :: TGL_URB3D !Optional urban
2889 REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers, jms:jme ), INTENT(INOUT) :: TGRL_URB3D !Optional urban
2890 REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers, jms:jme ), INTENT(INOUT) :: SMR_URB3D !Optional urban
2892 INTEGER , INTENT(IN) :: num_urban_ndm
2893 INTEGER , INTENT(IN) :: urban_map_zrd
2894 INTEGER , INTENT(IN) :: urban_map_zwd
2895 INTEGER , INTENT(IN) :: urban_map_gd
2896 INTEGER , INTENT(IN) :: urban_map_zd
2897 INTEGER , INTENT(IN) :: urban_map_zdf
2898 INTEGER , INTENT(IN) :: urban_map_bd
2899 INTEGER , INTENT(IN) :: urban_map_wd
2900 INTEGER , INTENT(IN) :: urban_map_gbd
2901 INTEGER , INTENT(IN) :: urban_map_fbd
2902 INTEGER , INTENT(IN) :: urban_map_zgrd
2903 INTEGER , INTENT(IN) :: num_urban_hi
2904 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zrd, jms:jme ), INTENT(INOUT) :: TRB_URB4D !Optional UCM
2905 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zwd, jms:jme ), INTENT(INOUT) :: TW1_URB4D !Optional UCM
2906 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zwd, jms:jme ), INTENT(INOUT) :: TW2_URB4D !Optional UCM
2907 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_gd , jms:jme ), INTENT(INOUT) :: TGB_URB4D !Optional UCM
2908 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_bd , jms:jme ), INTENT(INOUT) :: TLEV_URB3D !Optional UCM
2909 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_bd , jms:jme ), INTENT(INOUT) :: QLEV_URB3D !Optional UCM
2910 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_wd , jms:jme ), INTENT(INOUT) :: TW1LEV_URB3D ! multi-layer UCM
2911 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_wd , jms:jme ), INTENT(INOUT) :: TW2LEV_URB3D ! multi-layer UCM
2912 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_gbd, jms:jme ), INTENT(INOUT) :: TGLEV_URB3D ! multi-layer UCM
2913 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_fbd, jms:jme ), INTENT(INOUT) :: TFLEV_URB3D ! multi-layer UCM
2914 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: LF_AC_URB3D !multi-layer UCM
2915 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: SF_AC_URB3D !multi-layer UCM
2916 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: CM_AC_URB3D !multi-layer UCM
2917 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: SFVENT_URB3D !multi-layer UCM
2918 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: LFVENT_URB3D !multi-layer UCM
2919 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_wd , jms:jme ), INTENT(INOUT) :: SFWIN1_URB3D ! multi-layer UCM
2920 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_wd , jms:jme ), INTENT(INOUT) :: SFWIN2_URB3D ! multi-layer UCM
2921 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zd , jms:jme ), INTENT(INOUT) :: SFW1_URB3D !Optional UCM
2922 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zd , jms:jme ), INTENT(INOUT) :: SFW2_URB3D !Optional UCM
2923 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zdf, jms:jme ), INTENT(INOUT) :: SFR_URB3D !Optional UCM
2924 REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_ndm, jms:jme ), INTENT(INOUT) :: SFG_URB3D !Optional UCM
2925 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: EP_PV_URB3D!GRZ
2926 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zdf,jms:jme ), INTENT(INOUT) :: T_PV_URB3D!GRZ
2927 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zgrd, jms:jme),INTENT(INOUT) :: TRV_URB4D ! GRZ
2928 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zgrd, jms:jme),INTENT(INOUT) :: QR_URB4D ! GRZ
2929 REAL, OPTIONAL, DIMENSION( ims:ime,jms:jme), INTENT(INOUT) :: QGR_URB3D ! GRZ
2930 REAL, OPTIONAL, DIMENSION( ims:ime,jms:jme), INTENT(INOUT) :: TGR_URB3D ! GRZ
2931 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zdf, jms:jme),INTENT(INOUT) :: DRAIN_URB4D !GRZ
2932 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: DRAINGR_URB3D !GRZ
2933 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zdf, jms:jme),INTENT(INOUT) :: SFRV_URB3D !GRZ
2934 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zdf, jms:jme),INTENT(INOUT) :: LFRV_URB3D ! GRZ
2935 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zdf, jms:jme ),INTENT(INOUT) :: DGR_URB3D !GRZ
2936 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zdf, jms:jme ),INTENT(INOUT) :: DG_URB3D !GRZ
2937 REAL, OPTIONAL, DIMENSION( ims:ime, 1:urban_map_zdf, jms:jme ),INTENT(INOUT) :: LFR_URB3D !GRZ
2938 REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_ndm, jms:jme ), INTENT(INOUT) :: LFG_URB3D !GRZ
2939 REAL, OPTIONAL, DIMENSION( ims:ime,1:num_urban_hi, jms:jme ), INTENT(INOUT) :: HI_URB2D !multi-layer UCM
2940 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: LP_URB2D !multi-layer UCM
2941 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: LB_URB2D !multi-layer UCM
2942 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: HGT_URB2D !multi-layer UCM
2943 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: MH_URB2D !SLUCM
2944 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: STDH_URB2D !SLUCM
2945 REAL, OPTIONAL, DIMENSION( ims:ime, 4, jms:jme ), INTENT(INOUT) :: LF_URB2D !SLUCM
2946 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_U_BEP
2947 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_V_BEP
2948 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_T_BEP
2949 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_Q_BEP
2950 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_E_BEP
2951 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_U_BEP
2952 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_V_BEP
2953 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_T_BEP
2954 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_Q_BEP
2955 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_E_BEP
2956 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: VL_BEP
2957 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: DLG_BEP
2958 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme,jms:jme),INTENT(INOUT) :: SF_BEP
2959 REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: DL_U_BEP
2961 real, dimension(ims:ime,jms:jme ),intent(out) :: lakedepth2d, &
2963 real, dimension(ims:ime,jms:jme ),intent(inout) :: snowdp2d, &
2968 real, dimension( ims:ime,1:nlevlake, jms:jme ),INTENT(out) :: t_lake3d, &
2972 real, dimension( ims:ime,-nlevsnow+1:nlevsoil, jms:jme ),INTENT(inout) :: t_soisno3d, &
2978 real, dimension( ims:ime,1:nlevsoil, jms:jme ),INTENT(out) :: watsat3d, &
2983 real, dimension( ims:ime,-nlevsnow+0:nlevsoil, jms:jme ),INTENT(inout) :: zi3d
2985 logical, dimension(ims:ime,jms:jme ),intent(out) :: lake2d
2986 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: lake_depth
2987 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: water_depth
2988 #if ( EM_CORE == 1 )
2989 REAL, dimension(ims:ime,jms:jme ),intent(inout) :: lakemask
2990 INTEGER, INTENT(IN) :: lakeflag
2992 INTEGER, INTENT(IN) :: use_lakedepth
2993 INTEGER, INTENT(INOUT) :: lake_depth_flag
2994 INTEGER, INTENT(IN) :: shalwater_z0
2995 REAL, INTENT(IN) :: shalwater_depth
2996 INTEGER, INTENT(INOUT) :: bathymetry_flag
2997 ! REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: HT
2999 REAL, DIMENSION( ims:ime , jms:jme ) , OPTIONAL, INTENT(INOUT) :: &
3000 ACHFX,ACLHF,ACGRDFLX
3001 ! Optional OML variables
3002 REAL, DIMENSION( ims:ime , jms:jme ) , OPTIONAL, INTENT(INOUT) :: &
3003 TML,T0ML,HML,H0ML,HUML,HVML,TMOML
3004 INTEGER, OPTIONAL, INTENT(IN) :: sf_ocean_physics
3005 REAL, OPTIONAL, INTENT(IN) :: oml_hml0
3006 REAL, DIMENSION( ims:ime , jms:jme ) , OPTIONAL, INTENT(INOUT) :: &
3008 LOGICAL, INTENT(IN) :: start_of_simulation
3009 INTEGER :: i,j,patch
3012 INTEGER , INTENT(IN) :: maxpatch
3013 REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: HT
3014 integer, OPTIONAL, dimension(ims:ime,jms:jme ),intent(inout) :: numc,nump
3015 integer, OPTIONAL, dimension(ims:ime,1:maxpatch,jms:jme ),intent(inout) :: snl
3016 real, OPTIONAL, dimension(ims:ime,1:maxpatch,jms:jme ),intent(inout) :: &
3017 snowdp,wtc,wtp,h2osno,t_grnd,t_veg, &
3018 h2ocan,h2ocan_col,t2m_max,t2m_min,t_ref2m, &
3020 h2osoi_liq_s2,h2osoi_liq_s3,h2osoi_liq_s4, &
3021 h2osoi_liq_s5,h2osoi_liq1,h2osoi_liq2, &
3022 h2osoi_liq3,h2osoi_liq4,h2osoi_liq5,h2osoi_liq6, &
3023 h2osoi_liq7,h2osoi_liq8,h2osoi_liq9,h2osoi_liq10, &
3024 h2osoi_ice_s1,h2osoi_ice_s2, &
3025 h2osoi_ice_s3,h2osoi_ice_s4,h2osoi_ice_s5, &
3026 h2osoi_ice1,h2osoi_ice2,h2osoi_ice3,h2osoi_ice4, &
3027 h2osoi_ice5,h2osoi_ice6,h2osoi_ice7, &
3028 h2osoi_ice8,h2osoi_ice9,h2osoi_ice10, &
3029 t_soisno_s1,t_soisno_s2,t_soisno_s3,t_soisno_s4, &
3030 t_soisno_s5,t_soisno1,t_soisno2,t_soisno3, &
3031 t_soisno4,t_soisno5,t_soisno6,t_soisno7, &
3032 t_soisno8,t_soisno9,t_soisno10, &
3033 dzsnow1,dzsnow2,dzsnow3,dzsnow4,dzsnow5, &
3034 snowrds1,snowrds2,snowrds3,snowrds4,snowrds5, &
3035 t_lake1,t_lake2,t_lake3,t_lake4,t_lake5, &
3036 t_lake6,t_lake7,t_lake8,t_lake9,t_lake10, &
3037 h2osoi_vol1,h2osoi_vol2,h2osoi_vol3, &
3038 h2osoi_vol4,h2osoi_vol5,h2osoi_vol6, &
3039 h2osoi_vol7,h2osoi_vol8, &
3040 h2osoi_vol9,h2osoi_vol10, &
3041 ALBEDOsubgrid,LHsubgrid,HFXsubgrid,LWUPsubgrid, &
3042 Q2subgrid,SABVsubgrid,SABGsubgrid,NRAsubgrid, &
3043 SWUPsubgrid,lhsoi,lhtran,lhveg
3044 #if (WRF_USE_CLM == 1) && ( WRF_CHEM == 1 )
3045 LOGICAL, INTENT(IN) :: megan_mapped_emisfctrs
3046 CHARACTER(LEN=*), INTENT(IN) :: megan_factors_file
3047 CHARACTER(LEN=*), INTENT(IN) :: megan_specifier(:)
3051 ! Added flag to read MEGANv2.1 file initially BJG 3/28/19
3052 LOGICAL :: do_readmeganfile
3056 !-------------------------------------------------
3057 ! Noah-mosaic related variables are added to declaration (danli)
3058 !-------------------------------------------------
3060 INTEGER, INTENT(IN) :: sf_surface_mosaic, NLCAT
3061 INTEGER, INTENT(IN) :: mosaic_cat
3062 REAL, DIMENSION( ims:ime, NLCAT, jms:jme ) , INTENT(IN):: LANDUSEF
3063 REAL, DIMENSION( ims:ime, NLCAT, jms:jme ) , INTENT(INOUT):: LANDUSEF2
3064 INTEGER, DIMENSION( ims:ime, NLCAT, jms:jme ), INTENT(INOUT) :: mosaic_cat_index
3066 REAL, DIMENSION( ims:ime, 1:mosaic_cat, jms:jme ) , OPTIONAL, INTENT(INOUT):: TSK_mosaic, CANWAT_mosaic, SNOW_mosaic,SNOWH_mosaic, SNOWC_mosaic
3067 REAL, DIMENSION( ims:ime, jms:jme ) , INTENT(INOUT):: ALBEDO,ALBBCK, EMISS, EMBCK
3069 REAL, DIMENSION( ims:ime, 1:mosaic_cat, jms:jme ) , OPTIONAL, INTENT(INOUT):: ALBEDO_mosaic,ALBBCK_mosaic, EMISS_mosaic, EMBCK_mosaic, ZNT_mosaic, Z0_mosaic
3071 REAL, DIMENSION( ims:ime, 1:num_soil_layers*mosaic_cat, jms:jme ), OPTIONAL, INTENT(INOUT):: TSLB_mosaic,SMOIS_mosaic,SH2O_mosaic
3073 REAL, DIMENSION( ims:ime, 1:mosaic_cat, jms:jme ) , OPTIONAL, INTENT(INOUT):: TR_URB2D_mosaic, TB_URB2D_mosaic, TG_URB2D_mosaic, TC_URB2D_mosaic,QC_URB2D_mosaic, &
3074 SH_URB2D_mosaic,LH_URB2D_mosaic,G_URB2D_mosaic,RN_URB2D_mosaic,TS_URB2D_mosaic, TS_RUL2D_mosaic
3076 REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers*mosaic_cat, jms:jme ), INTENT(INOUT) :: TRL_URB3D_mosaic
3077 REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers*mosaic_cat, jms:jme ), INTENT(INOUT) :: TBL_URB3D_mosaic
3078 REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers*mosaic_cat, jms:jme ), INTENT(INOUT) :: TGL_URB3D_mosaic
3080 REAL :: xice_threshold ! lake input
3081 REAL :: max_utype_urb2d
3084 !-------------------------------------------------
3085 ! End of Noah-mosaic related variables
3086 !-------------------------------------------------
3089 INTEGER,OPTIONAL,INTENT(OUT), DIMENSION( ims:ime,jms:jme):: irr_rand_field
3090 INTEGER,OPTIONAL :: irr_ph,irr_freq
3092 ! To accommodate shared physics
3093 character*256 :: errmsg
3096 #if ( EM_CORE == 1 )
3098 INTEGER :: mynn_closure_level
3101 if ( config_flags%fractional_seaice == 0 ) then
3102 xice_threshold = 0.5
3103 else if ( config_flags%fractional_seaice == 1 ) then
3104 xice_threshold = 0.02
3107 !-- calculate pbl time step
3109 STEPBL = nint(BLDT*60./DT)
3110 STEPBL = max(STEPBL,1)
3113 IF(PRESENT(ACHFX))THEN
3114 IF(.not.restart)THEN
3126 IF(PRESENT(TSK_SAVE))THEN
3127 IF(.NOT.restart .AND. config_flags%fractional_seaice.EQ.1)THEN
3130 TSK_SAVE(i,j)=TSK(i,j)
3136 !-- initialize surface layer scheme
3138 sfclay_select: SELECT CASE(config_flags%sf_sfclay_physics)
3141 CALL sfclayinit( allowed_to_read )
3143 CASE (SFCLAYREVSCHEME)
3144 CALL sf_sfclayrev_init(errmsg,errflg)
3145 IF ( shalwater_z0 .EQ. 1 ) THEN
3146 CALL shalwater_init(ims,ime,jms,jme, &
3148 bathymetry_flag, shalwater_z0, &
3149 shalwater_depth, water_depth, &
3150 xland,LakeModel,lake_depth,lakemask )
3154 CALL pxsfclayinit( allowed_to_read )
3157 CALL myjsfcinit(LOWLYR,UST, &
3158 #if ( NMM_CORE == 1 )
3166 ids, ide, jds, jde, kds, kde, &
3167 ims, ime, jms, jme, kms, kme, &
3168 its, ite, jts, jte, kts, kte )
3171 CASE (QNSESFCSCHEME)
3172 CALL qnsesfcinit(LOWLYR,UST, &
3173 #if ( NMM_CORE == 1 )
3181 ids, ide, jds, jde, kds, kde, &
3182 ims, ime, jms, jme, kms, kme, &
3183 its, ite, jts, jte, kts, kte )
3187 CALL myjsfcinit(LOWLYR,UST, &
3188 #if ( NMM_CORE == 1 )
3196 ids, ide, jds, jde, kds, kde, &
3197 ims, ime, jms, jme, kms, kme, &
3198 its, ite, jts, jte, kts, kte )
3201 CASE (GFDLSFCSCHEME)
3202 CALL myjsfcinit(LOWLYR,UST, &
3207 ids, ide, jds, jde, kds, kde, &
3208 ims, ime, jms, jme, kms, kme, &
3209 its, ite, jts, jte, kts, kte )
3213 #if ( EM_CORE == 1 )
3216 CASE (MYNNSFCSCHEME)
3218 CALL mynn_sf_init_driver(allowed_to_read)
3222 CASE (TEMFSFCSCHEME)
3223 CALL wrf_debug( 100, 'calling temfsfclayinit' )
3224 CALL temfsfclayinit( restart, allowed_to_read , &
3226 ids, ide, jds, jde, kds, kde, &
3227 ims, ime, jms, jme, kms, kme, &
3228 its, ite, jts, jte, kts, kte )
3233 END SELECT sfclay_select
3236 !-- initialize surface scheme
3238 sfc_select: SELECT CASE(config_flags%sf_surface_physics)
3242 CALL slabinit(TSK,TMN, &
3243 TSLB,ZS,DZS,num_soil_layers, &
3244 allowed_to_read ,start_of_simulation ,&
3245 ids, ide, jds, jde, kds, kde, &
3246 ims, ime, jms, jme, kms, kme, &
3247 its, ite, jts, jte, kts, kte )
3251 CALL hwrfsfcinit(isn,XICE,VEGFRA,SNOW,SNOWC, CANWAT,SMSTAV, &
3252 SMSTOT, SFCRUNOFF,UDRUNOFF,GRDFLX,ACSNOW, &
3253 ACSNOM,IVGTYP,ISLTYP,TSLB,SMOIS,DZS,SFCEVP, &
3257 ids,ide, jds,jde, kds,kde, &
3258 ims,ime, jms,jme, kms,kme, &
3259 its,ite, jts,jte, kts,kte )
3264 IF(TRIM(mminlu) .EQ. 'NLCD40')THEN
3265 CALL wrf_message('Using NLCD40 for Noah, redefine urban categories ')
3268 IF(IVGTYP(i,j)==23) IVGTYP(i,j) = 24
3269 IF(IVGTYP(i,j)==25) IVGTYP(i,j) = 24
3274 CALL LSMINIT(VEGFRA,SNOW,SNOWC,SNOWH,CANWAT,SMSTAV, &
3275 SMSTOT, SFCRUNOFF,UDRUNOFF,ACSNOW, &
3276 ACSNOM,IVGTYP,ISLTYP,TSLB,SMOIS,SH2O,ZS,DZS, &
3278 SNOALB, FNDSOILW, FNDSNOWH, RDMAXALB, &
3279 num_soil_layers, restart, &
3281 irr_rand_field,irr_ph,irr_freq, &
3282 ids,ide, jds,jde, kds,kde, &
3283 ims,ime, jms,jme, kms,kme, &
3284 its,ite, jts,jte, kts,kte &
3289 IF ((SF_URBAN_PHYSICS.eq.1).OR.(SF_URBAN_PHYSICS.EQ.2).OR.(SF_URBAN_PHYSICS.EQ.3)) THEN
3291 IF ( PRESENT( FRC_URB2D ) .AND. PRESENT( UTYPE_URB2D )) THEN
3292 CALL urban_param_init(DZR,DZB,DZG,num_soil_layers, & !urban
3293 sf_urban_physics,config_flags%use_wudapt_lcz, &
3294 config_flags%slucm_distributed_drag)
3296 CALL urban_var_init(ISURBAN,TSK,TSLB,TMN,IVGTYP, & !urban
3297 ims,ime,jms,jme,kms,kme,num_soil_layers, & !urban
3298 LCZ_1,LCZ_2,LCZ_3,LCZ_4,LCZ_5, &
3299 LCZ_6,LCZ_7,LCZ_8,LCZ_9,LCZ_10,LCZ_11, &
3300 restart,sf_urban_physics, & !urban
3301 XXXR_URB2D,XXXB_URB2D,XXXG_URB2D,XXXC_URB2D, & !urban
3302 TR_URB2D,TB_URB2D,TG_URB2D,TC_URB2D,QC_URB2D, & !urban
3303 TRL_URB3D,TBL_URB3D,TGL_URB3D, & !urban
3304 SH_URB2D,LH_URB2D,G_URB2D,RN_URB2D, TS_URB2D, & !urban
3305 num_urban_ndm, & !urban
3306 urban_map_zrd, & !urban
3307 urban_map_zwd, & !urban
3308 urban_map_gd, & !urban
3309 urban_map_zd, & !urban
3310 urban_map_zdf, & !urban
3311 urban_map_bd, & !urban
3312 urban_map_wd, & !urban
3313 urban_map_gbd, & !urban
3314 urban_map_fbd, & !urban
3315 urban_map_zgrd, & !urban
3316 num_urban_hi, & !urban
3317 TRB_URB4D,TW1_URB4D,TW2_URB4D,TGB_URB4D, & !urban
3318 TLEV_URB3D,QLEV_URB3D, & !urban
3319 TW1LEV_URB3D,TW2LEV_URB3D, & !urban
3320 TGLEV_URB3D,TFLEV_URB3D, & !urban
3321 SF_AC_URB3D,LF_AC_URB3D,CM_AC_URB3D, & !urban
3322 SFVENT_URB3D,LFVENT_URB3D, & !urban
3323 SFWIN1_URB3D,SFWIN2_URB3D, & !urban
3324 SFW1_URB3D,SFW2_URB3D,SFR_URB3D,SFG_URB3D, & !urban
3325 EP_PV_URB3D,T_PV_URB3D, & !GRZ
3326 TRV_URB4D,QR_URB4D,QGR_URB3D,TGR_URB3D, & !GRZ
3327 DRAIN_URB4D,DRAINGR_URB3D,SFRV_URB3D, & !GRZ
3328 LFRV_URB3D,DGR_URB3D,DG_URB3D,LFR_URB3D,LFG_URB3D,&!GRZ
3330 LP_URB2D,HI_URB2D,LB_URB2D, & !urban
3331 HGT_URB2D,MH_URB2D,STDH_URB2D, & !urban
3333 CMCR_URB2D,TGR_URB2D,TGRL_URB3D,SMR_URB3D, & !urban
3334 DRELR_URB2D,DRELB_URB2D,DRELG_URB2D, & !urban
3335 FLXHUMR_URB2D, FLXHUMB_URB2D, FLXHUMG_URB2D, & !urban
3336 A_U_BEP,A_V_BEP,A_T_BEP,A_Q_BEP, & !multi-layer urban
3337 A_E_BEP,B_U_BEP,B_V_BEP, & !multi-layer urban
3338 B_T_BEP,B_Q_BEP,B_E_BEP,DLG_BEP, & !multi-layer urban
3339 DL_U_BEP,SF_BEP,VL_BEP, & !multi-layer urban
3340 FRC_URB2D, UTYPE_URB2D,config_flags%use_wudapt_lcz) !urban
3343 max_utype_urb2d = maxval(UTYPE_URB2D)*1.0
3344 #if ( defined( DM_PARALLEL ) && ( ! defined( STUBMPI ) ) )
3345 max_utype_urb2d = wrf_dm_max_real(max_utype_urb2d)
3347 IF (config_flags%use_wudapt_lcz.eq.0 .and. max_utype_urb2d.gt.3.0) THEN !new LCZ
3348 CALL wrf_error_fatal &
3349 ('USING 10 WUDAPT LCZ WITHOUT URBPARM_LCZ.TBL. SET USE_WUDAPT_LCZ=1')
3351 IF (config_flags%use_wudapt_lcz.eq.1 .and. max_utype_urb2d.le.3.0) THEN ! new LCZ
3352 CALL wrf_error_fatal &
3353 ('USING URBPARM_LCZ.TBL WITH OLD 3 URBAN CLASSES. SET USE_WUDAPT_LCZ=0')
3358 CALL wrf_error_fatal ( 'arguments not present for calling urban model' )
3364 IF (SF_surface_mosaic.eq.1) THEN
3366 CALL lsm_mosaic_init(IVGTYP,config_flags%ISWATER,config_flags%ISURBAN,config_flags%ISICE, XLAND, XICE,config_flags%fractional_seaice,TSK,TSLB,SMOIS,SH2O,SNOW,SNOWC,SNOWH,CANWAT, &
3367 ids,ide, jds,jde, kds,kde, &
3368 ims,ime, jms,jme, kms,kme, &
3369 its,ite, jts,jte, kts,kte, restart, &
3370 landusef,landusef2,NLCAT,num_soil_layers &
3371 ,sf_surface_mosaic, mosaic_cat &
3372 , mosaic_cat_index &
3373 ,TSK_mosaic,TSLB_mosaic &
3374 ,SMOIS_mosaic,SH2O_mosaic &
3375 ,CANWAT_mosaic,SNOW_mosaic &
3376 ,SNOWH_mosaic,SNOWC_mosaic &
3377 ,ALBEDO,ALBBCK, EMISS, EMBCK, & !danli
3378 #if ( NMM_CORE == 1 )
3383 ALBEDO_mosaic,ALBBCK_mosaic, EMISS_mosaic, EMBCK_mosaic, ZNT_mosaic, Z0_mosaic & !danli
3384 ,TR_URB2D_mosaic,TB_URB2D_mosaic & !danli mosaic
3385 ,TG_URB2D_mosaic,TC_URB2D_mosaic & !danli mosaic
3386 ,QC_URB2D_mosaic & !danli mosaic
3387 ,TRL_URB3D_mosaic,TBL_URB3D_mosaic & !danli mosaic
3388 ,TGL_URB3D_mosaic & !danli mosaic
3389 ,SH_URB2D_mosaic,LH_URB2D_mosaic & !danli mosaic
3390 ,G_URB2D_mosaic,RN_URB2D_mosaic & !danli mosaic
3391 ,TS_URB2D_mosaic & !danli mosaic
3392 ,TS_RUL2D_mosaic & !danli mosaic
3400 IF ( TRIM(mminlu) .EQ. 'NLCD40' ) THEN
3401 CALL wrf_error_fatal ( 'NoahMP does not work with NLCD data. Stop.' )
3404 CALL NOAHMP_INIT(MMINLU, SNOW,SNOWH,CANWAT,ISLTYP,IVGTYP,XLAT, &
3405 TSLB,SMOIS,SH2O,DZS, FNDSOILW, FNDSNOWH, &
3406 TSK,isnowxy ,tvxy ,tgxy ,canicexy ,TMN,XICE, &
3407 canliqxy ,eahxy ,tahxy ,cmxy ,chxy , &
3408 fwetxy ,sneqvoxy ,alboldxy ,qsnowxy ,qrainxy, wslakexy, zwtxy, waxy,&
3409 wtxy ,tsnoxy ,zsnsoxy ,snicexy ,snliqxy ,lfmassxy ,rtmassxy , &
3410 stmassxy ,woodxy ,stblcpxy ,fastcpxy ,xsaixy ,lai , &
3412 croptype ,cropcat , &
3413 irnumsi ,irnummi ,irnumfi ,irwatsi, &
3414 irwatmi ,irwatfi ,ireloss ,irsivol, &
3415 irmivol ,irfivol ,irrsplh , &
3416 t2mvxy ,t2mbxy ,chstarxy , &
3417 num_soil_layers, restart, &
3418 allowed_to_read, iopt_run , iopt_crop, &
3419 iopt_irr, iopt_irrm, &
3420 sf_urban_physics, & ! urban scheme
3421 ids,ide, jds,jde, kds,kde, &
3422 ims,ime, jms,jme, kms,kme, &
3423 its,ite, jts,jte, kts,kte &
3425 ,smoiseq ,smcwtdxy ,rechxy ,deeprechxy, qtdrain, areaxy ,dx, dy, msftx, msfty,&
3426 wtddt ,stepwtd ,dt ,qrfsxy ,qspringsxy ,qslatxy, &
3427 fdepthxy ,ht ,riverbedxy ,eqzwt ,rivercondxy ,pexpxy, &
3429 gecros_state & ! Optional gecros crop
3433 IF ((SF_URBAN_PHYSICS.eq.1).OR.(SF_URBAN_PHYSICS.EQ.2).OR.(SF_URBAN_PHYSICS.EQ.3)) THEN
3434 IF ( PRESENT( FRC_URB2D ) .AND. PRESENT( UTYPE_URB2D )) THEN
3435 CALL urban_param_init(DZR,DZB,DZG,num_soil_layers, & !urban
3436 sf_urban_physics,config_flags%use_wudapt_lcz, &
3437 config_flags%slucm_distributed_drag)
3438 CALL urban_var_init(ISURBAN,TSK,TSLB,TMN,IVGTYP, & !urban
3439 ims,ime,jms,jme,kms,kme,num_soil_layers, & !urban
3440 LCZ_1_TABLE,LCZ_2_TABLE,LCZ_3_TABLE,LCZ_4_TABLE, & !urban
3441 LCZ_5_TABLE,LCZ_6_TABLE,LCZ_7_TABLE,LCZ_8_TABLE, & !urban
3442 LCZ_9_TABLE,LCZ_10_TABLE,LCZ_11_TABLE, & !urban
3443 restart,sf_urban_physics, & !urban
3444 XXXR_URB2D,XXXB_URB2D,XXXG_URB2D,XXXC_URB2D, & !urban
3445 TR_URB2D,TB_URB2D,TG_URB2D,TC_URB2D,QC_URB2D, & !urban
3446 TRL_URB3D,TBL_URB3D,TGL_URB3D, & !urban
3447 SH_URB2D,LH_URB2D,G_URB2D,RN_URB2D, TS_URB2D, & !urban
3448 num_urban_ndm, & !urban
3449 urban_map_zrd, & !urban
3450 urban_map_zwd, & !urban
3451 urban_map_gd, & !urban
3452 urban_map_zd, & !urban
3453 urban_map_zdf, & !urban
3454 urban_map_bd, & !urban
3455 urban_map_wd, & !urban
3456 urban_map_gbd, & !urban
3457 urban_map_fbd, & !urban
3458 urban_map_zgrd, & !urban
3459 num_urban_hi, & !urban
3460 TRB_URB4D,TW1_URB4D,TW2_URB4D,TGB_URB4D, & !urban
3461 TLEV_URB3D,QLEV_URB3D, & !urban
3462 TW1LEV_URB3D,TW2LEV_URB3D, & !urban
3463 TGLEV_URB3D,TFLEV_URB3D, & !urban
3464 SF_AC_URB3D,LF_AC_URB3D,CM_AC_URB3D, & !urban
3465 SFVENT_URB3D,LFVENT_URB3D, & !urban
3466 SFWIN1_URB3D,SFWIN2_URB3D, & !urban
3467 SFW1_URB3D,SFW2_URB3D,SFR_URB3D,SFG_URB3D, & !urban
3468 EP_PV_URB3D,T_PV_URB3D, & !GRZ
3469 TRV_URB4D,QR_URB4D,QGR_URB3D,TGR_URB3D, & !GRZ
3470 DRAIN_URB4D,DRAINGR_URB3D,SFRV_URB3D, & !GRZ
3471 LFRV_URB3D,DGR_URB3D,DG_URB3D,LFR_URB3D,LFG_URB3D,&!GRZ
3473 LP_URB2D,HI_URB2D,LB_URB2D, & !urban
3474 HGT_URB2D,MH_URB2D,STDH_URB2D, & !urban
3476 CMCR_URB2D,TGR_URB2D,TGRL_URB3D,SMR_URB3D, & !urban
3477 DRELR_URB2D,DRELB_URB2D,DRELG_URB2D, & !urban
3478 FLXHUMR_URB2D, FLXHUMB_URB2D, FLXHUMG_URB2D, & !urban
3479 A_U_BEP,A_V_BEP,A_T_BEP,A_Q_BEP, & !multi-layer urban
3480 A_E_BEP,B_U_BEP,B_V_BEP, & !multi-layer urban
3481 B_T_BEP,B_Q_BEP,B_E_BEP,DLG_BEP, & !multi-layer urban
3482 DL_U_BEP,SF_BEP,VL_BEP, & !multi-layer urban
3483 FRC_URB2D, UTYPE_URB2D,config_flags%use_wudapt_lcz)!urban
3485 max_utype_urb2d = maxval(UTYPE_URB2D)*1.0
3486 #if ( defined( DM_PARALLEL ) && ( ! defined( STUBMPI ) ) )
3487 max_utype_urb2d = wrf_dm_max_real(max_utype_urb2d)
3490 IF (config_flags%use_wudapt_lcz.eq.0 .and. max_utype_urb2d.gt.3.) THEN !new LCZ
3491 CALL wrf_error_fatal &
3492 ('USING 10 WUDAPT LCZ WITHOUT URBPARM_LCZ.TBL. SET USE_WUDAPT_LCZ=1')
3494 IF (config_flags%use_wudapt_lcz.eq.1 .and. max_utype_urb2d.le.3.) THEN ! new LCZ
3495 CALL wrf_error_fatal &
3496 ('USING URBPARM_LCZ.TBL WITH OLD 3 URBAN CLASSES. SET USE_WUDAPT_LCZ=0')
3501 CALL wrf_error_fatal ( 'arguments not present for calling urban model' )
3506 ! if(isfc .ne. 2)CALL wrf_error_fatal &
3507 ! ( 'module_physics_init: use myjsfc and myjpbl scheme for this lsm option' )
3508 CALL ruclsminit( SH2O,SMFR3D,TSLB,SMOIS,ISLTYP,IVGTYP,MMINLU,XICE, &
3509 mavail,num_soil_layers, config_flags%iswater, &
3511 config_flags%isice, z0, restart, &
3513 config_flags%isice, znt, restart, &
3516 ids,ide, jds,jde, kds,kde, &
3517 ims,ime, jms,jme, kms,kme, &
3518 its,ite, jts,jte, kts,kte )
3521 if(config_flags%num_land_cat .ne. 20 .and. config_flags%num_land_cat .ne. 21 .and. & ! MODIS
3522 config_flags%num_land_cat .ne. 24 .and. config_flags%num_land_cat .ne. 28 .and. & ! USGS
3523 config_flags%num_land_cat .ne. 40 .and. config_flags%num_land_cat .ne. 50 .and. & ! NLCD
3524 config_flags%num_land_cat .ne. 61 ) & ! MODIS W/LCZ
3525 CALL wrf_error_fatal ( 'module_physics_init: PX LSM option requires USGS, MODIS, or NLCD' )
3526 CALL LSMINIT(VEGFRA,SNOW,SNOWC,SNOWH,CANWAT,SMSTAV, &
3527 SMSTOT, SFCRUNOFF,UDRUNOFF,ACSNOW, &
3528 ACSNOM,IVGTYP,ISLTYP,TSLB,SMOIS,SH2O,ZS,DZS, &
3530 SNOALB, FNDSOILW, FNDSNOWH, RDMAXALB, &
3531 num_soil_layers, restart, &
3533 irr_rand_field,irr_ph,irr_freq, &
3534 ids,ide, jds,jde, kds,kde, &
3535 ims,ime, jms,jme, kms,kme, &
3536 its,ite, jts,jte, kts,kte )
3538 !--------------fds (06/2010)-----------------------------------
3540 !SSiB only works with sfclay and YSU schemes. Check this here!
3541 if(isfc .ne. 1)CALL wrf_error_fatal &
3542 ( 'module_physics_init: use sfclay scheme with SSiB' )
3543 if(config_flags%bl_pbl_physics .ne. 1)CALL wrf_error_fatal &
3544 ( 'module_physics_init: use ysu scheme with SSiB' )
3545 ! Add radiation scheme 4 (RRTMg) for SSiB, By Zhenxin 2011-06-20 ************************
3546 if(config_flags%ra_lw_physics .eq. 2 .or. config_flags%ra_lw_physics .gt. 4)CALL wrf_error_fatal &
3547 ( 'module_physics_init: SSiB only works with rrtm, cam scheme or rrtmg scheme (lw_phys=1,3,4)' )
3548 if(config_flags%ra_sw_physics .eq. 2 .or. config_flags%ra_sw_physics .gt. 4)CALL wrf_error_fatal &
3549 ( 'module_physics_init: SSiB only works with rrtm, cam scheme or rrtmg scheme (sw_phys=1,3,4)' )
3550 ! End of Adding radiation scheme 4 (RRTMg) for SSiB, By Zhenxin 2011-06-20 **************
3551 IF ( TRIM(mminlu) .EQ. 'NLCD40' ) THEN
3552 CALL wrf_error_fatal ( 'SSIB does not work with NLCD data. Stop.' )
3554 !--------------------------------------------------------------
3557 IF ((SF_URBAN_PHYSICS.eq.1).OR.(SF_URBAN_PHYSICS.EQ.2).OR.(SF_URBAN_PHYSICS.EQ.3)) THEN
3558 CALL wrf_error_fatal ( 'CLM DOES NOT WORK WITH URBAN SCHEME' )
3560 IF ( TRIM(mminlu) .EQ. 'NLCD40' ) THEN
3561 CALL wrf_error_fatal ( 'CLM does not work with NLCD input. Stop' )
3565 ! Test here to see if MEGANv2.1 file should be read. bio_emiss_opt should only
3566 ! be referenced if WRF_CHEM is compiled. BJG 3/29/19
3568 do_readmeganfile = .false.
3570 IF(PRESENT(numc))THEN
3571 ! added by Jiming Jin 10/14/2012 ; modified to use MODIS data 3/6/2014
3572 if((config_flags%num_land_cat .ne. 24) .AND. &
3573 (config_flags%num_land_cat .ne. 28) .AND. &
3574 (config_flags%num_land_cat .ne. 21) .AND. &
3575 (config_flags%num_land_cat .ne. 20)) CALL wrf_error_fatal &
3576 ('module_physics_init: USGS or MODIS must be used with CLM option')
3578 #if ( WRF_CHEM == 1 )
3579 if( config_flags%bio_emiss_opt == MEGAN2_CLM ) then
3580 do_readmeganfile = .true.
3584 CALL CLMINIT(VEGFRA,SNOW,SNOWC,SNOWH,CANWAT,SMSTAV, &
3585 SMSTOT, SFCRUNOFF,UDRUNOFF,ACSNOW, &
3586 ACSNOM,IVGTYP,ISLTYP,TSLB,SMOIS,SH2O,ZS,DZS, &
3587 FNDSOILW, FNDSNOWH, &
3588 num_soil_layers, restart, &
3589 allowed_to_read, id, do_readmeganfile, &
3590 ids,ide, jds,jde, kds,kde, &
3591 ims,ime, jms,jme, kms,kme, &
3592 its,ite, jts,jte, kts,kte, &
3593 #if ( WRF_CHEM == 1 )
3595 megan_mapped_emisfctrs, &
3596 megan_factors_file, &
3600 snowdp,wtc,wtp,h2osno,t_grnd,t_veg, &
3601 h2ocan,h2ocan_col,t2m_max,t2m_min,t_ref2m, &
3603 h2osoi_liq_s2,h2osoi_liq_s3,h2osoi_liq_s4, &
3604 h2osoi_liq_s5,h2osoi_liq1,h2osoi_liq2, &
3605 h2osoi_liq3,h2osoi_liq4,h2osoi_liq5,h2osoi_liq6, &
3606 h2osoi_liq7,h2osoi_liq8,h2osoi_liq9,h2osoi_liq10, &
3607 h2osoi_ice_s1,h2osoi_ice_s2, &
3608 h2osoi_ice_s3,h2osoi_ice_s4,h2osoi_ice_s5, &
3609 h2osoi_ice1,h2osoi_ice2,h2osoi_ice3,h2osoi_ice4, &
3610 h2osoi_ice5,h2osoi_ice6,h2osoi_ice7, &
3611 h2osoi_ice8,h2osoi_ice9,h2osoi_ice10, &
3612 t_soisno_s1,t_soisno_s2,t_soisno_s3,t_soisno_s4, &
3613 t_soisno_s5,t_soisno1,t_soisno2,t_soisno3, &
3614 t_soisno4,t_soisno5,t_soisno6,t_soisno7, &
3615 t_soisno8,t_soisno9,t_soisno10, &
3616 dzsnow1,dzsnow2,dzsnow3,dzsnow4,dzsnow5, &
3617 snowrds1,snowrds2,snowrds3,snowrds4,snowrds5, &
3618 t_lake1,t_lake2,t_lake3,t_lake4,t_lake5, &
3619 t_lake6,t_lake7,t_lake8,t_lake9,t_lake10, &
3620 h2osoi_vol1,h2osoi_vol2,h2osoi_vol3, &
3621 h2osoi_vol4,h2osoi_vol5,h2osoi_vol6, &
3622 h2osoi_vol7,h2osoi_vol8, &
3623 h2osoi_vol9,h2osoi_vol10, &
3625 ,ALBEDOsubgrid,LHsubgrid,HFXsubgrid,LWUPsubgrid, &
3626 Q2subgrid,SABVsubgrid,SABGsubgrid,NRAsubgrid, &
3627 SWUPsubgrid,lhsoi,lhveg,lhtran,config_flags%chem_opt &
3630 CALL wrf_error_fatal ( 'arguments not present for calling CLM' )
3632 !--------------------------------------------------------------
3633 ! check that t_veg /= 0
3634 !--------------------------------------------------------------
3635 if( itimestep == 0 ) then
3636 do patch = 1,maxpatch
3638 where( t_veg(its:ite,patch,j) == 0.)
3639 t_veg(its:ite,patch,j) = tslb(its:ite,1,j)
3645 CALL wrf_error_fatal ( "SF CLM CURRENTLY ifdef'ed out, set -DWRF_USE_CLM in configure.wrf in ARCH_LOCAL" )
3652 ids=ids, ide=ide, jds=jds, jde=jde, &
3653 ims=ims, ime=ime, jms=jms, jme=jme, &
3654 its=its, ite=ite, jts=jts, jte=jte, &
3655 dt=DT, xlat=XLAT, xlong=XLONG, &
3656 atm_restart = restart)
3661 END SELECT sfc_select
3663 #if ( EM_CORE == 1 )
3664 IF(PRESENT(SF_OCEAN_PHYSICS))THEN
3665 IF ( ( sf_ocean_physics .EQ. OMLSCHEME ) .OR. &
3666 ( sf_ocean_physics .EQ. PWP3DSCHEME ) ) THEN
3667 CALL omlinit(oml_hml0, tsk, &
3668 tml,t0ml,hml,h0ml,huml,hvml,tmoml, &
3669 allowed_to_read, start_of_simulation, &
3670 ids,ide, jds,jde, kds,kde, &
3671 ims,ime, jms,jme, kms,kme, &
3672 its,ite, jts,jte, kts,kte )
3677 IF ( LakeModel == 1 ) THEN
3679 call lakeini(IVGTYP, ISLTYP, HT, SNOW, & !i
3680 lake_min_elev, restart, lakedepth_default, lake_depth, &
3681 lakedepth2d, savedtke12d, snowdp2d, h2osno2d, & !o
3682 snl2d, t_grnd2d, t_lake3d, lake_icefrac3d, &
3683 z_lake3d, dz_lake3d, t_soisno3d, h2osoi_ice3d, &
3684 h2osoi_liq3d, h2osoi_vol3d, z3d, dz3d, &
3685 zi3d, watsat3d, csol3d, tkmg3d, &
3686 config_flags%ISWATER, xice, xice_threshold, xland, tsk, &
3688 lakemask, lakeflag, &
3690 lake_depth_flag, use_lakedepth, &
3691 tkdry3d, tksatu3d, lake2d, its, ite, jts, jte, &
3695 !-- initialize pbl scheme
3697 pbl_select: SELECT CASE(config_flags%bl_pbl_physics)
3700 if(isfc .ne. 1)CALL wrf_error_fatal &
3701 ( 'module_physics_init: Use sf_sfclay_physics= 1 or 91 for this pbl option' )
3702 CASE (SHINHONGSCHEME)
3703 if(isfc .ne. 1)CALL wrf_error_fatal &
3704 ( 'module_physics_init: Use sf_sfclay_physics= 1 or 91 for this pbl option' )
3705 IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) CALL wrf_error_fatal &
3706 ( 'module_physics_init: use ysu (option1), myj (option 2), or boulac (option 8) with BEP/BEM urban scheme' )
3707 CALL shinhonginit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN,&
3708 RQCBLTEN,RQIBLTEN,TKE_PBL,P_QI, &
3709 PARAM_FIRST_SCALAR, &
3712 ids, ide, jds, jde, kds, kde, &
3713 ims, ime, jms, jme, kms, kme, &
3714 its, ite, jts, jte, kts, kte )
3716 if(isfc .ne. 1)CALL wrf_error_fatal &
3717 ( 'module_physics_init: Use sf_sfclay_physics= 1 or 91 for this pbl option' )
3718 IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) CALL wrf_error_fatal &
3719 ( 'module_physics_init: use ysu (option1), myj (option 2), or boulac (option 8) with BEP/BEM urban scheme' )
3720 CALL mrfinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, &
3721 RQCBLTEN,RQIBLTEN,P_QI, &
3722 PARAM_FIRST_SCALAR, &
3725 ids, ide, jds, jde, kds, kde, &
3726 ims, ime, jms, jme, kms, kme, &
3727 its, ite, jts, jte, kts, kte )
3729 if(isfc .ne. 1 .and. isfc .ne. 7)CALL wrf_error_fatal &
3730 ( 'module_physics_init: use sfclay or pxsfc scheme for this pbl option' )
3731 IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) CALL wrf_error_fatal &
3732 ( 'module_physics_init: use ysu (option1), myj (option 2), or boulac (option 8) with BEP/BEM urban scheme' )
3733 CALL acminit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, &
3734 RQCBLTEN,RQIBLTEN,P_QI, &
3735 PARAM_FIRST_SCALAR, &
3738 ids, ide, jds, jde, kds, kde, &
3739 ims, ime, jms, jme, kms, kme, &
3740 its, ite, jts, jte, kts, kte )
3742 if(isfc .ne. 2)CALL wrf_error_fatal &
3743 ( 'module_physics_init: use myjsfc scheme for this pbl option' )
3744 IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) CALL wrf_error_fatal &
3745 ( 'module_physics_init: use ysu (option1), myj (option 2), or boulac (option 8) with BEP/BEM urban scheme' )
3746 CALL gfsinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, &
3747 RQCBLTEN,RQIBLTEN,P_QI, &
3748 PARAM_FIRST_SCALAR, &
3751 ids, ide, jds, jde, kds, kde, &
3752 ims, ime, jms, jme, kms, kme, &
3753 its, ite, jts, jte, kts, kte )
3755 CASE (GFSEDMFSCHEME)
3756 if(isfc .ne. 2)CALL wrf_error_fatal &
3757 ( 'module_physics_init: use myjsfc scheme for this pbl option' )
3758 IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) CALL wrf_error_fatal &
3759 ( 'module_physics_init: use ysu (option1), myj (option 2), or boulac (option 8) with BEP/BEM urban scheme' )
3760 CALL gfsedmfinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN,&
3761 RQCBLTEN,RQIBLTEN,P_QI, &
3762 PARAM_FIRST_SCALAR, &
3765 ids, ide, jds, jde, kds, kde, &
3766 ims, ime, jms, jme, kms, kme, &
3767 its, ite, jts, jte, kts, kte )
3771 if(isfc .ne. 2)CALL wrf_error_fatal &
3772 ( 'module_physics_init: use myjsfc scheme for this pbl option' )
3773 IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) THEN
3774 CALL myjurbinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, &
3775 TKE_PBL,EXCH_H,restart, &
3777 ids, ide, jds, jde, kds, kde, &
3778 ims, ime, jms, jme, kms, kme, &
3779 its, ite, jts, jte, kts, kte )
3782 CALL myjpblinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, &
3783 TKE_PBL,EXCH_H,restart, &
3785 ids, ide, jds, jde, kds, kde, &
3786 ims, ime, jms, jme, kms, kme, &
3787 its, ite, jts, jte, kts, kte )
3789 CASE (QNSEPBLSCHEME)
3790 if(isfc .ne. 4)CALL wrf_error_fatal &
3791 ( 'module_physics_init: use qnsesfc scheme for this pbl option' )
3792 IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) CALL wrf_error_fatal &
3793 ( 'module_physics_init: use ysu (option1), myj (option 2), or boulac (option 8) with BEP/BEM urban scheme' )
3794 CALL qnsepblinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, &
3795 TKE_PBL,EXCH_H,restart, &
3797 ids, ide, jds, jde, kds, kde, &
3798 ims, ime, jms, jme, kms, kme, &
3799 its, ite, jts, jte, kts, kte )
3801 ! IF ( PRESENT (mfshconv) ) THEN
3802 if (mfshconv.EQ.1) &
3803 CALL mfshconvpblinit( massflux_EDKF, entr_EDKF, detr_EDKF &
3804 ,thl_up, thv_up, rt_up &
3805 ,rv_up, rc_up, u_up, v_up &
3806 ,frac_up, restart, &
3808 ids, ide, jds, jde, kds, kde, &
3809 ims, ime, jms, jme, kms, kme, &
3810 its, ite, jts, jte, kts, kte )
3815 if(isfc .ne. 1 .and. isfc .ne. 2)CALL wrf_error_fatal &
3816 ( 'module_physics_init: use sfclay or myjsfc scheme for this pbl option' )
3817 CALL boulacinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN,RQCBLTEN, &
3818 TKE_PBL,EXCH_H,restart, &
3820 ids, ide, jds, jde, kds, kde, &
3821 ims, ime, jms, jme, kms, kme, &
3822 its, ite, jts, jte, kts, kte )
3823 CASE (CAMUWPBLSCHEME)
3824 IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) CALL wrf_error_fatal &
3825 ( 'module_physics_init: use ysu (option1), myj (option 2), or boulac (option 8) with BEP/BEM urban scheme' )
3826 CALL camuwpblinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, &
3827 restart,TKE_PBL,is_CAMMGMP_used, &
3828 ids, ide, jds, jde, kds, kde, &
3829 ims, ime, jms, jme, kms, kme, &
3830 its, ite, jts, jte, kts, kte )
3833 #if ( EM_CORE == 1 )
3837 CASE (MYNNPBLSCHEME)
3838 IF(isfc .NE. 5 .AND. isfc .NE. 1 .AND. isfc .NE. 2) CALL wrf_error_fatal &
3839 ( 'module_physics_init: use mynnsfc or sfclay or myjsfc scheme for this pbl option')
3840 IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) CALL wrf_error_fatal &
3841 ( 'module_physics_init: use ysu (option1), myj (option 2), or boulac (option 8) with BEP/BEM urban scheme' )
3843 CALL mynnedmf_wrapper_init( &
3844 &RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN,RQCBLTEN, &
3846 &restart,allowed_to_read, &
3847 &P_QC,P_QI,PARAM_FIRST_SCALAR, &
3848 &IDS,IDE,JDS,JDE,KDS,KDE, &
3849 &IMS,IME,JMS,JME,KMS,KME, &
3850 &ITS,ITE,JTS,JTE,KTS,KTE )
3852 CASE (TEMFPBLSCHEME)
3853 ! if(isfc .ne. 0)CALL wrf_error_fatal &
3854 ! ( 'module_physics_init: use sfclay scheme = 0 for this pbl option' )
3855 IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) CALL wrf_error_fatal &
3856 ( 'module_physics_init: use ysu (option1), myj (option 2), or boulac (option 8) with BEP/BEM urban scheme' )
3857 IF ( PRESENT( te_temf ) .AND. PRESENT( cf3d_temf )) THEN
3858 CALL temfinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, &
3859 RQCBLTEN,RQIBLTEN,P_QI, &
3860 PARAM_FIRST_SCALAR, &
3863 te_temf,cf3d_temf, & ! WA
3864 ids, ide, jds, jde, kds, kde, &
3865 ims, ime, jms, jme, kms, kme, &
3866 its, ite, jts, jte, kts, kte )
3868 CALL wrf_error_fatal ( 'arguments not present for calling TEMF scheme' )
3872 IF(isfc .ne. 1 .and. isfc .ne. 2 .and. isfc .ne. 5 .and. isfc .ne. 91) CALL wrf_error_fatal &
3873 ( 'module_physics_init: use mynnsfc or sfclay or myjsfc schemefor this pbl option')
3874 IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) CALL wrf_error_fatal &
3875 ( 'module_physics_init: use myj (option 2) or boulac (option 8) with BEP/BEM urban scheme' )
3876 IF ( PRESENT( pek ) .AND. PRESENT( pep ) ) THEN
3877 CALL eepsinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, &
3878 RQCBLTEN,RQIBLTEN,P_QI, &
3879 PARAM_FIRST_SCALAR,pek,pep, &
3882 ids, ide, jds, jde, kds, kde, &
3883 ims, ime, jms, jme, kms, kme, &
3884 its, ite, jts, jte, kts, kte )
3886 CALL wrf_error_fatal ( 'arguments not present for calling EEPS scheme' )
3892 if(isfc .ne. 1)CALL wrf_error_fatal &
3893 ( 'module_physics_init: Use sf_sfclay_physics= 1 or 91 for this pbl option' )
3894 CALL gbmpblinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, &
3895 RQCBLTEN,RQIBLTEN,P_QI, &
3896 PARAM_FIRST_SCALAR,TKE_PBL, &
3898 restart,allowed_to_read , &
3899 ids, ide, jds, jde, kds, kde, &
3900 ims, ime, jms, jme, kms, kme, &
3901 its, ite, jts, jte, kts, kte )
3903 #if ( WRFPLUS == 1 )
3904 CASE (SURFDRAGSCHEME)
3905 CALL surface_drag_init(RUBLTEN,RVBLTEN,RTHBLTEN, &
3907 ids, ide, jds, jde, kds, kde, &
3908 ims, ime, jms, jme, kms, kme, &
3909 its, ite, jts, jte, kts, kte )
3915 END SELECT pbl_select
3918 END SUBROUTINE bl_init
3920 !==================================================================
3921 SUBROUTINE cu_init(DX,STEPCU,CUDT,DT,RUCUTEN,RVCUTEN,RTHCUTEN, &
3922 RQVCUTEN,RQRCUTEN,RQCCUTEN,RQSCUTEN,RQICUTEN,&
3923 NCA,RAINC,RAINCV,W0AVG,config_flags,restart, &
3925 MASS_FLUX, RTHFTEN, RQVFTEN, &
3926 #if ( EM_CORE == 1 )
3927 !BSINGH - For WRFCuP Scheme
3928 cupflag,cldfra_cup,cldfratend_cup, & !CuP, wig 18-Sep-2006
3929 shall, & !CuP, wig 18-Sep-2006
3930 tcloud_cup, & !CuP, rce 18-apr-2012
3933 APR_GR,APR_W,APR_MC,APR_ST,APR_AS, &
3934 APR_CAPMA,APR_CAPME,APR_CAPMI, &
3935 cugd_tten,cugd_ttens,cugd_qvten, &
3936 cugd_qvtens,cugd_qcten, &
3937 allowed_to_read, start_of_simulation, &
3938 ids, ide, jds, jde, kds, kde, &
3939 ims, ime, jms, jme, kms, kme, &
3940 its, ite, jts, jte, kts, kte, &
3941 RQCNCUTEN,RQINCUTEN)
3942 !------------------------------------------------------------------
3947 USE module_cu_gd, ONLY : GDINIT
3948 USE module_cu_g3, ONLY : G3INIT
3950 USE module_cu_scalesas
3952 USE module_cu_camzm_driver, ONLY : zm_conv_init
3954 USE module_cu_tiedtke
3955 USE module_cu_ntiedtke
3956 #if ( EM_CORE == 1 )
3957 USE module_cu_kfcup !BSINGH - For WRFCuP Scheme
3959 #if ( WRFPLUS == 1 )
3960 USE module_cu_du, ONLY : ducuinit
3962 !------------------------------------------------------------------
3964 !------------------------------------------------------------------
3965 TYPE (grid_config_rec_type) :: config_flags
3966 LOGICAL , INTENT(IN) :: restart
3968 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
3969 ims, ime, jms, jme, kms, kme, &
3970 its, ite, jts, jte, kts, kte
3972 REAL , INTENT(IN) :: DT, CUDT, DX
3973 LOGICAL , INTENT(IN) :: start_of_simulation
3974 LOGICAL , INTENT(IN) :: allowed_to_read
3975 INTEGER , INTENT(INOUT) :: STEPCU
3977 REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: &
3978 RUCUTEN, RVCUTEN, RTHCUTEN, RQVCUTEN, RQCCUTEN, &
3979 RQRCUTEN, RQICUTEN, RQSCUTEN
3980 #if ( EM_CORE == 1 )
3981 !BSINGH - For WRFCuP Scheme
3982 REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: &
3983 cldfra_cup,cldfratend_cup !CuP, wig 18-Sep-2006
3987 REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , OPTIONAL, INTENT(INOUT) :: &
3988 cugd_tten,cugd_ttens,cugd_qvten, &
3989 cugd_qvtens,cugd_qcten, RQCNCUTEN, RQINCUTEN
3991 REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: W0AVG
3993 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: &!BSINGH(PNNL)- should be declared inout
3996 REAL , DIMENSION( ims:ime , jms:jme ), INTENT(OUT):: RAINC, RAINCV
3998 REAL , DIMENSION( ims:ime , jms:jme ), INTENT(OUT):: CLDEFI
3999 #if ( EM_CORE == 1 )
4000 !BSINGH - For WRFCuP Scheme
4001 REAL , DIMENSION( ims:ime , jms:jme ), INTENT(OUT):: shall, & !CuP, wig 18-Sep-2006
4002 tcloud_cup !CuP, rce 18-apr-2012
4003 LOGICAL, DIMENSION( ims:ime , jms:jme ), INTENT(OUT):: cupflag !CuP, wig 9-Oct-2006 !BSINGH - For WRFCuP Scheme
4007 REAL , DIMENSION( ims:ime , jms:jme ), INTENT(INOUT):: NCA
4009 REAL , DIMENSION( ims:ime , jms:jme ), INTENT(INOUT):: MASS_FLUX, &
4010 APR_GR,APR_W,APR_MC,APR_ST,APR_AS, &
4011 APR_CAPMA,APR_CAPME,APR_CAPMI
4012 INTEGER, DIMENSION( ims:ime , jms:jme ), INTENT(INOUT):: LOWLYR
4016 INTEGER :: i,j,itf,jtf
4018 !--------------------------------------------------------------------
4020 !-- calculate cumulus parameterization time step
4025 STEPCU = nint(CUDT*60./DT)
4026 STEPCU = max(STEPCU,1)
4030 IF(start_of_simulation)THEN
4039 !-- deep convection and hybrid deep-shallow convection schemes
4040 cps_select: SELECT CASE(config_flags%cu_physics)
4043 CALL kfinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQRCUTEN, &
4044 RQICUTEN,RQSCUTEN,NCA,W0AVG,P_QI,P_QS, &
4045 PARAM_FIRST_SCALAR,restart, &
4047 ids, ide, jds, jde, kds, kde, &
4048 ims, ime, jms, jme, kms, kme, &
4049 its, ite, jts, jte, kts, kte )
4052 CALL bmjinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQRCUTEN, &
4053 CLDEFI,LOWLYR,cp,r_d,restart, &
4055 ids, ide, jds, jde, kds, kde, &
4056 ims, ime, jms, jme, kms, kme, &
4057 its, ite, jts, jte, kts, kte )
4060 CALL kf_eta_init(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQRCUTEN, &
4061 RQICUTEN,RQSCUTEN,NCA,W0AVG,P_QI,P_QS, &
4062 SVP1,SVP2,SVP3,SVPT0, &
4063 PARAM_FIRST_SCALAR,restart, &
4065 ids, ide, jds, jde, kds, kde, &
4066 ims, ime, jms, jme, kms, kme, &
4067 its, ite, jts, jte, kts, kte )
4069 #if ( EM_CORE == 1 )
4071 CALL mskf_init(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQRCUTEN, &
4072 RQICUTEN,RQSCUTEN,NCA,W0AVG,P_QI,P_QS, &
4073 SVP1,SVP2,SVP3,SVPT0, &
4074 PARAM_FIRST_SCALAR,restart, &
4076 ids, ide, jds, jde, kds, kde, &
4077 ims, ime, jms, jme, kms, kme, &
4078 its, ite, jts, jte, kts, kte, &
4079 RUCUTEN, RVCUTEN) !JTR
4083 CALL gdinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, &
4084 MASS_FLUX,cp,restart, &
4085 P_QC,P_QI,PARAM_FIRST_SCALAR, &
4087 APR_GR,APR_W,APR_MC,APR_ST,APR_AS, &
4088 APR_CAPMA,APR_CAPME,APR_CAPMI, &
4090 ids, ide, jds, jde, kds, kde, &
4091 ims, ime, jms, jme, kms, kme, &
4092 its, ite, jts, jte, kts, kte )
4093 CASE (KSASSCHEME,NSASSCHEME)
4094 CALL nsasinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, &
4096 restart,P_QC,P_QI,PARAM_FIRST_SCALAR, &
4098 ids, ide, jds, jde, kds, kde, &
4099 ims, ime, jms, jme, kms, kme, &
4100 its, ite, jts, jte, kts, kte )
4102 #if ( EM_CORE == 1 )
4103 CASE (G3SCHEME,GFSCHEME)
4104 CALL g3init(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, &
4105 MASS_FLUX,cp,restart, &
4106 P_QC,P_QI,PARAM_FIRST_SCALAR, &
4108 APR_GR,APR_W,APR_MC,APR_ST,APR_AS, &
4109 APR_CAPMA,APR_CAPME,APR_CAPMI, &
4110 cugd_tten,cugd_ttens,cugd_qvten, &
4111 cugd_qvtens,cugd_qcten, &
4113 ids, ide, jds, jde, kds, kde, &
4114 ims, ime, jms, jme, kms, kme, &
4115 its, ite, jts, jte, kts, kte )
4118 CALL sasinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, &
4119 RUCUTEN,RVCUTEN, & ! gopal's doing for SAS
4120 restart,P_QC,P_QI,PARAM_FIRST_SCALAR, &
4122 ids, ide, jds, jde, kds, kde, &
4123 ims, ime, jms, jme, kms, kme, &
4124 its, ite, jts, jte, kts, kte )
4126 CASE (SCALESASSCHEME)
4127 CALL scalesasinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, &
4129 restart,P_QC,P_QI,PARAM_FIRST_SCALAR, &
4131 ids, ide, jds, jde, kds, kde, &
4132 ims, ime, jms, jme, kms, kme, &
4133 its, ite, jts, jte, kts, kte )
4135 #if ( EM_CORE == 1 )
4136 !BSINGH - For WRFCuP Scheme
4137 CASE (KFCUPSCHEME) !wig: 18-Sep-2006
4138 CALL kf_cup_init(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQRCUTEN, &
4139 RQICUTEN,RQSCUTEN,NCA,W0AVG,P_QI,P_QS, &
4140 SVP1,SVP2,SVP3,SVPT0, &
4141 cupflag,cldfra_cup,cldfratend_cup, &
4144 PARAM_FIRST_SCALAR,restart, &
4146 ids, ide, jds, jde, kds, kde, &
4147 ims, ime, jms, jme, kms, kme, &
4148 its, ite, jts, jte, kts, kte )
4154 CALL osasinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, &
4155 RUCUTEN,RVCUTEN, & ! gopal's doing for SAS
4156 restart,P_QC,P_QI,PARAM_FIRST_SCALAR, &
4158 ids, ide, jds, jde, kds, kde, &
4159 ims, ime, jms, jme, kms, kme, &
4160 its, ite, jts, jte, kts, kte )
4163 IF (PRESENT(RQCNCUTEN)) THEN
4164 CALL zm_conv_init(DT, DX, rucuten, rvcuten, rthcuten, rqvcuten, &
4165 rqccuten, rqicuten, rqcncuten, rqincuten, &
4166 p_qc, p_qi, p_qnc, p_qni, param_first_scalar, &
4168 ids, ide, jds, jde, kds, kde, &
4169 ims, ime, jms, jme, kms, kme, &
4170 its, ite, jts, jte, kts, kte )
4172 CALL wrf_error_fatal ( 'arguments not present for calling camzmscheme' )
4175 ! Tiedtke Scheme - ZCX&YQW
4176 CASE (TIEDTKESCHEME)
4177 CALL tiedtkeinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, &
4179 restart,P_QC,P_QI,PARAM_FIRST_SCALAR, &
4181 ids, ide, jds, jde, kds, kde, &
4182 ims, ime, jms, jme, kms, kme, &
4183 its, ite, jts, jte, kts, kte )
4185 CASE (NTIEDTKESCHEME)
4186 CALL ntiedtkeinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, &
4189 restart,P_QC,P_QI,PARAM_FIRST_SCALAR, &
4191 ids, ide, jds, jde, kds, kde, &
4192 ims, ime, jms, jme, kms, kme, &
4193 its, ite, jts, jte, kts, kte )
4195 #if ( WRFPLUS == 1 )
4196 ! this is for WRFPlus only
4198 CALL ducuinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQRCUTEN, &
4199 RQICUTEN,RQSCUTEN,NCA,W0AVG,P_QC,P_QR, &
4200 SVP1,SVP2,SVP3,SVPT0, &
4201 PARAM_FIRST_SCALAR,restart, &
4203 ids, ide, jds, jde, kds, kde, &
4204 ims, ime, jms, jme, kms, kme, &
4205 its, ite, jts, jte, kts, kte )
4210 END SELECT cps_select
4212 END SUBROUTINE cu_init
4214 !==================================================================
4215 SUBROUTINE shcu_init(STEPCU,CUDT,DT,RUSHTEN,RVSHTEN,RTHSHTEN, &
4216 RQVSHTEN,RQRSHTEN,RQCSHTEN, &
4217 RQSSHTEN,RQISHTEN,RQGSHTEN, &
4218 NCA,RAINC,RAINCV,config_flags,restart, &
4219 allowed_to_read, start_of_simulation, &
4220 RDCASHTEN, RQCDCSHTEN, W0AVG, &
4221 cldareaa, cldareab, cldliqa, cldliqb, &
4223 pblmax, wub, ltopb, clddpthb, cldtopb, &
4224 capesave, ainckfsa, radsave, &
4225 rainsh, rainshvb, kdcldtop, kdcldbas, xtime1,&
4227 ids, ide, jds, jde, kds, kde, &
4228 ims, ime, jms, jme, kms, kme, &
4229 its, ite, jts, jte, kts, kte )
4230 !------------------------------------------------------------------
4231 USE uwshcu, ONLY: init_uwshcu
4232 USE module_shcu_grims, ONLY: grimsinit
4233 USE module_shcu_nscv , ONLY: nscvinit
4234 USE module_shcu_deng , ONLY: deng_shcu_init
4235 USE physconst, ONLY: cpair, gravit, latice, latvap, mwdry, mwh2o, &
4237 USE shr_kind_mod, ONLY: r8 => shr_kind_r8
4239 !------------------------------------------------------------------
4241 !------------------------------------------------------------------
4242 TYPE (grid_config_rec_type) :: config_flags
4243 LOGICAL , INTENT(IN) :: restart
4246 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
4247 ims, ime, jms, jme, kms, kme, &
4248 its, ite, jts, jte, kts, kte
4250 REAL , INTENT(IN) :: DT, CUDT
4251 LOGICAL , INTENT(IN) :: start_of_simulation
4252 LOGICAL , INTENT(IN) :: allowed_to_read
4253 INTEGER , INTENT(INOUT) :: STEPCU
4255 REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: &
4256 RUSHTEN, RVSHTEN, RTHSHTEN, &
4257 RQVSHTEN, RQCSHTEN, RQRSHTEN, RQISHTEN, RQSSHTEN, RQGSHTEN
4259 REAL , DIMENSION( ims:ime , jms:jme ), INTENT(OUT):: RAINC, RAINCV
4261 REAL , DIMENSION( ims:ime , jms:jme ), INTENT(INOUT):: NCA
4263 REAL, OPTIONAL, DIMENSION( ims:ime , jms:jme ) , &
4264 INTENT( OUT) :: pblmax, clddpthb, cldtopb, rainsh, rainshvb, &
4265 capesave, radsave, xtime1, PBLHAVG
4267 REAL, OPTIONAL, DIMENSION( ims:ime , 1:100, jms:jme ) , &
4268 INTENT( OUT) :: ainckfsa
4270 INTEGER, OPTIONAL, DIMENSION( ims:ime , jms:jme ) , &
4271 INTENT( OUT) :: kdcldtop, kdcldbas, ltopb
4273 REAL, OPTIONAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , &
4274 INTENT( OUT) :: wub, cldareaa, cldareab, &
4275 cldliqa, cldliqb, W0AVG, TKEAVG, &
4278 REAL, OPTIONAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: &
4279 RDCASHTEN, RQCDCSHTEN
4283 INTEGER :: i,j,itf,jtf
4285 !--------------------------------------------------------------------
4287 ! Some of this stuff is redundant with deep convection, but redo it
4288 ! in case deep is turned off...
4290 !-- calculate cumulus parameterization time step
4295 STEPCU = nint(CUDT*60./DT)
4296 STEPCU = max(STEPCU,1)
4300 IF(start_of_simulation)THEN
4309 !-- independent shallow convection schemes
4310 shcu_select: SELECT CASE(config_flags%shcu_physics)
4312 CASE (CAMUWSHCUSCHEME)
4313 CALL init_uwshcu(r8,latvap,cpair,latice,zvir,rair,gravit, &
4315 rushten, rvshten, rthshten, rqvshten, &
4316 rqcshten, rqrshten, rqishten, rqsshten, rqgshten, &
4317 p_qc, p_qr, p_qi, p_qs, p_qg, &
4318 config_flags%bl_pbl_physics, param_first_scalar, restart, &
4319 ids, ide, jds, jde, kds, kde, &
4320 ims, ime, jms, jme, kms, kme, &
4321 its, ite, jts, jte, kts, kte )
4323 CASE (GRIMSSHCUSCHEME)
4324 CALL grimsinit(rthshten,rqvshten, &
4326 ids, ide, jds, jde, kds, kde, &
4327 ims, ime, jms, jme, kms, kme, &
4328 its, ite, jts, jte, kts, kte )
4330 CASE (NSCVSHCUSCHEME)
4331 CALL nscvinit(rthshten,rqvshten,rqcshten,rqishten, &
4333 restart,p_qc,p_qi,param_first_scalar, &
4335 ids, ide, jds, jde, kds, kde, &
4336 ims, ime, jms, jme, kms, kme, &
4337 its, ite, jts, jte, kts, kte )
4339 #if ( EM_CORE == 1 )
4340 CASE (DENGSHCUSCHEME)
4341 CALL deng_shcu_init(RTHSHTEN,RQVSHTEN,RQCSHTEN,RQRSHTEN, &
4342 RUSHTEN,RVSHTEN,RDCASHTEN,RQCDCSHTEN,W0AVG, &
4344 cldareaa, cldareab, cldliqa, cldliqb, &
4346 wub, pblmax, ltopb, clddpthb, cldtopb, &
4347 capesave, ainckfsa, radsave, &
4348 rainsh, rainshvb, kdcldtop, kdcldbas, &
4350 SVP1,SVP2,SVP3,SVPT0, &
4351 ids, ide, jds, jde, kds, kde, &
4352 ims, ime, jms, jme, kms, kme, &
4353 its, ite, jts, jte, kts, kte )
4358 END SELECT shcu_select
4360 END SUBROUTINE shcu_init
4362 !==================================================================
4363 SUBROUTINE mp_init(RAINNC,SNOWNC,GRAUPELNC,config_flags,restart,warm_rain, &
4365 MPDT, DT, DX, DY, LOWLYR, & ! for eta mp
4366 F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, & ! for eta mp
4367 #if ( EM_CORE == 1 )
4368 PHB,PH,P,PB,QV,XLAND,CCNTY,QDCN,QTCN,QCCN, & ! for ntu3m
4369 QRCN,QNIN, & ! for ntu3m
4371 mp_restart_state,tbpvs_state,tbpvs0_state, & ! eta mp
4372 allowed_to_read, start_of_simulation, &
4373 !CAMMGMP specific variables
4374 ixcldliq, ixcldice, ixnumliq, ixnumice, &
4376 z_at_q, inv_dens, qnwfa2d, qnbca2d, & ! G. Thompson
4377 frc_urb2d, scalar, num_sc, & ! G. Thompson
4378 ids, ide, jds, jde, kds, kde, &
4379 ims, ime, jms, jme, kms, kme, &
4380 its, ite, jts, jte, kts, kte )
4381 !------------------------------------------------------------------
4386 USE module_mp_etanew
4387 USE module_mp_fer_hires
4391 USE module_mp_thompson
4392 USE module_mp_full_sbm
4393 #if (BUILD_SBM_FAST == 1)
4394 USE module_mp_fast_sbm
4396 USE module_mp_morr_two_moment
4398 USE module_mp_jensen_ishmael
4399 USE module_mp_milbrandt2mom
4400 ! USE module_mp_milbrandt3mom
4404 #if (WRFPLUS != 1) & !defined( VAR4D )
4405 USE module_mp_nssl_2mom, only: nssl_2mom_init
4408 USE module_mp_cammgmp_driver, ONLY:CAMMGMP_INIT !CAM5's microphysics
4409 USE module_mp_morr_two_moment_aero !TWG2017
4412 !------------------------------------------------------------------
4414 !------------------------------------------------------------------
4416 TYPE (grid_config_rec_type) :: config_flags
4417 LOGICAL , INTENT(IN) :: restart
4418 LOGICAL , INTENT(OUT) :: warm_rain,adv_moist_cond
4419 REAL , INTENT(IN) :: MPDT, DT, DX, DY
4421 LOGICAL , INTENT(IN) :: start_of_simulation
4422 INTEGER , INTENT(IN) :: ixcldliq, ixcldice, ixnumliq, ixnumice ! CAMMGMP specific variables
4424 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
4425 ims, ime, jms, jme, kms, kme, &
4426 its, ite, jts, jte, kts, kte
4428 INTEGER , DIMENSION( ims:ime , jms:jme ) ,INTENT(INOUT) :: LOWLYR
4429 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: RAINNC,SNOWNC,GRAUPELNC
4430 REAL, DIMENSION( ims:ime , kms:kme, jms:jme ) , INTENT(INOUT) :: &
4431 F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY
4432 #if ( EM_CORE == 1 )
4433 INTEGER, OPTIONAL, INTENT(IN) :: CCNTY ! for ntu3m
4434 REAL, OPTIONAL, DIMENSION(ims:ime,jms:jme), INTENT(IN) :: XLAND ! for ntu3m
4435 REAL, OPTIONAL, INTENT(IN), DIMENSION(ims:ime,kms:kme,jms:jme) :: PHB,PH,P,PB,QV ! for ntu3m
4436 REAL, INTENT(INOUT), DIMENSION(ims:ime,kms:kme,jms:jme) :: QDCN,QTCN,QCCN,QRCN,QNIN ! for ntu3m
4438 REAL , DIMENSION(:) ,INTENT(INOUT) :: mp_restart_state,tbpvs_state,tbpvs0_state
4439 LOGICAL , INTENT(IN) :: allowed_to_read
4440 REAL, INTENT(INOUT) :: ccn_conc ! RAS
4441 REAL, DIMENSION(ims:ime,jms:jme), INTENT(INOUT):: qnwfa2d, qnbca2d ! G. Thompson
4442 REAL, DIMENSION(ims:ime,jms:jme), INTENT(IN):: frc_urb2d
4443 REAL, DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(IN):: z_at_q ! G. Thompson
4444 REAL, DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(IN):: inv_dens ! G. Thompson
4445 INTEGER, INTENT(IN) :: num_sc ! G. Thompson
4446 REAL, DIMENSION(ims:ime,kms:kme,jms:jme, num_sc), INTENT(INOUT):: scalar ! G. Thompson
4449 INTEGER :: i, j, itf, jtf
4450 REAL, DIMENSION(20) :: nssl_params
4451 INTEGER :: nssl_ipelec_tmp, nssl_ipconc
4452 logical :: nssl_density_on
4455 ! To accommodate shared physics
4456 character*256 :: errmsg
4460 adv_moist_cond = .true.
4464 IF(start_of_simulation)THEN
4474 mp_select: SELECT CASE(config_flags%mp_physics)
4476 CASE (KESSLERSCHEME)
4478 #if ( WRFPLUS == 1 )
4479 CASE (MKESSLERSCHEME)
4483 CALL wsm3init(rhoair0,rhowater,rhosnow,cliq,cpv, allowed_to_read )
4485 CALL wsm5init(rhoair0,rhowater,rhosnow,cliq,cpv, allowed_to_read )
4487 CALL mp_wsm6_init(rhoair0,rhowater,rhosnow,cliq,cpv,config_flags%hail_opt,errmsg,errflg)
4489 CALL wsm7init(rhoair0,rhowater,rhosnow,cliq,cpv, allowed_to_read )
4491 adv_moist_cond = .false.
4492 CALL etanewinit (MPDT,DT,DX,DY,LOWLYR,restart, &
4493 F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, &
4494 mp_restart_state,tbpvs_state,tbpvs0_state,&
4496 ids, ide, jds, jde, kds, kde, &
4497 ims, ime, jms, jme, kms, kme, &
4498 its, ite, jts, jte, kts, kte )
4499 CASE (FER_MP_HIRES,FER_MP_HIRES_ADVECT)
4500 CALL fer_hires_init (MPDT,DT,DX,DY,LOWLYR,restart, &
4502 ids, ide, jds, jde, kds, kde, &
4503 ims, ime, jms, jme, kms, kme, &
4504 its, ite, jts, jte, kts, kte, &
4505 F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY)
4508 CALL etanewinit_HWRF (MPDT,DT,DX,DY,LOWLYR,restart, &
4509 F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, &
4511 ids, ide, jds, jde, kds, kde, &
4512 ims, ime, jms, jme, kms, kme, &
4513 its, ite, jts, jte, kts, kte )
4516 IF(start_of_simulation.or.restart.or.config_flags%cycling) &
4517 CALL thompson_init(HGT=z_at_q, &
4518 IDS=ids, IDE=ide, JDS=jds, JDE=jde, KDS=kds, KDE=kde, &
4519 IMS=ims, IME=ime, JMS=jms, JME=jme, KMS=kms, KME=kme, &
4520 ITS=its, ITE=ite, JTS=jts, JTE=jte, KTS=kts, KTE=kte)
4523 ! Cycling the WRF forecast with moving nests will cause this initialization to be
4524 ! called for each nest move. This is potentially very computationally expensive.
4525 IF(start_of_simulation.or.restart.or.config_flags%cycling) &
4526 CALL thompson_init(HGT=z_at_q, &
4528 NWFA2D=qnwfa2d, NBCA2D=qnbca2d, &
4529 NWFA=scalar(ims,kms,jms,P_QNWFA), &
4530 NIFA=scalar(ims,kms,jms,P_QNIFA), &
4531 NBCA=scalar(ims,kms,jms,P_QNBCA), &
4532 wif_input_opt=config_flags%wif_input_opt, &
4533 FRC_URB2D=frc_urb2d, &
4535 is_start=start_of_simulation, &
4536 IDS=ids, IDE=ide, JDS=jds, JDE=jde, KDS=kds, KDE=kde, &
4537 IMS=ims, IME=ime, JMS=jms, JME=jme, KMS=kms, KME=kme, &
4538 ITS=its, ITE=ite, JTS=jts, JTE=jte, KTS=kts, KTE=kte)
4541 ! Cycling the WRF forecast with moving nests will cause this initialization to be
4542 ! called for each nest move. This is potentially very computationally expensive.
4543 IF(start_of_simulation.or.restart.or.config_flags%cycling) &
4544 CALL thompson_init(HGT=z_at_q, &
4547 NWFA=scalar(ims,kms,jms,P_QNWFA), &
4548 NIFA=scalar(ims,kms,jms,P_QNIFA), &
4549 NBCA=scalar(ims,kms,jms,P_QNBCA), &
4550 wif_input_opt=config_flags%wif_input_opt, &
4551 FRC_URB2D=frc_urb2d, &
4552 NG=scalar(ims,kms,jms,P_QNG), &
4554 is_start=start_of_simulation, &
4555 IDS=ids, IDE=ide, JDS=jds, JDE=jde, KDS=kds, KDE=kde, &
4556 IMS=ims, IME=ime, JMS=jms, JME=jme, KMS=kms, KME=kme, &
4557 ITS=its, ITE=ite, JTS=jts, JTE=jte, KTS=kts, KTE=kte)
4559 CASE (MORR_TWO_MOMENT)
4560 CALL morr_two_moment_init( config_flags%morr_rimed_ice )
4563 CALL morr_two_moment_init_aero( config_flags%morr_rimed_ice )
4565 CASE (JENSEN_ISHMAEL)
4566 CALL jensen_ishmael_init()
4569 CALL p3_init('.',1,.false.,'WRF',i_err,.false.)
4570 CASE (P3_1CATEGORY_NC)
4571 CALL p3_init('.',1,.false.,'WRF',i_err,.false.)
4573 CALL p3_init('.',2,.false.,'WRF',i_err,.false.)
4575 CALL p3_init('.',1,.true.,'WRF',i_err,.false.)
4576 CASE (MILBRANDT2MOM)
4577 CALL milbrandt2mom_init
4578 ! CASE (MILBRANDT3MOM)
4579 ! CALL milbrandt3mom_init
4581 CALL wdm5init(rhoair0,rhowater,rhosnow,cliq,cpv,ccn_conc,allowed_to_read )
4583 CALL wdm6init(rhoair0,rhowater,rhosnow,cliq,cpv,ccn_conc, &
4584 config_flags%hail_opt, allowed_to_read )
4586 CALL wdm7init(rhoair0,rhowater,rhosnow,cliq,cpv,ccn_conc, allowed_to_read )
4589 CALL ntu_init(PHB,PH,P,PB,inv_dens,QV,QDCN,QTCN,QCCN,QRCN, &
4590 QNIN,XLAND,CCNTY,restart,ids,ide,jds,jde,kds, &
4591 kde,ims,ime,jms,jme,kms,kme,its,ite,jts,jte, &
4595 CASE (FULL_KHAIN_LYNN)
4596 IF(start_of_simulation.or.restart)THEN
4597 CALL full_hucminit(dt)
4599 # if (BUILD_SBM_FAST == 1)
4600 CASE (FAST_KHAIN_LYNN_SHPUND)
4601 IF(start_of_simulation.or.restart)THEN
4602 CALL fast_hucminit(dt)
4607 ! Single generalized case (mp_physics=18) replaces previously separate mp_physics values of 17,18,19,20,22
4608 #if (WRFPLUS != 1) & !defined( VAR4D )
4610 IF ( config_flags%elec_physics > 0 ) THEN
4611 nssl_ipelec_tmp = config_flags%nssl_ipelec
4613 nssl_ipelec_tmp = 0.0
4617 nssl_params(1) = config_flags%nssl_cccn
4618 nssl_params(2) = config_flags%nssl_alphah
4619 nssl_params(3) = config_flags%nssl_alphahl
4620 nssl_params(4) = config_flags%nssl_cnoh
4621 nssl_params(5) = config_flags%nssl_cnohl
4622 nssl_params(6) = config_flags%nssl_cnor
4623 nssl_params(7) = config_flags%nssl_cnos
4624 nssl_params(8) = config_flags%nssl_rho_qh
4625 nssl_params(9) = config_flags%nssl_rho_qhl
4626 nssl_params(10) = config_flags%nssl_rho_qs
4627 nssl_params(11) = nssl_ipelec_tmp
4628 nssl_params(12) = config_flags%nssl_isaund
4629 nssl_params(13) = 0 ! reserved
4630 nssl_params(14) = 0 ! reserved
4631 nssl_params(15) = 0 ! reserved
4633 IF ( config_flags%nssl_2moment_on == 0 ) THEN
4636 IF ( config_flags%nssl_3moment > 0 ) THEN
4643 IF ( config_flags % nssl_ccn_on > 0 ) THEN
4644 ccn_conc = config_flags%nssl_cccn/1.225 ! set this to have correct boundary conditions
4646 CALL nssl_2mom_init(nssl_params=nssl_params,ipctmp=nssl_ipconc,mixphase=0, &
4647 nssl_density_on=(config_flags%nssl_density_on > 0), &
4648 nssl_hail_on=config_flags%nssl_hail_on > 0, &
4649 nssl_ccn_on=(config_flags%nssl_ccn_on > 0), &
4650 nssl_icdx=config_flags%nssl_icdx, &
4651 nssl_icdxhl=config_flags%nssl_icdxhl,ccn_is_ccna=config_flags%nssl_ccn_is_ccna)
4654 CASE (CAMMGMPSCHEME) ! CAM5's microphysics
4655 CALL CAMMGMP_INIT(ixcldliq, ixcldice, ixnumliq, ixnumice &
4656 ,config_flags%chem_opt &
4657 ,ids, ide, jds, jde, kds, kde &
4658 ,ims, ime, jms, jme, kms, kme &
4659 ,its, ite, jts, jte, kts, kte )
4664 END SELECT mp_select
4666 if (config_flags%madwrf_opt == 2 .and. (.not. f_qc .or. .not. f_qi .or. .not. f_qs)) &
4667 call wrf_error_fatal('madwrf_opt = 2 requires a mp_physics option with qc, qi, and qs')
4669 END SUBROUTINE mp_init
4671 #if ( EM_CORE == 1 )
4672 !==========================================================
4673 SUBROUTINE fg_init(STEPFG,FGDT,DT,id,RUNDGDTEN,RVNDGDTEN, &
4674 RTHNDGDTEN,RPHNDGDTEN,RQVNDGDTEN,RMUNDGDTEN, &
4675 SDA_HFX, SDA_QFX, QNORM, HFX_BOTH, QFX_BOTH, & ! fasdas
4676 HFX_FDDA, & ! fasdas
4677 config_flags,restart, &
4679 ids, ide, jds, jde, kds, kde, &
4680 ims, ime, jms, jme, kms, kme, &
4681 its, ite, jts, jte, kts, kte )
4684 !--------------------------------------------------------------------
4685 USE module_fdda_psufddagd
4686 USE module_fdda_spnudging, ONLY : fddaspnudginginit
4687 !--------------------------------------------------------------------
4689 !--------------------------------------------------------------------
4690 TYPE (grid_config_rec_type) :: config_flags
4691 LOGICAL , INTENT(IN) :: restart
4693 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
4694 ims, ime, jms, jme, kms, kme, &
4695 its, ite, jts, jte, kts, kte
4697 REAL , INTENT(IN) :: DT, FGDT
4698 INTEGER , INTENT(IN) :: id
4699 INTEGER , INTENT(INOUT) :: STEPFG
4700 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: &!BSINGH(PNNL)- should be declared inout
4709 REAL , DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: &
4712 QNORM,HFX_BOTH,QFX_BOTH
4713 ! INTEGER , INTENT(IN ) :: fasdas
4714 REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: &
4717 REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: RMUNDGDTEN !BSINGH(PNNL)- should be declared inout
4719 LOGICAL, INTENT(IN) :: allowed_to_read
4720 !--------------------------------------------------------------------
4722 !-- calculate pbl time step
4724 STEPFG = nint(FGDT*60./DT)
4725 STEPFG = max(STEPFG,1)
4728 !-- initialize fdda scheme
4730 fdda_select: SELECT CASE(config_flags%grid_fdda)
4733 CALL fddagdinit(id,rundgdten,rvndgdten,rthndgdten,rqvndgdten,rmundgdten,&
4734 SDA_HFX, SDA_QFX, QNORM, HFX_BOTH, QFX_BOTH, config_flags%fasdas,& ! fasdas
4735 HFX_FDDA, & ! fasdas
4736 config_flags%run_hours, &
4737 config_flags%if_no_pbl_nudging_uv, &
4738 config_flags%if_no_pbl_nudging_t, &
4739 config_flags%if_no_pbl_nudging_q, &
4740 config_flags%if_zfac_uv, &
4741 config_flags%k_zfac_uv, &
4742 config_flags%if_zfac_t, &
4743 config_flags%k_zfac_t, &
4744 config_flags%if_zfac_q, &
4745 config_flags%k_zfac_q, &
4747 config_flags%gt, config_flags%gq, &
4748 config_flags%if_ramping, config_flags%dtramp_min, &
4749 config_flags%auxinput10_end_h, &
4750 config_flags%grid_sfdda, &
4751 config_flags%guv_sfc, &
4752 config_flags%gt_sfc, &
4753 config_flags%gq_sfc, &
4754 restart, allowed_to_read, &
4755 ids, ide, jds, jde, kds, kde, &
4756 ims, ime, jms, jme, kms, kme, &
4757 its, ite, jts, jte, kts, kte )
4760 CALL fddaspnudginginit(id,rundgdten,rvndgdten,rthndgdten,rphndgdten,rqvndgdten,&
4761 config_flags%run_hours, &
4762 config_flags%if_no_pbl_nudging_uv, &
4763 config_flags%if_no_pbl_nudging_t, &
4764 config_flags%if_no_pbl_nudging_ph, &
4765 config_flags%if_no_pbl_nudging_q, &
4766 config_flags%if_zfac_uv, &
4767 config_flags%k_zfac_uv, &
4768 config_flags%dk_zfac_uv, &
4769 config_flags%if_zfac_t, &
4770 config_flags%k_zfac_t, &
4771 config_flags%dk_zfac_t, &
4772 config_flags%if_zfac_ph, &
4773 config_flags%k_zfac_ph, &
4774 config_flags%dk_zfac_ph, &
4775 config_flags%if_zfac_q, &
4776 config_flags%k_zfac_q, &
4777 config_flags%dk_zfac_q, &
4778 config_flags%ktrop, &
4780 config_flags%gt, config_flags%gph, config_flags%gq, &
4781 config_flags%if_ramping, config_flags%dtramp_min, &
4782 config_flags%auxinput9_end_h, &
4783 config_flags%xwavenum,config_flags%ywavenum, &
4784 restart, allowed_to_read, &
4785 ids, ide, jds, jde, kds, kde, &
4786 ims, ime, jms, jme, kms, kme, &
4787 its, ite, jts, jte, kts, kte )
4791 END SELECT fdda_select
4793 END SUBROUTINE fg_init
4795 !-------------------------------------------------------------------
4796 SUBROUTINE fdob_init(obs_nudge_opt, maxdom, inest, parid, &
4797 idynin, dtramp, fdaend, restart, &
4798 obs_twindo_cg, obs_twindo, itimestep, &
4802 sfc_scheme_horiz, sfc_scheme_vert, &
4804 sfcfact, sfcfacr, dpsmx, &
4805 nudge_wind, nudge_temp, nudge_mois, &
4806 nudgezfullr1_uv, nudgezrampr1_uv, &
4807 nudgezfullr2_uv, nudgezrampr2_uv, &
4808 nudgezfullr4_uv, nudgezrampr4_uv, &
4809 nudgezfullr1_t, nudgezrampr1_t, &
4810 nudgezfullr2_t, nudgezrampr2_t, &
4811 nudgezfullr4_t, nudgezrampr4_t, &
4812 nudgezfullr1_q, nudgezrampr1_q, &
4813 nudgezfullr2_q, nudgezrampr2_q, &
4814 nudgezfullr4_q, nudgezrampr4_q, &
4815 nudgezfullmin, nudgezrampmin, nudgezmax, &
4817 start_year, start_month, start_day, &
4818 start_hour, start_minute, start_second, &
4822 ids, ide, jds, jde, kds, kde, &
4823 ims, ime, jms, jme, kms, kme, &
4824 its, ite, jts, jte, kts, kte )
4826 !--------------------------------------------------------------------
4828 USE module_fddaobs_rtfdda
4830 !--------------------------------------------------------------------
4832 !--------------------------------------------------------------------
4833 INTEGER , INTENT(IN) :: maxdom
4834 INTEGER , INTENT(IN) :: obs_nudge_opt(maxdom)
4835 INTEGER , INTENT(IN) :: ids,ide, jds,jde, kds,kde, &
4836 ims,ime, jms,jme, kms,kme, &
4837 its,ite, jts,jte, kts,kte
4838 INTEGER , INTENT(IN) :: inest
4839 INTEGER , INTENT(IN) :: parid(maxdom)
4840 INTEGER , INTENT(IN) :: idynin ! flag for dynamic initialization
4841 REAL , INTENT(IN) :: dtramp ! time period for ramping (idynin)
4842 REAL , INTENT(IN) :: fdaend(maxdom) ! nudging end time for domain (min)
4843 LOGICAL , INTENT(IN) :: restart
4844 REAL , INTENT(IN) :: obs_twindo_cg ! twindo on course grid
4845 REAL , INTENT(IN) :: obs_twindo
4846 INTEGER , INTENT(IN) :: itimestep
4847 INTEGER , INTENT(IN) :: no_pbl_nudge_uv(maxdom) ! flags for no wind nudging in pbl
4848 INTEGER , INTENT(IN) :: no_pbl_nudge_t(maxdom) ! flags for no temperature nudging in pbl
4849 INTEGER , INTENT(IN) :: no_pbl_nudge_q(maxdom) ! flags for no moisture nudging in pbl
4850 INTEGER , INTENT(IN) :: sfc_scheme_horiz ! horizontal spreading scheme for surf obs (wrf or orig mm5)
4851 INTEGER , INTENT(IN) :: sfc_scheme_vert ! vertical spreading scheme for surf obs (orig or regime vif)
4852 REAL , INTENT(IN) :: maxsnd_gap ! max allowed pressure gap in soundings for interp (centibars)
4853 REAL , INTENT(IN) :: sfcfact ! scale factor applied to time window for surface obs
4854 REAL , INTENT(IN) :: sfcfacr ! scale fac applied to horiz rad of infl for sfc obs
4855 REAL , INTENT(IN) :: dpsmx ! max pressure change allowed within horiz. infl. range
4856 INTEGER , INTENT(IN) :: nudge_wind(maxdom) ! wind-nudging flag
4857 INTEGER , INTENT(IN) :: nudge_temp(maxdom) ! temperature-nudging flag
4858 INTEGER , INTENT(IN) :: nudge_mois(maxdom) ! moisture-nudging flag
4859 REAL , INTENT(IN) :: nudgezfullr1_uv ! vert infl fcn, regime=1 full-wt hght, winds
4860 REAL , INTENT(IN) :: nudgezrampr1_uv ! vert infl fcn, regime=1 ramp down hght, winds
4861 REAL , INTENT(IN) :: nudgezfullr2_uv ! vert infl fcn, regime=2 full-wt hght, winds
4862 REAL , INTENT(IN) :: nudgezrampr2_uv ! vert infl fcn, regime=2 ramp down hght, winds
4863 REAL , INTENT(IN) :: nudgezfullr4_uv ! vert infl fcn, regime=4 full-wt hght, winds
4864 REAL , INTENT(IN) :: nudgezrampr4_uv ! vert infl fcn, regime=4 ramp down hght, winds
4865 REAL , INTENT(IN) :: nudgezfullr1_t ! vert infl fcn, regime=1 full-wt hght, temp
4866 REAL , INTENT(IN) :: nudgezrampr1_t ! vert infl fcn, regime=1 ramp down hght, temp
4867 REAL , INTENT(IN) :: nudgezfullr2_t ! vert infl fcn, regime=2 full-wt hght, temp
4868 REAL , INTENT(IN) :: nudgezrampr2_t ! vert infl fcn, regime=2 ramp down hght, temp
4869 REAL , INTENT(IN) :: nudgezfullr4_t ! vert infl fcn, regime=4 full-wt hght, temp
4870 REAL , INTENT(IN) :: nudgezrampr4_t ! vert infl fcn, regime=4 ramp down hght, temp
4871 REAL , INTENT(IN) :: nudgezfullr1_q ! vert infl fcn, regime=1 full-wt hght, mois
4872 REAL , INTENT(IN) :: nudgezrampr1_q ! vert infl fcn, regime=1 ramp down hght, mois
4873 REAL , INTENT(IN) :: nudgezfullr2_q ! vert infl fcn, regime=2 full-wt hght, mois
4874 REAL , INTENT(IN) :: nudgezrampr2_q ! vert infl fcn, regime=2 ramp down hght, mois
4875 REAL , INTENT(IN) :: nudgezfullr4_q ! vert infl fcn, regime=4 full-wt hght, mois
4876 REAL , INTENT(IN) :: nudgezrampr4_q ! vert infl fcn, regime=4 ramp down hght, mois
4877 REAL , INTENT(IN) :: nudgezfullmin ! min dpth thru which vert infl fcn remains 1.0 (m)
4878 REAL , INTENT(IN) :: nudgezrampmin ! min dpth thru which vif decreases 1.0 to 0.0 (m)
4879 REAL , INTENT(IN) :: nudgezmax ! max dpth in which vif is nonzero (m)
4880 REAL , INTENT(IN) :: xlat ( ims:ime, jms:jme ) ! latitudes on mass-point grid
4881 REAL , INTENT(IN) :: xlong( ims:ime, jms:jme ) ! longitudes on mass-point grid
4882 INTEGER , INTENT(INOUT) :: start_year
4883 INTEGER , INTENT(INOUT) :: start_month
4884 INTEGER , INTENT(INOUT) :: start_day
4885 INTEGER , INTENT(INOUT) :: start_hour
4886 INTEGER , INTENT(INOUT) :: start_minute
4887 INTEGER , INTENT(INOUT) :: start_second
4888 REAL , INTENT(IN) :: p00 ! base state pressure
4889 REAL , INTENT(IN) :: t00 ! base state temperature
4890 REAL , INTENT(IN) :: tlp ! base state lapse rate
4891 REAL , INTENT(IN) :: znu( kms:kme ) ! eta values on half (mass) levels
4892 REAL , INTENT(IN) :: p_top ! pressure at top of model
4893 TYPE(fdob_type), INTENT(INOUT) :: fdob
4895 INTEGER :: e_sn ! ending north-south grid index
4896 LOGICAL :: ipf_init ! print warnings detected at initialzn
4897 !--------------------------------------------------------------------
4898 !-- initialize fdda obs-nudging scheme
4900 IF ( obs_nudge_opt(inest) .eq. 0 ) RETURN
4903 CALL fddaobs_init(obs_nudge_opt, maxdom, inest, parid, &
4904 idynin, dtramp, fdaend, restart, &
4906 obs_twindo, itimestep, &
4910 sfc_scheme_horiz, sfc_scheme_vert, &
4912 sfcfact, sfcfacr, dpsmx, &
4913 nudge_wind, nudge_temp, nudge_mois, &
4914 nudgezfullr1_uv, nudgezrampr1_uv, &
4915 nudgezfullr2_uv, nudgezrampr2_uv, &
4916 nudgezfullr4_uv, nudgezrampr4_uv, &
4917 nudgezfullr1_t, nudgezrampr1_t, &
4918 nudgezfullr2_t, nudgezrampr2_t, &
4919 nudgezfullr4_t, nudgezrampr4_t, &
4920 nudgezfullr1_q, nudgezrampr1_q, &
4921 nudgezfullr2_q, nudgezrampr2_q, &
4922 nudgezfullr4_q, nudgezrampr4_q, &
4923 nudgezfullmin, nudgezrampmin, nudgezmax, &
4925 start_year, start_month, start_day, &
4926 start_hour, start_minute, start_second, &
4930 ids,ide, jds,jde, kds,kde, &
4931 ims,ime, jms,jme, kms,kme, &
4932 its,ite, jts,jte, kts,kte)
4934 END SUBROUTINE fdob_init
4937 !--------------------------------------------------------------------
4938 SUBROUTINE z2sigma(zf,zh,sf,sh,p_top,pptop,config_flags, &
4940 kds,kde,kms,kme,kts,kte)
4943 INTEGER, INTENT(IN) :: kds,kde,kms,kme,kts,kte
4944 REAL , DIMENSION( kms:kme ), INTENT(IN) :: zf,zh
4945 REAL , DIMENSION( kms:kme ), INTENT(OUT):: sf,sh
4946 REAL , INTENT(IN) :: p_top
4947 REAL , INTENT(OUT) :: pptop
4948 TYPE (grid_config_rec_type) :: config_flags
4949 LOGICAL , INTENT(IN) :: allowed_to_read
4951 REAL R, G, TS, GAMMA, PS, ZTROP, TSTRAT, PTROP, Z, T, P, ZTOP, PTOP
4954 IF(zf(kde/2) .GT. 1.0)THEN
4955 ! Height levels assumed (zeta coordinate)
4956 ! Convert to sigma using standard atmosphere for pressure-height relation
4957 ! constants for standard atmosphere definition
4964 tstrat=ts+gamma*ztrop
4965 ptrop=ps*(tstrat/ts)**(-g/(gamma*r))
4972 p=ps*(t/ts)**(-g/(gamma*r))
4975 p=ptrop*exp(-g*(z-ztrop)/(r*tstrat))
4981 sf(k)=(p-ptop)/(ps-ptop)
4984 z=0.5*(zf(k)+zf(k-1))
4987 p=ps*(t/ts)**(-g/(gamma*r))
4990 p=ptrop*exp(-g*(z-ztrop)/(r*tstrat))
4992 sh(k-1)=(p-ptop)/(ps-ptop)
4997 ! Levels are already sigma/eta
4999 ! sf(k)=zf(kde-k+kds)
5000 ! if(k .ne. kde)sh(k)=zh(kde-1-k+kds)
5002 if(k .ne. kde)sh(k)=zh(k)
5008 END SUBROUTINE z2sigma
5010 !--------------------------------------------------------------------
5011 SUBROUTINE CAM_INIT (ixcldliq, ixcldice, ixnumliq, ixnumice,config_flags)
5012 ! Purpose: To initialize a set of variables and arrays required by
5013 ! the CAM Parameterizations ported to WRF
5015 ! Called by: Phy_init
5017 ! Author:Balwinder.Singh@pnl.gov
5018 !--------------------------------------------------------------------
5019 USE shr_kind_mod, ONLY : r8 => shr_kind_r8
5020 USE module_cam_esinti, ONLY : esinti
5021 USE physconst, ONLY : mwh2o, cpwv, epsilo, latvap, latice &
5022 , rh2o, cpair, tmelt,mwdry
5023 USE constituents, ONLY : cnst_add
5024 USE module_cam_support, ONLY : pcnst =>pcnst_runtime, pcnst_mp
5025 USE modal_aero_initialize_data_phys, ONLY : modal_aero_initialize_phys
5029 TYPE (grid_config_rec_type) :: config_flags
5031 integer, intent(out) :: ixcldliq, ixcldice, ixnumliq, ixnumice
5034 !Following variable declarations are from CAM's stratiform.F90 module
5035 integer, parameter :: ncnstmax = 4 ! Number of constituents
5037 character(len=8), dimension(ncnstmax), parameter :: cnst_names = &
5038 (/'CLDLIQ', 'CLDICE','NUMLIQ','NUMICE'/) ! Constituent names
5039 !Variables with dummy values
5043 !set dynamic (runtime)pcnst
5044 pcnst = 5 !For [water vap, cld liq, cld ice, liq num and ice num]
5045 #if ( EM_CORE == 1 )
5046 IF(config_flags%mp_physics == CAMMGMPSCHEME) pcnst = 12 !Additional storage for prescribed aerosols
5049 !pcnst for microphysics (pcnst_mp is different from pcnst ONLY if CAM MAM package amd CAMMGMP schemes are decoupled)
5052 #if ( WRF_CHEM == 1 )
5053 !If CAM MAM package is selected
5054 !BSINGH (01/23/2014):Please make sure pcnst is equal to cam_mam_nspec in chem/module_cam_mam_init.F and registry.chem
5055 IF(config_flags%chem_opt == CBMZ_CAM_MAM3_NOAQ .OR. config_flags%chem_opt==CBMZ_CAM_MAM3_AQ) then
5056 pcnst = 85 !For 3 modes of aerosols [adjusted for DMS species-BSINGH (01/20/2014) suggested by PMA]
5057 else if(config_flags%chem_opt == CBMZ_CAM_MAM7_NOAQ .OR. config_flags%chem_opt == CBMZ_CAM_MAM7_AQ) then
5058 pcnst = 90 !For 7 modes of aerosols
5060 !If CAM MAM package is NOT selected then pcnst presumes its default value set above
5061 !*NOTE* : the value of pcnst is 'hardwired' here as it was a quick solution. The dynamic value
5062 !of pcnst is computed in module_cam_mam_init.F. In module_cam_mam_init.F, the value of PCNST set here
5063 !is tested for its accuracy. If the value computed in module_cam_mam_init.F differs from value mentioned
5064 !above, then the above values for pcnst should be adjusted accordingly
5066 !CAMMGMP Scheme is supposed to run with MODAL treatment of AEROSOLS only
5067 IF((config_flags%chem_opt .NE. CBMZ_CAM_MAM3_NOAQ .AND. config_flags%chem_opt .NE. CBMZ_CAM_MAM3_AQ &
5068 .AND. config_flags%chem_opt .NE. CBMZ_CAM_MAM7_NOAQ .AND. config_flags%chem_opt .NE. CBMZ_CAM_MAM7_AQ &
5069 .AND. config_flags%chem_opt .NE. 0) .AND. config_flags%mp_physics == CAMMGMPSCHEME) THEN
5070 call wrf_error_fatal('CAMMGMP (mp_physics=17) ONLY works with CAM MAM package (chem_opt =501,502,503 or 504)')
5074 !For assisting decoupled microphysics (MP) CAM MAM simulations (simulations, where MAM package is coupled with
5075 !radiation but uncoupled with MP- i.e. MP runs with 'prescribed' aerosols) 'pcnst_mp' is defined.'pcnst_mp' will
5076 !only be used in the CAMMGMP driver and its supporting modules (ndrop and microp_aero)
5078 if(.NOT.config_flags%CAM_MP_MAM_cpled)pcnst_mp = 12
5081 ! Initialize the saturation vapor pressure look-up table...
5082 call esinti(epsilo, latvap, latice, rh2o, cpair, tmelt)
5084 IF(.NOT.CAM_INITIALIZED) THEN
5086 !Allocate module level CAM arrays
5087 call ALLOCATE_CAM_ARRAYS()
5089 !-------------------------------------------------------------------------------------!
5090 !Calls to add constituents (these calls are imported from in initindx.F90 in CAM) !
5092 ! Register water vapor. !
5093 ! ** This must be the first call to cnst_add so that water vapor is constituent 1.** !
5094 !-------------------------------------------------------------------------------------!
5096 call cnst_add('Q', mwh2o, cpwv, 1.E-12_r8, mm, &
5097 longname='Specific humidity', readiv=.true. )
5100 !Following add constituent calls are imported from the stratiform.F90 in CAM
5102 call cnst_add(cnst_names(1), mwdry, cpair, 0._r8, ixcldliq, &
5103 longname='Grid box averaged cloud liquid amount')
5104 call cnst_add(cnst_names(2), mwdry, cpair, 0._r8, ixcldice, &
5105 longname='Grid box averaged cloud ice amount' )
5106 call cnst_add(cnst_names(3), mwdry, cpair, 0._r8, ixnumliq, &
5107 longname='Grid box averaged cloud liquid number')
5108 call cnst_add(cnst_names(4), mwdry, cpair, 0._r8, ixnumice, &
5109 longname='Grid box averaged cloud ice number' )
5111 !For prescribed aerosols
5112 #if ( EM_CORE == 1 )
5113 IF(config_flags%mp_physics .EQ. CAMMGMPSCHEME &
5114 #if ( WRF_CHEM == 1 )
5115 .AND. config_flags%chem_opt .EQ. 0 &
5119 call cnst_add('ACCUM_MASS', one, cpair, 0._r8, dumind, &
5120 longname='Grid box averaged accumulation mode mass')
5121 call cnst_add('ACCUM_NUM' , one, cpair, 0._r8, dumind, &
5122 longname='Grid box averaged accumulation mode number')
5123 call cnst_add('AITKEN_MASS', one, cpair, 0._r8, dumind, &
5124 longname='Grid box averaged aitken mode mass')
5125 call cnst_add('AITKEN_NUM' , one, cpair, 0._r8, dumind, &
5126 longname='Grid box averaged aitken mode number')
5127 call cnst_add('COARSE_MASS_1', one, cpair, 0._r8, dumind, &
5128 longname='Grid box averaged coarse mode1 mass')
5129 call cnst_add('COARSE_MASS_2', one, cpair, 0._r8, dumind, &
5130 longname='Grid box averaged coarse mode2 mass')
5131 call cnst_add('COARSE_NUM' , one, cpair, 0._r8, dumind, &
5132 longname='Grid box averaged coarse mode number')
5137 CAM_INITIALIZED = .TRUE.
5140 #if ( EM_CORE == 1 )
5141 IF(config_flags%mp_physics == CAMMGMPSCHEME)THEN
5142 #if ( WRF_CHEM != 1 )
5143 !Aerosols must be initialized after adding the constituents otherwise the code may crash in WRF-Chem simulations
5144 CALL modal_aero_initialize_phys
5146 if(config_flags%chem_opt==0) then
5147 CALL modal_aero_initialize_phys
5152 END SUBROUTINE CAM_INIT
5155 !--------------------------------------------------------------------
5156 SUBROUTINE ALLOCATE_CAM_ARRAYS ()
5157 ! Purpose: To allocate module level CAM arrays for CAM modules which
5158 ! doesn't have an 'initialization' subroutine
5160 ! Called by: CAM_INIT
5162 ! Author:Balwinder.Singh@pnl.gov
5163 !--------------------------------------------------------------------
5164 USE constituents, ONLY : cnst_name,cnst_longname,cnst_cp,&
5165 cnst_cv,cnst_mw,cnst_type,cnst_rgas,qmin,qmincg, &
5166 cnst_fixed_ubc,apcnst,bpcnst,hadvnam,vadvnam,dcconnam, &
5167 fixcnam,tendnam,ptendnam,dmetendnam,sflxnam,tottnam
5169 USE module_cam_support, ONLY : pcnst =>pcnst_runtime, pcnst_mp
5171 USE modal_aero_data, ONLY : cnst_name_cw,species_class, &
5172 qneg3_worst_thresh_amode,cnst_name_cw_mp
5176 !Allocate module_cam_constituents.F arrays
5177 Allocate(cnst_name(pcnst),cnst_longname(pcnst),cnst_cp(pcnst), &
5178 cnst_cv(pcnst),cnst_mw(pcnst),cnst_type(pcnst), &
5179 cnst_rgas(pcnst),qmin(pcnst),qmincg(pcnst), &
5180 cnst_fixed_ubc(pcnst),apcnst(pcnst),bpcnst(pcnst), &
5181 hadvnam(pcnst),vadvnam(pcnst),dcconnam(pcnst), &
5182 fixcnam(pcnst),tendnam(pcnst),ptendnam(pcnst), &
5183 dmetendnam(pcnst),sflxnam(pcnst),tottnam(pcnst) )
5185 !Initialize module_cam_constituents.F variables
5186 cnst_fixed_ubc(:) = .false.
5188 !Allocate module_cam_mp_modal_aero_data_phys.F arrays
5189 Allocate(cnst_name_cw(pcnst),cnst_name_cw_mp(pcnst_mp), &
5190 species_class(pcnst),qneg3_worst_thresh_amode(pcnst) )
5192 END SUBROUTINE ALLOCATE_CAM_ARRAYS
5194 subroutine aerosol_in(aerodm,pina,alevsiz,no_months,no_src_types,XLAT,XLONG, &
5195 ids, ide, jds, jde, kds, kde, &
5196 ims, ime, jms, jme, kms, kme, &
5197 its, ite, jts, jte, kts, kte)
5199 ! Adaped from oznini in CAM
5200 ! It should be replaced by monthly climatology that varies latitudinally and vertically
5204 INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde, &
5205 ims,ime, jms,jme, kms,kme, &
5206 its,ite, jts,jte, kts,kte
5208 INTEGER, INTENT(IN ) :: alevsiz, no_months, no_src_types
5210 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN ) :: XLAT, XLONG
5212 REAL, DIMENSION( ims:ime, alevsiz, jms:jme, no_months, no_src_types ), &
5213 INTENT(OUT ) :: aerodm
5215 REAL, DIMENSION(alevsiz), INTENT(OUT ) :: pina
5218 ! Data from Ryan Torn, computed from EC 6 types of aerosol data:
5219 ! organic carbon, sea salt, dust, black carbon, sulfalte
5220 ! and stratospheric aerosol (volcanic ashes)
5221 ! The data dimensions are 46 x 72 x 12 (pressure levels), and in unit of AOD per Pa
5223 INTEGER, PARAMETER :: latsiz = 46
5224 INTEGER, PARAMETER :: lonsiz = 72
5225 INTEGER :: i, j, k, itf, jtf, ktf, m, pin_unit, lat_unit, lon_unit, od_unit, ks, il, jl
5226 INTEGER :: ilon1, ilon2, jlat1, jlat2
5227 REAL :: interp_pt, interp_pt_lat, interp_pt_lon, wlat1, wlat2, wlon1, wlon2
5228 CHARACTER*256 :: message
5230 REAL, DIMENSION( lonsiz, alevsiz, latsiz, no_months, no_src_types ) :: &
5233 REAL, DIMENSION(latsiz) :: lat_od, aertmp1
5234 REAL, DIMENSION(lonsiz) :: lon_od, aertmp2
5240 !-- read in aerosol optical depth pressure data
5242 WRITE(message,*)'no_months = ',no_months
5243 CALL wrf_debug(1,message)
5247 OPEN(pin_unit, FILE='aerosol_plev.formatted',FORM='FORMATTED',STATUS='OLD')
5249 READ (pin_unit,*) pina(k)
5254 ! pina(k) = pina(k)*100.
5257 !-- read in aerosol optical depth lat data
5260 OPEN(lat_unit, FILE='aerosol_lat.formatted',FORM='FORMATTED',STATUS='OLD')
5262 READ (lat_unit,*) lat_od(j)
5266 !-- read in aerosol optical depth lon data
5269 OPEN(lon_unit, FILE='aerosol_lon.formatted',FORM='FORMATTED',STATUS='OLD')
5271 READ (lon_unit,*) lon_od(j)
5275 !-- read in ozone data
5278 OPEN(od_unit, FILE='aerosol.formatted',FORM='FORMATTED',STATUS='OLD')
5280 do ks=1,no_src_types
5282 do j=1,latsiz ! latsiz=46
5283 do k=1,alevsiz ! alevsiz=12
5284 do i=1,lonsiz ! lonsiz=72
5285 READ (od_unit,*) aerodin(i,k,j,m,ks)
5293 !-- latitudinally interpolate ozone data (and extend longitudinally)
5294 !-- using function lin_interpol2(x, f, y) result(g)
5296 ! interpolates f(x) to point y
5297 ! assuming f(x) = f(x0) + a * (x - x0)
5298 ! where a = ( f(x1) - f(x0) ) / (x1 - x0)
5300 ! assumes x is monotonically increasing
5301 ! real, intent(in), dimension(:) :: x ! grid points
5302 ! real, intent(in), dimension(:) :: f ! grid function values
5303 ! real, intent(in) :: y ! interpolation point
5304 ! real :: g ! interpolated function value
5305 !---------------------------------------------------------------------------
5309 interp_pt_lat=XLAT(i,j)
5310 interp_pt_lon=XLONG(i,j)
5311 call interp_vec(lat_od,interp_pt_lat,.true.,jlat1,jlat2,wlat1,wlat2)
5312 call interp_vec(lon_od,interp_pt_lon,.true.,ilon1,ilon2,wlon1,wlon2)
5314 do ks = 1,no_src_types
5317 aerodm(i,k,j,m,ks) = wlon1 * (wlat1 * aerodin(ilon1,k,jlat1,m,ks) + &
5318 wlat2 * aerodin(ilon1,k,jlat2,m,ks)) + &
5319 wlon2 * (wlat1 * aerodin(ilon2,k,jlat1,m,ks) + &
5320 wlat2 * aerodin(ilon2,k,jlat2,m,ks))
5330 ! onefld(i,j) = aerodm(i,12,j,1,1)
5334 END SUBROUTINE aerosol_in
5336 function lin_interp(x, f, y) result(g)
5339 ! interpolates f(x) to point y
5340 ! assuming f(x) = f(x0) + a * (x - x0)
5341 ! where a = ( f(x1) - f(x0) ) / (x1 - x0)
5343 ! assumes x is monotonically increasing
5345 ! Author: D. Fillmore :: J. Done changed from r8 to r4
5349 real, intent(in), dimension(:) :: x ! grid points
5350 real, intent(in), dimension(:) :: f ! grid function values
5351 real, intent(in) :: y ! interpolation point
5352 real :: g ! interpolated function value
5354 integer :: k ! interpolation point index
5355 integer :: n ! length of x
5360 ! find k such that x(k) < y =< x(k+1)
5361 ! set k = 1 if y <= x(1) and k = n-1 if y > x(n)
5365 else if (y >= x(n)) then
5369 do while (y > x(k+1) .and. k < n)
5375 a = ( f(k+1) - f(k) ) / ( x(k+1) - x(k) )
5376 g = f(k) + a * (y - x(k))
5378 end function lin_interp
5380 subroutine interp_vec(locvec,locwant,periodic,loc1,loc2,wght1,wght2)
5384 real, intent(in), dimension(:) :: locvec
5385 real, intent(in) :: locwant
5386 logical, intent(in) :: periodic
5387 integer, intent(out) :: loc1, loc2
5388 real, intent(out) :: wght1, wght2
5391 real :: locv1, locv2
5393 vsize = size(locvec)
5399 if ( locvec(n) <= locwant .and. locvec(n+1) > locwant ) then
5408 if ( loc1 < 0 .and. loc2 < 0 ) then
5409 if ( periodic ) then
5410 if ( locwant < locvec(1) ) then
5413 locv1 = locvec(vsize)-360.0
5418 locv1 = locvec(vsize)
5419 locv2 = locvec(1)+360.0
5422 if ( locwant < locvec(1) ) then
5430 locv1 = locvec(vsize)
5431 locv2 = locvec(vsize)
5436 wght2 = (locwant-locv1) / (locv2-locv1)
5440 end subroutine interp_vec
5442 !!--------------------START PSH/TWG CHANGES-----------------------
5443 !--------------------INPUT FOR AEROSOL DATA---------------------------
5444 subroutine aerosol_in_cu(aeromcu,alevsiz,no_months,no_src_types,XLAT,XLONG,aeropcu, &
5445 ids, ide, jds, jde, kds, kde, &
5446 ims, ime, jms, jme, kms, kme, &
5447 its, ite, jts, jte, kts, kte)
5449 ! This module was taken from the radiation driver and modified for the
5450 ! cumulus aerosol input. - PSH
5454 INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde, &
5455 ims,ime, jms,jme, kms,kme, &
5456 its,ite, jts,jte, kts,kte
5458 INTEGER, INTENT(IN ) :: alevsiz, no_months, no_src_types
5460 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN ) :: XLAT, XLONG
5462 INTEGER :: i, j, k, itf, jtf, ktf, m, pin_unit, lat_unit,lon_unit,od_unit,ks,il, jl
5463 INTEGER :: ilon1cu, ilon2cu, jlat1cu, jlat2cu
5464 REAL :: interp_ptcu, interp_pt_latcu, interp_pt_loncu,wlat1cu,wlat2cu,wlon1cu,wlon2cu
5465 CHARACTER*256 :: message
5467 integer :: numLons, numLats, numLevs
5469 REAL, DIMENSION( ims:ime, alevsiz, jms:jme, no_months, no_src_types ),&
5470 INTENT(OUT ) :: aeromcu !PSH
5471 REAL, DIMENSION( ims:ime, alevsiz, jms:jme, no_months), OPTIONAL, &
5472 INTENT(OUT) :: aeropcu !PSH
5473 real, dimension(:, :, :, :, :), allocatable :: aeroin !PSH
5474 real, dimension(:, :, :, :), allocatable :: aeropin !PSH
5475 CHARACTER (len=10), dimension(no_src_types) :: species !PSH
5476 CHARACTER (len=100) :: fname !PSH
5477 CHARACTER (len=8) :: frmt !PSH
5478 CHARACTER (len=2) :: mons !PSH
5479 integer :: v, mi !PSH
5480 REAL, dimension(:), ALLOCATABLE :: lon_aer, lat_aer !, lev_aer !PSH
5482 INTEGER, EXTERNAL :: get_unused_unit
5483 LOGICAL, EXTERNAL :: wrf_dm_on_monitor
5484 INTEGER :: istatus, iunit
5489 ! - - - - SPECIES OF INTEREST - - - - -
5490 species = (/"DUST1 ","DUST2 ","DUST3 ","DUST4 ","SEASALT2", &
5491 "SULFATE ","BCPHO ","BCPHI ","OCPHO ","OCPHI "/)
5494 INQUIRE(FILE='./CESM_RCP4.5_Aerosol_Data.dat', EXIST=exists)
5497 iunit = get_unused_unit()
5498 IF ( iunit <= 0 ) THEN
5499 IF ( wrf_dm_on_monitor() ) THEN
5500 CALL wrf_error_fatal('Error in aerosol_in_cu: could not find a free Fortran unit.')
5504 ! Read aerosol information
5505 OPEN(UNIT=iunit, FILE='CESM_RCP4.5_Aerosol_Data.dat', FORM='unformatted', &
5506 STATUS='old', IOSTAT=istatus)
5507 IF (istatus == 0) THEN
5508 READ(UNIT=iunit) numLons, numLats,numLevs
5509 allocate(aeroin(numLons, numLats, numLevs, no_months, no_src_types))
5510 allocate(aeropin(numLons, numLats, numLevs, no_months))
5511 allocate(lon_aer(numLons))
5512 allocate(lat_aer(numLats))
5513 READ(UNIT=iunit) lat_aer
5514 READ(UNIT=iunit) lon_aer
5515 READ(UNIT=iunit) aeropin
5516 READ(UNIT=iunit) aeroin
5518 CALL wrf_error_fatal('Unable to open file "CESM_RCP4.5_Aerosol_Data.dat" (required for aercu_opt = 1 or 2). ' // &
5519 'Please refer to the run/README.namelist file for more information.')
5523 CALL wrf_error_fatal('Missing file "CESM_RCP4.5_Aerosol_Data.dat" (required for aercu_opt = 1 or 2). ' // &
5524 'Please refer to the run/README.namelist file for more information.')
5526 !---------------------------------------------------------------------------
5527 !-- latitudinally interpolate ozone data (and extend longitudinally)
5528 !-- using function lin_interpol2(x, f, y) result(g)
5530 ! interpolates f(x) to point y
5531 ! assuming f(x) = f(x0) + a * (x - x0)
5532 ! where a = ( f(x1) - f(x0) ) / (x1 - x0)
5534 ! assumes x is monotonically increasing
5535 ! real, intent(in), dimension(:) :: x ! grid points
5536 ! real, intent(in), dimension(:) :: f ! grid function values
5537 ! real, intent(in) :: y ! interpolation point
5538 ! real :: g ! interpolated function value
5539 !---------------------------------------------------------------------------
5543 interp_pt_latcu=XLAT(i,j)
5544 interp_pt_loncu=XLONG(i,j)
5545 call interp_vec_cu(lat_aer,interp_pt_latcu,.true.,jlat1cu,jlat2cu,wlat1cu,wlat2cu)
5546 call interp_vec_cu(lon_aer,interp_pt_loncu,.true.,ilon1cu,ilon2cu,wlon1cu,wlon2cu)
5550 aeropcu(i,k,j,m) = wlon1cu * (wlat1cu * aeropin(ilon1cu,jlat1cu,k,m)+&
5551 wlat2cu*aeropin(ilon1cu,jlat2cu,k,m))+&
5552 wlon2cu * (wlat1cu*aeropin(ilon2cu,jlat1cu,k,m)+&
5553 wlat2cu*aeropin(ilon2cu,jlat2cu,k,m))
5554 do ks = 1,no_src_types
5555 aeromcu(i,k,j,m,ks) = wlon1cu * (wlat1cu*aeroin(ilon1cu,jlat1cu,k,m,ks) + &
5556 wlat2cu*aeroin(ilon1cu,jlat2cu,k,m,ks))+ &
5557 wlon2cu * (wlat1cu*aeroin(ilon2cu,jlat1cu,k,m,ks) + &
5558 wlat2cu*aeroin(ilon2cu,jlat2cu,k,m,ks))
5566 END SUBROUTINE aerosol_in_cu
5568 subroutine interp_vec_cu(locvec,locwant,periodic,loc1,loc2,wght1,wght2)
5569 ! This subroutine was taken and modified from the radiation driver. -PSH
5572 real, intent(in), dimension(:) :: locvec
5573 real, intent(in) :: locwant
5574 logical, intent(in) :: periodic
5575 integer, intent(out) :: loc1, loc2
5576 real, intent(out) :: wght1, wght2
5579 real :: locv1, locv2
5581 vsize = size(locvec)
5587 if ( locvec(n) <= locwant .and. locvec(n+1) > locwant ) then
5596 if ( loc1 < 0 .and. loc2 < 0 ) then
5597 if ( periodic ) then
5598 if ( locwant < locvec(1) ) then
5601 locv1 = locvec(vsize)-360.0
5606 locv1 = locvec(vsize)
5607 locv2 = locvec(1)+360.0
5610 if ( locwant < locvec(1) ) then
5618 locv1 = locvec(vsize)
5619 locv2 = locvec(vsize)
5624 wght2 = (locwant-locv1) / (locv2-locv1)
5628 end subroutine interp_vec_cu
5629 !---------------------END PSH/TWG CHANGES----------------
5631 subroutine compute_2d_dx_area(dx, dy, msftx, msfty, dx2d, area2d, &
5632 ids, ide, jds, jde, kds, kde, &
5633 ims, ime, jms, jme, kms, kme, &
5634 its, ite, jts, jte, kts, kte)
5638 integer , intent(in) :: ids, ide, jds, jde, kds, kde, &
5639 ims, ime, jms, jme, kms, kme, &
5640 its, ite, jts, jte, kts, kte
5642 real, intent(in) :: dx, dy
5643 real, dimension(ims:ime,jms:jme), intent(in) :: msftx, msfty
5644 real, dimension(ims:ime,jms:jme), intent(out) :: dx2d, area2d
5649 do j = jts, min(jde-1,jte)
5650 do i = its, min(ide-1,ite)
5651 area2d(i,j) = dx/msftx(i,j) * dy/msfty(i,j)
5652 dx2d (i,j) = sqrt ( area2d(i,j) )
5656 do j = jts, min(jde-1,jte)
5657 do i = its, min(ide-1,ite)
5658 area2d(i,j) = dx * dy
5664 end subroutine compute_2d_dx_area
5666 SUBROUTINE shalwater_init(ims,ime,jms,jme, &
5668 bathymetry_flag, shalwater_z0, &
5669 shalwater_depth, water_depth, &
5670 xland,LakeModel,lake_depth,lakemask )
5672 INTEGER, INTENT(IN) :: ims,ime,jms,jme,its,ite,jts,jte
5673 INTEGER, INTENT(IN) :: shalwater_z0
5674 REAL, INTENT(IN) :: shalwater_depth
5675 INTEGER, INTENT(IN) :: bathymetry_flag
5676 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: water_depth
5677 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN ) :: xland
5678 INTEGER :: LakeModel
5679 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN ) :: lake_depth
5680 REAL, DIMENSION( ims:ime, jms:jme ) :: lakemask
5683 LOGICAL :: overwrite_water_depth
5684 overwrite_water_depth = .False.
5686 IF ( bathymetry_flag .eq. 1 ) THEN
5687 IF ( shalwater_depth .LE. 0.0 ) THEN
5688 IF ( LakeModel .ge. 1 ) THEN
5692 IF ( lakemask(i,j) .EQ. 1 ) THEN
5693 water_depth(i,j) = lake_depth(i,j)
5699 overwrite_water_depth = .True.
5702 IF ( shalwater_depth .GT. 0.0 ) THEN
5703 overwrite_water_depth = .True.
5705 CALL wrf_error_fatal('No bathymetry data detected and shalwater_depth not greater than 0.0. Re-run WPS to get bathymetry data or set shalwater_depth > 0.0')
5709 IF (overwrite_water_depth) THEN
5712 IF((XLAND(i,j)-1.5).GE.0)THEN
5713 water_depth(i,j) = shalwater_depth
5715 water_depth(i,j) = -2.0
5721 END SUBROUTINE shalwater_init
5723 END MODULE module_physics_init