Skip to content

Commit

Permalink
Merge branch 'jonbob/ocn/add-akt-tilt-coupling' into next (PR #1278)
Browse files Browse the repository at this point in the history
Modifications needed for time filtered ssh gradient coupling

This PR adds changes needed to the ocean core to allow filtering of high
frequency modes from sea surface tilt. It includes modifications to the ocn
driver as well as the mpas-o model itself:
* Added a new namelist option specifying the filtering timescale
* Added a new set of variables to registry that are the filtered ssh gradient
It incorporates MPAS PR 1245. This PR will change answers for all compsets with
active ocean.  Tested to be BFB when the new namelist option,
config_ssh_grad_relax_timescale, is set to 0.0.  But also tested to have the
expected impact in ongoing T62-oRRS18to6 GMPAS simulation.

[NML]
[non-BFB]
  • Loading branch information
jonbob committed Feb 21, 2017
2 parents 1e30505 + 24cdc59 commit 80ff3aa
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 3 deletions.
7 changes: 7 additions & 0 deletions components/mpas-o/bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,12 @@ add_default($nl, 'config_use_bulk_thickness_flux');
add_default($nl, 'config_flux_attenuation_coefficient');
add_default($nl, 'config_flux_attenuation_coefficient_runoff');

############################
# Namelist group: coupling #
############################

add_default($nl, 'config_ssh_grad_relax_timescale');

######################################
# Namelist group: shortwaveRadiation #
######################################
Expand Down Expand Up @@ -1794,6 +1800,7 @@ my @groups = qw(run_modes
vmix_tanh
cvmix
forcing
coupling
shortwaveradiation
frazil_ice
land_ice_fluxes
Expand Down
1 change: 1 addition & 0 deletions components/mpas-o/bld/build-namelist-group-list
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ my @groups = qw(run_modes
vmix_tanh
cvmix
forcing
coupling
shortwaveradiation
frazil_ice
land_ice_fluxes
Expand Down
6 changes: 6 additions & 0 deletions components/mpas-o/bld/build-namelist-section
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,12 @@ add_default($nl, 'config_use_bulk_thickness_flux');
add_default($nl, 'config_flux_attenuation_coefficient');
add_default($nl, 'config_flux_attenuation_coefficient_runoff');

############################
# Namelist group: coupling #
############################

add_default($nl, 'config_ssh_grad_relax_timescale');

######################################
# Namelist group: shortwaveRadiation #
######################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@
<config_flux_attenuation_coefficient>0.001</config_flux_attenuation_coefficient>
<config_flux_attenuation_coefficient_runoff>10.0</config_flux_attenuation_coefficient_runoff>

<!-- coupling -->
<config_ssh_grad_relax_timescale>86400.0</config_ssh_grad_relax_timescale>

<!-- shortwaveRadiation -->
<config_sw_absorption_type>'jerlov'</config_sw_absorption_type>
<config_jerlov_water_type>3</config_jerlov_water_type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,17 @@ Default: Defined in namelist_defaults.xml
</entry>


<!-- 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 removes any relaxation and gives instantaneous response.

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


<!-- shortwaveRadiation -->

<entry id="config_sw_absorption_type" type="char*1024"
Expand Down
39 changes: 37 additions & 2 deletions components/mpas-o/driver/ocn_comp_mct.F
Original file line number Diff line number Diff line change
Expand Up @@ -1884,6 +1884,7 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{
integer, dimension(:), pointer :: landIceMask

real (kind=RKIND), dimension(:), pointer :: seaIceEnergy, accumulatedFrazilIceMass, frazilSurfacePressure, &
filteredSSHGradientZonal, filteredSSHGradientMeridional, &
CO2Flux, DMSFlux, surfaceUpwardCO2Flux, &
avgOceanSurfaceDIC, &
avgOceanSurfaceDON, &
Expand All @@ -1908,8 +1909,17 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{
config_use_DMSTracers_sea_ice_coupling, &
config_use_MacroMoleculesTracers_sea_ice_coupling

real(kind=RKIND), pointer :: &
config_ssh_grad_relax_timescale

real(kind=RKIND) :: &
timeFilterFactor

logical :: keepFrazil

! flag to check if this is the first export to allow setting of relaxed coupling variables.
logical :: firstExport = .true.

errorcode = 0

! get configure options
Expand All @@ -1923,6 +1933,8 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{
config_use_DMSTracers_sea_ice_coupling)
call mpas_pool_get_config(domain % configs, 'config_use_MacroMoleculesTracers_sea_ice_coupling', &
config_use_MacroMoleculesTracers_sea_ice_coupling)
call mpas_pool_get_config(domain % configs, 'config_ssh_grad_relax_timescale', &
config_ssh_grad_relax_timescale)

n = 0
block_ptr => domain % blocklist
Expand All @@ -1948,6 +1960,8 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{
call mpas_pool_get_array(forcingPool, 'avgTracersSurfaceValue', avgTracersSurfaceValue)
call mpas_pool_get_array(forcingPool, 'avgSurfaceVelocity', avgSurfaceVelocity)
call mpas_pool_get_array(forcingPool, 'avgSSHGradient', avgSSHGradient)
call mpas_pool_get_array(forcingPool, 'filteredSSHGradientZonal', filteredSSHGradientZonal)
call mpas_pool_get_array(forcingPool, 'filteredSSHGradientMeridional', filteredSSHGradientMeridional)
if ( frazilIceActive ) then
call mpas_pool_get_array(forcingPool, 'seaIceEnergy', seaIceEnergy)
call mpas_pool_get_array(forcingPool, 'frazilSurfacePressure', frazilSurfacePressure)
Expand Down Expand Up @@ -1983,6 +1997,27 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{
! call mpas_pool_get_array(forcingPool, 'DMSFlux', DMSFlux)
! call mpas_pool_get_array(forcingPool, 'surfaceUpwardCO2Flux', surfaceUpwardCO2Flux)

! time filter ssh gradient
if (firstExport .and. trim(runtype) == "initial") then
filteredSSHGradientZonal = avgSSHGradient(index_avgZonalSSHGradient, :)
filteredSSHGradientMeridional = avgSSHGradient(index_avgMeridionalSSHGradient, :)
firstExport = .false.
else

if (config_ssh_grad_relax_timescale < real(ocn_cpl_dt,RKIND)) then
timeFilterFactor = 1.0_RKIND
else
timeFilterFactor = real(ocn_cpl_dt,RKIND) / config_ssh_grad_relax_timescale
endif

filteredSSHGradientZonal = filteredSSHGradientZonal * (1.0_RKIND - timeFilterFactor) + &
avgSSHGradient(index_avgZonalSSHGradient, :) * timeFilterFactor

filteredSSHGradientMeridional = filteredSSHGradientMeridional * (1.0_RKIND - timeFilterFactor) + &
avgSSHGradient(index_avgMeridionalSSHGradient, :) * timeFilterFactor

endif

do i = 1, nCellsSolve
n = n + 1

Expand All @@ -1991,8 +2026,8 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{
o2x_o % rAttr(index_o2x_So_u, n) = avgSurfaceVelocity(index_avgZonalSurfaceVelocity, i)
o2x_o % rAttr(index_o2x_So_v, n) = avgSurfaceVelocity(index_avgMeridionalSurfaceVelocity, 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_So_dhdx, n) = filteredSSHGradientZonal(i)
o2x_o % rAttr(index_o2x_So_dhdy, n) = filteredSSHGradientMeridional(i)
if ( frazilIceActive ) then
! negative when frazil ice can be melted
keepFrazil = .true.
Expand Down
2 changes: 1 addition & 1 deletion components/mpas-o/model
Submodule model updated from 86e1f7 to 06040d

0 comments on commit 80ff3aa

Please sign in to comment.