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

Satellite Diagnostic not currently compatible with Carbon Simulation #2368

Closed
JFBrewer opened this issue Jul 9, 2024 · 5 comments · Fixed by #2369
Closed

Satellite Diagnostic not currently compatible with Carbon Simulation #2368

JFBrewer opened this issue Jul 9, 2024 · 5 comments · Fixed by #2369
Assignees
Labels
category: Bug Something isn't working topic: Carbon Gases Simulations Related to simulations with carbon gases (carbon, CO2, CH4, tagCH4, tagCO) topic: Diagnostics Related to output diagnostic data
Milestone

Comments

@JFBrewer
Copy link

JFBrewer commented Jul 9, 2024

Your name

Jared Brewer

Your affiliation

University of Minnesota

What happened? What did you expect to happen?

Hi GCST,

So, I'm working with GC 14.1.1 right now and I'm trying to use the satellite diagnostic with the Carbon Simulation. I've posted about this before in relation to ##2017 but I'm now moderately confident that I'm looking at two separate issues.

By default, the run directory created for the carbon sim doesn't include SatDiagn as an option. To add the Satellite Diagnostics to HISTORY.rc, I have simply added the line 'SatDiagn', to the Collections declaration in HISTORY.rc and then copied the SatDiagn COLLECTION section from the fullchem version of the model, with the SatDiagnConc species changed to match my carbon sim (e.g., SatDiagnConc_CH4, etc.).

What are the steps to reproduce the bug?

There are two separate presentations here, which I believe correspond to two separate bugs.

  1. When I only specify SatDiagnConc_XXX species as outputs in HISTORY.rc, I get a replica of the issue specified in SatDiagn problems in gcclassic fullchemistry run (v14.1) #2017:
    IF ( State_Diag%SatDiagnCount > 0 ) THEN 1 Error: IF clause at (1) requires a scalar LOGICAL expression, implying that SatDiagnCount is not a single number value. Bob has already suggested a fix in his response to issue 2017, but when I apply that fix, I find that that I still get a segfault for an invalid memory reference on the line WHERE( State_Diag%SatDiagnCount > 0 ).

This error triggers at the end of the first day of the run.

  1. The above error only occurs when I don't specify any SatDiagn outputs other than SatDiagnConc_XXX in HISTORY.rc. If I instead add some of the other SatDiagn outputs that I need (e.g. SatDiagnAirDen, SatDiagnRH, etc.) the error changes. It triggers on the first timestep of the first day, rather then at the end of the day, and gives the following error:
Carbon_Gases: Using global OH oxidant field option: GLOBAL_OH
===============================================================================
GEOS-Chem ERROR: OH is not a defined species in this simulation!!!
 -> at Do_Archive_SatDiagn (in module GeosCore/diagnostics_mod.F90)
==============================================================================

===============================================================================
GEOS-Chem ERROR: Error converting species units for archiving diagnostics #2
 -> at Set_Diagnostics_EndofTimestep (in GeosCore/diagnostics_mod.F90)
===============================================================================

===============================================================================
GEOS-CHEM ERROR: Error encountered in "Set_Diagnostics_EndOfTimestep"!
STOP at  -> at GEOS-Chem (in GeosCore/main.F90)
===============================================================================

If I comment out the responsible warning (GeosCore/diagnostics_mod.F90:1334), the code runs without issue, but the only variables added to the SatDiagn that gets written out are lat_bnds, lon_bnds, and AREA. (hyam, hybm, hai, and hybi are also written but all values are 0s).

I'm not certain what to do with this, but it definitely seems to me that the SatDiagn as currently written may just not be compatible with the Carbon Sim. If there's an easy way to make these things talk to each other, I'd love to do that. Otherwise, maybe this should be a 'feature request' rather than an 'issue report'.

Thanks,
Jared

What GEOS-Chem version were you using?

14.1.1

What environment were you running GEOS-Chem on?

Local cluster

What compiler and version were you using?

gcc 8.2.0

Will you be addressing this bug yourself?

Yes, but I will need some help

In what configuration were you running GEOS-Chem?

GCClassic

What simulation were you running?

Carbon

As what resolution were you running GEOS-Chem?

2x2.5

What meterology fields did you use?

MERRA-2

@JFBrewer JFBrewer added the category: Bug Something isn't working label Jul 9, 2024
@yantosca yantosca added topic: Diagnostics Related to output diagnostic data Attn: Carbon gases WG topic: Carbon Gases Simulations Related to simulations with carbon gases (carbon, CO2, CH4, tagCH4, tagCO) labels Jul 9, 2024
@yantosca yantosca self-assigned this Jul 9, 2024
@yantosca yantosca added this to the 14.4.2 milestone Jul 9, 2024
@yantosca
Copy link
Contributor

Thanks @JFBrewer. I can take a look at this. We can certainly add the SatDiagn collection to the carbon simulation files.

Also for the carbon simulation, OH is not a transported species, but is read in from disk. That may be why you cannot save out the OH field via SatDiagn.

@yantosca
Copy link
Contributor

@JFBrewer: In 14.4.1 we have added SatDiagn and SatDiagnEdge to the HISTORY.rc file for the carbon simulation.

@yantosca
Copy link
Contributor

Hi again @JFBrewer: This quick fix will get past the "OH is not a defined species" error. For the carbon simulation we also need to test for FixedOH. Still looking into the other error.

    ! Get the species ID for OH if this is the first call
    IF ( first ) THEN
       IF ( Input_Opt%ITS_A_CARBON_SIM     .or.                              &
            Input_Opt%ITS_A_FULLCHEM_SIM ) THEN
          id_OH  = Ind_('OH')
          IF ( id_OH < 0 ) THEN
             id_OH = Ind_('FixedOH')
             IF ( id_OH < 0 ) THEN           
                errMsg = 'OH is not a defined species in this simulation!!!'
                CALL GC_Error( errMsg, RC, thisLoc )
                RETURN
             ENDIF
          ENDIF
       ENDIF
       first= .FALSE.
    ENDIF

@yantosca
Copy link
Contributor

@JFBrewer: all these issues should be fixed by PR #2369, which is currently in testing.

@yantosca
Copy link
Contributor

We can close this issue as PR #2369 is now merged into the GEOS-Chem "no-diff-to-benchmark" stream. It is on track to ship with 14.4.2.

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: Carbon Gases Simulations Related to simulations with carbon gases (carbon, CO2, CH4, tagCH4, tagCO) topic: Diagnostics Related to output diagnostic data
Projects
None yet
2 participants