Thanks for this Grenville. Am using cf in a new app (calc_IVT) which creates .nc files from UM model level variables (u,v,q,P) in pp files, then calculates integrated water vapour transport online using CDO, and then delete the full profiles that I don’t need before I archive to jasmin.
I think I’ve set up all the scripts I need to do this okay, but I’m getting python errors about missing packages like this:
Traceback (most recent call last):
File "/home/n02/n02/dch/cfdm/cfdm/core/__init__.py", line 29, in <module>
import netCDF4
File "/home/n02/n02/shakka/.local/lib/python3.9/site-packages/netCDF4/__init__.py", line 3, in <module>
from ._netCDF4 import *
ModuleNotFoundError: No module named 'netCDF4._netCDF4'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/n02/n02/dch/cf-python/cf/__init__.py", line 95, in <module>
import cfdm
File "/home/n02/n02/dch/cfdm/cfdm/__init__.py", line 44, in <module>
from . import core
File "/home/n02/n02/dch/cfdm/cfdm/core/__init__.py", line 31, in <module>
raise ImportError(_error0 + str(error1))
ImportError: cfdm.core requires the modules numpy, netCDF4, packaging. No module named 'netCDF4._netCDF4'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/work/n02/n02/shakka/create_IVT_vars.py", line 2, in <module>
import cf
File "/home/n02/n02/dch/cf-python/cf/__init__.py", line 97, in <module>
raise ImportError(_error0 + str(error1))
ImportError: cf v3.14.1 requires the modules numpy, netCDF4, cftime, cfunits, cfdm, psutil, dask, packaging. cfdm.core requires the modules numpy, netCDF4, packaging. No module named 'netCDF4._netCDF4'
/work/n02/n02/shakka/cylc-run/u-cz527/app/calc_IVT/bin/main.sh: line 3: cdo: command not found
[FAIL] main.sh <<'__STDIN__'
[FAIL]
[FAIL] '__STDIN__' # return-code=127
2023-10-07T07:21:55Z CRITICAL - failed/EXIT
App is calc_IVT and suite is u-cz527.
The pre-script in suite.rc is
pre-script = """
export PATH=/home/n02/n02/dch/cf/bin:$PATH
export PYTHONPATH=/home/n02/n02/dch/cfdm:/home/n02/n02/dch/cf-python:$PYTHONPATH
"""
env-script = """
eval $(rose task-env)
module load cdo
"""
anything else I should add in there to get netCDF4 to work?