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] Seg. fault from gamap_mod.F90 running v13.0.0 with bpch diagnostics #671

Closed
rgryan92 opened this issue Mar 25, 2021 · 3 comments
Assignees
Labels
category: Bug Something isn't working topic: Diagnostics Related to output diagnostic data

Comments

@rgryan92
Copy link

rgryan92 commented Mar 25, 2021

GEOS-Chem v13.0.0 runs well with standard netcdf output but crashes with a segmentation fault when compiled with BPCH diagnostics turned on. This is the case using both GEOS-FP and MERRA-2 meteorology. No error reported in the GEOS-Chem log file, segmentation fault reported in the standard output:

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

Backtrace for this error:
#0  0x2af1df8eb3ff in ???
#1  0xdf0f24 in __hco_driver_mod_MOD_hco_final
	at /home/ucfargr/gc_rgr/utnox/v1300_geosfp_spinup_025x03125/CodeDir/src/HEMCO/src/Core/hco_driver_mod.F90:344
#2  0x5c669c in __hco_interface_gc_mod_MOD_hcoi_gc_final
	at /home/ucfargr/gc_rgr/utnox/v1300_geosfp_spinup_025x03125/CodeDir/src/GEOS-Chem/GeosCore/hco_interface_gc_mod.F90:1082
#3  0x519525 in __emissions_mod_MOD_emissions_final
	at /home/ucfargr/gc_rgr/utnox/v1300_geosfp_spinup_025x03125/CodeDir/src/GEOS-Chem/GeosCore/emissions_mod.F90:376
#4  0x45ced5 in cleanup_
	at /home/ucfargr/gc_rgr/utnox/v1300_geosfp_spinup_025x03125/CodeDir/src/GEOS-Chem/GeosCore/cleanup.F90:133
#5  0x10dd51b in __error_mod_MOD_geos_chem_stop
	at /home/ucfargr/gc_rgr/utnox/v1300_geosfp_spinup_025x03125/CodeDir/src/GEOS-Chem/GeosUtil/error_mod.F90:523
#6  0x10dede1 in __file_mod_MOD_ioerror
	at /home/ucfargr/gc_rgr/utnox/v1300_geosfp_spinup_025x03125/CodeDir/src/GEOS-Chem/GeosUtil/file_mod.F90:130
#7  0x9e4085 in write_tinfo
	at /home/ucfargr/gc_rgr/utnox/v1300_geosfp_spinup_025x03125/CodeDir/src/GEOS-Chem/GeosCore/gamap_mod.F90:545
#8  0x9e4ebc in create_tinfo
	at /home/ucfargr/gc_rgr/utnox/v1300_geosfp_spinup_025x03125/CodeDir/src/GEOS-Chem/GeosCore/gamap_mod.F90:489
#9  0x9e59e5 in __gamap_mod_MOD_do_gamap
	at /home/ucfargr/gc_rgr/utnox/v1300_geosfp_spinup_025x03125/CodeDir/src/GEOS-Chem/GeosCore/gamap_mod.F90:146
#10  0x58325e in __gc_environment_mod_MOD_gc_init_extra
	at /home/ucfargr/gc_rgr/utnox/v1300_geosfp_spinup_025x03125/CodeDir/src/GEOS-Chem/GeosCore/gc_environment_mod.F90:820
#11  0x405ced in geos_chem
	at /home/ucfargr/gc_rgr/utnox/v1300_geosfp_spinup_025x03125/CodeDir/src/GEOS-Chem/Interfaces/GCClassic/main.F90:2316
#12  0x40c57f in main
	at /home/ucfargr/gc_rgr/utnox/v1300_geosfp_spinup_025x03125/CodeDir/src/GEOS-Chem/Interfaces/GCClassic/main.F90:32
/var/opt/sge/node-d00a-041/job_scripts/6632279: line 52: 114800 Segmentation fault      (core dumped) ./gcclassic > log_gc_run_$run_num`

The error was tracked down by @eamarais : missing value in gamap_mod.F90 at line 542 corresponding to the number of molecules of carbon in previous model versions. This was stopping 'tracerinfo.dat' from writing out.

Line 542 changed from:

         ADJUSTL( NAME ), ADJUSTL( FNAME ), MWT, N, SCALE, TRIM( UNIT )

to this (add “, 1”):

         ADJUSTL( NAME ), ADJUSTL( FNAME ), MWT, 1, N, SCALE, TRIM( UNIT )

This workaround solved the problem but the way tracerinfo.dat is written may need updating for v13.0.0
logfiles_ryan.zip.zip

@rgryan92 rgryan92 added the category: Bug Something isn't working label Mar 25, 2021
@yantosca
Copy link
Contributor

Thanks for writing @rgryan92. This bug should have already been fixed in commits 1e481bb and 197e26e (dated Jan 15, 2021). Do you have these commits in your src/GEOS-Chem folder?

For 13.0.0 we ran several integration tests for simulations such as TOMAS and RRTMG that turn on the BPCH_DIAG option, and these all passed. But if this is still an issue, please let us know and we can take another look at it.

@yantosca yantosca self-assigned this Mar 25, 2021
@yantosca yantosca added the topic: Diagnostics Related to output diagnostic data label Mar 25, 2021
@yantosca yantosca changed the title Seg. fault from gamap_mod.F90 running v13.0.0 with bpch diagnostics [BUG/ISSUE] [BUG/ISSUE] Seg. fault from gamap_mod.F90 running v13.0.0 with bpch diagnostics Mar 25, 2021
@rgryan92
Copy link
Author

Hi @yantosca , thanks for that, I'll add these commits to my src/GEOS-Chem folder. Cheers

@yantosca
Copy link
Contributor

Thanks @rgryan. I'll close out this issue for now. Feel free to submit a new issue if you are still having problems.

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