Read/write file access w/PEST protocol
I am attempting to use the iTOUGH2 PEST protocol using a bash script as my forward-model executable. This script includes multiple calls of a TOUGHREACT simulation with file manipulation in between to set up restarts. However, it appears that some of the file manipulations do not operate correctly. For example, part of the bash script includes the command 'mv SAVE INCON' (which, in Linux and Mac lingo, moves the file SAVE to a file INCON). However, this command gets ignored when I attempt to run itough2 with the ">>> FORWARD" COMPUTATION option. When I run the batch script without invoking iTOUGH2, this command works. Are there limits on the batch-script commands that be included in Executables called by iTOUGH2-PEST, or am I running into another kind of problem? I'd be happy to include file if it helps.
10 replies
-
Hi Mikey,
iTOUGH2 does not know or care too much about what's in the script file. It also does not affect it (i.e., if you script works independently from iTOUGH2, it should also work when called from iTOUGH2).
Not sure what you mean by "gets ignored"; do you get an error message? Try to redirect standard error in your script, e.g.:
echo "Hard word ahead: try to move stuff" >> fort.99
mv SAVE INCON >> fort.99 2>&1 >> fort.99
echo "Glad this is done, or is it? Let me check:" >> fort.99
ls -l SAVE INCON >> fort.99
Then look in the *.msg file.
Alternatively, send me all your input files.
Stefan
-
Stefan Finsterle
I think I found my problem. In between restarts, I had a step where I remove the files providing initial conditions for flow (INCON) and the initial conditions for chemical equations (inchem). I did this by trying to run the command 'rm {INCON,inchem}'. This worked when running the shell script directly, but when attempting to run this using iTOUGH, it did not recognize the command. I think it was looking for a file named '{INCON,inchem}' rather than recognizing I wanted to delete both of the files. When I split this command into 'rm INCON' followed by 'rm inchem', the issue went away.
-
Why the curly bracket?
rm INCON inchem
should work as well.
Stefan