[4146] | 1 | ! |
---|
| 2 | ! $Id: gcm.F90 5272 2024-10-24 15:53:15Z abarral $ |
---|
| 3 | ! |
---|
[1632] | 4 | |
---|
[2263] | 5 | PROGRAM gcm |
---|
| 6 | |
---|
| 7 | USE IOIPSL |
---|
[1632] | 8 | |
---|
[2263] | 9 | USE mod_const_mpi, ONLY: init_const_mpi |
---|
| 10 | USE parallel_lmdz |
---|
[4325] | 11 | USE infotrac, ONLY: nqtot, init_infotrac |
---|
[2351] | 12 | !#ifdef CPP_PHYS |
---|
| 13 | ! USE mod_interface_dyn_phys, ONLY: init_interface_dyn_phys |
---|
| 14 | !#endif |
---|
[2263] | 15 | USE mod_hallo |
---|
| 16 | USE Bands |
---|
| 17 | USE filtreg_mod |
---|
| 18 | USE control_mod |
---|
[1632] | 19 | |
---|
[2347] | 20 | USE iniphysiq_mod, ONLY: iniphysiq |
---|
[2597] | 21 | USE comconst_mod, ONLY: cpp, daysec, dtphys, dtvr, g, r, rad |
---|
[2603] | 22 | USE logic_mod ! all of it, because of copyin clause when calling leapfrog |
---|
[2601] | 23 | USE temps_mod, ONLY: calend,start_time,annee_ref,day_ref, & |
---|
| 24 | itau_dyn,itau_phy,day_ini,jD_ref,jH_ref,day_end, & |
---|
| 25 | dt,hour_ini,itaufin |
---|
[4146] | 26 | USE mod_xios_dyn3dmem, ONLY: xios_dyn3dmem_init |
---|
[5250] | 27 | USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_PHYS |
---|
[5271] | 28 | USE dimensions_mod, ONLY: iim, jjm, llm, ndm |
---|
[5272] | 29 | USE paramet_mod_h, ONLY: iip1, iip2, iip3, jjp1, llmp1, llmp2, llmm1, kftd, ip1jm, ip1jmp1, & |
---|
| 30 | ip1jmi1, ijp1llm, ijmllm, mvar, jcfil, jcfllm |
---|
[5271] | 31 | IMPLICIT NONE |
---|
[1632] | 32 | |
---|
[2263] | 33 | ! ...... Version du 10/01/98 .......... |
---|
[1632] | 34 | |
---|
[5271] | 35 | ! avec coordonnees verticales hybrides |
---|
[2263] | 36 | ! avec nouveaux operat. dissipation * ( gradiv2,divgrad2,nxgraro2 ) |
---|
[1632] | 37 | |
---|
[2263] | 38 | !======================================================================= |
---|
| 39 | ! |
---|
| 40 | ! Auteur: P. Le Van /L. Fairhead/F.Hourdin |
---|
| 41 | ! ------- |
---|
| 42 | ! |
---|
| 43 | ! Objet: |
---|
| 44 | ! ------ |
---|
| 45 | ! |
---|
| 46 | ! GCM LMD nouvelle grille |
---|
| 47 | ! |
---|
| 48 | !======================================================================= |
---|
| 49 | ! |
---|
| 50 | ! ... Dans inigeom , nouveaux calculs pour les elongations cu , cv |
---|
| 51 | ! et possibilite d'appeler une fonction f(y) a derivee tangente |
---|
| 52 | ! hyperbolique a la place de la fonction a derivee sinusoidale. |
---|
| 53 | ! ... Possibilite de choisir le schema pour l'advection de |
---|
| 54 | ! q , en modifiant iadv dans traceur.def (MAF,10/02) . |
---|
| 55 | ! |
---|
| 56 | ! Pour Van-Leer + Vapeur d'eau saturee, iadv(1)=4. (F.Codron,10/99) |
---|
| 57 | ! Pour Van-Leer iadv=10 |
---|
| 58 | ! |
---|
| 59 | !----------------------------------------------------------------------- |
---|
| 60 | ! Declarations: |
---|
| 61 | ! ------------- |
---|
| 62 | include "comdissnew.h" |
---|
| 63 | include "comgeom.h" |
---|
| 64 | include "description.h" |
---|
| 65 | include "iniprint.h" |
---|
| 66 | include "tracstoke.h" |
---|
[1658] | 67 | |
---|
[1632] | 68 | |
---|
[2263] | 69 | REAL zdtvr |
---|
[1632] | 70 | |
---|
[2263] | 71 | ! variables dynamiques |
---|
| 72 | REAL,ALLOCATABLE,SAVE :: vcov(:,:),ucov(:,:) ! vents covariants |
---|
| 73 | REAL,ALLOCATABLE,SAVE :: teta(:,:) ! temperature potentielle |
---|
| 74 | REAL, ALLOCATABLE,SAVE :: q(:,:,:) ! champs advectes |
---|
| 75 | REAL,ALLOCATABLE,SAVE :: ps(:) ! pression au sol |
---|
| 76 | ! REAL p (ip1jmp1,llmp1 ) ! pression aux interfac.des couches |
---|
| 77 | REAL,ALLOCATABLE,SAVE :: masse(:,:) ! masse d'air |
---|
| 78 | REAL,ALLOCATABLE,SAVE :: phis(:) ! geopotentiel au sol |
---|
| 79 | ! REAL phi(ip1jmp1,llm) ! geopotentiel |
---|
| 80 | ! REAL w(ip1jmp1,llm) ! vitesse verticale |
---|
[1632] | 81 | |
---|
[2263] | 82 | ! variables dynamiques intermediaire pour le transport |
---|
[1632] | 83 | |
---|
[2263] | 84 | ! variables pour le fichier histoire |
---|
| 85 | REAL dtav ! intervalle de temps elementaire |
---|
[1632] | 86 | |
---|
[2263] | 87 | REAL time_0 |
---|
[1632] | 88 | |
---|
[2263] | 89 | LOGICAL lafin |
---|
[1632] | 90 | |
---|
[2263] | 91 | real time_step, t_wrt, t_ops |
---|
[1632] | 92 | |
---|
[2263] | 93 | !+jld variables test conservation energie |
---|
| 94 | ! REAL ecin(ip1jmp1,llm),ecin0(ip1jmp1,llm) |
---|
| 95 | ! Tendance de la temp. potentiel d (theta)/ d t due a la |
---|
| 96 | ! tansformation d'energie cinetique en energie thermique |
---|
| 97 | ! cree par la dissipation |
---|
| 98 | ! REAL dhecdt(ip1jmp1,llm) |
---|
| 99 | ! REAL vcont(ip1jm,llm),ucont(ip1jmp1,llm) |
---|
| 100 | ! REAL d_h_vcol, d_qt, d_qw, d_ql, d_ec |
---|
| 101 | ! CHARACTER (len=15) :: ztit |
---|
| 102 | !-jld |
---|
[1632] | 103 | |
---|
| 104 | |
---|
[2263] | 105 | character (len=80) :: dynhist_file, dynhistave_file |
---|
| 106 | character (len=20) :: modname |
---|
| 107 | character (len=80) :: abort_message |
---|
| 108 | ! locales pour gestion du temps |
---|
| 109 | INTEGER :: an, mois, jour |
---|
| 110 | REAL :: heure |
---|
[4146] | 111 | ! needed for xios interface |
---|
| 112 | character (len=10) :: xios_cal_type |
---|
| 113 | INTEGER :: anref, moisref, jourref |
---|
| 114 | REAL :: heureref |
---|
| 115 | |
---|
[1632] | 116 | |
---|
| 117 | |
---|
[2263] | 118 | !----------------------------------------------------------------------- |
---|
| 119 | ! Initialisations: |
---|
| 120 | ! ---------------- |
---|
[1632] | 121 | |
---|
[2263] | 122 | abort_message = 'last timestep reached' |
---|
| 123 | modname = 'gcm' |
---|
| 124 | descript = 'Run GCM LMDZ' |
---|
| 125 | lafin = .FALSE. |
---|
| 126 | dynhist_file = 'dyn_hist' |
---|
| 127 | dynhistave_file = 'dyn_hist_ave' |
---|
[1632] | 128 | |
---|
| 129 | |
---|
| 130 | |
---|
[2263] | 131 | !---------------------------------------------------------------------- |
---|
| 132 | ! lecture des fichiers gcm.def ou run.def |
---|
| 133 | ! --------------------------------------- |
---|
| 134 | ! |
---|
| 135 | CALL conf_gcm( 99, .TRUE. ) |
---|
| 136 | if (mod(iphysiq, iperiod) /= 0) call abort_gcm("conf_gcm", & |
---|
| 137 | "iphysiq must be a multiple of iperiod", 1) |
---|
| 138 | ! |
---|
| 139 | ! |
---|
| 140 | !------------------------------------ |
---|
| 141 | ! Initialisation partie parallele |
---|
| 142 | !------------------------------------ |
---|
| 143 | CALL init_const_mpi |
---|
[1632] | 144 | |
---|
[2263] | 145 | call init_parallel |
---|
| 146 | call Read_Distrib |
---|
[1673] | 147 | |
---|
[2351] | 148 | !#ifdef CPP_PHYS |
---|
| 149 | ! CALL Init_Phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys) |
---|
[2263] | 150 | !#endif |
---|
| 151 | ! CALL set_bands |
---|
| 152 | !#ifdef CPP_PHYS |
---|
[2351] | 153 | ! CALL Init_interface_dyn_phys |
---|
| 154 | !#endif |
---|
[2263] | 155 | CALL barrier |
---|
[1632] | 156 | |
---|
[2263] | 157 | CALL set_bands |
---|
| 158 | if (mpi_rank==0) call WriteBands |
---|
| 159 | call Set_Distrib(distrib_caldyn) |
---|
[1632] | 160 | |
---|
[2263] | 161 | !$OMP PARALLEL |
---|
| 162 | call Init_Mod_hallo |
---|
| 163 | !$OMP END PARALLEL |
---|
[1632] | 164 | |
---|
[2263] | 165 | !#ifdef CPP_PHYS |
---|
| 166 | !c$OMP PARALLEL |
---|
| 167 | ! call InitComgeomphy ! now done in iniphysiq |
---|
| 168 | !c$OMP END PARALLEL |
---|
| 169 | !#endif |
---|
[1632] | 170 | |
---|
[2263] | 171 | !----------------------------------------------------------------------- |
---|
| 172 | ! Choix du calendrier |
---|
| 173 | ! ------------------- |
---|
[1632] | 174 | |
---|
[2263] | 175 | ! calend = 'earth_365d' |
---|
[1632] | 176 | |
---|
[2263] | 177 | if (calend == 'earth_360d') then |
---|
[4361] | 178 | call ioconf_calendar('360_day') |
---|
[2263] | 179 | write(lunout,*)'CALENDRIER CHOISI: Terrestre a 360 jours/an' |
---|
[4146] | 180 | xios_cal_type='d360' |
---|
[2263] | 181 | else if (calend == 'earth_365d') then |
---|
| 182 | call ioconf_calendar('noleap') |
---|
| 183 | write(lunout,*)'CALENDRIER CHOISI: Terrestre a 365 jours/an' |
---|
[4146] | 184 | xios_cal_type='noleap' |
---|
[2263] | 185 | else if (calend == 'gregorian') then |
---|
| 186 | call ioconf_calendar('gregorian') |
---|
| 187 | write(lunout,*)'CALENDRIER CHOISI: Terrestre bissextile' |
---|
[4146] | 188 | xios_cal_type='gregorian' |
---|
[2263] | 189 | else |
---|
| 190 | abort_message = 'Mauvais choix de calendrier' |
---|
| 191 | call abort_gcm(modname,abort_message,1) |
---|
| 192 | endif |
---|
[1632] | 193 | |
---|
| 194 | |
---|
[5267] | 195 | |
---|
[2263] | 196 | !----------------------------------------------------------------------- |
---|
| 197 | ! Initialisation des traceurs |
---|
| 198 | ! --------------------------- |
---|
| 199 | ! Choix du nombre de traceurs et du schema pour l'advection |
---|
| 200 | ! dans fichier traceur.def, par default ou via INCA |
---|
[4325] | 201 | call init_infotrac |
---|
[1632] | 202 | |
---|
[2263] | 203 | ! Allocation de la tableau q : champs advectes |
---|
| 204 | ALLOCATE(ucov(ijb_u:ije_u,llm)) |
---|
| 205 | ALLOCATE(vcov(ijb_v:ije_v,llm)) |
---|
| 206 | ALLOCATE(teta(ijb_u:ije_u,llm)) |
---|
| 207 | ALLOCATE(masse(ijb_u:ije_u,llm)) |
---|
| 208 | ALLOCATE(ps(ijb_u:ije_u)) |
---|
| 209 | ALLOCATE(phis(ijb_u:ije_u)) |
---|
| 210 | ALLOCATE(q(ijb_u:ije_u,llm,nqtot)) |
---|
[1632] | 211 | |
---|
[2263] | 212 | !----------------------------------------------------------------------- |
---|
| 213 | ! Lecture de l'etat initial : |
---|
| 214 | ! --------------------------- |
---|
[1632] | 215 | |
---|
[2263] | 216 | ! lecture du fichier start.nc |
---|
| 217 | if (read_start) then |
---|
| 218 | ! we still need to run iniacademic to initialize some |
---|
| 219 | ! constants & fields, if we run the 'newtonian' or 'SW' cases: |
---|
| 220 | if (iflag_phys.ne.1) then |
---|
| 221 | CALL iniacademic_loc(vcov,ucov,teta,q,masse,ps,phis,time_0) |
---|
| 222 | endif |
---|
[1657] | 223 | |
---|
[2263] | 224 | ! if (planet_type.eq."earth") then |
---|
| 225 | ! Load an Earth-format start file |
---|
| 226 | CALL dynetat0_loc("start.nc",vcov,ucov, & |
---|
| 227 | teta,q,masse,ps,phis, time_0) |
---|
| 228 | ! endif ! of if (planet_type.eq."earth") |
---|
[1673] | 229 | |
---|
[2263] | 230 | ! write(73,*) 'ucov',ucov |
---|
| 231 | ! write(74,*) 'vcov',vcov |
---|
| 232 | ! write(75,*) 'teta',teta |
---|
| 233 | ! write(76,*) 'ps',ps |
---|
| 234 | ! write(77,*) 'q',q |
---|
[1632] | 235 | |
---|
[2263] | 236 | endif ! of if (read_start) |
---|
[1632] | 237 | |
---|
[2263] | 238 | ! le cas echeant, creation d un etat initial |
---|
| 239 | IF (prt_level > 9) WRITE(lunout,*) & |
---|
| 240 | 'GCM: AVANT iniacademic AVANT AVANT AVANT AVANT' |
---|
| 241 | if (.not.read_start) then |
---|
[3579] | 242 | start_time=0. |
---|
[3435] | 243 | annee_ref=anneeref |
---|
[2263] | 244 | CALL iniacademic_loc(vcov,ucov,teta,q,masse,ps,phis,time_0) |
---|
| 245 | endif |
---|
[1632] | 246 | |
---|
[2263] | 247 | !----------------------------------------------------------------------- |
---|
| 248 | ! Lecture des parametres de controle pour la simulation : |
---|
| 249 | ! ------------------------------------------------------- |
---|
| 250 | ! on recalcule eventuellement le pas de temps |
---|
[1632] | 251 | |
---|
[2263] | 252 | IF(MOD(day_step,iperiod).NE.0) THEN |
---|
| 253 | abort_message = & |
---|
| 254 | 'Il faut choisir un nb de pas par jour multiple de iperiod' |
---|
| 255 | call abort_gcm(modname,abort_message,1) |
---|
| 256 | ENDIF |
---|
[1632] | 257 | |
---|
[2263] | 258 | IF(MOD(day_step,iphysiq).NE.0) THEN |
---|
| 259 | abort_message = & |
---|
| 260 | 'Il faut choisir un nb de pas par jour multiple de iphysiq' |
---|
| 261 | call abort_gcm(modname,abort_message,1) |
---|
| 262 | ENDIF |
---|
[1632] | 263 | |
---|
[2263] | 264 | zdtvr = daysec/REAL(day_step) |
---|
| 265 | IF(dtvr.NE.zdtvr) THEN |
---|
| 266 | WRITE(lunout,*) & |
---|
| 267 | 'WARNING!!! changement de pas de temps',dtvr,'>',zdtvr |
---|
| 268 | ENDIF |
---|
[1632] | 269 | |
---|
[2263] | 270 | ! |
---|
| 271 | ! on remet le calendrier \`a zero si demande |
---|
| 272 | ! |
---|
| 273 | IF (start_time /= starttime) then |
---|
| 274 | WRITE(lunout,*)' GCM: Attention l''heure de depart lue dans le' & |
---|
| 275 | ,' fichier restart ne correspond pas a celle lue dans le run.def' |
---|
| 276 | IF (raz_date == 1) then |
---|
| 277 | WRITE(lunout,*)'Je prends l''heure lue dans run.def' |
---|
| 278 | start_time = starttime |
---|
| 279 | ELSE |
---|
| 280 | WRITE(lunout,*)'Je m''arrete' |
---|
| 281 | CALL abort |
---|
| 282 | ENDIF |
---|
| 283 | ENDIF |
---|
| 284 | IF (raz_date == 1) THEN |
---|
| 285 | annee_ref = anneeref |
---|
| 286 | day_ref = dayref |
---|
| 287 | day_ini = dayref |
---|
| 288 | itau_dyn = 0 |
---|
| 289 | itau_phy = 0 |
---|
| 290 | time_0 = 0. |
---|
| 291 | write(lunout,*) & |
---|
| 292 | 'GCM: On reinitialise a la date lue dans gcm.def' |
---|
| 293 | ELSE IF (annee_ref .ne. anneeref .or. day_ref .ne. dayref) THEN |
---|
| 294 | write(lunout,*) & |
---|
| 295 | 'GCM: Attention les dates initiales lues dans le fichier' |
---|
| 296 | write(lunout,*) & |
---|
| 297 | ' restart ne correspondent pas a celles lues dans ' |
---|
| 298 | write(lunout,*)' gcm.def' |
---|
| 299 | write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref |
---|
| 300 | write(lunout,*)' day_ref=',day_ref," dayref=",dayref |
---|
| 301 | write(lunout,*)' Pas de remise a zero' |
---|
| 302 | ENDIF |
---|
| 303 | ! if (annee_ref .ne. anneeref .or. day_ref .ne. dayref) then |
---|
| 304 | ! write(lunout,*) |
---|
| 305 | ! . 'GCM: Attention les dates initiales lues dans le fichier' |
---|
| 306 | ! write(lunout,*) |
---|
| 307 | ! . ' restart ne correspondent pas a celles lues dans ' |
---|
| 308 | ! write(lunout,*)' gcm.def' |
---|
| 309 | ! write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref |
---|
| 310 | ! write(lunout,*)' day_ref=',day_ref," dayref=",dayref |
---|
| 311 | ! if (raz_date .ne. 1) then |
---|
| 312 | ! write(lunout,*) |
---|
| 313 | ! . 'GCM: On garde les dates du fichier restart' |
---|
| 314 | ! else |
---|
| 315 | ! annee_ref = anneeref |
---|
| 316 | ! day_ref = dayref |
---|
| 317 | ! day_ini = dayref |
---|
| 318 | ! itau_dyn = 0 |
---|
| 319 | ! itau_phy = 0 |
---|
| 320 | ! time_0 = 0. |
---|
| 321 | ! write(lunout,*) |
---|
| 322 | ! . 'GCM: On reinitialise a la date lue dans gcm.def' |
---|
| 323 | ! endif |
---|
| 324 | ! ELSE |
---|
| 325 | ! raz_date = 0 |
---|
| 326 | ! endif |
---|
[1632] | 327 | |
---|
[2263] | 328 | mois = 1 |
---|
| 329 | heure = 0. |
---|
| 330 | call ymds2ju(annee_ref, mois, day_ref, heure, jD_ref) |
---|
| 331 | jH_ref = jD_ref - int(jD_ref) |
---|
| 332 | jD_ref = int(jD_ref) |
---|
[1632] | 333 | |
---|
[2263] | 334 | call ioconf_startdate(INT(jD_ref), jH_ref) |
---|
[1632] | 335 | |
---|
[2263] | 336 | write(lunout,*)'DEBUG' |
---|
| 337 | write(lunout,*)'annee_ref, mois, day_ref, heure, jD_ref' |
---|
| 338 | write(lunout,*)annee_ref, mois, day_ref, heure, jD_ref |
---|
[4146] | 339 | call ju2ymds(jD_ref+jH_ref,anref, moisref, jourref, heureref) |
---|
[2263] | 340 | write(lunout,*)'jD_ref+jH_ref,an, mois, jour, heure' |
---|
[4146] | 341 | write(lunout,*)jD_ref+jH_ref,anref, moisref, jourref, heureref |
---|
[1632] | 342 | |
---|
[5267] | 343 | |
---|
[2263] | 344 | if (iflag_phys.eq.1) then |
---|
| 345 | ! these initialisations have already been done (via iniacademic) |
---|
| 346 | ! if running in SW or Newtonian mode |
---|
| 347 | !----------------------------------------------------------------------- |
---|
| 348 | ! Initialisation des constantes dynamiques : |
---|
| 349 | ! ------------------------------------------ |
---|
| 350 | dtvr = zdtvr |
---|
| 351 | CALL iniconst |
---|
[1632] | 352 | |
---|
[2263] | 353 | !----------------------------------------------------------------------- |
---|
| 354 | ! Initialisation de la geometrie : |
---|
| 355 | ! -------------------------------- |
---|
| 356 | CALL inigeom |
---|
[1632] | 357 | |
---|
[2263] | 358 | !----------------------------------------------------------------------- |
---|
| 359 | ! Initialisation du filtre : |
---|
| 360 | ! -------------------------- |
---|
| 361 | CALL inifilr |
---|
| 362 | endif ! of if (iflag_phys.eq.1) |
---|
| 363 | ! |
---|
| 364 | !----------------------------------------------------------------------- |
---|
| 365 | ! Initialisation de la dissipation : |
---|
| 366 | ! ---------------------------------- |
---|
[1632] | 367 | |
---|
[2263] | 368 | CALL inidissip( lstardis, nitergdiv, nitergrot, niterh , & |
---|
| 369 | tetagdiv, tetagrot , tetatemp, vert_prof_dissip) |
---|
[1632] | 370 | |
---|
[2263] | 371 | !----------------------------------------------------------------------- |
---|
| 372 | ! Initialisation des I/O : |
---|
| 373 | ! ------------------------ |
---|
[1632] | 374 | |
---|
| 375 | |
---|
[2263] | 376 | if (nday>=0) then |
---|
| 377 | day_end = day_ini + nday |
---|
| 378 | else |
---|
| 379 | day_end = day_ini - nday/day_step |
---|
| 380 | endif |
---|
[1632] | 381 | |
---|
[2263] | 382 | WRITE(lunout,300)day_ini,day_end |
---|
| 383 | 300 FORMAT('1'/,15x,'run du jour',i7,2x,'au jour',i7//) |
---|
| 384 | |
---|
| 385 | call ju2ymds(jD_ref + day_ini - day_ref, an, mois, jour, heure) |
---|
| 386 | write (lunout,301)jour, mois, an |
---|
| 387 | call ju2ymds(jD_ref + day_end - day_ref, an, mois, jour, heure) |
---|
| 388 | write (lunout,302)jour, mois, an |
---|
| 389 | 301 FORMAT('1'/,15x,'run du ', i2,'/',i2,'/',i4) |
---|
| 390 | 302 FORMAT('1'/,15x,' au ', i2,'/',i2,'/',i4) |
---|
[1632] | 391 | |
---|
[5267] | 392 | |
---|
[3435] | 393 | !----------------------------------------------------------------------- |
---|
| 394 | ! Initialisation de la physique : |
---|
| 395 | ! ------------------------------- |
---|
[4139] | 396 | |
---|
| 397 | ! Choix des frequences de stokage pour le offline |
---|
| 398 | ! istdyn=day_step/4 ! stockage toutes les 6h=1jour/4 |
---|
| 399 | ! istdyn=day_step/12 ! stockage toutes les 2h=1jour/12 |
---|
| 400 | istdyn=day_step/8 ! stockage toutes les 6h=1jour/12 |
---|
| 401 | istphy=istdyn/iphysiq |
---|
| 402 | |
---|
[3435] | 403 | IF ((iflag_phys==1).or.(iflag_phys>=100)) THEN |
---|
| 404 | ! Physics: |
---|
[5250] | 405 | IF (CPPKEY_PHYS) THEN |
---|
[3435] | 406 | CALL iniphysiq(iim,jjm,llm, & |
---|
| 407 | distrib_phys(mpi_rank),comm_lmdz, & |
---|
| 408 | daysec,day_ini,dtphys/nsplit_phys, & |
---|
| 409 | rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp, & |
---|
| 410 | iflag_phys) |
---|
[5250] | 411 | END IF |
---|
[3435] | 412 | ENDIF ! of IF ((iflag_phys==1).or.(iflag_phys>=100)) |
---|
| 413 | |
---|
| 414 | |
---|
[2263] | 415 | ! if (planet_type.eq."earth") then |
---|
| 416 | ! Write an Earth-format restart file |
---|
| 417 | CALL dynredem0_loc("restart.nc", day_end, phis) |
---|
| 418 | ! endif |
---|
[1632] | 419 | |
---|
[2263] | 420 | ecripar = .TRUE. |
---|
[1632] | 421 | |
---|
[4146] | 422 | #define CPP_IOIPSL |
---|
[2263] | 423 | time_step = zdtvr |
---|
| 424 | if (ok_dyn_ins) then |
---|
| 425 | ! initialize output file for instantaneous outputs |
---|
| 426 | ! t_ops = iecri * daysec ! do operations every t_ops |
---|
[5267] | 427 | t_ops =((1.0*iecri)/day_step) * daysec |
---|
[2263] | 428 | t_wrt = daysec ! iecri * daysec ! write output every t_wrt |
---|
[2475] | 429 | CALL inithist_loc(day_ref,annee_ref,time_step, & |
---|
[2263] | 430 | t_ops,t_wrt) |
---|
| 431 | endif |
---|
[1632] | 432 | |
---|
[5267] | 433 | IF (ok_dyn_ave) THEN |
---|
[2263] | 434 | ! initialize output file for averaged outputs |
---|
| 435 | t_ops = iperiod * time_step ! do operations every t_ops |
---|
| 436 | t_wrt = periodav * daysec ! write output every t_wrt |
---|
| 437 | CALL initdynav_loc(day_ref,annee_ref,time_step,t_ops,t_wrt) |
---|
| 438 | END IF |
---|
| 439 | dtav = iperiod*dtvr/daysec |
---|
[4146] | 440 | |
---|
| 441 | ! setting up DYN3D/XIOS inerface |
---|
[4619] | 442 | if (ok_dyn_xios) then |
---|
| 443 | CALL xios_dyn3dmem_init(xios_cal_type, anref, moisref, jourref,heureref, an, & |
---|
[4146] | 444 | mois, jour, heure, zdtvr) |
---|
| 445 | endif |
---|
| 446 | |
---|
[2263] | 447 | ! |
---|
| 448 | !----------------------------------------------------------------------- |
---|
| 449 | ! Integration temporelle du modele : |
---|
| 450 | ! ---------------------------------- |
---|
[1632] | 451 | |
---|
[2263] | 452 | ! write(78,*) 'ucov',ucov |
---|
| 453 | ! write(78,*) 'vcov',vcov |
---|
| 454 | ! write(78,*) 'teta',teta |
---|
| 455 | ! write(78,*) 'ps',ps |
---|
| 456 | ! write(78,*) 'q',q |
---|
[1632] | 457 | |
---|
[2601] | 458 | !!$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/,/logici/,/logicl/) |
---|
[4103] | 459 | ! Copy all threadprivate variables in temps_mod logic_mod |
---|
[2603] | 460 | !$OMP PARALLEL DEFAULT(SHARED) & |
---|
[2601] | 461 | !$OMP COPYIN(dt,jD_ref,jH_ref,start_time,hour_ini,day_ini,day_end) & |
---|
[2603] | 462 | !$OMP COPYIN(annee_ref,day_ref,itau_dyn,itau_phy,itaufin,calend) & |
---|
| 463 | !$OMP COPYIN(purmats,forward,leapf,apphys,statcl,conser,apdiss,apdelq) & |
---|
| 464 | !$OMP COPYIN(saison,ecripar,fxyhypb,ysinus,read_start,ok_guide) & |
---|
| 465 | !$OMP COPYIN(ok_strato,ok_gradsfile,ok_limit,ok_etat0) & |
---|
[4996] | 466 | !$OMP COPYIN(iflag_phys,iflag_trac,adv_qsat_liq) |
---|
[2263] | 467 | CALL leapfrog_loc(ucov,vcov,teta,ps,masse,phis,q,time_0) |
---|
| 468 | !$OMP END PARALLEL |
---|
[1632] | 469 | |
---|
[2263] | 470 | ! OPEN(unit=5487,file='ok_lmdz',status='replace') |
---|
| 471 | ! WRITE(5487,*) 'ok_lmdz' |
---|
| 472 | ! CLOSE(5487) |
---|
| 473 | END PROGRAM gcm |
---|