Changeset 972 for LMDZ4/trunk
- Timestamp:
- Jun 19, 2008, 12:24:22 PM (16 years ago)
- Location:
- LMDZ4/trunk/libf/phylmd
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/trunk/libf/phylmd/add_phys_tend.F90
r941 r972 18 18 use phys_state_var_mod 19 19 IMPLICIT none 20 #include "iniprint.h" 20 21 21 22 ! Arguments : … … 32 33 INTEGER jadrs(klon*klev), jbad 33 34 INTEGER jqadrs(klon*klev), jqbad 35 INTEGER kadrs(klon*klev) 36 INTEGER kqadrs(klon*klev) 34 37 35 38 integer debug_level 36 39 logical, save :: first=.true. 40 INTEGER, SAVE :: itap 37 41 !====================================================================== 38 42 ! Initialisations 39 43 40 44 debug_level=10 41 45 if (first) then 46 itap=0 47 first=.false. 48 endif 49 ! Incrementer le compteur de la physique 50 itap = itap + 1 42 51 !====================================================================== 43 52 ! Ajout des tendances sur le vent et l'eau liquide … … 62 71 jbad = jbad + 1 63 72 jadrs(jbad) = i 73 kadrs(jbad) = k 64 74 ENDIF 65 75 IF ( zq<0. .or. zq>0.1 .or. abs(zdq(i,k))>1.e-2 ) then 66 76 jqbad = jqbad + 1 67 77 jqadrs(jqbad) = i 78 kqadrs(jqbad) = k 68 79 ENDIF 69 80 t_seri(i,k)=zt … … 97 108 print*,'l T dT Q dQ ' 98 109 DO k = 1, klev 99 write(*,'(i3,2f14.4,2e14.2)') k,t_seri(i,k),zdt(i,k),q_seri(i,k),zdq(i,k) 110 zq=q_seri(i,k)+zdq(i,k) 111 if (zq.lt.1.e-15) then 112 if (q_seri(i,k).lt.1.e-15) then 113 ! print*,' cas q_seri<1.e-15 i k q_seri zq zdq :',i,k,q_seri(i,k),zq,zdq(i,k) 114 q_seri(i,k)=1.e-15 115 zdq(i,k)=(1.e-15-q_seri(i,k)) 116 endif 117 endif 100 118 ! zq=q_seri(i,k)+zdq(i,k) 101 119 ! if (zq.lt.1.e-15) then … … 103 121 ! endif 104 122 ENDDO 105 call print_debug_phys(i,debug_level,text)106 123 ENDDO 107 124 ENDIF 108 125 ! 109 126 127 !IM ajout memes tests pour reverifier les jbad, jqbad beg 128 jbad=0 129 jqbad=0 130 DO k = 1, klev 131 DO i = 1, klon 132 IF ( t_seri(i,k)>370. .or. t_seri(i,k)<130. .or. abs(zdt(i,k))>50. ) then 133 jbad = jbad + 1 134 jadrs(jbad) = i 135 ! if(prt_level.ge.10) THEN 136 ! print*,'cas2 i k t_seri zdt',i,k,t_seri(i,k),zdt(i,k) 137 ! endif 138 ENDIF 139 IF ( q_seri(i,k)<0. .or. q_seri(i,k)>0.1 .or. abs(zdq(i,k))>1.e-2 ) then 140 jqbad = jqbad + 1 141 jqadrs(jqbad) = i 142 kqadrs(jqbad) = k 143 ! if(prt_level.ge.10) THEN 144 ! print*,'cas2 i k q_seri zdq',i,k,q_seri(i,k),zdq(i,k) 145 ! endif 146 ENDIF 147 ENDDO 148 ENDDO 149 IF (jbad .GT. 0) THEN 150 DO j = 1, jbad 151 i=jadrs(j) 152 k=kadrs(j) 153 print*,'PLANTAGE2 POUR LE POINT i itap rlon rlat txt jbad zdt t',i,itap,rlon(i),rlat(i),text,jbad, & 154 & zdt(i,k),t_seri(i,k)-zdt(i,k) 155 ! if(prt_level.ge.10) THEN 156 if(prt_level.ge.10.and.itap.GE.229.and.i.EQ.3027) THEN 157 print*,'l T dT Q dQ ' 158 DO k = 1, klev 159 write(*,'(i3,2f14.4,2e14.2)') k,t_seri(i,k),zdt(i,k),q_seri(i,k),zdq(i,k) 160 ENDDO 161 call print_debug_phys(i,debug_level,text) 162 endif 163 ENDDO 164 ENDIF 165 ! 166 IF (jqbad .GT. 0) THEN 167 DO j = 1, jqbad 168 i=jqadrs(j) 169 k=kqadrs(j) 170 print*,'WARNING : EAU2 POUR LE POINT i itap rlon rlat txt jqbad zdq q zdql ql',i,itap,rlon(i),rlat(i),text,jqbad,& 171 & zdq(i,k), q_seri(i,k)-zdq(i,k), zdql(i,k), ql_seri(i,k)-zdql(i,k) 172 ! if(prt_level.ge.10) THEN 173 if(prt_level.ge.10.and.itap.GE.229.and.i.EQ.3027) THEN 174 print*,'l T dT Q dQ ' 175 DO k = 1, klev 176 write(*,'(i3,2f14.4,2e14.2)') k,t_seri(i,k),zdt(i,k),q_seri(i,k),zdq(i,k) 177 ENDDO 178 call print_debug_phys(i,debug_level,text) 179 endif 180 ENDDO 181 ENDIF 182 183 CALL hgardfou(t_seri,ftsol,text) 110 184 RETURN 111 185 END -
LMDZ4/trunk/libf/phylmd/cv3a_compress.F
r879 r972 123 123 124 124 if (nn.ne.ncum) then 125 print*,' strange!nn not equal to ncum: ',nn,ncum125 print*,'WARNING nn not equal to ncum: ',nn,ncum 126 126 stop 127 127 endif … … 150 150 150 continue 151 151 152 if (nn.ne.ncum) then 153 print*,'WARNING nn not equal to ncum: ',nn,ncum 154 stop 155 endif 156 152 157 RETURN 153 158 END -
LMDZ4/trunk/libf/phylmd/hgardfou.F
r941 r972 51 51 ok = .FALSE. 52 52 DO i = 1, jbad 53 PRINT *,'i,k,temperature =',jadrs(i),k,zt(jadrs(i)),54 $ 53 PRINT *,'i,k,temperature rlon rlat=',jadrs(i),k,zt(jadrs(i)) 54 $ ,rlon(jadrs(i)),rlat(jadrs(i)) 55 55 ENDDO 56 56 ENDIF … … 70 70 ok = .FALSE. 71 71 DO i = 1, jbad 72 PRINT *,'i,k,temperature =',jadrs(i),k,zt(jadrs(i)),73 $ 72 PRINT *,'i,k,temperature rlon rlat=',jadrs(i),k,zt(jadrs(i)) 73 $ ,rlon(jadrs(i)),rlat(jadrs(i)) 74 74 ENDDO 75 75 ENDIF -
LMDZ4/trunk/libf/phylmd/pbl_surface_mod.F90
r889 r972 880 880 !**************************************************************************************** 881 881 ! H and Q 882 883 882 ! print *,'pbl_surface: ok_flux_surf=',ok_flux_surf 883 ! print *,'pbl_surface: fsens flat RLVTT=',fsens,flat,RLVTT 884 884 if (ok_flux_surf) then 885 885 y_flux_t1(:) = fsens -
LMDZ4/trunk/libf/phylmd/thermcell.h
r879 r972 1 1 integer iflag_thermals,nsplit_thermals 2 real r_aspect_thermals,l_mix_thermals,t ho_thermals2 real r_aspect_thermals,l_mix_thermals,tau_thermals 3 3 integer w2di_thermals,isplit 4 4 integer iflag_coupl,iflag_clos,iflag_wake 5 5 6 6 common/ctherm1/iflag_thermals,nsplit_thermals 7 common/ctherm2/r_aspect_thermals,l_mix_thermals,t ho_thermals7 common/ctherm2/r_aspect_thermals,l_mix_thermals,tau_thermals 8 8 common/ctherm3/w2di_thermals 9 9 common/ctherm4/iflag_coupl,iflag_clos,iflag_wake -
LMDZ4/trunk/libf/phylmd/thermcell_closure.F90
r938 r972 1 1 SUBROUTINE thermcell_closure(ngrid,nlay,r_aspect,ptimestep,rho, & 2 & zlev,lalim,alim_star,zmax_sec,wmax_sec,zmax,wmax,f, f0,lev_out)2 & zlev,lalim,alim_star,zmax_sec,wmax_sec,zmax,wmax,f,lev_out) 3 3 4 4 !------------------------------------------------------------------------- … … 24 24 25 25 REAL f(ngrid) 26 REAL f0(ngrid)27 26 28 27 do ig=1,ngrid … … 52 51 f(ig)=wmax_sec(ig)/(max(500.,zmax_sec(ig))*r_aspect & 53 52 & *alim_star2(ig)) 54 55 53 ! f(ig)=f(ig)+(f0(ig)-f(ig))*exp((-ptimestep/ & 54 ! & zmax_sec(ig))*wmax_sec(ig)) 56 55 else 57 56 f(ig)=wmax(ig)/zdenom 58 f(ig)=f(ig)+(f0(ig)-f(ig))*exp((-ptimestep/ &59 & zmax(ig))*wmax(ig))57 ! f(ig)=f(ig)+(f0(ig)-f(ig))*exp((-ptimestep/ & 58 ! & zmax(ig))*wmax(ig)) 60 59 endif 61 60 endif 62 f0(ig)=f(ig)61 ! f0(ig)=f(ig) 63 62 enddo 64 63 if (prt_level.ge.1) print*,'apres fermeture' -
LMDZ4/trunk/libf/phylmd/thermcell_dq.F90
r938 r972 23 23 real qa(ngrid,nlay),detr(ngrid,nlay),wqd(ngrid,nlay+1) 24 24 25 real zzm 26 25 27 integer ig,k 28 real cfl 29 30 real qold(ngrid,nlay) 31 real ztimestep 32 integer niter,iter 33 34 35 36 ! Calcul du critere CFL pour l'advection dans la subsidence 37 do k=1,nlay 38 do ig=1,ngrid 39 zzm=masse(ig,k)/ptimestep 40 cfl=max(cfl,fm(ig,k)/zzm) 41 if (entr(ig,k).gt.zzm) then 42 print*,'entr dt > m ',entr(ig,k)*ptimestep,masse(ig,k) 43 stop 44 endif 45 enddo 46 enddo 47 48 !IM 090508 print*,'CFL CFL CFL CFL ',cfl 49 50 #undef CFL 51 #ifdef CFL 52 ! On subdivise le calcul en niter pas de temps. 53 niter=int(cfl)+1 54 #else 55 niter=1 56 #endif 57 58 ztimestep=ptimestep/niter 59 qold=q 60 61 62 do iter=1,niter 63 if (prt_level.ge.1) print*,'Q2 THERMCEL_DQ 0' 26 64 27 65 ! calcul du detrainement 28 29 if (prt_level.ge.1) print*,'Q2 THERMCEL_DQ 0'30 31 66 do k=1,nlay 32 67 do ig=1,ngrid … … 56 91 do k=2,nlay 57 92 do ig=1,ngrid 58 if ((fm(ig,k+1)+detr(ig,k))* ptimestep.gt. &93 if ((fm(ig,k+1)+detr(ig,k))*ztimestep.gt. & 59 94 & 1.e-5*masse(ig,k)) then 60 95 qa(ig,k)=(fm(ig,k)*qa(ig,k-1)+entr(ig,k)*q(ig,k)) & … … 72 107 enddo 73 108 109 ! Calcul du flux subsident 110 74 111 do k=2,nlay 75 112 do ig=1,ngrid 76 ! wqd(ig,k)=fm(ig,k)*0.5*(q(ig,k-1)+q(ig,k)) 113 #undef centre 114 #ifdef centre 115 wqd(ig,k)=fm(ig,k)*0.5*(q(ig,k-1)+q(ig,k)) 116 #else 117 118 #define plusqueun 119 #ifdef plusqueun 120 ! Schema avec advection sur plus qu'une maille. 121 zzm=masse(ig,k)/ztimestep 122 if (fm(ig,k)>zzm) then 123 wqd(ig,k)=zzm*q(ig,k)+(fm(ig,k)-zzm)*q(ig,k+1) 124 else 125 wqd(ig,k)=fm(ig,k)*q(ig,k) 126 endif 127 #else 77 128 wqd(ig,k)=fm(ig,k)*q(ig,k) 129 #endif 130 #endif 131 78 132 if (wqd(ig,k).lt.0.) then 79 133 ! print*,'wqd<0!!!' … … 86 140 enddo 87 141 142 143 ! Calcul des tendances 88 144 do k=1,nlay 89 145 do ig=1,ngrid 90 dq(ig,k)=(detr(ig,k)*qa(ig,k)-entr(ig,k)*q(ig,k) &146 q(ig,k)=q(ig,k)+(detr(ig,k)*qa(ig,k)-entr(ig,k)*q(ig,k) & 91 147 & -wqd(ig,k)+wqd(ig,k+1)) & 92 & /masse(ig,k)148 & *ztimestep/masse(ig,k) 93 149 ! if (dq(ig,k).lt.0.) then 94 150 ! print*,'dq<0!!!' … … 97 153 enddo 98 154 155 156 enddo 157 158 159 ! Calcul des tendances 160 do k=1,nlay 161 do ig=1,ngrid 162 dq(ig,k)=(q(ig,k)-qold(ig,k))/ptimestep 163 q(ig,k)=qold(ig,k) 164 enddo 165 enddo 166 99 167 return 100 168 end -
LMDZ4/trunk/libf/phylmd/thermcell_dv2.F90
r938 r972 54 54 enddo 55 55 56 print*,'WARNING on initialise gamma(1:ngrid,1)=0.' 57 gamma(1:ngrid,1)=0. 56 58 do k=2,nlay 57 59 do ig=1,ngrid … … 60 62 ! On itère sur la valeur du coeff de freinage. 61 63 ! gamma0=rho(ig,k)*(zlev(ig,k+1)-zlev(ig,k)) 64 !IM 060508 beg 65 ! if(0.5*(fraca(ig,k+1)+fraca(ig,k)).LT.0.) THEN 66 ! print*,'th_dv2 ig k fraca(:,k) fraca(:k+1)', & 67 ! & ig,k,fraca(ig,k),fraca(ig,k+1) 68 ! endif 69 ! if(larga(ig).EQ.0.) THEN 70 ! print*,'th_dv2 ig larga=0.',ig 71 ! endif 72 if(larga(ig).GT.0.) THEN 73 !IM 060508 end 62 74 gamma0=masse(ig,k) & 63 75 & *sqrt( 0.5*(fraca(ig,k+1)+fraca(ig,k)) ) & 64 76 & *0.5/larga(ig) & 65 77 & *1. 78 !IM 060508 beg 79 else 80 if(prt_level.GE.10) print*,'WARNING cas ELSE on initialise gamma0=0.' 81 gamma0=0. 82 endif !(larga(ig).GT.0.) THEN 83 !IM 060508 end 66 84 ! s *0.5 67 85 ! gamma0=0. … … 117 135 do k=1,nlay 118 136 do ig=1,ngrid 137 !IM 138 if(prt_level.GE.10) print*,'th_dv2 ig k gamma entr detr ua ue va ve wud wvd masse',ig,k,gamma(ig,k), & 139 & entr(ig,k),detr(ig,k),ua(ig,k),ue(ig,k),va(ig,k),ve(ig,k),wud(ig,k),wvd(ig,k),wud(ig,k+1),wvd(ig,k+1), & 140 & masse(ig,k) 141 ! 119 142 du(ig,k)=((detr(ig,k)+gamma(ig,k))*ua(ig,k) & 120 143 & -(entr(ig,k)+gamma(ig,k))*ue(ig,k) & -
LMDZ4/trunk/libf/phylmd/thermcell_init.F90
r938 r972 1 SUBROUTINE thermcell_init(ngrid,nlay,ztv,zl ev, &1 SUBROUTINE thermcell_init(ngrid,nlay,ztv,zlay,zlev, & 2 2 & lalim,lmin,alim_star,alim_star_tot,lev_out) 3 3 … … 12 12 INTEGER ngrid,nlay 13 13 REAL ztv(ngrid,nlay) 14 REAL zlev(ngrid,nlay) 14 REAL zlay(ngrid,nlay) 15 REAL zlev(ngrid,nlay+1) 15 16 !arguments de sortie 16 17 INTEGER lalim(ngrid) … … 20 21 integer lev_out ! niveau pour les print 21 22 23 REAL zzalim(ngrid) 22 24 !CR: ponderation entrainement des couches instables 23 25 !def des alim_star tels que alim=f*alim_star … … 58 60 enddo 59 61 ! 62 zzalim(:)=0. 63 do l=1,nlay-1 64 do ig=1,ngrid 65 if (l<lalim(ig)) then 66 zzalim(ig)=zzalim(ig)+zlay(ig,l)*(ztv(ig,l)-ztv(ig,l+1)) 67 endif 68 enddo 69 enddo 70 do ig=1,ngrid 71 if (lalim(ig)>1) then 72 zzalim(ig)=zlay(ig,1)+zzalim(ig)/(ztv(ig,1)-ztv(ig,lalim(ig))) 73 else 74 zzalim(ig)=zlay(ig,1) 75 endif 76 enddo 77 78 if(prt_level.GE.10) print*,'ZZALIM LALIM ',zzalim,lalim,zlay(1,lalim(1)) 79 60 80 ! definition de l'entrainement des couches 81 if (1.eq.1) then 61 82 do l=1,nlay-1 62 83 do ig=1,ngrid … … 69 90 enddo 70 91 enddo 92 else 93 do l=1,nlay-1 94 do ig=1,ngrid 95 if (ztv(ig,l).gt.ztv(ig,l+1).and. & 96 & l.ge.lmin(ig).and.l.lt.lalim(ig)) then 97 alim_star(ig,l)=max(3.*zzalim(ig)-zlay(ig,l),0.) & 98 & *(zlev(ig,l+1)-zlev(ig,l)) 99 endif 100 enddo 101 enddo 102 endif 71 103 72 104 ! pas de thermique si couche 1 stable -
LMDZ4/trunk/libf/phylmd/thermcell_main.F90
r940 r972 2 2 ! $Header$ 3 3 ! 4 SUBROUTINE thermcell_main( ngrid,nlay,ptimestep &4 SUBROUTINE thermcell_main(itap,ngrid,nlay,ptimestep & 5 5 & ,pplay,pplev,pphi,debut & 6 6 & ,pu,pv,pt,po & 7 7 & ,pduadj,pdvadj,pdtadj,pdoadj & 8 & ,fm0,entr0, zqla,lmax &8 & ,fm0,entr0,detr0,zqla,lmax & 9 9 & ,ratqscth,ratqsdiff,zqsatth & 10 & ,r_aspect,l_mix, w2di,tho&10 & ,r_aspect,l_mix,tau_thermals & 11 11 & ,Ale_bl,Alp_bl,lalim_conv,wght_th & 12 12 & ,zmax0, f0) 13 13 14 usedimphy14 USE dimphy 15 15 IMPLICIT NONE 16 16 … … 50 50 ! ---------- 51 51 52 INTEGER ngrid,nlay,w2di,tho 52 !IM 140508 53 INTEGER itap 54 55 INTEGER ngrid,nlay,w2di 56 real tau_thermals 53 57 real ptimestep,l_mix,r_aspect 54 58 REAL pt(ngrid,nlay),pdtadj(ngrid,nlay) … … 61 65 ! local: 62 66 ! ------ 67 68 integer icount 69 data icount/0/ 70 save icount 63 71 64 72 integer,save :: igout=1 … … 79 87 !FH/IM save zmax0 80 88 89 real lambda 90 81 91 real zlev(klon,klev+1),zlay(klon,klev) 82 92 real deltaz(klon,klev) 83 REAL zh(klon,klev) ,zdhadj(klon,klev)93 REAL zh(klon,klev) 84 94 real zthl(klon,klev),zdthladj(klon,klev) 85 95 REAL ztv(klon,klev) … … 97 107 real thetath2(klon,klev),wth2(klon,klev),wth3(klon,klev) 98 108 real q2(klon,klev) 99 ! common/comtherm/thetath2,wth2 109 ! FH probleme de dimensionnement avec l'allocation dynamique 110 ! common/comtherm/thetath2,wth2 100 111 101 112 real ratqscth(klon,klev) … … 109 120 110 121 logical sorties 111 real rho(klon,klev),rhobarz(klon,klev +1),masse(klon,klev)122 real rho(klon,klev),rhobarz(klon,klev),masse(klon,klev) 112 123 real zpspsk(klon,klev) 113 124 114 125 real wmax(klon) 115 126 real wmax_sec(klon) 116 real fm0(klon,klev+1),entr0(klon,klev),detr(klon,klev) 117 real detr0(klon,klev) 118 real fm(klon,klev+1),entr(klon,klev) 127 real fm0(klon,klev+1),entr0(klon,klev),detr0(klon,klev) 128 real fm(klon,klev+1),entr(klon,klev),detr(klon,klev) 119 129 120 130 real ztla(klon,klev),zqla(klon,klev),zqta(klon,klev) … … 164 174 seuil=0.25 165 175 176 if (debut) then 177 fm0=0. 178 entr0=0. 179 detr0=0. 180 endif 181 182 fm=0. ; entr=0. ; detr=0. 183 184 icount=icount+1 185 186 !IM 090508 beg 187 !print*,'=====================================================================' 188 !print*,'=====================================================================' 189 !print*,' PAS ',icount,' PAS ',icount,' PAS ',icount,' PAS ',icount 190 !print*,'=====================================================================' 191 !print*,'=====================================================================' 192 !IM 090508 end 193 166 194 if (prt_level.ge.1) print*,'thermcell_main V4' 167 195 … … 176 204 !Initialisation 177 205 ! 178 do ig=1,klon 206 ! IF (1.eq.0) THEN 207 ! do ig=1,klon 179 208 !FH/IM 130308 if ((debut).or.((.not.debut).and.(f0(ig).lt.1.e-10))) then 180 181 182 209 ! if ((.not.debut).and.(f0(ig).lt.1.e-10)) then 210 ! f0(ig)=1.e-5 211 ! zmax0(ig)=40. 183 212 !v1d therm=.false. 184 endif 185 enddo 186 213 ! endif 214 ! enddo 215 ! ENDIF !(1.eq.0) THEN 216 print*,'WARNING thermcell_main f0=max(f0,1.e-2)' 217 do ig=1,klon 218 if (prt_level.ge.20) then 219 print*,'th_main ig f0',ig,f0(ig) 220 endif 221 f0(ig)=max(f0(ig),1.e-2) 222 !IMmarche pas ?! if (f0(ig)<1.e-2) f0(ig)=1.e-2 223 enddo 187 224 188 225 !----------------------------------------------------------------------- … … 238 275 rho(:,l)=pplay(:,l)/(zpspsk(:,l)*RD*ztv(:,l)) 239 276 enddo 277 278 !IM 279 print*,'WARNING thermcell_main rhobarz(:,1)=rho(:,1)' 280 rhobarz(:,1)=rho(:,1) 240 281 241 282 do l=2,nlay … … 309 350 ! 310 351 entr_star=0. ; detr_star=0. ; alim_star=0. ; alim_star_tot=0. 311 CALL thermcell_init(ngrid,nlay,ztv,zl ev, &352 CALL thermcell_init(ngrid,nlay,ztv,zlay,zlev, & 312 353 & lalim,lmin,alim_star,alim_star_tot,lev_out) 313 354 … … 318 359 if (prt_level.ge.1) print*,'thermcell_main apres thermcell_init' 319 360 if (prt_level.ge.10) then 320 write(lunout ,*) 'Dans thermcell_main 1'321 write(lunout ,*) 'lmin ',lmin(igout)322 write(lunout ,*) 'lalim ',lalim(igout)323 write(lunout ,*) ' ig l alim_star thetav'324 write(lunout ,'(i6,i4,2e15.5)') (igout,l,alim_star(igout,l) &361 write(lunout1,*) 'Dans thermcell_main 1' 362 write(lunout1,*) 'lmin ',lmin(igout) 363 write(lunout1,*) 'lalim ',lalim(igout) 364 write(lunout1,*) ' ig l alim_star thetav' 365 write(lunout1,'(i6,i4,2e15.5)') (igout,l,alim_star(igout,l) & 325 366 & ,ztv(igout,l),l=1,lalim(igout)+4) 326 367 endif … … 346 387 if (prt_level.ge.1) print*,'thermcell_main apres thermcell_dry' 347 388 if (prt_level.ge.10) then 348 write(lunout ,*) 'Dans thermcell_main 1b'349 write(lunout ,*) 'lmin ',lmin(igout)350 write(lunout ,*) 'lalim ',lalim(igout)351 write(lunout ,*) ' ig l alim_star entr_star detr_star f_star '352 write(lunout ,'(i6,i4,e15.5)') (igout,l,alim_star(igout,l) &389 write(lunout1,*) 'Dans thermcell_main 1b' 390 write(lunout1,*) 'lmin ',lmin(igout) 391 write(lunout1,*) 'lalim ',lalim(igout) 392 write(lunout1,*) ' ig l alim_star entr_star detr_star f_star ' 393 write(lunout1,'(i6,i4,e15.5)') (igout,l,alim_star(igout,l) & 353 394 & ,l=1,lalim(igout)+4) 354 395 endif … … 360 401 !-------------------------------------------------------------------------------- 361 402 ! 362 CALL thermcell_plume(ngrid,nlay,ztv,zthl,po,zl,rhobarz, & 403 if (prt_level.ge.1) print*,'avant thermcell_plume ',lev_out 404 !IM 140508 CALL thermcell_plume(ngrid,nlay,ptimestep,ztv,zthl,po,zl,rhobarz, & 405 CALL thermcell_plume(itap,ngrid,nlay,ptimestep,ztv,zthl,po,zl,rhobarz, & 363 406 & zlev,pplev,pphi,zpspsk,l_mix,r_aspect,alim_star, & 364 407 & lalim,zmax_sec,f0,detr_star,entr_star,f_star,ztva, & 365 408 & ztla,zqla,zqta,zha,zw2,zqsatth,lmix,linter,lev_out) 409 if (prt_level.ge.1) print*,'apres thermcell_plume ',lev_out 410 366 411 call test_ltherm(ngrid,nlay,pplev,pplay,lalim,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_plum lalim ') 367 412 call test_ltherm(ngrid,nlay,pplev,pplay,lmix ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_plum lmix ') … … 369 414 if (prt_level.ge.1) print*,'thermcell_main apres thermcell_plume' 370 415 if (prt_level.ge.10) then 371 write(lunout ,*) 'Dans thermcell_main 2'372 write(lunout ,*) 'lmin ',lmin(igout)373 write(lunout ,*) 'lalim ',lalim(igout)374 write(lunout ,*) ' ig l alim_star entr_star detr_star f_star '375 write(lunout ,'(i6,i4,4e15.5)') (igout,l,alim_star(igout,l),entr_star(igout,l),detr_star(igout,l) &416 write(lunout1,*) 'Dans thermcell_main 2' 417 write(lunout1,*) 'lmin ',lmin(igout) 418 write(lunout1,*) 'lalim ',lalim(igout) 419 write(lunout1,*) ' ig l alim_star entr_star detr_star f_star ' 420 write(lunout1,'(i6,i4,4e15.5)') (igout,l,alim_star(igout,l),entr_star(igout,l),detr_star(igout,l) & 376 421 & ,f_star(igout,l+1),l=1,nint(linter(igout))+5) 377 422 endif … … 397 442 398 443 CALL thermcell_closure(ngrid,nlay,r_aspect,ptimestep,rho, & 399 & zlev,lalim,alim_star,zmax_sec,wmax_sec,zmax,wmax,f, f0,lev_out)444 & zlev,lalim,alim_star,zmax_sec,wmax_sec,zmax,wmax,f,lev_out) 400 445 401 446 if(prt_level.ge.1)print*,'thermcell_closure apres thermcell_closure' 447 448 if (tau_thermals>1.) then 449 lambda=exp(-ptimestep/tau_thermals) 450 f0=(1.-lambda)*f+lambda*f0 451 else 452 f0=f 453 endif 454 455 ! Test valable seulement en 1D mais pas genant 456 if (.not. (f0(1).ge.0.) ) then 457 stop'Dans thermcell_main' 458 endif 402 459 403 460 !------------------------------------------------------------------------------- … … 405 462 !------------------------------------------------------------------------------- 406 463 407 CALL thermcell_flux (ngrid,nlay,ptimestep,masse, &464 CALL thermcell_flux2(ngrid,nlay,ptimestep,masse, & 408 465 & lalim,lmax,alim_star, & 409 466 & entr_star,detr_star,f,rhobarz,zlev,zw2,fm,entr, & 410 & detr,zqla,zmax,lev_out,lunout,igout) 467 & detr,zqla,lev_out,lunout1,igout) 468 !IM 060508 & detr,zqla,zmax,lev_out,lunout,igout) 411 469 412 470 if (prt_level.ge.1) print*,'thermcell_main apres thermcell_flux' … … 414 472 call test_ltherm(ngrid,nlay,pplev,pplay,lmax ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_flux lmax ') 415 473 416 !c------------------------------------------------------------------ 417 ! calcul du transport vertical 418 !------------------------------------------------------------------ 419 420 if (w2di.eq.1) then 421 fm0=fm0+ptimestep*(fm-fm0)/float(tho) 422 entr0=entr0+ptimestep*(entr-entr0)/float(tho) 474 !------------------------------------------------------------------ 475 ! On ne prend pas directement les profils issus des calculs precedents 476 ! mais on s'autorise genereusement une relaxation vers ceci avec 477 ! une constante de temps tau_thermals (typiquement 1800s). 478 !------------------------------------------------------------------ 479 480 if (tau_thermals>1.) then 481 lambda=exp(-ptimestep/tau_thermals) 482 fm0=(1.-lambda)*fm+lambda*fm0 483 entr0=(1.-lambda)*entr+lambda*entr0 484 ! detr0=(1.-lambda)*detr+lambda*detr0 423 485 else 424 486 fm0=fm … … 426 488 detr0=detr 427 489 endif 490 491 !c------------------------------------------------------------------ 492 ! calcul du transport vertical 493 !------------------------------------------------------------------ 428 494 429 495 call thermcell_dq(ngrid,nlay,ptimestep,fm0,entr0,masse, & … … 453 519 !------------------------------------------------------------------ 454 520 521 !IM 090508 455 522 if (1.eq.1) then 523 !IM 070508 vers. _dq 524 ! if (1.eq.0) then 456 525 457 526 … … 461 530 call thermcell_dv2(ngrid,nlay,ptimestep,fm0,entr0,masse & 462 531 & ,fraca,zmax & 463 & ,zu,zv,pduadj,pdvadj,zua,zva,igout,lev_out) 532 & ,zu,zv,pduadj,pdvadj,zua,zva,lev_out) 533 !IM 050508 & ,zu,zv,pduadj,pdvadj,zua,zva,igout,lev_out) 464 534 else 465 535 … … 478 548 enddo 479 549 480 !print*,'14 OK convect8'550 if (prt_level.ge.1) print*,'14 OK convect8' 481 551 !------------------------------------------------------------------ 482 552 ! Calculs de diagnostiques pour les sorties … … 485 555 486 556 if (sorties) then 487 !print*,'14a OK convect8'557 if (prt_level.ge.1) print*,'14a OK convect8' 488 558 ! calcul du niveau de condensation 489 559 ! initialisation … … 505 575 enddo 506 576 enddo 507 !print*,'14b OK convect8'577 if (prt_level.ge.1) print*,'14b OK convect8' 508 578 do k=nlay,1,-1 509 579 do ig=1,ngrid … … 514 584 enddo 515 585 enddo 516 !print*,'14c OK convect8'586 if (prt_level.ge.1) print*,'14c OK convect8' 517 587 !calcul des moments 518 588 !initialisation … … 526 596 enddo 527 597 enddo 528 ! print*,'14d OK convect8' 598 if (prt_level.ge.1) print*,'14d OK convect8' 599 print*,'WARNING thermcell_main wth2=0. si zw2 > 1.e-10' 529 600 do l=1,nlay 530 601 do ig=1,ngrid 531 602 zf=fraca(ig,l) 532 603 zf2=zf/(1.-zf) 604 ! 605 if (prt_level.ge.10) print*,'14e OK convect8 ig,l,zf,zf2',ig,l,zf,zf2 606 ! 607 if (prt_level.ge.10) print*,'14f OK convect8 ig,l,zha zh zpspsk ',ig,l,zha(ig,l),zh(ig,l),zpspsk(ig,l) 533 608 thetath2(ig,l)=zf2*(zha(ig,l)-zh(ig,l)/zpspsk(ig,l))**2 534 wth2(ig,l)=zf2*(zw2(ig,l))**2 609 if(zw2(ig,l).gt.1.e-10) then 610 wth2(ig,l)=zf2*(zw2(ig,l))**2 611 else 612 wth2(ig,l)=0. 613 endif 535 614 ! print*,'wth2=',wth2(ig,l) 536 615 wth3(ig,l)=zf2*(1-2.*fraca(ig,l))/(1-fraca(ig,l)) & 537 616 & *zw2(ig,l)*zw2(ig,l)*zw2(ig,l) 617 if (prt_level.ge.10) print*,'14g OK convect8 ig,l,po',ig,l,po(ig,l) 538 618 q2(ig,l)=zf2*(zqta(ig,l)*1000.-po(ig,l)*1000.)**2 539 619 !test: on calcul q2/po=ratqsc … … 548 628 n_int(ig)=0 549 629 enddo 550 do ig=1,ngrid 551 ! do l=nivcon(ig),lmax(ig) 552 do l=1,lmax(ig) 553 alp_int(ig)=alp_int(ig)+0.5*rhobarz(ig,l)*wth3(ig,l) 554 ale_int(ig)=ale_int(ig)+0.5*zw2(ig,l)**2 555 n_int(ig)=n_int(ig)+1 630 ! 631 do l=1,nlay 632 do ig=1,ngrid 633 if(l.LE.lmax(ig)) THEN 634 alp_int(ig)=alp_int(ig)+0.5*rhobarz(ig,l)*wth3(ig,l) 635 ale_int(ig)=ale_int(ig)+0.5*zw2(ig,l)**2 636 n_int(ig)=n_int(ig)+1 637 endif 556 638 enddo 557 639 enddo … … 638 720 639 721 !calcul du ratqscdiff 640 !print*,'14e OK convect8'722 if (prt_level.ge.1) print*,'14e OK convect8' 641 723 var=0. 642 724 vardiff=0. … … 647 729 enddo 648 730 enddo 649 !print*,'14f OK convect8'731 if (prt_level.ge.1) print*,'14f OK convect8' 650 732 do ig=1,ngrid 651 733 do l=1,lalim(ig) … … 658 740 enddo 659 741 enddo 660 !print*,'14g OK convect8'742 if (prt_level.ge.1) print*,'14g OK convect8' 661 743 do l=1,nlay 662 744 do ig=1,ngrid … … 679 761 680 762 681 ! #define troisD 763 #define troisD 764 #undef troisD 682 765 if (prt_level.ge.1) print*,'thermcell_main sorties 3D' 683 766 #ifdef troisD … … 689 772 if (prt_level.ge.1) print*,'thermcell_main FIN OK' 690 773 774 ! if(icount.eq.501) stop'au pas 301 dans thermcell_main' 691 775 return 692 776 end … … 717 801 ! test sur la hauteur des thermiques ... 718 802 do i=1,klon 719 if (pplay(i,long(i)).lt.seuil*pplev(i,1)) then 803 !IMtemp if (pplay(i,long(i)).lt.seuil*pplev(i,1)) then 804 if (prt_level.ge.10) then 720 805 print*,'WARNING ',comment,' au point ',i,' K= ',long(i) 721 806 print*,' K P(MB) THV(K) Qenv(g/kg)THVA QLA(g/kg) F* W2' … … 724 809 enddo 725 810 ! stop 726 811 endif 727 812 enddo 728 813 -
LMDZ4/trunk/libf/phylmd/thermcell_plume.F90
r938 r972 1 SUBROUTINE thermcell_plume( ngrid,klev,ztv,zthl,po,zl,rhobarz, &1 SUBROUTINE thermcell_plume(itap,ngrid,klev,ptimestep,ztv,zthl,po,zl,rhobarz, & 2 2 & zlev,pplev,pphi,zpspsk,l_mix,r_aspect,alim_star, & 3 3 & lalim,zmax_sec,f0,detr_star,entr_star,f_star,ztva, & … … 15 15 #include "iniprint.h" 16 16 17 INTEGER itap 18 17 19 INTEGER ngrid,klev 20 REAL ptimestep 18 21 REAL ztv(ngrid,klev) 19 22 REAL zthl(ngrid,klev) … … 32 35 INTEGER lalim(ngrid) 33 36 integer lev_out ! niveau pour les print 37 real zcon2(ngrid) 34 38 35 39 REAL ztva(ngrid,klev) 36 40 REAL ztla(ngrid,klev) 37 41 REAL zqla(ngrid,klev) 42 REAL zqla0(ngrid,klev) 38 43 REAL zqta(ngrid,klev) 39 44 REAL zha(ngrid,klev) 40 45 41 46 REAL detr_star(ngrid,klev) 47 REAL coefc 48 REAL detr_stara(ngrid,klev) 49 REAL detr_starb(ngrid,klev) 50 REAL detr_starc(ngrid,klev) 51 REAL detr_star0(ngrid,klev) 52 REAL detr_star1(ngrid,klev) 53 REAL detr_star2(ngrid,klev) 54 42 55 REAL entr_star(ngrid,klev) 56 REAL entr_star1(ngrid,klev) 57 REAL entr_star2(ngrid,klev) 43 58 REAL detr(ngrid,klev) 44 59 REAL entr(ngrid,klev) … … 55 70 REAL linter(ngrid) 56 71 INTEGER lmix(ngrid) 72 INTEGER lmix_bis(ngrid) 57 73 REAL wmaxa(ngrid) 58 74 … … 85 101 zqla(ig,k)=0. 86 102 zqta(ig,k)=po(ig,k) 103 ! 104 ztva(ig,k) = ztla(ig,k)*zpspsk(ig,k)+RLvCp*zqla(ig,k) 105 ztva(ig,k) = ztva(ig,k)/zpspsk(ig,k) 106 zha(ig,k) = ztva(ig,k) 107 ! 87 108 enddo 88 109 enddo … … 91 112 detr_star(ig,k)=0. 92 113 entr_star(ig,k)=0. 114 115 detr_stara(ig,k)=0. 116 detr_starb(ig,k)=0. 117 detr_starc(ig,k)=0. 118 detr_star0(ig,k)=0. 119 zqla0(ig,k)=0. 120 detr_star1(ig,k)=0. 121 detr_star2(ig,k)=0. 122 entr_star1(ig,k)=0. 123 entr_star2(ig,k)=0. 124 93 125 detr(ig,k)=0. 94 126 entr(ig,k)=0. … … 117 149 do l=1,klev-1 118 150 do ig=1,ngrid 151 152 153 154 ! Calcul dans la premiere couche active du thermique (ce qu'on teste 155 ! en disant que la couche est instable et que w2 en bas de la couche 156 ! est nulle. 157 119 158 if (ztv(ig,l).gt.ztv(ig,l+1) & 120 159 & .and.alim_star(ig,l).gt.1.e-10 & 121 160 & .and.zw2(ig,l).lt.1e-10) then 161 162 163 ! Le panache va prendre au debut les caracteristiques de l'air contenu 164 ! dans cette couche. 122 165 ztla(ig,l)=zthl(ig,l) 123 166 zqta(ig,l)=po(ig,l) 124 167 zqla(ig,l)=zl(ig,l) 125 168 f_star(ig,l+1)=alim_star(ig,l) 169 126 170 zw2(ig,l+1)=2.*RG*(ztv(ig,l)-ztv(ig,l+1))/ztv(ig,l+1) & 127 171 & *(zlev(ig,l+1)-zlev(ig,l)) & … … 129 173 w_est(ig,l+1)=zw2(ig,l+1) 130 174 ! 175 176 131 177 else if ((zw2(ig,l).ge.1e-10).and. & 132 178 & (f_star(ig,l)+alim_star(ig,l)).gt.1.e-10) then … … 147 193 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 148 194 195 196 197 ! Premier calcul de la vitesse verticale a partir de la temperature 198 ! potentielle virtuelle 199 200 ! FH CESTQUOI CA ???? 201 #define int1d2 202 !#undef int1d2 203 #ifdef int1d2 204 if (l.ge.2) then 205 #else 149 206 if (l.gt.2) then 207 #endif 208 209 if (1.eq.1) then 150 210 w_est(ig,3)=zw2(ig,2)* & 151 211 & ((f_star(ig,2))**2) & … … 153 213 & 2.*RG*(ztva(ig,2)-ztv(ig,2))/ztv(ig,2) & 154 214 & *(zlev(ig,3)-zlev(ig,2)) 215 endif 155 216 156 217 … … 160 221 ! 161 222 !test:estimation de ztva_new_est sans entrainement 223 162 224 Tbef=ztla(ig,l-1)*zpspsk(ig,l) 163 225 zdelta=MAX(0.,SIGN(1.,RTT-Tbef)) … … 204 266 ! 205 267 !calcul du detrainement 268 !======================= 269 270 271 ! Modifications du calcul du detrainement. 272 ! Dans la version de la these de Catherine, on passe brusquement 273 ! de la version seche a la version nuageuse pour le detrainement 274 ! ce qui peut occasioner des oscillations. 275 ! dans la nouvelle version, on commence par calculer un detrainement sec. 276 ! Puis un autre en cas de nuages. 277 ! Puis on combine les deux lineairement en fonction de la quantite d'eau. 278 279 #define int1d3 280 !#undef int1d3 281 #define RIO_TH 282 #ifdef RIO_TH 283 !1. Cas non nuageux 284 ! 1.1 on est sous le zmax_sec et w croit 206 285 if ((w_est(ig,l+1).gt.w_est(ig,l)).and. & 207 286 & (zlev(ig,l+1).lt.zmax_sec(ig)).and. & 287 #ifdef int1d3 288 & (zqla_est(ig,l).lt.1.e-10)) then 289 #else 208 290 & (zqla(ig,l-1).lt.1.e-10)) then 291 #endif 209 292 detr_star(ig,l)=MAX(0.,(rhobarz(ig,l+1) & 210 293 & *sqrt(w_est(ig,l+1))*sqrt(l_mix*zlev(ig,l+1)) & 211 294 & -rhobarz(ig,l)*sqrt(w_est(ig,l))*sqrt(l_mix*zlev(ig,l))) & 212 295 & /(r_aspect*zmax_sec(ig))) 213 if (prt_level.ge.20) print*,'coucou calcul detr 1' 296 detr_stara(ig,l)=detr_star(ig,l) 297 298 if (prt_level.ge.20) print*,'coucou calcul detr 1: ig, l',ig,l 299 300 ! 1.2 on est sous le zmax_sec et w decroit 214 301 else if ((zlev(ig,l+1).lt.zmax_sec(ig)).and. & 302 #ifdef int1d3 303 & (zqla_est(ig,l).lt.1.e-10)) then 304 #else 215 305 & (zqla(ig,l-1).lt.1.e-10)) then 306 #endif 216 307 detr_star(ig,l)=-f0(ig)*f_star(ig,lmix(ig)) & 217 308 & /(rhobarz(ig,lmix(ig))*wmaxa(ig))* & … … 222 313 & *((zmax_sec(ig)-zlev(ig,l))/ & 223 314 & ((zmax_sec(ig)-zlev(ig,lmix(ig)))))**2.) 224 if (prt_level.ge.20) print*,'coucou calcul detr 2' 315 detr_starb(ig,l)=detr_star(ig,l) 316 317 if (prt_level.ge.20) print*,'coucou calcul detr 2: ig, l',ig,l 318 225 319 else 320 321 ! 1.3 dans les autres cas 226 322 detr_star(ig,l)=0.002*f0(ig)*f_star(ig,l) & 227 323 & *(zlev(ig,l+1)-zlev(ig,l)) 228 if (prt_level.ge.20) print*,'coucou calcul detr 3' 324 detr_starc(ig,l)=detr_star(ig,l) 325 326 if (prt_level.ge.20) print*,'coucou calcul detr 3 n: ig, l',ig, l 229 327 230 328 endif 231 detr_star(ig,l)=detr_star(ig,l)/f0(ig) 329 330 #else 331 332 ! 1.1 on est sous le zmax_sec et w croit 333 if ((w_est(ig,l+1).gt.w_est(ig,l)).and. & 334 & (zlev(ig,l+1).lt.zmax_sec(ig)) ) then 335 detr_star(ig,l)=MAX(0.,(rhobarz(ig,l+1) & 336 & *sqrt(w_est(ig,l+1))*sqrt(l_mix*zlev(ig,l+1)) & 337 & -rhobarz(ig,l)*sqrt(w_est(ig,l))*sqrt(l_mix*zlev(ig,l))) & 338 & /(r_aspect*zmax_sec(ig))) 339 340 if (prt_level.ge.20) print*,'coucou calcul detr 1: ig, l', ig, l 341 342 ! 1.2 on est sous le zmax_sec et w decroit 343 else if ((zlev(ig,l+1).lt.zmax_sec(ig)) ) then 344 detr_star(ig,l)=-f0(ig)*f_star(ig,lmix(ig)) & 345 & /(rhobarz(ig,lmix(ig))*wmaxa(ig))* & 346 & (rhobarz(ig,l+1)*sqrt(w_est(ig,l+1)) & 347 & *((zmax_sec(ig)-zlev(ig,l+1))/ & 348 & ((zmax_sec(ig)-zlev(ig,lmix(ig)))))**2. & 349 & -rhobarz(ig,l)*sqrt(w_est(ig,l)) & 350 & *((zmax_sec(ig)-zlev(ig,l))/ & 351 & ((zmax_sec(ig)-zlev(ig,lmix(ig)))))**2.) 352 if (prt_level.ge.20) print*,'coucou calcul detr 1: ig, l', ig, l 353 354 else 355 detr_star=0. 356 endif 357 358 ! 1.3 dans les autres cas 359 detr_starc(ig,l)=0.002*f0(ig)*f_star(ig,l) & 360 & *(zlev(ig,l+1)-zlev(ig,l)) 361 362 coefc=min(zqla(ig,l-1)/1.e-3,1.) 363 if (zlev(ig,l+1).ge.zmax_sec(ig)) coefc=1. 364 coefc=1. 365 ! il semble qu'il soit important de baser le calcul sur 366 ! zqla_est(ig,l-1) plutot que sur zqla_est(ig,l) 367 detr_star(ig,l)=detr_starc(ig,l)*coefc+detr_star(ig,l)*(1.-coefc) 368 369 if (prt_level.ge.20) print*,'coucou calcul detr 2: ig, l', ig, l 370 371 #endif 372 373 374 if (prt_level.ge.20) print*,'coucou calcul detr 444: ig, l', ig, l 375 !IM 730508 beg 376 ! if(itap.GE.7200) THEN 377 ! print*,'th_plume ig,l,itap,zqla_est=',ig,l,itap,zqla_est(ig,l) 378 ! endif 379 !IM 730508 end 380 381 zqla0(ig,l)=zqla_est(ig,l) 382 detr_star0(ig,l)=detr_star(ig,l) 383 !IM 060508 beg 384 ! if(detr_star(ig,l).GT.1.) THEN 385 ! print*,'th_plumeBEF ig l detr_star detr_starc coefc',ig,l,detr_star(ig,l) & 386 ! & ,detr_starc(ig,l),coefc 387 ! endif 388 !IM 060508 end 389 !IM 160508 beg 390 !IM 160508 IF (f0(ig).NE.0.) THEN 391 detr_star(ig,l)=detr_star(ig,l)/f0(ig) 392 !IM 160508 ELSE IF(detr_star(ig,l).EQ.0.) THEN 393 !IM 160508 print*,'WARNING1 : th_plume f0=0, detr_star=0: ig, l, itap',ig,l,itap 394 !IM 160508 ELSE 395 !IM 160508 print*,'WARNING2 : th_plume f0=0, ig, l, itap, detr_star',ig,l,itap,detr_star(ig,l) 396 !IM 160508 ENDIF 397 !IM 160508 end 398 !IM 060508 beg 399 ! if(detr_star(ig,l).GT.1.) THEN 400 ! print*,'th_plumeAFT ig l detr_star f0 1/f0',ig,l,detr_star(ig,l),f0(ig), & 401 ! & float(1)/f0(ig) 402 ! endif 403 !IM 060508 end 404 if (prt_level.ge.20) print*,'coucou calcul detr 445: ig, l', ig, l 232 405 ! 233 406 !calcul de entr_star 407 408 ! #undef test2 409 ! #ifdef test2 410 ! La version test2 destabilise beaucoup le modele. 411 ! Il semble donc que ca aide d'avoir un entrainement important sous 412 ! le nuage. 413 ! if (zqla_est(ig,l-1).ge.1.e-10.and.l.gt.lalim(ig)) then 414 ! entr_star(ig,l)=0.4*detr_star(ig,l) 415 ! else 416 ! entr_star(ig,l)=0. 417 ! endif 418 ! #else 234 419 ! 235 420 ! Deplacement du calcul de entr_star pour eviter d'avoir aussi … … 237 422 ! Redeplacer suite a la transformation du cas detr>f 238 423 ! FH 424 425 if (prt_level.ge.20) print*,'coucou calcul detr 446: ig, l', ig, l 426 #define int1d 427 !FH 070508 #define int1d4 428 !#undef int1d4 429 ! L'option int1d4 correspond au choix dans le cas ou le detrainement 430 ! devient trop grand. 431 432 #ifdef int1d 433 434 #ifdef int1d4 435 #else 436 detr_star(ig,l)=min(detr_star(ig,l),f_star(ig,l)) 437 !FH 070508 plus 438 detr_star(ig,l)=min(detr_star(ig,l),1.) 439 #endif 440 441 entr_star(ig,l)=max(0.4*detr_star(ig,l)-alim_star(ig,l),0.) 442 443 if (prt_level.ge.20) print*,'coucou calcul detr 447: ig, l', ig, l 444 #ifdef int1d4 445 ! Si le detrainement excede le flux en bas + l'entrainement, le thermique 446 ! doit disparaitre. 447 if (detr_star(ig,l)>f_star(ig,l)+entr_star(ig,l)) then 448 detr_star(ig,l)=f_star(ig,l)+entr_star(ig,l) 449 f_star(ig,l+1)=0. 450 linter(ig)=l+1 451 zw2(ig,l+1)=-1.e-10 452 endif 453 #endif 454 455 456 #else 457 458 if (prt_level.ge.20) print*,'coucou calcul detr 448: ig, l', ig, l 239 459 if(l.gt.lalim(ig)) then 240 460 entr_star(ig,l)=0.4*detr_star(ig,l) … … 249 469 ! d* non nul) on a une discontinuité de e* ou d* en haut de la couche 250 470 ! d'alimentation, ce qui n'est pas forcement heureux. 471 472 if (prt_level.ge.20) print*,'coucou calcul detr 449: ig, l', ig, l 473 #undef pre_int1c 474 #ifdef pre_int1c 251 475 entr_star(ig,l)=max(detr_star(ig,l)-alim_star(ig,l),0.) 252 476 detr_star(ig,l)=entr_star(ig,l) 477 #else 478 entr_star(ig,l)=0. 479 #endif 480 253 481 endif 254 482 255 ! 483 #endif 484 485 if (prt_level.ge.20) print*,'coucou calcul detr 440: ig, l', ig, l 486 entr_star1(ig,l)=entr_star(ig,l) 487 detr_star1(ig,l)=detr_star(ig,l) 488 ! 489 490 #ifdef int1d 491 #else 256 492 if (detr_star(ig,l).gt.f_star(ig,l)) then 257 493 … … 261 497 262 498 detr_star(ig,l)=f_star(ig,l) 499 #ifdef pre_int1c 263 500 if (l.gt.lalim(ig)+1) then 264 501 entr_star(ig,l)=0. … … 269 506 linter(ig)=l+1 270 507 else 271 entr_star(ig,l)= detr_star(ig,l)508 entr_star(ig,l)=0.4*detr_star(ig,l) 272 509 endif 510 #else 511 entr_star(ig,l)=0.4*detr_star(ig,l) 512 #endif 273 513 endif 274 275 else 514 #endif 515 516 else !l > 2 276 517 detr_star(ig,l)=0. 277 518 entr_star(ig,l)=0. 278 519 endif 520 521 entr_star2(ig,l)=entr_star(ig,l) 522 detr_star2(ig,l)=detr_star(ig,l) 523 if (prt_level.ge.20) print*,'coucou calcul detr 450: ig, l', ig, l 279 524 280 525 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 292 537 293 538 !test sur le signe de f_star 539 if (prt_level.ge.20) print*,'coucou calcul detr 451: ig, l', ig, l 294 540 if (f_star(ig,l+1).gt.1.e-10) then 295 541 !---------------------------------------------------------------------------- … … 336 582 endif 337 583 ! 584 if (prt_level.ge.20) print*,'coucou calcul detr 4512: ig, l', ig, l 338 585 ! on ecrit de maniere conservative (sat ou non) 339 586 ! T = Tl +Lv/Cp ql … … 356 603 endif 357 604 endif 605 if (prt_level.ge.20) print*,'coucou calcul detr 460: ig, l',ig, l 358 606 ! 359 607 !initialisations pour le calcul de la hauteur du thermique, de l'inversion et de la vitesse verticale max … … 383 631 enddo 384 632 633 if (prt_level.ge.20) print*,'coucou calcul detr 470: ig, l', ig, l 634 #ifdef troisD 635 call wrgradsfi(1,klev,zqla_est,'ql_es ','ql_es ') 636 call wrgradsfi(1,klev,entr_star1,'e_st1 ','e_st1 ') 637 call wrgradsfi(1,klev,entr_star2,'e_st2 ','e_st2 ') 638 call wrgradsfi(1,klev,detr_stara,'d_sta ','d_sta ') 639 call wrgradsfi(1,klev,detr_starb,'d_stb ','d_stb ') 640 call wrgradsfi(1,klev,detr_starc,'d_stc ','d_stc ') 641 call wrgradsfi(1,klev,zqla0 ,'zqla0 ','zqla0 ') 642 call wrgradsfi(1,klev,detr_star0,'d_st0 ','d_st0 ') 643 call wrgradsfi(1,klev,detr_star1,'d_st1 ','d_st1 ') 644 call wrgradsfi(1,klev,detr_star2,'d_st2 ','d_st2 ') 645 #endif 646 647 ! print*,'thermcell_plume OK' 385 648 386 649 return
Note: See TracChangeset
for help on using the changeset viewer.