From f0c6d576189ccabc3de47e220136f75d8b8f9417 Mon Sep 17 00:00:00 2001 From: Philippe Blain Date: Mon, 1 May 2023 23:09:27 -0400 Subject: [PATCH] ice_flux: initialize fcondtopn_d as in CICE4 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 (#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. --- cicecore/cicedynB/general/ice_flux.F90 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cicecore/cicedynB/general/ice_flux.F90 b/cicecore/cicedynB/general/ice_flux.F90 index 3fe5c1b61..f60bbbc7a 100644 --- a/cicecore/cicedynB/general/ice_flux.F90 +++ b/cicecore/cicedynB/general/ice_flux.F90 @@ -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 @@ -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)