Skip to content

Commit

Permalink
updating to v2.3.0. Details in changelog.
Browse files Browse the repository at this point in the history
  • Loading branch information
maximusjstevens committed Nov 2, 2023
1 parent 03c6c33 commit 1e827fd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions CFM_main/firn_density_nospin.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,17 @@ def __init__(self, configName, climateTS = None, NewSpin = False):
# print('"Exact" time setup will not work properly if input forcing does not all have the same time')
# yr_start = input_year_temp[0] #previously had [1] - error? 20/3/3
# yr_end = input_year_temp[-1]
self.dt = np.diff(input_year_temp)*S_PER_YEAR #[units s]
self.dt = np.diff(input_year_temp)*S_PER_YEAR #[units s] #version 2.2.0 and earlier had just this.
self.dt = np.append(np.mean(self.dt),self.dt) # added version 2.3.0
# self.dt = np.append(self.dt,self.dt[-1])
self.stp = len(self.dt)
self.modeltime = input_year_temp[1:] # this offset because use diff above
# self.modeltime = input_year_temp[0:-1]
yr_start = self.modeltime[0]
yr_end = self.modeltime[-1]
# self.t = np.mean(np.diff(input_year_temp))
self.t = np.diff(input_year_temp)
# self.t = np.diff(input_year_temp) # old, v2.2.0 and earlier
self.t = self.dt/S_PER_YEAR # new in v2.3.0
init_time = input_year_temp[0]

elif self.c['timesetup']=='retmip': #VV retmip experiments require to match perfectly their 3h time step
Expand Down
2 changes: 1 addition & 1 deletion CFM_main/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

__author__ = "C. Max Stevens, Vincent Verjans, Brita Horlings, Annika Horlings, Jessica Lundin"
__license__ = "MIT"
__version__ = "2.2.0"
__version__ = "2.3.0"
__maintainer__ = "Max Stevens"
__email__ = "[email protected]"
__status__ = "Production"
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ https://communityfirnmodel.readthedocs.io/en/latest/
## [2.3.0] 2023-11-02
### Notes
- This version fixes two issues: when using the 'spinupdate' feature, the code would take the first time step off of each subsequent run when spinupdate was enabled. Now it does not. There was also an issue that merge.py did not correctly change the gridtrack variable when merging layers.
- I also made a change to how CFM handles time steps when timesetup is set to 'exact'. The forcing data has a decimal date, and differencing the input times gives a vector (dt) of time-step size. Because length of dt is one less than length of input time, CFM previously used input_time[1:]. Now, CFM appends a value (the mean of dt) to the start of dt. The upshot is where previously the values in the results represented the values in the firn at the start of the time interval, now they represent the values at the end. E.g., if you are using daily time steps, previously the results were the state of the firn at the start of that day, and now they are the state of firn at the end of the day. The reason I made this change is that now the forcing vectors line up exactly with dt, whereas before they were offset by one timestep.

### Fixed
- *merge.py* Merge.py now includes code to corretly reassign gridtrack values to each layer when it runs. The error only occured in isolated scenarios when melt or sublimation would leave the top layer very thin.
Expand Down

0 comments on commit 1e827fd

Please sign in to comment.