[709] | 1 | ! |
---|
[630] | 2 | ! $Header$ |
---|
| 3 | ! |
---|
| 4 | c |
---|
| 5 | c |
---|
| 6 | #define IO_DEBUG |
---|
| 7 | |
---|
| 8 | #undef CPP_IOIPSL |
---|
| 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 |
---|
| 233 | call guide(itau,ucov,vcov,teta,q,masse,ps) |
---|
| 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 | |
---|
| 420 | call SetDistrib(jj_nb_caldyn) |
---|
| 421 | call SendRequest(TestRequest) |
---|
| 422 | call WaitRequest(TestRequest) |
---|
| 423 | |
---|
| 424 | c call SetDistrib(jj_Nb_vanleer) |
---|
| 425 | c call AdjustBands_vanleer |
---|
| 426 | c do j=1,nqmx |
---|
| 427 | c call Register_SwapFieldHallo(q(1,1,j),q(1,1,j),ip1jmp1,llm, |
---|
| 428 | c * jj_nb_vanleer,0,0,TestRequest) |
---|
| 429 | c enddo |
---|
| 430 | c |
---|
| 431 | c call Register_SwapFieldHallo(finvmaold,finvmaold,ip1jmp1,llm, |
---|
| 432 | c & jj_Nb_vanleer,0,0,TestRequest) |
---|
| 433 | |
---|
| 434 | c call SendRequest(TestRequest) |
---|
| 435 | c call WaitRequest(TestRequest) |
---|
| 436 | |
---|
| 437 | call AdjustBands_dissip |
---|
| 438 | call AdjustBands_physic |
---|
| 439 | c call SetDistrib(jj_nb_caldyn) |
---|
| 440 | endif |
---|
| 441 | |
---|
| 442 | endif |
---|
| 443 | |
---|
| 444 | |
---|
| 445 | |
---|
| 446 | c----------------------------------------------------------------------- |
---|
| 447 | c calcul des tendances dynamiques: |
---|
| 448 | c -------------------------------- |
---|
| 449 | |
---|
| 450 | call VTb(VThallo) |
---|
| 451 | call Register_Hallo(ucov,ip1jmp1,llm,1,1,1,1,TestRequest) |
---|
| 452 | call Register_Hallo(vcov,ip1jm,llm,1,1,1,1,TestRequest) |
---|
| 453 | call Register_Hallo(teta,ip1jmp1,llm,1,1,1,1,TestRequest) |
---|
| 454 | call Register_Hallo(ps,ip1jmp1,1,1,2,2,1,TestRequest) |
---|
| 455 | call Register_Hallo(pkf,ip1jmp1,llm,1,1,1,1,TestRequest) |
---|
| 456 | call Register_Hallo(pk,ip1jmp1,llm,1,1,1,1,TestRequest) |
---|
| 457 | call Register_Hallo(pks,ip1jmp1,1,1,1,1,1,TestRequest) |
---|
| 458 | call Register_Hallo(p,ip1jmp1,llmp1,1,1,1,1,TestRequest) |
---|
| 459 | |
---|
| 460 | c do j=1,nqmx |
---|
| 461 | c call Register_Hallo(q(1,1,j),ip1jmp1,llm,1,1,1,1, |
---|
| 462 | c * TestRequest) |
---|
| 463 | c enddo |
---|
| 464 | |
---|
| 465 | call SendRequest(TestRequest) |
---|
| 466 | call WaitRequest(TestRequest) |
---|
| 467 | call VTe(VThallo) |
---|
| 468 | |
---|
[709] | 469 | |
---|
[630] | 470 | if (debug) then |
---|
| 471 | call WriteField_p('ucov',reshape(ucov,(/iip1,jmp1,llm/))) |
---|
| 472 | call WriteField_p('vcov',reshape(vcov,(/iip1,jjm,llm/))) |
---|
| 473 | call WriteField_p('teta',reshape(teta,(/iip1,jmp1,llm/))) |
---|
| 474 | call WriteField_p('ps',reshape(ps,(/iip1,jmp1/))) |
---|
| 475 | call WriteField_p('masse',reshape(masse,(/iip1,jmp1,llm/))) |
---|
[734] | 476 | call WriteField_p('pk',reshape(pk,(/iip1,jmp1,llm/))) |
---|
[630] | 477 | call WriteField_p('pks',reshape(pks,(/iip1,jmp1/))) |
---|
| 478 | call WriteField_p('pkf',reshape(pkf,(/iip1,jmp1,llm/))) |
---|
| 479 | call WriteField_p('phis',reshape(phis,(/iip1,jmp1/))) |
---|
| 480 | c do j=1,nqmx |
---|
| 481 | c call WriteField_p('q'//trim(int2str(j)), |
---|
| 482 | c . reshape(q(:,:,j),(/iip1,jmp1,llm/))) |
---|
| 483 | c enddo |
---|
| 484 | endif |
---|
[709] | 485 | |
---|
[630] | 486 | |
---|
| 487 | |
---|
| 488 | True_itau=True_itau+1 |
---|
| 489 | print*,"Iteration No",True_itau |
---|
| 490 | |
---|
| 491 | |
---|
| 492 | call start_timer(timer_caldyn) |
---|
| 493 | |
---|
| 494 | CALL geopot_p ( ip1jmp1, teta , pk , pks, phis , phi ) |
---|
| 495 | |
---|
| 496 | |
---|
| 497 | call VTb(VTcaldyn) |
---|
[709] | 498 | |
---|
| 499 | var_time=time+iday-day_ini |
---|
| 500 | OMP_CHUNK=5 |
---|
| 501 | c$OMP PARALLEL DEFAULT(SHARED) |
---|
| 502 | cc$OMP+ SHARED(itau,ucov,vcov,teta,ps,masse,pk,pkf,phis , |
---|
| 503 | cc$OMP+ phi,conser,du,dv,dteta,dp,w, pbaru,pbarv, |
---|
| 504 | cc$OMP+ var_time) |
---|
| 505 | |
---|
[630] | 506 | CALL caldyn_p |
---|
| 507 | $ ( itau,ucov,vcov,teta,ps,masse,pk,pkf,phis , |
---|
| 508 | $ phi,conser,du,dv,dteta,dp,w, pbaru,pbarv, time+iday-day_ini ) |
---|
[709] | 509 | |
---|
| 510 | c$OMP END PARALLEL |
---|
[630] | 511 | call VTe(VTcaldyn) |
---|
| 512 | c call WriteField_p('du',reshape(du,(/iip1,jmp1,llm/))) |
---|
| 513 | c call WriteField_p('dv',reshape(dv,(/iip1,jjm,llm/))) |
---|
| 514 | c call WriteField_p('dteta',reshape(dteta,(/iip1,jmp1,llm/))) |
---|
| 515 | c call WriteField_p('dp',reshape(dp,(/iip1,jmp1/))) |
---|
| 516 | c call WriteField_p('w',reshape(w,(/iip1,jmp1,llm/))) |
---|
| 517 | c call WriteField_p('pbaru',reshape(pbaru,(/iip1,jmp1,llm/))) |
---|
| 518 | c call WriteField_p('pbarv',reshape(pbarv,(/iip1,jjm,llm/))) |
---|
| 519 | |
---|
| 520 | c----------------------------------------------------------------------- |
---|
| 521 | c calcul des tendances advection des traceurs (dont l'humidite) |
---|
| 522 | c ------------------------------------------------------------- |
---|
| 523 | |
---|
| 524 | IF( forward. OR . leapf ) THEN |
---|
[709] | 525 | c$OMP PARALLEL DEFAULT(SHARED) |
---|
[630] | 526 | c |
---|
[726] | 527 | #ifdef INCA |
---|
[630] | 528 | CALL caladvtrac_p(q,pbaru,pbarv, |
---|
| 529 | * p, masse, dq, teta, |
---|
| 530 | . flxw, |
---|
[726] | 531 | . pk, |
---|
| 532 | . iapptrac) |
---|
[630] | 533 | #else |
---|
| 534 | CALL caladvtrac_p(q,pbaru,pbarv, |
---|
| 535 | * p, masse, dq, teta, |
---|
| 536 | . pk,iapptrac) |
---|
| 537 | #endif |
---|
[709] | 538 | |
---|
| 539 | c$OMP END PARALLEL |
---|
| 540 | |
---|
[630] | 541 | c do j=1,nqmx |
---|
| 542 | c call WriteField_p('q'//trim(int2str(j)), |
---|
[709] | 543 | c . reshape(q(:,:,j),(/iip1,jmp1,llm/))) |
---|
[630] | 544 | c call WriteField_p('dq'//trim(int2str(j)), |
---|
| 545 | c . reshape(dq(:,:,j),(/iip1,jmp1,llm/))) |
---|
| 546 | c enddo |
---|
[709] | 547 | IF (offline) THEN |
---|
[630] | 548 | Cmaf stokage du flux de masse pour traceurs OFF-LINE |
---|
| 549 | |
---|
| 550 | #ifdef CPP_IOIPSL |
---|
| 551 | CALL fluxstokenc(pbaru,pbarv,masse,teta,phi,phis, |
---|
| 552 | . dtvr, itau) |
---|
| 553 | #endif |
---|
| 554 | |
---|
| 555 | |
---|
| 556 | ENDIF |
---|
| 557 | c |
---|
| 558 | ENDIF |
---|
| 559 | |
---|
| 560 | |
---|
| 561 | c----------------------------------------------------------------------- |
---|
| 562 | c integrations dynamique et traceurs: |
---|
| 563 | c ---------------------------------- |
---|
| 564 | |
---|
| 565 | call VTb(VTintegre) |
---|
[709] | 566 | c call WriteField_p('ucovm1',reshape(ucovm1,(/iip1,jmp1,llm/))) |
---|
| 567 | c call WriteField_p('vcovm1',reshape(vcovm1,(/iip1,jjm,llm/))) |
---|
| 568 | c call WriteField_p('tetam1',reshape(tetam1,(/iip1,jmp1,llm/))) |
---|
| 569 | c call WriteField_p('psm1',reshape(psm1,(/iip1,jmp1/))) |
---|
| 570 | c call WriteField_p('ucov',reshape(ucov,(/iip1,jmp1,llm/))) |
---|
| 571 | c call WriteField_p('vcov',reshape(vcov,(/iip1,jjm,llm/))) |
---|
| 572 | c call WriteField_p('teta',reshape(teta,(/iip1,jmp1,llm/))) |
---|
| 573 | c call WriteField_p('ps',reshape(ps,(/iip1,jmp1/))) |
---|
| 574 | c$OMP PARALLEL DEFAULT(SHARED) |
---|
[630] | 575 | CALL integrd_p ( 2,vcovm1,ucovm1,tetam1,psm1,massem1 , |
---|
| 576 | $ dv,du,dteta,dq,dp,vcov,ucov,teta,q,ps,masse,phis , |
---|
| 577 | $ finvmaold ) |
---|
| 578 | |
---|
[709] | 579 | c$OMP END PARALLEL |
---|
| 580 | c call WriteField_p('ucovm1',reshape(ucovm1,(/iip1,jmp1,llm/))) |
---|
| 581 | c call WriteField_p('vcovm1',reshape(vcovm1,(/iip1,jjm,llm/))) |
---|
| 582 | c call WriteField_p('tetam1',reshape(tetam1,(/iip1,jmp1,llm/))) |
---|
| 583 | c call WriteField_p('psm1',reshape(psm1,(/iip1,jmp1/))) |
---|
| 584 | c call WriteField_p('ucov',reshape(ucov,(/iip1,jmp1,llm/))) |
---|
| 585 | c call WriteField_p('vcov',reshape(vcov,(/iip1,jjm,llm/))) |
---|
| 586 | c call WriteField_p('teta',reshape(teta,(/iip1,jmp1,llm/))) |
---|
| 587 | c call WriteField_p('dteta',reshape(dteta,(/iip1,jmp1,llm/))) |
---|
| 588 | |
---|
| 589 | c call WriteField_p('ps',reshape(ps,(/iip1,jmp1/))) |
---|
| 590 | |
---|
[630] | 591 | call VTe(VTintegre) |
---|
[709] | 592 | |
---|
[630] | 593 | c .P.Le Van (26/04/94 ajout de finvpold dans l'appel d'integrd) |
---|
| 594 | c |
---|
| 595 | c----------------------------------------------------------------------- |
---|
| 596 | c calcul des tendances physiques: |
---|
| 597 | c ------------------------------- |
---|
| 598 | c ######## P.Le Van ( Modif le 6/02/95 ) ########### |
---|
| 599 | c |
---|
| 600 | IF( purmats ) THEN |
---|
| 601 | IF( itau.EQ.itaufin.AND..NOT.forward ) lafin = .TRUE. |
---|
| 602 | ELSE |
---|
| 603 | IF( itau+1. EQ. itaufin ) lafin = .TRUE. |
---|
| 604 | ENDIF |
---|
| 605 | c |
---|
| 606 | c |
---|
| 607 | IF( apphys ) THEN |
---|
| 608 | c |
---|
| 609 | c ....... Ajout P.Le Van ( 17/04/96 ) ........... |
---|
| 610 | c |
---|
[709] | 611 | c$OMP PARALLEL DEFAULT(SHARED) |
---|
| 612 | c$OMP+ PRIVATE(rdaym_ini,rdayvrai,ijb,ije) |
---|
| 613 | |
---|
| 614 | c$OMP MASTER |
---|
[630] | 615 | call suspend_timer(timer_caldyn) |
---|
| 616 | print*,'Entree dans la physique : Iteration No ',true_itau |
---|
[709] | 617 | c$OMP END MASTER |
---|
| 618 | |
---|
[630] | 619 | CALL pression_p ( ip1jmp1, ap, bp, ps, p ) |
---|
[734] | 620 | c$OMP BARRIER |
---|
| 621 | |
---|
| 622 | c$OMP MASTER |
---|
[630] | 623 | CALL exner_hyb_p( ip1jmp1, ps, p,alpha,beta,pks, pk, pkf ) |
---|
[734] | 624 | c$OMP END MASTER |
---|
| 625 | c$OMP BARRIER |
---|
[630] | 626 | rdaym_ini = itau * dtvr / daysec |
---|
| 627 | rdayvrai = rdaym_ini + day_ini |
---|
| 628 | |
---|
| 629 | |
---|
| 630 | c rajout debug |
---|
| 631 | c lafin = .true. |
---|
| 632 | |
---|
| 633 | |
---|
| 634 | c Inbterface avec les routines de phylmd (phymars ... ) |
---|
| 635 | c ----------------------------------------------------- |
---|
| 636 | |
---|
| 637 | #ifdef CPP_PHYS |
---|
| 638 | c+jld |
---|
| 639 | |
---|
[734] | 640 | c Diagnostique de conservation de l'energie : initialisation |
---|
[630] | 641 | IF (ip_ebil_dyn.ge.1 ) THEN |
---|
| 642 | ztit='bil dyn' |
---|
| 643 | CALL diagedyn(ztit,2,1,1,dtphys |
---|
| 644 | e , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) |
---|
| 645 | ENDIF |
---|
| 646 | c-jld |
---|
[709] | 647 | c$OMP BARRIER |
---|
| 648 | c$OMP MASTER |
---|
[630] | 649 | call VTb(VThallo) |
---|
| 650 | call SetTag(Request_physic,800) |
---|
| 651 | |
---|
| 652 | call Register_SwapFieldHallo(ucov,ucov,ip1jmp1,llm, |
---|
| 653 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 654 | |
---|
| 655 | call Register_SwapFieldHallo(vcov,vcov,ip1jm,llm, |
---|
| 656 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 657 | |
---|
| 658 | call Register_SwapFieldHallo(teta,teta,ip1jmp1,llm, |
---|
| 659 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 660 | |
---|
| 661 | call Register_SwapFieldHallo(p,p,ip1jmp1,llmp1, |
---|
| 662 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 663 | |
---|
| 664 | call Register_SwapFieldHallo(pk,pk,ip1jmp1,llm, |
---|
| 665 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 666 | |
---|
| 667 | call Register_SwapFieldHallo(phis,phis,ip1jmp1,1, |
---|
| 668 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 669 | |
---|
| 670 | call Register_SwapFieldHallo(phi,phi,ip1jmp1,llm, |
---|
| 671 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 672 | |
---|
| 673 | call Register_SwapFieldHallo(w,w,ip1jmp1,llm, |
---|
| 674 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 675 | |
---|
| 676 | c call SetDistrib(jj_nb_vanleer) |
---|
| 677 | do j=1,nqmx |
---|
| 678 | |
---|
| 679 | call Register_SwapFieldHallo(q(1,1,j),q(1,1,j),ip1jmp1,llm, |
---|
| 680 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 681 | enddo |
---|
[726] | 682 | #ifdef INCA |
---|
[630] | 683 | call Register_SwapFieldHallo(flxw,flxw,ip1jmp1,llm, |
---|
| 684 | * jj_Nb_physic,2,2,Request_physic) |
---|
| 685 | #endif |
---|
| 686 | call SetDistrib(jj_nb_Physic) |
---|
| 687 | |
---|
| 688 | call SendRequest(Request_Physic) |
---|
| 689 | call WaitRequest(Request_Physic) |
---|
| 690 | |
---|
| 691 | call VTe(VThallo) |
---|
| 692 | |
---|
| 693 | call VTb(VTphysiq) |
---|
[709] | 694 | c$OMP END MASTER |
---|
| 695 | c$OMP BARRIER |
---|
[734] | 696 | |
---|
| 697 | cc$OMP MASTER |
---|
| 698 | c call WriteField_p('ucovfi',reshape(ucov,(/iip1,jmp1,llm/))) |
---|
| 699 | c call WriteField_p('vcovfi',reshape(vcov,(/iip1,jjm,llm/))) |
---|
| 700 | c call WriteField_p('tetafi',reshape(teta,(/iip1,jmp1,llm/))) |
---|
| 701 | c call WriteField_p('pfi',reshape(p,(/iip1,jmp1,llmp1/))) |
---|
| 702 | c call WriteField_p('pkfi',reshape(pk,(/iip1,jmp1,llm/))) |
---|
| 703 | cc$OMP END MASTER |
---|
| 704 | cc$OMP BARRIER |
---|
[709] | 705 | |
---|
[630] | 706 | CALL calfis_p( nq, lafin ,rdayvrai,time , |
---|
| 707 | $ ucov,vcov,teta,q,masse,ps,p,pk,phis,phi , |
---|
| 708 | $ du,dv,dteta,dq,w, |
---|
[726] | 709 | #ifdef INCA |
---|
[630] | 710 | $ flxw, |
---|
| 711 | #endif |
---|
| 712 | $ clesphy0, dufi,dvfi,dtetafi,dqfi,dpfi ) |
---|
| 713 | ijb=ij_begin |
---|
| 714 | ije=ij_end |
---|
| 715 | if ( .not. pole_nord) then |
---|
[709] | 716 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 717 | DO l=1,llm |
---|
| 718 | dufi_tmp(1:iip1,l) = dufi(ijb:ijb+iim,l) |
---|
| 719 | dvfi_tmp(1:iip1,l) = dvfi(ijb:ijb+iim,l) |
---|
| 720 | dtetafi_tmp(1:iip1,l)= dtetafi(ijb:ijb+iim,l) |
---|
| 721 | dqfi_tmp(1:iip1,l,:) = dqfi(ijb:ijb+iim,l,:) |
---|
| 722 | ENDDO |
---|
| 723 | c$OMP END DO NOWAIT |
---|
| 724 | |
---|
| 725 | c$OMP MASTER |
---|
[630] | 726 | dpfi_tmp(1:iip1) = dpfi(ijb:ijb+iim) |
---|
[709] | 727 | c$OMP END MASTER |
---|
| 728 | endif |
---|
| 729 | |
---|
| 730 | c$OMP BARRIER |
---|
| 731 | c$OMP MASTER |
---|
[630] | 732 | call SetDistrib(jj_nb_Physic_bis) |
---|
| 733 | |
---|
| 734 | call VTb(VThallo) |
---|
| 735 | |
---|
| 736 | call Register_Hallo(dufi,ip1jmp1,llm, |
---|
| 737 | * 1,0,0,1,Request_physic) |
---|
| 738 | |
---|
| 739 | call Register_Hallo(dvfi,ip1jm,llm, |
---|
| 740 | * 1,0,0,1,Request_physic) |
---|
| 741 | |
---|
| 742 | call Register_Hallo(dtetafi,ip1jmp1,llm, |
---|
| 743 | * 1,0,0,1,Request_physic) |
---|
| 744 | |
---|
| 745 | call Register_Hallo(dpfi,ip1jmp1,1, |
---|
| 746 | * 1,0,0,1,Request_physic) |
---|
| 747 | |
---|
| 748 | do j=1,nqmx |
---|
| 749 | call Register_Hallo(dqfi(1,1,j),ip1jmp1,llm, |
---|
| 750 | * 1,0,0,1,Request_physic) |
---|
| 751 | enddo |
---|
| 752 | |
---|
| 753 | call SendRequest(Request_Physic) |
---|
| 754 | call WaitRequest(Request_Physic) |
---|
| 755 | |
---|
| 756 | call VTe(VThallo) |
---|
| 757 | |
---|
| 758 | call SetDistrib(jj_nb_Physic) |
---|
[709] | 759 | c$OMP END MASTER |
---|
| 760 | c$OMP BARRIER |
---|
[630] | 761 | ijb=ij_begin |
---|
| 762 | if (.not. pole_nord) then |
---|
[709] | 763 | |
---|
| 764 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 765 | DO l=1,llm |
---|
| 766 | dufi(ijb:ijb+iim,l) = dufi(ijb:ijb+iim,l)+dufi_tmp(1:iip1,l) |
---|
| 767 | dvfi(ijb:ijb+iim,l) = dvfi(ijb:ijb+iim,l)+dvfi_tmp(1:iip1,l) |
---|
| 768 | dtetafi(ijb:ijb+iim,l) = dtetafi(ijb:ijb+iim,l) |
---|
| 769 | & +dtetafi_tmp(1:iip1,l) |
---|
| 770 | dqfi(ijb:ijb+iim,l,:) = dqfi(ijb:ijb+iim,l,:) |
---|
| 771 | & + dqfi_tmp(1:iip1,l,:) |
---|
| 772 | ENDDO |
---|
| 773 | c$OMP END DO NOWAIT |
---|
| 774 | |
---|
| 775 | c$OMP MASTER |
---|
[630] | 776 | dpfi(ijb:ijb+iim) = dpfi(ijb:ijb+iim)+ dpfi_tmp(1:iip1) |
---|
[709] | 777 | c$OMP END MASTER |
---|
| 778 | |
---|
[630] | 779 | endif |
---|
[709] | 780 | c$OMP BARRIER |
---|
| 781 | cc$OMP MASTER |
---|
[630] | 782 | c call WriteField_p('dufi',reshape(dufi,(/iip1,jmp1,llm/))) |
---|
| 783 | c call WriteField_p('dvfi',reshape(dvfi,(/iip1,jjm,llm/))) |
---|
| 784 | c call WriteField_p('dtetafi',reshape(dtetafi,(/iip1,jmp1,llm/))) |
---|
| 785 | c call WriteField_p('dpfi',reshape(dpfi,(/iip1,jmp1/))) |
---|
[709] | 786 | cc$OMP END MASTER |
---|
[630] | 787 | c |
---|
| 788 | c do j=1,nqmx |
---|
| 789 | c call WriteField_p('dqfi'//trim(int2str(j)), |
---|
| 790 | c . reshape(dqfi(:,:,j),(/iip1,jmp1,llm/))) |
---|
| 791 | c enddo |
---|
| 792 | |
---|
| 793 | c ajout des tendances physiques: |
---|
| 794 | c ------------------------------ |
---|
| 795 | CALL addfi_p( nqmx, dtphys, leapf, forward , |
---|
| 796 | $ ucov, vcov, teta , q ,ps , |
---|
| 797 | $ dufi, dvfi, dtetafi , dqfi ,dpfi ) |
---|
| 798 | |
---|
[709] | 799 | c$OMP BARRIER |
---|
| 800 | c$OMP MASTER |
---|
[630] | 801 | call VTe(VTphysiq) |
---|
| 802 | |
---|
| 803 | call VTb(VThallo) |
---|
| 804 | |
---|
| 805 | call SetTag(Request_physic,800) |
---|
| 806 | call Register_SwapField(ucov,ucov,ip1jmp1,llm, |
---|
| 807 | * jj_Nb_caldyn,Request_physic) |
---|
| 808 | |
---|
| 809 | call Register_SwapField(vcov,vcov,ip1jm,llm, |
---|
| 810 | * jj_Nb_caldyn,Request_physic) |
---|
| 811 | |
---|
| 812 | call Register_SwapField(teta,teta,ip1jmp1,llm, |
---|
| 813 | * jj_Nb_caldyn,Request_physic) |
---|
| 814 | |
---|
| 815 | call Register_SwapField(p,p,ip1jmp1,llmp1, |
---|
| 816 | * jj_Nb_caldyn,Request_physic) |
---|
| 817 | |
---|
| 818 | call Register_SwapField(pk,pk,ip1jmp1,llm, |
---|
| 819 | * jj_Nb_caldyn,Request_physic) |
---|
| 820 | |
---|
| 821 | call Register_SwapField(phis,phis,ip1jmp1,1, |
---|
| 822 | * jj_Nb_caldyn,Request_physic) |
---|
| 823 | |
---|
| 824 | call Register_SwapField(phi,phi,ip1jmp1,llm, |
---|
| 825 | * jj_Nb_caldyn,Request_physic) |
---|
| 826 | |
---|
| 827 | call Register_SwapField(w,w,ip1jmp1,llm, |
---|
| 828 | * jj_Nb_caldyn,Request_physic) |
---|
| 829 | |
---|
| 830 | do j=1,nqmx |
---|
| 831 | |
---|
| 832 | call Register_SwapField(q(1,1,j),q(1,1,j),ip1jmp1,llm, |
---|
| 833 | * jj_Nb_caldyn,Request_physic) |
---|
| 834 | |
---|
| 835 | enddo |
---|
| 836 | |
---|
| 837 | call SendRequest(Request_Physic) |
---|
| 838 | call WaitRequest(Request_Physic) |
---|
| 839 | |
---|
| 840 | call VTe(VThallo) |
---|
| 841 | |
---|
| 842 | call SetDistrib(jj_Nb_caldyn) |
---|
[709] | 843 | c$OMP END MASTER |
---|
| 844 | c$OMP BARRIER |
---|
[630] | 845 | c |
---|
[734] | 846 | c Diagnostique de conservation de l'energie : difference |
---|
[630] | 847 | IF (ip_ebil_dyn.ge.1 ) THEN |
---|
| 848 | ztit='bil phys' |
---|
| 849 | CALL diagedyn(ztit,2,1,1,dtphys |
---|
| 850 | e , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) |
---|
| 851 | ENDIF |
---|
[709] | 852 | |
---|
| 853 | cc$OMP MASTER |
---|
| 854 | c if (debug) then |
---|
| 855 | c call WriteField_p('ucovfi',reshape(ucov,(/iip1,jmp1,llm/))) |
---|
| 856 | c call WriteField_p('vcovfi',reshape(vcov,(/iip1,jjm,llm/))) |
---|
| 857 | c call WriteField_p('tetafi',reshape(teta,(/iip1,jmp1,llm/))) |
---|
| 858 | c endif |
---|
| 859 | cc$OMP END MASTER |
---|
| 860 | |
---|
[630] | 861 | #else |
---|
| 862 | |
---|
| 863 | c Calcul academique de la physique = Rappel Newtonien + fritcion |
---|
| 864 | c -------------------------------------------------------------- |
---|
| 865 | cym teta(:,:)=teta(:,:) |
---|
| 866 | cym s -iphysiq*dtvr*(teta(:,:)-tetarappel(:,:))/taurappel |
---|
| 867 | ijb=ij_begin |
---|
| 868 | ije=ij_end |
---|
| 869 | teta(ijb:ije,:)=teta(ijb:ije,:) |
---|
| 870 | s -iphysiq*dtvr*(teta(ijb:ije,:)-tetarappel(ijb:ije,:))/taurappel |
---|
| 871 | |
---|
| 872 | call Register_Hallo(ucov,ip1jmp1,llm,0,1,1,0,Request_Physic) |
---|
| 873 | call Register_Hallo(vcov,ip1jm,llm,1,1,1,1,Request_Physic) |
---|
| 874 | call SendRequest(Request_Physic) |
---|
| 875 | call WaitRequest(Request_Physic) |
---|
| 876 | |
---|
| 877 | call friction_p(ucov,vcov,iphysiq*dtvr) |
---|
| 878 | |
---|
| 879 | #endif |
---|
| 880 | |
---|
| 881 | c-jld |
---|
[709] | 882 | c$OMP MASTER |
---|
[630] | 883 | call resume_timer(timer_caldyn) |
---|
| 884 | if (FirstPhysic) then |
---|
| 885 | call InitTime |
---|
| 886 | FirstPhysic=.false. |
---|
| 887 | endif |
---|
[709] | 888 | c$OMP END MASTER |
---|
| 889 | c$OMP END PARALLEL |
---|
[630] | 890 | ENDIF |
---|
| 891 | |
---|
| 892 | CALL pression_p ( ip1jmp1, ap, bp, ps, p ) |
---|
| 893 | CALL exner_hyb_p( ip1jmp1, ps, p,alpha,beta, pks, pk, pkf ) |
---|
| 894 | |
---|
| 895 | |
---|
| 896 | c----------------------------------------------------------------------- |
---|
| 897 | c dissipation horizontale et verticale des petites echelles: |
---|
| 898 | c ---------------------------------------------------------- |
---|
| 899 | |
---|
| 900 | IF(apdiss) THEN |
---|
[709] | 901 | c$OMP PARALLEL DEFAULT(SHARED) |
---|
| 902 | c$OMP+ PRIVATE(ijb,ije,tppn,tpn,tpps,tps) |
---|
| 903 | c$OMP MASTER |
---|
[630] | 904 | call suspend_timer(timer_caldyn) |
---|
| 905 | |
---|
| 906 | print*,'Entree dans la dissipation : Iteration No ',true_itau |
---|
| 907 | c calcul de l'energie cinetique avant dissipation |
---|
| 908 | print *,'Passage dans la dissipation' |
---|
| 909 | |
---|
| 910 | call VTb(VThallo) |
---|
[709] | 911 | c$OMP END MASTER |
---|
[630] | 912 | |
---|
[709] | 913 | c$OMP BARRIER |
---|
| 914 | c$OMP MASTER |
---|
[630] | 915 | call Register_SwapFieldHallo(ucov,ucov,ip1jmp1,llm, |
---|
| 916 | * jj_Nb_dissip,1,1,Request_dissip) |
---|
| 917 | |
---|
| 918 | call Register_SwapFieldHallo(vcov,vcov,ip1jm,llm, |
---|
| 919 | * jj_Nb_dissip,1,1,Request_dissip) |
---|
| 920 | |
---|
| 921 | call Register_SwapField(teta,teta,ip1jmp1,llm, |
---|
| 922 | * jj_Nb_dissip,Request_dissip) |
---|
| 923 | |
---|
| 924 | call Register_SwapField(p,p,ip1jmp1,llmp1, |
---|
| 925 | * jj_Nb_dissip,Request_dissip) |
---|
| 926 | |
---|
| 927 | call Register_SwapField(pk,pk,ip1jmp1,llm, |
---|
| 928 | * jj_Nb_dissip,Request_dissip) |
---|
| 929 | |
---|
| 930 | call SendRequest(Request_dissip) |
---|
| 931 | call WaitRequest(Request_dissip) |
---|
| 932 | call SetDistrib(jj_Nb_dissip) |
---|
| 933 | |
---|
| 934 | call VTe(VThallo) |
---|
| 935 | |
---|
| 936 | call VTb(VTdissipation) |
---|
| 937 | |
---|
| 938 | call start_timer(timer_dissip) |
---|
[709] | 939 | c$OMP END MASTER |
---|
| 940 | c$OMP BARRIER |
---|
| 941 | |
---|
[630] | 942 | call covcont_p(llm,ucov,vcov,ucont,vcont) |
---|
| 943 | call enercin_p(vcov,ucov,vcont,ucont,ecin0) |
---|
| 944 | |
---|
| 945 | c dissipation |
---|
| 946 | |
---|
| 947 | CALL dissip_p(vcov,ucov,teta,p,dvdis,dudis,dtetadis) |
---|
[709] | 948 | |
---|
[630] | 949 | ijb=ij_begin |
---|
| 950 | ije=ij_end |
---|
[709] | 951 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 952 | DO l=1,llm |
---|
| 953 | ucov(ijb:ije,l)=ucov(ijb:ije,l)+dudis(ijb:ije,l) |
---|
| 954 | ENDDO |
---|
| 955 | c$OMP END DO NOWAIT |
---|
[630] | 956 | if (pole_sud) ije=ije-iip1 |
---|
[709] | 957 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 958 | DO l=1,llm |
---|
| 959 | vcov(ijb:ije,l)=vcov(ijb:ije,l)+dvdis(ijb:ije,l) |
---|
| 960 | ENDDO |
---|
| 961 | c$OMP END DO NOWAIT |
---|
| 962 | |
---|
[630] | 963 | c teta=teta+dtetadis |
---|
| 964 | |
---|
| 965 | |
---|
| 966 | c------------------------------------------------------------------------ |
---|
| 967 | if (dissip_conservative) then |
---|
| 968 | C On rajoute la tendance due a la transform. Ec -> E therm. cree |
---|
| 969 | C lors de la dissipation |
---|
[709] | 970 | c$OMP BARRIER |
---|
| 971 | c$OMP MASTER |
---|
[630] | 972 | call suspend_timer(timer_dissip) |
---|
| 973 | call VTb(VThallo) |
---|
| 974 | |
---|
| 975 | call Register_Hallo(ucov,ip1jmp1,llm,1,1,1,1,Request_Dissip) |
---|
| 976 | call Register_Hallo(vcov,ip1jm,llm,1,1,1,1,Request_Dissip) |
---|
| 977 | call SendRequest(Request_Dissip) |
---|
| 978 | call WaitRequest(Request_Dissip) |
---|
| 979 | call VTe(VThallo) |
---|
| 980 | call resume_timer(timer_dissip) |
---|
[709] | 981 | c$OMP END MASTER |
---|
| 982 | c$OMP BARRIER |
---|
[630] | 983 | call covcont_p(llm,ucov,vcov,ucont,vcont) |
---|
| 984 | call enercin_p(vcov,ucov,vcont,ucont,ecin) |
---|
| 985 | |
---|
| 986 | ijb=ij_begin |
---|
| 987 | ije=ij_end |
---|
[709] | 988 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 989 | do l=1,llm |
---|
| 990 | do ij=ijb,ije |
---|
| 991 | dtetaecdt(ij,l)= (ecin0(ij,l)-ecin(ij,l))/ pk(ij,l) |
---|
| 992 | dtetadis(ij,l)=dtetadis(ij,l)+dtetaecdt(ij,l) |
---|
| 993 | enddo |
---|
| 994 | enddo |
---|
[709] | 995 | c$OMP END DO NOWAIT |
---|
[630] | 996 | endif |
---|
| 997 | |
---|
| 998 | ijb=ij_begin |
---|
| 999 | ije=ij_end |
---|
[709] | 1000 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 1001 | do l=1,llm |
---|
| 1002 | do ij=ijb,ije |
---|
| 1003 | teta(ij,l)=teta(ij,l)+dtetadis(ij,l) |
---|
| 1004 | enddo |
---|
| 1005 | enddo |
---|
[709] | 1006 | c$OMP END DO NOWAIT |
---|
[630] | 1007 | c------------------------------------------------------------------------ |
---|
| 1008 | |
---|
| 1009 | |
---|
| 1010 | c ....... P. Le Van ( ajout le 17/04/96 ) ........... |
---|
| 1011 | c ... Calcul de la valeur moyenne, unique de h aux poles ..... |
---|
| 1012 | c |
---|
| 1013 | |
---|
| 1014 | ijb=ij_begin |
---|
| 1015 | ije=ij_end |
---|
| 1016 | |
---|
| 1017 | if (pole_nord) then |
---|
[709] | 1018 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 1019 | DO l = 1, llm |
---|
| 1020 | DO ij = 1,iim |
---|
| 1021 | tppn(ij) = aire( ij ) * teta( ij ,l) |
---|
| 1022 | ENDDO |
---|
| 1023 | tpn = SSUM(iim,tppn,1)/apoln |
---|
| 1024 | |
---|
| 1025 | DO ij = 1, iip1 |
---|
| 1026 | teta( ij ,l) = tpn |
---|
| 1027 | ENDDO |
---|
| 1028 | ENDDO |
---|
[709] | 1029 | c$OMP END DO NOWAIT |
---|
| 1030 | |
---|
| 1031 | c$OMP MASTER |
---|
[630] | 1032 | DO ij = 1,iim |
---|
| 1033 | tppn(ij) = aire( ij ) * ps ( ij ) |
---|
| 1034 | ENDDO |
---|
| 1035 | tpn = SSUM(iim,tppn,1)/apoln |
---|
| 1036 | |
---|
| 1037 | DO ij = 1, iip1 |
---|
| 1038 | ps( ij ) = tpn |
---|
| 1039 | ENDDO |
---|
[709] | 1040 | c$OMP END MASTER |
---|
[630] | 1041 | endif |
---|
| 1042 | |
---|
| 1043 | if (pole_sud) then |
---|
[709] | 1044 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[630] | 1045 | DO l = 1, llm |
---|
| 1046 | DO ij = 1,iim |
---|
| 1047 | tpps(ij) = aire(ij+ip1jm) * teta(ij+ip1jm,l) |
---|
| 1048 | ENDDO |
---|
| 1049 | tps = SSUM(iim,tpps,1)/apols |
---|
| 1050 | |
---|
| 1051 | DO ij = 1, iip1 |
---|
| 1052 | teta(ij+ip1jm,l) = tps |
---|
| 1053 | ENDDO |
---|
| 1054 | ENDDO |
---|
[709] | 1055 | c$OMP END DO NOWAIT |
---|
| 1056 | |
---|
| 1057 | c$OMP MASTER |
---|
[630] | 1058 | DO ij = 1,iim |
---|
| 1059 | tpps(ij) = aire(ij+ip1jm) * ps (ij+ip1jm) |
---|
| 1060 | ENDDO |
---|
| 1061 | tps = SSUM(iim,tpps,1)/apols |
---|
| 1062 | |
---|
| 1063 | DO ij = 1, iip1 |
---|
| 1064 | ps(ij+ip1jm) = tps |
---|
| 1065 | ENDDO |
---|
[709] | 1066 | c$OMP END MASTER |
---|
[630] | 1067 | endif |
---|
| 1068 | |
---|
[709] | 1069 | |
---|
| 1070 | c$OMP BARRIER |
---|
| 1071 | c$OMP MASTER |
---|
[630] | 1072 | call VTe(VTdissipation) |
---|
| 1073 | |
---|
| 1074 | call stop_timer(timer_dissip) |
---|
| 1075 | |
---|
| 1076 | call VTb(VThallo) |
---|
| 1077 | |
---|
| 1078 | call Register_SwapField(ucov,ucov,ip1jmp1,llm, |
---|
| 1079 | * jj_Nb_caldyn,Request_dissip) |
---|
| 1080 | |
---|
| 1081 | call Register_SwapField(vcov,vcov,ip1jm,llm, |
---|
| 1082 | * jj_Nb_caldyn,Request_dissip) |
---|
| 1083 | |
---|
| 1084 | call Register_SwapField(teta,teta,ip1jmp1,llm, |
---|
| 1085 | * jj_Nb_caldyn,Request_dissip) |
---|
| 1086 | |
---|
| 1087 | call Register_SwapField(p,p,ip1jmp1,llmp1, |
---|
| 1088 | * jj_Nb_caldyn,Request_dissip) |
---|
| 1089 | |
---|
| 1090 | call Register_SwapField(pk,pk,ip1jmp1,llm, |
---|
| 1091 | * jj_Nb_caldyn,Request_dissip) |
---|
| 1092 | |
---|
| 1093 | call SendRequest(Request_dissip) |
---|
| 1094 | call WaitRequest(Request_dissip) |
---|
| 1095 | call SetDistrib(jj_Nb_caldyn) |
---|
| 1096 | call VTe(VThallo) |
---|
| 1097 | call resume_timer(timer_caldyn) |
---|
| 1098 | print *,'fin dissipation' |
---|
[709] | 1099 | c$OMP END MASTER |
---|
| 1100 | c$OMP END PARALLEL |
---|
[630] | 1101 | END IF |
---|
| 1102 | |
---|
| 1103 | c ajout debug |
---|
| 1104 | c IF( lafin ) then |
---|
| 1105 | c abort_message = 'Simulation finished' |
---|
| 1106 | c call abort_gcm(modname,abort_message,0) |
---|
| 1107 | c ENDIF |
---|
| 1108 | |
---|
| 1109 | c ******************************************************************** |
---|
| 1110 | c ******************************************************************** |
---|
| 1111 | c .... fin de l'integration dynamique et physique pour le pas itau .. |
---|
| 1112 | c ******************************************************************** |
---|
| 1113 | c ******************************************************************** |
---|
| 1114 | |
---|
| 1115 | c preparation du pas d'integration suivant ...... |
---|
| 1116 | cym call WriteField('ucov',reshape(ucov,(/iip1,jmp1,llm/))) |
---|
| 1117 | cym call WriteField('vcov',reshape(vcov,(/iip1,jjm,llm/))) |
---|
| 1118 | |
---|
| 1119 | call stop_timer(timer_caldyn) |
---|
| 1120 | IF (itau==itaumax) then |
---|
| 1121 | call allgather_timer_average |
---|
| 1122 | |
---|
| 1123 | if (mpi_rank==0) then |
---|
| 1124 | |
---|
| 1125 | print *,'*********************************' |
---|
| 1126 | print *,'****** TIMER CALDYN ******' |
---|
| 1127 | do i=0,mpi_size-1 |
---|
| 1128 | print *,'proc',i,' : Nb Bandes :',jj_nb_caldyn(i), |
---|
| 1129 | & ' : temps moyen :', |
---|
| 1130 | & timer_average(jj_nb_caldyn(i),timer_caldyn,i) |
---|
| 1131 | enddo |
---|
| 1132 | |
---|
| 1133 | print *,'*********************************' |
---|
| 1134 | print *,'****** TIMER VANLEER ******' |
---|
| 1135 | do i=0,mpi_size-1 |
---|
| 1136 | print *,'proc',i,' : Nb Bandes :',jj_nb_vanleer(i), |
---|
| 1137 | & ' : temps moyen :', |
---|
| 1138 | & timer_average(jj_nb_vanleer(i),timer_vanleer,i) |
---|
| 1139 | enddo |
---|
| 1140 | |
---|
| 1141 | print *,'*********************************' |
---|
| 1142 | print *,'****** TIMER DISSIP ******' |
---|
| 1143 | do i=0,mpi_size-1 |
---|
| 1144 | print *,'proc',i,' : Nb Bandes :',jj_nb_dissip(i), |
---|
| 1145 | & ' : temps moyen :', |
---|
| 1146 | & timer_average(jj_nb_dissip(i),timer_dissip,i) |
---|
| 1147 | enddo |
---|
| 1148 | |
---|
| 1149 | print *,'*********************************' |
---|
| 1150 | print *,'****** TIMER PHYSIC ******' |
---|
| 1151 | do i=0,mpi_size-1 |
---|
| 1152 | print *,'proc',i,' : Nb Bandes :',jj_nb_physic(i), |
---|
| 1153 | & ' : temps moyen :', |
---|
| 1154 | & timer_average(jj_nb_physic(i),timer_physic,i) |
---|
| 1155 | enddo |
---|
| 1156 | |
---|
| 1157 | endif |
---|
| 1158 | |
---|
| 1159 | print *,'Taille du Buffer MPI (REAL*8)',MaxBufferSize |
---|
| 1160 | print *,'Taille du Buffer MPI utilise (REAL*8)',MaxBufferSize_Used |
---|
| 1161 | print *, 'Temps total ecoule sur la parallelisation :',DiffTime() |
---|
| 1162 | print *, 'Temps CPU ecoule sur la parallelisation :',DiffCpuTime() |
---|
| 1163 | call finalize_parallel |
---|
| 1164 | STOP |
---|
| 1165 | ENDIF |
---|
| 1166 | |
---|
| 1167 | IF ( .NOT.purmats ) THEN |
---|
| 1168 | c ........................................................ |
---|
| 1169 | c .............. schema matsuno + leapfrog .............. |
---|
| 1170 | c ........................................................ |
---|
| 1171 | |
---|
| 1172 | IF(forward. OR. leapf) THEN |
---|
| 1173 | itau= itau + 1 |
---|
| 1174 | iday= day_ini+itau/day_step |
---|
| 1175 | time= FLOAT(itau-(iday-day_ini)*day_step)/day_step+time_0 |
---|
| 1176 | IF(time.GT.1.) THEN |
---|
| 1177 | time = time-1. |
---|
| 1178 | iday = iday+1 |
---|
| 1179 | ENDIF |
---|
| 1180 | ENDIF |
---|
| 1181 | |
---|
| 1182 | |
---|
| 1183 | IF( itau. EQ. itaufinp1 ) then |
---|
| 1184 | |
---|
[709] | 1185 | call finalize_parallel |
---|
[630] | 1186 | abort_message = 'Simulation finished' |
---|
| 1187 | call abort_gcm(modname,abort_message,0) |
---|
| 1188 | ENDIF |
---|
| 1189 | c----------------------------------------------------------------------- |
---|
| 1190 | c ecriture du fichier histoire moyenne: |
---|
| 1191 | c ------------------------------------- |
---|
| 1192 | |
---|
| 1193 | IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN |
---|
| 1194 | IF(itau.EQ.itaufin) THEN |
---|
| 1195 | iav=1 |
---|
| 1196 | ELSE |
---|
| 1197 | iav=0 |
---|
| 1198 | ENDIF |
---|
| 1199 | #ifdef CPP_IOIPSL |
---|
| 1200 | call Register_Hallo(vcov,ip1jm,llm,1,0,0,1,TestRequest) |
---|
| 1201 | call SendRequest(TestRequest) |
---|
| 1202 | call WaitRequest(TestRequest) |
---|
| 1203 | |
---|
| 1204 | CALL writedynav_p(histaveid, nqmx, itau,vcov , |
---|
| 1205 | , ucov,teta,pk,phi,q,masse,ps,phis) |
---|
| 1206 | c call bilan_dyn_p(2,dtvr*iperiod,dtvr*day_step*periodav, |
---|
| 1207 | c , ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) |
---|
| 1208 | #endif |
---|
| 1209 | |
---|
| 1210 | ENDIF |
---|
| 1211 | |
---|
| 1212 | c----------------------------------------------------------------------- |
---|
| 1213 | c ecriture de la bande histoire: |
---|
| 1214 | c ------------------------------ |
---|
| 1215 | |
---|
| 1216 | c IF( MOD(itau,iecri ).EQ.0) THEN |
---|
| 1217 | IF( MOD(itau,iecri*day_step).EQ.0) THEN |
---|
| 1218 | |
---|
| 1219 | nbetat = nbetatdem |
---|
| 1220 | CALL geopot_p ( ip1jmp1, teta , pk , pks, phis , phi ) |
---|
| 1221 | |
---|
| 1222 | cym unat=0. |
---|
| 1223 | |
---|
| 1224 | ijb=ij_begin |
---|
| 1225 | ije=ij_end |
---|
| 1226 | |
---|
| 1227 | if (pole_nord) then |
---|
| 1228 | ijb=ij_begin+iip1 |
---|
| 1229 | unat(1:iip1,:)=0. |
---|
| 1230 | endif |
---|
| 1231 | |
---|
| 1232 | if (pole_sud) then |
---|
| 1233 | ije=ij_end-iip1 |
---|
| 1234 | unat(ij_end-iip1+1:ij_end,:)=0. |
---|
| 1235 | endif |
---|
| 1236 | |
---|
| 1237 | do l=1,llm |
---|
| 1238 | unat(ijb:ije,l)=ucov(ijb:ije,l)/cu(ijb:ije) |
---|
| 1239 | enddo |
---|
| 1240 | |
---|
| 1241 | ijb=ij_begin |
---|
| 1242 | ije=ij_end |
---|
| 1243 | if (pole_sud) ije=ij_end-iip1 |
---|
| 1244 | |
---|
| 1245 | do l=1,llm |
---|
| 1246 | vnat(ijb:ije,l)=vcov(ijb:ije,l)/cv(ijb:ije) |
---|
| 1247 | enddo |
---|
| 1248 | |
---|
| 1249 | #ifdef CPP_IOIPSL |
---|
| 1250 | |
---|
| 1251 | CALL writehist_p(histid,histvid, nqmx,itau,vcov, |
---|
| 1252 | s ucov,teta,phi,q,masse,ps,phis) |
---|
| 1253 | c#else |
---|
| 1254 | c call Gather_Field(unat,ip1jmp1,llm,0) |
---|
| 1255 | c call Gather_Field(vnat,ip1jm,llm,0) |
---|
| 1256 | c call Gather_Field(teta,ip1jmp1,llm,0) |
---|
| 1257 | c call Gather_Field(ps,ip1jmp1,1,0) |
---|
| 1258 | c do iq=1,nqmx |
---|
| 1259 | c call Gather_Field(q(1,1,iq),ip1jmp1,llm,0) |
---|
| 1260 | c enddo |
---|
| 1261 | c |
---|
| 1262 | c if (mpi_rank==0) then |
---|
| 1263 | c#include "write_grads_dyn.h" |
---|
| 1264 | c endif |
---|
| 1265 | #endif |
---|
| 1266 | |
---|
| 1267 | ENDIF |
---|
| 1268 | |
---|
| 1269 | IF(itau.EQ.itaufin) THEN |
---|
| 1270 | |
---|
| 1271 | |
---|
[709] | 1272 | c#ifdef CPP_IOIPSL |
---|
[630] | 1273 | CALL dynredem1_p("restart.nc",0.0, |
---|
| 1274 | , vcov,ucov,teta,q,nqmx,masse,ps) |
---|
[709] | 1275 | c#endif |
---|
[630] | 1276 | |
---|
| 1277 | CLOSE(99) |
---|
| 1278 | ENDIF |
---|
| 1279 | |
---|
| 1280 | c----------------------------------------------------------------------- |
---|
| 1281 | c gestion de l'integration temporelle: |
---|
| 1282 | c ------------------------------------ |
---|
| 1283 | |
---|
| 1284 | IF( MOD(itau,iperiod).EQ.0 ) THEN |
---|
| 1285 | GO TO 1 |
---|
| 1286 | ELSE IF ( MOD(itau-1,iperiod). EQ. 0 ) THEN |
---|
| 1287 | |
---|
| 1288 | IF( forward ) THEN |
---|
| 1289 | c fin du pas forward et debut du pas backward |
---|
| 1290 | |
---|
| 1291 | forward = .FALSE. |
---|
| 1292 | leapf = .FALSE. |
---|
| 1293 | GO TO 2 |
---|
| 1294 | |
---|
| 1295 | ELSE |
---|
| 1296 | c fin du pas backward et debut du premier pas leapfrog |
---|
| 1297 | |
---|
| 1298 | leapf = .TRUE. |
---|
| 1299 | dt = 2.*dtvr |
---|
| 1300 | GO TO 2 |
---|
| 1301 | END IF |
---|
| 1302 | ELSE |
---|
| 1303 | |
---|
| 1304 | c ...... pas leapfrog ..... |
---|
| 1305 | |
---|
| 1306 | leapf = .TRUE. |
---|
| 1307 | dt = 2.*dtvr |
---|
| 1308 | GO TO 2 |
---|
| 1309 | END IF |
---|
| 1310 | |
---|
| 1311 | ELSE |
---|
| 1312 | |
---|
| 1313 | c ........................................................ |
---|
| 1314 | c .............. schema matsuno ............... |
---|
| 1315 | c ........................................................ |
---|
| 1316 | IF( forward ) THEN |
---|
| 1317 | |
---|
| 1318 | itau = itau + 1 |
---|
| 1319 | iday = day_ini+itau/day_step |
---|
| 1320 | time = FLOAT(itau-(iday-day_ini)*day_step)/day_step+time_0 |
---|
| 1321 | |
---|
| 1322 | IF(time.GT.1.) THEN |
---|
| 1323 | time = time-1. |
---|
| 1324 | iday = iday+1 |
---|
| 1325 | ENDIF |
---|
| 1326 | |
---|
| 1327 | forward = .FALSE. |
---|
| 1328 | IF( itau. EQ. itaufinp1 ) then |
---|
[709] | 1329 | call finalize_parallel |
---|
[630] | 1330 | abort_message = 'Simulation finished' |
---|
| 1331 | call abort_gcm(modname,abort_message,0) |
---|
| 1332 | ENDIF |
---|
| 1333 | GO TO 2 |
---|
| 1334 | |
---|
| 1335 | ELSE |
---|
| 1336 | |
---|
| 1337 | IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN |
---|
| 1338 | IF(itau.EQ.itaufin) THEN |
---|
| 1339 | iav=1 |
---|
| 1340 | ELSE |
---|
| 1341 | iav=0 |
---|
| 1342 | ENDIF |
---|
| 1343 | #ifdef CPP_IOIPSL |
---|
| 1344 | call Register_Hallo(vcov,ip1jm,llm,1,0,0,1,TestRequest) |
---|
| 1345 | call SendRequest(TestRequest) |
---|
| 1346 | call WaitRequest(TestRequest) |
---|
| 1347 | |
---|
| 1348 | CALL writedynav_p(histaveid, nqmx, itau,vcov , |
---|
| 1349 | , ucov,teta,pk,phi,q,masse,ps,phis) |
---|
| 1350 | c call bilan_dyn_p (2,dtvr*iperiod,dtvr*day_step*periodav, |
---|
| 1351 | c , ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) |
---|
| 1352 | #endif |
---|
| 1353 | |
---|
| 1354 | ENDIF |
---|
| 1355 | |
---|
| 1356 | c IF(MOD(itau,iecri ).EQ.0) THEN |
---|
| 1357 | IF(MOD(itau,iecri*day_step).EQ.0) THEN |
---|
| 1358 | nbetat = nbetatdem |
---|
| 1359 | CALL geopot_p( ip1jmp1, teta , pk , pks, phis , phi ) |
---|
| 1360 | |
---|
| 1361 | cym unat=0. |
---|
| 1362 | ijb=ij_begin |
---|
| 1363 | ije=ij_end |
---|
| 1364 | |
---|
| 1365 | if (pole_nord) then |
---|
| 1366 | ijb=ij_begin+iip1 |
---|
| 1367 | unat(1:iip1,:)=0. |
---|
| 1368 | endif |
---|
| 1369 | |
---|
| 1370 | if (pole_sud) then |
---|
| 1371 | ije=ij_end-iip1 |
---|
| 1372 | unat(ij_end-iip1+1:ij_end,:)=0. |
---|
| 1373 | endif |
---|
| 1374 | |
---|
| 1375 | do l=1,llm |
---|
| 1376 | unat(ijb:ije,l)=ucov(ijb:ije,l)/cu(ijb:ije) |
---|
| 1377 | enddo |
---|
| 1378 | |
---|
| 1379 | ijb=ij_begin |
---|
| 1380 | ije=ij_end |
---|
| 1381 | if (pole_sud) ije=ij_end-iip1 |
---|
| 1382 | |
---|
| 1383 | do l=1,llm |
---|
| 1384 | vnat(ijb:ije,l)=vcov(ijb:ije,l)/cv(ijb:ije) |
---|
| 1385 | enddo |
---|
| 1386 | |
---|
| 1387 | #ifdef CPP_IOIPSL |
---|
| 1388 | |
---|
| 1389 | CALL writehist_p( histid, histvid, nqmx, itau,vcov , |
---|
| 1390 | , ucov,teta,phi,q,masse,ps,phis) |
---|
| 1391 | c#else |
---|
| 1392 | c call Gather_Field(unat,ip1jmp1,llm,0) |
---|
| 1393 | c call Gather_Field(vnat,ip1jm,llm,0) |
---|
| 1394 | c call Gather_Field(teta,ip1jmp1,llm,0) |
---|
| 1395 | c call Gather_Field(ps,ip1jmp1,1,0) |
---|
| 1396 | c do iq=1,nqmx |
---|
| 1397 | c call Gather_Field(q(1,1,iq),ip1jmp1,llm,0) |
---|
| 1398 | c enddo |
---|
| 1399 | c |
---|
| 1400 | c if (mpi_rank==0) then |
---|
| 1401 | c#include "write_grads_dyn.h" |
---|
| 1402 | c endif |
---|
| 1403 | #endif |
---|
| 1404 | |
---|
| 1405 | |
---|
| 1406 | ENDIF |
---|
| 1407 | |
---|
[709] | 1408 | c#ifdef CPP_IOIPSL |
---|
[630] | 1409 | IF(itau.EQ.itaufin) |
---|
| 1410 | . CALL dynredem1_p("restart.nc",0.0, |
---|
| 1411 | . vcov,ucov,teta,q,nqmx,masse,ps) |
---|
[709] | 1412 | c#endif |
---|
[630] | 1413 | |
---|
| 1414 | forward = .TRUE. |
---|
| 1415 | GO TO 1 |
---|
| 1416 | |
---|
| 1417 | ENDIF |
---|
| 1418 | |
---|
| 1419 | END IF |
---|
| 1420 | |
---|
[709] | 1421 | call finalize_parallel |
---|
| 1422 | STOP |
---|
[630] | 1423 | END |
---|