From 6aa677ec49b415298b6368a19e5122f9c9d49f8e Mon Sep 17 00:00:00 2001 From: David Bailey Date: Thu, 21 Nov 2024 15:39:33 -0700 Subject: [PATCH 1/2] Fix for lwout when aice_init = 0 and aice > 0 --- cicecore/cicedyn/general/ice_flux.F90 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cicecore/cicedyn/general/ice_flux.F90 b/cicecore/cicedyn/general/ice_flux.F90 index f1c6c3be6..7ac447d5f 100644 --- a/cicecore/cicedyn/general/ice_flux.F90 +++ b/cicecore/cicedyn/general/ice_flux.F90 @@ -1209,7 +1209,7 @@ subroutine scale_fluxes (nx_block, ny_block, & real (kind=dbl_kind) :: & ar, & ! 1/aice stefan_boltzmann, & - Tffresh + Tffresh, puny integer (kind=int_kind) :: & i, j ! horizontal indices @@ -1217,7 +1217,7 @@ subroutine scale_fluxes (nx_block, ny_block, & character(len=*), parameter :: subname = '(scale_fluxes)' call icepack_query_parameters(stefan_boltzmann_out=stefan_boltzmann, & - Tffresh_out=Tffresh) + Tffresh_out=Tffresh, puny_out=puny) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & file=__FILE__, line=__LINE__) @@ -1231,7 +1231,10 @@ subroutine scale_fluxes (nx_block, ny_block, & fsens (i,j) = fsens (i,j) * ar flat (i,j) = flat (i,j) * ar fswabs (i,j) = fswabs (i,j) * ar + if (flwout(i,j) > -puny) & + flwout (i,j) = -stefan_boltzmann *(Tf(i,j) + Tffresh)**4 flwout (i,j) = flwout (i,j) * ar + ! Special case where aice_init was zero and aice > 0. evap (i,j) = evap (i,j) * ar Tref (i,j) = Tref (i,j) * ar Qref (i,j) = Qref (i,j) * ar From 6e9933cd216b842ce26c7a4c7a40ad65ac589451 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Mon, 25 Nov 2024 08:56:05 -0700 Subject: [PATCH 2/2] Move comment line --- cicecore/cicedyn/general/ice_flux.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cicecore/cicedyn/general/ice_flux.F90 b/cicecore/cicedyn/general/ice_flux.F90 index 7ac447d5f..6378db6eb 100644 --- a/cicecore/cicedyn/general/ice_flux.F90 +++ b/cicecore/cicedyn/general/ice_flux.F90 @@ -1231,10 +1231,10 @@ subroutine scale_fluxes (nx_block, ny_block, & fsens (i,j) = fsens (i,j) * ar flat (i,j) = flat (i,j) * ar fswabs (i,j) = fswabs (i,j) * ar + ! Special case where aice_init was zero and aice > 0. if (flwout(i,j) > -puny) & flwout (i,j) = -stefan_boltzmann *(Tf(i,j) + Tffresh)**4 flwout (i,j) = flwout (i,j) * ar - ! Special case where aice_init was zero and aice > 0. evap (i,j) = evap (i,j) * ar Tref (i,j) = Tref (i,j) * ar Qref (i,j) = Qref (i,j) * ar