Skip to content

Commit

Permalink
fixing DIP saving issue
Browse files Browse the repository at this point in the history
  • Loading branch information
maximusjstevens committed Apr 10, 2023
1 parent f09bb35 commit e5af223
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 114 deletions.
Binary file removed CFM_main/CFMoutput_example/df/CFMresults.hdf5
Binary file not shown.
Binary file removed CFM_main/CFMoutput_example/df/CFMspin.hdf5
Binary file not shown.
112 changes: 0 additions & 112 deletions CFM_main/CFMoutput_example/df/example_df.json

This file was deleted.

2 changes: 1 addition & 1 deletion CFM_main/example.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"resultsFolder": "CFMoutput_example/df",
"initfirnFile": "example_firndata.csv",
"initprofile": false,
"input_type": "dataframe",
"input_type": "csv",
"input_type_options": ["csv","dataframe"],
"DFresample": "1M",
"DFfile": "CFM_example_input_df.pkl",
Expand Down
4 changes: 3 additions & 1 deletion CFM_main/firn_density_nospin.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def __init__(self, configName, climateTS = None, NewSpin = False):
self.c['spinUpdate'] = False
if self.c['spinUpdate']:
updatedStartDate = initDepth[0] # if the spin file has been updated, this is the date to start the run (find this time in the forcing data)
print('updatedStartDate', updatedStartDate)
else:
updatedStartDate = None

Expand Down Expand Up @@ -1203,7 +1204,7 @@ def time_evolve(self):
self.rho, self.age, self.dz, self.Tz, self.r2, self.z, self.mass, self.dzn, self.LWC, self.PLWC_mem, self.totwatersublim, sublgridtrack, dh_sub = sublim(self,iii) # keeps track of sublimated water for mass conservation
self.compaction = (self.dz_old[0:self.compboxes]-self.dzn)
# self.dzNew = 0
self.dh_acc = self.dh_acc + dh_sub #dh_sub is negative
self.dh_acc = float(self.dh_acc + dh_sub) #dh_sub is negative
if self.doublegrid == True: # gridtrack corrected for sublimation
self.gridtrack = np.copy(sublgridtrack)
znew = np.copy(self.z)
Expand Down Expand Up @@ -1440,6 +1441,7 @@ def update_dH(self,iii):
'''

self.dH = (self.sdz_new - self.sdz_old) + self.dh_acc + self.dh_melt - (self.iceout*self.t[iii]) # iceout has units m ice/year, t is years per time step.

# self.dH2 = self.z[-1] - self.z_old[-1] #- (self.iceout*self.t) # alternative method. Should be the same?
self.dHAll.append(self.dH)
self.dHtot = np.sum(self.dHAll)
Expand Down

0 comments on commit e5af223

Please sign in to comment.