Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ subroutine extract_constituents()
use m_fm_icecover, only: freezing_temperature
use m_get_kbot_ktop, only: getkbotktop
use m_missing, only: dmiss
use m_physcoef, only: salinity_max, salinity_min, use_salinity_freezing_point, temperature_max, temperature_min
use m_physcoef, only: salinity_max, salinity_min, use_salinity_freezing_point, backgroundsalinity, temperature_max, temperature_min
use m_plotdots, only: numdots
use m_sediment, only: mxgr, sed, stm_included, stmpar, ssccum, upperlimitssc
use m_transport, only: isalt, ised1, ispir, itemp, constituents, maserrsed
Expand Down Expand Up @@ -135,15 +135,27 @@ subroutine extract_constituents()
end if

cells_with_min_limit = 0
if (isalt > 0 .and. use_salinity_freezing_point) then ! only at surface limit to freezing point
do kk = 1, ndx
k = ktop(kk)
freezing_point_temperature = real(freezing_temperature(real(constituents(isalt, k), fp)), dp)
if (constituents(itemp, k) < freezing_point_temperature) then
constituents(itemp, k) = freezing_point_temperature
cells_with_min_limit = cells_with_min_limit + 1
end if
end do

if (use_salinity_freezing_point) then
if (isalt > 0) then ! if salinity is modeled, use local salinity to determine freezing point
do kk = 1, ndx
k = ktop(kk)
freezing_point_temperature = real(freezing_temperature(real(constituents(isalt, k), fp)), dp)
if (constituents(itemp, k) < freezing_point_temperature) then
constituents(itemp, k) = freezing_point_temperature
cells_with_min_limit = cells_with_min_limit + 1
end if
end do
else if (isalt == 0) then ! if salinity is not modeled, use background salinity to determine freezing point
freezing_point_temperature = real(freezing_temperature(backgroundsalinity), dp)
do kk = 1, ndx
k = ktop(kk)
if (constituents(itemp, k) < freezing_point_temperature) then
constituents(itemp, k) = freezing_point_temperature
cells_with_min_limit = cells_with_min_limit + 1
end if
end do
end if
end if

if (temperature_min /= dmiss) then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2230,6 +2230,23 @@
</file>
</checks>
</testCase>
<testCase name="e02_f006_c176_freezing_with_background_salinity" ref="dflowfm_default">
<path version="2025-12-08T14:08:55.403000">e02_dflowfm/f006_external_forcing/c176_freezing_with_background_salinity</path>
<maxRunTime>3600.0</maxRunTime>
<checks>
<file name="output/winter97_saltwater-2_map.nc" type="netcdf">
<parameters>
<parameter name="mesh2d_ice_area_fraction" toleranceAbsolute="0.0001" />
<parameter name="mesh2d_ice_thickness" toleranceAbsolute="0.0001" />
</parameters>
</file>
<file name="output/winter97_saltwater-2_his.nc" type="netcdf">
<parameters>
<parameter name="temperature" toleranceAbsolute="0.001" />
</parameters>
</file>
</checks>
</testCase>
<testCase name="e02_f008_c010_ws_bedlevel_asdefault" ref="dflowfm_default">
<path version="2025-10-15T15:15:48.243000">e02_dflowfm/f008_network/c010_ws_bedlevel_asdefault</path>
<maxRunTime>15000.0000000</maxRunTime>
Expand Down