Skip to content

Commit

Permalink
Merge pull request NOAA-EMC#37 from climbfuji/update_gsd_develop_from…
Browse files Browse the repository at this point in the history
…_develop_20200616

Update gsd/develop from develop 2020/06/16
  • Loading branch information
DomHeinzeller authored Jun 19, 2020
2 parents 4deb117 + 06d596e commit cef892d
Show file tree
Hide file tree
Showing 17 changed files with 202 additions and 86 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ target_link_libraries(fv3core PRIVATE fms)
target_link_libraries(fv3core PRIVATE gfsphysics)
target_link_libraries(fv3core PRIVATE ipd)

target_include_directories(fv3core PRIVATE ${ESMF_MOD})
target_include_directories(fv3core PRIVATE atmos_cubed_sphere ${ESMF_MOD})

# end of fv3core

Expand Down
2 changes: 1 addition & 1 deletion atmos_cubed_sphere
10 changes: 5 additions & 5 deletions atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ module atmos_model_mod
use atmosphere_mod, only: atmosphere_scalar_field_halo
use atmosphere_mod, only: atmosphere_get_bottom_layer
use atmosphere_mod, only: set_atmosphere_pelist
use atmosphere_mod, only: Atm, mytile
use atmosphere_mod, only: Atm, mygrid
use block_control_mod, only: block_control_type, define_blocks_packed
use DYCORE_typedefs, only: DYCORE_data_type, DYCORE_diag_type
#ifdef CCPP
Expand Down Expand Up @@ -626,8 +626,8 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step)
Init_parm%area => Atmos%area
Init_parm%tracer_names => tracer_names
#ifdef CCPP
Init_parm%restart = Atm(mytile)%flagstruct%warm_start
Init_parm%hydrostatic = Atm(mytile)%flagstruct%hydrostatic
Init_parm%restart = Atm(mygrid)%flagstruct%warm_start
Init_parm%hydrostatic = Atm(mygrid)%flagstruct%hydrostatic
#endif

#ifdef INTERNAL_FILE_NML
Expand Down Expand Up @@ -688,7 +688,7 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step)
endif
endif

Atm(mytile)%flagstruct%do_skeb = IPD_Control%do_skeb
Atm(mygrid)%flagstruct%do_skeb = IPD_Control%do_skeb

! initialize the IAU module
call iau_initialize (IPD_Control,IAU_data,Init_parm)
Expand All @@ -709,7 +709,7 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step)
call FV3GFS_diag_register (IPD_Diag, Time, Atm_block, IPD_Control, Atmos%lon, Atmos%lat, Atmos%axes)
call IPD_initialize_rst (IPD_Control, IPD_Data, IPD_Diag, IPD_Restart, Init_parm)
#ifdef CCPP
call FV3GFS_restart_read (IPD_Data, IPD_Restart, Atm_block, IPD_Control, Atmos%domain, Atm(mytile)%flagstruct%warm_start)
call FV3GFS_restart_read (IPD_Data, IPD_Restart, Atm_block, IPD_Control, Atmos%domain, Atm(mygrid)%flagstruct%warm_start)
#else
call FV3GFS_restart_read (IPD_Data, IPD_Restart, Atm_block, IPD_Control, Atmos%domain)
#endif
Expand Down
2 changes: 1 addition & 1 deletion ccpp/build_ccpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -eu
# List of valid/tested machines
VALID_MACHINES=( wcoss_cray wcoss_dell_p3 gaea.intel jet.intel \
hera.intel hera.gnu orion.intel \
cheyenne.intel cheyenne.intel-impi cheyenne.gnu cheyenne.pgi endeavor.intel \
cheyenne.intel cheyenne.intel-impi cheyenne.gnu endeavor.intel \
stampede.intel supermuc_phase2.intel macosx.gnu \
linux.intel linux.gnu linux.pgi )

Expand Down
2 changes: 1 addition & 1 deletion ccpp/framework
2 changes: 1 addition & 1 deletion ccpp/physics
8 changes: 0 additions & 8 deletions ccpp/set_compilers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,6 @@ case "$MACHINE_ID" in
export F77=mpif77
export F90=mpif90
;;
cheyenne.pgi)
export CPP="mpicc -E"
export CC=mpicc
export CXX=mpicxx
export FC=mpif90
export F77=mpif77
export F90=mpif90
;;
endeavor.intel)
export CC=mpiicc
export CXX=mpiicpc
Expand Down
18 changes: 17 additions & 1 deletion gfsphysics/GFS_layer/GFS_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module GFS_diagnostics
GFS_stateout_type, GFS_sfcprop_type, &
GFS_coupling_type, GFS_grid_type, &
GFS_tbd_type, GFS_cldprop_type, &
GFS_radtend_type, GFS_diag_type, &
GFS_radtend_type, GFS_diag_type, &
GFS_init_type
implicit none
private
Expand Down Expand Up @@ -3059,6 +3059,22 @@ subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop
ExtDiag(idx)%data(nb)%var2 => Sfcprop(nb)%tsfc(:)
enddo

if (Model%frac_grid) then
do num = 1,Model%kice
write (xtra,'(i1)') num
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'tiice'//trim(xtra)
ExtDiag(idx)%desc = 'internal ice temperature layer ' // trim(xtra)
ExtDiag(idx)%unit = 'K'
ExtDiag(idx)%mod_name = 'gfs_sfc'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => Sfcprop(nb)%tiice(:,num)
enddo
enddo
end if

idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'tg3'
Expand Down
4 changes: 2 additions & 2 deletions gfsphysics/GFS_layer/GFS_physics_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2389,7 +2389,7 @@ subroutine GFS_physics_driver &
call satmedmfvdifq(ix, im, levs, nvdiff, ntcw, ntiw, ntke, &
dvdt, dudt, dtdt, dqdt, &
Statein%ugrs, Statein%vgrs, Statein%tgrs, Statein%qgrs, &
Radtend%htrsw, Radtend%htrlw, xmu, garea, &
Radtend%htrsw, Radtend%htrlw, xmu, garea, islmsk, snowd3, &
Statein%prsik(1,1), rb, Sfcprop%zorl, Diag%u10m, Diag%v10m, &
Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, hflxq, evapq, &
stress, wind, kpbl, Statein%prsi, del, Statein%prsl, &
Expand Down Expand Up @@ -2642,7 +2642,7 @@ subroutine GFS_physics_driver &
call satmedmfvdifq(ix, im, levs, nvdiff, ntcw, ntiwx, ntkev, &
dvdt, dudt, dtdt, dvdftra, &
Statein%ugrs, Statein%vgrs, Statein%tgrs, vdftra, &
Radtend%htrsw, Radtend%htrlw, xmu, garea, &
Radtend%htrsw, Radtend%htrlw, xmu, garea, islmsk, snowd3, &
Statein%prsik(1,1), rb, Sfcprop%zorl, Diag%u10m, Diag%v10m, &
Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, hflxq, evapq, &
stress, wind, kpbl, Statein%prsi, del, Statein%prsl, &
Expand Down
29 changes: 24 additions & 5 deletions gfsphysics/GFS_layer/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: tsfco (:) => null() !< sst in K
real (kind=kind_phys), pointer :: tsfcl (:) => null() !< surface land temperature in K
real (kind=kind_phys), pointer :: tisfc (:) => null() !< surface temperature over ice fraction
real (kind=kind_phys), pointer :: tiice(:,:) => null() !< internal ice temperature
real (kind=kind_phys), pointer :: snowd (:) => null() !< snow depth water equivalent in mm ; same as snwdph
real (kind=kind_phys), pointer :: zorl (:) => null() !< composite surface roughness in cm
real (kind=kind_phys), pointer :: zorlo (:) => null() !< ocean surface roughness in cm
Expand Down Expand Up @@ -773,6 +774,7 @@ module GFS_typedefs
integer :: lsm_noahmp=2 !< flag for NOAH land surface model
integer :: lsm_ruc=3 !< flag for RUC land surface model
integer :: lsoil !< number of soil layers
integer :: kice=2 !< number of layers in sice
#ifdef CCPP
integer :: lsoil_lsm !< number of soil layers internal to land surface model
integer :: lsnow_lsm !< maximum number of snow layers internal to land surface model
Expand Down Expand Up @@ -861,6 +863,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 @@ -874,6 +877,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 @@ -979,7 +983,6 @@ module GFS_typedefs
!< nstf_name(5) : zsea2 in mm
!--- fractional grid
logical :: frac_grid !< flag for fractional grid
logical :: frac_grid_off !< flag for using fractional grid
logical :: ignore_lake !< flag for ignoring lakes
real(kind=kind_phys) :: min_lakeice !< minimum lake ice value
real(kind=kind_phys) :: min_seaice !< minimum sea ice value
Expand Down Expand Up @@ -2209,6 +2212,7 @@ subroutine sfcprop_create (Sfcprop, IM, Model)
allocate (Sfcprop%tsfco (IM))
allocate (Sfcprop%tsfcl (IM))
allocate (Sfcprop%tisfc (IM))
allocate (Sfcprop%tiice (IM,Model%kice))
allocate (Sfcprop%snowd (IM))
allocate (Sfcprop%zorl (IM))
allocate (Sfcprop%zorlo (IM))
Expand All @@ -2225,6 +2229,7 @@ subroutine sfcprop_create (Sfcprop, IM, Model)
Sfcprop%tsfco = clear_val
Sfcprop%tsfcl = clear_val
Sfcprop%tisfc = clear_val
Sfcprop%tiice = clear_val
Sfcprop%snowd = clear_val
Sfcprop%zorl = clear_val
Sfcprop%zorlo = clear_val
Expand Down Expand Up @@ -3119,6 +3124,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 @@ -3215,7 +3222,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
!< nstf_name(5) : zsea2 in mm
!--- fractional grid
logical :: frac_grid = .false. !< flag for fractional grid
logical :: frac_grid_off = .true. !< flag for using fractional grid
logical :: ignore_lake = .true. !< flag for ignoring lakes
real(kind=kind_phys) :: min_lakeice = 0.15d0 !< minimum lake ice value
real(kind=kind_phys) :: min_seaice = 1.0d-11 !< minimum sea ice value
Expand Down Expand Up @@ -3359,6 +3365,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
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 All @@ -3382,7 +3389,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
!--- near surface sea temperature model
nst_anl, lsea, nstf_name, &
frac_grid, min_lakeice, min_seaice, min_lake_height, &
frac_grid_off, ignore_lake, &
ignore_lake, &
!--- surface layer
sfc_z0_type, &
! vertical diffusion
Expand Down Expand Up @@ -3820,6 +3827,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 Expand Up @@ -3930,7 +3950,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &

!--- fractional grid
Model%frac_grid = frac_grid
Model%frac_grid_off = frac_grid_off
Model%ignore_lake = ignore_lake
Model%min_lakeice = min_lakeice
Model%min_seaice = min_seaice
Expand Down Expand Up @@ -4314,7 +4333,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
endif

print *,' nst_anl=',Model%nst_anl,' use_ufo=',Model%use_ufo,' frac_grid=',Model%frac_grid,&
' frac_grid_off=',frac_grid_off,' ignore_lake=',ignore_lake
' ignore_lake=',ignore_lake
print *,' min_lakeice=',Model%min_lakeice,' min_seaice=',Model%min_seaice, &
'min_lake_height=',Model%min_lake_height
if (Model%nstf_name(1) > 0 ) then
Expand Down
25 changes: 25 additions & 0 deletions gfsphysics/GFS_layer/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,13 @@
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
[tiice]
standard_name = internal_ice_temperature
long_name = sea ice internal temperature
units = K
dimensions = (horizontal_dimension,ice_vertical_dimension)
type = real
kind = kind_phys
[snowd]
standard_name = surface_snow_thickness_water_equivalent
long_name = water equivalent snow depth
Expand Down Expand Up @@ -2835,6 +2842,12 @@
units = flag
dimensions = ()
type = integer
[kice]
standard_name = ice_vertical_dimension
long_name = vertical loop extent for ice levels, start at 1
units = count
dimensions = ()
type = integer
[lsoil]
standard_name = soil_vertical_dimension
long_name = number of soil layers
Expand Down Expand Up @@ -3167,6 +3180,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
2 changes: 1 addition & 1 deletion gfsphysics/physics/radsw_datatb.f
Original file line number Diff line number Diff line change
Expand Up @@ -2552,7 +2552,7 @@ module module_radsw_sflux !
!> band index (3rd index in array sfluxref described below)
integer, dimension(nblow:nbhgh), public :: ibx

data layreffr/ 18,30, 6, 3, 3, 8, 2, 6, 1, 2, 0,32,58,49 /
data layreffr/ 18,30, 6, 3, 3, 8, 2, 6, 1, 2, 0,32,42,49 /
data ix1 / 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 3, 0 /
data ix2 / 5, 2, 5, 2, 0, 2, 6, 0, 6, 0, 0, 0, 6, 0 /
data ibx / 1, 1, 1, 2, 2, 3, 4, 3, 5, 4, 5, 6, 2, 7 /
Expand Down
6 changes: 2 additions & 4 deletions gfsphysics/physics/samfdeepcnv.f
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ subroutine samfdeepcnv(im,ix,km,delt,itc,ntc,ntk,ntr,delp,
parameter(clamd=0.03,tkemx=0.65,tkemn=0.05)
parameter(dtke=tkemx-tkemn)
parameter(dbeta=0.1)
parameter(cthk=200.,dthk=25.)
parameter(cthk=150.,dthk=25.)
parameter(cinpcrmx=180.,cinpcrmn=120.)
! parameter(cinacrmx=-120.,cinacrmn=-120.)
parameter(cinacrmx=-120.,cinacrmn=-80.)
Expand Down Expand Up @@ -1191,9 +1191,7 @@ subroutine samfdeepcnv(im,ix,km,delt,itc,ntc,ntk,ntr,delp,
!
k = kbcon(i)
dp = 1000. * del(i,k)
xmbmax(i) = dp / (2. * g * dt2)
!
! xmbmax(i) = dp / (g * dt2)
xmbmax(i) = dp / (g * dt2)
!
! mbdt(i) = 0.1 * dp / g
!
Expand Down
Loading

0 comments on commit cef892d

Please sign in to comment.