Ignore:
Timestamp:
Aug 16, 2011, 11:06:45 AM (13 years ago)
Author:
acolaitis
Message:

--- AC 03/08/2011 ---
M 267 libf/phymars/physiq.F
<> Minor modification to pass Ch from vdifc to meso_inc_les

M 267 libf/phymars/surflayer_interpol.F
<> Major modification to the formulation of integrals

Now stable for most cases. Some cases with highly negative Monin Obukhov length
remain to be explored.

M 267 libf/phymars/vdif_cd.F
<> Added gustiness to the Richardson computation. Gustiness factor is for now of beta=1., after

several comparisons with LES aerodynamic conductances. May be subject to a minor change (+/- 0.1)
in the near future. (almost transparent for the user)

M 267 libf/phymars/vdifc.F
<> Minor modifications relative to variables.

M 267 libf/phymars/calltherm_mars.F90
<> Added a comment on a "sensitive" parameter that should not be changed without knowing the consequence !

M 267 libf/phymars/meso_inc/meso_inc_les.F
<> Changed the definition for HFX computation in the LES (to be discussed with Aymeric). New definition yields

very similar results to old one and follows a strict definition of what HFX should be.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/phymars/surflayer_interpol.F

    r267 r268  
    55!
    66!   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*)
    88!   ------- 
    99!
     
    4242      REAL, INTENT(IN) :: wmax(ngrid)
    4343      REAL, INTENT(IN) :: pts(ngrid),ph(ngrid,nlay)
    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)
     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)
    4646      REAL, INTENT(OUT) :: ustar(ngrid), tstar(ngrid) ! u* and teta*
    4747
     
    7979! For output :
    8080
    81       REAL zu2                 ! Large-scale wind at first layer
     81      REAL zu2(ngrid)                  ! Large-scale wind at first layer
    8282      REAL L_mo(ngrid)                ! Monin-Obukhov length
    8383!-----------------------------------------------------------------------
     
    8888      ustar(:)=0.
    8989      reynolds(:)=0.
    90 
    91 ! Original formulation :
    92 
    93 !      DO ig=1,ngrid
    94 !         z1=1.E+0 + pz(ig,1)/pz0(ig)
    95 !         zcd0=karman/log(z1)
    96 !         zcd0=zcd0*zcd0
    97 !         pcdv(ig)=zcd0
    98 !         pcdh(ig)=zcd0
    99 !      ENDDO
    100 
    101 !      print*,'old : cd,ch; ',pcdv,pcdh
    10290
    10391! New formulation (AC) :
     
    141129! Richardson number formulation proposed by D.E. England et al. (1995)
    142130
     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
    143141          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))
    146144     &      *(((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)
    149149
    150150         else
     
    208208      ENDDO
    209209
    210 ! Large-scale wind at first layer (with gustiness) and
     210! Large-scale wind at first layer (without gustiness) and
    211211! u* theta* computation
    212212      DO ig=1,ngrid
     
    216216           tstar(ig)=0.
    217217         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
    222232         endif
    223233      ENDDO
     
    233243      ENDDO
    234244
     245      DO ig=1,ngrid
    235246      IF(z_out .ge. pz(ig,1)) THEN
    236247           z_out=1.
     
    252263     &                  and computation is resumed'
    253264      ENDIF
    254 
     265      ENDDO
    255266
    256267      print*, 'interpolation of u and teta at z_out=',z_out
     
    265276     &                            *(z_out-pz0tcomp(ig))
    266277        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)*(
    268282     &  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))
    274289     &                                  )
    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))
    280295     &                                                        )
     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
    281321        ELSE
    282322           u_out(ig)=0.
    283            Teta_out(ig)=0.
     323           Teta_out(ig)=pts(ig)
    284324        ENDIF
    285325      ENDDO
     326
     327! Usefull diagnostics for the interpolation routine :
    286328
    287329         call WRITEDIAGFI(ngrid,'L',
Note: See TracChangeset for help on using the changeset viewer.