Changeset 1146 for LMDZ4/trunk/libf/dyn3d
- Timestamp:
- Apr 9, 2009, 12:11:35 PM (16 years ago)
- Location:
- LMDZ4/trunk
- Files:
-
- 5 deleted
- 26 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/dyn3d/addfi.F
r524 r1146 2 2 ! $Header$ 3 3 ! 4 SUBROUTINE addfi( nq,pdt, leapf, forward,4 SUBROUTINE addfi(pdt, leapf, forward, 5 5 S pucov, pvcov, pteta, pq , pps , 6 6 S pdufi, pdvfi, pdhfi,pdqfi, pdpfi ) 7 8 USE infotrac, ONLY : nqtot 7 9 IMPLICIT NONE 8 10 c … … 52 54 c ----------- 53 55 c 54 INTEGER nq55 56 56 REAL pdt 57 57 c 58 58 REAL pvcov(ip1jm,llm),pucov(ip1jmp1,llm) 59 REAL pteta(ip1jmp1,llm),pq(ip1jmp1,llm,nq ),pps(ip1jmp1)59 REAL pteta(ip1jmp1,llm),pq(ip1jmp1,llm,nqtot),pps(ip1jmp1) 60 60 c 61 61 REAL pdvfi(ip1jm,llm),pdufi(ip1jmp1,llm) 62 REAL pdqfi(ip1jmp1,llm,nq ),pdhfi(ip1jmp1,llm),pdpfi(ip1jmp1)62 REAL pdqfi(ip1jmp1,llm,nqtot),pdhfi(ip1jmp1,llm),pdpfi(ip1jmp1) 63 63 c 64 64 LOGICAL leapf,forward … … 125 125 ENDDO 126 126 127 DO iq = 3, nq 127 DO iq = 3, nqtot 128 128 DO k = 1,llm 129 129 DO j = 1,ip1jmp1 … … 148 148 149 149 150 DO iq = 1, nq 150 DO iq = 1, nqtot 151 151 DO k = 1, llm 152 152 DO ij = 1, iim -
LMDZ4/trunk/libf/dyn3d/advtrac.F
r960 r1146 15 15 c M.A Filiberti (04/2002) 16 16 c 17 USE infotrac 18 17 19 IMPLICIT NONE 18 20 c … … 28 30 #include "ener.h" 29 31 #include "description.h" 30 #include "advtrac.h"31 32 32 33 c------------------------------------------------------------------- … … 39 40 INTEGER iapptrac 40 41 REAL pbaru(ip1jmp1,llm),pbarv(ip1jm,llm) 41 REAL q(ip1jmp1,llm,nq mx),masse(ip1jmp1,llm)42 REAL q(ip1jmp1,llm,nqtot),masse(ip1jmp1,llm) 42 43 REAL p( ip1jmp1,llmp1 ),teta(ip1jmp1,llm) 43 44 REAL pk(ip1jmp1,llm) … … 52 53 REAL pbarug(ip1jmp1,llm),pbarvg(ip1jm,llm),wg(ip1jmp1,llm) 53 54 REAL (kind=kind(1.d0)) :: t_initial, t_final, tps_cpu 54 real cpuadv(nqmx)55 common/cpuadv/cpuadv56 57 55 INTEGER iadvtr 58 56 INTEGER ij,l,iq,iiq … … 69 67 REAL psppm(iim,jjp1) ! pression au sol 70 68 REAL unatppm(iim,jjp1,llm),vnatppm(iim,jjp1,llm) 71 REAL qppm(iim*jjp1,llm,nq mx)69 REAL qppm(iim*jjp1,llm,nqtot) 72 70 REAL fluxwppm(iim,jjp1,llm) 73 71 REAL apppm(llmp1), bpppm(llmp1) … … 153 151 c Appel des sous programmes d'advection 154 152 c----------------------------------------------------------- 155 do iq=1,nq mx153 do iq=1,nqtot 156 154 c call clock(t_initial) 157 155 if(iadv(iq) == 0) cycle -
LMDZ4/trunk/libf/dyn3d/caladvtrac.F
r960 r1146 8 8 * flxw, pk) 9 9 c 10 USE infotrac 10 11 IMPLICIT NONE 11 12 c … … 24 25 #include "comconst.h" 25 26 #include "control.h" 26 #include "advtrac.h"27 27 28 28 c Arguments: 29 29 c ---------- 30 30 REAL pbaru( ip1jmp1,llm ),pbarv( ip1jm,llm),masse(ip1jmp1,llm) 31 REAL p( ip1jmp1,llmp1),q( ip1jmp1,llm,nq mx),dq( ip1jmp1,llm,2 )31 REAL p( ip1jmp1,llmp1),q( ip1jmp1,llm,nqtot),dq( ip1jmp1,llm,2 ) 32 32 REAL teta( ip1jmp1,llm),pk( ip1jmp1,llm) 33 33 REAL :: flxw(ip1jmp1,llm) -
LMDZ4/trunk/libf/dyn3d/calfis.F
r960 r1146 4 4 C 5 5 C 6 SUBROUTINE calfis(nq, 7 $ lafin, 6 SUBROUTINE calfis(lafin, 8 7 $ rdayvrai, 9 8 $ heure, … … 32 31 c Auteur : P. Le Van, F. Hourdin 33 32 c ......... 33 USE infotrac 34 34 35 35 IMPLICIT NONE … … 90 90 #include "paramet.h" 91 91 #include "temps.h" 92 #include "advtrac.h" 93 94 INTEGER ngridmx,nq 92 93 INTEGER ngridmx 95 94 PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm ) 96 95 … … 109 108 REAL pteta(iip1,jjp1,llm) 110 109 REAL pmasse(iip1,jjp1,llm) 111 REAL pq(iip1,jjp1,llm,nq mx)110 REAL pq(iip1,jjp1,llm,nqtot) 112 111 REAL pphis(iip1,jjp1) 113 112 REAL pphi(iip1,jjp1,llm) … … 116 115 REAL pducov(iip1,jjp1,llm) 117 116 REAL pdteta(iip1,jjp1,llm) 118 REAL pdq(iip1,jjp1,llm,nq mx)117 REAL pdq(iip1,jjp1,llm,nqtot) 119 118 c 120 119 REAL pps(iip1,jjp1) … … 125 124 REAL pdufi(iip1,jjp1,llm) 126 125 REAL pdhfi(iip1,jjp1,llm) 127 REAL pdqfi(iip1,jjp1,llm,nq mx)126 REAL pdqfi(iip1,jjp1,llm,nqtot) 128 127 REAL pdpsfi(iip1,jjp1) 129 128 … … 142 141 c 143 142 REAL zufi(ngridmx,llm), zvfi(ngridmx,llm) 144 REAL ztfi(ngridmx,llm),zqfi(ngridmx,llm,nq mx)143 REAL ztfi(ngridmx,llm),zqfi(ngridmx,llm,nqtot) 145 144 c 146 145 REAL pcvgu(ngridmx,llm), pcvgv(ngridmx,llm) … … 148 147 c 149 148 REAL zdufi(ngridmx,llm),zdvfi(ngridmx,llm) 150 REAL zdtfi(ngridmx,llm),zdqfi(ngridmx,llm,nq mx)149 REAL zdtfi(ngridmx,llm),zdqfi(ngridmx,llm,nqtot) 151 150 REAL zdpsrf(ngridmx) 152 151 c … … 275 274 c --------------- 276 275 c 277 DO iq=1,nq 276 DO iq=1,nqtot 278 277 iiq=niadv(iq) 279 278 DO l=1,llm … … 444 443 CALL physiq (ngridmx, 445 444 . llm, 446 . nq,447 445 . debut, 448 446 . lafin, … … 505 503 c --------------------- 506 504 507 DO iq=1,nq mx505 DO iq=1,nqtot 508 506 DO l=1,llm 509 507 DO i=1,iip1 … … 526 524 pdqfi=0. 527 525 C 528 DO iq=1,nq 526 DO iq=1,nqtot 529 527 iiq=niadv(iq) 530 528 DO l=1,llm -
LMDZ4/trunk/libf/dyn3d/comdissip.h
r524 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/dyn3d/comgeom.h
r524 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/dyn3d/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 IMPLICIT NONE 10 15 c----------------------------------------------------------------------- … … 99 104 c Parametres de controle du run: 100 105 c----------------------------------------------------------------------- 106 !Config Key = planet_type 107 !Config Desc = planet type ("earth", "mars", "venus", ...) 108 !Config Def = earth 109 !Config Help = this flag sets the type of atymosphere that is considered 110 planet_type="earth" 111 CALL getin('planet_type',planet_type) 101 112 102 113 !Config Key = dayref … … 179 190 CALL getin('periodav',periodav) 180 191 192 !Config Key = output_grads_dyn 193 !Config Desc = output dynamics diagnostics in 'dyn.dat' file 194 !Config Def = n 195 !Config Help = output dynamics diagnostics in Grads-readable 'dyn.dat' file 196 output_grads_dyn=.false. 197 CALL getin('output_grads_dyn',output_grads_dyn) 198 181 199 !Config Key = idissip 182 200 !Config Desc = periode de la dissipation … … 274 292 c ............................................................... 275 293 294 !Config Key = read_start 295 !Config Desc = Initialize model using a 'start.nc' file 296 !Config Def = y 297 !Config Help = y: intialize dynamical fields using a 'start.nc' file 298 ! n: fields are initialized by 'iniacademic' routine 299 read_start= .true. 300 CALL getin('read_start',read_start) 301 276 302 !Config Key = iflag_phys 277 303 !Config Desc = Avec ls physique … … 330 356 c 331 357 IF( ABS(clat - clatt).GE. 0.001 ) THEN 332 PRINT *,' La valeur de clat passee par run.def est differente de333 *celle lue sur le fichier start '358 write(lunout,*)'conf_gcm: La valeur de clat passee par run.def', 359 & ' est differente de celle lue sur le fichier start ' 334 360 STOP 335 361 ENDIF … … 345 371 346 372 IF( ABS(grossismx - grossismxx).GE. 0.001 ) THEN 347 PRINT *,' La valeur de grossismx passee par run.def est differente348 *de celle lue sur le fichier start '373 write(lunout,*)'conf_gcm: La valeur de grossismx passee par ', 374 & 'run.def est differente de celle lue sur le fichier start ' 349 375 STOP 350 376 ENDIF … … 359 385 360 386 IF( ABS(grossismy - grossismyy).GE. 0.001 ) THEN 361 PRINT *,' La valeur de grossismy passee par run.def est differen362 *te de celle lue sur le fichier start '387 write(lunout,*)'conf_gcm: La valeur de grossismy passee par ', 388 & 'run.def est differente de celle lue sur le fichier start ' 363 389 STOP 364 390 ENDIF 365 391 366 392 IF( grossismx.LT.1. ) THEN 367 PRINT *,' *** ATTENTION !! grossismx < 1 . *** ' 393 write(lunout,*) 394 & 'conf_gcm: *** ATTENTION !! grossismx < 1 . *** ' 368 395 STOP 369 396 ELSE … … 373 400 374 401 IF( grossismy.LT.1. ) THEN 375 PRINT *,' *** ATTENTION !! grossismy < 1 . *** ' 402 write(lunout,*) 403 & 'conf_gcm: *** ATTENTION !! grossismy < 1 . *** ' 376 404 STOP 377 405 ELSE … … 379 407 ENDIF 380 408 381 PRINT *,' alphax alphay defrun',alphax,alphay409 write(lunout,*)'conf_gcm: alphax alphay',alphax,alphay 382 410 c 383 411 c alphax et alphay sont les anciennes formulat. des grossissements … … 394 422 395 423 IF( .NOT.fxyhypb ) THEN 396 397 PRINT *,' ******** PBS DANS DEFRUN******** '398 PRINT *,' *** fxyhypb lu sur le fichier start est F',399 * ' alors qu il est T sur run.def ***'424 IF( fxyhypbb ) THEN 425 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 426 write(lunout,*)' *** fxyhypb lu sur le fichier start est ', 427 * 'F alors qu il est T sur run.def ***' 400 428 STOP 401 429 ENDIF 402 430 ELSE 403 404 PRINT *,' ******** PBS DANS DEFRUN******** '405 PRINT *,' *** fxyhypb lu sur le fichier start est T',406 * ' alors qu il est F sur run.def **** '431 IF( .NOT.fxyhypbb ) THEN 432 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 433 write(lunout,*)' *** fxyhypb lu sur le fichier start est ', 434 * 'T alors qu il est F sur run.def **** ' 407 435 STOP 408 436 ENDIF 409 437 ENDIF 410 438 c … … 419 447 IF( fxyhypb ) THEN 420 448 IF( ABS(dzoomx - dzoomxx).GE. 0.001 ) THEN 421 PRINT *,' La valeur de dzoomx passee par run.def est differente422 * de celle lue sur le fichier start '449 write(lunout,*)'conf_gcm: La valeur de dzoomx passee par ', 450 * 'run.def est differente de celle lue sur le fichier start ' 423 451 STOP 424 452 ENDIF … … 435 463 IF( fxyhypb ) THEN 436 464 IF( ABS(dzoomy - dzoomyy).GE. 0.001 ) THEN 437 PRINT *,' La valeur de dzoomy passee par run.def est differente438 * de celle lue sur le fichier start '465 write(lunout,*)'conf_gcm: La valeur de dzoomy passee par ', 466 * 'run.def est differente de celle lue sur le fichier start ' 439 467 STOP 440 468 ENDIF … … 450 478 IF( fxyhypb ) THEN 451 479 IF( ABS(taux - tauxx).GE. 0.001 ) THEN 452 PRINT *,' La valeur de taux passee par run.def est differente453 * de celle lue sur le fichier start '480 write(lunout,*)'conf_gcm: La valeur de taux passee par ', 481 * 'run.def est differente de celle lue sur le fichier start ' 454 482 STOP 455 483 ENDIF … … 465 493 IF( fxyhypb ) THEN 466 494 IF( ABS(tauy - tauyy).GE. 0.001 ) THEN 467 PRINT *,' La valeur de tauy passee par run.def est differente468 * de celle lue sur le fichier start '495 write(lunout,*)'conf_gcm: La valeur de tauy passee par ', 496 * 'run.def est differente de celle lue sur le fichier start ' 469 497 STOP 470 498 ENDIF … … 484 512 485 513 IF( .NOT.ysinus ) THEN 486 IF( ysinuss ) THEN 487 PRINT *,' ******** PBS DANS DEFRUN ******** ' 488 PRINT *,' *** ysinus lu sur le fichier start est F ', 489 * 'alors qu il est T sur run.def ***' 514 IF( ysinuss ) THEN 515 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 516 write(lunout,*)' *** ysinus lu sur le fichier start est F', 517 * ' alors qu il est T sur run.def ***' 518 STOP 519 ENDIF 520 ELSE 521 IF( .NOT.ysinuss ) THEN 522 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 523 write(lunout,*)' *** ysinus lu sur le fichier start est T', 524 * ' alors qu il est F sur run.def **** ' 490 525 STOP 491 ENDIF 492 ELSE 493 IF( .NOT.ysinuss ) THEN 494 PRINT *,' ******** PBS DANS DEFRUN ******** ' 495 PRINT *,' *** ysinus lu sur le fichier start est T ', 496 * 'alors qu il est F sur run.def **** ' 497 STOP 498 ENDIF 526 ENDIF 499 527 ENDIF 500 ENDIF 528 ENDIF ! of IF( .NOT.fxyhypb ) 501 529 c 502 530 !Config Key = offline … … 519 547 520 548 549 !Config Key = ok_dynzon 550 !Config Desc = calcul et sortie des transports 551 !Config Def = n 552 !Config Help = Permet de mettre en route le calcul des transports 553 !Config 554 ok_dynzon = .FALSE. 555 CALL getin('ok_dynzon',ok_dynzon) 556 521 557 write(lunout,*)' #########################################' 522 558 write(lunout,*)' Configuration des parametres du gcm: ' 559 write(lunout,*)' planet_type = ', planet_type 523 560 write(lunout,*)' dayref = ', dayref 524 561 write(lunout,*)' anneeref = ', anneeref … … 529 566 write(lunout,*)' iecri = ', iecri 530 567 write(lunout,*)' periodav = ', periodav 568 write(lunout,*)' output_grads_dyn = ', output_grads_dyn 531 569 write(lunout,*)' idissip = ', idissip 532 570 write(lunout,*)' lstardis = ', lstardis … … 539 577 write(lunout,*)' coefdis = ', coefdis 540 578 write(lunout,*)' purmats = ', purmats 579 write(lunout,*)' read_start = ', read_start 541 580 write(lunout,*)' iflag_phys = ', iflag_phys 542 581 write(lunout,*)' iphysiq = ', iphysiq … … 552 591 write(lunout,*)' offline = ', offline 553 592 write(lunout,*)' config_inca = ', config_inca 593 write(lunout,*)' ok_dynzon = ', ok_dynzon 554 594 555 595 RETURN … … 590 630 591 631 IF( grossismx.LT.1. ) THEN 592 PRINT *,' *** ATTENTION !! grossismx < 1 . *** ' 632 write(lunout,*) 633 & 'conf_gcm: *** ATTENTION !! grossismx < 1 . *** ' 593 634 STOP 594 635 ELSE … … 598 639 599 640 IF( grossismy.LT.1. ) THEN 600 PRINT *,' *** ATTENTION !! grossismy < 1 . *** ' 641 write(lunout,*) 642 & 'conf_gcm: *** ATTENTION !! grossismy < 1 . *** ' 601 643 STOP 602 644 ELSE … … 604 646 ENDIF 605 647 606 PRINT *,' alphax alphay defrun',alphax,alphay648 write(lunout,*)'conf_gcm: alphax alphay ',alphax,alphay 607 649 c 608 650 c alphax et alphay sont les anciennes formulat. des grossissements … … 675 717 CALL getin('config_inca',config_inca) 676 718 719 !Config Key = ok_dynzon 720 !Config Desc = calcul et sortie des transports 721 !Config Def = n 722 !Config Help = Permet de mettre en route le calcul des transports 723 !Config 724 ok_dynzon = .FALSE. 725 CALL getin('ok_dynzon',ok_dynzon) 726 677 727 !Config key = ok_strato 678 728 !Config Desc = activation de la version strato … … 693 743 write(lunout,*)' #########################################' 694 744 write(lunout,*)' Configuration des parametres du gcm: ' 745 write(lunout,*)' planet_type = ', planet_type 695 746 write(lunout,*)' dayref = ', dayref 696 747 write(lunout,*)' anneeref = ', anneeref … … 701 752 write(lunout,*)' iecri = ', iecri 702 753 write(lunout,*)' periodav = ', periodav 754 write(lunout,*)' output_grads_dyn = ', output_grads_dyn 703 755 write(lunout,*)' idissip = ', idissip 704 756 write(lunout,*)' lstardis = ', lstardis … … 711 763 write(lunout,*)' coefdis = ', coefdis 712 764 write(lunout,*)' purmats = ', purmats 765 write(lunout,*)' read_start = ', read_start 713 766 write(lunout,*)' iflag_phys = ', iflag_phys 714 767 write(lunout,*)' iphysiq = ', iphysiq 715 write(lunout,*)' clon n = ', clonn716 write(lunout,*)' clat t = ', clatt768 write(lunout,*)' clon = ', clon 769 write(lunout,*)' clat = ', clat 717 770 write(lunout,*)' grossismx = ', grossismx 718 771 write(lunout,*)' grossismy = ', grossismy 719 write(lunout,*)' fxyhypb b = ', fxyhypbb772 write(lunout,*)' fxyhypb = ', fxyhypb 720 773 write(lunout,*)' dzoomx = ', dzoomx 721 774 write(lunout,*)' dzoomy = ', dzoomy … … 724 777 write(lunout,*)' offline = ', offline 725 778 write(lunout,*)' config_inca = ', config_inca 779 write(lunout,*)' ok_dynzon = ', ok_dynzon 726 780 write(lunout,*)' ok_strato = ', ok_strato 727 781 write(lunout,*)' ok_gradsfile = ', ok_gradsfile -
LMDZ4/trunk/libf/dyn3d/control.h
r962 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, & … … 20 21 & ,ip_ebil_dyn 21 22 REAL periodav 22 logicaloffline23 LOGICAL offline 23 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/dyn3d/create_etat0_limit.F
r1016 r1146 5 5 USE dimphy 6 6 USE comgeomphy 7 7 USE infotrac 8 8 c 9 9 c … … 28 28 #include "paramet.h" 29 29 #include "indicesol.h" 30 #include "advtrac.h"31 30 #include "control.h" 32 31 REAL :: masque(iip1,jjp1) 33 32 ! REAL :: pctsrf(iim*(jjm-1)+2, nbsrf) 34 33 35 c initialisation traceurs36 hadv_flg(:) = 0.37 vadv_flg(:) = 0.38 conv_flg(:) = 0.39 pbl_flg(:) = 0.40 tracnam(:) = ' '41 nprath = 142 nbtrac = 043 mmt_adj(:,:,:,:) = 144 45 34 IF (config_inca /= 'none') THEN 46 35 #ifdef INCA 47 36 call init_const_lmdz( 48 $ nbtr ac,anneeref,dayref,37 $ nbtr,anneeref,dayref, 49 38 $ iphysiq, day_step,nday) 50 39 #endif 51 print *, 'nbtr ac =' , nbtrac40 print *, 'nbtr =' , nbtr 52 41 END IF 53 42 54 CALL Init_Phys_lmdz(iim,jjp1,llm, nqmx-2,1,(jjm-1)*iim+2)43 CALL Init_Phys_lmdz(iim,jjp1,llm,1,(jjm-1)*iim+2) 55 44 call InitComgeomphy 56 45 -
LMDZ4/trunk/libf/dyn3d/diagedyn.F
r524 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/dyn3d/dynetat0.F
r541 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 7 USE infotrac 6 8 IMPLICIT NONE 7 9 … … 32 34 #include "serre.h" 33 35 #include "logic.h" 34 #include "advtrac.h"35 36 36 37 c Arguments: … … 38 39 39 40 CHARACTER*(*) fichnom 40 INTEGER nq41 41 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm),teta(ip1jmp1,llm) 42 REAL q(ip1jmp1,llm,nq ),masse(ip1jmp1,llm)42 REAL q(ip1jmp1,llm,nqtot),masse(ip1jmp1,llm) 43 43 REAL ps(ip1jmp1),phis(ip1jmp1) 44 44 … … 315 315 316 316 317 IF(nq .GE.1) THEN318 DO iq=1,nq 317 IF(nqtot.GE.1) THEN 318 DO iq=1,nqtot 319 319 ierr = NF_INQ_VARID (nid, tname(iq), nvarid) 320 320 IF (ierr .NE. NF_NOERR) THEN -
LMDZ4/trunk/libf/dyn3d/dynredem.F
r960 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) THEN461 DO iq=1,nq 459 IF(nqtot.GE.1) THEN 460 DO iq=1,nqtot 462 461 cIM 220306 BEG 463 462 #ifdef NC_DOUBLE … … 508 507 END 509 508 SUBROUTINE dynredem1(fichnom,time, 510 . vcov,ucov,teta,q,nq,masse,ps) 509 . vcov,ucov,teta,q,masse,ps) 510 USE infotrac 511 511 IMPLICIT NONE 512 512 c================================================================= … … 519 519 #include "comvert.h" 520 520 #include "comgeom.h" 521 #include "advtrac.h"522 521 #include "temps.h" 523 522 #include "control.h" 524 523 525 INTEGER nq,l524 INTEGER l 526 525 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) 527 526 REAL teta(ip1jmp1,llm) 528 527 REAL ps(ip1jmp1),masse(ip1jmp1,llm) 529 REAL q(ip1jmp1,llm,nq )528 REAL q(ip1jmp1,llm,nqtot) 530 529 CHARACTER*(*) fichnom 531 530 … … 633 632 END IF 634 633 635 IF(nq .GE.1) THEN636 do iq=1,nq 634 IF(nqtot.GE.1) THEN 635 do iq=1,nqtot 637 636 638 637 IF (config_inca == 'none') THEN -
LMDZ4/trunk/libf/dyn3d/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 10 10 USE dimphy 11 USE infotrac 11 12 USE fonte_neige_mod 12 13 USE pbl_surface_mod 13 14 USE phys_state_var_mod 15 USE filtreg_mod 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),35 .psol(iip1, jjp1), phis(iip1, jjp1)45 REAL :: orog(iip1,jjp1), rugo(iip1,jjp1) 46 REAL :: psol(iip1, jjp1), phis(iip1, jjp1) 36 47 REAL :: p3d(iip1, jjp1, llm+1) 37 48 REAL :: uvent(iip1, jjp1, llm) 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, ALLOCATABLE, DIMENSION(:,:,:,:) :: q3d 52 REAL :: qsat(iip1, jjp1, llm) 41 53 REAL :: tsol(klon), qsol(klon), sn(klon) 42 54 REAL :: tsolsrf(klon,nbsrf), qsolsrf(klon,nbsrf),snsrf(klon,nbsrf) … … 63 75 ! 64 76 INTEGER :: i,j, ig, l, ji,ii1,ii2 65 INTEGER :: nq66 77 REAL :: xpi 67 78 ! … … 141 152 ! 142 153 preff = 101325. 154 pa = 50000. 143 155 unskap = 1./kappa 144 156 ! … … 164 176 print*,'dtvr',dtvr 165 177 166 CALL inicons0() 178 179 180 CALL iniconst() 167 181 CALL inigeom() 168 ! 182 183 ! Initialisation pour traceurs 184 CALL infotrac_init 185 ALLOCATE(q3d(iip1,jjp1,llm,nqtot)) 186 187 169 188 CALL inifilr() 170 189 CALL phys_state_var_init() … … 623 642 phis(iip1,:) = phis(1,:) 624 643 625 C init pour traceurs626 call iniadvtrac(nq)627 644 C Ecriture 628 645 CALL inidissip( lstardis, nitergdiv, nitergrot, niterh , … … 648 665 * phi,w, pbaru,pbarv,time+iday-dayref ) 649 666 print*,'sortie caldyn0' 650 CALL dynredem0("start.nc",dayref,phis ,nqmx)667 CALL dynredem0("start.nc",dayref,phis) 651 668 print*,'sortie dynredem0' 652 CALL dynredem1("start.nc",0.0,vvent,uvent,tpot,q3d, nqmx,masse ,669 CALL dynredem1("start.nc",0.0,vvent,uvent,tpot,q3d,masse , 653 670 . psol) 654 671 print*,'sortie dynredem1' … … 741 758 visu_file='Etat0_visu.nc' 742 759 CALL initdynav(visu_file,dayref,anneeref,time_step, 743 . t_ops, t_wrt, nqmx,visuid)744 CALL writedynav(visuid, nqmx,itau,vvent ,760 . t_ops, t_wrt, visuid) 761 CALL writedynav(visuid, itau,vvent , 745 762 . uvent,tpot,pk,phi,q3d,masse,psol,phis) 746 763 else … … 749 766 print*,'entree histclo' 750 767 CALL histclo 768 769 DEALLOCATE(q3d) 770 771 #endif 772 !#endif of #ifdef CPP_EARTH 751 773 RETURN 752 774 ! -
LMDZ4/trunk/libf/dyn3d/fluxstokenc.F
r697 r1146 56 56 CALL initfluxsto( 'fluxstoke', 57 57 . time_step,istdyn* time_step,istdyn* time_step, 58 . nqmx,fluxid,fluxvid,fluxdid)58 . fluxid,fluxvid,fluxdid) 59 59 60 60 ndex(1) = 0 -
LMDZ4/trunk/libf/dyn3d/gcm.F
r962 r1146 8 8 #ifdef CPP_IOIPSL 9 9 USE IOIPSL 10 #endif 10 #else 11 ! if not using IOIPSL, we still need to use (a local version of) getin 12 USE ioipsl_getincom 13 #endif 14 15 USE filtreg_mod 16 USE infotrac 11 17 12 18 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 14 20 ! A nettoyer. On ne veut qu'une ou deux routines d'interface 15 21 ! dynamique -> physique pour l'initialisation 16 #ifdef CPP_PHYS 22 ! Ehouarn: for now these only apply to Earth: 23 #ifdef CPP_EARTH 17 24 USE dimphy 18 25 USE comgeomphy … … 68 75 #include "iniprint.h" 69 76 #include "tracstoke.h" 70 #include "advtrac.h"71 77 72 78 INTEGER longcles … … 83 89 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants 84 90 REAL teta(ip1jmp1,llm) ! temperature potentielle 85 REAL q(ip1jmp1,llm,nqmx)! champs advectes91 REAL, ALLOCATABLE, DIMENSION(:,:,:):: q! champs advectes 86 92 REAL ps(ip1jmp1) ! pression au sol 87 93 REAL p (ip1jmp1,llmp1 ) ! pression aux interfac.des couches … … 137 143 c variables pour l'initialisation de la physique : 138 144 c ------------------------------------------------ 139 INTEGER ngridmx ,nq145 INTEGER ngridmx 140 146 PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm ) 141 147 REAL zcufi(ngridmx),zcvfi(ngridmx) … … 155 161 dynhistave_file = 'dyn_hist_ave.nc' 156 162 157 c initialisation Anne 158 hadv_flg(:) = 0. 159 vadv_flg(:) = 0. 160 conv_flg(:) = 0. 161 pbl_flg(:) = 0. 162 tracnam(:) = ' ' 163 nprath = 1 164 nbtrac = 0 165 mmt_adj(:,:,:,:) = 1 166 167 168 c-------------------------------------------------------------------------- 169 c Iflag_phys controle l'appel a la physique : 170 c ------------------------------------------- 171 c 0 : pas de physique 172 c 1 : Normale (appel a phylmd, phymars ...) 173 c 2 : rappel Newtonien pour la temperature + friction au sol 174 iflag_phys=1 175 176 c-------------------------------------------------------------------------- 177 c Lecture de l'etat initial : 178 c --------------------------- 179 c T : on lit start.nc 180 c F : le modele s'autoinitialise avec un cas academique (iniacademic) 181 read_start=.true. 182 #ifdef CPP_IOIPSL 183 #else 184 read_start=.false. 185 #endif 186 #ifdef CPP_PHYS 187 #else 188 read_start=.false. 189 #endif 163 190 164 191 165 c----------------------------------------------------------------------- … … 204 178 c --------------------------------------- 205 179 c 206 #ifdef CPP_IOIPSL 180 ! Ehouarn: dump possibility of using defrun 181 !#ifdef CPP_IOIPSL 207 182 CALL conf_gcm( 99, .TRUE. , clesphy0 ) 208 #else209 CALL defrun( 99, .TRUE. , clesphy0 )210 #endif183 !#else 184 ! CALL defrun( 99, .TRUE. , clesphy0 ) 185 !#endif 211 186 212 187 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 214 189 ! A nettoyer. On ne veut qu'une ou deux routines d'interface 215 190 ! dynamique -> physique pour l'initialisation 216 #ifdef CPP_PHYS 217 CALL Init_Phys_lmdz(iim,jjp1,llm,nqmx-2,1,(jjm-1)*iim+2) 191 ! Ehouarn : temporarily (?) keep this only for Earth 192 if (planet_type.eq."earth") then 193 #ifdef CPP_EARTH 194 CALL Init_Phys_lmdz(iim,jjp1,llm,1,(jjm-1)*iim+2) 218 195 call InitComgeomphy 219 196 #endif 197 endif 220 198 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 221 199 222 200 IF (config_inca /= 'none') THEN 223 201 #ifdef INCA 224 call init_const_lmdz(nbtr ac,anneeref,dayref,iphysiq,day_step,nday)202 call init_const_lmdz(nbtr,anneeref,dayref,iphysiq,day_step,nday) 225 203 call init_inca_para(iim,jjm+1,klon,1,klon_mpi_para_nb,0) 226 204 #endif … … 237 215 c Initialisation des traceurs 238 216 c --------------------------- 239 c Choix du schema pour l'advection 240 c dans fichier trac.def ou via INCA 241 242 call iniadvtrac(nq) 243 c 217 c Choix du nombre de traceurs et du schema pour l'advection 218 c dans fichier traceur.def, par default ou via INCA 219 call infotrac_init 220 221 c Allocation de la tableau q : champs advectes 222 allocate(q(ip1jmp1,llm,nqtot)) 223 244 224 c----------------------------------------------------------------------- 245 225 c Lecture de l'etat initial : … … 248 228 c lecture du fichier start.nc 249 229 if (read_start) then 250 #ifdef CPP_IOIPSL 251 CALL dynetat0("start.nc",nqmx,vcov,ucov, 230 ! we still need to run iniacademic to initialize some 231 ! constants & fields, if we run the 'newtonian' case: 232 if (iflag_phys.eq.2) then 233 CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) 234 endif 235 !#ifdef CPP_IOIPSL 236 if (planet_type.eq."earth") then 237 #ifdef CPP_EARTH 238 ! Load an Earth-format start file 239 CALL dynetat0("start.nc",vcov,ucov, 252 240 . teta,q,masse,ps,phis, time_0) 241 #endif 242 endif ! of if (planet_type.eq."earth") 253 243 c write(73,*) 'ucov',ucov 254 244 c write(74,*) 'vcov',vcov … … 257 247 c write(77,*) 'q',q 258 248 259 #endif 260 endif 249 endif ! of if (read_start) 261 250 262 251 IF (config_inca /= 'none') THEN … … 270 259 c le cas echeant, creation d un etat initial 271 260 IF (prt_level > 9) WRITE(lunout,*) 272 . 'AVANT iniacademic AVANT AVANT AVANT AVANT'261 . 'GCM: AVANT iniacademic AVANT AVANT AVANT AVANT' 273 262 if (.not.read_start) then 274 CALL iniacademic( nqmx,vcov,ucov,teta,q,masse,ps,phis,time_0)263 CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) 275 264 endif 276 265 … … 304 293 if (annee_ref .ne. anneeref .or. day_ref .ne. dayref) then 305 294 write(lunout,*) 306 . ' Attention les dates initiales lues dans le fichier'295 . 'GCM: Attention les dates initiales lues dans le fichier' 307 296 write(lunout,*) 308 297 . ' restart ne correspondent pas a celles lues dans ' … … 310 299 if (raz_date .ne. 1) then 311 300 write(lunout,*) 312 . ' On garde les dates du fichier restart'301 . 'GCM: On garde les dates du fichier restart' 313 302 else 314 303 annee_ref = anneeref … … 319 308 time_0 = 0. 320 309 write(lunout,*) 321 . ' On reinitialise a la date lue dans gcm.def'310 . 'GCM: On reinitialise a la date lue dans gcm.def' 322 311 endif 323 312 ELSE … … 356 345 c Initialisation de la physique : 357 346 c ------------------------------- 358 #ifdef CPP_PHYS 359 IF (call_iniphys.and. iflag_phys.eq.1) THEN347 348 IF (call_iniphys.and.(iflag_phys.eq.1)) THEN 360 349 latfi(1)=rlatu(1) 361 350 lonfi(1)=0. … … 376 365 CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi) 377 366 WRITE(lunout,*) 378 . 'WARNING!!! vitesse verticale nulle dans la physique' 367 . 'GCM: WARNING!!! vitesse verticale nulle dans la physique' 368 ! Earth: 369 if (planet_type.eq."earth") then 370 #ifdef CPP_EARTH 379 371 CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys , 380 372 , latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp ) 373 #endif 374 endif ! of if (planet_type.eq."earth") 381 375 call_iniphys=.false. 382 ENDIF 383 #endif376 ENDIF ! of IF (call_iniphys.and.(iflag_phys.eq.1)) 377 !#endif 384 378 385 379 c numero de stockage pour les fichiers de redemarrage: … … 392 386 day_end = day_ini + nday 393 387 WRITE(lunout,300)day_ini,day_end 388 300 FORMAT('1'/,15x,'run du jour',i7,2x,'au jour',i7//) 389 390 if (planet_type.eq."earth") then 391 #ifdef CPP_EARTH 392 CALL dynredem0("restart.nc", day_end, phis) 393 #endif 394 endif 395 396 ecripar = .TRUE. 394 397 395 398 #ifdef CPP_IOIPSL 396 CALL dynredem0("restart.nc", day_end, phis, nqmx)397 398 ecripar = .TRUE.399 400 399 if ( 1.eq.1) then 401 400 time_step = zdtvr … … 403 402 t_wrt = iecri * daysec 404 403 CALL inithist(dynhist_file,day_ref,annee_ref,time_step, 405 . t_ops, t_wrt, nqmx, histid, histvid) 406 407 t_ops = iperiod * time_step 408 t_wrt = periodav * daysec 409 CALL initdynav(dynhistave_file,day_ref,annee_ref,time_step, 410 . t_ops, t_wrt, nqmx, histaveid) 411 404 . t_ops, t_wrt, histid, histvid) 405 406 IF (ok_dynzon) THEN 407 t_ops = iperiod * time_step 408 t_wrt = periodav * daysec 409 CALL initdynav(dynhistave_file,day_ref,annee_ref,time_step, 410 . t_ops, t_wrt, histaveid) 411 END IF 412 412 dtav = iperiod*dtvr/daysec 413 413 endif … … 415 415 416 416 #endif 417 ! #endif of #ifdef CPP_IOIPSL 417 418 418 419 c Choix des frequences de stokage pour le offline … … 435 436 436 437 437 CALL leapfrog(ucov,vcov,teta,ps,masse,phis, nq,q,clesphy0,438 CALL leapfrog(ucov,vcov,teta,ps,masse,phis,q,clesphy0, 438 439 . time_0) 439 440 440 441 442 300 FORMAT('1'/,15x,'run du pas',i7,2x,'au pas',i7,2x,443 . 'c''est a dire du jour',i7,3x,'au jour',i7//)444 441 END 445 442 -
LMDZ4/trunk/libf/dyn3d/groupeun.F
r524 r1146 2 2 ! $Header$ 3 3 ! 4 subroutinegroupeun(jjmax,llmax,q)5 implicit none4 SUBROUTINE groupeun(jjmax,llmax,q) 5 IMPLICIT NONE 6 6 7 7 #include "dimensions.h" … … 10 10 #include "comgeom2.h" 11 11 12 integerjjmax,llmax13 realq(iip1,jjmax,llmax)12 INTEGER jjmax,llmax 13 REAL q(iip1,jjmax,llmax) 14 14 15 integerngroup16 parameter(ngroup=3)15 INTEGER ngroup 16 PARAMETER (ngroup=3) 17 17 18 real airen,airecn,qn19 real aires,airecs,qs18 REAL airecn,qn 19 REAL airecs,qs 20 20 21 integeri,j,l,ig,j1,j2,i0,jd21 INTEGER i,j,l,ig,j1,j2,i0,jd 22 22 23 Champs 3D 23 c--------------------------------------------------------------------c 24 c Strategie d'optimisation c 25 c stocker les valeurs systematiquement recalculees c 26 c et identiques d'un pas de temps sur l'autre. Il s'agit des c 27 c aires des cellules qui sont sommees. S'il n'y a pas de changement c 28 c de grille au cours de la simulation tout devrait bien se passer. c 29 c Autre optimisation : determination des bornes entre lesquelles "j" c 30 c varie, au lieu de faire un test à chaque fois... 31 c--------------------------------------------------------------------c 32 33 INTEGER j_start, j_finish 34 35 REAL, SAVE :: airen_tab(iip1,jjp1,0:1) 36 REAL, SAVE :: aires_tab(iip1,jjp1,0:1) 37 38 LOGICAL, SAVE :: first = .TRUE. 39 40 IF (first) THEN 41 CALL INIT_GROUPEUN(airen_tab, aires_tab) 42 first = .FALSE. 43 ENDIF 44 45 c Champs 3D 24 46 jd=jjp1-jjmax 25 do l=1,llm26 j1=1+jd27 j2=228 do ig=1,ngroup29 do j=j1-jd,j2-jd30 c print*,'groupe ',ig,' j= ',j,2**(ngroup-ig+1),'pts groupes'31 do i0=1,iim,2**(ngroup-ig+1)32 airen=0.33 airecn=0.34 qn=0.35 aires=0.36 airecs=0.37 qs=0.38 do i=i0,i0+2**(ngroup-ig+1)-139 airen=airen+aire(i,j)40 aires=aires+aire(i,jjp1-j+1)41 qn=qn+q(i,j,l)42 qs=qs+q(i,jjp1-j+1-jd,l)43 enddo44 airecn=0.45 airecs=0.46 do i=i0,i0+2**(ngroup-ig+1)-147 q(i,j,l)=qn*aire(i,j)/airen48 q(i,jjp1-j+1-jd,l)=qs*aire(i,jjp1-j+1)/aires49 enddo50 enddo51 q(iip1,j,l)=q(1,j,l)52 q(iip1,jjp1-j+1-jd,l)=q(1,jjp1-j+1-jd,l)53 enddo54 j1=j2+155 j2=j2+2**ig56 enddo57 enddo58 47 59 return 60 end 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 = j1-jd 55 j_finish = 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 = j1-jd 71 j_finish = 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 90 RETURN 91 END 92 93 94 95 SUBROUTINE INIT_GROUPEUN(airen_tab, aires_tab) 96 IMPLICIT NONE 97 98 #include "dimensions.h" 99 #include "paramet.h" 100 #include "comconst.h" 101 #include "comgeom2.h" 102 103 INTEGER ngroup 104 PARAMETER (ngroup=3) 105 106 REAL airen,airecn 107 REAL aires,airecs 108 109 INTEGER i,j,l,ig,j1,j2,i0,jd 110 111 INTEGER j_start, j_finish 112 113 REAL :: airen_tab(iip1,jjp1,0:1) 114 REAL :: aires_tab(iip1,jjp1,0:1) 115 116 DO jd=0, 1 117 j1=1+jd 118 j2=2 119 DO ig=1,ngroup 120 121 ! c Concerne le pole nord 122 j_start = j1-jd 123 j_finish = j2-jd 124 DO j=j_start, j_finish 125 DO i0=1,iim,2**(ngroup-ig+1) 126 airen=0. 127 DO i=i0,i0+2**(ngroup-ig+1)-1 128 airen = airen+aire(i,j) 129 ENDDO 130 DO i=i0,i0+2**(ngroup-ig+1)-1 131 airen_tab(i,j,jd) = 132 & aire(i,j) / airen 133 ENDDO 134 ENDDO 135 ENDDO 136 137 ! c Concerne le pole sud 138 j_start = j1-jd 139 j_finish = j2-jd 140 DO j=j_start, j_finish 141 DO i0=1,iim,2**(ngroup-ig+1) 142 aires=0. 143 DO i=i0,i0+2**(ngroup-ig+1)-1 144 aires=aires+aire(i,jjp1-j+1) 145 ENDDO 146 DO i=i0,i0+2**(ngroup-ig+1)-1 147 aires_tab(i,jjp1-j+1,jd) = 148 & aire(i,jjp1-j+1) / aires 149 ENDDO 150 ENDDO 151 ENDDO 152 153 j1=j2+1 154 j2=j2+2**ig 155 ENDDO 156 ENDDO 157 158 RETURN 159 END -
LMDZ4/trunk/libf/dyn3d/guide.F
r1046 r1146 3 3 ! 4 4 subroutine guide(itau,ucov,vcov,teta,q,masse,ps) 5 6 use netcdf 5 7 6 8 IMPLICIT NONE … … 225 227 c lecture d'un fichier netcdf pour determiner le nombre de niveaux 226 228 if (guide_modele) then 227 if (ncidpl.eq.-99) ncidpl=NCOPN('apbp.nc',NCNOWRIT,rcod) 229 if (ncidpl.eq.-99) rcod=nf90_open('apbp.nc',Nf90_NOWRITe, 230 $ ncidpl) 228 231 else 229 232 if (guide_u) then 230 if (ncidpl.eq.-99) ncidpl=NCOPN('u.nc',NCNOWRIT,rcod)233 if (ncidpl.eq.-99) rcod=nf90_open('u.nc',Nf90_NOWRITe,ncidpl) 231 234 endif 232 235 c 233 236 if (guide_v) then 234 if (ncidpl.eq.-99) ncidpl=NCOPN('v.nc',NCNOWRIT,rcod)237 if (ncidpl.eq.-99) rcod=nf90_open('v.nc',nf90_nowrite,ncidpl) 235 238 endif 236 239 c 237 240 if (guide_T) then 238 if (ncidpl.eq.-99) ncidpl=NCOPN('T.nc',NCNOWRIT,rcod)241 if (ncidpl.eq.-99) rcod=nf90_open('T.nc',nf90_nowrite,ncidpl) 239 242 endif 240 243 c 241 244 if (guide_Q) then 242 if (ncidpl.eq.-99) ncidpl=NCOPN('hur.nc',NCNOWRIT,rcod) 245 if (ncidpl.eq.-99) rcod=nf90_open('hur.nc',nf90_nowrite, 246 $ ncidpl) 243 247 endif 244 248 c … … 251 255 status=NF_INQ_DIMLEN(ncidpl,rid,nlev) 252 256 print *,'nlev guide', nlev 253 call ncclos(ncidpl,rcod)257 rcod = nf90_close(ncidpl) 254 258 c Lecture du premier etat des reanalyses. 255 259 call read_reanalyse(1,ps -
LMDZ4/trunk/libf/dyn3d/iniacademic.F
r524 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/dyn3d/integrd.F
r524 r1146 32 32 #include "temps.h" 33 33 #include "serre.h" 34 #include "advtrac.h"35 34 36 35 c Arguments: -
LMDZ4/trunk/libf/dyn3d/leapfrog.F
r1060 r1146 2 2 c 3 3 c 4 SUBROUTINE leapfrog(ucov,vcov,teta,ps,masse,phis, nq,q,clesphy0,4 SUBROUTINE leapfrog(ucov,vcov,teta,ps,masse,phis,q,clesphy0, 5 5 & time_0) 6 6 7 7 8 8 cIM : pour sortir les param. du modele dans un fis. netcdf 110106 9 USE IOIPSL 9 #ifdef CPP_IOIPSL 10 use IOIPSL 11 #endif 12 USE infotrac 10 13 11 14 IMPLICIT NONE … … 56 59 #include "com_io_dyn.h" 57 60 #include "iniprint.h" 58 #include "advtrac.h"59 c#include "tracstoke.h"60 61 61 #include "academic.h" 62 62 63 63 ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique 64 64 ! #include "clesphys.h" 65 66 integer nq67 65 68 66 INTEGER longcles … … 76 74 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants 77 75 REAL teta(ip1jmp1,llm) ! temperature potentielle 78 REAL q(ip1jmp1,llm,nq mx) ! champs advectes76 REAL q(ip1jmp1,llm,nqtot) ! champs advectes 79 77 REAL ps(ip1jmp1) ! pression au sol 80 78 REAL p (ip1jmp1,llmp1 ) ! pression aux interfac.des couches … … 97 95 c tendances dynamiques 98 96 REAL dv(ip1jm,llm),du(ip1jmp1,llm) 99 REAL dteta(ip1jmp1,llm),dq(ip1jmp1,llm,nq mx),dp(ip1jmp1)97 REAL dteta(ip1jmp1,llm),dq(ip1jmp1,llm,nqtot),dp(ip1jmp1) 100 98 101 99 c tendances de la dissipation … … 105 103 c tendances physiques 106 104 REAL dvfi(ip1jm,llm),dufi(ip1jmp1,llm) 107 REAL dtetafi(ip1jmp1,llm),dqfi(ip1jmp1,llm,nq mx),dpfi(ip1jmp1)105 REAL dtetafi(ip1jmp1,llm),dqfi(ip1jmp1,llm,nqtot),dpfi(ip1jmp1) 108 106 109 107 c variables pour le fichier histoire … … 165 163 166 164 character*80 dynhist_file, dynhistave_file 167 character *20modname165 character(len=20) :: modname 168 166 character*80 abort_message 169 167 … … 182 180 PARAMETER (testita = 9) 183 181 184 logical , parameter :: flag_verif = . false.182 logical , parameter :: flag_verif = .true. 185 183 186 184 … … 190 188 itaufin = nday*day_step 191 189 itaufinp1 = itaufin +1 192 190 modname="leapfrog" 191 193 192 194 193 itau = 0 … … 220 219 call guide(itau,ucov,vcov,teta,q,masse,ps) 221 220 else 222 IF(prt_level>9)WRITE( *,*)'attention on ne guide pas les',223 . ' 6 dernieres heures'221 IF(prt_level>9)WRITE(lunout,*)'leapfrog: attention on ne ', 222 . 'guide pas les 6 dernieres heures' 224 223 endif 225 224 #endif … … 230 229 c ENDIF 231 230 c 231 232 ! Save fields obtained at previous time step as '...m1' 232 233 CALL SCOPY( ijmllm ,vcov , 1, vcovm1 , 1 ) 233 234 CALL SCOPY( ijp1llm,ucov , 1, ucovm1 , 1 ) … … 245 246 CALL filtreg ( finvmaold ,jjp1, llm, -2,2, .TRUE., 1 ) 246 247 247 call minmax(ijp1llm,q(:,:,3),zqmin,zqmax) 248 ! Ehouarn: what is this for? zqmin & zqmax are not used anyway ... 249 ! call minmax(ijp1llm,q(:,:,3),zqmin,zqmax) 248 250 249 251 2 CONTINUE … … 305 307 306 308 307 ENDIF 308 c 309 ENDIF 309 ENDIF ! of IF (offline) 310 c 311 ENDIF ! of IF( forward. OR . leapf ) 310 312 311 313 … … 353 355 c ----------------------------------------------------- 354 356 355 #ifdef CPP_PHYS356 357 c+jld 357 358 358 359 c Diagnostique de conservation de l'énergie : initialisation 359 IF (ip_ebil_dyn.ge.1 ) THEN360 IF (ip_ebil_dyn.ge.1 ) THEN 360 361 ztit='bil dyn' 361 CALL diagedyn(ztit,2,1,1,dtphys 362 e , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) 363 ENDIF 362 ! Ehouarn: be careful, diagedyn is Earth-specific (includes ../phylmd/..)! 363 IF (planet_type.eq."earth") THEN 364 CALL diagedyn(ztit,2,1,1,dtphys 365 & , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) 366 ENDIF 367 ENDIF ! of IF (ip_ebil_dyn.ge.1 ) 364 368 c-jld 369 #ifdef CPP_IOIPSL 365 370 cIM : pour sortir les param. du modele dans un fis. netcdf 110106 366 IF (first) THEN367 first=.false.371 IF (first) THEN 372 first=.false. 368 373 #include "ini_paramLMDZ_dyn.h" 369 ENDIF374 ENDIF 370 375 c 371 376 #include "write_paramLMDZ_dyn.h" 372 377 c 373 374 CALL calfis( nq, lafin ,rdayvrai,time , 378 #endif 379 ! #endif of #ifdef CPP_IOIPSL 380 CALL calfis( lafin ,rdayvrai,time , 375 381 $ ucov,vcov,teta,q,masse,ps,p,pk,phis,phi , 376 382 $ du,dv,dteta,dq, … … 378 384 $ clesphy0, dufi,dvfi,dtetafi,dqfi,dpfi ) 379 385 380 IF (ok_strato) THEN381 CALL top_bound( vcov,ucov,teta, dufi,dvfi,dtetafi)382 ENDIF386 IF (ok_strato) THEN 387 CALL top_bound( vcov,ucov,teta, dufi,dvfi,dtetafi) 388 ENDIF 383 389 384 390 c ajout des tendances physiques: 385 391 c ------------------------------ 386 CALL addfi( nqmx,dtphys, leapf, forward ,392 CALL addfi( dtphys, leapf, forward , 387 393 $ ucov, vcov, teta , q ,ps , 388 394 $ dufi, dvfi, dtetafi , dqfi ,dpfi ) 389 395 c 390 396 c Diagnostique de conservation de l'énergie : difference 391 IF (ip_ebil_dyn.ge.1 ) THEN397 IF (ip_ebil_dyn.ge.1 ) THEN 392 398 ztit='bil phys' 393 CALL diagedyn(ztit,2,1,1,dtphys 394 e , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) 395 ENDIF 396 #endif 399 IF (planet_type.eq."earth") THEN 400 CALL diagedyn(ztit,2,1,1,dtphys 401 & , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) 402 ENDIF 403 ENDIF ! of IF (ip_ebil_dyn.ge.1 ) 404 397 405 ENDIF ! of IF( apphys ) 398 406 399 IF(iflag_phys.EQ.2) THEN ! "Newtonian physics" case407 IF(iflag_phys.EQ.2) THEN ! "Newtonian" case 400 408 c Calcul academique de la physique = Rappel Newtonien + friction 401 409 c -------------------------------------------------------------- … … 475 483 476 484 477 END IF 485 END IF ! of IF(apdiss) 478 486 479 487 c ajout debug … … 509 517 IF( itau. EQ. itaufinp1 ) then 510 518 if (flag_verif) then 511 write( 79,*) 'ucov',ucov512 write(8 0,*) 'vcov',vcov513 write(8 1,*) 'teta',teta514 write(8 2,*) 'ps',ps515 write(8 3,*) 'q',q519 write(80,*) 'ucov',ucov 520 write(81,*) 'vcov',vcov 521 write(82,*) 'teta',teta 522 write(83,*) 'ps',ps 523 write(84,*) 'q',q 516 524 WRITE(85,*) 'q1 = ',q(:,:,1) 517 525 WRITE(86,*) 'q3 = ',q(:,:,3) 526 write(90) ucov 527 write(91) vcov 528 write(92) teta 529 write(93) ps 530 write(94) q 518 531 endif 519 532 … … 532 545 iav=0 533 546 ENDIF 547 548 IF (ok_dynzon) THEN 534 549 #ifdef CPP_IOIPSL 535 CALL writedynav(histaveid, nqmx, itau,vcov , 536 , ucov,teta,pk,phi,q,masse,ps,phis) 537 call bilan_dyn (2,dtvr*iperiod,dtvr*day_step*periodav, 538 , ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) 539 #endif 550 CALL writedynav(histaveid, itau,vcov , 551 , ucov,teta,pk,phi,q,masse,ps,phis) 552 CALL bilan_dyn (2,dtvr*iperiod,dtvr*day_step*periodav, 553 , ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) 554 #endif 555 END IF 540 556 541 557 ENDIF … … 548 564 c IF( MOD(itau,iecri*day_step).EQ.0) THEN 549 565 550 551 CALL geopot ( ip1jmp1, teta , pk , pks, phis , phi)552 unat=0.553 do l=1,llm554 unat(iip2:ip1jm,l)=ucov(iip2:ip1jm,l)/cu(iip2:ip1jm)555 vnat(:,l)=vcov(:,l)/cv(:)556 enddo566 nbetat = nbetatdem 567 CALL geopot(ip1jmp1,teta,pk,pks,phis,phi) 568 unat=0. 569 do l=1,llm 570 unat(iip2:ip1jm,l)=ucov(iip2:ip1jm,l)/cu(iip2:ip1jm) 571 vnat(:,l)=vcov(:,l)/cv(:) 572 enddo 557 573 #ifdef CPP_IOIPSL 558 c CALL writehist(histid,histvid, nqmx,itau,vcov, 559 c s ucov,teta,phi,q,masse,ps,phis) 560 #else 574 c CALL writehist(histid,histvid,itau,vcov, 575 c & ucov,teta,phi,q,masse,ps,phis) 576 #endif 577 ! For some Grads outputs of fields 578 if (output_grads_dyn) then 561 579 #include "write_grads_dyn.h" 562 #endif 563 564 565 ENDIF 580 endif 581 582 ENDIF ! of IF(MOD(itau,iecri).EQ.0) 566 583 567 584 IF(itau.EQ.itaufin) THEN 568 585 569 586 570 #ifdef CPP_IOIPSL 571 CALL dynredem1("restart.nc",0.0, 572 , vcov,ucov,teta,q,nqmx,masse,ps) 573 #endif 587 if (planet_type.eq."earth") then 588 #ifdef CPP_EARTH 589 ! Write an Earth-format restart file 590 CALL dynredem1("restart.nc",0.0, 591 & vcov,ucov,teta,q,masse,ps) 592 #endif 593 endif ! of if (planet_type.eq."earth") 574 594 575 595 CLOSE(99) 576 ENDIF 596 ENDIF ! of IF (itau.EQ.itaufin) 577 597 578 598 c----------------------------------------------------------------------- … … 596 616 leapf = .TRUE. 597 617 dt = 2.*dtvr 598 GO TO 2 599 END IF 618 GO TO 2 619 END IF ! of IF (forward) 600 620 ELSE 601 621 … … 605 625 dt = 2.*dtvr 606 626 GO TO 2 607 END IF 608 609 ELSE 627 END IF ! of IF (MOD(itau,iperiod).EQ.0) 628 ! ELSEIF (MOD(itau-1,iperiod).EQ.0) 629 630 ELSE ! of IF (.not.purmats) 610 631 611 632 c ........................................................ … … 630 651 GO TO 2 631 652 632 ELSE 633 634 IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN653 ELSE ! of IF(forward) 654 655 IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN 635 656 IF(itau.EQ.itaufin) THEN 636 657 iav=1 … … 638 659 iav=0 639 660 ENDIF 661 662 IF (ok_dynzon) THEN 640 663 #ifdef CPP_IOIPSL 641 CALL writedynav(histaveid, nqmx, itau,vcov , 642 , ucov,teta,pk,phi,q,masse,ps,phis) 643 call bilan_dyn (2,dtvr*iperiod,dtvr*day_step*periodav, 644 , ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) 645 #endif 646 647 ENDIF 648 649 IF(MOD(itau,iecri ).EQ.0) THEN 664 CALL writedynav(histaveid, itau,vcov , 665 , ucov,teta,pk,phi,q,masse,ps,phis) 666 CALL bilan_dyn (2,dtvr*iperiod,dtvr*day_step*periodav, 667 , ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) 668 #endif 669 END IF 670 671 ENDIF ! of IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) 672 673 IF(MOD(itau,iecri ).EQ.0) THEN 650 674 c IF(MOD(itau,iecri*day_step).EQ.0) THEN 651 652 CALL geopot ( ip1jmp1, teta , pk , pks, phis , phi)653 unat=0.654 do l=1,llm655 unat(iip2:ip1jm,l)=ucov(iip2:ip1jm,l)/cu(iip2:ip1jm)656 vnat(:,l)=vcov(:,l)/cv(:)657 enddo675 nbetat = nbetatdem 676 CALL geopot(ip1jmp1,teta,pk,pks,phis,phi) 677 unat=0. 678 do l=1,llm 679 unat(iip2:ip1jm,l)=ucov(iip2:ip1jm,l)/cu(iip2:ip1jm) 680 vnat(:,l)=vcov(:,l)/cv(:) 681 enddo 658 682 #ifdef CPP_IOIPSL 659 c CALL writehist( histid, histvid, nqmx, itau,vcov , 660 c , ucov,teta,phi,q,masse,ps,phis) 661 #else 683 c CALL writehist( histid, histvid, itau,vcov , 684 c & ucov,teta,phi,q,masse,ps,phis) 685 #endif 686 ! For some Grads outputs 687 if (output_grads_dyn) then 662 688 #include "write_grads_dyn.h" 663 #endif 664 665 666 ENDIF 667 668 #ifdef CPP_IOIPSL 669 IF(itau.EQ.itaufin) 670 . CALL dynredem1("restart.nc",0.0, 671 . vcov,ucov,teta,q,nqmx,masse,ps) 672 #endif 673 674 forward = .TRUE. 675 GO TO 1 676 677 ENDIF 678 679 END IF 689 endif 690 691 ENDIF ! of IF(MOD(itau,iecri ).EQ.0) 692 693 IF(itau.EQ.itaufin) THEN 694 if (planet_type.eq."earth") then 695 #ifdef CPP_EARTH 696 CALL dynredem1("restart.nc",0.0, 697 & vcov,ucov,teta,q,masse,ps) 698 #endif 699 endif ! of if (planet_type.eq."earth") 700 ENDIF ! of IF(itau.EQ.itaufin) 701 702 forward = .TRUE. 703 GO TO 1 704 705 ENDIF ! of IF (forward) 706 707 END IF ! of IF(.not.purmats) 680 708 681 709 STOP -
LMDZ4/trunk/libf/dyn3d/qminimum.F
r524 r1146 42 42 c 43 43 DO 1000 k = 1, llm 44 DO 1040 i = 1, ip1jmp1 45 zx_defau = AMAX1( seuil_liq - q(i,k,iq_liq), 0.0 ) 46 q(i,k,iq_vap) = q(i,k,iq_vap) - zx_defau 47 q(i,k,iq_liq) = q(i,k,iq_liq) + zx_defau 48 1040 CONTINUE 44 DO 1040 i = 1, ip1jmp1 45 if (seuil_liq - q(i,k,iq_liq) .gt. 0.d0 ) then 46 q(i,k,iq_vap) = q(i,k,iq_vap) + q(i,k,iq_liq) - seuil_liq 47 q(i,k,iq_liq) = seuil_liq 48 endif 49 1040 CONTINUE 49 50 1000 CONTINUE 50 51 c … … 56 57 DO k = llm, 2, -1 57 58 ccc zx_abc = dpres(k) / dpres(k-1) 58 DO i = 1, ip1jmp1 59 zx_abc = deltap(i,k)/deltap(i,k-1) 60 zx_defau = AMAX1( seuil_vap - q(i,k,iq), 0.0 ) 61 q(i,k-1,iq) = q(i,k-1,iq) - zx_defau * zx_abc 62 q(i,k,iq) = q(i,k,iq) + zx_defau 63 ENDDO 59 DO i = 1, ip1jmp1 60 if ( seuil_vap - q(i,k,iq) .gt. 0.d0 ) then 61 q(i,k-1,iq) = q(i,k-1,iq) - ( seuil_vap - q(i,k,iq) ) * 62 & deltap(i,k) / deltap(i,k-1) 63 q(i,k,iq) = seuil_vap 64 endif 65 ENDDO 64 66 ENDDO 65 67 c -
LMDZ4/trunk/libf/dyn3d/read_reanalyse.F
r1122 r1146 13 13 c Declarations 14 14 c ----------------------------------------------------------------- 15 use netcdf 16 15 17 IMPLICIT NONE 16 18 … … 72 74 print *,'Vous êtes entrain de lire des données sur 73 75 . niveaux modèle' 74 ncidpl=NCOPN('apbp.nc',NCNOWRIT,rcode)75 varidap=NCVID(ncidpl,'AP',rcode)76 varidbp=NCVID(ncidpl,'BP',rcode)76 rcode=nf90_open('apbp.nc',nf90_nowrite,ncidpl) 77 rcode = nf90_inq_varid(ncidpl, 'AP', varidap) 78 rcode = nf90_inq_varid(ncidpl, 'BP', varidbp) 77 79 print*,'ncidpl,varidap',ncidpl,varidap 78 80 endif … … 80 82 c Vent zonal 81 83 if (guide_u) then 82 ncidu=NCOPN('u.nc',NCNOWRIT,rcode)83 varidu=NCVID(ncidu,'UWND',rcode)84 print*,'ncidu,varidu',ncidu,varidu85 if (ncidpl.eq.-99) ncidpl=ncidu84 rcode=nf90_open('u.nc',nf90_nowrite,ncidu) 85 rcode = nf90_inq_varid(ncidu, 'UWND', varidu) 86 print*,'ncidu,varidu',ncidu,varidu 87 if (ncidpl.eq.-99) ncidpl=ncidu 86 88 endif 87 89 88 90 c Vent meridien 89 91 if (guide_v) then 90 ncidv=NCOPN('v.nc',NCNOWRIT,rcode)91 varidv=NCVID(ncidv,'VWND',rcode)92 rcode=nf90_open('v.nc',nf90_nowrite,ncidv) 93 rcode = nf90_inq_varid(ncidv, 'VWND', varidv) 92 94 print*,'ncidv,varidv',ncidv,varidv 93 95 if (ncidpl.eq.-99) ncidpl=ncidv … … 96 98 c Temperature 97 99 if (guide_T) then 98 ncidt=NCOPN('T.nc',NCNOWRIT,rcode)99 varidt=NCVID(ncidt,'AIR',rcode)100 rcode=nf90_open('T.nc',nf90_nowrite,ncidt) 101 rcode = nf90_inq_varid(ncidt, 'AIR', varidt) 100 102 print*,'ncidt,varidt',ncidt,varidt 101 103 if (ncidpl.eq.-99) ncidpl=ncidt … … 104 106 c Humidite 105 107 if (guide_Q) then 106 ncidQ=NCOPN('hur.nc',NCNOWRIT,rcode)107 varidQ=NCVID(ncidQ,'RH',rcode)108 rcode=nf90_open('hur.nc',nf90_nowrite,ncidQ) 109 rcode = nf90_inq_varid(ncidQ, 'RH', varidQ) 108 110 print*,'ncidQ,varidQ',ncidQ,varidQ 109 111 if (ncidpl.eq.-99) ncidpl=ncidQ … … 112 114 c Pression de surface 113 115 if ((guide_P).OR.(guide_modele)) then 114 ncidps=NCOPN('ps.nc',NCNOWRIT,rcode)115 varidps=NCVID(ncidps,'SP',rcode)116 rcode=nf90_open('ps.nc',nf90_nowrite,ncidps) 117 rcode = nf90_inq_varid(ncidps, 'SP', varidps) 116 118 print*,'ncidps,varidps',ncidps,varidps 117 119 endif … … 119 121 c Coordonnee verticale 120 122 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,varidpl123 if (ncep) then 124 print*,'Vous etes entrain de lire des donnees NCEP' 125 rcode = nf90_inq_varid(ncidpl, 'LEVEL', varidpl) 126 else 127 print*,'Vous etes entrain de lire des donnees ECMWF' 128 rcode = nf90_inq_varid(ncidpl, 'PRESSURE', varidpl) 129 endif 130 print*,'ncidpl,varidpl',ncidpl,varidpl 129 131 endif 130 132 ! endif (first) -
LMDZ4/trunk/libf/dyn3d/serre.h
r524 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/dyn3d/test_period.F
r524 r1146 9 9 c teta, q , p et phis .......... 10 10 c 11 USE infotrac 11 12 c IMPLICIT NONE 12 13 c … … 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/dyn3d/write_grads_dyn.h
r524 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
Note: See TracChangeset
for help on using the changeset viewer.