SMOKE merge program problem

Hi all,
I used SMOKE to process EDGAR emissions by sector. When i tried to merge different sectors with the merge program, i encountered a problem. No error messages showed up, but the program just stuck at one place and never finished. I waited for one day and it still stuck there. Does anyone know how to fix this?


Thanks!
Lin

Lin, is there any sort of log file or stdout file that you could share?

Hi eyth,
Below is the log file:

 This program uses the EPA-AREAL/MCNC-EnvPgms/BAMS Models-3      
 I/O Applications Programming Interface, [I/O API] which is      
 built on top of the netCDF I/O library (Copyright 1993, 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-2019 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 136 2019-10-16 13:57:49Z coats $
 Version with PARMS3.EXT/PARAMETER::MXVARS3= 2048
 netCDF version 4.7.0 of Jan 26 2020 09:15:55 $
  
  
 Missing environment variable EXECUTION_ID
 SMOKE ---------------
 Copyright (c)2004 Environmental Modeling for Policy Development
 All rights reserved

 Program MRGGRID, Version SMOKEv4.7_Oct2019
 Online documentation 
     http://www.cep.unc.edu/empd/products/smoke                 
  
 Program MRGGRID reads 2-D area, biogenic, mobile, and 3-D
 point source emissions and merges into a single 3-D file.
 The time period merged is adjusted based on the latest
 starting file and earliest ending file.  All variables are
 merged, even if different variables are in each file.
  
  
 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:  Y returning TRUE
 Continue with program? (Y/N) [Y] >>

Looks like you are trying to run Mrggrid program interactively. If you want to do that, you need to set PROMPTFLAG to Y by entering the return key. If not, you can write up a simple csh run script that can automate your runs.

We think your program was waiting for a prompt related to “Continue with program?”. We always run SMOKE with PROMPTFLAG=N to avoid this.

Thanks! Yes, this solves the problem.
I have another question, is it possible to define input file names manually?
Lin

Good news. Which inputs are you referring to? Right now they are based on patterns by sector and day.

You could change the merging script, but if you provide an example that would make it clearer.

Below is the merging script i am using:

#Set Assigns file name
setenv ASSIGNS_FILE $SMKROOT/assigns/ASSIGNS.EDGAR.cmaq.cb05_soa.HEMI_108k

#Set source category
setenv SMK_SOURCE A # source category to process

#Set programs to run…

#For merging from previously generated gridded Smkmerge outputs
setenv RUN_MRGGRID Y #run gridded file merge program
#NOTE: in sample script, Mrggrid used to create merged model-ready CMAQ files

#Program-specific controls…

#For Mrggrid
setenv MRG_DIFF_DAYS N #Y allows data from different days to be merged
#MRGFILES see “Script settings” below

#Script settings
setenv MRGFILES “AGTS_L” #logical file names to merge
setenv MRGGRID_MOLE Y #Y outputs mole-based file, musy be consistent with MRGFILES
setenv SRCABBR a #abbreviation for naming log files
setenv PROMPTFLAG N #Y prompts for user input
setenv SMK_MAXERROR 100 #maximum number of error messages in log file
setenv SMK_MAXWARNING 100 #maximum number of warning messages in log file
setenv AUTO_DELETE Y #Y automatically deletes I/O API NetCDF output files
setenv AUTO_DELETE_LOG Y #Y automatically deletes log files
setenv DEBUGMODE N #Y runs program in debugger
setenv DEBUG_EXE pgdbg # debugger to use when DEBUGMODE = Y
##############################################################################

#Loop through days to run Smkmerge and Mrggrid

setenv RUN_PART2 Y
setenv RUN_PART4 Y
set cnt = 0
set g_stdate_sav = $G_STDATE
while ( $cnt < $EPI_NDAY )

@ cnt = $cnt + $NDAYS
source $ASSIGNS_FILE #Invoke Assigns file to set new dates

if ( $MRGGRID_MOLE == Y ) then
setenv OUTFILE $EGTS_L
else
setenv OUTFILE $EGTS_S
endif

source smk_run.csh #Run programs
setenv G_STDATE_ADVANCE $cnt

end
setenv RUN_PART2 N
setenv RUN_PART4 N
unsetenv G_STDATE_ADVANCE

#Ending of script

exit( 0 )

I am using EDGAR emission inventory and i have run by sectors, the sectors are : agriculture, aviation, energy, fire, industry, mobile, ship and waste. Because EDGAR emissions are pregrided so i process them as area source. The output names are as follows: agts_l.agriculture.area.20050710.1.NH108k.HEMI_108k.ncf. And i tried to chenge MRGFILES and SRCABBR but failed.

This is helpful. Can you also please provided your mrggrid log file? That would help us to understand where things are going wrong.

Below is the log file:

 This program uses the EPA-AREAL/MCNC-EnvPgms/BAMS Models-3      
 I/O Applications Programming Interface, [I/O API] which is      
 built on top of the netCDF I/O library (Copyright 1993, 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-2019 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 136 2019-10-16 13:57:49Z coats $
 Version with PARMS3.EXT/PARAMETER::MXVARS3= 2048
 netCDF version 4.7.0 of Jan 26 2020 09:15:55 $
  
  
 Missing environment variable EXECUTION_ID
 SMOKE ---------------
 Copyright (c)2004 Environmental Modeling for Policy Development
 All rights reserved

 Program MRGGRID, Version SMOKEv4.7_Oct2019
 Online documentation 
     http://www.cep.unc.edu/empd/products/smoke                 
  
 Program MRGGRID reads 2-D area, biogenic, mobile, and 3-D
 point source emissions and merges into a single 3-D file.
 The time period merged is adjusted based on the latest
 starting file and earliest ending file.  All variables are
 merged, even if different variables are in each file.
  
  
 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:  N returning FALSE
 Returning default value TRUE for query:
 "Continue with program?"
 Value for PROMPTFLAG:  N returning FALSE

 File "FILELIST" opened for input on unit:  98
 /home/lwu127/SMOKE-4.7/data/inventory/edgar2010/other/filelist.mrggrid.txt

 Value for MRG_DIFF_DAYS:  N returning FALSE
 Mrggrid compiled with I/O API MXVARS3 =   2048
 AGTS_L          :/home/lwu127/SMOKE-4.7/data/run_HEMI_108k/output/cmaq_cb05_soa/agts_l.area.20091231.1.NH108k.HEMI_108k.ncf
 
 >>--->> WARNING in subroutine OPENSET
 File not available.
 
 Could not open file "AGTS_L".
 
 *** ERROR ABORT in subroutine MRGGRID
 Ending program "MRGGRID".

Thanks !!

We think the error you are seeing means that your output directory does not exist and needs to be created.

We note your script looks a bit different than ours, but we think that this is most likely the problem.

You need to define the environment variable(s) for those sector-specific output files that you want to merge together. Once you define them in your ASSIGNS file, you can list them under MRGFILES. Mrggrid will use the list to merge them together.