Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gwdc.f, gwdps.f, gscond.f: merge updates from gfsphysics #99

Merged
merged 7 commits into from
Jul 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions physics/gscond.f
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
!> \file gscond.f
!! This file contains the subroutine that calculates grid-scale
!! condensation and evaporation for use in
!! condensation and evaporation for use in
!! \cite zhao_and_carr_1997 scheme.

module zhaocarr_gscond
Expand Down Expand Up @@ -57,7 +57,7 @@ end subroutine zhaocarr_gscond_finalize
!! cloud water and cloud ice (table2 of \cite zhao_and_carr_1997).
!! -# Calculate the changes in \f$t\f$, \f$q\f$ and \f$p\f$ due to all the processes except microphysics.
!! -# Calculate cloud evaporation rate (\f$E_c\f$, eq. 19 of \cite zhao_and_carr_1997)
!! -# Calculate cloud condensation rate (\f$C_g\f$, eq.8 of \cite zhao_and_carr_1997)
!! -# Calculate cloud condensation rate (\f$C_g\f$, eq.8 of \cite zhao_and_carr_1997)
!! -# update t,q,cwm due to cloud evaporation and condensation process
!> \section Zhao-Carr_cond_detailed GFS gscond Scheme Detailed Algorithm
!> @{
Expand Down Expand Up @@ -212,7 +212,7 @@ subroutine zhaocarr_gscond_run (im,ix,km,dt,dtf,prsl,ps,q,clw1 &
!> -# Compute ice-water identification number IW.
!!\n The distinction between cloud water and cloud ice is made by the
!! cloud identification number IW, which is zero for cloud water and
!! unity for cloud ice (Table 2 in
!! unity for cloud ice (Table 2 in
!! \cite zhao_and_carr_1997):
!! - All clouds are defined to consist of liquid water below the
!! freezing level (\f$T\geq 0^oC\f$) and of ice particles above the
Expand Down Expand Up @@ -347,7 +347,7 @@ subroutine zhaocarr_gscond_run (im,ix,km,dt,dtf,prsl,ps,q,clw1 &
!! M=A_{q}-\frac{f\epsilon Lq_{s}}{RT^{2}}A_{t}+\frac{fq_{s}}{p}A_{p}
!!\f]
!! To close the system, an equation for the relative humidity tendency
!! \f$f_{t}\f$ was derived by
!! \f$f_{t}\f$ was derived by
!! \cite sundqvist_et_al_1989 using the hypothesis that the quantity
!! \f$M+E_{c}\f$ is divided into one part,\f$bM\f$,which condenses
!! in the already cloudy portion of a grid square, and another part,
Expand Down Expand Up @@ -480,7 +480,6 @@ subroutine zhaocarr_gscond_run (im,ix,km,dt,dtf,prsl,ps,q,clw1 &
!> -# End of the condensation/evaporation loop (end of i-loop,k-loop).
!*********************************************************************
!

!> -# Store \f$t\f$, \f$q\f$, \f$ps\f$ for next time step.

if (dt > dtf+0.001) then ! three time level
Expand Down Expand Up @@ -519,8 +518,5 @@ subroutine zhaocarr_gscond_run (im,ix,km,dt,dtf,prsl,ps,q,clw1 &
end subroutine zhaocarr_gscond_run
!> @}
! @}


! @}

end module zhaocarr_gscond
40 changes: 21 additions & 19 deletions physics/gwdc.f
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
!> \file gwdc.f This file is the original code for parameterization of
!! stationary convection forced gravity wave drag based on
!! \cite chun_and_baik_1998 .
!! stationary convection forced gravity wave drag based on
!! \cite chun_and_baik_1998.

module gwdc_pre
contains
Expand Down Expand Up @@ -101,8 +101,6 @@ end subroutine gwdc_pre_finalize

end module gwdc_pre



module gwdc

contains
Expand Down Expand Up @@ -649,7 +647,7 @@ subroutine gwdc_run (im,ix,km,lat,u1,v1,t1,q1,deltim, &
bruni(i,k) = sqrt (max (n2min, n2))
enddo
enddo

deallocate (spfh)
!-----------------------------------------------------------------------
!
Expand Down Expand Up @@ -741,7 +739,7 @@ subroutine gwdc_run (im,ix,km,lat,u1,v1,t1,q1,deltim, &
!-----------------------------------------------------------------------
!
!> - Calculate the basic state wind profiles projected in the direction of the
!! cloud top wind at mid level and interface level.
!! cloud top wind at mid level and interface level.
! \n U : Basic-wind speed profile. Basic-wind is parallel to the wind
! vector at the cloud top level. (mid level)
! \n UI: Basic-wind speed profile. Basic-wind is parallel to the wind
Expand Down Expand Up @@ -894,12 +892,9 @@ subroutine gwdc_run (im,ix,km,lat,u1,v1,t1,q1,deltim, &
!-----------------------------------------------------------------------
!D
!> - Wave stress at cloud top is calculated when the atmosphere
!! is dynamically stable at the cloud top.
do i=1,npt
kk = kcldtop(i)
if ( abs(basicui(i,kk)) > zero .and. riloc(i,kk) > ricrit) then
!E
!> - The cloud top wave stress and nonlinear parameter are calculated
!! is dynamically stable at the cloud top
!!
!> - The cloud top wave stress and nonlinear parameter are calculated
!! using density, temperature, and wind that are defined at mid
!! level just below the interface level in which cloud top wave
!! stress is defined.
Expand Down Expand Up @@ -929,7 +924,20 @@ subroutine gwdc_run (im,ix,km,lat,u1,v1,t1,q1,deltim, &
!! top heights of thermal forcing. If the atmosphere is dynamically
!! unstable at the cloud top, the convective GWD calculation is
!! skipped at that grid point.
!!
! - If mean wind at the cloud top is less than zero, GWDC
! calculation in current horizontal grid is skipped.
!

!> - The stress is capped at tauctmax = - 5\f$n/m^2\f$
!! in order to prevent numerical instability.
!
!-----------------------------------------------------------------------
!D
do i=1,npt
kk = kcldtop(i)
if ( abs(basicui(i,kk)) > zero .and. riloc(i,kk) > ricrit) then
!E
tem = basicum(i,kk)
tem1 = tem * tem
nonlinct = gqmcldlen(i) / (bruni(i,kk)*t(i,kk)*tem1) ! Mu
Expand Down Expand Up @@ -1190,8 +1198,7 @@ subroutine gwdc_run (im,ix,km,lat,u1,v1,t1,q1,deltim, &
enddo
enddo

!!!!!! Vertical differentiation
!!!!!!
!!!!!! Vertical differentiation!!!!!!
!> - Calculate wind tendency in direction to the wind vector,zonal
!! wind tendency and meridional wind tendency above the cloud top
!! level due to convectively generated gravity waves.
Expand Down Expand Up @@ -1291,11 +1298,8 @@ subroutine gwdc_run (im,ix,km,lat,u1,v1,t1,q1,deltim, &
!-----------------------------------------------------------------------

! do k=1,kcldtop(i)-1

! if (utgwcl(i,k)*u(i,k) .gt. 0.0) then

!-------------------- x-component-------------------

! write(6,'(a)')
! + '(GWDC) WARNING: The GWDC should accelerate the zonal wind '
! write(6,'(a,a,i3,a,i3)')
Expand Down Expand Up @@ -1480,8 +1484,6 @@ end subroutine gwdc_finalize

end module gwdc



module gwdc_post

contains
Expand Down
Loading