<img align="left" width="60%" src="http://www.lsce.ipsl.fr/Css/img/banniere_LSCE_75.png" >
LSCE/IPSL, CEA-CNRS-UVSQ, Gif-sur-Yvette, France
In [ ]:
%%bash
pwd
mkdir code
cd code
git clone https://github.com/jamesorr/mocsy.git
cd mocsy
make
pwd
In [1]:
## Preliminaries
import numpy as np
import pandas as pd
import os, sys
The first uncommented line below is the subdirectory where the make
command was executed (where mocsy.so
is located)
In [2]:
# Comment out 1st line below, and Uncomment 2nd line below (if you have run the cell above under section 1.1)
mocsy_dir = "/homel/orr/Software/fortran/mocsy"
#mocsy_dir = "./code/mocsy"
sys.path.append (mocsy_dir)
import mocsy
In [3]:
print mocsy.mvars.vars.__doc__
In [4]:
# Options:
optCON = 'mol/kg'
optT = 'Tinsitu'
optP = 'm'
#optB = 'l10'
optB = 'u74'
optK1K2 = 'l'
optKf = 'dg'
# Standard 6 input variables
temp = 18.0
sal = 35.0
alk = 2300.e-6
dic = 2000.e-6
#phos = 2.0e-6
#sil = 60.0e-6
phos = 0.0e-6
sil = 0.0e-6
# Other standard input (depth, atm pressure, latitude)
depth = 0.
Patm = 1.0
lat = 0.
In [5]:
ph, pco2, fco2, co2, hco3, co3, OmegaA, OmegaC, BetaD, rhoSW, p, tempis = mocsy.mvars.vars(
temp, sal, alk, dic, sil, phos, Patm, depth, lat,
optCON, optT, optP, optb=optB, optk1k2=optK1K2, optkf=optKf )
In [6]:
print ph, pco2, fco2, co2, hco3, co3, OmegaA, OmegaC, BetaD, rhoSW, p, tempis
In [7]:
print mocsy.merrors.__doc__
In [9]:
#etemp, esal = 0.01, 0.01
etemp, esal = 0.0, 0.0
ealk, edic = 2e-6, 2e-6
esil = 5e-6
ephos = 0.1e-6
In [10]:
[eH, epCO2, efCO2, eCO2, eHCO3, eCO3, eOmegaA, eOmegaC] = \
mocsy.merrors(
temp, sal, alk, dic, sil, phos, Patm, depth, lat,
etemp, esal, ealk, edic, esil, ephos,
optCON, optT, optP, optb=optB, optk1k2=optK1K2, optkf=optKf, optgas='Pinsitu', ebt=0.01)
print eH, epCO2, efCO2, eCO2, eHCO3, eCO3, eOmegaA, eOmegaC
In [14]:
[eH, epCO2, efCO2, eCO2, eHCO3, eCO3, eOmegaA, eOmegaC] = \
mocsy.merrors(
temp, sal, alk, dic, sil, phos, Patm, depth, lat,
etemp, esal, ealk, edic, esil, ephos,
optCON, optT, optP, optb=optB, optk1k2=optK1K2, optkf=optKf, optgas='Pinsitu')
print eH, epCO2, efCO2, eCO2, eHCO3, eCO3, eOmegaA, eOmegaC
errors
specifying most all of the arguments, including the optional ones for just the errors routine (r, epk, and ebt).In the cell below, the results would be identical if those 3 options were not present, because the values listed are the defaults in the errors
routine:
In [15]:
[eH, epCO2, efCO2, eCO2, eHCO3, eCO3, eOmegaA, eOmegaC] = \
mocsy.merrors(
temp, sal, alk, dic, sil, phos, Patm, depth, lat,
etemp, esal, ealk, edic, esil, ephos,
optCON, optT, optP, optb=optB, optk1k2=optK1K2, optkf=optKf,
r=0.0, epk=np.array([0.002,0.0075,0.015,0.01,0.01,0.02,0.02]), ebt=0.02)
print eH, epCO2, efCO2, eCO2, eHCO3, eCO3, eOmegaA, eOmegaC
In [16]:
[eH, epCO2, efCO2, eCO2, eHCO3, eCO3, eOmegaA, eOmegaC] = \
mocsy.merrors(
temp, sal, alk, dic, sil, phos, Patm, depth, lat,
etemp, esal, ealk, edic, esil, ephos,
optCON, optT, optP, optb=optB, optk1k2=optK1K2, optkf=optKf)
print eH, epCO2, efCO2, eCO2, eHCO3, eCO3, eOmegaA, eOmegaC
In [17]:
[eH, epCO2, efCO2, eCO2, eHCO3, eCO3, eOmegaA, eOmegaC] = \
mocsy.merrors(
temp, sal, alk, dic, sil, phos, Patm, depth, lat,
etemp, esal, ealk, edic, esil, ephos,
optCON, optT, optP, optb=optB, optk1k2=optK1K2, optkf=optKf,
epk=np.array([0.000,0.000,0.00,0.00,0.00,0.00,0.00]), ebt=0.00)
print eH, epCO2, efCO2, eCO2, eHCO3, eCO3, eOmegaA, eOmegaC
In [18]:
[eH, epCO2, efCO2, eCO2, eHCO3, eCO3, eOmegaA, eOmegaC] = \
mocsy.merrors(
temp, sal, alk, dic, sil, phos, Patm, depth, lat,
etemp, esal, ealk, edic, esil, ephos,
optCON, optT, optP, optb=optB, optk1k2=optK1K2, optkf=optKf, r=1.0)
print eH, epCO2, efCO2, eCO2, eHCO3, eCO3, eOmegaA, eOmegaC