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] Inconsistent file target for error messages #21

Closed
lizziel opened this issue Mar 2, 2020 · 7 comments
Closed

[BUG/ISSUE] Inconsistent file target for error messages #21

lizziel opened this issue Mar 2, 2020 · 7 comments
Assignees
Labels
category: Bug Something isn't working

Comments

@lizziel
Copy link
Contributor

lizziel commented Mar 2, 2020

We recently had a user help request that had HEMCO error messages in both HEMCO.log and the GEOS-Chem log. The HEMCO.log file had this:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
HEMCO ERROR: Invalid time index in /home/disk/oreo/data/ctm/HEMCO/CMIP6/v2019-12/CMIP6_GHG_surface_VMR_2014.nc
ERROR LOCATION: HCOIO_READ_STD (hcoio_read_std_mod.F90)
ERROR LOCATION: HCOIO_DataRead (hcoio_dataread_mod.F90)
ERROR LOCATION: ReadList_Fill (hco_readlist_mod.F90)
ERROR LOCATION: ReadList_Read (hco_readlist_mod.F90)
ERROR LOCATION: HCO_RUN (hco_driver_mod.F90)

The GEOS-Chem log had this:

 Error in HCOIO_DATAREAD called from HEMCO ReadList_Fill: SfcVMR_CH3Cl
 Error in ReadList_Fill (3) called from HEMCO ReadList_Read
 Error in ReadList_Read called from hco_run
=====================================================================
GEOS-Chem ERROR: Error encountered in "HCO_Run"!
 -> at HCOI_GC_Run (in module GeosCore/hcoi_gc_main_mod.F90)
THIS ERROR ORIGINATED IN HEMCO!  Please check the HEMCO log file for 
additional error messages!
=====================================================================
=====================================================================
GEOS-Chem ERROR: Error encountered in "HCOI_GC_Run"!
 -> at Emissions_Run (in module GeosCore/emissions_mod.F90)
=====================================================================
=====================================================================
GEOS-CHEM ERROR: Error encountered in "Emissions_Run", Phase 0
This error can indicate a missing file. Please check the HEMCO log file for 
additional error messages!
STOP at  -> at GEOS-Chem (in GeosCore/main.F)
=====================================================================

I think this problem was introduced when I recently added more error messages to HEMCO. That code needs to be updated to send errors to the HEMCO log rather than GEOS-Chem log.

@lizziel lizziel added the category: Bug Something isn't working label Mar 2, 2020
@lizziel lizziel self-assigned this Mar 2, 2020
@jimmielin
Copy link
Collaborator

Hi Lizzie,

It seems that this is caused because it's printing to standard output:

       IF ( RC /= HCO_SUCCESS ) THEN
          PRINT *, "Error in ReadList_Fill (1) called from HEMCO ReadList_Read"
          RETURN
       ENDIF

It should be an easy fix for it to call HCO_MSG too. Note that the print or write to stdout are potentially dangerous in a distributed environment, as these calls don't check am_I_Root from what I've seen.

I've searched the print statements in HEMCO and attached a list, hope this is helpful. I can also help cleaning some of these as I go through the files.
print_hemco.txt

@lizziel
Copy link
Contributor Author

lizziel commented Mar 3, 2020

Thanks @jimmielin. Yes, the fix should be straightforward. I made this issue mainly to remind myself to go back and apply it. Feel free to tackle this!

@yantosca
Copy link
Contributor

yantosca commented Mar 3, 2020

This is related to the following issues:

Question: How should we handle it? Should we make the fix in geoschem/geos-chem (dev/12.7.2) first and then copy that into HEMCO?

@lizziel
Copy link
Contributor Author

lizziel commented Mar 3, 2020

To be clear, this issue is for the prints not for the timing read bug in HEMCO. I'll put a fix in for this particular print issue in 12.8. A more thorough look at where the prints go, especially testing with GCHP which uses MPI, can be in this repo. I've found that the print behavior can be different between GCHP and GCC.

@lizziel
Copy link
Contributor Author

lizziel commented Mar 5, 2020

An issue related to inconsistent HEMCO error prints messages: GEOS-Chem prints error messages specifying an error in HEMCO with instructions to check HEMCO.log, but starts doing this before HEMCO.log is created. This is confusing and frustrating to users.

@jimmielin
Copy link
Collaborator

Also as a side note I'd also like to sneak in a feature for WRF-GC to output HEMCO.log for each core (e.g. HEMCO-0000.log, HEMCO-0001.log, ...). I don't know where the name of the log file HEMCO.log is decided in the code and the file is created, please let me know if you'll change that part of the code and I may follow up with a commit specific to MODEL_WRF 😆

@lizziel
Copy link
Contributor Author

lizziel commented Apr 30, 2020

This update, limited to hco_readlist_mod, will go into 12.8.1. It will be ported to the HEMCO repository as part of the future update for compatibility with 12.8.1.

@jimmielin , regarding outputting HEMCO.log for each core, go for it. Although it would be good if it were optional. You can start a separate GitHub issue for discussion of this.

@lizziel lizziel closed this as completed Apr 30, 2020
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

3 participants