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