[524] | 1 | ! |
---|
[1279] | 2 | ! $Id: leapfrog.F 2298 2015-06-14 19:13:32Z dcugnet $ |
---|
| 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 |
---|
| 22 | |
---|
[524] | 23 | IMPLICIT NONE |
---|
| 24 | |
---|
| 25 | c ...... Version du 10/01/98 .......... |
---|
| 26 | |
---|
| 27 | c avec coordonnees verticales hybrides |
---|
| 28 | c avec nouveaux operat. dissipation * ( gradiv2,divgrad2,nxgraro2 ) |
---|
| 29 | |
---|
| 30 | c======================================================================= |
---|
| 31 | c |
---|
| 32 | c Auteur: P. Le Van /L. Fairhead/F.Hourdin |
---|
| 33 | c ------- |
---|
| 34 | c |
---|
| 35 | c Objet: |
---|
| 36 | c ------ |
---|
| 37 | c |
---|
| 38 | c GCM LMD nouvelle grille |
---|
| 39 | c |
---|
| 40 | c======================================================================= |
---|
| 41 | c |
---|
| 42 | c ... Dans inigeom , nouveaux calculs pour les elongations cu , cv |
---|
| 43 | c et possibilite d'appeler une fonction f(y) a derivee tangente |
---|
| 44 | c hyperbolique a la place de la fonction a derivee sinusoidale. |
---|
| 45 | |
---|
| 46 | c ... Possibilite de choisir le shema pour l'advection de |
---|
| 47 | c q , en modifiant iadv dans traceur.def (10/02) . |
---|
| 48 | c |
---|
| 49 | c Pour Van-Leer + Vapeur d'eau saturee, iadv(1)=4. (F.Codron,10/99) |
---|
| 50 | c Pour Van-Leer iadv=10 |
---|
| 51 | c |
---|
| 52 | c----------------------------------------------------------------------- |
---|
| 53 | c Declarations: |
---|
| 54 | c ------------- |
---|
| 55 | |
---|
| 56 | #include "dimensions.h" |
---|
| 57 | #include "paramet.h" |
---|
| 58 | #include "comconst.h" |
---|
| 59 | #include "comdissnew.h" |
---|
| 60 | #include "comvert.h" |
---|
| 61 | #include "comgeom.h" |
---|
| 62 | #include "logic.h" |
---|
| 63 | #include "temps.h" |
---|
| 64 | #include "ener.h" |
---|
| 65 | #include "description.h" |
---|
| 66 | #include "serre.h" |
---|
[1403] | 67 | !#include "com_io_dyn.h" |
---|
[524] | 68 | #include "iniprint.h" |
---|
| 69 | #include "academic.h" |
---|
| 70 | |
---|
[1999] | 71 | REAL,INTENT(IN) :: time_0 ! not used |
---|
[524] | 72 | |
---|
[1999] | 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 |
---|
[1665] | 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 | |
---|
[2056] | 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 ) |
---|
[1665] | 218 | if (pressure_exner) then |
---|
[2056] | 219 | CALL exner_hyb( ip1jmp1, ps, p, pks, pk, pkf ) |
---|
[1665] | 220 | else |
---|
[2056] | 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 | |
---|
[1665] | 228 | 1 CONTINUE ! Matsuno Forward step begins here |
---|
[524] | 229 | |
---|
[1665] | 230 | jD_cur = jD_ref + day_ini - day_ref + & |
---|
| 231 | & itau/day_step |
---|
| 232 | jH_cur = jH_ref + start_time + & |
---|
| 233 | & mod(itau,day_step)/float(day_step) |
---|
| 234 | jD_cur = jD_cur + int(jH_cur) |
---|
| 235 | jH_cur = jH_cur - int(jH_cur) |
---|
[524] | 236 | |
---|
[2298] | 237 | if (ok_iso_verif) then |
---|
| 238 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 321') |
---|
| 239 | endif !if (ok_iso_verif) then |
---|
[1279] | 240 | |
---|
[524] | 241 | #ifdef CPP_IOIPSL |
---|
[1279] | 242 | if (ok_guide) then |
---|
| 243 | call guide_main(itau,ucov,vcov,teta,q,masse,ps) |
---|
[524] | 244 | endif |
---|
| 245 | #endif |
---|
[1279] | 246 | |
---|
| 247 | |
---|
[524] | 248 | c |
---|
| 249 | c IF( MOD( itau, 10* day_step ).EQ.0 ) THEN |
---|
| 250 | c CALL test_period ( ucov,vcov,teta,q,p,phis ) |
---|
| 251 | c PRINT *,' ---- Test_period apres continue OK ! -----', itau |
---|
| 252 | c ENDIF |
---|
| 253 | c |
---|
[1146] | 254 | |
---|
| 255 | ! Save fields obtained at previous time step as '...m1' |
---|
[524] | 256 | CALL SCOPY( ijmllm ,vcov , 1, vcovm1 , 1 ) |
---|
| 257 | CALL SCOPY( ijp1llm,ucov , 1, ucovm1 , 1 ) |
---|
| 258 | CALL SCOPY( ijp1llm,teta , 1, tetam1 , 1 ) |
---|
| 259 | CALL SCOPY( ijp1llm,masse, 1, massem1, 1 ) |
---|
| 260 | CALL SCOPY( ip1jmp1, ps , 1, psm1 , 1 ) |
---|
| 261 | |
---|
| 262 | forward = .TRUE. |
---|
| 263 | leapf = .FALSE. |
---|
| 264 | dt = dtvr |
---|
| 265 | |
---|
| 266 | c ... P.Le Van .26/04/94 .... |
---|
[1665] | 267 | ! Ehouarn: finvmaold is actually not used |
---|
| 268 | ! CALL SCOPY ( ijp1llm, masse, 1, finvmaold, 1 ) |
---|
| 269 | ! CALL filtreg ( finvmaold ,jjp1, llm, -2,2, .TRUE., 1 ) |
---|
[524] | 270 | |
---|
[2298] | 271 | if (ok_iso_verif) then |
---|
| 272 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 400') |
---|
| 273 | endif !if (ok_iso_verif) then |
---|
| 274 | |
---|
[1665] | 275 | 2 CONTINUE ! Matsuno backward or leapfrog step begins here |
---|
[524] | 276 | |
---|
| 277 | c----------------------------------------------------------------------- |
---|
| 278 | |
---|
| 279 | c date: |
---|
| 280 | c ----- |
---|
| 281 | |
---|
| 282 | |
---|
| 283 | c gestion des appels de la physique et des dissipations: |
---|
| 284 | c ------------------------------------------------------ |
---|
| 285 | c |
---|
| 286 | c ... P.Le Van ( 6/02/95 ) .... |
---|
| 287 | |
---|
| 288 | apphys = .FALSE. |
---|
| 289 | statcl = .FALSE. |
---|
| 290 | conser = .FALSE. |
---|
| 291 | apdiss = .FALSE. |
---|
| 292 | |
---|
| 293 | IF( purmats ) THEN |
---|
[1403] | 294 | ! Purely Matsuno time stepping |
---|
[524] | 295 | IF( MOD(itau,iconser) .EQ.0.AND. forward ) conser = .TRUE. |
---|
[1502] | 296 | IF( MOD(itau,dissip_period ).EQ.0.AND..NOT.forward ) |
---|
| 297 | s apdiss = .TRUE. |
---|
[524] | 298 | IF( MOD(itau,iphysiq ).EQ.0.AND..NOT.forward |
---|
[1529] | 299 | s .and. physic ) apphys = .TRUE. |
---|
[524] | 300 | ELSE |
---|
[1403] | 301 | ! Leapfrog/Matsuno time stepping |
---|
[524] | 302 | IF( MOD(itau ,iconser) .EQ. 0 ) conser = .TRUE. |
---|
[1502] | 303 | IF( MOD(itau+1,dissip_period).EQ.0 .AND. .NOT. forward ) |
---|
| 304 | s apdiss = .TRUE. |
---|
[1529] | 305 | IF( MOD(itau+1,iphysiq).EQ.0.AND.physic ) apphys=.TRUE. |
---|
[524] | 306 | END IF |
---|
| 307 | |
---|
[1403] | 308 | ! Ehouarn: for Shallow Water case (ie: 1 vertical layer), |
---|
| 309 | ! supress dissipation step |
---|
| 310 | if (llm.eq.1) then |
---|
| 311 | apdiss=.false. |
---|
| 312 | endif |
---|
| 313 | |
---|
[2298] | 314 | |
---|
| 315 | if (ok_iso_verif) then |
---|
| 316 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 589') |
---|
| 317 | endif !if (ok_iso_verif) then |
---|
| 318 | |
---|
[524] | 319 | c----------------------------------------------------------------------- |
---|
| 320 | c calcul des tendances dynamiques: |
---|
| 321 | c -------------------------------- |
---|
| 322 | |
---|
[1665] | 323 | ! compute geopotential phi() |
---|
[524] | 324 | CALL geopot ( ip1jmp1, teta , pk , pks, phis , phi ) |
---|
| 325 | |
---|
[1279] | 326 | time = jD_cur + jH_cur |
---|
[524] | 327 | CALL caldyn |
---|
| 328 | $ ( itau,ucov,vcov,teta,ps,masse,pk,pkf,phis , |
---|
[1279] | 329 | $ phi,conser,du,dv,dteta,dp,w, pbaru,pbarv, time ) |
---|
[524] | 330 | |
---|
[1279] | 331 | |
---|
[524] | 332 | c----------------------------------------------------------------------- |
---|
| 333 | c calcul des tendances advection des traceurs (dont l'humidite) |
---|
| 334 | c ------------------------------------------------------------- |
---|
| 335 | |
---|
[2298] | 336 | if (ok_iso_verif) then |
---|
| 337 | call check_isotopes_seq(q,ip1jmp1, |
---|
| 338 | & 'leapfrog 686: avant caladvtrac') |
---|
| 339 | endif !if (ok_iso_verif) then |
---|
| 340 | |
---|
[524] | 341 | IF( forward. OR . leapf ) THEN |
---|
[1999] | 342 | ! Ehouarn: NB: fields sent to advtrac are those at the beginning of the time step |
---|
[960] | 343 | CALL caladvtrac(q,pbaru,pbarv, |
---|
| 344 | * p, masse, dq, teta, |
---|
| 345 | . flxw, pk) |
---|
[2298] | 346 | !write(*,*) 'caladvtrac 346' |
---|
| 347 | |
---|
[960] | 348 | |
---|
[524] | 349 | IF (offline) THEN |
---|
| 350 | Cmaf stokage du flux de masse pour traceurs OFF-LINE |
---|
| 351 | |
---|
| 352 | #ifdef CPP_IOIPSL |
---|
[541] | 353 | CALL fluxstokenc(pbaru,pbarv,masse,teta,phi,phis, |
---|
| 354 | . dtvr, itau) |
---|
[524] | 355 | #endif |
---|
| 356 | |
---|
| 357 | |
---|
[1146] | 358 | ENDIF ! of IF (offline) |
---|
[524] | 359 | c |
---|
[1146] | 360 | ENDIF ! of IF( forward. OR . leapf ) |
---|
[524] | 361 | |
---|
| 362 | |
---|
| 363 | c----------------------------------------------------------------------- |
---|
| 364 | c integrations dynamique et traceurs: |
---|
| 365 | c ---------------------------------- |
---|
| 366 | |
---|
[2298] | 367 | if (ok_iso_verif) then |
---|
| 368 | write(*,*) 'leapfrog 720' |
---|
| 369 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 756') |
---|
| 370 | endif !if (ok_iso_verif) then |
---|
| 371 | |
---|
| 372 | CALL integrd ( nqtot,vcovm1,ucovm1,tetam1,psm1,massem1 , |
---|
[1665] | 373 | $ dv,du,dteta,dq,dp,vcov,ucov,teta,q,ps,masse,phis ) |
---|
| 374 | ! $ finvmaold ) |
---|
[524] | 375 | |
---|
[2298] | 376 | if (ok_iso_verif) then |
---|
| 377 | write(*,*) 'leapfrog 724' |
---|
| 378 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 762') |
---|
| 379 | endif !if (ok_iso_verif) then |
---|
[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 ) |
---|
[1665] | 401 | if (pressure_exner) then |
---|
[2056] | 402 | CALL exner_hyb( ip1jmp1, ps, p,pks, pk, pkf ) |
---|
[1665] | 403 | else |
---|
[2056] | 404 | CALL exner_milieu( ip1jmp1, ps, p, pks, pk, pkf ) |
---|
[1520] | 405 | endif |
---|
[524] | 406 | |
---|
[2056] | 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 |
---|
[1665] | 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 + & |
---|
| 418 | & itau/day_step |
---|
[1707] | 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 | |
---|
[1665] | 425 | jH_cur = jH_ref + start_time + & |
---|
| 426 | & mod(itau,day_step)/float(day_step) |
---|
| 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 | |
---|
| 442 | c Diagnostique de conservation de l'énergie : initialisation |
---|
[1146] | 443 | IF (ip_ebil_dyn.ge.1 ) THEN |
---|
[524] | 444 | ztit='bil dyn' |
---|
[1146] | 445 | ! Ehouarn: be careful, diagedyn is Earth-specific (includes ../phylmd/..)! |
---|
| 446 | IF (planet_type.eq."earth") THEN |
---|
[1665] | 447 | #ifdef CPP_EARTH |
---|
[1146] | 448 | CALL diagedyn(ztit,2,1,1,dtphys |
---|
| 449 | & , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) |
---|
[1665] | 450 | #endif |
---|
[1146] | 451 | ENDIF |
---|
| 452 | ENDIF ! of IF (ip_ebil_dyn.ge.1 ) |
---|
[524] | 453 | c-jld |
---|
[1146] | 454 | #ifdef CPP_IOIPSL |
---|
[1669] | 455 | cIM decommenter les 6 lignes suivantes pour sortir quelques parametres dynamiques de LMDZ |
---|
| 456 | cIM uncomment next 6 lines to get some parameters for LMDZ dynamics |
---|
| 457 | c IF (first) THEN |
---|
| 458 | c first=.false. |
---|
| 459 | c#include "ini_paramLMDZ_dyn.h" |
---|
| 460 | c ENDIF |
---|
[692] | 461 | c |
---|
[1669] | 462 | c#include "write_paramLMDZ_dyn.h" |
---|
[692] | 463 | c |
---|
[1146] | 464 | #endif |
---|
| 465 | ! #endif of #ifdef CPP_IOIPSL |
---|
[2298] | 466 | #ifdef CPP_PHYS |
---|
[1279] | 467 | CALL calfis( lafin , jD_cur, jH_cur, |
---|
[524] | 468 | $ ucov,vcov,teta,q,masse,ps,p,pk,phis,phi , |
---|
[960] | 469 | $ du,dv,dteta,dq, |
---|
[2258] | 470 | $ flxw,dufi,dvfi,dtetafi,dqfi,dpfi ) |
---|
[2298] | 471 | #endif |
---|
[524] | 472 | c ajout des tendances physiques: |
---|
| 473 | c ------------------------------ |
---|
[1146] | 474 | CALL addfi( dtphys, leapf, forward , |
---|
[524] | 475 | $ ucov, vcov, teta , q ,ps , |
---|
| 476 | $ dufi, dvfi, dtetafi , dqfi ,dpfi ) |
---|
[1999] | 477 | ! since addfi updates ps(), also update p(), masse() and pk() |
---|
| 478 | CALL pression (ip1jmp1,ap,bp,ps,p) |
---|
| 479 | CALL massdair(p,masse) |
---|
| 480 | if (pressure_exner) then |
---|
[2056] | 481 | CALL exner_hyb(ip1jmp1,ps,p,pks,pk,pkf) |
---|
[1999] | 482 | else |
---|
[2056] | 483 | CALL exner_milieu(ip1jmp1,ps,p,pks,pk,pkf) |
---|
[1999] | 484 | endif |
---|
[1795] | 485 | |
---|
| 486 | IF (ok_strato) THEN |
---|
| 487 | CALL top_bound( vcov,ucov,teta,masse,dtphys) |
---|
| 488 | ENDIF |
---|
| 489 | |
---|
[524] | 490 | c |
---|
| 491 | c Diagnostique de conservation de l'énergie : difference |
---|
[1146] | 492 | IF (ip_ebil_dyn.ge.1 ) THEN |
---|
[524] | 493 | ztit='bil phys' |
---|
[1146] | 494 | IF (planet_type.eq."earth") THEN |
---|
| 495 | CALL diagedyn(ztit,2,1,1,dtphys |
---|
| 496 | & , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) |
---|
| 497 | ENDIF |
---|
| 498 | ENDIF ! of IF (ip_ebil_dyn.ge.1 ) |
---|
| 499 | |
---|
[1060] | 500 | ENDIF ! of IF( apphys ) |
---|
[524] | 501 | |
---|
[1146] | 502 | IF(iflag_phys.EQ.2) THEN ! "Newtonian" case |
---|
[1454] | 503 | ! Academic case : Simple friction and Newtonan relaxation |
---|
| 504 | ! ------------------------------------------------------- |
---|
| 505 | DO l=1,llm |
---|
| 506 | DO ij=1,ip1jmp1 |
---|
| 507 | teta(ij,l)=teta(ij,l)-dtvr* |
---|
| 508 | & (teta(ij,l)-tetarappel(ij,l))*(knewt_g+knewt_t(l)*clat4(ij)) |
---|
| 509 | ENDDO |
---|
| 510 | ENDDO ! of DO l=1,llm |
---|
| 511 | |
---|
[1505] | 512 | if (planet_type.eq."giant") then |
---|
| 513 | ! add an intrinsic heat flux at the base of the atmosphere |
---|
| 514 | teta(:,1)=teta(:,1)+dtvr*aire(:)*ihf/cpp/masse(:,1) |
---|
| 515 | endif |
---|
| 516 | |
---|
| 517 | call friction(ucov,vcov,dtvr) |
---|
| 518 | |
---|
[1454] | 519 | ! Sponge layer (if any) |
---|
| 520 | IF (ok_strato) THEN |
---|
[1795] | 521 | ! dufi(:,:)=0. |
---|
| 522 | ! dvfi(:,:)=0. |
---|
| 523 | ! dtetafi(:,:)=0. |
---|
| 524 | ! dqfi(:,:,:)=0. |
---|
| 525 | ! dpfi(:)=0. |
---|
| 526 | ! CALL top_bound(vcov,ucov,teta,masse,dufi,dvfi,dtetafi) |
---|
| 527 | CALL top_bound( vcov,ucov,teta,masse,dtvr) |
---|
| 528 | ! CALL addfi( dtvr, leapf, forward , |
---|
| 529 | ! $ ucov, vcov, teta , q ,ps , |
---|
| 530 | ! $ dufi, dvfi, dtetafi , dqfi ,dpfi ) |
---|
[1454] | 531 | ENDIF ! of IF (ok_strato) |
---|
| 532 | ENDIF ! of IF (iflag_phys.EQ.2) |
---|
[524] | 533 | |
---|
| 534 | |
---|
| 535 | c-jld |
---|
| 536 | |
---|
| 537 | CALL pression ( ip1jmp1, ap, bp, ps, p ) |
---|
[1665] | 538 | if (pressure_exner) then |
---|
[2056] | 539 | CALL exner_hyb( ip1jmp1, ps, p, pks, pk, pkf ) |
---|
[1665] | 540 | else |
---|
[2056] | 541 | CALL exner_milieu( ip1jmp1, ps, p, pks, pk, pkf ) |
---|
[1520] | 542 | endif |
---|
[1999] | 543 | CALL massdair(p,masse) |
---|
[524] | 544 | |
---|
[2298] | 545 | if (ok_iso_verif) then |
---|
| 546 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 1196') |
---|
| 547 | endif !if (ok_iso_verif) then |
---|
[524] | 548 | |
---|
| 549 | c----------------------------------------------------------------------- |
---|
| 550 | c dissipation horizontale et verticale des petites echelles: |
---|
| 551 | c ---------------------------------------------------------- |
---|
| 552 | |
---|
| 553 | IF(apdiss) THEN |
---|
| 554 | |
---|
| 555 | |
---|
| 556 | c calcul de l'energie cinetique avant dissipation |
---|
| 557 | call covcont(llm,ucov,vcov,ucont,vcont) |
---|
| 558 | call enercin(vcov,ucov,vcont,ucont,ecin0) |
---|
| 559 | |
---|
| 560 | c dissipation |
---|
| 561 | CALL dissip(vcov,ucov,teta,p,dvdis,dudis,dtetadis) |
---|
| 562 | ucov=ucov+dudis |
---|
| 563 | vcov=vcov+dvdis |
---|
| 564 | c teta=teta+dtetadis |
---|
| 565 | |
---|
| 566 | |
---|
| 567 | c------------------------------------------------------------------------ |
---|
| 568 | if (dissip_conservative) then |
---|
| 569 | C On rajoute la tendance due a la transform. Ec -> E therm. cree |
---|
| 570 | C lors de la dissipation |
---|
| 571 | call covcont(llm,ucov,vcov,ucont,vcont) |
---|
| 572 | call enercin(vcov,ucov,vcont,ucont,ecin) |
---|
| 573 | dtetaecdt= (ecin0-ecin)/ pk |
---|
| 574 | c teta=teta+dtetaecdt |
---|
| 575 | dtetadis=dtetadis+dtetaecdt |
---|
| 576 | endif |
---|
| 577 | teta=teta+dtetadis |
---|
| 578 | c------------------------------------------------------------------------ |
---|
| 579 | |
---|
| 580 | |
---|
| 581 | c ....... P. Le Van ( ajout le 17/04/96 ) ........... |
---|
| 582 | c ... Calcul de la valeur moyenne, unique de h aux poles ..... |
---|
| 583 | c |
---|
| 584 | |
---|
| 585 | DO l = 1, llm |
---|
| 586 | DO ij = 1,iim |
---|
| 587 | tppn(ij) = aire( ij ) * teta( ij ,l) |
---|
| 588 | tpps(ij) = aire(ij+ip1jm) * teta(ij+ip1jm,l) |
---|
| 589 | ENDDO |
---|
| 590 | tpn = SSUM(iim,tppn,1)/apoln |
---|
| 591 | tps = SSUM(iim,tpps,1)/apols |
---|
| 592 | |
---|
| 593 | DO ij = 1, iip1 |
---|
| 594 | teta( ij ,l) = tpn |
---|
| 595 | teta(ij+ip1jm,l) = tps |
---|
| 596 | ENDDO |
---|
| 597 | ENDDO |
---|
| 598 | |
---|
[1665] | 599 | if (1 == 0) then |
---|
| 600 | !!! Ehouarn: lines here 1) kill 1+1=2 in the dynamics |
---|
| 601 | !!! 2) should probably not be here anyway |
---|
| 602 | !!! but are kept for those who would want to revert to previous behaviour |
---|
| 603 | DO ij = 1,iim |
---|
| 604 | tppn(ij) = aire( ij ) * ps ( ij ) |
---|
| 605 | tpps(ij) = aire(ij+ip1jm) * ps (ij+ip1jm) |
---|
| 606 | ENDDO |
---|
| 607 | tpn = SSUM(iim,tppn,1)/apoln |
---|
| 608 | tps = SSUM(iim,tpps,1)/apols |
---|
[524] | 609 | |
---|
[1665] | 610 | DO ij = 1, iip1 |
---|
| 611 | ps( ij ) = tpn |
---|
| 612 | ps(ij+ip1jm) = tps |
---|
| 613 | ENDDO |
---|
| 614 | endif ! of if (1 == 0) |
---|
[524] | 615 | |
---|
[1146] | 616 | END IF ! of IF(apdiss) |
---|
[524] | 617 | |
---|
| 618 | c ajout debug |
---|
| 619 | c IF( lafin ) then |
---|
| 620 | c abort_message = 'Simulation finished' |
---|
| 621 | c call abort_gcm(modname,abort_message,0) |
---|
| 622 | c ENDIF |
---|
| 623 | |
---|
| 624 | c ******************************************************************** |
---|
| 625 | c ******************************************************************** |
---|
| 626 | c .... fin de l'integration dynamique et physique pour le pas itau .. |
---|
| 627 | c ******************************************************************** |
---|
| 628 | c ******************************************************************** |
---|
| 629 | |
---|
| 630 | c preparation du pas d'integration suivant ...... |
---|
| 631 | |
---|
[2298] | 632 | if (ok_iso_verif) then |
---|
| 633 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 1509') |
---|
| 634 | endif !if (ok_iso_verif) then |
---|
| 635 | |
---|
[524] | 636 | IF ( .NOT.purmats ) THEN |
---|
| 637 | c ........................................................ |
---|
| 638 | c .............. schema matsuno + leapfrog .............. |
---|
| 639 | c ........................................................ |
---|
| 640 | |
---|
| 641 | IF(forward. OR. leapf) THEN |
---|
| 642 | itau= itau + 1 |
---|
[1403] | 643 | c iday= day_ini+itau/day_step |
---|
| 644 | c time= REAL(itau-(iday-day_ini)*day_step)/day_step+time_0 |
---|
| 645 | c IF(time.GT.1.) THEN |
---|
| 646 | c time = time-1. |
---|
| 647 | c iday = iday+1 |
---|
| 648 | c ENDIF |
---|
[524] | 649 | ENDIF |
---|
| 650 | |
---|
| 651 | |
---|
| 652 | IF( itau. EQ. itaufinp1 ) then |
---|
[999] | 653 | if (flag_verif) then |
---|
[1279] | 654 | write(79,*) 'ucov',ucov |
---|
| 655 | write(80,*) 'vcov',vcov |
---|
| 656 | write(81,*) 'teta',teta |
---|
| 657 | write(82,*) 'ps',ps |
---|
| 658 | write(83,*) 'q',q |
---|
[999] | 659 | WRITE(85,*) 'q1 = ',q(:,:,1) |
---|
| 660 | WRITE(86,*) 'q3 = ',q(:,:,3) |
---|
| 661 | endif |
---|
[524] | 662 | |
---|
| 663 | abort_message = 'Simulation finished' |
---|
| 664 | |
---|
| 665 | call abort_gcm(modname,abort_message,0) |
---|
| 666 | ENDIF |
---|
| 667 | c----------------------------------------------------------------------- |
---|
| 668 | c ecriture du fichier histoire moyenne: |
---|
| 669 | c ------------------------------------- |
---|
| 670 | |
---|
| 671 | IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN |
---|
| 672 | IF(itau.EQ.itaufin) THEN |
---|
| 673 | iav=1 |
---|
| 674 | ELSE |
---|
| 675 | iav=0 |
---|
| 676 | ENDIF |
---|
[1146] | 677 | |
---|
| 678 | IF (ok_dynzon) THEN |
---|
[524] | 679 | #ifdef CPP_IOIPSL |
---|
[1403] | 680 | CALL bilan_dyn(2,dtvr*iperiod,dtvr*day_step*periodav, |
---|
| 681 | & ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) |
---|
[524] | 682 | #endif |
---|
[1146] | 683 | END IF |
---|
[1403] | 684 | IF (ok_dyn_ave) THEN |
---|
| 685 | #ifdef CPP_IOIPSL |
---|
| 686 | CALL writedynav(itau,vcov, |
---|
| 687 | & ucov,teta,pk,phi,q,masse,ps,phis) |
---|
| 688 | #endif |
---|
| 689 | ENDIF |
---|
[524] | 690 | |
---|
[1403] | 691 | ENDIF ! of IF((MOD(itau,iperiod).EQ.0).OR.(itau.EQ.itaufin)) |
---|
[524] | 692 | |
---|
[2298] | 693 | if (ok_iso_verif) then |
---|
| 694 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 1584') |
---|
| 695 | endif !if (ok_iso_verif) then |
---|
| 696 | |
---|
[524] | 697 | c----------------------------------------------------------------------- |
---|
| 698 | c ecriture de la bande histoire: |
---|
| 699 | c ------------------------------ |
---|
| 700 | |
---|
[1403] | 701 | IF( MOD(itau,iecri).EQ.0) THEN |
---|
| 702 | ! Ehouarn: output only during LF or Backward Matsuno |
---|
| 703 | if (leapf.or.(.not.leapf.and.(.not.forward))) then |
---|
[1146] | 704 | CALL geopot(ip1jmp1,teta,pk,pks,phis,phi) |
---|
| 705 | unat=0. |
---|
| 706 | do l=1,llm |
---|
| 707 | unat(iip2:ip1jm,l)=ucov(iip2:ip1jm,l)/cu(iip2:ip1jm) |
---|
| 708 | vnat(:,l)=vcov(:,l)/cv(:) |
---|
| 709 | enddo |
---|
[524] | 710 | #ifdef CPP_IOIPSL |
---|
[1403] | 711 | if (ok_dyn_ins) then |
---|
| 712 | ! write(lunout,*) "leapfrog: call writehist, itau=",itau |
---|
| 713 | CALL writehist(itau,vcov,ucov,teta,phi,q,masse,ps,phis) |
---|
| 714 | ! call WriteField('ucov',reshape(ucov,(/iip1,jmp1,llm/))) |
---|
| 715 | ! call WriteField('vcov',reshape(vcov,(/iip1,jjm,llm/))) |
---|
| 716 | ! call WriteField('teta',reshape(teta,(/iip1,jmp1,llm/))) |
---|
| 717 | ! call WriteField('ps',reshape(ps,(/iip1,jmp1/))) |
---|
| 718 | ! call WriteField('masse',reshape(masse,(/iip1,jmp1,llm/))) |
---|
| 719 | endif ! of if (ok_dyn_ins) |
---|
[1146] | 720 | #endif |
---|
| 721 | ! For some Grads outputs of fields |
---|
[1403] | 722 | if (output_grads_dyn) then |
---|
[524] | 723 | #include "write_grads_dyn.h" |
---|
[1403] | 724 | endif |
---|
| 725 | endif ! of if (leapf.or.(.not.leapf.and.(.not.forward))) |
---|
[1146] | 726 | ENDIF ! of IF(MOD(itau,iecri).EQ.0) |
---|
[524] | 727 | |
---|
| 728 | IF(itau.EQ.itaufin) THEN |
---|
| 729 | |
---|
| 730 | |
---|
[1454] | 731 | ! if (planet_type.eq."earth") then |
---|
[1146] | 732 | ! Write an Earth-format restart file |
---|
[1665] | 733 | CALL dynredem1("restart.nc",start_time, |
---|
[1146] | 734 | & vcov,ucov,teta,q,masse,ps) |
---|
[1454] | 735 | ! endif ! of if (planet_type.eq."earth") |
---|
[524] | 736 | |
---|
| 737 | CLOSE(99) |
---|
[1665] | 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 | |
---|
[2298] | 775 | if (ok_iso_verif) then |
---|
| 776 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 1664') |
---|
| 777 | endif !if (ok_iso_verif) then |
---|
| 778 | |
---|
[524] | 779 | c ........................................................ |
---|
| 780 | c .............. schema matsuno ............... |
---|
| 781 | c ........................................................ |
---|
| 782 | IF( forward ) THEN |
---|
| 783 | |
---|
| 784 | itau = itau + 1 |
---|
[1403] | 785 | c iday = day_ini+itau/day_step |
---|
| 786 | c time = REAL(itau-(iday-day_ini)*day_step)/day_step+time_0 |
---|
| 787 | c |
---|
| 788 | c IF(time.GT.1.) THEN |
---|
| 789 | c time = time-1. |
---|
| 790 | c iday = iday+1 |
---|
| 791 | c ENDIF |
---|
[524] | 792 | |
---|
| 793 | forward = .FALSE. |
---|
| 794 | IF( itau. EQ. itaufinp1 ) then |
---|
| 795 | abort_message = 'Simulation finished' |
---|
| 796 | call abort_gcm(modname,abort_message,0) |
---|
| 797 | ENDIF |
---|
| 798 | GO TO 2 |
---|
| 799 | |
---|
[1403] | 800 | ELSE ! of IF(forward) i.e. backward step |
---|
[2298] | 801 | |
---|
| 802 | if (ok_iso_verif) then |
---|
| 803 | call check_isotopes_seq(q,ip1jmp1,'leapfrog 1698') |
---|
| 804 | endif !if (ok_iso_verif) then |
---|
[524] | 805 | |
---|
[1146] | 806 | IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN |
---|
[524] | 807 | IF(itau.EQ.itaufin) THEN |
---|
| 808 | iav=1 |
---|
| 809 | ELSE |
---|
| 810 | iav=0 |
---|
| 811 | ENDIF |
---|
[1146] | 812 | |
---|
| 813 | IF (ok_dynzon) THEN |
---|
[524] | 814 | #ifdef CPP_IOIPSL |
---|
[1403] | 815 | CALL bilan_dyn(2,dtvr*iperiod,dtvr*day_step*periodav, |
---|
| 816 | & ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) |
---|
[524] | 817 | #endif |
---|
[1403] | 818 | ENDIF |
---|
| 819 | IF (ok_dyn_ave) THEN |
---|
| 820 | #ifdef CPP_IOIPSL |
---|
| 821 | CALL writedynav(itau,vcov, |
---|
| 822 | & ucov,teta,pk,phi,q,masse,ps,phis) |
---|
| 823 | #endif |
---|
| 824 | ENDIF |
---|
[524] | 825 | |
---|
[1146] | 826 | ENDIF ! of IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) |
---|
[524] | 827 | |
---|
[1146] | 828 | IF(MOD(itau,iecri ).EQ.0) THEN |
---|
[524] | 829 | c IF(MOD(itau,iecri*day_step).EQ.0) THEN |
---|
[1146] | 830 | CALL geopot(ip1jmp1,teta,pk,pks,phis,phi) |
---|
| 831 | unat=0. |
---|
| 832 | do l=1,llm |
---|
| 833 | unat(iip2:ip1jm,l)=ucov(iip2:ip1jm,l)/cu(iip2:ip1jm) |
---|
| 834 | vnat(:,l)=vcov(:,l)/cv(:) |
---|
| 835 | enddo |
---|
[524] | 836 | #ifdef CPP_IOIPSL |
---|
[1403] | 837 | if (ok_dyn_ins) then |
---|
| 838 | ! write(lunout,*) "leapfrog: call writehist (b)", |
---|
| 839 | ! & itau,iecri |
---|
| 840 | CALL writehist(itau,vcov,ucov,teta,phi,q,masse,ps,phis) |
---|
| 841 | endif ! of if (ok_dyn_ins) |
---|
[1146] | 842 | #endif |
---|
| 843 | ! For some Grads outputs |
---|
| 844 | if (output_grads_dyn) then |
---|
[524] | 845 | #include "write_grads_dyn.h" |
---|
[1146] | 846 | endif |
---|
[524] | 847 | |
---|
[1146] | 848 | ENDIF ! of IF(MOD(itau,iecri ).EQ.0) |
---|
[524] | 849 | |
---|
[1146] | 850 | IF(itau.EQ.itaufin) THEN |
---|
[1454] | 851 | ! if (planet_type.eq."earth") then |
---|
[1665] | 852 | CALL dynredem1("restart.nc",start_time, |
---|
[1146] | 853 | & vcov,ucov,teta,q,masse,ps) |
---|
[1454] | 854 | ! endif ! of if (planet_type.eq."earth") |
---|
[1146] | 855 | ENDIF ! of IF(itau.EQ.itaufin) |
---|
[524] | 856 | |
---|
[1146] | 857 | forward = .TRUE. |
---|
| 858 | GO TO 1 |
---|
[524] | 859 | |
---|
[1146] | 860 | ENDIF ! of IF (forward) |
---|
[524] | 861 | |
---|
[1146] | 862 | END IF ! of IF(.not.purmats) |
---|
[524] | 863 | |
---|
| 864 | STOP |
---|
| 865 | END |
---|