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

GEOS-chem failing to read in YAML file when new species are added to custom.eqn #2514

Closed
JFBrewer opened this issue Oct 11, 2024 · 1 comment
Labels
category: Bug Something isn't working

Comments

@JFBrewer
Copy link

Your name

Jared Brewer

Your affiliation

University of Minnesota

What happened? What did you expect to happen?

Pursuant to my struggles in issue #2497 and following the advice of @msl3v, I decided to work from fullchem in order to quantify the difference in loss rates of C2H6 by species in the fullchem and carbon mechanisms. To do this, I added two tracers to custom.eqn: C2H6X (a tracer created solely by the reaction of C2H6 + NO3) and C2H6Y (a tracer created solely by the reaction of C2H6 + Br). Additionally, I added three PORL families to custom.kpp: LC2H6, PC2H6X, and PC2H6Y. I figured that between these three metrics, I could back out the reaction rate I'm interested in and compare it with the same information in the carbon gases sim.

Unfortunately, this has proved more difficult than expected. As I understand it, the steps involved in my plan were these:

  1. Add the tracers and PORL families to the custom kpp mechanism, in the files specified above (custom.eqn and custom.kpp).
  2. Add all five species to species_database.yml, with C2H6X/Y as basically copies of ethane and the PORL terms as copies of LCH4
  3. Add C2H6X/Y to geoschem_config.yml (strictly speaking I don't think this one ought to be necessary, since I don't care about transport of these species, only their production. The bug occurs with or without them there).
  4. Add C2H6X/Y and the PORL species to the restart file.
  5. Quaff the nectar of victory while my code runs and I solve all my problems.

Something has broken down between steps 4 and 5, and when I run the code, I keep getting the following error:

===============================================================================
QFYAML ERROR: Could not open YAML file for output!
 -> at QFYAML_Print (in qfyaml_mod.F90)
===============================================================================

===============================================================================
GEOS-Chem ERROR: Error encountered in routine "Init_Species_Database"!
 -> at Init_State_Chm (in module Headers/state_chm_mod.F90)
===============================================================================

===============================================================================
GEOS-Chem ERROR: Error encountered within call to "Init_State_Chm"!
 -> at GC_Init_StateObj (in GeosCore/gc_environment_mod.F90)
===============================================================================

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

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x1511218b55af in ???
#1  0xa65b1f in __hco_driver_mod_MOD_hco_final
	at /users/5/brewe222/old_home/GC_Rundirs/TrackEthaneLoss/CodeDir/src/HEMCO/src/Core/hco_driver_mod.F90:359
#2  0x4a986c in __hco_interface_gc_mod_MOD_hcoi_gc_final
	at /users/5/brewe222/old_home/GC_Rundirs/TrackEthaneLoss/CodeDir/src/GEOS-Chem/GeosCore/hco_interface_gc_mod.F90:1236
#3  0x4504a3 in __emissions_mod_MOD_emissions_final
	at /users/5/brewe222/old_home/GC_Rundirs/TrackEthaneLoss/CodeDir/src/GEOS-Chem/GeosCore/emissions_mod.F90:394
#4  0x42c6e0 in cleanup_
	at /users/5/brewe222/old_home/GC_Rundirs/TrackEthaneLoss/CodeDir/src/GEOS-Chem/GeosCore/cleanup.F90:123
#5  0x86d126 in __error_mod_MOD_geos_chem_stop
	at /users/5/brewe222/old_home/GC_Rundirs/TrackEthaneLoss/CodeDir/src/GEOS-Chem/GeosUtil/error_mod.F90:523
#6  0x86d45f in __error_mod_MOD_error_stop
	at /users/5/brewe222/old_home/GC_Rundirs/TrackEthaneLoss/CodeDir/src/GEOS-Chem/GeosUtil/error_mod.F90:437
#7  0x409295 in geos_chem
	at /users/5/brewe222/old_home/GC_Rundirs/TrackEthaneLoss/CodeDir/src/GEOS-Chem/Interfaces/GCClassic/main.F90:512
#8  0x4035d6 in main
	at /users/5/brewe222/old_home/GC_Rundirs/TrackEthaneLoss/CodeDir/src/GEOS-Chem/Interfaces/GCClassic/main.F90:32
Segmentation fault (core dumped)

What are the steps to reproduce the bug?

This error continues to occur regardless of whether I add the information to fullchem or custom, and notably gets no more informative when I run in DEBUG mode instead of standard. All I can figure out is that reading in a yaml file is failing. The most obvious culprit seems to me to be species_database.yml based on that error, but reverting this to the unmodified file does not fix the bug.

So it seems like it's something wrong with my KPP additions but it claims to be failing at reading in a yaml file. Of course, there's not a yaml file in KPP. So I'm not at all sure how to proceed here. Do you see a particular mistake in my logic chain that might have lead me here? Or perhaps you've seen an error like this before?

Thanks,
Jared

Please attach any relevant configuration and log files.

custom.eqn.txt
custom.kpp.txt
geoschem_config.yml.txt
species_database.yml.txt

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

In what configuration were you running GEOS-Chem?

GCClassic

What simulation were you running?

Full chemistry

As what resolution were you running GEOS-Chem?

2x2.5

What meterology fields did you use?

MERRA-2

Additional information

No response

@JFBrewer JFBrewer added the category: Bug Something isn't working label Oct 11, 2024
@JFBrewer
Copy link
Author

JFBrewer commented Oct 14, 2024

I have solved this problem! The issue was in the simulation settings in geoschem_config.yml, specifically the setting of species_metadata_output_file, which by default is set like so: species_metadata_output_file: OutputDir/geoschem_species_metadata.yml.

I had changed this output directory path (species_metadata_output_file: OutputDir_CEDS/geoschem_species_metadata.yml) and then much later deleted the directory path OutputDir_CEDS. That's why the error seemed related to species_database.yml but wasn't impacted by which version of the species database I used. I'm not sure if this is worth adding a more specific error message to - the original QFYAML ERROR: Could not open YAML file for output was not specific which YAML was failing to write - but I have found a New And Exciting Failure Case for you, and I'm writing it here for future confused googlers to find.

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
Projects
None yet
Development

No branches or pull requests

1 participant