Changeset 1146 for LMDZ4/trunk/libf/dyn3dpar
- Timestamp:
- Apr 9, 2009, 12:11:35 PM (16 years ago)
- Location:
- LMDZ4/trunk
- Files:
-
- 5 deleted
- 37 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/trunk
-
Property
svn:mergeinfo
set to
/LMDZ4/branches/LMDZ4-dev merged eligible
-
Property
svn:mergeinfo
set to
-
LMDZ4/trunk/libf/dyn3dpar/addfi_p.F
r774 r1146 2 2 ! $Header$ 3 3 ! 4 SUBROUTINE addfi_p( nq,pdt, leapf, forward,4 SUBROUTINE addfi_p(pdt, leapf, forward, 5 5 S pucov, pvcov, pteta, pq , pps , 6 6 S pdufi, pdvfi, pdhfi,pdqfi, pdpfi ) 7 7 USE parallel 8 USE infotrac, ONLY : nqtot 8 9 IMPLICIT NONE 9 10 c … … 53 54 c ----------- 54 55 c 55 INTEGER nq56 57 56 REAL pdt 58 57 c 59 58 REAL pvcov(ip1jm,llm),pucov(ip1jmp1,llm) 60 REAL pteta(ip1jmp1,llm),pq(ip1jmp1,llm,nq ),pps(ip1jmp1)59 REAL pteta(ip1jmp1,llm),pq(ip1jmp1,llm,nqtot),pps(ip1jmp1) 61 60 c 62 61 REAL pdvfi(ip1jm,llm),pdufi(ip1jmp1,llm) 63 REAL pdqfi(ip1jmp1,llm,nq ),pdhfi(ip1jmp1,llm),pdpfi(ip1jmp1)62 REAL pdqfi(ip1jmp1,llm,nqtot),pdhfi(ip1jmp1,llm),pdpfi(ip1jmp1) 64 63 c 65 64 LOGICAL leapf,forward … … 166 165 ENDDO 167 166 168 DO iq = 3, nq 167 DO iq = 3, nqtot 169 168 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 170 169 DO k = 1,llm … … 208 207 209 208 if (pole_nord) then 210 DO iq = 1, nq 209 DO iq = 1, nqtot 211 210 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 212 211 DO k = 1, llm … … 225 224 226 225 if (pole_sud) then 227 DO iq = 1, nq 226 DO iq = 1, nqtot 228 227 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 229 228 DO k = 1, llm -
LMDZ4/trunk/libf/dyn3dpar/advtrac_p.F
r985 r1146 22 22 USE Vampir 23 23 USE times 24 USE infotrac 24 25 IMPLICIT NONE 25 26 c … … 35 36 #include "ener.h" 36 37 #include "description.h" 37 #include "advtrac.h"38 38 39 39 c------------------------------------------------------------------- … … 46 46 INTEGER iapptrac 47 47 REAL pbaru(ip1jmp1,llm),pbarv(ip1jm,llm) 48 REAL q(ip1jmp1,llm,nq mx),masse(ip1jmp1,llm)48 REAL q(ip1jmp1,llm,nqtot),masse(ip1jmp1,llm) 49 49 REAL p( ip1jmp1,llmp1 ),teta(ip1jmp1,llm) 50 50 REAL pk(ip1jmp1,llm) … … 59 59 REAL,SAVE::pbarug(ip1jmp1,llm),pbarvg(ip1jm,llm),wg(ip1jmp1,llm) 60 60 REAL (kind=kind(1.d0)) :: t_initial, t_final, tps_cpu 61 real cpuadv(nqmx)62 common/cpuadv/cpuadv63 64 61 INTEGER iadvtr 65 62 INTEGER ij,l,iq,iiq … … 76 73 REAL psppm(iim,jjp1) ! pression au sol 77 74 REAL unatppm(iim,jjp1,llm),vnatppm(iim,jjp1,llm) 78 REAL qppm(iim*jjp1,llm,nq mx)75 REAL qppm(iim*jjp1,llm,nqtot) 79 76 REAL fluxwppm(iim,jjp1,llm) 80 77 REAL apppm(llmp1), bpppm(llmp1) … … 88 85 REAL,SAVE :: teta_tmp(ip1jmp1,llm) 89 86 REAL,SAVE :: pk_tmp(ip1jmp1,llm) 90 87 91 88 ijb_u=ij_begin 92 89 ije_u=ij_end … … 196 193 call Register_SwapFieldHallo(pk_tmp,pk_tmp,ip1jmp1,llm, 197 194 * jj_Nb_vanleer,1,1,Request_vanleer) 198 do j=1,nq mx195 do j=1,nqtot 199 196 call Register_SwapFieldHallo(q(1,1,j),q(1,1,j),ip1jmp1,llm, 200 197 * jj_nb_vanleer,0,0,Request_vanleer) … … 279 276 c Appel des sous programmes d'advection 280 277 c----------------------------------------------------------- 281 do iq=1,nq mx278 do iq=1,nqtot 282 279 c call clock(t_initial) 283 280 if(iadv(iq) == 0) cycle … … 479 476 c$OMP END MASTER 480 477 481 do j=1,nq mx478 do j=1,nqtot 482 479 call Register_SwapFieldHallo(q(1,1,j),q(1,1,j),ip1jmp1,llm, 483 480 * jj_nb_caldyn,0,0,Request_vanleer) -
LMDZ4/trunk/libf/dyn3dpar/caladvtrac_p.F
r960 r1146 8 8 * flxw, pk, iapptrac) 9 9 USE parallel 10 USE infotrac 10 11 c 11 12 IMPLICIT NONE … … 25 26 #include "comconst.h" 26 27 #include "control.h" 27 #include "advtrac.h"28 28 29 29 c Arguments: 30 30 c ---------- 31 31 REAL pbaru( ip1jmp1,llm ),pbarv( ip1jm,llm),masse(ip1jmp1,llm) 32 REAL p( ip1jmp1,llmp1),q( ip1jmp1,llm,nq mx),dq( ip1jmp1,llm,2 )32 REAL p( ip1jmp1,llmp1),q( ip1jmp1,llm,nqtot),dq( ip1jmp1,llm,2 ) 33 33 REAL teta( ip1jmp1,llm),pk( ip1jmp1,llm) 34 34 REAL :: flxw(ip1jmp1,llm) … … 48 48 REAL finmasse(ip1jmp1,llm), dtvrtrac 49 49 50 51 50 cc 52 51 c -
LMDZ4/trunk/libf/dyn3dpar/calfis_p.F
r1000 r1146 4 4 C 5 5 C 6 SUBROUTINE calfis_p(nq, 7 $ lafin, 6 SUBROUTINE calfis_p(lafin, 8 7 $ rdayvrai, 9 8 $ heure, … … 40 39 USE Times 41 40 USE IOPHY 41 USE infotrac 42 42 43 IMPLICIT NONE 43 44 c======================================================================= … … 98 99 #include "paramet.h" 99 100 #include "temps.h" 100 #include "advtrac.h" 101 102 INTEGER ngridmx,nq 101 102 INTEGER ngridmx 103 103 PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm ) 104 104 … … 119 119 REAL pteta(iip1,jjp1,llm) 120 120 REAL pmasse(iip1,jjp1,llm) 121 REAL pq(iip1,jjp1,llm,nq mx)121 REAL pq(iip1,jjp1,llm,nqtot) 122 122 REAL pphis(iip1,jjp1) 123 123 REAL pphi(iip1,jjp1,llm) … … 126 126 REAL pducov(iip1,jjp1,llm) 127 127 REAL pdteta(iip1,jjp1,llm) 128 REAL pdq(iip1,jjp1,llm,nq mx)128 REAL pdq(iip1,jjp1,llm,nqtot) 129 129 c 130 130 REAL pps(iip1,jjp1) … … 135 135 REAL pdufi(iip1,jjp1,llm) 136 136 REAL pdhfi(iip1,jjp1,llm) 137 REAL pdqfi(iip1,jjp1,llm,nq mx)137 REAL pdqfi(iip1,jjp1,llm,nqtot) 138 138 REAL pdpsfi(iip1,jjp1) 139 139 … … 253 253 ALLOCATE(zphi(klon,llm),zphis(klon)) 254 254 ALLOCATE(zufi(klon,llm), zvfi(klon,llm)) 255 ALLOCATE(ztfi(klon,llm),zqfi(klon,llm,nq mx))255 ALLOCATE(ztfi(klon,llm),zqfi(klon,llm,nqtot)) 256 256 ALLOCATE(pcvgu(klon,llm), pcvgv(klon,llm)) 257 257 ALLOCATE(pcvgt(klon,llm), pcvgq(klon,llm,2)) 258 258 c ALLOCATE(pvervel(klon,llm)) 259 259 ALLOCATE(zdufi(klon,llm),zdvfi(klon,llm)) 260 ALLOCATE(zdtfi(klon,llm),zdqfi(klon,llm,nq mx))260 ALLOCATE(zdtfi(klon,llm),zdqfi(klon,llm,nqtot)) 261 261 ALLOCATE(zdpsrf(klon)) 262 262 ALLOCATE(zdufi2(klon+iim,llm),zdvfi2(klon+iim,llm)) … … 335 335 c 336 336 337 DO iq=1,nq 337 DO iq=1,nqtot 338 338 iiq=niadv(iq) 339 339 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) … … 369 369 CALL gr_dyn_fi_p(llm,iip1,jjp1,klon,pphi,zphi) 370 370 371 c$OMP MASTER372 371 CALL gr_dyn_fi_p(1,iip1,jjp1,klon,pphis,zphis) 373 c$OMP END MASTER 372 374 373 c$OMP BARRIER 375 374 … … 527 526 cc$OMP PARALLEL DEFAULT(NONE) 528 527 cc$OMP+ PRIVATE(i,l,offset,iq) 529 cc$OMP+ SHARED(klon_omp_nb,nq ,klon_omp_begin,528 cc$OMP+ SHARED(klon_omp_nb,nqtot,klon_omp_begin, 530 529 cc$OMP+ debut,lafin,rdayvrai,heure,dtphys,zplev,zplay, 531 530 cc$OMP+ zphi,zphis,presnivs,clesphy0,zufi,zvfi,ztfi, … … 549 548 allocate(zvfi_omp(klon,llm)) 550 549 allocate(ztfi_omp(klon,llm)) 551 allocate(zqfi_omp(klon,llm,nq ))550 allocate(zqfi_omp(klon,llm,nqtot)) 552 551 c allocate(pvervel_omp(klon,llm)) 553 552 allocate(zdufi_omp(klon,llm)) 554 553 allocate(zdvfi_omp(klon,llm)) 555 554 allocate(zdtfi_omp(klon,llm)) 556 allocate(zdqfi_omp(klon,llm,nq ))555 allocate(zdqfi_omp(klon,llm,nqtot)) 557 556 allocate(zdpsrf_omp(klon)) 558 557 allocate(flxwfi_omp(klon,llm)) … … 609 608 enddo 610 609 611 do iq=1,nq 610 do iq=1,nqtot 612 611 do l=1,llm 613 612 do i=1,klon … … 641 640 enddo 642 641 643 do iq=1,nq 642 do iq=1,nqtot 644 643 do l=1,llm 645 644 do i=1,klon … … 664 663 CALL physiq (klon, 665 664 . llm, 666 . nq,667 665 . debut, 668 666 . lafin, … … 743 741 enddo 744 742 745 do iq=1,nq 743 do iq=1,nqtot 746 744 do l=1,llm 747 745 do i=1,klon … … 775 773 enddo 776 774 777 do iq=1,nq 775 do iq=1,nqtot 778 776 do l=1,llm 779 777 do i=1,klon … … 896 894 c tendance sur la pression : 897 895 c ----------------------------------- 898 c$OMP MASTER899 896 CALL gr_fi_dyn_p(1,klon,iip1,jjp1,zdpsrf,pdpsfi) 900 c$OMP END MASTER901 897 c 902 898 c 62. enthalpie potentielle … … 937 933 c --------------------- 938 934 939 DO iq=1,nq mx935 DO iq=1,nqtot 940 936 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 941 937 DO l=1,llm … … 976 972 C 977 973 978 DO iq=1,nq 974 DO iq=1,nqtot 979 975 iiq=niadv(iq) 980 976 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) -
LMDZ4/trunk/libf/dyn3dpar/comdissip.h
r774 r1146 2 2 ! $Header$ 3 3 ! 4 c-----------------------------------------------------------------------5 c INCLUDEdissip.h4 !----------------------------------------------------------------------- 5 ! INCLUDE comdissip.h 6 6 7 COMMON/comdissip/ 8 $ lstardis,niterdis,coefdis,tetavel,tetatemp,gamdissip7 COMMON/comdissip/ & 8 & niterdis,coefdis,tetavel,tetatemp,gamdissip 9 9 10 10 11 LOGICAL lstardis12 11 INTEGER niterdis 13 12 14 13 REAL tetavel,tetatemp,coefdis,gamdissip 15 14 16 c-----------------------------------------------------------------------15 !----------------------------------------------------------------------- -
LMDZ4/trunk/libf/dyn3dpar/comgeom.h
r774 r1146 2 2 ! $Header$ 3 3 ! 4 *CDK comgeom5 COMMON/comgeom/ 6 1 cu(ip1jmp1),cv(ip1jm),unscu2(ip1jmp1),unscv2(ip1jm),7 2 aire(ip1jmp1),airesurg(ip1jmp1),aireu(ip1jmp1),8 3 airev(ip1jm),unsaire(ip1jmp1),apoln,apols,9 4 unsairez(ip1jm),airuscv2(ip1jm),airvscu2(ip1jm),10 5 aireij1(ip1jmp1),aireij2(ip1jmp1),aireij3(ip1jmp1),11 6 aireij4(ip1jmp1),alpha1(ip1jmp1),alpha2(ip1jmp1),12 7 alpha3(ip1jmp1),alpha4(ip1jmp1),alpha1p2(ip1jmp1),13 8 alpha1p4(ip1jmp1),alpha2p3(ip1jmp1),alpha3p4(ip1jmp1),14 9 fext(ip1jm),constang(ip1jmp1),rlatu(jjp1),rlatv(jjm),15 1 rlonu(iip1),rlonv(iip1),cuvsurcv(ip1jm),cvsurcuv(ip1jm),16 1 cvusurcu(ip1jmp1),cusurcvu(ip1jmp1),cuvscvgam1(ip1jm),17 2 cuvscvgam2(ip1jm),cvuscugam1(ip1jmp1),18 3 cvuscugam2(ip1jmp1),cvscuvgam(ip1jm),cuscvugam(ip1jmp1),19 4 unsapolnga1,unsapolnga2,unsapolsga1,unsapolsga2,20 5 unsair_gam1(ip1jmp1),unsair_gam2(ip1jmp1),unsairz_gam(ip1jm),21 6aivscu2gam(ip1jm),aiuscv2gam(ip1jm),xprimu(iip1),xprimv(iip1)4 !CDK comgeom 5 COMMON/comgeom/ & 6 & cu(ip1jmp1),cv(ip1jm),unscu2(ip1jmp1),unscv2(ip1jm), & 7 & aire(ip1jmp1),airesurg(ip1jmp1),aireu(ip1jmp1), & 8 & airev(ip1jm),unsaire(ip1jmp1),apoln,apols, & 9 & unsairez(ip1jm),airuscv2(ip1jm),airvscu2(ip1jm), & 10 & aireij1(ip1jmp1),aireij2(ip1jmp1),aireij3(ip1jmp1), & 11 & aireij4(ip1jmp1),alpha1(ip1jmp1),alpha2(ip1jmp1), & 12 & alpha3(ip1jmp1),alpha4(ip1jmp1),alpha1p2(ip1jmp1), & 13 & alpha1p4(ip1jmp1),alpha2p3(ip1jmp1),alpha3p4(ip1jmp1), & 14 & fext(ip1jm),constang(ip1jmp1),rlatu(jjp1),rlatv(jjm), & 15 & rlonu(iip1),rlonv(iip1),cuvsurcv(ip1jm),cvsurcuv(ip1jm), & 16 & cvusurcu(ip1jmp1),cusurcvu(ip1jmp1),cuvscvgam1(ip1jm), & 17 & cuvscvgam2(ip1jm),cvuscugam1(ip1jmp1), & 18 & cvuscugam2(ip1jmp1),cvscuvgam(ip1jm),cuscvugam(ip1jmp1), & 19 & unsapolnga1,unsapolnga2,unsapolsga1,unsapolsga2, & 20 & unsair_gam1(ip1jmp1),unsair_gam2(ip1jmp1),unsairz_gam(ip1jm), & 21 & aivscu2gam(ip1jm),aiuscv2gam(ip1jm),xprimu(iip1),xprimv(iip1) 22 22 23 c 24 REAL 25 1 cu,cv,unscu2,unscv2,aire,airesurg,aireu,airev,unsaire,apoln ,26 2 apols,unsairez,airuscv2,airvscu2,aireij1,aireij2,aireij3,aireij4,27 3 alpha1,alpha2,alpha3,alpha4,alpha1p2,alpha1p4,alpha2p3,alpha3p4 ,28 4 fext,constang,rlatu,rlatv,rlonu,rlonv,cuvscvgam1,cuvscvgam2 ,29 5 cvuscugam1,cvuscugam2,cvscuvgam,cuscvugam,unsapolnga1,unsapolnga230 6 ,unsapolsga1,unsapolsga2,unsair_gam1,unsair_gam2,unsairz_gam ,31 7 aivscu2gam ,aiuscv2gam,cuvsurcv,cvsurcuv,cvusurcu,cusurcvu,xprimu32 8, xprimv33 c 23 ! 24 REAL & 25 & cu,cv,unscu2,unscv2,aire,airesurg,aireu,airev,unsaire,apoln ,& 26 & apols,unsairez,airuscv2,airvscu2,aireij1,aireij2,aireij3,aireij4,& 27 & alpha1,alpha2,alpha3,alpha4,alpha1p2,alpha1p4,alpha2p3,alpha3p4 ,& 28 & fext,constang,rlatu,rlatv,rlonu,rlonv,cuvscvgam1,cuvscvgam2 ,& 29 & cvuscugam1,cvuscugam2,cvscuvgam,cuscvugam,unsapolnga1,unsapolnga2& 30 & ,unsapolsga1,unsapolsga2,unsair_gam1,unsair_gam2,unsairz_gam ,& 31 & aivscu2gam ,aiuscv2gam,cuvsurcv,cvsurcuv,cvusurcu,cusurcvu,xprimu& 32 & , xprimv 33 ! -
LMDZ4/trunk/libf/dyn3dpar/conf_gcm.F
r1046 r1146 6 6 SUBROUTINE conf_gcm( tapedef, etatinit, clesphy0 ) 7 7 c 8 #ifdef CPP_IOIPSL 8 9 use IOIPSL 10 #else 11 ! if not using IOIPSL, we still need to use (a local version of) getin 12 use ioipsl_getincom 13 #endif 9 14 use misc_mod 10 15 use mod_filtre_fft, ONLY : use_filtre_fft … … 109 114 c Parametres de controle du run: 110 115 c----------------------------------------------------------------------- 116 !Config Key = planet_type 117 !Config Desc = planet type ("earth", "mars", "venus", ...) 118 !Config Def = earth 119 !Config Help = this flag sets the type of atymosphere that is considered 120 planet_type="earth" 121 CALL getin('planet_type',planet_type) 111 122 112 123 !Config Key = dayref … … 189 200 CALL getin('periodav',periodav) 190 201 202 !Config Key = output_grads_dyn 203 !Config Desc = output dynamics diagnostics in 'dyn.dat' file 204 !Config Def = n 205 !Config Help = output dynamics diagnostics in Grads-readable 'dyn.dat' file 206 output_grads_dyn=.false. 207 CALL getin('output_grads_dyn',output_grads_dyn) 208 191 209 !Config Key = idissip 192 210 !Config Desc = periode de la dissipation … … 284 302 c ............................................................... 285 303 304 !Config Key = read_start 305 !Config Desc = Initialize model using a 'start.nc' file 306 !Config Def = y 307 !Config Help = y: intialize dynamical fields using a 'start.nc' file 308 ! n: fields are initialized by 'iniacademic' routine 309 read_start= .true. 310 CALL getin('read_start',read_start) 311 286 312 !Config Key = iflag_phys 287 313 !Config Desc = Avec ls physique … … 341 367 c 342 368 IF( ABS(clat - clatt).GE. 0.001 ) THEN 343 PRINT *,' La valeur de clat passee par run.def est differente de344 *celle lue sur le fichier start '369 write(lunout,*)'conf_gcm: La valeur de clat passee par run.def', 370 & ' est differente de celle lue sur le fichier start ' 345 371 STOP 346 372 ENDIF … … 356 382 357 383 IF( ABS(grossismx - grossismxx).GE. 0.001 ) THEN 358 PRINT *,' La valeur de grossismx passee par run.def est differente359 *de celle lue sur le fichier start '384 write(lunout,*)'conf_gcm: La valeur de grossismx passee par ', 385 & 'run.def est differente de celle lue sur le fichier start ' 360 386 STOP 361 387 ENDIF … … 370 396 371 397 IF( ABS(grossismy - grossismyy).GE. 0.001 ) THEN 372 PRINT *,' La valeur de grossismy passee par run.def est differen373 *te de celle lue sur le fichier start '398 write(lunout,*)'conf_gcm: La valeur de grossismy passee par ', 399 & 'run.def est differente de celle lue sur le fichier start ' 374 400 STOP 375 401 ENDIF 376 402 377 403 IF( grossismx.LT.1. ) THEN 378 PRINT *,' *** ATTENTION !! grossismx < 1 . *** ' 404 write(lunout,*) 405 & 'conf_gcm: *** ATTENTION !! grossismx < 1 . *** ' 379 406 STOP 380 407 ELSE … … 384 411 385 412 IF( grossismy.LT.1. ) THEN 386 PRINT *,' *** ATTENTION !! grossismy < 1 . *** ' 413 write(lunout,*) 414 & 'conf_gcm: *** ATTENTION !! grossismy < 1 . *** ' 387 415 STOP 388 416 ELSE … … 390 418 ENDIF 391 419 392 PRINT *,' alphax alphay defrun',alphax,alphay420 write(lunout,*)'conf_gcm: alphax alphay',alphax,alphay 393 421 c 394 422 c alphax et alphay sont les anciennes formulat. des grossissements … … 405 433 406 434 IF( .NOT.fxyhypb ) THEN 407 408 PRINT *,' ******** PBS DANS DEFRUN******** '409 PRINT *,' *** fxyhypb lu sur le fichier start est F',410 * ' alors qu il est T sur run.def ***'435 IF( fxyhypbb ) THEN 436 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 437 write(lunout,*)' *** fxyhypb lu sur le fichier start est ', 438 * 'F alors qu il est T sur run.def ***' 411 439 STOP 412 440 ENDIF 413 441 ELSE 414 415 PRINT *,' ******** PBS DANS DEFRUN******** '416 PRINT *,' *** fxyhypb lu sur le fichier start est T',417 * ' alors qu il est F sur run.def **** '442 IF( .NOT.fxyhypbb ) THEN 443 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 444 write(lunout,*)' *** fxyhypb lu sur le fichier start est ', 445 * 'T alors qu il est F sur run.def **** ' 418 446 STOP 419 447 ENDIF 420 448 ENDIF 421 449 c … … 430 458 IF( fxyhypb ) THEN 431 459 IF( ABS(dzoomx - dzoomxx).GE. 0.001 ) THEN 432 PRINT *,' La valeur de dzoomx passee par run.def est differente433 * de celle lue sur le fichier start '460 write(lunout,*)'conf_gcm: La valeur de dzoomx passee par ', 461 * 'run.def est differente de celle lue sur le fichier start ' 434 462 STOP 435 463 ENDIF … … 446 474 IF( fxyhypb ) THEN 447 475 IF( ABS(dzoomy - dzoomyy).GE. 0.001 ) THEN 448 PRINT *,' La valeur de dzoomy passee par run.def est differente449 * de celle lue sur le fichier start '476 write(lunout,*)'conf_gcm: La valeur de dzoomy passee par ', 477 * 'run.def est differente de celle lue sur le fichier start ' 450 478 STOP 451 479 ENDIF … … 461 489 IF( fxyhypb ) THEN 462 490 IF( ABS(taux - tauxx).GE. 0.001 ) THEN 463 PRINT *,' La valeur de taux passee par run.def est differente464 * de celle lue sur le fichier start '491 write(lunout,*)'conf_gcm: La valeur de taux passee par ', 492 * 'run.def est differente de celle lue sur le fichier start ' 465 493 STOP 466 494 ENDIF … … 476 504 IF( fxyhypb ) THEN 477 505 IF( ABS(tauy - tauyy).GE. 0.001 ) THEN 478 PRINT *,' La valeur de tauy passee par run.def est differente479 * de celle lue sur le fichier start '506 write(lunout,*)'conf_gcm: La valeur de tauy passee par ', 507 * 'run.def est differente de celle lue sur le fichier start ' 480 508 STOP 481 509 ENDIF … … 495 523 496 524 IF( .NOT.ysinus ) THEN 497 IF( ysinuss ) THEN 498 PRINT *,' ******** PBS DANS DEFRUN ******** ' 499 PRINT *,' *** ysinus lu sur le fichier start est F ', 500 * 'alors qu il est T sur run.def ***' 525 IF( ysinuss ) THEN 526 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 527 write(lunout,*)' *** ysinus lu sur le fichier start est F', 528 * ' alors qu il est T sur run.def ***' 529 STOP 530 ENDIF 531 ELSE 532 IF( .NOT.ysinuss ) THEN 533 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 534 write(lunout,*)' *** ysinus lu sur le fichier start est T', 535 * ' alors qu il est F sur run.def **** ' 501 536 STOP 502 ENDIF 503 ELSE 504 IF( .NOT.ysinuss ) THEN 505 PRINT *,' ******** PBS DANS DEFRUN ******** ' 506 PRINT *,' *** ysinus lu sur le fichier start est T ', 507 * 'alors qu il est F sur run.def **** ' 508 STOP 509 ENDIF 537 ENDIF 510 538 ENDIF 511 ENDIF 539 ENDIF ! of IF( .NOT.fxyhypb ) 512 540 c 513 541 !Config Key = offline … … 529 557 CALL getin('config_inca',config_inca) 530 558 559 !Config Key = ok_dynzon 560 !Config Desc = calcul et sortie des transports 561 !Config Def = n 562 !Config Help = Permet de mettre en route le calcul des transports 563 !Config 564 ok_dynzon = .FALSE. 565 CALL getin('ok_dynzon',ok_dynzon) 566 531 567 532 568 write(lunout,*)' #########################################' 533 569 write(lunout,*)' Configuration des parametres du gcm: ' 570 write(lunout,*)' planet_type = ', planet_type 534 571 write(lunout,*)' dayref = ', dayref 535 572 write(lunout,*)' anneeref = ', anneeref … … 540 577 write(lunout,*)' iecri = ', iecri 541 578 write(lunout,*)' periodav = ', periodav 579 write(lunout,*)' output_grads_dyn = ', output_grads_dyn 542 580 write(lunout,*)' idissip = ', idissip 543 581 write(lunout,*)' lstardis = ', lstardis … … 550 588 write(lunout,*)' coefdis = ', coefdis 551 589 write(lunout,*)' purmats = ', purmats 590 write(lunout,*)' read_start = ', read_start 552 591 write(lunout,*)' iflag_phys = ', iflag_phys 553 592 write(lunout,*)' clonn = ', clonn … … 562 601 write(lunout,*)' offline = ', offline 563 602 write(lunout,*)' config_inca = ', config_inca 603 write(lunout,*)' ok_dynzon = ', ok_dynzon 564 604 565 605 RETURN … … 600 640 601 641 IF( grossismx.LT.1. ) THEN 602 PRINT *,' *** ATTENTION !! grossismx < 1 . *** ' 642 write(lunout,*) 643 & 'conf_gcm: *** ATTENTION !! grossismx < 1 . *** ' 603 644 STOP 604 645 ELSE … … 608 649 609 650 IF( grossismy.LT.1. ) THEN 610 PRINT *,' *** ATTENTION !! grossismy < 1 . *** ' 651 write(lunout,*) 652 & 'conf_gcm: *** ATTENTION !! grossismy < 1 . *** ' 611 653 STOP 612 654 ELSE … … 614 656 ENDIF 615 657 616 PRINT *,' alphax alphay defrun',alphax,alphay658 write(lunout,*)'conf_gcm: alphax alphay ',alphax,alphay 617 659 c 618 660 c alphax et alphay sont les anciennes formulat. des grossissements … … 685 727 CALL getin('config_inca',config_inca) 686 728 729 !Config Key = ok_dynzon 730 !Config Desc = calcul et sortie des transports 731 !Config Def = n 732 !Config Help = Permet de mettre en route le calcul des transports 733 !Config 734 ok_dynzon = .FALSE. 735 CALL getin('ok_dynzon',ok_dynzon) 736 687 737 !Config Key = use_filtre_fft 688 738 !Config Desc = flag d'activation des FFT pour le filtre … … 692 742 use_filtre_fft=.FALSE. 693 743 CALL getin('use_filtre_fft',use_filtre_fft) 744 745 IF (use_filtre_fft .AND. grossismx /= 1.0) THEN 746 write(lunout,*)'WARNING !!! ' 747 write(lunout,*)"Le zoom en longitude est incompatible", 748 & " avec l'utilisation du filtre FFT ", 749 & "---> filtre FFT désactivé " 750 use_filtre_fft=.FALSE. 751 ENDIF 752 753 694 754 695 755 !Config Key = use_mpi_alloc 696 !Config Desc = Utilise un buffer MPI en m émoire globale756 !Config Desc = Utilise un buffer MPI en m�moire globale 697 757 !Config Def = false 698 758 !Config Help = permet d'activer l'utilisation d'un buffer MPI 699 !Config en m émoire globale a l'aide de la fonction MPI_ALLOC.700 !Config Cela peut am éliorer la bande passante des transferts MPI759 !Config en m�moire globale a l'aide de la fonction MPI_ALLOC. 760 !Config Cela peut am�liorer la bande passante des transferts MPI 701 761 !Config d'un facteur 2 702 762 use_mpi_alloc=.FALSE. … … 706 766 !Config Desc = taille des blocs openmp 707 767 !Config Def = 1 708 !Config Help = defini la taille des packets d'it ération openmp709 !Config distribu ée à chaque tâche lors de l'entrée dans une710 !Config boucle parall élisée768 !Config Help = defini la taille des packets d'it�ration openmp 769 !Config distribu�e � chaque t�che lors de l'entr�e dans une 770 !Config boucle parall�lis�e 711 771 712 772 omp_chunk=1 … … 716 776 !Config Desc = activation de la version strato 717 777 !Config Def = .FALSE. 718 !Config Help = active la version stratosph érique de LMDZ de F. Lott778 !Config Help = active la version stratosph�rique de LMDZ de F. Lott 719 779 720 780 ok_strato=.FALSE. … … 731 791 write(lunout,*)' #########################################' 732 792 write(lunout,*)' Configuration des parametres du gcm: ' 793 write(lunout,*)' planet_type = ', planet_type 733 794 write(lunout,*)' dayref = ', dayref 734 795 write(lunout,*)' anneeref = ', anneeref … … 739 800 write(lunout,*)' iecri = ', iecri 740 801 write(lunout,*)' periodav = ', periodav 802 write(lunout,*)' output_grads_dyn = ', output_grads_dyn 741 803 write(lunout,*)' idissip = ', idissip 742 804 write(lunout,*)' lstardis = ', lstardis … … 749 811 write(lunout,*)' coefdis = ', coefdis 750 812 write(lunout,*)' purmats = ', purmats 813 write(lunout,*)' read_start = ', read_start 751 814 write(lunout,*)' iflag_phys = ', iflag_phys 752 815 write(lunout,*)' clon = ', clon … … 754 817 write(lunout,*)' grossismx = ', grossismx 755 818 write(lunout,*)' grossismy = ', grossismy 756 write(lunout,*)' fxyhypb b = ', fxyhypbb819 write(lunout,*)' fxyhypb = ', fxyhypb 757 820 write(lunout,*)' dzoomx = ', dzoomx 758 821 write(lunout,*)' dzoomy = ', dzoomy … … 761 824 write(lunout,*)' offline = ', offline 762 825 write(lunout,*)' config_inca = ', config_inca 826 write(lunout,*)' ok_dynzon = ', ok_dynzon 763 827 write(lunout,*)' use_filtre_fft = ', use_filtre_fft 764 828 write(lunout,*)' use_mpi_alloc = ', use_mpi_alloc -
LMDZ4/trunk/libf/dyn3dpar/control.h
r985 r1146 14 14 & iperiod,iapp_tracvl,iconser,iecri,idissip,iphysiq , & 15 15 & periodav,iecrimoy,dayref,anneeref, & 16 & raz_date,offline,ip_ebil_dyn,config_inca 16 & raz_date,offline,ip_ebil_dyn,config_inca, & 17 & planet_type,output_grads_dyn,ok_dynzon 17 18 18 19 INTEGER nday,day_step,iperiod,iapp_tracvl,iconser,iecri, & … … 21 22 REAL periodav 22 23 logical offline 23 CHARACTER*4 config_inca 24 CHARACTER (len=4) :: config_inca 25 CHARACTER(len=10) :: planet_type ! planet type ('earth','mars',...) 26 LOGICAL :: output_grads_dyn ! output dynamics diagnostics in 27 ! binary grads file 'dyn.dat' (y/n) 28 LOGICAL :: ok_dynzon 24 29 !----------------------------------------------------------------------- -
LMDZ4/trunk/libf/dyn3dpar/covnat_p.F
r1000 r1146 61 61 END DO 62 62 63 ijb=ij_begin 63 ijb=ij_begin-iip1 64 64 ije=ij_end 65 if (pole_nord) ijb=ij_begin 65 66 if (pole_sud) ije=ij_end-iip1 66 67 -
LMDZ4/trunk/libf/dyn3dpar/create_etat0_limit.F
r1017 r1146 8 8 USE mod_const_mpi 9 9 USE phys_state_var_mod 10 USE infotrac 10 11 IMPLICIT NONE 11 12 c … … 31 32 #include "paramet.h" 32 33 #include "indicesol.h" 33 #include "advtrac.h"34 34 #include "control.h" 35 35 #include "clesphys.h" … … 37 37 ! REAL :: pctsrf(iim*(jjm-1)+2, nbsrf) 38 38 39 c initialisation traceurs40 hadv_flg(:) = 0.41 vadv_flg(:) = 0.42 conv_flg(:) = 0.43 pbl_flg(:) = 0.44 tracnam(:) = ' '45 nprath = 146 nbtrac = 047 mmt_adj(:,:,:,:) = 148 49 39 IF (config_inca /= 'none') THEN 50 40 #ifdef INCA 51 41 call init_const_lmdz( 52 $ nbtr ac,anneeref,dayref,42 $ nbtr,anneeref,dayref, 53 43 $ iphysiq,day_step,nday) 54 44 #endif 55 print *, 'nbtr ac =' , nbtrac45 print *, 'nbtr =' , nbtr 56 46 END IF 57 47 … … 59 49 60 50 61 CALL Init_Phys_lmdz(iim,jjp1,llm, nqmx-2,1,(/(jjm-1)*iim+2/))51 CALL Init_Phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/)) 62 52 PRINT *,'---> klon=',klon 63 53 -
LMDZ4/trunk/libf/dyn3dpar/diagedyn.F
r774 r1146 58 58 #include "paramet.h" 59 59 #include "comgeom.h" 60 61 #ifdef CPP_PHYS 60 #include "iniprint.h" 61 62 #ifdef CPP_EARTH 62 63 #include "../phylmd/YOMCST.h" 63 64 #include "../phylmd/YOETHF.h" … … 139 140 140 141 141 #ifdef CPP_ PHYS142 #ifdef CPP_EARTH 142 143 c====================================================================== 143 144 C Compute Kinetic enrgy … … 314 315 C 315 316 #else 316 print*,'Pour l instant diagedyn a besoin de la physique'317 write(lunout,*),'diagedyn: Needs Earth physics to function' 317 318 #endif 319 ! #endif of #ifdef CPP_EARTH 318 320 RETURN 319 321 END -
LMDZ4/trunk/libf/dyn3dpar/dynetat0.F
r774 r1146 2 2 ! $Header$ 3 3 ! 4 SUBROUTINE dynetat0(fichnom, nq,vcov,ucov,4 SUBROUTINE dynetat0(fichnom,vcov,ucov, 5 5 . teta,q,masse,ps,phis,time) 6 USE infotrac 6 7 IMPLICIT NONE 7 8 … … 32 33 #include "serre.h" 33 34 #include "logic.h" 34 #include "advtrac.h"35 35 36 36 c Arguments: … … 38 38 39 39 CHARACTER*(*) fichnom 40 INTEGER nq41 40 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm),teta(ip1jmp1,llm) 42 REAL q(ip1jmp1,llm,nq ),masse(ip1jmp1,llm)41 REAL q(ip1jmp1,llm,nqtot),masse(ip1jmp1,llm) 43 42 REAL ps(ip1jmp1),phis(ip1jmp1) 44 43 … … 53 52 54 53 c----------------------------------------------------------------------- 55 56 54 c Ouverture NetCDF du fichier etat initial 57 55 … … 315 313 316 314 317 IF(nq.GE.1) THEN 318 DO iq=1,nq 315 DO iq=1,nqtot 319 316 ierr = NF_INQ_VARID (nid, tname(iq), nvarid) 320 317 IF (ierr .NE. NF_NOERR) THEN … … 334 331 ENDIF 335 332 ENDDO 336 ENDIF337 333 338 334 ierr = NF_INQ_VARID (nid, "masse", nvarid) -
LMDZ4/trunk/libf/dyn3dpar/dynredem.F
r1000 r1146 3 3 ! 4 4 c 5 SUBROUTINE dynredem0(fichnom,iday_end,phis ,nq)5 SUBROUTINE dynredem0(fichnom,iday_end,phis) 6 6 USE IOIPSL 7 USE infotrac 7 8 IMPLICIT NONE 8 9 c======================================================================= … … 22 23 #include "description.h" 23 24 #include "serre.h" 24 #include "advtrac.h"25 25 26 26 c Arguments: … … 29 29 REAL phis(ip1jmp1) 30 30 CHARACTER*(*) fichnom 31 INTEGER nq32 31 33 32 c Local: … … 458 457 dims4(3) = idim_s 459 458 dims4(4) = idim_tim 460 IF(nq.GE.1) THEN 461 DO iq=1,nq 459 460 DO iq=1,nqtot 462 461 cIM 220306 BEG 463 462 #ifdef NC_DOUBLE … … 469 468 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 12,ttext(iq)) 470 469 ENDDO 471 ENDIF472 470 c 473 471 dims4(1) = idim_rlonv … … 508 506 END 509 507 SUBROUTINE dynredem1(fichnom,time, 510 . vcov,ucov,teta,q,nq,masse,ps) 508 . vcov,ucov,teta,q,masse,ps) 509 USE infotrac 511 510 IMPLICIT NONE 512 511 c================================================================= … … 519 518 #include "comvert.h" 520 519 #include "comgeom.h" 521 #include "advtrac.h"522 520 #include "temps.h" 523 521 #include "control.h" 524 522 525 INTEGER nq,l523 INTEGER l 526 524 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) 527 525 REAL teta(ip1jmp1,llm) 528 526 REAL ps(ip1jmp1),masse(ip1jmp1,llm) 529 REAL q(ip1jmp1,llm,nq )527 REAL q(ip1jmp1,llm,nqtot) 530 528 CHARACTER*(*) fichnom 531 529 … … 633 631 END IF 634 632 635 IF(nq.GE.1) THEN 636 do iq=1,nq 633 do iq=1,nqtot 637 634 638 635 IF (config_inca == 'none') THEN … … 704 701 705 702 ENDDO 706 ENDIF707 703 c 708 704 ierr = NF_INQ_VARID(nid, "masse", nvarid) -
LMDZ4/trunk/libf/dyn3dpar/dynredem_p.F
r1084 r1146 3 3 ! 4 4 c 5 SUBROUTINE dynredem0_p(fichnom,iday_end,phis ,nq)5 SUBROUTINE dynredem0_p(fichnom,iday_end,phis) 6 6 USE IOIPSL 7 7 USE parallel 8 USE infotrac 8 9 IMPLICIT NONE 9 10 c======================================================================= … … 23 24 #include "description.h" 24 25 #include "serre.h" 25 #include "advtrac.h"26 26 27 27 c Arguments: … … 30 30 REAL phis(ip1jmp1) 31 31 CHARACTER*(*) fichnom 32 INTEGER nq33 32 34 33 c Local: … … 54 53 INTEGER yyears0,jjour0, mmois0 55 54 character*30 unites 56 57 55 58 56 c----------------------------------------------------------------------- … … 461 459 dims4(3) = idim_s 462 460 dims4(4) = idim_tim 463 IF(nq.GE.1) THEN 464 DO iq=1,nq 461 462 DO iq=1,nqtot 465 463 cIM 220306 BEG 466 464 #ifdef NC_DOUBLE … … 472 470 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 12,ttext(iq)) 473 471 ENDDO 474 ENDIF475 472 c 476 473 dims4(1) = idim_rlonv … … 513 510 END 514 511 SUBROUTINE dynredem1_p(fichnom,time, 515 . vcov,ucov,teta,q, nq,masse,ps)512 . vcov,ucov,teta,q,masse,ps) 516 513 USE parallel 514 USE infotrac 517 515 IMPLICIT NONE 518 516 c================================================================= … … 525 523 #include "comvert.h" 526 524 #include "comgeom.h" 527 #include "advtrac.h"528 525 #include "temps.h" 529 526 #include "control.h" 530 527 531 INTEGER nq,l528 INTEGER l 532 529 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) 533 530 REAL teta(ip1jmp1,llm) 534 531 REAL ps(ip1jmp1),masse(ip1jmp1,llm) 535 REAL q(ip1jmp1,llm,nq )532 REAL q(ip1jmp1,llm,nqtot) 536 533 CHARACTER*(*) fichnom 537 534 … … 559 556 call Gather_Field(ps,ip1jmp1,1,0) 560 557 561 do iq=1,nq 558 do iq=1,nqtot 562 559 call Gather_Field(q(1,1,iq),ip1jmp1,llm,0) 563 560 enddo … … 660 657 END IF 661 658 662 IF(nq.GE.1) THEN 663 do iq=1,nq 659 do iq=1,nqtot 664 660 665 661 IF (config_inca == 'none') THEN … … 731 727 732 728 ENDDO 733 ENDIF734 735 729 736 730 -
LMDZ4/trunk/libf/dyn3dpar/etat0_netcdf.F
r1058 r1146 5 5 c 6 6 SUBROUTINE etat0_netcdf (interbar, masque) 7 7 #ifdef CPP_EARTH 8 8 USE startvar 9 9 USE ioipsl … … 12 12 USE pbl_surface_mod 13 13 USE phys_state_var_mod 14 USE filtreg_mod 15 USE infotrac 16 #endif 17 !#endif of #ifdef CPP_EARTH 14 18 ! 15 19 IMPLICIT NONE … … 23 27 ! .KLON=KFDIA-KIDIA+1,KLEV=llm 24 28 ! 29 #ifdef CPP_EARTH 25 30 #include "comgeom2.h" 26 31 #include "comvert.h" … … 29 34 #include "dimsoil.h" 30 35 #include "temps.h" 31 ! 36 #endif 37 !#endif of #ifdef CPP_EARTH 38 ! arguments: 32 39 LOGICAL interbar 40 REAL :: masque(iip1,jjp1) 41 42 #ifdef CPP_EARTH 43 ! local variables: 33 44 REAL :: latfi(klon), lonfi(klon) 34 REAL :: orog(iip1,jjp1), rugo(iip1,jjp1), masque(iip1,jjp1),45 REAL :: orog(iip1,jjp1), rugo(iip1,jjp1), 35 46 . psol(iip1, jjp1), phis(iip1, jjp1) 36 47 REAL :: p3d(iip1, jjp1, llm+1) … … 38 49 REAL :: vvent(iip1, jjm, llm) 39 50 REAL :: t3d(iip1, jjp1, llm), tpot(iip1, jjp1, llm) 40 REAL :: q3d(iip1, jjp1, llm,nqmx), qsat(iip1, jjp1, llm) 51 REAL :: qsat(iip1, jjp1, llm) 52 REAL,ALLOCATABLE :: q3d(:, :, :,:) 41 53 REAL :: tsol(klon), qsol(klon), sn(klon) 42 54 REAL :: tsolsrf(klon,nbsrf), qsolsrf(klon,nbsrf),snsrf(klon,nbsrf) … … 141 153 ! 142 154 preff = 101325. 155 pa = 50000. 143 156 unskap = 1./kappa 144 157 ! … … 164 177 print*,'dtvr',dtvr 165 178 166 CALL inicons 0()179 CALL iniconst() 167 180 CALL inigeom() 168 181 ! 169 182 CALL inifilr() 183 C init pour traceurs 184 call infotrac_init 185 ALLOCATE(q3d(iip1, jjp1, llm,nqtot)) 170 186 ! CALL phys_state_var_init() 171 187 ! … … 623 639 phis(iip1,:) = phis(1,:) 624 640 625 C init pour traceurs626 call iniadvtrac(nq)627 641 C Ecriture 628 642 CALL inidissip( lstardis, nitergdiv, nitergrot, niterh , … … 648 662 * phi,w, pbaru,pbarv,time+iday-dayref ) 649 663 print*,'sortie caldyn0' 650 CALL dynredem0("start.nc",dayref,phis ,nqmx)664 CALL dynredem0("start.nc",dayref,phis) 651 665 print*,'sortie dynredem0' 652 CALL dynredem1("start.nc",0.0,vvent,uvent,tpot,q3d, nqmx,masse ,666 CALL dynredem1("start.nc",0.0,vvent,uvent,tpot,q3d,masse , 653 667 . psol) 654 668 print*,'sortie dynredem1' … … 742 756 visu_file='Etat0_visu.nc' 743 757 CALL initdynav(visu_file,dayref,anneeref,time_step, 744 . t_ops, t_wrt, nqmx,visuid)745 CALL writedynav(visuid, nqmx,itau,vvent ,758 . t_ops, t_wrt, visuid) 759 CALL writedynav(visuid, itau,vvent , 746 760 . uvent,tpot,pk,phi,q3d,masse,psol,phis) 747 761 else … … 750 764 print*,'entree histclo' 751 765 CALL histclo 766 767 #endif 768 !#endif of #ifdef CPP_EARTH 752 769 RETURN 753 770 ! -
LMDZ4/trunk/libf/dyn3dpar/filtreg_p.F
r985 r1146 2 2 3 3 SUBROUTINE filtreg_p ( champ, ibeg, iend, nlat, nbniv, 4 .ifiltre, iaire, griscal ,iter)5 USE Parallel, only : OMP_CHUNK 4 & ifiltre, iaire, griscal ,iter) 5 USE Parallel, only : OMP_CHUNK 6 6 USE mod_filtre_fft 7 7 USE timer_filtre 8 9 USE filtreg_mod 10 8 11 IMPLICIT NONE 9 12 10 13 c======================================================================= 11 14 c … … 50 53 #include "dimensions.h" 51 54 #include "paramet.h" 52 #include "parafilt.h"53 55 #include "coefils.h" 54 56 c … … 57 59 INTEGER iim2,immjm 58 60 INTEGER jdfil1,jdfil2,jffil1,jffil2,jdfil,jffil 59 61 60 62 REAL champ( iip1,nlat,nbniv) 61 REAL matriceun,matriceus,matricevn,matricevs,matrinvn,matrinvs62 COMMON/matrfil/matriceun(iim,iim,nfilun),matriceus(iim,iim,nfilus)63 , , matricevn(iim,iim,nfilvn),matricevs(iim,iim,nfilvs)64 , , matrinvn(iim,iim,nfilun),matrinvs (iim,iim,nfilus)65 cym REAL eignq(iim), sdd1(iim),sdd2(iim)66 67 REAL eignq(iim)68 REAL :: sdd1(iim),sdd2(iim)69 63 70 64 LOGICAL griscal … … 74 68 REAL :: champ_in(iip1,nlat,nbniv) 75 69 76 REAL,SAVE,TARGET :: sddu_loc(iim)77 REAL,SAVE,TARGET :: sddv_loc(iim)78 REAL,SAVE,TARGET :: unsddu_loc(iim)79 REAL,SAVE,TARGET :: unsddv_loc(iim)80 c$OMP THREADPRIVATE(sddu_loc,sddv_loc,unsddu_loc,unsddv_loc)81 70 LOGICAL,SAVE :: first=.TRUE. 82 71 c$OMP THREADPRIVATE(first) 83 72 73 REAL, DIMENSION(iip1,nlat,nbniv) :: champ_loc 74 INTEGER :: ll_nb, nbniv_loc 75 REAL, SAVE :: sdd12(iim,4) 76 c$OMP THREADPRIVATE(sdd12) 77 78 INTEGER, PARAMETER :: type_sddu=1 79 INTEGER, PARAMETER :: type_sddv=2 80 INTEGER, PARAMETER :: type_unsddu=3 81 INTEGER, PARAMETER :: type_unsddv=4 82 83 INTEGER :: sdd1_type, sdd2_type 84 84 85 IF (first) THEN 85 sddu_loc(1:iim)=sddu(1:iim) 86 sddv_loc(1:iim)=sddv(1:iim) 87 unsddu_loc(1:iim)=unsddu(1:iim) 88 unsddv_loc(1:iim)=unsddv(1:iim) 89 CALL Init_timer 90 first=.FALSE. 91 c PRINT *,"----> sddu_loc=",sddu_loc 92 c PRINT *,"----> sddv_loc=",sddv_loc 93 c PRINT *,"----> unsddu_loc=",unsddu_loc 94 c PRINT *,"----> unsddv_loc=",unsddv_loc 86 sdd12(1:iim,type_sddu) = sddu(1:iim) 87 sdd12(1:iim,type_sddv) = sddv(1:iim) 88 sdd12(1:iim,type_unsddu) = unsddu(1:iim) 89 sdd12(1:iim,type_unsddv) = unsddv(1:iim) 90 91 CALL Init_timer 92 first=.FALSE. 95 93 ENDIF 96 94 … … 99 97 c$OMP END MASTER 100 98 99 c-------------------------------------------------------c 100 101 101 IF(ifiltre.EQ.1.or.ifiltre.EQ.-1) 102 *STOP'Pas de transformee simple dans cette version'103 102 & STOP'Pas de transformee simple dans cette version' 103 104 104 IF( iter.EQ. 2 ) THEN 105 PRINT *,' Pas d iteration du filtre dans cette version !'106 *, ' Utiliser old_filtreg et repasser !'107 105 PRINT *,' Pas d iteration du filtre dans cette version !' 106 & , ' Utiliser old_filtreg et repasser !' 107 STOP 108 108 ENDIF 109 109 110 110 IF( ifiltre.EQ. -2 .AND..NOT.griscal ) THEN 111 PRINT *,' Cette routine ne calcule le filtre inverse que ',112 *' sur la grille des scalaires !'113 111 PRINT *,' Cette routine ne calcule le filtre inverse que ' 112 & , ' sur la grille des scalaires !' 113 STOP 114 114 ENDIF 115 115 116 116 IF( ifiltre.NE.2 .AND.ifiltre.NE. - 2 ) THEN 117 PRINT *,' Probleme dans filtreg car ifiltre NE 2 et NE -2'118 *,' corriger et repasser !'119 117 PRINT *,' Probleme dans filtreg car ifiltre NE 2 et NE -2' 118 & , ' corriger et repasser !' 119 STOP 120 120 ENDIF 121 121 c … … 127 127 IF( griscal ) THEN 128 128 IF( nlat. NE. jjp1 ) THEN 129 130 129 PRINT 1111 130 STOP 131 131 ELSE 132 c 133 IF( iaire.EQ.1 ) THEN 134 cym CALL SCOPY( iim, sddv, 1, sdd1, 1 ) 135 cym CALL SCOPY( iim, unsddv, 1, sdd2, 1 ) 136 cym sdd1=>sddv_loc 137 cym sdd2=>unsddv_loc 138 sdd1(1:iim)=sddv_loc(1:iim) 139 sdd2(1:iim)=unsddv_loc(1:iim) 140 ELSE 141 cym CALL SCOPY( iim, unsddv, 1, sdd1, 1 ) 142 cym CALL SCOPY( iim, sddv, 1, sdd2, 1 ) 143 sdd1(1:iim)=unsddv_loc(1:iim) 144 sdd2(1:iim)=sddv_loc(1:iim) 145 END IF 146 c 147 jdfil1 = 2 148 jffil1 = jfiltnu 149 jdfil2 = jfiltsu 150 jffil2 = jjm 151 END IF 132 c 133 IF( iaire.EQ.1 ) THEN 134 sdd1_type = type_sddv 135 sdd2_type = type_unsddv 136 ELSE 137 sdd1_type = type_unsddv 138 sdd2_type = type_sddv 139 ENDIF 140 c 141 jdfil1 = 2 142 jffil1 = jfiltnu 143 jdfil2 = jfiltsu 144 jffil2 = jjm 145 ENDIF 152 146 ELSE 153 IF( nlat.NE.jjm ) THEN 154 PRINT 2222 155 STOP 156 ELSE 157 c 158 IF( iaire.EQ.1 ) THEN 159 cym CALL SCOPY( iim, sddu, 1, sdd1, 1 ) 160 cym CALL SCOPY( iim, unsddu, 1, sdd2, 1 ) 161 cym sdd1=>sddu_loc 162 cym sdd2=>unsddu_loc 163 sdd1(1:iim)=sddu_loc(1:iim) 164 sdd2(1:iim)=unsddu_loc(1:iim) 165 166 ELSE 167 cym CALL SCOPY( iim, unsddu, 1, sdd1, 1 ) 168 cym CALL SCOPY( iim, sddu, 1, sdd2, 1 ) 169 cym sdd1=>unsddu_loc 170 cym sdd2=>sddu_loc 171 sdd1(1:iim)=unsddu_loc(1:iim) 172 sdd2(1:iim)=sddu_loc(1:iim) 173 END IF 174 c 175 jdfil1 = 1 176 jffil1 = jfiltnv 177 jdfil2 = jfiltsv 178 jffil2 = jjm 179 END IF 180 END IF 181 182 c PRINT *,"APPEL a filtreg --> sdd1=",sdd1 183 c PRINT *,"APPEL a filtreg --> sdd2=",sdd2 184 c PRINT *,"----> sddu_loc=",sddu_loc 185 c PRINT *,"----> sddv_loc=",sddv_loc 186 c PRINT *,"----> unsddu_loc=",unsddu_loc 187 c PRINT *,"----> unsddv_loc=",unsddv_loc 188 189 c 190 c 191 DO 100 hemisph = 1, 2 192 c 193 IF ( hemisph.EQ.1 ) THEN 194 c ym 195 jdfil = max(jdfil1,ibeg) 196 jffil = min(jffil1,iend) 197 ELSE 198 c ym 199 jdfil = max(jdfil2,ibeg) 200 jffil = min(jffil2,iend) 201 END IF 147 IF( nlat.NE.jjm ) THEN 148 PRINT 2222 149 STOP 150 ELSE 151 c 152 IF( iaire.EQ.1 ) THEN 153 sdd1_type = type_sddu 154 sdd2_type = type_unsddu 155 ELSE 156 sdd1_type = type_unsddu 157 sdd2_type = type_sddu 158 ENDIF 159 c 160 jdfil1 = 1 161 jffil1 = jfiltnv 162 jdfil2 = jfiltsv 163 jffil2 = jjm 164 ENDIF 165 ENDIF 166 c 167 DO hemisph = 1, 2 168 c 169 IF ( hemisph.EQ.1 ) THEN 170 cym 171 jdfil = max(jdfil1,ibeg) 172 jffil = min(jffil1,iend) 173 ELSE 174 cym 175 jdfil = max(jdfil2,ibeg) 176 jffil = min(jffil2,iend) 177 ENDIF 202 178 203 179 … … 206 182 cccccccccccccccccccccccccccccccccccccccccccc 207 183 208 IF (.NOT. use_filtre_fft) THEN 209 210 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 211 DO 50 l = 1, nbniv 212 DO 30 j = jdfil,jffil 213 214 215 DO 5 i = 1, iim 216 champ(i,j,l) = champ(i,j,l) * sdd1(i) 217 5 CONTINUE 218 c 219 220 IF( hemisph. EQ. 1 ) THEN 221 222 IF( ifiltre. EQ. -2 ) THEN 223 224 225 CALL SGEMV("N", iim,iim, 1.0, matrinvn(1,1,j),iim, 226 . champ(1,j,l), 1, 0.0, eignq, 1) 227 228 229 ELSE IF ( griscal ) THEN 230 231 CALL SGEMV("N", iim,iim, 1.0, matriceun(1,1,j),iim, 232 . champ(1,j,l), 1, 0.0, eignq, 1) 233 234 ELSE 235 236 CALL SGEMV("N", iim,iim, 1.0, matricevn(1,1,j),iim, 237 . champ(1,j,l), 1, 0.0, eignq, 1) 238 ENDIF 239 240 ELSE 241 242 IF( ifiltre. EQ. -2 ) THEN 243 244 CALL SGEMV("N",iim,iim,1.0, matrinvs(1,1,j-jfiltsu+1),iim, 245 . champ(1,j,l), 1, 0.0, eignq, 1) 246 247 ELSE IF ( griscal ) THEN 248 249 CALL SGEMV("N",iim,iim,1.0,matriceus(1,1,j-jfiltsu+1),iim, 250 . champ(1,j,l), 1, 0.0, eignq, 1) 251 ELSE 252 253 CALL SGEMV("N",iim,iim,1.0,matricevs(1,1,j-jfiltsv+1),iim, 254 . champ(1,j,l), 1, 0.0, eignq, 1) 255 ENDIF 256 257 ENDIF 258 259 260 c 261 IF( ifiltre.EQ. 2 ) THEN 262 263 DO 15 i = 1, iim 264 champ( i,j,l ) = ( champ(i,j,l) + eignq(i) ) * sdd2(i) 265 15 CONTINUE 266 267 ELSE 268 269 DO 16 i=1,iim 270 champ( i,j,l ) = ( champ(i,j,l) - eignq(i) ) * sdd2(i) 271 16 CONTINUE 272 273 ENDIF 274 c 275 champ( iip1,j,l ) = champ( 1,j,l ) 276 c 277 30 CONTINUE 278 c 279 50 CONTINUE 184 IF (.NOT. use_filtre_fft) THEN 185 186 c !---------------------------------! 187 c ! Agregation des niveau verticaux ! 188 c ! uniquement necessaire pour une ! 189 c ! execution OpenMP ! 190 c !---------------------------------! 191 ll_nb = 0 192 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 193 DO l = 1, nbniv 194 ll_nb = ll_nb+1 195 DO j = jdfil,jffil 196 DO i = 1, iim 197 champ_loc(i,j,ll_nb) = 198 & champ(i,j,l) * sdd12(i,sdd1_type) 199 ENDDO 200 ENDDO 201 ENDDO 280 202 c$OMP END DO NOWAIT 281 203 204 nbniv_loc = ll_nb 205 206 IF( hemisph.EQ.1 ) THEN 207 208 IF( ifiltre.EQ.-2 ) THEN 209 DO j = jdfil,jffil 210 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 211 & matrinvn(1,1,j), iim, 212 & champ_loc(1,j,1), iip1*nlat, 0.0, 213 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 214 ENDDO 215 216 ELSE IF ( griscal ) THEN 217 DO j = jdfil,jffil 218 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 219 & matriceun(1,1,j), iim, 220 & champ_loc(1,j,1), iip1*nlat, 0.0, 221 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 222 ENDDO 223 224 ELSE 225 DO j = jdfil,jffil 226 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 227 & matricevn(1,1,j), iim, 228 & champ_loc(1,j,1), iip1*nlat, 0.0, 229 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 230 ENDDO 231 232 ENDIF 233 234 ELSE 235 236 IF( ifiltre.EQ.-2 ) THEN 237 DO j = jdfil,jffil 238 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 239 & matrinvs(1,1,j-jfiltsu+1), iim, 240 & champ_loc(1,j,1), iip1*nlat, 0.0, 241 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 242 ENDDO 243 244 ELSE IF ( griscal ) THEN 245 246 DO j = jdfil,jffil 247 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 248 & matriceus(1,1,j-jfiltsu+1), iim, 249 & champ_loc(1,j,1), iip1*nlat, 0.0, 250 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 251 ENDDO 252 253 ELSE 254 255 DO j = jdfil,jffil 256 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 257 & matricevs(1,1,j-jfiltsv+1), iim, 258 & champ_loc(1,j,1), iip1*nlat, 0.0, 259 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 260 ENDDO 261 262 ENDIF 263 264 ENDIF 265 ! c 266 IF( ifiltre.EQ.2 ) THEN 267 268 c !-------------------------------------! 269 c ! Dés-agregation des niveau verticaux ! 270 c ! uniquement necessaire pour une ! 271 c ! execution OpenMP ! 272 c !-------------------------------------! 273 ll_nb = 0 274 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 275 DO l = 1, nbniv 276 ll_nb = ll_nb + 1 277 DO j = jdfil,jffil 278 DO i = 1, iim 279 champ( i,j,l ) = (champ_loc(i,j,ll_nb) 280 & + champ_fft(i,j-jdfil+1,ll_nb)) 281 & * sdd12(i,sdd2_type) 282 ENDDO 283 ENDDO 284 ENDDO 285 c$OMP END DO NOWAIT 286 287 ELSE 288 289 ll_nb = 0 290 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 291 DO l = 1, nbniv_loc 292 ll_nb = ll_nb + 1 293 DO j = jdfil,jffil 294 DO i = 1, iim 295 champ( i,j,l ) = (champ_loc(i,j,ll_nb) 296 & - champ_fft(i,j-jdfil+1,ll_nb)) 297 & * sdd12(i,sdd2_type) 298 ENDDO 299 ENDDO 300 ENDDO 301 c$OMP END DO NOWAIT 302 303 ENDIF 304 305 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 306 DO l = 1, nbniv 307 DO j = jdfil,jffil 308 champ( iip1,j,l ) = champ( 1,j,l ) 309 ENDDO 310 ENDDO 311 c$OMP END DO NOWAIT 312 282 313 ccccccccccccccccccccccccccccccccccccccccccccc 283 314 c Utilisation du filtre FFT 284 315 ccccccccccccccccccccccccccccccccccccccccccccc 285 316 286 ELSE317 ELSE 287 318 288 319 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 289 DO l=1,nbniv 290 DO j=jdfil,jffil 291 DO i = 1, iim 292 champ( i,j,l)= champ(i,j,l)*sdd1(i) 293 champ_fft( i,j,l) = champ(i,j,l) 294 ENDDO 320 DO l=1,nbniv 321 DO j=jdfil,jffil 322 DO i = 1, iim 323 champ( i,j,l)= champ(i,j,l)*sdd12(i,sdd1_type) 324 champ_fft( i,j,l) = champ(i,j,l) 325 ENDDO 326 ENDDO 295 327 ENDDO 296 ENDDO297 328 c$OMP END DO NOWAIT 298 329 299 IF (jdfil<=jffil) THEN300 IF( ifiltre. EQ. -2 ) THEN301 CALL Filtre_inv_fft(champ_fft,nlat,jdfil,jffil,nbniv)302 ELSE IF ( griscal ) THEN303 304 305 306 307 ENDIF308 309 310 IF( ifiltre.EQ. 2 ) THEN330 IF (jdfil<=jffil) THEN 331 IF( ifiltre. EQ. -2 ) THEN 332 CALL Filtre_inv_fft(champ_fft,nlat,jdfil,jffil,nbniv) 333 ELSE IF ( griscal ) THEN 334 CALL Filtre_u_fft(champ_fft,nlat,jdfil,jffil,nbniv) 335 ELSE 336 CALL Filtre_v_fft(champ_fft,nlat,jdfil,jffil,nbniv) 337 ENDIF 338 ENDIF 339 340 341 IF( ifiltre.EQ. 2 ) THEN 311 342 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 312 313 314 315 champ( i,j,l)=(champ(i,j,l)+champ_fft(i,j,l))316 . *sdd2(i)317 ENDDO318 ENDDO319 343 DO l=1,nbniv 344 DO j=jdfil,jffil 345 DO i = 1, iim 346 champ( i,j,l)=(champ(i,j,l)+champ_fft(i,j,l)) 347 & *sdd12(i,sdd2_type) 348 ENDDO 349 ENDDO 350 ENDDO 320 351 c$OMP END DO NOWAIT 321 352 ELSE 322 353 323 354 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 324 DO l=1,nbniv 325 DO j=jdfil,jffil 326 DO i = 1, iim 327 champ(i,j,l)=(champ(i,j,l)-champ_fft(i,j,l)) 328 . *sdd2(i) 329 ENDDO 355 DO l=1,nbniv 356 DO j=jdfil,jffil 357 DO i = 1, iim 358 champ(i,j,l)=(champ(i,j,l)-champ_fft(i,j,l)) 359 & *sdd12(i,sdd2_type) 360 ENDDO 361 ENDDO 362 ENDDO 363 c$OMP END DO NOWAIT 364 ENDIF 365 c 366 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 367 DO l=1,nbniv 368 DO j=jdfil,jffil 369 ! champ_FFT( iip1,j,l ) = champ_FFT( 1,j,l ) 370 champ( iip1,j,l ) = champ( 1,j,l ) 371 ENDDO 330 372 ENDDO 331 ENDDO332 c$OMP END DO NOWAIT333 ENDIF334 c335 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)336 DO l=1,nbniv337 DO j=jdfil,jffil338 ! champ_FFT( iip1,j,l ) = champ_FFT( 1,j,l )339 champ( iip1,j,l ) = champ( 1,j,l )340 ENDDO341 ENDDO342 373 c$OMP END DO NOWAIT 343 ENDIF374 ENDIF 344 375 c Fin de la zone de filtrage 345 376 346 377 347 100 CONTINUE378 ENDDO 348 379 349 380 ! DO j=1,nlat … … 359 390 360 391 c 361 1111FORMAT(//20x,'ERREUR dans le dimensionnement du tableau CHAMP a362 *filtrer, sur la grille des scalaires'/)363 2222FORMAT(//20x,'ERREUR dans le dimensionnement du tableau CHAMP a fi364 *ltrer, sur la grille de V ou de Z'/)392 1111 FORMAT(//20x,'ERREUR dans le dimensionnement du tableau CHAMP a 393 & filtrer, sur la grille des scalaires'/) 394 2222 FORMAT(//20x,'ERREUR dans le dimensionnement du tableau CHAMP a fi 395 & ltrer, sur la grille de V ou de Z'/) 365 396 c$OMP MASTER 366 397 CALL stop_timer -
LMDZ4/trunk/libf/dyn3dpar/fluxstokenc_p.F
r1021 r1146 61 61 CALL initfluxsto_p( 'fluxstoke', 62 62 . time_step,istdyn* time_step,istdyn* time_step, 63 . nqmx,fluxid,fluxvid,fluxdid)63 . fluxid,fluxvid,fluxdid) 64 64 65 65 ijb=ij_begin -
LMDZ4/trunk/libf/dyn3dpar/gcm.F
r1084 r1146 9 9 USE IOIPSL 10 10 #endif 11 11 12 USE mod_const_mpi, ONLY: init_const_mpi 12 13 USE parallel 13 14 USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb 14 USE mod_grid_phy_lmdz 15 USE mod_phys_lmdz_omp_data, ONLY: klon_omp 16 USE dimphy 15 USE infotrac 17 16 USE mod_interface_dyn_phys 18 USE comgeomphy19 17 USE mod_hallo 20 18 USE Bands 19 20 USE filtreg_mod 21 22 ! Ehouarn: for now these only apply to Earth: 23 #ifdef CPP_EARTH 24 USE mod_grid_phy_lmdz 25 USE mod_phys_lmdz_omp_data, ONLY: klon_omp 26 USE dimphy 27 USE comgeomphy 28 #endif 21 29 IMPLICIT NONE 22 30 … … 65 73 #include "iniprint.h" 66 74 #include "tracstoke.h" 67 #include "advtrac.h"68 75 69 76 INTEGER longcles … … 81 88 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants 82 89 REAL teta(ip1jmp1,llm) ! temperature potentielle 83 REAL q(ip1jmp1,llm,nqmx)! champs advectes90 REAL, ALLOCATABLE, DIMENSION(:,:,:) :: q ! champs advectes 84 91 REAL ps(ip1jmp1) ! pression au sol 85 92 c REAL p (ip1jmp1,llmp1 ) ! pression aux interfac.des couches … … 136 143 c variables pour l'initialisation de la physique : 137 144 c ------------------------------------------------ 138 INTEGER ngridmx ,nq145 INTEGER ngridmx 139 146 PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm ) 140 147 REAL zcufi(ngridmx),zcvfi(ngridmx) … … 158 165 159 166 160 c initialisation Anne161 hadv_flg(:) = 0.162 vadv_flg(:) = 0.163 conv_flg(:) = 0.164 pbl_flg(:) = 0.165 tracnam(:) = ' '166 nprath = 1167 nbtrac = 0168 mmt_adj(:,:,:,:) = 1169 170 171 c--------------------------------------------------------------------------172 c Iflag_phys controle l'appel a la physique :173 c -------------------------------------------174 c 0 : pas de physique175 c 1 : Normale (appel a phylmd, phymars ...)176 c 2 : rappel Newtonien pour la temperature + friction au sol177 iflag_phys=1178 179 c--------------------------------------------------------------------------180 c Lecture de l'etat initial :181 c ---------------------------182 c T : on lit start.nc183 c F : le modele s'autoinitialise avec un cas academique (iniacademic)184 #ifdef CPP_IOIPSL185 read_start=.true.186 #else187 read_start=.false.188 #endif189 190 167 c----------------------------------------------------------------------- 191 168 c Choix du calendrier … … 203 180 c --------------------------------------- 204 181 c 205 #ifdef CPP_IOIPSL 182 ! Ehouarn: dump possibility of using defrun 183 !#ifdef CPP_IOIPSL 206 184 CALL conf_gcm( 99, .TRUE. , clesphy0 ) 207 #else208 CALL defrun( 99, .TRUE. , clesphy0 )209 #endif185 !#else 186 ! CALL defrun( 99, .TRUE. , clesphy0 ) 187 !#endif 210 188 c 211 189 c … … 217 195 call init_parallel 218 196 call Read_Distrib 219 CALL Init_Phys_lmdz(iim,jjp1,llm,nqmx-2,mpi_size,distrib_phys) 197 ! Ehouarn : temporarily (?) keep this only for Earth 198 if (planet_type.eq."earth") then 199 #ifdef CPP_EARTH 200 CALL Init_Phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys) 201 #endif 202 endif ! of if (planet_type.eq."earth") 220 203 CALL set_bands 221 204 CALL Init_interface_dyn_phys … … 229 212 c$OMP END PARALLEL 230 213 214 ! Ehouarn : temporarily (?) keep this only for Earth 215 if (planet_type.eq."earth") then 216 #ifdef CPP_EARTH 231 217 c$OMP PARALLEL 232 218 call InitComgeomphy 233 219 c$OMP END PARALLEL 220 #endif 221 endif ! of if (planet_type.eq."earth") 234 222 235 223 IF (config_inca /= 'none') THEN 236 224 #ifdef INCA 237 225 call init_const_lmdz( 238 $ nbtr ac,anneeref,dayref,226 $ nbtr,anneeref,dayref, 239 227 $ iphysiq,day_step,nday) 240 228 … … 248 236 c Initialisation des traceurs 249 237 c --------------------------- 250 c Choix du schema pour l'advection 251 c dans fichier trac.def ou via INCA 252 253 call iniadvtrac(nq) 254 c 238 c Choix du nombre de traceurs et du schema pour l'advection 239 c dans fichier traceur.def, par default ou via INCA 240 call infotrac_init 241 242 c Allocation de la tableau q : champs advectes 243 ALLOCATE(q(ip1jmp1,llm,nqtot)) 244 255 245 c----------------------------------------------------------------------- 256 246 c Lecture de l'etat initial : … … 259 249 c lecture du fichier start.nc 260 250 if (read_start) then 261 #ifdef CPP_IOIPSL 262 CALL dynetat0("start.nc",nqmx,vcov,ucov, 251 ! we still need to run iniacademic to initialize some 252 ! constants & fields, if we run the 'newtonian' case: 253 if (iflag_phys.eq.2) then 254 CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) 255 endif 256 !#ifdef CPP_IOIPSL 257 if (planet_type.eq."earth") then 258 #ifdef CPP_EARTH 259 ! Load an Earth-format start file 260 CALL dynetat0("start.nc",vcov,ucov, 263 261 . teta,q,masse,ps,phis, time_0) 262 #endif 263 endif ! of if (planet_type.eq."earth") 264 264 c write(73,*) 'ucov',ucov 265 265 c write(74,*) 'vcov',vcov … … 268 268 c write(77,*) 'q',q 269 269 270 #endif 271 endif 270 endif ! of if (read_start) 272 271 273 272 c le cas echeant, creation d un etat initial 274 273 IF (prt_level > 9) WRITE(lunout,*) 275 . 'AVANT iniacademic AVANT AVANT AVANT AVANT'274 . 'GCM: AVANT iniacademic AVANT AVANT AVANT AVANT' 276 275 if (.not.read_start) then 277 CALL iniacademic( nqmx,vcov,ucov,teta,q,masse,ps,phis,time_0)276 CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) 278 277 endif 279 280 278 281 279 c----------------------------------------------------------------------- … … 359 357 c Initialisation de la physique : 360 358 c ------------------------------- 361 #ifdef CPP_PHYS362 359 IF (call_iniphys.and.iflag_phys.eq.1) THEN 363 360 latfi(1)=rlatu(1) … … 380 377 381 378 WRITE(lunout,*) 382 . 'WARNING!!! vitesse verticale nulle dans la physique' 383 379 . 'GCM: WARNING!!! vitesse verticale nulle dans la physique' 380 ! Earth: 381 if (planet_type.eq."earth") then 382 #ifdef CPP_EARTH 384 383 CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys , 385 384 , latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp ) 386 385 #endif 386 endif ! of if (planet_type.eq."earth") 387 387 call_iniphys=.false. 388 389 ENDIF 390 #endif 388 ENDIF ! of IF (call_iniphys.and.(iflag_phys.eq.1)) 391 389 392 390 … … 404 402 405 403 c----------------------------------------------------------------------- 404 c Initialisation des dimensions d'INCA : 405 c -------------------------------------- 406 IF (config_inca /= 'none') THEN 407 !$OMP PARALLEL 408 #ifdef INCA 409 CALL init_inca_dim(klon_omp,llm,iim,jjm, 410 $ rlonu,rlatu,rlonv,rlatv) 411 #endif 412 !$OMP END PARALLEL 413 END IF 414 415 c----------------------------------------------------------------------- 406 416 c Initialisation des I/O : 407 417 c ------------------------ … … 410 420 day_end = day_ini + nday 411 421 WRITE(lunout,300)day_ini,day_end 422 300 FORMAT('1'/,15x,'run du jour',i7,2x,'au jour',i7//) 423 424 !#ifdef CPP_IOIPSL 425 if (planet_type.eq."earth") then 426 #ifdef CPP_EARTH 427 CALL dynredem0_p("restart.nc", day_end, phis) 428 #endif 429 endif 430 431 ecripar = .TRUE. 412 432 413 433 #ifdef CPP_IOIPSL 414 CALL dynredem0_p("restart.nc", day_end, phis, nqmx)415 416 ecripar = .TRUE.417 418 434 if ( 1.eq.1) then 419 435 time_step = zdtvr … … 421 437 t_wrt = iecri * daysec 422 438 CALL inithist_p(dynhist_file,day_ref,annee_ref,time_step, 423 . t_ops, t_wrt, nqmx, histid, histvid) 424 425 t_ops = iperiod * time_step 426 t_wrt = periodav * daysec 427 CALL initdynav_p(dynhistave_file,day_ref,annee_ref,time_step, 428 . t_ops, t_wrt, nqmx, histaveid) 429 439 . t_ops, t_wrt, histid, histvid) 440 441 IF (ok_dynzon) THEN 442 t_ops = iperiod * time_step 443 t_wrt = periodav * daysec 444 CALL initdynav_p(dynhistave_file,day_ref,annee_ref,time_step, 445 . t_ops, t_wrt, histaveid) 446 END IF 430 447 dtav = iperiod*dtvr/daysec 431 448 endif … … 433 450 434 451 #endif 452 ! #endif of #ifdef CPP_IOIPSL 435 453 436 454 c Choix des frequences de stokage pour le offline … … 453 471 454 472 c$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/,/logic/) 455 CALL leapfrog_p(ucov,vcov,teta,ps,masse,phis, nq,q,clesphy0,473 CALL leapfrog_p(ucov,vcov,teta,ps,masse,phis,q,clesphy0, 456 474 . time_0) 457 475 c$OMP END PARALLEL 458 476 459 477 460 300 FORMAT('1'/,15x,'run du pas',i7,2x,'au pas',i7,2x,461 . 'c''est a dire du jour',i7,3x,'au jour',i7//)462 478 END 463 479 -
LMDZ4/trunk/libf/dyn3dpar/groupeun_p.F
r764 r1146 1 subroutinegroupeun_p(jjmax,llmax,jjb,jje,q)1 SUBROUTINE groupeun_p(jjmax,llmax,jjb,jje,q) 2 2 USE parallel 3 implicit none3 IMPLICIT NONE 4 4 5 5 #include "dimensions.h" … … 8 8 #include "comgeom2.h" 9 9 10 integerjjmax,llmax,jjb,jje11 realq(iip1,jjmax,llmax)10 INTEGER jjmax,llmax,jjb,jje 11 REAL q(iip1,jjmax,llmax) 12 12 13 integerngroup14 parameter(ngroup=3)13 INTEGER ngroup 14 PARAMETER (ngroup=3) 15 15 16 real airen,airecn,qn17 real aires,airecs,qs16 REAL airecn,qn 17 REAL airecs,qs 18 18 19 integeri,j,l,ig,j1,j2,i0,jd19 INTEGER i,j,l,ig,j1,j2,i0,jd 20 20 21 Champs 3D 21 c--------------------------------------------------------------------c 22 c Strategie d'optimisation c 23 c stocker les valeurs systematiquement recalculees c 24 c et identiques d'un pas de temps sur l'autre. Il s'agit des c 25 c aires des cellules qui sont sommees. S'il n'y a pas de changement c 26 c de grille au cours de la simulation tout devrait bien se passer. c 27 c Autre optimisation : determination des bornes entre lesquelles "j" c 28 c varie, au lieu de faire un test à chaque fois... 29 c--------------------------------------------------------------------c 30 31 INTEGER j_start, j_finish 32 33 REAL, SAVE :: airen_tab(iip1,jjp1,0:1) 34 REAL, SAVE :: aires_tab(iip1,jjp1,0:1) 35 !$OMP THREADPRIVATE(airen_tab, aires_tab) 36 37 LOGICAL, SAVE :: first = .TRUE. 38 !$OMP THREADPRIVATE(first) 39 40 IF (first) THEN 41 CALL INIT_GROUPEUN_P(airen_tab, aires_tab) 42 first = .FALSE. 43 ENDIF 44 45 c Champs 3D 22 46 jd=jjp1-jjmax 23 47 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 24 do l=1,llm 25 j1=1+jd 26 j2=2 27 do ig=1,ngroup 28 do j=j1-jd,j2-jd 29 c print*,'groupe ',ig,' j= ',j,2**(ngroup-ig+1),'pts groupes' 30 if ( j >= jjb .AND. j <= jje) THEN 31 32 do i0=1,iim,2**(ngroup-ig+1) 33 34 airen=0. 35 airecn=0. 36 qn=0. 37 38 do i=i0,i0+2**(ngroup-ig+1)-1 39 airen=airen+aire(i,j) 40 qn=qn+q(i,j,l) 41 enddo 42 airecn=0. 43 do i=i0,i0+2**(ngroup-ig+1)-1 44 q(i,j,l)=qn*aire(i,j)/airen 45 enddo 46 enddo 47 q(iip1,j,l)=q(1,j,l) 48 49 endif 48 DO l=1,llm 49 j1=1+jd 50 j2=2 51 DO ig=1,ngroup 52 53 c Concerne le pole nord 54 j_start = MAX(jjb, j1-jd) 55 j_finish = MIN(jje, j2-jd) 56 DO j=j_start, j_finish 57 DO i0=1,iim,2**(ngroup-ig+1) 58 qn=0. 59 DO i=i0,i0+2**(ngroup-ig+1)-1 60 qn=qn+q(i,j,l) 61 ENDDO 62 DO i=i0,i0+2**(ngroup-ig+1)-1 63 q(i,j,l)=qn*airen_tab(i,j,jd) 64 ENDDO 65 ENDDO 66 q(iip1,j,l)=q(1,j,l) 67 ENDDO 68 69 !c Concerne le pole sud 70 j_start = MAX(1+jjp1-jje-jd, j1-jd) 71 j_finish = MIN(1+jjp1-jjb-jd, j2-jd) 72 DO j=j_start, j_finish 73 DO i0=1,iim,2**(ngroup-ig+1) 74 qs=0. 75 DO i=i0,i0+2**(ngroup-ig+1)-1 76 qs=qs+q(i,jjp1-j+1-jd,l) 77 ENDDO 78 DO i=i0,i0+2**(ngroup-ig+1)-1 79 q(i,jjp1-j+1-jd,l)=qs*aires_tab(i,jjp1-j+1,jd) 80 ENDDO 81 ENDDO 82 q(iip1,jjp1-j+1-jd,l)=q(1,jjp1-j+1-jd,l) 83 ENDDO 84 85 j1=j2+1 86 j2=j2+2**ig 87 ENDDO 88 ENDDO 89 !$OMP END DO NOWAIT 90 91 RETURN 92 END 93 94 95 96 SUBROUTINE INIT_GROUPEUN_P(airen_tab, aires_tab) 97 98 USE parallel 99 IMPLICIT NONE 100 101 #include "dimensions.h" 102 #include "paramet.h" 103 #include "comconst.h" 104 #include "comgeom2.h" 105 106 INTEGER ngroup 107 PARAMETER (ngroup=3) 108 109 REAL airen,airecn 110 REAL aires,airecs 111 112 INTEGER i,j,l,ig,j1,j2,i0,jd 113 114 INTEGER j_start, j_finish 115 116 REAL :: airen_tab(iip1,jjp1,0:1) 117 REAL :: aires_tab(iip1,jjp1,0:1) 118 119 DO jd=0, 1 120 j1=1+jd 121 j2=2 122 DO ig=1,ngroup 50 123 51 if ( jjp1-j+1-jd >= jjb .AND. jjp1-j+1-jd <= jje) THEN 52 53 do i0=1,iim,2**(ngroup-ig+1) 54 aires=0. 55 airecs=0. 56 qs=0. 57 do i=i0,i0+2**(ngroup-ig+1)-1 58 aires=aires+aire(i,jjp1-j+1) 59 qs=qs+q(i,jjp1-j+1-jd,l) 60 enddo 61 airecs=0. 62 do i=i0,i0+2**(ngroup-ig+1)-1 63 q(i,jjp1-j+1-jd,l)=qs*aire(i,jjp1-j+1)/aires 64 enddo 65 enddo 66 q(iip1,jjp1-j+1-jd,l)=q(1,jjp1-j+1-jd,l) 67 68 endif 69 enddo 70 71 j1=j2+1 72 j2=j2+2**ig 73 enddo 74 enddo 75 c$OMP END DO NOWAIT 76 return 77 end 124 ! c Concerne le pole nord 125 j_start = j1-jd 126 j_finish = j2-jd 127 DO j=j_start, j_finish 128 DO i0=1,iim,2**(ngroup-ig+1) 129 airen=0. 130 DO i=i0,i0+2**(ngroup-ig+1)-1 131 airen = airen+aire(i,j) 132 ENDDO 133 DO i=i0,i0+2**(ngroup-ig+1)-1 134 airen_tab(i,j,jd) = 135 & aire(i,j) / airen 136 ENDDO 137 ENDDO 138 ENDDO 139 140 ! c Concerne le pole sud 141 j_start = j1-jd 142 j_finish = j2-jd 143 DO j=j_start, j_finish 144 DO i0=1,iim,2**(ngroup-ig+1) 145 aires=0. 146 DO i=i0,i0+2**(ngroup-ig+1)-1 147 aires=aires+aire(i,jjp1-j+1) 148 ENDDO 149 DO i=i0,i0+2**(ngroup-ig+1)-1 150 aires_tab(i,jjp1-j+1,jd) = 151 & aire(i,jjp1-j+1) / aires 152 ENDDO 153 ENDDO 154 ENDDO 155 156 j1=j2+1 157 j2=j2+2**ig 158 ENDDO 159 ENDDO 160 161 RETURN 162 END -
LMDZ4/trunk/libf/dyn3dpar/guide_p.F
r1049 r1146 4 4 subroutine guide_pp(itau,ucov,vcov,teta,q,masse,ps) 5 5 USE parallel 6 use netcdf 6 7 7 8 IMPLICIT NONE … … 229 230 IF (mpi_rank==0) THEN 230 231 if (guide_modele) then 231 if (ncidpl.eq.-99) ncidpl=NCOPN('apbp.nc',NCNOWRIT,rcod) 232 else 233 if (guide_u) then 234 if (ncidpl.eq.-99) ncidpl=NCOPN('u.nc',NCNOWRIT,rcod) 235 endif 236 c 237 if (guide_v) then 238 if (ncidpl.eq.-99) ncidpl=NCOPN('v.nc',NCNOWRIT,rcod) 239 endif 240 c 241 if (guide_T) then 242 if (ncidpl.eq.-99) ncidpl=NCOPN('T.nc',NCNOWRIT,rcod) 243 endif 244 c 245 if (guide_Q) then 246 if (ncidpl.eq.-99) ncidpl=NCOPN('hur.nc',NCNOWRIT,rcod) 247 endif 232 if (ncidpl.eq.-99) rcod=nf90_open('apbp.nc',Nf90_NOWRITe, 233 $ ncidpl) 234 else 235 if (guide_u) then 236 if (ncidpl.eq.-99) rcod=nf90_open('u.nc',Nf90_NOWRITe, 237 $ ncidpl) 238 endif 239 c 240 if (guide_v) then 241 if (ncidpl.eq.-99) rcod=nf90_open('v.nc',nf90_nowrite, 242 $ ncidpl) 243 endif 244 c 245 if (guide_T) then 246 if (ncidpl.eq.-99) rcod=nf90_open('T.nc',nf90_nowrite, 247 $ ncidpl) 248 endif 249 c 250 if (guide_Q) then 251 if (ncidpl.eq.-99) rcod=nf90_open('hur.nc',nf90_nowrite, 252 $ ncidpl) 253 endif 248 254 c 249 255 endif !guide_modele … … 256 262 status=NF_INQ_DIMLEN(ncidpl,rid,nlev) 257 263 print *,'nlev guide', nlev 258 call ncclos(ncidpl,rcod)264 rcod = nf90_close(ncidpl) 259 265 c Lecture du premier etat des reanalyses. 260 266 call Gather_Field(ps,ip1jmp1,1,0) -
LMDZ4/trunk/libf/dyn3dpar/iniacademic.F
r774 r1146 4 4 c 5 5 c 6 SUBROUTINE iniacademic(nq,vcov,ucov,teta,q,masse,ps,phis,time_0) 6 SUBROUTINE iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) 7 8 USE filtreg_mod 9 USE infotrac, ONLY : nqtot 7 10 8 11 c%W% %G% … … 42 45 #include "temps.h" 43 46 #include "control.h" 47 #include "iniprint.h" 44 48 45 49 c Arguments: 46 50 c ---------- 47 51 48 integer nq49 52 real time_0 50 53 … … 52 55 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants 53 56 REAL teta(ip1jmp1,llm) ! temperature potentielle 54 REAL q(ip1jmp1,llm,nq )! champs advectes57 REAL q(ip1jmp1,llm,nqtot) ! champs advectes 55 58 REAL ps(ip1jmp1) ! pression au sol 56 59 REAL masse(ip1jmp1,llm) ! masse d'air 60 REAL phis(ip1jmp1) ! geopotentiel au sol 61 62 c Local: 63 c ------ 64 57 65 REAL p (ip1jmp1,llmp1 ) ! pression aux interfac.des couches 58 66 REAL pks(ip1jmp1) ! exner au sol 59 67 REAL pk(ip1jmp1,llm) ! exner au milieu des couches 60 68 REAL pkf(ip1jmp1,llm) ! exner filt.au milieu des couches 61 REAL phis(ip1jmp1) ! geopotentiel au sol62 69 REAL phi(ip1jmp1,llm) ! geopotentiel 63 64 65 66 67 68 c Local:69 c ------70 71 70 REAL ddsin,tetarappelj,tetarappell,zsig 72 71 real tetajl(jjp1,llm) … … 79 78 80 79 c----------------------------------------------------------------------- 80 ! 1. Initializations for Earth-like case 81 ! -------------------------------------- 82 if (planet_type=="earth") then 83 c 84 time_0=0. 81 85 82 c 83 time_0=0. 86 im = iim 87 jm = jjm 88 day_ini = 0 89 omeg = 4.*asin(1.)/86400. 90 rad = 6371229. 91 g = 9.8 92 daysec = 86400. 93 dtvr = daysec/FLOAT(day_step) 94 zdtvr=dtvr 95 kappa = 0.2857143 96 cpp = 1004.70885 97 preff = 101325. 98 pa = 50000. 99 etot0 = 0. 100 ptot0 = 0. 101 ztot0 = 0. 102 stot0 = 0. 103 ang0 = 0. 84 104 85 im = iim 86 jm = jjm 87 day_ini = 0 88 omeg = 4.*asin(1.)/86400. 89 rad = 6371229. 90 g = 9.8 91 daysec = 86400. 92 dtvr = daysec/FLOAT(day_step) 93 zdtvr=dtvr 94 kappa = 0.2857143 95 cpp = 1004.70885 96 preff = 101325. 97 pa = 50 000. 98 etot0 = 0. 99 ptot0 = 0. 100 ztot0 = 0. 101 stot0 = 0. 102 ang0 = 0. 103 pa = 0. 105 CALL iniconst 106 CALL inigeom 107 CALL inifilr 104 108 105 CALL inicons0 106 CALL inigeom 107 CALL inifilr 108 109 ps=0. 110 phis=0. 109 ps=0. 110 phis=0. 111 111 c--------------------------------------------------------------------- 112 112 113 taurappel=10.*daysec113 taurappel=10.*daysec 114 114 115 115 c--------------------------------------------------------------------- … … 117 117 c -------------------------------------- 118 118 119 DO l=1,llm120 zsig=ap(l)/preff+bp(l)121 if (zsig.gt.0.3) then122 lsup=l123 tetarappell=1./8.*(-log(zsig)-.5)124 DO j=1,jjp1125 ddsin=sin(rlatu(j))-sin(pi/20.)126 tetajl(j,l)=300.*(1+1./18.*(1.-3.*ddsin*ddsin)+tetarappell)127 ENDDO128 else119 DO l=1,llm 120 zsig=ap(l)/preff+bp(l) 121 if (zsig.gt.0.3) then 122 lsup=l 123 tetarappell=1./8.*(-log(zsig)-.5) 124 DO j=1,jjp1 125 ddsin=sin(rlatu(j))-sin(pi/20.) 126 tetajl(j,l)=300.*(1+1./18.*(1.-3.*ddsin*ddsin)+tetarappell) 127 ENDDO 128 else 129 129 c Choix isotherme au-dessus de 300 mbar 130 do j=1,jjp1131 tetajl(j,l)=tetajl(j,lsup)*(0.3/zsig)**kappa132 enddo133 endif134 ENDDO130 do j=1,jjp1 131 tetajl(j,l)=tetajl(j,lsup)*(0.3/zsig)**kappa 132 enddo 133 endif ! of if (zsig.gt.0.3) 134 ENDDO ! of DO l=1,llm 135 135 136 do l=1,llm137 do j=1,jjp1138 do i=1,iip1139 ij=(j-1)*iip1+i140 tetarappel(ij,l)=tetajl(j,l)141 enddo142 enddo143 enddo136 do l=1,llm 137 do j=1,jjp1 138 do i=1,iip1 139 ij=(j-1)*iip1+i 140 tetarappel(ij,l)=tetajl(j,l) 141 enddo 142 enddo 143 enddo 144 144 145 c call dump2d(jjp1,llm,tetajl,'TEQ ')145 c call dump2d(jjp1,llm,tetajl,'TEQ ') 146 146 147 ps=1.e5148 phis=0.149 CALL pression ( ip1jmp1, ap, bp, ps, p )150 CALL exner_hyb( ip1jmp1, ps, p,alpha,beta, pks, pk, pkf )151 CALL massdair(p,masse)147 ps=1.e5 148 phis=0. 149 CALL pression ( ip1jmp1, ap, bp, ps, p ) 150 CALL exner_hyb( ip1jmp1, ps, p,alpha,beta, pks, pk, pkf ) 151 CALL massdair(p,masse) 152 152 153 153 c intialisation du vent et de la temperature 154 teta(:,:)=tetarappel(:,:)155 CALL geopot(ip1jmp1,teta,pk,pks,phis,phi)156 call ugeostr(phi,ucov)157 vcov=0.158 q(:,:,1 )=1.e-10159 q(:,:,2 )=1.e-15160 q(:,:,3:nq)=0.154 teta(:,:)=tetarappel(:,:) 155 CALL geopot(ip1jmp1,teta,pk,pks,phis,phi) 156 call ugeostr(phi,ucov) 157 vcov=0. 158 q(:,:,1 )=1.e-10 159 q(:,:,2 )=1.e-15 160 q(:,:,3:nqtot)=0. 161 161 162 162 163 c perturbation al \351atoire sur la temp\351rature164 idum = -1165 zz = ran1(idum)166 idum = 0167 do l=1,llm168 do ij=iip2,ip1jm169 teta(ij,l)=teta(ij,l)*(1.+0.005*ran1(idum))170 enddo171 enddo163 c perturbation aleatoire sur la temperature 164 idum = -1 165 zz = ran1(idum) 166 idum = 0 167 do l=1,llm 168 do ij=iip2,ip1jm 169 teta(ij,l)=teta(ij,l)*(1.+0.005*ran1(idum)) 170 enddo 171 enddo 172 172 173 do l=1,llm174 do ij=1,ip1jmp1,iip1175 teta(ij+iim,l)=teta(ij,l)176 enddo177 enddo173 do l=1,llm 174 do ij=1,ip1jmp1,iip1 175 teta(ij+iim,l)=teta(ij,l) 176 enddo 177 enddo 178 178 179 179 … … 185 185 186 186 c initialisation d'un traceur sur une colonne 187 j=jjp1*3/4 188 i=iip1/2 189 ij=(j-1)*iip1+i 190 q(ij,:,3)=1. 191 187 j=jjp1*3/4 188 i=iip1/2 189 ij=(j-1)*iip1+i 190 q(ij,:,3)=1. 191 192 else 193 write(lunout,*)"iniacademic: planet types other than earth", 194 & " not implemented (yet)." 195 stop 196 endif ! of if (planet_type=="earth") 192 197 return 193 198 END -
LMDZ4/trunk/libf/dyn3dpar/initdynav_p.F
r1000 r1146 4 4 c 5 5 c 6 subroutine initdynav_p(infile,day0,anne0,tstep,t_ops,t_wrt 7 . ,nq,fileid) 6 subroutine initdynav_p(infile,day0,anne0,tstep,t_ops,t_wrt,fileid) 8 7 9 8 USE IOIPSL … … 11 10 use Write_field 12 11 use misc_mod 12 USE infotrac 13 13 14 implicit none 14 15 … … 30 31 C t_ops: frequence de l'operation pour IOIPSL 31 32 C t_wrt: frequence d'ecriture sur le fichier 32 C nq: nombre de traceurs33 33 C 34 34 C Sortie: … … 50 50 #include "description.h" 51 51 #include "serre.h" 52 #include "advtrac.h"53 52 54 53 C Arguments … … 58 57 real tstep, t_ops, t_wrt 59 58 integer fileid 60 integer nq61 59 integer thoriid, zvertiid 62 60 … … 82 80 83 81 INTEGER :: dynave_domain_id 84 85 82 86 83 if (adjust) return … … 169 166 C Traceurs 170 167 C 171 DO iq=1,nq 168 DO iq=1,nqtot 172 169 call histdef(fileid, ttext(iq), ttext(iq), '-', 173 170 . iip1, jjn, thoriid, llm, 1, llm, zvertiid, -
LMDZ4/trunk/libf/dyn3dpar/initfluxsto_p.F
r1000 r1146 3 3 ! 4 4 subroutine initfluxsto_p 5 . (infile,tstep,t_ops,t_wrt, nq,5 . (infile,tstep,t_ops,t_wrt, 6 6 . fileid,filevid,filedid) 7 7 … … 30 30 C t_ops: frequence de l'operation pour IOIPSL 31 31 C t_wrt: frequence d'ecriture sur le fichier 32 C nq: nombre de traceurs33 32 C 34 33 C Sortie: … … 58 57 real tstep, t_ops, t_wrt 59 58 integer fileid, filevid,filedid 60 integer n q,ndex(1)59 integer ndex(1) 61 60 real nivd(1) 62 61 … … 87 86 INTEGER :: dynu_domain_id 88 87 INTEGER :: dynv_domain_id 89 90 88 91 89 C -
LMDZ4/trunk/libf/dyn3dpar/inithist_p.F
r1000 r1146 2 2 ! $Header$ 3 3 ! 4 subroutine inithist_p(infile,day0,anne0,tstep,t_ops,t_wrt, nq,4 subroutine inithist_p(infile,day0,anne0,tstep,t_ops,t_wrt, 5 5 . fileid,filevid) 6 6 … … 9 9 use Write_field 10 10 use misc_mod 11 USE infotrac 11 12 12 13 implicit none … … 29 30 C t_ops: frequence de l'operation pour IOIPSL 30 31 C t_wrt: frequence d'ecriture sur le fichier 31 C nq: nombre de traceurs32 32 C 33 33 C Sortie: … … 50 50 #include "description.h" 51 51 #include "serre.h" 52 #include "advtrac.h"53 52 54 53 C Arguments … … 58 57 real tstep, t_ops, t_wrt 59 58 integer fileid, filevid 60 integer nq61 59 62 60 C Variables locales … … 83 81 INTEGER :: dynu_domain_id 84 82 INTEGER :: dynv_domain_id 83 85 84 C 86 85 C Initialisations … … 217 216 C Traceurs 218 217 C 219 DO iq=1,nq 218 DO iq=1,nqtot 220 219 call histdef(fileid, ttext(iq), ttext(iq), '-', 221 220 . iip1, jjn, thoriid, llm, 1, llm, zvertiid, -
LMDZ4/trunk/libf/dyn3dpar/integrd_p.F
r985 r1146 32 32 #include "temps.h" 33 33 #include "serre.h" 34 #include "advtrac.h"35 34 36 35 c Arguments: -
LMDZ4/trunk/libf/dyn3dpar/leapfrog_p.F
r1000 r1146 4 4 c 5 5 c 6 #define IO_DEBUG 7 8 #undef CPP_IOIPSL 9 #define CPP_IOIPSL 10 11 SUBROUTINE leapfrog_p(ucov,vcov,teta,ps,masse,phis,nq,q,clesphy0, 6 7 SUBROUTINE leapfrog_p(ucov,vcov,teta,ps,masse,phis,q,clesphy0, 12 8 & time_0) 13 9 … … 21 17 USE vampir 22 18 USE timer_filtre, ONLY : print_filtre_timer 19 USE infotrac 23 20 24 21 IMPLICIT NONE … … 69 66 #include "com_io_dyn.h" 70 67 #include "iniprint.h" 71 72 c#include "tracstoke.h"73 74 68 #include "academic.h" 75 !#include "clesphys.h"76 #include "advtrac.h"77 69 78 integer nq79 80 70 INTEGER longcles 81 71 PARAMETER ( longcles = 20 ) … … 88 78 REAL :: vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants 89 79 REAL :: teta(ip1jmp1,llm) ! temperature potentielle 90 REAL :: q(ip1jmp1,llm,nq mx)! champs advectes80 REAL :: q(ip1jmp1,llm,nqtot) ! champs advectes 91 81 REAL :: ps(ip1jmp1) ! pression au sol 92 82 REAL,SAVE :: p (ip1jmp1,llmp1 ) ! pression aux interfac.des couches … … 109 99 c tendances dynamiques 110 100 REAL,SAVE :: dv(ip1jm,llm),du(ip1jmp1,llm) 111 REAL,SAVE :: dteta(ip1jmp1,llm),dq(ip1jmp1,llm,nqmx),dp(ip1jmp1) 101 REAL,SAVE :: dteta(ip1jmp1,llm),dp(ip1jmp1) 102 REAL,DIMENSION(:,:,:), ALLOCATABLE, SAVE :: dq 112 103 113 104 c tendances de la dissipation … … 118 109 REAL,SAVE :: dvfi(ip1jm,llm),dufi(ip1jmp1,llm) 119 110 REAL,SAVE :: dtetafi(ip1jmp1,llm) 120 REAL,SAVE :: dqfi(ip1jmp1,llm,nqmx),dpfi(ip1jmp1) 111 REAL,SAVE :: dpfi(ip1jmp1) 112 REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: dqfi 121 113 122 114 c variables pour le fichier histoire … … 186 178 type(Request) :: Request_physic 187 179 REAL,SAVE :: dvfi_tmp(iip1,llm),dufi_tmp(iip1,llm) 188 REAL,SAVE :: dtetafi_tmp(iip1,llm),dqfi_tmp(iip1,llm,nqmx) 180 REAL,SAVE :: dtetafi_tmp(iip1,llm) 181 REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: dqfi_tmp 189 182 REAL,SAVE :: dpfi_tmp(iip1) 190 183 … … 195 188 INTEGER :: var_time 196 189 LOGICAL :: ok_start_timer=.FALSE. 190 LOGICAL, SAVE :: firstcall=.TRUE. 197 191 198 192 c$OMP MASTER … … 208 202 itaufin = nday*day_step 209 203 itaufinp1 = itaufin +1 210 204 modname="leapfrog_p" 211 205 212 206 itau = 0 … … 217 211 iday = iday+1 218 212 ENDIF 213 214 c Allocate variables depending on dynamic variable nqtot 215 c$OMP MASTER 216 IF (firstcall) THEN 217 firstcall=.FALSE. 218 ALLOCATE(dq(ip1jmp1,llm,nqtot)) 219 ALLOCATE(dqfi(ip1jmp1,llm,nqtot)) 220 ALLOCATE(dqfi_tmp(iip1,llm,nqtot)) 221 END IF 222 c$OMP END MASTER 223 c$OMP BARRIER 219 224 220 225 c----------------------------------------------------------------------- … … 276 281 c$OMP BARRIER 277 282 else 278 283 ! Save fields obtained at previous time step as '...m1' 279 284 ijb=ij_begin 280 285 ije=ij_end … … 303 308 . llm, -2,2, .TRUE., 1 ) 304 309 305 endif 310 endif ! of if (FirstCaldyn) 306 311 307 312 forward = .TRUE. … … 347 352 IF( MOD(itau,idissip ).EQ.0.AND..NOT.forward ) apdiss = .TRUE. 348 353 IF( MOD(itau,iphysiq ).EQ.0.AND..NOT.forward 349 s .and. iflag_phys. NE.0) apphys = .TRUE.354 s .and. iflag_phys.EQ.1 ) apphys = .TRUE. 350 355 ELSE 351 356 IF( MOD(itau ,iconser) .EQ. 0 ) conser = .TRUE. 352 357 IF( MOD(itau+1,idissip) .EQ. 0 ) apdiss = .TRUE. 353 IF( MOD(itau+1,iphysiq).EQ.0.AND.iflag_phys. NE.0) apphys=.TRUE.358 IF( MOD(itau+1,iphysiq).EQ.0.AND.iflag_phys.EQ.1) apphys=.TRUE. 354 359 END IF 355 360 … … 455 460 & jj_Nb_caldyn,0,0,TestRequest) 456 461 457 do j=1,nq mx462 do j=1,nqtot 458 463 call Register_SwapFieldHallo(q(1,1,j),q(1,1,j),ip1jmp1,llm, 459 464 & jj_nb_caldyn,0,0,TestRequest) … … 490 495 call Register_Hallo(p,ip1jmp1,llmp1,1,1,1,1,TestRequest) 491 496 492 c do j=1,nq mx497 c do j=1,nqtot 493 498 c call Register_Hallo(q(1,1,j),ip1jmp1,llm,1,1,1,1, 494 499 c * TestRequest) … … 516 521 call WriteField_p('pkf',reshape(pkf,(/iip1,jmp1,llm/))) 517 522 call WriteField_p('phis',reshape(phis,(/iip1,jmp1/))) 518 do j=1,nq mx523 do j=1,nqtot 519 524 call WriteField_p('q'//trim(int2str(j)), 520 525 . reshape(q(:,:,j),(/iip1,jmp1,llm/))) … … 528 533 529 534 c$OMP MASTER 530 print*,"Iteration No",True_itau 535 IF (prt_level>9) THEN 536 WRITE(lunout,*)"leapfrog_p: Iteration No",True_itau 537 ENDIF 531 538 532 539 … … 585 592 586 593 587 ENDIF 588 c 589 ENDIF 594 ENDIF ! of IF (offline) 595 c 596 ENDIF ! of IF( forward. OR . leapf ) 590 597 cc$OMP END PARALLEL 591 598 … … 608 615 c$OMP BARRIER 609 616 ! CALL FTRACE_REGION_BEGIN("integrd") 617 610 618 CALL integrd_p ( 2,vcovm1,ucovm1,tetam1,psm1,massem1 , 611 619 $ dv,du,dteta,dq,dp,vcov,ucov,teta,q,ps,masse,phis , … … 625 633 c 626 634 c call WriteField_p('ps',reshape(ps,(/iip1,jmp1/))) 627 c do j=1,nq mx635 c do j=1,nqtot 628 636 c call WriteField_p('q'//trim(int2str(j)), 629 637 c . reshape(q(:,:,j),(/iip1,jmp1,llm/))) … … 663 671 c$OMP MASTER 664 672 call suspend_timer(timer_caldyn) 665 print*,'Entree dans la physique : Iteration No ',true_itau 673 674 write(lunout,*) 675 & 'leapfrog_p: Entree dans la physique : Iteration No ',true_itau 666 676 c$OMP END MASTER 667 677 … … 669 679 670 680 c$OMP BARRIER 671 672 681 CALL exner_hyb_p( ip1jmp1, ps, p,alpha,beta,pks, pk, pkf ) 673 682 c$OMP BARRIER … … 683 692 c ----------------------------------------------------- 684 693 685 #ifdef CPP_PHYS686 694 c+jld 687 695 … … 689 697 IF (ip_ebil_dyn.ge.1 ) THEN 690 698 ztit='bil dyn' 691 CALL diagedyn(ztit,2,1,1,dtphys 692 e , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) 699 ! Ehouarn: be careful, diagedyn is Earth-specific (includes ../phylmd/..)! 700 IF (planet_type.eq."earth") THEN 701 CALL diagedyn(ztit,2,1,1,dtphys 702 & , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) 703 ENDIF 693 704 ENDIF 694 705 c-jld … … 725 736 726 737 c call SetDistrib(jj_nb_vanleer) 727 do j=1,nq mx738 do j=1,nqtot 728 739 729 740 call Register_SwapFieldHallo(q(1,1,j),q(1,1,j),ip1jmp1,llm, … … 756 767 cc$OMP BARRIER 757 768 ! CALL FTRACE_REGION_BEGIN("calfis") 758 CALL calfis_p( nq,lafin ,rdayvrai,time ,769 CALL calfis_p(lafin ,rdayvrai,time , 759 770 $ ucov,vcov,teta,q,masse,ps,p,pk,phis,phi , 760 771 $ du,dv,dteta,dq, … … 777 788 dpfi_tmp(1:iip1) = dpfi(ijb:ijb+iim) 778 789 c$OMP END MASTER 779 endif 790 endif ! of if ( .not. pole_nord) 780 791 781 792 c$OMP BARRIER … … 799 810 * 1,0,0,1,Request_physic) 800 811 801 do j=1,nq mx812 do j=1,nqtot 802 813 call Register_Hallo(dqfi(1,1,j),ip1jmp1,llm, 803 814 * 1,0,0,1,Request_physic) … … 833 844 c$OMP END MASTER 834 845 835 endif 846 endif ! of if (.not. pole_nord) 836 847 c$OMP BARRIER 837 848 cc$OMP MASTER … … 842 853 cc$OMP END MASTER 843 854 c 844 c do j=1,nq mx855 c do j=1,nqtot 845 856 c call WriteField_p('dqfi'//trim(int2str(j)), 846 857 c . reshape(dqfi(:,:,j),(/iip1,jmp1,llm/))) … … 853 864 ENDIF 854 865 855 CALL addfi_p( nqmx,dtphys, leapf, forward ,866 CALL addfi_p( dtphys, leapf, forward , 856 867 $ ucov, vcov, teta , q ,ps , 857 868 $ dufi, dvfi, dtetafi , dqfi ,dpfi ) … … 889 900 * jj_Nb_caldyn,Request_physic) 890 901 891 do j=1,nq mx902 do j=1,nqtot 892 903 893 904 call Register_SwapField(q(1,1,j),q(1,1,j),ip1jmp1,llm, … … 922 933 cc$OMP END MASTER 923 934 924 #else 925 935 936 c-jld 937 c$OMP MASTER 938 call resume_timer(timer_caldyn) 939 if (FirstPhysic) then 940 ok_start_timer=.TRUE. 941 FirstPhysic=.false. 942 endif 943 c$OMP END MASTER 944 ENDIF ! of IF( apphys ) 945 946 IF(iflag_phys.EQ.2) THEN ! "Newtonian" case 926 947 c Calcul academique de la physique = Rappel Newtonien + fritcion 927 948 c -------------------------------------------------------------- … … 939 960 940 961 call friction_p(ucov,vcov,iphysiq*dtvr) 941 942 #endif 943 944 c-jld 945 c$OMP MASTER 946 call resume_timer(timer_caldyn) 947 if (FirstPhysic) then 948 ok_start_timer=.TRUE. 949 FirstPhysic=.false. 950 endif 951 c$OMP END MASTER 952 ENDIF 962 ENDIF ! of IF(iflag_phys.EQ.2) 963 953 964 954 965 CALL pression_p ( ip1jmp1, ap, bp, ps, p ) 955 966 c$OMP BARRIER 956 957 958 967 CALL exner_hyb_p( ip1jmp1, ps, p,alpha,beta, pks, pk, pkf ) 959 968 c$OMP BARRIER … … 1285 1294 ENDIF 1286 1295 #ifdef CPP_IOIPSL 1296 IF (ok_dynzon) THEN 1287 1297 call Register_Hallo(vcov,ip1jm,llm,1,0,0,1,TestRequest) 1288 1298 call SendRequest(TestRequest) … … 1291 1301 c$OMP BARRIER 1292 1302 c$OMP MASTER 1293 CALL writedynav_p(histaveid, nqmx,itau,vcov ,1303 CALL writedynav_p(histaveid, itau,vcov , 1294 1304 , ucov,teta,pk,phi,q,masse,ps,phis) 1295 c$OMP END MASTER 1296 1305 1306 c ATTENTION!!! bilan_dyn_p ne marche probablement pas avec OpenMP 1307 CALL bilan_dyn_p(2,dtvr*iperiod,dtvr*day_step*periodav, 1308 , ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) 1309 c$OMP END MASTER 1310 ENDIF !ok_dynzon 1297 1311 #endif 1298 1312 ENDIF … … 1304 1318 c IF( MOD(itau,iecri ).EQ.0) THEN 1305 1319 1306 IF( MOD(itau,iecri*day_step).EQ.0) THEN1307 c$OMP BARRIER 1308 c$OMP MASTER 1309 1310 CALL geopot_p ( ip1jmp1, teta , pk , pks, phis , phi)1320 IF( MOD(itau,iecri*day_step).EQ.0) THEN 1321 c$OMP BARRIER 1322 c$OMP MASTER 1323 nbetat = nbetatdem 1324 CALL geopot_p(ip1jmp1,teta,pk,pks,phis,phi) 1311 1325 1312 1326 cym unat=0. 1313 1327 1314 ijb=ij_begin1315 ije=ij_end1316 1317 if (pole_nord) then1318 ijb=ij_begin+iip11319 unat(1:iip1,:)=0.1320 endif1321 1322 if (pole_sud) then1323 ije=ij_end-iip11324 unat(ij_end-iip1+1:ij_end,:)=0.1325 endif1328 ijb=ij_begin 1329 ije=ij_end 1330 1331 if (pole_nord) then 1332 ijb=ij_begin+iip1 1333 unat(1:iip1,:)=0. 1334 endif 1335 1336 if (pole_sud) then 1337 ije=ij_end-iip1 1338 unat(ij_end-iip1+1:ij_end,:)=0. 1339 endif 1326 1340 1327 do l=1,llm1328 unat(ijb:ije,l)=ucov(ijb:ije,l)/cu(ijb:ije)1329 enddo1330 1331 ijb=ij_begin1332 ije=ij_end1333 if (pole_sud) ije=ij_end-iip11334 1335 do l=1,llm1336 vnat(ijb:ije,l)=vcov(ijb:ije,l)/cv(ijb:ije)1337 enddo1341 do l=1,llm 1342 unat(ijb:ije,l)=ucov(ijb:ije,l)/cu(ijb:ije) 1343 enddo 1344 1345 ijb=ij_begin 1346 ije=ij_end 1347 if (pole_sud) ije=ij_end-iip1 1348 1349 do l=1,llm 1350 vnat(ijb:ije,l)=vcov(ijb:ije,l)/cv(ijb:ije) 1351 enddo 1338 1352 1339 1353 #ifdef CPP_IOIPSL 1340 1354 1341 CALL writehist_p(histid,histvid, nqmx,itau,vcov,1342 sucov,teta,phi,q,masse,ps,phis)1355 CALL writehist_p(histid,histvid, itau,vcov, 1356 & ucov,teta,phi,q,masse,ps,phis) 1343 1357 1344 1358 #endif 1345 c$OMP END MASTER 1346 ENDIF 1359 ! For some Grads outputs of fields 1360 if (output_grads_dyn) then 1361 ! Ehouarn: hope this works the way I think it does: 1362 call Gather_Field(unat,ip1jmp1,llm,0) 1363 call Gather_Field(vnat,ip1jm,llm,0) 1364 call Gather_Field(teta,ip1jmp1,llm,0) 1365 call Gather_Field(ps,ip1jmp1,1,0) 1366 do iq=1,nqtot 1367 call Gather_Field(q(1,1,iq),ip1jmp1,llm,0) 1368 enddo 1369 if (mpi_rank==0) then 1370 #include "write_grads_dyn.h" 1371 endif 1372 endif ! of if (output_grads_dyn) 1373 c$OMP END MASTER 1374 ENDIF ! of IF(MOD(itau,iecri).EQ.0) 1347 1375 1348 1376 IF(itau.EQ.itaufin) THEN … … 1351 1379 c$OMP MASTER 1352 1380 1353 c#ifdef CPP_IOIPSL 1354 1355 CALL dynredem1_p("restart.nc",0.0, 1356 , vcov,ucov,teta,q,nqmx,masse,ps) 1357 c#endif 1381 if (planet_type.eq."earth") then 1382 #ifdef CPP_EARTH 1383 ! Write an Earth-format restart file 1384 CALL dynredem1_p("restart.nc",0.0, 1385 & vcov,ucov,teta,q,masse,ps) 1386 1387 #endif 1388 endif ! of if (planet_type.eq."earth") 1358 1389 1359 1390 CLOSE(99) 1360 1391 c$OMP END MASTER 1361 ENDIF 1392 ENDIF ! of IF (itau.EQ.itaufin) 1362 1393 1363 1394 c----------------------------------------------------------------------- … … 1390 1421 dt = 2.*dtvr 1391 1422 GO TO 2 1392 END IF 1393 1394 ELSE 1423 END IF ! of IF (MOD(itau,iperiod).EQ.0) 1424 ! ELSEIF (MOD(itau-1,iperiod).EQ.0) 1425 1426 1427 ELSE ! of IF (.not.purmats) 1395 1428 1396 1429 c ........................................................ … … 1419 1452 GO TO 2 1420 1453 1421 ELSE 1422 1423 IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN1454 ELSE ! of IF(forward) 1455 1456 IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN 1424 1457 IF(itau.EQ.itaufin) THEN 1425 1458 iav=1 … … 1428 1461 ENDIF 1429 1462 #ifdef CPP_IOIPSL 1430 c$OMP BARRIER 1431 1432 call Register_Hallo(vcov,ip1jm,llm,1,0,0,1,TestRequest) 1433 call SendRequest(TestRequest) 1434 c$OMP BARRIER 1435 call WaitRequest(TestRequest) 1436 1437 c$OMP BARRIER 1438 c$OMP MASTER 1439 CALL writedynav_p(histaveid, nqmx, itau,vcov , 1463 IF (ok_dynzon) THEN 1464 c$OMP BARRIER 1465 1466 call Register_Hallo(vcov,ip1jm,llm,1,0,0,1,TestRequest) 1467 call SendRequest(TestRequest) 1468 c$OMP BARRIER 1469 call WaitRequest(TestRequest) 1470 1471 c$OMP BARRIER 1472 c$OMP MASTER 1473 CALL writedynav_p(histaveid, itau,vcov , 1440 1474 , ucov,teta,pk,phi,q,masse,ps,phis) 1441 call bilan_dyn_p(2,dtvr*iperiod,dtvr*day_step*periodav,1475 CALL bilan_dyn_p(2,dtvr*iperiod,dtvr*day_step*periodav, 1442 1476 , ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) 1443 1477 c$OMP END MASTER 1478 END IF !ok_dynzon 1444 1479 #endif 1445 ENDIF 1480 ENDIF ! of IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) 1481 1446 1482 1447 1483 c IF(MOD(itau,iecri ).EQ.0) THEN … … 1449 1485 c$OMP BARRIER 1450 1486 c$OMP MASTER 1451 1452 CALL geopot_p( ip1jmp1, teta , pk , pks, phis , phi)1487 nbetat = nbetatdem 1488 CALL geopot_p(ip1jmp1,teta,pk,pks,phis,phi) 1453 1489 1454 1490 cym unat=0. 1455 ijb=ij_begin1456 ije=ij_end1457 1458 if (pole_nord) then1459 ijb=ij_begin+iip11460 unat(1:iip1,:)=0.1461 endif1462 1463 if (pole_sud) then1464 ije=ij_end-iip11465 unat(ij_end-iip1+1:ij_end,:)=0.1466 endif1491 ijb=ij_begin 1492 ije=ij_end 1493 1494 if (pole_nord) then 1495 ijb=ij_begin+iip1 1496 unat(1:iip1,:)=0. 1497 endif 1498 1499 if (pole_sud) then 1500 ije=ij_end-iip1 1501 unat(ij_end-iip1+1:ij_end,:)=0. 1502 endif 1467 1503 1468 do l=1,llm1469 unat(ijb:ije,l)=ucov(ijb:ije,l)/cu(ijb:ije)1470 enddo1471 1472 ijb=ij_begin1473 ije=ij_end1474 if (pole_sud) ije=ij_end-iip11475 1476 do l=1,llm1477 vnat(ijb:ije,l)=vcov(ijb:ije,l)/cv(ijb:ije)1478 enddo1504 do l=1,llm 1505 unat(ijb:ije,l)=ucov(ijb:ije,l)/cu(ijb:ije) 1506 enddo 1507 1508 ijb=ij_begin 1509 ije=ij_end 1510 if (pole_sud) ije=ij_end-iip1 1511 1512 do l=1,llm 1513 vnat(ijb:ije,l)=vcov(ijb:ije,l)/cv(ijb:ije) 1514 enddo 1479 1515 1480 1516 #ifdef CPP_IOIPSL 1481 1517 1482 CALL writehist_p( histid, histvid, nqmx, itau,vcov , 1483 , ucov,teta,phi,q,masse,ps,phis) 1484 c#else 1485 c call Gather_Field(unat,ip1jmp1,llm,0) 1486 c call Gather_Field(vnat,ip1jm,llm,0) 1487 c call Gather_Field(teta,ip1jmp1,llm,0) 1488 c call Gather_Field(ps,ip1jmp1,1,0) 1489 c do iq=1,nqmx 1490 c call Gather_Field(q(1,1,iq),ip1jmp1,llm,0) 1491 c enddo 1518 CALL writehist_p(histid, histvid, itau,vcov , 1519 & ucov,teta,phi,q,masse,ps,phis) 1520 #endif 1521 ! For some Grads output (but does it work?) 1522 if (output_grads_dyn) then 1523 call Gather_Field(unat,ip1jmp1,llm,0) 1524 call Gather_Field(vnat,ip1jm,llm,0) 1525 call Gather_Field(teta,ip1jmp1,llm,0) 1526 call Gather_Field(ps,ip1jmp1,1,0) 1527 do iq=1,nqtot 1528 call Gather_Field(q(1,1,iq),ip1jmp1,llm,0) 1529 enddo 1492 1530 c 1493 c if (mpi_rank==0) then 1494 c#include "write_grads_dyn.h" 1495 c endif 1531 if (mpi_rank==0) then 1532 #include "write_grads_dyn.h" 1533 endif 1534 endif ! of if (output_grads_dyn) 1535 1536 c$OMP END MASTER 1537 ENDIF ! of IF(MOD(itau,iecri*day_step).EQ.0) 1538 1539 IF(itau.EQ.itaufin) THEN 1540 if (planet_type.eq."earth") then 1541 #ifdef CPP_EARTH 1542 c$OMP MASTER 1543 CALL dynredem1_p("restart.nc",0.0, 1544 . vcov,ucov,teta,q,masse,ps) 1545 c$OMP END MASTER 1496 1546 #endif 1497 1498 c$OMP END MASTER 1499 ENDIF 1500 1501 IF(itau.EQ.itaufin) THEN 1502 c$OMP MASTER 1503 CALL dynredem1_p("restart.nc",0.0, 1504 . vcov,ucov,teta,q,nqmx,masse,ps) 1505 c$OMP END MASTER 1506 ENDIF 1507 forward = .TRUE. 1508 GO TO 1 1509 1510 ENDIF 1511 1512 END IF 1513 c$OMP MASTER 1514 call finalize_parallel 1515 c$OMP END MASTER 1516 RETURN 1547 endif ! of if (planet_type.eq."earth") 1548 ENDIF ! of IF(itau.EQ.itaufin) 1549 1550 forward = .TRUE. 1551 GO TO 1 1552 1553 ENDIF ! of IF (forward) 1554 1555 END IF ! of IF(.not.purmats) 1556 c$OMP MASTER 1557 call finalize_parallel 1558 c$OMP END MASTER 1559 RETURN 1517 1560 END -
LMDZ4/trunk/libf/dyn3dpar/parallel.F90
r1000 r1146 51 51 #else 52 52 using_mpi=.FALSE. 53 #endif 54 55 56 #ifdef CPP_OMP 57 using_OMP=.TRUE. 58 #else 59 using_OMP=.FALSE. 53 60 #endif 54 61 -
LMDZ4/trunk/libf/dyn3dpar/qminimum_p.F
r985 r1146 50 50 DO 1000 k = 1, llm 51 51 DO 1040 i = ijb, ije 52 zx_defau = AMAX1( seuil_liq - q(i,k,iq_liq), 0.0 ) 53 q(i,k,iq_vap) = q(i,k,iq_vap) - zx_defau 54 q(i,k,iq_liq) = q(i,k,iq_liq) + zx_defau 52 if (seuil_liq - q(i,k,iq_liq) .gt. 0.d0 ) then 53 q(i,k,iq_vap) = q(i,k,iq_vap) + q(i,k,iq_liq) - seuil_liq 54 q(i,k,iq_liq) = seuil_liq 55 endif 55 56 1040 CONTINUE 56 57 1000 CONTINUE … … 69 70 c$OMP DO SCHEDULE(STATIC) 70 71 DO i = ijb, ije 71 zx_abc = deltap(i,k)/deltap(i,k-1) 72 zx_defau = AMAX1( seuil_vap - q(i,k,iq), 0.0 ) 73 q(i,k-1,iq) = q(i,k-1,iq) - zx_defau * zx_abc 74 q(i,k,iq) = q(i,k,iq) + zx_defau 72 if ( seuil_vap - q(i,k,iq) .gt. 0.d0 ) then 73 q(i,k-1,iq) = q(i,k-1,iq) - ( seuil_vap - q(i,k,iq) ) * 74 & deltap(i,k) / deltap(i,k-1) 75 q(i,k,iq) = seuil_vap 76 endif 75 77 ENDDO 76 78 c$OMP END DO NOWAIT -
LMDZ4/trunk/libf/dyn3dpar/read_reanalyse.F
r1122 r1146 11 11 12 12 USE parallel 13 use netcdf 13 14 c ----------------------------------------------------------------- 14 15 c Declarations … … 72 73 print *,'Vous êtes entrain de lire des données sur 73 74 . niveaux modèle' 74 ncidpl=NCOPN('apbp.nc',NCNOWRIT,rcode)75 varidap=NCVID(ncidpl,'AP',rcode)76 varidbp=NCVID(ncidpl,'BP',rcode)75 rcode=nf90_open('apbp.nc',nf90_nowrite,ncidpl) 76 rcode = nf90_inq_varid(ncidpl, 'AP', varidap) 77 rcode = nf90_inq_varid(ncidpl, 'BP', varidbp) 77 78 print*,'ncidpl,varidap',ncidpl,varidap 78 79 endif … … 80 81 c Vent zonal 81 82 if (guide_u) then 82 ncidu=NCOPN('u.nc',NCNOWRIT,rcode)83 varidu=NCVID(ncidu,'UWND',rcode)83 rcode=nf90_open('u.nc',nf90_nowrite,ncidu) 84 rcode = nf90_inq_varid(ncidu, 'UWND', varidu) 84 85 print*,'ncidu,varidu',ncidu,varidu 85 86 if (ncidpl.eq.-99) ncidpl=ncidu … … 88 89 c Vent meridien 89 90 if (guide_v) then 90 ncidv=NCOPN('v.nc',NCNOWRIT,rcode)91 varidv=NCVID(ncidv,'VWND',rcode)91 rcode=nf90_open('v.nc',nf90_nowrite,ncidv) 92 rcode = nf90_inq_varid(ncidv, 'VWND', varidv) 92 93 print*,'ncidv,varidv',ncidv,varidv 93 94 if (ncidpl.eq.-99) ncidpl=ncidv … … 96 97 c Temperature 97 98 if (guide_T) then 98 ncidt=NCOPN('T.nc',NCNOWRIT,rcode)99 varidt=NCVID(ncidt,'AIR',rcode)99 rcode=nf90_open('T.nc',nf90_nowrite,ncidt) 100 rcode = nf90_inq_varid(ncidt, 'AIR', varidt) 100 101 print*,'ncidt,varidt',ncidt,varidt 101 102 if (ncidpl.eq.-99) ncidpl=ncidt … … 104 105 c Humidite 105 106 if (guide_Q) then 106 ncidQ=NCOPN('hur.nc',NCNOWRIT,rcode)107 varidQ=NCVID(ncidQ,'RH',rcode)107 rcode=nf90_open('hur.nc',nf90_nowrite,ncidQ) 108 rcode = nf90_inq_varid(ncidQ, 'RH', varidQ) 108 109 print*,'ncidQ,varidQ',ncidQ,varidQ 109 110 if (ncidpl.eq.-99) ncidpl=ncidQ … … 112 113 c Pression de surface 113 114 if ((guide_P).OR.(guide_modele)) then 114 ncidps=NCOPN('ps.nc',NCNOWRIT,rcode)115 varidps=NCVID(ncidps,'SP',rcode)115 rcode=nf90_open('ps.nc',nf90_nowrite,ncidps) 116 rcode = nf90_inq_varid(ncidps, 'SP', varidps) 116 117 print*,'ncidps,varidps',ncidps,varidps 117 118 endif … … 119 120 c Coordonnee verticale 120 121 if (.not.guide_modele) then 121 if (ncep) then122 print*,'Vous etes entrain de lire des donnees NCEP'123 varidpl=NCVID(ncidpl,'LEVEL',rcode)124 else125 print*,'Vous etes entrain de lire des donnees ECMWF'126 varidpl=NCVID(ncidpl,'PRESSURE',rcode)127 endif128 print*,'ncidpl,varidpl',ncidpl,varidpl122 if (ncep) then 123 print*,'Vous etes entrain de lire des donnees NCEP' 124 rcode = nf90_inq_varid(ncidpl, 'LEVEL', varidpl) 125 else 126 print*,'Vous etes entrain de lire des donnees ECMWF' 127 rcode = nf90_inq_varid(ncidpl, 'PRESSURE', varidpl) 128 endif 129 print*,'ncidpl,varidpl',ncidpl,varidpl 129 130 endif 130 131 print*,'ncidu,varidpl',ncidu,varidpl -
LMDZ4/trunk/libf/dyn3dpar/serre.h
r774 r1146 2 2 ! $Header$ 3 3 ! 4 c5 c6 c..include serre.h7 c8 REAL clon,clat,transx,transy,alphax,alphay,pxo,pyo, 9 ,grossismx, grossismy, dzoomx, dzoomy,taux,tauy10 COMMON/serre/clon,clat,transx,transy,alphax,alphay,pxo,pyo , 11 ,grossismx, grossismy, dzoomx, dzoomy,taux,tauy4 !c 5 !c 6 !c..include serre.h 7 !c 8 REAL clon,clat,transx,transy,alphax,alphay,pxo,pyo, & 9 & grossismx, grossismy, dzoomx, dzoomy,taux,tauy 10 COMMON/serre/clon,clat,transx,transy,alphax,alphay,pxo,pyo , & 11 & grossismx, grossismy, dzoomx, dzoomy,taux,tauy -
LMDZ4/trunk/libf/dyn3dpar/test_period.F
r774 r1146 3 3 ! 4 4 SUBROUTINE test_period ( ucov, vcov, teta, q, p, phis ) 5 USE infotrac, ONLY : nqtot 5 6 c 6 7 c Auteur : P. Le Van … … 17 18 c 18 19 REAL ucov(ip1jmp1,llm), vcov(ip1jm,llm), teta(ip1jmp1,llm) , 19 , q(ip1jmp1,llm,nq mx), p(ip1jmp1,llmp1), phis(ip1jmp1)20 , q(ip1jmp1,llm,nqtot), p(ip1jmp1,llmp1), phis(ip1jmp1) 20 21 c 21 22 c ..... Variables locales ..... … … 68 69 69 70 c 70 DO nq =1, nq mx71 DO nq =1, nqtot 71 72 DO l =1, llm 72 73 DO ij = 1, ip1jmp1, iip1 -
LMDZ4/trunk/libf/dyn3dpar/times.F90
r1000 r1146 207 207 endif 208 208 209 ENDIF ! using_mp î209 ENDIF ! using_mp� 210 210 end subroutine allgather_timer_average 211 211 … … 222 222 end subroutine InitTime 223 223 224 function DiffTime 224 function DiffTime() 225 225 implicit none 226 226 double precision :: DiffTime … … 236 236 end function DiffTime 237 237 238 function DiffCpuTime 238 function DiffCpuTime() 239 239 implicit none 240 240 real :: DiffCpuTime -
LMDZ4/trunk/libf/dyn3dpar/vlspltgen_p.F
r985 r1146 26 26 USE Write_Field_p 27 27 USE VAMPIR 28 USE infotrac, ONLY : nqtot 28 29 IMPLICIT NONE 29 30 … … 38 39 c Arguments: 39 40 c ---------- 40 INTEGER iadv(nq mx)41 INTEGER iadv(nqtot) 41 42 REAL masse(ip1jmp1,llm),pente_max 42 43 REAL pbaru( ip1jmp1,llm ),pbarv( ip1jm,llm) 43 REAL q(ip1jmp1,llm,nq mx)44 REAL q(ip1jmp1,llm,nqtot) 44 45 REAL w(ip1jmp1,llm),pdt 45 46 REAL p(ip1jmp1,llmp1),teta(ip1jmp1,llm),pk(ip1jmp1,llm) … … 51 52 c 52 53 REAL,SAVE :: qsat(ip1jmp1,llm) 53 REAL, SAVE :: zm(ip1jmp1,llm,nqmx)54 REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: zm 54 55 REAL,SAVE :: mu(ip1jmp1,llm) 55 56 REAL,SAVE :: mv(ip1jm,llm) 56 57 REAL,SAVE :: mw(ip1jmp1,llm+1) 57 REAL, SAVE :: zq(ip1jmp1,llm,nqmx)58 REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: zq 58 59 REAL zzpbar, zzw 59 60 … … 67 68 REAL tempe(ip1jmp1) 68 69 INTEGER ijb,ije,iq 70 LOGICAL, SAVE :: firstcall=.TRUE. 71 !$OMP THREADPRIVATE(firstcall) 69 72 type(request) :: MyRequest1 70 73 type(request) :: MyRequest2 … … 84 87 rtt = 273.16 85 88 89 c Allocate variables depending on dynamic variable nqtot 90 91 IF (firstcall) THEN 92 firstcall=.FALSE. 93 !$OMP MASTER 94 ALLOCATE(zm(ip1jmp1,llm,nqtot)) 95 ALLOCATE(zq(ip1jmp1,llm,nqtot)) 96 !$OMP END MASTER 97 !$OMP BARRIER 98 END IF 86 99 c-- Calcul de Qsat en chaque point 87 100 c-- approximation: au milieu des couches play(l)=(p(l)+p(l+1))/2 … … 164 177 ije=ij_end 165 178 166 DO iq=1,nq mx179 DO iq=1,nqtot 167 180 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 168 181 DO l=1,llm … … 175 188 176 189 c$OMP BARRIER 177 DO iq=1,nq mx190 DO iq=1,nqtot 178 191 179 192 if(iadv(iq) == 0) then … … 245 258 c$OMP END MASTER 246 259 c$OMP BARRIER 247 do iq=1,nq mx260 do iq=1,nqtot 248 261 249 262 if(iadv(iq) == 0) then … … 285 298 c$OMP BARRIER 286 299 287 do iq=1,nq mx300 do iq=1,nqtot 288 301 289 302 if(iadv(iq) == 0) then … … 308 321 309 322 310 do iq=1,nq mx323 do iq=1,nqtot 311 324 312 325 if(iadv(iq) == 0) then … … 359 372 360 373 c$OMP BARRIER 361 do iq=1,nq mx374 do iq=1,nqtot 362 375 363 376 if(iadv(iq) == 0) then … … 398 411 399 412 400 do iq=1,nq mx413 do iq=1,nqtot 401 414 402 415 if(iadv(iq) == 0) then … … 420 433 enddo 421 434 422 do iq=1,nq mx435 do iq=1,nqtot 423 436 424 437 if(iadv(iq) == 0) then … … 450 463 451 464 452 DO iq=1,nq mx465 DO iq=1,nqtot 453 466 454 467 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) -
LMDZ4/trunk/libf/dyn3dpar/write_grads_dyn.h
r774 r1146 24 24 string10='teta' 25 25 CALL wrgrads(1,llm,teta,string10,string10) 26 do iq=1,nq mx26 do iq=1,nqtot 27 27 string10='q' 28 28 write(string10(2:2),'(i1)') iq -
LMDZ4/trunk/libf/dyn3dpar/writedynav_p.F
r1000 r1146 2 2 ! $Header$ 3 3 ! 4 subroutine writedynav_p( histid, nq,time, vcov,4 subroutine writedynav_p( histid, time, vcov, 5 5 , ucov,teta,ppk,phi,q,masse,ps,phis) 6 6 … … 8 8 USE parallel 9 9 USE misc_mod 10 USE infotrac 10 11 implicit none 11 12 … … 17 18 C Entree: 18 19 C histid: ID du fichier histoire 19 C nqmx: nombre maxi de traceurs20 20 C time: temps de l'ecriture 21 21 C vcov: vents v covariants … … 47 47 #include "description.h" 48 48 #include "serre.h" 49 #include "advtrac.h"50 49 51 50 C … … 53 52 C 54 53 55 INTEGER histid , nq54 INTEGER histid 56 55 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) 57 56 REAL teta(ip1jmp1,llm),phi(ip1jmp1,llm),ppk(ip1jmp1,llm) 58 57 REAL ps(ip1jmp1),masse(ip1jmp1,llm) 59 58 REAL phis(ip1jmp1) 60 REAL q(ip1jmp1,llm,nq )59 REAL q(ip1jmp1,llm,nqtot) 61 60 integer time 62 61 … … 105 104 C Vents V scalaire 106 105 C 107 if (pole_sud) ije=ij_end-iip1108 if (pole_sud) jjn=jj_nb-1109 106 110 107 call gr_v_scal_p(llm, vnat, vs) … … 114 111 C Temperature potentielle moyennee 115 112 C 116 ijb=ij_begin 117 ije=ij_end 118 jjn=jj_nb 119 113 120 114 call histwrite(histid, 'theta', itau_w, teta(ijb:ije,:), 121 115 . iip1*jjn*llm, ndex3d) … … 139 133 C Traceurs 140 134 C 141 DO iq=1,nq 135 DO iq=1,nqtot 142 136 call histwrite(histid, ttext(iq), itau_w, q(ijb:ije,:,iq), 143 137 . iip1*jjn*llm, ndex3d) -
LMDZ4/trunk/libf/dyn3dpar/writehist_p.F
r1000 r1146 2 2 ! $Header$ 3 3 ! 4 subroutine writehist_p( histid, histvid, nq,time, vcov,4 subroutine writehist_p( histid, histvid, time, vcov, 5 5 , ucov,teta,phi,q,masse,ps,phis) 6 6 … … 8 8 USE parallel 9 9 USE misc_mod 10 USE infotrac 10 11 implicit none 11 12 … … 18 19 C histid: ID du fichier histoire 19 20 C histvid:ID du fichier histoire pour les vents V (appele a disparaitre) 20 C nqmx: nombre maxi de traceurs21 21 C time: temps de l'ecriture 22 22 C vcov: vents v covariants … … 48 48 #include "description.h" 49 49 #include "serre.h" 50 #include "advtrac.h"51 50 52 51 C … … 54 53 C 55 54 56 INTEGER histid, nq,histvid55 INTEGER histid, histvid 57 56 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) 58 57 REAL teta(ip1jmp1,llm),phi(ip1jmp1,llm) 59 58 REAL ps(ip1jmp1),masse(ip1jmp1,llm) 60 59 REAL phis(ip1jmp1) 61 REAL q(ip1jmp1,llm,nq )60 REAL q(ip1jmp1,llm,nqtot) 62 61 integer time 63 62 … … 119 118 C Traceurs 120 119 C 121 DO iq=1,nq 120 DO iq=1,nqtot 122 121 call histwrite(histid, ttext(iq), itau_w, q(ijb:ije,:,iq), 123 122 . iip1*jjn*llm, ndexu)
Note: See TracChangeset
for help on using the changeset viewer.