-
Notifications
You must be signed in to change notification settings - Fork 10
Reading old GEOS Chem output files (ctm.bpch files)
Pre versions 12, GEOS-Chem outputs binary files containing diagnostics information called ctm.bpch files to the run directory. We can convert this output using a python package called PyGChem to NetCDF files, which are more portable and allow us to use more tools to work with them.
This programme uses a python script called bpch2netCDF.py to convert the ctm.bpch files to a NetCDF named "ctm.nc". This is done to allow for allow for opening of only parts of file to save time/memory, that is not possible with ctm.bpch format. This allow allows for use of numerous packages developed to work with NetCDF files ( e.g. ncdump, panopoly, ...)
To start analysing ctm.bpch output using the scripts here just take the two steps below.
(1) Download the code from the GitHub repository (if you are new to GIT, it is probably worth reading this guide). Install instructions are in the AC_tools README file.
(2) Run a python script in the ipython prompt to get model output. e.g.
import AC_tools as AC
folder = '<folder containing GEOS-Chem output>'
# Get the atmospheric ozone burden in Gg O3 as a np.array
array = AC.get_O3_burden_bpch(folder)
print( "The ozone burden is: {burden}".format(burden=array.sum()))
You can then look at the contents of the NetCDF files using numerous programmes, such as ncdump. For instance to show headers within NetCDF file, just type:
ncdump -h ctm.nc