Changeset 1189 for trunk/LMDZ.COMMON/libf/dyn3dpar
- Timestamp:
- Feb 25, 2014, 10:59:48 AM (11 years ago)
- Location:
- trunk/LMDZ.COMMON/libf/dyn3dpar
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/dyn3dpar/addfi_p.F
r1019 r1189 55 55 c ----------- 56 56 c 57 REAL pdt 58 c 59 REAL pvcov(ip1jm,llm),pucov(ip1jmp1,llm) 60 REAL pteta(ip1jmp1,llm),pq(ip1jmp1,llm,nqtot),pps(ip1jmp1) 61 c 62 REAL pdvfi(ip1jm,llm),pdufi(ip1jmp1,llm) 63 REAL pdqfi(ip1jmp1,llm,nqtot),pdhfi(ip1jmp1,llm),pdpfi(ip1jmp1) 64 c 65 LOGICAL leapf,forward 57 REAL,INTENT(IN) :: pdt ! time step for the integration (s) 58 c 59 REAL,INTENT(INOUT) :: pvcov(ip1jm,llm) ! covariant meridional wind 60 REAL,INTENT(INOUT) :: pucov(ip1jmp1,llm) ! covariant zonal wind 61 REAL,INTENT(INOUT) :: pteta(ip1jmp1,llm) ! potential temperature 62 REAL,INTENT(INOUT) :: pq(ip1jmp1,llm,nqtot) ! tracers 63 REAL,INTENT(INOUT) :: pps(ip1jmp1) ! surface pressure (Pa) 64 c respective tendencies (.../s) to add 65 REAL,INTENT(IN) :: pdvfi(ip1jm,llm) 66 REAL,INTENT(IN) :: pdufi(ip1jmp1,llm) 67 REAL,INTENT(IN) :: pdqfi(ip1jmp1,llm,nqtot) 68 REAL,INTENT(IN) :: pdhfi(ip1jmp1,llm) 69 REAL,INTENT(IN) :: pdpfi(ip1jmp1) 70 c 71 LOGICAL,INTENT(IN) :: leapf,forward ! not used 66 72 c 67 73 c … … 71 77 REAL xpn(iim),xps(iim),tpn,tps 72 78 INTEGER j,k,iq,ij 73 REAL qtestw, qtestt 74 PARAMETER ( qtestw = 1.0e-15 ) 75 PARAMETER ( qtestt = 1.0e-40 ) 79 REAL,PARAMETER :: qtestw = 1.0e-15 80 REAL,PARAMETER :: qtestt = 1.0e-40 76 81 77 82 REAL SSUM -
trunk/LMDZ.COMMON/libf/dyn3dpar/advtrac_p.F90
r1019 r1189 16 16 USE Vampir 17 17 USE times 18 USE infotrac 19 USE control_mod 18 USE infotrac, ONLY: nqtot, iadv 19 USE control_mod, ONLY: iapp_tracvl, day_step, planet_type 20 20 IMPLICIT NONE 21 21 ! … … 34 34 ! Arguments 35 35 !------------------------------------------------------------------- 36 INTEGER,INTENT(OUT) :: iapptrac 37 REAL,INTENT(IN) :: pbaru(ip1jmp1,llm) 38 REAL,INTENT(IN) :: pbarv(ip1jm,llm) 39 REAL,INTENT(INOUT) :: q(ip1jmp1,llm,nqtot) 40 REAL,INTENT(IN) :: masse(ip1jmp1,llm) 41 REAL,INTENT(IN) :: p( ip1jmp1,llmp1 ) 42 REAL,INTENT(IN) :: teta(ip1jmp1,llm) 43 REAL,INTENT(IN) :: pk(ip1jmp1,llm) 44 REAL,INTENT(OUT) :: flxw(ip1jmp1,llm) 45 !------------------------------------------------------------------- 36 46 ! Ajout PPM 37 47 !-------------------------------------------------------- 38 48 REAL massebx(ip1jmp1,llm),masseby(ip1jm,llm) 39 !--------------------------------------------------------40 INTEGER iapptrac41 REAL pbaru(ip1jmp1,llm),pbarv(ip1jm,llm)42 REAL q(ip1jmp1,llm,nqtot),masse(ip1jmp1,llm)43 REAL p( ip1jmp1,llmp1 ),teta(ip1jmp1,llm)44 REAL pk(ip1jmp1,llm)45 REAL :: flxw(ip1jmp1,llm)46 47 49 !------------------------------------------------------------- 48 50 ! Variables locales -
trunk/LMDZ.COMMON/libf/dyn3dpar/caldyn_p.F
r1019 r1189 1 1 ! 2 ! $Header$ 3 ! 4 c 5 c 2 ! $Id: $ 3 ! 6 4 #undef DEBUG_IO 7 5 c#define DEBUG_IO … … 15 13 IMPLICIT NONE 16 14 17 c=======================================================================18 c 19 cAuteur : P. Le Van20 c 21 cObjet:22 c------23 c 24 cCalcul des tendances dynamiques.25 c 26 cModif 04/93 F.Forget27 c=======================================================================28 29 c-----------------------------------------------------------------------30 c0. Declarations:31 c----------------15 !======================================================================= 16 ! 17 ! Auteur : P. Le Van 18 ! 19 ! Objet: 20 ! ------ 21 ! 22 ! Calcul des tendances dynamiques. 23 ! 24 ! Modif 04/93 F.Forget 25 !======================================================================= 26 27 !----------------------------------------------------------------------- 28 ! 0. Declarations: 29 ! ---------------- 32 30 33 31 #include "dimensions.h" … … 37 35 #include "comgeom.h" 38 36 39 c Arguments: 40 c ---------- 41 42 LOGICAL conser 43 44 INTEGER itau 45 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm),teta(ip1jmp1,llm) 46 REAL ps(ip1jmp1),phis(ip1jmp1) 47 REAL pk(ip1jmp1,llm),pkf(ip1jmp1,llm) 48 REAL tsurpk(ip1jmp1,llm) 37 ! Arguments: 38 ! ---------- 39 40 LOGICAL,INTENT(IN) :: conser ! triggers printing some diagnostics 41 INTEGER,INTENT(IN) :: itau ! time step index 42 REAL,INTENT(IN) :: vcov(ip1jm,llm) ! covariant meridional wind 43 REAL,INTENT(IN) :: ucov(ip1jmp1,llm) ! covariant zonal wind 44 REAL,INTENT(IN) :: teta(ip1jmp1,llm) ! potential temperature 45 REAL,INTENT(IN) :: ps(ip1jmp1) ! surface pressure 46 REAL,INTENT(IN) :: phis(ip1jmp1) ! geopotential at the surface 47 REAL,INTENT(IN) :: pk(ip1jmp1,llm) ! Exner at mid-layer 48 REAL,INTENT(IN) :: pkf(ip1jmp1,llm) ! filtered Exner 49 REAL,INTENT(IN) :: tsurpk(ip1jmp1,llm) ! cpp * temperature / pk 50 REAL,INTENT(IN) :: phi(ip1jmp1,llm) ! geopotential 51 REAL,INTENT(OUT) :: masse(ip1jmp1,llm) ! air mass 52 REAL,INTENT(OUT) :: dv(ip1jm,llm) ! tendency on vcov 53 REAL,INTENT(OUT) :: du(ip1jmp1,llm) ! tendency on ucov 54 REAL,INTENT(OUT) :: dteta(ip1jmp1,llm) ! tenddency on teta 55 REAL,INTENT(OUT) :: dp(ip1jmp1) ! tendency on ps 56 REAL,INTENT(OUT) :: w(ip1jmp1,llm) ! vertical velocity 57 REAL,INTENT(OUT) :: pbaru(ip1jmp1,llm) ! mass flux in the zonal direction 58 REAL,INTENT(OUT) :: pbarv(ip1jm,llm) ! mass flux in the meridional direction 59 REAL,INTENT(IN) :: time ! current time 60 61 ! Local: 62 ! ------ 63 49 64 REAL,SAVE :: vcont(ip1jm,llm),ucont(ip1jmp1,llm) 50 REAL phi(ip1jmp1,llm),masse(ip1jmp1,llm)51 REAL dv(ip1jm,llm),du(ip1jmp1,llm)52 REAL dteta(ip1jmp1,llm),dp(ip1jmp1)53 REAL w(ip1jmp1,llm)54 REAL pbaru(ip1jmp1,llm),pbarv(ip1jm,llm)55 REAL time56 57 c Local:58 c ------59 60 65 REAL,SAVE :: ang(ip1jmp1,llm) 61 66 REAL,SAVE :: p(ip1jmp1,llmp1) … … 70 75 INTEGER ij,l,ijb,ije,ierr 71 76 72 c----------------------------------------------------------------------- 73 c Calcul des tendances dynamiques: 74 c -------------------------------- 77 !----------------------------------------------------------------------- 78 ! Compute dynamical tendencies: 79 !-------------------------------- 80 81 ! compute contravariant winds ucont() and vcont 75 82 CALL covcont_p ( llm , ucov , vcov , ucont, vcont ) 83 ! compute pressure p() 76 84 CALL pression_p ( ip1jmp1, ap , bp , ps , p ) 77 85 cym CALL psextbar ( ps , psexbarxy ) 78 86 c$OMP BARRIER 87 ! compute mass in each atmospheric mesh: masse() 79 88 CALL massdair_p ( p , masse ) 89 ! compute X and Y-averages of mass, massebx() and masseby() 80 90 CALL massbar_p ( masse, massebx , masseby ) 91 ! compute XY-average of mass, massebxy() 81 92 call massbarxy_p( masse, massebxy ) 93 ! compute mass fluxes pbaru() and pbarv() 82 94 CALL flumass_p ( massebx, masseby , vcont, ucont ,pbaru, pbarv ) 95 ! compute dteta() , horizontal converging flux of theta 83 96 CALL dteta1_p ( teta , pbaru , pbarv, dteta ) 97 ! compute convm(), horizontal converging flux of mass 84 98 CALL convmas1_p ( pbaru, pbarv , convm ) 85 99 c$OMP BARRIER … … 108 122 ijb=ij_begin 109 123 ije=ij_end 110 124 ! compute pressure variation due to mass convergence 111 125 DO ij =ijb, ije 112 126 dp( ij ) = convm( ij,1 ) / airesurg( ij ) … … 115 129 c$OMP BARRIER 116 130 c$OMP FLUSH 131 132 ! compute vertical velocity w() 117 133 CALL vitvert_p ( convm , w ) 134 ! compute potential vorticity vorpot() 118 135 CALL tourpot_p ( vcov , ucov , massebxy , vorpot ) 136 ! compute rotation induced du() and dv() 119 137 CALL dudv1_p ( vorpot , pbaru , pbarv , du , dv ) 120 138 … … 129 147 c$OMP BARRIER 130 148 #endif 149 150 ! compute kinetic energy ecin() 131 151 CALL enercin_p ( vcov , ucov , vcont , ucont , ecin ) 152 ! compute Bernouilli function bern() 132 153 CALL bernoui_p ( ip1jmp1, llm , phi , ecin , bern ) 154 ! compute and add du() and dv() contributions from Bernouilli and pressure 133 155 CALL dudv2_p ( tsurpk , pkf , bern , du , dv ) 134 156 … … 159 181 c$OMP END DO 160 182 183 ! compute vertical advection contributions to du(), dv() and dteta() 161 184 CALL advect_new_p(ang,vcov,teta,w,massebx,masseby,du,dv,dteta) 162 185 … … 190 213 ENDIF 191 214 192 RETURN193 215 END -
trunk/LMDZ.COMMON/libf/dyn3dpar/calfis_p.F
r1129 r1189 37 37 Use Write_field_p 38 38 USE Times 39 USE infotrac 40 USE control_mod 39 USE infotrac, ONLY: nqtot, niadv, tname 40 USE control_mod, ONLY: planet_type, nsplit_phys 41 41 USE cpdet_mod, only: tpot2t_p, t2tpot_p 42 42 … … 116 116 c Arguments : 117 117 c ----------- 118 LOGICAL lafin 119 ! REAL heure 120 REAL, intent(in):: jD_cur, jH_cur 121 REAL pvcov(iip1,jjm,llm) 122 REAL pucov(iip1,jjp1,llm) 123 REAL pteta(iip1,jjp1,llm) 124 REAL pmasse(iip1,jjp1,llm) 125 REAL pq(iip1,jjp1,llm,nqtot) 126 REAL pphis(iip1,jjp1) 127 REAL pphi(iip1,jjp1,llm) 128 129 REAL pdvcov(iip1,jjm,llm) 130 REAL pducov(iip1,jjp1,llm) 131 REAL pdteta(iip1,jjp1,llm) 118 LOGICAL,INTENT(IN) :: lafin ! .true. for the very last call to physics 119 REAL,INTENT(IN) :: jD_cur, jH_cur 120 REAL,INTENT(IN) :: pvcov(iip1,jjm,llm) ! covariant meridional velocity 121 REAL,INTENT(IN) :: pucov(iip1,jjp1,llm) ! covariant zonal velocity 122 REAL,INTENT(IN) :: pteta(iip1,jjp1,llm) ! potential temperature 123 REAL,INTENT(IN) :: pmasse(iip1,jjp1,llm) ! mass in each cell ! not used 124 REAL,INTENT(IN) :: pq(iip1,jjp1,llm,nqtot) ! tracers 125 REAL,INTENT(IN) :: pphis(iip1,jjp1) ! surface geopotential 126 REAL,INTENT(IN) :: pphi(iip1,jjp1,llm) ! geopotential 127 128 REAL,INTENT(IN) :: pdvcov(iip1,jjm,llm) ! dynamical tendency on vcov 129 REAL,INTENT(IN) :: pducov(iip1,jjp1,llm) ! dynamical tendency on ucov 130 REAL,INTENT(IN) :: pdteta(iip1,jjp1,llm) ! dynamical tendency on teta 132 131 ! commentaire SL: pdq ne sert que pour le calcul de pcvgq, 133 132 ! qui lui meme ne sert a rien dans la routine telle qu'elle est 134 133 ! ecrite, et que j'ai donc commente.... 135 REAL pdq(iip1,jjp1,llm,nqtot) 136 REAL flxw(iip1,jjp1,llm) ! Flux de masse verticale sur la grille dynamique 137 138 REAL pps(iip1,jjp1) 139 REAL pp(iip1,jjp1,llmp1) 140 REAL ppk(iip1,jjp1,llm) 141 142 REAL pdvfi(iip1,jjm,llm) 143 REAL pdufi(iip1,jjp1,llm) 144 REAL pdhfi(iip1,jjp1,llm) 145 REAL pdqfi(iip1,jjp1,llm,nqtot) 146 REAL pdpsfi(iip1,jjp1) 134 REAL,INTENT(IN) :: pdq(iip1,jjp1,llm,nqtot) ! dynamical tendency on tracers 135 ! NB: pdq is only used to compute pcvgq which is in fact not used... 136 137 REAL,INTENT(IN) :: pps(iip1,jjp1) ! surface pressure (Pa) 138 REAL,INTENT(IN) :: pp(iip1,jjp1,llmp1) ! pressure at mesh interfaces (Pa) 139 REAL,INTENT(IN) :: ppk(iip1,jjp1,llm) ! Exner at mid-layer 140 REAL,INTENT(IN) :: flxw(iip1,jjp1,llm) ! Vertical mass flux on dynamics grid 141 142 ! tendencies (in */s) from the physics 143 REAL,INTENT(OUT) :: pdvfi(iip1,jjm,llm) ! tendency on covariant meridional wind 144 REAL,INTENT(OUT) :: pdufi(iip1,jjp1,llm) ! tendency on covariant zonal wind 145 REAL,INTENT(OUT) :: pdhfi(iip1,jjp1,llm) ! tendency on potential temperature (K/s) 146 REAL,INTENT(OUT) :: pdqfi(iip1,jjp1,llm,nqtot) ! tendency on tracers 147 REAL,INTENT(OUT) :: pdpsfi(iip1,jjp1) ! tendency on surface pressure (Pa/s) 147 148 148 149 #ifdef CPP_PHYS … … 225 226 226 227 cIM diagnostique PVteta, Amip2 227 INTEGER ntetaSTD 228 PARAMETER(ntetaSTD=3) 229 REAL rtetaSTD(ntetaSTD) 230 DATA rtetaSTD/350., 380., 405./ ! Earth-specific values, beware !! 228 INTEGER,PARAMETER :: ntetaSTD=3 229 REAL,SAVE :: rtetaSTD(ntetaSTD)=(/350.,380.,405./) ! Earth-specific, beware !! 231 230 REAL PVteta(klon,ntetaSTD) 232 231 … … 234 233 REAL SSUM 235 234 236 LOGICAL firstcal, debut 237 DATA firstcal/.true./ 238 SAVE firstcal,debut 235 LOGICAL,SAVE :: firstcal=.true., debut=.true. 239 236 c$OMP THREADPRIVATE(firstcal,debut) 240 237 -
trunk/LMDZ.COMMON/libf/dyn3dpar/conf_gcm.F
r1056 r1189 202 202 CALL getin('starttime',starttime) 203 203 204 ! Mars: time of start for run in "start.nc" (when there are multiple time 205 ! steps stored in the file) 206 timestart=-9999 ! default value; if <0, use last stored time 207 call getin("timestart",timestart) 208 204 209 !Config Key = less1day 205 210 !Config Desc = Possibilite d'integrer moins d'un jour -
trunk/LMDZ.COMMON/libf/dyn3dpar/dissip_p.F
r1019 r1189 1 ! 2 ! $Id: $ 3 ! 1 4 SUBROUTINE dissip_p( vcov,ucov,teta,p, dv,du,dh ) 2 5 c … … 34 37 c ---------- 35 38 36 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm),teta(ip1jmp1,llm) 37 REAL p( ip1jmp1,llmp1 ) 38 REAL dv(ip1jm,llm),du(ip1jmp1,llm),dh(ip1jmp1,llm) 39 REAL,INTENT(IN) :: vcov(ip1jm,llm) ! covariant meridional wind 40 REAL,INTENT(IN) :: ucov(ip1jmp1,llm) ! covariant zonal wind 41 REAL,INTENT(IN) :: teta(ip1jmp1,llm) ! potentail temperature 42 REAL,INTENT(IN) :: p(ip1jmp1,llmp1) ! pressure 43 ! tendencies (.../s) on covariant winds and potential temperature 44 REAL,INTENT(OUT) :: dv(ip1jm,llm) 45 REAL,INTENT(OUT) :: du(ip1jmp1,llm) 46 REAL,INTENT(OUT) :: dh(ip1jmp1,llm) 39 47 40 48 c Local: -
trunk/LMDZ.COMMON/libf/dyn3dpar/leapfrog_p.F
r1107 r1189 83 83 #include "academic.h" 84 84 85 real zqmin,zqmax 86 87 c variables dynamiques 88 REAL :: vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants 89 REAL :: teta(ip1jmp1,llm) ! temperature potentielle 90 REAL :: q(ip1jmp1,llm,nqtot) ! champs advectes 91 REAL :: ps(ip1jmp1) ! pression au sol 92 REAL,SAVE :: p (ip1jmp1,llmp1 ) ! pression aux interfac.des couches 93 REAL,SAVE :: pks(ip1jmp1) ! exner au sol 94 REAL,SAVE :: pk(ip1jmp1,llm) ! exner au milieu des couches 95 REAL,SAVE :: pkf(ip1jmp1,llm) ! exner filt.au milieu des couches 96 REAL :: masse(ip1jmp1,llm) ! masse d'air 97 REAL :: phis(ip1jmp1) ! geopotentiel au sol 98 REAL,SAVE :: phi(ip1jmp1,llm) ! geopotentiel 99 REAL,SAVE :: w(ip1jmp1,llm) ! vitesse verticale 85 REAL,INTENT(IN) :: time_0 ! not used 86 87 c dynamical variables: 88 REAL,INTENT(INOUT) :: ucov(ip1jmp1,llm) ! zonal covariant wind 89 REAL,INTENT(INOUT) :: vcov(ip1jm,llm) ! meridional covariant wind 90 REAL,INTENT(INOUT) :: teta(ip1jmp1,llm) ! potential temperature 91 REAL,INTENT(INOUT) :: ps(ip1jmp1) ! surface pressure (Pa) 92 REAL,INTENT(INOUT) :: masse(ip1jmp1,llm) ! air mass 93 REAL,INTENT(INOUT) :: phis(ip1jmp1) ! geopotentiat at the surface 94 REAL,INTENT(INOUT) :: q(ip1jmp1,llm,nqtot) ! advected tracers 95 96 REAL,SAVE :: p (ip1jmp1,llmp1 ) ! interlayer pressure 97 REAL,SAVE :: pks(ip1jmp1) ! exner at the surface 98 REAL,SAVE :: pk(ip1jmp1,llm) ! exner at mid-layer 99 REAL,SAVE :: pkf(ip1jmp1,llm) ! filtered exner at mid-layer 100 REAL,SAVE :: phi(ip1jmp1,llm) ! geopotential 101 REAL,SAVE :: w(ip1jmp1,llm) ! vertical velocity 100 102 ! ADAPTATION GCM POUR CP(T) 101 103 REAL,SAVE :: temp(ip1jmp1,llm) ! temperature 102 104 REAL,SAVE :: tsurpk(ip1jmp1,llm) ! cpp*T/pk 105 106 real zqmin,zqmax 103 107 104 108 c variables dynamiques intermediaire pour le transport … … 144 148 REAL time 145 149 146 REAL SSUM 147 REAL time_0 150 REAL SSUM 148 151 ! REAL,SAVE :: finvmaold(ip1jmp1,llm) 149 152 … … 721 724 c ------------------------------------------------------------- 722 725 723 ! IF( forward. OR . leapf ) THEN 724 IF((.not.forward).OR. leapf ) THEN 725 ! Ehouarn: gather mass fluxes during backward Matsuno or LF step 726 cc$OMP PARALLEL DEFAULT(SHARED) 727 c 726 IF( forward. OR . leapf ) THEN 727 ! Ehouarn: NB: fields sent to advtrac are those at the beginning of the time step 728 728 CALL advtrac_p( pbaru,pbarv, 729 729 * p, masse,q,iapptrac, teta, … … 737 737 738 738 ENDIF ! of IF( forward. OR . leapf ) 739 cc$OMP END PARALLEL740 739 741 740 c----------------------------------------------------------------------- … … 1037 1036 $ ucov, vcov, teta , q ,ps , 1038 1037 $ dufi, dvfi, dtetafi , dqfi ,dpfi ) 1038 ! since addfi updates ps(), also update p(), masse() and pk() 1039 CALL pression_p(ip1jmp1,ap,bp,ps,p) 1040 c$OMP BARRIER 1041 CALL massdair_p(p,masse) 1042 c$OMP BARRIER 1043 if (pressure_exner) then 1044 CALL exner_hyb_p(ip1jmp1,ps,p,alpha,beta,pks,pk,pkf) 1045 else 1046 CALL exner_milieu_p(ip1jmp1,ps,p,beta,pks,pk,pkf) 1047 endif 1048 c$OMP BARRIER 1039 1049 1040 1050 c Couche superieure : … … 1195 1205 CALL exner_milieu_p( ip1jmp1, ps, p, beta, pks, pk, pkf ) 1196 1206 endif 1207 c$OMP BARRIER 1208 CALL massdair_p(p,masse) 1197 1209 c$OMP BARRIER 1198 1210
Note: See TracChangeset
for help on using the changeset viewer.