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