Changeset 1056 for trunk/LMDZ.COMMON/libf
- Timestamp:
- Oct 7, 2013, 6:42:03 PM (11 years ago)
- Location:
- trunk/LMDZ.COMMON/libf
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/dyn3d/calfis.F
r1017 r1056 31 31 USE infotrac 32 32 USE control_mod 33 USE write_field 33 34 USE cpdet_mod, only: t2tpot,tpot2t 35 36 ! used only for zonal averages 37 USE moyzon_mod 34 38 35 39 IMPLICIT NONE … … 90 94 #include "paramet.h" 91 95 #include "temps.h" 96 #include "logic.h" 92 97 93 98 INTEGER ngridmx … … 111 116 REAL pphis(iip1,jjp1) 112 117 REAL pphi(iip1,jjp1,llm) 113 c 118 114 119 REAL pdvcov(iip1,jjm,llm) 115 120 REAL pducov(iip1,jjp1,llm) … … 119 124 ! ecrite, et que j'ai donc commente.... 120 125 REAL pdq(iip1,jjp1,llm,nqtot) 121 c 126 122 127 REAL pps(iip1,jjp1) 123 128 REAL pp(iip1,jjp1,llmp1) 124 129 REAL ppk(iip1,jjp1,llm) 125 c 130 126 131 c TENDENCIES in */s 127 132 REAL pdvfi(iip1,jjm,llm) … … 139 144 REAL zplev(ngridmx,llm+1),zplay(ngridmx,llm) 140 145 REAL zphi(ngridmx,llm),zphis(ngridmx) 141 c 146 142 147 REAL zufi(ngridmx,llm), zvfi(ngridmx,llm) 143 148 REAL ztfi(ngridmx,llm),zqfi(ngridmx,llm,nqtot) … … 145 150 REAL zteta(ngridmx,llm) 146 151 REAL zpk(ngridmx,llm) 147 c 152 148 153 ! RQ SL 13/10/10: 149 154 ! Ces calculs ne servent pas. … … 151 156 ! REAL pcvgu(ngridmx,llm), pcvgv(ngridmx,llm) 152 157 ! REAL pcvgt(ngridmx,llm), pcvgq(ngridmx,llm,2) 153 c 158 154 159 REAL zdufi(ngridmx,llm),zdvfi(ngridmx,llm) 155 160 REAL zdtfi(ngridmx,llm),zdqfi(ngridmx,llm,nqtot) 156 161 REAL zdpsrf(ngridmx) 157 c 162 158 163 REAL zdufic(ngridmx,llm),zdvfic(ngridmx,llm) 159 164 REAL zdtfic(ngridmx,llm),zdqfic(ngridmx,llm,nqtot) … … 165 170 REAL zsinbis(iim),zcosbis(iim),z1bis(iim) 166 171 REAL unskap, pksurcp 167 c 172 save unskap 173 168 174 cIM diagnostique PVteta, Amip2 169 175 INTEGER ntetaSTD … … 172 178 DATA rtetaSTD/350., 380., 405./ ! Earth-specific values, beware !! 173 179 REAL PVteta(ngridmx,ntetaSTD) 174 c 180 175 181 REAL flxw(iip1,jjp1,llm) ! Flux de masse verticale sur la grille dynamique 176 182 REAL flxwfi(ngridmx,llm) ! Flux de masse verticale sur la grille physiq 177 c178 183 179 184 REAL SSUM … … 186 191 187 192 LOGICAL tracerdyn ! for generic/mars physics call ; possibly to get rid of 188 c 193 194 ! For Titan only right now: 195 ! to allow for 2D computation of microphys and chemistry 196 LOGICAL,save :: flag_moyzon 197 REAL,dimension(iip1,llm) :: tmpvar 198 REAL,dimension(iip1,llmp1) :: tmpvarp1 199 REAL,dimension(llm) :: tmpvarbar 200 REAL,dimension(llmp1) :: tmpvarbarp1 201 189 202 c----------------------------------------------------------------------- 190 c 203 191 204 c 1. Initialisations : 192 205 c -------------------- 193 c 194 c 206 207 195 208 IF ( firstcal ) THEN 196 209 debut = .TRUE. … … 203 216 STOP 204 217 ENDIF 218 219 unskap = 1./ kappa 220 221 flag_moyzon = .false. 222 if(moyzon_ch.or.moyzon_mu) then 223 flag_moyzon = .true. 224 endif 225 if (flag_moyzon) call moyzon_init 226 227 c---------------------------------------------- 228 c moyennes globales pour le profil de pression 229 ALLOCATE(plevmoy(llm+1)) 230 ALLOCATE(playmoy(llm)) 231 ALLOCATE(tmoy(llm)) 232 ALLOCATE(tetamoy(llm)) 233 ALLOCATE(pkmoy(llm)) 234 plevmoy=0. 235 do l=1,llmp1 236 do i=1,iip1 237 do j=1,jjp1 238 plevmoy(l)=plevmoy(l)+pp(i,j,l)/(iip1*jjp1) 239 enddo 240 enddo 241 enddo 242 tetamoy=0. 243 pkmoy=0. 244 do l=1,llm 245 do i=1,iip1 246 do j=1,jjp1 247 tetamoy(l)=tetamoy(l)+pteta(i,j,l)/(iip1*jjp1) 248 pkmoy(l)=pkmoy(l)+ppk(i,j,l)/(iip1*jjp1) 249 enddo 250 enddo 251 enddo 252 playmoy = preff * (pkmoy/cpp) ** unskap 253 call tpot2t(llm,tetamoy,tmoy,pkmoy) 254 c---------------------------------------------- 255 c + lat index 256 allocate(klat(ngridmx)) 257 klat=0 258 klat(1) = 1 259 ig0 = 2 260 DO j = 2,jjm 261 do i=0,iim-1 262 klat(ig0+i) = j 263 enddo 264 ig0 = ig0+iim 265 ENDDO 266 klat(ngridmx) = jjp1 267 c---------------------------------------------- 205 268 ELSE 206 269 debut = .FALSE. 207 270 ENDIF ! of IF (firstcal) 208 271 209 c 210 c 272 211 273 c----------------------------------------------------------------------- 212 274 c 40. transformation des variables dynamiques en variables physiques: … … 215 277 c 41. pressions au sol (en Pascals) 216 278 c ---------------------------------- 217 218 279 219 280 zpsrf(1) = pps(1,1) … … 227 288 zpsrf(ngridmx) = pps(1,jjp1) 228 289 229 230 290 c 42. pression intercouches et fonction d'Exner: 231 c 291 232 292 c ----------------------------------------------------------------- 233 293 c .... zplev definis aux (llm +1) interfaces des couches .... … … 236 296 237 297 c ... Exner = cp * ( p(l) / preff ) ** kappa .... 238 c 239 unskap = 1./ kappa 240 c 298 241 299 ! ADAPTATION GCM POUR CP(T) 242 300 DO l = 1, llm … … 266 324 ENDDO 267 325 zplev( ngridmx,llmp1 ) = pp(1,jjp1,llmp1) 268 c 269 c 326 327 if (flag_moyzon) then 328 tmpvarp1(:,:) = pp(:,1,:) 329 call moyzon(llmp1,tmpvarp1,tmpvarbarp1) 330 zplevbar(1,:) = tmpvarbarp1 331 tmpvar(:,:) = ppk(:,1,:) 332 call moyzon(llm,tmpvar,tmpvarbar) 333 zpkbar(1,:) = tmpvarbar 334 tmpvar(:,:) = pteta(:,1,:) 335 call moyzon(llm,tmpvar,tmpvarbar) 336 ztetabar(1,:) = tmpvarbar 337 call tpot2t(llm,ztetabar(1,:),ztfibar(1,:),zpkbar(1,:)) 338 ig0 = 2 339 do j = 2, jjm 340 tmpvarp1(:,:) = pp(:,j,:) 341 call moyzon(llmp1,tmpvarp1,tmpvarbarp1) 342 zplevbar(ig0,:) = tmpvarbarp1 343 tmpvar(:,:) = ppk(:,j,:) 344 call moyzon(llm,tmpvar,tmpvarbar) 345 zpkbar(ig0,:) = tmpvarbar 346 tmpvar(:,:) = pteta(:,j,:) 347 call moyzon(llm,tmpvar,tmpvarbar) 348 ztetabar(ig0,:) = tmpvarbar 349 call tpot2t(llm,ztetabar(ig0,:),ztfibar(ig0,:),zpkbar(ig0,:)) 350 ig0 = ig0+1 351 do i=2,iim 352 zplevbar(ig0,:) = zplevbar(ig0-1,:) 353 zpkbar(ig0,:) = zpkbar(ig0-1,:) 354 ztetabar(ig0,:) = ztetabar(ig0-1,:) 355 ztfibar(ig0,:) = ztfibar(ig0-1,:) 356 ig0 = ig0+1 357 enddo 358 enddo 359 tmpvarp1(:,:) = pp(:,jjp1,:) 360 call moyzon(llmp1,tmpvarp1,tmpvarbarp1) 361 zplevbar(ngridmx,:) = tmpvarbarp1 362 tmpvar(:,:) = ppk(:,jjp1,:) 363 call moyzon(llm,tmpvar,tmpvarbar) 364 zpkbar(ngridmx,:) = tmpvarbar 365 tmpvar(:,:) = pteta(:,jjp1,:) 366 call moyzon(llm,tmpvar,tmpvarbar) 367 ztetabar(ngridmx,:) = tmpvarbar 368 call tpot2t(llm,ztetabar(ngridmx,:), 369 . ztfibar(ngridmx,:),zpkbar(ngridmx,:)) 370 endif 270 371 271 372 c 43. temperature naturelle (en K) et pressions milieux couches . … … 297 398 ENDDO 298 399 400 if (flag_moyzon) then 401 zplaybar(:,:) = preff * (zpkbar(:,:)/cpp)**unskap 402 endif 403 299 404 c 43.bis traceurs (tous intensifs) 300 405 c --------------- 301 c 406 302 407 DO iq=1,nqtot 303 iiq=niadv(iq)304 408 DO l=1,llm 305 zqfi(1,l,iq) = pq(1,1,l,i iq)409 zqfi(1,l,iq) = pq(1,1,l,iq) 306 410 ig0 = 2 307 411 DO j=2,jjm 308 412 DO i = 1, iim 309 zqfi(ig0,l,iq) = pq(i,j,l,i iq)413 zqfi(ig0,l,iq) = pq(i,j,l,iq) 310 414 ig0 = ig0 + 1 311 415 ENDDO 312 416 ENDDO 313 zqfi(ig0,l,iq) = pq(1,jjp1,l,i iq)417 zqfi(ig0,l,iq) = pq(1,jjp1,l,iq) 314 418 ENDDO 315 419 ENDDO ! boucle sur traceurs 420 421 if (flag_moyzon) then 422 DO iq=1,nqtot 423 ! RQ: REVOIR A QUOI CA SERT... ET VERIFIER... 424 ! iiq=niadv(iq) 425 ! en fait, iiq=iq... 426 ! FIN RQ 427 tmpvar(:,:) = pq(:,1,:,iq) 428 call moyzon(llm,tmpvar,tmpvarbar) 429 zqfibar(1,:,iq) = tmpvarbar 430 ig0 = 2 431 do j = 2, jjm 432 tmpvar(:,:) = pq(:,j,:,iq) 433 call moyzon(llm,tmpvar,tmpvarbar) 434 zqfibar(ig0,:,iq) = tmpvarbar 435 ig0 = ig0+1 436 do i=2,iim 437 zqfibar(ig0,:,iq) = zqfibar(ig0-1,:,iq) 438 ig0 = ig0+1 439 enddo 440 enddo 441 tmpvar(:,:) = pq(:,jjp1,:,iq) 442 call moyzon(llm,tmpvar,tmpvarbar) 443 zqfibar(ngridmx,:,iq) = tmpvarbar 444 ENDDO ! of DO iq=1,nqtot 445 endif 446 447 ! DEBUG 448 ! do ig0=1,ngridmx 449 ! write(*,'(6(e13.5,1x))') zqfibar(ig0,1,10),zqfi(ig0,1,10), 450 ! . zqfibar(ig0,llm/2,10),zqfi(ig0,llm/2,10), 451 ! . zqfibar(ig0,llm,10),zqfi(ig0,llm,10) 452 ! enddo 453 ! stop 316 454 317 455 !----------------- … … 349 487 ENDDO 350 488 ENDDO 489 490 if (flag_moyzon) then 491 tmpvar(:,1) = pphis(:,1) 492 call moyzon(1,tmpvar(:,1),tmpvarbar(1)) 493 zphisbar(1) = tmpvarbar(1) 494 tmpvar(:,:) = pphi(:,1,:) 495 call moyzon(llm,tmpvar,tmpvarbar) 496 zphibar(1,:) = tmpvarbar 497 ig0 = 2 498 do j = 2, jjm 499 tmpvar(:,1) = pphis(:,j) 500 call moyzon(1,tmpvar(:,1),tmpvarbar(1)) 501 zphisbar(ig0) = tmpvarbar(1) 502 tmpvar(:,:) = pphi(:,j,:) 503 call moyzon(llm,tmpvar,tmpvarbar) 504 zphibar(ig0,:) = tmpvarbar 505 ig0 = ig0+1 506 do i=2,iim 507 zphisbar(ig0) = zphisbar(ig0-1) 508 zphibar(ig0,:) = zphibar(ig0-1,:) 509 ig0 = ig0+1 510 enddo 511 enddo 512 tmpvar(:,1) = pphis(:,jjp1) 513 call moyzon(1,tmpvar(:,1),tmpvarbar(1)) 514 zphisbar(ngridmx) = tmpvarbar(1) 515 tmpvar(:,:) = pphi(:,jjp1,:) 516 call moyzon(llm,tmpvar,tmpvarbar) 517 zphibar(ngridmx,:) = tmpvarbar 518 endif 351 519 352 520 c .... Calcul de la vitesse verticale ( en Pa*m*s ou Kg/s ) .... … … 594 762 enddo ! of do isplit=1,nsplit_phys 595 763 764 ! ATTENTION... 765 if (flag_moyzon.and.(nsplit_phys.ne.1)) then 766 print*,"WARNING ! flag_moyzon + nsplit_phys" 767 print*,"zqfibar n'est pas implemente au cours des iterations" 768 print*,"Donc a revoir..." 769 stop 770 endif 771 596 772 #endif 597 773 ! #endif of #ifdef CPP_PHYS -
trunk/LMDZ.COMMON/libf/dyn3d/conf_gcm.F
r1024 r1056 587 587 grilles_gcm_netcdf = .FALSE. 588 588 CALL getin('grilles_gcm_netcdf',grilles_gcm_netcdf) 589 590 c---------------------------------------- 591 c Parameters for zonal averages in the case of Titan 592 moyzon_mu = .false. 593 moyzon_ch = .false. 594 if (planet_type=="titan") then 595 CALL getin('moyzon_mu', moyzon_mu) 596 CALL getin('moyzon_ch', moyzon_ch) 597 endif 598 c---------------------------------------- 589 599 590 600 c---------------------------------------- … … 948 958 write(lunout,*)' ok_etat0 = ', ok_etat0 949 959 write(lunout,*)' grilles_gcm_netcdf = ', grilles_gcm_netcdf 950 c 960 if (planet_type=="titan") then 961 write(lunout,*)' moyzon_mu = ', moyzon_mu 962 write(lunout,*)' moyzon_ch = ', moyzon_ch 963 endif 964 951 965 RETURN 952 966 END -
trunk/LMDZ.COMMON/libf/dyn3d/leapfrog.F
r1024 r1056 529 529 ! #endif of #ifdef CPP_IOIPSL 530 530 531 c call WriteField('pfi',reshape(p,(/iip1,jmp1,llmp1/))) 532 531 533 CALL calfis( lafin , jD_cur, jH_cur, 532 534 $ ucov,vcov,teta,q,masse,ps,p,pk,phis,phi , … … 534 536 $ flxw, 535 537 $ dufi,dvfi,dtetafi,dqfi,dpfi ) 538 539 c call WriteField('dufi',reshape(dufi,(/iip1,jmp1,llm/))) 540 c call WriteField('dvfi',reshape(dvfi,(/iip1,jjm,llm/))) 541 c call WriteField('dtetafi',reshape(dtetafi,(/iip1,jmp1,llm/))) 536 542 537 543 c ajout des tendances physiques: -
trunk/LMDZ.COMMON/libf/dyn3d/logic.h
r495 r1056 11 11 & statcl,conser,apdiss,apdelq,saison,ecripar,fxyhypb,ysinus & 12 12 & ,read_start,ok_guide,ok_strato,tidal,ok_gradsfile & 13 & ,ok_limit,ok_etat0,grilles_gcm_netcdf,hybrid 13 & ,ok_limit,ok_etat0,grilles_gcm_netcdf,hybrid & 14 & ,moyzon_mu,moyzon_ch 14 15 15 16 COMMON/logici/ iflag_phys,iflag_trac … … 21 22 logical hybrid ! vertical coordinate is hybrid if true (sigma otherwise) 22 23 ! (only used if disvert_type==2) 24 logical moyzon_mu,moyzon_ch ! used for zonal averages in Titan 23 25 24 26 integer iflag_phys,iflag_trac -
trunk/LMDZ.COMMON/libf/dyn3dpar/calfis_p.F
r1019 r1056 33 33 USE IOPHY 34 34 #endif 35 USE parallel_lmdz, ONLY : omp_chunk, using_mpi 35 USE parallel_lmdz, ONLY : omp_chunk, using_mpi, AllGather_Field 36 36 USE Write_Field 37 37 Use Write_field_p … … 40 40 USE control_mod 41 41 USE cpdet_mod, only: tpot2t_p, t2tpot_p 42 43 ! used only for zonal averages 44 USE moyzon_mod 42 45 43 46 IMPLICIT NONE … … 99 102 #include "paramet.h" 100 103 #include "temps.h" 104 #include "logic.h" 101 105 102 106 INTEGER ngridmx … … 122 126 REAL pphis(iip1,jjp1) 123 127 REAL pphi(iip1,jjp1,llm) 124 c 128 125 129 REAL pdvcov(iip1,jjm,llm) 126 130 REAL pducov(iip1,jjp1,llm) … … 131 135 REAL pdq(iip1,jjp1,llm,nqtot) 132 136 REAL flxw(iip1,jjp1,llm) ! Flux de masse verticale sur la grille dynamique 133 c 137 134 138 REAL pps(iip1,jjp1) 135 139 REAL pp(iip1,jjp1,llmp1) 136 140 REAL ppk(iip1,jjp1,llm) 137 c 141 138 142 REAL pdvfi(iip1,jjm,llm) 139 143 REAL pdufi(iip1,jjp1,llm) … … 150 154 REAL,ALLOCATABLE,SAVE :: zplev(:,:),zplay(:,:) 151 155 REAL,ALLOCATABLE,SAVE :: zphi(:,:),zphis(:) 152 c 156 153 157 REAL,ALLOCATABLE,SAVE :: zufi(:,:), zvfi(:,:) 154 158 REAL,ALLOCATABLE,SAVE :: ztfi(:,:),zqfi(:,:,:) … … 156 160 REAL,ALLOCATABLE,SAVE :: zteta(:,:) 157 161 REAL,ALLOCATABLE,SAVE :: zpk(:,:) 158 c 162 159 163 ! Ces calculs ne servent pas. 160 164 ! Si necessaire, decommenter ces variables et les calculs... … … 167 171 REAL,SAVE,ALLOCATABLE :: flxwfi(:,:) ! Flux de masse verticale sur la grille physiq 168 172 169 c170 173 REAL,ALLOCATABLE,SAVE :: zplev_omp(:,:) 171 174 REAL,ALLOCATABLE,SAVE :: zplay_omp(:,:) … … 219 222 REAL zsinbis(iim),zcosbis(iim),z1bis(iim) 220 223 REAL unskap, pksurcp 221 c 224 save unskap 225 222 226 cIM diagnostique PVteta, Amip2 223 227 INTEGER ntetaSTD … … 248 252 249 253 LOGICAL tracerdyn ! for generic/mars physics call ; possibly to get rid of 250 c 254 255 ! For Titan only right now: 256 ! to allow for 2D computation of microphys and chemistry 257 LOGICAL,save :: flag_moyzon 258 REAL,dimension(iip1,llm) :: tmpvar 259 REAL,dimension(iip1,llmp1) :: tmpvarp1 260 REAL,dimension(llm) :: tmpvarbar 261 REAL,dimension(llmp1) :: tmpvarbarp1 262 251 263 c----------------------------------------------------------------------- 252 c 264 253 265 c 1. Initialisations : 254 266 c -------------------- 255 c 267 256 268 257 269 klon=klon_mpi … … 259 271 PVteta(:,:)=0. 260 272 261 c262 273 IF ( firstcal ) THEN 263 274 debut = .TRUE. … … 270 281 STOP 271 282 ENDIF 283 284 unskap = 1./ kappa 285 286 flag_moyzon = .false. 287 if(moyzon_ch.or.moyzon_mu) then 288 flag_moyzon = .true. 289 endif 290 272 291 c$OMP MASTER 273 292 ALLOCATE(zpsrf(klon)) … … 286 305 ALLOCATE(zteta(klon,llm)) 287 306 ALLOCATE(zpk(klon,llm)) 307 308 if (flag_moyzon) call moyzon_init 309 310 c------------------------------------------------------------------ 311 c moyennes globales pour les profils de pression et de temperature 312 call AllGather_Field(pp,iip1*jjp1,llmp1) 313 call AllGather_Field(pteta,iip1*jjp1,llm) 314 call AllGather_Field(ppk,iip1*jjp1,llm) 315 ALLOCATE(plevmoy(llm+1)) 316 ALLOCATE(playmoy(llm)) 317 ALLOCATE(tmoy(llm)) 318 ALLOCATE(tetamoy(llm)) 319 ALLOCATE(pkmoy(llm)) 320 plevmoy=0. 321 do l=1,llmp1 322 do i=1,iip1 323 do j=1,jjp1 324 plevmoy(l)=plevmoy(l)+pp(i,j,l)/(iip1*jjp1) 325 enddo 326 enddo 327 enddo 328 tetamoy=0. 329 pkmoy=0. 330 do l=1,llm 331 do i=1,iip1 332 do j=1,jjp1 333 tetamoy(l)=tetamoy(l)+pteta(i,j,l)/(iip1*jjp1) 334 pkmoy(l)=pkmoy(l)+ppk(i,j,l)/(iip1*jjp1) 335 enddo 336 enddo 337 enddo 338 playmoy = preff * (pkmoy/cpp) ** unskap 339 call tpot2t_p(1,llm,tetamoy,tmoy,pkmoy) 340 c------------------------------------------------------------------ 341 c + lat index 342 allocate(klat(klon)) 343 do ig0=1,klon 344 j=index_j(ig0) 345 klat(ig0)=j 346 enddo 347 c------------------------------------------------------------------ 348 288 349 c$OMP END MASTER 289 350 c$OMP BARRIER … … 292 353 ENDIF 293 354 294 c 295 c 355 296 356 c----------------------------------------------------------------------- 297 357 c 40. transformation des variables dynamiques en variables physiques: … … 317 377 318 378 c 42. pression intercouches et fonction d'Exner: 319 c 379 320 380 c ----------------------------------------------------------------- 321 381 c .... zplev definis aux (llm +1) interfaces des couches .... … … 324 384 325 385 c ... Exner = cp * ( p(l) / preff ) ** kappa .... 326 c 327 unskap = 1./ kappa 328 c 386 329 387 c print *,omp_rank,'klon--->',klon 330 388 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) … … 339 397 ENDDO 340 398 c$OMP END DO NOWAIT 399 if (flag_moyzon) then 400 call AllGather_Field(pp,iip1*jjp1,llmp1) 401 j=index_j(1) 402 tmpvarp1(:,:) = pp(:,j,:) 403 call moyzon(llmp1,tmpvarp1,tmpvarbarp1) 404 zplevbar_mpi(1,:) = tmpvarbarp1 405 do ig0=2,klon 406 j=index_j(ig0) 407 if (j.ne.index_j(ig0-1)) then 408 tmpvarp1(:,:) = pp(:,j,:) 409 call moyzon(llmp1,tmpvarp1,tmpvarbarp1) 410 zplevbar_mpi(ig0,:) = tmpvarbarp1 411 else 412 zplevbar_mpi(ig0,:) = zplevbar_mpi(ig0-1,:) 413 endif 414 enddo 415 endif 416 341 417 ! ADAPTATION GCM POUR CP(T) 418 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 342 419 DO l=1,llm 343 420 !CDIR ON_ADB(index_i) … … 351 428 ENDDO 352 429 c$OMP END DO NOWAIT 353 354 c 355 c 430 if (flag_moyzon) then 431 call AllGather_Field(pteta,iip1*jjp1,llm) 432 call AllGather_Field(ppk,iip1*jjp1,llm) 433 j=index_j(1) 434 tmpvar(:,:) = pteta(:,j,:) 435 call moyzon(llm,tmpvar,tmpvarbar) 436 ztetabar_mpi(1,:) = tmpvarbar 437 tmpvar(:,:) = ppk(:,j,:) 438 call moyzon(llm,tmpvar,tmpvarbar) 439 zpkbar_mpi(1,:) = tmpvarbar 440 call tpot2t_p(1,llm,ztetabar_mpi(1,:),ztfibar_mpi(1,:), 441 & zpkbar_mpi(1,:)) 442 do ig0=2,klon 443 j=index_j(ig0) 444 if (j.ne.index_j(ig0-1)) then 445 tmpvar(:,:) = pteta(:,j,:) 446 call moyzon(llm,tmpvar,tmpvarbar) 447 ztetabar_mpi(ig0,:) = tmpvarbar 448 tmpvar(:,:) = ppk(:,j,:) 449 call moyzon(llm,tmpvar,tmpvarbar) 450 zpkbar_mpi(ig0,:) = tmpvarbar 451 call tpot2t_p(1,llm,ztetabar_mpi(ig0,:),ztfibar_mpi(ig0,:), 452 & zpkbar_mpi(ig0,:)) 453 else 454 zpkbar_mpi(ig0,:) = zpkbar_mpi(ig0-1,:) 455 ztetabar_mpi(ig0,:) = ztetabar_mpi(ig0-1,:) 456 ztfibar_mpi(ig0,:) = ztfibar_mpi(ig0-1,:) 457 endif 458 enddo 459 endif 356 460 357 461 c 43. temperature naturelle (en K) et pressions milieux couches . … … 370 474 pksurcp = ppk(i,j,l) / cpp 371 475 zplay(ig0,l) = preff * pksurcp ** unskap 372 ! ztfi(ig0,l) = pteta(i,j,l) * pksurcp373 476 enddo 374 375 477 ENDDO 376 478 c$OMP END DO NOWAIT 479 if (flag_moyzon) then 480 zplaybar_mpi(:,:) = preff * (zpkbar_mpi(:,:)/cpp)**unskap 481 endif 377 482 378 483 c 43.bis traceurs (tous intensifs) 379 484 c --------------- 380 c381 485 382 486 DO iq=1,nqtot 383 iiq=niadv(iq)384 487 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 385 488 DO l=1,llm … … 389 492 i=index_i(ig0) 390 493 j=index_j(ig0) 391 zqfi(ig0,l,iq) = pq(i,j,l,i iq)494 zqfi(ig0,l,iq) = pq(i,j,l,iq) 392 495 enddo 393 496 ENDDO 394 497 c$OMP END DO NOWAIT 395 498 ENDDO ! of DO iq=1,nqtot 499 if (flag_moyzon) then 500 DO iq=1,nqtot 501 call AllGather_Field(pq(:,:,:,iq),iip1*jjp1,llm) 502 j=index_j(1) 503 tmpvar(:,:) = pq(:,j,:,iq) 504 call moyzon(llm,tmpvar,tmpvarbar) 505 zqfibar_mpi(1,:,iq) = tmpvarbar 506 do ig0=2,klon 507 j=index_j(ig0) 508 if (j.ne.index_j(ig0-1)) then 509 tmpvar(:,:) = pq(:,j,:,iq) 510 call moyzon(llm,tmpvar,tmpvarbar) 511 zqfibar_mpi(ig0,:,iq) = tmpvarbar 512 else 513 zqfibar_mpi(ig0,:,iq) = zqfibar_mpi(ig0-1,:,iq) 514 endif 515 enddo 516 ENDDO ! of DO iq=1,nqtot 517 endif 396 518 397 519 … … 404 526 405 527 c$OMP BARRIER 406 407 528 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 408 529 DO l=1,llm … … 413 534 c$OMP END DO NOWAIT 414 535 536 if (flag_moyzon) then 537 call AllGather_Field(pphis,iip1*jjp1,1) 538 call AllGather_Field(pphi,iip1*jjp1,llm) 539 j=index_j(1) 540 tmpvar(:,1) = pphis(:,j) 541 call moyzon(1,tmpvar(:,1),tmpvarbar(1)) 542 zphisbar_mpi(1) = tmpvarbar(1) 543 tmpvar(:,:) = pphi(:,j,:) 544 call moyzon(llm,tmpvar,tmpvarbar) 545 zphibar_mpi(1,:) = tmpvarbar-zphisbar_mpi(1) 546 do ig0=2,klon 547 j=index_j(ig0) 548 if (j.ne.index_j(ig0-1)) then 549 tmpvar(:,1) = pphis(:,j) 550 call moyzon(1,tmpvar(:,1),tmpvarbar(1)) 551 zphisbar_mpi(ig0) = tmpvarbar(1) 552 tmpvar(:,:) = pphi(:,j,:) 553 call moyzon(llm,tmpvar,tmpvarbar) 554 zphibar_mpi(ig0,:) = tmpvarbar-zphisbar_mpi(ig0) 555 else 556 zphisbar_mpi(ig0) = zphisbar_mpi(ig0-1) 557 zphibar_mpi(ig0,:) = zphibar_mpi(ig0-1,:) 558 endif 559 enddo 560 endif 415 561 416 562 c … … 563 709 allocate(zdpsrf_omp(klon)) 564 710 allocate(flxwfi_omp(klon,llm)) 711 712 if (flag_moyzon) call moyzon_init_omp(klon) 713 565 714 first_omp=.false. 566 715 endif … … 664 813 enddo 665 814 enddo 815 816 if (flag_moyzon) then 817 do l=1,llm+1 818 do i=1,klon 819 zplevbar(i,l)=zplevbar_mpi(offset+i,l) 820 enddo 821 enddo 822 823 do l=1,llm 824 do i=1,klon 825 zplaybar(i,l)=zplaybar_mpi(offset+i,l) 826 enddo 827 enddo 828 829 do l=1,llm 830 do i=1,klon 831 zphibar(i,l)=zphibar_mpi(offset+i,l) 832 enddo 833 enddo 834 835 do i=1,klon 836 zphisbar(i)=zphisbar_mpi(offset+i) 837 enddo 838 839 do l=1,llm 840 do i=1,klon 841 ztfibar(i,l)=ztfibar_mpi(offset+i,l) 842 enddo 843 enddo 844 845 do iq=1,nqtot 846 do l=1,llm 847 do i=1,klon 848 zqfibar(i,l,iq)=zqfibar_mpi(offset+i,l,iq) 849 enddo 850 enddo 851 enddo 852 endif 853 666 854 667 855 c$OMP BARRIER … … 1067 1255 !cdir NODEP 1068 1256 DO iq=1,nqtot 1069 iiq=niadv(iq)1070 1257 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 1071 1258 DO l=1,llm … … 1076 1263 i=index_i(ig0) 1077 1264 j=index_j(ig0) 1078 pdqfi(i,j,l,i iq) = zdqfi(ig0,l,iq)1079 if (i==1) pdqfi(iip1,j,l,i iq) = zdqfi(ig0,l,iq)1265 pdqfi(i,j,l,iq) = zdqfi(ig0,l,iq) 1266 if (i==1) pdqfi(iip1,j,l,iq) = zdqfi(ig0,l,iq) 1080 1267 ENDDO 1081 1268 1082 1269 IF (is_north_pole) then 1083 1270 DO i=1,iip1 1084 pdqfi(i,1,l,i iq) = zdqfi(1,l,iq)1271 pdqfi(i,1,l,iq) = zdqfi(1,l,iq) 1085 1272 ENDDO 1086 1273 ENDIF … … 1088 1275 IF (is_south_pole) then 1089 1276 DO i=1,iip1 1090 pdqfi(i,jjp1,l,i iq) = zdqfi(klon,l,iq)1277 pdqfi(i,jjp1,l,iq) = zdqfi(klon,l,iq) 1091 1278 ENDDO 1092 1279 ENDIF -
trunk/LMDZ.COMMON/libf/dyn3dpar/conf_gcm.F
r1024 r1056 643 643 grilles_gcm_netcdf = .FALSE. 644 644 CALL getin('grilles_gcm_netcdf',grilles_gcm_netcdf) 645 646 c---------------------------------------- 647 c Parameters for zonal averages in the case of Titan 648 moyzon_mu = .false. 649 moyzon_ch = .false. 650 if (planet_type=="titan") then 651 CALL getin('moyzon_mu', moyzon_mu) 652 CALL getin('moyzon_ch', moyzon_ch) 653 endif 654 c---------------------------------------- 645 655 646 656 c---------------------------------------- … … 1007 1017 write(lunout,*)' ok_etat0 = ', ok_etat0 1008 1018 write(lunout,*)' grilles_gcm_netcdf = ', grilles_gcm_netcdf 1009 c 1019 if (planet_type=="titan") then 1020 write(lunout,*)' moyzon_mu = ', moyzon_mu 1021 write(lunout,*)' moyzon_ch = ', moyzon_ch 1022 endif 1023 1010 1024 RETURN 1011 1025 END -
trunk/LMDZ.COMMON/libf/dyn3dpar/leapfrog_p.F
r1024 r1056 587 587 !$OMP BARRIER 588 588 !$OMP MASTER 589 590 589 call WriteField_p('temp',reshape(temp,(/iip1,jmp1,llm/))) 590 call WriteField_p('tsurpk',reshape(tsurpk,(/iip1,jmp1,llm/))) 591 591 !$OMP END MASTER 592 592 !$OMP BARRIER … … 1029 1029 c call WriteField_p('dvfi',reshape(dvfi,(/iip1,jjm,llm/))) 1030 1030 c call WriteField_p('dtetafi',reshape(dtetafi,(/iip1,jmp1,llm/))) 1031 c call WriteField_p('dpfi',reshape(dpfi,(/iip1,jmp1/)))1032 1031 cc$OMP END MASTER 1033 c1034 c do j=1,nqtot1035 c call WriteField_p('dqfi'//trim(int2str(j)),1036 c . reshape(dqfi(:,:,j),(/iip1,jmp1,llm/)))1037 c enddo1038 1032 1039 1033 c ajout des tendances physiques: -
trunk/LMDZ.COMMON/libf/dyn3dpar/logic.h
r495 r1056 11 11 & statcl,conser,apdiss,apdelq,saison,ecripar,fxyhypb,ysinus & 12 12 & ,read_start,ok_guide,ok_strato,tidal,ok_gradsfile & 13 & ,ok_limit,ok_etat0,grilles_gcm_netcdf,hybrid 13 & ,ok_limit,ok_etat0,grilles_gcm_netcdf,hybrid & 14 & ,moyzon_mu,moyzon_ch 14 15 15 16 COMMON/logici/ iflag_phys,iflag_trac … … 21 22 logical hybrid ! vertical coordinate is hybrid if true (sigma otherwise) 22 23 ! (only used if disvert_type==2) 24 logical moyzon_mu,moyzon_ch ! used for zonal averages in Titan 23 25 24 26 integer iflag_phys,iflag_trac
Note: See TracChangeset
for help on using the changeset viewer.