Cumulative elevation change in example seems unrealistic.
Jez-Carter opened this issue · comments
Hi there, I've created a simple script to plot the cumulative elevation change against time for the example output with the following path '/CommunityFirnModel/CFM_main/CFMoutput_example/df/CFMresults.hdf5'. I've included this script below. The elevation change for the 40 years is showing as around -17.5m, this seems far too significant a decrease given that the example is meant to be for the Summit station on Greenland, am I missing something?
import xarray as xr
results_filename = '/CommunityFirnModel/CFM_main/CFMoutput_example/df/CFMresults.hdf5'
ds = xr.open_dataset(results_filename)
dimensions_dict = {ds.density.dims[0]:'time',ds.density.dims[1]:'cell'}
ds = ds.rename_dims(dimensions_dict)
year_data = ds.isel(cell=0).density.data
ds = ds.assign_coords(year = ('time',year_data))
ds = ds.isel(cell=slice(1,None))
ds['cumulative_elevation']=ds.DIP[:,6]
ds['cumulative_elevation'].plot.line(x='year')
Hi @Jez-Carter, good catch. It turns out that when we implemented the sublimation physics the elevation change due to surface processes (accumulation, melt, sublimation) was not properly accounted for. The next release, which should be soon, will fix this issue.
Hi @maximusjstevens, thanks for this reply. I found that setting "SUBLIM": false in the json file seemed to help, which aligns with your comment. Although, note I had to change line 454 in firn_density_nospin.py from the commented to the following since I was getting an error message that self.sublim was None:
#self.w_firn = np.mean(self.bdot+self.sublim) * RHO_I / self.rho
self.w_firn = np.mean(self.bdot) * RHO_I / self.rho
Even with setting "SUBLIM": false, I found that I was getting strange behaviour for sites with high melt, where this time it was under-estimating the decrease in elevation with time. To show this I created the following minimal example script where I create an adjusted csv file for SMELT and set the value to a constant 1 m ieq/yr, then I run the CFM with this adjusted csv. I found that the elevation change with time was much less than expected and that it was insensitive to me setting melt even higher.
import pandas as pd
import json
import subprocess
### Adjusting CSV for melt
df = pd.read_csv('/CommunityFirnModel/CFM_main/CFMinput_example/example_SMELT.csv')
df.T[0][:] = 1.0
df.to_csv('/CommunityFirnModel/CFM_main/CFMinput_example/adjusted_SMELT.csv',index=False, header=True)
### Loading and editing JSON file for CFM run
with open('/CommunityFirnModel/CFM_main/example.json', 'r') as read_file:
adjusted_json = json.load(read_file)
adjusted_json['input_type'] = 'csv'
adjusted_json['InputFileNamemelt'] = 'adjusted_SMELT.csv'
adjusted_json['SUBLIM'] = False
with open('/CommunityFirnModel/CFM_main/adjusted.json', 'w') as json_file:
json.dump(adjusted_json, json_file, indent=0)
### Running CFM with edited JSON
subprocess.call(['python','/CommunityFirnModel/CFM_main/main.py','/CommunityFirnModel/CFM_main/adjusted.json','-n'])
The output I got when plotting cumulative elevation was the following:
@Jez-Carter - it turns out this is more or less the same issue as with the sublimation, and the solution is to explicitly add in a term dh_melt that is the elevation lowering due to melt. (Likewise I added a dh_sub term for sublimation). I've just released v1.1.11, which hopefully fixes this. It also fixes the issue you noticed where the code will fail if sublim is turned off. I'll appreciate any testing you can do to see if this version fixes your issue!
@maximusjstevens that's great news thanks, I've tested the new release and it is producing sensible results so it looks like it solves the issue I was running into. I'll do some more testing over the next week or so and will let you know if anything still seems off. Best, Jez.