1 | !WRF:MODEL_LAYER:INITIALIZATION |
---|
2 | ! |
---|
3 | |
---|
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 |
---|
6 | ! calling 'integrate'. |
---|
7 | |
---|
8 | ! This MODULE CONTAINS the following routines: |
---|
9 | |
---|
10 | |
---|
11 | MODULE module_physics_init |
---|
12 | |
---|
13 | USE module_state_description |
---|
14 | USE module_model_constants |
---|
15 | USE module_configure, ONLY : grid_config_rec_type |
---|
16 | |
---|
17 | CONTAINS |
---|
18 | |
---|
19 | |
---|
20 | !================================================================= |
---|
21 | SUBROUTINE phy_init ( id, config_flags, DT, restart, zfull, zhalf, & |
---|
22 | p_top, TSK,RADT,BLDT,CUDT,MPDT, & |
---|
23 | RUCUTEN, RVCUTEN, & |
---|
24 | RTHCUTEN, RQVCUTEN, RQRCUTEN, & |
---|
25 | RQCCUTEN, RQSCUTEN, RQICUTEN, & |
---|
26 | RUSHTEN, RVSHTEN, RTHSHTEN, & |
---|
27 | RQVSHTEN, RQRSHTEN, RQCSHTEN, & |
---|
28 | RQSSHTEN, RQISHTEN, RQGSHTEN, & |
---|
29 | RUBLTEN,RVBLTEN,RTHBLTEN, & |
---|
30 | RQVBLTEN,RQCBLTEN,RQIBLTEN, & |
---|
31 | RTHRATEN,RTHRATENLW,RTHRATENSW, & |
---|
32 | STEPBL,STEPRA,STEPCU, & |
---|
33 | W0AVG, RAINNC, RAINC, RAINCV, RAINNCV, & |
---|
34 | SNOWNC, SNOWNCV, GRAUPELNC, GRAUPELNCV, & |
---|
35 | NCA,swrad_scat, & |
---|
36 | CLDEFI,LOWLYR, & |
---|
37 | MASS_FLUX, & |
---|
38 | RTHFTEN, RQVFTEN, & |
---|
39 | CLDFRA,CLDFRA_OLD,GLW,GSW,EMISS,EMBCK, & !EMBCK new |
---|
40 | LU_INDEX, & |
---|
41 | landuse_ISICE, landuse_LUCATS, & |
---|
42 | landuse_LUSEAS, landuse_ISN, & |
---|
43 | lu_state, & |
---|
44 | XLAT,XLONG,ALBEDO,ALBBCK,GMT,JULYR,JULDAY,& |
---|
45 | levsiz, n_ozmixm, n_aerosolc, paerlev, & |
---|
46 | TMN,XLAND,ZNT,Z0,UST,MOL,PBLH,TKE_PBL, & |
---|
47 | EXCH_H,THC,SNOWC,MAVAIL,HFX,QFX,RAINBL, & |
---|
48 | TSLB,ZS,DZS,num_soil_layers,warm_rain, & |
---|
49 | adv_moist_cond, & |
---|
50 | APR_GR,APR_W,APR_MC,APR_ST,APR_AS, & |
---|
51 | APR_CAPMA,APR_CAPME,APR_CAPMI, & |
---|
52 | XICE,XICEM,VEGFRA,SNOW,CANWAT,SMSTAV, & |
---|
53 | SMSTOT, SFCRUNOFF,UDRUNOFF,GRDFLX,ACSNOW,& |
---|
54 | ACSNOM,IVGTYP,ISLTYP, SFCEVP, SMOIS, & |
---|
55 | SH2O, SNOWH, SMFR3D, & ! temporary |
---|
56 | SNOALB, & |
---|
57 | DX,DY,F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, & |
---|
58 | mp_restart_state,tbpvs_state,tbpvs0_state,& |
---|
59 | allowed_to_read, moved, start_of_simulation,& |
---|
60 | LAGDAY, & |
---|
61 | ids, ide, jds, jde, kds, kde, & |
---|
62 | ims, ime, jms, jme, kms, kme, & |
---|
63 | its, ite, jts, jte, kts, kte, & |
---|
64 | NUM_URBAN_LAYERS, & |
---|
65 | ozmixm,pin, & ! Optional |
---|
66 | m_ps_1,m_ps_2,m_hybi,aerosolc_1,aerosolc_2,& ! Optional |
---|
67 | RUNDGDTEN,RVNDGDTEN,RTHNDGDTEN, & ! Optional |
---|
68 | RPHNDGDTEN,RQVNDGDTEN,RMUNDGDTEN, & ! Optional |
---|
69 | FGDT,STEPFG, & ! Optional |
---|
70 | cugd_tten,cugd_ttens,cugd_qvten, & ! Optional |
---|
71 | cugd_qvtens,cugd_qcten, & ! Optional |
---|
72 | ! num_roof_layers,num_wall_layers, & !Optional urban |
---|
73 | ! num_road_layers, & !Optional urban |
---|
74 | DZR, DZB, DZG, & !Optional urban |
---|
75 | TR_URB2D,TB_URB2D,TG_URB2D,TC_URB2D, & !Optional urban |
---|
76 | QC_URB2D, XXXR_URB2D,XXXB_URB2D, & !Optional urban |
---|
77 | XXXG_URB2D, XXXC_URB2D, & !Optional urban |
---|
78 | TRL_URB3D, TBL_URB3D, TGL_URB3D, & !Optional urban |
---|
79 | SH_URB2D, LH_URB2D, G_URB2D, RN_URB2D, & !Optional urban |
---|
80 | TS_URB2D, FRC_URB2D, UTYPE_URB2D, & !Optional urban |
---|
81 | TRB_URB4D,TW1_URB4D,TW2_URB4D, & !Optional multi-layer urban |
---|
82 | TGB_URB4D,TLEV_URB3D,QLEV_URB3D, & !Optional multi-layer urban |
---|
83 | TW1LEV_URB3D,TW2LEV_URB3D, & !Optional multi-layer urban |
---|
84 | TGLEV_URB3D,TFLEV_URB3D, & !Optional multi-layer urban |
---|
85 | SF_AC_URB3D,LF_AC_URB3D,CM_AC_URB3D, & !Optional multi-layer urban |
---|
86 | SFVENT_URB3D,LFVENT_URB3D, & !Optional multi-layer urban |
---|
87 | SFWIN1_URB3D,SFWIN2_URB3D, & !Optional multi-layer urban |
---|
88 | SFW1_URB3D,SFW2_URB3D, & !Optional multi-layer urban |
---|
89 | SFR_URB3D,SFG_URB3D, & !Optional multi-layer urban |
---|
90 | A_U_BEP,A_V_BEP,A_T_BEP,A_Q_BEP, & !Optional multi-layer urban |
---|
91 | A_E_BEP,B_U_BEP,B_V_BEP, & !Optional multi-layer urban |
---|
92 | B_T_BEP,B_Q_BEP,B_E_BEP,DLG_BEP, & !Optional multi-layer urban |
---|
93 | DL_U_BEP,SF_BEP,VL_BEP, & !Optional multi-layer urban |
---|
94 | TML,T0ML,HML,H0ML,HUML,HVML,TMOML, & !Optional oml |
---|
95 | itimestep, & !Optional obs fdda |
---|
96 | #if ( EM_CORE == 1 ) |
---|
97 | fdob, & !Optional obs fdda |
---|
98 | #endif |
---|
99 | t00, p00, tlp, & !for obs-nudging |
---|
100 | TYR,TYRA,TDLY,TLAG,NYEAR,NDAY,tmn_update, & |
---|
101 | ACHFX,ACLHF,ACGRDFLX & |
---|
102 | ! OPTIONAL |
---|
103 | ,te_temf & ! WA 12/21/09 |
---|
104 | ,cf3d_temf & ! WA 9/27/10 |
---|
105 | ,wm_temf & ! WA 2/22/11 |
---|
106 | ) |
---|
107 | |
---|
108 | !----------------------------------------------------------------- |
---|
109 | USE module_domain |
---|
110 | USE module_wrf_error |
---|
111 | USE module_wind_generic |
---|
112 | USE module_wind_fitch |
---|
113 | IMPLICIT NONE |
---|
114 | !----------------------------------------------------------------- |
---|
115 | TYPE (grid_config_rec_type) :: config_flags |
---|
116 | |
---|
117 | INTEGER , INTENT(IN) :: id |
---|
118 | INTEGER , INTENT(IN) ,OPTIONAL :: tmn_update |
---|
119 | LOGICAL , INTENT(OUT) :: warm_rain,adv_moist_cond |
---|
120 | ! LOGICAL , INTENT (IN) :: FNDSOILW, FNDSNOWH |
---|
121 | LOGICAL, PARAMETER :: FNDSOILW=.true., FNDSNOWH=.true. |
---|
122 | INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, & |
---|
123 | ims, ime, jms, jme, kms, kme, & |
---|
124 | its, ite, jts, jte, kts, kte |
---|
125 | |
---|
126 | INTEGER , INTENT(IN) :: num_soil_layers |
---|
127 | INTEGER , INTENT(IN) :: lagday |
---|
128 | INTEGER , INTENT(OUT) ,OPTIONAL :: nyear |
---|
129 | REAL , INTENT(OUT) ,OPTIONAL :: nday |
---|
130 | |
---|
131 | LOGICAL, INTENT(IN) :: start_of_simulation |
---|
132 | REAL, INTENT(IN) :: DT, p_top, DX, DY |
---|
133 | LOGICAL, INTENT(IN) :: restart |
---|
134 | REAL, INTENT(IN) :: RADT,BLDT,CUDT,MPDT |
---|
135 | REAL, INTENT(IN) :: swrad_scat |
---|
136 | |
---|
137 | REAL, DIMENSION( kms:kme ) , INTENT(IN) :: zfull, zhalf |
---|
138 | REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(IN) :: TSK, XLAT, XLONG |
---|
139 | |
---|
140 | INTEGER, INTENT(IN ) :: levsiz, n_ozmixm |
---|
141 | INTEGER, INTENT(IN ) :: paerlev, n_aerosolc |
---|
142 | |
---|
143 | REAL, DIMENSION( ims:ime, levsiz, jms:jme, n_ozmixm ), OPTIONAL, & |
---|
144 | INTENT(INOUT) :: OZMIXM |
---|
145 | |
---|
146 | REAL, DIMENSION(levsiz), OPTIONAL, INTENT(INOUT) :: PIN |
---|
147 | |
---|
148 | REAL, DIMENSION(ims:ime,jms:jme), OPTIONAL, INTENT(INOUT) :: m_ps_1,m_ps_2 |
---|
149 | REAL, DIMENSION(paerlev), OPTIONAL,INTENT(INOUT) :: m_hybi |
---|
150 | REAL, DIMENSION( ims:ime, paerlev, jms:jme, n_aerosolc ), OPTIONAL, & |
---|
151 | INTENT(INOUT) :: aerosolc_1, aerosolc_2 |
---|
152 | |
---|
153 | REAL, DIMENSION( ims:ime , 1:num_soil_layers , jms:jme ),& |
---|
154 | INTENT(INOUT) :: SMOIS, SH2O,TSLB |
---|
155 | REAL, DIMENSION( ims:ime , 1:num_soil_layers , jms:jme ), INTENT(OUT) :: SMFR3D |
---|
156 | |
---|
157 | REAL, DIMENSION( ims:ime, jms:jme ) , & |
---|
158 | INTENT(INOUT) :: SNOW, & |
---|
159 | SNOWC, & |
---|
160 | SNOWH, & |
---|
161 | CANWAT, & |
---|
162 | SMSTAV, & |
---|
163 | SMSTOT, & |
---|
164 | SFCRUNOFF, & |
---|
165 | UDRUNOFF, & |
---|
166 | SFCEVP, & |
---|
167 | GRDFLX, & |
---|
168 | ACSNOW, & |
---|
169 | XICE, & |
---|
170 | XICEM, & |
---|
171 | VEGFRA, & |
---|
172 | ACSNOM |
---|
173 | |
---|
174 | REAL, DIMENSION( ims:ime, jms:jme ) , & |
---|
175 | OPTIONAL, INTENT(INOUT) :: ACHFX, & |
---|
176 | ACLHF, & |
---|
177 | ACGRDFLX |
---|
178 | |
---|
179 | INTEGER, DIMENSION( ims:ime, jms:jme ) , & |
---|
180 | INTENT(INOUT) :: IVGTYP, & |
---|
181 | ISLTYP |
---|
182 | |
---|
183 | ! rad |
---|
184 | |
---|
185 | REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: & |
---|
186 | RTHRATEN, RTHRATENLW, RTHRATENSW, CLDFRA |
---|
187 | |
---|
188 | REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , OPTIONAL, INTENT(OUT) :: & |
---|
189 | CLDFRA_OLD |
---|
190 | |
---|
191 | REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: & |
---|
192 | GSW,ALBEDO,ALBBCK,GLW,EMISS,EMBCK !EMBCK new |
---|
193 | REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: SNOALB |
---|
194 | |
---|
195 | |
---|
196 | REAL, INTENT(IN) :: GMT |
---|
197 | |
---|
198 | INTEGER , INTENT(OUT) :: STEPRA, STEPBL, STEPCU |
---|
199 | INTEGER , INTENT(IN) :: JULYR, JULDAY |
---|
200 | |
---|
201 | ! cps |
---|
202 | |
---|
203 | REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: & |
---|
204 | RUCUTEN, RVCUTEN, RTHCUTEN, RQVCUTEN, RQRCUTEN, RQCCUTEN, & |
---|
205 | RQSCUTEN, RQICUTEN, & |
---|
206 | RUSHTEN, RVSHTEN, RTHSHTEN, RQVSHTEN, RQRSHTEN, RQCSHTEN, & |
---|
207 | RQSSHTEN, RQISHTEN, RQGSHTEN |
---|
208 | |
---|
209 | REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: W0AVG |
---|
210 | |
---|
211 | REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(OUT) :: MASS_FLUX, & |
---|
212 | APR_GR,APR_W,APR_MC,APR_ST,APR_AS, & |
---|
213 | APR_CAPMA,APR_CAPME,APR_CAPMI |
---|
214 | |
---|
215 | REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: & |
---|
216 | RTHFTEN, RQVFTEN |
---|
217 | |
---|
218 | REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(OUT) :: & |
---|
219 | RAINNC, RAINC, RAINCV, RAINNCV, & |
---|
220 | SNOWNC, SNOWNCV, GRAUPELNC, GRAUPELNCV |
---|
221 | |
---|
222 | REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(OUT) :: CLDEFI, NCA |
---|
223 | |
---|
224 | INTEGER, DIMENSION( ims:ime , jms:jme ) , INTENT(OUT) :: LOWLYR |
---|
225 | |
---|
226 | !pbl |
---|
227 | |
---|
228 | ! soil layer |
---|
229 | |
---|
230 | |
---|
231 | REAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: ZS,DZS |
---|
232 | |
---|
233 | REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: & |
---|
234 | RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN,RQCBLTEN,RQIBLTEN,EXCH_H,TKE_PBL |
---|
235 | REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , OPTIONAL, INTENT(OUT) :: & |
---|
236 | cugd_tten,cugd_ttens,cugd_qvten, & |
---|
237 | cugd_qvtens,cugd_qcten |
---|
238 | REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: & |
---|
239 | XLAND,ZNT,Z0,UST,MOL,LU_INDEX, & |
---|
240 | PBLH,THC,MAVAIL,HFX,QFX,RAINBL |
---|
241 | INTEGER , INTENT(INOUT) :: landuse_ISICE, landuse_LUCATS |
---|
242 | INTEGER , INTENT(INOUT) :: landuse_LUSEAS, landuse_ISN |
---|
243 | REAL , INTENT(INOUT) , DIMENSION( : ) :: lu_state |
---|
244 | |
---|
245 | REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: TMN |
---|
246 | REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT),OPTIONAL :: TYR |
---|
247 | REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT),OPTIONAL :: TYRA |
---|
248 | REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT),OPTIONAL :: TDLY |
---|
249 | REAL, DIMENSION( ims:ime , 1:lagday , jms:jme ) , INTENT(INOUT),OPTIONAL :: TLAG |
---|
250 | |
---|
251 | !mp |
---|
252 | REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: & |
---|
253 | F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY |
---|
254 | REAL, DIMENSION(:), INTENT(INOUT) :: mp_restart_state,tbpvs_state,tbpvs0_state |
---|
255 | LOGICAL, INTENT(IN) :: allowed_to_read, moved |
---|
256 | |
---|
257 | ! ocean mixed layer |
---|
258 | REAL, DIMENSION( ims:ime , jms:jme ) , OPTIONAL, INTENT(INOUT) :: & |
---|
259 | TML,T0ML,HML,H0ML,HUML,HVML,TMOML |
---|
260 | |
---|
261 | !fdda |
---|
262 | REAL, OPTIONAL, INTENT(IN) :: FGDT |
---|
263 | INTEGER , OPTIONAL, INTENT(OUT) :: STEPFG |
---|
264 | REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , OPTIONAL, INTENT(OUT) :: & |
---|
265 | RUNDGDTEN, RVNDGDTEN, RTHNDGDTEN, RPHNDGDTEN, RQVNDGDTEN |
---|
266 | REAL, DIMENSION( ims:ime , jms:jme ) , OPTIONAL, INTENT(OUT) :: & |
---|
267 | RMUNDGDTEN |
---|
268 | |
---|
269 | !URBAN |
---|
270 | ! REAL, DIMENSION(1:num_roof_layers), INTENT(INOUT) :: DZR !urban |
---|
271 | ! REAL, DIMENSION(1:num_wall_layers), INTENT(INOUT) :: DZB !urban |
---|
272 | ! REAL, DIMENSION(1:num_road_layers), INTENT(INOUT) :: DZG !urban |
---|
273 | REAL, OPTIONAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: DZR !urban |
---|
274 | REAL, OPTIONAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: DZB !urban |
---|
275 | REAL, OPTIONAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: DZG !urban |
---|
276 | |
---|
277 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TR_URB2D !urban |
---|
278 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TB_URB2D !urban |
---|
279 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TG_URB2D !urban |
---|
280 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TC_URB2D !urban |
---|
281 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: QC_URB2D !urban |
---|
282 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXR_URB2D !urban |
---|
283 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXB_URB2D !urban |
---|
284 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXG_URB2D !urban |
---|
285 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXC_URB2D !urban |
---|
286 | |
---|
287 | ! REAL, DIMENSION(ims:ime, 1:num_roof_layers, jms:jme), INTENT(INOUT) :: TRL_URB3D !urban |
---|
288 | ! REAL, DIMENSION(ims:ime, 1:num_wall_layers, jms:jme), INTENT(INOUT) :: TBL_URB3D !urban |
---|
289 | ! REAL, DIMENSION(ims:ime, 1:num_road_layers, jms:jme), INTENT(INOUT) :: TGL_URB3D !urban |
---|
290 | REAL, OPTIONAL, DIMENSION(ims:ime, 1:num_soil_layers, jms:jme), INTENT(INOUT) :: TRL_URB3D !urban |
---|
291 | REAL, OPTIONAL, DIMENSION(ims:ime, 1:num_soil_layers, jms:jme), INTENT(INOUT) :: TBL_URB3D !urban |
---|
292 | REAL, OPTIONAL, DIMENSION(ims:ime, 1:num_soil_layers, jms:jme), INTENT(INOUT) :: TGL_URB3D !urban |
---|
293 | |
---|
294 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: SH_URB2D !urban |
---|
295 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: LH_URB2D !urban |
---|
296 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: G_URB2D !urban |
---|
297 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: RN_URB2D !urban |
---|
298 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TS_URB2D !urban |
---|
299 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: FRC_URB2D !urban |
---|
300 | INTEGER, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: UTYPE_URB2D !urban |
---|
301 | |
---|
302 | INTEGER , INTENT(IN) :: num_urban_layers |
---|
303 | REAL, OPTIONAL, DIMENSION(ims:ime, 1:num_urban_layers, jms:jme), INTENT(INOUT) :: TRB_URB4D ! multi-layer UCM |
---|
304 | REAL, OPTIONAL, DIMENSION(ims:ime, 1:num_urban_layers, jms:jme), INTENT(INOUT) :: TW1_URB4D ! multi-layer UCM |
---|
305 | REAL, OPTIONAL, DIMENSION(ims:ime, 1:num_urban_layers, jms:jme), INTENT(INOUT) :: TW2_URB4D ! multi-layer UCM |
---|
306 | REAL, OPTIONAL, DIMENSION(ims:ime, 1:num_urban_layers, jms:jme), INTENT(INOUT) :: TGB_URB4D ! multi-layer UCM |
---|
307 | REAL, OPTIONAL, DIMENSION(ims:ime, 1:num_urban_layers, jms:jme), INTENT(INOUT) :: TLEV_URB3D ! multi-layer UCM |
---|
308 | REAL, OPTIONAL, DIMENSION(ims:ime, 1:num_urban_layers, jms:jme), INTENT(INOUT) :: QLEV_URB3D ! multi-layer UCM |
---|
309 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: TW1LEV_URB3D ! multi-layer UCM |
---|
310 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: TW2LEV_URB3D ! multi-layer UCM |
---|
311 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: TGLEV_URB3D ! multi-layer UCM |
---|
312 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: TFLEV_URB3D ! multi-layer UCM |
---|
313 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: LF_AC_URB3D !multi-layer UCM |
---|
314 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: SF_AC_URB3D !multi-layer UCM |
---|
315 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: CM_AC_URB3D !multi-layer UCM |
---|
316 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: SFVENT_URB3D !multi-layer UCM |
---|
317 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: LFVENT_URB3D !multi-layer UCM |
---|
318 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: SFWIN1_URB3D ! multi-layer UCM |
---|
319 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: SFWIN2_URB3D ! multi-layer UCM |
---|
320 | REAL, OPTIONAL, DIMENSION(ims:ime, 1:num_urban_layers, jms:jme), INTENT(INOUT) :: SFG_URB3D ! multi-layer UCM |
---|
321 | REAL, OPTIONAL, DIMENSION(ims:ime, 1:num_urban_layers, jms:jme), INTENT(INOUT) :: SFR_URB3D ! multi-layer UCM |
---|
322 | REAL, OPTIONAL, DIMENSION(ims:ime, 1:num_urban_layers, jms:jme), INTENT(INOUT) :: SFW1_URB3D ! multi-layer UCM |
---|
323 | REAL, OPTIONAL, DIMENSION(ims:ime, 1:num_urban_layers, jms:jme), INTENT(INOUT) :: SFW2_URB3D ! multi-layer UCM |
---|
324 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_U_BEP |
---|
325 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_V_BEP |
---|
326 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_T_BEP |
---|
327 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_Q_BEP |
---|
328 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_E_BEP |
---|
329 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_U_BEP |
---|
330 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_V_BEP |
---|
331 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_T_BEP |
---|
332 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_Q_BEP |
---|
333 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_E_BEP |
---|
334 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: VL_BEP |
---|
335 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: DLG_BEP |
---|
336 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme,jms:jme), INTENT(INOUT) :: SF_BEP |
---|
337 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: DL_U_BEP |
---|
338 | |
---|
339 | !obs fdda |
---|
340 | INTEGER, OPTIONAL, INTENT(IN) :: itimestep |
---|
341 | #if ( EM_CORE == 1 ) |
---|
342 | TYPE(fdob_type), OPTIONAL, INTENT(INOUT) :: fdob |
---|
343 | #endif |
---|
344 | REAL, OPTIONAL, INTENT(IN) :: p00, t00, tlp ! for obs-nudging base-state calcn |
---|
345 | |
---|
346 | ! WA 12/21/09 |
---|
347 | REAL,OPTIONAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , & |
---|
348 | INTENT(OUT) :: te_temf, cf3d_temf |
---|
349 | ! WA 2/22/11 |
---|
350 | REAL,OPTIONAL, DIMENSION( ims:ime , jms:jme ) , & |
---|
351 | INTENT(OUT) :: wm_temf |
---|
352 | |
---|
353 | ! Local data |
---|
354 | |
---|
355 | REAL :: ALBLND,ZZLND,ZZWTR,THINLD,XMAVA,CEN_LAT,pptop |
---|
356 | REAL, DIMENSION( kms:kme ) :: sfull, shalf |
---|
357 | REAL :: obs_twindo_cg, obs_twindo |
---|
358 | |
---|
359 | CHARACTER*256 :: MMINLU_loc |
---|
360 | CHARACTER*80 :: message |
---|
361 | INTEGER :: ISWATER |
---|
362 | INTEGER :: ISICE |
---|
363 | INTEGER :: ISURBAN |
---|
364 | INTEGER :: sf_urban_physics |
---|
365 | INTEGER :: omlcall |
---|
366 | REAL :: oml_hml0 |
---|
367 | LOGICAL :: usemonalb |
---|
368 | LOGICAL :: rdmaxalb |
---|
369 | |
---|
370 | INTEGER :: i, j, k, itf, jtf, n |
---|
371 | integer myproc |
---|
372 | |
---|
373 | !----------------------------------------------------------------- |
---|
374 | |
---|
375 | sf_urban_physics=config_flags%sf_urban_physics |
---|
376 | usemonalb=config_flags%usemonalb |
---|
377 | rdmaxalb=config_flags%rdmaxalb |
---|
378 | #if ( EM_CORE == 1 ) |
---|
379 | obs_twindo_cg=model_config_rec%obs_twindo(1) |
---|
380 | obs_twindo=config_flags%obs_twindo |
---|
381 | oml_hml0=config_flags%oml_hml0 |
---|
382 | omlcall=config_flags%omlcall |
---|
383 | #endif |
---|
384 | |
---|
385 | !-- should be from the namelist |
---|
386 | |
---|
387 | sfull = 0. |
---|
388 | shalf = 0. |
---|
389 | |
---|
390 | CALL wrf_debug(100,'top of phy_init') |
---|
391 | |
---|
392 | WRITE(wrf_err_message,*) 'phy_init: start_of_simulation = ',start_of_simulation |
---|
393 | CALL wrf_debug ( 100, TRIM(wrf_err_message) ) |
---|
394 | |
---|
395 | itf=min0(ite,ide-1) |
---|
396 | jtf=min0(jte,jde-1) |
---|
397 | |
---|
398 | ZZLND=0.1 |
---|
399 | ZZWTR=0.0001 |
---|
400 | THINLD=0.04 |
---|
401 | ALBLND=0.2 |
---|
402 | XMAVA=0.3 |
---|
403 | |
---|
404 | #if (NMM_CORE == 1) |
---|
405 | if (.not.usemonalb) CALL wrf_error_fatal('usemonalb should always be true for NMM') |
---|
406 | #endif |
---|
407 | |
---|
408 | CALL nl_get_cen_lat(id,cen_lat) |
---|
409 | CALL wrf_debug(100,'calling nl_get_iswater, nl_get_isice, nl_get_mminlu_loc') |
---|
410 | CALL nl_get_iswater(id,iswater) |
---|
411 | CALL nl_get_isice(id,isice) |
---|
412 | CALL nl_get_isurban(id,isurban) |
---|
413 | CALL nl_get_mminlu( 1, mminlu_loc ) |
---|
414 | CALL wrf_debug(100,'after nl_get_iswater, nl_get_isice, nl_get_mminlu_loc') |
---|
415 | !-- temporary fix by ww |
---|
416 | landuse_ISICE = isice |
---|
417 | |
---|
418 | ! Added for Wind Turbine parameterization code -- This will only read in an optional |
---|
419 | ! configuration file with information that will be used by inividual turbine init routines |
---|
420 | ! as each domain is initialized. |
---|
421 | IF ( id .EQ. 1 ) THEN |
---|
422 | CALL init_module_wind_generic |
---|
423 | CALL init_module_wind_fitch |
---|
424 | ENDIF |
---|
425 | ! |
---|
426 | |
---|
427 | IF(.not.restart)THEN |
---|
428 | !-- initialize common variables |
---|
429 | |
---|
430 | IF ( .NOT. moved ) THEN |
---|
431 | DO j=jts,jtf |
---|
432 | DO i=its,itf |
---|
433 | XLAND(i,j)=1. |
---|
434 | GSW(i,j)=0. |
---|
435 | GLW(i,j)=0. |
---|
436 | !-- initialize ust to a small value |
---|
437 | UST(i,j)=0.0001 |
---|
438 | MOL(i,j)=0.0 |
---|
439 | PBLH(i,j)=0.0 |
---|
440 | HFX(i,j)=0. |
---|
441 | QFX(i,j)=0. |
---|
442 | RAINBL(i,j)=0. |
---|
443 | RAINNCV(i,j)=0. |
---|
444 | SNOWNCV(i,j)=0. |
---|
445 | GRAUPELNCV(i,j)=0. |
---|
446 | ACSNOW(i,j)=0. |
---|
447 | DO k=kms,kme !wig, 17-May-2006: Added for idealized chem. runs |
---|
448 | EXCH_H(i,k,j) = 0. |
---|
449 | END DO |
---|
450 | ENDDO |
---|
451 | ENDDO |
---|
452 | ENDIF |
---|
453 | ! |
---|
454 | IF(PRESENT(TMN_UPDATE))THEN |
---|
455 | if(tmn_update.eq.1) then |
---|
456 | nyear=1 |
---|
457 | nday=0. |
---|
458 | DO j=jts,jtf |
---|
459 | DO i=its,itf |
---|
460 | TYR(i,j)=TMN(i,j) |
---|
461 | TYRA(i,j)=TMN(i,j) |
---|
462 | TDLY(i,j)=TMN(i,j) |
---|
463 | DO n=1,lagday |
---|
464 | TLAG(i,n,j)=TMN(i,j) |
---|
465 | ENDDO |
---|
466 | ENDDO |
---|
467 | ENDDO |
---|
468 | endif |
---|
469 | ENDIF |
---|
470 | ! |
---|
471 | |
---|
472 | ! |
---|
473 | DO j=jts,jtf |
---|
474 | DO i=its,itf |
---|
475 | IF(XLAND(i,j) .LT. 1.5)THEN |
---|
476 | IF(mminlu_loc .EQ. ' ') ALBBCK(i,j)=ALBLND |
---|
477 | EMBCK(i,j)=0.85 |
---|
478 | ALBEDO(i,j)=ALBBCK(i,j) |
---|
479 | EMISS(i,j)=EMBCK(i,j) |
---|
480 | THC(i,j)=THINLD |
---|
481 | ZNT(i,j)=ZZLND |
---|
482 | #if ! ( NMM_CORE == 1 ) |
---|
483 | Z0(i,j)=ZZLND |
---|
484 | #endif |
---|
485 | MAVAIL(i,j)=XMAVA |
---|
486 | ELSE |
---|
487 | IF(mminlu_loc .EQ. ' ') ALBBCK(i,j)=0.08 |
---|
488 | ALBEDO(i,j)=ALBBCK(i,j) |
---|
489 | EMBCK(i,j)=0.98 |
---|
490 | EMISS(i,j)=EMBCK(i,j) |
---|
491 | THC(i,j)=THINLD |
---|
492 | ZNT(i,j)=ZZWTR |
---|
493 | #if ! ( NMM_CORE == 1 ) |
---|
494 | Z0(i,j)=ZZWTR |
---|
495 | #endif |
---|
496 | MAVAIL(i,j)=1.0 |
---|
497 | ENDIF |
---|
498 | |
---|
499 | ENDDO |
---|
500 | ENDDO |
---|
501 | |
---|
502 | CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to landuse_init' ) |
---|
503 | |
---|
504 | IF(mminlu_loc .ne. ' ')THEN |
---|
505 | !-- initialize surface properties |
---|
506 | |
---|
507 | CALL landuse_init(lu_index, snowc, albedo, albbck, snoalb, mavail, emiss, embck, & |
---|
508 | znt, Z0, thc, xland, xice, xicem, julday, cen_lat, iswater, & |
---|
509 | TRIM ( mminlu_loc ) , & |
---|
510 | landuse_ISICE, landuse_LUCATS, & |
---|
511 | landuse_LUSEAS, landuse_ISN, & |
---|
512 | config_flags%fractional_seaice, & |
---|
513 | lu_state, & |
---|
514 | allowed_to_read , usemonalb , & |
---|
515 | ids, ide, jds, jde, kds, kde, & |
---|
516 | ims, ime, jms, jme, kms, kme, & |
---|
517 | its, ite, jts, jte, kts, kte ) |
---|
518 | ENDIF |
---|
519 | |
---|
520 | ENDIF |
---|
521 | |
---|
522 | !-- convert zfull and zhalf to sigma values for ra_init (Eta CO2 needs these) |
---|
523 | !-- zfull/zhalf may be either zeta or eta |
---|
524 | !-- what is done here depends on coordinate (check this code if adding new coordinates) |
---|
525 | CALL z2sigma(zfull,zhalf,sfull,shalf,p_top,pptop,config_flags, & |
---|
526 | allowed_to_read, & |
---|
527 | kds,kde,kms,kme,kts,kte) |
---|
528 | |
---|
529 | !-- initialize physics |
---|
530 | !-- ra: radiation |
---|
531 | !-- bl: pbl |
---|
532 | !-- cu: cumulus |
---|
533 | !-- mp: microphysics |
---|
534 | |
---|
535 | CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to ra_init' ) |
---|
536 | |
---|
537 | CALL ra_init(id=id,STEPRA=STEPRA,RADT=RADT,DT=DT,RTHRATEN=RTHRATEN,RTHRATENLW=RTHRATENLW, & |
---|
538 | RTHRATENSW=RTHRATENSW,CLDFRA=CLDFRA,EMISS=EMISS,cen_lat=cen_lat,JULYR=JULYR,JULDAY=JULDAY,GMT=GMT, & |
---|
539 | levsiz=levsiz,XLAT=XLAT,n_ozmixm=n_ozmixm, & |
---|
540 | cldfra_old=cldfra_old, & ! Optional |
---|
541 | ozmixm=ozmixm,pin=pin, & ! Optional |
---|
542 | 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 |
---|
543 | paerlev=paerlev,n_aerosolc=n_aerosolc, & |
---|
544 | sfull=sfull,shalf=shalf,pptop=pptop,swrad_scat=swrad_scat,p_top=p_top, & |
---|
545 | config_flags=config_flags,restart=restart, & |
---|
546 | allowed_to_read=allowed_to_read, start_of_simulation=start_of_simulation, & |
---|
547 | ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, & |
---|
548 | ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, & |
---|
549 | its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte ) |
---|
550 | |
---|
551 | CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to bl_init' ) |
---|
552 | CALL bl_init(STEPBL,BLDT,DT,RUBLTEN,RVBLTEN,RTHBLTEN, & |
---|
553 | RQVBLTEN,RQCBLTEN,RQIBLTEN,TSK,TMN, & |
---|
554 | config_flags,restart,UST,LOWLYR,TSLB,ZS,DZS, & |
---|
555 | num_soil_layers,TKE_PBL, & |
---|
556 | EXCH_H,VEGFRA, & |
---|
557 | SNOW,SNOWC, CANWAT,SMSTAV, & |
---|
558 | SMSTOT, SFCRUNOFF,UDRUNOFF,ACSNOW,ACSNOM, & |
---|
559 | IVGTYP,ISLTYP,ISURBAN,SMOIS,SMFR3D,MAVAIL, & |
---|
560 | SNOWH,SH2O,SNOALB,FNDSOILW,FNDSNOWH,RDMAXALB, & |
---|
561 | #if (NMM_CORE == 1) |
---|
562 | Z0,XLAND,XICE, & |
---|
563 | #else |
---|
564 | ZNT,XLAND,XICE, & |
---|
565 | #endif |
---|
566 | SFCEVP,GRDFLX, & |
---|
567 | TRIM (MMINLU_LOC), & |
---|
568 | allowed_to_read , & |
---|
569 | start_of_simulation , & |
---|
570 | te_temf,cf3d_temf,wm_temf, & ! WA |
---|
571 | DZR, DZB, DZG, & !Optional urban |
---|
572 | TR_URB2D,TB_URB2D,TG_URB2D,TC_URB2D,QC_URB2D, & !Optional urban |
---|
573 | XXXR_URB2D,XXXB_URB2D,XXXG_URB2D,XXXC_URB2D, & !Optional urban |
---|
574 | TRL_URB3D, TBL_URB3D, TGL_URB3D, & !Optional urban |
---|
575 | SH_URB2D, LH_URB2D, G_URB2D, RN_URB2D, & !Optional urban |
---|
576 | TS_URB2D, FRC_URB2D, UTYPE_URB2D, & |
---|
577 | SF_URBAN_PHYSICS, & !Optional urban |
---|
578 | NUM_URBAN_LAYERS, & !Optional multi-layer urban |
---|
579 | TRB_URB4D,TW1_URB4D,TW2_URB4D, & !Optional multi-layer urban |
---|
580 | TGB_URB4D,TLEV_URB3D,QLEV_URB3D, & !Optional multi-layer urban |
---|
581 | TW1LEV_URB3D,TW2LEV_URB3D, & !Optional multi-layer urban |
---|
582 | TGLEV_URB3D,TFLEV_URB3D, & !Optional multi-layer urban |
---|
583 | SF_AC_URB3D,LF_AC_URB3D,CM_AC_URB3D, & !Optional multi-layer urban |
---|
584 | SFVENT_URB3D,LFVENT_URB3D, & !Optional multi-layer urban |
---|
585 | SFWIN1_URB3D,SFWIN2_URB3D, & !Optional multi-layer urban |
---|
586 | SFW1_URB3D,SFW2_URB3D, & !Optional multi-layer urban |
---|
587 | SFR_URB3D,SFG_URB3D, & !Optional multi-layer urban |
---|
588 | A_U_BEP,A_V_BEP,A_T_BEP,A_Q_BEP, & !Optional multi-layer urban |
---|
589 | A_E_BEP,B_U_BEP,B_V_BEP, & !Optional multi-layer urban |
---|
590 | B_T_BEP,B_Q_BEP,B_E_BEP,DLG_BEP, & !Optional multi-layer urban |
---|
591 | DL_U_BEP,SF_BEP,VL_BEP, & !Optional multi-layer urban |
---|
592 | ids, ide, jds, jde, kds, kde, & |
---|
593 | ims, ime, jms, jme, kms, kme, & |
---|
594 | its, ite, jts, jte, kts, kte, & |
---|
595 | ACHFX,ACLHF,ACGRDFLX, & |
---|
596 | oml_hml0, omlcall, & !Optional oml |
---|
597 | TML,T0ML,HML,H0ML,HUML,HVML,TMOML ) !Optional oml |
---|
598 | |
---|
599 | CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to cu_init' ) |
---|
600 | |
---|
601 | CALL cu_init(STEPCU,CUDT,DT,RUCUTEN,RVCUTEN,RTHCUTEN, & |
---|
602 | RQVCUTEN,RQRCUTEN,RQCCUTEN,RQSCUTEN,RQICUTEN, & |
---|
603 | NCA,RAINC,RAINCV,W0AVG,config_flags,restart, & |
---|
604 | CLDEFI,LOWLYR,MASS_FLUX, & |
---|
605 | RTHFTEN, RQVFTEN, & |
---|
606 | APR_GR,APR_W,APR_MC,APR_ST,APR_AS, & |
---|
607 | APR_CAPMA,APR_CAPME,APR_CAPMI, & |
---|
608 | cugd_tten,cugd_ttens,cugd_qvten, & |
---|
609 | cugd_qvtens,cugd_qcten, & |
---|
610 | allowed_to_read, start_of_simulation, & |
---|
611 | ids, ide, jds, jde, kds, kde, & |
---|
612 | ims, ime, jms, jme, kms, kme, & |
---|
613 | its, ite, jts, jte, kts, kte ) |
---|
614 | |
---|
615 | CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to shcu_init' ) |
---|
616 | |
---|
617 | CALL shcu_init(STEPCU,CUDT,DT,RUSHTEN,RVSHTEN,RTHSHTEN, & |
---|
618 | RQVSHTEN,RQRSHTEN,RQCSHTEN, & |
---|
619 | RQSSHTEN,RQISHTEN,RQGSHTEN, & |
---|
620 | NCA,RAINC,RAINCV,config_flags,restart, & |
---|
621 | allowed_to_read, start_of_simulation, & |
---|
622 | ids, ide, jds, jde, kds, kde, & |
---|
623 | ims, ime, jms, jme, kms, kme, & |
---|
624 | its, ite, jts, jte, kts, kte ) |
---|
625 | |
---|
626 | CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to mp_init' ) |
---|
627 | |
---|
628 | CALL mp_init(RAINNC,SNOWNC,GRAUPELNC,config_flags,restart,warm_rain, & |
---|
629 | adv_moist_cond, & |
---|
630 | MPDT, DT, DX, DY, LOWLYR, & |
---|
631 | F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, & |
---|
632 | mp_restart_state,tbpvs_state,tbpvs0_state, & |
---|
633 | allowed_to_read, start_of_simulation, & |
---|
634 | ids, ide, jds, jde, kds, kde, & |
---|
635 | ims, ime, jms, jme, kms, kme, & |
---|
636 | its, ite, jts, jte, kts, kte ) |
---|
637 | |
---|
638 | #if ( EM_CORE == 1 ) |
---|
639 | CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to fg_init' ) |
---|
640 | |
---|
641 | CALL fg_init(STEPFG,FGDT,DT,id,RUNDGDTEN,RVNDGDTEN, & |
---|
642 | RTHNDGDTEN,RPHNDGDTEN,RQVNDGDTEN,RMUNDGDTEN, & |
---|
643 | config_flags,restart, & |
---|
644 | allowed_to_read , & |
---|
645 | ids, ide, jds, jde, kds, kde, & |
---|
646 | ims, ime, jms, jme, kms, kme, & |
---|
647 | its, ite, jts, jte, kts, kte ) |
---|
648 | |
---|
649 | CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to fdob_init' ) |
---|
650 | |
---|
651 | CALL fdob_init(model_config_rec%obs_nudge_opt, & |
---|
652 | model_config_rec%max_dom, & |
---|
653 | id, & |
---|
654 | model_config_rec%parent_id, & |
---|
655 | model_config_rec%obs_idynin, & |
---|
656 | model_config_rec%obs_dtramp, & |
---|
657 | model_config_rec%fdda_end, & |
---|
658 | model_config_rec%restart, & |
---|
659 | obs_twindo_cg, obs_twindo, & |
---|
660 | itimestep, & |
---|
661 | model_config_rec%obs_no_pbl_nudge_uv, & |
---|
662 | model_config_rec%obs_no_pbl_nudge_t, & |
---|
663 | model_config_rec%obs_no_pbl_nudge_q, & |
---|
664 | model_config_rec%obs_sfc_scheme_horiz, & |
---|
665 | model_config_rec%obs_sfc_scheme_vert, & |
---|
666 | model_config_rec%obs_max_sndng_gap, & |
---|
667 | model_config_rec%obs_sfcfact, & |
---|
668 | model_config_rec%obs_sfcfacr, & |
---|
669 | model_config_rec%obs_dpsmx, & |
---|
670 | model_config_rec%obs_nudge_wind, & |
---|
671 | model_config_rec%obs_nudge_temp, & |
---|
672 | model_config_rec%obs_nudge_mois, & |
---|
673 | model_config_rec%obs_nudgezfullr1_uv, & |
---|
674 | model_config_rec%obs_nudgezrampr1_uv, & |
---|
675 | model_config_rec%obs_nudgezfullr2_uv, & |
---|
676 | model_config_rec%obs_nudgezrampr2_uv, & |
---|
677 | model_config_rec%obs_nudgezfullr4_uv, & |
---|
678 | model_config_rec%obs_nudgezrampr4_uv, & |
---|
679 | model_config_rec%obs_nudgezfullr1_t, & |
---|
680 | model_config_rec%obs_nudgezrampr1_t, & |
---|
681 | model_config_rec%obs_nudgezfullr2_t, & |
---|
682 | model_config_rec%obs_nudgezrampr2_t, & |
---|
683 | model_config_rec%obs_nudgezfullr4_t, & |
---|
684 | model_config_rec%obs_nudgezrampr4_t, & |
---|
685 | model_config_rec%obs_nudgezfullr1_q, & |
---|
686 | model_config_rec%obs_nudgezrampr1_q, & |
---|
687 | model_config_rec%obs_nudgezfullr2_q, & |
---|
688 | model_config_rec%obs_nudgezrampr2_q, & |
---|
689 | model_config_rec%obs_nudgezfullr4_q, & |
---|
690 | model_config_rec%obs_nudgezrampr4_q, & |
---|
691 | model_config_rec%obs_nudgezfullmin, & |
---|
692 | model_config_rec%obs_nudgezrampmin, & |
---|
693 | model_config_rec%obs_nudgezmax, & |
---|
694 | xlat, & |
---|
695 | xlong, & |
---|
696 | model_config_rec%start_year(id), & |
---|
697 | model_config_rec%start_month(id), & |
---|
698 | model_config_rec%start_day(id), & |
---|
699 | model_config_rec%start_hour(id), & |
---|
700 | model_config_rec%start_minute(id), & |
---|
701 | model_config_rec%start_second(id), & |
---|
702 | p00, t00, tlp, & |
---|
703 | zhalf, p_top, & |
---|
704 | fdob, & |
---|
705 | model_config_rec%obs_ipf_init, & |
---|
706 | ids, ide, jds, jde, kds, kde, & |
---|
707 | ims, ime, jms, jme, kms, kme, & |
---|
708 | its, ite, jts, jte, kts, kte ) |
---|
709 | |
---|
710 | #endif |
---|
711 | |
---|
712 | END SUBROUTINE phy_init |
---|
713 | |
---|
714 | !===================================================================== |
---|
715 | SUBROUTINE landuse_init(lu_index, snowc, albedo, albbck, snoalb, mavail, emiss, embck, & |
---|
716 | znt,Z0,thc,xland, xice, xicem, julday, cen_lat, iswater, mminlu, & |
---|
717 | ISICE, LUCATS, LUSEAS, ISN, & |
---|
718 | fractional_seaice, & |
---|
719 | lu_state, & |
---|
720 | allowed_to_read , usemonalb , & |
---|
721 | ids, ide, jds, jde, kds, kde, & |
---|
722 | ims, ime, jms, jme, kms, kme, & |
---|
723 | its, ite, jts, jte, kts, kte ) |
---|
724 | |
---|
725 | USE module_wrf_error |
---|
726 | IMPLICIT NONE |
---|
727 | |
---|
728 | !--------------------------------------------------------------------- |
---|
729 | INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, & |
---|
730 | ims, ime, jms, jme, kms, kme, & |
---|
731 | its, ite, jts, jte, kts, kte |
---|
732 | |
---|
733 | INTEGER , INTENT(IN) :: iswater, julday |
---|
734 | REAL , INTENT(IN) :: cen_lat |
---|
735 | CHARACTER(LEN=*), INTENT(IN) :: mminlu |
---|
736 | LOGICAL, INTENT(IN) :: allowed_to_read , usemonalb |
---|
737 | REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(IN ) :: lu_index, snowc, xice, snoalb |
---|
738 | REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(OUT ) :: albedo, albbck, mavail, emiss, & |
---|
739 | embck, & |
---|
740 | znt, Z0, thc, xland, xicem |
---|
741 | INTEGER , INTENT(INOUT) :: ISICE, LUCATS, LUSEAS, ISN, fractional_seaice |
---|
742 | REAL , INTENT(INOUT) , DIMENSION( : ) :: lu_state |
---|
743 | |
---|
744 | REAL :: xice_threshold |
---|
745 | !--------------------------------------------------------------------- |
---|
746 | ! Local |
---|
747 | CHARACTER*256 LUTYPE |
---|
748 | CHARACTER*80 :: message |
---|
749 | INTEGER :: landuse_unit, LS, LC, LI, LUN, NSN |
---|
750 | INTEGER :: i, j, itf, jtf, is, cats, seas, curs |
---|
751 | INTEGER , PARAMETER :: OPEN_OK = 0 |
---|
752 | INTEGER :: ierr |
---|
753 | INTEGER , PARAMETER :: max_cats = 100 , max_seas = 12 |
---|
754 | REAL , DIMENSION( max_cats, max_seas ) :: ALBD, SLMO, SFEM, SFZ0, THERIN, SFHC |
---|
755 | REAL , DIMENSION( max_cats ) :: SCFX |
---|
756 | ! save these fields in case nest moves or has to be reinitialized |
---|
757 | ! and this routine is called with allowed_to_read set to false |
---|
758 | ! note that by saving these, we're locking in the same landuse for |
---|
759 | ! the duration of a run; possible implications for long climate runs |
---|
760 | LOGICAL :: found_lu, end_of_file |
---|
761 | LOGICAL, EXTERNAL :: wrf_dm_on_monitor |
---|
762 | |
---|
763 | !--------------------------------------------------------------------- |
---|
764 | |
---|
765 | CALL wrf_debug( 100 , 'top of landuse_init' ) |
---|
766 | |
---|
767 | NSN=-1 ! set this to suppress uninitalized data messages from tools |
---|
768 | |
---|
769 | if ( fractional_seaice == 0 ) then |
---|
770 | xice_threshold = 0.5 |
---|
771 | else if ( fractional_seaice == 1 ) then |
---|
772 | xice_threshold = 0.02 |
---|
773 | endif |
---|
774 | |
---|
775 | ! recover LU variables from state |
---|
776 | IF ( 6*(max_cats*max_seas)+1*max_cats .GT. 7501 ) THEN |
---|
777 | WRITE(message,*)'landuse_init: lu_state overflow. Make Registry dimspec p > ',6*(max_cats*max_seas)+1*max_cats |
---|
778 | ENDIF |
---|
779 | curs = 1 |
---|
780 | DO cats = 1, max_cats |
---|
781 | SCFX(cats) = lu_state(curs) ; curs = curs + 1 |
---|
782 | DO seas = 1, max_seas |
---|
783 | ALBD(cats,seas) = lu_state(curs) ; curs = curs + 1 |
---|
784 | SLMO(cats,seas) = lu_state(curs) ; curs = curs + 1 |
---|
785 | SFEM(cats,seas) = lu_state(curs) ; curs = curs + 1 |
---|
786 | SFZ0(cats,seas) = lu_state(curs) ; curs = curs + 1 |
---|
787 | SFHC(cats,seas) = lu_state(curs) ; curs = curs + 1 |
---|
788 | THERIN(cats,seas) = lu_state(curs) ; curs = curs + 1 |
---|
789 | ENDDO |
---|
790 | ENDDO |
---|
791 | |
---|
792 | ! Determine season (summer=1, winter=2) |
---|
793 | ISN=1 |
---|
794 | IF(JULDAY.LT.105.OR.JULDAY.GT.288)ISN=2 |
---|
795 | IF(CEN_LAT.LT.0.0)ISN=3-ISN |
---|
796 | |
---|
797 | FOUND_LU = .TRUE. |
---|
798 | IF ( allowed_to_read ) THEN |
---|
799 | landuse_unit = 29 |
---|
800 | IF ( wrf_dm_on_monitor() ) THEN |
---|
801 | OPEN(landuse_unit, FILE='LANDUSE.TBL',FORM='FORMATTED',STATUS='OLD',IOSTAT=ierr) |
---|
802 | IF ( ierr .NE. OPEN_OK ) THEN |
---|
803 | WRITE(message,FMT='(A)') & |
---|
804 | 'module_physics_init.F: LANDUSE_INIT: open failure for LANDUSE.TBL' |
---|
805 | CALL wrf_error_fatal ( message ) |
---|
806 | END IF |
---|
807 | ENDIF |
---|
808 | |
---|
809 | ! Read info from file LANDUSE.TBL |
---|
810 | ! IF(MMINLU.EQ.'OLD ')THEN |
---|
811 | ! ISWATER=7 |
---|
812 | ! ISICE=11 |
---|
813 | ! ELSE IF(MMINLU.EQ.'USGS')THEN |
---|
814 | ! ISWATER=16 |
---|
815 | ! ISICE=24 |
---|
816 | ! ELSE IF(MMINLU.EQ.'SiB ')THEN |
---|
817 | ! ISWATER=15 |
---|
818 | ! ISICE=16 |
---|
819 | ! ELSE IF(MMINLU.EQ.'LW12')THEN |
---|
820 | ! ISWATER=15 |
---|
821 | ! ISICE=3 |
---|
822 | ! ELSE IF (MMINLU .EQ. 'MODIFIED_IGBP_MODIS_NOAH') THEN |
---|
823 | ! ISICE = 15 |
---|
824 | ! ELSE |
---|
825 | ! call wrf_error_fatal ("INPUT LandUse not found: "//TRIM(MMINLU)) |
---|
826 | ! ENDIF |
---|
827 | call wrf_message ( 'INPUT LandUse = "' // TRIM(MMINLU) // '"' ) |
---|
828 | FOUND_LU = .FALSE. |
---|
829 | end_of_file = .FALSE. |
---|
830 | !!! BEGINNING OF 1999 LOOP |
---|
831 | 1999 CONTINUE |
---|
832 | IF ( wrf_dm_on_monitor() ) THEN |
---|
833 | READ (landuse_unit,*,END=2002)LUTYPE |
---|
834 | GOTO 2003 |
---|
835 | 2002 CONTINUE |
---|
836 | CALL wrf_message( 'INPUT FILE FOR LANDUSE REACHED END OF FILE' ) |
---|
837 | end_of_file = .TRUE. |
---|
838 | 2003 CONTINUE |
---|
839 | IF ( .NOT. end_of_file ) READ (landuse_unit,*)LUCATS,LUSEAS |
---|
840 | FOUND_LU = LUTYPE.EQ.MMINLU |
---|
841 | ENDIF |
---|
842 | CALL wrf_dm_bcast_bytes (end_of_file, LWORDSIZE ) |
---|
843 | IF ( .NOT. end_of_file ) THEN |
---|
844 | CALL wrf_dm_bcast_string(lutype, 256) |
---|
845 | CALL wrf_dm_bcast_bytes (lucats, IWORDSIZE ) |
---|
846 | CALL wrf_dm_bcast_bytes (luseas, IWORDSIZE ) |
---|
847 | CALL wrf_dm_bcast_bytes (found_lu, LWORDSIZE ) |
---|
848 | IF(FOUND_LU)THEN |
---|
849 | LUN=LUCATS |
---|
850 | NSN=LUSEAS |
---|
851 | PRINT *, 'LANDUSE TYPE = "' // TRIM (LUTYPE) // '" FOUND', & |
---|
852 | LUCATS,' CATEGORIES',LUSEAS,' SEASONS', & |
---|
853 | ' WATER CATEGORY = ',ISWATER, & |
---|
854 | ' SNOW CATEGORY = ',ISICE |
---|
855 | ENDIF |
---|
856 | DO ls=1,luseas |
---|
857 | if ( wrf_dm_on_monitor() ) then |
---|
858 | READ (landuse_unit,*) |
---|
859 | endif |
---|
860 | DO LC=1,LUCATS |
---|
861 | IF(found_lu)THEN |
---|
862 | IF ( wrf_dm_on_monitor() ) THEN |
---|
863 | READ (landuse_unit,*)LI,ALBD(LC,LS),SLMO(LC,LS),SFEM(LC,LS), & |
---|
864 | SFZ0(LC,LS),THERIN(LC,LS),SCFX(LC),SFHC(LC,LS) |
---|
865 | ENDIF |
---|
866 | CALL wrf_dm_bcast_bytes (LI, IWORDSIZE ) |
---|
867 | IF(LC.NE.LI)CALL wrf_error_fatal ( 'module_start: MISSING LANDUSE UNIT ' ) |
---|
868 | ELSE |
---|
869 | IF ( wrf_dm_on_monitor() ) THEN |
---|
870 | READ (landuse_unit,*) |
---|
871 | ENDIF |
---|
872 | ENDIF |
---|
873 | ENDDO |
---|
874 | ENDDO |
---|
875 | IF(NSN.EQ.1.AND.FOUND_LU) THEN |
---|
876 | ISN = 1 |
---|
877 | END IF |
---|
878 | CALL wrf_dm_bcast_bytes (albd, max_cats * max_seas * RWORDSIZE ) |
---|
879 | CALL wrf_dm_bcast_bytes (slmo, max_cats * max_seas * RWORDSIZE ) |
---|
880 | CALL wrf_dm_bcast_bytes (sfem, max_cats * max_seas * RWORDSIZE ) |
---|
881 | CALL wrf_dm_bcast_bytes (sfz0, max_cats * max_seas * RWORDSIZE ) |
---|
882 | CALL wrf_dm_bcast_bytes (therin, max_cats * max_seas * RWORDSIZE ) |
---|
883 | CALL wrf_dm_bcast_bytes (sfhc, max_cats * max_seas * RWORDSIZE ) |
---|
884 | CALL wrf_dm_bcast_bytes (scfx, max_cats * RWORDSIZE ) |
---|
885 | ENDIF |
---|
886 | |
---|
887 | IF(.NOT. found_lu .AND. .NOT. end_of_file ) GOTO 1999 |
---|
888 | !!! END OF 1999 LOOP |
---|
889 | |
---|
890 | IF(.NOT. found_lu .OR. end_of_file )THEN |
---|
891 | CALL wrf_message ( 'LANDUSE IN INPUT FILE DOES NOT MATCH LUTABLE: TABLE NOT USED' ) |
---|
892 | ENDIF |
---|
893 | ENDIF ! allowed_to_read |
---|
894 | |
---|
895 | IF(FOUND_LU)THEN |
---|
896 | ! Set arrays according to lu_index |
---|
897 | itf = min0(ite, ide-1) |
---|
898 | jtf = min0(jte, jde-1) |
---|
899 | IF(usemonalb)CALL wrf_message ( 'Climatological albedo is used instead of table values' ) |
---|
900 | DO j = jts, jtf |
---|
901 | DO i = its, itf |
---|
902 | IS=nint(lu_index(i,j)) |
---|
903 | ! only do this check on read-in data |
---|
904 | IF(IS.LT.0.OR.IS.GT.LUN.AND.allowed_to_read)THEN |
---|
905 | WRITE ( wrf_err_message , * ) 'ERROR: LANDUSE OUTSIDE RANGE =',IS,' AT ',I,J,' LUN= ',LUN |
---|
906 | CALL wrf_error_fatal ( TRIM ( wrf_err_message ) ) |
---|
907 | ENDIF |
---|
908 | ! SET NO-DATA POINTS (IS=0) TO WATER |
---|
909 | IF(IS.EQ.0)THEN |
---|
910 | IS=ISWATER |
---|
911 | ENDIF |
---|
912 | IF(.NOT.usemonalb)ALBBCK(I,J)=ALBD(IS,ISN)/100. |
---|
913 | ALBEDO(I,J)=ALBBCK(I,J) |
---|
914 | IF(SNOWC(I,J) .GT. 0.5) THEN |
---|
915 | IF (usemonalb) THEN |
---|
916 | ALBEDO(I,J)=SNOALB(I,J) |
---|
917 | ELSE |
---|
918 | ALBEDO(I,J)=ALBBCK(I,J)*(1.+SCFX(IS)) |
---|
919 | ENDIF |
---|
920 | ENDIF |
---|
921 | THC(I,J)=THERIN(IS,ISN)/100. |
---|
922 | Z0(I,J)=SFZ0(IS,ISN)/100. |
---|
923 | ZNT(I,J)=Z0(I,J) |
---|
924 | EMBCK(I,J)=SFEM(IS,ISN) |
---|
925 | EMISS(I,J)=EMBCK(I,J) |
---|
926 | MAVAIL(I,J)=SLMO(IS,ISN) |
---|
927 | IF(IS.NE.ISWATER)THEN |
---|
928 | XLAND(I,J)=1.0 |
---|
929 | ELSE |
---|
930 | XLAND(I,J)=2.0 |
---|
931 | ENDIF |
---|
932 | ! SET SEA-ICE POINTS TO LAND WITH ICE/SNOW SURFACE PROPERTIES |
---|
933 | XICEM(I,J)=XICE(I,J) |
---|
934 | IF(XICE(I,J).GE.xice_threshold)THEN |
---|
935 | XLAND(I,J)=1.0 |
---|
936 | ALBBCK(I,J)=ALBD(ISICE,ISN)/100. |
---|
937 | EMBCK(I,J)=SFEM(ISICE,ISN) |
---|
938 | IF (FRACTIONAL_SEAICE == 1) THEN |
---|
939 | ! The 0.08 value is the albedo over open water. |
---|
940 | ! The 0.98 value is the emissivity over open water. |
---|
941 | ALBEDO(I,J) = ( XICE(I,J) * ALBBCK(I,J) ) + ( (1.0-XICE(I,J)) * 0.08 ) |
---|
942 | EMISS(I,J) = ( XICE(I,J) * EMBCK(I,J) ) + ( (1.0-XICE(I,J)) * 0.98 ) |
---|
943 | ELSE |
---|
944 | ALBEDO(I,J)=ALBBCK(I,J) |
---|
945 | EMISS(I,J)=EMBCK(I,J) |
---|
946 | ENDIF |
---|
947 | THC(I,J)=THERIN(ISICE,ISN)/100. |
---|
948 | Z0(I,J)=SFZ0(ISICE,ISN)/100. |
---|
949 | ZNT(I,J)=Z0(I,J) |
---|
950 | MAVAIL(I,J)=SLMO(ISICE,ISN) |
---|
951 | ENDIF |
---|
952 | ENDDO |
---|
953 | ENDDO |
---|
954 | ENDIF |
---|
955 | if ( wrf_dm_on_monitor() .and. allowed_to_read ) then |
---|
956 | CLOSE (landuse_unit) |
---|
957 | endif |
---|
958 | CALL wrf_debug( 100 , 'returning from of landuse_init' ) |
---|
959 | |
---|
960 | ! restore LU variables from state |
---|
961 | curs = 1 |
---|
962 | DO cats = 1, max_cats |
---|
963 | lu_state(curs) = SCFX(cats) ; curs = curs + 1 |
---|
964 | DO seas = 1, max_seas |
---|
965 | lu_state(curs) = ALBD(cats,seas) ; curs = curs + 1 |
---|
966 | lu_state(curs) = SLMO(cats,seas) ; curs = curs + 1 |
---|
967 | lu_state(curs) = SFEM(cats,seas) ; curs = curs + 1 |
---|
968 | lu_state(curs) = SFZ0(cats,seas) ; curs = curs + 1 |
---|
969 | lu_state(curs) = SFHC(cats,seas) ; curs = curs + 1 |
---|
970 | lu_state(curs) = THERIN(cats,seas) ; curs = curs + 1 |
---|
971 | ENDDO |
---|
972 | ENDDO |
---|
973 | |
---|
974 | |
---|
975 | END SUBROUTINE landuse_init |
---|
976 | |
---|
977 | !===================================================================== |
---|
978 | SUBROUTINE ra_init(id,STEPRA,RADT,DT,RTHRATEN,RTHRATENLW, & |
---|
979 | RTHRATENSW,CLDFRA,EMISS,cen_lat,JULYR,JULDAY,GMT, & |
---|
980 | levsiz,XLAT,n_ozmixm, & |
---|
981 | cldfra_old, & ! Optional |
---|
982 | ozmixm,pin, & ! Optional |
---|
983 | m_ps_1,m_ps_2,m_hybi,aerosolc_1,aerosolc_2, & ! Optional |
---|
984 | paerlev,n_aerosolc, & |
---|
985 | sfull,shalf,pptop,swrad_scat,p_top, & |
---|
986 | config_flags,restart, & |
---|
987 | allowed_to_read, start_of_simulation, & |
---|
988 | ids, ide, jds, jde, kds, kde, & |
---|
989 | ims, ime, jms, jme, kms, kme, & |
---|
990 | its, ite, jts, jte, kts, kte ) |
---|
991 | !--------------------------------------------------------------------- |
---|
992 | USE module_ra_rrtm , ONLY : rrtminit |
---|
993 | USE module_ra_rrtmg_lw , ONLY : rrtmg_lwinit |
---|
994 | USE module_ra_rrtmg_sw , ONLY : rrtmg_swinit |
---|
995 | USE module_ra_cam , ONLY : camradinit |
---|
996 | USE module_ra_sw , ONLY : swinit |
---|
997 | USE module_ra_gsfcsw , ONLY : gsfc_swinit |
---|
998 | USE module_ra_gfdleta , ONLY : gfdletainit |
---|
999 | #if(NMM_CORE==1) |
---|
1000 | USE module_ra_hwrf , ONLY : hwrfrainit |
---|
1001 | #endif |
---|
1002 | USE module_ra_hs , ONLY : hsinit |
---|
1003 | USE module_domain |
---|
1004 | !--------------------------------------------------------------------- |
---|
1005 | IMPLICIT NONE |
---|
1006 | !--------------------------------------------------------------------- |
---|
1007 | INTEGER, INTENT(IN) :: id |
---|
1008 | TYPE (grid_config_rec_type) :: config_flags |
---|
1009 | LOGICAL , INTENT(IN) :: restart |
---|
1010 | LOGICAL, INTENT(IN) :: allowed_to_read |
---|
1011 | |
---|
1012 | INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, & |
---|
1013 | ims, ime, jms, jme, kms, kme, & |
---|
1014 | its, ite, jts, jte, kts, kte |
---|
1015 | |
---|
1016 | INTEGER , INTENT(IN) :: JULDAY,JULYR |
---|
1017 | REAL , INTENT(IN) :: DT, RADT, cen_lat, GMT, pptop, & |
---|
1018 | swrad_scat, p_top |
---|
1019 | LOGICAL, INTENT(IN) :: start_of_simulation |
---|
1020 | |
---|
1021 | INTEGER, INTENT(IN ) :: levsiz, n_ozmixm |
---|
1022 | INTEGER, INTENT(IN ) :: paerlev, n_aerosolc |
---|
1023 | |
---|
1024 | REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(IN) :: XLAT |
---|
1025 | |
---|
1026 | REAL, DIMENSION( ims:ime, levsiz, jms:jme, n_ozmixm ), OPTIONAL, & |
---|
1027 | INTENT(INOUT) :: OZMIXM |
---|
1028 | |
---|
1029 | REAL, DIMENSION(ims:ime,jms:jme), OPTIONAL, INTENT(INOUT) :: m_ps_1,m_ps_2 |
---|
1030 | REAL, DIMENSION(paerlev), OPTIONAL, INTENT(INOUT) :: m_hybi |
---|
1031 | REAL, DIMENSION( ims:ime, paerlev, jms:jme, n_aerosolc ), OPTIONAL, & |
---|
1032 | INTENT(INOUT) :: aerosolc_1, aerosolc_2 |
---|
1033 | |
---|
1034 | REAL, DIMENSION(levsiz), OPTIONAL, INTENT(INOUT) :: PIN |
---|
1035 | |
---|
1036 | INTEGER , INTENT(INOUT) :: STEPRA |
---|
1037 | INTEGER :: isn |
---|
1038 | |
---|
1039 | REAL , DIMENSION( kms:kme ) , INTENT(IN) :: sfull, shalf |
---|
1040 | REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: & |
---|
1041 | RTHRATEN, & |
---|
1042 | RTHRATENLW, & |
---|
1043 | RTHRATENSW, & |
---|
1044 | CLDFRA |
---|
1045 | |
---|
1046 | REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , OPTIONAL, INTENT(OUT) :: & |
---|
1047 | CLDFRA_OLD |
---|
1048 | |
---|
1049 | REAL , DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: EMISS |
---|
1050 | LOGICAL :: etalw = .false. |
---|
1051 | LOGICAL :: hwrflw= .false. |
---|
1052 | LOGICAL :: camlw = .false. |
---|
1053 | LOGICAL :: etamp = .false. |
---|
1054 | LOGICAL :: acswalloc = .false. |
---|
1055 | LOGICAL :: aclwalloc = .false. |
---|
1056 | integer :: month,iday |
---|
1057 | INTEGER :: i, j, k, itf, jtf, ktf |
---|
1058 | !--------------------------------------------------------------------- |
---|
1059 | |
---|
1060 | jtf=min0(jte,jde-1) |
---|
1061 | ktf=min0(kte,kde-1) |
---|
1062 | itf=min0(ite,ide-1) |
---|
1063 | |
---|
1064 | !--------------------------------------------------------------------- |
---|
1065 | |
---|
1066 | !-- calculate radiation time step |
---|
1067 | |
---|
1068 | STEPRA = nint(RADT*60./DT) |
---|
1069 | STEPRA = max(STEPRA,1) |
---|
1070 | |
---|
1071 | !-- initialization |
---|
1072 | |
---|
1073 | IF(start_of_simulation)THEN |
---|
1074 | DO j=jts,jtf |
---|
1075 | DO k=kts,ktf |
---|
1076 | DO i=its,itf |
---|
1077 | RTHRATEN(i,k,j)=0. |
---|
1078 | RTHRATENLW(i,k,j)=0. |
---|
1079 | RTHRATENSW(i,k,j)=0. |
---|
1080 | CLDFRA(i,k,j)=0. |
---|
1081 | ENDDO |
---|
1082 | ENDDO |
---|
1083 | ENDDO |
---|
1084 | |
---|
1085 | if( present(cldfra_old) ) then |
---|
1086 | DO j=jts,jtf |
---|
1087 | DO k=kts,ktf |
---|
1088 | DO i=its,itf |
---|
1089 | cldfra_old(i,k,j) = 0. |
---|
1090 | ENDDO |
---|
1091 | ENDDO |
---|
1092 | ENDDO |
---|
1093 | end if |
---|
1094 | ENDIF |
---|
1095 | |
---|
1096 | !-- find out which microphysics option is used first |
---|
1097 | |
---|
1098 | mp_select: SELECT CASE(config_flags%mp_physics) |
---|
1099 | |
---|
1100 | CASE (ETAMPNEW) |
---|
1101 | etamp = .true. |
---|
1102 | |
---|
1103 | END SELECT mp_select |
---|
1104 | |
---|
1105 | !-- chose long wave radiation scheme |
---|
1106 | |
---|
1107 | lwrad_select: SELECT CASE(config_flags%ra_lw_physics) |
---|
1108 | |
---|
1109 | CASE (RRTMSCHEME) |
---|
1110 | CALL rrtminit( & |
---|
1111 | p_top, allowed_to_read , & |
---|
1112 | ids, ide, jds, jde, kds, kde, & |
---|
1113 | ims, ime, jms, jme, kms, kme, & |
---|
1114 | its, ite, jts, jte, kts, kte ) |
---|
1115 | |
---|
1116 | CASE (CAMLWSCHEME) |
---|
1117 | #ifdef MAC_KLUDGE |
---|
1118 | CALL wrf_error_fatal ( 'CAM radiation scheme not supported under the chosen build configuration' ) |
---|
1119 | #endif |
---|
1120 | IF ( PRESENT( OZMIXM ) .AND. PRESENT( PIN ) .AND. & |
---|
1121 | PRESENT(M_PS_1) .AND. PRESENT(M_PS_2) .AND. & |
---|
1122 | PRESENT(M_HYBI) .AND. PRESENT(AEROSOLC_1) & |
---|
1123 | .AND. PRESENT(AEROSOLC_2)) THEN |
---|
1124 | CALL camradinit( & |
---|
1125 | R_D,R_V,CP,G,STBOLT,EP_2,shalf,pptop, & |
---|
1126 | ozmixm,pin,levsiz,XLAT,n_ozmixm, & |
---|
1127 | m_ps_1,m_ps_2,m_hybi,aerosolc_1,aerosolc_2,& |
---|
1128 | paerlev, n_aerosolc, & |
---|
1129 | ids, ide, jds, jde, kds, kde, & |
---|
1130 | ims, ime, jms, jme, kms, kme, & |
---|
1131 | its, ite, jts, jte, kts, kte ) |
---|
1132 | ELSE |
---|
1133 | CALL wrf_error_fatal ( 'arguments not present for calling cam radiation' ) |
---|
1134 | ENDIF |
---|
1135 | |
---|
1136 | camlw = .true. |
---|
1137 | aclwalloc = .true. |
---|
1138 | |
---|
1139 | CASE (RRTMG_LWSCHEME) |
---|
1140 | CALL rrtmg_lwinit( & |
---|
1141 | p_top, allowed_to_read , & |
---|
1142 | ids, ide, jds, jde, kds, kde, & |
---|
1143 | ims, ime, jms, jme, kms, kme, & |
---|
1144 | its, ite, jts, jte, kts, kte ) |
---|
1145 | |
---|
1146 | aclwalloc = .true. |
---|
1147 | |
---|
1148 | CASE (GFDLLWSCHEME) |
---|
1149 | CALL nl_get_start_month(id,month) |
---|
1150 | CALL nl_get_start_day(id,iday) |
---|
1151 | CALL gfdletainit(emiss,sfull,shalf,pptop, & |
---|
1152 | julyr,month,iday,gmt, & |
---|
1153 | config_flags,allowed_to_read, & |
---|
1154 | ids, ide, jds, jde, kds, kde, & |
---|
1155 | ims, ime, jms, jme, kms, kme, & |
---|
1156 | its, ite, jts, jte, kts, kte ) |
---|
1157 | etalw = .true. |
---|
1158 | #if(NMM_CORE==1) |
---|
1159 | CASE (HWRFLWSCHEME) |
---|
1160 | CALL nl_get_start_month(id,month) |
---|
1161 | CALL nl_get_start_day(id,iday) |
---|
1162 | ! test this with standard jul-day calls |
---|
1163 | ! CALL nl_get_start_year(id,start_year) |
---|
1164 | ! CALL nl_get_start_month(id,start_month) |
---|
1165 | ! CALL nl_get_start_day(id,start_day) |
---|
1166 | ! CALL nl_get_start_hour(id,start_hour) |
---|
1167 | ! CALL nl_get_start_minute(id,start_minute) |
---|
1168 | ! CALL nl_get_start_second(id,start_second) |
---|
1169 | ! CALL jdn_sec(day_in_sec,start_year,start_month,start_day,0,0,0) |
---|
1170 | ! CALL jdn_sec(day_in_sec_ref,start_year,1,1,0,0,0) |
---|
1171 | ! julyr_start=start_year |
---|
1172 | ! julday_start=(day_in_sec-day_in_sec_ref)/(3600.*24.)+1 |
---|
1173 | ! gmt_start=start_hour+real(start_minute)/60.+real(start_second)/3600. |
---|
1174 | CALL hwrfrainit(sfull,shalf,pptop,JULYR,MONTH,IDAY,GMT,& |
---|
1175 | ! CALL hwrfrainit(sfull,shalf,pptop,JULYR_start,MONTH,IDAY,GMT_start,& |
---|
1176 | allowed_to_read , & |
---|
1177 | kds, kde, kms, kme, kts, kte ) |
---|
1178 | hwrflw = .true. |
---|
1179 | #endif |
---|
1180 | CASE (HELDSUAREZ) |
---|
1181 | CALL hsinit(RTHRATEN,restart, & |
---|
1182 | ids, ide, jds, jde, kds, kde, & |
---|
1183 | ims, ime, jms, jme, kms, kme, & |
---|
1184 | its, ite, jts, jte, kts, kte ) |
---|
1185 | CASE DEFAULT |
---|
1186 | |
---|
1187 | END SELECT lwrad_select |
---|
1188 | !-- initialize short wave radiation scheme |
---|
1189 | |
---|
1190 | swrad_select: SELECT CASE(config_flags%ra_sw_physics) |
---|
1191 | |
---|
1192 | CASE (SWRADSCHEME) |
---|
1193 | CALL swinit( & |
---|
1194 | swrad_scat, & |
---|
1195 | allowed_to_read , & |
---|
1196 | ids, ide, jds, jde, kds, kde, & |
---|
1197 | ims, ime, jms, jme, kms, kme, & |
---|
1198 | its, ite, jts, jte, kts, kte ) |
---|
1199 | |
---|
1200 | CASE (CAMSWSCHEME) |
---|
1201 | #ifdef MAC_KLUDGE |
---|
1202 | CALL wrf_error_fatal ( 'CAM radiation scheme not supported under the chosen build configuration' ) |
---|
1203 | #endif |
---|
1204 | IF(.not.camlw)THEN |
---|
1205 | CALL camradinit( & |
---|
1206 | R_D,R_V,CP,G,STBOLT,EP_2,shalf,pptop, & |
---|
1207 | ozmixm,pin,levsiz,XLAT,n_ozmixm, & |
---|
1208 | m_ps_1,m_ps_2,m_hybi,aerosolc_1,aerosolc_2,& |
---|
1209 | paerlev, n_aerosolc, & |
---|
1210 | ids, ide, jds, jde, kds, kde, & |
---|
1211 | ims, ime, jms, jme, kms, kme, & |
---|
1212 | its, ite, jts, jte, kts, kte ) |
---|
1213 | ENDIF |
---|
1214 | acswalloc = .true. |
---|
1215 | |
---|
1216 | CASE (GSFCSWSCHEME) |
---|
1217 | CALL gsfc_swinit(cen_lat, allowed_to_read ) |
---|
1218 | |
---|
1219 | CASE (RRTMG_SWSCHEME) |
---|
1220 | CALL rrtmg_swinit( & |
---|
1221 | allowed_to_read , & |
---|
1222 | ids, ide, jds, jde, kds, kde, & |
---|
1223 | ims, ime, jms, jme, kms, kme, & |
---|
1224 | its, ite, jts, jte, kts, kte ) |
---|
1225 | |
---|
1226 | acswalloc = .true. |
---|
1227 | |
---|
1228 | CASE (GFDLSWSCHEME) |
---|
1229 | IF(.not.etalw)THEN |
---|
1230 | CALL nl_get_start_month(id,month) |
---|
1231 | CALL nl_get_start_day(id,iday) |
---|
1232 | CALL gfdletainit(emiss,sfull,shalf,pptop, & |
---|
1233 | julyr,month,iday,gmt, & |
---|
1234 | config_flags,allowed_to_read, & |
---|
1235 | ids, ide, jds, jde, kds, kde, & |
---|
1236 | ims, ime, jms, jme, kms, kme, & |
---|
1237 | its, ite, jts, jte, kts, kte ) |
---|
1238 | ENDIF |
---|
1239 | #if(NMM_CORE==1) |
---|
1240 | CASE (HWRFSWSCHEME) |
---|
1241 | IF(.not.hwrflw)THEN |
---|
1242 | CALL nl_get_start_month(id,month) |
---|
1243 | CALL nl_get_start_day(id,iday) |
---|
1244 | CALL hwrfrainit(sfull,shalf,pptop,JULYR,MONTH,IDAY,GMT,& |
---|
1245 | allowed_to_read, & |
---|
1246 | kds, kde, kms, kme, kts, kte ) |
---|
1247 | ENDIF |
---|
1248 | #endif |
---|
1249 | CASE DEFAULT |
---|
1250 | |
---|
1251 | END SELECT swrad_select |
---|
1252 | |
---|
1253 | #if ( EM_CORE == 1 ) |
---|
1254 | ! test for conditionally allocated arrays when using bucket_J |
---|
1255 | |
---|
1256 | IF(config_flags%bucket_J .gt. 0.0)THEN |
---|
1257 | IF(.not. (acswalloc .and. aclwalloc))THEN |
---|
1258 | CALL wrf_error_fatal ( 'Need CAM or RRTMG radiation for bucket_J option') |
---|
1259 | ENDIF |
---|
1260 | ENDIF |
---|
1261 | #endif |
---|
1262 | |
---|
1263 | END SUBROUTINE ra_init |
---|
1264 | |
---|
1265 | SUBROUTINE bl_init(STEPBL,BLDT,DT,RUBLTEN,RVBLTEN,RTHBLTEN, & |
---|
1266 | RQVBLTEN,RQCBLTEN,RQIBLTEN,TSK,TMN, & |
---|
1267 | config_flags,restart,UST,LOWLYR,TSLB,ZS,DZS, & |
---|
1268 | num_soil_layers,TKE_PBL, & |
---|
1269 | EXCH_H,VEGFRA, & |
---|
1270 | SNOW,SNOWC, CANWAT,SMSTAV, & |
---|
1271 | SMSTOT, SFCRUNOFF,UDRUNOFF,ACSNOW,ACSNOM, & |
---|
1272 | IVGTYP,ISLTYP,ISURBAN,SMOIS,SMFR3D,mavail, & |
---|
1273 | SNOWH,SH2O,SNOALB,FNDSOILW,FNDSNOWH,RDMAXALB, & |
---|
1274 | #if ( NMM_CORE == 1 ) |
---|
1275 | Z0,XLAND,XICE, & |
---|
1276 | #else |
---|
1277 | ZNT,XLAND,XICE, & |
---|
1278 | #endif |
---|
1279 | SFCEVP,GRDFLX, & |
---|
1280 | MMINLU, & |
---|
1281 | allowed_to_read, & |
---|
1282 | start_of_simulation, & |
---|
1283 | te_temf,cf3d_temf,wm_temf, & ! WA |
---|
1284 | ! num_roof_layers,num_wall_layers,num_road_layers,& !Optional urban |
---|
1285 | DZR, DZB, DZG, & !Optional urban |
---|
1286 | TR_URB2D,TB_URB2D,TG_URB2D,TC_URB2D,QC_URB2D, & !Optional urban |
---|
1287 | XXXR_URB2D,XXXB_URB2D,XXXG_URB2D,XXXC_URB2D, & !Optional urban |
---|
1288 | TRL_URB3D, TBL_URB3D, TGL_URB3D, & !Optional urban |
---|
1289 | SH_URB2D,LH_URB2D,G_URB2D,RN_URB2D, & !Optional urban |
---|
1290 | TS_URB2D, FRC_URB2D, UTYPE_URB2D, & |
---|
1291 | SF_URBAN_PHYSICS, & !Optional urban |
---|
1292 | NUM_URBAN_LAYERS, & !Optional multi-layer urban |
---|
1293 | TRB_URB4D,TW1_URB4D,TW2_URB4D, & !Optional multi-layer urban |
---|
1294 | TGB_URB4D,TLEV_URB3D,QLEV_URB3D, & !Optional multi-layer urban |
---|
1295 | TW1LEV_URB3D,TW2LEV_URB3D, & !Optional multi-layer urban |
---|
1296 | TGLEV_URB3D,TFLEV_URB3D, & !Optional multi-layer urban |
---|
1297 | SF_AC_URB3D,LF_AC_URB3D,CM_AC_URB3D, & !Optional multi-layer urban |
---|
1298 | SFVENT_URB3D,LFVENT_URB3D, & !Optional multi-layer urban |
---|
1299 | SFWIN1_URB3D,SFWIN2_URB3D, & !Optional multi-layer urban |
---|
1300 | SFW1_URB3D,SFW2_URB3D, & !Optional multi-layer urban |
---|
1301 | SFR_URB3D,SFG_URB3D, & !Optional multi-layer urban |
---|
1302 | A_U_BEP,A_V_BEP,A_T_BEP,A_Q_BEP, & !Optional multi-layer urban |
---|
1303 | A_E_BEP,B_U_BEP,B_V_BEP, & !Optional multi-layer urban |
---|
1304 | B_T_BEP,B_Q_BEP,B_E_BEP,DLG_BEP, & !Optional multi-layer urban |
---|
1305 | DL_U_BEP,SF_BEP,VL_BEP, & !Optional multi-layer urban |
---|
1306 | ids, ide, jds, jde, kds, kde, & |
---|
1307 | ims, ime, jms, jme, kms, kme, & |
---|
1308 | its, ite, jts, jte, kts, kte, & |
---|
1309 | ACHFX,ACLHF,ACGRDFLX, & |
---|
1310 | oml_hml0, omlcall, & !Optional oml |
---|
1311 | TML,T0ML,HML,H0ML,HUML,HVML,TMOML ) !Optional oml |
---|
1312 | !-------------------------------------------------------------------- |
---|
1313 | USE module_sf_sfclay |
---|
1314 | USE module_sf_slab |
---|
1315 | USE module_sf_pxsfclay |
---|
1316 | USE module_bl_ysu |
---|
1317 | USE module_bl_mrf |
---|
1318 | USE module_bl_gfs |
---|
1319 | USE module_bl_acm |
---|
1320 | USE module_sf_myjsfc |
---|
1321 | USE module_sf_qnsesfc |
---|
1322 | USE module_sf_noahdrv |
---|
1323 | USE module_sf_urban |
---|
1324 | USE module_sf_bep !BEP |
---|
1325 | USE module_sf_bep_bem |
---|
1326 | USE module_sf_ruclsm |
---|
1327 | USE module_sf_pxlsm |
---|
1328 | USE module_sf_oml |
---|
1329 | USE module_bl_myjpbl |
---|
1330 | USE module_bl_myjurb |
---|
1331 | USE module_bl_boulac |
---|
1332 | USE module_bl_camuwpbl_driver, ONLY : camuwpblinit |
---|
1333 | USE module_bl_qnsepbl |
---|
1334 | #if ( EM_CORE == 1 ) |
---|
1335 | USE module_bl_mynn |
---|
1336 | USE module_bl_temf |
---|
1337 | USE module_sf_temfsfclay |
---|
1338 | USE module_sf_mynn |
---|
1339 | #endif |
---|
1340 | |
---|
1341 | #if (NMM_CORE == 1) |
---|
1342 | USE module_sf_gfdl |
---|
1343 | #endif |
---|
1344 | !-------------------------------------------------------------------- |
---|
1345 | IMPLICIT NONE |
---|
1346 | !-------------------------------------------------------------------- |
---|
1347 | TYPE (grid_config_rec_type) :: config_flags |
---|
1348 | LOGICAL , INTENT(IN) :: restart |
---|
1349 | LOGICAL, INTENT(IN) :: FNDSOILW, FNDSNOWH |
---|
1350 | LOGICAL, INTENT(IN) :: RDMAXALB |
---|
1351 | |
---|
1352 | INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, & |
---|
1353 | ims, ime, jms, jme, kms, kme, & |
---|
1354 | its, ite, jts, jte, kts, kte |
---|
1355 | INTEGER , INTENT(IN) :: num_soil_layers |
---|
1356 | INTEGER , INTENT(IN) :: SF_URBAN_PHYSICS |
---|
1357 | |
---|
1358 | REAL , INTENT(IN) :: DT, BLDT |
---|
1359 | INTEGER , INTENT(INOUT) :: STEPBL |
---|
1360 | |
---|
1361 | REAL, DIMENSION( ims:ime , 1:num_soil_layers , jms:jme ), & |
---|
1362 | INTENT(OUT) :: SMFR3D |
---|
1363 | |
---|
1364 | REAL, DIMENSION( ims:ime , 1:num_soil_layers , jms:jme ),& |
---|
1365 | INTENT(INOUT) :: SMOIS,SH2O,TSLB |
---|
1366 | |
---|
1367 | REAL, DIMENSION( ims:ime, jms:jme ) , & |
---|
1368 | INTENT(INOUT) :: SNOW, & |
---|
1369 | SNOWH, & |
---|
1370 | SNOWC, & |
---|
1371 | SNOALB, & |
---|
1372 | CANWAT, & |
---|
1373 | MAVAIL, & |
---|
1374 | SMSTAV, & |
---|
1375 | SMSTOT, & |
---|
1376 | SFCRUNOFF, & |
---|
1377 | UDRUNOFF, & |
---|
1378 | ACSNOW, & |
---|
1379 | VEGFRA, & |
---|
1380 | ACSNOM, & |
---|
1381 | SFCEVP, & |
---|
1382 | GRDFLX, & |
---|
1383 | UST, & |
---|
1384 | #if ( NMM_CORE == 1 ) |
---|
1385 | Z0, & |
---|
1386 | #else |
---|
1387 | ZNT, & |
---|
1388 | #endif |
---|
1389 | XLAND, & |
---|
1390 | XICE |
---|
1391 | |
---|
1392 | INTEGER, DIMENSION( ims:ime, jms:jme ) , & |
---|
1393 | INTENT(INOUT) :: IVGTYP, & |
---|
1394 | ISLTYP, & |
---|
1395 | LOWLYR |
---|
1396 | |
---|
1397 | |
---|
1398 | REAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: ZS,DZS |
---|
1399 | |
---|
1400 | REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: & |
---|
1401 | RUBLTEN, & |
---|
1402 | RVBLTEN, & |
---|
1403 | EXCH_H, & |
---|
1404 | RTHBLTEN, & |
---|
1405 | RQVBLTEN, & |
---|
1406 | RQCBLTEN, & |
---|
1407 | RQIBLTEN, & |
---|
1408 | TKE_PBL |
---|
1409 | REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(IN) :: TSK |
---|
1410 | REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: TMN |
---|
1411 | CHARACTER(LEN=*), INTENT(IN) :: MMINLU |
---|
1412 | LOGICAL, INTENT(IN) :: allowed_to_read |
---|
1413 | INTEGER, INTENT(IN) :: ISURBAN |
---|
1414 | INTEGER :: isn, isfc |
---|
1415 | INTEGER :: k |
---|
1416 | |
---|
1417 | REAL, OPTIONAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , & |
---|
1418 | INTENT(OUT) :: te_temf, cf3d_temf !WA |
---|
1419 | REAL, OPTIONAL, DIMENSION( ims:ime , jms:jme ) , & |
---|
1420 | INTENT(OUT) :: wm_temf |
---|
1421 | |
---|
1422 | !URBAN |
---|
1423 | ! REAL, DIMENSION(1:num_roof_layers), INTENT(INOUT) :: DZR !Optional urban |
---|
1424 | ! REAL, DIMENSION(1:num_wall_layers), INTENT(INOUT) :: DZB !Optional urban |
---|
1425 | ! REAL, DIMENSION(1:num_road_layers), INTENT(INOUT) :: DZG !Optional urban |
---|
1426 | REAL, OPTIONAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: DZR !Optional urban |
---|
1427 | REAL, OPTIONAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: DZB !Optional urban |
---|
1428 | REAL, OPTIONAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: DZG !Optional urban |
---|
1429 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TR_URB2D !Optional urban |
---|
1430 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TB_URB2D !Optional urban |
---|
1431 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TG_URB2D !Optional urban |
---|
1432 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TC_URB2D !Optional urban |
---|
1433 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: QC_URB2D !Optional urban |
---|
1434 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXR_URB2D !Optional urban |
---|
1435 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXB_URB2D !Optional urban |
---|
1436 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXG_URB2D !Optional urban |
---|
1437 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXC_URB2D !Optional urban |
---|
1438 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: SH_URB2D !Optional urban |
---|
1439 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: LH_URB2D !Optional urban |
---|
1440 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: G_URB2D !Optional urban |
---|
1441 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: RN_URB2D !Optional urban |
---|
1442 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TS_URB2D !Optional urban |
---|
1443 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: FRC_URB2D !Optional urban |
---|
1444 | INTEGER, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: UTYPE_URB2D !Optional urban |
---|
1445 | ! REAL, DIMENSION( ims:ime, 1:num_roof_layers, jms:jme ), INTENT(INOUT) :: TRL_URB3D !Optional urban |
---|
1446 | ! REAL, DIMENSION( ims:ime, 1:num_wall_layers, jms:jme ), INTENT(INOUT) :: TBL_URB3D !Optional urban |
---|
1447 | ! REAL, DIMENSION( ims:ime, 1:num_road_layers, jms:jme ), INTENT(INOUT) :: TGL_URB3D !Optional urban |
---|
1448 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers, jms:jme ), INTENT(INOUT) :: TRL_URB3D !Optional urban |
---|
1449 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers, jms:jme ), INTENT(INOUT) :: TBL_URB3D !Optional urban |
---|
1450 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers, jms:jme ), INTENT(INOUT) :: TGL_URB3D !Optional urban |
---|
1451 | |
---|
1452 | INTEGER , INTENT(IN) :: num_urban_layers |
---|
1453 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: TRB_URB4D !Optional UCM |
---|
1454 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: TW1_URB4D !Optional UCM |
---|
1455 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: TW2_URB4D !Optional UCM |
---|
1456 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: TGB_URB4D !Optional UCM |
---|
1457 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: TLEV_URB3D !Optional UCM |
---|
1458 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: QLEV_URB3D !Optional UCM |
---|
1459 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: TW1LEV_URB3D ! multi-layer UCM |
---|
1460 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: TW2LEV_URB3D ! multi-layer UCM |
---|
1461 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: TGLEV_URB3D ! multi-layer UCM |
---|
1462 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: TFLEV_URB3D ! multi-layer UCM |
---|
1463 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: LF_AC_URB3D !multi-layer UCM |
---|
1464 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: SF_AC_URB3D !multi-layer UCM |
---|
1465 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: CM_AC_URB3D !multi-layer UCM |
---|
1466 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: SFVENT_URB3D !multi-layer UCM |
---|
1467 | REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: LFVENT_URB3D !multi-layer UCM |
---|
1468 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: SFWIN1_URB3D ! multi-layer UCM |
---|
1469 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: SFWIN2_URB3D ! multi-layer UCM |
---|
1470 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: SFW1_URB3D !Optional UCM |
---|
1471 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: SFW2_URB3D !Optional UCM |
---|
1472 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: SFR_URB3D !Optional UCM |
---|
1473 | REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_urban_layers, jms:jme ), INTENT(INOUT) :: SFG_URB3D !Optional UCM |
---|
1474 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_U_BEP |
---|
1475 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_V_BEP |
---|
1476 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_T_BEP |
---|
1477 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_Q_BEP |
---|
1478 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: A_E_BEP |
---|
1479 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_U_BEP |
---|
1480 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_V_BEP |
---|
1481 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_T_BEP |
---|
1482 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_Q_BEP |
---|
1483 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: B_E_BEP |
---|
1484 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: VL_BEP |
---|
1485 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: DLG_BEP |
---|
1486 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme,jms:jme),INTENT(INOUT) :: SF_BEP |
---|
1487 | REAL, OPTIONAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: DL_U_BEP |
---|
1488 | |
---|
1489 | REAL, DIMENSION( ims:ime , jms:jme ) , OPTIONAL, INTENT(INOUT) :: & |
---|
1490 | ACHFX,ACLHF,ACGRDFLX |
---|
1491 | ! Optional OML variables |
---|
1492 | REAL, DIMENSION( ims:ime , jms:jme ) , OPTIONAL, INTENT(INOUT) :: & |
---|
1493 | TML,T0ML,HML,H0ML,HUML,HVML,TMOML |
---|
1494 | INTEGER, OPTIONAL, INTENT(IN) :: omlcall |
---|
1495 | REAL, OPTIONAL, INTENT(IN) :: oml_hml0 |
---|
1496 | LOGICAL, INTENT(IN) :: start_of_simulation |
---|
1497 | INTEGER :: i,j |
---|
1498 | |
---|
1499 | |
---|
1500 | #if ( EM_CORE == 1 ) |
---|
1501 | !local mynn |
---|
1502 | INTEGER :: mynn_closure_level |
---|
1503 | #endif |
---|
1504 | |
---|
1505 | !-- calculate pbl time step |
---|
1506 | |
---|
1507 | STEPBL = nint(BLDT*60./DT) |
---|
1508 | STEPBL = max(STEPBL,1) |
---|
1509 | !-- initialization |
---|
1510 | |
---|
1511 | IF(PRESENT(ACHFX))THEN |
---|
1512 | IF(.not.restart)THEN |
---|
1513 | DO j=jts,jte |
---|
1514 | DO i=its,ite |
---|
1515 | ACHFX(i,j)=0. |
---|
1516 | ACLHF(i,j)=0. |
---|
1517 | ACGRDFLX(i,j)=0. |
---|
1518 | SFCEVP(i,j)=0. |
---|
1519 | ENDDO |
---|
1520 | ENDDO |
---|
1521 | ENDIF |
---|
1522 | ENDIF |
---|
1523 | |
---|
1524 | !-- initialize surface layer scheme |
---|
1525 | |
---|
1526 | sfclay_select: SELECT CASE(config_flags%sf_sfclay_physics) |
---|
1527 | |
---|
1528 | CASE (SFCLAYSCHEME) |
---|
1529 | CALL sfclayinit( allowed_to_read ) |
---|
1530 | isfc = 1 |
---|
1531 | CASE (PXSFCSCHEME) |
---|
1532 | CALL pxsfclayinit( allowed_to_read ) |
---|
1533 | isfc = 7 |
---|
1534 | CASE (MYJSFCSCHEME) |
---|
1535 | CALL myjsfcinit(LOWLYR,UST, & |
---|
1536 | #if ( NMM_CORE == 1 ) |
---|
1537 | Z0, & |
---|
1538 | #else |
---|
1539 | ZNT, & |
---|
1540 | #endif |
---|
1541 | XLAND,XICE, & |
---|
1542 | IVGTYP,restart, & |
---|
1543 | allowed_to_read , & |
---|
1544 | ids, ide, jds, jde, kds, kde, & |
---|
1545 | ims, ime, jms, jme, kms, kme, & |
---|
1546 | its, ite, jts, jte, kts, kte ) |
---|
1547 | isfc = 2 |
---|
1548 | |
---|
1549 | CASE (QNSESFCSCHEME) |
---|
1550 | CALL qnsesfcinit(LOWLYR,UST, & |
---|
1551 | #if ( NMM_CORE == 1 ) |
---|
1552 | Z0, & |
---|
1553 | #else |
---|
1554 | ZNT, & |
---|
1555 | #endif |
---|
1556 | XLAND,XICE, & |
---|
1557 | IVGTYP,restart, & |
---|
1558 | allowed_to_read , & |
---|
1559 | ids, ide, jds, jde, kds, kde, & |
---|
1560 | ims, ime, jms, jme, kms, kme, & |
---|
1561 | its, ite, jts, jte, kts, kte ) |
---|
1562 | isfc = 4 |
---|
1563 | |
---|
1564 | CASE (GFSSFCSCHEME) |
---|
1565 | CALL myjsfcinit(LOWLYR,UST, & |
---|
1566 | #if ( NMM_CORE == 1 ) |
---|
1567 | Z0, & |
---|
1568 | #else |
---|
1569 | ZNT, & |
---|
1570 | #endif |
---|
1571 | XLAND,XICE, & |
---|
1572 | IVGTYP,restart, & |
---|
1573 | allowed_to_read , & |
---|
1574 | ids, ide, jds, jde, kds, kde, & |
---|
1575 | ims, ime, jms, jme, kms, kme, & |
---|
1576 | its, ite, jts, jte, kts, kte ) |
---|
1577 | isfc = 2 |
---|
1578 | #if (NMM_CORE==1) |
---|
1579 | CASE (GFDLSFCSCHEME) |
---|
1580 | CALL myjsfcinit(LOWLYR,UST, & |
---|
1581 | Z0, & |
---|
1582 | XLAND,XICE, & |
---|
1583 | IVGTYP,restart, & |
---|
1584 | allowed_to_read , & |
---|
1585 | ids, ide, jds, jde, kds, kde, & |
---|
1586 | ims, ime, jms, jme, kms, kme, & |
---|
1587 | its, ite, jts, jte, kts, kte ) |
---|
1588 | isfc = 2 |
---|
1589 | #endif |
---|
1590 | |
---|
1591 | #if ( EM_CORE == 1 ) |
---|
1592 | !mynn |
---|
1593 | |
---|
1594 | CASE (MYNNSFCSCHEME) |
---|
1595 | |
---|
1596 | CALL mynn_sf_init_driver(allowed_to_read) |
---|
1597 | isfc=5 |
---|
1598 | ! isfc=3 |
---|
1599 | |
---|
1600 | CASE (TEMFSFCSCHEME) |
---|
1601 | CALL wrf_debug( 100, 'calling temfsfclayinit' ) |
---|
1602 | CALL temfsfclayinit( restart, allowed_to_read , & |
---|
1603 | wm_temf, & |
---|
1604 | ids, ide, jds, jde, kds, kde, & |
---|
1605 | ims, ime, jms, jme, kms, kme, & |
---|
1606 | its, ite, jts, jte, kts, kte ) |
---|
1607 | #endif |
---|
1608 | |
---|
1609 | CASE DEFAULT |
---|
1610 | |
---|
1611 | END SELECT sfclay_select |
---|
1612 | |
---|
1613 | |
---|
1614 | !-- initialize surface scheme |
---|
1615 | |
---|
1616 | sfc_select: SELECT CASE(config_flags%sf_surface_physics) |
---|
1617 | |
---|
1618 | CASE (SLABSCHEME) |
---|
1619 | |
---|
1620 | CALL slabinit(TSK,TMN, & |
---|
1621 | TSLB,ZS,DZS,num_soil_layers, & |
---|
1622 | allowed_to_read ,start_of_simulation ,& |
---|
1623 | ids, ide, jds, jde, kds, kde, & |
---|
1624 | ims, ime, jms, jme, kms, kme, & |
---|
1625 | its, ite, jts, jte, kts, kte ) |
---|
1626 | |
---|
1627 | #if (NMM_CORE == 1) |
---|
1628 | CASE (GFDLSLAB) |
---|
1629 | CALL hwrfsfcinit(isn,XICE,VEGFRA,SNOW,SNOWC, CANWAT,SMSTAV, & |
---|
1630 | SMSTOT, SFCRUNOFF,UDRUNOFF,GRDFLX,ACSNOW, & |
---|
1631 | ACSNOM,IVGTYP,ISLTYP,TSLB,SMOIS,DZS,SFCEVP, & |
---|
1632 | TMN, & |
---|
1633 | num_soil_layers, & |
---|
1634 | allowed_to_read , & |
---|
1635 | ids,ide, jds,jde, kds,kde, & |
---|
1636 | ims,ime, jms,jme, kms,kme, & |
---|
1637 | its,ite, jts,jte, kts,kte ) |
---|
1638 | |
---|
1639 | #endif |
---|
1640 | CASE (LSMSCHEME) |
---|
1641 | CALL LSMINIT(VEGFRA,SNOW,SNOWC,SNOWH,CANWAT,SMSTAV, & |
---|
1642 | SMSTOT, SFCRUNOFF,UDRUNOFF,ACSNOW, & |
---|
1643 | ACSNOM,IVGTYP,ISLTYP,TSLB,SMOIS,SH2O,ZS,DZS, & |
---|
1644 | MMINLU, & |
---|
1645 | SNOALB, FNDSOILW, FNDSNOWH, RDMAXALB, & |
---|
1646 | num_soil_layers, restart, & |
---|
1647 | allowed_to_read , & |
---|
1648 | ids,ide, jds,jde, kds,kde, & |
---|
1649 | ims,ime, jms,jme, kms,kme, & |
---|
1650 | its,ite, jts,jte, kts,kte ) |
---|
1651 | |
---|
1652 | !URBAN |
---|
1653 | IF ((SF_URBAN_PHYSICS.eq.1).OR.(SF_URBAN_PHYSICS.EQ.2).OR.(SF_URBAN_PHYSICS.EQ.3)) THEN |
---|
1654 | |
---|
1655 | IF ( PRESENT( FRC_URB2D ) .AND. PRESENT( UTYPE_URB2D )) THEN |
---|
1656 | |
---|
1657 | CALL urban_param_init(DZR,DZB,DZG,num_soil_layers, & !urban |
---|
1658 | sf_urban_physics) |
---|
1659 | ! num_roof_layers,num_wall_layers,road_soil_layers) !urban |
---|
1660 | |
---|
1661 | |
---|
1662 | CALL urban_var_init(ISURBAN,TSK,TSLB,TMN,IVGTYP, & !urban |
---|
1663 | ims,ime,jms,jme,kms,kme,num_soil_layers, & !urban |
---|
1664 | ! num_roof_layers,num_wall_layers,num_road_layers, & !urban |
---|
1665 | restart,sf_urban_physics, & !urban |
---|
1666 | XXXR_URB2D,XXXB_URB2D,XXXG_URB2D,XXXC_URB2D, & !urban |
---|
1667 | TR_URB2D,TB_URB2D,TG_URB2D,TC_URB2D,QC_URB2D, & !urban |
---|
1668 | TRL_URB3D,TBL_URB3D,TGL_URB3D, & !urban |
---|
1669 | SH_URB2D,LH_URB2D,G_URB2D,RN_URB2D, TS_URB2D, & !urban |
---|
1670 | num_urban_layers, & !urban |
---|
1671 | TRB_URB4D,TW1_URB4D,TW2_URB4D,TGB_URB4D, & !urban |
---|
1672 | TLEV_URB3D,QLEV_URB3D, & !urban |
---|
1673 | TW1LEV_URB3D,TW2LEV_URB3D, & !urban |
---|
1674 | TGLEV_URB3D,TFLEV_URB3D, & !urban |
---|
1675 | SF_AC_URB3D,LF_AC_URB3D,CM_AC_URB3D, & !urban |
---|
1676 | SFVENT_URB3D,LFVENT_URB3D, & !urban |
---|
1677 | SFWIN1_URB3D,SFWIN2_URB3D, & !urban |
---|
1678 | SFW1_URB3D,SFW2_URB3D,SFR_URB3D,SFG_URB3D, & !urban |
---|
1679 | A_U_BEP,A_V_BEP,A_T_BEP,A_Q_BEP, & !multi-layer urban |
---|
1680 | A_E_BEP,B_U_BEP,B_V_BEP, & !multi-layer urban |
---|
1681 | B_T_BEP,B_Q_BEP,B_E_BEP,DLG_BEP, & !multi-layer urban |
---|
1682 | DL_U_BEP,SF_BEP,VL_BEP, & !multi-layer urban |
---|
1683 | FRC_URB2D, UTYPE_URB2D) !urban |
---|
1684 | ELSE |
---|
1685 | CALL wrf_error_fatal ( 'arguments not present for calling urban model' ) |
---|
1686 | ENDIF |
---|
1687 | ENDIF |
---|
1688 | ! |
---|
1689 | CASE (RUCLSMSCHEME) |
---|
1690 | ! if(isfc .ne. 2)CALL wrf_error_fatal & |
---|
1691 | ! ( 'module_physics_init: use myjsfc and myjpbl scheme for this lsm option' ) |
---|
1692 | CALL ruclsminit( SH2O,SMFR3D,TSLB,SMOIS,ISLTYP,IVGTYP,XICE, & |
---|
1693 | mavail,num_soil_layers, config_flags%iswater, & |
---|
1694 | config_flags%isice, restart, & |
---|
1695 | allowed_to_read , & |
---|
1696 | ids,ide, jds,jde, kds,kde, & |
---|
1697 | ims,ime, jms,jme, kms,kme, & |
---|
1698 | its,ite, jts,jte, kts,kte ) |
---|
1699 | |
---|
1700 | CASE (PXLSMSCHEME) |
---|
1701 | CALL LSMINIT(VEGFRA,SNOW,SNOWC,SNOWH,CANWAT,SMSTAV, & |
---|
1702 | SMSTOT, SFCRUNOFF,UDRUNOFF,ACSNOW, & |
---|
1703 | ACSNOM,IVGTYP,ISLTYP,TSLB,SMOIS,SH2O,ZS,DZS, & |
---|
1704 | MMINLU, & |
---|
1705 | SNOALB, FNDSOILW, FNDSNOWH, RDMAXALB, & |
---|
1706 | num_soil_layers, restart, & |
---|
1707 | allowed_to_read , & |
---|
1708 | ids,ide, jds,jde, kds,kde, & |
---|
1709 | ims,ime, jms,jme, kms,kme, & |
---|
1710 | its,ite, jts,jte, kts,kte ) |
---|
1711 | |
---|
1712 | CASE DEFAULT |
---|
1713 | |
---|
1714 | END SELECT sfc_select |
---|
1715 | |
---|
1716 | IF(PRESENT(OMLCALL))THEN |
---|
1717 | IF (omlcall .EQ. 1) THEN |
---|
1718 | CALL omlinit(oml_hml0, tsk, & |
---|
1719 | tml,t0ml,hml,h0ml,huml,hvml,tmoml, & |
---|
1720 | allowed_to_read, start_of_simulation, & |
---|
1721 | ids,ide, jds,jde, kds,kde, & |
---|
1722 | ims,ime, jms,jme, kms,kme, & |
---|
1723 | its,ite, jts,jte, kts,kte ) |
---|
1724 | ENDIF |
---|
1725 | ENDIF |
---|
1726 | |
---|
1727 | !-- initialize pbl scheme |
---|
1728 | |
---|
1729 | pbl_select: SELECT CASE(config_flags%bl_pbl_physics) |
---|
1730 | |
---|
1731 | CASE (YSUSCHEME) |
---|
1732 | if(isfc .ne. 1)CALL wrf_error_fatal & |
---|
1733 | ( 'module_physics_init: use sfclay scheme for this pbl option' ) |
---|
1734 | IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) CALL wrf_error_fatal & |
---|
1735 | ( 'module_physics_init: use myj (option 2) or boulac (option 8) with BEP/BEM urban scheme' ) |
---|
1736 | CALL ysuinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & |
---|
1737 | RQCBLTEN,RQIBLTEN,P_QI, & |
---|
1738 | PARAM_FIRST_SCALAR, & |
---|
1739 | restart, & |
---|
1740 | allowed_to_read , & |
---|
1741 | ids, ide, jds, jde, kds, kde, & |
---|
1742 | ims, ime, jms, jme, kms, kme, & |
---|
1743 | its, ite, jts, jte, kts, kte ) |
---|
1744 | CASE (MRFSCHEME) |
---|
1745 | if(isfc .ne. 1)CALL wrf_error_fatal & |
---|
1746 | ( 'module_physics_init: use sfclay scheme for this pbl option' ) |
---|
1747 | IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) CALL wrf_error_fatal & |
---|
1748 | ( 'module_physics_init: use myj (option 2) or boulac (option 8) with BEP/BEM urban scheme' ) |
---|
1749 | CALL mrfinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & |
---|
1750 | RQCBLTEN,RQIBLTEN,P_QI, & |
---|
1751 | PARAM_FIRST_SCALAR, & |
---|
1752 | restart, & |
---|
1753 | allowed_to_read , & |
---|
1754 | ids, ide, jds, jde, kds, kde, & |
---|
1755 | ims, ime, jms, jme, kms, kme, & |
---|
1756 | its, ite, jts, jte, kts, kte ) |
---|
1757 | CASE (ACMPBLSCHEME) |
---|
1758 | if(isfc .ne. 1 .and. isfc .ne. 7)CALL wrf_error_fatal & |
---|
1759 | ( 'module_physics_init: use sfclay or pxsfc scheme for this pbl option' ) |
---|
1760 | IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) CALL wrf_error_fatal & |
---|
1761 | ( 'module_physics_init: use myj (option 2) or boulac (option 8) with BEP/BEM urban scheme' ) |
---|
1762 | CALL acminit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & |
---|
1763 | RQCBLTEN,RQIBLTEN,P_QI, & |
---|
1764 | PARAM_FIRST_SCALAR, & |
---|
1765 | restart, & |
---|
1766 | allowed_to_read , & |
---|
1767 | ids, ide, jds, jde, kds, kde, & |
---|
1768 | ims, ime, jms, jme, kms, kme, & |
---|
1769 | its, ite, jts, jte, kts, kte ) |
---|
1770 | CASE (GFSSCHEME) |
---|
1771 | if(isfc .ne. 2)CALL wrf_error_fatal & |
---|
1772 | ( 'module_physics_init: use myjsfc scheme for this pbl option' ) |
---|
1773 | IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) CALL wrf_error_fatal & |
---|
1774 | ( 'module_physics_init: use myj (option 2) or boulac (option 8) with BEP/BEM urban scheme' ) |
---|
1775 | CALL gfsinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & |
---|
1776 | RQCBLTEN,RQIBLTEN,P_QI, & |
---|
1777 | PARAM_FIRST_SCALAR, & |
---|
1778 | restart, & |
---|
1779 | allowed_to_read , & |
---|
1780 | ids, ide, jds, jde, kds, kde, & |
---|
1781 | ims, ime, jms, jme, kms, kme, & |
---|
1782 | its, ite, jts, jte, kts, kte ) |
---|
1783 | CASE (MYJPBLSCHEME) |
---|
1784 | if(isfc .ne. 2)CALL wrf_error_fatal & |
---|
1785 | ( 'module_physics_init: use myjsfc scheme for this pbl option' ) |
---|
1786 | IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) THEN |
---|
1787 | CALL myjurbinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & |
---|
1788 | TKE_PBL,EXCH_H,restart, & |
---|
1789 | allowed_to_read , & |
---|
1790 | ids, ide, jds, jde, kds, kde, & |
---|
1791 | ims, ime, jms, jme, kms, kme, & |
---|
1792 | its, ite, jts, jte, kts, kte ) |
---|
1793 | ELSE |
---|
1794 | |
---|
1795 | CALL myjpblinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & |
---|
1796 | TKE_PBL,EXCH_H,restart, & |
---|
1797 | allowed_to_read , & |
---|
1798 | ids, ide, jds, jde, kds, kde, & |
---|
1799 | ims, ime, jms, jme, kms, kme, & |
---|
1800 | its, ite, jts, jte, kts, kte ) |
---|
1801 | END IF |
---|
1802 | CASE (QNSEPBLSCHEME) |
---|
1803 | if(isfc .ne. 4)CALL wrf_error_fatal & |
---|
1804 | ( 'module_physics_init: use qnsesfc scheme for this pbl option' ) |
---|
1805 | IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) CALL wrf_error_fatal & |
---|
1806 | ( 'module_physics_init: use myj (option 2) or boulac (option 8) with BEP/BEM urban scheme' ) |
---|
1807 | CALL qnsepblinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & |
---|
1808 | TKE_PBL,EXCH_H,restart, & |
---|
1809 | allowed_to_read , & |
---|
1810 | ids, ide, jds, jde, kds, kde, & |
---|
1811 | ims, ime, jms, jme, kms, kme, & |
---|
1812 | its, ite, jts, jte, kts, kte ) |
---|
1813 | #if (NMM_CORE != 1) |
---|
1814 | CASE (BOULACSCHEME) |
---|
1815 | if(isfc .ne. 1 .and. isfc .ne. 2)CALL wrf_error_fatal & |
---|
1816 | ( 'module_physics_init: use sfclay or myjsfc scheme for this pbl option' ) |
---|
1817 | CALL boulacinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & |
---|
1818 | TKE_PBL,EXCH_H,restart, & |
---|
1819 | allowed_to_read , & |
---|
1820 | ids, ide, jds, jde, kds, kde, & |
---|
1821 | ims, ime, jms, jme, kms, kme, & |
---|
1822 | its, ite, jts, jte, kts, kte ) |
---|
1823 | CASE (CAMUWPBLSCHEME) |
---|
1824 | IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) CALL wrf_error_fatal & |
---|
1825 | ( 'module_physics_init: use myj (option 2) or boulac (option 8) with BEP/BEM urban scheme' ) |
---|
1826 | CALL camuwpblinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & |
---|
1827 | restart,TKE_PBL,config_flags%grid_id, & |
---|
1828 | ids, ide, jds, jde, kds, kde, & |
---|
1829 | ims, ime, jms, jme, kms, kme, & |
---|
1830 | its, ite, jts, jte, kts, kte ) |
---|
1831 | #endif |
---|
1832 | |
---|
1833 | #if ( EM_CORE == 1 ) |
---|
1834 | |
---|
1835 | !mynn |
---|
1836 | |
---|
1837 | CASE (MYNNPBLSCHEME2, MYNNPBLSCHEME3) |
---|
1838 | IF(isfc .NE. 5 .AND. isfc .NE. 1 .AND. isfc .NE. 2) CALL wrf_error_fatal & |
---|
1839 | ( 'module_physics_init: use mynnsfc or sfclay or myjsfc scheme for this pbl option') |
---|
1840 | IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) CALL wrf_error_fatal & |
---|
1841 | ( 'module_physics_init: use myj (option 2) or boulac (option 8) with BEP/BEM urban scheme' ) |
---|
1842 | |
---|
1843 | SELECT CASE(config_flags%bl_pbl_physics) |
---|
1844 | |
---|
1845 | CASE(MYNNPBLSCHEME2) |
---|
1846 | mynn_closure_level=2 |
---|
1847 | |
---|
1848 | CASE(MYNNPBLSCHEME3) |
---|
1849 | mynn_closure_level=3 |
---|
1850 | |
---|
1851 | CASE DEFAULT |
---|
1852 | |
---|
1853 | END SELECT |
---|
1854 | |
---|
1855 | CALL mynn_bl_init_driver(& |
---|
1856 | &RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN,RQCBLTEN& |
---|
1857 | &,restart,allowed_to_read,mynn_closure_level & |
---|
1858 | &,IDS,IDE,JDS,JDE,KDS,KDE & |
---|
1859 | &,IMS,IME,JMS,JME,KMS,KME & |
---|
1860 | &,ITS,ITE,JTS,JTE,KTS,KTE) |
---|
1861 | |
---|
1862 | CASE (TEMFPBLSCHEME) |
---|
1863 | ! if(isfc .ne. 0)CALL wrf_error_fatal & |
---|
1864 | ! ( 'module_physics_init: use sfclay scheme = 0 for this pbl option' ) |
---|
1865 | IF ((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.EQ.3)) CALL wrf_error_fatal & |
---|
1866 | ( 'module_physics_init: use myj (option 2) or boulac (option 8) with BEP/BEM urban scheme' ) |
---|
1867 | IF ( PRESENT( te_temf ) .AND. PRESENT( cf3d_temf )) THEN |
---|
1868 | CALL temfinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & |
---|
1869 | RQCBLTEN,RQIBLTEN,P_QI, & |
---|
1870 | PARAM_FIRST_SCALAR, & |
---|
1871 | restart, & |
---|
1872 | allowed_to_read , & |
---|
1873 | te_temf,cf3d_temf, & ! WA |
---|
1874 | ids, ide, jds, jde, kds, kde, & |
---|
1875 | ims, ime, jms, jme, kms, kme, & |
---|
1876 | its, ite, jts, jte, kts, kte ) |
---|
1877 | ELSE |
---|
1878 | CALL wrf_error_fatal ( 'arguments not present for calling TEMF scheme' ) |
---|
1879 | ENDIF |
---|
1880 | |
---|
1881 | #endif |
---|
1882 | |
---|
1883 | CASE DEFAULT |
---|
1884 | |
---|
1885 | END SELECT pbl_select |
---|
1886 | |
---|
1887 | |
---|
1888 | END SUBROUTINE bl_init |
---|
1889 | |
---|
1890 | !================================================================== |
---|
1891 | SUBROUTINE cu_init(STEPCU,CUDT,DT,RUCUTEN,RVCUTEN,RTHCUTEN, & |
---|
1892 | RQVCUTEN,RQRCUTEN,RQCCUTEN,RQSCUTEN,RQICUTEN,& |
---|
1893 | NCA,RAINC,RAINCV,W0AVG,config_flags,restart, & |
---|
1894 | CLDEFI,LOWLYR,MASS_FLUX, & |
---|
1895 | RTHFTEN, RQVFTEN, & |
---|
1896 | APR_GR,APR_W,APR_MC,APR_ST,APR_AS, & |
---|
1897 | APR_CAPMA,APR_CAPME,APR_CAPMI, & |
---|
1898 | cugd_tten,cugd_ttens,cugd_qvten, & |
---|
1899 | cugd_qvtens,cugd_qcten, & |
---|
1900 | allowed_to_read, start_of_simulation, & |
---|
1901 | ids, ide, jds, jde, kds, kde, & |
---|
1902 | ims, ime, jms, jme, kms, kme, & |
---|
1903 | its, ite, jts, jte, kts, kte ) |
---|
1904 | !------------------------------------------------------------------ |
---|
1905 | USE module_cu_kf |
---|
1906 | USE module_cu_kfeta |
---|
1907 | USE MODULE_CU_BMJ |
---|
1908 | USE module_cu_gd, ONLY : GDINIT |
---|
1909 | USE module_cu_g3, ONLY : G3INIT |
---|
1910 | USE module_cu_sas |
---|
1911 | USE module_cu_camzm_driver, ONLY : zm_conv_init |
---|
1912 | USE module_cu_nsas |
---|
1913 | USE module_cu_tiedtke |
---|
1914 | !------------------------------------------------------------------ |
---|
1915 | IMPLICIT NONE |
---|
1916 | !------------------------------------------------------------------ |
---|
1917 | TYPE (grid_config_rec_type) :: config_flags |
---|
1918 | LOGICAL , INTENT(IN) :: restart |
---|
1919 | |
---|
1920 | |
---|
1921 | INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, & |
---|
1922 | ims, ime, jms, jme, kms, kme, & |
---|
1923 | its, ite, jts, jte, kts, kte |
---|
1924 | |
---|
1925 | REAL , INTENT(IN) :: DT, CUDT |
---|
1926 | LOGICAL , INTENT(IN) :: start_of_simulation |
---|
1927 | LOGICAL , INTENT(IN) :: allowed_to_read |
---|
1928 | INTEGER , INTENT(INOUT) :: STEPCU |
---|
1929 | |
---|
1930 | REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: & |
---|
1931 | RUCUTEN, RVCUTEN, RTHCUTEN, & |
---|
1932 | RQVCUTEN, RQCCUTEN, RQRCUTEN, RQICUTEN, RQSCUTEN |
---|
1933 | REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , OPTIONAL, INTENT(INOUT) :: & |
---|
1934 | cugd_tten,cugd_ttens,cugd_qvten, & |
---|
1935 | cugd_qvtens,cugd_qcten |
---|
1936 | |
---|
1937 | REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: W0AVG |
---|
1938 | |
---|
1939 | REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: & |
---|
1940 | RTHFTEN, RQVFTEN |
---|
1941 | |
---|
1942 | REAL , DIMENSION( ims:ime , jms:jme ), INTENT(OUT):: RAINC, RAINCV |
---|
1943 | |
---|
1944 | REAL , DIMENSION( ims:ime , jms:jme ), INTENT(OUT):: CLDEFI |
---|
1945 | |
---|
1946 | REAL , DIMENSION( ims:ime , jms:jme ), INTENT(INOUT):: NCA |
---|
1947 | |
---|
1948 | REAL , DIMENSION( ims:ime , jms:jme ), INTENT(INOUT):: MASS_FLUX, & |
---|
1949 | APR_GR,APR_W,APR_MC,APR_ST,APR_AS, & |
---|
1950 | APR_CAPMA,APR_CAPME,APR_CAPMI |
---|
1951 | |
---|
1952 | INTEGER, DIMENSION( ims:ime , jms:jme ), INTENT(INOUT):: LOWLYR |
---|
1953 | |
---|
1954 | ! LOCAL VAR |
---|
1955 | |
---|
1956 | INTEGER :: i,j,itf,jtf |
---|
1957 | |
---|
1958 | !-------------------------------------------------------------------- |
---|
1959 | |
---|
1960 | !-- calculate cumulus parameterization time step |
---|
1961 | |
---|
1962 | itf=min0(ite,ide-1) |
---|
1963 | jtf=min0(jte,jde-1) |
---|
1964 | ! |
---|
1965 | STEPCU = nint(CUDT*60./DT) |
---|
1966 | STEPCU = max(STEPCU,1) |
---|
1967 | |
---|
1968 | !-- initialization |
---|
1969 | |
---|
1970 | IF(start_of_simulation)THEN |
---|
1971 | DO j=jts,jtf |
---|
1972 | DO i=its,itf |
---|
1973 | RAINC(i,j)=0. |
---|
1974 | RAINCV(i,j)=0. |
---|
1975 | ENDDO |
---|
1976 | ENDDO |
---|
1977 | ENDIF |
---|
1978 | |
---|
1979 | !-- deep convection and hybrid deep-shallow convection schemes |
---|
1980 | cps_select: SELECT CASE(config_flags%cu_physics) |
---|
1981 | |
---|
1982 | CASE (KFSCHEME) |
---|
1983 | CALL kfinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQRCUTEN, & |
---|
1984 | RQICUTEN,RQSCUTEN,NCA,W0AVG,P_QI,P_QS, & |
---|
1985 | PARAM_FIRST_SCALAR,restart, & |
---|
1986 | allowed_to_read , & |
---|
1987 | ids, ide, jds, jde, kds, kde, & |
---|
1988 | ims, ime, jms, jme, kms, kme, & |
---|
1989 | its, ite, jts, jte, kts, kte ) |
---|
1990 | |
---|
1991 | CASE (BMJSCHEME) |
---|
1992 | CALL bmjinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQRCUTEN, & |
---|
1993 | CLDEFI,LOWLYR,cp,r_d,restart, & |
---|
1994 | allowed_to_read , & |
---|
1995 | ids, ide, jds, jde, kds, kde, & |
---|
1996 | ims, ime, jms, jme, kms, kme, & |
---|
1997 | its, ite, jts, jte, kts, kte ) |
---|
1998 | |
---|
1999 | CASE (KFETASCHEME) |
---|
2000 | CALL kf_eta_init(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQRCUTEN, & |
---|
2001 | RQICUTEN,RQSCUTEN,NCA,W0AVG,P_QI,P_QS, & |
---|
2002 | SVP1,SVP2,SVP3,SVPT0, & |
---|
2003 | PARAM_FIRST_SCALAR,restart, & |
---|
2004 | allowed_to_read , & |
---|
2005 | ids, ide, jds, jde, kds, kde, & |
---|
2006 | ims, ime, jms, jme, kms, kme, & |
---|
2007 | its, ite, jts, jte, kts, kte ) |
---|
2008 | CASE (GDSCHEME) |
---|
2009 | CALL gdinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, & |
---|
2010 | MASS_FLUX,cp,restart, & |
---|
2011 | P_QC,P_QI,PARAM_FIRST_SCALAR, & |
---|
2012 | RTHFTEN, RQVFTEN, & |
---|
2013 | APR_GR,APR_W,APR_MC,APR_ST,APR_AS, & |
---|
2014 | APR_CAPMA,APR_CAPME,APR_CAPMI, & |
---|
2015 | allowed_to_read , & |
---|
2016 | ids, ide, jds, jde, kds, kde, & |
---|
2017 | ims, ime, jms, jme, kms, kme, & |
---|
2018 | its, ite, jts, jte, kts, kte ) |
---|
2019 | CASE (NSASSCHEME) |
---|
2020 | CALL nsasinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, & |
---|
2021 | RUCUTEN,RVCUTEN, & |
---|
2022 | restart,P_QC,P_QI,PARAM_FIRST_SCALAR, & |
---|
2023 | allowed_to_read , & |
---|
2024 | ids, ide, jds, jde, kds, kde, & |
---|
2025 | ims, ime, jms, jme, kms, kme, & |
---|
2026 | its, ite, jts, jte, kts, kte ) |
---|
2027 | |
---|
2028 | #if ( EM_CORE == 1 ) |
---|
2029 | CASE (G3SCHEME) |
---|
2030 | CALL g3init(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, & |
---|
2031 | MASS_FLUX,cp,restart, & |
---|
2032 | P_QC,P_QI,PARAM_FIRST_SCALAR, & |
---|
2033 | RTHFTEN, RQVFTEN, & |
---|
2034 | APR_GR,APR_W,APR_MC,APR_ST,APR_AS, & |
---|
2035 | APR_CAPMA,APR_CAPME,APR_CAPMI, & |
---|
2036 | cugd_tten,cugd_ttens,cugd_qvten, & |
---|
2037 | cugd_qvtens,cugd_qcten, & |
---|
2038 | allowed_to_read , & |
---|
2039 | ids, ide, jds, jde, kds, kde, & |
---|
2040 | ims, ime, jms, jme, kms, kme, & |
---|
2041 | its, ite, jts, jte, kts, kte ) |
---|
2042 | #endif |
---|
2043 | CASE (SASSCHEME) |
---|
2044 | CALL sasinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, & |
---|
2045 | RUCUTEN,RVCUTEN, & ! gopal's doing for SAS |
---|
2046 | restart,P_QC,P_QI,PARAM_FIRST_SCALAR, & |
---|
2047 | allowed_to_read , & |
---|
2048 | ids, ide, jds, jde, kds, kde, & |
---|
2049 | ims, ime, jms, jme, kms, kme, & |
---|
2050 | its, ite, jts, jte, kts, kte ) |
---|
2051 | |
---|
2052 | CASE (CAMZMSCHEME) |
---|
2053 | CALL zm_conv_init(rucuten, rvcuten, rthcuten, rqvcuten, & |
---|
2054 | rqccuten, rqicuten, & |
---|
2055 | p_qc, p_qi, param_first_scalar, & |
---|
2056 | restart, & |
---|
2057 | ids, ide, jds, jde, kds, kde, & |
---|
2058 | ims, ime, jms, jme, kms, kme, & |
---|
2059 | its, ite, jts, jte, kts, kte ) |
---|
2060 | |
---|
2061 | ! Tiedtke Scheme - ZCX&YQW |
---|
2062 | CASE (TIEDTKESCHEME) |
---|
2063 | CALL tiedtkeinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, & |
---|
2064 | RUCUTEN,RVCUTEN, & |
---|
2065 | restart,P_QC,P_QI,PARAM_FIRST_SCALAR, & |
---|
2066 | allowed_to_read , & |
---|
2067 | ids, ide, jds, jde, kds, kde, & |
---|
2068 | ims, ime, jms, jme, kms, kme, & |
---|
2069 | its, ite, jts, jte, kts, kte ) |
---|
2070 | |
---|
2071 | CASE DEFAULT |
---|
2072 | |
---|
2073 | END SELECT cps_select |
---|
2074 | |
---|
2075 | END SUBROUTINE cu_init |
---|
2076 | |
---|
2077 | !================================================================== |
---|
2078 | SUBROUTINE shcu_init(STEPCU,CUDT,DT,RUSHTEN,RVSHTEN,RTHSHTEN, & |
---|
2079 | RQVSHTEN,RQRSHTEN,RQCSHTEN, & |
---|
2080 | RQSSHTEN,RQISHTEN,RQGSHTEN, & |
---|
2081 | NCA,RAINC,RAINCV,config_flags,restart, & |
---|
2082 | allowed_to_read, start_of_simulation, & |
---|
2083 | ids, ide, jds, jde, kds, kde, & |
---|
2084 | ims, ime, jms, jme, kms, kme, & |
---|
2085 | its, ite, jts, jte, kts, kte ) |
---|
2086 | !------------------------------------------------------------------ |
---|
2087 | USE uwshcu, ONLY: init_uwshcu |
---|
2088 | USE physconst, ONLY: cpair, gravit, latice, latvap, mwdry, mwh2o, & |
---|
2089 | rair, zvir |
---|
2090 | USE shr_kind_mod, ONLY: r8 => shr_kind_r8 |
---|
2091 | |
---|
2092 | !------------------------------------------------------------------ |
---|
2093 | IMPLICIT NONE |
---|
2094 | !------------------------------------------------------------------ |
---|
2095 | TYPE (grid_config_rec_type) :: config_flags |
---|
2096 | LOGICAL , INTENT(IN) :: restart |
---|
2097 | |
---|
2098 | |
---|
2099 | INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, & |
---|
2100 | ims, ime, jms, jme, kms, kme, & |
---|
2101 | its, ite, jts, jte, kts, kte |
---|
2102 | |
---|
2103 | REAL , INTENT(IN) :: DT, CUDT |
---|
2104 | LOGICAL , INTENT(IN) :: start_of_simulation |
---|
2105 | LOGICAL , INTENT(IN) :: allowed_to_read |
---|
2106 | INTEGER , INTENT(INOUT) :: STEPCU |
---|
2107 | |
---|
2108 | REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: & |
---|
2109 | RUSHTEN, RVSHTEN, RTHSHTEN, & |
---|
2110 | RQVSHTEN, RQCSHTEN, RQRSHTEN, RQISHTEN, RQSSHTEN, RQGSHTEN |
---|
2111 | |
---|
2112 | REAL , DIMENSION( ims:ime , jms:jme ), INTENT(OUT):: RAINC, RAINCV |
---|
2113 | |
---|
2114 | REAL , DIMENSION( ims:ime , jms:jme ), INTENT(INOUT):: NCA |
---|
2115 | |
---|
2116 | ! LOCAL VAR |
---|
2117 | |
---|
2118 | INTEGER :: i,j,itf,jtf |
---|
2119 | |
---|
2120 | !-------------------------------------------------------------------- |
---|
2121 | |
---|
2122 | ! Some of this stuff is redundant with deep convection, but redo it |
---|
2123 | ! in case deep is turned off... |
---|
2124 | |
---|
2125 | !-- calculate cumulus parameterization time step |
---|
2126 | |
---|
2127 | itf=min0(ite,ide-1) |
---|
2128 | jtf=min0(jte,jde-1) |
---|
2129 | ! |
---|
2130 | STEPCU = nint(CUDT*60./DT) |
---|
2131 | STEPCU = max(STEPCU,1) |
---|
2132 | |
---|
2133 | !-- initialization |
---|
2134 | |
---|
2135 | IF(start_of_simulation)THEN |
---|
2136 | DO j=jts,jtf |
---|
2137 | DO i=its,itf |
---|
2138 | RAINC(i,j)=0. |
---|
2139 | RAINCV(i,j)=0. |
---|
2140 | ENDDO |
---|
2141 | ENDDO |
---|
2142 | ENDIF |
---|
2143 | |
---|
2144 | !-- independent shallow convection schemes |
---|
2145 | shcu_select: SELECT CASE(config_flags%shcu_physics) |
---|
2146 | |
---|
2147 | CASE (CAMUWSHCUSCHEME) |
---|
2148 | CALL init_uwshcu(r8,latvap,cpair,latice,zvir,rair,gravit, & |
---|
2149 | mwh2o/mwdry, & |
---|
2150 | rushten, rvshten, rthshten, rqvshten, & |
---|
2151 | rqcshten, rqrshten, rqishten, rqsshten, rqgshten, & |
---|
2152 | p_qc, p_qr, p_qi, p_qs, p_qg, & |
---|
2153 | config_flags%bl_pbl_physics, param_first_scalar, restart, & |
---|
2154 | config_flags%grid_id, & |
---|
2155 | ids, ide, jds, jde, kds, kde, & |
---|
2156 | ims, ime, jms, jme, kms, kme, & |
---|
2157 | its, ite, jts, jte, kts, kte ) |
---|
2158 | |
---|
2159 | CASE DEFAULT |
---|
2160 | |
---|
2161 | END SELECT shcu_select |
---|
2162 | |
---|
2163 | END SUBROUTINE shcu_init |
---|
2164 | |
---|
2165 | !================================================================== |
---|
2166 | SUBROUTINE mp_init(RAINNC,SNOWNC,GRAUPELNC,config_flags,restart,warm_rain, & |
---|
2167 | adv_moist_cond, & |
---|
2168 | MPDT, DT, DX, DY, LOWLYR, & ! for eta mp |
---|
2169 | F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, & ! for eta mp |
---|
2170 | mp_restart_state,tbpvs_state,tbpvs0_state, & ! eta mp |
---|
2171 | allowed_to_read, start_of_simulation, & |
---|
2172 | ids, ide, jds, jde, kds, kde, & |
---|
2173 | ims, ime, jms, jme, kms, kme, & |
---|
2174 | its, ite, jts, jte, kts, kte ) |
---|
2175 | !------------------------------------------------------------------ |
---|
2176 | USE module_mp_wsm3 |
---|
2177 | USE module_mp_wsm5 |
---|
2178 | USE module_mp_wsm6 |
---|
2179 | USE module_mp_etanew |
---|
2180 | #if (NMM_CORE == 1) |
---|
2181 | USE module_mp_HWRF |
---|
2182 | #endif |
---|
2183 | USE module_mp_thompson |
---|
2184 | USE module_mp_morr_two_moment |
---|
2185 | USE module_mp_milbrandt2mom |
---|
2186 | ! USE module_mp_milbrandt3mom |
---|
2187 | USE module_mp_wdm5 |
---|
2188 | USE module_mp_wdm6 |
---|
2189 | !------------------------------------------------------------------ |
---|
2190 | IMPLICIT NONE |
---|
2191 | !------------------------------------------------------------------ |
---|
2192 | ! Arguments |
---|
2193 | TYPE (grid_config_rec_type) :: config_flags |
---|
2194 | LOGICAL , INTENT(IN) :: restart |
---|
2195 | LOGICAL , INTENT(OUT) :: warm_rain,adv_moist_cond |
---|
2196 | REAL , INTENT(IN) :: MPDT, DT, DX, DY |
---|
2197 | LOGICAL , INTENT(IN) :: start_of_simulation |
---|
2198 | |
---|
2199 | INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, & |
---|
2200 | ims, ime, jms, jme, kms, kme, & |
---|
2201 | its, ite, jts, jte, kts, kte |
---|
2202 | |
---|
2203 | INTEGER , DIMENSION( ims:ime , jms:jme ) ,INTENT(INOUT) :: LOWLYR |
---|
2204 | REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: RAINNC,SNOWNC,GRAUPELNC |
---|
2205 | REAL, DIMENSION( ims:ime , kms:kme, jms:jme ) , INTENT(INOUT) :: & |
---|
2206 | F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY |
---|
2207 | REAL , DIMENSION(:) ,INTENT(INOUT) :: mp_restart_state,tbpvs_state,tbpvs0_state |
---|
2208 | LOGICAL , INTENT(IN) :: allowed_to_read |
---|
2209 | |
---|
2210 | ! Local |
---|
2211 | INTEGER :: i, j, itf, jtf |
---|
2212 | |
---|
2213 | warm_rain = .false. |
---|
2214 | adv_moist_cond = .true. |
---|
2215 | itf=min0(ite,ide-1) |
---|
2216 | jtf=min0(jte,jde-1) |
---|
2217 | |
---|
2218 | IF(start_of_simulation)THEN |
---|
2219 | DO j=jts,jtf |
---|
2220 | DO i=its,itf |
---|
2221 | RAINNC(i,j) = 0. |
---|
2222 | SNOWNC(i,j) = 0. |
---|
2223 | GRAUPELNC(i,j) = 0. |
---|
2224 | ENDDO |
---|
2225 | ENDDO |
---|
2226 | ENDIF |
---|
2227 | |
---|
2228 | mp_select: SELECT CASE(config_flags%mp_physics) |
---|
2229 | |
---|
2230 | CASE (KESSLERSCHEME) |
---|
2231 | warm_rain = .true. |
---|
2232 | CASE (WSM3SCHEME) |
---|
2233 | CALL wsm3init(rhoair0,rhowater,rhosnow,cliq,cpv, allowed_to_read ) |
---|
2234 | CASE (WSM5SCHEME) |
---|
2235 | CALL wsm5init(rhoair0,rhowater,rhosnow,cliq,cpv, allowed_to_read ) |
---|
2236 | CASE (WSM6SCHEME) |
---|
2237 | CALL wsm6init(rhoair0,rhowater,rhosnow,cliq,cpv, allowed_to_read ) |
---|
2238 | CASE (ETAMPNEW) |
---|
2239 | adv_moist_cond = .false. |
---|
2240 | CALL etanewinit (MPDT,DT,DX,DY,LOWLYR,restart, & |
---|
2241 | F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, & |
---|
2242 | mp_restart_state,tbpvs_state,tbpvs0_state,& |
---|
2243 | allowed_to_read, & |
---|
2244 | ids, ide, jds, jde, kds, kde, & |
---|
2245 | ims, ime, jms, jme, kms, kme, & |
---|
2246 | its, ite, jts, jte, kts, kte ) |
---|
2247 | #if(NMM_CORE==1) |
---|
2248 | CASE (etamp_HWRF) |
---|
2249 | CALL etanewinit_HWRF (MPDT,DT,DX,DY,LOWLYR,restart, & |
---|
2250 | F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, & |
---|
2251 | allowed_to_read, & |
---|
2252 | ids, ide, jds, jde, kds, kde, & |
---|
2253 | ims, ime, jms, jme, kms, kme, & |
---|
2254 | its, ite, jts, jte, kts, kte ) |
---|
2255 | #endif |
---|
2256 | CASE (THOMPSON) |
---|
2257 | ! Cycling the WRF forecast with moving nests will cause this initialization to be |
---|
2258 | ! called for each nest move. This is potentially very computationally expensive. |
---|
2259 | IF(start_of_simulation.or.restart.or.config_flags%cycling)CALL thompson_init |
---|
2260 | |
---|
2261 | CASE (MORR_TWO_MOMENT) |
---|
2262 | CALL morr_two_moment_init |
---|
2263 | CASE (MILBRANDT2MOM) |
---|
2264 | CALL milbrandt2mom_init |
---|
2265 | ! CASE (MILBRANDT3MOM) |
---|
2266 | ! CALL milbrandt3mom_init |
---|
2267 | CASE (WDM5SCHEME) |
---|
2268 | CALL wdm5init(rhoair0,rhowater,rhosnow,cliq,cpv,n_ccn0,allowed_to_read ) |
---|
2269 | CASE (WDM6SCHEME) |
---|
2270 | CALL wdm6init(rhoair0,rhowater,rhosnow,cliq,cpv,n_ccn0,allowed_to_read ) |
---|
2271 | |
---|
2272 | CASE DEFAULT |
---|
2273 | |
---|
2274 | END SELECT mp_select |
---|
2275 | |
---|
2276 | END SUBROUTINE mp_init |
---|
2277 | |
---|
2278 | #if ( EM_CORE == 1 ) |
---|
2279 | !========================================================== |
---|
2280 | SUBROUTINE fg_init(STEPFG,FGDT,DT,id,RUNDGDTEN,RVNDGDTEN, & |
---|
2281 | RTHNDGDTEN,RPHNDGDTEN,RQVNDGDTEN,RMUNDGDTEN, & |
---|
2282 | config_flags,restart, & |
---|
2283 | allowed_to_read , & |
---|
2284 | ids, ide, jds, jde, kds, kde, & |
---|
2285 | ims, ime, jms, jme, kms, kme, & |
---|
2286 | its, ite, jts, jte, kts, kte ) |
---|
2287 | |
---|
2288 | |
---|
2289 | !-------------------------------------------------------------------- |
---|
2290 | USE module_fdda_psufddagd |
---|
2291 | USE module_fdda_spnudging, ONLY : fddaspnudginginit |
---|
2292 | !-------------------------------------------------------------------- |
---|
2293 | IMPLICIT NONE |
---|
2294 | !-------------------------------------------------------------------- |
---|
2295 | TYPE (grid_config_rec_type) :: config_flags |
---|
2296 | LOGICAL , INTENT(IN) :: restart |
---|
2297 | |
---|
2298 | INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, & |
---|
2299 | ims, ime, jms, jme, kms, kme, & |
---|
2300 | its, ite, jts, jte, kts, kte |
---|
2301 | |
---|
2302 | REAL , INTENT(IN) :: DT, FGDT |
---|
2303 | INTEGER , INTENT(IN) :: id |
---|
2304 | INTEGER , INTENT(INOUT) :: STEPFG |
---|
2305 | REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: & |
---|
2306 | RUNDGDTEN, & |
---|
2307 | RVNDGDTEN, & |
---|
2308 | RTHNDGDTEN, & |
---|
2309 | RPHNDGDTEN, & |
---|
2310 | RQVNDGDTEN |
---|
2311 | REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(OUT) :: RMUNDGDTEN |
---|
2312 | |
---|
2313 | LOGICAL, INTENT(IN) :: allowed_to_read |
---|
2314 | !-------------------------------------------------------------------- |
---|
2315 | |
---|
2316 | !-- calculate pbl time step |
---|
2317 | |
---|
2318 | STEPFG = nint(FGDT*60./DT) |
---|
2319 | STEPFG = max(STEPFG,1) |
---|
2320 | |
---|
2321 | |
---|
2322 | !-- initialize fdda scheme |
---|
2323 | |
---|
2324 | fdda_select: SELECT CASE(config_flags%grid_fdda) |
---|
2325 | |
---|
2326 | CASE (PSUFDDAGD) |
---|
2327 | CALL fddagdinit(id,rundgdten,rvndgdten,rthndgdten,rqvndgdten,rmundgdten,& |
---|
2328 | config_flags%run_hours, & |
---|
2329 | config_flags%if_no_pbl_nudging_uv, & |
---|
2330 | config_flags%if_no_pbl_nudging_t, & |
---|
2331 | config_flags%if_no_pbl_nudging_q, & |
---|
2332 | config_flags%if_zfac_uv, & |
---|
2333 | config_flags%k_zfac_uv, & |
---|
2334 | config_flags%if_zfac_t, & |
---|
2335 | config_flags%k_zfac_t, & |
---|
2336 | config_flags%if_zfac_q, & |
---|
2337 | config_flags%k_zfac_q, & |
---|
2338 | config_flags%guv, & |
---|
2339 | config_flags%gt, config_flags%gq, & |
---|
2340 | config_flags%if_ramping, config_flags%dtramp_min, & |
---|
2341 | config_flags%auxinput10_end_h, & |
---|
2342 | config_flags%grid_sfdda, & |
---|
2343 | config_flags%guv_sfc, & |
---|
2344 | config_flags%gt_sfc, & |
---|
2345 | config_flags%gq_sfc, & |
---|
2346 | restart, allowed_to_read, & |
---|
2347 | ids, ide, jds, jde, kds, kde, & |
---|
2348 | ims, ime, jms, jme, kms, kme, & |
---|
2349 | its, ite, jts, jte, kts, kte ) |
---|
2350 | |
---|
2351 | CASE (SPNUDGING) |
---|
2352 | CALL fddaspnudginginit(id,rundgdten,rvndgdten,rthndgdten,rphndgdten,& |
---|
2353 | config_flags%run_hours, & |
---|
2354 | config_flags%if_no_pbl_nudging_uv, & |
---|
2355 | config_flags%if_no_pbl_nudging_t, & |
---|
2356 | config_flags%if_no_pbl_nudging_ph, & |
---|
2357 | config_flags%if_zfac_uv, & |
---|
2358 | config_flags%k_zfac_uv, & |
---|
2359 | config_flags%dk_zfac_uv, & |
---|
2360 | config_flags%if_zfac_t, & |
---|
2361 | config_flags%k_zfac_t, & |
---|
2362 | config_flags%dk_zfac_t, & |
---|
2363 | config_flags%if_zfac_ph, & |
---|
2364 | config_flags%k_zfac_ph, & |
---|
2365 | config_flags%dk_zfac_ph, & |
---|
2366 | config_flags%guv, & |
---|
2367 | config_flags%gt, config_flags%gph, & |
---|
2368 | config_flags%if_ramping, config_flags%dtramp_min, & |
---|
2369 | config_flags%auxinput9_end_h, & |
---|
2370 | config_flags%xwavenum,config_flags%ywavenum, & |
---|
2371 | restart, allowed_to_read, & |
---|
2372 | ids, ide, jds, jde, kds, kde, & |
---|
2373 | ims, ime, jms, jme, kms, kme, & |
---|
2374 | its, ite, jts, jte, kts, kte ) |
---|
2375 | |
---|
2376 | CASE DEFAULT |
---|
2377 | |
---|
2378 | END SELECT fdda_select |
---|
2379 | |
---|
2380 | END SUBROUTINE fg_init |
---|
2381 | |
---|
2382 | !------------------------------------------------------------------- |
---|
2383 | SUBROUTINE fdob_init(obs_nudge_opt, maxdom, inest, parid, & |
---|
2384 | idynin, dtramp, fdaend, restart, & |
---|
2385 | obs_twindo_cg, obs_twindo, itimestep, & |
---|
2386 | no_pbl_nudge_uv, & |
---|
2387 | no_pbl_nudge_t, & |
---|
2388 | no_pbl_nudge_q, & |
---|
2389 | sfc_scheme_horiz, sfc_scheme_vert, & |
---|
2390 | maxsnd_gap, & |
---|
2391 | sfcfact, sfcfacr, dpsmx, & |
---|
2392 | nudge_wind, nudge_temp, nudge_mois, & |
---|
2393 | nudgezfullr1_uv, nudgezrampr1_uv, & |
---|
2394 | nudgezfullr2_uv, nudgezrampr2_uv, & |
---|
2395 | nudgezfullr4_uv, nudgezrampr4_uv, & |
---|
2396 | nudgezfullr1_t, nudgezrampr1_t, & |
---|
2397 | nudgezfullr2_t, nudgezrampr2_t, & |
---|
2398 | nudgezfullr4_t, nudgezrampr4_t, & |
---|
2399 | nudgezfullr1_q, nudgezrampr1_q, & |
---|
2400 | nudgezfullr2_q, nudgezrampr2_q, & |
---|
2401 | nudgezfullr4_q, nudgezrampr4_q, & |
---|
2402 | nudgezfullmin, nudgezrampmin, nudgezmax, & |
---|
2403 | xlat, xlong, & |
---|
2404 | start_year, start_month, start_day, & |
---|
2405 | start_hour, start_minute, start_second, & |
---|
2406 | p00, t00, tlp, & |
---|
2407 | znu, p_top, & |
---|
2408 | fdob, ipf_init, & |
---|
2409 | ids, ide, jds, jde, kds, kde, & |
---|
2410 | ims, ime, jms, jme, kms, kme, & |
---|
2411 | its, ite, jts, jte, kts, kte ) |
---|
2412 | |
---|
2413 | !-------------------------------------------------------------------- |
---|
2414 | USE module_domain |
---|
2415 | USE module_fddaobs_rtfdda |
---|
2416 | USE module_llxy |
---|
2417 | !-------------------------------------------------------------------- |
---|
2418 | IMPLICIT NONE |
---|
2419 | !-------------------------------------------------------------------- |
---|
2420 | INTEGER , INTENT(IN) :: maxdom |
---|
2421 | INTEGER , INTENT(IN) :: obs_nudge_opt(maxdom) |
---|
2422 | INTEGER , INTENT(IN) :: ids,ide, jds,jde, kds,kde, & |
---|
2423 | ims,ime, jms,jme, kms,kme, & |
---|
2424 | its,ite, jts,jte, kts,kte |
---|
2425 | INTEGER , INTENT(IN) :: inest |
---|
2426 | INTEGER , INTENT(IN) :: parid(maxdom) |
---|
2427 | INTEGER , INTENT(IN) :: idynin ! flag for dynamic initialization |
---|
2428 | REAL , INTENT(IN) :: dtramp ! time period for ramping (idynin) |
---|
2429 | REAL , INTENT(IN) :: fdaend(maxdom) ! nudging end time for domain (min) |
---|
2430 | LOGICAL , INTENT(IN) :: restart |
---|
2431 | REAL , INTENT(IN) :: obs_twindo_cg ! twindo on course grid |
---|
2432 | REAL , INTENT(IN) :: obs_twindo |
---|
2433 | INTEGER , INTENT(IN) :: itimestep |
---|
2434 | INTEGER , INTENT(IN) :: no_pbl_nudge_uv(maxdom) ! flags for no wind nudging in pbl |
---|
2435 | INTEGER , INTENT(IN) :: no_pbl_nudge_t(maxdom) ! flags for no temperature nudging in pbl |
---|
2436 | INTEGER , INTENT(IN) :: no_pbl_nudge_q(maxdom) ! flags for no moisture nudging in pbl |
---|
2437 | INTEGER , INTENT(IN) :: sfc_scheme_horiz ! horizontal spreading scheme for surf obs (wrf or orig mm5) |
---|
2438 | INTEGER , INTENT(IN) :: sfc_scheme_vert ! vertical spreading scheme for surf obs (orig or regime vif) |
---|
2439 | REAL , INTENT(IN) :: maxsnd_gap ! max allowed pressure gap in soundings for interp (centibars) |
---|
2440 | REAL , INTENT(IN) :: sfcfact ! scale factor applied to time window for surface obs |
---|
2441 | REAL , INTENT(IN) :: sfcfacr ! scale fac applied to horiz rad of infl for sfc obs |
---|
2442 | REAL , INTENT(IN) :: dpsmx ! max pressure change allowed within horiz. infl. range |
---|
2443 | INTEGER , INTENT(IN) :: nudge_wind(maxdom) ! wind-nudging flag |
---|
2444 | INTEGER , INTENT(IN) :: nudge_temp(maxdom) ! temperature-nudging flag |
---|
2445 | INTEGER , INTENT(IN) :: nudge_mois(maxdom) ! moisture-nudging flag |
---|
2446 | REAL , INTENT(IN) :: nudgezfullr1_uv ! vert infl fcn, regime=1 full-wt hght, winds |
---|
2447 | REAL , INTENT(IN) :: nudgezrampr1_uv ! vert infl fcn, regime=1 ramp down hght, winds |
---|
2448 | REAL , INTENT(IN) :: nudgezfullr2_uv ! vert infl fcn, regime=2 full-wt hght, winds |
---|
2449 | REAL , INTENT(IN) :: nudgezrampr2_uv ! vert infl fcn, regime=2 ramp down hght, winds |
---|
2450 | REAL , INTENT(IN) :: nudgezfullr4_uv ! vert infl fcn, regime=4 full-wt hght, winds |
---|
2451 | REAL , INTENT(IN) :: nudgezrampr4_uv ! vert infl fcn, regime=4 ramp down hght, winds |
---|
2452 | REAL , INTENT(IN) :: nudgezfullr1_t ! vert infl fcn, regime=1 full-wt hght, temp |
---|
2453 | REAL , INTENT(IN) :: nudgezrampr1_t ! vert infl fcn, regime=1 ramp down hght, temp |
---|
2454 | REAL , INTENT(IN) :: nudgezfullr2_t ! vert infl fcn, regime=2 full-wt hght, temp |
---|
2455 | REAL , INTENT(IN) :: nudgezrampr2_t ! vert infl fcn, regime=2 ramp down hght, temp |
---|
2456 | REAL , INTENT(IN) :: nudgezfullr4_t ! vert infl fcn, regime=4 full-wt hght, temp |
---|
2457 | REAL , INTENT(IN) :: nudgezrampr4_t ! vert infl fcn, regime=4 ramp down hght, temp |
---|
2458 | REAL , INTENT(IN) :: nudgezfullr1_q ! vert infl fcn, regime=1 full-wt hght, mois |
---|
2459 | REAL , INTENT(IN) :: nudgezrampr1_q ! vert infl fcn, regime=1 ramp down hght, mois |
---|
2460 | REAL , INTENT(IN) :: nudgezfullr2_q ! vert infl fcn, regime=2 full-wt hght, mois |
---|
2461 | REAL , INTENT(IN) :: nudgezrampr2_q ! vert infl fcn, regime=2 ramp down hght, mois |
---|
2462 | REAL , INTENT(IN) :: nudgezfullr4_q ! vert infl fcn, regime=4 full-wt hght, mois |
---|
2463 | REAL , INTENT(IN) :: nudgezrampr4_q ! vert infl fcn, regime=4 ramp down hght, mois |
---|
2464 | REAL , INTENT(IN) :: nudgezfullmin ! min dpth thru which vert infl fcn remains 1.0 (m) |
---|
2465 | REAL , INTENT(IN) :: nudgezrampmin ! min dpth thru which vif decreases 1.0 to 0.0 (m) |
---|
2466 | REAL , INTENT(IN) :: nudgezmax ! max dpth in which vif is nonzero (m) |
---|
2467 | REAL , INTENT(IN) :: xlat ( ims:ime, jms:jme ) ! latitudes on mass-point grid |
---|
2468 | REAL , INTENT(IN) :: xlong( ims:ime, jms:jme ) ! longitudes on mass-point grid |
---|
2469 | INTEGER , INTENT(INOUT) :: start_year |
---|
2470 | INTEGER , INTENT(INOUT) :: start_month |
---|
2471 | INTEGER , INTENT(INOUT) :: start_day |
---|
2472 | INTEGER , INTENT(INOUT) :: start_hour |
---|
2473 | INTEGER , INTENT(INOUT) :: start_minute |
---|
2474 | INTEGER , INTENT(INOUT) :: start_second |
---|
2475 | REAL , INTENT(IN) :: p00 ! base state pressure |
---|
2476 | REAL , INTENT(IN) :: t00 ! base state temperature |
---|
2477 | REAL , INTENT(IN) :: tlp ! base state lapse rate |
---|
2478 | REAL , INTENT(IN) :: znu( kms:kme ) ! eta values on half (mass) levels |
---|
2479 | REAL , INTENT(IN) :: p_top ! pressure at top of model |
---|
2480 | TYPE(fdob_type), INTENT(INOUT) :: fdob |
---|
2481 | |
---|
2482 | INTEGER :: e_sn ! ending north-south grid index |
---|
2483 | LOGICAL :: ipf_init ! print warnings detected at initialzn |
---|
2484 | !-------------------------------------------------------------------- |
---|
2485 | !-- initialize fdda obs-nudging scheme |
---|
2486 | |
---|
2487 | IF ( obs_nudge_opt(inest) .eq. 0 ) RETURN |
---|
2488 | |
---|
2489 | e_sn = jde |
---|
2490 | CALL fddaobs_init(obs_nudge_opt, maxdom, inest, parid, & |
---|
2491 | idynin, dtramp, fdaend, restart, & |
---|
2492 | obs_twindo_cg, & |
---|
2493 | obs_twindo, itimestep, & |
---|
2494 | no_pbl_nudge_uv, & |
---|
2495 | no_pbl_nudge_t, & |
---|
2496 | no_pbl_nudge_q, & |
---|
2497 | sfc_scheme_horiz, sfc_scheme_vert, & |
---|
2498 | maxsnd_gap, & |
---|
2499 | sfcfact, sfcfacr, dpsmx, & |
---|
2500 | nudge_wind, nudge_temp, nudge_mois, & |
---|
2501 | nudgezfullr1_uv, nudgezrampr1_uv, & |
---|
2502 | nudgezfullr2_uv, nudgezrampr2_uv, & |
---|
2503 | nudgezfullr4_uv, nudgezrampr4_uv, & |
---|
2504 | nudgezfullr1_t, nudgezrampr1_t, & |
---|
2505 | nudgezfullr2_t, nudgezrampr2_t, & |
---|
2506 | nudgezfullr4_t, nudgezrampr4_t, & |
---|
2507 | nudgezfullr1_q, nudgezrampr1_q, & |
---|
2508 | nudgezfullr2_q, nudgezrampr2_q, & |
---|
2509 | nudgezfullr4_q, nudgezrampr4_q, & |
---|
2510 | nudgezfullmin, nudgezrampmin, nudgezmax, & |
---|
2511 | xlat, xlong, & |
---|
2512 | start_year, start_month, start_day, & |
---|
2513 | start_hour, start_minute, start_second, & |
---|
2514 | p00, t00, tlp, & |
---|
2515 | znu, p_top, & |
---|
2516 | fdob, ipf_init, & |
---|
2517 | ids,ide, jds,jde, kds,kde, & |
---|
2518 | ims,ime, jms,jme, kms,kme, & |
---|
2519 | its,ite, jts,jte, kts,kte) |
---|
2520 | |
---|
2521 | END SUBROUTINE fdob_init |
---|
2522 | #endif |
---|
2523 | |
---|
2524 | !-------------------------------------------------------------------- |
---|
2525 | SUBROUTINE z2sigma(zf,zh,sf,sh,p_top,pptop,config_flags, & |
---|
2526 | allowed_to_read , & |
---|
2527 | kds,kde,kms,kme,kts,kte) |
---|
2528 | IMPLICIT NONE |
---|
2529 | ! Arguments |
---|
2530 | INTEGER, INTENT(IN) :: kds,kde,kms,kme,kts,kte |
---|
2531 | REAL , DIMENSION( kms:kme ), INTENT(IN) :: zf,zh |
---|
2532 | REAL , DIMENSION( kms:kme ), INTENT(OUT):: sf,sh |
---|
2533 | REAL , INTENT(IN) :: p_top |
---|
2534 | REAL , INTENT(OUT) :: pptop |
---|
2535 | TYPE (grid_config_rec_type) :: config_flags |
---|
2536 | LOGICAL , INTENT(IN) :: allowed_to_read |
---|
2537 | ! Local |
---|
2538 | REAL R, G, TS, GAMMA, PS, ZTROP, TSTRAT, PTROP, Z, T, P, ZTOP, PTOP |
---|
2539 | INTEGER K |
---|
2540 | |
---|
2541 | IF(zf(kde/2) .GT. 1.0)THEN |
---|
2542 | ! Height levels assumed (zeta coordinate) |
---|
2543 | ! Convert to sigma using standard atmosphere for pressure-height relation |
---|
2544 | ! constants for standard atmosphere definition |
---|
2545 | r=287.05 |
---|
2546 | g=9.80665 |
---|
2547 | ts=288.15 |
---|
2548 | gamma=-6.5/1000. |
---|
2549 | ps=1013.25 |
---|
2550 | ztrop=11000. |
---|
2551 | tstrat=ts+gamma*ztrop |
---|
2552 | ptrop=ps*(tstrat/ts)**(-g/(gamma*r)) |
---|
2553 | |
---|
2554 | do k=kde,kds,-1 |
---|
2555 | ! full levels |
---|
2556 | z=zf(k) |
---|
2557 | if(z.le.ztrop)then |
---|
2558 | t=ts+gamma*z |
---|
2559 | p=ps*(t/ts)**(-g/(gamma*r)) |
---|
2560 | else |
---|
2561 | t=tstrat |
---|
2562 | p=ptrop*exp(-g*(z-ztrop)/(r*tstrat)) |
---|
2563 | endif |
---|
2564 | if(k.eq.kde)then |
---|
2565 | ztop=zf(k) |
---|
2566 | ptop=p |
---|
2567 | endif |
---|
2568 | sf(k)=(p-ptop)/(ps-ptop) |
---|
2569 | ! half levels |
---|
2570 | if(k.ne.kds)then |
---|
2571 | z=0.5*(zf(k)+zf(k-1)) |
---|
2572 | if(z.le.ztrop)then |
---|
2573 | t=ts+gamma*z |
---|
2574 | p=ps*(t/ts)**(-g/(gamma*r)) |
---|
2575 | else |
---|
2576 | t=tstrat |
---|
2577 | p=ptrop*exp(-g*(z-ztrop)/(r*tstrat)) |
---|
2578 | endif |
---|
2579 | sh(k-1)=(p-ptop)/(ps-ptop) |
---|
2580 | endif |
---|
2581 | enddo |
---|
2582 | pptop=ptop/10. |
---|
2583 | ELSE |
---|
2584 | ! Levels are already sigma/eta |
---|
2585 | do k=kde,kds,-1 |
---|
2586 | ! sf(k)=zf(kde-k+kds) |
---|
2587 | ! if(k .ne. kde)sh(k)=zh(kde-1-k+kds) |
---|
2588 | sf(k)=zf(k) |
---|
2589 | if(k .ne. kde)sh(k)=zh(k) |
---|
2590 | enddo |
---|
2591 | pptop=p_top/1000. |
---|
2592 | |
---|
2593 | ENDIF |
---|
2594 | |
---|
2595 | END SUBROUTINE z2sigma |
---|
2596 | |
---|
2597 | END MODULE module_physics_init |
---|