Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG/ISSUE] Planeflight concentration output has weird/inconsistent units #796

Closed
tscarter opened this issue Jul 27, 2021 · 12 comments
Closed
Assignees
Labels
category: Bug Something isn't working topic: Diagnostics Related to output diagnostic data
Milestone

Comments

@tscarter
Copy link

Description of the problem/Description of troubleshooting performed

In looking at planeflight diagnostic output, the concentration output seems to be in different units (e.g., ppm, ppb, ppt) for different species, and I cannot tell a pattern for those differences. For example, in these files, ISOP appears a factor of 1E6 too small and MTPA a factor of 1E3 too small. The runs are fully spun up, so I don't think that's the problem.

Other people in our lab group are seeing something similar. This can be roughly corrected for by referencing the monthly output files and using intuition to figure out what units the species should be in. However, I am wondering if any changes to this diagnostic were pushed in a recent version that would have led to this and if there is any fix that you are aware of.

GEOS-Chem version

13.0.0

Description of modifications

Describe your modifications here.

Log files

  • Build log (if applicable): It won't let me attach a plane.log file, so here's a pdf:
    planeflightOuput.pdf

If it's helpful, I also have the netcdf monthly species file and input.geos and can send over email since github won't let me attach them.

  • Run logs (if applicable):
  • Run script (if applicable):

Software versions

  • CMake version:
  • Compilers (Intel or GNU, and version):
  • NetCDF version:
@tscarter tscarter added the category: Bug Something isn't working label Jul 27, 2021
@yantosca
Copy link
Contributor

Thanks for writing @tscarter. You can attach a log file by dragging & dropping, but you have to make sure it's renamed to e.g. plane.log.txt. Then Github will understand it.

@tscarter
Copy link
Author

Got it. Thanks! Here it is.

plane.log copy.20190923.txt

@yantosca
Copy link
Contributor

Hi @tscarter, I so I made a simple Planeflight.dat for testing with the same location that you used. I used a different date (since that is what my restart file was for), as the date might not matter if there is a units issue.

Planeflight.dat -- Input file for planeflight diagnostic
GCST
July 2018
-----------------------------------------------------------
4      <-- # of variables to be output (listed below)
-----------------------------------------------------------
ISOP
TRA_121
MTPA
TRA_146
-----------------------------------------------------------
  Now give the times and locations of the flight
-----------------------------------------------------------
Point   Type DD-MM-YYYY HH:MM     LAT     LON ALT/PRE  OBS
    1   Tamt 01-07-2019 00:15  -59.01   -2.15    30.0
    2   Tamt 01-07-2019 00:15  -59.01   -2.15   100.0
    3   Tamt 01-07-2019 00:15  -59.01   -2.15   200.0
    4   Tamt 01-07-2019 00:45  -59.01   -2.15    30.0
    5   Tamt 01-07-2019 00:45  -59.01   -2.15   100.0
    6   Tamt 01-07-2019 00:45  -59.01   -2.15   200.0
99999   END  00-00-0000 00:00    0.00    0.00    0.00  0.000

So I specified ISOP by name and by TRA_121, and MTPA by name and by TRA_146. My plane.log file looked like this:

POINT    TYPE YYYYMMDD HHMM     LAT     LON   PRESS        OBS     T-IND P-I I-IND J-IND  ISOP        TRA_121     MTPA        TRA_146   
    1    Tamt 20190701 0015  -59.01   -2.15  970.51      0.000 000000003 001 00037 00009  9.726E+003  3.753E-016  3.641E+000  1.405E-019
    2    Tamt 20190701 0015  -59.01   -2.15  970.51      0.000 000000003 001 00037 00009  9.726E+003  3.753E-016  3.641E+000  1.405E-019
    3    Tamt 20190701 0015  -59.01   -2.15  955.91      0.000 000000003 002 00037 00009  9.662E+003  3.771E-016  3.638E+000  1.420E-019
    4    Tamt 20190701 0045  -59.01   -2.15  970.51      0.000 000000005 001 00037 00009  9.892E+003  3.816E-016  3.707E+000  1.430E-019
    5    Tamt 20190701 0045  -59.01   -2.15  970.51      0.000 000000005 001 00037 00009  9.892E+003  3.816E-016  3.707E+000  1.430E-019
    6    Tamt 20190701 0045  -59.01   -2.15  955.91      0.000 000000005 002 00037 00009  9.823E+003  3.833E-016  3.707E+000  1.446E-019

The species by name are in molec/cm3:

             !-------------------------
             ! GEOS-Chem Chemical species [molec/cm3]
             !-------------------------
             CASE ( 1:996)

                ! Only archive where chemistry is done
                IF ( State_Met%InChemGrid(I,J,L) ) THEN

                   ! Species concentration [v/v] -> [molec/cm3]
                   VARI(V) = Spc(I,J,L,PVAR(V)) * State_Met%AIRNUMDEN(I,J,L)

                ENDIF

and the species by TRA_ are in mixing ratio (actually mol/mol dry):

             !--------------------------
             ! GEOS-CHEM advected species [v/v]
             !--------------------------
             CASE( 100000:199999 )

                ! Remove offset from PVAR
                N = PVAR(V) - 100000

                ! Species concentration [v/v]
                VARI(V) = Spc(I,J,L,N)

                IF ( VARI(V) < TINY ) VARI(V) = 0.e+0_fp

I think the difference between the 2 was back when we had SMVGEAR, and we kept track of non-advected species separately than advected species.

In any case, my simulation was a short run so I'm not sure if those values are correct. 1e-16 seems very small for ISOP.

P.S. I ran into the other bug described at #800, but I'll push a fix for that separately.

@yantosca
Copy link
Contributor

Also I think there have been some recent updates to the planeflight diagnostic but at this point we have been relying on the community to submit scientific updates, as we aren't using it ourselves. See commits: 6e14981, 0727622, a615790, and 7b1c618.

Also, you can tell what the species units are by printing out State_Chm%Species_Units at any point in the code. That might shed some light on the subject. It is possible that the units are different than what they used to be by the time the code gets into the PLANEFLIGHT routine.

@yantosca
Copy link
Contributor

yantosca commented Jul 29, 2021

A couple more things:

  1. It's State_Chm%Spc_Units that has the units of the species (i.e. Spc_Units, not Species_Units)
  2. In planeflight, I printed this out and got: ### State_Chm%Species units: kg/kg dry

So the species units are now mass mixing ratio rather than molar mixing ratio. That may explain the weird results you are seeing.

@yantosca yantosca added the topic: Diagnostics Related to output diagnostic data label Jul 29, 2021
@yantosca yantosca self-assigned this Jul 29, 2021
yantosca added a commit that referenced this issue Jul 30, 2021
This commit should fix issue geoschem/geos-chem #796.  Apparently,
the planeflight diagnostic outputs in v/v were never updated to account
for the fact that State_Chm%Species is in units of kg/kg dry at the
point when the PLANEFLIGHT routine is called.  The code had assumed
that the species units were v/v.

We have corrected the unit conversions for the following outputs:
(1) Chemical species (#1 -996)
(2) RO2 (#997)
(3) AN (#998)
(4) NOy (#999)
(5) TRA_xxx (#100000-199999)

Also updated some comment lines.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@yantosca
Copy link
Contributor

yantosca commented Jul 30, 2021

This issue should now be fixed with commit 2e58896. This will ship as version 13.2.1 (but you can grab this right now from the patch/13.2.1 branch, which is based off of main).

With the unit conversions to v/v dry corrected, we now get:

POINT    TYPE YYYYMMDD HHMM     LAT     LON   PRESS        OBS     T-IND P-I I-IND J-IND  ISOP        TRA_121     MTPA        TRA_146     RO2         AN          NOy       
    1    Tamt 20190701 0015  -59.01   -2.15  970.51      0.000 000000003 001 00037 00009  4.135E+003  1.596E-016  7.739E-001  2.986E-020  9.347E-013  1.476E-015  6.340E-012
    2    Tamt 20190701 0015  -59.01   -2.15  970.51      0.000 000000003 001 00037 00009  4.135E+003  1.596E-016  7.739E-001  2.986E-020  9.347E-013  1.476E-015  6.340E-012
    3    Tamt 20190701 0015  -59.01   -2.15  955.91      0.000 000000003 002 00037 00009  4.108E+003  1.603E-016  7.733E-001  3.018E-020  8.902E-013  1.531E-015  6.227E-012
    4    Tamt 20190701 0045  -59.01   -2.15  970.51      0.000 000000005 001 00037 00009  4.205E+003  1.622E-016  7.880E-001  3.040E-020  9.269E-013  1.477E-015  6.324E-012
    5    Tamt 20190701 0045  -59.01   -2.15  970.51      0.000 000000005 001 00037 00009  4.205E+003  1.622E-016  7.880E-001  3.040E-020  9.269E-013  1.477E-015  6.324E-012
    6    Tamt 20190701 0045  -59.01   -2.15  955.91      0.000 000000005 002 00037 00009  4.176E+003  1.629E-016  7.879E-001  3.074E-020  8.900E-013  1.530E-015  6.217E-012

RO2, AN, and NOy concentrations look pretty good. The ISOP and MTPA are low (~4000 molec/cm3) but this might be true if the station is a remote site or near the ocean. @tscarter, can you doublecheck on your end?

@yantosca yantosca added this to the 13.2.1 milestone Jul 30, 2021
@tscarter
Copy link
Author

tscarter commented Aug 2, 2021 via email

@yantosca
Copy link
Contributor

yantosca commented Aug 5, 2021

@tscarter, thanks for following up. My run was only for 1 hour so this could be an initialization issue. Have you tried again with the unit conversion fixes?

@tscarter
Copy link
Author

tscarter commented Aug 5, 2021 via email

@yantosca
Copy link
Contributor

yantosca commented Aug 5, 2021

Thanks @tscarter. Have a hunch that if you use a well-spun up restart file then it should be OK. But let us know when you get to it.

@tscarter
Copy link
Author

tscarter commented Aug 15, 2021 via email

@yantosca
Copy link
Contributor

Thank you Tess! Will close out this issue.

LiamBindle pushed a commit that referenced this issue Oct 14, 2021
This commit should fix issue geoschem/geos-chem #796.  Apparently,
the planeflight diagnostic outputs in v/v were never updated to account
for the fact that State_Chm%Species is in units of kg/kg dry at the
point when the PLANEFLIGHT routine is called.  The code had assumed
that the species units were v/v.

We have corrected the unit conversions for the following outputs:
(1) Chemical species (#1 -996)
(2) RO2 (#997)
(3) AN (#998)
(4) NOy (#999)
(5) TRA_xxx (#100000-199999)

Also updated some comment lines.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
yantosca added a commit that referenced this issue Oct 27, 2021
GeosCore/planeflight_mod.F90
- Remove calls to Convert_Spc_Units.  It turns out that we were doing
  the unit conversion from kg/kg dry -> v/v twice (once in routine
  Convert_Spc_Units, and once directly by code introduced in
  geoschem/geos-chem #796)

This now fixes the issue noted by @RuijunDang in geoschem/geos-chem #959.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Bug Something isn't working topic: Diagnostics Related to output diagnostic data
Projects
None yet
Development

No branches or pull requests

2 participants