Changeset 268 for trunk/LMDZ.MARS/libf/phymars/surflayer_interpol.F
- Timestamp:
- Aug 16, 2011, 11:06:45 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/surflayer_interpol.F
r267 r268 5 5 ! 6 6 ! Subject: interpolation of temperature and velocity norm in the surface layer 7 ! by recomputation of surface layer quantities (Richardson, Prandtl, u*, teta*)7 ! by recomputation of surface layer quantities (Richardson, Prandtl, Reynolds, u*, teta*) 8 8 ! ------- 9 9 ! … … 42 42 REAL, INTENT(IN) :: wmax(ngrid) 43 43 REAL, INTENT(IN) :: pts(ngrid),ph(ngrid,nlay) 44 REAL, INTENT(INOUT) :: z_out 45 REAL, INTENT(OUT) :: Teta_out(ngrid),u_out(ngrid) 44 REAL, INTENT(INOUT) :: z_out ! output height (in m above surface) 45 REAL, INTENT(OUT) :: Teta_out(ngrid),u_out(ngrid)! interpolated fields at z_out : potential temperature and norm(uv) 46 46 REAL, INTENT(OUT) :: ustar(ngrid), tstar(ngrid) ! u* and teta* 47 47 … … 79 79 ! For output : 80 80 81 REAL zu2 ! Large-scale wind at first layer81 REAL zu2(ngrid) ! Large-scale wind at first layer 82 82 REAL L_mo(ngrid) ! Monin-Obukhov length 83 83 !----------------------------------------------------------------------- … … 88 88 ustar(:)=0. 89 89 reynolds(:)=0. 90 91 ! Original formulation :92 93 ! DO ig=1,ngrid94 ! z1=1.E+0 + pz(ig,1)/pz0(ig)95 ! zcd0=karman/log(z1)96 ! zcd0=zcd0*zcd097 ! pcdv(ig)=zcd098 ! pcdh(ig)=zcd099 ! ENDDO100 101 ! print*,'old : cd,ch; ',pcdv,pcdh102 90 103 91 ! New formulation (AC) : … … 141 129 ! Richardson number formulation proposed by D.E. England et al. (1995) 142 130 131 ! IF((pu(ig,1)*pu(ig,1) + pv(ig,1)*pv(ig,1) .lt. 1.) 132 ! & .and. (wmax(ig) .gt. 0.)) THEN 133 zu2(ig)= 134 ! & (MAX(pu(ig,1)*pu(ig,1) + pv(ig,1)*pv(ig,1),wmax(ig)**2)) 135 & ( pu(ig,1)*pu(ig,1) + pv(ig,1)*pv(ig,1) + wmax(ig)**2) 136 ! & pu(ig,1)*pu(ig,1) + pv(ig,1)*pv(ig,1) 137 ! ELSE 138 ! zu2(ig)=pu(ig,1)*pu(ig,1) + pv(ig,1)*pv(ig,1) 139 ! ENDIF 140 143 141 rib(ig) = (pg/ph(ig,1)) 144 & *pz(ig,1)*pz0(ig)/sqrt(pz(ig,1)*pz0t)145 !& *sqrt(pz(ig,1)*pz0(ig))142 ! & *pz(ig,1)*pz0(ig)/sqrt(pz(ig,1)*pz0t) 143 & *sqrt(pz(ig,1)*pz0(ig)) 146 144 & *(((log(pz(ig,1)/pz0(ig)))**2)/(log(pz(ig,1)/pz0t))) 147 & *(ph(ig,1)-pts(ig)) 148 & /(pu(ig,1)*pu(ig,1) + pv(ig,1)*pv(ig,1)) 145 & *(ph(ig,1)-pts(ig))/zu2(ig) 146 147 ! & /(MAX(pu(ig,1)*pu(ig,1) + pv(ig,1)*pv(ig,1),wmax(ig)**2)) 148 ! & /( pu(ig,1)*pu(ig,1) + pv(ig,1)*pv(ig,1) + wmax(ig)**2) 149 149 150 150 else … … 208 208 ENDDO 209 209 210 ! Large-scale wind at first layer (with gustiness) and210 ! Large-scale wind at first layer (without gustiness) and 211 211 ! u* theta* computation 212 212 DO ig=1,ngrid … … 216 216 tstar(ig)=0. 217 217 else 218 zu2=pu(ig,1)*pu(ig,1)+pv(ig,1)*pv(ig,1)+(0.*wmax(ig))**2 219 ustar(ig)=karman*sqrt(fm(ig)*zu2)/(log(pz(ig,1)/pz0(ig))) 220 tstar(ig)=karman*fh(ig)*(ph(ig,1)-pts(ig)) 221 & /(log(pz(ig,1)/pz0tcomp(ig))*sqrt(fm(ig))) 218 219 ! ustar(ig)=karman*sqrt(fm(ig)*zu2(ig))/(log(pz(ig,1)/pz0(ig))) 220 ! tstar(ig)=karman*fh(ig)*(ph(ig,1)-pts(ig)) 221 ! & /(log(pz(ig,1)/pz0tcomp(ig))*sqrt(fm(ig))) 222 223 !simpler definition of u* and teta*, equivalent to the formula above : 224 225 ustar(ig)=sqrt(pcdv(ig))*sqrt(zu2(ig)) 226 tstar(ig)=-pcdh(ig)*(pts(ig)-ph(ig,1))/sqrt(pcdv(ig)) 227 228 if (tstar(ig) .lt. -50) then 229 print*, fh(ig),rib(ig),(ph(ig,1)-pts(ig)) 230 & ,log(pz(ig,1)/pz0tcomp(ig)),sqrt(fm(ig)) 231 endif 222 232 endif 223 233 ENDDO … … 233 243 ENDDO 234 244 245 DO ig=1,ngrid 235 246 IF(z_out .ge. pz(ig,1)) THEN 236 247 z_out=1. … … 252 263 & and computation is resumed' 253 264 ENDIF 254 265 ENDDO 255 266 256 267 print*, 'interpolation of u and teta at z_out=',z_out … … 265 276 & *(z_out-pz0tcomp(ig)) 266 277 ELSEIF (L_mo(ig) .lt. 0.) THEN 267 u_out(ig)=(ustar(ig)/karman)*(( 278 279 IF(L_mo(ig) .gt. -1000.) THEN 280 281 u_out(ig)=(ustar(ig)/karman)*( 268 282 & 2.*atan((1.-16.*z_out/L_mo(ig))**0.25) 269 & +log((-1.+(1.-16.*z_out/L_mo(ig))**0.25) 270 & /(-1.+(1.-16.*z_out/L_mo(ig))**0.25)))-( 271 & 2.*atan((1.-16.*pz0(ig)/L_mo(ig))**0.25) 272 & +log((-1.+(1.-16.*pz0(ig)/L_mo(ig))**0.25) 273 & /(-1.+(1.-16.*pz0(ig)/L_mo(ig))**0.25))) 283 & -2.*atan((1.-16.*pz0(ig)/L_mo(ig))**0.25) 284 & -2.*log(1.+(1.-16.*z_out/L_mo(ig))**0.25) 285 & +2.*log(1.+(1.-16.*pz0(ig)/L_mo(ig))**0.25) 286 & - log(1.+sqrt(1.-16.*z_out/L_mo(ig))) 287 & + log(1.+sqrt(1.-16.*pz0(ig)/L_mo(ig))) 288 & + log(z_out/pz0(ig)) 274 289 & ) 275 Teta_out(ig)=pts(ig)+(tstar(ig)/(prandtl(ig)*karman))*(( 276 & log((-1.+sqrt(1.-16.*z_out/L_mo(ig)))277 & /(1.+sqrt(1.-16.*z_out/L_mo(ig)))))-(278 & log((-1.+sqrt(1.-16.*pz0tcomp(ig)/L_mo(ig)))279 & /(1.+sqrt(1.-16.*pz0tcomp(ig)/L_mo(ig)))))290 291 Teta_out(ig)=pts(ig)+(tstar(ig)/(prandtl(ig)*karman))*( 292 & 2.*log(1.+sqrt(1.-16.*pz0tcomp(ig)/L_mo(ig))) 293 & -2.*log(1.+sqrt(1.-16.*z_out/L_mo(ig))) 294 & + log(z_out/pz0tcomp(ig)) 280 295 & ) 296 297 ELSE 298 299 ! We have to treat the case where L is very large and negative, 300 ! corresponding to a very nearly stable atmosphere (but not quite !) 301 ! i.e. teta* <0 and almost zero. We choose the cutoff 302 ! corresponding to L_mo < -1000 and use a 3rd order taylor expansion. The difference 303 ! between the two expression for z/L = -1/1000 is -1.54324*10^-9 304 ! (we do that to avoid using r*4 precision, otherwise, we get -inf values) 305 306 u_out(ig)=(ustar(ig)/karman)*( 307 & (4./L_mo(ig))*(z_out-pz0(ig)) 308 & + (20./(L_mo(ig))**2)*(z_out**2-pz0(ig)**2) 309 & + (160./(L_mo(ig))**3)*(z_out**3-pz0(ig)**3) 310 & + log(z_out/pz0(ig)) 311 & ) 312 313 Teta_out(ig)=pts(ig)+(tstar(ig)/(prandtl(ig)*karman))*( 314 & (8./L_mo(ig))*(z_out-pz0tcomp(ig)) 315 & + (48./(L_mo(ig))**2)*(z_out**2-pz0tcomp(ig)**2) 316 & + (1280./(3.*(L_mo(ig))**3))*(z_out**3-pz0tcomp(ig)**3) 317 & + log(z_out/pz0tcomp(ig)) 318 & ) 319 320 ENDIF 281 321 ELSE 282 322 u_out(ig)=0. 283 Teta_out(ig)= 0.323 Teta_out(ig)=pts(ig) 284 324 ENDIF 285 325 ENDDO 326 327 ! Usefull diagnostics for the interpolation routine : 286 328 287 329 call WRITEDIAGFI(ngrid,'L',
Note: See TracChangeset
for help on using the changeset viewer.