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/verttransform.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   *
     
    5050  ! added the variable cloud for use with scavenging - descr. in com_mod
    5151  !*****************************************************************************
     52  ! Petra Seibert, Feb 2015: Add quick fix from 2013
     53  !*****************************************************************************
    5254  !                                                                            *
    5355  ! Variables:                                                                 *
    5456  ! nx,ny,nz                        field dimensions in x,y and z direction    *
    55   ! clouds(0:nxmax,0:nymax,0:nzmax,2) cloud field for wet deposition           *
    5657  ! uu(0:nxmax,0:nymax,nzmax,2)     wind components in x-direction [m/s]       *
    5758  ! vv(0:nxmax,0:nymax,nzmax,2)     wind components in y-direction [m/s]       *
     
    6970  implicit none
    7071
    71   integer :: ix,jy,kz,iz,n,kmin,kl,klp,ix1,jy1,ixp,jyp,ixm,jym
    72   integer :: rain_cloud_above,kz_inv
     72  integer :: ix,jy,kz,iz,n,kmin,kl,klp,ix1,jy1,ixp,jyp,ixm,jym,kz_inv
     73  integer :: icloudtop
    7374  real :: f_qvsat,pressure
    74   real :: rh,lsp,convp
     75  real :: rh,lsp,convp,prec,rhmin
    7576  real :: rhoh(nuvzmax),pinmconv(nzmax)
    7677  real :: ew,pint,tv,tvold,pold,dz1,dz2,dz,ui,vi
     
    8586  real,parameter :: const=r_air/ga
    8687
    87   logical :: init = .true.
     88  logical :: init = .true., lconvectprec, lsearch
    8889
    8990
     
    477478
    478479
    479   !write (*,*) 'initializing clouds, n:',n,nymin1,nxmin1,nz
    480   !   create a cloud and rainout/washout field, clouds occur where rh>80%
    481   !   total cloudheight is stored at level 0
     480  ! write (*,*) 'diagnosing clouds, n:',n,nymin1,nxmin1,nz
     481  jy_loop: &
    482482  do jy=0,nymin1
    483483    do ix=0,nxmin1
    484       rain_cloud_above=0
     484   
    485485      lsp=lsprec(ix,jy,1,n)
    486486      convp=convprec(ix,jy,1,n)
    487       cloudsh(ix,jy,n)=0
    488       do kz_inv=1,nz-1
    489          kz=nz-kz_inv+1
    490          pressure=rho(ix,jy,kz,n)*r_air*tt(ix,jy,kz,n)
    491          rh=qv(ix,jy,kz,n)/f_qvsat(pressure,tt(ix,jy,kz,n))
    492          clouds(ix,jy,kz,n)=0
    493          if (rh.gt.0.8) then ! in cloud
    494             if ((lsp.gt.0.01).or.(convp.gt.0.01)) then ! cloud and precipitation
    495                rain_cloud_above=1
    496                cloudsh(ix,jy,n)=cloudsh(ix,jy,n)+ &
    497                height(kz)-height(kz-1)
    498                if (lsp.ge.convp) then
    499                   clouds(ix,jy,kz,n)=3 ! lsp dominated rainout
    500                else
    501                   clouds(ix,jy,kz,n)=2 ! convp dominated rainout
    502                endif
    503             else ! no precipitation
    504                   clouds(ix,jy,kz,n)=1 ! cloud
     487      prec=lsp+convp
     488      if (lsp .gt. convp) then !  prectype='lsp'
     489        lconvectprec = .false.
     490      else ! prectype='cp '
     491        lconvectprec = .true.
     492      endif
     493      icloudbot(ix,jy,n)=icmv
     494      icloudtop=icmv ! this is just a local variable
     495      rhmin=rhmininit ! just initialise in a way that cond is true
     496      lsearch=.true.
     497
     498      cloudsearch_loop: &
     499      do while (rhmin .ge. rhminx .and. lsearch)
     500        ! give up for < rhminx
     501
     502        kz_loop: &
     503        do kz_inv=1,nz-1
     504          kz=nz-kz_inv+1
     505          pressure=rho(ix,jy,kz,n)*r_air*tt(ix,jy,kz,n)
     506          rh=qv(ix,jy,kz,n)/f_qvsat(pressure,tt(ix,jy,kz,n))
     507          if (rh .gt. rhmin) then
     508            if (icloudbot(ix,jy,n) .eq. icmv) then
     509              icloudtop=nint(height(kz)) ! use int to save memory
    505510            endif
    506          else ! no cloud
    507             if (rain_cloud_above.eq.1) then ! scavenging
    508                if (lsp.ge.convp) then
    509                   clouds(ix,jy,kz,n)=5 ! lsp dominated washout
    510                else
    511                   clouds(ix,jy,kz,n)=4 ! convp dominated washout
    512                endif
    513             endif
    514          endif
    515       end do
    516     end do
    517   end do
     511            icloudbot(ix,jy,n)=nint(height(kz))
     512          endif
     513        end do kz_loop
     514
     515        ! PS try to get a cloud thicker than 50 m
     516        ! PS if there is at least precmin mm/h
     517        if (prec .gt. precmin .and. &
     518          ( icloudbot(ix,jy,n) .eq. icmv .or. &
     519            icloudtop-icloudbot(ix,jy,n) .lt. 50)) then
     520          rhmin = rhmin - 0.05
     521        else
     522          lsearch = .false.
     523        endif
     524       
     525      enddo cloudsearch_loop
     526
     527      ! PS implement a rough fix for badly represented convection
     528      ! PS is based on looking at a limited set of comparison data
     529      if (lconvectprec .and. icloudtop .lt. icloudtopconvmin .or. &
     530         icloudbot(ix,jy,n) .lt. icloudtopmin .and. prec .gt. precmin) then
     531        if (convp .lt. 0.1) then
     532          icloudbot(ix,jy,n) = icloudbot1
     533          icloudtop =          icloudtop1
     534        else
     535          icloudbot(ix,jy,n) = icloudbot2
     536          icloudtop =          icloudtop2
     537        endif
     538      endif
     539
     540      if (icloudtop .ne. icmv) then
     541        icloudthck(ix,jy,n) = icloudtop-icloudbot(ix,jy,n)
     542      else
     543        icloudthck(ix,jy,n) = icmv ! no cloud found whatsoever
     544      endif
     545
     546      ! PS get rid of too thin clouds     
     547      if (icloudthck(ix,jy,n) .lt. 50) then
     548        icloudbot(ix,jy,n)=icmv
     549        icloudthck(ix,jy,n)=icmv
     550      endif
     551
     552    enddo
     553  enddo jy_loop
    518554
    519555end subroutine verttransform
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG