Skip to content

Commit

Permalink
Merge pull request NCAR#355 from climbfuji/add_sas_and_satmedmfvdifq
Browse files Browse the repository at this point in the history
Add SAS deep/shallow convection and satmedmfvdifq (updated version of satmedmfvdif)
  • Loading branch information
climbfuji committed Nov 20, 2019
2 parents 74851c1 + cbbac67 commit a7c38a6
Show file tree
Hide file tree
Showing 15 changed files with 7,864 additions and 311 deletions.
39 changes: 38 additions & 1 deletion physics/GFS_SCNV_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ end subroutine GFS_SCNV_generic_post_finalize
!! \htmlinclude GFS_SCNV_generic_post_run.html
!!
subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, cplchm, &
frain, gt0, gq0_water_vapor, save_t, save_qv, dqdti, dt3dt, dq3dt, clw, errmsg, errflg)
frain, gt0, gq0_water_vapor, save_t, save_qv, dqdti, dt3dt, dq3dt, clw, &
shcnvcw, rain1, npdf3d, num_p3d, ncnvcld3d, cnvc, cnvw, &
rainc, cnvprcp, cnvprcpb, cnvw_phy_f3d, cnvc_phy_f3d, &
imfshalcnv, imfshalcnv_sas, imfshalcnv_samf, errmsg, errflg)

use machine, only: kind_phys

Expand All @@ -85,6 +88,19 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, cplchm, &
real(kind=kind_phys), dimension(:,:), intent(inout) :: dt3dt, dq3dt
real(kind=kind_phys), dimension(im,levs,nn), intent(inout) :: clw

! Post code for SAS/SAMF
integer, intent(in) :: npdf3d, num_p3d, ncnvcld3d
logical, intent(in) :: shcnvcw
real(kind=kind_phys), dimension(im), intent(in) :: rain1
real(kind=kind_phys), dimension(im,levs), intent(in) :: cnvw, cnvc
real(kind=kind_phys), dimension(im), intent(inout) :: rainc, cnvprcp, cnvprcpb
! The following arrays may not be allocated, depending on certain flags and microphysics schemes.
! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape,
! use assumed-shape arrays. Note that Intel 18 and GNU 6.2.0-8.1.0 tolerate explicit-shape arrays
! as long as these do not get used when not allocated.
real(kind=kind_phys), dimension(:,:), intent(inout) :: cnvw_phy_f3d, cnvc_phy_f3d
integer, intent(in) :: imfshalcnv, imfshalcnv_sas, imfshalcnv_samf

character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg

Expand All @@ -95,6 +111,27 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, cplchm, &
errmsg = ''
errflg = 0

if (imfshalcnv==imfshalcnv_sas .or. imfshalcnv==imfshalcnv_samf) then
do i=1,im
rainc(i) = rainc(i) + frain * rain1(i)
enddo
! 'cnvw' and 'cnvc' are set to zero before computation starts:
if (shcnvcw .and. num_p3d == 4 .and. npdf3d == 3) then
do k=1,levs
do i=1,im
cnvw_phy_f3d(i,k) = cnvw_phy_f3d(i,k) + cnvw(i,k)
cnvc_phy_f3d(i,k) = cnvc_phy_f3d(i,k) + cnvc(i,k)
enddo
enddo
elseif (npdf3d == 0 .and. ncnvcld3d == 1) then
do k=1,levs
do i=1,im
cnvw_phy_f3d(i,k) = cnvw_phy_f3d(i,k) + cnvw(i,k)
enddo
enddo
endif
endif

if (lssav) then
if (ldiag3d) then
do k=1,levs
Expand Down
128 changes: 128 additions & 0 deletions physics/GFS_SCNV_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,134 @@
kind = kind_phys
intent = inout
optional = F
[shcnvcw]
standard_name = flag_shallow_convective_cloud
long_name = flag for shallow convective cloud
units =
dimensions = ()
type = logical
intent = in
optional = F
[rain1]
standard_name = lwe_thickness_of_shallow_convective_precipitation_amount
long_name = shallow convective rainfall amount on physics timestep
units = m
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[npdf3d]
standard_name = number_of_3d_arrays_associated_with_pdf_based_clouds
long_name = number of 3d arrays associated with pdf based clouds/mp
units = count
dimensions = ()
type = integer
intent = in
optional = F
[num_p3d]
standard_name = array_dimension_of_3d_arrays_for_microphysics
long_name = number of 3D arrays needed for microphysics
units = count
dimensions = ()
type = integer
intent = in
optional = F
[ncnvcld3d]
standard_name = number_of_convective_3d_cloud_fields
long_name = number of convective 3d clouds fields
units = count
dimensions = ()
type = integer
intent = in
optional = F
[cnvc]
standard_name = convective_cloud_cover
long_name = convective cloud cover
units = frac
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[cnvw]
standard_name = convective_cloud_water_mixing_ratio
long_name = moist convective cloud water mixing ratio
units = kg kg-1
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[rainc]
standard_name = lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep
long_name = convective rain at this time step
units = m
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[cnvprcp]
standard_name = cumulative_lwe_thickness_of_convective_precipitation_amount
long_name = cumulative convective precipitation
units = m
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[cnvprcpb]
standard_name = cumulative_lwe_thickness_of_convective_precipitation_amount_in_bucket
long_name = cumulative convective precipitation in bucket
units = m
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[cnvw_phy_f3d]
standard_name = convective_cloud_water_mixing_ratio_in_phy_f3d
long_name = convective cloud water mixing ratio in the phy_f3d array
units = kg kg-1
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[cnvc_phy_f3d]
standard_name = convective_cloud_cover_in_phy_f3d
long_name = convective cloud cover in the phy_f3d array
units = frac
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[imfshalcnv]
standard_name = flag_for_mass_flux_shallow_convection_scheme
long_name = flag for mass-flux shallow convection scheme
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[imfshalcnv_sas]
standard_name = flag_for_sas_shallow_convection_scheme
long_name = flag for SAS shallow convection scheme
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[imfshalcnv_samf]
standard_name = flag_for_samf_shallow_convection_scheme
long_name = flag for SAMF shallow convection scheme
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down
Loading

0 comments on commit a7c38a6

Please sign in to comment.