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