Please help me check the format of my arinv file

Dear Experts and Users,

Hello! I’m encountering an inventory format recognition issue while using SMOKE v5.2.1 to process EDGAR gridded NetCDF emission data and would appreciate your assistance.

I’m trying to read EDGAR gridded NetCDF data using the list file approach with #LIST GRID header, but SMOKE encounters an error when reading the list file:

*** ERROR ABORT in subroutine CHKLSTFL
Problem at line 2 of ARINV. Could not open file:
bohai,CO,CO,0,/home/cmaq/CMAQ_build/LIBRARIES_gcc/SMOKE/data/ge_dat/EDGAR/EDGAR_Bohai_All_Pollutants.nc

The content of the file arinv.EDGAR.bohai.lst: #LIST GRID
bohai,CO,CO,0,/home/cmaq/CMAQ_build/LIBRARIES_gcc/SMOKE/data/ge_dat/EDGAR/EDGAR_Bohai_All_Pollutants.nc
bohai,NOx,NOx,0,/home/cmaq/CMAQ_build/LIBRARIES_gcc/SMOKE/data/ge_dat/EDGAR/EDGAR_Bohai_All_Pollutants.nc
bohai,SO2,SO2,0,/home/cmaq/CMAQ_build/LIBRARIES_gcc/SMOKE/data/ge_dat/EDGAR/EDGAR_Bohai_All_Pollutants.nc
bohai,NH3,NH3,0,/home/cmaq/CMAQ_build/LIBRARIES_gcc/SMOKE/data/ge_dat/EDGAR/EDGAR_Bohai_All_Pollutants.nc
bohai,NMVOC,NMVOC,0,/home/cmaq/CMAQ_build/LIBRARIES_gcc/SMOKE/data/ge_dat/EDGAR/EDGAR_Bohai_All_Pollutants.nc
bohai,BC,BC,0,/home/cmaq/CMAQ_build/LIBRARIES_gcc/SMOKE/data/ge_dat/EDGAR/EDGAR_Bohai_All_Pollutants.nc
bohai,OC,OC,0,/home/cmaq/CMAQ_build/LIBRARIES_gcc/SMOKE/data/ge_dat/EDGAR/EDGAR_Bohai_All_Pollutants.nc
bohai,PM25,PM25,0,/home/cmaq/CMAQ_build/LIBRARIES_gcc/SMOKE/data/ge_dat/EDGAR/EDGAR_Bohai_All_Pollutants.nc
bohai,PM10,PM10,0,/home/cmaq/CMAQ_build/LIBRARIES_gcc/SMOKE/data/ge_dat/EDGAR/EDGAR_Bohai_All_Pollutants.nc
bohai,CO2,CO2,0,/home/cmaq/CMAQ_build/LIBRARIES_gcc/SMOKE/data/ge_dat/EDGAR/EDGAR_Bohai_All_Pollutants.nc

It is an issue with the format of the ARINV file, or is there a problem with my NC file?

Hi, could you please post the complete smkinven logfile?

Please also verify that the environment variable IMPORT_GRDNETCDF_YN was set to “Y” in the run script.

META: This last arrogant and incompetent “WYSIWIG upgrade” to the Forum software makes it nearly impossible to deal with “code” issues. IT NEEDS TO BE FIXED !!!

This problem with CHKLSTFL is made harder to answer because of the code-author’s failure to follow standards about reporting the status associated with failures. The code

TDEV = JUNIT()

OPEN( TDEV, FILE=INFILE, STATUS=‘OLD’, IOSTAT=IOS )...

IF( IOS /= 0 ) THEN...

should report the value of IOS associated with this OPEN call: something like the following needs to follow immediately after the IF-stateament

WRITE( MESG,’(A,I9)’) ‘Status IOSTAT=’, IOS

CALL M3MESG( MESG )

Note that the status-numbers are (purely) compiler-vendor dependent: if you are using Intel-compiled programs, the compiler-manual will give you a (professional-quality) complete and detailed error characterization – and if you are using GNU gfortran-compiled programs, you will not get anything useful ;-(

Thank you, james! The issue is resolved.

Thank you, cjcoats! The issue is resolved.

Now I have a new question.

I am encountering an issue with the SMOKE model’s SMKINVEN program while processing emission inventory data. My study region is the Bohai Sea, so I cropped the global data. The error messages changed before and after cropping:

Before cropping:
Bad COL dimension for “emissions” in “TMPFILE”
Could not read “emissions” from gridded inventory file

After cropping:
Error opening “TMPFILE”
No such file or directory
Could not read “emissions” from gridded inventory file

The error before cropping indicates that TMPFILE could be opened but the column dimension of the data did not match. After cropping, the program cannot open the TMPFILE at all.

This is my run log. The bottom part is using the data before cropping, and the rest is using the data after cropping.

Value for PROMPTFLAG: FALSE returning FALSE
Returning default value TRUE for query:
“Continue with program?”
Value for SMK_SOURCE: ‘A’
Value for SMK_SOURCE: ‘A’
Value for OUTZONE: 0
Value for SMKINVEN_FORMULA: ’ ’
Value for SMKINVEN_FORMULA: ’ ’
Value for IMPORT_AVEINV_YN not defined;returning default: TRUE
Value for DAY_SPECIFIC_YN: FALSE returning FALSE
Value for HOUR_SPECIFIC_YN: FALSE returning FALSE
Value for SMK_PROCESS_HAPS: ’ ’
Value for SMK_PROCESS_HAPS: ’ ’
No processing of combining criteria VOC with hazardous air pollutants (HAP).
Value for SMK_ARTOPNT_YN: FALSE returning FALSE
Value for IMPORT_GRDIOAPI_YN: FALSE returning 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:  FALSE returning FALSE
 Value for IOAPI_CHECK_HEADERS not defined;returning default:   FALSE
  
 "GRIDMASK" opened as OLD:READ-ONLY   
 File name "/home/cmaq/CMAQ_build/LIBRARIES_gcc/SMOKE/data/ge_dat/EDGAR/GRIDMASK_Bohai.ncf"
 File type GRDDED3 
 Execution ID "????????????????"
 Grid name "Bohai_Grid"
 Dimensions: 40 rows, 60 cols, 1 lays, 2 vbles
 NetCDF ID:     65536  opened as READONLY            
 Time-independent data.
 Value for USE_EXP_GEO_CODES:  FALSE returning FALSE
 Value for PROMPTFLAG:  FALSE returning FALSE

 File "COSTCY" opened for input on unit:  98
 /home/cmaq/CMAQ_build/LIBRARIES_gcc/SMOKE/data/ge_dat/EDGAR/costcy.txt


 File "INVTABLE" opened for input on unit:  97
 /home/cmaq/CMAQ_build/LIBRARIES_gcc/SMOKE/data/ge_dat/EDGAR/invtable_edgar_bohai.txt

 Setting up to read inventory data...
 Value for SMK_DEFAULT_TZONE:  8
 Reading state and county names and time zones...
 Value for SMKINVEN_MONTH not defined; returning default:  0
 Value for NETCDF_INV_YEAR:  2022

 File "ARINV" opened for input on unit:  96
 /home/cmaq/CMAQ_build/LIBRARIES_gcc/SMOKE/data/ge_dat/EDGAR/arinv.EDGAR.bohai.lst

 Value for WKDAY_NORMALIZE:  N returning FALSE
 NOTE: Setting inventory to use full-week normalizer for weekly profiles
 Error opening "TMPFILE"
 No such file or directory
 Could not read "emissions" from gridded inventory file
 Error opening "TMPFILE"
 No such file or directory
 Could not read "emissions" from gridded inventory file
 Error opening "TMPFILE"
 No such file or directory
 Could not read "emissions" from gridded inventory file
 Error opening "TMPFILE"
 No such file or directory
 Could not read "emissions" from gridded inventory file
 Error opening "TMPFILE"
 No such file or directory
 Could not read "emissions" from gridded inventory file
 Error opening "TMPFILE"
 No such file or directory
 Could not read "emissions" from gridded inventory file
 Error opening "TMPFILE"
 No such file or directory
 Could not read "emissions" from gridded inventory file
 Error opening "TMPFILE"
 No such file or directory
 Could not read "emissions" from gridded inventory file
 Error opening "TMPFILE"
 No such file or directory
 Could not read "emissions" from gridded inventory file
 Bad COL dimension for  "emissions" in "TMPFILE"
 Could not read "emissions" from gridded inventory file
 
 *** ERROR ABORT in subroutine RDGRDNCF
 Problem reading gridded inventory file

My questions are:

  1. Why would the cropped data cause TMPFILE to be unopenable?

  2. What should I pay attention to when cropping data to ensure compatibility with SMOKE?