Changeset 1999 for LMDZ5/branches/testing/libf/dyn3d/caldyn.F
- Timestamp:
- Mar 20, 2014, 10:57:19 AM (10 years ago)
- Location:
- LMDZ5/branches/testing
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/branches/testing
- Property svn:mergeinfo changed
/LMDZ5/trunk merged: 1922-1927,1929-1933,1937-1939,1943-1997
- Property svn:mergeinfo changed
-
LMDZ5/branches/testing/libf/dyn3d/caldyn.F
r1910 r1999 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 c5 c6 4 SUBROUTINE caldyn 7 5 $ (itau,ucov,vcov,teta,ps,masse,pk,pkf,phis , … … 10 8 IMPLICIT NONE 11 9 12 c=======================================================================13 c 14 cAuteur : P. Le Van15 c 16 cObjet:17 c------18 c 19 cCalcul des tendances dynamiques.20 c 21 cModif 04/93 F.Forget22 c=======================================================================10 !======================================================================= 11 ! 12 ! Auteur : P. Le Van 13 ! 14 ! Objet: 15 ! ------ 16 ! 17 ! Calcul des tendances dynamiques. 18 ! 19 ! Modif 04/93 F.Forget 20 !======================================================================= 23 21 24 c-----------------------------------------------------------------------25 c0. Declarations:26 c----------------22 !----------------------------------------------------------------------- 23 ! 0. Declarations: 24 ! ---------------- 27 25 28 26 #include "dimensions.h" … … 32 30 #include "comgeom.h" 33 31 34 cArguments:35 c----------32 ! Arguments: 33 ! ---------- 36 34 37 LOGICAL conser 35 LOGICAL,INTENT(IN) :: conser ! triggers printing some diagnostics 36 INTEGER,INTENT(IN) :: itau ! time step index 37 REAL,INTENT(IN) :: vcov(ip1jm,llm) ! covariant meridional wind 38 REAL,INTENT(IN) :: ucov(ip1jmp1,llm) ! covariant zonal wind 39 REAL,INTENT(IN) :: teta(ip1jmp1,llm) ! potential temperature 40 REAL,INTENT(IN) :: ps(ip1jmp1) ! surface pressure 41 REAL,INTENT(IN) :: phis(ip1jmp1) ! geopotential at the surface 42 REAL,INTENT(IN) :: pk(ip1jmp1,llm) ! Exner at mid-layer 43 REAL,INTENT(IN) :: pkf(ip1jmp1,llm) ! filtered Exner 44 REAL,INTENT(IN) :: phi(ip1jmp1,llm) ! geopotential 45 REAL,INTENT(OUT) :: masse(ip1jmp1,llm) ! air mass 46 REAL,INTENT(OUT) :: dv(ip1jm,llm) ! tendency on vcov 47 REAL,INTENT(OUT) :: du(ip1jmp1,llm) ! tendency on ucov 48 REAL,INTENT(OUT) :: dteta(ip1jmp1,llm) ! tenddency on teta 49 REAL,INTENT(OUT) :: dp(ip1jmp1) ! tendency on ps 50 REAL,INTENT(OUT) :: w(ip1jmp1,llm) ! vertical velocity 51 REAL,INTENT(OUT) :: pbaru(ip1jmp1,llm) ! mass flux in the zonal direction 52 REAL,INTENT(OUT) :: pbarv(ip1jm,llm) ! mass flux in the meridional direction 53 REAL,INTENT(IN) :: time ! current time 38 54 39 INTEGER itau 40 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm),teta(ip1jmp1,llm) 41 REAL ps(ip1jmp1),phis(ip1jmp1) 42 REAL pk(iip1,jjp1,llm),pkf(ip1jmp1,llm) 55 ! Local: 56 ! ------ 57 43 58 REAL vcont(ip1jm,llm),ucont(ip1jmp1,llm) 44 REAL phi(ip1jmp1,llm),masse(ip1jmp1,llm)45 REAL dv(ip1jm,llm),du(ip1jmp1,llm)46 REAL dteta(ip1jmp1,llm),dp(ip1jmp1)47 REAL pbaru(ip1jmp1,llm),pbarv(ip1jm,llm)48 REAL time49 50 c Local:51 c ------52 53 59 REAL ang(ip1jmp1,llm),p(ip1jmp1,llmp1) 54 60 REAL massebx(ip1jmp1,llm),masseby(ip1jm,llm),psexbarxy(ip1jm) 55 61 REAL vorpot(ip1jm,llm) 56 REAL w(ip1jmp1,llm),ecin(ip1jmp1,llm),convm(ip1jmp1,llm)62 REAL ecin(ip1jmp1,llm),convm(ip1jmp1,llm) 57 63 REAL bern(ip1jmp1,llm) 58 64 REAL massebxy(ip1jm,llm) … … 61 67 INTEGER ij,l 62 68 63 c-----------------------------------------------------------------------64 c Calcul des tendances dynamiques:65 c--------------------------------69 !----------------------------------------------------------------------- 70 ! Compute dynamical tendencies: 71 !-------------------------------- 66 72 73 ! compute contravariant winds ucont() and vcont 67 74 CALL covcont ( llm , ucov , vcov , ucont, vcont ) 75 ! compute pressure p() 68 76 CALL pression ( ip1jmp1, ap , bp , ps , p ) 77 ! compute psexbarxy() XY-area weighted-averaged surface pressure (what for?) 69 78 CALL psextbar ( ps , psexbarxy ) 79 ! compute mass in each atmospheric mesh: masse() 70 80 CALL massdair ( p , masse ) 81 ! compute X and Y-averages of mass, massebx() and masseby() 71 82 CALL massbar ( masse, massebx , masseby ) 83 ! compute XY-average of mass, massebxy() 72 84 call massbarxy( masse, massebxy ) 85 ! compute mass fluxes pbaru() and pbarv() 73 86 CALL flumass ( massebx, masseby , vcont, ucont ,pbaru, pbarv ) 87 ! compute dteta() , horizontal converging flux of theta 74 88 CALL dteta1 ( teta , pbaru , pbarv, dteta ) 89 ! compute convm(), horizontal converging flux of mass 75 90 CALL convmas ( pbaru, pbarv , convm ) 76 91 92 ! compute pressure variation due to mass convergence 77 93 DO ij =1, ip1jmp1 78 94 dp( ij ) = convm( ij,1 ) / airesurg( ij ) 79 95 ENDDO 80 96 97 ! compute vertical velocity w() 81 98 CALL vitvert ( convm , w ) 99 ! compute potential vorticity vorpot() 82 100 CALL tourpot ( vcov , ucov , massebxy , vorpot ) 101 ! compute rotation induced du() and dv() 83 102 CALL dudv1 ( vorpot , pbaru , pbarv , du , dv ) 103 ! compute kinetic energy ecin() 84 104 CALL enercin ( vcov , ucov , vcont , ucont , ecin ) 105 ! compute Bernouilli function bern() 85 106 CALL bernoui ( ip1jmp1, llm , phi , ecin , bern ) 107 ! compute and add du() and dv() contributions from Bernouilli and pressure 86 108 CALL dudv2 ( teta , pkf , bern , du , dv ) 87 109 … … 90 112 DO ij=1,ip1jmp1 91 113 ang(ij,l) = ucov(ij,l) + constang(ij) 92 ENDDO114 ENDDO 93 115 ENDDO 94 116 95 117 ! compute vertical advection contributions to du(), dv() and dteta() 96 118 CALL advect( ang, vcov, teta, w, massebx, masseby, du, dv,dteta ) 97 119 98 CWARNING probleme de peridocite de dv sur les PC/linux. Pb d'arrondi99 Cprobablement. Observe sur le code compile avec pgf90 3.0-1120 ! WARNING probleme de peridocite de dv sur les PC/linux. Pb d'arrondi 121 ! probablement. Observe sur le code compile avec pgf90 3.0-1 100 122 101 123 DO l = 1, llm 102 124 DO ij = 1, ip1jm, iip1 103 125 IF( dv(ij,l).NE.dv(ij+iim,l) ) THEN 104 cPRINT *,'!!!ATTENTION!!! probleme de periodicite sur vcov',105 c, ' dans caldyn'106 cPRINT *,' l, ij = ', l, ij, ij+iim,dv(ij+iim,l),dv(ij,l)126 ! PRINT *,'!!!ATTENTION!!! probleme de periodicite sur vcov', 127 ! , ' dans caldyn' 128 ! PRINT *,' l, ij = ', l, ij, ij+iim,dv(ij+iim,l),dv(ij,l) 107 129 dv(ij+iim,l) = dv(ij,l) 108 endif 109 enddo 110 enddo 111 c----------------------------------------------------------------------- 112 c Sorties eventuelles des variables de controle: 113 c ---------------------------------------------- 130 ENDIF 131 ENDDO 132 ENDDO 133 134 !----------------------------------------------------------------------- 135 ! Output some control variables: 136 !--------------------------------- 114 137 115 138 IF( conser ) THEN 116 139 CALL sortvarc 117 $ ( itau,ucov,teta,ps,masse,pk,phis,vorpot,phi,bern,dp,time,vcov ) 118 140 & ( itau,ucov,teta,ps,masse,pk,phis,vorpot,phi,bern,dp,time,vcov ) 119 141 ENDIF 120 142 121 RETURN122 143 END
Note: See TracChangeset
for help on using the changeset viewer.