Closed kshedstrom closed 3 years ago
Is there some reason that this isn't the appropriate fix?
diff --git a/src/SIS_state_initialization.F90 b/src/SIS_state_initialization.F90
index 9eaaffa..65719aa 100644
--- a/src/SIS_state_initialization.F90
+++ b/src/SIS_state_initialization.F90
@@ -155,6 +155,8 @@ subroutine ice_state_mass_init(IST, Ice, G, IG, US, PF, init_Time, just_read_par
call data_override_init(Ice_domain_in=Ice%slow_domain_NH)
endif
+ if (just_read) return
+
select case (trim(conc_config))
case ("data_override")
if (.not.just_read) &
@@ -208,8 +210,6 @@ subroutine ice_state_mass_init(IST, Ice, G, IG, US, PF, init_Time, just_read_par
enddo ; enddo ; enddo ; endif
end select
- if (just_read) return
-
total_conc(:,:) = 0.0
do k=1,CatIce ; do j=jsc,jec ; do i=isc,iec
total_conc(i,j) = total_conc(i,j) + IST%part_size(i,j,k)
We need to be able to read and log the parameters that would be used in initialization, even if we are starting this particular run segment from a restart file. Just doing a return does not capture this behavior, but all of the statements like if (.not.just_read)
are supposed to prevent any changes to the model state. If this code change fixes the problem with the lost ice mass, it is highly suggestive of where in the code this intended use of just read is not working.
I think that the answer here is to add the line if (just_read) return ! All run-time parameters have been read, so return.
at about line 514 of SIS_state_initialization.F90, inside of initialize_concentration_from_latitudes()
just after the parameters are read but before any of the state variables are actually altered, analogous to what is done in other routines like initialize_concentration_from_file()
.
Perfect, that explains why the ice masses weren't being lost as well.
I believe that this issue was addressed as a part of PR#136, which has now been merged in to dev/gfdl, and that this issue can now be closed. Please let me know if that is your understanding as well, @kshedstrom.
Yes, closing.
I start my run in September with one of the new ice initializations (1 m north of a specified latitude). If I restart in late December, it reads the restart file, then resets the ice concentration to match the September values. initialize_concentration_from_latitudes gets called on restart even if it shouldn't. On the other hand, my ice mass didn't vanish - until later, when the model realizes there's no ice to hold onto the mass.