[1279] | 1 | ! |
---|
| 2 | ! $Id: gcm.F90 2438 2016-02-03 20:45:25Z oboucher $ |
---|
| 3 | ! |
---|
[2247] | 4 | ! |
---|
| 5 | ! |
---|
| 6 | PROGRAM gcm |
---|
[524] | 7 | |
---|
| 8 | #ifdef CPP_IOIPSL |
---|
[2247] | 9 | USE IOIPSL |
---|
[1146] | 10 | #else |
---|
[2247] | 11 | ! if not using IOIPSL, we still need to use (a local version of) getin |
---|
| 12 | USE ioipsl_getincom |
---|
[524] | 13 | #endif |
---|
[956] | 14 | |
---|
[1825] | 15 | |
---|
| 16 | #ifdef CPP_XIOS |
---|
[2247] | 17 | ! ug Pour les sorties XIOS |
---|
| 18 | USE wxios |
---|
[1825] | 19 | #endif |
---|
| 20 | |
---|
[2247] | 21 | USE filtreg_mod |
---|
| 22 | USE infotrac |
---|
| 23 | USE control_mod |
---|
[2351] | 24 | USE mod_const_mpi, ONLY: COMM_LMDZ |
---|
[1146] | 25 | |
---|
[1785] | 26 | |
---|
[956] | 27 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[2247] | 28 | ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique |
---|
| 29 | ! A nettoyer. On ne veut qu'une ou deux routines d'interface |
---|
| 30 | ! dynamique -> physique pour l'initialisation |
---|
[1615] | 31 | #ifdef CPP_PHYS |
---|
[2347] | 32 | USE iniphysiq_mod, ONLY: iniphysiq |
---|
[956] | 33 | #endif |
---|
| 34 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 35 | |
---|
[2247] | 36 | IMPLICIT NONE |
---|
[524] | 37 | |
---|
[2247] | 38 | ! ...... Version du 10/01/98 .......... |
---|
[524] | 39 | |
---|
[2247] | 40 | ! avec coordonnees verticales hybrides |
---|
| 41 | ! avec nouveaux operat. dissipation * ( gradiv2,divgrad2,nxgraro2 ) |
---|
[524] | 42 | |
---|
[2247] | 43 | !======================================================================= |
---|
| 44 | ! |
---|
| 45 | ! Auteur: P. Le Van /L. Fairhead/F.Hourdin |
---|
| 46 | ! ------- |
---|
| 47 | ! |
---|
| 48 | ! Objet: |
---|
| 49 | ! ------ |
---|
| 50 | ! |
---|
| 51 | ! GCM LMD nouvelle grille |
---|
| 52 | ! |
---|
| 53 | !======================================================================= |
---|
| 54 | ! |
---|
| 55 | ! ... Dans inigeom , nouveaux calculs pour les elongations cu , cv |
---|
| 56 | ! et possibilite d'appeler une fonction f(y) a derivee tangente |
---|
| 57 | ! hyperbolique a la place de la fonction a derivee sinusoidale. |
---|
| 58 | ! ... Possibilite de choisir le schema pour l'advection de |
---|
| 59 | ! q , en modifiant iadv dans traceur.def (MAF,10/02) . |
---|
| 60 | ! |
---|
| 61 | ! Pour Van-Leer + Vapeur d'eau saturee, iadv(1)=4. (F.Codron,10/99) |
---|
| 62 | ! Pour Van-Leer iadv=10 |
---|
| 63 | ! |
---|
| 64 | !----------------------------------------------------------------------- |
---|
| 65 | ! Declarations: |
---|
| 66 | ! ------------- |
---|
[524] | 67 | |
---|
[2247] | 68 | include "dimensions.h" |
---|
| 69 | include "paramet.h" |
---|
| 70 | include "comconst.h" |
---|
| 71 | include "comdissnew.h" |
---|
| 72 | include "comvert.h" |
---|
| 73 | include "comgeom.h" |
---|
| 74 | include "logic.h" |
---|
| 75 | include "temps.h" |
---|
| 76 | !!!!!!!!!!!include "control.h" |
---|
| 77 | include "ener.h" |
---|
| 78 | include "description.h" |
---|
| 79 | include "serre.h" |
---|
| 80 | !include "com_io_dyn.h" |
---|
| 81 | include "iniprint.h" |
---|
| 82 | include "tracstoke.h" |
---|
[524] | 83 | |
---|
[2247] | 84 | REAL zdtvr |
---|
[524] | 85 | |
---|
[2247] | 86 | ! variables dynamiques |
---|
| 87 | REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants |
---|
| 88 | REAL teta(ip1jmp1,llm) ! temperature potentielle |
---|
| 89 | REAL, ALLOCATABLE, DIMENSION(:,:,:):: q! champs advectes |
---|
| 90 | REAL ps(ip1jmp1) ! pression au sol |
---|
| 91 | REAL p (ip1jmp1,llmp1 ) ! pression aux interfac.des couches |
---|
| 92 | REAL masse(ip1jmp1,llm) ! masse d'air |
---|
| 93 | REAL phis(ip1jmp1) ! geopotentiel au sol |
---|
| 94 | REAL phi(ip1jmp1,llm) ! geopotentiel |
---|
| 95 | REAL w(ip1jmp1,llm) ! vitesse verticale |
---|
[524] | 96 | |
---|
[2247] | 97 | ! variables dynamiques intermediaire pour le transport |
---|
[524] | 98 | |
---|
[2247] | 99 | ! variables pour le fichier histoire |
---|
| 100 | REAL dtav ! intervalle de temps elementaire |
---|
[524] | 101 | |
---|
[2247] | 102 | REAL time_0 |
---|
[524] | 103 | |
---|
[2247] | 104 | LOGICAL lafin |
---|
| 105 | INTEGER ij,iq,l,i,j |
---|
[524] | 106 | |
---|
| 107 | |
---|
[2247] | 108 | real time_step, t_wrt, t_ops |
---|
[524] | 109 | |
---|
[2247] | 110 | LOGICAL first |
---|
[524] | 111 | |
---|
[2247] | 112 | ! LOGICAL call_iniphys |
---|
| 113 | ! data call_iniphys/.true./ |
---|
[524] | 114 | |
---|
[2247] | 115 | !+jld variables test conservation energie |
---|
| 116 | ! REAL ecin(ip1jmp1,llm),ecin0(ip1jmp1,llm) |
---|
| 117 | ! Tendance de la temp. potentiel d (theta)/ d t due a la |
---|
| 118 | ! tansformation d'energie cinetique en energie thermique |
---|
| 119 | ! cree par la dissipation |
---|
| 120 | REAL dhecdt(ip1jmp1,llm) |
---|
| 121 | ! REAL vcont(ip1jm,llm),ucont(ip1jmp1,llm) |
---|
| 122 | ! REAL d_h_vcol, d_qt, d_qw, d_ql, d_ec |
---|
| 123 | CHARACTER (len=15) :: ztit |
---|
| 124 | !-jld |
---|
[524] | 125 | |
---|
| 126 | |
---|
[2247] | 127 | character (len=80) :: dynhist_file, dynhistave_file |
---|
| 128 | character (len=20) :: modname |
---|
| 129 | character (len=80) :: abort_message |
---|
| 130 | ! locales pour gestion du temps |
---|
| 131 | INTEGER :: an, mois, jour |
---|
| 132 | REAL :: heure |
---|
| 133 | logical use_filtre_fft |
---|
[524] | 134 | |
---|
[2247] | 135 | !----------------------------------------------------------------------- |
---|
| 136 | ! Initialisations: |
---|
| 137 | ! ---------------- |
---|
[524] | 138 | |
---|
[2247] | 139 | abort_message = 'last timestep reached' |
---|
| 140 | modname = 'gcm' |
---|
| 141 | descript = 'Run GCM LMDZ' |
---|
| 142 | lafin = .FALSE. |
---|
| 143 | dynhist_file = 'dyn_hist.nc' |
---|
| 144 | dynhistave_file = 'dyn_hist_ave.nc' |
---|
[524] | 145 | |
---|
[762] | 146 | |
---|
| 147 | |
---|
[2247] | 148 | !---------------------------------------------------------------------- |
---|
| 149 | ! lecture des fichiers gcm.def ou run.def |
---|
| 150 | ! --------------------------------------- |
---|
| 151 | ! |
---|
| 152 | CALL conf_gcm( 99, .TRUE.) |
---|
[762] | 153 | |
---|
[2247] | 154 | if (mod(iphysiq, iperiod) /= 0) call abort_gcm("conf_gcm", & |
---|
| 155 | "iphysiq must be a multiple of iperiod", 1) |
---|
| 156 | |
---|
| 157 | use_filtre_fft=.FALSE. |
---|
| 158 | CALL getin('use_filtre_fft',use_filtre_fft) |
---|
[2438] | 159 | IF (use_filtre_fft) call abort_gcm("gcm", 'FFT filter is not available in ' & |
---|
| 160 | // 'the sequential version of the dynamics.', 1) |
---|
[2247] | 161 | |
---|
[956] | 162 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[2247] | 163 | ! Initialisation de XIOS |
---|
[1825] | 164 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 165 | |
---|
| 166 | #ifdef CPP_XIOS |
---|
[2247] | 167 | CALL wxios_init("LMDZ") |
---|
[1825] | 168 | #endif |
---|
| 169 | |
---|
| 170 | |
---|
| 171 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[2247] | 172 | ! FH 2008/05/02 |
---|
| 173 | ! A nettoyer. On ne veut qu'une ou deux routines d'interface |
---|
| 174 | ! dynamique -> physique pour l'initialisation |
---|
[2351] | 175 | !#ifdef CPP_PHYS |
---|
| 176 | ! CALL Init_Phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/)) |
---|
| 177 | ! ! call InitComgeomphy ! now done in iniphysiq |
---|
| 178 | !#endif |
---|
[956] | 179 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[2247] | 180 | !----------------------------------------------------------------------- |
---|
| 181 | ! Choix du calendrier |
---|
| 182 | ! ------------------- |
---|
[762] | 183 | |
---|
[2247] | 184 | ! calend = 'earth_365d' |
---|
[1279] | 185 | |
---|
| 186 | #ifdef CPP_IOIPSL |
---|
[2247] | 187 | if (calend == 'earth_360d') then |
---|
| 188 | call ioconf_calendar('360d') |
---|
| 189 | write(lunout,*)'CALENDRIER CHOISI: Terrestre a 360 jours/an' |
---|
| 190 | else if (calend == 'earth_365d') then |
---|
| 191 | call ioconf_calendar('noleap') |
---|
| 192 | write(lunout,*)'CALENDRIER CHOISI: Terrestre a 365 jours/an' |
---|
| 193 | else if (calend == 'gregorian') then |
---|
| 194 | call ioconf_calendar('gregorian') |
---|
| 195 | write(lunout,*)'CALENDRIER CHOISI: Terrestre bissextile' |
---|
| 196 | else |
---|
| 197 | abort_message = 'Mauvais choix de calendrier' |
---|
| 198 | call abort_gcm(modname,abort_message,1) |
---|
| 199 | endif |
---|
[1279] | 200 | #endif |
---|
[2247] | 201 | !----------------------------------------------------------------------- |
---|
| 202 | ! |
---|
| 203 | ! |
---|
| 204 | !------------------------------------ |
---|
| 205 | ! Initialisation partie parallele |
---|
| 206 | !------------------------------------ |
---|
[762] | 207 | |
---|
[2247] | 208 | ! |
---|
| 209 | ! |
---|
| 210 | !----------------------------------------------------------------------- |
---|
| 211 | ! Initialisation des traceurs |
---|
| 212 | ! --------------------------- |
---|
| 213 | ! Choix du nombre de traceurs et du schema pour l'advection |
---|
| 214 | ! dans fichier traceur.def, par default ou via INCA |
---|
| 215 | call infotrac_init |
---|
[524] | 216 | |
---|
[2247] | 217 | ! Allocation de la tableau q : champs advectes |
---|
| 218 | allocate(q(ip1jmp1,llm,nqtot)) |
---|
[1146] | 219 | |
---|
[2247] | 220 | !----------------------------------------------------------------------- |
---|
| 221 | ! Lecture de l'etat initial : |
---|
| 222 | ! --------------------------- |
---|
[524] | 223 | |
---|
[2247] | 224 | ! lecture du fichier start.nc |
---|
| 225 | if (read_start) then |
---|
| 226 | ! we still need to run iniacademic to initialize some |
---|
| 227 | ! constants & fields, if we run the 'newtonian' or 'SW' cases: |
---|
| 228 | if (iflag_phys.ne.1) then |
---|
| 229 | CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) |
---|
| 230 | endif |
---|
[1403] | 231 | |
---|
[2247] | 232 | ! if (planet_type.eq."earth") then |
---|
| 233 | ! Load an Earth-format start file |
---|
| 234 | CALL dynetat0("start.nc",vcov,ucov, & |
---|
| 235 | teta,q,masse,ps,phis, time_0) |
---|
| 236 | ! endif ! of if (planet_type.eq."earth") |
---|
[524] | 237 | |
---|
[2247] | 238 | ! write(73,*) 'ucov',ucov |
---|
| 239 | ! write(74,*) 'vcov',vcov |
---|
| 240 | ! write(75,*) 'teta',teta |
---|
| 241 | ! write(76,*) 'ps',ps |
---|
| 242 | ! write(77,*) 'q',q |
---|
[524] | 243 | |
---|
[2247] | 244 | endif ! of if (read_start) |
---|
| 245 | |
---|
[524] | 246 | |
---|
[2247] | 247 | ! le cas echeant, creation d un etat initial |
---|
| 248 | IF (prt_level > 9) WRITE(lunout,*) & |
---|
| 249 | 'GCM: AVANT iniacademic AVANT AVANT AVANT AVANT' |
---|
| 250 | if (.not.read_start) then |
---|
| 251 | CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) |
---|
| 252 | endif |
---|
[524] | 253 | |
---|
| 254 | |
---|
[2247] | 255 | !----------------------------------------------------------------------- |
---|
| 256 | ! Lecture des parametres de controle pour la simulation : |
---|
| 257 | ! ------------------------------------------------------- |
---|
| 258 | ! on recalcule eventuellement le pas de temps |
---|
[524] | 259 | |
---|
[2247] | 260 | IF(MOD(day_step,iperiod).NE.0) THEN |
---|
| 261 | abort_message = & |
---|
| 262 | 'Il faut choisir un nb de pas par jour multiple de iperiod' |
---|
| 263 | call abort_gcm(modname,abort_message,1) |
---|
| 264 | ENDIF |
---|
[524] | 265 | |
---|
[2247] | 266 | IF(MOD(day_step,iphysiq).NE.0) THEN |
---|
| 267 | abort_message = & |
---|
| 268 | 'Il faut choisir un nb de pas par jour multiple de iphysiq' |
---|
| 269 | call abort_gcm(modname,abort_message,1) |
---|
| 270 | ENDIF |
---|
[524] | 271 | |
---|
[2247] | 272 | zdtvr = daysec/REAL(day_step) |
---|
| 273 | IF(dtvr.NE.zdtvr) THEN |
---|
| 274 | WRITE(lunout,*) & |
---|
| 275 | 'WARNING!!! changement de pas de temps',dtvr,'>',zdtvr |
---|
| 276 | ENDIF |
---|
[524] | 277 | |
---|
[2247] | 278 | ! |
---|
| 279 | ! on remet le calendrier \`a zero si demande |
---|
| 280 | ! |
---|
| 281 | IF (start_time /= starttime) then |
---|
| 282 | WRITE(lunout,*)' GCM: Attention l''heure de depart lue dans le' & |
---|
| 283 | ,' fichier restart ne correspond pas a celle lue dans le run.def' |
---|
| 284 | IF (raz_date == 1) then |
---|
| 285 | WRITE(lunout,*)'Je prends l''heure lue dans run.def' |
---|
| 286 | start_time = starttime |
---|
| 287 | ELSE |
---|
| 288 | call abort_gcm("gcm", "'Je m''arrete'", 1) |
---|
| 289 | ENDIF |
---|
| 290 | ENDIF |
---|
| 291 | IF (raz_date == 1) THEN |
---|
| 292 | annee_ref = anneeref |
---|
| 293 | day_ref = dayref |
---|
| 294 | day_ini = dayref |
---|
| 295 | itau_dyn = 0 |
---|
| 296 | itau_phy = 0 |
---|
| 297 | time_0 = 0. |
---|
| 298 | write(lunout,*) & |
---|
| 299 | 'GCM: On reinitialise a la date lue dans gcm.def' |
---|
| 300 | ELSE IF (annee_ref .ne. anneeref .or. day_ref .ne. dayref) THEN |
---|
| 301 | write(lunout,*) & |
---|
| 302 | 'GCM: Attention les dates initiales lues dans le fichier' |
---|
| 303 | write(lunout,*) & |
---|
| 304 | ' restart ne correspondent pas a celles lues dans ' |
---|
| 305 | write(lunout,*)' gcm.def' |
---|
| 306 | write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref |
---|
| 307 | write(lunout,*)' day_ref=',day_ref," dayref=",dayref |
---|
| 308 | write(lunout,*)' Pas de remise a zero' |
---|
| 309 | ENDIF |
---|
[1279] | 310 | |
---|
[2247] | 311 | ! if (annee_ref .ne. anneeref .or. day_ref .ne. dayref) then |
---|
| 312 | ! write(lunout,*) |
---|
| 313 | ! . 'GCM: Attention les dates initiales lues dans le fichier' |
---|
| 314 | ! write(lunout,*) |
---|
| 315 | ! . ' restart ne correspondent pas a celles lues dans ' |
---|
| 316 | ! write(lunout,*)' gcm.def' |
---|
| 317 | ! write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref |
---|
| 318 | ! write(lunout,*)' day_ref=',day_ref," dayref=",dayref |
---|
| 319 | ! if (raz_date .ne. 1) then |
---|
| 320 | ! write(lunout,*) |
---|
| 321 | ! . 'GCM: On garde les dates du fichier restart' |
---|
| 322 | ! else |
---|
| 323 | ! annee_ref = anneeref |
---|
| 324 | ! day_ref = dayref |
---|
| 325 | ! day_ini = dayref |
---|
| 326 | ! itau_dyn = 0 |
---|
| 327 | ! itau_phy = 0 |
---|
| 328 | ! time_0 = 0. |
---|
| 329 | ! write(lunout,*) |
---|
| 330 | ! . 'GCM: On reinitialise a la date lue dans gcm.def' |
---|
| 331 | ! endif |
---|
| 332 | ! ELSE |
---|
| 333 | ! raz_date = 0 |
---|
| 334 | ! endif |
---|
[1403] | 335 | |
---|
[1147] | 336 | #ifdef CPP_IOIPSL |
---|
[2247] | 337 | mois = 1 |
---|
| 338 | heure = 0. |
---|
| 339 | call ymds2ju(annee_ref, mois, day_ref, heure, jD_ref) |
---|
| 340 | jH_ref = jD_ref - int(jD_ref) |
---|
| 341 | jD_ref = int(jD_ref) |
---|
[1279] | 342 | |
---|
[2247] | 343 | call ioconf_startdate(INT(jD_ref), jH_ref) |
---|
[1279] | 344 | |
---|
[2247] | 345 | write(lunout,*)'DEBUG' |
---|
| 346 | write(lunout,*)'annee_ref, mois, day_ref, heure, jD_ref' |
---|
| 347 | write(lunout,*)annee_ref, mois, day_ref, heure, jD_ref |
---|
| 348 | call ju2ymds(jD_ref+jH_ref,an, mois, jour, heure) |
---|
| 349 | write(lunout,*)'jD_ref+jH_ref,an, mois, jour, heure' |
---|
| 350 | write(lunout,*)jD_ref+jH_ref,an, mois, jour, heure |
---|
[1279] | 351 | #else |
---|
[2247] | 352 | ! Ehouarn: we still need to define JD_ref and JH_ref |
---|
| 353 | ! and since we don't know how many days there are in a year |
---|
| 354 | ! we set JD_ref to 0 (this should be improved ...) |
---|
| 355 | jD_ref=0 |
---|
| 356 | jH_ref=0 |
---|
[1147] | 357 | #endif |
---|
[524] | 358 | |
---|
| 359 | |
---|
[2247] | 360 | if (iflag_phys.eq.1) then |
---|
| 361 | ! these initialisations have already been done (via iniacademic) |
---|
| 362 | ! if running in SW or Newtonian mode |
---|
| 363 | !----------------------------------------------------------------------- |
---|
| 364 | ! Initialisation des constantes dynamiques : |
---|
| 365 | ! ------------------------------------------ |
---|
| 366 | dtvr = zdtvr |
---|
| 367 | CALL iniconst |
---|
[524] | 368 | |
---|
[2247] | 369 | !----------------------------------------------------------------------- |
---|
| 370 | ! Initialisation de la geometrie : |
---|
| 371 | ! -------------------------------- |
---|
| 372 | CALL inigeom |
---|
[524] | 373 | |
---|
[2247] | 374 | !----------------------------------------------------------------------- |
---|
| 375 | ! Initialisation du filtre : |
---|
| 376 | ! -------------------------- |
---|
| 377 | CALL inifilr |
---|
| 378 | endif ! of if (iflag_phys.eq.1) |
---|
| 379 | ! |
---|
| 380 | !----------------------------------------------------------------------- |
---|
| 381 | ! Initialisation de la dissipation : |
---|
| 382 | ! ---------------------------------- |
---|
[524] | 383 | |
---|
[2247] | 384 | CALL inidissip( lstardis, nitergdiv, nitergrot, niterh , & |
---|
| 385 | tetagdiv, tetagrot , tetatemp, vert_prof_dissip) |
---|
[524] | 386 | |
---|
[2247] | 387 | !----------------------------------------------------------------------- |
---|
| 388 | ! Initialisation de la physique : |
---|
| 389 | ! ------------------------------- |
---|
[1146] | 390 | |
---|
[2247] | 391 | IF ((iflag_phys==1).or.(iflag_phys>=100)) THEN |
---|
| 392 | ! Physics: |
---|
[1615] | 393 | #ifdef CPP_PHYS |
---|
[2351] | 394 | CALL iniphysiq(iim,jjm,llm, & |
---|
| 395 | (jjm-1)*iim+2,comm_lmdz, & |
---|
| 396 | daysec,day_ini,dtphys/nsplit_phys, & |
---|
[2346] | 397 | rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp, & |
---|
[2247] | 398 | iflag_phys) |
---|
[1146] | 399 | #endif |
---|
[2247] | 400 | ENDIF ! of IF ((iflag_phys==1).or.(iflag_phys>=100)) |
---|
[524] | 401 | |
---|
[2247] | 402 | ! numero de stockage pour les fichiers de redemarrage: |
---|
[524] | 403 | |
---|
[2247] | 404 | !----------------------------------------------------------------------- |
---|
| 405 | ! Initialisation des I/O : |
---|
| 406 | ! ------------------------ |
---|
[524] | 407 | |
---|
| 408 | |
---|
[2247] | 409 | if (nday>=0) then |
---|
| 410 | day_end = day_ini + nday |
---|
| 411 | else |
---|
| 412 | day_end = day_ini - nday/day_step |
---|
| 413 | endif |
---|
| 414 | WRITE(lunout,300)day_ini,day_end |
---|
| 415 | 300 FORMAT('1'/,15x,'run du jour',i7,2x,'au jour',i7//) |
---|
[524] | 416 | |
---|
[1279] | 417 | #ifdef CPP_IOIPSL |
---|
[2247] | 418 | call ju2ymds(jD_ref + day_ini - day_ref, an, mois, jour, heure) |
---|
| 419 | write (lunout,301)jour, mois, an |
---|
| 420 | call ju2ymds(jD_ref + day_end - day_ref, an, mois, jour, heure) |
---|
| 421 | write (lunout,302)jour, mois, an |
---|
| 422 | 301 FORMAT('1'/,15x,'run du ', i2,'/',i2,'/',i4) |
---|
| 423 | 302 FORMAT('1'/,15x,' au ', i2,'/',i2,'/',i4) |
---|
[1279] | 424 | #endif |
---|
| 425 | |
---|
[2247] | 426 | ! if (planet_type.eq."earth") then |
---|
| 427 | ! Write an Earth-format restart file |
---|
[1529] | 428 | |
---|
[2247] | 429 | CALL dynredem0("restart.nc", day_end, phis) |
---|
| 430 | ! endif |
---|
[524] | 431 | |
---|
[2247] | 432 | ecripar = .TRUE. |
---|
[524] | 433 | |
---|
[1146] | 434 | #ifdef CPP_IOIPSL |
---|
[2247] | 435 | time_step = zdtvr |
---|
| 436 | if (ok_dyn_ins) then |
---|
| 437 | ! initialize output file for instantaneous outputs |
---|
| 438 | ! t_ops = iecri * daysec ! do operations every t_ops |
---|
| 439 | t_ops =((1.0*iecri)/day_step) * daysec |
---|
| 440 | t_wrt = daysec ! iecri * daysec ! write output every t_wrt |
---|
| 441 | CALL inithist(day_ref,annee_ref,time_step, & |
---|
| 442 | t_ops,t_wrt) |
---|
| 443 | endif |
---|
[524] | 444 | |
---|
[2247] | 445 | IF (ok_dyn_ave) THEN |
---|
| 446 | ! initialize output file for averaged outputs |
---|
| 447 | t_ops = iperiod * time_step ! do operations every t_ops |
---|
| 448 | t_wrt = periodav * daysec ! write output every t_wrt |
---|
| 449 | CALL initdynav(day_ref,annee_ref,time_step, & |
---|
| 450 | t_ops,t_wrt) |
---|
| 451 | END IF |
---|
| 452 | dtav = iperiod*dtvr/daysec |
---|
[524] | 453 | #endif |
---|
[2247] | 454 | ! #endif of #ifdef CPP_IOIPSL |
---|
[524] | 455 | |
---|
[2247] | 456 | ! Choix des frequences de stokage pour le offline |
---|
| 457 | ! istdyn=day_step/4 ! stockage toutes les 6h=1jour/4 |
---|
| 458 | ! istdyn=day_step/12 ! stockage toutes les 2h=1jour/12 |
---|
| 459 | istdyn=day_step/4 ! stockage toutes les 6h=1jour/12 |
---|
| 460 | istphy=istdyn/iphysiq |
---|
[541] | 461 | |
---|
| 462 | |
---|
[2247] | 463 | ! |
---|
| 464 | !----------------------------------------------------------------------- |
---|
| 465 | ! Integration temporelle du modele : |
---|
| 466 | ! ---------------------------------- |
---|
[524] | 467 | |
---|
[2247] | 468 | ! write(78,*) 'ucov',ucov |
---|
| 469 | ! write(78,*) 'vcov',vcov |
---|
| 470 | ! write(78,*) 'teta',teta |
---|
| 471 | ! write(78,*) 'ps',ps |
---|
| 472 | ! write(78,*) 'q',q |
---|
[524] | 473 | |
---|
| 474 | |
---|
[2247] | 475 | CALL leapfrog(ucov,vcov,teta,ps,masse,phis,q,time_0) |
---|
[524] | 476 | |
---|
[2247] | 477 | END PROGRAM gcm |
---|