The documentation for the ARCCSS CMIP5 data searching tools can be found here.
To use this on the CWS Virtual Desktops, I first had to comment out the miniconda command in my .bashrc
file so that it used the default system python. Then I just typed the following before launching the notebook:
vdi $ pip install --user ARCCSSive
vdi $ export CMIP5_DB=sqlite:////g/data1/ua6/unofficial-ESG-replica/tmp/tree/cmip5_raijin_latest.db
In [1]:
from ARCCSSive import CMIP5
import six
import glob
cmip5 = CMIP5.DB.connect()
In [2]:
experiment = 'historicalMisc'
variable = 'tauuo'
mip = 'Omon'
model = 'CCSM4'
ensemble = 'r6i1p10'
outputs = cmip5.outputs(experiment = experiment,
variable = variable,
mip = mip,
model = model,
ensemble = ensemble)
path = '/g/data/ua6/DRSv2/CMIP5/%s/%s/mon/ocean/%s/%s/latest/*' %(model, experiment, ensemble, variable)
print(glob.glob(path))
for o in outputs:
var = o.variable
for v in o.versions:
print(v.path)
for f in outputs.first().filenames():
six.print_(f)
The local install of ARCCSSive can get dated, so you need occasionally need to remove the source files and re-install. e.g:
vdi $ rm -r /home/599/dbi599/.local/lib/python2.7/site-packages/ARCCSSive/
vdi $ rm -r /home/599/dbi599/.local/lib/python2.7/site-packages/ARCCSSive-0.1.3.dev88+gba1abb-py2.7.egg-info/
vdi $ pip install --user ARCCSSive
vdi $ pip freeze | grep -i arc
ARCCSSive==0.2.2
In [28]:
for o in outputs:
#print(o.drstree_path)
print(o.ensemble)
print(o.experiment)
#print(o.filenames)
#print(o.id)
#print(o.latest)
#print(o.metadata)
print(o.mip)
print(o.model)
print(o.realm)
for version in o.versions:
#print(version.checked_on)
#print(version.dataset_id)
#print(version.drstree_path)
print(version.files[0])
#print(version.glob)
#print(version.id)
#print(version.instance_id)
print(version.is_latest)
print(version.metadata)
print(version.path)
print(version.to_update)
print(version.tracking_ids())
print(dir(version.variable))
print(version.version)
print(version.warnings)
print(version.variable.variable)
There's a script within the ARCCSS repo called compare_ESGF.py
:
$ git clone https://github.com/coecms/ARCCSSive.git
$ cd ARCCSSive/examples
$ module load python
$ export CMIP5_DB=sqlite:////g/data1/ua6/unofficial-ESG-replica/tmp/tree/cmip5_raijin_latest.db
$ python compare_ESGF.py -v thetao -e historicalMisc -t Omon
In [21]:
outputs
Out[21]:
In [ ]: