1 | ! $Id: lmdz1d.F90 3540 2019-06-25 14:50:13Z fairhead $ |
---|
2 | |
---|
3 | MODULE lmdz_old_lmdz1d |
---|
4 | USE lmdz_old_1dconv, ONLY: copie, get_uvd2, get_uvd, rdgrads, spaces |
---|
5 | USE lmdz_1dutils, ONLY: interp2_case_vertical, nudge_uv, nudge_rht, lstendh, nudge_uv_init, & |
---|
6 | nudge_rht_init, disvert0 |
---|
7 | PRIVATE ! -- We'd love to put IMPLICIT NONE; here... |
---|
8 | PUBLIC old_lmdz1d |
---|
9 | CONTAINS |
---|
10 | |
---|
11 | SUBROUTINE old_lmdz1d |
---|
12 | |
---|
13 | USE ioipsl, ONLY: ju2ymds, ymds2ju, ioconf_calendar, getin |
---|
14 | USE phys_state_var_mod, ONLY: phys_state_var_init, phys_state_var_end, & |
---|
15 | clwcon, detr_therm, & |
---|
16 | qsol, fevap, z0m, z0h, agesno, & |
---|
17 | du_gwd_rando, du_gwd_front, entr_therm, f0, fm_therm, & |
---|
18 | falb_dir, falb_dif, & |
---|
19 | ftsol, beta_aridity, pbl_tke, pctsrf, radsol, rain_fall, snow_fall, ratqs, & |
---|
20 | rnebcon, rugoro, sig1, w01, solaire_etat0, sollw, sollwdown, & |
---|
21 | solsw, solswfdiff, t_ancien, q_ancien, u_ancien, v_ancien, rneb_ancien, & |
---|
22 | wake_delta_pbl_TKE, delta_tsurf, wake_fip, wake_pe, & |
---|
23 | wake_deltaq, wake_deltat, wake_s, awake_s, wake_dens, & |
---|
24 | awake_dens, cv_gen, wake_cstar, & |
---|
25 | zgam, zmax0, zmea, zpic, zsig, & |
---|
26 | zstd, zthe, zval, ale_bl, ale_bl_trig, alp_bl, ql_ancien, qs_ancien, & |
---|
27 | prlw_ancien, prsw_ancien, prw_ancien, & |
---|
28 | u10m, v10m, ale_wake, ale_bl_stat |
---|
29 | |
---|
30 | USE dimphy |
---|
31 | USE surface_data, ONLY: type_ocean, ok_veget |
---|
32 | USE pbl_surface_mod, ONLY: ftsoil, pbl_surface_init, pbl_surface_final |
---|
33 | USE fonte_neige_mod, ONLY: fonte_neige_init, fonte_neige_final |
---|
34 | |
---|
35 | USE infotrac |
---|
36 | USE control_mod |
---|
37 | USE indice_sol_mod |
---|
38 | USE phyaqua_mod |
---|
39 | USE mod_1D_cases_read2 |
---|
40 | USE mod_1D_amma_read |
---|
41 | USE lmdz_print_control, ONLY: lunout, prt_level |
---|
42 | USE iniphysiq_mod, ONLY: iniphysiq |
---|
43 | USE mod_const_mpi, ONLY: comm_lmdz |
---|
44 | USE physiq_mod, ONLY: physiq |
---|
45 | USE comvert_mod, ONLY: presnivs, ap, bp, dpres, nivsig, nivsigs, pa, & |
---|
46 | preff, aps, bps, pseudoalt, scaleheight |
---|
47 | USE temps_mod, ONLY: annee_ref, calend, day_end, day_ini, day_ref, & |
---|
48 | itau_dyn, itau_phy, start_time, year_len |
---|
49 | USE phys_cal_mod, ONLY: year_len_phys_cal_mod => year_len |
---|
50 | USE mod_1D_cases_read, ONLY: interp_case_time ! used in included old_1D_read_forc_cases.h |
---|
51 | USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_OUTPUTPHYSSCM |
---|
52 | USE lmdz_1dutils, ONLY: fq_sat, conf_unicol, dyn1deta0, dyn1dredem |
---|
53 | USE lmdz_clesphys |
---|
54 | USE lmdz_flux_arp, ONLY: fsens, flat, betaevap, ust, tg, ok_flux_surf, ok_prescr_ust, ok_prescr_beta, ok_forc_tsurf |
---|
55 | USE lmdz_compbl, ONLY: iflag_pbl, iflag_pbl_split, iflag_order2_sollw, ifl_pbltree |
---|
56 | USE lmdz_fcs_gcssold, ONLY: imp_fcg_gcssold, ts_fcg_gcssold, Tp_fcg_gcssold, Tp_ini_gcssold, xTurb_fcg_gcssold |
---|
57 | USE lmdz_tsoilnudge, ONLY: nudge_tsoil, isoil_nudge, Tsoil_nudge, tau_soil_nudge |
---|
58 | USE lmdz_yomcst |
---|
59 | USE lmdz_compar1d |
---|
60 | USE lmdz_date_cas, ONLY: year_ini_cas, mth_ini_cas, day_deb, heure_ini_cas, pdt_cas, day_ju_ini_cas |
---|
61 | |
---|
62 | IMPLICIT NONE |
---|
63 | |
---|
64 | INCLUDE "dimensions.h" |
---|
65 | INCLUDE "dimsoil.h" |
---|
66 | |
---|
67 | !===================================================================== |
---|
68 | ! DECLARATIONS |
---|
69 | !===================================================================== |
---|
70 | !--------------------------------------------------------------------- |
---|
71 | ! Arguments d' initialisations de la physique (USER DEFINE) |
---|
72 | !--------------------------------------------------------------------- |
---|
73 | |
---|
74 | INTEGER, parameter :: ngrid = 1 |
---|
75 | REAL :: zcufi = 1. |
---|
76 | REAL :: zcvfi = 1. |
---|
77 | |
---|
78 | !- REAL :: nat_surf |
---|
79 | !- LOGICAL :: ok_flux_surf |
---|
80 | !- REAL :: fsens |
---|
81 | !- REAL :: flat |
---|
82 | !- REAL :: tsurf |
---|
83 | !- REAL :: rugos |
---|
84 | !- REAL :: qsol(1:2) |
---|
85 | !- REAL :: qsurf |
---|
86 | !- REAL :: psurf |
---|
87 | !- REAL :: zsurf |
---|
88 | !- REAL :: albedo |
---|
89 | !- |
---|
90 | !- REAL :: time = 0. |
---|
91 | !- REAL :: time_ini |
---|
92 | !- REAL :: xlat |
---|
93 | !- REAL :: xlon |
---|
94 | !- REAL :: wtsurf |
---|
95 | !- REAL :: wqsurf |
---|
96 | !- REAL :: restart_runoff |
---|
97 | !- REAL :: xagesno |
---|
98 | !- REAL :: qsolinp |
---|
99 | !- REAL :: zpicinp |
---|
100 | !- |
---|
101 | REAL :: fnday |
---|
102 | REAL :: day, daytime |
---|
103 | REAL :: day1 |
---|
104 | REAL :: heure |
---|
105 | INTEGER :: jour |
---|
106 | INTEGER :: mois |
---|
107 | INTEGER :: an |
---|
108 | |
---|
109 | !--------------------------------------------------------------------- |
---|
110 | ! Declarations related to forcing and initial profiles |
---|
111 | !--------------------------------------------------------------------- |
---|
112 | |
---|
113 | INTEGER :: kmax = llm |
---|
114 | INTEGER llm700, nq1, nq2 |
---|
115 | INTEGER, PARAMETER :: nlev_max = 1000, nqmx = 1000 |
---|
116 | REAL timestep, frac |
---|
117 | REAL height(nlev_max), tttprof(nlev_max), qtprof(nlev_max) |
---|
118 | real uprof(nlev_max), vprof(nlev_max), e12prof(nlev_max) |
---|
119 | real ugprof(nlev_max), vgprof(nlev_max), wfls(nlev_max) |
---|
120 | real dqtdxls(nlev_max), dqtdyls(nlev_max) |
---|
121 | real dqtdtls(nlev_max), thlpcar(nlev_max) |
---|
122 | real qprof(nlev_max, nqmx) |
---|
123 | |
---|
124 | ! INTEGER :: forcing_type |
---|
125 | LOGICAL :: forcing_les = .FALSE. |
---|
126 | LOGICAL :: forcing_armcu = .FALSE. |
---|
127 | LOGICAL :: forcing_rico = .FALSE. |
---|
128 | LOGICAL :: forcing_radconv = .FALSE. |
---|
129 | LOGICAL :: forcing_toga = .FALSE. |
---|
130 | LOGICAL :: forcing_twpice = .FALSE. |
---|
131 | LOGICAL :: forcing_amma = .FALSE. |
---|
132 | LOGICAL :: forcing_dice = .FALSE. |
---|
133 | LOGICAL :: forcing_gabls4 = .FALSE. |
---|
134 | |
---|
135 | LOGICAL :: forcing_GCM2SCM = .FALSE. |
---|
136 | LOGICAL :: forcing_GCSSold = .FALSE. |
---|
137 | LOGICAL :: forcing_sandu = .FALSE. |
---|
138 | LOGICAL :: forcing_astex = .FALSE. |
---|
139 | LOGICAL :: forcing_fire = .FALSE. |
---|
140 | LOGICAL :: forcing_case = .FALSE. |
---|
141 | LOGICAL :: forcing_case2 = .FALSE. |
---|
142 | LOGICAL :: forcing_SCM = .FALSE. |
---|
143 | INTEGER :: type_ts_forcing ! 0 = SST constant; 1 = SST read from a file |
---|
144 | ! (cf read_tsurf1d.F) |
---|
145 | |
---|
146 | REAL wwww |
---|
147 | !vertical advection computation |
---|
148 | ! real d_t_z(llm), d_q_z(llm) |
---|
149 | ! real d_t_dyn_z(llm), dq_dyn_z(llm) |
---|
150 | ! real zz(llm) |
---|
151 | ! real zfact |
---|
152 | |
---|
153 | !flag forcings |
---|
154 | LOGICAL :: nudge_wind = .TRUE. |
---|
155 | LOGICAL :: nudge_thermo = .FALSE. |
---|
156 | LOGICAL :: cptadvw = .TRUE. |
---|
157 | !===================================================================== |
---|
158 | ! DECLARATIONS FOR EACH CASE |
---|
159 | !===================================================================== |
---|
160 | |
---|
161 | INCLUDE "old_1D_decl_cases.h" |
---|
162 | |
---|
163 | !--------------------------------------------------------------------- |
---|
164 | ! Declarations related to nudging |
---|
165 | !--------------------------------------------------------------------- |
---|
166 | INTEGER :: nudge_max |
---|
167 | parameter (nudge_max = 9) |
---|
168 | INTEGER :: inudge_RHT = 1 |
---|
169 | INTEGER :: inudge_UV = 2 |
---|
170 | LOGICAL :: nudge(nudge_max) |
---|
171 | REAL :: t_targ(llm) |
---|
172 | REAL :: rh_targ(llm) |
---|
173 | REAL :: u_targ(llm) |
---|
174 | REAL :: v_targ(llm) |
---|
175 | |
---|
176 | !--------------------------------------------------------------------- |
---|
177 | ! Declarations related to vertical discretization: |
---|
178 | !--------------------------------------------------------------------- |
---|
179 | REAL :: pzero = 1.e5 |
---|
180 | REAL :: play (llm), zlay (llm), sig_s(llm), plev(llm + 1) |
---|
181 | REAL :: playd(llm), zlayd(llm), ap_amma(llm + 1), bp_amma(llm + 1) |
---|
182 | |
---|
183 | !--------------------------------------------------------------------- |
---|
184 | ! Declarations related to variables |
---|
185 | !--------------------------------------------------------------------- |
---|
186 | |
---|
187 | REAL :: phi(llm) |
---|
188 | REAL :: teta(llm), tetal(llm), temp(llm), u(llm), v(llm), w(llm) |
---|
189 | REAL rot(1, llm) ! relative vorticity, in s-1 |
---|
190 | REAL :: rlat_rad(1), rlon_rad(1) |
---|
191 | REAL :: omega(llm + 1), omega2(llm), rho(llm + 1) |
---|
192 | REAL :: ug(llm), vg(llm), fcoriolis |
---|
193 | REAL :: sfdt, cfdt |
---|
194 | REAL :: du_phys(llm), dv_phys(llm), dt_phys(llm) |
---|
195 | REAL :: dt_dyn(llm) |
---|
196 | REAL :: dt_cooling(llm), d_t_adv(llm), d_t_nudge(llm) |
---|
197 | REAL :: d_u_nudge(llm), d_v_nudge(llm) |
---|
198 | REAL :: du_adv(llm), dv_adv(llm) |
---|
199 | REAL :: du_age(llm), dv_age(llm) |
---|
200 | REAL :: alpha |
---|
201 | REAL :: ttt |
---|
202 | |
---|
203 | REAL, ALLOCATABLE, DIMENSION(:, :) :: q |
---|
204 | REAL, ALLOCATABLE, DIMENSION(:, :) :: dq |
---|
205 | REAL, ALLOCATABLE, DIMENSION(:, :) :: dq_dyn |
---|
206 | REAL, ALLOCATABLE, DIMENSION(:, :) :: d_q_adv |
---|
207 | REAL, ALLOCATABLE, DIMENSION(:, :) :: d_q_nudge |
---|
208 | ! REAL, ALLOCATABLE, DIMENSION(:):: d_th_adv |
---|
209 | |
---|
210 | !--------------------------------------------------------------------- |
---|
211 | ! Initialization of surface variables |
---|
212 | !--------------------------------------------------------------------- |
---|
213 | REAL :: run_off_lic_0(1) |
---|
214 | REAL :: fder(1), snsrf(1, nbsrf), qsurfsrf(1, nbsrf) |
---|
215 | REAL :: tsoil(1, nsoilmx, nbsrf) |
---|
216 | ! REAL :: agesno(1,nbsrf) |
---|
217 | |
---|
218 | !--------------------------------------------------------------------- |
---|
219 | ! Call to phyredem |
---|
220 | !--------------------------------------------------------------------- |
---|
221 | LOGICAL :: ok_writedem = .TRUE. |
---|
222 | REAL :: sollw_in = 0. |
---|
223 | REAL :: solsw_in = 0. |
---|
224 | |
---|
225 | !--------------------------------------------------------------------- |
---|
226 | ! Call to physiq |
---|
227 | !--------------------------------------------------------------------- |
---|
228 | LOGICAL :: firstcall = .TRUE. |
---|
229 | LOGICAL :: lastcall = .FALSE. |
---|
230 | REAL :: phis(1) = 0.0 |
---|
231 | REAL :: dpsrf(1) |
---|
232 | |
---|
233 | !--------------------------------------------------------------------- |
---|
234 | ! Initializations of boundary conditions |
---|
235 | !--------------------------------------------------------------------- |
---|
236 | REAL, ALLOCATABLE :: phy_nat (:) ! 0=ocean libre,1=land,2=glacier,3=banquise |
---|
237 | REAL, ALLOCATABLE :: phy_alb (:) ! Albedo land only (old value condsurf_jyg=0.3) |
---|
238 | REAL, ALLOCATABLE :: phy_sst (:) ! SST (will not be used; cf read_tsurf1d.F) |
---|
239 | REAL, ALLOCATABLE :: phy_bil (:) ! Ne sert que pour les slab_ocean |
---|
240 | REAL, ALLOCATABLE :: phy_rug (:) ! Longueur rugosite utilisee sur land only |
---|
241 | REAL, ALLOCATABLE :: phy_ice (:) ! Fraction de glace |
---|
242 | REAL, ALLOCATABLE :: phy_fter(:) ! Fraction de terre |
---|
243 | REAL, ALLOCATABLE :: phy_foce(:) ! Fraction de ocean |
---|
244 | REAL, ALLOCATABLE :: phy_fsic(:) ! Fraction de glace |
---|
245 | REAL, ALLOCATABLE :: phy_flic(:) ! Fraction de glace |
---|
246 | |
---|
247 | !--------------------------------------------------------------------- |
---|
248 | ! Fichiers et d'autres variables |
---|
249 | !--------------------------------------------------------------------- |
---|
250 | INTEGER :: k, l, i, it = 1, mxcalc |
---|
251 | INTEGER :: nsrf |
---|
252 | INTEGER jcode |
---|
253 | INTEGER read_climoz |
---|
254 | |
---|
255 | INTEGER :: it_end ! iteration number of the last call |
---|
256 | !Al1 |
---|
257 | INTEGER ecrit_slab_oc !1=ecrit,-1=lit,0=no file |
---|
258 | data ecrit_slab_oc/-1/ |
---|
259 | |
---|
260 | ! if flag_inhib_forcing = 0, tendencies of forcing are added |
---|
261 | ! <> 0, tendencies of forcing are not added |
---|
262 | INTEGER :: flag_inhib_forcing = 0 |
---|
263 | |
---|
264 | !===================================================================== |
---|
265 | ! INITIALIZATIONS |
---|
266 | !===================================================================== |
---|
267 | du_phys(:) = 0. |
---|
268 | dv_phys(:) = 0. |
---|
269 | dt_phys(:) = 0. |
---|
270 | dt_dyn(:) = 0. |
---|
271 | dt_cooling(:) = 0. |
---|
272 | d_t_adv(:) = 0. |
---|
273 | d_t_nudge(:) = 0. |
---|
274 | d_u_nudge(:) = 0. |
---|
275 | d_v_nudge(:) = 0. |
---|
276 | du_adv(:) = 0. |
---|
277 | dv_adv(:) = 0. |
---|
278 | du_age(:) = 0. |
---|
279 | dv_age(:) = 0. |
---|
280 | |
---|
281 | ! Initialization of Common turb_forcing |
---|
282 | dtime_frcg = 0. |
---|
283 | Turb_fcg_gcssold = .FALSE. |
---|
284 | hthturb_gcssold = 0. |
---|
285 | hqturb_gcssold = 0. |
---|
286 | |
---|
287 | |
---|
288 | |
---|
289 | |
---|
290 | !--------------------------------------------------------------------- |
---|
291 | ! OPTIONS OF THE 1D SIMULATION (lmdz1d.def => unicol.def) |
---|
292 | !--------------------------------------------------------------------- |
---|
293 | !Al1 |
---|
294 | CALL conf_unicol |
---|
295 | !Al1 moves this gcssold var from common fcg_gcssold to |
---|
296 | Turb_fcg_gcssold = xTurb_fcg_gcssold |
---|
297 | ! -------------------------------------------------------------------- |
---|
298 | close(1) |
---|
299 | !Al1 |
---|
300 | WRITE(*, *) 'lmdz1d.def lu => unicol.def' |
---|
301 | |
---|
302 | ! forcing_type defines the way the SCM is forced: |
---|
303 | !forcing_type = 0 ==> forcing_les = .TRUE. |
---|
304 | ! initial profiles from file prof.inp.001 |
---|
305 | ! no forcing by LS convergence ; |
---|
306 | ! surface temperature imposed ; |
---|
307 | ! radiative cooling may be imposed (iflag_radia=0 in physiq.def) |
---|
308 | !forcing_type = 1 ==> forcing_radconv = .TRUE. |
---|
309 | ! idem forcing_type = 0, but the imposed radiative cooling |
---|
310 | ! is set to 0 (hence, if iflag_radia=0 in physiq.def, |
---|
311 | ! then there is no radiative cooling at all) |
---|
312 | !forcing_type = 2 ==> forcing_toga = .TRUE. |
---|
313 | ! initial profiles from TOGA-COARE IFA files |
---|
314 | ! LS convergence and SST imposed from TOGA-COARE IFA files |
---|
315 | !forcing_type = 3 ==> forcing_GCM2SCM = .TRUE. |
---|
316 | ! initial profiles from the GCM output |
---|
317 | ! LS convergence imposed from the GCM output |
---|
318 | !forcing_type = 4 ==> forcing_twpice = .TRUE. |
---|
319 | ! initial profiles from TWP-ICE cdf file |
---|
320 | ! LS convergence, omega and SST imposed from TWP-ICE files |
---|
321 | !forcing_type = 5 ==> forcing_rico = .TRUE. |
---|
322 | ! initial profiles from RICO files |
---|
323 | ! LS convergence imposed from RICO files |
---|
324 | !forcing_type = 6 ==> forcing_amma = .TRUE. |
---|
325 | ! initial profiles from AMMA nc file |
---|
326 | ! LS convergence, omega and surface fluxes imposed from AMMA file |
---|
327 | !forcing_type = 7 ==> forcing_dice = .TRUE. |
---|
328 | ! initial profiles and large scale forcings in dice_driver.nc |
---|
329 | ! Different stages: soil model alone, atm. model alone |
---|
330 | ! then both models coupled |
---|
331 | !forcing_type = 8 ==> forcing_gabls4 = .TRUE. |
---|
332 | ! initial profiles and large scale forcings in gabls4_driver.nc |
---|
333 | !forcing_type >= 100 ==> forcing_case = .TRUE. |
---|
334 | ! initial profiles and large scale forcings in cas.nc |
---|
335 | ! LS convergence, omega and SST imposed from CINDY-DYNAMO files |
---|
336 | ! 101=cindynamo |
---|
337 | ! 102=bomex |
---|
338 | !forcing_type >= 100 ==> forcing_case2 = .TRUE. |
---|
339 | ! temporary flag while all the 1D cases are not whith the same cas.nc forcing file |
---|
340 | ! 103=arm_cu2 ie arm_cu with new forcing format |
---|
341 | ! 104=rico2 ie rico with new forcing format |
---|
342 | !forcing_type = 40 ==> forcing_GCSSold = .TRUE. |
---|
343 | ! initial profile from GCSS file |
---|
344 | ! LS convergence imposed from GCSS file |
---|
345 | !forcing_type = 50 ==> forcing_fire = .TRUE. |
---|
346 | ! forcing from fire.nc |
---|
347 | !forcing_type = 59 ==> forcing_sandu = .TRUE. |
---|
348 | ! initial profiles from sanduref file: see prof.inp.001 |
---|
349 | ! SST varying with time and divergence constante: see ifa_sanduref.txt file |
---|
350 | ! Radiation has to be computed interactively |
---|
351 | !forcing_type = 60 ==> forcing_astex = .TRUE. |
---|
352 | ! initial profiles from file: see prof.inp.001 |
---|
353 | ! SST,divergence,ug,vg,ufa,vfa varying with time : see ifa_astex.txt file |
---|
354 | ! Radiation has to be computed interactively |
---|
355 | !forcing_type = 61 ==> forcing_armcu = .TRUE. |
---|
356 | ! initial profiles from file: see prof.inp.001 |
---|
357 | ! sensible and latent heat flux imposed: see ifa_arm_cu_1.txt |
---|
358 | ! large scale advective forcing & radiative tendencies applied below 1000m: see ifa_arm_cu_2.txt |
---|
359 | ! use geostrophic wind ug=10m/s vg=0m/s. Duration of the case 53100s |
---|
360 | ! Radiation to be switched off |
---|
361 | |
---|
362 | IF (forcing_type <=0) THEN |
---|
363 | forcing_les = .TRUE. |
---|
364 | elseif (forcing_type ==1) THEN |
---|
365 | forcing_radconv = .TRUE. |
---|
366 | elseif (forcing_type ==2) THEN |
---|
367 | forcing_toga = .TRUE. |
---|
368 | elseif (forcing_type ==3) THEN |
---|
369 | forcing_GCM2SCM = .TRUE. |
---|
370 | elseif (forcing_type ==4) THEN |
---|
371 | forcing_twpice = .TRUE. |
---|
372 | elseif (forcing_type ==5) THEN |
---|
373 | forcing_rico = .TRUE. |
---|
374 | elseif (forcing_type ==6) THEN |
---|
375 | forcing_amma = .TRUE. |
---|
376 | elseif (forcing_type ==7) THEN |
---|
377 | forcing_dice = .TRUE. |
---|
378 | elseif (forcing_type ==8) THEN |
---|
379 | forcing_gabls4 = .TRUE. |
---|
380 | elseif (forcing_type ==101) THEN ! Cindynamo starts 1-10-2011 0h |
---|
381 | forcing_case = .TRUE. |
---|
382 | year_ini_cas = 2011 |
---|
383 | mth_ini_cas = 10 |
---|
384 | day_deb = 1 |
---|
385 | heure_ini_cas = 0. |
---|
386 | pdt_cas = 3 * 3600. ! forcing frequency |
---|
387 | elseif (forcing_type ==102) THEN ! Bomex starts 24-6-1969 0h |
---|
388 | forcing_case = .TRUE. |
---|
389 | year_ini_cas = 1969 |
---|
390 | mth_ini_cas = 6 |
---|
391 | day_deb = 24 |
---|
392 | heure_ini_cas = 0. |
---|
393 | pdt_cas = 1800. ! forcing frequency |
---|
394 | elseif (forcing_type ==103) THEN ! Arm_cu starts 21-6-1997 11h30 |
---|
395 | forcing_case2 = .TRUE. |
---|
396 | year_ini_cas = 1997 |
---|
397 | mth_ini_cas = 6 |
---|
398 | day_deb = 21 |
---|
399 | heure_ini_cas = 11.5 |
---|
400 | pdt_cas = 1800. ! forcing frequency |
---|
401 | elseif (forcing_type ==104) THEN ! rico starts 16-12-2004 0h |
---|
402 | forcing_case2 = .TRUE. |
---|
403 | year_ini_cas = 2004 |
---|
404 | mth_ini_cas = 12 |
---|
405 | day_deb = 16 |
---|
406 | heure_ini_cas = 0. |
---|
407 | pdt_cas = 1800. ! forcing frequency |
---|
408 | elseif (forcing_type ==105) THEN ! bomex starts 16-12-2004 0h |
---|
409 | forcing_case2 = .TRUE. |
---|
410 | year_ini_cas = 1969 |
---|
411 | mth_ini_cas = 6 |
---|
412 | day_deb = 24 |
---|
413 | heure_ini_cas = 0. |
---|
414 | pdt_cas = 1800. ! forcing frequency |
---|
415 | elseif (forcing_type ==106) THEN ! ayotte_24SC starts 6-11-1992 0h |
---|
416 | forcing_case2 = .TRUE. |
---|
417 | year_ini_cas = 1992 |
---|
418 | mth_ini_cas = 11 |
---|
419 | day_deb = 6 |
---|
420 | heure_ini_cas = 10. |
---|
421 | pdt_cas = 86400. ! forcing frequency |
---|
422 | elseif (forcing_type ==113) THEN ! Arm_cu starts 21-6-1997 11h30 |
---|
423 | forcing_SCM = .TRUE. |
---|
424 | year_ini_cas = 1997 |
---|
425 | ! It is possible that those parameters are run twice. |
---|
426 | CALL getin('anneeref', year_ini_cas) |
---|
427 | CALL getin('dayref', day_deb) |
---|
428 | mth_ini_cas = 1 ! pour le moment on compte depuis le debut de l'annee |
---|
429 | CALL getin('time_ini', heure_ini_cas) |
---|
430 | elseif (forcing_type ==40) THEN |
---|
431 | forcing_GCSSold = .TRUE. |
---|
432 | elseif (forcing_type ==50) THEN |
---|
433 | forcing_fire = .TRUE. |
---|
434 | elseif (forcing_type ==59) THEN |
---|
435 | forcing_sandu = .TRUE. |
---|
436 | elseif (forcing_type ==60) THEN |
---|
437 | forcing_astex = .TRUE. |
---|
438 | elseif (forcing_type ==61) THEN |
---|
439 | forcing_armcu = .TRUE. |
---|
440 | IF(llm/=19.AND.llm/=40) stop 'Erreur nombre de niveaux !!' |
---|
441 | else |
---|
442 | write (*, *) 'ERROR : unknown forcing_type ', forcing_type |
---|
443 | stop 'Forcing_type should be 0,1,2,3,4,5,6 or 40,59,60,61' |
---|
444 | ENDIF |
---|
445 | PRINT*, "forcing type=", forcing_type |
---|
446 | |
---|
447 | ! if type_ts_forcing=0, the surface temp of 1D simulation is constant in time |
---|
448 | ! (specified by tsurf in lmdz1d.def); if type_ts_forcing=1, the surface temperature |
---|
449 | ! varies in time according to a forcing (e.g. forcing_toga) and is passed to read_tsurf1d.F |
---|
450 | ! through the common sst_forcing. |
---|
451 | |
---|
452 | type_ts_forcing = 0 |
---|
453 | IF (forcing_toga.OR.forcing_sandu.OR.forcing_astex .OR. forcing_dice) & |
---|
454 | type_ts_forcing = 1 |
---|
455 | |
---|
456 | ! Initialization of the LOGICAL switch for nudging |
---|
457 | jcode = iflag_nudge |
---|
458 | DO i = 1, nudge_max |
---|
459 | nudge(i) = mod(jcode, 10) >= 1 |
---|
460 | jcode = jcode / 10 |
---|
461 | enddo |
---|
462 | !--------------------------------------------------------------------- |
---|
463 | ! Definition of the run |
---|
464 | !--------------------------------------------------------------------- |
---|
465 | |
---|
466 | CALL conf_gcm(99, .TRUE.) |
---|
467 | |
---|
468 | !----------------------------------------------------------------------- |
---|
469 | allocate(phy_nat (year_len)) ! 0=ocean libre,1=land,2=glacier,3=banquise |
---|
470 | phy_nat(:) = 0.0 |
---|
471 | allocate(phy_alb (year_len)) ! Albedo land only (old value condsurf_jyg=0.3) |
---|
472 | allocate(phy_sst (year_len)) ! SST (will not be used; cf read_tsurf1d.F) |
---|
473 | allocate(phy_bil (year_len)) ! Ne sert que pour les slab_ocean |
---|
474 | phy_bil(:) = 1.0 |
---|
475 | allocate(phy_rug (year_len)) ! Longueur rugosite utilisee sur land only |
---|
476 | allocate(phy_ice (year_len)) ! Fraction de glace |
---|
477 | phy_ice(:) = 0.0 |
---|
478 | allocate(phy_fter(year_len)) ! Fraction de terre |
---|
479 | phy_fter(:) = 0.0 |
---|
480 | allocate(phy_foce(year_len)) ! Fraction de ocean |
---|
481 | phy_foce(:) = 0.0 |
---|
482 | allocate(phy_fsic(year_len)) ! Fraction de glace |
---|
483 | phy_fsic(:) = 0.0 |
---|
484 | allocate(phy_flic(year_len)) ! Fraction de glace |
---|
485 | phy_flic(:) = 0.0 |
---|
486 | !----------------------------------------------------------------------- |
---|
487 | ! Choix du calendrier |
---|
488 | ! ------------------- |
---|
489 | |
---|
490 | ! calend = 'earth_365d' |
---|
491 | IF (calend == 'earth_360d') THEN |
---|
492 | CALL ioconf_calendar('360_day') |
---|
493 | WRITE(*, *)'CALENDRIER CHOISI: Terrestre a 360 jours/an' |
---|
494 | ELSE IF (calend == 'earth_365d') THEN |
---|
495 | CALL ioconf_calendar('noleap') |
---|
496 | WRITE(*, *)'CALENDRIER CHOISI: Terrestre a 365 jours/an' |
---|
497 | ELSE IF (calend == 'earth_366d') THEN |
---|
498 | CALL ioconf_calendar('all_leap') |
---|
499 | WRITE(*, *)'CALENDRIER CHOISI: Terrestre bissextile' |
---|
500 | ELSE IF (calend == 'gregorian') THEN |
---|
501 | stop 'gregorian calend should not be used by normal user' |
---|
502 | CALL ioconf_calendar('gregorian') ! not to be used by normal users |
---|
503 | WRITE(*, *)'CALENDRIER CHOISI: Gregorien' |
---|
504 | else |
---|
505 | write (*, *) 'ERROR : unknown calendar ', calend |
---|
506 | stop 'calend should be 360d,earth_365d,earth_366d,gregorian' |
---|
507 | endif |
---|
508 | !----------------------------------------------------------------------- |
---|
509 | |
---|
510 | !c Date : |
---|
511 | ! La date est supposee donnee sous la forme [annee, numero du jour dans |
---|
512 | ! l annee] ; l heure est donnee dans time_ini, lu dans lmdz1d.def. |
---|
513 | ! On appelle ymds2ju pour convertir [annee, jour] en [jour Julien]. |
---|
514 | ! Le numero du jour est dans "day". L heure est traitee separement. |
---|
515 | ! La date complete est dans "daytime" (l'unite est le jour). |
---|
516 | IF (nday>0) THEN |
---|
517 | fnday = nday |
---|
518 | else |
---|
519 | fnday = -nday / float(day_step) |
---|
520 | endif |
---|
521 | print *, 'fnday=', fnday |
---|
522 | ! start_time doit etre en FRACTION DE JOUR |
---|
523 | start_time = time_ini / 24. |
---|
524 | |
---|
525 | ! Special case for arm_cu which lasts less than one day : 53100s !! (MPL 20111026) |
---|
526 | IF(forcing_type == 61) fnday = 53100. / 86400. |
---|
527 | IF(forcing_type == 103) fnday = 53100. / 86400. |
---|
528 | ! Special case for amma which lasts less than one day : 64800s !! (MPL 20120216) |
---|
529 | IF(forcing_type == 6) fnday = 64800. / 86400. |
---|
530 | ! IF(forcing_type .EQ. 6) fnday=50400./86400. |
---|
531 | IF(forcing_type == 8) fnday = 129600. / 86400. |
---|
532 | annee_ref = anneeref |
---|
533 | mois = 1 |
---|
534 | day_ref = dayref |
---|
535 | heure = 0. |
---|
536 | itau_dyn = 0 |
---|
537 | itau_phy = 0 |
---|
538 | CALL ymds2ju(annee_ref, mois, day_ref, heure, day) |
---|
539 | day_ini = int(day) |
---|
540 | day_end = day_ini + int(fnday) |
---|
541 | |
---|
542 | IF (forcing_type ==2) THEN |
---|
543 | ! Convert the initial date of Toga-Coare to Julian day |
---|
544 | CALL ymds2ju & |
---|
545 | (year_ini_toga, mth_ini_toga, day_ini_toga, heure, day_ju_ini_toga) |
---|
546 | |
---|
547 | ELSEIF (forcing_type ==4) THEN |
---|
548 | ! Convert the initial date of TWPICE to Julian day |
---|
549 | CALL ymds2ju & |
---|
550 | (year_ini_twpi, mth_ini_twpi, day_ini_twpi, heure_ini_twpi & |
---|
551 | , day_ju_ini_twpi) |
---|
552 | ELSEIF (forcing_type ==6) THEN |
---|
553 | ! Convert the initial date of AMMA to Julian day |
---|
554 | CALL ymds2ju & |
---|
555 | (year_ini_amma, mth_ini_amma, day_ini_amma, heure_ini_amma & |
---|
556 | , day_ju_ini_amma) |
---|
557 | ELSEIF (forcing_type ==7) THEN |
---|
558 | ! Convert the initial date of DICE to Julian day |
---|
559 | CALL ymds2ju & |
---|
560 | (year_ini_dice, mth_ini_dice, day_ini_dice, heure_ini_dice & |
---|
561 | , day_ju_ini_dice) |
---|
562 | ELSEIF (forcing_type ==8) THEN |
---|
563 | ! Convert the initial date of GABLS4 to Julian day |
---|
564 | CALL ymds2ju & |
---|
565 | (year_ini_gabls4, mth_ini_gabls4, day_ini_gabls4, heure_ini_gabls4 & |
---|
566 | , day_ju_ini_gabls4) |
---|
567 | ELSEIF (forcing_type >100) THEN |
---|
568 | ! Convert the initial date to Julian day |
---|
569 | day_ini_cas = day_deb |
---|
570 | PRINT*, 'time case', year_ini_cas, mth_ini_cas, day_ini_cas |
---|
571 | CALL ymds2ju & |
---|
572 | (year_ini_cas, mth_ini_cas, day_ini_cas, heure_ini_cas * 3600 & |
---|
573 | , day_ju_ini_cas) |
---|
574 | PRINT*, 'time case 2', day_ini_cas, day_ju_ini_cas |
---|
575 | ELSEIF (forcing_type ==59) THEN |
---|
576 | ! Convert the initial date of Sandu case to Julian day |
---|
577 | CALL ymds2ju & |
---|
578 | (year_ini_sandu, mth_ini_sandu, day_ini_sandu, & |
---|
579 | time_ini * 3600., day_ju_ini_sandu) |
---|
580 | |
---|
581 | ELSEIF (forcing_type ==60) THEN |
---|
582 | ! Convert the initial date of Astex case to Julian day |
---|
583 | CALL ymds2ju & |
---|
584 | (year_ini_astex, mth_ini_astex, day_ini_astex, & |
---|
585 | time_ini * 3600., day_ju_ini_astex) |
---|
586 | |
---|
587 | ELSEIF (forcing_type ==61) THEN |
---|
588 | ! Convert the initial date of Arm_cu case to Julian day |
---|
589 | CALL ymds2ju & |
---|
590 | (year_ini_armcu, mth_ini_armcu, day_ini_armcu, heure_ini_armcu & |
---|
591 | , day_ju_ini_armcu) |
---|
592 | ENDIF |
---|
593 | |
---|
594 | IF (forcing_type >100) THEN |
---|
595 | daytime = day + heure_ini_cas / 24. ! 1st day and initial time of the simulation |
---|
596 | ELSE |
---|
597 | daytime = day + time_ini / 24. ! 1st day and initial time of the simulation |
---|
598 | ENDIF |
---|
599 | ! Print out the actual date of the beginning of the simulation : |
---|
600 | CALL ju2ymds(daytime, year_print, month_print, day_print, sec_print) |
---|
601 | print *, ' Time of beginning : ', & |
---|
602 | year_print, month_print, day_print, sec_print |
---|
603 | |
---|
604 | !--------------------------------------------------------------------- |
---|
605 | ! Initialization of dimensions, geometry and initial state |
---|
606 | !--------------------------------------------------------------------- |
---|
607 | ! CALL init_phys_lmdz(1,1,llm,1,(/1/)) ! job now done via iniphysiq |
---|
608 | ! but we still need to initialize dimphy module (klon,klev,etc.) here. |
---|
609 | CALL init_dimphy1D(1, llm) |
---|
610 | CALL suphel |
---|
611 | CALL init_infotrac |
---|
612 | |
---|
613 | IF (nqtot>nqmx) STOP 'Augmenter nqmx dans lmdz1d.F' |
---|
614 | allocate(q(llm, nqtot)) ; q(:, :) = 0. |
---|
615 | allocate(dq(llm, nqtot)) |
---|
616 | allocate(dq_dyn(llm, nqtot)) |
---|
617 | allocate(d_q_adv(llm, nqtot)) |
---|
618 | allocate(d_q_nudge(llm, nqtot)) |
---|
619 | ! allocate(d_th_adv(llm)) |
---|
620 | |
---|
621 | q(:, :) = 0. |
---|
622 | dq(:, :) = 0. |
---|
623 | dq_dyn(:, :) = 0. |
---|
624 | d_q_adv(:, :) = 0. |
---|
625 | d_q_nudge(:, :) = 0. |
---|
626 | |
---|
627 | ! No ozone climatology need be read in this pre-initialization |
---|
628 | ! (phys_state_var_init is called again in physiq) |
---|
629 | read_climoz = 0 |
---|
630 | nsw = 6 ! EV et LF: sinon, falb_dir et falb_dif ne peuvent etre alloues |
---|
631 | |
---|
632 | CALL phys_state_var_init(read_climoz) |
---|
633 | |
---|
634 | IF (ngrid/=klon) THEN |
---|
635 | PRINT*, 'stop in inifis' |
---|
636 | PRINT*, 'Probleme de dimensions :' |
---|
637 | PRINT*, 'ngrid = ', ngrid |
---|
638 | PRINT*, 'klon = ', klon |
---|
639 | stop |
---|
640 | endif |
---|
641 | !!!===================================================================== |
---|
642 | !!! Feedback forcing values for Gateaux differentiation (al1) |
---|
643 | !!!===================================================================== |
---|
644 | !!! Surface Planck forcing bracketing CALL radiation |
---|
645 | !! surf_Planck = 0. |
---|
646 | !! surf_Conv = 0. |
---|
647 | !! WRITE(*,*) 'Gateaux-dif Planck,Conv:',surf_Planck,surf_Conv |
---|
648 | !!! a mettre dans le lmdz1d.def ou autre |
---|
649 | !! |
---|
650 | !! |
---|
651 | qsol = qsolinp |
---|
652 | qsurf = fq_sat(tsurf, psurf / 100.) |
---|
653 | beta_surf = 1. |
---|
654 | beta_aridity(:, :) = beta_surf |
---|
655 | day1 = day_ini |
---|
656 | time = daytime - day |
---|
657 | ts_toga(1) = tsurf ! needed by read_tsurf1d.F |
---|
658 | rho(1) = psurf / (rd * tsurf * (1. + (rv / rd - 1.) * qsurf)) |
---|
659 | |
---|
660 | !! mpl et jyg le 22/08/2012 : |
---|
661 | !! pour que les cas a flux de surface imposes marchent |
---|
662 | IF(.NOT.ok_flux_surf.OR.max(abs(wtsurf), abs(wqsurf))>0.) THEN |
---|
663 | fsens = -wtsurf * rcpd * rho(1) |
---|
664 | flat = -wqsurf * rlvtt * rho(1) |
---|
665 | print *, 'Flux: ok_flux wtsurf wqsurf', ok_flux_surf, wtsurf, wqsurf |
---|
666 | ENDIF |
---|
667 | PRINT*, 'Flux sol ', fsens, flat |
---|
668 | !! ok_flux_surf=.FALSE. |
---|
669 | !! fsens=-wtsurf*rcpd*rho(1) |
---|
670 | !! flat=-wqsurf*rlvtt*rho(1) |
---|
671 | !!!! |
---|
672 | |
---|
673 | ! Vertical discretization and pressure levels at half and mid levels: |
---|
674 | |
---|
675 | pa = 5e4 |
---|
676 | !! preff= 1.01325e5 |
---|
677 | preff = psurf |
---|
678 | IF (ok_old_disvert) THEN |
---|
679 | CALL disvert0(pa, preff, ap, bp, dpres, presnivs, nivsigs, nivsig) |
---|
680 | print *, 'On utilise disvert0' |
---|
681 | aps(1:llm) = 0.5 * (ap(1:llm) + ap(2:llm + 1)) |
---|
682 | bps(1:llm) = 0.5 * (bp(1:llm) + bp(2:llm + 1)) |
---|
683 | scaleheight = 8. |
---|
684 | pseudoalt(1:llm) = -scaleheight * log(presnivs(1:llm) / preff) |
---|
685 | ELSE |
---|
686 | CALL disvert() |
---|
687 | print *, 'On utilise disvert' |
---|
688 | ! Nouvelle version disvert permettant d imposer ap,bp (modif L.Guez) MPL 18092012 |
---|
689 | ! Dans ce cas, on lit ap,bp dans le fichier hybrid.txt |
---|
690 | ENDIF |
---|
691 | |
---|
692 | sig_s = presnivs / preff |
---|
693 | plev = ap + bp * psurf |
---|
694 | play = 0.5 * (plev(1:llm) + plev(2:llm + 1)) |
---|
695 | zlay = -rd * 300. * log(play / psurf) / rg ! moved after reading profiles |
---|
696 | |
---|
697 | IF (forcing_type == 59) THEN |
---|
698 | ! pour forcing_sandu, on cherche l'indice le plus proche de 700hpa#3000m |
---|
699 | WRITE(*, *) '***********************' |
---|
700 | DO l = 1, llm |
---|
701 | WRITE(*, *) 'l,play(l),presnivs(l): ', l, play(l), presnivs(l) |
---|
702 | IF (trouve_700 .AND. play(l)<=70000) THEN |
---|
703 | llm700 = l |
---|
704 | print *, 'llm700,play=', llm700, play(l) / 100. |
---|
705 | trouve_700 = .FALSE. |
---|
706 | endif |
---|
707 | enddo |
---|
708 | WRITE(*, *) '***********************' |
---|
709 | ENDIF |
---|
710 | |
---|
711 | !===================================================================== |
---|
712 | ! EVENTUALLY, READ FORCING DATA : |
---|
713 | !===================================================================== |
---|
714 | |
---|
715 | INCLUDE "old_1D_read_forc_cases.h" |
---|
716 | |
---|
717 | IF (forcing_GCM2SCM) THEN |
---|
718 | write (*, *) 'forcing_GCM2SCM not yet implemented' |
---|
719 | stop 'in initialization' |
---|
720 | END IF ! forcing_GCM2SCM |
---|
721 | |
---|
722 | PRINT*, 'mxcalc=', mxcalc |
---|
723 | ! PRINT*,'zlay=',zlay(mxcalc) |
---|
724 | PRINT*, 'play=', play(mxcalc) |
---|
725 | |
---|
726 | !Al1 pour SST forced, appell?? depuis ocean_forced_noice |
---|
727 | ! EV tg instead of ts_cur |
---|
728 | |
---|
729 | tg = tsurf ! SST used in read_tsurf1d |
---|
730 | !===================================================================== |
---|
731 | ! Initialisation de la physique : |
---|
732 | !===================================================================== |
---|
733 | |
---|
734 | ! Rq: conf_phys.F90 lit tous les flags de physiq.def; conf_phys appele depuis physiq.F |
---|
735 | |
---|
736 | ! day_step, iphysiq lus dans gcm.def ci-dessus |
---|
737 | ! timestep: calcule ci-dessous from rday et day_step |
---|
738 | ! ngrid=1 |
---|
739 | ! llm: defini dans .../modipsl/modeles/LMDZ4/libf/grid/dimension |
---|
740 | ! rday: defini dans suphel.F (86400.) |
---|
741 | ! day_ini: lu dans run.def (dayref) |
---|
742 | ! rlat_rad,rlon-rad: transformes en radian de rlat,rlon lus dans lmdz1d.def (en degres) |
---|
743 | ! airefi,zcufi,zcvfi initialises au debut de ce programme |
---|
744 | ! rday,ra,rg,rd,rcpd declares dans YOMCST.h et calcules dans suphel.F |
---|
745 | day_step = float(nsplit_phys) * day_step / float(iphysiq) |
---|
746 | write (*, *) 'Time step divided by nsplit_phys (=', nsplit_phys, ')' |
---|
747 | timestep = rday / day_step |
---|
748 | dtime_frcg = timestep |
---|
749 | |
---|
750 | zcufi = airefi |
---|
751 | zcvfi = airefi |
---|
752 | |
---|
753 | rlat_rad(1) = xlat * rpi / 180. |
---|
754 | rlon_rad(1) = xlon * rpi / 180. |
---|
755 | |
---|
756 | ! iniphysiq will CALL iniaqua who needs year_len from phys_cal_mod |
---|
757 | year_len_phys_cal_mod = year_len |
---|
758 | |
---|
759 | ! Ehouarn: iniphysiq requires arrays related to (3D) dynamics grid, |
---|
760 | ! e.g. for cell boundaries, which are meaningless in 1D; so pad these |
---|
761 | ! with '0.' when necessary |
---|
762 | CALL iniphysiq(iim, jjm, llm, & |
---|
763 | 1, comm_lmdz, & |
---|
764 | rday, day_ini, timestep, & |
---|
765 | (/rlat_rad(1), 0./), (/0./), & |
---|
766 | (/0., 0./), (/rlon_rad(1), 0./), & |
---|
767 | (/ (/airefi, 0./), (/0., 0./) /), & |
---|
768 | (/zcufi, 0., 0., 0./), & |
---|
769 | (/zcvfi, 0./), & |
---|
770 | ra, rg, rd, rcpd, 1) |
---|
771 | PRINT*, 'apres iniphysiq' |
---|
772 | |
---|
773 | ! 2 PARAMETRES QUI DEVRAIENT ETRE LUS DANS run.def MAIS NE LE SONT PAS ICI: |
---|
774 | co2_ppm = 330.0 |
---|
775 | solaire = 1370.0 |
---|
776 | |
---|
777 | ! Ecriture du startphy avant le premier appel a la physique. |
---|
778 | ! On le met juste avant pour avoir acces a tous les champs |
---|
779 | |
---|
780 | IF (ok_writedem) THEN |
---|
781 | !-------------------------------------------------------------------------- |
---|
782 | ! pbl_surface_init (called here) and pbl_surface_final (called by phyredem) |
---|
783 | ! need : qsol fder snow qsurf evap rugos agesno ftsoil |
---|
784 | !-------------------------------------------------------------------------- |
---|
785 | |
---|
786 | type_ocean = "force" |
---|
787 | run_off_lic_0(1) = restart_runoff |
---|
788 | CALL fonte_neige_init(run_off_lic_0) |
---|
789 | |
---|
790 | fder = 0. |
---|
791 | snsrf(1, :) = snowmass ! masse de neige des sous surface |
---|
792 | print *, 'snsrf', snsrf |
---|
793 | qsurfsrf(1, :) = qsurf ! humidite de l'air des sous surface |
---|
794 | fevap = 0. |
---|
795 | z0m(1, :) = rugos ! couverture de neige des sous surface |
---|
796 | z0h(1, :) = rugosh ! couverture de neige des sous surface |
---|
797 | agesno = xagesno |
---|
798 | tsoil(:, :, :) = tsurf |
---|
799 | !------ AMMA 2e run avec modele sol et rayonnement actif (MPL 23052012) |
---|
800 | ! tsoil(1,1,1)=299.18 |
---|
801 | ! tsoil(1,2,1)=300.08 |
---|
802 | ! tsoil(1,3,1)=301.88 |
---|
803 | ! tsoil(1,4,1)=305.48 |
---|
804 | ! tsoil(1,5,1)=308.00 |
---|
805 | ! tsoil(1,6,1)=308.00 |
---|
806 | ! tsoil(1,7,1)=308.00 |
---|
807 | ! tsoil(1,8,1)=308.00 |
---|
808 | ! tsoil(1,9,1)=308.00 |
---|
809 | ! tsoil(1,10,1)=308.00 |
---|
810 | ! tsoil(1,11,1)=308.00 |
---|
811 | !----------------------------------------------------------------------- |
---|
812 | CALL pbl_surface_init(fder, snsrf, qsurfsrf, tsoil) |
---|
813 | |
---|
814 | !------------------ prepare limit conditions for limit.nc ----------------- |
---|
815 | !-- Ocean force |
---|
816 | |
---|
817 | PRINT*, 'avant phyredem' |
---|
818 | pctsrf(1, :) = 0. |
---|
819 | IF (nat_surf==0.) THEN |
---|
820 | pctsrf(1, is_oce) = 1. |
---|
821 | pctsrf(1, is_ter) = 0. |
---|
822 | pctsrf(1, is_lic) = 0. |
---|
823 | pctsrf(1, is_sic) = 0. |
---|
824 | ELSE IF (nat_surf == 1) THEN |
---|
825 | pctsrf(1, is_oce) = 0. |
---|
826 | pctsrf(1, is_ter) = 1. |
---|
827 | pctsrf(1, is_lic) = 0. |
---|
828 | pctsrf(1, is_sic) = 0. |
---|
829 | ELSE IF (nat_surf == 2) THEN |
---|
830 | pctsrf(1, is_oce) = 0. |
---|
831 | pctsrf(1, is_ter) = 0. |
---|
832 | pctsrf(1, is_lic) = 1. |
---|
833 | pctsrf(1, is_sic) = 0. |
---|
834 | ELSE IF (nat_surf == 3) THEN |
---|
835 | pctsrf(1, is_oce) = 0. |
---|
836 | pctsrf(1, is_ter) = 0. |
---|
837 | pctsrf(1, is_lic) = 0. |
---|
838 | pctsrf(1, is_sic) = 1. |
---|
839 | |
---|
840 | end if |
---|
841 | |
---|
842 | PRINT*, 'nat_surf,pctsrf(1,is_oce),pctsrf(1,is_ter)', nat_surf & |
---|
843 | , pctsrf(1, is_oce), pctsrf(1, is_ter) |
---|
844 | |
---|
845 | zmasq = pctsrf(1, is_ter) + pctsrf(1, is_lic) |
---|
846 | zpic = zpicinp |
---|
847 | ftsol = tsurf |
---|
848 | falb_dir = albedo |
---|
849 | falb_dif = albedo |
---|
850 | rugoro = rugos |
---|
851 | t_ancien(1, :) = temp(:) |
---|
852 | q_ancien(1, :) = q(:, 1) |
---|
853 | ql_ancien = 0. |
---|
854 | qs_ancien = 0. |
---|
855 | prlw_ancien = 0. |
---|
856 | prsw_ancien = 0. |
---|
857 | prw_ancien = 0. |
---|
858 | !jyg< |
---|
859 | !! pbl_tke(:,:,:)=1.e-8 |
---|
860 | pbl_tke(:, :, :) = 0. |
---|
861 | pbl_tke(:, 2, :) = 1.e-2 |
---|
862 | PRINT *, ' pbl_tke dans lmdz1d ' |
---|
863 | IF (prt_level >= 5) THEN |
---|
864 | DO nsrf = 1, 4 |
---|
865 | PRINT *, 'pbl_tke(1,:,', nsrf, ') ', pbl_tke(1, :, nsrf) |
---|
866 | ENDDO |
---|
867 | end if |
---|
868 | |
---|
869 | !>jyg |
---|
870 | |
---|
871 | rain_fall = 0. |
---|
872 | snow_fall = 0. |
---|
873 | solsw = 0. |
---|
874 | solswfdiff = 0. |
---|
875 | sollw = 0. |
---|
876 | sollwdown = rsigma * tsurf**4 |
---|
877 | radsol = 0. |
---|
878 | rnebcon = 0. |
---|
879 | ratqs = 0. |
---|
880 | clwcon = 0. |
---|
881 | zmax0 = 0. |
---|
882 | zmea = zsurf |
---|
883 | zstd = 0. |
---|
884 | zsig = 0. |
---|
885 | zgam = 0. |
---|
886 | zval = 0. |
---|
887 | zthe = 0. |
---|
888 | sig1 = 0. |
---|
889 | w01 = 0. |
---|
890 | |
---|
891 | wake_deltaq = 0. |
---|
892 | wake_deltat = 0. |
---|
893 | wake_delta_pbl_TKE(:, :, :) = 0. |
---|
894 | delta_tsurf = 0. |
---|
895 | wake_fip = 0. |
---|
896 | wake_pe = 0. |
---|
897 | wake_s = 0. |
---|
898 | awake_s = 0. |
---|
899 | wake_dens = 0. |
---|
900 | awake_dens = 0. |
---|
901 | cv_gen = 0. |
---|
902 | wake_cstar = 0. |
---|
903 | ale_bl = 0. |
---|
904 | ale_bl_trig = 0. |
---|
905 | alp_bl = 0. |
---|
906 | IF (ALLOCATED(du_gwd_rando)) du_gwd_rando = 0. |
---|
907 | IF (ALLOCATED(du_gwd_front)) du_gwd_front = 0. |
---|
908 | entr_therm = 0. |
---|
909 | detr_therm = 0. |
---|
910 | f0 = 0. |
---|
911 | fm_therm = 0. |
---|
912 | u_ancien(1, :) = u(:) |
---|
913 | v_ancien(1, :) = v(:) |
---|
914 | rneb_ancien(1, :) = 0. |
---|
915 | |
---|
916 | u10m = 0. |
---|
917 | v10m = 0. |
---|
918 | ale_wake = 0. |
---|
919 | ale_bl_stat = 0. |
---|
920 | |
---|
921 | !------------------------------------------------------------------------ |
---|
922 | ! Make file containing restart for the physics (startphy.nc) |
---|
923 | |
---|
924 | ! NB: List of the variables to be written by phyredem (via put_field): |
---|
925 | ! rlon,rlat,zmasq,pctsrf(:,is_ter),pctsrf(:,is_lic),pctsrf(:,is_oce) |
---|
926 | ! pctsrf(:,is_sic),ftsol(:,nsrf),tsoil(:,isoil,nsrf),qsurf(:,nsrf) |
---|
927 | ! qsol,falb_dir(:,nsrf),falb_dif(:,nsrf),evap(:,nsrf),snow(:,nsrf) |
---|
928 | ! radsol,solsw,solswfdiff,sollw, sollwdown,fder,rain_fall,snow_fall,frugs(:,nsrf) |
---|
929 | ! agesno(:,nsrf),zmea,zstd,zsig,zgam,zthe,zpic,zval,rugoro |
---|
930 | ! t_ancien,q_ancien,,frugs(:,is_oce),clwcon(:,1),rnebcon(:,1),ratqs(:,1) |
---|
931 | ! run_off_lic_0,pbl_tke(:,1:klev,nsrf), zmax0,f0,sig1,w01 |
---|
932 | ! wake_deltat,wake_deltaq,wake_s,awake_s,wake_dens,awake_dens,cv_gen,wake_cstar, |
---|
933 | ! wake_fip,wake_delta_pbl_tke(:,1:klev,nsrf) |
---|
934 | |
---|
935 | ! NB2: The content of the startphy.nc file depends on some flags defined in |
---|
936 | ! the ".def" files. However, since conf_phys is not called in lmdz1d.F90, these flags have |
---|
937 | ! to be set at some arbitratry convenient values. |
---|
938 | !------------------------------------------------------------------------ |
---|
939 | !Al1 =============== restart option ========================== |
---|
940 | iflag_physiq = 0 |
---|
941 | CALL getin('iflag_physiq', iflag_physiq) |
---|
942 | |
---|
943 | IF (.NOT.restart) THEN |
---|
944 | iflag_pbl = 5 |
---|
945 | CALL phyredem ("startphy.nc") |
---|
946 | else |
---|
947 | ! (desallocations) |
---|
948 | PRINT*, 'callin surf final' |
---|
949 | CALL pbl_surface_final(fder, snsrf, qsurfsrf, tsoil) |
---|
950 | PRINT*, 'after surf final' |
---|
951 | CALL fonte_neige_final(run_off_lic_0) |
---|
952 | endif |
---|
953 | |
---|
954 | ok_writedem = .FALSE. |
---|
955 | PRINT*, 'apres phyredem' |
---|
956 | |
---|
957 | END IF ! ok_writedem |
---|
958 | |
---|
959 | !------------------------------------------------------------------------ |
---|
960 | ! Make file containing boundary conditions (limit.nc) **Al1->restartdyn*** |
---|
961 | ! -------------------------------------------------- |
---|
962 | ! NB: List of the variables to be written in limit.nc |
---|
963 | ! (by writelim.F, SUBROUTINE of 1DUTILS.h): |
---|
964 | ! phy_nat,phy_alb,phy_sst,phy_bil,phy_rug,phy_ice, |
---|
965 | ! phy_fter,phy_foce,phy_flic,phy_fsic) |
---|
966 | !------------------------------------------------------------------------ |
---|
967 | DO i = 1, year_len |
---|
968 | phy_nat(i) = nat_surf |
---|
969 | phy_alb(i) = albedo |
---|
970 | phy_sst(i) = tsurf ! read_tsurf1d will be used instead |
---|
971 | phy_rug(i) = rugos |
---|
972 | phy_fter(i) = pctsrf(1, is_ter) |
---|
973 | phy_foce(i) = pctsrf(1, is_oce) |
---|
974 | phy_fsic(i) = pctsrf(1, is_sic) |
---|
975 | phy_flic(i) = pctsrf(1, is_lic) |
---|
976 | END DO |
---|
977 | |
---|
978 | ! fabrication de limit.nc |
---|
979 | CALL writelim (1, phy_nat, phy_alb, phy_sst, phy_bil, phy_rug, & |
---|
980 | phy_ice, phy_fter, phy_foce, phy_flic, phy_fsic) |
---|
981 | |
---|
982 | CALL phys_state_var_end |
---|
983 | !Al1 |
---|
984 | IF (restart) THEN |
---|
985 | PRINT*, 'CALL to restart dyn 1d' |
---|
986 | Call dyn1deta0("start1dyn.nc", plev, play, phi, phis, presnivs, & |
---|
987 | u, v, temp, q, omega2) |
---|
988 | |
---|
989 | PRINT*, 'fnday,annee_ref,day_ref,day_ini', & |
---|
990 | fnday, annee_ref, day_ref, day_ini |
---|
991 | !** CALL ymds2ju(annee_ref,mois,day_ini,heure,day) |
---|
992 | day = day_ini |
---|
993 | day_end = day_ini + nday |
---|
994 | daytime = day + time_ini / 24. ! 1st day and initial time of the simulation |
---|
995 | |
---|
996 | ! Print out the actual date of the beginning of the simulation : |
---|
997 | CALL ju2ymds(daytime, an, mois, jour, heure) |
---|
998 | print *, ' Time of beginning : y m d h', an, mois, jour, heure / 3600. |
---|
999 | |
---|
1000 | day = int(daytime) |
---|
1001 | time = daytime - day |
---|
1002 | |
---|
1003 | PRINT*, '****** intialised fields from restart1dyn *******' |
---|
1004 | PRINT*, 'plev,play,phi,phis,presnivs,u,v,temp,q,omega2' |
---|
1005 | PRINT*, 'temp(1),q(1,1),u(1),v(1),plev(1),phis :' |
---|
1006 | PRINT*, temp(1), q(1, 1), u(1), v(1), plev(1), phis |
---|
1007 | ! raz for safety |
---|
1008 | DO l = 1, llm |
---|
1009 | dq_dyn(l, 1) = 0. |
---|
1010 | enddo |
---|
1011 | END IF |
---|
1012 | !Al1 ================ end restart ================================= |
---|
1013 | IF (ecrit_slab_oc==1) THEN |
---|
1014 | open(97, file = 'div_slab.dat', STATUS = 'UNKNOWN') |
---|
1015 | elseif (ecrit_slab_oc==0) THEN |
---|
1016 | open(97, file = 'div_slab.dat', STATUS = 'OLD') |
---|
1017 | END IF |
---|
1018 | |
---|
1019 | !--------------------------------------------------------------------- |
---|
1020 | ! Initialize target profile for RHT nudging if needed |
---|
1021 | !--------------------------------------------------------------------- |
---|
1022 | IF (nudge(inudge_RHT)) THEN |
---|
1023 | CALL nudge_RHT_init(plev, play, temp, q(:, 1), t_targ, rh_targ) |
---|
1024 | END IF |
---|
1025 | IF (nudge(inudge_UV)) THEN |
---|
1026 | CALL nudge_UV_init(plev, play, u, v, u_targ, v_targ) |
---|
1027 | END IF |
---|
1028 | |
---|
1029 | !===================================================================== |
---|
1030 | IF (CPPKEY_OUTPUTPHYSSCM) THEN |
---|
1031 | CALL iophys_ini(timestep) |
---|
1032 | END IF |
---|
1033 | ! START OF THE TEMPORAL LOOP : |
---|
1034 | !===================================================================== |
---|
1035 | |
---|
1036 | it_end = nint(fnday * day_step) |
---|
1037 | !test JLD it_end = 10 |
---|
1038 | DO while(it<=it_end) |
---|
1039 | |
---|
1040 | IF (prt_level>=1) THEN |
---|
1041 | PRINT*, 'XXXXXXXXXXXXXXXXXXX ITAP,day,time=', & |
---|
1042 | it, day, time, it_end, day_step |
---|
1043 | PRINT*, 'PAS DE TEMPS ', timestep |
---|
1044 | endif |
---|
1045 | !Al1 demande de restartphy.nc |
---|
1046 | IF (it==it_end) lastcall = .True. |
---|
1047 | |
---|
1048 | !--------------------------------------------------------------------- |
---|
1049 | ! Geopotential : |
---|
1050 | !--------------------------------------------------------------------- |
---|
1051 | |
---|
1052 | phi(1) = RD * temp(1) * (plev(1) - play(1)) / (.5 * (plev(1) + play(1))) |
---|
1053 | DO l = 1, llm - 1 |
---|
1054 | phi(l + 1) = phi(l) + RD * (temp(l) + temp(l + 1)) * & |
---|
1055 | (play(l) - play(l + 1)) / (play(l) + play(l + 1)) |
---|
1056 | enddo |
---|
1057 | |
---|
1058 | !--------------------------------------------------------------------- |
---|
1059 | ! Interpolation of forcings in time and onto model levels |
---|
1060 | !--------------------------------------------------------------------- |
---|
1061 | |
---|
1062 | INCLUDE "old_1D_interp_cases.h" |
---|
1063 | |
---|
1064 | IF (forcing_GCM2SCM) THEN |
---|
1065 | write (*, *) 'forcing_GCM2SCM not yet implemented' |
---|
1066 | stop 'in time loop' |
---|
1067 | END IF ! forcing_GCM2SCM |
---|
1068 | |
---|
1069 | !!!!--------------------------------------------------------------------- |
---|
1070 | !!!! Geopotential : |
---|
1071 | !!!!--------------------------------------------------------------------- |
---|
1072 | !!! |
---|
1073 | !!! phi(1)=RD*temp(1)*(plev(1)-play(1))/(.5*(plev(1)+play(1))) |
---|
1074 | !!! do l = 1, llm-1 |
---|
1075 | !!! phi(l+1)=phi(l)+RD*(temp(l)+temp(l+1))* & |
---|
1076 | !!! & (play(l)-play(l+1))/(play(l)+play(l+1)) |
---|
1077 | !!! enddo |
---|
1078 | |
---|
1079 | !--------------------------------------------------------------------- |
---|
1080 | ! Listing output for debug prt_level>=1 |
---|
1081 | !--------------------------------------------------------------------- |
---|
1082 | IF (prt_level>=1) THEN |
---|
1083 | print *, ' avant physiq : -------- day time ', day, time |
---|
1084 | WRITE(*, *) 'firstcall,lastcall,phis', & |
---|
1085 | firstcall, lastcall, phis |
---|
1086 | end if |
---|
1087 | IF (prt_level>=5) THEN |
---|
1088 | WRITE(*, '(a10,2a4,4a13)') 'BEFOR1 IT=', 'it', 'l', & |
---|
1089 | 'presniv', 'plev', 'play', 'phi' |
---|
1090 | WRITE(*, '(a10,2i4,4f13.2)') ('BEFOR1 IT= ', it, l, & |
---|
1091 | presnivs(l), plev(l), play(l), phi(l), l = 1, llm) |
---|
1092 | WRITE(*, '(a11,2a4,a11,6a8)') 'BEFOR2', 'it', 'l', & |
---|
1093 | 'presniv', 'u', 'v', 'temp', 'q1', 'q2', 'omega2' |
---|
1094 | WRITE(*, '(a11,2i4,f11.2,5f8.2,e10.2)') ('BEFOR2 IT= ', it, l, & |
---|
1095 | presnivs(l), u(l), v(l), temp(l), q(l, 1), q(l, 2), omega2(l), l = 1, llm) |
---|
1096 | END IF |
---|
1097 | |
---|
1098 | !--------------------------------------------------------------------- |
---|
1099 | ! Call physiq : |
---|
1100 | !--------------------------------------------------------------------- |
---|
1101 | CALL physiq(ngrid, llm, & |
---|
1102 | firstcall, lastcall, timestep, & |
---|
1103 | plev, play, phi, phis, presnivs, & |
---|
1104 | u, v, rot, temp, q, omega2, & |
---|
1105 | du_phys, dv_phys, dt_phys, dq, dpsrf) |
---|
1106 | firstcall = .FALSE. |
---|
1107 | |
---|
1108 | !--------------------------------------------------------------------- |
---|
1109 | ! Listing output for debug |
---|
1110 | !--------------------------------------------------------------------- |
---|
1111 | IF (prt_level>=5) THEN |
---|
1112 | WRITE(*, '(a11,2a4,4a13)') 'AFTER1 IT=', 'it', 'l', & |
---|
1113 | 'presniv', 'plev', 'play', 'phi' |
---|
1114 | WRITE(*, '(a11,2i4,4f13.2)') ('AFTER1 it= ', it, l, & |
---|
1115 | presnivs(l), plev(l), play(l), phi(l), l = 1, llm) |
---|
1116 | WRITE(*, '(a11,2a4,a11,6a8)') 'AFTER2', 'it', 'l', & |
---|
1117 | 'presniv', 'u', 'v', 'temp', 'q1', 'q2', 'omega2' |
---|
1118 | WRITE(*, '(a11,2i4,f11.2,5f8.2,e10.2)') ('AFTER2 it= ', it, l, & |
---|
1119 | presnivs(l), u(l), v(l), temp(l), q(l, 1), q(l, 2), omega2(l), l = 1, llm) |
---|
1120 | WRITE(*, '(a11,2a4,a11,5a8)') 'AFTER3', 'it', 'l', & |
---|
1121 | 'presniv', 'du_phys', 'dv_phys', 'dt_phys', 'dq1', 'dq2' |
---|
1122 | WRITE(*, '(a11,2i4,f11.2,5f8.2)') ('AFTER3 it= ', it, l, & |
---|
1123 | presnivs(l), 86400 * du_phys(l), 86400 * dv_phys(l), & |
---|
1124 | 86400 * dt_phys(l), 86400 * dq(l, 1), dq(l, 2), l = 1, llm) |
---|
1125 | WRITE(*, *) 'dpsrf', dpsrf |
---|
1126 | END IF |
---|
1127 | !--------------------------------------------------------------------- |
---|
1128 | ! Add physical tendencies : |
---|
1129 | !--------------------------------------------------------------------- |
---|
1130 | |
---|
1131 | fcoriolis = 2. * sin(rpi * xlat / 180.) * romega |
---|
1132 | IF (forcing_radconv .OR. forcing_fire) THEN |
---|
1133 | fcoriolis = 0.0 |
---|
1134 | dt_cooling = 0.0 |
---|
1135 | d_t_adv = 0.0 |
---|
1136 | d_q_adv = 0.0 |
---|
1137 | END IF |
---|
1138 | ! PRINT*, 'calcul de fcoriolis ', fcoriolis |
---|
1139 | |
---|
1140 | IF (forcing_toga .OR. forcing_GCSSold .OR. forcing_twpice & |
---|
1141 | .OR.forcing_amma .OR. forcing_type==101) THEN |
---|
1142 | fcoriolis = 0.0 ; ug = 0. ; vg = 0. |
---|
1143 | END IF |
---|
1144 | |
---|
1145 | IF(forcing_rico) THEN |
---|
1146 | dt_cooling = 0. |
---|
1147 | END IF |
---|
1148 | |
---|
1149 | !CRio:Attention modif sp??cifique cas de Caroline |
---|
1150 | IF (forcing_type==-1) THEN |
---|
1151 | fcoriolis = 0. |
---|
1152 | !Nudging |
---|
1153 | |
---|
1154 | !on calcule dt_cooling |
---|
1155 | DO l = 1, llm |
---|
1156 | IF (play(l)>=20000.) THEN |
---|
1157 | dt_cooling(l) = -1.5 / 86400. |
---|
1158 | elseif ((play(l)>=10000.).AND.((play(l)<20000.))) THEN |
---|
1159 | dt_cooling(l) = -1.5 / 86400. * (play(l) - 10000.) / (10000.) - 1. / 86400. * (20000. - play(l)) / 10000. * (temp(l) - 200.) |
---|
1160 | else |
---|
1161 | dt_cooling(l) = -1. * (temp(l) - 200.) / 86400. |
---|
1162 | endif |
---|
1163 | enddo |
---|
1164 | |
---|
1165 | END IF |
---|
1166 | !RC |
---|
1167 | IF (forcing_sandu) THEN |
---|
1168 | ug(1:llm) = u_mod(1:llm) |
---|
1169 | vg(1:llm) = v_mod(1:llm) |
---|
1170 | END IF |
---|
1171 | |
---|
1172 | IF (prt_level >= 5) PRINT*, 'fcoriolis, xlat,mxcalc ', & |
---|
1173 | fcoriolis, xlat, mxcalc |
---|
1174 | |
---|
1175 | ! print *,'u-ug=',u-ug |
---|
1176 | |
---|
1177 | !!!!!!!!!!!!!!!!!!!!!!!! |
---|
1178 | ! Geostrophic wind |
---|
1179 | ! Le calcul ci dessous est insuffisamment precis |
---|
1180 | ! du_age(1:mxcalc)=fcoriolis*(v(1:mxcalc)-vg(1:mxcalc)) |
---|
1181 | ! dv_age(1:mxcalc)=-fcoriolis*(u(1:mxcalc)-ug(1:mxcalc)) |
---|
1182 | !!!!!!!!!!!!!!!!!!!!!!!! |
---|
1183 | sfdt = sin(0.5 * fcoriolis * timestep) |
---|
1184 | cfdt = cos(0.5 * fcoriolis * timestep) |
---|
1185 | ! print *,'fcoriolis,sfdt,cfdt,timestep',fcoriolis,sfdt,cfdt,timestep |
---|
1186 | |
---|
1187 | du_age(1:mxcalc) = -2. * sfdt / timestep * & |
---|
1188 | (sfdt * (u(1:mxcalc) - ug(1:mxcalc)) - & |
---|
1189 | cfdt * (v(1:mxcalc) - vg(1:mxcalc))) |
---|
1190 | !! : fcoriolis*(v(1:mxcalc)-vg(1:mxcalc)) |
---|
1191 | |
---|
1192 | dv_age(1:mxcalc) = -2. * sfdt / timestep * & |
---|
1193 | (cfdt * (u(1:mxcalc) - ug(1:mxcalc)) + & |
---|
1194 | sfdt * (v(1:mxcalc) - vg(1:mxcalc))) |
---|
1195 | !! : -fcoriolis*(u(1:mxcalc)-ug(1:mxcalc)) |
---|
1196 | |
---|
1197 | !!!!!!!!!!!!!!!!!!!!!!!! |
---|
1198 | ! Nudging |
---|
1199 | !!!!!!!!!!!!!!!!!!!!!!!! |
---|
1200 | d_t_nudge(:) = 0. |
---|
1201 | d_q_nudge(:, :) = 0. |
---|
1202 | d_u_nudge(:) = 0. |
---|
1203 | d_v_nudge(:) = 0. |
---|
1204 | IF (nudge(inudge_RHT)) THEN |
---|
1205 | CALL nudge_RHT(timestep, plev, play, t_targ, rh_targ, temp, q(:, 1), & |
---|
1206 | d_t_nudge, d_q_nudge(:, 1)) |
---|
1207 | END IF |
---|
1208 | IF (nudge(inudge_UV)) THEN |
---|
1209 | CALL nudge_UV(timestep, plev, play, u_targ, v_targ, u, v, & |
---|
1210 | d_u_nudge, d_v_nudge) |
---|
1211 | END IF |
---|
1212 | |
---|
1213 | IF (forcing_fire) THEN |
---|
1214 | |
---|
1215 | !let ww=if ( alt le 1100 ) then alt*-0.00001 else 0 |
---|
1216 | !let wt=if ( alt le 1100 ) then min( -3.75e-5 , -7.5e-8*alt) else 0 |
---|
1217 | !let wq=if ( alt le 1100 ) then max( 1.5e-8 , 3e-11*alt) else 0 |
---|
1218 | d_t_adv = 0. |
---|
1219 | d_q_adv = 0. |
---|
1220 | teta = temp * (pzero / play)**rkappa |
---|
1221 | d_t_adv = 0. |
---|
1222 | d_q_adv = 0. |
---|
1223 | DO l = 2, llm - 1 |
---|
1224 | IF (zlay(l)<=1100) THEN |
---|
1225 | wwww = -0.00001 * zlay(l) |
---|
1226 | d_t_adv(l) = -wwww * (teta(l) - teta(l + 1)) / (zlay(l) - zlay(l + 1)) / (pzero / play(l))**rkappa |
---|
1227 | d_q_adv(l, 1:2) = -wwww * (q(l, 1:2) - q(l + 1, 1:2)) / (zlay(l) - zlay(l + 1)) |
---|
1228 | d_t_adv(l) = d_t_adv(l) + min(-3.75e-5, -7.5e-8 * zlay(l)) |
---|
1229 | d_q_adv(l, 1) = d_q_adv(l, 1) + max(1.5e-8, 3e-11 * zlay(l)) |
---|
1230 | endif |
---|
1231 | enddo |
---|
1232 | |
---|
1233 | END IF |
---|
1234 | |
---|
1235 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
1236 | ! call writefield_phy('dv_age' ,dv_age,llm) |
---|
1237 | ! call writefield_phy('du_age' ,du_age,llm) |
---|
1238 | ! call writefield_phy('du_phys' ,du_phys,llm) |
---|
1239 | ! call writefield_phy('u_tend' ,u,llm) |
---|
1240 | ! call writefield_phy('u_g' ,ug,llm) |
---|
1241 | |
---|
1242 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
1243 | !! Increment state variables |
---|
1244 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
1245 | IF (flag_inhib_forcing == 0) then ! if tendency of forcings should be added |
---|
1246 | |
---|
1247 | ! pour les cas sandu et astex, on reclacule u,v,q,temp et teta dans 1D_nudge_sandu_astex.h |
---|
1248 | ! au dessus de 700hpa, on relaxe vers les profils initiaux |
---|
1249 | IF (forcing_sandu .OR. forcing_astex) THEN |
---|
1250 | INCLUDE "1D_nudge_sandu_astex.h" |
---|
1251 | else |
---|
1252 | u(1:mxcalc) = u(1:mxcalc) + timestep * (& |
---|
1253 | du_phys(1:mxcalc) & |
---|
1254 | + du_age(1:mxcalc) + du_adv(1:mxcalc) & |
---|
1255 | + d_u_nudge(1:mxcalc)) |
---|
1256 | v(1:mxcalc) = v(1:mxcalc) + timestep * (& |
---|
1257 | dv_phys(1:mxcalc) & |
---|
1258 | + dv_age(1:mxcalc) + dv_adv(1:mxcalc) & |
---|
1259 | + d_v_nudge(1:mxcalc)) |
---|
1260 | q(1:mxcalc, :) = q(1:mxcalc, :) + timestep * (& |
---|
1261 | dq(1:mxcalc, :) & |
---|
1262 | + d_q_adv(1:mxcalc, :) & |
---|
1263 | + d_q_nudge(1:mxcalc, :)) |
---|
1264 | |
---|
1265 | IF (prt_level>=3) THEN |
---|
1266 | print *, & |
---|
1267 | 'physiq-> temp(1),dt_phys(1),d_t_adv(1),dt_cooling(1) ', & |
---|
1268 | temp(1), dt_phys(1), d_t_adv(1), dt_cooling(1) |
---|
1269 | PRINT*, 'dv_phys=', dv_phys |
---|
1270 | PRINT*, 'dv_age=', dv_age |
---|
1271 | PRINT*, 'dv_adv=', dv_adv |
---|
1272 | PRINT*, 'd_v_nudge=', d_v_nudge |
---|
1273 | PRINT*, v |
---|
1274 | PRINT*, vg |
---|
1275 | endif |
---|
1276 | |
---|
1277 | temp(1:mxcalc) = temp(1:mxcalc) + timestep * (& |
---|
1278 | dt_phys(1:mxcalc) & |
---|
1279 | + d_t_adv(1:mxcalc) & |
---|
1280 | + d_t_nudge(1:mxcalc) & |
---|
1281 | + dt_cooling(1:mxcalc)) ! Taux de chauffage ou refroid. |
---|
1282 | |
---|
1283 | IF (CPPKEY_OUTPUTPHYSSCM) THEN |
---|
1284 | CALL iophys_ecrit('d_t_adv', klev, 'd_t_adv', 'm/s', d_t_adv) |
---|
1285 | CALL iophys_ecrit('d_t_nudge', klev, 'd_t_nudge', 'm/s', d_t_nudge) |
---|
1286 | END IF |
---|
1287 | |
---|
1288 | endif ! forcing_sandu or forcing_astex |
---|
1289 | |
---|
1290 | teta = temp * (pzero / play)**rkappa |
---|
1291 | |
---|
1292 | !--------------------------------------------------------------------- |
---|
1293 | ! Nudge soil temperature if requested |
---|
1294 | !--------------------------------------------------------------------- |
---|
1295 | |
---|
1296 | IF (nudge_tsoil .AND. .NOT. lastcall) THEN |
---|
1297 | ftsoil(1, isoil_nudge, :) = ftsoil(1, isoil_nudge, :) & |
---|
1298 | - timestep / tau_soil_nudge * (ftsoil(1, isoil_nudge, :) - Tsoil_nudge) |
---|
1299 | ENDIF |
---|
1300 | |
---|
1301 | !--------------------------------------------------------------------- |
---|
1302 | ! Add large-scale tendencies (advection, etc) : |
---|
1303 | !--------------------------------------------------------------------- |
---|
1304 | |
---|
1305 | !cc nrlmd |
---|
1306 | !cc tmpvar=teta |
---|
1307 | !cc CALL advect_vert(llm,omega,timestep,tmpvar,plev) |
---|
1308 | !cc |
---|
1309 | !cc teta(1:mxcalc)=tmpvar(1:mxcalc) |
---|
1310 | !cc tmpvar(:)=q(:,1) |
---|
1311 | !cc CALL advect_vert(llm,omega,timestep,tmpvar,plev) |
---|
1312 | !cc q(1:mxcalc,1)=tmpvar(1:mxcalc) |
---|
1313 | !cc tmpvar(:)=q(:,2) |
---|
1314 | !cc CALL advect_vert(llm,omega,timestep,tmpvar,plev) |
---|
1315 | !cc q(1:mxcalc,2)=tmpvar(1:mxcalc) |
---|
1316 | |
---|
1317 | END IF ! end if tendency of tendency should be added |
---|
1318 | |
---|
1319 | !--------------------------------------------------------------------- |
---|
1320 | ! Air temperature : |
---|
1321 | !--------------------------------------------------------------------- |
---|
1322 | IF (lastcall) THEN |
---|
1323 | PRINT*, 'Pas de temps final ', it |
---|
1324 | CALL ju2ymds(daytime, an, mois, jour, heure) |
---|
1325 | PRINT*, 'a la date : a m j h', an, mois, jour, heure / 3600. |
---|
1326 | END IF |
---|
1327 | |
---|
1328 | ! incremente day time |
---|
1329 | ! PRINT*,'daytime bef',daytime,1./day_step |
---|
1330 | daytime = daytime + 1. / day_step |
---|
1331 | !Al1dbg |
---|
1332 | day = int(daytime + 0.1 / day_step) |
---|
1333 | ! time = max(daytime-day,0.0) |
---|
1334 | !Al1&jyg: correction de bug |
---|
1335 | !cc time = real(mod(it,day_step))/day_step |
---|
1336 | time = time_ini / 24. + real(mod(it, day_step)) / day_step |
---|
1337 | ! PRINT*,'daytime nxt time',daytime,time |
---|
1338 | it = it + 1 |
---|
1339 | |
---|
1340 | END DO |
---|
1341 | |
---|
1342 | !Al1 |
---|
1343 | IF (ecrit_slab_oc/=-1) close(97) |
---|
1344 | |
---|
1345 | !Al1 Call to 1D equivalent of dynredem (an,mois,jour,heure ?) |
---|
1346 | ! ------------------------------------- |
---|
1347 | CALL dyn1dredem("restart1dyn.nc", & |
---|
1348 | plev, play, phi, phis, presnivs, & |
---|
1349 | u, v, temp, q, omega2) |
---|
1350 | |
---|
1351 | CALL abort_gcm ('lmdz1d ', 'The End ', 0) |
---|
1352 | |
---|
1353 | END SUBROUTINE old_lmdz1d |
---|
1354 | |
---|
1355 | INCLUDE "old_1DUTILS_read_interp.h" |
---|
1356 | END MODULE lmdz_old_lmdz1d |
---|