Skip to content

Commit

Permalink
ice_flux: initialize fcondtopn_d as in CICE4
Browse files Browse the repository at this point in the history
In our in-house CICE4 version, we had special initialization code in
ice_flux::init_coupler_flux to initialize the 'fcondtopn_d' and
'fsurfn_d' arrays for ncat != 6. This was needed to avoid going out of
bounds on the loop on ncat where these arrays are used below to
initialize fcondtopn_f and fsurfn_f.

This was fixed in CICE in 97370d7 (Update testing, in particular for
diagnostics and decompositions (CICE-Consortium#602), 2021-05-26) by using the last
(6th) value of the array for any higher category. This leads to
'fcondtopn_d' having different values in CICE6 for the last 4
categories compared to our in-house CICE4.

To make side-by-side debugging of CICE6 and CICE4 easier, minimize the
differences between the initialization in both models by adding a 7th
value to fcondtopn_d. This makes its fcondtopn_f have identical values
in both models. Adjust 'fsurfn_d' accordingly.
  • Loading branch information
phil-blain committed Sep 12, 2023
1 parent 7ea78bf commit f0c6d57
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cicecore/cicedynB/general/ice_flux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ subroutine init_coupler_flux

integer (kind=int_kind) :: n

integer (kind=int_kind), parameter :: max_d = 6
integer (kind=int_kind), parameter :: max_d = 7
real (kind=dbl_kind) :: fcondtopn_d(max_d), fsurfn_d(max_d)
real (kind=dbl_kind) :: stefan_boltzmann, Tffresh
real (kind=dbl_kind) :: vonkar, zref, iceruf
Expand All @@ -573,9 +573,11 @@ subroutine init_coupler_flux
character(len=*), parameter :: subname = '(init_coupler_flux)'

data fcondtopn_d / -50.0_dbl_kind,-17.0_dbl_kind,-12.0_dbl_kind, &
-9.0_dbl_kind, -7.0_dbl_kind, -3.0_dbl_kind /
-9.0_dbl_kind, -7.0_dbl_kind, -3.0_dbl_kind, &
-1.0_dbl_kind /
data fsurfn_d / 0.20_dbl_kind, 0.15_dbl_kind, 0.10_dbl_kind, &
0.05_dbl_kind, 0.01_dbl_kind, 0.01_dbl_kind /
0.05_dbl_kind, 0.01_dbl_kind, 0.01_dbl_kind, &
0.01_dbl_kind /

call icepack_query_parameters(stefan_boltzmann_out=stefan_boltzmann, &
Tffresh_out=Tffresh, vonkar_out=vonkar, zref_out=zref, iceruf_out=iceruf)
Expand Down

0 comments on commit f0c6d57

Please sign in to comment.