Error while time-shifting NHEMI_201906c file

Hello,
Trying to time-shift CCTM_CONC_v532_intel18.0_CMAQv53_TS_108NHEMI_201906_dailyav.nc is generating the following output/error:

$ ./run_tshift.sh

 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-2020 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 185 2020-08-28 16:49:45Z coats $
 Version with PARMS3.EXT/PARAMETER::MXVARS3= 2048
 netCDF version 4.8.1 of Sep 29 2021 09:36:14 $


 Missing environment variable EXECUTION_ID

 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

 Program M3TSHIFT to copy a selected time period from a Models-3 file
 to a different time period in a different Models-3 file.

 You need to have set environment variables for the input and output
 file logical names.  You will be asked to select the time period to be
 copied and the start of the time period to receive the results.
 Note that RUNLEN=0 for single-step runs (a "fencepost" problem)

 USAGE:  m3tproc [INFILE OUTFILE]     (and then answer the prompts).

 See URL

    https://www.cmascenter.org/ioapi/documentation/3.1/html/AA.html#tools

 Program copyright (C) 1992-2002 MCNC, (C) 1995-2013 Carlie J. Coats, Jr.
 (C) 2002-2010 Baron Advanced Meteorological Systems, LLC., and
 (C) 2014-2016 UNC Institute for the Environment.
 Released under Version 2 of the GNU General Public License. See
 enclosed GPL.txt, or URL

     https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

 Comments and questions are welcome and can be sent to

     Carlie J. Coats, Jr.    carlie@jyarborough.com
 or
     UNC Institute for the Environment
     100 Europa Dr., Suite 490 Rm 405
     Campus Box 1105
     Chapel Hill, NC 27599-1105

 Program version:
 $Id: m3tshift.f90 117 2019-06-15 14:56:29Z coats $


 Value for PROMPTFLAG not defined;returning default:   TRUE
 Enter INPUT FILE name [INFILE] >>     Value for IOAPI_CHECK_HEADERS not defined;returning default:   FALSE

 "INFILE" opened as OLD:READ-ONLY
 File name "/home/ubuntu/CMAQ/SEASONAL/CCTM_CONC_v532_intel18.0_CMAQv53_TS_108NHEMI_201906_dailyav.nc"
 File type GRDDED3
 Execution ID "????????????????"
 Grid name "108NHEMI"
 Dimensions: 187 rows, 187 cols, 44 lays, 260 vbles
 NetCDF ID:     65536  opened as READONLY
 Starting date and time  2019152:000000 (0:00:00   June 1, 2019)
 Timestep                          240000 (24:00:00 hh:mm:ss)
 Maximum current record number        31
 Value for PROMPTFLAG not defined;returning default:   TRUE
 Enter starting (source) date (YYYYDDD) for run [2019152] >>
 >>>  RESPONSE ERROR  <<<

      Your response 2015289 not in the range 2019152 ... 9999999
      This is error 1 of 5 errors allowed
      Please try again.

 Enter starting (source) date (YYYYDDD) for run [2019152] >>
 >>>  RESPONSE ERROR  <<<

      Your response  120000 not in the range 2019152 ... 9999999
      This is error 2 of 5 errors allowed
      Please try again.

 Enter starting (source) date (YYYYDDD) for run [2019152] >>     Using response   2022289
 Enter starting (source) time  (HHMMSS) for run [0] >>     Using response    120000
 Enter target date (YYYYDDD) for run [2019152] >>
 >>>  RESPONSE ERROR  <<<

      Your response ******* not in the range       0 ... 9999999
      This is error 1 of 5 errors allowed
      Please try again.

 Enter target date (YYYYDDD) for run [2019152] >>
 >>>  RESPONSE ERROR  <<<

      Your response ******* not in the range       0 ... 9999999
      This is error 2 of 5 errors allowed
      Please try again.

 Enter target date (YYYYDDD) for run [2019152] >>
 >>>  RESPONSE ERROR  <<<

      Did not understand your response
      This is error 3 of 5 errors allowed
      Please try again.

 Enter target date (YYYYDDD) for run [2019152] >>
 *** ERROR ABORT in subroutine M3PROMPT
 END-OF-FILE encountered

The error seems to be generated by m3tshift (this is why I’m posting it in the I/OAPI forum). The error did not occur when time-shifting CCTM_CONC_v53beta2_intel17.0_HEMIS_cb6r3m_ae7_kmtbr_m3dry_2023_quarterly_av.nc.
Thanks.

Before running m3tools programs like m3tshift through a script, it is recommended to first run it interactively and respond to each prompt.

While you did not post your script so we cannot look closer at how it needs to be modified, it is clear from the error messages you posted that your script is not providing the correct input to the prompts issued by m3shift. Running m3tshift interactively, you’ll see that the sequence of prompts is 1) logical name of input file, 2) first date in the input file you want to shift FROM, 3) first time in the input file you want to shift FROM, 4) date you want the date selected under 2) to be shifted to (to be written to the output file), 5) time you want the date selected under 3) to be shifted to (to be written to the output file), 6) time step you want to be used in the output file, 7) number of time steps you want to be written to the output file, and 8) logical file name of the output file.

File CCTM_CONC_v532_intel18.0_CMAQv53_TS_108NHEMI_201906_dailyav.nc contains 30 daily values for June 2019 and has a start time of 0, so your response to 2) needs to fall between 2019152 and 2019181, and of course your number of desired time steps needs to be equal or less than 30 depending on your selection under 2).

Hi Christian,
You’re right. Yesterday evening I had completely forgotten that run_tshift is not a part of the CMAQ official repository (somehow I incorrectly assumed that it had similar status as run_icon or run_bcon). Of course, the problem was M3TSHIFT not picking up the right dates and I now see that this is not done automatically but must be input manually in the script. With the due modification, it ran w/o problem.
Thanks.
P.S. Trying to use M3TSHIFT interactively does not work for me. Somehow, it always crops the name of the input file to 18 characters (don’t know why, maybe it’s the system configuration)

…always crops the name of the input file to 18 characters…

It’s not the system-configuration, it’s the system-guts.
See https://cjcoats.github.io/ioapi/LOGICALS.html

@afernandez The environment variable is restricted to 16 characters or less, but those environment variables can be set to a path+filename that is much longer than 16 characters. I’m not sure what the limit is for the length of the value of an environment variable, but I have never exceeded it.
Running interactively, you need something like:
setenv INFILE /path/to/your/file/filename.nc

Then you invoke the program interactively using
m3tshift $INFILE

POSIX specifies that you must support at least 512 (and allows the OS vendor to support more); the I/O API supports the usual Linux max of 65535. Such a large internal I/O API limit is very handy for routines like STRLIST()