Skip to content

Commit

Permalink
develop: merge HWRF version of saSAS with GFS version (NOAA-GSL#93)
Browse files Browse the repository at this point in the history
* Merge branch 'man_hafs_sas_without_updates_of_dtc_develop_49b73a8f4149ca88f071dbaae81f1769b120f1e0' into HEAD
* gfsphysics/physics/GFS_debug.F90: add capability to debug 1-d logical arrays
* Clean up error messages in gfsphysics/GFS_layer/GFS_typedefs.F90

Co-authored-by: Dusan Jovic <dusan.jovic@noaa.gov>
  • Loading branch information
2 people authored and tsupinie committed Jul 20, 2020
1 parent 026c942 commit 9be11f6
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 2 deletions.
2 changes: 1 addition & 1 deletion atmos_cubed_sphere
2 changes: 1 addition & 1 deletion ccpp/physics
18 changes: 18 additions & 0 deletions gfsphysics/GFS_layer/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,7 @@ module GFS_typedefs
integer :: imfshalcnv_samf = 2 !< flag for SAMF scale- & aerosol-aware mass-flux shallow convection scheme
integer :: imfshalcnv_gf = 3 !< flag for scale- & aerosol-aware Grell-Freitas scheme (GSD)
integer :: imfshalcnv_ntiedtke = 4 !< flag for new Tiedtke scheme (CAPS)
logical :: hwrf_samfdeep !< flag for HWRF SAMF deepcnv scheme (HWRF)
#endif
integer :: imfdeepcnv !< flag for mass-flux deep convection scheme
!< 1: July 2010 version of SAS conv scheme
Expand All @@ -855,6 +856,7 @@ module GFS_typedefs
integer :: imfdeepcnv_samf = 2 !< flag for SAMF scale- & aerosol-aware mass-flux deep convection scheme
integer :: imfdeepcnv_gf = 3 !< flag for scale- & aerosol-aware Grell-Freitas scheme (GSD)
integer :: imfdeepcnv_ntiedtke = 4 !< flag for new Tiedtke scheme (CAPS)
logical :: hwrf_samfshal !< flag for HWRF SAMF shalcnv scheme (HWRF)
#endif
integer :: isatmedmf !< flag for scale-aware TKE-based moist edmf scheme
!< 0: initial version of satmedmf (Nov. 2018)
Expand Down Expand Up @@ -3065,6 +3067,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
!< 1: updated version of satmedmf (as of May 2019)
logical :: do_deep = .true. !< whether to do deep convection
#ifdef CCPP
logical :: hwrf_samfdeep = .false. !< flag for HWRF SAMF deepcnv scheme
logical :: hwrf_samfshal = .false. !< flag for HWRF SAMF shalcnv scheme
logical :: do_mynnedmf = .false. !< flag for MYNN-EDMF
logical :: do_mynnsfclay = .false. !< flag for MYNN Surface Layer Scheme
! DH* TODO - move to MYNN namelist section
Expand Down Expand Up @@ -3300,6 +3304,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
bl_mynn_mixqt, icloud_bl, bl_mynn_tkeadvect, gwd_opt, &
! *DH
do_myjsfc, do_myjpbl, &
hwrf_samfdeep, hwrf_samfshal, &
#endif
h2o_phys, pdfcld, shcnvcw, redrag, hybedmf, satmedmf, &
shinhong, do_ysu, dspheat, lheatstrg, cnvcld, &
Expand Down Expand Up @@ -3675,6 +3680,19 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%shoc_parm = shoc_parm
Model%shocaftcnv = shocaftcnv
Model%shoc_cld = shoc_cld
#ifdef CCPP
!HWRF physics suite
if (hwrf_samfdeep .and. imfdeepcnv/=2) then
write(*,*) 'Logic error: hwrf_samfdeep requires imfdeepcnv=2'
stop
end if
if (hwrf_samfshal .and. imfshalcnv/=2) then
write(*,*) 'Logic error: hwrf_samfshal requires imfshalcnv=2'
stop
end if
Model%hwrf_samfdeep = hwrf_samfdeep
Model%hwrf_samfshal = hwrf_samfshal
#endif
#ifdef CCPP
if (oz_phys .and. oz_phys_2015) then
write(*,*) 'Logic error: can only use one ozone physics option (oz_phys or oz_phys_2015), not both. Exiting.'
Expand Down
12 changes: 12 additions & 0 deletions gfsphysics/GFS_layer/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -3159,6 +3159,18 @@
units = flag
dimensions = ()
type = integer
[hwrf_samfdeep]
standard_name = flag_for_hwrf_samfdeepcnv_scheme
long_name = flag for hwrf samfdeepcnv scheme
units = flag
dimensions = ()
type = logical
[hwrf_samfshal]
standard_name = flag_for_hwrf_samfshalcnv_scheme
long_name = flag for hwrf samfshalcnv scheme
units = flag
dimensions = ()
type = logical
[isatmedmf]
standard_name = choice_of_scale_aware_TKE_moist_EDMF_PBL
long_name = choice of scale-aware TKE moist EDMF PBL scheme
Expand Down
26 changes: 26 additions & 0 deletions gfsphysics/physics/GFS_debug.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module GFS_diagtoscreen

interface print_var
module procedure print_logic_0d
module procedure print_logic_1d
module procedure print_int_0d
module procedure print_int_1d
module procedure print_real_0d
Expand Down Expand Up @@ -106,6 +107,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling,
do impi=0,mpisize-1
do iomp=0,ompsize-1
if (mpirank==impi .and. omprank==iomp) then
call print_var(mpirank,omprank, blkno, 'Model%kdt' , Model%kdt)
! Sfcprop
call print_var(mpirank,omprank, blkno, 'Sfcprop%slmsk' , Sfcprop%slmsk)
call print_var(mpirank,omprank, blkno, 'Sfcprop%oceanfrac', Sfcprop%oceanfrac)
Expand Down Expand Up @@ -544,6 +546,30 @@ subroutine print_int_0d(mpirank,omprank,blkno,name,var)

end subroutine print_int_0d

subroutine print_logic_1d(mpirank,omprank,blkno,name,var)

use machine, only: kind_phys

implicit none

integer, intent(in) :: mpirank, omprank, blkno
character(len=*), intent(in) :: name
logical, intent(in) :: var(:)

integer :: i

#ifdef PRINT_SUM
write(0,'(2a,3i6,2i8)') 'XXX: ', trim(name), mpirank, omprank, blkno, size(var), count(var)
#elif defined(PRINT_CHKSUM)
write(0,'(2a,3i6,2i8)') 'XXX: ', trim(name), mpirank, omprank, blkno, size(var), count(var)
#else
do i=ISTART,min(IEND,size(var(:)))
write(0,'(2a,3i6,i6,1x,l)') 'XXX: ', trim(name), mpirank, omprank, blkno, i, var(i)
end do
#endif

end subroutine print_logic_1d

subroutine print_int_1d(mpirank,omprank,blkno,name,var)

use machine, only: kind_phys
Expand Down

0 comments on commit 9be11f6

Please sign in to comment.