[709] | 1 | ! |
---|
[630] | 2 | ! $Header$ |
---|
| 3 | ! |
---|
| 4 | c |
---|
| 5 | c |
---|
| 6 | #define IO_DEBUG |
---|
| 7 | |
---|
[753] | 8 | !#undef CPP_IOIPSL |
---|
[630] | 9 | |
---|
| 10 | SUBROUTINE leapfrog_p(ucov,vcov,teta,ps,masse,phis,nq,q,clesphy0, |
---|
| 11 | & time_0) |
---|
| 12 | |
---|
| 13 | USE misc_mod |
---|
| 14 | USE parallel |
---|
| 15 | USE times |
---|
| 16 | USE mod_hallo |
---|
| 17 | USE Bands |
---|
| 18 | USE Write_Field |
---|
| 19 | USE Write_Field_p |
---|
| 20 | USE vampir |
---|
| 21 | |
---|
| 22 | IMPLICIT NONE |
---|
| 23 | |
---|
| 24 | c ...... Version du 10/01/98 .......... |
---|
| 25 | |
---|
| 26 | c avec coordonnees verticales hybrides |
---|
| 27 | c avec nouveaux operat. dissipation * ( gradiv2,divgrad2,nxgraro2 ) |
---|
| 28 | |
---|
| 29 | c======================================================================= |
---|
| 30 | c |
---|
| 31 | c Auteur: P. Le Van /L. Fairhead/F.Hourdin |
---|
| 32 | c ------- |
---|
| 33 | c |
---|
| 34 | c Objet: |
---|
| 35 | c ------ |
---|
| 36 | c |
---|
| 37 | c GCM LMD nouvelle grille |
---|
| 38 | c |
---|
| 39 | c======================================================================= |
---|
| 40 | c |
---|
| 41 | c ... Dans inigeom , nouveaux calculs pour les elongations cu , cv |
---|
| 42 | c et possibilite d'appeler une fonction f(y) a derivee tangente |
---|
| 43 | c hyperbolique a la place de la fonction a derivee sinusoidale. |
---|
| 44 | |
---|
| 45 | c ... Possibilite de choisir le shema pour l'advection de |
---|
| 46 | c q , en modifiant iadv dans traceur.def (10/02) . |
---|
| 47 | c |
---|
| 48 | c Pour Van-Leer + Vapeur d'eau saturee, iadv(1)=4. (F.Codron,10/99) |
---|
| 49 | c Pour Van-Leer iadv=10 |
---|
| 50 | c |
---|
| 51 | c----------------------------------------------------------------------- |
---|
| 52 | c Declarations: |
---|
| 53 | c ------------- |
---|
| 54 | |
---|
| 55 | #include "dimensions.h" |
---|
| 56 | #include "paramet.h" |
---|
| 57 | #include "comconst.h" |
---|
| 58 | #include "comdissnew.h" |
---|
| 59 | #include "comvert.h" |
---|
| 60 | #include "comgeom.h" |
---|
| 61 | #include "logic.h" |
---|
| 62 | #include "temps.h" |
---|
| 63 | #include "control.h" |
---|
| 64 | #include "ener.h" |
---|
| 65 | #include "description.h" |
---|
| 66 | #include "serre.h" |
---|
| 67 | #include "com_io_dyn.h" |
---|
| 68 | #include "iniprint.h" |
---|
| 69 | |
---|
| 70 | c#include "tracstoke.h" |
---|
| 71 | |
---|
| 72 | #include "academic.h" |
---|
[709] | 73 | #include "clesphys.h" |
---|
[726] | 74 | #include "advtrac.h" |
---|
[630] | 75 | |
---|
| 76 | include 'mpif.h' |
---|
| 77 | integer nq |
---|
| 78 | |
---|
| 79 | INTEGER longcles |
---|
| 80 | PARAMETER ( longcles = 20 ) |
---|
| 81 | REAL clesphy0( longcles ) |
---|
| 82 | |
---|
| 83 | real zqmin,zqmax |
---|
| 84 | INTEGER nbetatmoy, nbetatdem,nbetat |
---|
| 85 | |
---|
| 86 | c variables dynamiques |
---|
| 87 | REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants |
---|
| 88 | REAL teta(ip1jmp1,llm) ! temperature potentielle |
---|
| 89 | REAL q(ip1jmp1,llm,nqmx) ! champs advectes |
---|
| 90 | REAL ps(ip1jmp1) ! pression au sol |
---|
| 91 | REAL p (ip1jmp1,llmp1 ) ! pression aux interfac.des couches |
---|
| 92 | REAL pks(ip1jmp1) ! exner au sol |
---|
| 93 | REAL pk(ip1jmp1,llm) ! exner au milieu des couches |
---|
| 94 | REAL pkf(ip1jmp1,llm) ! exner filt.au milieu des couches |
---|
| 95 | REAL masse(ip1jmp1,llm) ! masse d'air |
---|
| 96 | REAL phis(ip1jmp1) ! geopotentiel au sol |
---|
| 97 | REAL phi(ip1jmp1,llm) ! geopotentiel |
---|
| 98 | REAL w(ip1jmp1,llm) ! vitesse verticale |
---|
| 99 | |
---|
| 100 | c variables dynamiques intermediaire pour le transport |
---|
| 101 | REAL pbaru(ip1jmp1,llm),pbarv(ip1jm,llm) !flux de masse |
---|
| 102 | |
---|
| 103 | c variables dynamiques au pas -1 |
---|
| 104 | REAL vcovm1(ip1jm,llm),ucovm1(ip1jmp1,llm) |
---|
| 105 | REAL tetam1(ip1jmp1,llm),psm1(ip1jmp1) |
---|
| 106 | REAL massem1(ip1jmp1,llm) |
---|
| 107 | |
---|
| 108 | c tendances dynamiques |
---|
| 109 | REAL dv(ip1jm,llm),du(ip1jmp1,llm) |
---|
| 110 | REAL dteta(ip1jmp1,llm),dq(ip1jmp1,llm,nqmx),dp(ip1jmp1) |
---|
| 111 | |
---|
| 112 | c tendances de la dissipation |
---|
| 113 | REAL dvdis(ip1jm,llm),dudis(ip1jmp1,llm) |
---|
| 114 | REAL dtetadis(ip1jmp1,llm) |
---|
| 115 | |
---|
| 116 | c tendances physiques |
---|
| 117 | REAL dvfi(ip1jm,llm),dufi(ip1jmp1,llm) |
---|
| 118 | REAL dtetafi(ip1jmp1,llm),dqfi(ip1jmp1,llm,nqmx),dpfi(ip1jmp1) |
---|
| 119 | |
---|
| 120 | c variables pour le fichier histoire |
---|
| 121 | REAL dtav ! intervalle de temps elementaire |
---|
| 122 | |
---|
| 123 | REAL tppn(iim),tpps(iim),tpn,tps |
---|
| 124 | c |
---|
| 125 | INTEGER itau,itaufinp1,iav |
---|
| 126 | INTEGER*4 iday ! jour julien |
---|
| 127 | REAL time ! Heure de la journee en fraction d'1 jour |
---|
| 128 | |
---|
| 129 | REAL SSUM |
---|
| 130 | REAL time_0 , finvmaold(ip1jmp1,llm) |
---|
| 131 | |
---|
| 132 | cym LOGICAL lafin |
---|
| 133 | LOGICAL :: lafin=.false. |
---|
| 134 | INTEGER ij,iq,l |
---|
| 135 | INTEGER ik |
---|
| 136 | |
---|
| 137 | real time_step, t_wrt, t_ops |
---|
| 138 | |
---|
| 139 | REAL rdayvrai,rdaym_ini |
---|
| 140 | LOGICAL first,callinigrads |
---|
| 141 | |
---|
| 142 | data callinigrads/.true./ |
---|
| 143 | character*10 string10 |
---|
| 144 | |
---|
| 145 | REAL alpha(ip1jmp1,llm),beta(ip1jmp1,llm) |
---|
[726] | 146 | #ifdef INCA |
---|
[630] | 147 | REAL :: flxw(ip1jmp1,llm) |
---|
| 148 | #endif |
---|
| 149 | |
---|
| 150 | c+jld variables test conservation energie |
---|
| 151 | REAL ecin(ip1jmp1,llm),ecin0(ip1jmp1,llm) |
---|
| 152 | C Tendance de la temp. potentiel d (theta)/ d t due a la |
---|
| 153 | C tansformation d'energie cinetique en energie thermique |
---|
| 154 | C cree par la dissipation |
---|
| 155 | REAL dtetaecdt(ip1jmp1,llm) |
---|
| 156 | REAL vcont(ip1jm,llm),ucont(ip1jmp1,llm) |
---|
| 157 | REAL vnat(ip1jm,llm),unat(ip1jmp1,llm) |
---|
| 158 | REAL d_h_vcol, d_qt, d_qw, d_ql, d_ec |
---|
| 159 | CHARACTER*15 ztit |
---|
[709] | 160 | ! INTEGER ip_ebil_dyn ! PRINT level for energy conserv. diag. |
---|
| 161 | ! SAVE ip_ebil_dyn |
---|
| 162 | ! DATA ip_ebil_dyn/0/ |
---|
[630] | 163 | c-jld |
---|
| 164 | |
---|
| 165 | character*80 dynhist_file, dynhistave_file |
---|
| 166 | character*20 modname |
---|
| 167 | character*80 abort_message |
---|
| 168 | |
---|
| 169 | C Calendrier |
---|
| 170 | LOGICAL true_calendar |
---|
| 171 | PARAMETER (true_calendar = .false.) |
---|
| 172 | |
---|
| 173 | logical dissip_conservative |
---|
| 174 | save dissip_conservative |
---|
| 175 | data dissip_conservative/.true./ |
---|
| 176 | |
---|
| 177 | LOGICAL prem |
---|
| 178 | save prem |
---|
| 179 | DATA prem/.true./ |
---|
| 180 | INTEGER testita |
---|
| 181 | PARAMETER (testita = 9) |
---|
| 182 | |
---|
[734] | 183 | c declaration liees au parallelisme |
---|
[630] | 184 | INTEGER :: ierr |
---|
| 185 | LOGICAL :: FirstCaldyn=.TRUE. |
---|
| 186 | LOGICAL :: FirstPhysic=.TRUE. |
---|
| 187 | INTEGER :: ijb,ije,j,i |
---|
| 188 | type(Request) :: TestRequest |
---|
| 189 | type(Request) :: Request_Dissip |
---|
| 190 | type(Request) :: Request_physic |
---|
| 191 | REAL dvfi_tmp(iip1,llm),dufi_tmp(iip1,llm) |
---|
| 192 | REAL dtetafi_tmp(iip1,llm),dqfi_tmp(iip1,llm,nqmx) |
---|
| 193 | REAL dpfi_tmp(iip1) |
---|
| 194 | INTEGER :: true_itau=0 |
---|
| 195 | LOGICAL :: verbose=.true. |
---|
| 196 | INTEGER :: iapptrac = 0 |
---|
| 197 | INTEGER :: AdjustCount = 0 |
---|
[709] | 198 | INTEGER :: var_time |
---|
[630] | 199 | ItCount=0 |
---|
| 200 | |
---|
| 201 | itaufin = nday*day_step |
---|
| 202 | itaufinp1 = itaufin +1 |
---|
| 203 | |
---|
| 204 | |
---|
| 205 | itau = 0 |
---|
| 206 | iday = day_ini+itau/day_step |
---|
| 207 | time = FLOAT(itau-(iday-day_ini)*day_step)/day_step+time_0 |
---|
| 208 | IF(time.GT.1.) THEN |
---|
| 209 | time = time-1. |
---|
| 210 | iday = iday+1 |
---|
| 211 | ENDIF |
---|
| 212 | |
---|
| 213 | |
---|
| 214 | c----------------------------------------------------------------------- |
---|
| 215 | c On initialise la pression et la fonction d'Exner : |
---|
| 216 | c -------------------------------------------------- |
---|
| 217 | |
---|
| 218 | dq=0. |
---|
| 219 | CALL pression ( ip1jmp1, ap, bp, ps, p ) |
---|
| 220 | CALL exner_hyb( ip1jmp1, ps, p,alpha,beta, pks, pk, pkf ) |
---|
| 221 | |
---|
| 222 | c----------------------------------------------------------------------- |
---|
| 223 | c Debut de l'integration temporelle: |
---|
| 224 | c ---------------------------------- |
---|
[734] | 225 | c et du parallelisme !! |
---|
[630] | 226 | |
---|
| 227 | 1 CONTINUE |
---|
| 228 | |
---|
[709] | 229 | call MPI_BARRIER(COMM_LMDZ,ierr) |
---|
[630] | 230 | |
---|
| 231 | #ifdef CPP_IOIPSL |
---|
| 232 | if (ok_guide.and.(itaufin-itau-1)*dtvr.gt.21600) then |
---|
[753] | 233 | call guide_pp(itau,ucov,vcov,teta,q,masse,ps) |
---|
[630] | 234 | else |
---|
| 235 | IF(prt_level>9)WRITE(*,*)'attention on ne guide pas les ', |
---|
| 236 | . '6 dernieres heures' |
---|
| 237 | endif |
---|
| 238 | #endif |
---|
| 239 | c |
---|
| 240 | c IF( MOD( itau, 10* day_step ).EQ.0 ) THEN |
---|
| 241 | c CALL test_period ( ucov,vcov,teta,q,p,phis ) |
---|
| 242 | c PRINT *,' ---- Test_period apres continue OK ! -----', itau |
---|
| 243 | c ENDIF |
---|
| 244 | c |
---|
| 245 | cym CALL SCOPY( ijmllm ,vcov , 1, vcovm1 , 1 ) |
---|
| 246 | cym CALL SCOPY( ijp1llm,ucov , 1, ucovm1 , 1 ) |
---|
| 247 | cym CALL SCOPY( ijp1llm,teta , 1, tetam1 , 1 ) |
---|
| 248 | cym CALL SCOPY( ijp1llm,masse, 1, massem1, 1 ) |
---|
| 249 | cym CALL SCOPY( ip1jmp1, ps , 1, psm1 , 1 ) |
---|
| 250 | |
---|
| 251 | if (FirstCaldyn) then |
---|
| 252 | ucovm1=ucov |
---|
| 253 | vcovm1=vcov |
---|
| 254 | tetam1= teta |
---|
| 255 | massem1= masse |
---|
| 256 | psm1= ps |
---|
| 257 | |
---|
| 258 | finvmaold = masse |
---|
| 259 | CALL filtreg ( finvmaold ,jjp1, llm, -2,2, .TRUE., 1 ) |
---|
| 260 | |
---|
| 261 | else |
---|
| 262 | |
---|
| 263 | ijb=ij_begin |
---|
| 264 | ije=ij_end |
---|
| 265 | |
---|
| 266 | ucovm1 (ijb:ije,:) = ucov (ijb:ije,:) |
---|
| 267 | tetam1 (ijb:ije,:) = teta (ijb:ije,:) |
---|
| 268 | massem1 (ijb:ije,:) = masse (ijb:ije,:) |
---|
| 269 | psm1 (ijb:ije) = ps (ijb:ije) |
---|
| 270 | |
---|
| 271 | if (pole_sud) ije=ij_end-iip1 |
---|
| 272 | vcovm1(ijb:ije,:) = vcov (ijb:ije,:) |
---|
| 273 | |
---|
| 274 | finvmaold(ij_begin:ij_end,1:llm)=masse(ij_begin:ij_end,1:llm) |
---|
| 275 | CALL filtreg_p ( finvmaold ,jj_begin,jj_end,jjp1, |
---|
| 276 | . llm, -2,2, .TRUE., 1 ) |
---|
| 277 | |
---|
| 278 | endif |
---|
| 279 | |
---|
| 280 | forward = .TRUE. |
---|
| 281 | leapf = .FALSE. |
---|
| 282 | dt = dtvr |
---|
| 283 | |
---|
| 284 | c ... P.Le Van .26/04/94 .... |
---|
| 285 | |
---|
| 286 | cym CALL SCOPY ( ijp1llm, masse, 1, finvmaold, 1 ) |
---|
| 287 | cym CALL filtreg ( finvmaold ,jjp1, llm, -2,2, .TRUE., 1 ) |
---|
| 288 | |
---|
[734] | 289 | cym ne sert a rien |
---|
[630] | 290 | cym call minmax(ijp1llm,q(:,:,3),zqmin,zqmax) |
---|
| 291 | |
---|
| 292 | 2 CONTINUE |
---|
| 293 | |
---|
| 294 | ItCount=ItCount+1 |
---|
[709] | 295 | if (MOD(ItCount,1)==1) then |
---|
[630] | 296 | debug=.true. |
---|
| 297 | else |
---|
| 298 | debug=.false. |
---|
| 299 | endif |
---|
| 300 | c----------------------------------------------------------------------- |
---|
| 301 | |
---|
| 302 | c date: |
---|
| 303 | c ----- |
---|
| 304 | |
---|
| 305 | |
---|
| 306 | c gestion des appels de la physique et des dissipations: |
---|
| 307 | c ------------------------------------------------------ |
---|
| 308 | c |
---|
| 309 | c ... P.Le Van ( 6/02/95 ) .... |
---|
| 310 | |
---|
| 311 | apphys = .FALSE. |
---|
| 312 | statcl = .FALSE. |
---|
| 313 | conser = .FALSE. |
---|
| 314 | apdiss = .FALSE. |
---|
[709] | 315 | c idissip=1 |
---|
[630] | 316 | IF( purmats ) THEN |
---|
| 317 | IF( MOD(itau,iconser) .EQ.0.AND. forward ) conser = .TRUE. |
---|
| 318 | IF( MOD(itau,idissip ).EQ.0.AND..NOT.forward ) apdiss = .TRUE. |
---|
| 319 | IF( MOD(itau,iphysiq ).EQ.0.AND..NOT.forward |
---|
| 320 | s .and. iflag_phys.NE.0 ) apphys = .TRUE. |
---|
| 321 | ELSE |
---|
| 322 | IF( MOD(itau ,iconser) .EQ. 0 ) conser = .TRUE. |
---|
| 323 | IF( MOD(itau+1,idissip) .EQ. 0 ) apdiss = .TRUE. |
---|
| 324 | IF( MOD(itau+1,iphysiq).EQ.0.AND.iflag_phys.NE.0) apphys=.TRUE. |
---|
| 325 | END IF |
---|
| 326 | |
---|
| 327 | cym ---> Pour le moment |
---|
| 328 | cym apphys = .FALSE. |
---|
| 329 | statcl = .FALSE. |
---|
| 330 | conser = .FALSE. |
---|
| 331 | |
---|
| 332 | if (firstCaldyn) then |
---|
| 333 | |
---|
| 334 | call SetDistrib(jj_Nb_Caldyn) |
---|
| 335 | firstCaldyn=.FALSE. |
---|
| 336 | cym call InitTime |
---|
| 337 | call Init_timer |
---|
| 338 | endif |
---|
| 339 | |
---|
| 340 | |
---|
| 341 | |
---|
| 342 | |
---|
| 343 | if (Adjust) then |
---|
| 344 | AdjustCount=AdjustCount+1 |
---|
| 345 | c if (MOD(itau+1,20)==0) then |
---|
| 346 | if (iapptrac==iapp_tracvl .and. (forward. OR . leapf) |
---|
| 347 | & .and. .not.FirstPhysic .and. Adjustcount>30) then |
---|
| 348 | AdjustCount=0 |
---|
| 349 | call allgather_timer_average |
---|
| 350 | |
---|
| 351 | if (Verbose) then |
---|
| 352 | |
---|
| 353 | print *,'*********************************' |
---|
| 354 | print *,'****** TIMER CALDYN ******' |
---|
| 355 | do i=0,mpi_size-1 |
---|
| 356 | print *,'proc',i,' : Nb Bandes :',jj_nb_caldyn(i), |
---|
| 357 | & ' : temps moyen :', |
---|
| 358 | & timer_average(jj_nb_caldyn(i),timer_caldyn,i), |
---|
| 359 | & '+-',timer_delta(jj_nb_caldyn(i),timer_caldyn,i) |
---|
| 360 | enddo |
---|
| 361 | |
---|
| 362 | print *,'*********************************' |
---|
| 363 | print *,'****** TIMER VANLEER ******' |
---|
| 364 | do i=0,mpi_size-1 |
---|
| 365 | print *,'proc',i,' : Nb Bandes :',jj_nb_vanleer(i), |
---|
| 366 | & ' : temps moyen :', |
---|
| 367 | & timer_average(jj_nb_vanleer(i),timer_vanleer,i), |
---|
| 368 | & '+-',timer_delta(jj_nb_vanleer(i),timer_vanleer,i) |
---|
| 369 | enddo |
---|
| 370 | |
---|
| 371 | print *,'*********************************' |
---|
| 372 | print *,'****** TIMER DISSIP ******' |
---|
| 373 | do i=0,mpi_size-1 |
---|
| 374 | print *,'proc',i,' : Nb Bandes :',jj_nb_dissip(i), |
---|
| 375 | & ' : temps moyen :', |
---|
| 376 | & timer_average(jj_nb_dissip(i),timer_dissip,i), |
---|
| 377 | & '+-',timer_delta(jj_nb_dissip(i),timer_dissip,i) |
---|
| 378 | enddo |
---|
| 379 | |
---|
| 380 | if (mpi_rank==0) call WriteBands |
---|
| 381 | |
---|
| 382 | endif |
---|
| 383 | |
---|
| 384 | call AdjustBands_caldyn |
---|
| 385 | if (mpi_rank==0) call WriteBands |
---|
| 386 | |
---|
| 387 | call Register_SwapFieldHallo(ucov,ucov,ip1jmp1,llm, |
---|
| 388 | & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 389 | call Register_SwapFieldHallo(ucovm1,ucovm1,ip1jmp1,llm, |
---|
| 390 | & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 391 | call Register_SwapFieldHallo(vcov,vcov,ip1jm,llm, |
---|
| 392 | & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 393 | call Register_SwapFieldHallo(vcovm1,vcovm1,ip1jm,llm, |
---|
| 394 | & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 395 | call Register_SwapFieldHallo(teta,teta,ip1jmp1,llm, |
---|
| 396 | & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 397 | call Register_SwapFieldHallo(tetam1,tetam1,ip1jmp1,llm, |
---|
| 398 | & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 399 | call Register_SwapFieldHallo(masse,masse,ip1jmp1,llm, |
---|
| 400 | & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 401 | call Register_SwapFieldHallo(massem1,massem1,ip1jmp1,llm, |
---|
| 402 | & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 403 | call Register_SwapFieldHallo(ps,ps,ip1jmp1,1, |
---|
| 404 | & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 405 | call Register_SwapFieldHallo(psm1,psm1,ip1jmp1,1, |
---|
| 406 | & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 407 | call Register_SwapFieldHallo(pkf,pkf,ip1jmp1,llm, |
---|
| 408 | & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 409 | call Register_SwapFieldHallo(pk,pk,ip1jmp1,llm, |
---|
| 410 | & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 411 | call Register_SwapFieldHallo(pks,pks,ip1jmp1,1, |
---|
| 412 | & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 413 | call Register_SwapFieldHallo(phis,phis,ip1jmp1,1, |
---|
| 414 | & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 415 | call Register_SwapFieldHallo(phi,phi,ip1jmp1,llm, |
---|
| 416 | & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 417 | call Register_SwapFieldHallo(finvmaold,finvmaold,ip1jmp1,llm, |
---|
| 418 | & jj_Nb_caldyn,0,0,TestRequest) |
---|
| 419 | |
---|
[743] | 420 | do j=1,nqmx |
---|
| 421 | call Register_SwapFieldHallo(q(1,1,j),q(1,1,j),ip1jmp1,llm, |
---|
| 422 | & jj_nb_caldyn,0,0,TestRequest) |
---|
| 423 | enddo |
---|
| 424 | |
---|
[630] | 425 | call SetDistrib(jj_nb_caldyn) |
---|
| 426 | call SendRequest(TestRequest) |
---|
| 427 | call WaitRequest(TestRequest) |
---|
| 428 | |
---|
| 429 | c call SetDistrib(jj_Nb_vanleer) |
---|
| 430 | c call AdjustBands_vanleer |
---|
| 431 | c do j=1,nqmx |
---|
| 432 | c call Register_SwapFieldHallo(q(1,1,j),q(1,1,j),ip1jmp1,llm, |
---|
| 433 | c * jj_nb_vanleer,0,0,TestRequest) |
---|
| 434 | c enddo |
---|
| 435 | c |
---|
| 436 | c call Register_SwapFieldHallo(finvmaold,finvmaold,ip1jmp1,llm, |
---|
| 437 | c & jj_Nb_vanleer,0,0,TestRequest) |
---|
| 438 | |
---|
| 439 | c call SendRequest(TestRequest) |
---|
| 440 | c call WaitRequest(TestRequest) |
---|
| 441 | |
---|
| 442 | call AdjustBands_dissip |
---|
| 443 | call AdjustBands_physic |
---|
| 444 | c call SetDistrib(jj_nb_caldyn) |
---|
| 445 | endif |
---|
| 446 | |
---|
| 447 | endif |
---|
| 448 | |
---|
| 449 | |
---|
| 450 | |
---|
| 451 | c----------------------------------------------------------------------- |
---|
| 452 | c calcul des tendances dynamiques: |
---|
| 453 | c -------------------------------- |
---|
| 454 | |
---|
| 455 | call VTb(VThallo) |
---|
| 456 | call Register_Hallo(ucov,ip1jmp1,llm,1,1,1,1,TestRequest) |
---|
| 457 | call Register_Hallo(vcov,ip1jm,llm,1,1,1,1,TestRequest) |
---|
| 458 | call Register_Hallo(teta,ip1jmp1,llm,1,1,1,1,TestRequest) |
---|
| 459 | call Register_Hallo(ps,ip1jmp1,1,1,2,2,1,TestRequest) |
---|
| 460 | call Register_Hallo(pkf,ip1jmp1,llm,1,1,1,1,TestRequest) |
---|
| 461 | call Register_Hallo(pk,ip1jmp1,llm,1,1,1,1,TestRequest) |
---|
| 462 | call Register_Hallo(pks,ip1jmp1,1,1,1,1,1,TestRequest) |
---|
| 463 | call Register_Hallo(p,ip1jmp1,llmp1,1,1,1,1,TestRequest) |
---|
| 464 | |
---|
| 465 | c do j=1,nqmx |
---|
| 466 | c call Register_Hallo(q(1,1,j),ip1jmp1,llm,1,1,1,1, |
---|
| 467 | c * TestRequest) |
---|
| 468 | c enddo |
---|
| 469 | |
---|
| 470 | call SendRequest(TestRequest) |
---|
| 471 | call WaitRequest(TestRequest) |
---|
| 472 | call VTe(VThallo) |
---|
| 473 | |
---|
[709] | 474 | |
---|
[630] | 475 | if (debug) then |
---|
| 476 | call WriteField_p('ucov',reshape(ucov,(/iip1,jmp1,llm/))) |
---|
| 477 | call WriteField_p('vcov',reshape(vcov,(/iip1,jjm,llm/))) |
---|
| 478 | call WriteField_p('teta',reshape(teta,(/iip1,jmp1,llm/))) |
---|
| 479 | call WriteField_p('ps',reshape(ps,(/iip1,jmp1/))) |
---|
| 480 | call WriteField_p('masse',reshape(masse,(/iip1,jmp1,llm/))) |
---|
[734] | 481 | call WriteField_p('pk',reshape(pk,(/iip1,jmp1,llm/))) |
---|
[630] | 482 | call WriteField_p('pks',reshape(pks,(/iip1,jmp1/))) |
---|
| 483 | call WriteField_p('pkf',reshape(pkf,(/iip1,jmp1,llm/))) |
---|
| 484 | call WriteField_p('phis',reshape(phis,(/iip1,jmp1/))) |
---|
[743] | 485 | do j=1,nqmx |
---|
| 486 | call WriteField_p('q'//trim(int2str(j)), |
---|
| 487 | . reshape(q(:,:,j),(/iip1,jmp1,llm/))) |
---|
| 488 | enddo |
---|
[630] | 489 | endif |
---|
[709] | 490 | |
---|
[630] | 491 | |
---|
| 492 | |
---|
| 493 | True_itau=True_itau+1 |
---|
| 494 | print*,"Iteration No",True_itau |
---|
| 495 | |
---|
| 496 | |
---|
| 497 | call start_timer(timer_caldyn) |
---|
| 498 | |
---|
| 499 | CALL geopot_p ( ip1jmp1, teta , pk , pks, phis , phi ) |
---|
| 500 | |
---|
| 501 | |
---|
| 502 | call VTb(VTcaldyn) |
---|
[709] | 503 | |
---|
| 504 | var_time=time+iday-day_ini |
---|
| 505 | OMP_CHUNK=5 |
---|
| 506 | c$OMP PARALLEL DEFAULT(SHARED) |
---|
| 507 | cc$OMP+ SHARED(itau,ucov,vcov,teta,ps,masse,pk,pkf,phis , |
---|
| 508 | cc$OMP+ phi,conser,du,dv,dteta,dp,w, pbaru,pbarv, |
---|
| 509 | cc$OMP+ var_time) |
---|
| 510 | |
---|
[630] | 511 | CALL caldyn_p |
---|
| 512 | $ ( itau,ucov,vcov,teta,ps,masse,pk,pkf,phis , |
---|
| 513 | $ phi,conser,du,dv,dteta,dp,w, pbaru,pbarv, time+iday-day_ini ) |
---|
[709] | 514 | |
---|
| 515 | c$OMP END PARALLEL |
---|
[630] | 516 | call VTe(VTcaldyn) |
---|
| 517 | c call WriteField_p('du',reshape(du,(/iip1,jmp1,llm/))) |
---|
| 518 | c call WriteField_p('dv',reshape(dv,(/iip1,jjm,llm/))) |
---|
| 519 | c call WriteField_p('dteta',reshape(dteta,(/iip1,jmp1,llm/))) |
---|
| 520 | c call WriteField_p('dp',reshape(dp,(/iip1,jmp1/))) |
---|
| 521 | c call WriteField_p('w',reshape(w,(/iip1,jmp1,llm/))) |
---|
| 522 | c call WriteField_p('pbaru',reshape(pbaru,(/iip1,jmp1,llm/))) |
---|
| 523 | c call WriteField_p('pbarv',reshape(pbarv,(/iip1,jjm,llm/))) |
---|
| 524 | |
---|
| 525 | c----------------------------------------------------------------------- |
---|
| 526 | c calcul des tendances advection des traceurs (dont l'humidite) |
---|
| 527 | c ------------------------------------------------------------- |
---|
| 528 | |
---|
| 529 | IF( forward. OR . leapf ) THEN |
---|
[709] | 530 | c$OMP PARALLEL DEFAULT(SHARED) |
---|
[630] | 531 | c |
---|
[726] | 532 | #ifdef INCA |
---|
[630] | 533 | CALL caladvtrac_p(q,pbaru,pbarv, |
---|
| 534 | * p, masse, dq, teta, |
---|
| 535 | . flxw, |
---|
[726] | 536 | . pk, |
---|
| 537 | . iapptrac) |
---|
[630] | 538 | #else |
---|
| 539 | CALL caladvtrac_p(q,pbaru,pbarv, |
---|
| 540 | * p, masse, dq, teta, |
---|
| 541 | . pk,iapptrac) |
---|
| 542 | #endif |
---|
[709] | 543 | |
---|
| 544 | c$OMP END PARALLEL |
---|
| 545 | |
---|
[630] | 546 | c do j=1,nqmx |
---|
| 547 | c call WriteField_p('q'//trim(int2str(j)), |
---|
[709] | 548 | c . reshape(q(:,:,j),(/iip1,jmp1,llm/))) |
---|
[630] | 549 | c call WriteField_p('dq'//trim(int2str(j)), |
---|
| 550 | c . reshape(dq(:,:,j),(/iip1,jmp1,llm/))) |
---|
| 551 | c enddo |
---|
[709] | 552 | IF (offline) THEN |
---|
[630] | 553 | Cmaf stokage du flux de masse pour traceurs OFF-LINE |
---|
[753] | 554 | #undef CPP_IOIPSL |
---|
[630] | 555 | #ifdef CPP_IOIPSL |
---|
| 556 | CALL fluxstokenc(pbaru,pbarv,masse,teta,phi,phis, |
---|
| 557 | . dtvr, itau) |
---|
| 558 | #endif |
---|
| 559 | |
---|
| 560 | |
---|
| 561 | ENDIF |
---|
| 562 | c |
---|
| 563 | ENDIF |
---|
| 564 | |
---|
| 565 | |
---|
| 566 | c----------------------------------------------------------------------- |
---|
| 567 | c integrations dynamique et traceurs: |
---|
| 568 | c ---------------------------------- |
---|
| 569 | |
---|
| 570 | call VTb(VTintegre) |
---|
[709] | 571 | c call WriteField_p('ucovm1',reshape(ucovm1,(/iip1,jmp1,llm/))) |
---|
| 572 | c call WriteField_p('vcovm1',reshape(vcovm1,(/iip1,jjm,llm/))) |
---|
| 573 | c call WriteField_p('tetam1',reshape(tetam1,(/iip1,jmp1,llm/))) |
---|
| 574 | c call WriteField_p('psm1',reshape(psm1,(/iip1,jmp1/))) |
---|
| 575 | c call WriteField_p('ucov',reshape(ucov,(/iip1,jmp1,llm/))) |
---|
| 576 | c call WriteField_p('vcov',reshape(vcov,(/iip1,jjm,llm/))) |
---|
| 577 | c call WriteField_p('teta',reshape(teta,(/iip1,jmp1,llm/))) |
---|
| 578 | c call WriteField_p('ps',reshape(ps,(/iip1,jmp1/))) |
---|
| 579 | c$OMP PARALLEL DEFAULT(SHARED) |
---|
[630] | 580 | CALL integrd_p ( 2,vcovm1,ucovm1,tetam1,psm1,massem1 , |
---|
| 581 | $ dv,du,dteta,dq,dp,vcov,ucov,teta,q,ps,masse,phis , |
---|
| 582 | $ finvmaold ) |
---|
| 583 | |
---|
[709] | 584 | c$OMP END PARALLEL |
---|
| 585 | c call WriteField_p('ucovm1',reshape(ucovm1,(/iip1,jmp1,llm/))) |
---|
| 586 | c call WriteField_p('vcovm1',reshape(vcovm1,(/iip1,jjm,llm/))) |
---|
| 587 | c call WriteField_p('tetam1',reshape(tetam1,(/iip1,jmp1,llm/))) |
---|
| 588 | c call WriteField_p('psm1',reshape(psm1,(/iip1,jmp1/))) |
---|
| 589 | c call WriteField_p('ucov',reshape(ucov,(/iip1,jmp1,llm/))) |
---|
| 590 | c call WriteField_p('vcov',reshape(vcov,(/iip1,jjm,llm/))) |
---|
| 591 | c call WriteField_p('teta',reshape(teta,(/iip1,jmp1,llm/))) |
---|
| 592 | c call WriteField_p('dteta',reshape(dteta,(/iip1,jmp1,llm/))) |
---|
| 593 | |
---|
| 594 | c call WriteField_p('ps',reshape(ps,(/iip1,jmp1/))) |
---|
| 595 | |
---|
[630] | 596 | call VTe(VTintegre) |
---|
[709] | 597 | |
---|
[630] | 598 | c .P.Le Van (26/04/94 ajout de finvpold dans l'appel d'integrd) |
---|
| 599 | c |
---|
| 600 | c----------------------------------------------------------------------- |
---|
| 601 | c calcul des tendances physiques: |
---|
| 602 | c ------------------------------- |
---|
| 603 | c ######## P.Le Van ( Modif le 6/02/95 ) ########### |
---|
| 604 | c |
---|
| 605 | IF( purmats ) THEN |
---|
| 606 | IF( itau.EQ.itaufin.AND..NOT.forward ) lafin = .TRUE. |
---|
| 607 | ELSE |
---|
| 608 | IF( itau+1. EQ. itaufin ) lafin = .TRUE. |
---|
| 609 | ENDIF |
---|
| 610 | c |
---|
| 611 | c |
---|
| 612 | IF( apphys ) THEN |
---|
| 613 | c |
---|
| 614 | c ....... Ajout P.Le Van ( 17/04/96 ) ........... |
---|
| 615 | c |
---|
[709] | 616 | c$OMP PARALLEL DEFAULT(SHARED) |
---|
| 617 | c$OMP+ PRIVATE(rdaym_ini,rdayvrai,ijb,ije) |
---|
| 618 | |
---|
| 619 | c$OMP MASTER |
---|
[630] | 620 | call suspend_timer(timer_caldyn) |
---|
| 621 | print*,'Entree dans la physique : Iteration No ',true_itau |
---|
[709] | 622 | c$OMP END MASTER |
---|
| 623 | |
---|
[630] | 624 | CALL pression_p ( ip1jmp1, ap, bp, ps, p ) |
---|
[734] | 625 | c$OMP BARRIER |
---|
| 626 | |
---|
| 627 | c$OMP MASTER |
---|
[630] | 628 | CALL exner_hyb_p( ip1jmp1, ps, p,alpha,beta,pks, pk, pkf ) |
---|
[734] | 629 | c$OMP END MASTER |
---|
| 630 | c$OMP BARRIER |
---|
[630] | 631 | rdaym_ini = itau * dtvr / daysec |
---|
| 632 | rdayvrai = rdaym_ini + day_ini |
---|
| 633 | |
---|
| 634 | |
---|
| 635 | c rajout debug |
---|
| 636 | c lafin = .true. |
---|
| 637 | |
---|
| 638 | |
---|
| 639 | c Inbterface avec les routines de phylmd (phymars ... ) |
---|
| 640 | c ----------------------------------------------------- |
---|
| 641 | |
---|
| 642 | #ifdef CPP_PHYS |
---|
| 643 | c+jld |
---|
| 644 | |
---|
[734] | 645 | c Diagnostique de conservation de l'energie : initialisation |
---|
[630] | 646 | IF (ip_ebil_dyn.ge.1 ) THEN |
---|
| 647 | ztit='bil dyn' |
---|
| 648 | CALL diagedyn(ztit,2,1,1,dtphys |
---|
| 649 | e , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) |
---|
| 650 | ENDIF |
---|
| 651 | c-jld |
---|
[709] | 652 | c$OMP BARRIER |
---|
| 653 | c$OMP MASTER |
---|
[630] | 654 | call VTb(VThallo) |
---|
| 655 | call SetTag(Request_physic,800) |
---|
| 656 | |
---|
| 657 | call Register_SwapFieldHallo(ucov,ucov,ip1jmp1,llm, |
---|
| 658 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 659 | |
---|
| 660 | call Register_SwapFieldHallo(vcov,vcov,ip1jm,llm, |
---|
| 661 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 662 | |
---|
| 663 | call Register_SwapFieldHallo(teta,teta,ip1jmp1,llm, |
---|
| 664 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 665 | |
---|
| 666 | call Register_SwapFieldHallo(p,p,ip1jmp1,llmp1, |
---|
| 667 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 668 | |
---|
| 669 | call Register_SwapFieldHallo(pk,pk,ip1jmp1,llm, |
---|
| 670 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 671 | |
---|
| 672 | call Register_SwapFieldHallo(phis,phis,ip1jmp1,1, |
---|
| 673 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 674 | |
---|
| 675 | call Register_SwapFieldHallo(phi,phi,ip1jmp1,llm, |
---|
| 676 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 677 | |
---|
| 678 | call Register_SwapFieldHallo(w,w,ip1jmp1,llm, |
---|
| 679 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 680 | |
---|
| 681 | c call SetDistrib(jj_nb_vanleer) |
---|
| 682 | do j=1,nqmx |
---|
| 683 | |
---|
| 684 | call Register_SwapFieldHallo(q(1,1,j),q(1,1,j),ip1jmp1,llm, |
---|
| 685 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 686 | enddo |
---|
[726] | 687 | #ifdef INCA |
---|
[630] | 688 | call Register_SwapFieldHallo(flxw,flxw,ip1jmp1,llm, |
---|
| 689 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 690 | #endif |
---|
| 691 | call SetDistrib(jj_nb_Physic) |
---|
| 692 | |
---|
| 693 | call SendRequest(Request_Physic) |
---|
| 694 | call WaitRequest(Request_Physic) |
---|
| 695 | |
---|
| 696 | call VTe(VThallo) |
---|
| 697 | |
---|
| 698 | call VTb(VTphysiq) |
---|
[709] | 699 | c$OMP END MASTER |
---|
| 700 | c$OMP BARRIER |
---|
[734] | 701 | |
---|
| 702 | cc$OMP MASTER |
---|
| 703 | c call WriteField_p('ucovfi',reshape(ucov,(/iip1,jmp1,llm/))) |
---|
| 704 | c call WriteField_p('vcovfi',reshape(vcov,(/iip1,jjm,llm/))) |
---|
| 705 | c call WriteField_p('tetafi',reshape(teta,(/iip1,jmp1,llm/))) |
---|
| 706 | c call WriteField_p('pfi',reshape(p,(/iip1,jmp1,llmp1/))) |
---|
| 707 | c call WriteField_p('pkfi',reshape(pk,(/iip1,jmp1,llm/))) |
---|
| 708 | cc$OMP END MASTER |
---|
| 709 | cc$OMP BARRIER |
---|
[709] | 710 | |
---|
[630] | 711 | CALL calfis_p( nq, lafin ,rdayvrai,time , |
---|
| 712 | $ ucov,vcov,teta,q,masse,ps,p,pk,phis,phi , |
---|
| 713 | $ du,dv,dteta,dq,w, |
---|
[726] | 714 | #ifdef INCA |
---|
[630] | 715 | $ flxw, |
---|
| 716 | #endif |
---|
| 717 | $ clesphy0, dufi,dvfi,dtetafi,dqfi,dpfi ) |
---|
| 718 | ijb=ij_begin |
---|
| 719 | ije=ij_end |
---|
| 720 | if ( .not. pole_nord) then |
---|
[709] | 721 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 722 | DO l=1,llm |
---|
| 723 | dufi_tmp(1:iip1,l) = dufi(ijb:ijb+iim,l) |
---|
| 724 | dvfi_tmp(1:iip1,l) = dvfi(ijb:ijb+iim,l) |
---|
| 725 | dtetafi_tmp(1:iip1,l)= dtetafi(ijb:ijb+iim,l) |
---|
| 726 | dqfi_tmp(1:iip1,l,:) = dqfi(ijb:ijb+iim,l,:) |
---|
| 727 | ENDDO |
---|
| 728 | c$OMP END DO NOWAIT |
---|
| 729 | |
---|
| 730 | c$OMP MASTER |
---|
[630] | 731 | dpfi_tmp(1:iip1) = dpfi(ijb:ijb+iim) |
---|
[709] | 732 | c$OMP END MASTER |
---|
| 733 | endif |
---|
| 734 | |
---|
| 735 | c$OMP BARRIER |
---|
| 736 | c$OMP MASTER |
---|
[630] | 737 | call SetDistrib(jj_nb_Physic_bis) |
---|
| 738 | |
---|
| 739 | call VTb(VThallo) |
---|
| 740 | |
---|
| 741 | call Register_Hallo(dufi,ip1jmp1,llm, |
---|
| 742 | * 1,0,0,1,Request_physic) |
---|
| 743 | |
---|
| 744 | call Register_Hallo(dvfi,ip1jm,llm, |
---|
| 745 | * 1,0,0,1,Request_physic) |
---|
| 746 | |
---|
| 747 | call Register_Hallo(dtetafi,ip1jmp1,llm, |
---|
| 748 | * 1,0,0,1,Request_physic) |
---|
| 749 | |
---|
| 750 | call Register_Hallo(dpfi,ip1jmp1,1, |
---|
| 751 | * 1,0,0,1,Request_physic) |
---|
| 752 | |
---|
| 753 | do j=1,nqmx |
---|
| 754 | call Register_Hallo(dqfi(1,1,j),ip1jmp1,llm, |
---|
| 755 | * 1,0,0,1,Request_physic) |
---|
| 756 | enddo |
---|
| 757 | |
---|
| 758 | call SendRequest(Request_Physic) |
---|
| 759 | call WaitRequest(Request_Physic) |
---|
| 760 | |
---|
| 761 | call VTe(VThallo) |
---|
| 762 | |
---|
| 763 | call SetDistrib(jj_nb_Physic) |
---|
[709] | 764 | c$OMP END MASTER |
---|
| 765 | c$OMP BARRIER |
---|
[630] | 766 | ijb=ij_begin |
---|
| 767 | if (.not. pole_nord) then |
---|
[709] | 768 | |
---|
| 769 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 770 | DO l=1,llm |
---|
| 771 | dufi(ijb:ijb+iim,l) = dufi(ijb:ijb+iim,l)+dufi_tmp(1:iip1,l) |
---|
| 772 | dvfi(ijb:ijb+iim,l) = dvfi(ijb:ijb+iim,l)+dvfi_tmp(1:iip1,l) |
---|
| 773 | dtetafi(ijb:ijb+iim,l) = dtetafi(ijb:ijb+iim,l) |
---|
| 774 | & +dtetafi_tmp(1:iip1,l) |
---|
| 775 | dqfi(ijb:ijb+iim,l,:) = dqfi(ijb:ijb+iim,l,:) |
---|
| 776 | & + dqfi_tmp(1:iip1,l,:) |
---|
| 777 | ENDDO |
---|
| 778 | c$OMP END DO NOWAIT |
---|
| 779 | |
---|
| 780 | c$OMP MASTER |
---|
[630] | 781 | dpfi(ijb:ijb+iim) = dpfi(ijb:ijb+iim)+ dpfi_tmp(1:iip1) |
---|
[709] | 782 | c$OMP END MASTER |
---|
| 783 | |
---|
[630] | 784 | endif |
---|
[709] | 785 | c$OMP BARRIER |
---|
| 786 | cc$OMP MASTER |
---|
[630] | 787 | c call WriteField_p('dufi',reshape(dufi,(/iip1,jmp1,llm/))) |
---|
| 788 | c call WriteField_p('dvfi',reshape(dvfi,(/iip1,jjm,llm/))) |
---|
| 789 | c call WriteField_p('dtetafi',reshape(dtetafi,(/iip1,jmp1,llm/))) |
---|
| 790 | c call WriteField_p('dpfi',reshape(dpfi,(/iip1,jmp1/))) |
---|
[709] | 791 | cc$OMP END MASTER |
---|
[630] | 792 | c |
---|
| 793 | c do j=1,nqmx |
---|
| 794 | c call WriteField_p('dqfi'//trim(int2str(j)), |
---|
| 795 | c . reshape(dqfi(:,:,j),(/iip1,jmp1,llm/))) |
---|
| 796 | c enddo |
---|
| 797 | |
---|
| 798 | c ajout des tendances physiques: |
---|
| 799 | c ------------------------------ |
---|
| 800 | CALL addfi_p( nqmx, dtphys, leapf, forward , |
---|
| 801 | $ ucov, vcov, teta , q ,ps , |
---|
| 802 | $ dufi, dvfi, dtetafi , dqfi ,dpfi ) |
---|
| 803 | |
---|
[709] | 804 | c$OMP BARRIER |
---|
| 805 | c$OMP MASTER |
---|
[630] | 806 | call VTe(VTphysiq) |
---|
| 807 | |
---|
| 808 | call VTb(VThallo) |
---|
| 809 | |
---|
| 810 | call SetTag(Request_physic,800) |
---|
| 811 | call Register_SwapField(ucov,ucov,ip1jmp1,llm, |
---|
| 812 | * jj_Nb_caldyn,Request_physic) |
---|
| 813 | |
---|
| 814 | call Register_SwapField(vcov,vcov,ip1jm,llm, |
---|
| 815 | * jj_Nb_caldyn,Request_physic) |
---|
| 816 | |
---|
| 817 | call Register_SwapField(teta,teta,ip1jmp1,llm, |
---|
| 818 | * jj_Nb_caldyn,Request_physic) |
---|
| 819 | |
---|
| 820 | call Register_SwapField(p,p,ip1jmp1,llmp1, |
---|
| 821 | * jj_Nb_caldyn,Request_physic) |
---|
| 822 | |
---|
| 823 | call Register_SwapField(pk,pk,ip1jmp1,llm, |
---|
| 824 | * jj_Nb_caldyn,Request_physic) |
---|
| 825 | |
---|
| 826 | call Register_SwapField(phis,phis,ip1jmp1,1, |
---|
| 827 | * jj_Nb_caldyn,Request_physic) |
---|
| 828 | |
---|
| 829 | call Register_SwapField(phi,phi,ip1jmp1,llm, |
---|
| 830 | * jj_Nb_caldyn,Request_physic) |
---|
| 831 | |
---|
| 832 | call Register_SwapField(w,w,ip1jmp1,llm, |
---|
| 833 | * jj_Nb_caldyn,Request_physic) |
---|
| 834 | |
---|
| 835 | do j=1,nqmx |
---|
| 836 | |
---|
| 837 | call Register_SwapField(q(1,1,j),q(1,1,j),ip1jmp1,llm, |
---|
| 838 | * jj_Nb_caldyn,Request_physic) |
---|
| 839 | |
---|
| 840 | enddo |
---|
| 841 | |
---|
| 842 | call SendRequest(Request_Physic) |
---|
| 843 | call WaitRequest(Request_Physic) |
---|
| 844 | |
---|
| 845 | call VTe(VThallo) |
---|
| 846 | |
---|
| 847 | call SetDistrib(jj_Nb_caldyn) |
---|
[709] | 848 | c$OMP END MASTER |
---|
| 849 | c$OMP BARRIER |
---|
[630] | 850 | c |
---|
[734] | 851 | c Diagnostique de conservation de l'energie : difference |
---|
[630] | 852 | IF (ip_ebil_dyn.ge.1 ) THEN |
---|
| 853 | ztit='bil phys' |
---|
| 854 | CALL diagedyn(ztit,2,1,1,dtphys |
---|
| 855 | e , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) |
---|
| 856 | ENDIF |
---|
[709] | 857 | |
---|
| 858 | cc$OMP MASTER |
---|
| 859 | c if (debug) then |
---|
| 860 | c call WriteField_p('ucovfi',reshape(ucov,(/iip1,jmp1,llm/))) |
---|
| 861 | c call WriteField_p('vcovfi',reshape(vcov,(/iip1,jjm,llm/))) |
---|
| 862 | c call WriteField_p('tetafi',reshape(teta,(/iip1,jmp1,llm/))) |
---|
| 863 | c endif |
---|
| 864 | cc$OMP END MASTER |
---|
| 865 | |
---|
[630] | 866 | #else |
---|
| 867 | |
---|
| 868 | c Calcul academique de la physique = Rappel Newtonien + fritcion |
---|
| 869 | c -------------------------------------------------------------- |
---|
| 870 | cym teta(:,:)=teta(:,:) |
---|
| 871 | cym s -iphysiq*dtvr*(teta(:,:)-tetarappel(:,:))/taurappel |
---|
| 872 | ijb=ij_begin |
---|
| 873 | ije=ij_end |
---|
| 874 | teta(ijb:ije,:)=teta(ijb:ije,:) |
---|
| 875 | s -iphysiq*dtvr*(teta(ijb:ije,:)-tetarappel(ijb:ije,:))/taurappel |
---|
| 876 | |
---|
| 877 | call Register_Hallo(ucov,ip1jmp1,llm,0,1,1,0,Request_Physic) |
---|
| 878 | call Register_Hallo(vcov,ip1jm,llm,1,1,1,1,Request_Physic) |
---|
| 879 | call SendRequest(Request_Physic) |
---|
| 880 | call WaitRequest(Request_Physic) |
---|
| 881 | |
---|
| 882 | call friction_p(ucov,vcov,iphysiq*dtvr) |
---|
| 883 | |
---|
| 884 | #endif |
---|
| 885 | |
---|
| 886 | c-jld |
---|
[709] | 887 | c$OMP MASTER |
---|
[630] | 888 | call resume_timer(timer_caldyn) |
---|
| 889 | if (FirstPhysic) then |
---|
| 890 | call InitTime |
---|
| 891 | FirstPhysic=.false. |
---|
| 892 | endif |
---|
[709] | 893 | c$OMP END MASTER |
---|
| 894 | c$OMP END PARALLEL |
---|
[630] | 895 | ENDIF |
---|
| 896 | |
---|
| 897 | CALL pression_p ( ip1jmp1, ap, bp, ps, p ) |
---|
| 898 | CALL exner_hyb_p( ip1jmp1, ps, p,alpha,beta, pks, pk, pkf ) |
---|
| 899 | |
---|
| 900 | |
---|
| 901 | c----------------------------------------------------------------------- |
---|
| 902 | c dissipation horizontale et verticale des petites echelles: |
---|
| 903 | c ---------------------------------------------------------- |
---|
| 904 | |
---|
| 905 | IF(apdiss) THEN |
---|
[709] | 906 | c$OMP PARALLEL DEFAULT(SHARED) |
---|
| 907 | c$OMP+ PRIVATE(ijb,ije,tppn,tpn,tpps,tps) |
---|
| 908 | c$OMP MASTER |
---|
[630] | 909 | call suspend_timer(timer_caldyn) |
---|
| 910 | |
---|
| 911 | print*,'Entree dans la dissipation : Iteration No ',true_itau |
---|
| 912 | c calcul de l'energie cinetique avant dissipation |
---|
| 913 | print *,'Passage dans la dissipation' |
---|
| 914 | |
---|
| 915 | call VTb(VThallo) |
---|
[709] | 916 | c$OMP END MASTER |
---|
[630] | 917 | |
---|
[709] | 918 | c$OMP BARRIER |
---|
| 919 | c$OMP MASTER |
---|
[630] | 920 | call Register_SwapFieldHallo(ucov,ucov,ip1jmp1,llm, |
---|
| 921 | * jj_Nb_dissip,1,1,Request_dissip) |
---|
| 922 | |
---|
| 923 | call Register_SwapFieldHallo(vcov,vcov,ip1jm,llm, |
---|
| 924 | * jj_Nb_dissip,1,1,Request_dissip) |
---|
| 925 | |
---|
| 926 | call Register_SwapField(teta,teta,ip1jmp1,llm, |
---|
| 927 | * jj_Nb_dissip,Request_dissip) |
---|
| 928 | |
---|
| 929 | call Register_SwapField(p,p,ip1jmp1,llmp1, |
---|
| 930 | * jj_Nb_dissip,Request_dissip) |
---|
| 931 | |
---|
| 932 | call Register_SwapField(pk,pk,ip1jmp1,llm, |
---|
| 933 | * jj_Nb_dissip,Request_dissip) |
---|
| 934 | |
---|
| 935 | call SendRequest(Request_dissip) |
---|
| 936 | call WaitRequest(Request_dissip) |
---|
| 937 | call SetDistrib(jj_Nb_dissip) |
---|
| 938 | |
---|
| 939 | call VTe(VThallo) |
---|
| 940 | |
---|
| 941 | call VTb(VTdissipation) |
---|
| 942 | |
---|
| 943 | call start_timer(timer_dissip) |
---|
[709] | 944 | c$OMP END MASTER |
---|
| 945 | c$OMP BARRIER |
---|
| 946 | |
---|
[630] | 947 | call covcont_p(llm,ucov,vcov,ucont,vcont) |
---|
| 948 | call enercin_p(vcov,ucov,vcont,ucont,ecin0) |
---|
| 949 | |
---|
| 950 | c dissipation |
---|
| 951 | |
---|
| 952 | CALL dissip_p(vcov,ucov,teta,p,dvdis,dudis,dtetadis) |
---|
[709] | 953 | |
---|
[630] | 954 | ijb=ij_begin |
---|
| 955 | ije=ij_end |
---|
[709] | 956 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 957 | DO l=1,llm |
---|
| 958 | ucov(ijb:ije,l)=ucov(ijb:ije,l)+dudis(ijb:ije,l) |
---|
| 959 | ENDDO |
---|
| 960 | c$OMP END DO NOWAIT |
---|
[630] | 961 | if (pole_sud) ije=ije-iip1 |
---|
[709] | 962 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 963 | DO l=1,llm |
---|
| 964 | vcov(ijb:ije,l)=vcov(ijb:ije,l)+dvdis(ijb:ije,l) |
---|
| 965 | ENDDO |
---|
| 966 | c$OMP END DO NOWAIT |
---|
| 967 | |
---|
[630] | 968 | c teta=teta+dtetadis |
---|
| 969 | |
---|
| 970 | |
---|
| 971 | c------------------------------------------------------------------------ |
---|
| 972 | if (dissip_conservative) then |
---|
| 973 | C On rajoute la tendance due a la transform. Ec -> E therm. cree |
---|
| 974 | C lors de la dissipation |
---|
[709] | 975 | c$OMP BARRIER |
---|
| 976 | c$OMP MASTER |
---|
[630] | 977 | call suspend_timer(timer_dissip) |
---|
| 978 | call VTb(VThallo) |
---|
| 979 | |
---|
| 980 | call Register_Hallo(ucov,ip1jmp1,llm,1,1,1,1,Request_Dissip) |
---|
| 981 | call Register_Hallo(vcov,ip1jm,llm,1,1,1,1,Request_Dissip) |
---|
| 982 | call SendRequest(Request_Dissip) |
---|
| 983 | call WaitRequest(Request_Dissip) |
---|
| 984 | call VTe(VThallo) |
---|
| 985 | call resume_timer(timer_dissip) |
---|
[709] | 986 | c$OMP END MASTER |
---|
| 987 | c$OMP BARRIER |
---|
[630] | 988 | call covcont_p(llm,ucov,vcov,ucont,vcont) |
---|
| 989 | call enercin_p(vcov,ucov,vcont,ucont,ecin) |
---|
| 990 | |
---|
| 991 | ijb=ij_begin |
---|
| 992 | ije=ij_end |
---|
[709] | 993 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 994 | do l=1,llm |
---|
| 995 | do ij=ijb,ije |
---|
| 996 | dtetaecdt(ij,l)= (ecin0(ij,l)-ecin(ij,l))/ pk(ij,l) |
---|
| 997 | dtetadis(ij,l)=dtetadis(ij,l)+dtetaecdt(ij,l) |
---|
| 998 | enddo |
---|
| 999 | enddo |
---|
[709] | 1000 | c$OMP END DO NOWAIT |
---|
[630] | 1001 | endif |
---|
| 1002 | |
---|
| 1003 | ijb=ij_begin |
---|
| 1004 | ije=ij_end |
---|
[709] | 1005 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 1006 | do l=1,llm |
---|
| 1007 | do ij=ijb,ije |
---|
| 1008 | teta(ij,l)=teta(ij,l)+dtetadis(ij,l) |
---|
| 1009 | enddo |
---|
| 1010 | enddo |
---|
[709] | 1011 | c$OMP END DO NOWAIT |
---|
[630] | 1012 | c------------------------------------------------------------------------ |
---|
| 1013 | |
---|
| 1014 | |
---|
| 1015 | c ....... P. Le Van ( ajout le 17/04/96 ) ........... |
---|
| 1016 | c ... Calcul de la valeur moyenne, unique de h aux poles ..... |
---|
| 1017 | c |
---|
| 1018 | |
---|
| 1019 | ijb=ij_begin |
---|
| 1020 | ije=ij_end |
---|
| 1021 | |
---|
| 1022 | if (pole_nord) then |
---|
[709] | 1023 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 1024 | DO l = 1, llm |
---|
| 1025 | DO ij = 1,iim |
---|
| 1026 | tppn(ij) = aire( ij ) * teta( ij ,l) |
---|
| 1027 | ENDDO |
---|
| 1028 | tpn = SSUM(iim,tppn,1)/apoln |
---|
| 1029 | |
---|
| 1030 | DO ij = 1, iip1 |
---|
| 1031 | teta( ij ,l) = tpn |
---|
| 1032 | ENDDO |
---|
| 1033 | ENDDO |
---|
[709] | 1034 | c$OMP END DO NOWAIT |
---|
| 1035 | |
---|
| 1036 | c$OMP MASTER |
---|
[630] | 1037 | DO ij = 1,iim |
---|
| 1038 | tppn(ij) = aire( ij ) * ps ( ij ) |
---|
| 1039 | ENDDO |
---|
| 1040 | tpn = SSUM(iim,tppn,1)/apoln |
---|
| 1041 | |
---|
| 1042 | DO ij = 1, iip1 |
---|
| 1043 | ps( ij ) = tpn |
---|
| 1044 | ENDDO |
---|
[709] | 1045 | c$OMP END MASTER |
---|
[630] | 1046 | endif |
---|
| 1047 | |
---|
| 1048 | if (pole_sud) then |
---|
[709] | 1049 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 1050 | DO l = 1, llm |
---|
| 1051 | DO ij = 1,iim |
---|
| 1052 | tpps(ij) = aire(ij+ip1jm) * teta(ij+ip1jm,l) |
---|
| 1053 | ENDDO |
---|
| 1054 | tps = SSUM(iim,tpps,1)/apols |
---|
| 1055 | |
---|
| 1056 | DO ij = 1, iip1 |
---|
| 1057 | teta(ij+ip1jm,l) = tps |
---|
| 1058 | ENDDO |
---|
| 1059 | ENDDO |
---|
[709] | 1060 | c$OMP END DO NOWAIT |
---|
| 1061 | |
---|
| 1062 | c$OMP MASTER |
---|
[630] | 1063 | DO ij = 1,iim |
---|
| 1064 | tpps(ij) = aire(ij+ip1jm) * ps (ij+ip1jm) |
---|
| 1065 | ENDDO |
---|
| 1066 | tps = SSUM(iim,tpps,1)/apols |
---|
| 1067 | |
---|
| 1068 | DO ij = 1, iip1 |
---|
| 1069 | ps(ij+ip1jm) = tps |
---|
| 1070 | ENDDO |
---|
[709] | 1071 | c$OMP END MASTER |
---|
[630] | 1072 | endif |
---|
| 1073 | |
---|
[709] | 1074 | |
---|
| 1075 | c$OMP BARRIER |
---|
| 1076 | c$OMP MASTER |
---|
[630] | 1077 | call VTe(VTdissipation) |
---|
| 1078 | |
---|
| 1079 | call stop_timer(timer_dissip) |
---|
| 1080 | |
---|
| 1081 | call VTb(VThallo) |
---|
| 1082 | |
---|
| 1083 | call Register_SwapField(ucov,ucov,ip1jmp1,llm, |
---|
| 1084 | * jj_Nb_caldyn,Request_dissip) |
---|
| 1085 | |
---|
| 1086 | call Register_SwapField(vcov,vcov,ip1jm,llm, |
---|
| 1087 | * jj_Nb_caldyn,Request_dissip) |
---|
| 1088 | |
---|
| 1089 | call Register_SwapField(teta,teta,ip1jmp1,llm, |
---|
| 1090 | * jj_Nb_caldyn,Request_dissip) |
---|
| 1091 | |
---|
| 1092 | call Register_SwapField(p,p,ip1jmp1,llmp1, |
---|
| 1093 | * jj_Nb_caldyn,Request_dissip) |
---|
| 1094 | |
---|
| 1095 | call Register_SwapField(pk,pk,ip1jmp1,llm, |
---|
| 1096 | * jj_Nb_caldyn,Request_dissip) |
---|
| 1097 | |
---|
| 1098 | call SendRequest(Request_dissip) |
---|
| 1099 | call WaitRequest(Request_dissip) |
---|
| 1100 | call SetDistrib(jj_Nb_caldyn) |
---|
| 1101 | call VTe(VThallo) |
---|
| 1102 | call resume_timer(timer_caldyn) |
---|
| 1103 | print *,'fin dissipation' |
---|
[709] | 1104 | c$OMP END MASTER |
---|
| 1105 | c$OMP END PARALLEL |
---|
[630] | 1106 | END IF |
---|
| 1107 | |
---|
| 1108 | c ajout debug |
---|
| 1109 | c IF( lafin ) then |
---|
| 1110 | c abort_message = 'Simulation finished' |
---|
| 1111 | c call abort_gcm(modname,abort_message,0) |
---|
| 1112 | c ENDIF |
---|
| 1113 | |
---|
| 1114 | c ******************************************************************** |
---|
| 1115 | c ******************************************************************** |
---|
| 1116 | c .... fin de l'integration dynamique et physique pour le pas itau .. |
---|
| 1117 | c ******************************************************************** |
---|
| 1118 | c ******************************************************************** |
---|
| 1119 | |
---|
| 1120 | c preparation du pas d'integration suivant ...... |
---|
| 1121 | cym call WriteField('ucov',reshape(ucov,(/iip1,jmp1,llm/))) |
---|
| 1122 | cym call WriteField('vcov',reshape(vcov,(/iip1,jjm,llm/))) |
---|
| 1123 | |
---|
| 1124 | call stop_timer(timer_caldyn) |
---|
| 1125 | IF (itau==itaumax) then |
---|
| 1126 | call allgather_timer_average |
---|
| 1127 | |
---|
| 1128 | if (mpi_rank==0) then |
---|
| 1129 | |
---|
| 1130 | print *,'*********************************' |
---|
| 1131 | print *,'****** TIMER CALDYN ******' |
---|
| 1132 | do i=0,mpi_size-1 |
---|
| 1133 | print *,'proc',i,' : Nb Bandes :',jj_nb_caldyn(i), |
---|
| 1134 | & ' : temps moyen :', |
---|
| 1135 | & timer_average(jj_nb_caldyn(i),timer_caldyn,i) |
---|
| 1136 | enddo |
---|
| 1137 | |
---|
| 1138 | print *,'*********************************' |
---|
| 1139 | print *,'****** TIMER VANLEER ******' |
---|
| 1140 | do i=0,mpi_size-1 |
---|
| 1141 | print *,'proc',i,' : Nb Bandes :',jj_nb_vanleer(i), |
---|
| 1142 | & ' : temps moyen :', |
---|
| 1143 | & timer_average(jj_nb_vanleer(i),timer_vanleer,i) |
---|
| 1144 | enddo |
---|
| 1145 | |
---|
| 1146 | print *,'*********************************' |
---|
| 1147 | print *,'****** TIMER DISSIP ******' |
---|
| 1148 | do i=0,mpi_size-1 |
---|
| 1149 | print *,'proc',i,' : Nb Bandes :',jj_nb_dissip(i), |
---|
| 1150 | & ' : temps moyen :', |
---|
| 1151 | & timer_average(jj_nb_dissip(i),timer_dissip,i) |
---|
| 1152 | enddo |
---|
| 1153 | |
---|
| 1154 | print *,'*********************************' |
---|
| 1155 | print *,'****** TIMER PHYSIC ******' |
---|
| 1156 | do i=0,mpi_size-1 |
---|
| 1157 | print *,'proc',i,' : Nb Bandes :',jj_nb_physic(i), |
---|
| 1158 | & ' : temps moyen :', |
---|
| 1159 | & timer_average(jj_nb_physic(i),timer_physic,i) |
---|
| 1160 | enddo |
---|
| 1161 | |
---|
| 1162 | endif |
---|
| 1163 | |
---|
| 1164 | print *,'Taille du Buffer MPI (REAL*8)',MaxBufferSize |
---|
| 1165 | print *,'Taille du Buffer MPI utilise (REAL*8)',MaxBufferSize_Used |
---|
| 1166 | print *, 'Temps total ecoule sur la parallelisation :',DiffTime() |
---|
| 1167 | print *, 'Temps CPU ecoule sur la parallelisation :',DiffCpuTime() |
---|
| 1168 | call finalize_parallel |
---|
| 1169 | STOP |
---|
| 1170 | ENDIF |
---|
| 1171 | |
---|
| 1172 | IF ( .NOT.purmats ) THEN |
---|
| 1173 | c ........................................................ |
---|
| 1174 | c .............. schema matsuno + leapfrog .............. |
---|
| 1175 | c ........................................................ |
---|
| 1176 | |
---|
| 1177 | IF(forward. OR. leapf) THEN |
---|
| 1178 | itau= itau + 1 |
---|
| 1179 | iday= day_ini+itau/day_step |
---|
| 1180 | time= FLOAT(itau-(iday-day_ini)*day_step)/day_step+time_0 |
---|
| 1181 | IF(time.GT.1.) THEN |
---|
| 1182 | time = time-1. |
---|
| 1183 | iday = iday+1 |
---|
| 1184 | ENDIF |
---|
| 1185 | ENDIF |
---|
| 1186 | |
---|
| 1187 | |
---|
| 1188 | IF( itau. EQ. itaufinp1 ) then |
---|
| 1189 | |
---|
[709] | 1190 | call finalize_parallel |
---|
[630] | 1191 | abort_message = 'Simulation finished' |
---|
| 1192 | call abort_gcm(modname,abort_message,0) |
---|
| 1193 | ENDIF |
---|
| 1194 | c----------------------------------------------------------------------- |
---|
| 1195 | c ecriture du fichier histoire moyenne: |
---|
| 1196 | c ------------------------------------- |
---|
| 1197 | |
---|
| 1198 | IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN |
---|
| 1199 | IF(itau.EQ.itaufin) THEN |
---|
| 1200 | iav=1 |
---|
| 1201 | ELSE |
---|
| 1202 | iav=0 |
---|
| 1203 | ENDIF |
---|
| 1204 | #ifdef CPP_IOIPSL |
---|
| 1205 | call Register_Hallo(vcov,ip1jm,llm,1,0,0,1,TestRequest) |
---|
| 1206 | call SendRequest(TestRequest) |
---|
| 1207 | call WaitRequest(TestRequest) |
---|
| 1208 | |
---|
| 1209 | CALL writedynav_p(histaveid, nqmx, itau,vcov , |
---|
| 1210 | , ucov,teta,pk,phi,q,masse,ps,phis) |
---|
| 1211 | c call bilan_dyn_p(2,dtvr*iperiod,dtvr*day_step*periodav, |
---|
| 1212 | c , ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) |
---|
| 1213 | #endif |
---|
| 1214 | |
---|
| 1215 | ENDIF |
---|
| 1216 | |
---|
| 1217 | c----------------------------------------------------------------------- |
---|
| 1218 | c ecriture de la bande histoire: |
---|
| 1219 | c ------------------------------ |
---|
| 1220 | |
---|
| 1221 | c IF( MOD(itau,iecri ).EQ.0) THEN |
---|
| 1222 | IF( MOD(itau,iecri*day_step).EQ.0) THEN |
---|
| 1223 | |
---|
| 1224 | nbetat = nbetatdem |
---|
| 1225 | CALL geopot_p ( ip1jmp1, teta , pk , pks, phis , phi ) |
---|
| 1226 | |
---|
| 1227 | cym unat=0. |
---|
| 1228 | |
---|
| 1229 | ijb=ij_begin |
---|
| 1230 | ije=ij_end |
---|
| 1231 | |
---|
| 1232 | if (pole_nord) then |
---|
| 1233 | ijb=ij_begin+iip1 |
---|
| 1234 | unat(1:iip1,:)=0. |
---|
| 1235 | endif |
---|
| 1236 | |
---|
| 1237 | if (pole_sud) then |
---|
| 1238 | ije=ij_end-iip1 |
---|
| 1239 | unat(ij_end-iip1+1:ij_end,:)=0. |
---|
| 1240 | endif |
---|
| 1241 | |
---|
| 1242 | do l=1,llm |
---|
| 1243 | unat(ijb:ije,l)=ucov(ijb:ije,l)/cu(ijb:ije) |
---|
| 1244 | enddo |
---|
| 1245 | |
---|
| 1246 | ijb=ij_begin |
---|
| 1247 | ije=ij_end |
---|
| 1248 | if (pole_sud) ije=ij_end-iip1 |
---|
| 1249 | |
---|
| 1250 | do l=1,llm |
---|
| 1251 | vnat(ijb:ije,l)=vcov(ijb:ije,l)/cv(ijb:ije) |
---|
| 1252 | enddo |
---|
| 1253 | |
---|
| 1254 | #ifdef CPP_IOIPSL |
---|
| 1255 | |
---|
| 1256 | CALL writehist_p(histid,histvid, nqmx,itau,vcov, |
---|
| 1257 | s ucov,teta,phi,q,masse,ps,phis) |
---|
| 1258 | c#else |
---|
| 1259 | c call Gather_Field(unat,ip1jmp1,llm,0) |
---|
| 1260 | c call Gather_Field(vnat,ip1jm,llm,0) |
---|
| 1261 | c call Gather_Field(teta,ip1jmp1,llm,0) |
---|
| 1262 | c call Gather_Field(ps,ip1jmp1,1,0) |
---|
| 1263 | c do iq=1,nqmx |
---|
| 1264 | c call Gather_Field(q(1,1,iq),ip1jmp1,llm,0) |
---|
| 1265 | c enddo |
---|
| 1266 | c |
---|
| 1267 | c if (mpi_rank==0) then |
---|
| 1268 | c#include "write_grads_dyn.h" |
---|
| 1269 | c endif |
---|
| 1270 | #endif |
---|
| 1271 | |
---|
| 1272 | ENDIF |
---|
| 1273 | |
---|
| 1274 | IF(itau.EQ.itaufin) THEN |
---|
| 1275 | |
---|
| 1276 | |
---|
[709] | 1277 | c#ifdef CPP_IOIPSL |
---|
[630] | 1278 | CALL dynredem1_p("restart.nc",0.0, |
---|
| 1279 | , vcov,ucov,teta,q,nqmx,masse,ps) |
---|
[709] | 1280 | c#endif |
---|
[630] | 1281 | |
---|
| 1282 | CLOSE(99) |
---|
| 1283 | ENDIF |
---|
| 1284 | |
---|
| 1285 | c----------------------------------------------------------------------- |
---|
| 1286 | c gestion de l'integration temporelle: |
---|
| 1287 | c ------------------------------------ |
---|
| 1288 | |
---|
| 1289 | IF( MOD(itau,iperiod).EQ.0 ) THEN |
---|
| 1290 | GO TO 1 |
---|
| 1291 | ELSE IF ( MOD(itau-1,iperiod). EQ. 0 ) THEN |
---|
| 1292 | |
---|
| 1293 | IF( forward ) THEN |
---|
| 1294 | c fin du pas forward et debut du pas backward |
---|
| 1295 | |
---|
| 1296 | forward = .FALSE. |
---|
| 1297 | leapf = .FALSE. |
---|
| 1298 | GO TO 2 |
---|
| 1299 | |
---|
| 1300 | ELSE |
---|
| 1301 | c fin du pas backward et debut du premier pas leapfrog |
---|
| 1302 | |
---|
| 1303 | leapf = .TRUE. |
---|
| 1304 | dt = 2.*dtvr |
---|
| 1305 | GO TO 2 |
---|
| 1306 | END IF |
---|
| 1307 | ELSE |
---|
| 1308 | |
---|
| 1309 | c ...... pas leapfrog ..... |
---|
| 1310 | |
---|
| 1311 | leapf = .TRUE. |
---|
| 1312 | dt = 2.*dtvr |
---|
| 1313 | GO TO 2 |
---|
| 1314 | END IF |
---|
| 1315 | |
---|
| 1316 | ELSE |
---|
| 1317 | |
---|
| 1318 | c ........................................................ |
---|
| 1319 | c .............. schema matsuno ............... |
---|
| 1320 | c ........................................................ |
---|
| 1321 | IF( forward ) THEN |
---|
| 1322 | |
---|
| 1323 | itau = itau + 1 |
---|
| 1324 | iday = day_ini+itau/day_step |
---|
| 1325 | time = FLOAT(itau-(iday-day_ini)*day_step)/day_step+time_0 |
---|
| 1326 | |
---|
| 1327 | IF(time.GT.1.) THEN |
---|
| 1328 | time = time-1. |
---|
| 1329 | iday = iday+1 |
---|
| 1330 | ENDIF |
---|
| 1331 | |
---|
| 1332 | forward = .FALSE. |
---|
| 1333 | IF( itau. EQ. itaufinp1 ) then |
---|
[709] | 1334 | call finalize_parallel |
---|
[630] | 1335 | abort_message = 'Simulation finished' |
---|
| 1336 | call abort_gcm(modname,abort_message,0) |
---|
| 1337 | ENDIF |
---|
| 1338 | GO TO 2 |
---|
| 1339 | |
---|
| 1340 | ELSE |
---|
| 1341 | |
---|
| 1342 | IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN |
---|
| 1343 | IF(itau.EQ.itaufin) THEN |
---|
| 1344 | iav=1 |
---|
| 1345 | ELSE |
---|
| 1346 | iav=0 |
---|
| 1347 | ENDIF |
---|
| 1348 | #ifdef CPP_IOIPSL |
---|
| 1349 | call Register_Hallo(vcov,ip1jm,llm,1,0,0,1,TestRequest) |
---|
| 1350 | call SendRequest(TestRequest) |
---|
| 1351 | call WaitRequest(TestRequest) |
---|
| 1352 | |
---|
| 1353 | CALL writedynav_p(histaveid, nqmx, itau,vcov , |
---|
| 1354 | , ucov,teta,pk,phi,q,masse,ps,phis) |
---|
| 1355 | c call bilan_dyn_p (2,dtvr*iperiod,dtvr*day_step*periodav, |
---|
| 1356 | c , ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) |
---|
| 1357 | #endif |
---|
| 1358 | |
---|
| 1359 | ENDIF |
---|
| 1360 | |
---|
| 1361 | c IF(MOD(itau,iecri ).EQ.0) THEN |
---|
| 1362 | IF(MOD(itau,iecri*day_step).EQ.0) THEN |
---|
| 1363 | nbetat = nbetatdem |
---|
| 1364 | CALL geopot_p( ip1jmp1, teta , pk , pks, phis , phi ) |
---|
| 1365 | |
---|
| 1366 | cym unat=0. |
---|
| 1367 | ijb=ij_begin |
---|
| 1368 | ije=ij_end |
---|
| 1369 | |
---|
| 1370 | if (pole_nord) then |
---|
| 1371 | ijb=ij_begin+iip1 |
---|
| 1372 | unat(1:iip1,:)=0. |
---|
| 1373 | endif |
---|
| 1374 | |
---|
| 1375 | if (pole_sud) then |
---|
| 1376 | ije=ij_end-iip1 |
---|
| 1377 | unat(ij_end-iip1+1:ij_end,:)=0. |
---|
| 1378 | endif |
---|
| 1379 | |
---|
| 1380 | do l=1,llm |
---|
| 1381 | unat(ijb:ije,l)=ucov(ijb:ije,l)/cu(ijb:ije) |
---|
| 1382 | enddo |
---|
| 1383 | |
---|
| 1384 | ijb=ij_begin |
---|
| 1385 | ije=ij_end |
---|
| 1386 | if (pole_sud) ije=ij_end-iip1 |
---|
| 1387 | |
---|
| 1388 | do l=1,llm |
---|
| 1389 | vnat(ijb:ije,l)=vcov(ijb:ije,l)/cv(ijb:ije) |
---|
| 1390 | enddo |
---|
| 1391 | |
---|
| 1392 | #ifdef CPP_IOIPSL |
---|
| 1393 | |
---|
| 1394 | CALL writehist_p( histid, histvid, nqmx, itau,vcov , |
---|
| 1395 | , ucov,teta,phi,q,masse,ps,phis) |
---|
| 1396 | c#else |
---|
| 1397 | c call Gather_Field(unat,ip1jmp1,llm,0) |
---|
| 1398 | c call Gather_Field(vnat,ip1jm,llm,0) |
---|
| 1399 | c call Gather_Field(teta,ip1jmp1,llm,0) |
---|
| 1400 | c call Gather_Field(ps,ip1jmp1,1,0) |
---|
| 1401 | c do iq=1,nqmx |
---|
| 1402 | c call Gather_Field(q(1,1,iq),ip1jmp1,llm,0) |
---|
| 1403 | c enddo |
---|
| 1404 | c |
---|
| 1405 | c if (mpi_rank==0) then |
---|
| 1406 | c#include "write_grads_dyn.h" |
---|
| 1407 | c endif |
---|
| 1408 | #endif |
---|
| 1409 | |
---|
| 1410 | |
---|
| 1411 | ENDIF |
---|
| 1412 | |
---|
[709] | 1413 | c#ifdef CPP_IOIPSL |
---|
[630] | 1414 | IF(itau.EQ.itaufin) |
---|
| 1415 | . CALL dynredem1_p("restart.nc",0.0, |
---|
| 1416 | . vcov,ucov,teta,q,nqmx,masse,ps) |
---|
[709] | 1417 | c#endif |
---|
[630] | 1418 | |
---|
| 1419 | forward = .TRUE. |
---|
| 1420 | GO TO 1 |
---|
| 1421 | |
---|
| 1422 | ENDIF |
---|
| 1423 | |
---|
| 1424 | END IF |
---|
| 1425 | |
---|
[709] | 1426 | call finalize_parallel |
---|
| 1427 | STOP |
---|
[630] | 1428 | END |
---|