Error in smkinven while reading gridded netcdf inventory

I am following “Hemispheric Modeling Support in SMOKE” document and trying to use SMOKE for local gridded inventory for an Indian city. I have formatted my gridded inventory exactly as EDGAR netcdf format. I have created GRIDMASK and GEOCODE_LEVEL1-4 files as suggested in document. After setting environmental variables, when I run smkinven program, I get following error:

This program uses the EPA-AREAL/MCNC-EnvPgms/BAMS/ UNC IE
Models-3 I/O Applications Programming Interface, [I/O API]
which is built on top of the netCDF I/O library (Copyright
993, 1996 University Corporation for Atmospheric Research
Unidata Program) and the PVM parallel-programming library
(from Oak Ridge National Laboratory).
Copyright (C) 1992-2002 MCNC,
(C) 1992-2018 Carlie J. Coats, Jr.,
(C) 2003-2012 Baron Advanced Meteorological Systems, LLC, and
(C) 2014-2023 UNC Institute for the Environment.
Released under the GNU LGPL License, version 2.1. See URL

     https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html

 for conditions of use.

 ioapi-3.2: $Id: init3.F90 247 2023-03-22 15:59:19Z coats $
 $Tag: 2023075 $
 Version 3.2.74 with PARMS3.EXT/PARAMETER::MXVARS3= 2048
 netCDF version 4.3.3.1 of Dec 10 2015 16:44:18 $


 EXECUTION_ID: GGN_TEST
 SMOKE ---------------
 Copyright (c)2004 Center for Environmental Modeling for Policy Development
 All rights reserved

 Program SMKINVEN, Version SMOKEv5.1_Jul2024
 Online documentation
     https://cmascenter.org/smoke/

 Program SMKINVEN to take ASCII area or point source files
 in IDA, EMS-95, or SMOKE list format, or mobile files
 in IDA format, and produce the I/O API and ASCII SMOKE
 inventory files and list of unique SCCs in the inventory.


 You will need to enter the logical names for the input and
 output files (and to have set them prior to program start,
 using "setenv <logicalname> <pathname>").

 You may use END_OF-FILE (control-D) to quit the program
 during logical-name entry. Default responses are given in
 brackets [LIKE THIS] and can be accepted by hitting the
 <RETURN> key.

 Value for PROMPTFLAG not defined;returning default:   TRUE
 Continue with program? (Y/N) [Y] >>
 Returning default value TRUE for query:
 "Continue with program?"
 Value for SMK_SOURCE:  'A'
 Value for SMK_SOURCE:  'A'
 Value for OUTZONE not defined; returning default:  0
 Value for SMKINVEN_FORMULA not defined; returning defaultval ':  ' '
 Value for SMKINVEN_FORMULA not defined; returning defaultval ':  ' '
 Value for IMPORT_AVEINV_YN not defined;returning default:   TRUE
 Value for DAY_SPECIFIC_YN not defined;returning default:   FALSE
 Value for HOUR_SPECIFIC_YN not defined;returning default:   FALSE
 Value for SMK_PROCESS_HAPS not defined; returning defaultval ':  ' '
 Value for SMK_PROCESS_HAPS not defined; returning defaultval ':  ' '
 No processing of combining criteria VOC with hazardous air pollutants (HAP).
 Value for SMK_ARTOPNT_YN not defined;returning default:   FALSE
 Value for IMPORT_GRDIOAPI_YN not defined;returning default:   FALSE
 Value for IMPORT_GRDNETCDF_YN:  Y returning TRUE
 Value for NETCDF_POL_UNIT:  'kg m-2 s-1'
 Value for NETCDF_POL_UNIT:  'kg m-2 s-1'

 Value for PROMPTFLAG not defined;returning default:   TRUE
 Enter logical name of the GRID MASK input file [GRIDMASK] >>
 Value for IOAPI_CHECK_HEADERS:  Y returning TRUE

 "GRIDMASK" opened as OLD:READ-ONLY
 File name "/home/erl-yvs/SMK_CAMx/SMOKE_V5/inputs/GGN_GRIDMASK.nc"
 File type GRDDED3
 Execution ID "GRIDDESC"
 Grid name "GGN_GRD_01"
 Dimensions: 14 rows, 15 cols, 1 lays, 2 vbles
 NetCDF ID:     65536  opened as READONLY
 Time-independent data.
 Value for USE_EXP_GEO_CODES:  Y returning TRUE
 Value for PROMPTFLAG not defined;returning default:   TRUE
 Enter logical name for INVENTORY DATA TABLE file [INVTABLE] >>

 File "INVTABLE" opened for input on unit:  99
 /home/erl-yvs/SMK_CAMx/SMOKE_V5/data/inventory/nei2005/other/invtable_hapcap_cb05soa.txt

 Setting up to read inventory data...
 Value for SMK_DEFAULT_TZONE not defined; returning default:  5
 Reading geographic region names and time zones...
 Enter logical name for geographic level 1 codes file [GEOCODE_LEVEL1] >>

 File "GEOCODE_LEVEL1" opened for input on unit:  98
 GEOCODE_LEVEL1

 Enter logical name for geographic level 2 codes file [GEOCODE_LEVEL2] >>

 File "GEOCODE_LEVEL2" opened for input on unit:  98
 GEOCODE_LEVEL2

 Enter logical name for geographic level 3 codes file [GEOCODE_LEVEL3] >>

 File "GEOCODE_LEVEL3" opened for input on unit:  98
 GEOCODE_LEVEL3

 Enter logical name for geographic level 4 codes file [GEOCODE_LEVEL4] >>

 File "GEOCODE_LEVEL4" opened for input on unit:  98
 GEOCODE_LEVEL4

 Value for SMKINVEN_MONTH not defined; returning default:  0
 Value for NETCDF_INV_YEAR:  2023
 Enter logical name for the inventory list file [ARINV] >>

 File "ARINV" opened for input on unit:  98
 /home/erl-yvs/SMK_CAMx/SMOKE_V5/inputs/GGN_List_File.txt

 Value for WKDAY_NORMALIZE not defined;returning default:   FALSE
 NOTE: Setting inventory to use full-week normalizer for weekly profiles
 Value for SMKINVEN_FORMULA not defined; returning defaultval ':  ' '
 Value for SMKINVEN_FORMULA not defined; returning defaultval ':  ' '
 Value for SMK_BASEYR_OVERRIDE not defined; returning default:  0
 Value for INVNAME1:  'area.ggn'
 Value for INVNAME1:  'area.ggn'
 Value for INVNAME2:  'areasrc.ggn'
 Value for INVNAME2:  'areasrc.ggn'

 File "AREA" opened for output on unit:  98
 area.out

 Value for AREA:  'area.out'
 Value for AREA:  'area.out'
 NOTE: Inventory base year set to   2023
 Number of variables per file array is not allocated for file set IOAPI_INV;
 using default of  2048 variables per file

 >>--->> WARNING in subroutine OPENSET
 Could not generate individual file names for file set "IOAPI_INV"

 ERROR: Could not open I/O API inventory file for file name:
                                                                                      VOC

GETEFILE ERROR: file-open failure: File name too long
File name too long: File name too long

ASRC: VOC
I/O status: 36

 Could not open output file:
      ASRC.

 *** ERROR ABORT in subroutine OPENINVOUT
 Ending program.

I tries various options to resolve but unable to resolve the error.
Any leads are appreciated.
@bbaek
test_smkinven_script.csh (589 Bytes)

Please verify that your list file “GGN_List_File.txt” follows the column order of SCC, pollutant, inventory variable name for pollutant, month of inventory as an integer (1-12) or 0 for annual inventories, and complete path to netCDF inventory.

Example snippet of list file for netCDF input:

The error “GETEFILE ERROR: file-open failure: File name too long” indicates that the path to your inventory in the list file exceeds the maximum variable size. Try moving the inventory to a path with a shorter length/fewer number of characters. If this doesn’t work please share your list file so that we can review it for any potential issues.

Note that GETEFILE supports path-names up to 512 characters (which is the length guaranteed by the POSIX Standard).

Longer than that sounds suspicious, and I would suspect some other problem. FWIW

1 Like

Hi @cjcoats @james.beidler
Thank you for your reply.
My filename path in list file is 52 characters only.
I am uploading the some test data and other required files as well to get help on this issue.
Due to file upload restriction, I have added txt extension to some filenames here.

Thank you.
smkinven_log.txt (6.8 KB)
GRIDDESC_GGN.txt (132 Bytes)
GEOCODE_LEVEL1.txt (47 Bytes)
GEOCODE_LEVEL2.txt (52 Bytes)
GEOCODE_LEVEL3.txt (59 Bytes)
GEOCODE_LEVEL4.txt (6.5 KB)
test_smkinven_script.csh (589 Bytes)
GGN_List_File.txt (5.5 KB)
GGN_GRIDMASK.nc.txt (13.1 KB)
TRAN_NOx.nc.txt (1.9 KB)
TRAN_PM2.5.nc.txt (1.9 KB)

Hello Mr. James Beidler,
When I set the month in the arinv file as shown in your example instead of setting it to 0, I get the following error.
Do you happen to know how to resolve this issue?

 "IOAPI_DAT" opened as OLD:READ-ONLY
 File name "/home2/heo/MODEL/EMIS/SMOKE/V4.7/subsys/smoke/data/inventory/BASE/VEG.BASE_dat/PM2_5_OTH.ncf"
 File type GRDDED3
 Execution ID "????????????????"
 Grid name ""
 Dimensions: 231208 rows, 1 cols, 1 lays, 7 vbles
 NetCDF ID:    196608  opened as READONLY
 Time-independent data.
 Closing file IOAPI_DAT
 ERROR: Missing or negative emission value(s) in inventory for "PM2_5_OTH".

 "IOAPI_DAT" opened as OLD:READ-ONLY
 File name "/home2/heo/MODEL/EMIS/SMOKE/V4.7/subsys/smoke/data/inventory/BASE/VEG.BASE_dat/POC.ncf"
 File type GRDDED3
 Execution ID "????????????????"
 Grid name ""
 Dimensions: 1277 rows, 1 cols, 1 lays, 7 vbles
 NetCDF ID:    196608  opened as READONLY
 Time-independent data.
 Closing file IOAPI_DAT
 ERROR: Missing or negative emission value(s) in inventory for "POC".

 "IOAPI_DAT" opened as OLD:READ-ONLY
 File name "/home2/heo/MODEL/EMIS/SMOKE/V4.7/subsys/smoke/data/inventory/BASE/VEG.BASE_dat/VOC.ncf"
 File type GRDDED3
 Execution ID "????????????????"
 Grid name ""
 Dimensions: 221206 rows, 1 cols, 1 lays, 7 vbles
 NetCDF ID:    196608  opened as READONLY
 Time-independent data.
 Closing file IOAPI_DAT
 ERROR: Missing or negative emission value(s) in inventory for "VOC".