[1279] | 1 | ! |
---|
| 2 | ! $Id: gcm.F 1907 2013-11-26 13:10:46Z musat $ |
---|
| 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 pks(ip1jmp1) ! exner au sol |
---|
| 108 | REAL pk(ip1jmp1,llm) ! exner au milieu des couches |
---|
| 109 | REAL pkf(ip1jmp1,llm) ! exner filt.au milieu des couches |
---|
| 110 | REAL masse(ip1jmp1,llm) ! masse d'air |
---|
| 111 | REAL phis(ip1jmp1) ! geopotentiel au sol |
---|
| 112 | REAL phi(ip1jmp1,llm) ! geopotentiel |
---|
| 113 | REAL w(ip1jmp1,llm) ! vitesse verticale |
---|
| 114 | |
---|
| 115 | c variables dynamiques intermediaire pour le transport |
---|
| 116 | |
---|
| 117 | c variables pour le fichier histoire |
---|
| 118 | REAL dtav ! intervalle de temps elementaire |
---|
| 119 | |
---|
| 120 | REAL time_0 |
---|
| 121 | |
---|
| 122 | LOGICAL lafin |
---|
| 123 | INTEGER ij,iq,l,i,j |
---|
| 124 | |
---|
| 125 | |
---|
| 126 | real time_step, t_wrt, t_ops |
---|
| 127 | |
---|
| 128 | LOGICAL first |
---|
| 129 | |
---|
| 130 | LOGICAL call_iniphys |
---|
| 131 | data call_iniphys/.true./ |
---|
| 132 | |
---|
| 133 | REAL alpha(ip1jmp1,llm),beta(ip1jmp1,llm) |
---|
| 134 | c+jld variables test conservation energie |
---|
[962] | 135 | c REAL ecin(ip1jmp1,llm),ecin0(ip1jmp1,llm) |
---|
[524] | 136 | C Tendance de la temp. potentiel d (theta)/ d t due a la |
---|
| 137 | C tansformation d'energie cinetique en energie thermique |
---|
| 138 | C cree par la dissipation |
---|
| 139 | REAL dhecdt(ip1jmp1,llm) |
---|
[962] | 140 | c REAL vcont(ip1jm,llm),ucont(ip1jmp1,llm) |
---|
| 141 | c REAL d_h_vcol, d_qt, d_qw, d_ql, d_ec |
---|
| 142 | CHARACTER (len=15) :: ztit |
---|
[524] | 143 | c-jld |
---|
| 144 | |
---|
| 145 | |
---|
[962] | 146 | character (len=80) :: dynhist_file, dynhistave_file |
---|
| 147 | character (len=20) :: modname |
---|
| 148 | character (len=80) :: abort_message |
---|
[1279] | 149 | ! locales pour gestion du temps |
---|
| 150 | INTEGER :: an, mois, jour |
---|
| 151 | REAL :: heure |
---|
[524] | 152 | |
---|
| 153 | |
---|
| 154 | c----------------------------------------------------------------------- |
---|
| 155 | c variables pour l'initialisation de la physique : |
---|
| 156 | c ------------------------------------------------ |
---|
[1146] | 157 | INTEGER ngridmx |
---|
[524] | 158 | PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm ) |
---|
| 159 | REAL zcufi(ngridmx),zcvfi(ngridmx) |
---|
| 160 | REAL latfi(ngridmx),lonfi(ngridmx) |
---|
| 161 | REAL airefi(ngridmx) |
---|
| 162 | SAVE latfi, lonfi, airefi |
---|
| 163 | |
---|
| 164 | c----------------------------------------------------------------------- |
---|
| 165 | c Initialisations: |
---|
| 166 | c ---------------- |
---|
| 167 | |
---|
| 168 | abort_message = 'last timestep reached' |
---|
| 169 | modname = 'gcm' |
---|
| 170 | descript = 'Run GCM LMDZ' |
---|
| 171 | lafin = .FALSE. |
---|
| 172 | dynhist_file = 'dyn_hist.nc' |
---|
| 173 | dynhistave_file = 'dyn_hist_ave.nc' |
---|
| 174 | |
---|
[762] | 175 | |
---|
| 176 | |
---|
[524] | 177 | c---------------------------------------------------------------------- |
---|
| 178 | c lecture des fichiers gcm.def ou run.def |
---|
| 179 | c --------------------------------------- |
---|
| 180 | c |
---|
[1146] | 181 | ! Ehouarn: dump possibility of using defrun |
---|
| 182 | !#ifdef CPP_IOIPSL |
---|
[524] | 183 | CALL conf_gcm( 99, .TRUE. , clesphy0 ) |
---|
[1146] | 184 | !#else |
---|
| 185 | ! CALL defrun( 99, .TRUE. , clesphy0 ) |
---|
| 186 | !#endif |
---|
[762] | 187 | |
---|
[956] | 188 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[1825] | 189 | ! Initialisation de XIOS |
---|
| 190 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 191 | |
---|
| 192 | #ifdef CPP_XIOS |
---|
| 193 | CALL wxios_init("LMDZ") |
---|
| 194 | #endif |
---|
| 195 | |
---|
| 196 | |
---|
| 197 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[956] | 198 | ! FH 2008/05/02 |
---|
| 199 | ! A nettoyer. On ne veut qu'une ou deux routines d'interface |
---|
| 200 | ! dynamique -> physique pour l'initialisation |
---|
[1615] | 201 | #ifdef CPP_PHYS |
---|
[1403] | 202 | CALL Init_Phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/)) |
---|
[762] | 203 | call InitComgeomphy |
---|
[956] | 204 | #endif |
---|
| 205 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[1279] | 206 | c----------------------------------------------------------------------- |
---|
| 207 | c Choix du calendrier |
---|
| 208 | c ------------------- |
---|
[762] | 209 | |
---|
[1279] | 210 | c calend = 'earth_365d' |
---|
| 211 | |
---|
| 212 | #ifdef CPP_IOIPSL |
---|
| 213 | if (calend == 'earth_360d') then |
---|
| 214 | call ioconf_calendar('360d') |
---|
| 215 | write(lunout,*)'CALENDRIER CHOISI: Terrestre a 360 jours/an' |
---|
| 216 | else if (calend == 'earth_365d') then |
---|
| 217 | call ioconf_calendar('noleap') |
---|
| 218 | write(lunout,*)'CALENDRIER CHOISI: Terrestre a 365 jours/an' |
---|
| 219 | else if (calend == 'earth_366d') then |
---|
| 220 | call ioconf_calendar('gregorian') |
---|
| 221 | write(lunout,*)'CALENDRIER CHOISI: Terrestre bissextile' |
---|
| 222 | else |
---|
| 223 | abort_message = 'Mauvais choix de calendrier' |
---|
| 224 | call abort_gcm(modname,abort_message,1) |
---|
| 225 | endif |
---|
| 226 | #endif |
---|
| 227 | c----------------------------------------------------------------------- |
---|
| 228 | |
---|
[1563] | 229 | IF (type_trac == 'inca') THEN |
---|
[762] | 230 | #ifdef INCA |
---|
[1315] | 231 | call init_const_lmdz(nbtr,anneeref,dayref,iphysiq,day_step,nday, |
---|
| 232 | $ nbsrf, is_oce,is_sic,is_ter,is_lic) |
---|
[863] | 233 | call init_inca_para(iim,jjm+1,klon,1,klon_mpi_para_nb,0) |
---|
[762] | 234 | #endif |
---|
[960] | 235 | END IF |
---|
[524] | 236 | c |
---|
| 237 | c |
---|
[762] | 238 | c------------------------------------ |
---|
| 239 | c Initialisation partie parallele |
---|
| 240 | c------------------------------------ |
---|
| 241 | |
---|
| 242 | c |
---|
| 243 | c |
---|
[524] | 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 |
---|
[524] | 250 | |
---|
[1146] | 251 | c Allocation de la tableau q : champs advectes |
---|
| 252 | allocate(q(ip1jmp1,llm,nqtot)) |
---|
| 253 | |
---|
[524] | 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") |
---|
[1403] | 271 | |
---|
[524] | 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) |
---|
[524] | 279 | |
---|
[1563] | 280 | IF (type_trac == 'inca') THEN |
---|
[762] | 281 | #ifdef INCA |
---|
[960] | 282 | call init_inca_dim(klon,llm,iim,jjm, |
---|
| 283 | $ rlonu,rlatu,rlonv,rlatv) |
---|
[762] | 284 | #endif |
---|
[960] | 285 | END IF |
---|
[524] | 286 | |
---|
| 287 | |
---|
| 288 | c le cas echeant, creation d un etat initial |
---|
| 289 | IF (prt_level > 9) WRITE(lunout,*) |
---|
[1146] | 290 | . 'GCM: AVANT iniacademic AVANT AVANT AVANT AVANT' |
---|
[524] | 291 | if (.not.read_start) then |
---|
[1146] | 292 | CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) |
---|
[524] | 293 | endif |
---|
| 294 | |
---|
| 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 | |
---|
[1403] | 313 | zdtvr = daysec/REAL(day_step) |
---|
[524] | 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 |
---|
[1577] | 322 | IF (start_time /= starttime) then |
---|
| 323 | WRITE(lunout,*)' GCM: Attention l''heure de depart lue dans le' |
---|
| 324 | &,' fichier restart ne correspond pas à celle lue dans le run.def' |
---|
| 325 | IF (raz_date == 1) then |
---|
| 326 | WRITE(lunout,*)'Je prends l''heure lue dans run.def' |
---|
| 327 | start_time = starttime |
---|
| 328 | ELSE |
---|
| 329 | WRITE(lunout,*)'Je m''arrete' |
---|
| 330 | CALL abort |
---|
| 331 | ENDIF |
---|
| 332 | ENDIF |
---|
[1403] | 333 | IF (raz_date == 1) THEN |
---|
| 334 | annee_ref = anneeref |
---|
| 335 | day_ref = dayref |
---|
| 336 | day_ini = dayref |
---|
| 337 | itau_dyn = 0 |
---|
| 338 | itau_phy = 0 |
---|
| 339 | time_0 = 0. |
---|
[524] | 340 | write(lunout,*) |
---|
[1403] | 341 | . 'GCM: On reinitialise a la date lue dans gcm.def' |
---|
| 342 | ELSE IF (annee_ref .ne. anneeref .or. day_ref .ne. dayref) THEN |
---|
| 343 | write(lunout,*) |
---|
[1146] | 344 | . 'GCM: Attention les dates initiales lues dans le fichier' |
---|
[524] | 345 | write(lunout,*) |
---|
| 346 | . ' restart ne correspondent pas a celles lues dans ' |
---|
| 347 | write(lunout,*)' gcm.def' |
---|
[1403] | 348 | write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref |
---|
| 349 | write(lunout,*)' day_ref=',day_ref," dayref=",dayref |
---|
| 350 | write(lunout,*)' Pas de remise a zero' |
---|
| 351 | ENDIF |
---|
[1279] | 352 | |
---|
[1403] | 353 | c if (annee_ref .ne. anneeref .or. day_ref .ne. dayref) then |
---|
| 354 | c write(lunout,*) |
---|
| 355 | c . 'GCM: Attention les dates initiales lues dans le fichier' |
---|
| 356 | c write(lunout,*) |
---|
| 357 | c . ' restart ne correspondent pas a celles lues dans ' |
---|
| 358 | c write(lunout,*)' gcm.def' |
---|
| 359 | c write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref |
---|
| 360 | c write(lunout,*)' day_ref=',day_ref," dayref=",dayref |
---|
| 361 | c if (raz_date .ne. 1) then |
---|
| 362 | c write(lunout,*) |
---|
| 363 | c . 'GCM: On garde les dates du fichier restart' |
---|
| 364 | c else |
---|
| 365 | c annee_ref = anneeref |
---|
| 366 | c day_ref = dayref |
---|
| 367 | c day_ini = dayref |
---|
| 368 | c itau_dyn = 0 |
---|
| 369 | c itau_phy = 0 |
---|
| 370 | c time_0 = 0. |
---|
| 371 | c write(lunout,*) |
---|
| 372 | c . 'GCM: On reinitialise a la date lue dans gcm.def' |
---|
| 373 | c endif |
---|
| 374 | c ELSE |
---|
| 375 | c raz_date = 0 |
---|
| 376 | c endif |
---|
| 377 | |
---|
[1147] | 378 | #ifdef CPP_IOIPSL |
---|
[1279] | 379 | mois = 1 |
---|
| 380 | heure = 0. |
---|
| 381 | call ymds2ju(annee_ref, mois, day_ref, heure, jD_ref) |
---|
| 382 | jH_ref = jD_ref - int(jD_ref) |
---|
| 383 | jD_ref = int(jD_ref) |
---|
| 384 | |
---|
| 385 | call ioconf_startdate(INT(jD_ref), jH_ref) |
---|
| 386 | |
---|
| 387 | write(lunout,*)'DEBUG' |
---|
| 388 | write(lunout,*)'annee_ref, mois, day_ref, heure, jD_ref' |
---|
| 389 | write(lunout,*)annee_ref, mois, day_ref, heure, jD_ref |
---|
| 390 | call ju2ymds(jD_ref+jH_ref,an, mois, jour, heure) |
---|
| 391 | write(lunout,*)'jD_ref+jH_ref,an, mois, jour, heure' |
---|
| 392 | write(lunout,*)jD_ref+jH_ref,an, mois, jour, heure |
---|
| 393 | #else |
---|
| 394 | ! Ehouarn: we still need to define JD_ref and JH_ref |
---|
| 395 | ! and since we don't know how many days there are in a year |
---|
| 396 | ! we set JD_ref to 0 (this should be improved ...) |
---|
| 397 | jD_ref=0 |
---|
| 398 | jH_ref=0 |
---|
[1147] | 399 | #endif |
---|
[524] | 400 | |
---|
| 401 | |
---|
[1403] | 402 | if (iflag_phys.eq.1) then |
---|
| 403 | ! these initialisations have already been done (via iniacademic) |
---|
| 404 | ! if running in SW or Newtonian mode |
---|
[524] | 405 | c----------------------------------------------------------------------- |
---|
| 406 | c Initialisation des constantes dynamiques : |
---|
| 407 | c ------------------------------------------ |
---|
[1403] | 408 | dtvr = zdtvr |
---|
| 409 | CALL iniconst |
---|
[524] | 410 | |
---|
| 411 | c----------------------------------------------------------------------- |
---|
| 412 | c Initialisation de la geometrie : |
---|
| 413 | c -------------------------------- |
---|
[1403] | 414 | CALL inigeom |
---|
[524] | 415 | |
---|
| 416 | c----------------------------------------------------------------------- |
---|
| 417 | c Initialisation du filtre : |
---|
| 418 | c -------------------------- |
---|
[1403] | 419 | CALL inifilr |
---|
| 420 | endif ! of if (iflag_phys.eq.1) |
---|
[524] | 421 | c |
---|
| 422 | c----------------------------------------------------------------------- |
---|
| 423 | c Initialisation de la dissipation : |
---|
| 424 | c ---------------------------------- |
---|
| 425 | |
---|
| 426 | CALL inidissip( lstardis, nitergdiv, nitergrot, niterh , |
---|
[1697] | 427 | * tetagdiv, tetagrot , tetatemp, vert_prof_dissip) |
---|
[524] | 428 | |
---|
| 429 | c----------------------------------------------------------------------- |
---|
| 430 | c Initialisation de la physique : |
---|
| 431 | c ------------------------------- |
---|
[1146] | 432 | |
---|
[1529] | 433 | IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100)) THEN |
---|
[524] | 434 | latfi(1)=rlatu(1) |
---|
| 435 | lonfi(1)=0. |
---|
| 436 | zcufi(1) = cu(1) |
---|
| 437 | zcvfi(1) = cv(1) |
---|
| 438 | DO j=2,jjm |
---|
| 439 | DO i=1,iim |
---|
| 440 | latfi((j-2)*iim+1+i)= rlatu(j) |
---|
| 441 | lonfi((j-2)*iim+1+i)= rlonv(i) |
---|
| 442 | zcufi((j-2)*iim+1+i) = cu((j-1)*iip1+i) |
---|
| 443 | zcvfi((j-2)*iim+1+i) = cv((j-1)*iip1+i) |
---|
| 444 | ENDDO |
---|
| 445 | ENDDO |
---|
| 446 | latfi(ngridmx)= rlatu(jjp1) |
---|
| 447 | lonfi(ngridmx)= 0. |
---|
| 448 | zcufi(ngridmx) = cu(ip1jm+1) |
---|
| 449 | zcvfi(ngridmx) = cv(ip1jm-iim) |
---|
| 450 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi) |
---|
| 451 | WRITE(lunout,*) |
---|
[1146] | 452 | . 'GCM: WARNING!!! vitesse verticale nulle dans la physique' |
---|
[1615] | 453 | ! Physics: |
---|
| 454 | #ifdef CPP_PHYS |
---|
[1671] | 455 | CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys, |
---|
| 456 | & latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp, |
---|
| 457 | & iflag_phys) |
---|
[1146] | 458 | #endif |
---|
[524] | 459 | call_iniphys=.false. |
---|
[1146] | 460 | ENDIF ! of IF (call_iniphys.and.(iflag_phys.eq.1)) |
---|
[524] | 461 | |
---|
| 462 | c numero de stockage pour les fichiers de redemarrage: |
---|
| 463 | |
---|
| 464 | c----------------------------------------------------------------------- |
---|
| 465 | c Initialisation des I/O : |
---|
| 466 | c ------------------------ |
---|
| 467 | |
---|
| 468 | |
---|
| 469 | day_end = day_ini + nday |
---|
| 470 | WRITE(lunout,300)day_ini,day_end |
---|
[1146] | 471 | 300 FORMAT('1'/,15x,'run du jour',i7,2x,'au jour',i7//) |
---|
[524] | 472 | |
---|
[1279] | 473 | #ifdef CPP_IOIPSL |
---|
| 474 | call ju2ymds(jD_ref + day_ini - day_ref, an, mois, jour, heure) |
---|
| 475 | write (lunout,301)jour, mois, an |
---|
| 476 | call ju2ymds(jD_ref + day_end - day_ref, an, mois, jour, heure) |
---|
| 477 | write (lunout,302)jour, mois, an |
---|
| 478 | 301 FORMAT('1'/,15x,'run du ', i2,'/',i2,'/',i4) |
---|
| 479 | 302 FORMAT('1'/,15x,' au ', i2,'/',i2,'/',i4) |
---|
| 480 | #endif |
---|
| 481 | |
---|
[1454] | 482 | ! if (planet_type.eq."earth") then |
---|
| 483 | ! Write an Earth-format restart file |
---|
[1529] | 484 | |
---|
[1279] | 485 | CALL dynredem0("restart.nc", day_end, phis) |
---|
[1454] | 486 | ! endif |
---|
[524] | 487 | |
---|
| 488 | ecripar = .TRUE. |
---|
| 489 | |
---|
[1146] | 490 | #ifdef CPP_IOIPSL |
---|
[524] | 491 | time_step = zdtvr |
---|
[1403] | 492 | if (ok_dyn_ins) then |
---|
| 493 | ! initialize output file for instantaneous outputs |
---|
| 494 | ! t_ops = iecri * daysec ! do operations every t_ops |
---|
| 495 | t_ops =((1.0*iecri)/day_step) * daysec |
---|
| 496 | t_wrt = daysec ! iecri * daysec ! write output every t_wrt |
---|
| 497 | CALL inithist(day_ref,annee_ref,time_step, |
---|
| 498 | & t_ops,t_wrt) |
---|
| 499 | endif |
---|
[524] | 500 | |
---|
[1403] | 501 | IF (ok_dyn_ave) THEN |
---|
| 502 | ! initialize output file for averaged outputs |
---|
| 503 | t_ops = iperiod * time_step ! do operations every t_ops |
---|
| 504 | t_wrt = periodav * daysec ! write output every t_wrt |
---|
| 505 | CALL initdynav(day_ref,annee_ref,time_step, |
---|
| 506 | & t_ops,t_wrt) |
---|
| 507 | END IF |
---|
[524] | 508 | dtav = iperiod*dtvr/daysec |
---|
| 509 | #endif |
---|
[1146] | 510 | ! #endif of #ifdef CPP_IOIPSL |
---|
[524] | 511 | |
---|
[541] | 512 | c Choix des frequences de stokage pour le offline |
---|
| 513 | c istdyn=day_step/4 ! stockage toutes les 6h=1jour/4 |
---|
| 514 | c istdyn=day_step/12 ! stockage toutes les 2h=1jour/12 |
---|
| 515 | istdyn=day_step/4 ! stockage toutes les 6h=1jour/12 |
---|
| 516 | istphy=istdyn/iphysiq |
---|
| 517 | |
---|
| 518 | |
---|
[524] | 519 | c |
---|
| 520 | c----------------------------------------------------------------------- |
---|
| 521 | c Integration temporelle du modele : |
---|
| 522 | c ---------------------------------- |
---|
| 523 | |
---|
| 524 | c write(78,*) 'ucov',ucov |
---|
| 525 | c write(78,*) 'vcov',vcov |
---|
| 526 | c write(78,*) 'teta',teta |
---|
| 527 | c write(78,*) 'ps',ps |
---|
| 528 | c write(78,*) 'q',q |
---|
| 529 | |
---|
| 530 | |
---|
[1146] | 531 | CALL leapfrog(ucov,vcov,teta,ps,masse,phis,q,clesphy0, |
---|
[550] | 532 | . time_0) |
---|
[524] | 533 | |
---|
| 534 | END |
---|
| 535 | |
---|