Hello,
I recently completed some paleoclimate simulations in iCESM1.2, and am now trying to compute d18O_precipitation values from the output using the following code:
However, I'm getting some unrealistic d18O_precip values out of this calculation, ranging from -9148167.0 permil to 77604790.0 permil. Am I doing something wrong? Should I simply set a threshold value and ignore anything above and below it?
Any help is appreciated!
I recently completed some paleoclimate simulations in iCESM1.2, and am now trying to compute d18O_precipitation values from the output using the following code:
Code:
# Convert isotope data from rain rate (in m/s) to d18O
fill_val = np.nan # old fill_val = 9.96921e+36
Rstd = 2005.20e-6 # O18/O16 ratio in standard (here, VSMOW) = 2005.20 ± 0.45 ppm (Sharp txtbook, 2007)
Mh2o = 18.015 # mean molecular mass of water
Mh218o = 20.013 # molecular mass of H218O, units = atomic mass units (1/12 mass of 12C ~ 1.66654 E -27 kg)
Mh216o = 18.009 # molecular mass of H216O
# Load in variables as values
H216ORL_ctrl = ds_H216ORL_ctrl.PRECRL_H216OR.values
H216ORC_ctrl = ds_H216ORC_ctrl.PRECRC_H216Or.values
H218ORL_ctrl = ds_H218ORL_ctrl.PRECRL_H218OR.values
H218ORC_ctrl = ds_H218ORC_ctrl.PRECRC_H218Or.values
# Add large-scale and convective values to get total
H216O_ctrl = H216ORL_ctrl + H216ORC_ctrl
H218O_ctrl = H218ORL_ctrl + H218ORC_ctrl
H216O_ctrl[H216O_ctrl == 0] = fill_val # Replace 0's with NaNs for R18O calculation
R18O_ctrl = (H218O_ctrl/H216O_ctrl)*(Mh216o/Mh218o)
d18O_ctrl = (R18O_ctrl - 1)*1000 # Rstandard assumed = 1
However, I'm getting some unrealistic d18O_precip values out of this calculation, ranging from -9148167.0 permil to 77604790.0 permil. Am I doing something wrong? Should I simply set a threshold value and ignore anything above and below it?
Any help is appreciated!