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