| [1] | 1 | ! |
|---|
| [7] | 2 | ! $Id: gcm.F 1446 2010-10-22 09:27:25Z emillour $ |
|---|
| [1] | 3 | ! |
|---|
| 4 | c |
|---|
| 5 | c |
|---|
| 6 | PROGRAM gcm |
|---|
| 7 | |
|---|
| 8 | #ifdef CPP_IOIPSL |
|---|
| 9 | USE IOIPSL |
|---|
| 10 | #else |
|---|
| 11 | ! if not using IOIPSL, we still need to use (a local version of) getin |
|---|
| 12 | USE ioipsl_getincom |
|---|
| 13 | #endif |
|---|
| 14 | |
|---|
| 15 | USE filtreg_mod |
|---|
| 16 | USE infotrac |
|---|
| 17 | USE control_mod |
|---|
| 18 | |
|---|
| 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 |
|---|
| 23 | ! Ehouarn: for now these only apply to Earth: |
|---|
| 24 | #ifdef CPP_EARTH |
|---|
| 25 | USE dimphy |
|---|
| 26 | USE comgeomphy |
|---|
| 27 | USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb |
|---|
| 28 | #endif |
|---|
| 29 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|---|
| 30 | |
|---|
| 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" |
|---|
| 71 | !!!!!!!!!!!#include "control.h" |
|---|
| 72 | #include "ener.h" |
|---|
| 73 | #include "description.h" |
|---|
| 74 | #include "serre.h" |
|---|
| 75 | !#include "com_io_dyn.h" |
|---|
| 76 | #include "iniprint.h" |
|---|
| 77 | #include "tracstoke.h" |
|---|
| 78 | #ifdef INCA |
|---|
| 79 | ! Only INCA needs these informations (from the Earth's physics) |
|---|
| 80 | #include "indicesol.h" |
|---|
| 81 | #endif |
|---|
| 82 | INTEGER longcles |
|---|
| 83 | PARAMETER ( longcles = 20 ) |
|---|
| 84 | REAL clesphy0( longcles ) |
|---|
| 85 | SAVE clesphy0 |
|---|
| 86 | |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | REAL zdtvr |
|---|
| 90 | INTEGER nbetatmoy, nbetatdem,nbetat |
|---|
| 91 | |
|---|
| 92 | c variables dynamiques |
|---|
| 93 | REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants |
|---|
| 94 | REAL teta(ip1jmp1,llm) ! temperature potentielle |
|---|
| 95 | REAL, ALLOCATABLE, DIMENSION(:,:,:):: q! champs advectes |
|---|
| 96 | REAL ps(ip1jmp1) ! pression au sol |
|---|
| 97 | REAL p (ip1jmp1,llmp1 ) ! pression aux interfac.des couches |
|---|
| 98 | REAL pks(ip1jmp1) ! exner au sol |
|---|
| 99 | REAL pk(ip1jmp1,llm) ! exner au milieu des couches |
|---|
| 100 | REAL pkf(ip1jmp1,llm) ! exner filt.au milieu des couches |
|---|
| 101 | REAL masse(ip1jmp1,llm) ! masse d'air |
|---|
| 102 | REAL phis(ip1jmp1) ! geopotentiel au sol |
|---|
| 103 | REAL phi(ip1jmp1,llm) ! geopotentiel |
|---|
| 104 | REAL w(ip1jmp1,llm) ! vitesse verticale |
|---|
| 105 | |
|---|
| 106 | c variables dynamiques intermediaire pour le transport |
|---|
| 107 | |
|---|
| 108 | c variables pour le fichier histoire |
|---|
| 109 | REAL dtav ! intervalle de temps elementaire |
|---|
| 110 | |
|---|
| 111 | REAL time_0 |
|---|
| 112 | |
|---|
| 113 | LOGICAL lafin |
|---|
| 114 | INTEGER ij,iq,l,i,j |
|---|
| 115 | |
|---|
| 116 | |
|---|
| 117 | real time_step, t_wrt, t_ops |
|---|
| 118 | |
|---|
| 119 | LOGICAL first |
|---|
| 120 | |
|---|
| 121 | LOGICAL call_iniphys |
|---|
| 122 | data call_iniphys/.true./ |
|---|
| 123 | |
|---|
| 124 | REAL alpha(ip1jmp1,llm),beta(ip1jmp1,llm) |
|---|
| 125 | c+jld variables test conservation energie |
|---|
| 126 | c REAL ecin(ip1jmp1,llm),ecin0(ip1jmp1,llm) |
|---|
| 127 | C Tendance de la temp. potentiel d (theta)/ d t due a la |
|---|
| 128 | C tansformation d'energie cinetique en energie thermique |
|---|
| 129 | C cree par la dissipation |
|---|
| 130 | REAL dhecdt(ip1jmp1,llm) |
|---|
| 131 | c REAL vcont(ip1jm,llm),ucont(ip1jmp1,llm) |
|---|
| 132 | c REAL d_h_vcol, d_qt, d_qw, d_ql, d_ec |
|---|
| 133 | CHARACTER (len=15) :: ztit |
|---|
| 134 | c-jld |
|---|
| 135 | |
|---|
| 136 | |
|---|
| 137 | character (len=80) :: dynhist_file, dynhistave_file |
|---|
| 138 | character (len=20) :: modname |
|---|
| 139 | character (len=80) :: abort_message |
|---|
| 140 | ! locales pour gestion du temps |
|---|
| 141 | INTEGER :: an, mois, jour |
|---|
| 142 | REAL :: heure |
|---|
| 143 | |
|---|
| 144 | |
|---|
| 145 | c----------------------------------------------------------------------- |
|---|
| 146 | c variables pour l'initialisation de la physique : |
|---|
| 147 | c ------------------------------------------------ |
|---|
| 148 | INTEGER ngridmx |
|---|
| 149 | PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm ) |
|---|
| 150 | REAL zcufi(ngridmx),zcvfi(ngridmx) |
|---|
| 151 | REAL latfi(ngridmx),lonfi(ngridmx) |
|---|
| 152 | REAL airefi(ngridmx) |
|---|
| 153 | SAVE latfi, lonfi, airefi |
|---|
| 154 | |
|---|
| 155 | c----------------------------------------------------------------------- |
|---|
| 156 | c Initialisations: |
|---|
| 157 | c ---------------- |
|---|
| 158 | |
|---|
| 159 | abort_message = 'last timestep reached' |
|---|
| 160 | modname = 'gcm' |
|---|
| 161 | descript = 'Run GCM LMDZ' |
|---|
| 162 | lafin = .FALSE. |
|---|
| 163 | dynhist_file = 'dyn_hist.nc' |
|---|
| 164 | dynhistave_file = 'dyn_hist_ave.nc' |
|---|
| 165 | |
|---|
| 166 | |
|---|
| 167 | |
|---|
| 168 | c---------------------------------------------------------------------- |
|---|
| 169 | c lecture des fichiers gcm.def ou run.def |
|---|
| 170 | c --------------------------------------- |
|---|
| 171 | c |
|---|
| 172 | ! Ehouarn: dump possibility of using defrun |
|---|
| 173 | !#ifdef CPP_IOIPSL |
|---|
| 174 | CALL conf_gcm( 99, .TRUE. , clesphy0 ) |
|---|
| 175 | !#else |
|---|
| 176 | ! CALL defrun( 99, .TRUE. , clesphy0 ) |
|---|
| 177 | !#endif |
|---|
| 178 | |
|---|
| 179 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|---|
| 180 | ! FH 2008/05/02 |
|---|
| 181 | ! A nettoyer. On ne veut qu'une ou deux routines d'interface |
|---|
| 182 | ! dynamique -> physique pour l'initialisation |
|---|
| 183 | ! Ehouarn : temporarily (?) keep this only for Earth |
|---|
| [7] | 184 | ! if (planet_type.eq."earth") then |
|---|
| 185 | !#ifdef CPP_EARTH |
|---|
| 186 | #ifdef CPP_PHYS |
|---|
| [1] | 187 | CALL Init_Phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/)) |
|---|
| 188 | call InitComgeomphy |
|---|
| 189 | #endif |
|---|
| [7] | 190 | ! endif |
|---|
| [1] | 191 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|---|
| [5] | 192 | c |
|---|
| 193 | c Initialisations pour Cp(T) Venus |
|---|
| 194 | call ini_cpdet |
|---|
| 195 | c |
|---|
| [1] | 196 | c----------------------------------------------------------------------- |
|---|
| 197 | c Choix du calendrier |
|---|
| 198 | c ------------------- |
|---|
| 199 | |
|---|
| 200 | c calend = 'earth_365d' |
|---|
| 201 | |
|---|
| 202 | #ifdef CPP_IOIPSL |
|---|
| 203 | if (calend == 'earth_360d') then |
|---|
| 204 | call ioconf_calendar('360d') |
|---|
| 205 | write(lunout,*)'CALENDRIER CHOISI: Terrestre a 360 jours/an' |
|---|
| 206 | else if (calend == 'earth_365d') then |
|---|
| 207 | call ioconf_calendar('noleap') |
|---|
| 208 | write(lunout,*)'CALENDRIER CHOISI: Terrestre a 365 jours/an' |
|---|
| 209 | else if (calend == 'earth_366d') then |
|---|
| 210 | call ioconf_calendar('gregorian') |
|---|
| 211 | write(lunout,*)'CALENDRIER CHOISI: Terrestre bissextile' |
|---|
| 212 | else |
|---|
| 213 | abort_message = 'Mauvais choix de calendrier' |
|---|
| 214 | call abort_gcm(modname,abort_message,1) |
|---|
| 215 | endif |
|---|
| 216 | #endif |
|---|
| 217 | c----------------------------------------------------------------------- |
|---|
| 218 | |
|---|
| 219 | IF (config_inca /= 'none') THEN |
|---|
| 220 | #ifdef INCA |
|---|
| 221 | call init_const_lmdz(nbtr,anneeref,dayref,iphysiq,day_step,nday, |
|---|
| 222 | $ nbsrf, is_oce,is_sic,is_ter,is_lic) |
|---|
| 223 | call init_inca_para(iim,jjm+1,klon,1,klon_mpi_para_nb,0) |
|---|
| 224 | #endif |
|---|
| 225 | END IF |
|---|
| 226 | c |
|---|
| 227 | c |
|---|
| 228 | c------------------------------------ |
|---|
| 229 | c Initialisation partie parallele |
|---|
| 230 | c------------------------------------ |
|---|
| 231 | |
|---|
| 232 | c |
|---|
| 233 | c |
|---|
| 234 | c----------------------------------------------------------------------- |
|---|
| 235 | c Initialisation des traceurs |
|---|
| 236 | c --------------------------- |
|---|
| 237 | c Choix du nombre de traceurs et du schema pour l'advection |
|---|
| 238 | c dans fichier traceur.def, par default ou via INCA |
|---|
| 239 | call infotrac_init |
|---|
| 240 | |
|---|
| 241 | c Allocation de la tableau q : champs advectes |
|---|
| 242 | allocate(q(ip1jmp1,llm,nqtot)) |
|---|
| 243 | |
|---|
| 244 | c----------------------------------------------------------------------- |
|---|
| 245 | c Lecture de l'etat initial : |
|---|
| 246 | c --------------------------- |
|---|
| 247 | |
|---|
| 248 | c lecture du fichier start.nc |
|---|
| 249 | if (read_start) then |
|---|
| 250 | ! we still need to run iniacademic to initialize some |
|---|
| 251 | ! constants & fields, if we run the 'newtonian' or 'SW' cases: |
|---|
| 252 | if (iflag_phys.ne.1) then |
|---|
| 253 | CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) |
|---|
| 254 | endif |
|---|
| 255 | |
|---|
| [6] | 256 | if (planet_type.eq."mars") then |
|---|
| 257 | ! POUR MARS, METTRE UNE FONCTION A PART, genre dynetat0_mars |
|---|
| 258 | abort_message = 'dynetat0_mars A FAIRE' |
|---|
| 259 | call abort_gcm(modname,abort_message,0) |
|---|
| 260 | else |
|---|
| [1] | 261 | CALL dynetat0("start.nc",vcov,ucov, |
|---|
| 262 | & teta,q,masse,ps,phis, time_0) |
|---|
| [6] | 263 | endif ! of if (planet_type.eq."mars") |
|---|
| [1] | 264 | |
|---|
| 265 | c write(73,*) 'ucov',ucov |
|---|
| 266 | c write(74,*) 'vcov',vcov |
|---|
| 267 | c write(75,*) 'teta',teta |
|---|
| 268 | c write(76,*) 'ps',ps |
|---|
| 269 | c write(77,*) 'q',q |
|---|
| 270 | |
|---|
| 271 | endif ! of if (read_start) |
|---|
| 272 | |
|---|
| 273 | IF (config_inca /= 'none') THEN |
|---|
| 274 | #ifdef INCA |
|---|
| 275 | call init_inca_dim(klon,llm,iim,jjm, |
|---|
| 276 | $ rlonu,rlatu,rlonv,rlatv) |
|---|
| 277 | #endif |
|---|
| 278 | END IF |
|---|
| 279 | |
|---|
| 280 | |
|---|
| 281 | c le cas echeant, creation d un etat initial |
|---|
| 282 | IF (prt_level > 9) WRITE(lunout,*) |
|---|
| 283 | . 'GCM: AVANT iniacademic AVANT AVANT AVANT AVANT' |
|---|
| 284 | if (.not.read_start) then |
|---|
| 285 | CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) |
|---|
| 286 | endif |
|---|
| 287 | |
|---|
| 288 | |
|---|
| 289 | c----------------------------------------------------------------------- |
|---|
| 290 | c Lecture des parametres de controle pour la simulation : |
|---|
| 291 | c ------------------------------------------------------- |
|---|
| 292 | c on recalcule eventuellement le pas de temps |
|---|
| 293 | |
|---|
| 294 | IF(MOD(day_step,iperiod).NE.0) THEN |
|---|
| 295 | abort_message = |
|---|
| 296 | . 'Il faut choisir un nb de pas par jour multiple de iperiod' |
|---|
| 297 | call abort_gcm(modname,abort_message,1) |
|---|
| 298 | ENDIF |
|---|
| 299 | |
|---|
| 300 | IF(MOD(day_step,iphysiq).NE.0) THEN |
|---|
| 301 | abort_message = |
|---|
| 302 | * 'Il faut choisir un nb de pas par jour multiple de iphysiq' |
|---|
| 303 | call abort_gcm(modname,abort_message,1) |
|---|
| 304 | ENDIF |
|---|
| 305 | |
|---|
| 306 | zdtvr = daysec/REAL(day_step) |
|---|
| 307 | IF(dtvr.NE.zdtvr) THEN |
|---|
| 308 | WRITE(lunout,*) |
|---|
| 309 | . 'WARNING!!! changement de pas de temps',dtvr,'>',zdtvr |
|---|
| 310 | ENDIF |
|---|
| 311 | |
|---|
| 312 | C |
|---|
| 313 | C on remet le calendrier à zero si demande |
|---|
| 314 | c |
|---|
| 315 | IF (raz_date == 1) THEN |
|---|
| 316 | annee_ref = anneeref |
|---|
| 317 | day_ref = dayref |
|---|
| 318 | day_ini = dayref |
|---|
| 319 | itau_dyn = 0 |
|---|
| 320 | itau_phy = 0 |
|---|
| 321 | time_0 = 0. |
|---|
| 322 | write(lunout,*) |
|---|
| 323 | . 'GCM: On reinitialise a la date lue dans gcm.def' |
|---|
| 324 | ELSE IF (annee_ref .ne. anneeref .or. day_ref .ne. dayref) THEN |
|---|
| 325 | write(lunout,*) |
|---|
| 326 | . 'GCM: Attention les dates initiales lues dans le fichier' |
|---|
| 327 | write(lunout,*) |
|---|
| 328 | . ' restart ne correspondent pas a celles lues dans ' |
|---|
| 329 | write(lunout,*)' gcm.def' |
|---|
| 330 | write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref |
|---|
| 331 | write(lunout,*)' day_ref=',day_ref," dayref=",dayref |
|---|
| 332 | write(lunout,*)' Pas de remise a zero' |
|---|
| 333 | ENDIF |
|---|
| 334 | |
|---|
| 335 | c if (annee_ref .ne. anneeref .or. day_ref .ne. dayref) then |
|---|
| 336 | c write(lunout,*) |
|---|
| 337 | c . 'GCM: Attention les dates initiales lues dans le fichier' |
|---|
| 338 | c write(lunout,*) |
|---|
| 339 | c . ' restart ne correspondent pas a celles lues dans ' |
|---|
| 340 | c write(lunout,*)' gcm.def' |
|---|
| 341 | c write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref |
|---|
| 342 | c write(lunout,*)' day_ref=',day_ref," dayref=",dayref |
|---|
| 343 | c if (raz_date .ne. 1) then |
|---|
| 344 | c write(lunout,*) |
|---|
| 345 | c . 'GCM: On garde les dates du fichier restart' |
|---|
| 346 | c else |
|---|
| 347 | c annee_ref = anneeref |
|---|
| 348 | c day_ref = dayref |
|---|
| 349 | c day_ini = dayref |
|---|
| 350 | c itau_dyn = 0 |
|---|
| 351 | c itau_phy = 0 |
|---|
| 352 | c time_0 = 0. |
|---|
| 353 | c write(lunout,*) |
|---|
| 354 | c . 'GCM: On reinitialise a la date lue dans gcm.def' |
|---|
| 355 | c endif |
|---|
| 356 | c ELSE |
|---|
| 357 | c raz_date = 0 |
|---|
| 358 | c endif |
|---|
| 359 | |
|---|
| 360 | #ifdef CPP_IOIPSL |
|---|
| 361 | mois = 1 |
|---|
| 362 | heure = 0. |
|---|
| 363 | call ymds2ju(annee_ref, mois, day_ref, heure, jD_ref) |
|---|
| 364 | jH_ref = jD_ref - int(jD_ref) |
|---|
| 365 | jD_ref = int(jD_ref) |
|---|
| 366 | |
|---|
| 367 | call ioconf_startdate(INT(jD_ref), jH_ref) |
|---|
| 368 | |
|---|
| 369 | write(lunout,*)'DEBUG' |
|---|
| 370 | write(lunout,*)'annee_ref, mois, day_ref, heure, jD_ref' |
|---|
| 371 | write(lunout,*)annee_ref, mois, day_ref, heure, jD_ref |
|---|
| 372 | call ju2ymds(jD_ref+jH_ref,an, mois, jour, heure) |
|---|
| 373 | write(lunout,*)'jD_ref+jH_ref,an, mois, jour, heure' |
|---|
| 374 | write(lunout,*)jD_ref+jH_ref,an, mois, jour, heure |
|---|
| 375 | #else |
|---|
| 376 | ! Ehouarn: we still need to define JD_ref and JH_ref |
|---|
| 377 | ! and since we don't know how many days there are in a year |
|---|
| 378 | ! we set JD_ref to 0 (this should be improved ...) |
|---|
| 379 | jD_ref=0 |
|---|
| 380 | jH_ref=0 |
|---|
| 381 | #endif |
|---|
| 382 | |
|---|
| 383 | c nombre d'etats dans les fichiers demarrage et histoire |
|---|
| 384 | nbetatdem = nday / iecri |
|---|
| 385 | nbetatmoy = nday / periodav + 1 |
|---|
| 386 | |
|---|
| 387 | if (iflag_phys.eq.1) then |
|---|
| 388 | ! these initialisations have already been done (via iniacademic) |
|---|
| 389 | ! if running in SW or Newtonian mode |
|---|
| 390 | c----------------------------------------------------------------------- |
|---|
| 391 | c Initialisation des constantes dynamiques : |
|---|
| 392 | c ------------------------------------------ |
|---|
| 393 | dtvr = zdtvr |
|---|
| 394 | CALL iniconst |
|---|
| 395 | |
|---|
| 396 | c----------------------------------------------------------------------- |
|---|
| 397 | c Initialisation de la geometrie : |
|---|
| 398 | c -------------------------------- |
|---|
| 399 | CALL inigeom |
|---|
| 400 | |
|---|
| 401 | c----------------------------------------------------------------------- |
|---|
| 402 | c Initialisation du filtre : |
|---|
| 403 | c -------------------------- |
|---|
| 404 | CALL inifilr |
|---|
| 405 | endif ! of if (iflag_phys.eq.1) |
|---|
| 406 | c |
|---|
| 407 | c----------------------------------------------------------------------- |
|---|
| 408 | c Initialisation de la dissipation : |
|---|
| 409 | c ---------------------------------- |
|---|
| 410 | |
|---|
| 411 | CALL inidissip( lstardis, nitergdiv, nitergrot, niterh , |
|---|
| 412 | * tetagdiv, tetagrot , tetatemp ) |
|---|
| 413 | |
|---|
| 414 | c----------------------------------------------------------------------- |
|---|
| 415 | c Initialisation de la physique : |
|---|
| 416 | c ------------------------------- |
|---|
| 417 | |
|---|
| 418 | IF (call_iniphys.and.(iflag_phys.eq.1)) THEN |
|---|
| 419 | latfi(1)=rlatu(1) |
|---|
| 420 | lonfi(1)=0. |
|---|
| 421 | zcufi(1) = cu(1) |
|---|
| 422 | zcvfi(1) = cv(1) |
|---|
| 423 | DO j=2,jjm |
|---|
| 424 | DO i=1,iim |
|---|
| 425 | latfi((j-2)*iim+1+i)= rlatu(j) |
|---|
| 426 | lonfi((j-2)*iim+1+i)= rlonv(i) |
|---|
| 427 | zcufi((j-2)*iim+1+i) = cu((j-1)*iip1+i) |
|---|
| 428 | zcvfi((j-2)*iim+1+i) = cv((j-1)*iip1+i) |
|---|
| 429 | ENDDO |
|---|
| 430 | ENDDO |
|---|
| 431 | latfi(ngridmx)= rlatu(jjp1) |
|---|
| 432 | lonfi(ngridmx)= 0. |
|---|
| 433 | zcufi(ngridmx) = cu(ip1jm+1) |
|---|
| 434 | zcvfi(ngridmx) = cv(ip1jm-iim) |
|---|
| 435 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi) |
|---|
| 436 | WRITE(lunout,*) |
|---|
| 437 | . 'GCM: WARNING!!! vitesse verticale nulle dans la physique' |
|---|
| [6] | 438 | |
|---|
| 439 | ! Initialisation de la physique: pose probleme quand on tourne |
|---|
| 440 | ! SANS physique, car iniphysiq.F est dans le repertoire phy[]... |
|---|
| 441 | ! Il faut une cle CPP_PHYS |
|---|
| [7] | 442 | #ifdef CPP_PHYS |
|---|
| [1] | 443 | CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys , |
|---|
| 444 | , latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp ) |
|---|
| [7] | 445 | #endif ! CPP_PHYS |
|---|
| [1] | 446 | call_iniphys=.false. |
|---|
| 447 | ENDIF ! of IF (call_iniphys.and.(iflag_phys.eq.1)) |
|---|
| 448 | !#endif |
|---|
| 449 | |
|---|
| 450 | c numero de stockage pour les fichiers de redemarrage: |
|---|
| 451 | |
|---|
| 452 | c----------------------------------------------------------------------- |
|---|
| 453 | c Initialisation des I/O : |
|---|
| 454 | c ------------------------ |
|---|
| 455 | |
|---|
| 456 | |
|---|
| 457 | day_end = day_ini + nday |
|---|
| 458 | WRITE(lunout,300)day_ini,day_end |
|---|
| 459 | 300 FORMAT('1'/,15x,'run du jour',i7,2x,'au jour',i7//) |
|---|
| 460 | |
|---|
| 461 | #ifdef CPP_IOIPSL |
|---|
| 462 | call ju2ymds(jD_ref + day_ini - day_ref, an, mois, jour, heure) |
|---|
| 463 | write (lunout,301)jour, mois, an |
|---|
| 464 | call ju2ymds(jD_ref + day_end - day_ref, an, mois, jour, heure) |
|---|
| 465 | write (lunout,302)jour, mois, an |
|---|
| 466 | 301 FORMAT('1'/,15x,'run du ', i2,'/',i2,'/',i4) |
|---|
| 467 | 302 FORMAT('1'/,15x,' au ', i2,'/',i2,'/',i4) |
|---|
| 468 | #endif |
|---|
| 469 | |
|---|
| [6] | 470 | if (planet_type.eq."mars") then |
|---|
| 471 | ! POUR MARS, METTRE UNE FONCTION A PART, genre dynredem0_mars |
|---|
| 472 | abort_message = 'dynredem0_mars A FAIRE' |
|---|
| 473 | call abort_gcm(modname,abort_message,0) |
|---|
| 474 | else |
|---|
| [1] | 475 | CALL dynredem0("restart.nc", day_end, phis) |
|---|
| [6] | 476 | endif ! of if (planet_type.eq."mars") |
|---|
| [1] | 477 | |
|---|
| 478 | ecripar = .TRUE. |
|---|
| 479 | |
|---|
| 480 | #ifdef CPP_IOIPSL |
|---|
| 481 | time_step = zdtvr |
|---|
| 482 | if (ok_dyn_ins) then |
|---|
| 483 | ! initialize output file for instantaneous outputs |
|---|
| 484 | ! t_ops = iecri * daysec ! do operations every t_ops |
|---|
| 485 | t_ops =((1.0*iecri)/day_step) * daysec |
|---|
| 486 | t_wrt = daysec ! iecri * daysec ! write output every t_wrt |
|---|
| 487 | CALL inithist(day_ref,annee_ref,time_step, |
|---|
| 488 | & t_ops,t_wrt) |
|---|
| 489 | endif |
|---|
| 490 | |
|---|
| 491 | IF (ok_dyn_ave) THEN |
|---|
| 492 | ! initialize output file for averaged outputs |
|---|
| 493 | t_ops = iperiod * time_step ! do operations every t_ops |
|---|
| 494 | t_wrt = periodav * daysec ! write output every t_wrt |
|---|
| 495 | CALL initdynav(day_ref,annee_ref,time_step, |
|---|
| 496 | & t_ops,t_wrt) |
|---|
| 497 | END IF |
|---|
| 498 | dtav = iperiod*dtvr/daysec |
|---|
| 499 | #endif |
|---|
| 500 | ! #endif of #ifdef CPP_IOIPSL |
|---|
| 501 | |
|---|
| 502 | c Choix des frequences de stokage pour le offline |
|---|
| 503 | c istdyn=day_step/4 ! stockage toutes les 6h=1jour/4 |
|---|
| 504 | c istdyn=day_step/12 ! stockage toutes les 2h=1jour/12 |
|---|
| 505 | istdyn=day_step/4 ! stockage toutes les 6h=1jour/12 |
|---|
| 506 | istphy=istdyn/iphysiq |
|---|
| 507 | |
|---|
| 508 | |
|---|
| 509 | c |
|---|
| 510 | c----------------------------------------------------------------------- |
|---|
| 511 | c Integration temporelle du modele : |
|---|
| 512 | c ---------------------------------- |
|---|
| 513 | |
|---|
| 514 | c write(78,*) 'ucov',ucov |
|---|
| 515 | c write(78,*) 'vcov',vcov |
|---|
| 516 | c write(78,*) 'teta',teta |
|---|
| 517 | c write(78,*) 'ps',ps |
|---|
| 518 | c write(78,*) 'q',q |
|---|
| 519 | |
|---|
| 520 | |
|---|
| 521 | CALL leapfrog(ucov,vcov,teta,ps,masse,phis,q,clesphy0, |
|---|
| 522 | . time_0) |
|---|
| 523 | |
|---|
| 524 | END |
|---|
| 525 | |
|---|