[524] | 1 | ! |
---|
[1279] | 2 | ! $Id: leapfrog.F 2641 2016-09-29 21:26:46Z acozic $ |
---|
| 3 | ! |
---|
[524] | 4 | c |
---|
| 5 | c |
---|
[2258] | 6 | SUBROUTINE leapfrog(ucov,vcov,teta,ps,masse,phis,q,time_0) |
---|
[524] | 7 | |
---|
| 8 | |
---|
[692] | 9 | cIM : pour sortir les param. du modele dans un fis. netcdf 110106 |
---|
[1146] | 10 | #ifdef CPP_IOIPSL |
---|
| 11 | use IOIPSL |
---|
| 12 | #endif |
---|
[2298] | 13 | USE infotrac, ONLY: nqtot,ok_iso_verif |
---|
[1279] | 14 | USE guide_mod, ONLY : guide_main |
---|
[1999] | 15 | USE write_field, ONLY: writefield |
---|
| 16 | USE control_mod, ONLY: nday, day_step, planet_type, offline, |
---|
| 17 | & iconser, iphysiq, iperiod, dissip_period, |
---|
| 18 | & iecri, ip_ebil_dyn, ok_dynzon, ok_dyn_ins, |
---|
| 19 | & periodav, ok_dyn_ave, output_grads_dyn |
---|
[2056] | 20 | use exner_hyb_m, only: exner_hyb |
---|
| 21 | use exner_milieu_m, only: exner_milieu |
---|
[2641] | 22 | USE comvert_mod, ONLY: ap,bp,pressure_exner,presnivs |
---|
| 23 | USE comconst_mod, ONLY: cpp, dtphys, dtvr, pi, ihf |
---|
| 24 | USE logic_mod, ONLY: iflag_phys,ok_guide,forward,leapf,apphys, |
---|
| 25 | & statcl,conser,apdiss,purmats,ok_strato |
---|
| 26 | USE temps_mod, ONLY: jD_ref,jH_ref,itaufin,day_ini,day_ref, |
---|
| 27 | & start_time,dt |
---|
[2056] | 28 | |
---|
[524] | 29 | IMPLICIT NONE |
---|
| 30 | |
---|
| 31 | c ...... Version du 10/01/98 .......... |
---|
| 32 | |
---|
| 33 | c avec coordonnees verticales hybrides |
---|
| 34 | c avec nouveaux operat. dissipation * ( gradiv2,divgrad2,nxgraro2 ) |
---|
| 35 | |
---|
| 36 | c======================================================================= |
---|
| 37 | c |
---|
| 38 | c Auteur: P. Le Van /L. Fairhead/F.Hourdin |
---|
| 39 | c ------- |
---|
| 40 | c |
---|
| 41 | c Objet: |
---|
| 42 | c ------ |
---|
| 43 | c |
---|
| 44 | c GCM LMD nouvelle grille |
---|
| 45 | c |
---|
| 46 | c======================================================================= |
---|
| 47 | c |
---|
| 48 | c ... Dans inigeom , nouveaux calculs pour les elongations cu , cv |
---|
| 49 | c et possibilite d'appeler une fonction f(y) a derivee tangente |
---|
| 50 | c hyperbolique a la place de la fonction a derivee sinusoidale. |
---|
| 51 | |
---|
| 52 | c ... Possibilite de choisir le shema pour l'advection de |
---|
| 53 | c q , en modifiant iadv dans traceur.def (10/02) . |
---|
| 54 | c |
---|
| 55 | c Pour Van-Leer + Vapeur d'eau saturee, iadv(1)=4. (F.Codron,10/99) |
---|
| 56 | c Pour Van-Leer iadv=10 |
---|
| 57 | c |
---|
| 58 | c----------------------------------------------------------------------- |
---|
| 59 | c Declarations: |
---|
| 60 | c ------------- |
---|
| 61 | |
---|
[2641] | 62 | include "dimensions.h" |
---|
| 63 | include "paramet.h" |
---|
| 64 | include "comdissnew.h" |
---|
| 65 | include "comgeom.h" |
---|
| 66 | include "description.h" |
---|
| 67 | include "iniprint.h" |
---|
| 68 | include "academic.h" |
---|
[524] | 69 | |
---|
[1999] | 70 | REAL,INTENT(IN) :: time_0 ! not used |
---|
[524] | 71 | |
---|
[1999] | 72 | c dynamical variables: |
---|
| 73 | REAL,INTENT(INOUT) :: ucov(ip1jmp1,llm) ! zonal covariant wind |
---|
| 74 | REAL,INTENT(INOUT) :: vcov(ip1jm,llm) ! meridional covariant wind |
---|
| 75 | REAL,INTENT(INOUT) :: teta(ip1jmp1,llm) ! potential temperature |
---|
| 76 | REAL,INTENT(INOUT) :: ps(ip1jmp1) ! surface pressure (Pa) |
---|
| 77 | REAL,INTENT(INOUT) :: masse(ip1jmp1,llm) ! air mass |
---|
| 78 | REAL,INTENT(INOUT) :: phis(ip1jmp1) ! geopotentiat at the surface |
---|
| 79 | REAL,INTENT(INOUT) :: q(ip1jmp1,llm,nqtot) ! advected tracers |
---|
| 80 | |
---|
| 81 | REAL p (ip1jmp1,llmp1 ) ! interlayer pressure |
---|
| 82 | REAL pks(ip1jmp1) ! exner at the surface |
---|
| 83 | REAL pk(ip1jmp1,llm) ! exner at mid-layer |
---|
| 84 | REAL pkf(ip1jmp1,llm) ! filtered exner at mid-layer |
---|
| 85 | REAL phi(ip1jmp1,llm) ! geopotential |
---|
| 86 | REAL w(ip1jmp1,llm) ! vertical velocity |
---|
| 87 | |
---|
[524] | 88 | real zqmin,zqmax |
---|
| 89 | |
---|
| 90 | c variables dynamiques intermediaire pour le transport |
---|
| 91 | REAL pbaru(ip1jmp1,llm),pbarv(ip1jm,llm) !flux de masse |
---|
| 92 | |
---|
| 93 | c variables dynamiques au pas -1 |
---|
| 94 | REAL vcovm1(ip1jm,llm),ucovm1(ip1jmp1,llm) |
---|
| 95 | REAL tetam1(ip1jmp1,llm),psm1(ip1jmp1) |
---|
| 96 | REAL massem1(ip1jmp1,llm) |
---|
| 97 | |
---|
| 98 | c tendances dynamiques |
---|
| 99 | REAL dv(ip1jm,llm),du(ip1jmp1,llm) |
---|
[1146] | 100 | REAL dteta(ip1jmp1,llm),dq(ip1jmp1,llm,nqtot),dp(ip1jmp1) |
---|
[524] | 101 | |
---|
| 102 | c tendances de la dissipation |
---|
| 103 | REAL dvdis(ip1jm,llm),dudis(ip1jmp1,llm) |
---|
| 104 | REAL dtetadis(ip1jmp1,llm) |
---|
| 105 | |
---|
| 106 | c tendances physiques |
---|
| 107 | REAL dvfi(ip1jm,llm),dufi(ip1jmp1,llm) |
---|
[1146] | 108 | REAL dtetafi(ip1jmp1,llm),dqfi(ip1jmp1,llm,nqtot),dpfi(ip1jmp1) |
---|
[524] | 109 | |
---|
| 110 | c variables pour le fichier histoire |
---|
| 111 | REAL dtav ! intervalle de temps elementaire |
---|
| 112 | |
---|
| 113 | REAL tppn(iim),tpps(iim),tpn,tps |
---|
| 114 | c |
---|
| 115 | INTEGER itau,itaufinp1,iav |
---|
[1279] | 116 | ! INTEGER iday ! jour julien |
---|
| 117 | REAL time |
---|
[524] | 118 | |
---|
| 119 | REAL SSUM |
---|
[1665] | 120 | ! REAL finvmaold(ip1jmp1,llm) |
---|
[524] | 121 | |
---|
[566] | 122 | cym LOGICAL lafin |
---|
| 123 | LOGICAL :: lafin=.false. |
---|
[524] | 124 | INTEGER ij,iq,l |
---|
| 125 | INTEGER ik |
---|
| 126 | |
---|
| 127 | real time_step, t_wrt, t_ops |
---|
| 128 | |
---|
[1279] | 129 | ! REAL rdayvrai,rdaym_ini |
---|
| 130 | ! jD_cur: jour julien courant |
---|
| 131 | ! jH_cur: heure julienne courante |
---|
| 132 | REAL :: jD_cur, jH_cur |
---|
| 133 | INTEGER :: an, mois, jour |
---|
| 134 | REAL :: secondes |
---|
| 135 | |
---|
[524] | 136 | LOGICAL first,callinigrads |
---|
[692] | 137 | cIM : pour sortir les param. du modele dans un fis. netcdf 110106 |
---|
| 138 | save first |
---|
| 139 | data first/.true./ |
---|
[1279] | 140 | real dt_cum |
---|
[692] | 141 | character*10 infile |
---|
| 142 | integer zan, tau0, thoriid |
---|
| 143 | integer nid_ctesGCM |
---|
| 144 | save nid_ctesGCM |
---|
| 145 | real degres |
---|
| 146 | real rlong(iip1), rlatg(jjp1) |
---|
| 147 | real zx_tmp_2d(iip1,jjp1) |
---|
| 148 | integer ndex2d(iip1*jjp1) |
---|
| 149 | logical ok_sync |
---|
| 150 | parameter (ok_sync = .true.) |
---|
[1529] | 151 | logical physic |
---|
[524] | 152 | |
---|
| 153 | data callinigrads/.true./ |
---|
| 154 | character*10 string10 |
---|
| 155 | |
---|
[960] | 156 | REAL :: flxw(ip1jmp1,llm) ! flux de masse verticale |
---|
[524] | 157 | |
---|
| 158 | c+jld variables test conservation energie |
---|
| 159 | REAL ecin(ip1jmp1,llm),ecin0(ip1jmp1,llm) |
---|
| 160 | C Tendance de la temp. potentiel d (theta)/ d t due a la |
---|
| 161 | C tansformation d'energie cinetique en energie thermique |
---|
| 162 | C cree par la dissipation |
---|
| 163 | REAL dtetaecdt(ip1jmp1,llm) |
---|
| 164 | REAL vcont(ip1jm,llm),ucont(ip1jmp1,llm) |
---|
| 165 | REAL vnat(ip1jm,llm),unat(ip1jmp1,llm) |
---|
| 166 | REAL d_h_vcol, d_qt, d_qw, d_ql, d_ec |
---|
| 167 | CHARACTER*15 ztit |
---|
[692] | 168 | !IM INTEGER ip_ebil_dyn ! PRINT level for energy conserv. diag. |
---|
| 169 | !IM SAVE ip_ebil_dyn |
---|
| 170 | !IM DATA ip_ebil_dyn/0/ |
---|
[524] | 171 | c-jld |
---|
| 172 | |
---|
| 173 | character*80 dynhist_file, dynhistave_file |
---|
[1520] | 174 | character(len=*),parameter :: modname="leapfrog" |
---|
[524] | 175 | character*80 abort_message |
---|
| 176 | |
---|
| 177 | logical dissip_conservative |
---|
| 178 | save dissip_conservative |
---|
| 179 | data dissip_conservative/.true./ |
---|
| 180 | |
---|
| 181 | LOGICAL prem |
---|
| 182 | save prem |
---|
| 183 | DATA prem/.true./ |
---|
| 184 | INTEGER testita |
---|
| 185 | PARAMETER (testita = 9) |
---|
| 186 | |
---|
[1286] | 187 | logical , parameter :: flag_verif = .false. |
---|
[999] | 188 | |
---|
| 189 | |
---|
[825] | 190 | integer itau_w ! pas de temps ecriture = itap + itau_phy |
---|
| 191 | |
---|
| 192 | |
---|
[2056] | 193 | if (nday>=0) then |
---|
| 194 | itaufin = nday*day_step |
---|
| 195 | else |
---|
| 196 | itaufin = -nday |
---|
| 197 | endif |
---|
[524] | 198 | itaufinp1 = itaufin +1 |
---|
[1529] | 199 | itau = 0 |
---|
| 200 | physic=.true. |
---|
| 201 | if (iflag_phys==0.or.iflag_phys==2) physic=.false. |
---|
[524] | 202 | |
---|
[1403] | 203 | c iday = day_ini+itau/day_step |
---|
| 204 | c time = REAL(itau-(iday-day_ini)*day_step)/day_step+time_0 |
---|
| 205 | c IF(time.GT.1.) THEN |
---|
| 206 | c time = time-1. |
---|
| 207 | c iday = iday+1 |
---|
| 208 | c ENDIF |
---|
[524] | 209 | |
---|
| 210 | |
---|
| 211 | c----------------------------------------------------------------------- |
---|
| 212 | c On initialise la pression et la fonction d'Exner : |
---|
| 213 | c -------------------------------------------------- |
---|
| 214 | |
---|
[1454] | 215 | dq(:,:,:)=0. |
---|
[524] | 216 | CALL pression ( ip1jmp1, ap, bp, ps, p ) |
---|
[1665] | 217 | if (pressure_exner) then |
---|
[2056] | 218 | CALL exner_hyb( ip1jmp1, ps, p, pks, pk, pkf ) |
---|
[1665] | 219 | else |
---|
[2056] | 220 | CALL exner_milieu( ip1jmp1, ps, p, pks, pk, pkf ) |
---|
[1520] | 221 | endif |
---|
[524] | 222 | |
---|
| 223 | c----------------------------------------------------------------------- |
---|
| 224 | c Debut de l'integration temporelle: |
---|
| 225 | c ---------------------------------- |
---|
| 226 | |
---|
[1665] | 227 | 1 CONTINUE ! Matsuno Forward step begins here |
---|
[524] | 228 | |
---|
[2408] | 229 | c date: (NB: date remains unchanged for Backward step) |
---|
| 230 | c ----- |
---|
| 231 | |
---|
[1665] | 232 | jD_cur = jD_ref + day_ini - day_ref + & |
---|
[2408] | 233 | & (itau+1)/day_step |
---|
[1665] | 234 | jH_cur = jH_ref + start_time + & |
---|
[2408] | 235 | & mod(itau+1,day_step)/float(day_step) |
---|
[1665] | 236 | jD_cur = jD_cur + int(jH_cur) |
---|
| 237 | jH_cur = jH_cur - int(jH_cur) |
---|
[524] | 238 | |
---|
[2298] | 239 | if (ok_iso_verif) then |
---|
| 240 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 321') |
---|
| 241 | endif !if (ok_iso_verif) then |
---|
[1279] | 242 | |
---|
[524] | 243 | #ifdef CPP_IOIPSL |
---|
[1279] | 244 | if (ok_guide) then |
---|
| 245 | call guide_main(itau,ucov,vcov,teta,q,masse,ps) |
---|
[524] | 246 | endif |
---|
| 247 | #endif |
---|
[1279] | 248 | |
---|
| 249 | |
---|
[524] | 250 | c |
---|
| 251 | c IF( MOD( itau, 10* day_step ).EQ.0 ) THEN |
---|
| 252 | c CALL test_period ( ucov,vcov,teta,q,p,phis ) |
---|
| 253 | c PRINT *,' ---- Test_period apres continue OK ! -----', itau |
---|
| 254 | c ENDIF |
---|
| 255 | c |
---|
[1146] | 256 | |
---|
| 257 | ! Save fields obtained at previous time step as '...m1' |
---|
[524] | 258 | CALL SCOPY( ijmllm ,vcov , 1, vcovm1 , 1 ) |
---|
| 259 | CALL SCOPY( ijp1llm,ucov , 1, ucovm1 , 1 ) |
---|
| 260 | CALL SCOPY( ijp1llm,teta , 1, tetam1 , 1 ) |
---|
| 261 | CALL SCOPY( ijp1llm,masse, 1, massem1, 1 ) |
---|
| 262 | CALL SCOPY( ip1jmp1, ps , 1, psm1 , 1 ) |
---|
| 263 | |
---|
| 264 | forward = .TRUE. |
---|
| 265 | leapf = .FALSE. |
---|
| 266 | dt = dtvr |
---|
| 267 | |
---|
| 268 | c ... P.Le Van .26/04/94 .... |
---|
[1665] | 269 | ! Ehouarn: finvmaold is actually not used |
---|
| 270 | ! CALL SCOPY ( ijp1llm, masse, 1, finvmaold, 1 ) |
---|
| 271 | ! CALL filtreg ( finvmaold ,jjp1, llm, -2,2, .TRUE., 1 ) |
---|
[524] | 272 | |
---|
[2298] | 273 | if (ok_iso_verif) then |
---|
| 274 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 400') |
---|
| 275 | endif !if (ok_iso_verif) then |
---|
| 276 | |
---|
[1665] | 277 | 2 CONTINUE ! Matsuno backward or leapfrog step begins here |
---|
[524] | 278 | |
---|
| 279 | c----------------------------------------------------------------------- |
---|
| 280 | |
---|
[2408] | 281 | c date: (NB: only leapfrog step requires recomputing date) |
---|
[524] | 282 | c ----- |
---|
| 283 | |
---|
[2408] | 284 | IF (leapf) THEN |
---|
| 285 | jD_cur = jD_ref + day_ini - day_ref + |
---|
| 286 | & (itau+1)/day_step |
---|
| 287 | jH_cur = jH_ref + start_time + |
---|
| 288 | & mod(itau+1,day_step)/float(day_step) |
---|
| 289 | jD_cur = jD_cur + int(jH_cur) |
---|
| 290 | jH_cur = jH_cur - int(jH_cur) |
---|
| 291 | ENDIF |
---|
[524] | 292 | |
---|
[2408] | 293 | |
---|
[524] | 294 | c gestion des appels de la physique et des dissipations: |
---|
| 295 | c ------------------------------------------------------ |
---|
| 296 | c |
---|
| 297 | c ... P.Le Van ( 6/02/95 ) .... |
---|
| 298 | |
---|
| 299 | apphys = .FALSE. |
---|
| 300 | statcl = .FALSE. |
---|
| 301 | conser = .FALSE. |
---|
| 302 | apdiss = .FALSE. |
---|
| 303 | |
---|
| 304 | IF( purmats ) THEN |
---|
[1403] | 305 | ! Purely Matsuno time stepping |
---|
[524] | 306 | IF( MOD(itau,iconser) .EQ.0.AND. forward ) conser = .TRUE. |
---|
[1502] | 307 | IF( MOD(itau,dissip_period ).EQ.0.AND..NOT.forward ) |
---|
| 308 | s apdiss = .TRUE. |
---|
[524] | 309 | IF( MOD(itau,iphysiq ).EQ.0.AND..NOT.forward |
---|
[1529] | 310 | s .and. physic ) apphys = .TRUE. |
---|
[524] | 311 | ELSE |
---|
[1403] | 312 | ! Leapfrog/Matsuno time stepping |
---|
[524] | 313 | IF( MOD(itau ,iconser) .EQ. 0 ) conser = .TRUE. |
---|
[1502] | 314 | IF( MOD(itau+1,dissip_period).EQ.0 .AND. .NOT. forward ) |
---|
| 315 | s apdiss = .TRUE. |
---|
[1529] | 316 | IF( MOD(itau+1,iphysiq).EQ.0.AND.physic ) apphys=.TRUE. |
---|
[524] | 317 | END IF |
---|
| 318 | |
---|
[1403] | 319 | ! Ehouarn: for Shallow Water case (ie: 1 vertical layer), |
---|
| 320 | ! supress dissipation step |
---|
| 321 | if (llm.eq.1) then |
---|
| 322 | apdiss=.false. |
---|
| 323 | endif |
---|
| 324 | |
---|
[2298] | 325 | |
---|
| 326 | if (ok_iso_verif) then |
---|
| 327 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 589') |
---|
| 328 | endif !if (ok_iso_verif) then |
---|
| 329 | |
---|
[524] | 330 | c----------------------------------------------------------------------- |
---|
| 331 | c calcul des tendances dynamiques: |
---|
| 332 | c -------------------------------- |
---|
| 333 | |
---|
[1665] | 334 | ! compute geopotential phi() |
---|
[524] | 335 | CALL geopot ( ip1jmp1, teta , pk , pks, phis , phi ) |
---|
| 336 | |
---|
[1279] | 337 | time = jD_cur + jH_cur |
---|
[524] | 338 | CALL caldyn |
---|
| 339 | $ ( itau,ucov,vcov,teta,ps,masse,pk,pkf,phis , |
---|
[1279] | 340 | $ phi,conser,du,dv,dteta,dp,w, pbaru,pbarv, time ) |
---|
[524] | 341 | |
---|
[1279] | 342 | |
---|
[524] | 343 | c----------------------------------------------------------------------- |
---|
| 344 | c calcul des tendances advection des traceurs (dont l'humidite) |
---|
| 345 | c ------------------------------------------------------------- |
---|
| 346 | |
---|
[2298] | 347 | if (ok_iso_verif) then |
---|
| 348 | call check_isotopes_seq(q,ip1jmp1, |
---|
| 349 | & 'leapfrog 686: avant caladvtrac') |
---|
| 350 | endif !if (ok_iso_verif) then |
---|
| 351 | |
---|
[524] | 352 | IF( forward. OR . leapf ) THEN |
---|
[1999] | 353 | ! Ehouarn: NB: fields sent to advtrac are those at the beginning of the time step |
---|
[960] | 354 | CALL caladvtrac(q,pbaru,pbarv, |
---|
| 355 | * p, masse, dq, teta, |
---|
| 356 | . flxw, pk) |
---|
[2298] | 357 | !write(*,*) 'caladvtrac 346' |
---|
| 358 | |
---|
[960] | 359 | |
---|
[524] | 360 | IF (offline) THEN |
---|
| 361 | Cmaf stokage du flux de masse pour traceurs OFF-LINE |
---|
| 362 | |
---|
| 363 | #ifdef CPP_IOIPSL |
---|
[541] | 364 | CALL fluxstokenc(pbaru,pbarv,masse,teta,phi,phis, |
---|
| 365 | . dtvr, itau) |
---|
[524] | 366 | #endif |
---|
| 367 | |
---|
| 368 | |
---|
[1146] | 369 | ENDIF ! of IF (offline) |
---|
[524] | 370 | c |
---|
[1146] | 371 | ENDIF ! of IF( forward. OR . leapf ) |
---|
[524] | 372 | |
---|
| 373 | |
---|
| 374 | c----------------------------------------------------------------------- |
---|
| 375 | c integrations dynamique et traceurs: |
---|
| 376 | c ---------------------------------- |
---|
| 377 | |
---|
[2298] | 378 | if (ok_iso_verif) then |
---|
| 379 | write(*,*) 'leapfrog 720' |
---|
| 380 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 756') |
---|
| 381 | endif !if (ok_iso_verif) then |
---|
| 382 | |
---|
| 383 | CALL integrd ( nqtot,vcovm1,ucovm1,tetam1,psm1,massem1 , |
---|
[1665] | 384 | $ dv,du,dteta,dq,dp,vcov,ucov,teta,q,ps,masse,phis ) |
---|
| 385 | ! $ finvmaold ) |
---|
[524] | 386 | |
---|
[2298] | 387 | if (ok_iso_verif) then |
---|
| 388 | write(*,*) 'leapfrog 724' |
---|
| 389 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 762') |
---|
| 390 | endif !if (ok_iso_verif) then |
---|
[524] | 391 | |
---|
| 392 | c .P.Le Van (26/04/94 ajout de finvpold dans l'appel d'integrd) |
---|
| 393 | c |
---|
| 394 | c----------------------------------------------------------------------- |
---|
| 395 | c calcul des tendances physiques: |
---|
| 396 | c ------------------------------- |
---|
| 397 | c ######## P.Le Van ( Modif le 6/02/95 ) ########### |
---|
| 398 | c |
---|
| 399 | IF( purmats ) THEN |
---|
| 400 | IF( itau.EQ.itaufin.AND..NOT.forward ) lafin = .TRUE. |
---|
| 401 | ELSE |
---|
| 402 | IF( itau+1. EQ. itaufin ) lafin = .TRUE. |
---|
| 403 | ENDIF |
---|
| 404 | c |
---|
| 405 | c |
---|
| 406 | IF( apphys ) THEN |
---|
| 407 | c |
---|
| 408 | c ....... Ajout P.Le Van ( 17/04/96 ) ........... |
---|
| 409 | c |
---|
| 410 | |
---|
| 411 | CALL pression ( ip1jmp1, ap, bp, ps, p ) |
---|
[1665] | 412 | if (pressure_exner) then |
---|
[2056] | 413 | CALL exner_hyb( ip1jmp1, ps, p,pks, pk, pkf ) |
---|
[1665] | 414 | else |
---|
[2056] | 415 | CALL exner_milieu( ip1jmp1, ps, p, pks, pk, pkf ) |
---|
[1520] | 416 | endif |
---|
[524] | 417 | |
---|
[2056] | 418 | ! Appel a geopot ajoute le 2014/05/08 pour garantir la convergence numerique |
---|
| 419 | ! avec dyn3dmem |
---|
| 420 | CALL geopot ( ip1jmp1, teta , pk , pks, phis , phi ) |
---|
| 421 | |
---|
[1279] | 422 | ! rdaym_ini = itau * dtvr / daysec |
---|
| 423 | ! rdayvrai = rdaym_ini + day_ini |
---|
[1665] | 424 | ! jD_cur = jD_ref + day_ini - day_ref |
---|
| 425 | ! $ + int (itau * dtvr / daysec) |
---|
| 426 | ! jH_cur = jH_ref + & |
---|
| 427 | ! & (itau * dtvr / daysec - int(itau * dtvr / daysec)) |
---|
| 428 | jD_cur = jD_ref + day_ini - day_ref + & |
---|
[2408] | 429 | & (itau+1)/day_step |
---|
[1707] | 430 | |
---|
| 431 | IF (planet_type .eq."generic") THEN |
---|
| 432 | ! AS: we make jD_cur to be pday |
---|
| 433 | jD_cur = int(day_ini + itau/day_step) |
---|
| 434 | ENDIF |
---|
| 435 | |
---|
[1665] | 436 | jH_cur = jH_ref + start_time + & |
---|
[2408] | 437 | & mod(itau+1,day_step)/float(day_step) |
---|
[1665] | 438 | jD_cur = jD_cur + int(jH_cur) |
---|
| 439 | jH_cur = jH_cur - int(jH_cur) |
---|
[1279] | 440 | ! write(lunout,*)'itau, jD_cur = ', itau, jD_cur, jH_cur |
---|
| 441 | ! call ju2ymds(jD_cur+jH_cur, an, mois, jour, secondes) |
---|
| 442 | ! write(lunout,*)'current date = ',an, mois, jour, secondes |
---|
[524] | 443 | |
---|
| 444 | c rajout debug |
---|
| 445 | c lafin = .true. |
---|
| 446 | |
---|
| 447 | |
---|
| 448 | c Inbterface avec les routines de phylmd (phymars ... ) |
---|
| 449 | c ----------------------------------------------------- |
---|
| 450 | |
---|
| 451 | c+jld |
---|
| 452 | |
---|
| 453 | c Diagnostique de conservation de l'énergie : initialisation |
---|
[1146] | 454 | IF (ip_ebil_dyn.ge.1 ) THEN |
---|
[524] | 455 | ztit='bil dyn' |
---|
[2408] | 456 | ! Ehouarn: be careful, diagedyn is Earth-specific! |
---|
[1146] | 457 | IF (planet_type.eq."earth") THEN |
---|
| 458 | CALL diagedyn(ztit,2,1,1,dtphys |
---|
| 459 | & , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) |
---|
| 460 | ENDIF |
---|
| 461 | ENDIF ! of IF (ip_ebil_dyn.ge.1 ) |
---|
[524] | 462 | c-jld |
---|
[1146] | 463 | #ifdef CPP_IOIPSL |
---|
[1669] | 464 | cIM decommenter les 6 lignes suivantes pour sortir quelques parametres dynamiques de LMDZ |
---|
| 465 | cIM uncomment next 6 lines to get some parameters for LMDZ dynamics |
---|
| 466 | c IF (first) THEN |
---|
| 467 | c first=.false. |
---|
| 468 | c#include "ini_paramLMDZ_dyn.h" |
---|
| 469 | c ENDIF |
---|
[692] | 470 | c |
---|
[1669] | 471 | c#include "write_paramLMDZ_dyn.h" |
---|
[692] | 472 | c |
---|
[1146] | 473 | #endif |
---|
| 474 | ! #endif of #ifdef CPP_IOIPSL |
---|
[2298] | 475 | #ifdef CPP_PHYS |
---|
[1279] | 476 | CALL calfis( lafin , jD_cur, jH_cur, |
---|
[524] | 477 | $ ucov,vcov,teta,q,masse,ps,p,pk,phis,phi , |
---|
[960] | 478 | $ du,dv,dteta,dq, |
---|
[2258] | 479 | $ flxw,dufi,dvfi,dtetafi,dqfi,dpfi ) |
---|
[2298] | 480 | #endif |
---|
[524] | 481 | c ajout des tendances physiques: |
---|
| 482 | c ------------------------------ |
---|
[1146] | 483 | CALL addfi( dtphys, leapf, forward , |
---|
[524] | 484 | $ ucov, vcov, teta , q ,ps , |
---|
| 485 | $ dufi, dvfi, dtetafi , dqfi ,dpfi ) |
---|
[1999] | 486 | ! since addfi updates ps(), also update p(), masse() and pk() |
---|
| 487 | CALL pression (ip1jmp1,ap,bp,ps,p) |
---|
| 488 | CALL massdair(p,masse) |
---|
| 489 | if (pressure_exner) then |
---|
[2056] | 490 | CALL exner_hyb(ip1jmp1,ps,p,pks,pk,pkf) |
---|
[1999] | 491 | else |
---|
[2056] | 492 | CALL exner_milieu(ip1jmp1,ps,p,pks,pk,pkf) |
---|
[1999] | 493 | endif |
---|
[1795] | 494 | |
---|
| 495 | IF (ok_strato) THEN |
---|
| 496 | CALL top_bound( vcov,ucov,teta,masse,dtphys) |
---|
| 497 | ENDIF |
---|
| 498 | |
---|
[524] | 499 | c |
---|
| 500 | c Diagnostique de conservation de l'énergie : difference |
---|
[1146] | 501 | IF (ip_ebil_dyn.ge.1 ) THEN |
---|
[524] | 502 | ztit='bil phys' |
---|
[1146] | 503 | IF (planet_type.eq."earth") THEN |
---|
| 504 | CALL diagedyn(ztit,2,1,1,dtphys |
---|
| 505 | & , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) |
---|
| 506 | ENDIF |
---|
| 507 | ENDIF ! of IF (ip_ebil_dyn.ge.1 ) |
---|
| 508 | |
---|
[1060] | 509 | ENDIF ! of IF( apphys ) |
---|
[524] | 510 | |
---|
[1146] | 511 | IF(iflag_phys.EQ.2) THEN ! "Newtonian" case |
---|
[1454] | 512 | ! Academic case : Simple friction and Newtonan relaxation |
---|
| 513 | ! ------------------------------------------------------- |
---|
| 514 | DO l=1,llm |
---|
| 515 | DO ij=1,ip1jmp1 |
---|
| 516 | teta(ij,l)=teta(ij,l)-dtvr* |
---|
| 517 | & (teta(ij,l)-tetarappel(ij,l))*(knewt_g+knewt_t(l)*clat4(ij)) |
---|
| 518 | ENDDO |
---|
| 519 | ENDDO ! of DO l=1,llm |
---|
| 520 | |
---|
[1505] | 521 | if (planet_type.eq."giant") then |
---|
| 522 | ! add an intrinsic heat flux at the base of the atmosphere |
---|
| 523 | teta(:,1)=teta(:,1)+dtvr*aire(:)*ihf/cpp/masse(:,1) |
---|
| 524 | endif |
---|
| 525 | |
---|
| 526 | call friction(ucov,vcov,dtvr) |
---|
| 527 | |
---|
[1454] | 528 | ! Sponge layer (if any) |
---|
| 529 | IF (ok_strato) THEN |
---|
[1795] | 530 | ! dufi(:,:)=0. |
---|
| 531 | ! dvfi(:,:)=0. |
---|
| 532 | ! dtetafi(:,:)=0. |
---|
| 533 | ! dqfi(:,:,:)=0. |
---|
| 534 | ! dpfi(:)=0. |
---|
| 535 | ! CALL top_bound(vcov,ucov,teta,masse,dufi,dvfi,dtetafi) |
---|
| 536 | CALL top_bound( vcov,ucov,teta,masse,dtvr) |
---|
| 537 | ! CALL addfi( dtvr, leapf, forward , |
---|
| 538 | ! $ ucov, vcov, teta , q ,ps , |
---|
| 539 | ! $ dufi, dvfi, dtetafi , dqfi ,dpfi ) |
---|
[1454] | 540 | ENDIF ! of IF (ok_strato) |
---|
| 541 | ENDIF ! of IF (iflag_phys.EQ.2) |
---|
[524] | 542 | |
---|
| 543 | |
---|
| 544 | c-jld |
---|
| 545 | |
---|
| 546 | CALL pression ( ip1jmp1, ap, bp, ps, p ) |
---|
[1665] | 547 | if (pressure_exner) then |
---|
[2056] | 548 | CALL exner_hyb( ip1jmp1, ps, p, pks, pk, pkf ) |
---|
[1665] | 549 | else |
---|
[2056] | 550 | CALL exner_milieu( ip1jmp1, ps, p, pks, pk, pkf ) |
---|
[1520] | 551 | endif |
---|
[1999] | 552 | CALL massdair(p,masse) |
---|
[524] | 553 | |
---|
[2298] | 554 | if (ok_iso_verif) then |
---|
| 555 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 1196') |
---|
| 556 | endif !if (ok_iso_verif) then |
---|
[524] | 557 | |
---|
| 558 | c----------------------------------------------------------------------- |
---|
| 559 | c dissipation horizontale et verticale des petites echelles: |
---|
| 560 | c ---------------------------------------------------------- |
---|
| 561 | |
---|
| 562 | IF(apdiss) THEN |
---|
| 563 | |
---|
| 564 | |
---|
| 565 | c calcul de l'energie cinetique avant dissipation |
---|
| 566 | call covcont(llm,ucov,vcov,ucont,vcont) |
---|
| 567 | call enercin(vcov,ucov,vcont,ucont,ecin0) |
---|
| 568 | |
---|
| 569 | c dissipation |
---|
| 570 | CALL dissip(vcov,ucov,teta,p,dvdis,dudis,dtetadis) |
---|
| 571 | ucov=ucov+dudis |
---|
| 572 | vcov=vcov+dvdis |
---|
| 573 | c teta=teta+dtetadis |
---|
| 574 | |
---|
| 575 | |
---|
| 576 | c------------------------------------------------------------------------ |
---|
| 577 | if (dissip_conservative) then |
---|
| 578 | C On rajoute la tendance due a la transform. Ec -> E therm. cree |
---|
| 579 | C lors de la dissipation |
---|
| 580 | call covcont(llm,ucov,vcov,ucont,vcont) |
---|
| 581 | call enercin(vcov,ucov,vcont,ucont,ecin) |
---|
| 582 | dtetaecdt= (ecin0-ecin)/ pk |
---|
| 583 | c teta=teta+dtetaecdt |
---|
| 584 | dtetadis=dtetadis+dtetaecdt |
---|
| 585 | endif |
---|
| 586 | teta=teta+dtetadis |
---|
| 587 | c------------------------------------------------------------------------ |
---|
| 588 | |
---|
| 589 | |
---|
| 590 | c ....... P. Le Van ( ajout le 17/04/96 ) ........... |
---|
| 591 | c ... Calcul de la valeur moyenne, unique de h aux poles ..... |
---|
| 592 | c |
---|
| 593 | |
---|
| 594 | DO l = 1, llm |
---|
| 595 | DO ij = 1,iim |
---|
| 596 | tppn(ij) = aire( ij ) * teta( ij ,l) |
---|
| 597 | tpps(ij) = aire(ij+ip1jm) * teta(ij+ip1jm,l) |
---|
| 598 | ENDDO |
---|
| 599 | tpn = SSUM(iim,tppn,1)/apoln |
---|
| 600 | tps = SSUM(iim,tpps,1)/apols |
---|
| 601 | |
---|
| 602 | DO ij = 1, iip1 |
---|
| 603 | teta( ij ,l) = tpn |
---|
| 604 | teta(ij+ip1jm,l) = tps |
---|
| 605 | ENDDO |
---|
| 606 | ENDDO |
---|
| 607 | |
---|
[1665] | 608 | if (1 == 0) then |
---|
| 609 | !!! Ehouarn: lines here 1) kill 1+1=2 in the dynamics |
---|
| 610 | !!! 2) should probably not be here anyway |
---|
| 611 | !!! but are kept for those who would want to revert to previous behaviour |
---|
| 612 | DO ij = 1,iim |
---|
| 613 | tppn(ij) = aire( ij ) * ps ( ij ) |
---|
| 614 | tpps(ij) = aire(ij+ip1jm) * ps (ij+ip1jm) |
---|
| 615 | ENDDO |
---|
| 616 | tpn = SSUM(iim,tppn,1)/apoln |
---|
| 617 | tps = SSUM(iim,tpps,1)/apols |
---|
[524] | 618 | |
---|
[1665] | 619 | DO ij = 1, iip1 |
---|
| 620 | ps( ij ) = tpn |
---|
| 621 | ps(ij+ip1jm) = tps |
---|
| 622 | ENDDO |
---|
| 623 | endif ! of if (1 == 0) |
---|
[524] | 624 | |
---|
[1146] | 625 | END IF ! of IF(apdiss) |
---|
[524] | 626 | |
---|
| 627 | c ajout debug |
---|
| 628 | c IF( lafin ) then |
---|
| 629 | c abort_message = 'Simulation finished' |
---|
| 630 | c call abort_gcm(modname,abort_message,0) |
---|
| 631 | c ENDIF |
---|
| 632 | |
---|
| 633 | c ******************************************************************** |
---|
| 634 | c ******************************************************************** |
---|
| 635 | c .... fin de l'integration dynamique et physique pour le pas itau .. |
---|
| 636 | c ******************************************************************** |
---|
| 637 | c ******************************************************************** |
---|
| 638 | |
---|
| 639 | c preparation du pas d'integration suivant ...... |
---|
| 640 | |
---|
[2298] | 641 | if (ok_iso_verif) then |
---|
| 642 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 1509') |
---|
| 643 | endif !if (ok_iso_verif) then |
---|
| 644 | |
---|
[524] | 645 | IF ( .NOT.purmats ) THEN |
---|
| 646 | c ........................................................ |
---|
| 647 | c .............. schema matsuno + leapfrog .............. |
---|
| 648 | c ........................................................ |
---|
| 649 | |
---|
| 650 | IF(forward. OR. leapf) THEN |
---|
| 651 | itau= itau + 1 |
---|
[1403] | 652 | c iday= day_ini+itau/day_step |
---|
| 653 | c time= REAL(itau-(iday-day_ini)*day_step)/day_step+time_0 |
---|
| 654 | c IF(time.GT.1.) THEN |
---|
| 655 | c time = time-1. |
---|
| 656 | c iday = iday+1 |
---|
| 657 | c ENDIF |
---|
[524] | 658 | ENDIF |
---|
| 659 | |
---|
| 660 | |
---|
| 661 | IF( itau. EQ. itaufinp1 ) then |
---|
[999] | 662 | if (flag_verif) then |
---|
[1279] | 663 | write(79,*) 'ucov',ucov |
---|
| 664 | write(80,*) 'vcov',vcov |
---|
| 665 | write(81,*) 'teta',teta |
---|
| 666 | write(82,*) 'ps',ps |
---|
| 667 | write(83,*) 'q',q |
---|
[999] | 668 | WRITE(85,*) 'q1 = ',q(:,:,1) |
---|
| 669 | WRITE(86,*) 'q3 = ',q(:,:,3) |
---|
| 670 | endif |
---|
[524] | 671 | |
---|
| 672 | abort_message = 'Simulation finished' |
---|
| 673 | |
---|
| 674 | call abort_gcm(modname,abort_message,0) |
---|
| 675 | ENDIF |
---|
| 676 | c----------------------------------------------------------------------- |
---|
| 677 | c ecriture du fichier histoire moyenne: |
---|
| 678 | c ------------------------------------- |
---|
| 679 | |
---|
| 680 | IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN |
---|
| 681 | IF(itau.EQ.itaufin) THEN |
---|
| 682 | iav=1 |
---|
| 683 | ELSE |
---|
| 684 | iav=0 |
---|
| 685 | ENDIF |
---|
[1146] | 686 | |
---|
[2488] | 687 | ! ! Ehouarn: re-compute geopotential for outputs |
---|
| 688 | CALL geopot(ip1jmp1,teta,pk,pks,phis,phi) |
---|
| 689 | |
---|
[1146] | 690 | IF (ok_dynzon) THEN |
---|
[524] | 691 | #ifdef CPP_IOIPSL |
---|
[1403] | 692 | CALL bilan_dyn(2,dtvr*iperiod,dtvr*day_step*periodav, |
---|
| 693 | & ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) |
---|
[524] | 694 | #endif |
---|
[1146] | 695 | END IF |
---|
[1403] | 696 | IF (ok_dyn_ave) THEN |
---|
| 697 | #ifdef CPP_IOIPSL |
---|
| 698 | CALL writedynav(itau,vcov, |
---|
| 699 | & ucov,teta,pk,phi,q,masse,ps,phis) |
---|
| 700 | #endif |
---|
| 701 | ENDIF |
---|
[524] | 702 | |
---|
[1403] | 703 | ENDIF ! of IF((MOD(itau,iperiod).EQ.0).OR.(itau.EQ.itaufin)) |
---|
[524] | 704 | |
---|
[2298] | 705 | if (ok_iso_verif) then |
---|
| 706 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 1584') |
---|
| 707 | endif !if (ok_iso_verif) then |
---|
| 708 | |
---|
[524] | 709 | c----------------------------------------------------------------------- |
---|
| 710 | c ecriture de la bande histoire: |
---|
| 711 | c ------------------------------ |
---|
| 712 | |
---|
[1403] | 713 | IF( MOD(itau,iecri).EQ.0) THEN |
---|
| 714 | ! Ehouarn: output only during LF or Backward Matsuno |
---|
[2641] | 715 | if (leapf.or.(.not.leapf.and.(.not.forward))) then |
---|
[1146] | 716 | CALL geopot(ip1jmp1,teta,pk,pks,phis,phi) |
---|
| 717 | unat=0. |
---|
| 718 | do l=1,llm |
---|
| 719 | unat(iip2:ip1jm,l)=ucov(iip2:ip1jm,l)/cu(iip2:ip1jm) |
---|
| 720 | vnat(:,l)=vcov(:,l)/cv(:) |
---|
| 721 | enddo |
---|
[524] | 722 | #ifdef CPP_IOIPSL |
---|
[1403] | 723 | if (ok_dyn_ins) then |
---|
| 724 | ! write(lunout,*) "leapfrog: call writehist, itau=",itau |
---|
[2641] | 725 | CALL writehist(itau,vcov,ucov,teta,phi,q,masse,ps,phis) |
---|
[1403] | 726 | ! call WriteField('ucov',reshape(ucov,(/iip1,jmp1,llm/))) |
---|
| 727 | ! call WriteField('vcov',reshape(vcov,(/iip1,jjm,llm/))) |
---|
| 728 | ! call WriteField('teta',reshape(teta,(/iip1,jmp1,llm/))) |
---|
| 729 | ! call WriteField('ps',reshape(ps,(/iip1,jmp1/))) |
---|
| 730 | ! call WriteField('masse',reshape(masse,(/iip1,jmp1,llm/))) |
---|
| 731 | endif ! of if (ok_dyn_ins) |
---|
[1146] | 732 | #endif |
---|
| 733 | ! For some Grads outputs of fields |
---|
[1403] | 734 | if (output_grads_dyn) then |
---|
[524] | 735 | #include "write_grads_dyn.h" |
---|
[1403] | 736 | endif |
---|
| 737 | endif ! of if (leapf.or.(.not.leapf.and.(.not.forward))) |
---|
[1146] | 738 | ENDIF ! of IF(MOD(itau,iecri).EQ.0) |
---|
[524] | 739 | |
---|
| 740 | IF(itau.EQ.itaufin) THEN |
---|
| 741 | |
---|
| 742 | |
---|
[1454] | 743 | ! if (planet_type.eq."earth") then |
---|
[1146] | 744 | ! Write an Earth-format restart file |
---|
[1665] | 745 | CALL dynredem1("restart.nc",start_time, |
---|
[1146] | 746 | & vcov,ucov,teta,q,masse,ps) |
---|
[1454] | 747 | ! endif ! of if (planet_type.eq."earth") |
---|
[524] | 748 | |
---|
| 749 | CLOSE(99) |
---|
[1665] | 750 | !!! Ehouarn: Why not stop here and now? |
---|
[1146] | 751 | ENDIF ! of IF (itau.EQ.itaufin) |
---|
[524] | 752 | |
---|
| 753 | c----------------------------------------------------------------------- |
---|
| 754 | c gestion de l'integration temporelle: |
---|
| 755 | c ------------------------------------ |
---|
| 756 | |
---|
| 757 | IF( MOD(itau,iperiod).EQ.0 ) THEN |
---|
| 758 | GO TO 1 |
---|
| 759 | ELSE IF ( MOD(itau-1,iperiod). EQ. 0 ) THEN |
---|
| 760 | |
---|
| 761 | IF( forward ) THEN |
---|
| 762 | c fin du pas forward et debut du pas backward |
---|
| 763 | |
---|
| 764 | forward = .FALSE. |
---|
| 765 | leapf = .FALSE. |
---|
| 766 | GO TO 2 |
---|
| 767 | |
---|
| 768 | ELSE |
---|
| 769 | c fin du pas backward et debut du premier pas leapfrog |
---|
| 770 | |
---|
| 771 | leapf = .TRUE. |
---|
| 772 | dt = 2.*dtvr |
---|
[1146] | 773 | GO TO 2 |
---|
| 774 | END IF ! of IF (forward) |
---|
[524] | 775 | ELSE |
---|
| 776 | |
---|
| 777 | c ...... pas leapfrog ..... |
---|
| 778 | |
---|
| 779 | leapf = .TRUE. |
---|
| 780 | dt = 2.*dtvr |
---|
| 781 | GO TO 2 |
---|
[1146] | 782 | END IF ! of IF (MOD(itau,iperiod).EQ.0) |
---|
| 783 | ! ELSEIF (MOD(itau-1,iperiod).EQ.0) |
---|
[524] | 784 | |
---|
[1146] | 785 | ELSE ! of IF (.not.purmats) |
---|
[524] | 786 | |
---|
[2298] | 787 | if (ok_iso_verif) then |
---|
| 788 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 1664') |
---|
| 789 | endif !if (ok_iso_verif) then |
---|
| 790 | |
---|
[524] | 791 | c ........................................................ |
---|
| 792 | c .............. schema matsuno ............... |
---|
| 793 | c ........................................................ |
---|
| 794 | IF( forward ) THEN |
---|
| 795 | |
---|
| 796 | itau = itau + 1 |
---|
[1403] | 797 | c iday = day_ini+itau/day_step |
---|
| 798 | c time = REAL(itau-(iday-day_ini)*day_step)/day_step+time_0 |
---|
| 799 | c |
---|
| 800 | c IF(time.GT.1.) THEN |
---|
| 801 | c time = time-1. |
---|
| 802 | c iday = iday+1 |
---|
| 803 | c ENDIF |
---|
[524] | 804 | |
---|
| 805 | forward = .FALSE. |
---|
| 806 | IF( itau. EQ. itaufinp1 ) then |
---|
| 807 | abort_message = 'Simulation finished' |
---|
| 808 | call abort_gcm(modname,abort_message,0) |
---|
| 809 | ENDIF |
---|
| 810 | GO TO 2 |
---|
| 811 | |
---|
[1403] | 812 | ELSE ! of IF(forward) i.e. backward step |
---|
[2298] | 813 | |
---|
| 814 | if (ok_iso_verif) then |
---|
| 815 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 1698') |
---|
| 816 | endif !if (ok_iso_verif) then |
---|
[524] | 817 | |
---|
[1146] | 818 | IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN |
---|
[524] | 819 | IF(itau.EQ.itaufin) THEN |
---|
| 820 | iav=1 |
---|
| 821 | ELSE |
---|
| 822 | iav=0 |
---|
| 823 | ENDIF |
---|
[1146] | 824 | |
---|
[2488] | 825 | ! ! Ehouarn: re-compute geopotential for outputs |
---|
| 826 | CALL geopot(ip1jmp1,teta,pk,pks,phis,phi) |
---|
| 827 | |
---|
[1146] | 828 | IF (ok_dynzon) THEN |
---|
[524] | 829 | #ifdef CPP_IOIPSL |
---|
[1403] | 830 | CALL bilan_dyn(2,dtvr*iperiod,dtvr*day_step*periodav, |
---|
| 831 | & ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) |
---|
[524] | 832 | #endif |
---|
[1403] | 833 | ENDIF |
---|
| 834 | IF (ok_dyn_ave) THEN |
---|
| 835 | #ifdef CPP_IOIPSL |
---|
| 836 | CALL writedynav(itau,vcov, |
---|
| 837 | & ucov,teta,pk,phi,q,masse,ps,phis) |
---|
| 838 | #endif |
---|
| 839 | ENDIF |
---|
[524] | 840 | |
---|
[1146] | 841 | ENDIF ! of IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) |
---|
[524] | 842 | |
---|
[1146] | 843 | IF(MOD(itau,iecri ).EQ.0) THEN |
---|
[524] | 844 | c IF(MOD(itau,iecri*day_step).EQ.0) THEN |
---|
[1146] | 845 | CALL geopot(ip1jmp1,teta,pk,pks,phis,phi) |
---|
| 846 | unat=0. |
---|
| 847 | do l=1,llm |
---|
| 848 | unat(iip2:ip1jm,l)=ucov(iip2:ip1jm,l)/cu(iip2:ip1jm) |
---|
| 849 | vnat(:,l)=vcov(:,l)/cv(:) |
---|
| 850 | enddo |
---|
[524] | 851 | #ifdef CPP_IOIPSL |
---|
[1403] | 852 | if (ok_dyn_ins) then |
---|
| 853 | ! write(lunout,*) "leapfrog: call writehist (b)", |
---|
| 854 | ! & itau,iecri |
---|
[2641] | 855 | CALL writehist(itau,vcov,ucov,teta,phi,q,masse,ps,phis) |
---|
[1403] | 856 | endif ! of if (ok_dyn_ins) |
---|
[1146] | 857 | #endif |
---|
| 858 | ! For some Grads outputs |
---|
| 859 | if (output_grads_dyn) then |
---|
[524] | 860 | #include "write_grads_dyn.h" |
---|
[1146] | 861 | endif |
---|
[524] | 862 | |
---|
[1146] | 863 | ENDIF ! of IF(MOD(itau,iecri ).EQ.0) |
---|
[524] | 864 | |
---|
[1146] | 865 | IF(itau.EQ.itaufin) THEN |
---|
[1454] | 866 | ! if (planet_type.eq."earth") then |
---|
[1665] | 867 | CALL dynredem1("restart.nc",start_time, |
---|
[1146] | 868 | & vcov,ucov,teta,q,masse,ps) |
---|
[1454] | 869 | ! endif ! of if (planet_type.eq."earth") |
---|
[1146] | 870 | ENDIF ! of IF(itau.EQ.itaufin) |
---|
[524] | 871 | |
---|
[1146] | 872 | forward = .TRUE. |
---|
| 873 | GO TO 1 |
---|
[524] | 874 | |
---|
[1146] | 875 | ENDIF ! of IF (forward) |
---|
[524] | 876 | |
---|
[1146] | 877 | END IF ! of IF(.not.purmats) |
---|
[524] | 878 | |
---|
| 879 | STOP |
---|
| 880 | END |
---|