ESCOMP / CISM-wrapper

Community Ice Sheet Model wrapper for CESM
http://www.cesm.ucar.edu/models/cesm2.0/land-ice/
Other
3 stars 16 forks source link

Time manager doesn't support years greater than 9999 #19

Closed billsacks closed 5 years ago

billsacks commented 5 years ago

@d80ngv (Sarah Bradley) ran into a problem when doing a run that extended past year 9999: In trying to restart from a file with year 10078:

 Cannot end at a date earlier than starting date.
307   Starting date:   *078-01-01
308   No ending date.
309   Model relies on external signal for stopping.
310 ------------------------------------------------------------------------
311 
312 glc aborting...
313  invalid end date
314 

We thought it might be as the in source_glc/glc_time_management.F90 it is set to 4 digits for the time but we increased to 5 digits and that did not help as it produces the same error message.

We therefore: (1) cloned the original case; copied across the restart files and rpointer.glc/drv/lnd into the */run folder. (2) changed the STARTDATE=10078-0-0 and setting continue_run=TRUE, but that gave errors that it was not a valid restart.

(3) setting continue run=FALSE this seems to be working, but of course the ‘time’ of the hist output files is not correct, but this is just a minor point.

I have a feeling this is due at least in part to limitations in glc_time_management.F90. I can't tell from Sarah's message if they changed everything that would need to be changed: doing a search for '4' in glc_time_management.F90 turns up many instances, including both lengths of character strings and the string_length argument in many int_to_char calls.

One possible approach, then, would be to make sure that glc_time_management gets all the changes it needs to support up to 6-digit years. Another approach (at least longer-term) is to just ditch this module and replace it with a functional time manager, given all of the other issues with this time manager.

ekluzek commented 5 years ago

I'm starting to work on this one.

ekluzek commented 5 years ago

I see one problem already. build-namelist has a hard-coded assumption that years in RUN_STARTDATE are going to be exactly 4 digits. This can be generalized in the perl code so that the number of digits for the year can be any length.

I'm not sure if this is the only problem here, but it's one problem.

ekluzek commented 5 years ago

Another problem is that the end year is hardcoded to 9999 for this case in the time-manager. So it'll stop rather than running.

   select case (stop_option)

   case ('never')   !*** coupler or signal catcher stops glc     

      stop_iopt = stop_opt_never
      iyear_end_run  = 9999