[1279] | 1 | ! |
---|
| 2 | ! $Id: gcm.F 1592 2011-11-26 06:57:55Z lguez $ |
---|
| 3 | ! |
---|
[524] | 4 | c |
---|
| 5 | c |
---|
| 6 | PROGRAM gcm |
---|
| 7 | |
---|
| 8 | #ifdef CPP_IOIPSL |
---|
| 9 | USE IOIPSL |
---|
[1146] | 10 | #else |
---|
| 11 | ! if not using IOIPSL, we still need to use (a local version of) getin |
---|
| 12 | USE ioipsl_getincom |
---|
[524] | 13 | #endif |
---|
[956] | 14 | |
---|
[1146] | 15 | USE filtreg_mod |
---|
| 16 | USE infotrac |
---|
[1403] | 17 | USE control_mod |
---|
[1146] | 18 | |
---|
[956] | 19 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 20 | ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique |
---|
| 21 | ! A nettoyer. On ne veut qu'une ou deux routines d'interface |
---|
| 22 | ! dynamique -> physique pour l'initialisation |
---|
[1146] | 23 | ! Ehouarn: for now these only apply to Earth: |
---|
| 24 | #ifdef CPP_EARTH |
---|
[762] | 25 | USE dimphy |
---|
| 26 | USE comgeomphy |
---|
[863] | 27 | USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb |
---|
[956] | 28 | #endif |
---|
| 29 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 30 | |
---|
[524] | 31 | IMPLICIT NONE |
---|
| 32 | |
---|
| 33 | c ...... Version du 10/01/98 .......... |
---|
| 34 | |
---|
| 35 | c avec coordonnees verticales hybrides |
---|
| 36 | c avec nouveaux operat. dissipation * ( gradiv2,divgrad2,nxgraro2 ) |
---|
| 37 | |
---|
| 38 | c======================================================================= |
---|
| 39 | c |
---|
| 40 | c Auteur: P. Le Van /L. Fairhead/F.Hourdin |
---|
| 41 | c ------- |
---|
| 42 | c |
---|
| 43 | c Objet: |
---|
| 44 | c ------ |
---|
| 45 | c |
---|
| 46 | c GCM LMD nouvelle grille |
---|
| 47 | c |
---|
| 48 | c======================================================================= |
---|
| 49 | c |
---|
| 50 | c ... Dans inigeom , nouveaux calculs pour les elongations cu , cv |
---|
| 51 | c et possibilite d'appeler une fonction f(y) a derivee tangente |
---|
| 52 | c hyperbolique a la place de la fonction a derivee sinusoidale. |
---|
| 53 | c ... Possibilite de choisir le schema pour l'advection de |
---|
| 54 | c q , en modifiant iadv dans traceur.def (MAF,10/02) . |
---|
| 55 | c |
---|
| 56 | c Pour Van-Leer + Vapeur d'eau saturee, iadv(1)=4. (F.Codron,10/99) |
---|
| 57 | c Pour Van-Leer iadv=10 |
---|
| 58 | c |
---|
| 59 | c----------------------------------------------------------------------- |
---|
| 60 | c Declarations: |
---|
| 61 | c ------------- |
---|
| 62 | |
---|
| 63 | #include "dimensions.h" |
---|
| 64 | #include "paramet.h" |
---|
| 65 | #include "comconst.h" |
---|
| 66 | #include "comdissnew.h" |
---|
| 67 | #include "comvert.h" |
---|
| 68 | #include "comgeom.h" |
---|
| 69 | #include "logic.h" |
---|
| 70 | #include "temps.h" |
---|
[1403] | 71 | !!!!!!!!!!!#include "control.h" |
---|
[524] | 72 | #include "ener.h" |
---|
| 73 | #include "description.h" |
---|
| 74 | #include "serre.h" |
---|
[1403] | 75 | !#include "com_io_dyn.h" |
---|
[524] | 76 | #include "iniprint.h" |
---|
[541] | 77 | #include "tracstoke.h" |
---|
[1403] | 78 | #ifdef INCA |
---|
| 79 | ! Only INCA needs these informations (from the Earth's physics) |
---|
[1315] | 80 | #include "indicesol.h" |
---|
[1403] | 81 | #endif |
---|
[524] | 82 | INTEGER longcles |
---|
| 83 | PARAMETER ( longcles = 20 ) |
---|
| 84 | REAL clesphy0( longcles ) |
---|
| 85 | SAVE clesphy0 |
---|
| 86 | |
---|
| 87 | |
---|
| 88 | |
---|
| 89 | REAL zdtvr |
---|
| 90 | |
---|
| 91 | c variables dynamiques |
---|
| 92 | REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants |
---|
| 93 | REAL teta(ip1jmp1,llm) ! temperature potentielle |
---|
[1146] | 94 | REAL, ALLOCATABLE, DIMENSION(:,:,:):: q! champs advectes |
---|
[524] | 95 | REAL ps(ip1jmp1) ! pression au sol |
---|
| 96 | REAL p (ip1jmp1,llmp1 ) ! pression aux interfac.des couches |
---|
| 97 | REAL pks(ip1jmp1) ! exner au sol |
---|
| 98 | REAL pk(ip1jmp1,llm) ! exner au milieu des couches |
---|
| 99 | REAL pkf(ip1jmp1,llm) ! exner filt.au milieu des couches |
---|
| 100 | REAL masse(ip1jmp1,llm) ! masse d'air |
---|
| 101 | REAL phis(ip1jmp1) ! geopotentiel au sol |
---|
| 102 | REAL phi(ip1jmp1,llm) ! geopotentiel |
---|
| 103 | 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 | INTEGER ij,iq,l,i,j |
---|
| 114 | |
---|
| 115 | |
---|
| 116 | real time_step, t_wrt, t_ops |
---|
| 117 | |
---|
| 118 | LOGICAL first |
---|
| 119 | |
---|
| 120 | LOGICAL call_iniphys |
---|
| 121 | data call_iniphys/.true./ |
---|
| 122 | |
---|
| 123 | REAL alpha(ip1jmp1,llm),beta(ip1jmp1,llm) |
---|
| 124 | c+jld variables test conservation energie |
---|
[962] | 125 | c REAL ecin(ip1jmp1,llm),ecin0(ip1jmp1,llm) |
---|
[524] | 126 | C Tendance de la temp. potentiel d (theta)/ d t due a la |
---|
| 127 | C tansformation d'energie cinetique en energie thermique |
---|
| 128 | C cree par la dissipation |
---|
| 129 | REAL dhecdt(ip1jmp1,llm) |
---|
[962] | 130 | c REAL vcont(ip1jm,llm),ucont(ip1jmp1,llm) |
---|
| 131 | c REAL d_h_vcol, d_qt, d_qw, d_ql, d_ec |
---|
| 132 | CHARACTER (len=15) :: ztit |
---|
[524] | 133 | c-jld |
---|
| 134 | |
---|
| 135 | |
---|
[962] | 136 | character (len=80) :: dynhist_file, dynhistave_file |
---|
| 137 | character (len=20) :: modname |
---|
| 138 | character (len=80) :: abort_message |
---|
[1279] | 139 | ! locales pour gestion du temps |
---|
| 140 | INTEGER :: an, mois, jour |
---|
| 141 | REAL :: heure |
---|
[524] | 142 | |
---|
| 143 | |
---|
| 144 | c----------------------------------------------------------------------- |
---|
| 145 | c variables pour l'initialisation de la physique : |
---|
| 146 | c ------------------------------------------------ |
---|
[1146] | 147 | INTEGER ngridmx |
---|
[524] | 148 | PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm ) |
---|
| 149 | REAL zcufi(ngridmx),zcvfi(ngridmx) |
---|
| 150 | REAL latfi(ngridmx),lonfi(ngridmx) |
---|
| 151 | REAL airefi(ngridmx) |
---|
| 152 | SAVE latfi, lonfi, airefi |
---|
| 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.nc' |
---|
| 163 | dynhistave_file = 'dyn_hist_ave.nc' |
---|
| 164 | |
---|
[762] | 165 | |
---|
| 166 | |
---|
[524] | 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 |
---|
[524] | 173 | CALL conf_gcm( 99, .TRUE. , clesphy0 ) |
---|
[1146] | 174 | !#else |
---|
| 175 | ! CALL defrun( 99, .TRUE. , clesphy0 ) |
---|
| 176 | !#endif |
---|
[762] | 177 | |
---|
[956] | 178 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 179 | ! FH 2008/05/02 |
---|
| 180 | ! A nettoyer. On ne veut qu'une ou deux routines d'interface |
---|
| 181 | ! dynamique -> physique pour l'initialisation |
---|
[1146] | 182 | ! Ehouarn : temporarily (?) keep this only for Earth |
---|
| 183 | if (planet_type.eq."earth") then |
---|
| 184 | #ifdef CPP_EARTH |
---|
[1403] | 185 | CALL Init_Phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/)) |
---|
[762] | 186 | call InitComgeomphy |
---|
[956] | 187 | #endif |
---|
[1146] | 188 | endif |
---|
[956] | 189 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[1279] | 190 | c----------------------------------------------------------------------- |
---|
| 191 | c Choix du calendrier |
---|
| 192 | c ------------------- |
---|
[762] | 193 | |
---|
[1279] | 194 | c calend = 'earth_365d' |
---|
| 195 | |
---|
| 196 | #ifdef CPP_IOIPSL |
---|
| 197 | if (calend == 'earth_360d') then |
---|
| 198 | call ioconf_calendar('360d') |
---|
| 199 | write(lunout,*)'CALENDRIER CHOISI: Terrestre a 360 jours/an' |
---|
| 200 | else if (calend == 'earth_365d') then |
---|
| 201 | call ioconf_calendar('noleap') |
---|
| 202 | write(lunout,*)'CALENDRIER CHOISI: Terrestre a 365 jours/an' |
---|
| 203 | else if (calend == 'earth_366d') then |
---|
| 204 | call ioconf_calendar('gregorian') |
---|
| 205 | write(lunout,*)'CALENDRIER CHOISI: Terrestre bissextile' |
---|
| 206 | else |
---|
| 207 | abort_message = 'Mauvais choix de calendrier' |
---|
| 208 | call abort_gcm(modname,abort_message,1) |
---|
| 209 | endif |
---|
| 210 | #endif |
---|
| 211 | c----------------------------------------------------------------------- |
---|
| 212 | |
---|
[1563] | 213 | IF (type_trac == 'inca') THEN |
---|
[762] | 214 | #ifdef INCA |
---|
[1315] | 215 | call init_const_lmdz(nbtr,anneeref,dayref,iphysiq,day_step,nday, |
---|
| 216 | $ nbsrf, is_oce,is_sic,is_ter,is_lic) |
---|
[863] | 217 | call init_inca_para(iim,jjm+1,klon,1,klon_mpi_para_nb,0) |
---|
[762] | 218 | #endif |
---|
[960] | 219 | END IF |
---|
[524] | 220 | c |
---|
| 221 | c |
---|
[762] | 222 | c------------------------------------ |
---|
| 223 | c Initialisation partie parallele |
---|
| 224 | c------------------------------------ |
---|
| 225 | |
---|
| 226 | c |
---|
| 227 | c |
---|
[524] | 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 |
---|
[524] | 234 | |
---|
[1146] | 235 | c Allocation de la tableau q : champs advectes |
---|
| 236 | allocate(q(ip1jmp1,llm,nqtot)) |
---|
| 237 | |
---|
[524] | 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") |
---|
[1403] | 255 | |
---|
[524] | 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) |
---|
[524] | 263 | |
---|
[1563] | 264 | IF (type_trac == 'inca') THEN |
---|
[762] | 265 | #ifdef INCA |
---|
[960] | 266 | call init_inca_dim(klon,llm,iim,jjm, |
---|
| 267 | $ rlonu,rlatu,rlonv,rlatv) |
---|
[762] | 268 | #endif |
---|
[960] | 269 | END IF |
---|
[524] | 270 | |
---|
| 271 | |
---|
| 272 | c le cas echeant, creation d un etat initial |
---|
| 273 | IF (prt_level > 9) WRITE(lunout,*) |
---|
[1146] | 274 | . 'GCM: AVANT iniacademic AVANT AVANT AVANT AVANT' |
---|
[524] | 275 | if (.not.read_start) then |
---|
[1146] | 276 | CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) |
---|
[524] | 277 | endif |
---|
| 278 | |
---|
| 279 | |
---|
| 280 | c----------------------------------------------------------------------- |
---|
| 281 | c Lecture des parametres de controle pour la simulation : |
---|
| 282 | c ------------------------------------------------------- |
---|
| 283 | c on recalcule eventuellement le pas de temps |
---|
| 284 | |
---|
| 285 | IF(MOD(day_step,iperiod).NE.0) THEN |
---|
| 286 | abort_message = |
---|
| 287 | . 'Il faut choisir un nb de pas par jour multiple de iperiod' |
---|
| 288 | call abort_gcm(modname,abort_message,1) |
---|
| 289 | ENDIF |
---|
| 290 | |
---|
| 291 | IF(MOD(day_step,iphysiq).NE.0) THEN |
---|
| 292 | abort_message = |
---|
| 293 | * 'Il faut choisir un nb de pas par jour multiple de iphysiq' |
---|
| 294 | call abort_gcm(modname,abort_message,1) |
---|
| 295 | ENDIF |
---|
| 296 | |
---|
[1403] | 297 | zdtvr = daysec/REAL(day_step) |
---|
[524] | 298 | IF(dtvr.NE.zdtvr) THEN |
---|
| 299 | WRITE(lunout,*) |
---|
| 300 | . 'WARNING!!! changement de pas de temps',dtvr,'>',zdtvr |
---|
| 301 | ENDIF |
---|
| 302 | |
---|
| 303 | C |
---|
| 304 | C on remet le calendrier à zero si demande |
---|
| 305 | c |
---|
[1577] | 306 | IF (start_time /= starttime) then |
---|
| 307 | WRITE(lunout,*)' GCM: Attention l''heure de depart lue dans le' |
---|
| 308 | &,' fichier restart ne correspond pas à celle lue dans le run.def' |
---|
| 309 | IF (raz_date == 1) then |
---|
| 310 | WRITE(lunout,*)'Je prends l''heure lue dans run.def' |
---|
| 311 | start_time = starttime |
---|
| 312 | ELSE |
---|
| 313 | WRITE(lunout,*)'Je m''arrete' |
---|
| 314 | CALL abort |
---|
| 315 | ENDIF |
---|
| 316 | ENDIF |
---|
[1403] | 317 | IF (raz_date == 1) THEN |
---|
| 318 | annee_ref = anneeref |
---|
| 319 | day_ref = dayref |
---|
| 320 | day_ini = dayref |
---|
| 321 | itau_dyn = 0 |
---|
| 322 | itau_phy = 0 |
---|
| 323 | time_0 = 0. |
---|
[524] | 324 | write(lunout,*) |
---|
[1403] | 325 | . 'GCM: On reinitialise a la date lue dans gcm.def' |
---|
| 326 | ELSE IF (annee_ref .ne. anneeref .or. day_ref .ne. dayref) THEN |
---|
| 327 | write(lunout,*) |
---|
[1146] | 328 | . 'GCM: Attention les dates initiales lues dans le fichier' |
---|
[524] | 329 | write(lunout,*) |
---|
| 330 | . ' restart ne correspondent pas a celles lues dans ' |
---|
| 331 | write(lunout,*)' gcm.def' |
---|
[1403] | 332 | write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref |
---|
| 333 | write(lunout,*)' day_ref=',day_ref," dayref=",dayref |
---|
| 334 | write(lunout,*)' Pas de remise a zero' |
---|
| 335 | ENDIF |
---|
[1279] | 336 | |
---|
[1403] | 337 | c if (annee_ref .ne. anneeref .or. day_ref .ne. dayref) then |
---|
| 338 | c write(lunout,*) |
---|
| 339 | c . 'GCM: Attention les dates initiales lues dans le fichier' |
---|
| 340 | c write(lunout,*) |
---|
| 341 | c . ' restart ne correspondent pas a celles lues dans ' |
---|
| 342 | c write(lunout,*)' gcm.def' |
---|
| 343 | c write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref |
---|
| 344 | c write(lunout,*)' day_ref=',day_ref," dayref=",dayref |
---|
| 345 | c if (raz_date .ne. 1) then |
---|
| 346 | c write(lunout,*) |
---|
| 347 | c . 'GCM: On garde les dates du fichier restart' |
---|
| 348 | c else |
---|
| 349 | c annee_ref = anneeref |
---|
| 350 | c day_ref = dayref |
---|
| 351 | c day_ini = dayref |
---|
| 352 | c itau_dyn = 0 |
---|
| 353 | c itau_phy = 0 |
---|
| 354 | c time_0 = 0. |
---|
| 355 | c write(lunout,*) |
---|
| 356 | c . 'GCM: On reinitialise a la date lue dans gcm.def' |
---|
| 357 | c endif |
---|
| 358 | c ELSE |
---|
| 359 | c raz_date = 0 |
---|
| 360 | c endif |
---|
| 361 | |
---|
[1147] | 362 | #ifdef CPP_IOIPSL |
---|
[1279] | 363 | mois = 1 |
---|
| 364 | heure = 0. |
---|
| 365 | call ymds2ju(annee_ref, mois, day_ref, heure, jD_ref) |
---|
| 366 | jH_ref = jD_ref - int(jD_ref) |
---|
| 367 | jD_ref = int(jD_ref) |
---|
| 368 | |
---|
| 369 | call ioconf_startdate(INT(jD_ref), jH_ref) |
---|
| 370 | |
---|
| 371 | write(lunout,*)'DEBUG' |
---|
| 372 | write(lunout,*)'annee_ref, mois, day_ref, heure, jD_ref' |
---|
| 373 | write(lunout,*)annee_ref, mois, day_ref, heure, jD_ref |
---|
| 374 | call ju2ymds(jD_ref+jH_ref,an, mois, jour, heure) |
---|
| 375 | write(lunout,*)'jD_ref+jH_ref,an, mois, jour, heure' |
---|
| 376 | write(lunout,*)jD_ref+jH_ref,an, mois, jour, heure |
---|
| 377 | #else |
---|
| 378 | ! Ehouarn: we still need to define JD_ref and JH_ref |
---|
| 379 | ! and since we don't know how many days there are in a year |
---|
| 380 | ! we set JD_ref to 0 (this should be improved ...) |
---|
| 381 | jD_ref=0 |
---|
| 382 | jH_ref=0 |
---|
[1147] | 383 | #endif |
---|
[524] | 384 | |
---|
| 385 | |
---|
[1403] | 386 | if (iflag_phys.eq.1) then |
---|
| 387 | ! these initialisations have already been done (via iniacademic) |
---|
| 388 | ! if running in SW or Newtonian mode |
---|
[524] | 389 | c----------------------------------------------------------------------- |
---|
| 390 | c Initialisation des constantes dynamiques : |
---|
| 391 | c ------------------------------------------ |
---|
[1403] | 392 | dtvr = zdtvr |
---|
| 393 | CALL iniconst |
---|
[524] | 394 | |
---|
| 395 | c----------------------------------------------------------------------- |
---|
| 396 | c Initialisation de la geometrie : |
---|
| 397 | c -------------------------------- |
---|
[1403] | 398 | CALL inigeom |
---|
[524] | 399 | |
---|
| 400 | c----------------------------------------------------------------------- |
---|
| 401 | c Initialisation du filtre : |
---|
| 402 | c -------------------------- |
---|
[1403] | 403 | CALL inifilr |
---|
| 404 | endif ! of if (iflag_phys.eq.1) |
---|
[524] | 405 | c |
---|
| 406 | c----------------------------------------------------------------------- |
---|
| 407 | c Initialisation de la dissipation : |
---|
| 408 | c ---------------------------------- |
---|
| 409 | |
---|
| 410 | CALL inidissip( lstardis, nitergdiv, nitergrot, niterh , |
---|
| 411 | * tetagdiv, tetagrot , tetatemp ) |
---|
| 412 | |
---|
| 413 | c----------------------------------------------------------------------- |
---|
| 414 | c Initialisation de la physique : |
---|
| 415 | c ------------------------------- |
---|
[1146] | 416 | |
---|
[1529] | 417 | IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100)) THEN |
---|
[524] | 418 | latfi(1)=rlatu(1) |
---|
| 419 | lonfi(1)=0. |
---|
| 420 | zcufi(1) = cu(1) |
---|
| 421 | zcvfi(1) = cv(1) |
---|
| 422 | DO j=2,jjm |
---|
| 423 | DO i=1,iim |
---|
| 424 | latfi((j-2)*iim+1+i)= rlatu(j) |
---|
| 425 | lonfi((j-2)*iim+1+i)= rlonv(i) |
---|
| 426 | zcufi((j-2)*iim+1+i) = cu((j-1)*iip1+i) |
---|
| 427 | zcvfi((j-2)*iim+1+i) = cv((j-1)*iip1+i) |
---|
| 428 | ENDDO |
---|
| 429 | ENDDO |
---|
| 430 | latfi(ngridmx)= rlatu(jjp1) |
---|
| 431 | lonfi(ngridmx)= 0. |
---|
| 432 | zcufi(ngridmx) = cu(ip1jm+1) |
---|
| 433 | zcvfi(ngridmx) = cv(ip1jm-iim) |
---|
| 434 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi) |
---|
| 435 | WRITE(lunout,*) |
---|
[1146] | 436 | . 'GCM: WARNING!!! vitesse verticale nulle dans la physique' |
---|
| 437 | ! Earth: |
---|
| 438 | if (planet_type.eq."earth") then |
---|
| 439 | #ifdef CPP_EARTH |
---|
[1403] | 440 | CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys , |
---|
[524] | 441 | , latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp ) |
---|
[1146] | 442 | #endif |
---|
| 443 | endif ! of if (planet_type.eq."earth") |
---|
[524] | 444 | call_iniphys=.false. |
---|
[1146] | 445 | ENDIF ! of IF (call_iniphys.and.(iflag_phys.eq.1)) |
---|
| 446 | !#endif |
---|
[524] | 447 | |
---|
| 448 | c numero de stockage pour les fichiers de redemarrage: |
---|
| 449 | |
---|
| 450 | c----------------------------------------------------------------------- |
---|
| 451 | c Initialisation des I/O : |
---|
| 452 | c ------------------------ |
---|
| 453 | |
---|
| 454 | |
---|
| 455 | day_end = day_ini + nday |
---|
| 456 | WRITE(lunout,300)day_ini,day_end |
---|
[1146] | 457 | 300 FORMAT('1'/,15x,'run du jour',i7,2x,'au jour',i7//) |
---|
[524] | 458 | |
---|
[1279] | 459 | #ifdef CPP_IOIPSL |
---|
| 460 | call ju2ymds(jD_ref + day_ini - day_ref, an, mois, jour, heure) |
---|
| 461 | write (lunout,301)jour, mois, an |
---|
| 462 | call ju2ymds(jD_ref + day_end - day_ref, an, mois, jour, heure) |
---|
| 463 | write (lunout,302)jour, mois, an |
---|
| 464 | 301 FORMAT('1'/,15x,'run du ', i2,'/',i2,'/',i4) |
---|
| 465 | 302 FORMAT('1'/,15x,' au ', i2,'/',i2,'/',i4) |
---|
| 466 | #endif |
---|
| 467 | |
---|
[1529] | 468 | #ifdef CPP_EARTH |
---|
| 469 | ! Create start file (startphy.nc) and boundary conditions (limit.nc) |
---|
| 470 | ! for the Earth verstion |
---|
| 471 | if (iflag_phys>=100) then |
---|
| 472 | call iniaqua(ngridmx,latfi,lonfi,iflag_phys) |
---|
| 473 | endif |
---|
| 474 | #endif |
---|
| 475 | |
---|
[1454] | 476 | ! if (planet_type.eq."earth") then |
---|
| 477 | ! Write an Earth-format restart file |
---|
[1529] | 478 | |
---|
[1279] | 479 | CALL dynredem0("restart.nc", day_end, phis) |
---|
[1454] | 480 | ! endif |
---|
[524] | 481 | |
---|
| 482 | ecripar = .TRUE. |
---|
| 483 | |
---|
[1146] | 484 | #ifdef CPP_IOIPSL |
---|
[524] | 485 | time_step = zdtvr |
---|
[1403] | 486 | if (ok_dyn_ins) then |
---|
| 487 | ! initialize output file for instantaneous outputs |
---|
| 488 | ! t_ops = iecri * daysec ! do operations every t_ops |
---|
| 489 | t_ops =((1.0*iecri)/day_step) * daysec |
---|
| 490 | t_wrt = daysec ! iecri * daysec ! write output every t_wrt |
---|
| 491 | CALL inithist(day_ref,annee_ref,time_step, |
---|
| 492 | & t_ops,t_wrt) |
---|
| 493 | endif |
---|
[524] | 494 | |
---|
[1403] | 495 | IF (ok_dyn_ave) THEN |
---|
| 496 | ! initialize output file for averaged outputs |
---|
| 497 | t_ops = iperiod * time_step ! do operations every t_ops |
---|
| 498 | t_wrt = periodav * daysec ! write output every t_wrt |
---|
| 499 | CALL initdynav(day_ref,annee_ref,time_step, |
---|
| 500 | & t_ops,t_wrt) |
---|
| 501 | END IF |
---|
[524] | 502 | dtav = iperiod*dtvr/daysec |
---|
| 503 | #endif |
---|
[1146] | 504 | ! #endif of #ifdef CPP_IOIPSL |
---|
[524] | 505 | |
---|
[541] | 506 | c Choix des frequences de stokage pour le offline |
---|
| 507 | c istdyn=day_step/4 ! stockage toutes les 6h=1jour/4 |
---|
| 508 | c istdyn=day_step/12 ! stockage toutes les 2h=1jour/12 |
---|
| 509 | istdyn=day_step/4 ! stockage toutes les 6h=1jour/12 |
---|
| 510 | istphy=istdyn/iphysiq |
---|
| 511 | |
---|
| 512 | |
---|
[524] | 513 | c |
---|
| 514 | c----------------------------------------------------------------------- |
---|
| 515 | c Integration temporelle du modele : |
---|
| 516 | c ---------------------------------- |
---|
| 517 | |
---|
| 518 | c write(78,*) 'ucov',ucov |
---|
| 519 | c write(78,*) 'vcov',vcov |
---|
| 520 | c write(78,*) 'teta',teta |
---|
| 521 | c write(78,*) 'ps',ps |
---|
| 522 | c write(78,*) 'q',q |
---|
| 523 | |
---|
| 524 | |
---|
[1146] | 525 | CALL leapfrog(ucov,vcov,teta,ps,masse,phis,q,clesphy0, |
---|
[550] | 526 | . time_0) |
---|
[524] | 527 | |
---|
| 528 | END |
---|
| 529 | |
---|