[1279] | 1 | ! $Id: gcm.F90 5137 2024-07-28 20:25:12Z abarral $ |
---|
[5099] | 2 | |
---|
| 3 | |
---|
| 4 | |
---|
[2247] | 5 | PROGRAM gcm |
---|
[524] | 6 | |
---|
[2247] | 7 | USE IOIPSL |
---|
[5117] | 8 | USE lmdz_wxios ! ug Pour les sorties XIOS |
---|
[956] | 9 | |
---|
[5106] | 10 | USE lmdz_filtreg, ONLY: inifilr |
---|
[4325] | 11 | USE infotrac, ONLY: nqtot, init_infotrac |
---|
[2247] | 12 | USE control_mod |
---|
[2351] | 13 | USE mod_const_mpi, ONLY: COMM_LMDZ |
---|
[5118] | 14 | USE temps_mod, ONLY: calend, start_time, annee_ref, day_ref, & |
---|
| 15 | itau_dyn, itau_phy, day_ini, jD_ref, jH_ref, day_end |
---|
[2597] | 16 | USE comconst_mod, ONLY: cpp, daysec, dtphys, dtvr, g, r, rad |
---|
[2603] | 17 | USE logic_mod, ONLY: ecripar, iflag_phys, read_start |
---|
[1146] | 18 | |
---|
[5090] | 19 | USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_PHYS |
---|
[5114] | 20 | USE lmdz_description, ONLY: descript |
---|
[5090] | 21 | |
---|
[5118] | 22 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[2247] | 23 | ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique |
---|
| 24 | ! A nettoyer. On ne veut qu'une ou deux routines d'interface |
---|
| 25 | ! dynamique -> physique pour l'initialisation |
---|
[5090] | 26 | ! AB 2024/07/20: remplace CPP key by fortran logical, but ^ still relevant, see later use of iniphys later on |
---|
[2347] | 27 | USE iniphysiq_mod, ONLY: iniphysiq |
---|
[5118] | 28 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 29 | USE lmdz_iniprint, ONLY: lunout, prt_level |
---|
[5134] | 30 | USE lmdz_comdissnew, ONLY: lstardis, nitergdiv, nitergrot, niterh, tetagdiv, & |
---|
| 31 | tetagrot, tetatemp, coefdis, vert_prof_dissip |
---|
[5136] | 32 | USE lmdz_comgeom |
---|
[5137] | 33 | USE lmdz_tracstoke |
---|
[956] | 34 | |
---|
[2247] | 35 | IMPLICIT NONE |
---|
[524] | 36 | |
---|
[2247] | 37 | ! ...... Version du 10/01/98 .......... |
---|
[524] | 38 | |
---|
[2247] | 39 | ! avec coordonnees verticales hybrides |
---|
| 40 | ! avec nouveaux operat. dissipation * ( gradiv2,divgrad2,nxgraro2 ) |
---|
[524] | 41 | |
---|
[2247] | 42 | !======================================================================= |
---|
[5099] | 43 | |
---|
[2247] | 44 | ! Auteur: P. Le Van /L. Fairhead/F.Hourdin |
---|
| 45 | ! ------- |
---|
[5099] | 46 | |
---|
[2247] | 47 | ! Objet: |
---|
| 48 | ! ------ |
---|
[5099] | 49 | |
---|
[2247] | 50 | ! GCM LMD nouvelle grille |
---|
[5099] | 51 | |
---|
[2247] | 52 | !======================================================================= |
---|
[5099] | 53 | |
---|
[2247] | 54 | ! ... Dans inigeom , nouveaux calculs pour les elongations cu , cv |
---|
| 55 | ! et possibilite d'appeler une fonction f(y) a derivee tangente |
---|
| 56 | ! hyperbolique a la place de la fonction a derivee sinusoidale. |
---|
| 57 | ! ... Possibilite de choisir le schema pour l'advection de |
---|
| 58 | ! q , en modifiant iadv dans traceur.def (MAF,10/02) . |
---|
[5099] | 59 | |
---|
[2247] | 60 | ! Pour Van-Leer + Vapeur d'eau saturee, iadv(1)=4. (F.Codron,10/99) |
---|
| 61 | ! Pour Van-Leer iadv=10 |
---|
[5099] | 62 | |
---|
[2247] | 63 | !----------------------------------------------------------------------- |
---|
| 64 | ! Declarations: |
---|
| 65 | ! ------------- |
---|
[524] | 66 | |
---|
[5134] | 67 | INCLUDE "dimensions.h" |
---|
| 68 | INCLUDE "paramet.h" |
---|
[524] | 69 | |
---|
[2247] | 70 | REAL zdtvr |
---|
[524] | 71 | |
---|
[2247] | 72 | ! variables dynamiques |
---|
[5118] | 73 | REAL vcov(ip1jm, llm), ucov(ip1jmp1, llm) ! vents covariants |
---|
| 74 | REAL teta(ip1jmp1, llm) ! temperature potentielle |
---|
| 75 | REAL, ALLOCATABLE, DIMENSION(:, :, :) :: q! champs advectes |
---|
[2247] | 76 | REAL ps(ip1jmp1) ! pression au sol |
---|
[5118] | 77 | ! REAL p (ip1jmp1,llmp1 ) ! pression aux interfac.des couches |
---|
| 78 | REAL masse(ip1jmp1, llm) ! masse d'air |
---|
[2247] | 79 | REAL phis(ip1jmp1) ! geopotentiel au sol |
---|
[5118] | 80 | ! REAL phi(ip1jmp1,llm) ! geopotentiel |
---|
| 81 | ! REAL w(ip1jmp1,llm) ! vitesse verticale |
---|
[524] | 82 | |
---|
[2247] | 83 | ! variables dynamiques intermediaire pour le transport |
---|
[524] | 84 | |
---|
[2247] | 85 | ! variables pour le fichier histoire |
---|
| 86 | REAL dtav ! intervalle de temps elementaire |
---|
[524] | 87 | |
---|
[2247] | 88 | REAL time_0 |
---|
[524] | 89 | |
---|
[2247] | 90 | LOGICAL lafin |
---|
[524] | 91 | |
---|
[5117] | 92 | REAL time_step, t_wrt, t_ops |
---|
[524] | 93 | |
---|
[2247] | 94 | ! LOGICAL call_iniphys |
---|
[5103] | 95 | ! data call_iniphys/.TRUE./ |
---|
[524] | 96 | |
---|
[2247] | 97 | !+jld variables test conservation energie |
---|
| 98 | ! REAL ecin(ip1jmp1,llm),ecin0(ip1jmp1,llm) |
---|
| 99 | ! Tendance de la temp. potentiel d (theta)/ d t due a la |
---|
| 100 | ! tansformation d'energie cinetique en energie thermique |
---|
| 101 | ! cree par la dissipation |
---|
[5118] | 102 | ! REAL dhecdt(ip1jmp1,llm) |
---|
[2247] | 103 | ! REAL vcont(ip1jm,llm),ucont(ip1jmp1,llm) |
---|
| 104 | ! REAL d_h_vcol, d_qt, d_qw, d_ql, d_ec |
---|
[5118] | 105 | ! CHARACTER (len=15) :: ztit |
---|
[2247] | 106 | !-jld |
---|
[524] | 107 | |
---|
[5118] | 108 | CHARACTER (LEN = 80) :: dynhist_file, dynhistave_file |
---|
| 109 | CHARACTER (LEN = 20) :: modname |
---|
| 110 | CHARACTER (LEN = 80) :: abort_message |
---|
[2247] | 111 | ! locales pour gestion du temps |
---|
| 112 | INTEGER :: an, mois, jour |
---|
| 113 | REAL :: heure |
---|
[5117] | 114 | LOGICAL use_filtre_fft |
---|
[524] | 115 | |
---|
[2247] | 116 | !----------------------------------------------------------------------- |
---|
| 117 | ! Initialisations: |
---|
| 118 | ! ---------------- |
---|
[524] | 119 | |
---|
[2247] | 120 | abort_message = 'last timestep reached' |
---|
| 121 | modname = 'gcm' |
---|
| 122 | descript = 'Run GCM LMDZ' |
---|
[5118] | 123 | lafin = .FALSE. |
---|
[2247] | 124 | dynhist_file = 'dyn_hist.nc' |
---|
| 125 | dynhistave_file = 'dyn_hist_ave.nc' |
---|
[524] | 126 | |
---|
[762] | 127 | |
---|
| 128 | |
---|
[2247] | 129 | !---------------------------------------------------------------------- |
---|
| 130 | ! lecture des fichiers gcm.def ou run.def |
---|
| 131 | ! --------------------------------------- |
---|
[5099] | 132 | |
---|
[5118] | 133 | CALL conf_gcm(99, .TRUE.) |
---|
[762] | 134 | |
---|
[5117] | 135 | IF (mod(iphysiq, iperiod) /= 0) CALL abort_gcm("conf_gcm", & |
---|
[5118] | 136 | "iphysiq must be a multiple of iperiod", 1) |
---|
[2247] | 137 | |
---|
[5118] | 138 | use_filtre_fft = .FALSE. |
---|
| 139 | CALL getin('use_filtre_fft', use_filtre_fft) |
---|
[5101] | 140 | IF (use_filtre_fft) CALL abort_gcm("gcm", 'FFT filter is not available in ' & |
---|
[2438] | 141 | // 'the sequential version of the dynamics.', 1) |
---|
[2247] | 142 | |
---|
[5118] | 143 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[2247] | 144 | ! Initialisation de XIOS |
---|
[5118] | 145 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[1825] | 146 | |
---|
[4619] | 147 | IF (using_xios) THEN |
---|
| 148 | CALL wxios_init("LMDZ") |
---|
| 149 | ENDIF |
---|
[1825] | 150 | |
---|
| 151 | |
---|
[5118] | 152 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[2247] | 153 | ! FH 2008/05/02 |
---|
| 154 | ! A nettoyer. On ne veut qu'une ou deux routines d'interface |
---|
| 155 | ! dynamique -> physique pour l'initialisation |
---|
[5118] | 156 | !#ifdef CPP_PHYS |
---|
| 157 | ! CALL Init_Phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/)) |
---|
| 158 | ! ! CALL InitComgeomphy ! now done in iniphysiq |
---|
| 159 | !#endif |
---|
| 160 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[2247] | 161 | !----------------------------------------------------------------------- |
---|
| 162 | ! Choix du calendrier |
---|
| 163 | ! ------------------- |
---|
[762] | 164 | |
---|
[2247] | 165 | ! calend = 'earth_365d' |
---|
[1279] | 166 | |
---|
[5117] | 167 | IF (calend == 'earth_360d') THEN |
---|
[5118] | 168 | CALL ioconf_calendar('360_day') |
---|
| 169 | WRITE(lunout, *)'CALENDRIER CHOISI: Terrestre a 360 jours/an' |
---|
[5117] | 170 | ELSE IF (calend == 'earth_365d') THEN |
---|
[5118] | 171 | CALL ioconf_calendar('noleap') |
---|
| 172 | WRITE(lunout, *)'CALENDRIER CHOISI: Terrestre a 365 jours/an' |
---|
[5117] | 173 | ELSE IF (calend == 'gregorian') THEN |
---|
[5118] | 174 | CALL ioconf_calendar('gregorian') |
---|
| 175 | WRITE(lunout, *)'CALENDRIER CHOISI: Terrestre bissextile' |
---|
[2247] | 176 | else |
---|
[5118] | 177 | abort_message = 'Mauvais choix de calendrier' |
---|
| 178 | CALL abort_gcm(modname, abort_message, 1) |
---|
[5117] | 179 | ENDIF |
---|
[2247] | 180 | !----------------------------------------------------------------------- |
---|
[5099] | 181 | |
---|
| 182 | |
---|
[2247] | 183 | !------------------------------------ |
---|
| 184 | ! Initialisation partie parallele |
---|
| 185 | !------------------------------------ |
---|
[762] | 186 | |
---|
[5099] | 187 | |
---|
[2247] | 188 | !----------------------------------------------------------------------- |
---|
| 189 | ! Initialisation des traceurs |
---|
| 190 | ! --------------------------- |
---|
| 191 | ! Choix du nombre de traceurs et du schema pour l'advection |
---|
| 192 | ! dans fichier traceur.def, par default ou via INCA |
---|
[5101] | 193 | CALL init_infotrac |
---|
[524] | 194 | |
---|
[2247] | 195 | ! Allocation de la tableau q : champs advectes |
---|
[5118] | 196 | allocate(q(ip1jmp1, llm, nqtot)) |
---|
[1146] | 197 | |
---|
[2247] | 198 | !----------------------------------------------------------------------- |
---|
| 199 | ! Lecture de l'etat initial : |
---|
| 200 | ! --------------------------- |
---|
[524] | 201 | |
---|
[2247] | 202 | ! lecture du fichier start.nc |
---|
[5117] | 203 | IF (read_start) THEN |
---|
[5118] | 204 | ! we still need to run iniacademic to initialize some |
---|
| 205 | ! constants & fields, if we run the 'newtonian' or 'SW' cases: |
---|
| 206 | IF (iflag_phys/=1) THEN |
---|
| 207 | CALL iniacademic(vcov, ucov, teta, q, masse, ps, phis, time_0) |
---|
| 208 | endif |
---|
[1403] | 209 | |
---|
[5118] | 210 | ! if (planet_type.EQ."earth") THEN |
---|
| 211 | ! Load an Earth-format start file |
---|
| 212 | CALL dynetat0("start.nc", vcov, ucov, & |
---|
| 213 | teta, q, masse, ps, phis, time_0) |
---|
| 214 | ! endif ! of if (planet_type.EQ."earth") |
---|
[524] | 215 | |
---|
[5118] | 216 | ! WRITE(73,*) 'ucov',ucov |
---|
| 217 | ! WRITE(74,*) 'vcov',vcov |
---|
| 218 | ! WRITE(75,*) 'teta',teta |
---|
| 219 | ! WRITE(76,*) 'ps',ps |
---|
| 220 | ! WRITE(77,*) 'q',q |
---|
[524] | 221 | |
---|
[5117] | 222 | ENDIF ! of if (read_start) |
---|
[2247] | 223 | |
---|
[524] | 224 | |
---|
[2247] | 225 | ! le cas echeant, creation d un etat initial |
---|
[5118] | 226 | IF (prt_level > 9) WRITE(lunout, *) & |
---|
| 227 | 'GCM: AVANT iniacademic AVANT AVANT AVANT AVANT' |
---|
[5117] | 228 | IF (.NOT.read_start) THEN |
---|
[5118] | 229 | start_time = 0. |
---|
| 230 | annee_ref = anneeref |
---|
| 231 | CALL iniacademic(vcov, ucov, teta, q, masse, ps, phis, time_0) |
---|
[5117] | 232 | ENDIF |
---|
[524] | 233 | |
---|
| 234 | |
---|
[2247] | 235 | !----------------------------------------------------------------------- |
---|
| 236 | ! Lecture des parametres de controle pour la simulation : |
---|
| 237 | ! ------------------------------------------------------- |
---|
| 238 | ! on recalcule eventuellement le pas de temps |
---|
[524] | 239 | |
---|
[5118] | 240 | IF(MOD(day_step, iperiod)/=0) THEN |
---|
| 241 | abort_message = & |
---|
| 242 | 'Il faut choisir un nb de pas par jour multiple de iperiod' |
---|
| 243 | CALL abort_gcm(modname, abort_message, 1) |
---|
[2247] | 244 | ENDIF |
---|
[524] | 245 | |
---|
[5118] | 246 | IF(MOD(day_step, iphysiq)/=0) THEN |
---|
| 247 | abort_message = & |
---|
| 248 | 'Il faut choisir un nb de pas par jour multiple de iphysiq' |
---|
| 249 | CALL abort_gcm(modname, abort_message, 1) |
---|
[2247] | 250 | ENDIF |
---|
[524] | 251 | |
---|
[5118] | 252 | zdtvr = daysec / REAL(day_step) |
---|
[5082] | 253 | IF(dtvr/=zdtvr) THEN |
---|
[5118] | 254 | WRITE(lunout, *) & |
---|
| 255 | 'WARNING!!! changement de pas de temps', dtvr, '>', zdtvr |
---|
[2247] | 256 | ENDIF |
---|
[524] | 257 | |
---|
[2247] | 258 | ! on remet le calendrier \`a zero si demande |
---|
[5099] | 259 | |
---|
[5116] | 260 | IF (start_time /= starttime) THEN |
---|
[5118] | 261 | WRITE(lunout, *)' GCM: Attention l''heure de depart lue dans le' & |
---|
| 262 | , ' fichier restart ne correspond pas a celle lue dans le run.def' |
---|
| 263 | IF (raz_date == 1) THEN |
---|
| 264 | WRITE(lunout, *)'Je prends l''heure lue dans run.def' |
---|
| 265 | start_time = starttime |
---|
| 266 | ELSE |
---|
| 267 | CALL abort_gcm("gcm", "'Je m''arrete'", 1) |
---|
| 268 | ENDIF |
---|
[2247] | 269 | ENDIF |
---|
| 270 | IF (raz_date == 1) THEN |
---|
[5118] | 271 | annee_ref = anneeref |
---|
| 272 | day_ref = dayref |
---|
| 273 | day_ini = dayref |
---|
| 274 | itau_dyn = 0 |
---|
| 275 | itau_phy = 0 |
---|
| 276 | time_0 = 0. |
---|
| 277 | WRITE(lunout, *) & |
---|
| 278 | 'GCM: On reinitialise a la date lue dans gcm.def' |
---|
[5117] | 279 | ELSE IF (annee_ref /= anneeref .OR. day_ref /= dayref) THEN |
---|
[5118] | 280 | WRITE(lunout, *) & |
---|
| 281 | 'GCM: Attention les dates initiales lues dans le fichier' |
---|
| 282 | WRITE(lunout, *) & |
---|
| 283 | ' restart ne correspondent pas a celles lues dans ' |
---|
| 284 | WRITE(lunout, *)' gcm.def' |
---|
| 285 | WRITE(lunout, *)' annee_ref=', annee_ref, " anneeref=", anneeref |
---|
| 286 | WRITE(lunout, *)' day_ref=', day_ref, " dayref=", dayref |
---|
| 287 | WRITE(lunout, *)' Pas de remise a zero' |
---|
[2247] | 288 | ENDIF |
---|
[1279] | 289 | |
---|
[5117] | 290 | ! if (annee_ref .NE. anneeref .OR. day_ref .NE. dayref) THEN |
---|
[5116] | 291 | ! WRITE(lunout,*) |
---|
[2247] | 292 | ! . 'GCM: Attention les dates initiales lues dans le fichier' |
---|
[5116] | 293 | ! WRITE(lunout,*) |
---|
[2247] | 294 | ! . ' restart ne correspondent pas a celles lues dans ' |
---|
[5116] | 295 | ! WRITE(lunout,*)' gcm.def' |
---|
| 296 | ! WRITE(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref |
---|
| 297 | ! WRITE(lunout,*)' day_ref=',day_ref," dayref=",dayref |
---|
[5117] | 298 | ! if (raz_date .NE. 1) THEN |
---|
[5116] | 299 | ! WRITE(lunout,*) |
---|
[2247] | 300 | ! . 'GCM: On garde les dates du fichier restart' |
---|
| 301 | ! else |
---|
| 302 | ! annee_ref = anneeref |
---|
| 303 | ! day_ref = dayref |
---|
| 304 | ! day_ini = dayref |
---|
| 305 | ! itau_dyn = 0 |
---|
| 306 | ! itau_phy = 0 |
---|
| 307 | ! time_0 = 0. |
---|
[5116] | 308 | ! WRITE(lunout,*) |
---|
[2247] | 309 | ! . 'GCM: On reinitialise a la date lue dans gcm.def' |
---|
| 310 | ! endif |
---|
| 311 | ! ELSE |
---|
| 312 | ! raz_date = 0 |
---|
| 313 | ! endif |
---|
[1403] | 314 | |
---|
[2247] | 315 | mois = 1 |
---|
| 316 | heure = 0. |
---|
[5101] | 317 | CALL ymds2ju(annee_ref, mois, day_ref, heure, jD_ref) |
---|
[2247] | 318 | jH_ref = jD_ref - int(jD_ref) |
---|
| 319 | jD_ref = int(jD_ref) |
---|
[1279] | 320 | |
---|
[5101] | 321 | CALL ioconf_startdate(INT(jD_ref), jH_ref) |
---|
[1279] | 322 | |
---|
[5118] | 323 | WRITE(lunout, *)'DEBUG' |
---|
| 324 | WRITE(lunout, *)'annee_ref, mois, day_ref, heure, jD_ref' |
---|
| 325 | WRITE(lunout, *)annee_ref, mois, day_ref, heure, jD_ref |
---|
| 326 | CALL ju2ymds(jD_ref + jH_ref, an, mois, jour, heure) |
---|
| 327 | WRITE(lunout, *)'jD_ref+jH_ref,an, mois, jour, heure' |
---|
| 328 | WRITE(lunout, *)jD_ref + jH_ref, an, mois, jour, heure |
---|
[524] | 329 | |
---|
[5117] | 330 | IF (iflag_phys==1) THEN |
---|
[5118] | 331 | ! these initialisations have already been done (via iniacademic) |
---|
| 332 | ! if running in SW or Newtonian mode |
---|
| 333 | !----------------------------------------------------------------------- |
---|
| 334 | ! Initialisation des constantes dynamiques : |
---|
| 335 | ! ------------------------------------------ |
---|
| 336 | dtvr = zdtvr |
---|
| 337 | CALL iniconst |
---|
[524] | 338 | |
---|
[5118] | 339 | !----------------------------------------------------------------------- |
---|
| 340 | ! Initialisation de la geometrie : |
---|
| 341 | ! -------------------------------- |
---|
| 342 | CALL inigeom |
---|
[524] | 343 | |
---|
[5118] | 344 | !----------------------------------------------------------------------- |
---|
| 345 | ! Initialisation du filtre : |
---|
| 346 | ! -------------------------- |
---|
| 347 | CALL inifilr |
---|
[5117] | 348 | ENDIF ! of if (iflag_phys.EQ.1) |
---|
[5099] | 349 | |
---|
[2247] | 350 | !----------------------------------------------------------------------- |
---|
| 351 | ! Initialisation de la dissipation : |
---|
| 352 | ! ---------------------------------- |
---|
[524] | 353 | |
---|
[5118] | 354 | CALL inidissip(lstardis, nitergdiv, nitergrot, niterh, & |
---|
| 355 | tetagdiv, tetagrot, tetatemp, vert_prof_dissip) |
---|
[524] | 356 | |
---|
[2247] | 357 | ! numero de stockage pour les fichiers de redemarrage: |
---|
[524] | 358 | |
---|
[2247] | 359 | !----------------------------------------------------------------------- |
---|
| 360 | ! Initialisation des I/O : |
---|
| 361 | ! ------------------------ |
---|
[524] | 362 | |
---|
[5117] | 363 | IF (nday>=0) THEN |
---|
[5118] | 364 | day_end = day_ini + nday |
---|
[2247] | 365 | else |
---|
[5118] | 366 | day_end = day_ini - nday / day_step |
---|
[5117] | 367 | ENDIF |
---|
[5118] | 368 | WRITE(lunout, 300)day_ini, day_end |
---|
| 369 | 300 FORMAT('1'/, 15x, 'run du jour', i7, 2x, 'au jour', i7//) |
---|
[524] | 370 | |
---|
[5101] | 371 | CALL ju2ymds(jD_ref + day_ini - day_ref, an, mois, jour, heure) |
---|
[5118] | 372 | write (lunout, 301)jour, mois, an |
---|
[5101] | 373 | CALL ju2ymds(jD_ref + day_end - day_ref, an, mois, jour, heure) |
---|
[5118] | 374 | write (lunout, 302)jour, mois, an |
---|
| 375 | 301 FORMAT('1'/, 15x, 'run du ', i2, '/', i2, '/', i4) |
---|
| 376 | 302 FORMAT('1'/, 15x, ' au ', i2, '/', i2, '/', i4) |
---|
[1279] | 377 | |
---|
[3435] | 378 | !----------------------------------------------------------------------- |
---|
| 379 | ! Initialisation de la physique : |
---|
| 380 | ! ------------------------------- |
---|
| 381 | |
---|
[5117] | 382 | IF ((iflag_phys==1).OR.(iflag_phys>=100)) THEN |
---|
[5090] | 383 | ! Physics: |
---|
| 384 | IF (CPPKEY_PHYS) THEN |
---|
[5118] | 385 | CALL iniphysiq(iim, jjm, llm, & |
---|
| 386 | (jjm - 1) * iim + 2, comm_lmdz, & |
---|
| 387 | daysec, day_ini, dtphys / nsplit_phys, & |
---|
| 388 | rlatu, rlatv, rlonu, rlonv, aire, cu, cv, rad, g, r, cpp, & |
---|
| 389 | iflag_phys) |
---|
[5090] | 390 | END IF |
---|
[5117] | 391 | ENDIF ! of IF ((iflag_phys==1).OR.(iflag_phys>=100)) |
---|
[3435] | 392 | |
---|
[5117] | 393 | ! if (planet_type.EQ."earth") THEN |
---|
[2247] | 394 | ! Write an Earth-format restart file |
---|
[1529] | 395 | |
---|
[2247] | 396 | CALL dynredem0("restart.nc", day_end, phis) |
---|
| 397 | ! endif |
---|
[524] | 398 | |
---|
[2247] | 399 | ecripar = .TRUE. |
---|
[524] | 400 | |
---|
[2247] | 401 | time_step = zdtvr |
---|
[5117] | 402 | IF (ok_dyn_ins) THEN |
---|
[5118] | 403 | ! initialize output file for instantaneous outputs |
---|
| 404 | ! t_ops = iecri * daysec ! do operations every t_ops |
---|
| 405 | t_ops = ((1.0 * iecri) / day_step) * daysec |
---|
| 406 | t_wrt = daysec ! iecri * daysec ! write output every t_wrt |
---|
| 407 | CALL inithist(day_ref, annee_ref, time_step, & |
---|
| 408 | t_ops, t_wrt) |
---|
[5117] | 409 | ENDIF |
---|
[524] | 410 | |
---|
[5118] | 411 | IF (ok_dyn_ave) THEN |
---|
| 412 | ! initialize output file for averaged outputs |
---|
| 413 | t_ops = iperiod * time_step ! do operations every t_ops |
---|
| 414 | t_wrt = periodav * daysec ! write output every t_wrt |
---|
| 415 | CALL initdynav(day_ref, annee_ref, time_step, & |
---|
| 416 | t_ops, t_wrt) |
---|
[2247] | 417 | END IF |
---|
[5118] | 418 | dtav = iperiod * dtvr / daysec |
---|
[524] | 419 | |
---|
[2247] | 420 | ! Choix des frequences de stokage pour le offline |
---|
| 421 | ! istdyn=day_step/4 ! stockage toutes les 6h=1jour/4 |
---|
| 422 | ! istdyn=day_step/12 ! stockage toutes les 2h=1jour/12 |
---|
[5118] | 423 | istdyn = day_step / 4 ! stockage toutes les 6h=1jour/12 |
---|
| 424 | istphy = istdyn / iphysiq |
---|
[541] | 425 | |
---|
[2247] | 426 | !----------------------------------------------------------------------- |
---|
| 427 | ! Integration temporelle du modele : |
---|
| 428 | ! ---------------------------------- |
---|
[524] | 429 | |
---|
[5116] | 430 | ! WRITE(78,*) 'ucov',ucov |
---|
| 431 | ! WRITE(78,*) 'vcov',vcov |
---|
| 432 | ! WRITE(78,*) 'teta',teta |
---|
| 433 | ! WRITE(78,*) 'ps',ps |
---|
| 434 | ! WRITE(78,*) 'q',q |
---|
[524] | 435 | |
---|
[5118] | 436 | CALL leapfrog(ucov, vcov, teta, ps, masse, phis, q, time_0) |
---|
[524] | 437 | |
---|
[2247] | 438 | END PROGRAM gcm |
---|