Skip to content

Commit

Permalink
Merge branch 'proteanplanet/ocn/remove-dsshdx-filter' (PR #6067)
Browse files Browse the repository at this point in the history
Removes sea surface height gradient filtering as a stealth option in E3SM

This removes sea surface height gradient filtering from MPAS-Ocean
coupling with MPAS-SeaIce, which is a stealth option in E3SM. This
option was used in E3SM Version 1 to provide a temporary solution to
"tiger stripes" in sea ice concentration associated with non-linear
feedbacks between multiple bugs in the sea ice and ocean codes. The
"tiger stripes" were reduced by time filtering sea surface height
gradient passed from the ocean to the sea ice model through the coupler.
The time filtering option was switched off in Version 2 of E3SM, but the
code remained as a stealth option. This PR completely removes this
stealth option for Version 3. The option should not be used in future.

[NML]
[BFB]
  • Loading branch information
jonbob committed Dec 19, 2023
2 parents 524b754 + fbef231 commit d080e69
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 62 deletions.
1 change: 0 additions & 1 deletion components/mpas-ocean/bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,6 @@ add_default($nl, 'config_flux_attenuation_coefficient_runoff');
# Namelist group: coupling #
############################

add_default($nl, 'config_ssh_grad_relax_timescale');
if (($OCN_ICEBERG eq 'true') && ($OCN_FORCING eq 'active_atm')) {
add_default($nl, 'config_remove_AIS_coupler_runoff', 'val'=>".true.");
} else {
Expand Down
1 change: 0 additions & 1 deletion components/mpas-ocean/bld/build-namelist-section
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ add_default($nl, 'config_flux_attenuation_coefficient_runoff');
# Namelist group: coupling #
############################

add_default($nl, 'config_ssh_grad_relax_timescale');
add_default($nl, 'config_remove_AIS_coupler_runoff');

######################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@
<config_flux_attenuation_coefficient_runoff>10.0</config_flux_attenuation_coefficient_runoff>

<!-- coupling -->
<config_ssh_grad_relax_timescale>0.0</config_ssh_grad_relax_timescale>
<config_remove_AIS_coupler_runoff>.false.</config_remove_AIS_coupler_runoff>

<!-- shortwaveRadiation -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1175,14 +1175,6 @@ Default: Defined in namelist_defaults.xml

<!-- coupling -->

<entry id="config_ssh_grad_relax_timescale" type="real"
category="coupling" group="coupling">
Timescale for relaxation of the ssh gradient for coupling. A value of 0.0 (default) removes any relaxation and gives instantaneous response.

Valid values: Any positive real number.
Default: Defined in namelist_defaults.xml
</entry>

<entry id="config_remove_AIS_coupler_runoff" type="logical"
category="coupling" group="coupling">
If true, solid and liquid runoff from the Antarctic Ice Sheet (below 60S latitude) coming from the coupled is zeroed in the coupler import routines. To be used with data iceberg fluxes coming from the sea ice model.
Expand Down
48 changes: 11 additions & 37 deletions components/mpas-ocean/driver/ocn_comp_mct.F
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,8 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )!{{{
logical, pointer :: config_use_surface_salinity_monthly_restoring
character (len=StrKIND), pointer :: config_land_ice_flux_mode

! Added for coupling interval initialization
! ssh coupling interval initialization
integer, pointer :: index_avgZonalSSHGradient, index_avgMeridionalSSHGradient
real (kind=RKIND), dimension(:), pointer :: filteredSSHGradientZonal, filteredSSHGradientMeridional
real (kind=RKIND), dimension(:,:), pointer :: avgSSHGradient

interface
Expand Down Expand Up @@ -752,10 +751,6 @@ end subroutine xml_stream_get_attributes
call mpas_pool_get_dimension(forcingPool, 'index_avgSSHGradientZonal', index_avgZonalSSHGradient)
call mpas_pool_get_dimension(forcingPool, 'index_avgSSHGradientMeridional', index_avgMeridionalSSHGradient)
call mpas_pool_get_array(forcingPool, 'avgSSHGradient', avgSSHGradient)
call mpas_pool_get_array(forcingPool, 'filteredSSHGradientZonal', filteredSSHGradientZonal)
call mpas_pool_get_array(forcingPool, 'filteredSSHGradientMeridional', filteredSSHGradientMeridional)
filteredSSHGradientZonal = avgSSHGradient(index_avgZonalSSHGradient, :)
filteredSSHGradientMeridional = avgSSHGradient(index_avgMeridionalSSHGradient, :)
block_ptr => block_ptr % next
end do
endif
Expand Down Expand Up @@ -889,10 +884,7 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)!{{{
! Added for coupling interval initialization
integer, pointer :: index_avgZonalSSHGradient, index_avgMeridionalSSHGradient
real (kind=RKIND), dimension(:), pointer :: filteredSSHGradientZonal, filteredSSHGradientMeridional
real (kind=RKIND), dimension(:,:), pointer :: avgSSHGradient
real (kind=RKIND), pointer :: config_ssh_grad_relax_timescale
real (kind=RKIND) :: timeFilterFactor
iam = domain % dminfo % my_proc_id
Expand Down Expand Up @@ -1104,29 +1096,13 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)!{{{
if (debugOn) call mpas_log_write('Completed timestep '//trim(timeStamp))
end do

! update coupled variables that get calculated on coupling intervals
! NOTE: could be moved to subroutine
! time filter ssh gradient
! update coupled variables that are calculated on coupling intervals
block_ptr => domain_ptr % blocklist
do while(associated(block_ptr))
call mpas_pool_get_subpool(block_ptr % structs, 'forcing', forcingPool)
call mpas_pool_get_dimension(forcingPool, 'index_avgSSHGradientZonal', index_avgZonalSSHGradient)
call mpas_pool_get_dimension(forcingPool, 'index_avgSSHGradientMeridional', index_avgMeridionalSSHGradient)
call mpas_pool_get_array(forcingPool, 'avgSSHGradient', avgSSHGradient)
call mpas_pool_get_array(forcingPool, 'filteredSSHGradientZonal', filteredSSHGradientZonal)
call mpas_pool_get_array(forcingPool, 'filteredSSHGradientMeridional', filteredSSHGradientMeridional)
call mpas_pool_get_config(domain % configs, 'config_ssh_grad_relax_timescale', &
config_ssh_grad_relax_timescale)
if (config_ssh_grad_relax_timescale < real(ocn_cpl_dt,RKIND)) then
filteredSSHGradientZonal = avgSSHGradient(index_avgZonalSSHGradient, :)
filteredSSHGradientMeridional = avgSSHGradient(index_avgMeridionalSSHGradient, :)
else
timeFilterFactor = real(ocn_cpl_dt,RKIND) / config_ssh_grad_relax_timescale
filteredSSHGradientZonal = filteredSSHGradientZonal * (1.0_RKIND - timeFilterFactor) + &
avgSSHGradient(index_avgZonalSSHGradient, :) * timeFilterFactor
filteredSSHGradientMeridional = filteredSSHGradientMeridional * (1.0_RKIND - timeFilterFactor) + &
avgSSHGradient(index_avgMeridionalSSHGradient, :) * timeFilterFactor
endif
block_ptr => block_ptr % next
end do

Expand Down Expand Up @@ -2545,7 +2521,8 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{

integer :: i, n
integer, pointer :: nCellsSolve, index_temperatureSurfaceValue, index_salinitySurfaceValue, &
index_avgZonalSurfaceVelocity, index_avgMeridionalSurfaceVelocity
index_avgZonalSurfaceVelocity, index_avgMeridionalSurfaceVelocity, &
index_avgZonalSSHGradient, index_avgMeridionalSSHGradient

type (block_type), pointer :: block_ptr

Expand All @@ -2561,7 +2538,6 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{
integer, dimension(:), pointer :: landIceMask

real (kind=RKIND), dimension(:), pointer :: seaIceEnergy, accumulatedFrazilIceMass, frazilSurfacePressure, &
filteredSSHGradientZonal, filteredSSHGradientMeridional, &
avgTotalFreshWaterTemperatureFlux, &
avgCO2_gas_flux, DMSFlux, surfaceUpwardCO2Flux, &
avgOceanSurfaceDIC, &
Expand All @@ -2578,7 +2554,7 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{
ssh

real (kind=RKIND), dimension(:,:), pointer :: avgTracersSurfaceValue, avgSurfaceVelocity, &
avgOceanSurfacePhytoC, &
avgSSHGradient, avgOceanSurfacePhytoC, &
avgOceanSurfaceDOC, layerThickness

real (kind=RKIND) :: surfaceFreezingTemp
Expand Down Expand Up @@ -2625,16 +2601,18 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{
call mpas_pool_get_dimension(forcingPool, 'index_avgSalinitySurfaceValue', index_salinitySurfaceValue)
call mpas_pool_get_dimension(forcingPool, 'index_avgSurfaceVelocityZonal', index_avgZonalSurfaceVelocity)
call mpas_pool_get_dimension(forcingPool, 'index_avgSurfaceVelocityMeridional', index_avgMeridionalSurfaceVelocity)
call mpas_pool_get_dimension(forcingPool, 'index_avgSSHGradientZonal', index_avgZonalSSHGradient)
call mpas_pool_get_dimension(forcingPool, 'index_avgSSHGradientMeridional', index_avgMeridionalSSHGradient)

call mpas_pool_get_array(statePool, 'ssh', ssh, 1)
call mpas_pool_get_array(statePool, 'layerThickness', layerThickness, 1)

call mpas_pool_get_array(forcingPool, 'landIceMask', landIceMask)
call mpas_pool_get_array(forcingPool, 'avgTracersSurfaceValue', avgTracersSurfaceValue)
call mpas_pool_get_array(forcingPool, 'avgSurfaceVelocity', avgSurfaceVelocity)
call mpas_pool_get_array(forcingPool, 'filteredSSHGradientZonal', filteredSSHGradientZonal)
call mpas_pool_get_array(forcingPool, 'filteredSSHGradientMeridional', filteredSSHGradientMeridional)
call mpas_pool_get_array(forcingPool, 'avgSSHGradient', avgSSHGradient)
call mpas_pool_get_array(forcingPool, 'avgTotalFreshWaterTemperatureFlux', avgTotalFreshWaterTemperatureFlux)

if ( frazilIceActive ) then
call mpas_pool_get_array(forcingPool, 'seaIceEnergy', seaIceEnergy)
call mpas_pool_get_array(forcingPool, 'frazilSurfacePressure', frazilSurfacePressure)
Expand Down Expand Up @@ -2687,15 +2665,11 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{
o2x_o % rAttr(index_o2x_So_v, n) = avgSurfaceVelocity(index_avgMeridionalSurfaceVelocity, i)

o2x_o % rAttr(index_o2x_So_ssh, n) = ssh(i)
o2x_o % rAttr(index_o2x_So_dhdx, n) = filteredSSHGradientZonal(i)
o2x_o % rAttr(index_o2x_So_dhdy, n) = filteredSSHGradientMeridional(i)
o2x_o % rAttr(index_o2x_So_dhdx, n) = avgSSHGradient(index_avgZonalSSHGradient, i)
o2x_o % rAttr(index_o2x_So_dhdy, n) = avgSSHGradient(index_avgMeridionalSSHGradient, i)

o2x_o % rAttr(index_o2x_Faoo_h2otemp, n) = avgTotalFreshWaterTemperatureFlux(i) * rho_sw * cp_sw

if (ocn_rof_two_way) then
o2x_o % rAttr(index_o2x_So_ssh, n) = ssh(i)
end if

if ( frazilIceActive ) then
! negative when frazil ice can be melted
keepFrazil = .true.
Expand Down
15 changes: 1 addition & 14 deletions components/mpas-ocean/src/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -755,10 +755,6 @@
/>
</nml_record>
<nml_record name="coupling" mode="init;forward">
<nml_option name="config_ssh_grad_relax_timescale" type="real" default_value="0.0" units="seconds"
description="Timescale for relaxation of the ssh gradient for coupling. A value of 0.0 (default) removes any relaxation and gives instantaneous response."
possible_values="Any positive real number."
/>
<nml_option name="config_remove_AIS_coupler_runoff" type="logical" default_value=".false."
description="If true, solid and liquid runoff from the Antarctic Ice Sheet (below 60S latitude) coming from the coupled is zeroed in the coupler import routines. To be used with data iceberg fluxes coming from the sea ice model."
possible_values=".true. or .false."
Expand Down Expand Up @@ -1930,8 +1926,7 @@
<var name="accumulatedLandIceHeat"/>
<var name="accumulatedLandIceFrazilMass"/>
<var name="frazilSurfacePressure"/>
<var name="filteredSSHGradientZonal"/>
<var name="filteredSSHGradientMeridional"/>
<var_array name="avgSSHGradient"/>
<var name="forcingGroupNames"/>
<var name="forcingGroupRestartTimes"/>
<var name="gotmVertViscTopOfCell"/>
Expand Down Expand Up @@ -3679,14 +3674,6 @@
description="Time averaged meridional gradient of SSH"
/>
</var_array>
<var name="filteredSSHGradientZonal" type="real" dimensions="nCells Time" units="1"
description="Time filtered zonal gradient of SSH"
packages="forwardMode;analysisMode"
/>
<var name="filteredSSHGradientMeridional" type="real" dimensions="nCells Time" units="1"
description="Time filtered meridional gradient of SSH"
packages="forwardMode;analysisMode"
/>
<var name="avgTotalFreshWaterTemperatureFlux" type="real" dimensions="nCells Time" units="C m s^-1"
description="Sum of heat fluxes associated with water fluxes cell centers sent to coupler. Positive into the ocean."
/>
Expand Down

0 comments on commit d080e69

Please sign in to comment.