Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/core_ocean/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,10 @@
/>
</nml_record>
<nml_record name="forcing" mode="init;forward">
<nml_option name="config_use_variable_drag" type="logical" default_value=".false." units="unitless"
description="Controls if variable drag is enabled."
possible_values=".true. or .false."
/>
<nml_option name="config_use_bulk_wind_stress" type="logical" default_value=".false." units="unitless"
description="Controls if zonal and meridional components of windstress are used to build surface wind stress."
possible_values=".true. or .false."
Expand Down Expand Up @@ -1059,6 +1063,14 @@
description="Dimensionless bottom drag coefficient, $c_{drag}$."
possible_values="any positive real, typically 1.0e-3"
/>
<nml_option name="config_use_implicit_bottom_drag_variable" type="logical" default_value=".false." units="unitless"
description="If true, spatially-variable implicit bottom drag is used on the momentum equation."
possible_values=".true. or .false."
/>
<nml_option name="config_use_implicit_bottom_drag_variable_mannings" type="logical" default_value=".false." units="unitless"
description="If true, uses Mannings' n values for the computation of Cd=g*n^2*h^{-1/3}."
possible_values=".true. or .false."
/>
<nml_option name="config_use_explicit_bottom_drag" type="logical" default_value=".false." units="unitless"
description="If true, explicit bottom drag is used on the momentum equation."
possible_values=".true. or .false."
Expand Down Expand Up @@ -1430,6 +1442,7 @@
<package name="splitTimeIntegrator" description="This package includes variables required for either the split or unsplit explicit time integrators."/>
<package name="thicknessFilter" description="This package includes variables required for frequency filtered thickness."/>
<package name="windStressBulkPKG" description="This package includes varibles required for bulk wind stress forcing."/>
<package name="variableBottomDragPKG" description="This package includes varibles required for variable bottom drag."/>
<package name="thicknessBulkPKG" description="This package includes varibles required for bulk thickness forcing."/>
<package name="landIcePressurePKG" description="This package includes variables needed for runs with the sea surface depressed by land-ice pressure."/>
<package name="landIceFluxesPKG" description="This package includes varibles required for land ice thickness, momentum and tracer fluxes."/>
Expand Down Expand Up @@ -1557,6 +1570,7 @@
<var name="shortWaveHeatFlux"/>
<var name="evaporationFlux"/>
<var name="rainFlux"/>
<var name="bottomDrag"/>
</stream>

<!-- Forward mode streams -->
Expand Down Expand Up @@ -1965,6 +1979,7 @@
<var name="topDragMagnitude"/>
<var name="landIceFreshwaterFlux"/>
<var name="landIceHeatFlux"/>
<var name="bottomDrag"/>
</stream>

<stream name="Gent_McWilliams_spherical"
Expand Down Expand Up @@ -2972,6 +2987,10 @@
description="Meridional (northward) component of wind stress at cell centers from coupler. Positive northward."
packages="windStressBulkPKG"
/>
<var name="bottomDrag" type="real" dimensions="nCells" units="unitless"
description="Bottom drag Cd coefficient in cells."
packages="variableBottomDragPKG"
/>
<var name="nForcingGroupCounter" type="integer" dimensions="Time"/>
<var name="forcingGroupNames" type="text" dimensions="nForcingGroupsMax Time"/>
<var name="forcingGroupRestartTimes" type="text" dimensions="nForcingGroupsMax Time"/>
Expand Down
10 changes: 10 additions & 0 deletions src/core_ocean/driver/mpas_ocn_core_interface.F
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ function ocn_setup_packages(configPool, packagePool, iocontext) result(ierr)!{{{
logical, pointer :: thicknessFilterActive
logical, pointer :: splitTimeIntegratorActive
logical, pointer :: windStressBulkPKGActive
logical, pointer :: variableBottomDragPKGActive
logical, pointer :: tracerBudgetActive
logical, pointer :: landIcePressurePKGActive
logical, pointer :: landIceFluxesPKGActive
Expand Down Expand Up @@ -159,6 +160,7 @@ function ocn_setup_packages(configPool, packagePool, iocontext) result(ierr)!{{{
character (len=StrKIND), pointer :: config_pressure_gradient_type
character (len=StrKIND), pointer :: config_sw_absorption_type

logical, pointer :: config_use_variable_drag
logical, pointer :: config_use_bulk_wind_stress
logical, pointer :: config_use_bulk_thickness_flux
logical, pointer :: config_compute_active_tracer_budgets
Expand Down Expand Up @@ -230,6 +232,14 @@ function ocn_setup_packages(configPool, packagePool, iocontext) result(ierr)!{{{
windStressBulkPKGActive = .true.
end if

!
! test for variable bottom drag of momentum, variableBottomDragPKG
call mpas_pool_get_package(packagePool, 'variableBottomDragPKGActive', variableBottomDragPKGActive)
call mpas_pool_get_config(configPool, 'config_use_variable_drag', config_use_variable_drag)
if ( config_use_variable_drag ) then
variableBottomDragPKGActive = .true.
end if

!
! test for tracer budget
!
Expand Down
8 changes: 8 additions & 0 deletions src/core_ocean/mode_init/Registry_tidal_boundary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,12 @@
description="Fraction of the domain the plug should take up initially. Only in the y direction."
possible_values="Any real number between 0 and 1."
/>
<nml_option name="config_tidal_forcing_left_Cd_or_n" type="real" default_value="1.0e-3" units="unitless"
description="Bottom drag of left side of the boundary."
possible_values="Any real number"
/>
<nml_option name="config_tidal_forcing_right_Cd_or_n" type="real" default_value="1.0e-3" units="unitless"
description="Bottom drag of right side of the boundary."
possible_values="Any real number"
/>
</nml_record>
19 changes: 18 additions & 1 deletion src/core_ocean/mode_init/mpas_ocn_init_tidal_boundary.F
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ subroutine ocn_init_setup_tidal_boundary(domain, iErr)!{{{
integer, dimension(:), pointer :: maxLevelCell
real (kind=RKIND), dimension(:), pointer :: yCell, refBottomDepth, bottomDepth, vertCoordMovementWeights, dcEdge
real (kind=RKIND), dimension(:), pointer :: tidalInputMask
real (kind=RKIND), dimension(:), pointer :: bottomDrag
real (kind=RKIND), dimension(:), pointer :: ssh
real (kind=RKIND), dimension(:,:), pointer :: layerThickness, restingThickness, zMid
real (kind=RKIND), dimension(:,:,:), pointer :: activeTracers, debugTracers
Expand All @@ -112,14 +113,18 @@ subroutine ocn_init_setup_tidal_boundary(domain, iErr)!{{{
config_tidal_boundary_layer_type
logical, pointer :: config_tidal_boundary_use_distances, config_alter_ICs_for_pbcs
logical, pointer :: config_use_wetting_drying, config_tidal_start_dry
logical, pointer :: config_use_variable_drag
real (kind=RKIND), pointer :: config_tidal_boundary_right_bottom_depth, &
config_tidal_boundary_left_bottom_depth, &
config_tidal_boundary_plug_width_dist, config_tidal_boundary_plug_width_frac, &
config_tidal_boundary_plug_temperature, config_tidal_boundary_domain_temperature, &
config_tidal_boundary_salinity, config_tidal_boundary_isopycnal_min_thickness, &
config_tidal_boundary_left_value, &
config_tidal_boundary_right_value, &
config_drying_min_cell_height
config_drying_min_cell_height, &
config_tidal_boundary_water_thickness, &
config_tidal_forcing_left_Cd_or_n, &
config_tidal_forcing_right_Cd_or_n
integer, pointer :: config_tidal_boundary_min_vert_levels


Expand Down Expand Up @@ -147,6 +152,9 @@ subroutine ocn_init_setup_tidal_boundary(domain, iErr)!{{{
call mpas_pool_get_config(ocnConfigs, 'config_tidal_boundary_domain_temperature', config_tidal_boundary_domain_temperature)
call mpas_pool_get_config(ocnConfigs, 'config_tidal_boundary_salinity', config_tidal_boundary_salinity)
call mpas_pool_get_config(ocnConfigs, 'config_alter_ICs_for_pbcs', config_alter_ICs_for_pbcs)
call mpas_pool_get_config(ocnConfigs, 'config_tidal_forcing_left_Cd_or_n', config_tidal_forcing_left_Cd_or_n)
call mpas_pool_get_config(ocnConfigs, 'config_tidal_forcing_right_Cd_or_n', config_tidal_forcing_right_Cd_or_n)
call mpas_pool_get_config(ocnConfigs, 'config_use_variable_drag', config_use_variable_drag)

call mpas_pool_get_config(ocnConfigs, 'config_tidal_start_dry', config_tidal_start_dry)
call mpas_pool_get_config(ocnConfigs, 'config_use_wetting_drying', config_use_wetting_drying)
Expand Down Expand Up @@ -244,6 +252,15 @@ subroutine ocn_init_setup_tidal_boundary(domain, iErr)!{{{
(config_tidal_boundary_right_bottom_depth - config_tidal_boundary_left_bottom_depth)
end do

if (config_use_variable_drag) then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@caozd999, here is the selection of different types of bottom drag you can use as an example to build your own transect and variable drag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/MPAS-Dev/MPAS-Model/pull/389/files#diff-6270014bc9ae9b8554f8af50127caf5fL242 above shows bottom depth that needs modified.

I recommend building your own new src/core_ocean/mode_init/mpas_ocn_init_tidal_transect.F case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll merge this PR here and you can do a new PR on top of this merged one.

call mpas_pool_get_array(forcingPool, 'bottomDrag', bottomDrag)
do iCell = 1, nCellsSolve
bottomDrag(iCell) = config_tidal_forcing_left_Cd_or_n &
+ (yCell(iCell) - yMin) / (yMax - yMin) * &
(config_tidal_forcing_right_Cd_or_n - config_tidal_forcing_left_Cd_or_n)
end do
end if

if (config_use_wetting_drying .and. config_tidal_start_dry .and. &
trim(config_tidal_boundary_layer_type) == 'zstar') then
do iCell = 1, nCellsSolve
Expand Down
Loading