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