From de872272b0648b3bb470854a62ad6254b0c0f800 Mon Sep 17 00:00:00 2001 From: bderembl Date: Tue, 9 Dec 2025 11:46:51 +0100 Subject: [PATCH 1/2] avdvective temperature flux only for ice cover --- src/gotm/gotm.F90 | 2 +- src/meanflow/temperature.F90 | 8 ++++---- src/util/convert_fluxes.F90 | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gotm/gotm.F90 b/src/gotm/gotm.F90 index b3cf852c..5268a9b3 100644 --- a/src/gotm/gotm.F90 +++ b/src/gotm/gotm.F90 @@ -784,7 +784,7 @@ subroutine integrate_gotm() #ifdef _ICE_ I_0%value = transmissivity*I_0%value swf=melt_rate - shf=ocean_ice_heat_flux + shf=ocean_ice_heat_flux + T(nlev)*swf ssf=ocean_ice_salt_flux #endif else diff --git a/src/meanflow/temperature.F90 b/src/meanflow/temperature.F90 index d314a5ad..2b767d63 100644 --- a/src/meanflow/temperature.F90 +++ b/src/meanflow/temperature.F90 @@ -137,10 +137,10 @@ subroutine temperature(nlev,dt,cnpar,I_0,wflux,hflux,nuh,gamh,rad) DiffBcup = Neumann DiffBcdw = Neumann -! HB: -! Note that this is the surface temperature flux for rigid-lid models like GOTM. -! For a free surface model the surface temperature flux must be - -hflux/(rho0*cp) - DiffTup = -T(nlev)*wflux-hflux/(rho0*cp) +! For the open ocean the surface temperature flux is only the diffusive +! component. In case of ice cover, hflux is defined as the sum of a diffusive +! and advective component. + DiffTup = -hflux/(rho0*cp) #ifndef _ICE_ ! simple sea ice model: surface heat flux switched off for sst < freezing temp if (T(nlev) .le. -0.0575*S(nlev)) then diff --git a/src/util/convert_fluxes.F90 b/src/util/convert_fluxes.F90 index 6b37a80d..75620c83 100644 --- a/src/util/convert_fluxes.F90 +++ b/src/util/convert_fluxes.F90 @@ -66,8 +66,8 @@ subroutine convert_fluxes(nlev,gravity,swf,shf,ssf,rad,Tsrf,Ssrf,tFlux,sFlux,bt beta0 = get_beta(Ssrf,Tsrf,_ZERO_) ! temperature flux and associated buoyancy flux - tFlux = -Tsrf*swf - shf/(rho0*cp) - btFlux = gravity*alpha0*tFlux + tFlux = - shf/(rho0*cp) + btFlux = gravity*alpha0*tFlux ! salinity flux and associated buoyancy flux sFlux = -Ssrf*swf - ssf From 96b051b522e58b472635ed5fbf8be0915e977dda Mon Sep 17 00:00:00 2001 From: bderembl Date: Mon, 12 Jan 2026 09:49:27 +0100 Subject: [PATCH 2/2] consistent salinity and heat fluxes --- src/gotm/gotm.F90 | 5 +++-- src/meanflow/salinity.F90 | 2 +- src/util/convert_fluxes.F90 | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gotm/gotm.F90 b/src/gotm/gotm.F90 index 5268a9b3..a10572d2 100644 --- a/src/gotm/gotm.F90 +++ b/src/gotm/gotm.F90 @@ -784,12 +784,13 @@ subroutine integrate_gotm() #ifdef _ICE_ I_0%value = transmissivity*I_0%value swf=melt_rate - shf=ocean_ice_heat_flux + T(nlev)*swf - ssf=ocean_ice_salt_flux + shf=ocean_ice_heat_flux + rho0*cp*T(nlev)*swf + ssf=ocean_ice_salt_flux + S(nlev)*swf #endif else swf=precip_input%value+evap shf=-heat_input%value ! temperature() changed to positive heat flux upwards (v7) + ssf= S(nlev)*swf tx = tx/rho0 ty = ty/rho0 end if diff --git a/src/meanflow/salinity.F90 b/src/meanflow/salinity.F90 index eac8ed13..bd182cb8 100644 --- a/src/meanflow/salinity.F90 +++ b/src/meanflow/salinity.F90 @@ -116,7 +116,7 @@ subroutine salinity(nlev,dt,cnpar,wflux,sflux,nus,gams) ! set boundary conditions DiffBcup = Neumann DiffBcdw = Neumann - DiffSup = -S(nlev)*wflux-sflux + DiffSup = -sflux DiffSdw = _ZERO_ AdvBcup = oneSided diff --git a/src/util/convert_fluxes.F90 b/src/util/convert_fluxes.F90 index 75620c83..b2d00b05 100644 --- a/src/util/convert_fluxes.F90 +++ b/src/util/convert_fluxes.F90 @@ -70,7 +70,7 @@ subroutine convert_fluxes(nlev,gravity,swf,shf,ssf,rad,Tsrf,Ssrf,tFlux,sFlux,bt btFlux = gravity*alpha0*tFlux ! salinity flux and associated buoyancy flux - sFlux = -Ssrf*swf - ssf + sFlux = - ssf bsFlux = -gravity*beta0*sFlux ! radiative temperature and buoyancy flux profiles