Skip to content

Commit

Permalink
updating to v.1.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
maximusjstevens committed Jun 27, 2022
1 parent d391f23 commit fbdc6f5
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 10 deletions.
7 changes: 5 additions & 2 deletions CFM_main/RCMpkl_to_spin.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ def makeSpinFiles(CLIM_name,timeres='1D',Tinterp='mean',spin_date_st = 1980.0, s

stepsperyear = 1/(df_CLIM_re.decdate.diff().mean())

BDOT_mean_IE = ((df_CLIM_re['BDOT']+df_CLIM_re['SUBLIM'])*stepsperyear/917).mean()
if 'SUBLIM' in df_CLIM_re:
BDOT_mean_IE = ((df_CLIM_re['BDOT']+df_CLIM_re['SUBLIM'])*stepsperyear/917).mean()
else:
BDOT_mean_IE = ((df_CLIM_re['BDOT'])*stepsperyear/917).mean()
T_mean = (df_TS_re['TSKIN']).mean()
print(BDOT_mean_IE)
print(T_mean)
Expand All @@ -186,7 +189,7 @@ def makeSpinFiles(CLIM_name,timeres='1D',Tinterp='mean',spin_date_st = 1980.0, s
depth_S2 = desired_depth * 0.75
#### Make spin up series ###
RCI_length = spin_date_end-spin_date_st+1
num_reps = int(np.round(desired_depth/BDOT_mean_IE/RCI_length))
num_reps = int(np.round(desired_depth/BDOT_mean_IE/RCI_length))
years = num_reps*RCI_length
sub = np.arange(-1*years,0,RCI_length)
startyear = int(df_CLIM_re.index[0].year + sub[0])
Expand Down
10 changes: 5 additions & 5 deletions CFM_main/firn_density_nospin.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,13 +445,13 @@ def __init__(self, configName, climateTS = None, NewSpin = False):
self.iceout = self.c['iceout']
print('Ensure that your iceout value has units m ice eq. per year!')
else:
self.iceout = np.mean(self.bdot) # this is the rate of ice flow advecting out of the column, units m I.E. per year.
self.iceout = np.mean(self.bdot+self.sublim) # this is the rate of ice flow advecting out of the column, units m I.E. per year.

except Exception:
print('add field "manual_iceout" to .json file to set iceout value manually')
self.iceout = np.mean(self.bdot) # this is the rate of ice flow advecting out of the column, units m I.E. per year.

self.w_firn = np.mean(self.bdot) * RHO_I / self.rho
self.w_firn = np.mean(self.bdot+self.sublim) * RHO_I / self.rho

if (np.any(self.bdotSec<0.0) and self.c['bdot_type']=='instant'):
print('ERROR: bdot_type set to "instant" in .json and input')
Expand Down Expand Up @@ -570,14 +570,14 @@ def __init__(self, configName, climateTS = None, NewSpin = False):
self.Trunoff = np.array([0.]) #total runoff, single value for the whole firn column
self.refrozen = np.zeros_like(self.dz) #vrefreezing in every layer, array of size of our grid
self.totalrunoff = np.array([0.]) # Might be useful to have a total final value without having to write every time step
self.totalrefrozen = np.zeros_like(self.dz) # Might be useful to have a total final value without having to write every time step
self.totwatersublim = 0. #VV Total amount of liquid water that get sublimated
self.totalrefrozen = np.zeros_like(self.dz) # Might be useful to have a total final value without having to write every time step
self.lwcerror = 0. #VV
self.totallwcerror = 0. #
#VV update (23/03/2021)
self.refreeze = np.array([0.]) #total liquid water refreezing at each time step [m we]
self.runoff = np.array([0.]) #total liquid water runoff at each time step [m we]
self.meltvol = np.array([0.]) #total melt volume
self.totwatersublim = 0. #VV Total amount of liquid water that get sublimated

### Strain modules
self.c = check_strain_settings(self)
Expand Down Expand Up @@ -822,7 +822,7 @@ def time_evolve(self):
print('modeltime',self.modeltime[0],self.modeltime[-1])
for iii in range(self.stp):
mtime = self.modeltime[iii]
self.D_surf[iii] = iii
self.D_surf[iii] = iii # This gives each layer a tracking number that is just iteration number.
if iii==1000:
if ((self.MELT) and (self.c['liquid']=='darcy')):
pass
Expand Down
2 changes: 1 addition & 1 deletion CFM_main/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

__author__ = "C. Max Stevens, Vincent Verjans, Brita Horlings, Annika Horlings, Jessica Lundin"
__license__ = "MIT"
__version__ = "1.1.8"
__version__ = "1.1.10"
__maintainer__ = "Max Stevens"
__email__ = "[email protected]"
__status__ = "Production"
Expand Down
1 change: 1 addition & 0 deletions CFM_main/strain.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def check_strain_settings(self):
# Check for deprecated config keys.
if 'strain' in self.c:
self.c['horizontal_divergence'] = self.c['strain']
if 'InputFileNamedudx' in self.c:
self.c['InputFileNameStrain'] = self.c['InputFileNamedudx']

# Check if strain settings are set in the config. Otherwise deactivate.
Expand Down
15 changes: 14 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@ All notable changes to the Community Firn Model should be documented in this fil

TL;DR: Write down the changes that you made to the the model in this document and update the version number here and in main.py, then update master on github.

To run the update:
git commit -a -m "updating to vX.Y.Z. Details in changelog."
git push
git tag -a vX.Y.Z -m "CFM version vX.Y.Z"
git push origin vX.Y.Z

Then, on github do a release, which will trigger an updated DOI.

## Current Version
1.1.9
1.1.10

## Full Documentation

Expand All @@ -23,6 +31,11 @@ https://communityfirnmodel.readthedocs.io/en/latest/
- Goujon physics work, but could possibly be implemented more elegantly (it would be nice to avoid globals)
- Not exactly in progress, but at some point adding a log file that gets saved in the results folder would be a good idea.

## [1.1.10]
### Notes
- Version 1.1.10 is a minor update to fix an issue with the strain softening routine introduced in v1.1.9. (The code would throw an error if InputFileNamedudx was not in the .json).
- There is a small update to the documentation regarding BCO outputs.

## [1.1.9]
### Notes
- Version 1.1.9 is an update to add strain softening as described by Oraschewski and Grinsted (2021; https://doi.org/10.5194/tc-2021-240)
Expand Down
9 changes: 8 additions & 1 deletion docs/running/outputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,18 @@ Firn air to a horizon (7) is there because due to the model's lagrangian format,

(I'd advise using caution if you use the modeled elevation change fields - we have made changes to the code to merge deeper nodes together to save computing time, but in doing so that can make the model-outputed dH have blips in it. If you want to work with this field let me know and I can do a bit of testing. I'd recommend structuring your analyses around the FAC variable.)

BCO: bubble close-off properties. 10 columns: time, Martinerie close-off age, Marinerie close-off depth, age of 830 kg m-3 density horizon, depth of 830 kg m-3 density horizon, Martinerie lock-in age, Marinerie lock-in depth, age of 815 kg m-3 density horizon, depth of 815 kg m-3 density horizon, depth of zero porosity.
BCO: bubble close-off properties. 10 columns: time, Martinerie close-off age, Martinerie close-off depth, age of 830 kg m-3 density horizon, depth of 830 kg m-3 density horizon, Martinerie lock-in age, Martinerie lock-in depth, age of 815 kg m-3 density horizon, depth of 815 kg m-3 density horizon, depth of zero closed porosity. The Martinerie fields refer to paramaterizations for close-off properties published by Patricia Martinerie in the early 1990s. See references below.

meltvol: two columnes: decimal time, total melt volume at that time step [m w.e.]

refreeze: two columns: decimal time, total liquid water refreezing at that time step [m w.e.]

runoff: two columns: decimal time, total liquid water runoff at that time step [m w.e.]

**References**
*Goujon, C., Barnola, J.-M., and Ritz, C. (2003), Modeling the densification of polar firn including heat diffusion: Application to close-off characteristics and gas isotopic fractionation for Antarctica and Greenland sites, J. Geophys. Res., 108, 4792, doi:10.1029/2002JD003319, D24.*

*Martinerie, P., Lipenkov, V. Y., Raynaud, D., Chappellaz, J., Barkov, N. I., and Lorius, C. (1994), Air content paleo record in the Vostok ice core (Antarctica): A mixed record of climatic and glaciological parameters, J. Geophys. Res., 99( D5), 10565– 10576, doi:10.1029/93JD03223.*

*Martinerie, P., Raynaud, D., Etheridge, D. M., Barnola, J.-M., & Mazaudier, D. (1992, August). Physical and climatic parameters which influence the air content in polar ice. Earth and Planetary Science Letters. Elsevier BV. https://doi.org/10.1016/0012-821x(92)90002-d*

0 comments on commit fbdc6f5

Please sign in to comment.