[1632] | 1 | ! |
---|
[1673] | 2 | ! $Id$ |
---|
[1632] | 3 | ! |
---|
| 4 | c |
---|
| 5 | c |
---|
| 6 | #define DEBUG_IO |
---|
| 7 | #undef DEBUG_IO |
---|
| 8 | |
---|
| 9 | |
---|
| 10 | SUBROUTINE leapfrog_loc(ucov0,vcov0,teta0,ps0, |
---|
[2221] | 11 | & masse0,phis0,q0,time_0) |
---|
[1632] | 12 | |
---|
| 13 | USE misc_mod |
---|
[1823] | 14 | USE parallel_lmdz |
---|
[1632] | 15 | USE times |
---|
| 16 | USE mod_hallo |
---|
| 17 | USE Bands |
---|
| 18 | USE Write_Field |
---|
| 19 | USE Write_Field_p |
---|
| 20 | USE vampir |
---|
| 21 | USE timer_filtre, ONLY : print_filtre_timer |
---|
| 22 | USE infotrac |
---|
| 23 | USE guide_loc_mod, ONLY : guide_main |
---|
| 24 | USE getparam |
---|
| 25 | USE control_mod |
---|
| 26 | USE mod_filtreg_p |
---|
| 27 | USE write_field_loc |
---|
[1810] | 28 | USE allocate_field_mod |
---|
[1632] | 29 | USE call_dissip_mod, ONLY : call_dissip |
---|
| 30 | USE call_calfis_mod, ONLY : call_calfis |
---|
[3583] | 31 | USE leapfrog_mod, ONLY : ucov,vcov,teta,ps,masse,phis,q,dq |
---|
| 32 | & ,ucovm1,vcovm1,tetam1,massem1,psm1,p,pks,pk,pkf,flxw |
---|
| 33 | & ,pbaru,pbarv,du,dv,dteta,phi,dp,w |
---|
| 34 | & ,leapfrog_allocate,leapfrog_switch_caldyn,leapfrog_switch_dissip |
---|
| 35 | |
---|
[2021] | 36 | use exner_hyb_loc_m, only: exner_hyb_loc |
---|
| 37 | use exner_milieu_loc_m, only: exner_milieu_loc |
---|
[2597] | 38 | USE comconst_mod, ONLY: cpp, dtvr, ihf |
---|
[2600] | 39 | USE comvert_mod, ONLY: ap, bp, pressure_exner |
---|
[2603] | 40 | USE logic_mod, ONLY: iflag_phys,ok_guide,forward,leapf,apphys, |
---|
| 41 | & statcl,conser,apdiss,purmats,ok_strato |
---|
[2601] | 42 | USE temps_mod, ONLY: itaufin,jD_ref,jH_ref,day_ini, |
---|
| 43 | & day_ref,start_time,dt |
---|
[2600] | 44 | |
---|
[1632] | 45 | IMPLICIT NONE |
---|
| 46 | |
---|
| 47 | c ...... Version du 10/01/98 .......... |
---|
| 48 | |
---|
| 49 | c avec coordonnees verticales hybrides |
---|
| 50 | c avec nouveaux operat. dissipation * ( gradiv2,divgrad2,nxgraro2 ) |
---|
| 51 | |
---|
| 52 | c======================================================================= |
---|
| 53 | c |
---|
| 54 | c Auteur: P. Le Van /L. Fairhead/F.Hourdin |
---|
| 55 | c ------- |
---|
| 56 | c |
---|
| 57 | c Objet: |
---|
| 58 | c ------ |
---|
| 59 | c |
---|
| 60 | c GCM LMD nouvelle grille |
---|
| 61 | c |
---|
| 62 | c======================================================================= |
---|
| 63 | c |
---|
| 64 | c ... Dans inigeom , nouveaux calculs pour les elongations cu , cv |
---|
| 65 | c et possibilite d'appeler une fonction f(y) a derivee tangente |
---|
| 66 | c hyperbolique a la place de la fonction a derivee sinusoidale. |
---|
| 67 | |
---|
| 68 | c ... Possibilite de choisir le shema pour l'advection de |
---|
| 69 | c q , en modifiant iadv dans traceur.def (10/02) . |
---|
| 70 | c |
---|
| 71 | c Pour Van-Leer + Vapeur d'eau saturee, iadv(1)=4. (F.Codron,10/99) |
---|
| 72 | c Pour Van-Leer iadv=10 |
---|
| 73 | c |
---|
| 74 | c----------------------------------------------------------------------- |
---|
| 75 | c Declarations: |
---|
| 76 | c ------------- |
---|
| 77 | |
---|
[2597] | 78 | include "dimensions.h" |
---|
| 79 | include "paramet.h" |
---|
| 80 | include "comdissnew.h" |
---|
| 81 | include "comgeom.h" |
---|
| 82 | include "description.h" |
---|
| 83 | include "iniprint.h" |
---|
| 84 | include "academic.h" |
---|
[1632] | 85 | |
---|
[1987] | 86 | REAL,INTENT(IN) :: time_0 ! not used |
---|
[1632] | 87 | |
---|
[1987] | 88 | c dynamical variables: |
---|
| 89 | REAL,INTENT(IN) :: ucov0(ijb_u:ije_u,llm) ! zonal covariant wind |
---|
| 90 | REAL,INTENT(IN) :: vcov0(ijb_v:ije_v,llm) ! meridional covariant wind |
---|
| 91 | REAL,INTENT(IN) :: teta0(ijb_u:ije_u,llm) ! potential temperature |
---|
| 92 | REAL,INTENT(IN) :: q0(ijb_u:ije_u,llm,nqtot) ! advected tracers |
---|
| 93 | REAL,INTENT(IN) :: ps0(ijb_u:ije_u) ! surface pressure (Pa) |
---|
| 94 | REAL,INTENT(IN) :: masse0(ijb_u:ije_u,llm) ! air mass |
---|
| 95 | REAL,INTENT(IN) :: phis0(ijb_u:ije_u) ! geopotentiat at the surface |
---|
| 96 | |
---|
[1632] | 97 | real zqmin,zqmax |
---|
| 98 | |
---|
| 99 | ! REAL,SAVE,ALLOCATABLE :: p (:,: ) ! pression aux interfac.des couches |
---|
| 100 | ! REAL,SAVE,ALLOCATABLE :: pks(:) ! exner au sol |
---|
| 101 | ! REAL,SAVE,ALLOCATABLE :: pk(:,:) ! exner au milieu des couches |
---|
| 102 | ! REAL,SAVE,ALLOCATABLE :: pkf(:,:) ! exner filt.au milieu des couches |
---|
| 103 | ! REAL,SAVE,ALLOCATABLE :: phi(:,:) ! geopotentiel |
---|
| 104 | ! REAL,SAVE,ALLOCATABLE :: w(:,:) ! vitesse verticale |
---|
| 105 | |
---|
| 106 | c variables dynamiques intermediaire pour le transport |
---|
| 107 | ! REAL,SAVE,ALLOCATABLE :: pbaru(:,:),pbarv(:,:) !flux de masse |
---|
| 108 | |
---|
| 109 | c variables dynamiques au pas -1 |
---|
| 110 | ! REAL,SAVE,ALLOCATABLE :: vcovm1(:,:),ucovm1(:,:) |
---|
| 111 | ! REAL,SAVE,ALLOCATABLE :: tetam1(:,:),psm1(:) |
---|
| 112 | ! REAL,SAVE,ALLOCATABLE :: massem1(:,:) |
---|
| 113 | |
---|
| 114 | c tendances dynamiques |
---|
| 115 | ! REAL,SAVE,ALLOCATABLE :: dv(:,:),du(:,:) |
---|
| 116 | ! REAL,SAVE,ALLOCATABLE :: dteta(:,:),dp(:) |
---|
| 117 | ! REAL,DIMENSION(:,:,:), ALLOCATABLE, SAVE :: dq |
---|
| 118 | |
---|
| 119 | c tendances de la dissipation |
---|
| 120 | ! REAL,SAVE,ALLOCATABLE :: dvdis(:,:),dudis(:,:) |
---|
| 121 | ! REAL,SAVE,ALLOCATABLE :: dtetadis(:,:) |
---|
| 122 | |
---|
| 123 | c tendances physiques |
---|
[1673] | 124 | REAL,SAVE,ALLOCATABLE :: dvfi(:,:),dufi(:,:) |
---|
| 125 | REAL,SAVE,ALLOCATABLE :: dtetafi(:,:) |
---|
| 126 | REAL,SAVE,ALLOCATABLE :: dpfi(:) |
---|
| 127 | REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: dqfi |
---|
[1632] | 128 | |
---|
| 129 | c variables pour le fichier histoire |
---|
| 130 | REAL dtav ! intervalle de temps elementaire |
---|
| 131 | |
---|
| 132 | REAL tppn(iim),tpps(iim),tpn,tps |
---|
| 133 | c |
---|
| 134 | INTEGER itau,itaufinp1,iav |
---|
| 135 | ! INTEGER iday ! jour julien |
---|
| 136 | REAL time |
---|
| 137 | |
---|
[1987] | 138 | REAL SSUM |
---|
[1632] | 139 | ! REAL,SAVE,ALLOCATABLE :: finvmaold(:,:) |
---|
| 140 | |
---|
| 141 | cym LOGICAL lafin |
---|
| 142 | LOGICAL :: lafin |
---|
| 143 | INTEGER ij,iq,l |
---|
| 144 | INTEGER ik |
---|
| 145 | |
---|
| 146 | real time_step, t_wrt, t_ops |
---|
| 147 | |
---|
| 148 | ! jD_cur: jour julien courant |
---|
| 149 | ! jH_cur: heure julienne courante |
---|
| 150 | REAL :: jD_cur, jH_cur |
---|
| 151 | INTEGER :: an, mois, jour |
---|
| 152 | REAL :: secondes |
---|
| 153 | |
---|
[1673] | 154 | logical :: physic |
---|
[1632] | 155 | LOGICAL first,callinigrads |
---|
| 156 | |
---|
| 157 | data callinigrads/.true./ |
---|
| 158 | character*10 string10 |
---|
| 159 | |
---|
| 160 | ! REAL,SAVE,ALLOCATABLE :: flxw(:,:) ! flux de masse verticale |
---|
| 161 | |
---|
| 162 | c+jld variables test conservation energie |
---|
| 163 | ! REAL,SAVE,ALLOCATABLE :: ecin(:,:),ecin0(:,:) |
---|
| 164 | C Tendance de la temp. potentiel d (theta)/ d t due a la |
---|
| 165 | C tansformation d'energie cinetique en energie thermique |
---|
| 166 | C cree par la dissipation |
---|
| 167 | ! REAL,SAVE,ALLOCATABLE :: dtetaecdt(:,:) |
---|
| 168 | ! REAL,SAVE,ALLOCATABLE :: vcont(:,:),ucont(:,:) |
---|
| 169 | ! REAL,SAVE,ALLOCATABLE :: vnat(:,:),unat(:,:) |
---|
| 170 | REAL d_h_vcol, d_qt, d_qw, d_ql, d_ec |
---|
| 171 | CHARACTER*15 ztit |
---|
| 172 | !! INTEGER ip_ebil_dyn ! PRINT level for energy conserv. diag. |
---|
| 173 | ! SAVE ip_ebil_dyn |
---|
| 174 | ! DATA ip_ebil_dyn/0/ |
---|
| 175 | c-jld |
---|
| 176 | |
---|
| 177 | character*80 dynhist_file, dynhistave_file |
---|
[1673] | 178 | character(len=*),parameter :: modname="leapfrog_loc" |
---|
[1632] | 179 | character*80 abort_message |
---|
| 180 | |
---|
| 181 | |
---|
| 182 | logical,PARAMETER :: dissip_conservative=.TRUE. |
---|
| 183 | |
---|
| 184 | INTEGER testita |
---|
| 185 | PARAMETER (testita = 9) |
---|
| 186 | |
---|
| 187 | logical , parameter :: flag_verif = .false. |
---|
| 188 | |
---|
| 189 | c declaration liees au parallelisme |
---|
| 190 | INTEGER :: ierr |
---|
| 191 | LOGICAL :: FirstCaldyn |
---|
| 192 | LOGICAL :: FirstPhysic |
---|
| 193 | INTEGER :: ijb,ije,j,i |
---|
| 194 | type(Request) :: TestRequest |
---|
| 195 | type(Request) :: Request_Dissip |
---|
| 196 | type(Request) :: Request_physic |
---|
| 197 | |
---|
| 198 | INTEGER :: true_itau |
---|
| 199 | INTEGER :: iapptrac |
---|
| 200 | INTEGER :: AdjustCount |
---|
| 201 | ! INTEGER :: var_time |
---|
| 202 | LOGICAL :: ok_start_timer=.FALSE. |
---|
| 203 | LOGICAL, SAVE :: firstcall=.TRUE. |
---|
| 204 | TYPE(distrib),SAVE :: new_dist |
---|
[2270] | 205 | |
---|
| 206 | if (ok_iso_verif) then |
---|
| 207 | call check_isotopes(q0,ijb_u,ije_u,'leapfrog204: debut') |
---|
| 208 | endif !if (ok_iso_verif) then |
---|
[1632] | 209 | |
---|
| 210 | c$OMP MASTER |
---|
| 211 | ItCount=0 |
---|
| 212 | c$OMP END MASTER |
---|
| 213 | true_itau=0 |
---|
| 214 | FirstCaldyn=.TRUE. |
---|
| 215 | FirstPhysic=.TRUE. |
---|
| 216 | iapptrac=0 |
---|
| 217 | AdjustCount = 0 |
---|
| 218 | lafin=.false. |
---|
| 219 | |
---|
[2038] | 220 | if (nday>=0) then |
---|
| 221 | itaufin = nday*day_step |
---|
| 222 | else |
---|
| 223 | itaufin = -nday |
---|
| 224 | endif |
---|
| 225 | |
---|
[1632] | 226 | itaufinp1 = itaufin +1 |
---|
| 227 | |
---|
[2270] | 228 | if (ok_iso_verif) then |
---|
| 229 | call check_isotopes(q0,ijb_u,ije_u,'leapfrog 226') |
---|
| 230 | endif !if (ok_iso_verif) then |
---|
| 231 | |
---|
[1632] | 232 | itau = 0 |
---|
[1673] | 233 | physic=.true. |
---|
| 234 | if (iflag_phys==0.or.iflag_phys==2) physic=.false. |
---|
[1632] | 235 | CALL init_nan |
---|
| 236 | CALL leapfrog_allocate |
---|
| 237 | ucov=ucov0 |
---|
| 238 | vcov=vcov0 |
---|
| 239 | teta=teta0 |
---|
| 240 | ps=ps0 |
---|
| 241 | masse=masse0 |
---|
| 242 | phis=phis0 |
---|
| 243 | q=q0 |
---|
[2270] | 244 | |
---|
| 245 | if (ok_iso_verif) then |
---|
| 246 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 239') |
---|
| 247 | endif !if (ok_iso_verif) then |
---|
[1632] | 248 | |
---|
| 249 | ! iday = day_ini+itau/day_step |
---|
| 250 | ! time = REAL(itau-(iday-day_ini)*day_step)/day_step+time_0 |
---|
| 251 | ! IF(time.GT.1.) THEN |
---|
| 252 | ! time = time-1. |
---|
| 253 | ! iday = iday+1 |
---|
| 254 | ! ENDIF |
---|
| 255 | |
---|
| 256 | c Allocate variables depending on dynamic variable nqtot |
---|
[1705] | 257 | !$OMP MASTER |
---|
| 258 | if (firstcall) then |
---|
[1632] | 259 | ! |
---|
| 260 | ! ALLOCATE(p(ijb_u:ije_u,llmp1)) |
---|
| 261 | ! ALLOCATE(pks(ijb_u:ije_u)) |
---|
| 262 | ! ALLOCATE(pk(ijb_u:ije_u,llm)) |
---|
| 263 | ! ALLOCATE(pkf(ijb_u:ije_u,llm)) |
---|
| 264 | ! ALLOCATE(phi(ijb_u:ije_u,llm)) |
---|
| 265 | ! ALLOCATE(w(ijb_u:ije_u,llm)) |
---|
| 266 | ! ALLOCATE(pbaru(ip1jmp1,llm),pbarv(ip1jm,llm)) |
---|
| 267 | ! ALLOCATE(vcovm1(ijb_v:ije_v,llm),ucovm1(ijb_u:ije_u,llm)) |
---|
| 268 | ! ALLOCATE(tetam1(ijb_u:ije_u,llm),psm1(ijb_u:ije_u)) |
---|
| 269 | ! ALLOCATE(massem1(ijb_u:ije_u,llm)) |
---|
| 270 | ! ALLOCATE(dv(ijb_v:ije_v,llm),du(ijb_u:ije_u,llm)) |
---|
| 271 | ! ALLOCATE(dteta(ijb_u:ije_u,llm),dp(ijb_u:ije_u)) |
---|
| 272 | ! ALLOCATE(dvdis(ijb_v:ije_v,llm),dudis(ijb_u:ije_u,llm)) |
---|
| 273 | ! ALLOCATE(dtetadis(ijb_u:ije_u,llm)) |
---|
[1673] | 274 | ALLOCATE(dvfi(ijb_v:ije_v,llm),dufi(ijb_u:ije_u,llm)) |
---|
| 275 | ALLOCATE(dtetafi(ijb_u:ije_u,llm)) |
---|
| 276 | ALLOCATE(dpfi(ijb_u:ije_u)) |
---|
[1632] | 277 | ! ALLOCATE(dq(ijb_u:ije_u,llm,nqtot)) |
---|
[1673] | 278 | ALLOCATE(dqfi(ijb_u:ije_u,llm,nqtot)) |
---|
[1632] | 279 | ! ALLOCATE(dqfi_tmp(iip1,llm,nqtot)) |
---|
| 280 | ! ALLOCATE(finvmaold(ijb_u:ije_u,llm)) |
---|
| 281 | ! ALLOCATE(flxw(ijb_u:ije_u,llm)) |
---|
| 282 | ! ALLOCATE(ecin(ijb_u:ije_u,llm),ecin0(ijb_u:ije_u,llm)) |
---|
| 283 | ! ALLOCATE(dtetaecdt(ijb_u:ije_u,llm)) |
---|
| 284 | ! ALLOCATE(vcont(ijb_v:ije_v,llm),ucont(ijb_u:ije_u,llm)) |
---|
| 285 | ! ALLOCATE(vnat(ijb_v:ije_v,llm),unat(ijb_u:ije_u,llm)) |
---|
[1705] | 286 | endif |
---|
| 287 | !$OMP END MASTER |
---|
| 288 | !$OMP BARRIER |
---|
[1632] | 289 | |
---|
| 290 | ! CALL dynredem1_loc("restart.nc",0.0, |
---|
| 291 | ! & vcov,ucov,teta,q,masse,ps) |
---|
| 292 | |
---|
| 293 | |
---|
| 294 | c----------------------------------------------------------------------- |
---|
| 295 | c On initialise la pression et la fonction d'Exner : |
---|
| 296 | c -------------------------------------------------- |
---|
| 297 | |
---|
| 298 | c$OMP MASTER |
---|
[1673] | 299 | dq(:,:,:)=0. |
---|
[1632] | 300 | CALL pression ( ijnb_u, ap, bp, ps, p ) |
---|
| 301 | c$OMP END MASTER |
---|
[1673] | 302 | if (pressure_exner) then |
---|
[2021] | 303 | CALL exner_hyb_loc( ijnb_u, ps, p, pks, pk, pkf) |
---|
[1673] | 304 | else |
---|
[2021] | 305 | CALL exner_milieu_loc( ijnb_u, ps, p, pks, pk, pkf ) |
---|
[1673] | 306 | endif |
---|
[1632] | 307 | c----------------------------------------------------------------------- |
---|
| 308 | c Debut de l'integration temporelle: |
---|
| 309 | c ---------------------------------- |
---|
| 310 | c et du parallelisme !! |
---|
| 311 | |
---|
[1673] | 312 | 1 CONTINUE ! Matsuno Forward step begins here |
---|
[2375] | 313 | |
---|
| 314 | c date: (NB: date remains unchanged for Backward step) |
---|
| 315 | c ----- |
---|
| 316 | |
---|
[1673] | 317 | jD_cur = jD_ref + day_ini - day_ref + & |
---|
[2375] | 318 | & (itau+1)/day_step |
---|
[1673] | 319 | jH_cur = jH_ref + start_time + & |
---|
[2375] | 320 | & mod(itau+1,day_step)/float(day_step) |
---|
[1673] | 321 | if (jH_cur > 1.0 ) then |
---|
| 322 | jD_cur = jD_cur +1. |
---|
| 323 | jH_cur = jH_cur -1. |
---|
| 324 | endif |
---|
[1632] | 325 | |
---|
[2270] | 326 | if (ok_iso_verif) then |
---|
| 327 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 321') |
---|
| 328 | endif !if (ok_iso_verif) then |
---|
[1673] | 329 | |
---|
[1632] | 330 | #ifdef CPP_IOIPSL |
---|
| 331 | if (ok_guide) then |
---|
| 332 | call guide_main(itau,ucov,vcov,teta,q,masse,ps) |
---|
| 333 | !$OMP BARRIER |
---|
| 334 | endif |
---|
| 335 | #endif |
---|
| 336 | |
---|
| 337 | |
---|
| 338 | c |
---|
| 339 | c IF( MOD( itau, 10* day_step ).EQ.0 ) THEN |
---|
| 340 | c CALL test_period ( ucov,vcov,teta,q,p,phis ) |
---|
| 341 | c PRINT *,' ---- Test_period apres continue OK ! -----', itau |
---|
| 342 | c ENDIF |
---|
| 343 | c |
---|
| 344 | cym CALL SCOPY( ijmllm ,vcov , 1, vcovm1 , 1 ) |
---|
| 345 | cym CALL SCOPY( ijp1llm,ucov , 1, ucovm1 , 1 ) |
---|
| 346 | cym CALL SCOPY( ijp1llm,teta , 1, tetam1 , 1 ) |
---|
| 347 | cym CALL SCOPY( ijp1llm,masse, 1, massem1, 1 ) |
---|
| 348 | cym CALL SCOPY( ip1jmp1, ps , 1, psm1 , 1 ) |
---|
| 349 | |
---|
| 350 | if (FirstCaldyn) then |
---|
| 351 | c$OMP MASTER |
---|
| 352 | ucovm1=ucov |
---|
| 353 | vcovm1=vcov |
---|
| 354 | tetam1= teta |
---|
| 355 | massem1= masse |
---|
| 356 | psm1= ps |
---|
| 357 | |
---|
[1673] | 358 | ! Ehouarn: finvmaold is actually not used |
---|
| 359 | ! finvmaold = masse |
---|
[1632] | 360 | c$OMP END MASTER |
---|
| 361 | c$OMP BARRIER |
---|
[1673] | 362 | ! CALL filtreg_p ( finvmaold ,jjb_u,jje_u,jjb_u,jje_u,jjp1, llm, |
---|
| 363 | ! & -2,2, .TRUE., 1 ) |
---|
[1632] | 364 | else |
---|
| 365 | ! Save fields obtained at previous time step as '...m1' |
---|
| 366 | ijb=ij_begin |
---|
| 367 | ije=ij_end |
---|
| 368 | |
---|
| 369 | c$OMP MASTER |
---|
| 370 | psm1 (ijb:ije) = ps (ijb:ije) |
---|
| 371 | c$OMP END MASTER |
---|
| 372 | |
---|
| 373 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 374 | DO l=1,llm |
---|
| 375 | ije=ij_end |
---|
| 376 | ucovm1 (ijb:ije,l) = ucov (ijb:ije,l) |
---|
| 377 | tetam1 (ijb:ije,l) = teta (ijb:ije,l) |
---|
| 378 | massem1 (ijb:ije,l) = masse (ijb:ije,l) |
---|
[1673] | 379 | ! finvmaold(ijb:ije,l)=masse(ijb:ije,l) |
---|
[1632] | 380 | |
---|
| 381 | if (pole_sud) ije=ij_end-iip1 |
---|
| 382 | vcovm1(ijb:ije,l) = vcov (ijb:ije,l) |
---|
| 383 | |
---|
| 384 | |
---|
| 385 | ENDDO |
---|
| 386 | c$OMP ENDDO |
---|
| 387 | |
---|
| 388 | |
---|
[1673] | 389 | ! Ehouarn: finvmaold not used |
---|
| 390 | ! CALL filtreg_p(finvmaold ,jjb_u,jje_u,jj_begin,jj_end,jjp1, |
---|
| 391 | ! . llm, -2,2, .TRUE., 1 ) |
---|
[1632] | 392 | |
---|
| 393 | endif ! of if (FirstCaldyn) |
---|
| 394 | |
---|
| 395 | forward = .TRUE. |
---|
| 396 | leapf = .FALSE. |
---|
| 397 | dt = dtvr |
---|
| 398 | |
---|
| 399 | c ... P.Le Van .26/04/94 .... |
---|
| 400 | |
---|
| 401 | cym CALL SCOPY ( ijp1llm, masse, 1, finvmaold, 1 ) |
---|
| 402 | cym CALL filtreg ( finvmaold ,jjp1, llm, -2,2, .TRUE., 1 ) |
---|
| 403 | |
---|
| 404 | cym ne sert a rien |
---|
| 405 | cym call minmax(ijp1llm,q(:,:,3),zqmin,zqmax) |
---|
| 406 | |
---|
[2270] | 407 | |
---|
| 408 | if (ok_iso_verif) then |
---|
| 409 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 400') |
---|
| 410 | endif !if (ok_iso_verif) then |
---|
| 411 | |
---|
[1673] | 412 | 2 CONTINUE ! Matsuno backward or leapfrog step begins here |
---|
[1632] | 413 | |
---|
[2270] | 414 | |
---|
| 415 | if (ok_iso_verif) then |
---|
| 416 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 402') |
---|
| 417 | endif !if (ok_iso_verif) then |
---|
| 418 | |
---|
[1632] | 419 | c$OMP MASTER |
---|
| 420 | ItCount=ItCount+1 |
---|
[1682] | 421 | if (MOD(ItCount,1)==1) then |
---|
[1632] | 422 | debug=.true. |
---|
| 423 | else |
---|
| 424 | debug=.false. |
---|
| 425 | endif |
---|
| 426 | c$OMP END MASTER |
---|
| 427 | c----------------------------------------------------------------------- |
---|
| 428 | |
---|
[2375] | 429 | c date: (NB: only leapfrog step requires recomputing date) |
---|
[1632] | 430 | c ----- |
---|
| 431 | |
---|
[2375] | 432 | IF (leapf) THEN |
---|
| 433 | jD_cur = jD_ref + day_ini - day_ref + |
---|
| 434 | & (itau+1)/day_step |
---|
| 435 | jH_cur = jH_ref + start_time + |
---|
| 436 | & mod(itau+1,day_step)/float(day_step) |
---|
| 437 | if (jH_cur > 1.0 ) then |
---|
| 438 | jD_cur = jD_cur +1. |
---|
| 439 | jH_cur = jH_cur -1. |
---|
| 440 | endif |
---|
| 441 | ENDIF |
---|
[1632] | 442 | |
---|
| 443 | c gestion des appels de la physique et des dissipations: |
---|
| 444 | c ------------------------------------------------------ |
---|
| 445 | c |
---|
| 446 | c ... P.Le Van ( 6/02/95 ) .... |
---|
| 447 | |
---|
| 448 | apphys = .FALSE. |
---|
| 449 | statcl = .FALSE. |
---|
| 450 | conser = .FALSE. |
---|
| 451 | apdiss = .FALSE. |
---|
| 452 | |
---|
| 453 | IF( purmats ) THEN |
---|
[1657] | 454 | ! Purely Matsuno time stepping |
---|
[1632] | 455 | IF( MOD(itau,iconser) .EQ.0.AND. forward ) conser = .TRUE. |
---|
[1673] | 456 | IF( MOD(itau,dissip_period ).EQ.0.AND..NOT.forward ) |
---|
| 457 | s apdiss = .TRUE. |
---|
[1632] | 458 | IF( MOD(itau,iphysiq ).EQ.0.AND..NOT.forward |
---|
[1673] | 459 | s .and. physic ) apphys = .TRUE. |
---|
[1632] | 460 | ELSE |
---|
[1657] | 461 | ! Leapfrog/Matsuno time stepping |
---|
[1632] | 462 | IF( MOD(itau ,iconser) .EQ. 0 ) conser = .TRUE. |
---|
[1673] | 463 | IF( MOD(itau+1,dissip_period).EQ.0 .AND. .NOT. forward ) |
---|
| 464 | s apdiss = .TRUE. |
---|
| 465 | IF( MOD(itau+1,iphysiq).EQ.0.AND.physic) apphys=.TRUE. |
---|
[1632] | 466 | END IF |
---|
| 467 | |
---|
[1657] | 468 | ! Ehouarn: for Shallow Water case (ie: 1 vertical layer), |
---|
| 469 | ! supress dissipation step |
---|
| 470 | if (llm.eq.1) then |
---|
| 471 | apdiss=.false. |
---|
| 472 | endif |
---|
| 473 | |
---|
[1632] | 474 | cym ---> Pour le moment |
---|
| 475 | cym apphys = .FALSE. |
---|
| 476 | statcl = .FALSE. |
---|
[2616] | 477 | ! conser = .FALSE. ! ie: no output of control variables to stdout in // |
---|
[1632] | 478 | |
---|
| 479 | if (firstCaldyn) then |
---|
| 480 | c$OMP MASTER |
---|
| 481 | call Set_Distrib(distrib_caldyn) |
---|
| 482 | c$OMP END MASTER |
---|
| 483 | c$OMP BARRIER |
---|
| 484 | firstCaldyn=.FALSE. |
---|
| 485 | cym call InitTime |
---|
| 486 | c$OMP MASTER |
---|
| 487 | call Init_timer |
---|
| 488 | c$OMP END MASTER |
---|
| 489 | endif |
---|
| 490 | |
---|
| 491 | c$OMP MASTER |
---|
| 492 | IF (ok_start_timer) THEN |
---|
| 493 | CALL InitTime |
---|
[1848] | 494 | ok_start_timer=.FALSE. |
---|
[1632] | 495 | ENDIF |
---|
| 496 | c$OMP END MASTER |
---|
| 497 | |
---|
| 498 | |
---|
[2270] | 499 | if (ok_iso_verif) then |
---|
| 500 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 471') |
---|
| 501 | endif !if (ok_iso_verif) then |
---|
| 502 | |
---|
[1632] | 503 | !ym PAS D'AJUSTEMENT POUR LE MOMENT |
---|
| 504 | if (Adjust) then |
---|
| 505 | AdjustCount=AdjustCount+1 |
---|
| 506 | ! if (iapptrac==iapp_tracvl .and. (forward. OR . leapf) |
---|
| 507 | ! & .and. itau/iphysiq>2 .and. Adjustcount>30) then |
---|
| 508 | if (Adjustcount>1) then |
---|
| 509 | AdjustCount=0 |
---|
| 510 | c$OMP MASTER |
---|
| 511 | call allgather_timer_average |
---|
[1673] | 512 | |
---|
| 513 | if (prt_level > 9) then |
---|
[1632] | 514 | |
---|
| 515 | print *,'*********************************' |
---|
| 516 | print *,'****** TIMER CALDYN ******' |
---|
| 517 | do i=0,mpi_size-1 |
---|
| 518 | print *,'proc',i,' : Nb Bandes :',jj_nb_caldyn(i), |
---|
| 519 | & ' : temps moyen :', |
---|
| 520 | & timer_average(jj_nb_caldyn(i),timer_caldyn,i), |
---|
| 521 | & '+-',timer_delta(jj_nb_caldyn(i),timer_caldyn,i) |
---|
| 522 | enddo |
---|
| 523 | |
---|
| 524 | print *,'*********************************' |
---|
| 525 | print *,'****** TIMER VANLEER ******' |
---|
| 526 | do i=0,mpi_size-1 |
---|
| 527 | print *,'proc',i,' : Nb Bandes :',jj_nb_vanleer(i), |
---|
| 528 | & ' : temps moyen :', |
---|
| 529 | & timer_average(jj_nb_vanleer(i),timer_vanleer,i), |
---|
| 530 | & '+-',timer_delta(jj_nb_vanleer(i),timer_vanleer,i) |
---|
| 531 | enddo |
---|
| 532 | |
---|
| 533 | print *,'*********************************' |
---|
| 534 | print *,'****** TIMER DISSIP ******' |
---|
| 535 | do i=0,mpi_size-1 |
---|
| 536 | print *,'proc',i,' : Nb Bandes :',jj_nb_dissip(i), |
---|
| 537 | & ' : temps moyen :', |
---|
| 538 | & timer_average(jj_nb_dissip(i),timer_dissip,i), |
---|
| 539 | & '+-',timer_delta(jj_nb_dissip(i),timer_dissip,i) |
---|
| 540 | enddo |
---|
| 541 | |
---|
| 542 | ! if (mpi_rank==0) call WriteBands |
---|
| 543 | |
---|
| 544 | endif |
---|
| 545 | |
---|
| 546 | call AdjustBands_caldyn(new_dist) |
---|
| 547 | !$OMP END MASTER |
---|
| 548 | !$OMP BARRIER |
---|
| 549 | CALL leapfrog_switch_caldyn(new_dist) |
---|
| 550 | !$OMP BARRIER |
---|
| 551 | |
---|
| 552 | |
---|
| 553 | !$OMP MASTER |
---|
| 554 | distrib_caldyn=new_dist |
---|
| 555 | CALL set_distrib(distrib_caldyn) |
---|
| 556 | !$OMP END MASTER |
---|
| 557 | !$OMP BARRIER |
---|
| 558 | ! call Register_SwapFieldHallo(ucov,ucov,ip1jmp1,llm, |
---|
| 559 | ! & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 560 | ! call Register_SwapFieldHallo(ucovm1,ucovm1,ip1jmp1,llm, |
---|
| 561 | ! & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 562 | ! call Register_SwapFieldHallo(vcov,vcov,ip1jm,llm, |
---|
| 563 | ! & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 564 | ! call Register_SwapFieldHallo(vcovm1,vcovm1,ip1jm,llm, |
---|
| 565 | ! & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 566 | ! call Register_SwapFieldHallo(teta,teta,ip1jmp1,llm, |
---|
| 567 | ! & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 568 | ! call Register_SwapFieldHallo(tetam1,tetam1,ip1jmp1,llm, |
---|
| 569 | ! & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 570 | ! call Register_SwapFieldHallo(masse,masse,ip1jmp1,llm, |
---|
| 571 | ! & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 572 | ! call Register_SwapFieldHallo(massem1,massem1,ip1jmp1,llm, |
---|
| 573 | ! & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 574 | ! call Register_SwapFieldHallo(ps,ps,ip1jmp1,1, |
---|
| 575 | ! & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 576 | ! call Register_SwapFieldHallo(psm1,psm1,ip1jmp1,1, |
---|
| 577 | ! & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 578 | ! call Register_SwapFieldHallo(pkf,pkf,ip1jmp1,llm, |
---|
| 579 | ! & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 580 | ! call Register_SwapFieldHallo(pk,pk,ip1jmp1,llm, |
---|
| 581 | ! & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 582 | ! call Register_SwapFieldHallo(pks,pks,ip1jmp1,1, |
---|
| 583 | ! & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 584 | ! call Register_SwapFieldHallo(phis,phis,ip1jmp1,1, |
---|
| 585 | ! & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 586 | ! call Register_SwapFieldHallo(phi,phi,ip1jmp1,llm, |
---|
| 587 | ! & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 588 | ! call Register_SwapFieldHallo(finvmaold,finvmaold,ip1jmp1,llm, |
---|
| 589 | ! & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 590 | ! |
---|
| 591 | ! do j=1,nqtot |
---|
| 592 | ! call Register_SwapFieldHallo(q(:,:,j),q(:,:,j),ip1jmp1,llm, |
---|
| 593 | ! & jj_nb_caldyn,0,0,TestRequest) |
---|
| 594 | ! enddo |
---|
| 595 | ! |
---|
| 596 | ! call Set_Distrib(distrib_caldyn) |
---|
| 597 | ! call SendRequest(TestRequest) |
---|
| 598 | ! call WaitRequest(TestRequest) |
---|
| 599 | |
---|
| 600 | !$OMP MASTER |
---|
| 601 | call AdjustBands_dissip(new_dist) |
---|
| 602 | !$OMP END MASTER |
---|
| 603 | !$OMP BARRIER |
---|
| 604 | CALL leapfrog_switch_dissip(new_dist) |
---|
| 605 | !$OMP BARRIER |
---|
| 606 | !$OMP MASTER |
---|
| 607 | distrib_dissip=new_dist |
---|
| 608 | !$OMP END MASTER |
---|
| 609 | !$OMP BARRIER |
---|
| 610 | ! call AdjustBands_physic |
---|
| 611 | |
---|
| 612 | c$OMP MASTER |
---|
| 613 | if (mpi_rank==0) call WriteBands |
---|
| 614 | c$OMP END MASTER |
---|
| 615 | |
---|
| 616 | |
---|
| 617 | endif |
---|
| 618 | endif |
---|
| 619 | |
---|
| 620 | |
---|
[2270] | 621 | if (ok_iso_verif) then |
---|
| 622 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 589') |
---|
| 623 | endif !if (ok_iso_verif) then |
---|
[1632] | 624 | |
---|
| 625 | c----------------------------------------------------------------------- |
---|
| 626 | c calcul des tendances dynamiques: |
---|
| 627 | c -------------------------------- |
---|
| 628 | c$OMP BARRIER |
---|
| 629 | c$OMP MASTER |
---|
| 630 | call VTb(VThallo) |
---|
| 631 | c$OMP END MASTER |
---|
| 632 | |
---|
| 633 | call Register_Hallo_u(ucov,llm,1,1,1,1,TestRequest) |
---|
| 634 | call Register_Hallo_v(vcov,llm,1,1,1,1,TestRequest) |
---|
| 635 | call Register_Hallo_u(teta,llm,1,1,1,1,TestRequest) |
---|
| 636 | call Register_Hallo_u(ps,1,1,2,2,1,TestRequest) |
---|
| 637 | call Register_Hallo_u(pkf,llm,1,1,1,1,TestRequest) |
---|
| 638 | call Register_Hallo_u(pk,llm,1,1,1,1,TestRequest) |
---|
| 639 | call Register_Hallo_u(pks,1,1,1,1,1,TestRequest) |
---|
| 640 | call Register_Hallo_u(p,llmp1,1,1,1,1,TestRequest) |
---|
| 641 | |
---|
| 642 | c do j=1,nqtot |
---|
| 643 | c call Register_Hallo(q(1,1,j),ip1jmp1,llm,1,1,1,1, |
---|
| 644 | c * TestRequest) |
---|
| 645 | c enddo |
---|
| 646 | |
---|
| 647 | call SendRequest(TestRequest) |
---|
| 648 | c$OMP BARRIER |
---|
| 649 | call WaitRequest(TestRequest) |
---|
| 650 | |
---|
| 651 | c$OMP MASTER |
---|
| 652 | call VTe(VThallo) |
---|
| 653 | c$OMP END MASTER |
---|
| 654 | c$OMP BARRIER |
---|
| 655 | |
---|
| 656 | if (debug) then |
---|
| 657 | call WriteField_u('ucov',ucov) |
---|
| 658 | call WriteField_v('vcov',vcov) |
---|
| 659 | call WriteField_u('teta',teta) |
---|
| 660 | call WriteField_u('ps',ps) |
---|
| 661 | call WriteField_u('masse',masse) |
---|
| 662 | call WriteField_u('pk',pk) |
---|
| 663 | call WriteField_u('pks',pks) |
---|
| 664 | call WriteField_u('pkf',pkf) |
---|
| 665 | call WriteField_u('phis',phis) |
---|
| 666 | do j=1,nqtot |
---|
| 667 | call WriteField_u('q'//trim(int2str(j)), |
---|
| 668 | . q(:,:,j)) |
---|
| 669 | enddo |
---|
| 670 | endif |
---|
| 671 | |
---|
| 672 | |
---|
| 673 | True_itau=True_itau+1 |
---|
| 674 | |
---|
| 675 | c$OMP MASTER |
---|
| 676 | IF (prt_level>9) THEN |
---|
| 677 | WRITE(lunout,*)"leapfrog_p: Iteration No",True_itau |
---|
| 678 | ENDIF |
---|
| 679 | |
---|
| 680 | |
---|
| 681 | call start_timer(timer_caldyn) |
---|
| 682 | |
---|
[1673] | 683 | ! compute geopotential phi() |
---|
[1632] | 684 | CALL geopot_loc ( ip1jmp1, teta , pk , pks, phis , phi ) |
---|
[2270] | 685 | |
---|
| 686 | if (ok_iso_verif) then |
---|
| 687 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 651') |
---|
| 688 | endif !if (ok_iso_verif) then |
---|
[1632] | 689 | |
---|
| 690 | call VTb(VTcaldyn) |
---|
| 691 | c$OMP END MASTER |
---|
| 692 | ! var_time=time+iday-day_ini |
---|
| 693 | |
---|
| 694 | c$OMP BARRIER |
---|
| 695 | ! CALL FTRACE_REGION_BEGIN("caldyn") |
---|
| 696 | time = jD_cur + jH_cur |
---|
[2270] | 697 | |
---|
[1632] | 698 | CALL caldyn_loc |
---|
| 699 | $ ( itau,ucov,vcov,teta,ps,masse,pk,pkf,phis , |
---|
| 700 | $ phi,conser,du,dv,dteta,dp,w, pbaru,pbarv, time ) |
---|
| 701 | |
---|
| 702 | ! CALL FTRACE_REGION_END("caldyn") |
---|
| 703 | |
---|
| 704 | c$OMP MASTER |
---|
[2616] | 705 | if (mpi_rank==0.AND.conser) THEN |
---|
| 706 | WRITE(lunout,*) 'leapfrog_loc, Time step: ',itau,' Day:',time |
---|
| 707 | ENDIF |
---|
[1632] | 708 | call VTe(VTcaldyn) |
---|
| 709 | c$OMP END MASTER |
---|
| 710 | |
---|
| 711 | #ifdef DEBUG_IO |
---|
| 712 | call WriteField_u('du',du) |
---|
| 713 | call WriteField_v('dv',dv) |
---|
| 714 | call WriteField_u('dteta',dteta) |
---|
| 715 | call WriteField_u('dp',dp) |
---|
| 716 | call WriteField_u('w',w) |
---|
| 717 | call WriteField_u('pbaru',pbaru) |
---|
| 718 | call WriteField_v('pbarv',pbarv) |
---|
| 719 | call WriteField_u('p',p) |
---|
| 720 | call WriteField_u('masse',masse) |
---|
| 721 | call WriteField_u('pk',pk) |
---|
| 722 | #endif |
---|
| 723 | c----------------------------------------------------------------------- |
---|
| 724 | c calcul des tendances advection des traceurs (dont l'humidite) |
---|
| 725 | c ------------------------------------------------------------- |
---|
| 726 | |
---|
[2270] | 727 | if (ok_iso_verif) then |
---|
| 728 | call check_isotopes(q,ijb_u,ije_u, |
---|
| 729 | & 'leapfrog 686: avant caladvtrac') |
---|
| 730 | endif !if (ok_iso_verif) then |
---|
[1632] | 731 | |
---|
| 732 | IF( forward. OR . leapf ) THEN |
---|
[1987] | 733 | ! Ehouarn: NB: fields sent to advtrac are those at the beginning of the time step |
---|
[2286] | 734 | !write(*,*) 'leapfrog 679: avant CALL caladvtrac_loc' |
---|
[1632] | 735 | CALL caladvtrac_loc(q,pbaru,pbarv, |
---|
| 736 | * p, masse, dq, teta, |
---|
| 737 | . flxw,pk, iapptrac) |
---|
| 738 | |
---|
[2286] | 739 | !write(*,*) 'leapfrog 719' |
---|
[2270] | 740 | if (ok_iso_verif) then |
---|
| 741 | call check_isotopes(q,ijb_u,ije_u, |
---|
| 742 | & 'leapfrog 698: apres caladvtrac') |
---|
| 743 | endif !if (ok_iso_verif) then |
---|
| 744 | |
---|
[1632] | 745 | ! do j=1,nqtot |
---|
| 746 | ! call WriteField_u('qadv'//trim(int2str(j)),q(:,:,j)) |
---|
| 747 | ! enddo |
---|
| 748 | |
---|
[1987] | 749 | ! Ehouarn: Storage of mass flux for off-line tracers... not implemented... |
---|
| 750 | |
---|
[1632] | 751 | ENDIF ! of IF( forward. OR . leapf ) |
---|
| 752 | |
---|
| 753 | |
---|
| 754 | c----------------------------------------------------------------------- |
---|
| 755 | c integrations dynamique et traceurs: |
---|
| 756 | c ---------------------------------- |
---|
| 757 | |
---|
| 758 | c$OMP MASTER |
---|
| 759 | call VTb(VTintegre) |
---|
| 760 | c$OMP END MASTER |
---|
| 761 | #ifdef DEBUG_IO |
---|
| 762 | if (true_itau>20) then |
---|
| 763 | call WriteField_u('ucovm1',ucovm1) |
---|
| 764 | call WriteField_v('vcovm1',vcovm1) |
---|
| 765 | call WriteField_u('tetam1',tetam1) |
---|
| 766 | call WriteField_u('psm1',psm1) |
---|
| 767 | call WriteField_u('ucov_int',ucov) |
---|
| 768 | call WriteField_v('vcov_int',vcov) |
---|
| 769 | call WriteField_u('teta_int',teta) |
---|
| 770 | call WriteField_u('ps_int',ps) |
---|
| 771 | endif |
---|
| 772 | #endif |
---|
| 773 | c$OMP BARRIER |
---|
| 774 | ! CALL FTRACE_REGION_BEGIN("integrd") |
---|
| 775 | |
---|
[2286] | 776 | !write(*,*) 'leapfrog 720' |
---|
[2270] | 777 | if (ok_iso_verif) then |
---|
| 778 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 756') |
---|
| 779 | endif !if (ok_iso_verif) then |
---|
| 780 | |
---|
| 781 | ! CRisi: pourquoi aller jusqu'à 2 et non pas jusqu'à nqtot?? |
---|
| 782 | CALL integrd_loc ( nqtot,vcovm1,ucovm1,tetam1,psm1,massem1 , |
---|
[1673] | 783 | $ dv,du,dteta,dq,dp,vcov,ucov,teta,q,ps,masse,phis) |
---|
| 784 | ! $ finvmaold ) |
---|
[1632] | 785 | |
---|
[2286] | 786 | !write(*,*) 'leapfrog 724' |
---|
[2270] | 787 | if (ok_iso_verif) then |
---|
| 788 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 762') |
---|
| 789 | endif !if (ok_iso_verif) then |
---|
| 790 | |
---|
[1632] | 791 | ! CALL FTRACE_REGION_END("integrd") |
---|
| 792 | c$OMP BARRIER |
---|
| 793 | #ifdef DEBUG_IO |
---|
| 794 | call WriteField_u('ucovm1',ucovm1) |
---|
| 795 | call WriteField_v('vcovm1',vcovm1) |
---|
| 796 | call WriteField_u('tetam1',tetam1) |
---|
| 797 | call WriteField_u('psm1',psm1) |
---|
| 798 | call WriteField_u('ucov_int',ucov) |
---|
| 799 | call WriteField_v('vcov_int',vcov) |
---|
| 800 | call WriteField_u('teta_int',teta) |
---|
| 801 | call WriteField_u('ps_int',ps) |
---|
| 802 | #endif |
---|
[2270] | 803 | |
---|
| 804 | if (ok_iso_verif) then |
---|
| 805 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 775') |
---|
| 806 | endif !if (ok_iso_verif) then |
---|
| 807 | |
---|
[1632] | 808 | c do j=1,nqtot |
---|
| 809 | c call WriteField_p('q'//trim(int2str(j)), |
---|
| 810 | c . reshape(q(:,:,j),(/iip1,jmp1,llm/))) |
---|
| 811 | c call WriteField_p('dq'//trim(int2str(j)), |
---|
| 812 | c . reshape(dq(:,:,j),(/iip1,jmp1,llm/))) |
---|
| 813 | c enddo |
---|
| 814 | |
---|
| 815 | |
---|
| 816 | c$OMP MASTER |
---|
| 817 | call VTe(VTintegre) |
---|
| 818 | c$OMP END MASTER |
---|
| 819 | c .P.Le Van (26/04/94 ajout de finvpold dans l'appel d'integrd) |
---|
| 820 | c |
---|
| 821 | c----------------------------------------------------------------------- |
---|
| 822 | c calcul des tendances physiques: |
---|
| 823 | c ------------------------------- |
---|
| 824 | c ######## P.Le Van ( Modif le 6/02/95 ) ########### |
---|
| 825 | c |
---|
| 826 | IF( purmats ) THEN |
---|
| 827 | IF( itau.EQ.itaufin.AND..NOT.forward ) lafin = .TRUE. |
---|
| 828 | ELSE |
---|
| 829 | IF( itau+1. EQ. itaufin ) lafin = .TRUE. |
---|
| 830 | ENDIF |
---|
| 831 | |
---|
| 832 | cc$OMP END PARALLEL |
---|
| 833 | |
---|
| 834 | c |
---|
| 835 | c |
---|
| 836 | IF( apphys ) THEN |
---|
| 837 | |
---|
[2221] | 838 | CALL call_calfis(itau,lafin,ucov,vcov,teta,masse,ps, |
---|
[1632] | 839 | & phis,q,flxw) |
---|
| 840 | ! #ifdef DEBUG_IO |
---|
| 841 | ! call WriteField_u('ucovfi',ucov) |
---|
| 842 | ! call WriteField_v('vcovfi',vcov) |
---|
| 843 | ! call WriteField_u('tetafi',teta) |
---|
| 844 | ! call WriteField_u('pfi',p) |
---|
| 845 | ! call WriteField_u('pkfi',pk) |
---|
| 846 | ! do j=1,nqtot |
---|
| 847 | ! call WriteField_u('qfi'//trim(int2str(j)),q(:,:,j)) |
---|
| 848 | ! enddo |
---|
| 849 | ! #endif |
---|
| 850 | ! c |
---|
| 851 | ! c ....... Ajout P.Le Van ( 17/04/96 ) ........... |
---|
| 852 | ! c |
---|
| 853 | ! cc$OMP PARALLEL DEFAULT(SHARED) |
---|
| 854 | ! cc$OMP+ PRIVATE(rdaym_ini,rdayvrai,ijb,ije) |
---|
| 855 | |
---|
| 856 | ! c$OMP MASTER |
---|
| 857 | ! call suspend_timer(timer_caldyn) |
---|
| 858 | |
---|
| 859 | ! write(lunout,*) |
---|
| 860 | ! & 'leapfrog_p: Entree dans la physique : Iteration No ',true_itau |
---|
| 861 | ! c$OMP END MASTER |
---|
| 862 | |
---|
| 863 | ! CALL pression_loc ( ip1jmp1, ap, bp, ps, p ) |
---|
| 864 | |
---|
| 865 | ! c$OMP BARRIER |
---|
[2021] | 866 | ! CALL exner_hyb_loc( ip1jmp1, ps, p,pks, pk, pkf ) |
---|
[1632] | 867 | ! c$OMP BARRIER |
---|
| 868 | ! jD_cur = jD_ref + day_ini - day_ref |
---|
| 869 | ! $ + int (itau * dtvr / daysec) |
---|
| 870 | ! jH_cur = jH_ref + & |
---|
| 871 | ! & (itau * dtvr / daysec - int(itau * dtvr / daysec)) |
---|
| 872 | ! ! call ju2ymds(jD_cur+jH_cur, an, mois, jour, secondes) |
---|
| 873 | |
---|
| 874 | ! c rajout debug |
---|
| 875 | ! c lafin = .true. |
---|
| 876 | |
---|
| 877 | |
---|
| 878 | ! c Inbterface avec les routines de phylmd (phymars ... ) |
---|
| 879 | ! c ----------------------------------------------------- |
---|
| 880 | |
---|
| 881 | ! c+jld |
---|
| 882 | |
---|
| 883 | ! c Diagnostique de conservation de l'energie : initialisation |
---|
| 884 | ! |
---|
| 885 | ! c-jld |
---|
| 886 | ! c$OMP BARRIER |
---|
| 887 | ! c$OMP MASTER |
---|
| 888 | ! call VTb(VThallo) |
---|
| 889 | ! c$OMP END MASTER |
---|
| 890 | |
---|
| 891 | ! #ifdef DEBUG_IO |
---|
| 892 | ! call WriteField_u('ucovfi',ucov) |
---|
| 893 | ! call WriteField_v('vcovfi',vcov) |
---|
| 894 | ! call WriteField_u('tetafi',teta) |
---|
| 895 | ! call WriteField_u('pfi',p) |
---|
| 896 | ! call WriteField_u('pkfi',pk) |
---|
| 897 | ! #endif |
---|
| 898 | ! call SetTag(Request_physic,800) |
---|
| 899 | ! |
---|
| 900 | ! call Register_SwapField_u(ucov,ucov,distrib_physic, |
---|
| 901 | ! * Request_physic,up=2,down=2) |
---|
| 902 | ! |
---|
| 903 | ! call Register_SwapField_v(vcov,vcov,distrib_physic, |
---|
| 904 | ! * Request_physic,up=2,down=2) |
---|
| 905 | |
---|
| 906 | ! call Register_SwapField_u(teta,teta,distrib_physic, |
---|
| 907 | ! * Request_physic,up=2,down=2) |
---|
| 908 | ! |
---|
| 909 | ! call Register_SwapField_u(masse,masse,distrib_physic, |
---|
| 910 | ! * Request_physic,up=1,down=2) |
---|
| 911 | |
---|
| 912 | ! call Register_SwapField_u(p,p,distrib_physic, |
---|
| 913 | ! * Request_physic,up=2,down=2) |
---|
| 914 | ! |
---|
| 915 | ! call Register_SwapField_u(pk,pk,distrib_physic, |
---|
| 916 | ! * Request_physic,up=2,down=2) |
---|
| 917 | ! |
---|
| 918 | ! call Register_SwapField_u(phis,phis,distrib_physic, |
---|
| 919 | ! * Request_physic,up=2,down=2) |
---|
| 920 | ! |
---|
| 921 | ! call Register_SwapField_u(phi,phi,distrib_physic, |
---|
| 922 | ! * Request_physic,up=2,down=2) |
---|
| 923 | ! |
---|
| 924 | ! call Register_SwapField_u(w,w,distrib_physic, |
---|
| 925 | ! * Request_physic,up=2,down=2) |
---|
| 926 | ! |
---|
| 927 | ! call Register_SwapField_u(q,q,distrib_physic, |
---|
| 928 | ! * Request_physic,up=2,down=2) |
---|
| 929 | |
---|
| 930 | ! call Register_SwapField_u(flxw,flxw,distrib_physic, |
---|
| 931 | ! * Request_physic,up=2,down=2) |
---|
| 932 | ! |
---|
| 933 | ! call SendRequest(Request_Physic) |
---|
| 934 | ! c$OMP BARRIER |
---|
| 935 | ! call WaitRequest(Request_Physic) |
---|
| 936 | |
---|
| 937 | ! c$OMP BARRIER |
---|
| 938 | ! c$OMP MASTER |
---|
| 939 | ! call Set_Distrib(distrib_Physic) |
---|
| 940 | ! call VTe(VThallo) |
---|
| 941 | ! |
---|
| 942 | ! call VTb(VTphysiq) |
---|
| 943 | ! c$OMP END MASTER |
---|
| 944 | ! c$OMP BARRIER |
---|
| 945 | |
---|
| 946 | ! #ifdef DEBUG_IO |
---|
| 947 | ! call WriteField_u('ucovfi',ucov) |
---|
| 948 | ! call WriteField_v('vcovfi',vcov) |
---|
| 949 | ! call WriteField_u('tetafi',teta) |
---|
| 950 | ! call WriteField_u('pfi',p) |
---|
| 951 | ! call WriteField_u('pkfi',pk) |
---|
| 952 | ! do j=1,nqtot |
---|
| 953 | ! call WriteField_u('qfi'//trim(int2str(j)),q(:,:,j)) |
---|
| 954 | ! enddo |
---|
| 955 | ! #endif |
---|
| 956 | ! STOP |
---|
| 957 | ! c$OMP BARRIER |
---|
| 958 | ! ! CALL FTRACE_REGION_BEGIN("calfis") |
---|
| 959 | ! CALL calfis_loc(lafin ,jD_cur, jH_cur, |
---|
| 960 | ! $ ucov,vcov,teta,q,masse,ps,p,pk,phis,phi , |
---|
| 961 | ! $ du,dv,dteta,dq, |
---|
| 962 | ! $ flxw, |
---|
[2221] | 963 | ! $ dufi,dvfi,dtetafi,dqfi,dpfi ) |
---|
[1632] | 964 | ! ! CALL FTRACE_REGION_END("calfis") |
---|
| 965 | ! ! ijb=ij_begin |
---|
| 966 | ! ! ije=ij_end |
---|
| 967 | ! ! if ( .not. pole_nord) then |
---|
| 968 | ! !c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 969 | ! ! DO l=1,llm |
---|
| 970 | ! ! dufi_tmp(1:iip1,l) = dufi(ijb:ijb+iim,l) |
---|
| 971 | ! ! dvfi_tmp(1:iip1,l) = dvfi(ijb:ijb+iim,l) |
---|
| 972 | ! ! dtetafi_tmp(1:iip1,l)= dtetafi(ijb:ijb+iim,l) |
---|
| 973 | ! ! dqfi_tmp(1:iip1,l,:) = dqfi(ijb:ijb+iim,l,:) |
---|
| 974 | ! ! ENDDO |
---|
| 975 | ! !c$OMP END DO NOWAIT |
---|
| 976 | ! ! |
---|
| 977 | ! !c$OMP MASTER |
---|
| 978 | ! ! dpfi_tmp(1:iip1) = dpfi(ijb:ijb+iim) |
---|
| 979 | ! !c$OMP END MASTER |
---|
| 980 | ! ! endif ! of if ( .not. pole_nord) |
---|
| 981 | |
---|
| 982 | ! !c$OMP BARRIER |
---|
| 983 | ! !c$OMP MASTER |
---|
| 984 | ! ! call Set_Distrib(distrib_physic_bis) |
---|
| 985 | |
---|
| 986 | ! ! call VTb(VThallo) |
---|
| 987 | ! !c$OMP END MASTER |
---|
| 988 | ! !c$OMP BARRIER |
---|
| 989 | ! ! |
---|
| 990 | ! ! call Register_Hallo_u(dufi,llm, |
---|
| 991 | ! ! * 1,0,0,1,Request_physic) |
---|
| 992 | ! ! |
---|
| 993 | ! ! call Register_Hallo_v(dvfi,llm, |
---|
| 994 | ! ! * 1,0,0,1,Request_physic) |
---|
| 995 | ! ! |
---|
| 996 | ! ! call Register_Hallo_u(dtetafi,llm, |
---|
| 997 | ! ! * 1,0,0,1,Request_physic) |
---|
| 998 | ! ! |
---|
| 999 | ! ! call Register_Hallo_u(dpfi,1, |
---|
| 1000 | ! ! * 1,0,0,1,Request_physic) |
---|
| 1001 | ! ! |
---|
| 1002 | ! ! do j=1,nqtot |
---|
| 1003 | ! ! call Register_Hallo_u(dqfi(ijb_u,1,j),llm, |
---|
| 1004 | ! ! * 1,0,0,1,Request_physic) |
---|
| 1005 | ! ! enddo |
---|
| 1006 | ! ! |
---|
| 1007 | ! ! call SendRequest(Request_Physic) |
---|
| 1008 | ! !c$OMP BARRIER |
---|
| 1009 | ! ! call WaitRequest(Request_Physic) |
---|
| 1010 | ! ! |
---|
| 1011 | ! !c$OMP BARRIER |
---|
| 1012 | ! !c$OMP MASTER |
---|
| 1013 | ! ! call VTe(VThallo) |
---|
| 1014 | ! ! |
---|
| 1015 | ! ! call set_Distrib(distrib_Physic) |
---|
| 1016 | ! !c$OMP END MASTER |
---|
| 1017 | ! !c$OMP BARRIER |
---|
| 1018 | ! ! ijb=ij_begin |
---|
| 1019 | ! ! if (.not. pole_nord) then |
---|
| 1020 | ! ! |
---|
| 1021 | ! !c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 1022 | ! ! DO l=1,llm |
---|
| 1023 | ! ! dufi(ijb:ijb+iim,l) = dufi(ijb:ijb+iim,l)+dufi_tmp(1:iip1,l) |
---|
| 1024 | ! ! dvfi(ijb:ijb+iim,l) = dvfi(ijb:ijb+iim,l)+dvfi_tmp(1:iip1,l) |
---|
| 1025 | ! ! dtetafi(ijb:ijb+iim,l) = dtetafi(ijb:ijb+iim,l) |
---|
| 1026 | ! ! & +dtetafi_tmp(1:iip1,l) |
---|
| 1027 | ! ! dqfi(ijb:ijb+iim,l,:) = dqfi(ijb:ijb+iim,l,:) |
---|
| 1028 | ! ! & + dqfi_tmp(1:iip1,l,:) |
---|
| 1029 | ! ! ENDDO |
---|
| 1030 | ! !c$OMP END DO NOWAIT |
---|
| 1031 | ! ! |
---|
| 1032 | ! !c$OMP MASTER |
---|
| 1033 | ! ! dpfi(ijb:ijb+iim) = dpfi(ijb:ijb+iim)+ dpfi_tmp(1:iip1) |
---|
| 1034 | ! !c$OMP END MASTER |
---|
| 1035 | ! ! |
---|
| 1036 | ! ! endif ! of if (.not. pole_nord) |
---|
| 1037 | |
---|
| 1038 | ! #ifdef DEBUG_IO |
---|
| 1039 | ! call WriteField_u('dufi',dufi) |
---|
| 1040 | ! call WriteField_v('dvfi',dvfi) |
---|
| 1041 | ! call WriteField_u('dtetafi',dtetafi) |
---|
| 1042 | ! call WriteField_u('dpfi',dpfi) |
---|
| 1043 | ! do j=1,nqtot |
---|
| 1044 | ! call WriteField_u('dqfi'//trim(int2str(j)),dqfi(:,:,j)) |
---|
| 1045 | ! enddo |
---|
| 1046 | ! #endif |
---|
| 1047 | |
---|
| 1048 | ! c$OMP BARRIER |
---|
| 1049 | |
---|
| 1050 | ! c ajout des tendances physiques: |
---|
| 1051 | ! c ------------------------------ |
---|
| 1052 | ! #ifdef DEBUG_IO |
---|
| 1053 | ! call WriteField_u('ucovfi',ucov) |
---|
| 1054 | ! call WriteField_v('vcovfi',vcov) |
---|
| 1055 | ! call WriteField_u('tetafi',teta) |
---|
| 1056 | ! call WriteField_u('psfi',ps) |
---|
| 1057 | ! do j=1,nqtot |
---|
| 1058 | ! call WriteField_u('qfi'//trim(int2str(j)),q(:,:,j)) |
---|
| 1059 | ! enddo |
---|
| 1060 | ! #endif |
---|
| 1061 | |
---|
| 1062 | ! IF (ok_strato) THEN |
---|
| 1063 | ! CALL top_bound_loc( vcov,ucov,teta,masse,dufi,dvfi,dtetafi) |
---|
| 1064 | ! ENDIF |
---|
| 1065 | |
---|
| 1066 | ! #ifdef DEBUG_IO |
---|
| 1067 | ! call WriteField_u('ucovfi',ucov) |
---|
| 1068 | ! call WriteField_v('vcovfi',vcov) |
---|
| 1069 | ! call WriteField_u('tetafi',teta) |
---|
| 1070 | ! call WriteField_u('psfi',ps) |
---|
| 1071 | ! do j=1,nqtot |
---|
| 1072 | ! call WriteField_u('qfi'//trim(int2str(j)),q(:,:,j)) |
---|
| 1073 | ! enddo |
---|
| 1074 | ! #endif |
---|
| 1075 | |
---|
| 1076 | ! CALL addfi_loc( dtphys, leapf, forward , |
---|
| 1077 | ! $ ucov, vcov, teta , q ,ps , |
---|
| 1078 | ! $ dufi, dvfi, dtetafi , dqfi ,dpfi ) |
---|
| 1079 | |
---|
| 1080 | ! #ifdef DEBUG_IO |
---|
| 1081 | ! call WriteField_u('ucovfi',ucov) |
---|
| 1082 | ! call WriteField_v('vcovfi',vcov) |
---|
| 1083 | ! call WriteField_u('tetafi',teta) |
---|
| 1084 | ! call WriteField_u('psfi',ps) |
---|
| 1085 | ! do j=1,nqtot |
---|
| 1086 | ! call WriteField_u('qfi'//trim(int2str(j)),q(:,:,j)) |
---|
| 1087 | ! enddo |
---|
| 1088 | ! #endif |
---|
| 1089 | |
---|
| 1090 | ! c$OMP BARRIER |
---|
| 1091 | ! c$OMP MASTER |
---|
| 1092 | ! call VTe(VTphysiq) |
---|
| 1093 | |
---|
| 1094 | ! call VTb(VThallo) |
---|
| 1095 | ! c$OMP END MASTER |
---|
| 1096 | |
---|
| 1097 | ! call SetTag(Request_physic,800) |
---|
| 1098 | ! call Register_SwapField_u(ucov,ucov, |
---|
| 1099 | ! * distrib_caldyn,Request_physic) |
---|
| 1100 | ! |
---|
| 1101 | ! call Register_SwapField_v(vcov,vcov, |
---|
| 1102 | ! * distrib_caldyn,Request_physic) |
---|
| 1103 | ! |
---|
| 1104 | ! call Register_SwapField_u(teta,teta, |
---|
| 1105 | ! * distrib_caldyn,Request_physic) |
---|
| 1106 | ! |
---|
| 1107 | ! call Register_SwapField_u(masse,masse, |
---|
| 1108 | ! * distrib_caldyn,Request_physic) |
---|
| 1109 | |
---|
| 1110 | ! call Register_SwapField_u(p,p, |
---|
| 1111 | ! * distrib_caldyn,Request_physic) |
---|
| 1112 | ! |
---|
| 1113 | ! call Register_SwapField_u(pk,pk, |
---|
| 1114 | ! * distrib_caldyn,Request_physic) |
---|
| 1115 | ! |
---|
| 1116 | ! call Register_SwapField_u(phis,phis, |
---|
| 1117 | ! * distrib_caldyn,Request_physic) |
---|
| 1118 | ! |
---|
| 1119 | ! call Register_SwapField_u(phi,phi, |
---|
| 1120 | ! * distrib_caldyn,Request_physic) |
---|
| 1121 | ! |
---|
| 1122 | ! call Register_SwapField_u(w,w, |
---|
| 1123 | ! * distrib_caldyn,Request_physic) |
---|
| 1124 | |
---|
| 1125 | ! call Register_SwapField_u(q,q, |
---|
| 1126 | ! * distrib_caldyn,Request_physic) |
---|
| 1127 | ! |
---|
| 1128 | ! call SendRequest(Request_Physic) |
---|
| 1129 | ! c$OMP BARRIER |
---|
| 1130 | ! call WaitRequest(Request_Physic) |
---|
| 1131 | |
---|
| 1132 | ! c$OMP BARRIER |
---|
| 1133 | ! c$OMP MASTER |
---|
| 1134 | ! call VTe(VThallo) |
---|
| 1135 | ! call set_distrib(distrib_caldyn) |
---|
| 1136 | ! c$OMP END MASTER |
---|
| 1137 | ! c$OMP BARRIER |
---|
| 1138 | ! c |
---|
| 1139 | ! c Diagnostique de conservation de l'energie : difference |
---|
| 1140 | ! IF (ip_ebil_dyn.ge.1 ) THEN |
---|
| 1141 | ! ztit='bil phys' |
---|
| 1142 | ! CALL diagedyn(ztit,2,1,1,dtphys |
---|
| 1143 | ! e , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) |
---|
| 1144 | ! ENDIF |
---|
| 1145 | |
---|
| 1146 | ! #ifdef DEBUG_IO |
---|
| 1147 | ! call WriteField_u('ucovfi',ucov) |
---|
| 1148 | ! call WriteField_v('vcovfi',vcov) |
---|
| 1149 | ! call WriteField_u('tetafi',teta) |
---|
| 1150 | ! call WriteField_u('psfi',ps) |
---|
| 1151 | ! do j=1,nqtot |
---|
| 1152 | ! call WriteField_u('qfi'//trim(int2str(j)),q(:,:,j)) |
---|
| 1153 | ! enddo |
---|
| 1154 | ! #endif |
---|
| 1155 | |
---|
| 1156 | |
---|
| 1157 | ! c-jld |
---|
| 1158 | c$OMP MASTER |
---|
| 1159 | if (FirstPhysic) then |
---|
| 1160 | ok_start_timer=.TRUE. |
---|
| 1161 | FirstPhysic=.false. |
---|
| 1162 | endif |
---|
| 1163 | c$OMP END MASTER |
---|
| 1164 | ENDIF ! of IF( apphys ) |
---|
| 1165 | |
---|
[2270] | 1166 | if (ok_iso_verif) then |
---|
| 1167 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 1132') |
---|
| 1168 | endif !if (ok_iso_verif) then |
---|
[2286] | 1169 | !write(*,*) 'leapfrog 1134: iflag_phys=',iflag_phys |
---|
[2270] | 1170 | |
---|
[1632] | 1171 | IF(iflag_phys.EQ.2) THEN ! "Newtonian" case |
---|
[1848] | 1172 | c$OMP MASTER |
---|
| 1173 | if (FirstPhysic) then |
---|
| 1174 | ok_start_timer=.TRUE. |
---|
| 1175 | FirstPhysic=.false. |
---|
| 1176 | endif |
---|
| 1177 | c$OMP END MASTER |
---|
| 1178 | |
---|
| 1179 | |
---|
[1632] | 1180 | c Calcul academique de la physique = Rappel Newtonien + fritcion |
---|
| 1181 | c -------------------------------------------------------------- |
---|
| 1182 | cym teta(:,:)=teta(:,:) |
---|
| 1183 | cym s -iphysiq*dtvr*(teta(:,:)-tetarappel(:,:))/taurappel |
---|
| 1184 | ijb=ij_begin |
---|
| 1185 | ije=ij_end |
---|
[1657] | 1186 | !LF teta(ijb:ije,:)=teta(ijb:ije,:) |
---|
| 1187 | !LF s -iphysiq*dtvr*(teta(ijb:ije,:)-tetarappel(ijb:ije,:))/taurappel |
---|
| 1188 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 1189 | do l=1,llm |
---|
[1673] | 1190 | teta(ijb:ije,l)=teta(ijb:ije,l) -dtvr* |
---|
| 1191 | & (teta(ijb:ije,l)-tetarappel(ijb:ije,l))* |
---|
| 1192 | & (knewt_g+knewt_t(l)*clat4(ijb:ije)) |
---|
[1657] | 1193 | enddo |
---|
| 1194 | !$OMP END DO |
---|
[1632] | 1195 | |
---|
[1673] | 1196 | !$OMP MASTER |
---|
| 1197 | if (planet_type.eq."giant") then |
---|
| 1198 | ! add an intrinsic heat flux at the base of the atmosphere |
---|
| 1199 | teta(ijb:ije,1) = teta(ijb:ije,1) |
---|
| 1200 | & + dtvr * aire(ijb:ije) * ihf / cpp / masse(ijb:ije,1) |
---|
| 1201 | endif |
---|
| 1202 | !$OMP END MASTER |
---|
| 1203 | !$OMP BARRIER |
---|
| 1204 | |
---|
| 1205 | |
---|
[1632] | 1206 | call Register_Hallo_u(ucov,llm,0,1,1,0,Request_Physic) |
---|
| 1207 | call Register_Hallo_v(vcov,llm,1,1,1,1,Request_Physic) |
---|
| 1208 | call SendRequest(Request_Physic) |
---|
| 1209 | c$OMP BARRIER |
---|
| 1210 | call WaitRequest(Request_Physic) |
---|
[1657] | 1211 | c$OMP BARRIER |
---|
[1673] | 1212 | call friction_loc(ucov,vcov,dtvr) |
---|
[1657] | 1213 | !$OMP BARRIER |
---|
[1673] | 1214 | |
---|
| 1215 | ! Sponge layer (if any) |
---|
| 1216 | IF (ok_strato) THEN |
---|
[1793] | 1217 | CALL top_bound_loc(vcov,ucov,teta,masse,dtvr) |
---|
[1673] | 1218 | !$OMP BARRIER |
---|
| 1219 | ENDIF ! of IF (ok_strato) |
---|
[1632] | 1220 | ENDIF ! of IF(iflag_phys.EQ.2) |
---|
| 1221 | |
---|
| 1222 | |
---|
| 1223 | CALL pression_loc ( ip1jmp1, ap, bp, ps, p ) |
---|
| 1224 | c$OMP BARRIER |
---|
[1673] | 1225 | if (pressure_exner) then |
---|
[2021] | 1226 | CALL exner_hyb_loc( ijnb_u, ps, p, pks, pk, pkf ) |
---|
[1673] | 1227 | else |
---|
[2021] | 1228 | CALL exner_milieu_loc( ijnb_u, ps, p, pks, pk, pkf ) |
---|
[1673] | 1229 | endif |
---|
[1632] | 1230 | c$OMP BARRIER |
---|
[1987] | 1231 | CALL massdair_loc(p,masse) |
---|
| 1232 | c$OMP BARRIER |
---|
[1632] | 1233 | |
---|
| 1234 | cc$OMP END PARALLEL |
---|
[2270] | 1235 | if (ok_iso_verif) then |
---|
| 1236 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 1196') |
---|
| 1237 | endif !if (ok_iso_verif) then |
---|
[1632] | 1238 | |
---|
| 1239 | c----------------------------------------------------------------------- |
---|
| 1240 | c dissipation horizontale et verticale des petites echelles: |
---|
| 1241 | c ---------------------------------------------------------- |
---|
[2286] | 1242 | !write(*,*) 'leapfrog 1163: apdiss=',apdiss |
---|
[1632] | 1243 | IF(apdiss) THEN |
---|
| 1244 | |
---|
| 1245 | CALL call_dissip(ucov,vcov,teta,p,pk,ps) |
---|
| 1246 | !cc$OMP PARALLEL DEFAULT(SHARED) |
---|
| 1247 | !cc$OMP+ PRIVATE(ijb,ije,tppn,tpn,tpps,tps) |
---|
| 1248 | !c$OMP MASTER |
---|
| 1249 | ! call suspend_timer(timer_caldyn) |
---|
| 1250 | ! |
---|
| 1251 | !c print*,'Entree dans la dissipation : Iteration No ',true_itau |
---|
| 1252 | !c calcul de l'energie cinetique avant dissipation |
---|
| 1253 | !c print *,'Passage dans la dissipation' |
---|
| 1254 | |
---|
| 1255 | ! call VTb(VThallo) |
---|
| 1256 | !c$OMP END MASTER |
---|
| 1257 | |
---|
| 1258 | !c$OMP BARRIER |
---|
| 1259 | |
---|
| 1260 | ! call Register_SwapField_u(ucov,ucov,distrib_dissip, |
---|
| 1261 | ! * Request_dissip,up=1,down=1) |
---|
| 1262 | |
---|
| 1263 | ! call Register_SwapField_v(vcov,vcov,distrib_dissip, |
---|
| 1264 | ! * Request_dissip,up=1,down=1) |
---|
| 1265 | |
---|
| 1266 | ! call Register_SwapField_u(teta,teta,distrib_dissip, |
---|
| 1267 | ! * Request_dissip) |
---|
| 1268 | |
---|
| 1269 | ! call Register_SwapField_u(p,p,distrib_dissip, |
---|
| 1270 | ! * Request_dissip) |
---|
| 1271 | |
---|
| 1272 | ! call Register_SwapField_u(pk,pk,distrib_dissip, |
---|
| 1273 | ! * Request_dissip) |
---|
| 1274 | |
---|
| 1275 | ! call SendRequest(Request_dissip) |
---|
| 1276 | !c$OMP BARRIER |
---|
| 1277 | ! call WaitRequest(Request_dissip) |
---|
| 1278 | |
---|
| 1279 | !c$OMP BARRIER |
---|
| 1280 | !c$OMP MASTER |
---|
| 1281 | ! call set_distrib(distrib_dissip) |
---|
| 1282 | ! call VTe(VThallo) |
---|
| 1283 | ! call VTb(VTdissipation) |
---|
| 1284 | ! call start_timer(timer_dissip) |
---|
| 1285 | !c$OMP END MASTER |
---|
| 1286 | !c$OMP BARRIER |
---|
| 1287 | |
---|
| 1288 | ! call covcont_loc(llm,ucov,vcov,ucont,vcont) |
---|
| 1289 | ! call enercin_loc(vcov,ucov,vcont,ucont,ecin0) |
---|
| 1290 | |
---|
| 1291 | !c dissipation |
---|
| 1292 | |
---|
| 1293 | !! CALL FTRACE_REGION_BEGIN("dissip") |
---|
| 1294 | ! CALL dissip_loc(vcov,ucov,teta,p,dvdis,dudis,dtetadis) |
---|
| 1295 | |
---|
| 1296 | !#ifdef DEBUG_IO |
---|
| 1297 | ! call WriteField_u('dudis',dudis) |
---|
| 1298 | ! call WriteField_v('dvdis',dvdis) |
---|
| 1299 | ! call WriteField_u('dtetadis',dtetadis) |
---|
| 1300 | !#endif |
---|
| 1301 | ! |
---|
| 1302 | !! CALL FTRACE_REGION_END("dissip") |
---|
| 1303 | ! |
---|
| 1304 | ! ijb=ij_begin |
---|
| 1305 | ! ije=ij_end |
---|
| 1306 | !c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 1307 | ! DO l=1,llm |
---|
| 1308 | ! ucov(ijb:ije,l)=ucov(ijb:ije,l)+dudis(ijb:ije,l) |
---|
| 1309 | ! ENDDO |
---|
| 1310 | !c$OMP END DO NOWAIT |
---|
| 1311 | ! if (pole_sud) ije=ije-iip1 |
---|
| 1312 | !c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 1313 | ! DO l=1,llm |
---|
| 1314 | ! vcov(ijb:ije,l)=vcov(ijb:ije,l)+dvdis(ijb:ije,l) |
---|
| 1315 | ! ENDDO |
---|
| 1316 | !c$OMP END DO NOWAIT |
---|
| 1317 | |
---|
| 1318 | !c teta=teta+dtetadis |
---|
| 1319 | |
---|
| 1320 | |
---|
| 1321 | !c------------------------------------------------------------------------ |
---|
| 1322 | ! if (dissip_conservative) then |
---|
| 1323 | !C On rajoute la tendance due a la transform. Ec -> E therm. cree |
---|
| 1324 | !C lors de la dissipation |
---|
| 1325 | !c$OMP BARRIER |
---|
| 1326 | !c$OMP MASTER |
---|
| 1327 | ! call suspend_timer(timer_dissip) |
---|
| 1328 | ! call VTb(VThallo) |
---|
| 1329 | !c$OMP END MASTER |
---|
| 1330 | ! call Register_Hallo_u(ucov,llm,1,1,1,1,Request_Dissip) |
---|
| 1331 | ! call Register_Hallo_v(vcov,llm,1,1,1,1,Request_Dissip) |
---|
| 1332 | ! call SendRequest(Request_Dissip) |
---|
| 1333 | !c$OMP BARRIER |
---|
| 1334 | ! call WaitRequest(Request_Dissip) |
---|
| 1335 | !c$OMP MASTER |
---|
| 1336 | ! call VTe(VThallo) |
---|
| 1337 | ! call resume_timer(timer_dissip) |
---|
| 1338 | !c$OMP END MASTER |
---|
| 1339 | !c$OMP BARRIER |
---|
| 1340 | ! call covcont_loc(llm,ucov,vcov,ucont,vcont) |
---|
| 1341 | ! call enercin_loc(vcov,ucov,vcont,ucont,ecin) |
---|
| 1342 | ! |
---|
| 1343 | ! ijb=ij_begin |
---|
| 1344 | ! ije=ij_end |
---|
| 1345 | !c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 1346 | ! do l=1,llm |
---|
| 1347 | ! do ij=ijb,ije |
---|
| 1348 | ! dtetaecdt(ij,l)= (ecin0(ij,l)-ecin(ij,l))/ pk(ij,l) |
---|
| 1349 | ! dtetadis(ij,l)=dtetadis(ij,l)+dtetaecdt(ij,l) |
---|
| 1350 | ! enddo |
---|
| 1351 | ! enddo |
---|
| 1352 | !c$OMP END DO NOWAIT |
---|
| 1353 | ! endif |
---|
| 1354 | |
---|
| 1355 | ! ijb=ij_begin |
---|
| 1356 | ! ije=ij_end |
---|
| 1357 | !c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 1358 | ! do l=1,llm |
---|
| 1359 | ! do ij=ijb,ije |
---|
| 1360 | ! teta(ij,l)=teta(ij,l)+dtetadis(ij,l) |
---|
| 1361 | ! enddo |
---|
| 1362 | ! enddo |
---|
| 1363 | !c$OMP END DO NOWAIT |
---|
| 1364 | !c------------------------------------------------------------------------ |
---|
| 1365 | |
---|
| 1366 | |
---|
| 1367 | !c ....... P. Le Van ( ajout le 17/04/96 ) ........... |
---|
| 1368 | !c ... Calcul de la valeur moyenne, unique de h aux poles ..... |
---|
| 1369 | !c |
---|
| 1370 | |
---|
| 1371 | ! ijb=ij_begin |
---|
| 1372 | ! ije=ij_end |
---|
| 1373 | ! |
---|
| 1374 | ! if (pole_nord) then |
---|
| 1375 | !c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 1376 | ! DO l = 1, llm |
---|
| 1377 | ! DO ij = 1,iim |
---|
| 1378 | ! tppn(ij) = aire( ij ) * teta( ij ,l) |
---|
| 1379 | ! ENDDO |
---|
| 1380 | ! tpn = SSUM(iim,tppn,1)/apoln |
---|
| 1381 | |
---|
| 1382 | ! DO ij = 1, iip1 |
---|
| 1383 | ! teta( ij ,l) = tpn |
---|
| 1384 | ! ENDDO |
---|
| 1385 | ! ENDDO |
---|
| 1386 | !c$OMP END DO NOWAIT |
---|
| 1387 | |
---|
| 1388 | !c$OMP MASTER |
---|
| 1389 | ! DO ij = 1,iim |
---|
| 1390 | ! tppn(ij) = aire( ij ) * ps ( ij ) |
---|
| 1391 | ! ENDDO |
---|
| 1392 | ! tpn = SSUM(iim,tppn,1)/apoln |
---|
| 1393 | ! |
---|
| 1394 | ! DO ij = 1, iip1 |
---|
| 1395 | ! ps( ij ) = tpn |
---|
| 1396 | ! ENDDO |
---|
| 1397 | !c$OMP END MASTER |
---|
| 1398 | ! endif |
---|
| 1399 | ! |
---|
| 1400 | ! if (pole_sud) then |
---|
| 1401 | !c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 1402 | ! DO l = 1, llm |
---|
| 1403 | ! DO ij = 1,iim |
---|
| 1404 | ! tpps(ij) = aire(ij+ip1jm) * teta(ij+ip1jm,l) |
---|
| 1405 | ! ENDDO |
---|
| 1406 | ! tps = SSUM(iim,tpps,1)/apols |
---|
| 1407 | |
---|
| 1408 | ! DO ij = 1, iip1 |
---|
| 1409 | ! teta(ij+ip1jm,l) = tps |
---|
| 1410 | ! ENDDO |
---|
| 1411 | ! ENDDO |
---|
| 1412 | !c$OMP END DO NOWAIT |
---|
| 1413 | |
---|
| 1414 | !c$OMP MASTER |
---|
| 1415 | ! DO ij = 1,iim |
---|
| 1416 | ! tpps(ij) = aire(ij+ip1jm) * ps (ij+ip1jm) |
---|
| 1417 | ! ENDDO |
---|
| 1418 | ! tps = SSUM(iim,tpps,1)/apols |
---|
| 1419 | ! |
---|
| 1420 | ! DO ij = 1, iip1 |
---|
| 1421 | ! ps(ij+ip1jm) = tps |
---|
| 1422 | ! ENDDO |
---|
| 1423 | !c$OMP END MASTER |
---|
| 1424 | ! endif |
---|
| 1425 | |
---|
| 1426 | |
---|
| 1427 | !c$OMP BARRIER |
---|
| 1428 | !c$OMP MASTER |
---|
| 1429 | ! call VTe(VTdissipation) |
---|
| 1430 | |
---|
| 1431 | ! call stop_timer(timer_dissip) |
---|
| 1432 | ! |
---|
| 1433 | ! call VTb(VThallo) |
---|
| 1434 | !c$OMP END MASTER |
---|
| 1435 | ! call Register_SwapField_u(ucov,ucov,distrib_caldyn, |
---|
| 1436 | ! * Request_dissip) |
---|
| 1437 | |
---|
| 1438 | ! call Register_SwapField_v(vcov,vcov,distrib_caldyn, |
---|
| 1439 | ! * Request_dissip) |
---|
| 1440 | |
---|
| 1441 | ! call Register_SwapField_u(teta,teta,distrib_caldyn, |
---|
| 1442 | ! * Request_dissip) |
---|
| 1443 | |
---|
| 1444 | ! call Register_SwapField_u(p,p,distrib_caldyn, |
---|
| 1445 | ! * Request_dissip) |
---|
| 1446 | |
---|
| 1447 | ! call Register_SwapField_u(pk,pk,distrib_caldyn, |
---|
| 1448 | ! * Request_dissip) |
---|
| 1449 | |
---|
| 1450 | ! call SendRequest(Request_dissip) |
---|
| 1451 | !c$OMP BARRIER |
---|
| 1452 | ! call WaitRequest(Request_dissip) |
---|
| 1453 | |
---|
| 1454 | !c$OMP BARRIER |
---|
| 1455 | !c$OMP MASTER |
---|
| 1456 | ! call set_distrib(distrib_caldyn) |
---|
| 1457 | ! call VTe(VThallo) |
---|
| 1458 | ! call resume_timer(timer_caldyn) |
---|
| 1459 | !c print *,'fin dissipation' |
---|
| 1460 | !c$OMP END MASTER |
---|
| 1461 | !c$OMP BARRIER |
---|
[1657] | 1462 | END IF ! of IF(apdiss) |
---|
[1632] | 1463 | |
---|
| 1464 | cc$OMP END PARALLEL |
---|
| 1465 | |
---|
| 1466 | c ajout debug |
---|
| 1467 | c IF( lafin ) then |
---|
| 1468 | c abort_message = 'Simulation finished' |
---|
| 1469 | c call abort_gcm(modname,abort_message,0) |
---|
| 1470 | c ENDIF |
---|
[2270] | 1471 | |
---|
| 1472 | if (ok_iso_verif) then |
---|
| 1473 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 1430') |
---|
| 1474 | endif !if (ok_iso_verif) then |
---|
| 1475 | |
---|
[1632] | 1476 | c ******************************************************************** |
---|
| 1477 | c ******************************************************************** |
---|
| 1478 | c .... fin de l'integration dynamique et physique pour le pas itau .. |
---|
| 1479 | c ******************************************************************** |
---|
| 1480 | c ******************************************************************** |
---|
| 1481 | |
---|
| 1482 | c preparation du pas d'integration suivant ...... |
---|
| 1483 | cym call WriteField('ucov',reshape(ucov,(/iip1,jmp1,llm/))) |
---|
| 1484 | cym call WriteField('vcov',reshape(vcov,(/iip1,jjm,llm/))) |
---|
| 1485 | c$OMP MASTER |
---|
| 1486 | call stop_timer(timer_caldyn) |
---|
| 1487 | c$OMP END MASTER |
---|
| 1488 | IF (itau==itaumax) then |
---|
| 1489 | c$OMP MASTER |
---|
[2185] | 1490 | call allgather_timer_average |
---|
| 1491 | call barrier |
---|
| 1492 | if (mpi_rank==0) then |
---|
| 1493 | |
---|
| 1494 | print *,'*********************************' |
---|
| 1495 | print *,'****** TIMER CALDYN ******' |
---|
| 1496 | do i=0,mpi_size-1 |
---|
| 1497 | print *,'proc',i,' : Nb Bandes :',jj_nb_caldyn(i), |
---|
| 1498 | & ' : temps moyen :', |
---|
| 1499 | & timer_average(jj_nb_caldyn(i),timer_caldyn,i) |
---|
| 1500 | enddo |
---|
| 1501 | |
---|
| 1502 | print *,'*********************************' |
---|
| 1503 | print *,'****** TIMER VANLEER ******' |
---|
| 1504 | do i=0,mpi_size-1 |
---|
| 1505 | print *,'proc',i,' : Nb Bandes :',jj_nb_vanleer(i), |
---|
| 1506 | & ' : temps moyen :', |
---|
| 1507 | & timer_average(jj_nb_vanleer(i),timer_vanleer,i) |
---|
| 1508 | enddo |
---|
| 1509 | |
---|
| 1510 | print *,'*********************************' |
---|
| 1511 | print *,'****** TIMER DISSIP ******' |
---|
| 1512 | do i=0,mpi_size-1 |
---|
| 1513 | print *,'proc',i,' : Nb Bandes :',jj_nb_dissip(i), |
---|
| 1514 | & ' : temps moyen :', |
---|
| 1515 | & timer_average(jj_nb_dissip(i),timer_dissip,i) |
---|
| 1516 | enddo |
---|
| 1517 | |
---|
| 1518 | print *,'*********************************' |
---|
| 1519 | print *,'****** TIMER PHYSIC ******' |
---|
| 1520 | do i=0,mpi_size-1 |
---|
| 1521 | print *,'proc',i,' : Nb Bandes :',jj_nb_physic(i), |
---|
| 1522 | & ' : temps moyen :', |
---|
| 1523 | & timer_average(jj_nb_physic(i),timer_physic,i) |
---|
| 1524 | enddo |
---|
| 1525 | |
---|
| 1526 | endif |
---|
| 1527 | CALL barrier |
---|
| 1528 | print *,'Taille du Buffer MPI (REAL*8)',MaxBufferSize |
---|
[1632] | 1529 | print *,'Taille du Buffer MPI utilise (REAL*8)',MaxBufferSize_Used |
---|
[2185] | 1530 | print *, 'Temps total ecoule sur la parallelisation :',DiffTime() |
---|
[1632] | 1531 | print *, 'Temps CPU ecoule sur la parallelisation :',DiffCpuTime() |
---|
[2185] | 1532 | CALL print_filtre_timer |
---|
[1632] | 1533 | c$OMP END MASTER |
---|
[2185] | 1534 | CALL dynredem1_loc("restart.nc",0.0, |
---|
| 1535 | . vcov,ucov,teta,q,masse,ps) |
---|
[1632] | 1536 | c$OMP MASTER |
---|
[2185] | 1537 | call fin_getparam |
---|
[1632] | 1538 | c$OMP END MASTER |
---|
[2185] | 1539 | |
---|
| 1540 | #ifdef INCA |
---|
[3544] | 1541 | if (type_trac == 'inca') then |
---|
| 1542 | call finalize_inca |
---|
| 1543 | endif |
---|
[2185] | 1544 | #endif |
---|
[3666] | 1545 | #ifdef REPROBUS |
---|
| 1546 | if (type_trac == 'repr') then |
---|
| 1547 | call finalize_reprobus |
---|
| 1548 | endif |
---|
| 1549 | #endif |
---|
[2185] | 1550 | |
---|
| 1551 | c$OMP MASTER |
---|
| 1552 | call finalize_parallel |
---|
| 1553 | c$OMP END MASTER |
---|
[1632] | 1554 | c$OMP BARRIER |
---|
[2185] | 1555 | RETURN |
---|
[1632] | 1556 | ENDIF |
---|
| 1557 | |
---|
[2270] | 1558 | if (ok_iso_verif) then |
---|
| 1559 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 1509') |
---|
| 1560 | endif !if (ok_iso_verif) then |
---|
| 1561 | |
---|
[1632] | 1562 | IF ( .NOT.purmats ) THEN |
---|
| 1563 | c ........................................................ |
---|
| 1564 | c .............. schema matsuno + leapfrog .............. |
---|
| 1565 | c ........................................................ |
---|
| 1566 | |
---|
| 1567 | IF(forward. OR. leapf) THEN |
---|
| 1568 | itau= itau + 1 |
---|
| 1569 | ! iday= day_ini+itau/day_step |
---|
| 1570 | ! time= REAL(itau-(iday-day_ini)*day_step)/day_step+time_0 |
---|
| 1571 | ! IF(time.GT.1.) THEN |
---|
| 1572 | ! time = time-1. |
---|
| 1573 | ! iday = iday+1 |
---|
| 1574 | ! ENDIF |
---|
| 1575 | ENDIF |
---|
| 1576 | |
---|
| 1577 | |
---|
| 1578 | IF( itau. EQ. itaufinp1 ) then |
---|
| 1579 | |
---|
| 1580 | if (flag_verif) then |
---|
| 1581 | write(79,*) 'ucov',ucov |
---|
| 1582 | write(80,*) 'vcov',vcov |
---|
| 1583 | write(81,*) 'teta',teta |
---|
| 1584 | write(82,*) 'ps',ps |
---|
| 1585 | write(83,*) 'q',q |
---|
| 1586 | WRITE(85,*) 'q1 = ',q(:,:,1) |
---|
| 1587 | WRITE(86,*) 'q3 = ',q(:,:,3) |
---|
| 1588 | endif |
---|
| 1589 | |
---|
| 1590 | |
---|
| 1591 | c$OMP MASTER |
---|
| 1592 | call fin_getparam |
---|
[2185] | 1593 | c$OMP END MASTER |
---|
| 1594 | |
---|
| 1595 | #ifdef INCA |
---|
[3544] | 1596 | if (type_trac == 'inca') then |
---|
| 1597 | call finalize_inca |
---|
| 1598 | endif |
---|
[2185] | 1599 | #endif |
---|
[3666] | 1600 | #ifdef REPROBUS |
---|
| 1601 | if (type_trac == 'repr') then |
---|
| 1602 | call finalize_reprobus |
---|
| 1603 | endif |
---|
| 1604 | #endif |
---|
[2185] | 1605 | |
---|
| 1606 | c$OMP MASTER |
---|
[1632] | 1607 | call finalize_parallel |
---|
| 1608 | c$OMP END MASTER |
---|
| 1609 | abort_message = 'Simulation finished' |
---|
| 1610 | call abort_gcm(modname,abort_message,0) |
---|
| 1611 | RETURN |
---|
| 1612 | ENDIF |
---|
| 1613 | c----------------------------------------------------------------------- |
---|
| 1614 | c ecriture du fichier histoire moyenne: |
---|
| 1615 | c ------------------------------------- |
---|
| 1616 | |
---|
| 1617 | IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN |
---|
| 1618 | c$OMP BARRIER |
---|
| 1619 | IF(itau.EQ.itaufin) THEN |
---|
| 1620 | iav=1 |
---|
| 1621 | ELSE |
---|
| 1622 | iav=0 |
---|
| 1623 | ENDIF |
---|
| 1624 | |
---|
[2475] | 1625 | ! Ehouarn: re-compute geopotential for outputs |
---|
| 1626 | c$OMP BARRIER |
---|
| 1627 | c$OMP MASTER |
---|
| 1628 | CALL geopot_loc(ip1jmp1,teta,pk,pks,phis,phi) |
---|
| 1629 | c$OMP END MASTER |
---|
| 1630 | c$OMP BARRIER |
---|
| 1631 | |
---|
[1632] | 1632 | #ifdef CPP_IOIPSL |
---|
| 1633 | IF (ok_dynzon) THEN |
---|
| 1634 | |
---|
| 1635 | CALL bilan_dyn_loc(2,dtvr*iperiod,dtvr*day_step*periodav, |
---|
| 1636 | , ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) |
---|
| 1637 | |
---|
| 1638 | ENDIF !ok_dynzon |
---|
| 1639 | |
---|
| 1640 | IF (ok_dyn_ave) THEN |
---|
| 1641 | CALL writedynav_loc(itau,vcov, |
---|
| 1642 | & ucov,teta,pk,phi,q,masse,ps,phis) |
---|
| 1643 | ENDIF |
---|
| 1644 | #endif |
---|
| 1645 | ENDIF |
---|
| 1646 | |
---|
[2270] | 1647 | if (ok_iso_verif) then |
---|
| 1648 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 1584') |
---|
| 1649 | endif !if (ok_iso_verif) then |
---|
| 1650 | |
---|
[1632] | 1651 | c----------------------------------------------------------------------- |
---|
| 1652 | c ecriture de la bande histoire: |
---|
| 1653 | c ------------------------------ |
---|
| 1654 | |
---|
| 1655 | IF( MOD(itau,iecri).EQ.0) THEN |
---|
| 1656 | ! Ehouarn: output only during LF or Backward Matsuno |
---|
[2600] | 1657 | if (leapf.or.(.not.leapf.and.(.not.forward))) then |
---|
[1632] | 1658 | |
---|
| 1659 | c$OMP BARRIER |
---|
| 1660 | c$OMP MASTER |
---|
| 1661 | CALL geopot_loc(ip1jmp1,teta,pk,pks,phis,phi) |
---|
| 1662 | c$OMP END MASTER |
---|
| 1663 | c$OMP BARRIER |
---|
| 1664 | |
---|
| 1665 | #ifdef CPP_IOIPSL |
---|
| 1666 | if (ok_dyn_ins) then |
---|
[2600] | 1667 | CALL writehist_loc(itau,vcov,ucov,teta,pk,phi,q, |
---|
[1632] | 1668 | & masse,ps,phis) |
---|
| 1669 | endif |
---|
| 1670 | #endif |
---|
| 1671 | endif ! of if (leapf.or.(.not.leapf.and.(.not.forward))) |
---|
| 1672 | ENDIF ! of IF(MOD(itau,iecri).EQ.0) |
---|
| 1673 | |
---|
| 1674 | IF(itau.EQ.itaufin) THEN |
---|
| 1675 | |
---|
| 1676 | c$OMP BARRIER |
---|
| 1677 | |
---|
[1673] | 1678 | ! if (planet_type.eq."earth") then |
---|
[1632] | 1679 | ! Write an Earth-format restart file |
---|
| 1680 | CALL dynredem1_loc("restart.nc",0.0, |
---|
| 1681 | & vcov,ucov,teta,q,masse,ps) |
---|
[1673] | 1682 | ! endif ! of if (planet_type.eq."earth") |
---|
[1632] | 1683 | |
---|
| 1684 | ! CLOSE(99) |
---|
| 1685 | ENDIF ! of IF (itau.EQ.itaufin) |
---|
| 1686 | |
---|
[2270] | 1687 | if (ok_iso_verif) then |
---|
| 1688 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 1624') |
---|
| 1689 | endif !if (ok_iso_verif) then |
---|
| 1690 | |
---|
[1632] | 1691 | c----------------------------------------------------------------------- |
---|
| 1692 | c gestion de l'integration temporelle: |
---|
| 1693 | c ------------------------------------ |
---|
| 1694 | |
---|
| 1695 | IF( MOD(itau,iperiod).EQ.0 ) THEN |
---|
| 1696 | GO TO 1 |
---|
| 1697 | ELSE IF ( MOD(itau-1,iperiod). EQ. 0 ) THEN |
---|
| 1698 | |
---|
| 1699 | IF( forward ) THEN |
---|
| 1700 | c fin du pas forward et debut du pas backward |
---|
| 1701 | |
---|
| 1702 | forward = .FALSE. |
---|
| 1703 | leapf = .FALSE. |
---|
| 1704 | GO TO 2 |
---|
| 1705 | |
---|
| 1706 | ELSE |
---|
| 1707 | c fin du pas backward et debut du premier pas leapfrog |
---|
| 1708 | |
---|
| 1709 | leapf = .TRUE. |
---|
| 1710 | dt = 2.*dtvr |
---|
| 1711 | GO TO 2 |
---|
| 1712 | END IF |
---|
| 1713 | ELSE |
---|
| 1714 | |
---|
| 1715 | c ...... pas leapfrog ..... |
---|
| 1716 | |
---|
| 1717 | leapf = .TRUE. |
---|
| 1718 | dt = 2.*dtvr |
---|
| 1719 | GO TO 2 |
---|
| 1720 | END IF ! of IF (MOD(itau,iperiod).EQ.0) |
---|
| 1721 | ! ELSEIF (MOD(itau-1,iperiod).EQ.0) |
---|
| 1722 | |
---|
| 1723 | |
---|
| 1724 | ELSE ! of IF (.not.purmats) |
---|
| 1725 | |
---|
[2270] | 1726 | |
---|
| 1727 | if (ok_iso_verif) then |
---|
| 1728 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 1664') |
---|
| 1729 | endif !if (ok_iso_verif) then |
---|
| 1730 | |
---|
[1632] | 1731 | c ........................................................ |
---|
| 1732 | c .............. schema matsuno ............... |
---|
| 1733 | c ........................................................ |
---|
| 1734 | IF( forward ) THEN |
---|
| 1735 | |
---|
| 1736 | itau = itau + 1 |
---|
| 1737 | ! iday = day_ini+itau/day_step |
---|
| 1738 | ! time = REAL(itau-(iday-day_ini)*day_step)/day_step+time_0 |
---|
| 1739 | ! |
---|
| 1740 | ! IF(time.GT.1.) THEN |
---|
| 1741 | ! time = time-1. |
---|
| 1742 | ! iday = iday+1 |
---|
| 1743 | ! ENDIF |
---|
| 1744 | |
---|
| 1745 | forward = .FALSE. |
---|
| 1746 | IF( itau. EQ. itaufinp1 ) then |
---|
| 1747 | c$OMP MASTER |
---|
| 1748 | call fin_getparam |
---|
[2180] | 1749 | c$OMP END MASTER |
---|
| 1750 | |
---|
| 1751 | #ifdef INCA |
---|
[3544] | 1752 | if (type_trac == 'inca') then |
---|
| 1753 | call finalize_inca |
---|
| 1754 | endif |
---|
[2180] | 1755 | #endif |
---|
[3666] | 1756 | #ifdef REPROBUS |
---|
| 1757 | if (type_trac == 'repr') then |
---|
| 1758 | call finalize_reprobus |
---|
| 1759 | endif |
---|
| 1760 | #endif |
---|
[2180] | 1761 | |
---|
| 1762 | c$OMP MASTER |
---|
[1632] | 1763 | call finalize_parallel |
---|
| 1764 | c$OMP END MASTER |
---|
| 1765 | abort_message = 'Simulation finished' |
---|
| 1766 | call abort_gcm(modname,abort_message,0) |
---|
| 1767 | RETURN |
---|
| 1768 | ENDIF |
---|
| 1769 | GO TO 2 |
---|
| 1770 | |
---|
| 1771 | ELSE ! of IF(forward) i.e. backward step |
---|
| 1772 | |
---|
[2270] | 1773 | |
---|
| 1774 | if (ok_iso_verif) then |
---|
| 1775 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 1698') |
---|
| 1776 | endif !if (ok_iso_verif) then |
---|
| 1777 | |
---|
[1632] | 1778 | IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN |
---|
| 1779 | IF(itau.EQ.itaufin) THEN |
---|
| 1780 | iav=1 |
---|
| 1781 | ELSE |
---|
| 1782 | iav=0 |
---|
| 1783 | ENDIF |
---|
| 1784 | |
---|
| 1785 | #ifdef CPP_IOIPSL |
---|
[2475] | 1786 | ! Ehouarn: re-compute geopotential for outputs |
---|
| 1787 | c$OMP BARRIER |
---|
| 1788 | c$OMP MASTER |
---|
| 1789 | CALL geopot_loc(ip1jmp1,teta,pk,pks,phis,phi) |
---|
| 1790 | c$OMP END MASTER |
---|
| 1791 | c$OMP BARRIER |
---|
| 1792 | |
---|
[1632] | 1793 | IF (ok_dynzon) THEN |
---|
| 1794 | CALL bilan_dyn_loc(2,dtvr*iperiod,dtvr*day_step*periodav, |
---|
| 1795 | , ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) |
---|
| 1796 | ENDIF |
---|
| 1797 | |
---|
| 1798 | IF (ok_dyn_ave) THEN |
---|
| 1799 | CALL writedynav_loc(itau,vcov, |
---|
| 1800 | & ucov,teta,pk,phi,q,masse,ps,phis) |
---|
| 1801 | ENDIF |
---|
| 1802 | #endif |
---|
| 1803 | ENDIF ! of IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) |
---|
| 1804 | |
---|
| 1805 | |
---|
| 1806 | IF(MOD(itau,iecri ).EQ.0) THEN |
---|
| 1807 | |
---|
| 1808 | c$OMP BARRIER |
---|
| 1809 | c$OMP MASTER |
---|
| 1810 | CALL geopot_loc(ip1jmp1,teta,pk,pks,phis,phi) |
---|
| 1811 | c$OMP END MASTER |
---|
| 1812 | c$OMP BARRIER |
---|
| 1813 | |
---|
| 1814 | |
---|
| 1815 | #ifdef CPP_IOIPSL |
---|
| 1816 | if (ok_dyn_ins) then |
---|
[2475] | 1817 | CALL writehist_loc(itau,vcov,ucov,teta,pk,phi,q, |
---|
[1659] | 1818 | & masse,ps,phis) |
---|
[1632] | 1819 | endif ! of if (ok_dyn_ins) |
---|
| 1820 | #endif |
---|
| 1821 | ENDIF ! of IF(MOD(itau,iecri).EQ.0) |
---|
| 1822 | |
---|
| 1823 | |
---|
| 1824 | IF(itau.EQ.itaufin) THEN |
---|
[1673] | 1825 | ! if (planet_type.eq."earth") then |
---|
[1632] | 1826 | CALL dynredem1_loc("restart.nc",0.0, |
---|
| 1827 | . vcov,ucov,teta,q,masse,ps) |
---|
[1673] | 1828 | ! endif ! of if (planet_type.eq."earth") |
---|
[1632] | 1829 | ENDIF ! of IF(itau.EQ.itaufin) |
---|
| 1830 | |
---|
| 1831 | forward = .TRUE. |
---|
| 1832 | GO TO 1 |
---|
| 1833 | |
---|
| 1834 | ENDIF ! of IF (forward) |
---|
| 1835 | |
---|
[2270] | 1836 | |
---|
| 1837 | if (ok_iso_verif) then |
---|
| 1838 | call check_isotopes(q,ijb_u,ije_u,'leapfrog 1750') |
---|
| 1839 | endif !if (ok_iso_verif) then |
---|
| 1840 | |
---|
[1632] | 1841 | END IF ! of IF(.not.purmats) |
---|
| 1842 | c$OMP MASTER |
---|
| 1843 | call fin_getparam |
---|
[2185] | 1844 | c$OMP END MASTER |
---|
| 1845 | |
---|
| 1846 | #ifdef INCA |
---|
[3544] | 1847 | if (type_trac == 'inca') then |
---|
| 1848 | call finalize_inca |
---|
| 1849 | endif |
---|
[2185] | 1850 | #endif |
---|
[3666] | 1851 | #ifdef REPROBUS |
---|
| 1852 | if (type_trac == 'repr') then |
---|
| 1853 | call finalize_reprobus |
---|
| 1854 | endif |
---|
| 1855 | #endif |
---|
[2185] | 1856 | |
---|
| 1857 | c$OMP MASTER |
---|
[1632] | 1858 | call finalize_parallel |
---|
| 1859 | c$OMP END MASTER |
---|
| 1860 | abort_message = 'Simulation finished' |
---|
| 1861 | call abort_gcm(modname,abort_message,0) |
---|
| 1862 | RETURN |
---|
| 1863 | END |
---|