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