Changeset 373 for LMDZ.3.3/branches
- Timestamp:
- Jul 12, 2002, 12:27:22 PM (22 years ago)
- Location:
- LMDZ.3.3/branches/rel-LF/libf/phylmd
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ.3.3/branches/rel-LF/libf/phylmd/conema3.F
r230 r373 1 1 c $Header$ 2 SUBROUTINE conema (dtime,paprs,pplay,t,q,u,v,tra,ntra,2 SUBROUTINE conema3 (dtime,paprs,pplay,t,q,u,v,tra,ntra, 3 3 . work1,work2,d_t,d_q,d_u,d_v,d_tra, 4 4 . rain, snow, kbas, ktop, 5 5 . upwd,dnwd,dnwdbis,bas,top,Ma,cape,tvp,rflag, 6 . pbase,bbase,dtvpdt1,dtvpdq1,dplcldt,dplcldr) 6 . pbase,bbase,dtvpdt1,dtvpdq1,dplcldt,dplcldr, 7 . qcond_incld) 7 8 8 9 IMPLICIT none … … 52 53 #include "dimensions.h" 53 54 #include "dimphy.h" 55 #include "conema3.h" 54 56 INTEGER i, l,m,itra 55 57 INTEGER ntra,ntrac !number of tracers; if no tracer transport … … 58 60 REAL dtime 59 61 c 60 62 REAL d_t2(klon,klev), d_q2(klon,klev) ! sbl 63 REAL d_u2(klon,klev), d_v2(klon,klev) ! sbl 64 REAL em_d_t2(klev), em_d_q2(klev) ! sbl 65 REAL em_d_u2(klev), em_d_v2(klev) ! sbl 61 66 c 62 67 REAL paprs(klon,klev+1), pplay(klon,klev) … … 73 78 REAL dplcldt(klon), dplcldr(klon) 74 79 INTEGER kbas(klon), ktop(klon) 80 81 REAL wd(klon) 82 REAL qcond_incld(klon,klev) 75 83 c 76 84 REAL em_t(klev) … … 91 99 INTEGER em_bas, em_top 92 100 SAVE em_bas, em_top 101 102 REAL em_wd 103 REAL em_qcond(klev) 104 REAL em_qcondc(klev) 93 105 c 94 106 REAL zx_t, zx_qs, zdelta, zcor … … 115 127 real em_pbase, em_bbase 116 128 integer iw,j,k,ix,iy 129 130 c -- sb: pour schema nuages: 131 132 integer iflagcon 133 integer em_ifc(klev) 134 135 real em_pradj 136 real em_cldf(klev), em_cldq(klev) 137 real em_ftadj(klev), em_fradj(klev) 138 139 integer ifc(klon,klev) 140 real pradj(klon) 141 real cldf(klon,klev), cldq(klon,klev) 142 real ftadj(klon,klev), fqadj(klon,klev) 143 144 c sb -- 145 117 146 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 118 147 c … … 121 150 #include "FCTTRE.h" 122 151 152 qcond_incld(:,:) = 0. 123 153 c 124 154 c$$$ print*,'debut conema' … … 190 220 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 191 221 c 192 CALL convect(dtime, em_t, em_q, em_qs,em_u ,em_v , 222 223 c print*,'avant convect i=',i 224 CALL convect3(dtime,epmax,ok_adj_ema, 225 . em_t, em_q, em_qs,em_u ,em_v , 193 226 . em_tra, em_p, em_ph, 194 227 . klev, klev+1, klev-1,ntra, dtime, iflag, … … 197 230 . em_bas, em_top,em_upwd, em_dnwd, em_dnwdbis, 198 231 . em_work1, em_work2,emmip,emMke,emMa,Ment, 199 c SB 11sept98 . Qent,TPS,TLS,SIJ)200 c 19oct98 . Qent,TPS,TLS,SIJ,em_CAPE,em_TVP)201 232 . Qent,TPS,TLS,SIJ,em_CAPE,em_TVP,em_pbase,em_bbase, 202 . em_dtvpdt1,em_dtvpdq1,em_dplcldt,em_dplcldr) 233 . em_dtvpdt1,em_dtvpdq1,em_dplcldt,em_dplcldr, ! sbl 234 . em_d_t2,em_d_q2,em_d_u2,em_d_v2,em_wd,em_qcond,em_qcondc)!sbl 235 c print*,'apres convect ' 203 236 c 204 237 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 238 c 239 c -- sb: Appel schema statistique de nuages couple a la convection 240 c (Bony et Emanuel 2001): 241 242 c -- creer cvthermo.h qui contiendra les cstes thermo de LMDZ: 243 244 iflagcon = 3 245 c CALL cv_thermo(iflagcon) 246 247 c -- appel schema de nuages: 248 249 c CALL CLOUDS_SUB_LS(klev,em_q,em_qs,em_t 250 c i ,em_p,em_ph,dtime,em_qcondc 251 c o ,em_cldf,em_cldq,em_pradj,em_ftadj,em_fradj,em_ifc) 252 253 do k = 1, klev 254 cldf(i,k) = em_cldf(k) ! cloud fraction (0-1) 255 cldq(i,k) = em_cldq(k) ! in-cloud water content (kg/kg) 256 ftadj(i,k) = em_ftadj(k) ! (dT/dt)_{LS adj} (K/s) 257 fqadj(i,k) = em_fradj(k) ! (dq/dt)_{LS adj} (kg/kg/s) 258 ifc(i,k) = em_ifc(k) ! flag convergence clouds_gno (1 ou 2) 259 enddo 260 pradj(i) = em_pradj ! precip from LS supersat adj (mm/day) 261 262 c sb -- 205 263 c 206 264 c SB: … … 251 309 snow(i) = 0.0 252 310 cape(i) = em_CAPE 311 wd(i) = em_wd 253 312 rflag(i) = float(iflag) 254 313 c SB kbas(i) = em_bas … … 257 316 dplcldr(i) = em_dplcldr 258 317 DO l = 1, klev 318 d_t2(i,l) = dtime * em_d_t2(l) 319 d_q2(i,l) = dtime * em_d_q2(l) 320 d_u2(i,l) = dtime * em_d_u2(l) 321 d_v2(i,l) = dtime * em_d_v2(l) 322 259 323 d_t(i,l) = dtime * em_d_t(l) 260 324 d_q(i,l) = dtime * em_d_q(l) … … 273 337 dtvpdt1(i,l) = em_dtvpdt1(l) 274 338 dtvpdq1(i,l) = em_dtvpdq1(l) 339 340 if (iflag_clw.eq.0) then 341 qcond_incld(i,l) = em_qcondc(l) 342 else if (iflag_clw.eq.1) then 343 qcond_incld(i,l) = em_qcond(l) 344 endif 275 345 ENDDO 276 346 999 CONTINUE 347 348 c On calcule une eau liquide diagnostique en fonction de la 349 c precip. 350 if ( iflag_clw.eq.2 ) then 351 do l=1,klev 352 do i=1,klon 353 if (ktop(i)-kbas(i).gt.0.and. 354 s l.ge.kbas(i).and.l.le.ktop(i)) then 355 qcond_incld(i,l)=rain(i)*8.e4 356 c s *(pplay(i,l )-paprs(i,ktop(i)+1)) 357 s /(pplay(i,kbas(i))-pplay(i,ktop(i))) 358 c s **2 359 else 360 qcond_incld(i,l)=0. 361 endif 362 enddo 363 print*,'l=',l,', qcond_incld=',qcond_incld(1,l) 364 enddo 365 endif 277 366 278 367 -
LMDZ.3.3/branches/rel-LF/libf/phylmd/conf_phys.F90
r241 r373 3 3 ! 4 4 5 subroutine conf_phys(ocean, ok_veget, ok_journe, ok_mensuel, ok_instan) 5 subroutine conf_phys(ocean, ok_veget, ok_journe, ok_mensuel, ok_instan, & 6 & fact_cldcon, facttemps,ok_newmicro,iflag_cldcon, & 7 & ratqsbas,ratqshaut) 6 8 7 9 use IOIPSL 8 10 implicit none 9 11 12 #include "conema3.h" 13 #include "fisrtilp.inc" 10 14 ! 11 15 ! Configuration de la "physique" de LMDZ a l'aide de la fonction … … 26 30 ! Sortie: 27 31 character (len = 6) :: ocean 28 logical :: ok_veget 32 logical :: ok_veget, ok_newmicro 29 33 logical :: ok_journe, ok_mensuel, ok_instan 34 real :: fact_cldcon, facttemps,ratqsbas,ratqshaut 35 integer :: iflag_cldcon 30 36 ! Local 31 37 integer :: numout = 6 … … 78 84 ok_instan = .false. 79 85 call getin('OK_instan', ok_instan) 86 !! 87 !! KE 88 ! 89 !Config Key = epmax 90 !Config Desc = Efficacite precip 91 !Config Def = 0.993 92 !Config Help = 93 ! 94 epmax = .993 95 call getin('epmax', epmax) 96 ! 97 !Config Key = ok_adj_ema 98 !Config Desc = 99 !Config Def = false 100 !Config Help = 101 ! 102 ok_adj_ema = .false. 103 call getin('ok_adj_ema',ok_adj_ema) 104 ! 105 !Config Key = iflag_clw 106 !Config Desc = 107 !Config Def = 0 108 !Config Help = 109 ! 110 iflag_clw = 0 111 call getin('iflag_clw',iflag_clw) 112 ! 113 !Config Key = cld_lc_lsc 114 !Config Desc = 115 !Config Def = 2.6e-4 116 !Config Help = 117 ! 118 cld_lc_lsc = 2.6e-4 119 call getin('cld_lc_lsc',cld_lc_lsc) 120 ! 121 !Config Key = cld_lc_con 122 !Config Desc = 123 !Config Def = 2.6e-4 124 !Config Help = 125 ! 126 cld_lc_con = 2.6e-4 127 call getin('cld_lc_con',cld_lc_con) 128 ! 129 !Config Key = cld_tau_lsc 130 !Config Desc = 131 !Config Def = 3600. 132 !Config Help = 133 ! 134 cld_tau_lsc = 3600. 135 call getin('cld_tau_lsc',cld_tau_lsc) 136 ! 137 !Config Key = cld_tau_con 138 !Config Desc = 139 !Config Def = 3600. 140 !Config Help = 141 ! 142 cld_tau_con = 3600. 143 call getin('cld_tau_con',cld_tau_con) 144 ! 145 !Config Key = ffallv_lsc 146 !Config Desc = 147 !Config Def = 1. 148 !Config Help = 149 ! 150 ffallv_lsc = 1. 151 call getin('ffallv_lsc',ffallv_lsc) 152 ! 153 !Config Key = ffallv_con 154 !Config Desc = 155 !Config Def = 1. 156 !Config Help = 157 ! 158 ffallv_con = 1. 159 call getin('ffallv_con',ffallv_con) 160 ! 161 !Config Key = coef_eva 162 !Config Desc = 163 !Config Def = 2.e-5 164 !Config Help = 165 ! 166 coef_eva = 2.e-5 167 call getin('coef_eva',coef_eva) 168 ! 169 !Config Key = reevap_ice 170 !Config Desc = 171 !Config Def = .false. 172 !Config Help = 173 ! 174 reevap_ice = .false. 175 call getin('reevap_ice',reevap_ice) 176 ! 177 !Config Key = iflag_cldcon 178 !Config Desc = 179 !Config Def = 1 180 !Config Help = 181 ! 182 iflag_cldcon = 1 183 call getin('iflag_cldcon',iflag_cldcon) 184 185 ! 186 !Config Key = iflag_pdf 187 !Config Desc = 188 !Config Def = 0 189 !Config Help = 190 ! 191 iflag_pdf = 0 192 call getin('iflag_pdf',iflag_pdf) 193 ! 194 !Config Key = fact_cldcon 195 !Config Desc = 196 !Config Def = 0.375 197 !Config Help = 198 ! 199 fact_cldcon = 0.375 200 call getin('fact_cldcon',fact_cldcon) 201 202 ! 203 !Config Key = facttemps 204 !Config Desc = 205 !Config Def = 1.e-4 206 !Config Help = 207 ! 208 facttemps = 1.e-4 209 call getin('facttemps',facttemps) 210 211 ! 212 !Config Key = ok_newmicro 213 !Config Desc = 214 !Config Def = .true. 215 !Config Help = 216 ! 217 ok_newmicro = .true. 218 call getin('ok_newmicro',ok_newmicro) 219 ! 220 !Config Key = ratqsbas 221 !Config Desc = 222 !Config Def = 0.01 223 !Config Help = 224 ! 225 ratqsbas = 0.01 226 call getin('ratqsbas',ratqsbas) 227 ! 228 !Config Key = ratqshaut 229 !Config Desc = 230 !Config Def = 0.3 231 !Config Help = 232 ! 233 ratqshaut = 0.3 234 call getin('ratqshaut',ratqshaut) 80 235 81 236 ! … … 90 245 write(numout,*)' Sortie mensuelle = ', ok_mensuel 91 246 write(numout,*)' Sortie instantanee = ', ok_instan 92 247 write(numout,*)' epmax = ', epmax 248 write(numout,*)' ok_adj_ema = ', ok_adj_ema 249 write(numout,*)' iflag_clw = ', iflag_clw 250 write(numout,*)' cld_lc_lsc = ', cld_lc_lsc 251 write(numout,*)' cld_lc_con = ', cld_lc_con 252 write(numout,*)' cld_tau_lsc = ', cld_tau_lsc 253 write(numout,*)' cld_tau_con = ', cld_tau_con 254 write(numout,*)' ffallv_lsc = ', ffallv_lsc 255 write(numout,*)' ffallv_con = ', ffallv_con 256 write(numout,*)' coef_eva = ', coef_eva 257 write(numout,*)' reevap_ice = ', reevap_ice 258 write(numout,*)' iflag_pdf = ', iflag_pdf 259 write(numout,*)' iflag_cldcon = ', iflag_cldcon 260 write(numout,*)' fact_cldcon = ', fact_cldcon 261 write(numout,*)' facttemps = ', facttemps 262 write(numout,*)' ok_newmicro = ',ok_newmicro 263 write(numout,*)' ratqsbas = ',ratqsbas 264 write(numout,*)' ratqshaut = ',ratqshaut 93 265 94 266 return -
LMDZ.3.3/branches/rel-LF/libf/phylmd/convect3.F
r230 r373 1 1 c $Header$ 2 SUBROUTINE CONVECT 3 * (DTIME, T1, R1, RS, U, V, TRA, P, PH, 2 SUBROUTINE CONVECT3 3 * (DTIME,EPMAX,ok_adj, 4 * T1, R1, RS, U, V, TRA, P, PH, 4 5 * ND, NDP1, NL, NTRA, DELT, IFLAG, 5 6 * FT, FR, FU, FV, FTRA, PRECIP, 6 7 * icb,inb, upwd,dnwd,dnwd0,SIG, W0,Mike,Mke, 7 8 * Ma,MENTS,QENTS,TPS,TLS,SIGIJ,CAPE,TVP,PBASE,BUOYBASE, 8 * DTVPDT1,DTVPDQ1,DPLCLDT,DPLCLDR) 9 cccc * DTVPDT1,DTVPDQ1,DPLCLDT,DPLCLDR) 10 * DTVPDT1,DTVPDQ1,DPLCLDT,DPLCLDR, ! sbl 11 * FT2,FR2,FU2,FV2,WD,QCOND,QCONDC) ! sbl 9 12 C 10 13 C *** THE PARAMETER NA SHOULD IN GENERAL EQUAL ND *** … … 19 22 integer NTRAC 20 23 PARAMETER (NTRAC=nqmx-2) 24 REAL DELTAC ! cld 25 PARAMETER (DELTAC=0.01) ! cld 21 26 22 27 INTEGER NENT(NA) … … 34 39 REAL T(NA),RR(NA) 35 40 C 41 REAL FT2(ND),FR2(ND),FU2(ND),FV2(ND) ! added sbl 42 REAL U1(ND),V1(ND) ! added sbl 43 C 36 44 REAL BUOY(NA) ! Lifted parcel buoyancy 37 45 REAL DTVPDT1(ND),DTVPDQ1(ND) ! Derivatives of parcel virtual … … 39 47 REAL CLW_NEW(NA),QI(NA) 40 48 C 41 LOGICAL ICE_CONV 49 REAL WD, BETAD ! for gust factor (sb) 50 REAL QCONDC(ND) ! interface cld param (sb) 51 REAL QCOND(ND),NQCOND(NA),WA(NA),MAA(NA),SIGA(NA),AXC(NA) ! cld 52 C 53 LOGICAL ICE_CONV,ok_adj 42 54 PARAMETER (ICE_CONV=.TRUE.) 43 55 … … 110 122 FU(I)=0.0 111 123 FV(I)=0.0 124 125 FT2(I)=0.0 126 FR2(I)=0.0 127 FU2(I)=0.0 128 FV2(I)=0.0 129 112 130 DO 4 J=1,NTRA 113 131 FTRA(I,J)=0.0 114 132 4 CONTINUE 133 134 QCONDC(I)=0.0 ! cld 135 QCOND(I)=0.0 ! cld 136 NQCOND(I)=0.0 ! cld 137 115 138 T(I)=T1(I) 116 139 RR(I)=R1(I) 140 U1(I)=U(I) ! added sbl 141 V1(I)=V(I) ! added sbl 117 142 5 CONTINUE 118 143 DO 7 I=1,NL … … 137 162 138 163 PRECIP=0.0 164 WD=0.0 ! sb 139 165 IFLAG=1 140 166 C … … 160 186 SPFAC=0.15 161 187 c sb: 162 188 c EPMAX=0.993 ! precip efficiency less than unity 163 189 c EPMAX=1. ! precip efficiency less than unity 164 190 C … … 196 222 C 197 223 NOPT=0 224 c! NOPT=1 ! sbl 198 225 C 199 226 C *** PERFORM DRY ADIABATIC ADJUSTMENT *** … … 202 229 C *** BOUNDARY LAYER SCHEME !!! *** 203 230 C 204 c test sb DO 30 I=NL-1,1,-1 205 c test sb JN=0 206 c test sb DO 10 J=I+1,NL 207 c test sb 10 IF(TH(J).LT.TH(I))JN=J 208 c test sb IF(JN.EQ.0)GOTO 30 209 c test sb AHM=0.0 210 c test sb RM=0.0 211 c test sb UM=0.0 212 c test sb VM=0.0 213 c test sb DO K=1,NTRA 214 c test sb TRATM(K)=0.0 215 c test sb END DO 216 c test sb DO 15 J=I,JN 217 c test sb AHM=AHM+(CPD*(1.-RR(J))+RR(J)*CPV)*T(J)*(PH(J)-PH(J+1)) 218 c test sb RM=RM+RR(J)*(PH(J)-PH(J+1)) 219 c test sb UM=UM+U(J)*(PH(J)-PH(J+1)) 220 c test sb VM=VM+V(J)*(PH(J)-PH(J+1)) 221 c test sb DO K=1,NTRA 222 c test sb TRATM(K)=TRATM(K)+TRA(J,K)*(PH(J)-PH(J+1)) 223 c test sb END DO 224 c test sb 15 CONTINUE 225 c test sb DPHINV=1./(PH(I)-PH(JN+1)) 226 c test sb RM=RM*DPHINV 227 c test sb UM=UM*DPHINV 228 c test sb VM=VM*DPHINV 229 c test sb DO K=1,NTRA 230 c test sb TRATM(K)=TRATM(K)*DPHINV 231 c test sb END DO 232 c test sb A2=0.0 233 c test sb DO 20 J=I,JN 234 c test sb RR(J)=RM 235 c test sb U(J)=UM 236 c test sb V(J)=VM 237 c test sb DO K=1,NTRA 238 c test sb TRA(J,K)=TRATM(K) 239 c test sb END DO 240 c test sb RDCP=(RD*(1.-RR(J))+RR(J)*RV)/ (CPD*(1.-RR(J))+RR(J)*CPV) 241 c test sb X=(0.001*P(J))**RDCP 242 c test sb T(J)=X 243 c test sb A2=A2+(CPD*(1.-RR(J))+RR(J)*CPV)*X*(PH(J)-PH(J+1)) 244 c test sb 20 CONTINUE 245 c test sb DO 25 J=I,JN 246 c test sb TH(J)=AHM/A2 247 c test sb T(J)=T(J)*TH(J) 248 c test sb 25 CONTINUE 249 c test sb 30 CONTINUE 250 C 251 C *** RESET INPUT ARRAYS IF NOPT .NE. 0 *** 252 C 253 IF (NOPT.NE.0)THEN 231 IF (ok_adj) THEN ! added sbl 232 233 DO 30 I=NL-1,1,-1 234 JN=0 235 DO 10 J=I+1,NL 236 10 IF(TH(J).LT.TH(I))JN=J 237 IF(JN.EQ.0)GOTO 30 238 AHM=0.0 239 RM=0.0 240 UM=0.0 241 VM=0.0 242 DO K=1,NTRA 243 TRATM(K)=0.0 244 END DO 245 DO 15 J=I,JN 246 AHM=AHM+(CPD*(1.-RR(J))+RR(J)*CPV)*T(J)*(PH(J)-PH(J+1)) 247 RM=RM+RR(J)*(PH(J)-PH(J+1)) 248 UM=UM+U(J)*(PH(J)-PH(J+1)) 249 VM=VM+V(J)*(PH(J)-PH(J+1)) 250 DO K=1,NTRA 251 TRATM(K)=TRATM(K)+TRA(J,K)*(PH(J)-PH(J+1)) 252 END DO 253 15 CONTINUE 254 DPHINV=1./(PH(I)-PH(JN+1)) 255 RM=RM*DPHINV 256 UM=UM*DPHINV 257 VM=VM*DPHINV 258 DO K=1,NTRA 259 TRATM(K)=TRATM(K)*DPHINV 260 END DO 261 A2=0.0 262 DO 20 J=I,JN 263 RR(J)=RM 264 U(J)=UM 265 V(J)=VM 266 DO K=1,NTRA 267 TRA(J,K)=TRATM(K) 268 END DO 269 RDCP=(RD*(1.-RR(J))+RR(J)*RV)/ (CPD*(1.-RR(J))+RR(J)*CPV) 270 X=(0.001*P(J))**RDCP 271 T(J)=X 272 A2=A2+(CPD*(1.-RR(J))+RR(J)*CPV)*X*(PH(J)-PH(J+1)) 273 20 CONTINUE 274 DO 25 J=I,JN 275 TH(J)=AHM/A2 276 T(J)=T(J)*TH(J) 277 25 CONTINUE 278 30 CONTINUE 279 280 ENDIF ! added sbl 281 C 282 C *** RESET INPUT ARRAYS IF ok_adj 0 *** 283 C 284 IF (ok_adj)THEN 254 285 DO 35 I=1,ND 255 T1(I)=T(I) 256 R1(I)=RR(I) 286 287 FT2(I)=(T(I)-T1(I))/DELT ! sbl 288 FR2(I)=(RR(I)-R1(I))/DELT ! sbl 289 FU2(I)=(U(I)-U1(I))/DELT ! sbl 290 FV2(I)=(V(I)-V1(I))/DELT ! sbl 291 292 c! T1(I)=T(I) ! commente sbl 293 c! R1(I)=RR(I) ! commente sbl 257 294 35 CONTINUE 258 295 END IF … … 401 438 $ +TV(ICB+1)*(P(ICB)-PBASE )/(P(ICB)-P(ICB+1)) 402 439 C 440 c test sb: 441 c@ write(*,*) '++++++++++++++++++++++++++++++++++++++++' 442 c@ write(*,*) 'plcl,dpbas,tvpbas,tvbas,tvp(icb),tvp(icb1) 443 c@ : ,tv(icb),tv(icb1)' 444 c@ write(*,*) plcl,dpbase,tvpbase,tvbase,tvp(icb) 445 c@ L ,tvp(icb+1),tv(icb),tv(icb+1) 446 c@ write(*,*) '++++++++++++++++++++++++++++++++++++++++' 447 c fin test sb 403 448 BUOYBASE = TVPBASE - TVBASE 404 449 C … … 418 463 c sb3d print *, 'P ',(p(i),i=1,nl) 419 464 c sb3d print *,'ICB ',icb 465 c test sb: 466 c@ write(*,*) '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@' 467 c@ write(*,*) 'icb,icbs,inb,buoybase:' 468 c@ write(*,*) icb,icb+1,inb,buoybase 469 c@ write(*,*) 'k,tvp,tv,tp,buoy,ep: ' 470 c@ do k=1,nl 471 c@ write(*,*) k,tvp(k),tv(k),tp(k),buoy(k),ep(k) 472 c@ enddo 473 c@ write(*,*) '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@' 474 c fin test sb 475 476 420 477 C 421 478 C *** MAKE SURE THAT COLUMN IS DRY ADIABATIC BETWEEN THE SURFACE *** … … 552 609 Cjyg2 553 610 c sb3d print *,'buoy,dlnp,dcape,cape',buoy(i-1),dlnp,dcape,cape 611 c test sb: 612 c@ write(*,*) '############################################' 613 c@ write(*,*) 'cape,rrd,buoy,deltap,p,pbase,ph:' 614 c@ : ,cape,rd,buoy(i-1),deltap,p(i-1),pbase,ph(i) 615 c@ write(*,*) '############################################' 616 617 c fin test sb 554 618 CAPE=AMAX1(0.0,CAPE) 555 619 C … … 573 637 AMU=0.5*(SIG(I)+SIGOLD)*W 574 638 M(I)=AMU*0.007*P(I)*(PH(I)-PH(I+1))/TV(I) 639 640 c --------- test sb: 641 c write(*,*) '############################################' 642 c write(*,*) 'k,amu,buoy(k-1),deltap,w,beta,fac,cape,w0(k)' 643 c write(*,*) i,amu,buoy(i-1),deltap 644 c : ,w,beta,fac,cape,w0(i) 645 c write(*,*) '############################################' 646 c --------- 647 575 648 W0(I)=W 576 649 98 CONTINUE … … 750 823 751 824 *********************************************************** 825 c--- test sb: 826 c@ write(*,*) '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^' 827 c@ write(*,*) 'inb,m(inb),ment(inb,inb),sigij(inb,inb):' 828 c@ write(*,*) inb,m(inb),ment(inb,inb),sigij(inb,inb) 829 c@ write(*,*) '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^' 830 c--- 831 752 832 753 833 … … 936 1016 C 937 1017 PRECIP=WT(1)*SIGD*WATER(1)*8640.0 1018 1019 c sb *** Calculate downdraft velocity scale and surface temperature and *** 1020 c sb *** water vapor fluctuations *** 1021 c sb (inspire de convect 4.3) 1022 1023 c BETAD=10.0 1024 BETAD=5.0 1025 WD=BETAD*ABS(MP(ICB))*0.01*RD*T(ICB)/(SIGD*P(ICB)) 1026 938 1027 405 CONTINUE 939 1028 C … … 1021 1110 FU(I)=FU(I)+0.1*DPINV*MENT(K,I)*(UENT(K,I)-U(I)) 1022 1111 FV(I)=FV(I)+0.1*DPINV*MENT(K,I)*(VENT(K,I)-V(I)) 1112 C (saturated updrafts resulting from mixing) ! cld 1113 QCOND(I)=QCOND(I)+(ELIJ(K,I)-AWAT) ! cld 1114 NQCOND(I)=NQCOND(I)+1. ! cld 1023 1115 DO J=1,NTRA 1024 1116 FTRA(I,J)=FTRA(I,J)+0.1*DPINV*MENT(K,I)*(TRAENT(K,I,J)- … … 1045 1137 1 MP(I)*(TRAP(I,J)-TRAP(I-1,J))) 1046 1138 END DO 1139 C (saturated downdrafts resulting from mixing) ! cld 1140 DO K=I+1,INB ! cld 1141 QCOND(I)=QCOND(I)+ELIJ(K,I) ! cld 1142 NQCOND(I)=NQCOND(I)+1. ! cld 1143 ENDDO ! cld 1144 C (particular case: no detraining level is found) ! cld 1145 IF (NENT(I).EQ.0) THEN ! cld 1146 QCOND(I)=QCOND(I)+(1-EP(I))*CLW(I) ! cld 1147 NQCOND(I)=NQCOND(I)+1. ! cld 1148 ENDIF ! cld 1149 IF (NQCOND(I).NE.0.) THEN ! cld 1150 QCOND(I)=QCOND(I)/NQCOND(I) ! cld 1151 ENDIF ! cld 1047 1152 500 CONTINUE 1048 1153 … … 1054 1159 C *** INTEGRATED ENTHALPY AND WATER TENDENCIES *** 1055 1160 C 1161 c test sb: 1162 c@ write(*,*) '--------------------------------------------' 1163 c@ write(*,*) 'inb,ft,hp,h,t,rr,qent,ment,water,waterp,wt,mp,b' 1164 c@ write(*,*) inb,ft(inb),hp(inb),h(inb) 1165 c@ : ,t(inb),rr(inb),qent(inb,inb) 1166 c@ : ,ment(inb,inb),water(inb) 1167 c@ : ,water(inb+1),wt(inb),mp(inb),b(inb) 1168 c@ write(*,*) '--------------------------------------------' 1169 c fin test sb: 1170 1056 1171 AX=0.1*MENT(INB,INB)*(HP(INB)-H(INB)+T(INB)* 1057 1172 1 (CPV-CPD)*(RR(INB)-QENT(INB,INB)))/(CPN(INB)* … … 1187 1302 Mke(i)=upwd(i)+dnwd(i) 1188 1303 enddo 1304 1305 C 1306 C *** Diagnose the in-cloud mixing ratio *** ! cld 1307 C *** of condensed water *** ! cld 1308 C ! cld 1309 DO I=1,ND ! cld 1310 MAA(I)=0.0 ! cld 1311 WA(I)=0.0 ! cld 1312 SIGA(I)=0.0 ! cld 1313 ENDDO ! cld 1314 DO I=NK,INB ! cld 1315 DO K=I+1,INB+1 ! cld 1316 MAA(I)=MAA(I)+M(K) ! cld 1317 ENDDO ! cld 1318 ENDDO ! cld 1319 DO I=ICB,INB-1 ! cld 1320 AXC(I)=0. ! cld 1321 DO J=ICB,I ! cld 1322 AXC(I)=AXC(I)+RD*(TVP(J)-TV(J))*(PH(J)-PH(J+1))/P(J) ! cld 1323 ENDDO ! cld 1324 IF (AXC(I).GT.0.0) THEN ! cld 1325 WA(I)=SQRT(2.*AXC(I)) ! cld 1326 ENDIF ! cld 1327 ENDDO ! cld 1328 DO I=1,NL ! cld 1329 IF (WA(I).GT.0.0) ! cld 1330 1 SIGA(I)=MAA(I)/WA(I)*RD*TVP(I)/P(I)/100./DELTAC ! cld 1331 SIGA(I) = MIN(SIGA(I),1.0) ! cld 1332 QCONDC(I)=SIGA(I)*CLW(I)*(1.-EP(I)) ! cld 1333 1 + (1.-SIGA(I))*QCOND(I) ! cld 1334 ENDDO ! cld 1335 1336 1189 1337 c$$$cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 1190 1338 c$$$ call writeg1d(1,klev,ma,'ma ','ma ') -
LMDZ.3.3/branches/rel-LF/libf/phylmd/fisrtilp.F
r79 r373 1 SUBROUTINE fisrtilp(dtime,paprs,pplay,t,q, 1 c $Header$ 2 c 3 SUBROUTINE fisrtilp(dtime,paprs,pplay,t,q,ptconv,ratqs, 2 4 s d_t, d_q, d_ql, rneb, radliq, rain, snow, 3 s prfl, psfl) 5 s pfrac_impa, pfrac_nucl, pfrac_1nucl, 6 s frac_impa, frac_nucl, 7 s prfl, psfl, rhcl) 8 4 9 c 5 10 IMPLICIT none … … 14 19 #include "dimphy.h" 15 20 #include "YOMCST.h" 21 #include "tracstoke.h" 22 #include "fisrtilp.h" 16 23 c 17 24 c Arguments: … … 27 34 REAL rneb(klon,klev) ! fraction nuageuse 28 35 REAL radliq(klon,klev) ! eau liquide utilisee dans rayonnements 36 REAL rhcl(klon,klev) ! humidite relative en ciel clair 29 37 REAL rain(klon) ! pluies (mm/s) 30 38 REAL snow(klon) ! neige (mm/s) 31 39 REAL prfl(klon,klev+1) ! flux d'eau precipitante aux interfaces (kg/m2/s) 32 40 REAL psfl(klon,klev+1) ! flux d'eau precipitante aux interfaces (kg/m2/s) 41 cAA 42 c Coeffients de fraction lessivee : pour OFF-LINE 43 c 44 REAL pfrac_nucl(klon,klev) 45 REAL pfrac_1nucl(klon,klev) 46 REAL pfrac_impa(klon,klev) 47 c 48 c Fraction d'aerosols lessivee par impaction et par nucleation 49 c POur ON-LINE 50 c 51 REAL frac_impa(klon,klev) 52 REAL frac_nucl(klon,klev) 53 real zct(klon),zcl(klon) 54 cAA 33 55 c 34 56 c Options du programme: … … 36 58 REAL seuil_neb ! un nuage existe vraiment au-dela 37 59 PARAMETER (seuil_neb=0.001) 38 REAL ct ! inverse du temps pour qu'un nuage precipite 39 PARAMETER (ct=1./1800.) 40 REAL cl ! seuil de precipitation 41 PARAMETER (cl=2.6e-4) 42 ccc PARAMETER (cl=2.3e-4) 43 ccc PARAMETER (cl=2.0e-4) 60 44 61 INTEGER ninter ! sous-intervals pour la precipitation 45 62 PARAMETER (ninter=5) 46 63 LOGICAL evap_prec ! evaporation de la pluie 47 64 PARAMETER (evap_prec=.TRUE.) 48 REAL coef_eva 49 PARAMETER (coef_eva=2.0E-05) 50 LOGICAL calcrat ! calculer ratqs au lieu de fixer sa valeur 51 REAL ratqs ! determine la largeur de distribution de vapeur 52 PARAMETER (calcrat=.TRUE.) 53 REAL zx_min, rat_max 54 PARAMETER (zx_min=1.0, rat_max=0.01) 55 REAL zx_max, rat_min 56 PARAMETER (zx_max=0.1, rat_min=0.3) 57 REAL zx 65 REAL ratqs(klon,klev) ! determine la largeur de distribution de vapeur 66 logical ptconv(klon,klev) ! determine la largeur de distribution de vapeur 67 68 real zpdf_sig(klon),zpdf_k(klon),zpdf_delta(klon) 69 real Zpdf_a(klon),zpdf_b(klon),zpdf_e1(klon),zpdf_e2(klon) 70 real erf 58 71 c 59 72 LOGICAL cpartiel ! condensation partielle … … 64 77 c Variables locales: 65 78 c 66 INTEGER i, k, n 79 INTEGER i, k, n, kk 67 80 REAL zqs(klon), zdqs(klon), zdelta, zcor, zcvm5 68 81 REAL zrfl(klon), zrfln(klon), zqev, zqevt … … 76 89 SAVE appel1er 77 90 c 91 c--------------------------------------------------------------- 92 c 93 cAA Variables traceurs: 94 cAA Provisoire !!! Parametres alpha du lessivage 95 cAA A priori on a 4 scavenging # possibles 96 c 97 REAL a_tr_sca(4) 98 save a_tr_sca 99 c 100 c Variables intermediaires 101 c 102 REAL zalpha_tr 103 REAL zfrac_lessi 104 REAL zprec_cond(klon) 105 cAA 106 c--------------------------------------------------------------- 107 c 78 108 c Fonctions en ligne: 79 109 c 80 REAL fallv ! vitesse de chute pour crystaux de glace110 REAL fallvs,fallvc ! vitesse de chute pour crystaux de glace 81 111 REAL zzz 82 112 #include "YOETHF.h" 83 113 #include "FCTTRE.h" 84 fallv (zzz) = 3.29/2.0 * ((zzz)**0.16) 85 ccc fallv (zzz) = 3.29/3.0 * ((zzz)**0.16) 86 ccc fallv (zzz) = 3.29 * ((zzz)**0.16) 114 fallvc (zzz) = 3.29/2.0 * ((zzz)**0.16) * ffallv_con 115 fallvs (zzz) = 3.29/2.0 * ((zzz)**0.16) * ffallv_lsc 87 116 c 88 117 DATA appel1er /.TRUE./ 89 c 118 90 119 IF (appel1er) THEN 91 PRINT*, 'fisrtilp, calcrat:', calcrat 120 c 92 121 PRINT*, 'fisrtilp, ninter:', ninter 93 122 PRINT*, 'fisrtilp, evap_prec:', evap_prec … … 96 125 PRINT*, 'fisrtilp: Ce n est pas prevu, voir Z.X.Li', dtime 97 126 PRINT*, 'Je prefere un sous-intervalle de 6 minutes' 98 127 c CALL abort 99 128 ENDIF 100 129 appel1er = .FALSE. 101 ENDIF 102 c 130 c 131 cAA initialiation provisoire 132 a_tr_sca(1) = -0.5 133 a_tr_sca(2) = -0.5 134 a_tr_sca(3) = -0.5 135 a_tr_sca(4) = -0.5 136 c 137 cAA Initialisation a 1 des coefs des fractions lessivees 138 c 139 DO k = 1, klev 140 DO i = 1, klon 141 pfrac_nucl(i,k)=1. 142 pfrac_1nucl(i,k)=1. 143 pfrac_impa(i,k)=1. 144 ENDDO 145 ENDDO 146 147 ENDIF ! test sur appel1er 148 c 149 cMAf Initialisation a 0 de zoliq 150 DO i = 1, klon 151 zoliq(i)=0. 152 ENDDO 103 153 c Determiner les nuages froids par leur temperature 154 c nexpo regle la raideur de la transition eau liquide / eau glace. 104 155 c 105 156 ztglace = RTT - 15.0 … … 115 166 ENDDO 116 167 ENDDO 168 117 169 DO k = 1, klev 118 170 DO i = 1, klon … … 122 174 rneb(i,k) = 0.0 123 175 radliq(i,k) = 0.0 176 frac_nucl(i,k) = 1. 177 frac_impa(i,k) = 1. 124 178 ENDDO 125 179 ENDDO … … 136 190 ENDDO 137 191 c 192 c 193 cAA Pour plus de securite 194 195 zalpha_tr = 0. 196 zfrac_lessi = 0. 197 198 cAA---------------------------------------------------------- 199 c 138 200 c Boucle verticale (du haut vers le bas) 139 201 c 140 202 DO 9999 k = klev, 1, -1 203 c 204 cAA---------------------------------------------------------- 141 205 c 142 206 DO i = 1, klon … … 171 235 zrfln(i) = zrfl(i) - zqev*(paprs(i,k)-paprs(i,k+1)) 172 236 . /RG/dtime 237 238 c pour la glace, on réévapore toute la précip dans la couche du dessous 239 c la glace venant de la couche du dessus est simplement dans la couche 240 c du dessous. 241 242 IF (zt(i) .LT. t_coup.and.reevap_ice) zrfln(i)=0. 243 173 244 zq(i) = zq(i) - (zrfln(i)-zrfl(i)) 174 245 . * (RG/(paprs(i,k)-paprs(i,k+1)))*dtime … … 210 281 c 211 282 IF (cpartiel) THEN 212 DO i = 1, klon 213 c 214 zx = pplay(i,k)/paprs(i,1) 215 zx = (zx_max-zx)/(zx_max-zx_min) 216 zx = MIN(MAX(zx,0.0),1.0) 217 zx = zx * zx * zx 218 ratqs = zx * (rat_max-rat_min) + rat_min 219 IF (.NOT.calcrat) ratqs=0.05 220 ccc IF (.NOT.calcrat) ratqs=0.2 221 c 222 zdelq = ratqs * zq(i) 283 284 c print*,'Dans partiel k=',k 285 c 286 c Calcul de l'eau condensee et de la fraction nuageuse et de l'eau 287 c nuageuse a partir des PDF de Sandrine Bony. 288 c rneb : fraction nuageuse 289 c zqn : eau totale dans le nuage 290 c zcond : eau condensee moyenne dans la maille. 291 c on prend en compte le réchauffement qui diminue la partie condensee 292 c 293 c Version avec les raqts 294 295 if (iflag_pdf.eq.0) then 296 297 do i=1,klon 298 zdelq = min(ratqs(i,k),0.99) * zq(i) 223 299 rneb(i,k) = (zq(i)+zdelq-zqs(i)) / (2.0*zdelq) 224 300 zqn(i) = (zq(i)+zdelq+zqs(i))/2.0 301 enddo 302 303 else 304 c 305 c Version avec les nouvelles PDFs. 306 do i=1,klon 307 if(zq(i).lt.1.e-15) then 308 print*,'ZQ(',i,',',k,')=',zq(i) 309 zq(i)=1.e-15 310 endif 311 enddo 312 do i=1,klon 313 zpdf_sig(i)=ratqs(i,k)*zq(i) 314 zpdf_k(i)=-sqrt(log(1.+(zpdf_sig(i)/zq(i))**2)) 315 zpdf_delta(i)=log(zq(i)/zqs(i)) 316 zpdf_a(i)=zpdf_delta(i)/(zpdf_k(i)*sqrt(2.)) 317 zpdf_b(i)=zpdf_k(i)/(2.*sqrt(2.)) 318 zpdf_e1(i)=zpdf_a(i)-zpdf_b(i) 319 zpdf_e1(i)=sign(min(abs(zpdf_e1(i)),5.),zpdf_e1(i)) 320 zpdf_e1(i)=1.-erf(zpdf_e1(i)) 321 zpdf_e2(i)=zpdf_a(i)+zpdf_b(i) 322 zpdf_e2(i)=sign(min(abs(zpdf_e2(i)),5.),zpdf_e2(i)) 323 zpdf_e2(i)=1.-erf(zpdf_e2(i)) 324 if (zpdf_e1(i).lt.1.e-10) then 325 rneb(i,k)=0. 326 zqn(i)=zqs(i) 327 else 328 rneb(i,k)=0.5*zpdf_e1(i) 329 zqn(i)=zq(i)*zpdf_e2(i)/zpdf_e1(i) 330 endif 331 332 enddo 333 334 endif ! iflag_pdf 335 336 do i=1,klon 225 337 IF (rneb(i,k) .LE. 0.0) zqn(i) = 0.0 226 338 IF (rneb(i,k) .GE. 1.0) zqn(i) = zq(i) 227 339 rneb(i,k) = MAX(0.0,MIN(1.0,rneb(i,k))) 228 zcond(i) = MAX(0.0,zqn(i)-zqs(i))*rneb(i,k)/(1.+zdqs(i)) 229 ENDDO 340 c zcond(i) = MAX(0.0,zqn(i)-zqs(i))*rneb(i,k)/(1.+zdqs(i)) 341 c On ne divise pas par 1+zdqs pour forcer a avoir l'eau predite par 342 c la convection. 343 c ATTENTION !!! Il va falloir verifier tout ca. 344 zcond(i) = MAX(0.0,zqn(i)-zqs(i))*rneb(i,k) 345 c print*,'ZDQS ',zdqs(i) 346 c--Olivier 347 rhcl(i,k)=(zqs(i)+zq(i)-zdelq)/2./zqs(i) 348 IF (rneb(i,k) .LE. 0.0) rhcl(i,k)=zq(i)/zqs(i) 349 IF (rneb(i,k) .GE. 1.0) rhcl(i,k)=1.0 350 c--fin 351 ENDDO 230 352 ELSE 231 353 DO i = 1, klon … … 262 384 DO i = 1, klon 263 385 IF (rneb(i,k).GT.0.0) THEN 264 zchau(i) = ct*dtime/FLOAT(ninter) * zoliq(i)265 . * (1.0-EXP(-(zoliq(i)/zneb(i)/cl)**2)) *(1.-zfice(i))266 386 zrhol(i) = zrho(i) * zoliq(i) / zneb(i) 267 zfroi(i) = dtime/FLOAT(ninter)/zdz(i)*zoliq(i) 268 . *fallv(zrhol(i)) * zfice(i) 387 388 if (ptconv(i,k)) then 389 zcl(i)=cld_lc_con 390 zct(i)=1./cld_tau_con 391 else 392 zcl(i)=cld_lc_lsc 393 zct(i)=1./cld_tau_lsc 394 endif 395 c quantité d'eau à élminier. 396 zchau(i) = zct(i)*dtime/FLOAT(ninter) * zoliq(i) 397 . *(1.0-EXP(-(zoliq(i)/zneb(i)/zcl(i))**2)) *(1.-zfice(i)) 398 c meme chose pour la glace. 399 if (ptconv(i,k)) then 400 zfroi(i) = dtime/FLOAT(ninter)/zdz(i)*zoliq(i) 401 . *fallvc(zrhol(i)) * zfice(i) 402 else 403 zfroi(i) = dtime/FLOAT(ninter)/zdz(i)*zoliq(i) 404 . *fallvs(zrhol(i)) * zfice(i) 405 endif 269 406 ztot(i) = zchau(i) + zfroi(i) 270 407 IF (zneb(i).EQ.seuil_neb) ztot(i) = 0.0 … … 296 433 ENDDO 297 434 c 435 cAA--------------- Calcul du lessivage stratiforme ------------- 436 437 DO i = 1,klon 438 c 439 zprec_cond(i) = MAX(zcond(i)-zoliq(i),0.0) 440 . * (paprs(i,k)-paprs(i,k+1))/RG 441 IF (rneb(i,k).GT.0.0.and.zprec_cond(i).gt.0.) THEN 442 cAA lessivage nucleation LMD5 dans la couche elle-meme 443 if (t(i,k) .GE. ztglace) THEN 444 zalpha_tr = a_tr_sca(3) 445 else 446 zalpha_tr = a_tr_sca(4) 447 endif 448 zfrac_lessi = 1. - EXP(zalpha_tr*zprec_cond(i)/zneb(i)) 449 pfrac_nucl(i,k)=pfrac_nucl(i,k)*(1.-zneb(i)*zfrac_lessi) 450 frac_nucl(i,k)= 1.-zneb(i)*zfrac_lessi 451 c 452 c nucleation avec un facteur -1 au lieu de -0.5 453 zfrac_lessi = 1. - EXP(-zprec_cond(i)/zneb(i)) 454 pfrac_1nucl(i,k)=pfrac_1nucl(i,k)*(1.-zneb(i)*zfrac_lessi) 455 ENDIF 456 c 457 ENDDO ! boucle sur i 458 c 459 cAA Lessivage par impaction dans les couches en-dessous 460 DO kk = k-1, 1, -1 461 DO i = 1, klon 462 IF (rneb(i,k).GT.0.0.and.zprec_cond(i).gt.0.) THEN 463 if (t(i,kk) .GE. ztglace) THEN 464 zalpha_tr = a_tr_sca(1) 465 else 466 zalpha_tr = a_tr_sca(2) 467 endif 468 zfrac_lessi = 1. - EXP(zalpha_tr*zprec_cond(i)/zneb(i)) 469 pfrac_impa(i,kk)=pfrac_impa(i,kk)*(1.-zneb(i)*zfrac_lessi) 470 frac_impa(i,kk)= 1.-zneb(i)*zfrac_lessi 471 ENDIF 472 ENDDO 473 ENDDO 474 c 475 cAA---------------------------------------------------------- 476 c FIN DE BOUCLE SUR K 298 477 9999 CONTINUE 478 c 479 cAA----------------------------------------------------------- 299 480 c 300 481 c Pluie ou neige au sol selon la temperature de la 1ere couche -
LMDZ.3.3/branches/rel-LF/libf/phylmd/phyetat0.F
r353 r373 7 7 . fder,radsol,frugs,agesno,clesphy0, 8 8 . zmea,zstd,zsig,zgam,zthe,zpic,zval,rugsrel,tabcntr0, 9 . t_ancien,q_ancien,ancien_ok )9 . t_ancien,q_ancien,ancien_ok, rnebcon, ratqs,clwcon) 10 10 IMPLICIT none 11 11 c====================================================================== … … 54 54 55 55 REAL t_ancien(klon,klev), q_ancien(klon,klev) 56 real rnebcon(klon,klev),clwcon(klon,klev),ratqs(klon,klev) 56 57 LOGICAL ancien_ok 57 58 … … 1170 1171 ENDIF 1171 1172 c 1173 ierr = NF_INQ_VARID (nid, "CLWCON", nvarid) 1174 IF (ierr.NE.NF_NOERR) THEN 1175 PRINT*, "phyetat0: Le champ CLWCON est absent" 1176 PRINT*, "Depart legerement fausse. Mais je continue" 1177 clwcon = 0. 1178 ELSE 1179 #ifdef NC_DOUBLE 1180 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, clwcon) 1181 #else 1182 ierr = NF_GET_VAR_REAL(nid, nvarid, clwcon) 1183 #endif 1184 IF (ierr.NE.NF_NOERR) THEN 1185 PRINT*, "phyetat0: Lecture echouee pour <CLWCON>" 1186 CALL abort 1187 ENDIF 1188 ENDIF 1189 xmin = 1.0E+20 1190 xmax = -1.0E+20 1191 xmin = MINval(clwcon) 1192 xmax = MAXval(clwcon) 1193 PRINT*,'Eau liquide convective (ecart-type) clwcon:', xmin, xmax 1194 c 1195 ierr = NF_INQ_VARID (nid, "RNEBCON", nvarid) 1196 IF (ierr.NE.NF_NOERR) THEN 1197 PRINT*, "phyetat0: Le champ RNEBCON est absent" 1198 PRINT*, "Depart legerement fausse. Mais je continue" 1199 rnebcon = 0. 1200 ELSE 1201 #ifdef NC_DOUBLE 1202 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, rnebcon) 1203 #else 1204 ierr = NF_GET_VAR_REAL(nid, nvarid, rnebcon) 1205 #endif 1206 IF (ierr.NE.NF_NOERR) THEN 1207 PRINT*, "phyetat0: Lecture echouee pour <RNEBCON>" 1208 CALL abort 1209 ENDIF 1210 ENDIF 1211 xmin = 1.0E+20 1212 xmax = -1.0E+20 1213 xmin = MINval(rnebcon) 1214 xmax = MAXval(rnebcon) 1215 PRINT*,'Nebulosite convective (ecart-type) rnebcon:', xmin, xmax 1216 1217 c 1218 ierr = NF_INQ_VARID (nid, "QANCIEN", nvarid) 1219 IF (ierr.NE.NF_NOERR) THEN 1220 PRINT*, "phyetat0: Le champ <QANCIEN> est absent" 1221 PRINT*, "Depart legerement fausse. Mais je continue" 1222 ancien_ok = .FALSE. 1223 ELSE 1224 #ifdef NC_DOUBLE 1225 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, q_ancien) 1226 #else 1227 ierr = NF_GET_VAR_REAL(nid, nvarid, q_ancien) 1228 #endif 1229 IF (ierr.NE.NF_NOERR) THEN 1230 PRINT*, "phyetat0: Lecture echouee pour <QANCIEN>" 1231 CALL abort 1232 ENDIF 1233 ENDIF 1234 c 1235 ierr = NF_INQ_VARID (nid, "RATQS", nvarid) 1236 IF (ierr.NE.NF_NOERR) THEN 1237 PRINT*, "phyetat0: Le champ <RATQS> est absent" 1238 PRINT*, "Depart legerement fausse. Mais je continue" 1239 ratqs = 0. 1240 ELSE 1241 #ifdef NC_DOUBLE 1242 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, ratqs) 1243 #else 1244 ierr = NF_GET_VAR_REAL(nid, nvarid, ratqs) 1245 #endif 1246 IF (ierr.NE.NF_NOERR) THEN 1247 PRINT*, "phyetat0: Lecture echouee pour <RATQS>" 1248 CALL abort 1249 ENDIF 1250 ENDIF 1251 xmin = 1.0E+20 1252 xmax = -1.0E+20 1253 xmin = MINval(ratqs) 1254 xmax = MAXval(ratqs) 1255 PRINT*,'(ecart-type) ratqs:', xmin, xmax 1256 c 1172 1257 c Fermer le fichier: 1173 1258 c -
LMDZ.3.3/branches/rel-LF/libf/phylmd/phyredem.F
r352 r373 7 7 . radsol,frugs,agesno, 8 8 . zmea,zstd,zsig,zgam,zthe,zpic,zval,rugsrel, 9 . t_ancien, q_ancien )9 . t_ancien, q_ancien, rnebcon, ratqs, clwcon) 10 10 IMPLICIT none 11 11 c====================================================================== … … 53 53 REAL pctsrf(klon, nbsrf) 54 54 REAL t_ancien(klon,klev), q_ancien(klon,klev) 55 real clwcon(klon,klev),rnebcon(klon,klev),ratqs(klon,klev) 55 56 c 56 57 INTEGER nid, nvarid, idim1, idim2, idim3 … … 96 97 IF( ok_orolf ) tab_cntrl(11 ) = 1. 97 98 98 tab_cntrl(13) = dayref99 tab_cntrl(14) = anneeref100 99 tab_cntrl(13) = day_end 101 100 tab_cntrl(14) = annee_ref … … 670 669 #endif 671 670 c 671 ierr = NF_REDEF (nid) 672 #ifdef NC_DOUBLE 673 ierr = NF_DEF_VAR (nid, "CLWCON", NF_DOUBLE, 1, idim2,nvarid) 674 #else 675 ierr = NF_DEF_VAR (nid, "CLWCON", NF_FLOAT, 1, idim2,nvarid) 676 #endif 677 ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 28, 678 . "Eau liquide convective") 679 ierr = NF_ENDDEF(nid) 680 #ifdef NC_DOUBLE 681 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,clwcon) 682 #else 683 ierr = NF_PUT_VAR_REAL (nid,nvarid,clwcon) 684 #endif 685 c 686 ierr = NF_REDEF (nid) 687 #ifdef NC_DOUBLE 688 ierr = NF_DEF_VAR (nid, "RNEBCON", NF_DOUBLE, 1, idim2,nvarid) 689 #else 690 ierr = NF_DEF_VAR (nid, "RNEBCON", NF_FLOAT, 1, idim2,nvarid) 691 #endif 692 ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 28, 693 . "Nebulosite convective") 694 ierr = NF_ENDDEF(nid) 695 #ifdef NC_DOUBLE 696 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rnebcon) 697 #else 698 ierr = NF_PUT_VAR_REAL (nid,nvarid,rnebcon) 699 #endif 700 c 701 ierr = NF_REDEF (nid) 702 #ifdef NC_DOUBLE 703 ierr = NF_DEF_VAR (nid, "RATQS", NF_DOUBLE, 1, idim2,nvarid) 704 #else 705 ierr = NF_DEF_VAR (nid, "RATQS", NF_FLOAT, 1, idim2,nvarid) 706 #endif 707 ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 28, 708 . "Ratqs") 709 ierr = NF_ENDDEF(nid) 710 #ifdef NC_DOUBLE 711 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ratqs) 712 #else 713 ierr = NF_PUT_VAR_REAL (nid,nvarid,ratqs) 714 #endif 715 c 672 716 c 673 717 ierr = NF_CLOSE(nid) -
LMDZ.3.3/branches/rel-LF/libf/phylmd/physiq.F
r364 r373 388 388 EXTERNAL conlmd ! convection (schema LMD) 389 389 cKE43 390 EXTERNAL conema ! convect4.3390 EXTERNAL conema3 ! convect4.3 391 391 EXTERNAL fisrtilp ! schema de condensation a grande echelle (pluie) 392 392 cAA … … 412 412 c Variables locales 413 413 c 414 real clwcon(klon,klev),rnebcon(klon,klev) 415 real clwcon0(klon,klev),rnebcon0(klon,klev) 416 save rnebcon, clwcon 417 418 REAL rhcl(klon,klev) ! humiditi relative ciel clair 414 419 REAL dialiq(klon,klev) ! eau liquide nuageuse 415 420 REAL diafra(klon,klev) ! fraction nuageuse … … 464 469 c 465 470 REAL za, zb 466 REAL zx_t, zx_qs, zdelta, zcor, zlvdcp, zlsdcp 467 INTEGER i, k, iq, nsrf, ll 471 REAL zx_t, zx_qs, zdelta, zcor, zfra, zlvdcp, zlsdcp 472 real zqsat(klon,klev) 473 INTEGER i, k, iq, ig, j, nsrf, ll 468 474 REAL t_coup 469 475 PARAMETER (t_coup=234.0) … … 534 540 REAL d_t_lif(klon,klev) 535 541 536 REAL ratqs(klon,klev) 537 integer flag_ratqs 542 REAL ratqs(klon,klev),ratqss(klon,klev),ratqsc(klon,klev) 543 real ratqsbas,ratqshaut 544 save ratqsbas,ratqshaut, ratqs 538 545 real zpt_conv(klon,klev) 546 547 c Parametres lies au nouveau schema de nuages (SB, PDF) 548 real fact_cldcon 549 real facttemps 550 logical ok_newmicro 551 save ok_newmicro 552 save fact_cldcon,facttemps 553 554 integer iflag_cldcon 555 save iflag_cldcon 556 557 logical ptconv(klon,klev) 539 558 540 559 c … … 630 649 c 631 650 call conf_phys(ocean, ok_veget, ok_journe, ok_mensuel, 632 . ok_instan) 651 . ok_instan, fact_cldcon, facttemps,ok_newmicro, 652 . iflag_cldcon,ratqsbas,ratqshaut) 633 653 634 654 DO k = 2, nvm ! pas de vegetation … … 655 675 . dlw,radsol,frugs,agesno,clesphy0, 656 676 . zmea,zstd,zsig,zgam,zthe,zpic,zval,rugoro,tabcntr0, 657 . t_ancien, q_ancien, ancien_ok )677 . t_ancien, q_ancien, ancien_ok, rnebcon, ratqs,clwcon ) 658 678 659 679 c … … 1307 1327 . "ave(X)", zsto,zout) 1308 1328 c 1329 CALL histdef(nid_mth, "ducon", "Convection du", "m/s2", 1330 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, 1331 . "ave(X)", zsto,zout) 1332 c 1309 1333 CALL histdef(nid_mth, "dqcon", "Convection dQ", "Kg/Kg/s", 1310 1334 . iim,jjmp1,nhori, klev,1,klev,nvert, 32, … … 1774 1798 DO i = 1, klon 1775 1799 zlvdcp=RLVTT/RCPD/(1.0+RVTMP2*q_seri(i,k)) 1776 zlsdcp=RLSTT/RCPD/(1.0+RVTMP2*q_seri(i,k)) 1800 c zlsdcp=RLSTT/RCPD/(1.0+RVTMP2*q_seri(i,k)) 1801 zlsdcp=RLVTT/RCPD/(1.0+RVTMP2*q_seri(i,k)) 1777 1802 zdelta = MAX(0.,SIGN(1.,RTT-t_seri(i,k))) 1778 1803 zb = MAX(0.0,ql_seri(i,k)) … … 1981 2006 else 1982 2007 1983 CALL conema (dtime,paprs,pplay,t_seri,q_seri, 2008 c print*,'Avant conema OUI' 2009 CALL conema3 (dtime, 2010 . paprs,pplay,t_seri,q_seri, 1984 2011 . u_seri,v_seri,tr_seri,nbtr, 1985 2012 . ema_work1,ema_work2, … … 1988 2015 . upwd,dnwd,dnwd0,bas,top, 1989 2016 . Ma,cape,tvp,rflag, 1990 . pbase 1991 . ,bbase,dtvpdt1,dtvpdq1,dplcldt,dplcldr) 2017 . pbase 2018 . ,bbase,dtvpdt1,dtvpdq1,dplcldt,dplcldr 2019 . ,clwcon0) 2020 c print*,'Apres conema3 ' 2021 2022 c Calculer l'humidite relative pour diagnostique 2023 c 2024 DO k = 1, klev 2025 DO i = 1, klon 2026 zx_t = t_seri(i,k) 2027 IF (thermcep) THEN 2028 zdelta = MAX(0.,SIGN(1.,rtt-zx_t)) 2029 zx_qs = r2es * FOEEW(zx_t,zdelta)/pplay(i,k) 2030 zx_qs = MIN(0.5,zx_qs) 2031 zcor = 1./(1.-retv*zx_qs) 2032 zx_qs = zx_qs*zcor 2033 ELSE 2034 IF (zx_t.LT.t_coup) THEN 2035 zx_qs = qsats(zx_t)/pplay(i,k) 2036 ELSE 2037 zx_qs = qsatl(zx_t)/pplay(i,k) 2038 ENDIF 2039 ENDIF 2040 zqsat(i,k)=zx_qs 2041 ENDDO 2042 ENDDO 2043 2044 c calcul des propriétés des nuages convectifs 2045 clwcon0(:,:)=fact_cldcon*clwcon0(:,:) 2046 call clouds_gno 2047 s (klon,klev,q_seri,zqsat,clwcon0,ptconv,ratqsc,rnebcon0) 2048 1992 2049 endif 1993 2050 DO i = 1, klon … … 2054 2111 IF (nqmax.GT.2) THEN !--melange convectif de traceurs 2055 2112 c 2056 IF (iflag_con . LT. 2 .AND. iflag_con .GT. 4) THEN2113 IF (iflag_con .NE. 2 .AND. debut) THEN 2057 2114 PRINT*, 'Pour l instant, seul conflx fonctionne ', 2058 2115 $ 'avec traceurs', iflag_con 2059 2116 PRINT*,' Mettre iflag_con', 2060 $ ' = 2 , 3 ou 4dans run.def et repasser'2061 CALL abort2117 $ ' = 2 dans run.def et repasser' 2118 c CALL abort 2062 2119 ENDIF 2063 2120 c … … 2074 2131 ENDDO 2075 2132 2076 c RATQS 2077 if (iflag_con.eq.2) then 2078 flag_ratqs=0 2133 2134 c------------------------------------------------------------------------- 2135 c Caclul des ratqs 2136 c------------------------------------------------------------------------- 2137 2138 c print*,'calcul des ratqs' 2139 c ratqs convectifs a l'ancienne en fonction de q(z=0)-q / q 2140 c ---------------- 2141 c on ecrase le tableau ratqsc calcule par clouds_gno 2142 if (iflag_cldcon.eq.1) then 2143 do k=1,klev 2144 do i=1,klon 2145 if(ptconv(i,k)) then 2146 ratqsc(i,k)=ratqsbas 2147 s +fact_cldcon*(q_seri(i,1)-q_seri(i,k))/q_seri(i,k) 2148 else 2149 ratqsc(i,k)=0. 2150 endif 2151 enddo 2152 enddo 2153 endif 2154 2155 c ratqs stables 2156 c ------------- 2157 do k=1,klev 2158 ratqss(:,k)=ratqsbas+(ratqshaut-ratqsbas)* 2159 s min((paprs(:,1)-pplay(:,k))/(paprs(:,1)-30000.),1.) 2160 enddo 2161 2162 2163 c ratqs final 2164 c ----------- 2165 if (iflag_cldcon.eq.1 .or.iflag_cldcon.eq.2) then 2166 c les ratqs sont une conbinaison de ratqss et ratqsc 2167 c ratqs final 2168 c 1e4 (en gros 3 heures), en dur pour le moment, est le temps de 2169 c relaxation des ratqs 2170 facttemps=exp(-pdtphys/1.e4) 2171 ratqs(:,:)=max(ratqs(:,:)*facttemps,ratqss(:,:)) 2172 ratqs(:,:)=max(ratqs(:,:),ratqsc(:,:)) 2173 c print*,'calcul des ratqs fini' 2079 2174 else 2080 flag_ratqs=1 2175 c on ne prend que le ratqs stable pour fisrtilp 2176 ratqs(:,:)=ratqss(:,:) 2081 2177 endif 2082 call calcratqs (flag_ratqs, 2083 I paprs,pplay,q_seri,d_t_con,d_t_ajs 2084 O ,ratqs,zpt_conv) 2178 2179 2085 2180 c 2086 2181 c Appeler le processus de condensation a grande echelle 2087 2182 c et le processus de precipitation 2088 c 2089 CALL fisrtilp _tr(dtime,paprs,pplay,2090 . t_seri, q_seri, ratqs,2183 c------------------------------------------------------------------------- 2184 CALL fisrtilp(dtime,paprs,pplay, 2185 . t_seri, q_seri,ptconv,ratqs, 2091 2186 . d_t_lsc, d_q_lsc, d_ql_lsc, rneb, cldliq, 2092 2187 . rain_lsc, snow_lsc, 2093 2188 . pfrac_impa, pfrac_nucl, pfrac_1nucl, 2094 2189 . frac_impa, frac_nucl, 2095 . prfl, psfl) 2190 . prfl, psfl, rhcl) 2191 2096 2192 WHERE (rain_lsc < 0) rain_lsc = 0. 2097 2193 WHERE (snow_lsc < 0) snow_lsc = 0. … … 2118 2214 ENDIF 2119 2215 c 2120 c Nuages diagnostiques: 2121 c 2122 IF (iflag_con.EQ.2) THEN ! seulement pour Tiedtke 2216 c------------------------------------------------------------------- 2217 c PRESCRIPTION DES NUAGES POUR LE RAYONNEMENT 2218 c------------------------------------------------------------------- 2219 2220 c 1. NUAGES CONVECTIFS 2221 c 2222 IF (iflag_cldcon.eq.-1) THEN ! seulement pour Tiedtke 2223 2224 c Nuages diagnostiques pour Tiedtke 2123 2225 CALL diagcld1(paprs,pplay, 2124 2226 . rain_con,snow_con,ibas_con,itop_con, … … 2132 2234 ENDDO 2133 2235 ENDDO 2236 2237 ELSE IF (iflag_cldcon.eq.3) THEN 2238 c On prend pour les nuages convectifs le max du calcul de la 2239 c convection et du calcul du pas de temps précédent diminué d'un facteur 2240 c facttemps 2241 facttemps=pdtphys/1.e4 2242 do k=1,klev 2243 do i=1,klon 2244 rnebcon(i,k)=rnebcon(i,k)*facttemps 2245 if (rnebcon0(i,k)*clwcon0(i,k).gt.rnebcon(i,k)*clwcon(i,k)) 2246 s then 2247 rnebcon(i,k)=rnebcon0(i,k) 2248 clwcon(i,k)=clwcon0(i,k) 2249 endif 2250 enddo 2251 enddo 2252 2253 c On prend la somme des fractions nuageuses et des contenus en eau 2254 cldfra(:,:)=min(max(cldfra(:,:),rnebcon(:,:)),1.) 2255 cldliq(:,:)=cldliq(:,:)+rnebcon(:,:)*clwcon(:,:) 2256 2257 2134 2258 ENDIF 2135 2259 c 2136 c Nuages stratus artificiels:2260 c 2. NUAGES STARTIFORMES 2137 2261 c 2138 2262 IF (ok_stratus) THEN … … 2174 2298 ENDIF 2175 2299 zx_rh(i,k) = q_seri(i,k)/zx_qs 2300 zqsat(i,k)=zx_qs 2176 2301 ENDDO 2177 2302 ENDDO … … 2180 2305 c parametres pour diagnostiques: 2181 2306 c 2307 if (ok_newmicro) then 2308 CALL newmicro (paprs, pplay,ok_newmicro, 2309 . t_seri, cldliq, cldfra, cldtau, cldemi, 2310 . cldh, cldl, cldm, cldt, cldq) 2311 else 2182 2312 CALL nuage (paprs, pplay, 2183 2313 . t_seri, cldliq, cldfra, cldtau, cldemi, 2184 2314 . cldh, cldl, cldm, cldt, cldq) 2315 endif 2185 2316 c 2186 2317 c Appeler le rayonnement mais calculer tout d'abord l'albedo du sol. … … 3361 3492 . radsol,frugs,agesno, 3362 3493 . zmea,zstd,zsig,zgam,zthe,zpic,zval,rugoro, 3363 . t_ancien, q_ancien )3494 . t_ancien, q_ancien, rnebcon, ratqs, clwcon) 3364 3495 ENDIF 3365 3496
Note: See TracChangeset
for help on using the changeset viewer.