Changes in src/richardson.f90 [c2162ce:6ecb30a] in flexpart.git


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/richardson.f90

    rc2162ce r6ecb30a  
    2121
    2222subroutine richardson(psurf,ust,ttlev,qvlev,ulev,vlev,nuvz, &
    23        akz,bkz,hf,tt2,td2,h,wst,hmixplus)
     23       akz,bkz,hf,tt2,td2,h,wst,hmixplus,metdata_format)
    2424  !                        i    i    i     i    i    i    i
    2525  ! i   i  i   i   i  o  o     o
     
    4141  !     Meteor. 81, 245-269.                                                  *
    4242  !                                                                           *
     43  !****************************************************************************
     44  !                                                                           *
    4345  !     Update: 1999-02-01 by G. Wotawa                                       *
    4446  !                                                                           *
     
    4648  !     instead of first model level.                                         *
    4749  !     New input variables tt2, td2 introduced.                              *
     50  !                                                                           *
     51  !     CHANGE: 17/11/2005 Caroline Forster NCEP GFS version                  *
     52  !                                                                           *
     53  !     Unified ECMWF and GFS builds                                          *
     54  !     Marian Harustak, 12.5.2017                                            *
     55  !       - Merged richardson and richardson_gfs into one routine using       *
     56  !         if-then for meteo-type dependent code                             *
    4857  !                                                                           *
    4958  !****************************************************************************
     
    5564  ! tv                         virtual temperature                            *
    5665  ! wst                        convective velocity scale                      *
     66  ! metdata_format             format of metdata (ecmwf/gfs)                  *
    5767  !                                                                           *
    5868  ! Constants:                                                                *
     
    6272
    6373  use par_mod
     74  use class_gribfile
    6475
    6576  implicit none
    6677
    67   integer :: i,k,nuvz,iter
     78  integer :: metdata_format
     79  integer :: i,k,nuvz,iter,llev,loop_start
    6880  real :: tv,tvold,zref,z,zold,pint,pold,theta,thetaref,ri
    6981  real :: akz(nuvz),bkz(nuvz),ulev(nuvz),vlev(nuvz),hf,wst,tt2,td2,ew
     
    7789  iter=0
    7890
     91  if (metdata_format.eq.GRIBFILE_CENTRE_NCEP) then
     92    ! NCEP version: find first model level above ground
     93    !**************************************************
     94
     95     llev = 0
     96     do i=1,nuvz
     97       if (psurf.lt.akz(i)) llev=i
     98     end do
     99     llev = llev+1
     100    ! sec llev should not be 1!
     101     if (llev.eq.1) llev = 2
     102     if (llev.gt.nuvz) llev = nuvz-1
     103    ! NCEP version
     104  end if
     105
     106
    79107  ! Compute virtual temperature and virtual potential temperature at
    80108  ! reference level (2 m)
     
    95123  ! Integrate z up to one level above zt
    96124  !*************************************
    97 
    98   do k=2,nuvz
     125  if (metdata_format.eq.GRIBFILE_CENTRE_ECMWF) then
     126    loop_start=2
     127  else
     128    loop_start=llev
     129  end if
     130  do k=loop_start,nuvz
    99131    pint=akz(k)+bkz(k)*psurf  ! pressure on model layers
    100132    tv=ttlev(k)*(1.+0.608*qvlev(k))
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG