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