Skip to content

Commit

Permalink
Merge pull request #19 from climbfuji/mynnsfclay_from_joe_in_latest_code
Browse files Browse the repository at this point in the history
Updates to MYNN surface layer scheme (# 17 - based on latest code)
  • Loading branch information
DomHeinzeller authored Apr 3, 2020
2 parents d1ef650 + afd6481 commit fadc3cd
Show file tree
Hide file tree
Showing 7 changed files with 2,581 additions and 1,678 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,17 @@ elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
${CMAKE_CURRENT_SOURCE_DIR}/physics/cu_gf_sh.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_bl_mynn.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_MYNNPBL_wrapper.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_sf_mynn.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_MYNNSFC_wrapper.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_MYNNrad_pre.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_MYNNrad_post.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_mp_thompson_make_number_concentrations.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_SF_JSFC.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_BL_MYJPBL.F90
PROPERTIES COMPILE_FLAGS "-r8 -ftz")

# Reduce optimization for module_sf_mynn.F90 (to avoid an apparent compiler bug with Intel 18 on Hera)
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/physics/module_sf_mynn.F90
PROPERTIES COMPILE_FLAGS "${CMAKE_Fortran_FLAGS_OPT} -O1")
list(APPEND SCHEMES_SFX_OPT ${CMAKE_CURRENT_SOURCE_DIR}/physics/module_sf_mynn.F90)

# Replace -xHost or -xCORE-AVX2 with -xCORE-AVX-I for certain files
set(CMAKE_Fortran_FLAGS_LOPT1 ${CMAKE_Fortran_FLAGS_OPT})
string(REPLACE "-xHOST" "-xCORE-AVX-I"
Expand Down
4 changes: 3 additions & 1 deletion physics/GFS_debug.F90
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling,
call print_var(mpirank,omprank, blkno, 'Tbd%acv' , Tbd%acv)
call print_var(mpirank,omprank, blkno, 'Tbd%acvb' , Tbd%acvb)
call print_var(mpirank,omprank, blkno, 'Tbd%acvt' , Tbd%acvt)
call print_var(mpirank,omprank, blkno, 'Tbd%hpbl' , Tbd%hpbl)
if (Model%do_sppt) then
call print_var(mpirank,omprank, blkno, 'Tbd%dtdtr' , Tbd%dtdtr)
call print_var(mpirank,omprank, blkno, 'Tbd%dtotprcp' , Tbd%dtotprcp)
Expand Down Expand Up @@ -294,7 +295,6 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling,
call print_var(mpirank,omprank, blkno, 'Diag%dpt2m ', Diag%dpt2m)
call print_var(mpirank,omprank, blkno, 'Diag%zlvl ', Diag%zlvl)
call print_var(mpirank,omprank, blkno, 'Diag%psurf ', Diag%psurf)
call print_var(mpirank,omprank, blkno, 'Diag%hpbl ', Diag%hpbl)
call print_var(mpirank,omprank, blkno, 'Diag%pwat ', Diag%pwat)
call print_var(mpirank,omprank, blkno, 'Diag%t1 ', Diag%t1)
call print_var(mpirank,omprank, blkno, 'Diag%q1 ', Diag%q1)
Expand All @@ -310,6 +310,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling,
call print_var(mpirank,omprank, blkno, 'Diag%tdomzr ', Diag%tdomzr)
call print_var(mpirank,omprank, blkno, 'Diag%tdomip ', Diag%tdomip)
call print_var(mpirank,omprank, blkno, 'Diag%tdoms ', Diag%tdoms)
! CCPP/RUC only
if (Model%lsm == Model%lsm_ruc) then
call print_var(mpirank,omprank, blkno, 'Diag%wet1 ', Sfcprop%wetness)
else
Expand Down Expand Up @@ -345,6 +346,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling,
if(Model%lradar) then
call print_var(mpirank,omprank, blkno, 'Diag%refl_10cm ', Diag%refl_10cm)
end if
! CCPP/MYNNPBL only
if (Model%do_mynnedmf) then
call print_var(mpirank,omprank, blkno, 'Diag%edmf_a ', Diag%edmf_a)
call print_var(mpirank,omprank, blkno, 'Diag%edmf_w ', Diag%edmf_w)
Expand Down
21 changes: 15 additions & 6 deletions physics/GFS_surface_composites.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ end subroutine GFS_surface_composites_pre_finalize
subroutine GFS_surface_composites_pre_run (im, frac_grid, flag_cice, cplflx, landfrac, lakefrac, oceanfrac, &
frland, dry, icy, lake, ocean, wet, cice, cimin, zorl, zorlo, zorll, zorl_ocn, &
zorl_lnd, zorl_ice, snowd, snowd_ocn, snowd_lnd, snowd_ice, tprcp, tprcp_ocn, &
tprcp_lnd, tprcp_ice, uustar, uustar_lnd, uustar_ice, weasd, weasd_ocn, &
weasd_lnd, weasd_ice, ep1d_ice, tsfc, tsfco, tsfcl, tsfc_ocn, tsfc_lnd, &
tsfc_ice, tisfc, tice, tsurf, tsurf_ocn, tsurf_lnd, tsurf_ice, gflx_ice, &
tgice, islmsk, semis_rad, semis_ocn, semis_lnd, semis_ice, &
tprcp_lnd, tprcp_ice, uustar, uustar_ocn, uustar_lnd, uustar_ice, &
weasd, weasd_ocn, weasd_lnd, weasd_ice, ep1d_ice, tsfc, tsfco, tsfcl, tsfc_ocn,&
tsfc_lnd, tsfc_ice, tisfc, tice, tsurf, tsurf_ocn, tsurf_lnd, tsurf_ice, &
gflx_ice, tgice, islmsk, semis_rad, semis_ocn, semis_lnd, semis_ice, &
qss, qss_ocn, qss_lnd, qss_ice, hflx, hflx_ocn, hflx_lnd, hflx_ice, &
min_lakeice, min_seaice, errmsg, errflg)

implicit none
Expand All @@ -45,12 +46,13 @@ subroutine GFS_surface_composites_pre_run (im, frac_grid, flag_cice, cplflx, lan
real(kind=kind_phys), dimension(im), intent(in ) :: landfrac, lakefrac, oceanfrac
real(kind=kind_phys), dimension(im), intent(inout) :: cice
real(kind=kind_phys), dimension(im), intent( out) :: frland
real(kind=kind_phys), dimension(im), intent(in ) :: zorl, snowd, tprcp, uustar, weasd
real(kind=kind_phys), dimension(im), intent(in ) :: zorl, snowd, tprcp, uustar, weasd, qss, hflx

real(kind=kind_phys), dimension(im), intent(inout) :: zorlo, zorll, tsfc, tsfco, tsfcl, tisfc, tsurf
real(kind=kind_phys), dimension(im), intent(inout) :: snowd_ocn, snowd_lnd, snowd_ice, tprcp_ocn, &
tprcp_lnd, tprcp_ice, zorl_ocn, zorl_lnd, zorl_ice, tsfc_ocn, tsfc_lnd, tsfc_ice, tsurf_ocn, &
tsurf_lnd, tsurf_ice, uustar_lnd, uustar_ice, weasd_ocn, weasd_lnd, weasd_ice, ep1d_ice, gflx_ice
tsurf_lnd, tsurf_ice, uustar_ocn, uustar_lnd, uustar_ice, weasd_ocn, weasd_lnd, weasd_ice, &
qss_ocn, qss_lnd, qss_ice, hflx_ocn, hflx_lnd, hflx_ice, ep1d_ice, gflx_ice
real(kind=kind_phys), dimension(im), intent( out) :: tice
real(kind=kind_phys), intent(in ) :: tgice
integer, dimension(im), intent(in ) :: islmsk
Expand Down Expand Up @@ -145,6 +147,7 @@ subroutine GFS_surface_composites_pre_run (im, frac_grid, flag_cice, cplflx, lan
tprcp_lnd(i) = tprcp(i)
tprcp_ice(i) = tprcp(i)
if (wet(i)) then ! Water
uustar_ocn(i) = uustar(i)
zorl_ocn(i) = zorlo(i)
tsfc_ocn(i) = tsfco(i)
tsurf_ocn(i) = tsfco(i)
Expand All @@ -153,6 +156,8 @@ subroutine GFS_surface_composites_pre_run (im, frac_grid, flag_cice, cplflx, lan
weasd_ocn(i) = zero
snowd_ocn(i) = zero
semis_ocn(i) = 0.984d0
qss_ocn(i) = qss(i)
hflx_ocn(i) = hflx(i)
endif
if (dry(i)) then ! Land
uustar_lnd(i) = uustar(i)
Expand All @@ -162,6 +167,8 @@ subroutine GFS_surface_composites_pre_run (im, frac_grid, flag_cice, cplflx, lan
tsurf_lnd(i) = tsfcl(i)
snowd_lnd(i) = snowd(i)
semis_lnd(i) = semis_rad(i)
qss_lnd(i) = qss(i)
hflx_lnd(i) = hflx(i)
end if
if (icy(i)) then ! Ice
uustar_ice(i) = uustar(i)
Expand All @@ -173,6 +180,8 @@ subroutine GFS_surface_composites_pre_run (im, frac_grid, flag_cice, cplflx, lan
ep1d_ice(i) = zero
gflx_ice(i) = zero
semis_ice(i) = 0.95d0
qss_ice(i) = qss(i)
hflx_ice(i) = hflx(i)
end if
enddo

Expand Down
81 changes: 81 additions & 0 deletions physics/GFS_surface_composites.meta
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,15 @@
kind = kind_phys
intent = in
optional = F
[uustar_ocn]
standard_name = surface_friction_velocity_over_ocean
long_name = surface friction velocity over ocean
units = m s-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[uustar_lnd]
standard_name = surface_friction_velocity_over_land
long_name = surface friction velocity over land
Expand Down Expand Up @@ -495,6 +504,78 @@
kind = kind_phys
intent = inout
optional = F
[qss]
standard_name = surface_specific_humidity
long_name = surface air saturation specific humidity
units = kg kg-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[qss_ocn]
standard_name = surface_specific_humidity_over_ocean
long_name = surface air saturation specific humidity over ocean
units = kg kg-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[qss_lnd]
standard_name = surface_specific_humidity_over_land
long_name = surface air saturation specific humidity over land
units = kg kg-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[qss_ice]
standard_name = surface_specific_humidity_over_ice
long_name = surface air saturation specific humidity over ice
units = kg kg-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[hflx]
standard_name = kinematic_surface_upward_sensible_heat_flux
long_name = kinematic surface upward sensible heat flux
units = K m s-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[hflx_ocn]
standard_name = kinematic_surface_upward_sensible_heat_flux_over_ocean
long_name = kinematic surface upward sensible heat flux over ocean
units = K m s-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[hflx_lnd]
standard_name = kinematic_surface_upward_sensible_heat_flux_over_land
long_name = kinematic surface upward sensible heat flux over land
units = K m s-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[hflx_ice]
standard_name = kinematic_surface_upward_sensible_heat_flux_over_ice
long_name = kinematic surface upward sensible heat flux over ice
units = K m s-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[min_lakeice]
standard_name = lake_ice_minimum
long_name = minimum lake ice value
Expand Down
Loading

0 comments on commit fadc3cd

Please sign in to comment.