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