Commit 9ca6e380 authored by Espen Sollum's avatar Espen Sollum
Browse files

minor edits

parent 467460af
......@@ -66,24 +66,28 @@ subroutine calcmatrix(lconv,delt,cbmf,metdata_format)
phconv(1) = psconv
! Emanuel subroutine needs pressure in hPa, therefore convert all pressures
! Emanuel subroutine needs pressure in hPa, therefore convert all pressures
if (metdata_format.eq.GRIBFILE_CENTRE_ECMWF) then
do kuvz = 2,nuvz
k = kuvz-1
if (metdata_format.eq.GRIBFILE_CENTRE_ECMWF) then
pconv(k) = (akz(kuvz) + bkz(kuvz)*psconv)
phconv(kuvz) = (akm(kuvz) + bkm(kuvz)*psconv)
else
phconv(kuvz) = 0.5*(pconv(kuvz)+pconv(k))
endif
dpr(k) = phconv(k) - phconv(kuvz)
qsconv(k) = f_qvsat( pconv(k), tconv(k) )
! initialize mass fractions
do kk=1,nconvlev
fmassfrac(k,kk)=0.
end do
else
! JMA / SH Bugfix phconv was set in loop with access to undefined pconv(nuvz)
phconv(2:nuvz-1) = 0.5*(pconv(2:nuvz-1)+pconv(1:nuvz-2))
phconv(nuvz) = pconv(nuvz-1)
dpr(1:nuvz-1) = phconv(1:nuvz-1)-phconv(2:nuvz)
do k = 1,nuvz-1
qsconv(k) = f_qvsat( pconv(k), tconv(k) )
end do
end if
! initialize mass fractions
fmassfrac(1:nuvz-1,1:nconvlev)=0.0
!note that Emanuel says it is important
!a. to set this =0. every grid point
......@@ -93,8 +97,8 @@ subroutine calcmatrix(lconv,delt,cbmf,metdata_format)
!******************
cbmfold = cbmf
! Convert pressures to hPa, as required by Emanuel scheme
!********************************************************
! Convert pressures to hPa, as required by Emanuel scheme
!********************************************************
!!$ do k=1,nconvlev !old
do k=1,nconvlev+1 !bugfix
pconv_hpa(k)=pconv(k)/100.
......@@ -104,24 +108,24 @@ subroutine calcmatrix(lconv,delt,cbmf,metdata_format)
call convect(nconvlevmax, nconvlev, delt, iflag, &
precip, wd, tprime, qprime, cbmf)
! do not update fmassfrac and cloudbase massflux
! if no convection takes place or
! if a CFL criterion is violated in convect43c.f
! do not update fmassfrac and cloudbase massflux
! if no convection takes place or
! if a CFL criterion is violated in convect43c.f
if (iflag .ne. 1 .and. iflag .ne. 4) then
cbmf=cbmfold
goto 200
endif
! do not update fmassfrac and cloudbase massflux
! if the old and the new cloud base mass
! fluxes are zero
! do not update fmassfrac and cloudbase massflux
! if the old and the new cloud base mass
! fluxes are zero
if (cbmf.le.0..and.cbmfold.le.0.) then
cbmf=cbmfold
goto 200
endif
! Update fmassfrac
! account for mass displaced from level k to level k
! Update fmassfrac
! account for mass displaced from level k to level k
lconv = .true.
do k=1,nconvtop
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment