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