Ignore:
Timestamp:
Apr 22, 2015, 3:42:35 PM (9 years ago)
Author:
pesei
Message:

Wet dep quick fix and other small changes. Wet depo quick fix not final yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/petra/src/interpol_rain.f90

    r24 r37  
    11!**********************************************************************
    2 ! Copyright 1998,1999,2000,2001,2002,2005,2007,2008,2009,2010         *
     2! Copyright 1998-2015                                                 *
    33! Andreas Stohl, Petra Seibert, A. Frank, Gerhard Wotawa,             *
    44! Caroline Forster, Sabine Eckhardt, John Burkhart, Harald Sodemann   *
     
    2020!**********************************************************************
    2121
    22 subroutine interpol_rain(yy1,yy2,yy3,nxmax,nymax,nzmax,nx, &
    23        ny,memind,xt,yt,level,itime1,itime2,itime,yint1,yint2,yint3)
     22subroutine interpol_rain(yy1,yy2,yy3,nxmax,nymax,nzmax,nx,ny, &
     23       memind,xt,yt,level,itime1,itime2,itime,yint1,yint2,yint3, &
     24       icbot,ictop)
    2425  !                          i   i   i    i    i     i   i
    2526  !i    i    i  i    i     i      i      i     o     o     o
     
    4041  !                                                                           *
    4142  !     30 August 1996                                                        *
     43  !****************************************************************************
     44  ! Petra Seibert, 2011/2012-2015:
     45  !  Add interpolation of cloud bottom and cloud thickness
     46  !  for fix to SE's new wet scavenging scheme
    4247  !                                                                           *
    4348  !****************************************************************************
     
    6671  !                                                                           *
    6772  !****************************************************************************
     73 
     74  use com_mod, only: icloudbot, icloudthck
     75  use par_mod, only: icmv
    6876
    6977  implicit none
    7078
    7179  integer :: nx,ny,nxmax,nymax,nzmax,memind(2),m,ix,jy,ixp,jyp
    72   integer :: itime,itime1,itime2,level,indexh
     80  integer :: itime,itime1,itime2,level,indexh,ip1,ip2,ip3,ip4
     81  integer :: icbot,icthck,ictop,ipsum
    7382  real :: yy1(0:nxmax-1,0:nymax-1,nzmax,2)
    7483  real :: yy2(0:nxmax-1,0:nymax-1,nzmax,2)
    7584  real :: yy3(0:nxmax-1,0:nymax-1,nzmax,2)
    76   real :: ddx,ddy,rddx,rddy,dt1,dt2,dt,y1(2),y2(2),y3(2)
     85  real :: ddx,ddy,rddx,rddy,dt1,dt2,dt,y1(2),y2(2),y3(2),cbot(2),cthck(2)
    7786  real :: xt,yt,yint1,yint2,yint3,p1,p2,p3,p4
    78 
    7987
    8088
     
    112120  !***********************
    113121
     122  memind_loop: &
    114123  do m=1,2
     124
    115125    indexh=memind(m)
    116126
     
    127137         + p3*yy3(ix ,jyp,level,indexh) &
    128138         + p4*yy3(ixp,jyp,level,indexh)
    129   end do
     139
     140
     141! PS clouds:
     142    ip1=1
     143    ip2=1
     144    ip3=1
     145    ip4=1
     146    if (icloudbot(ix ,jy ,indexh) .eq. icmv) ip1=0
     147    if (icloudbot(ixp,jy ,indexh) .eq. icmv) ip2=0
     148    if (icloudbot(ix ,jyp,indexh) .eq. icmv) ip3=0
     149    if (icloudbot(ixp,jyp,indexh) .eq. icmv) ip4=0
     150    ipsum = ip1+ip2+ip3+ip4
     151    if (ipsum .eq. 0) then
     152      cbot(m)=icmv
     153    else
     154      cbot(m)=(ip1*p1*icloudbot(ix ,jy ,indexh) &
     155             + ip2*p2*icloudbot(ixp,jy ,indexh) &
     156             + ip3*p3*icloudbot(ix ,jyp,indexh) &
     157             + ip4*p4*icloudbot(ixp,jyp,indexh)) / ipsum
     158    endif
     159
     160    ip1=1
     161    ip2=1
     162    ip3=1
     163    ip4=1
     164    if (icloudthck(ix ,jy ,indexh) .eq. icmv) ip1=0
     165    if (icloudthck(ixp,jy ,indexh) .eq. icmv) ip2=0
     166    if (icloudthck(ix ,jyp,indexh) .eq. icmv) ip3=0
     167    if (icloudthck(ixp,jyp,indexh) .eq. icmv) ip4=0
     168    ipsum = ip1+ip2+ip3+ip4
     169    if (ipsum .eq. 0) then
     170      cthck(m)=icmv
     171    else
     172      cthck(m)=(ip1*p1*icloudthck(ix ,jy ,indexh) &
     173              + ip2*p2*icloudthck(ixp,jy ,indexh) &
     174              + ip3*p3*icloudthck(ix ,jyp,indexh) &
     175              + ip4*p4*icloudthck(ixp,jyp,indexh)) / ipsum
     176    endif
     177! PS end clouds
     178
     179  enddo memind_loop
    130180
    131181
     
    142192  yint3=(y3(1)*dt2+y3(2)*dt1)/dt
    143193
     194! PS clouds:
     195  icbot = nint( (cbot(1)*dt2 + cbot(2)*dt1)/dt )
     196  if (nint(cbot(1)) .eq. icmv) icbot=cbot(2)
     197  if (nint(cbot(2)) .eq. icmv) icbot=cbot(1)
     198
     199  icthck = nint( (cthck(1)*dt2 + cthck(2)*dt1)/dt )
     200  if (nint(cthck(1)) .eq. icmv) icthck=cthck(2)
     201  if (nint(cthck(2)) .eq. icmv) icthck=cthck(1)
     202
     203  if (icbot .ne. icmv .and. icthck .ne. icmv) then
     204    ictop = icbot + icthck ! convert cloud thickness to cloud top
     205  else
     206    icbot=icmv
     207    ictop=icmv
     208  endif
     209! PS end clouds
     210
    144211
    145212end subroutine interpol_rain
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG