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

Add namelist flag to restore ability to prescribe SST from Python wrapper #173

Merged
merged 9 commits into from
Mar 25, 2021
8 changes: 7 additions & 1 deletion FV3/gfsphysics/GFS_layer/GFS_physics_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,7 @@ subroutine GFS_physics_driver &
real(kind=kind_phys), allocatable, dimension(:,:) :: den
real(kind=kind_phys), allocatable, dimension(:,:) :: dqdt_work
real(kind=kind_phys), pointer :: adjsfcdlw_for_lsm(:), adjsfcdsw_for_lsm(:), adjsfcnsw_for_lsm(:)
real(kind=kind_phys), pointer :: ocean_surface_temperature(:)
spencerkclark marked this conversation as resolved.
Show resolved Hide resolved
integer :: nwat

!! Initialize local variables (mainly for debugging purposes, because the
Expand Down Expand Up @@ -728,6 +729,11 @@ subroutine GFS_physics_driver &
adjsfcnsw_for_lsm => adjsfcnsw
endif

if (Model%override_ocean_surface_temperature) then
ocean_surface_temperature => Sfcprop%tsfco
else
ocean_surface_temperature => Sfcprop%tsfc
endif
mcgibbon marked this conversation as resolved.
Show resolved Hide resolved
!-------
! For COORDE-2019 averaging with fwindow, it was done before
! 3Diag fixes and averaging ingested using "fdaily"-factor
Expand Down Expand Up @@ -1129,7 +1135,7 @@ subroutine GFS_physics_driver &
do i = 1, IM
frland(i) = zero
if (islmsk(i) == 0) then
Sfcprop%tsfco(i) = Sfcprop%tsfc(i)
Sfcprop%tsfco(i) = ocean_surface_temperature(i)
wet(i) = .true.
fice(i) = zero
elseif (islmsk(i) == 1) then
Expand Down
6 changes: 5 additions & 1 deletion FV3/gfsphysics/GFS_layer/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,7 @@ module GFS_typedefs
logical :: iau_filter_increments
real(kind=kind_phys) :: sst_perturbation ! Sea surface temperature perturbation to climatology or nudging SST (default 0.0 K)
logical :: override_surface_radiative_fluxes ! Whether to use Statein to override the surface radiative fluxes
logical :: override_ocean_surface_temperature ! Whether to allow the Python wrapper to override the sea surface temperature
mcgibbon marked this conversation as resolved.
Show resolved Hide resolved
#ifdef CCPP
! From physcons.F90, updated/set in control_initialize
real(kind=kind_phys) :: dxinv ! inverse scaling factor for critical relative humidity, replaces dxinv in physcons.F90
Expand Down Expand Up @@ -3128,6 +3129,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &

real(kind=kind_phys) :: sst_perturbation = 0.0 ! Sea surface temperature perturbation [K]
logical :: override_surface_radiative_fluxes = .false.
logical :: override_ocean_surface_temperature = .false.
!--- END NAMELIST VARIABLES

NAMELIST /gfs_physics_nml/ &
Expand Down Expand Up @@ -3219,7 +3221,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
!--- aerosol scavenging factors ('name:value' string array)
fscav_aero, &
sst_perturbation, &
override_surface_radiative_fluxes
override_surface_radiative_fluxes, override_ocean_surface_temperature

!--- other parameters
integer :: nctp = 0 !< number of cloud types in CS scheme
Expand Down Expand Up @@ -3688,6 +3690,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &

Model%sst_perturbation = sst_perturbation
Model%override_surface_radiative_fluxes = override_surface_radiative_fluxes
Model%override_ocean_surface_temperature = override_ocean_surface_temperature
!--- tracer handling
Model%ntrac = size(tracer_names)
#ifdef CCPP
Expand Down Expand Up @@ -4496,6 +4499,7 @@ subroutine control_print(Model)
print *, ' isot : ', Model%isot
print *, ' sst_perturbation : ', Model%sst_perturbation
print *, ' override_surface_radiative_fluxes: ', Model%override_surface_radiative_fluxes
print *, ' override_ocean_surface_temperature: ', Model%override_ocean_surface_temperature
if (Model%lsm == Model%lsm_noahmp) then
print *, ' Noah MP LSM is used, the options are'
print *, ' iopt_dveg : ', Model%iopt_dveg
Expand Down