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

Error when reading OCEAN_MASK in TransportTracer simulation #204

Closed
4 tasks done
msulprizio opened this issue Apr 11, 2023 · 5 comments · Fixed by #205
Closed
4 tasks done

Error when reading OCEAN_MASK in TransportTracer simulation #204

msulprizio opened this issue Apr 11, 2023 · 5 comments · Fixed by #205
Assignees
Labels
category: Bug Something isn't working topic: Scaling or Masking Related to issues in applying scale factors or masks
Milestone

Comments

@msulprizio
Copy link
Contributor

Name and Institution (Required)

Name: Melissa Sulprizio
Institution: Harvard/GCST

Confirm you have reviewed the following documentation

Description of your issue or question

After merging in PR #198, GCClassic integration tests are failing for the TransportTracer simulations. The simulation is crashing when attempting to read OCEAN_MASK, defined in HEMCO_Config.rc as:

1000 OCEAN_MASK  $METDIR/$CNYR/01/$MET.$CNYR0101.CN.$RES.$NC FROCEAN 2000/1/1/0 C xy 1 1 -180/-90/180/90

The error from HEMCO is:

 Read from config file: OCEAN_MASK
At line 139 of file /n/home05/msulprizio/RD/gc_4x5_merra2_TransportTracers/CodeDir/src/HEMCO/src/Core/hco_chartools_mod.F90
Fortran runtime error: Bad real number in item 1 of list input

Error termination. Backtrace:
#0  0x2b4c27e518e8 in read_real
        at ../.././libgfortran/io/list_read.c:2026
#1  0x2b4c27e52d14 in list_formatted_read_scalar
        at ../.././libgfortran/io/list_read.c:2180
#2  0xa46114 in __hco_chartools_mod_MOD_hco_charsplit_r8
        at /n/home05/msulprizio/RD/gc_4x5_merra2_TransportTracers/CodeDir/src/HEMCO/src/Core/hco_chartools_mod.F90:139
#3  0xa9e55c in __hcoio_util_mod_MOD_getdatavals
        at /n/home05/msulprizio/RD/gc_4x5_merra2_TransportTracers/CodeDir/src/HEMCO/src/Core/hcoio_util_mod.F90:2777
#4  0xaa061c in __hcoio_util_mod_MOD_hcoio_readfromconfig
        at /n/home05/msulprizio/RD/gc_4x5_merra2_TransportTracers/CodeDir/src/HEMCO/src/Core/hcoio_util_mod.F90:2489
#5  0xaa3214 in __hcoio_util_mod_MOD_hcoio_readother
        at /n/home05/msulprizio/RD/gc_4x5_merra2_TransportTracers/CodeDir/src/HEMCO/src/Core/hcoio_util_mod.F90:2188
#6  0xa8ccb1 in readlist_fill
        at /n/home05/msulprizio/RD/gc_4x5_merra2_TransportTracers/CodeDir/src/HEMCO/src/Core/hco_readlist_mod.F90:491
#7  0xa8e5f5 in __hco_readlist_mod_MOD_readlist_read
        at /n/home05/msulprizio/RD/gc_4x5_merra2_TransportTracers/CodeDir/src/HEMCO/src/Core/hco_readlist_mod.F90:288
#8  0xa6b886 in __hco_driver_mod_MOD_hco_run
        at /n/home05/msulprizio/RD/gc_4x5_merra2_TransportTracers/CodeDir/src/HEMCO/src/Core/hco_driver_mod.F90:165
#9  0x48ea58 in __hco_interface_gc_mod_MOD_hcoi_gc_run
        at /n/home05/msulprizio/RD/gc_4x5_merra2_TransportTracers/CodeDir/src/GEOS-Chem/GeosCore/hco_interface_gc_mod.F90:999
#10  0x452a3f in __emissions_mod_MOD_emissions_run
        at /n/home05/msulprizio/RD/gc_4x5_merra2_TransportTracers/CodeDir/src/GEOS-Chem/GeosCore/emissions_mod.F90:204
#11  0x40515f in geos_chem
        at /n/home05/msulprizio/RD/gc_4x5_merra2_TransportTracers/CodeDir/src/GEOS-Chem/Interfaces/GCClassic/main.F90:701
#12  0x403d96 in main
        at /n/home05/msulprizio/RD/gc_4x5_merra2_TransportTracers/CodeDir/src/GEOS-Chem/Interfaces/GCClassic/main.F90:32

Tagging @yantosca

@msulprizio msulprizio added the category: Bug Something isn't working label Apr 11, 2023
@msulprizio msulprizio added this to the 3.7.0 milestone Apr 11, 2023
@yantosca
Copy link
Contributor

Hi @msulprizio! Thanks for bringing this up. I believe this is a syntax error. Try changing

... C xy 1 1 -180/-90/180/90

to

... C xy 1 1 - 180/-90/180/90

leave a space between the - and the mask limits. That should fix it.

@msulprizio
Copy link
Contributor Author

msulprizio commented Apr 11, 2023

@yantosca The syntax appears to be correct. The dash there is meant to be there so lat1=-180. Also, the correct number of entries are passed in that line, adding a space between the - and 180 causes HEMCO to crash when reading that line because of two many entries.

I suspect the issue is caused by these lines added in #198:

! If ncFile is passed as the lon1/lat1/lon2/lat2 instead
! of netCDF file name, then set ncRead to false, so that
! HEMCO won't try to read a file from disk. Also set the
! IsLocTime flag to TRUE. This should fix Github issue
! https://github.com/geoschem/HEMCO/issues/153.
! -- Bob Yantosca (12 Jul 2022)
IF ( INDEX( Lct%Dct%Dta%ncFile, ".nc" ) == 0 ) THEN
Lct%Dct%Dta%ncRead = .FALSE.
Lct%Dct%Dta%IsLocTime = .TRUE.
ENDIF
ThisCover = CALC_COVERAGE( lon1, lon2, lat1, lat2, &
cpux1, cpux2, cpuy1, cpuy2 )

When I print Lct%Dct%Dta%ncFile there, it returns $METDIR/$CNYR/01/$MET.$CNYR0101.CN.$RES.$NC for OCEAN_MASK which I think means it is not recognized as a netCDF file.

@yantosca
Copy link
Contributor

yantosca commented Apr 11, 2023

Thanks @msulprizio, I'll look into this now.

@yantosca
Copy link
Contributor

This fixes the issue. I will prep a PR.

          ! If ncFile is passed as the lon1/lat1/lon2/lat2 instead
          ! of netCDF file name, then set ncRead to false, so that
          ! HEMCO won't try to read a file from disk.  Also set the
          ! IsLocTime flag to TRUE.  This should fix Github issue
          ! https://github.com/geoschem/HEMCO/issues/153.
          !  -- Bob Yantosca (12 Jul 2022)
          !
          ! Also allow for the .$NC replaceable token, see:
          ! https://github.com/geoschem/HEMCO/issues/204
          !  -- Melissa Sulprizio & Bob Yantosca (11 Apr 2023)
          IF ( INDEX( Lct%Dct%Dta%ncFile,   ".nc" ) == 0 ) THEN
             IF ( INDEX(  Lct%Dct%Dta%ncFile, ".$NC" ) == 0 ) THEN
                Lct%Dct%Dta%ncRead    = .FALSE.
                Lct%Dct%Dta%IsLocTime = .TRUE.
             ENDIF
          ENDIF

@msulprizio
Copy link
Contributor Author

The fix for this issue (PR #205) is now merged into the 3.7.0 development branch.

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: Scaling or Masking Related to issues in applying scale factors or masks
Projects
None yet
2 participants