xbpch
xbpch copied to clipboard
tracerinfo.dat not corrrectly read in GEOS-Chem v12.2.0
Hello Daniel,
When using xpbch to read (successfully completed) GEOS-Chem output from version v12.2.0, I see the following message:
/work/home/ts551/.conda/envs/py_3_7_master/lib/python3.7/site-packages/xbpch/util/diaginfo.py:104: UserWarning: At least one row in /work/home/ts551/GC/rundirs/geosfp_4x5_tropchem.v12.2.0.test_JNIT.3600s.J025/tracerinfo.dat wasn't decoded correctly; we strongly recommend you manually check that file to see that all tracers are properly recorded.
This is due to a change in the formatting of tracerinfo.dat between v12.1.1 and v12.2.0 (see below). Is it possible to allow for xpbch to read both formats?
---- change in tracerinfo.dat
in v12.1.1
#==============================================================================
# tracerinfo.dat: Created by GEOS-CHEM at 2019/01/15 10:31
#
# ****** CUSTOMIZED FOR NOx-Ox-Hydrocarbon-Aerosol SIMULATION *****
#
# This file contains name weight and index information about GEOS-CHEM
# tracers. It is read by routine "ctm_tracerinfo.pro" of the GAMAP package.
#
# File Format:
# -----------------------------------------------------------------------------
# NAME (A8 ) Tracer name (up to 8 chars)
# -- (1X ) 1-character spacer
# FULLNAME (A30 ) Full tracer name (up to 30 chars)
# MOLWT (E10.0) Molecular weight (kg/mole)
# C (I3 ) For HC's: # moles C/moles tracer; otherwise set=1
# TRACER (I9 ) Tracer number (up to 9 digits)
# SCALE (E10.3) Standard scale factor to convert to unit given below
# -- (1X ) 1-character spacer
# UNIT (A40 ) Unit string
#
#==============================================================================
# GEOS-CHEM tracers [ppbv]
#==============================================================================
NO NO tracer 3.000E-02 1 1 1.000E+09 ppbv
O3 O3 tracer 4.800E-02 1 2 1.000E+09 ppbv
PAN PAN tracer 1.210E-01 1 3 1.000E+09 ppbv
CO CO tracer 2.800E-02 1 4 1.000E+09 ppbv
...
AVGW Mixing ratio of H2O vapor 0.000E+00 1 24003 1.000E+00 v/v
AIRNUMDE Dry air number density 0.000E+00 1 24004 1.000E+00 molec air/cm3
T Temperature 0.000E+00 1 24005 1.000E+00 K
PMID Pressure at average pressure l 0.000E+00 1 24006 1.000E+00 hPa
PEDGE Pressure at grid box lower edg 0.000E+00 1 24007 1.000E+00 hPa
RH Relative humidity 0.000E+00 1 24008 1.000E+00 %
#==============================================================================
# ND69 diagnostic quantities
#==============================================================================
DXYP Grid box surface area 0.000E+00 1 25001 1.000E+00 m2
in v12.2.0
#==============================================================================
# tracerinfo.dat: Created by GEOS-CHEM at 2019/02/20 11:28
#
# ****** CUSTOMIZED FOR NOx-Ox-Hydrocarbon-Aerosol SIMULATION *****
#
# This file contains name weight and index information about GEOS-CHEM
# tracers. It is read by routine "ctm_tracerinfo.pro" of the GAMAP package.
#
# File Format:
# -----------------------------------------------------------------------------
# NAME (A31 ) Tracer name (up to 31 chars)
# -- (1X ) 1-character spacer
# FULLNAME (A30 ) Full tracer name (up to 30 chars)
# MOLWT (E10.0) Molecular weight (kg/mole)
# C (I3 ) For HC's: # moles C/moles tracer; otherwise set=1
# TRACER (I9 ) Tracer number (up to 9 digits)
# SCALE (E10.3) Standard scale factor to convert to unit given below
# -- (1X ) 1-character spacer
# UNIT (A40 ) Unit string
#
#==============================================================================
# GEOS-CHEM tracers [ppbv]
#==============================================================================
NO NO tracer 3.000E-02 1 1 1.000E+09 ppbv
O3 O3 tracer 4.800E-02 1 2 1.000E+09 ppbv
PAN PAN tracer 1.210E-01 1 3 1.000E+09 ppbv
CO CO tracer 2.800E-02 1 4 1.000E+09 ppbv
ALK4 ALK4 tracer 1.200E-02 4 5 1.000E+09 ppbC
...
AVGW Mixing ratio of H2O vapor 0.000E+00 1 24003 1.000E+00 v/v
AIRNUMDEN Dry air number density 0.000E+00 1 24004 1.000E+00 molec air/cm3
T Temperature 0.000E+00 1 24005 1.000E+00 K
PMID Pressure at average pressure l 0.000E+00 1 24006 1.000E+00 hPa
PEDGE Pressure at grid box lower edg 0.000E+00 1 24007 1.000E+00 hPa
RH Relative humidity 0.000E+00 1 24008 1.000E+00 %
#==============================================================================
# ND69 diagnostic quantities
#==============================================================================
DXYP Grid box surface area 0.000E+00 1 25001 1.000E+00 m2
Hi @tsherwen, I opened a PR at #21 to try to deal with this, but it's a little bit complicated. The best way to handle this would be to auto-infer the column widths in tracerinfo.dat
so we don't have to hard-code details based on the version of the model being run, since that data isn't immediately available from other metadata. Would happily accept tweaks to PR #21 if you have any good working solutions!