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