Editing I/O API file dates only

I just want to edit the MCIPv4.5 output files in I/O API format such that year 2000 becomes 2005 and everything else stays the same. What are some ways to tackle this problem?

Trying to edit in place will mess up the internal data structures. Instead, use M3Tools program m3tshift: see https://www.cmascenter.org/ioapi/documentation/all_versions/html/M3TSHIFT.html

m3tshift of I/O API v3.1 didn’t work for me - it kept creating a new file with the same old date (basically not replacing 2000 with 2005)!

I just re-checked and it works for me. What version do you have (do ident which m3tshift)?
The current version has

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

When I typed the command ‘ident m3tshift’, I got:

 $Id:: m3tshift.f 79 2014-12-12 16:28:01Z coats             $
 $Id:: init3.F 321 2016-02-26 16:00:20Z coats                $

This version is at least 4 versions (jun152019, dec12017, sep092017, jun142016) out-of-date. You may want to update… everything.

Looks like only v3.2 is on github, I will download the tar-zip of v3.1 directly at https://www.cmascenter.org/ioapi/download/ioapi-3.1.tar.gz

Both of these versions should work correctly, unless you’re doing something like

setenv PROMPTFLAG N

I’d need to see a complete log to help any further.

In a command line interactive execution of the I/O API tool m3tshift, I just press the ‘enter’ key to accept default value, but in a shell script version of the same tool in UNIX, what should I write in the code that indicates ‘enter’ key equivalent to accept the default values? A blank is not working for me.

I normally do something like the following (in this example, from a script for m3probe, which has a somewhat-complicated set of prompts and defaults) [where I’m having to use backslash-poundsymbol to make this editor happy;-( ]

set UI    = /tmp/m3probe.$$

echo "Yes         " >&  ${UI}          \# continue with the program
echo "            " >>  ${UI}          \# default starting date
echo "            " >>  ${UI}          \# default starting time
echo "            " >>  ${UI}          \# default ending   date
echo "            " >>  ${UI}          \# default ending   time
echo "            " >>  ${UI}         \ # default time step
echo "${VARIABLE} " >>  ${UI}         \ # name for variable to be probed
echo "${POINT}    " >>  ${UI}         \ # number for stream-reach to be probed
echo "0           " >>  ${UI}          \# end list of points

time ${pgm} < ${UI}
set foo = ${status}
if ( ${foo} != 0 )  echo "ERROR ${foo} on program m3probe"
exit ( ${foo} )

Thanks - I use a tcsh shell, and some changes worked for me:

mkdir -p temp_files
set UI = $cwd/temp_files/temp_response_m3tshift_2may2020.${source_YYYYMMDD}.${SECTOR}.$$
echo INFILE >>  ${UI}               \ 
echo "" >>  ${UI}                   \ 
echo "" >>  ${UI}                   \ 
echo ${YYYYDDD_target} >>  ${UI} \ 
echo "" >>  ${UI}                   \ 
echo "" >>  ${UI}                   \ 
echo "" >>  ${UI}                   \ 
echo OUTFILE >>  ${UI}
# ###################################################################
/proj/MYLIB/ioapi/Linux2_x86_64ifort/m3tshift < $UI