News:

alphaMELTS 2.3 standalone & for MATLAB/Python is now open source and available on GitHub (https://github.com/magmasource/alphaMELTS).
alphaMELTS 1.9 is available at the legacy download and information site.
For news of all MELTS software see the MELTS Facebook page.

Main Menu

run_adiabat.pl bugs?

Started by robert, October 04, 2007, 04:40:47 PM

Previous topic - Next topic

robert

Using perl 5.8 and I'm having some trouble with the default run_adiabat.pl script. Here's a few issues so far: 

1. -m flag doesn't work

$ ./run_adiabat.pl -m Workman_Hart_DMM2.txt

...lots of env variables...
ADIABAT_MINP 10000

Please use melts file: Workman_Hart_DMM.melts

Checking for updates...

*** ADIABAT_1pH 1.8.2 -- Batch isentrope w/ or w/o liquid ***
.....blah blah

then when I hit "4" to begin it says
Your choice: 4
Please read in an input (or restart) file first.
Press any key to continue.

and I have to hit 1 and enter "Workman_Hart_DMM.melts" all over again. I assume the point of the -m flag is to skip this step? The filename is registered and the $melts_file seems to be defined correctly (at line 323 in run_adiabat.pl) but for whatever reason it doesn't load into the adiabat_1ph.

2. -o flag either doesn't work or I don't see what the point is?

It seems to me by entering this flag you want to automatically save (via 11) an output file upon completion. This does not happen. In the run_adiabat.pl help file it mentions "(must be same as given in option 11 of adiabat_1ph)", implying that you also have to enter it there as well? Why even have this flag if you're expected to enter it in the actual program? Am I missing something?


Paula

#1
As explained in the manual, these are not bugs:

QuoteBugs and fixes

  • The following is not really an erratum or a bug but, as it is the most frequent e-mail query, it is included first here. (Actually that should read 'was the most frequent' as we rarely get this particular query since this comment was added.) run_adiabat.pl only passes the information in your commands_file to adiabat_1ph in indirect ways - either by setting environment variables or by making entries in text files. If you are in batch or automatic mode it will redirect the adiabat_1ph standard input by executing 'adiabat_1ph < batch_file', which passes the melts_file / restart_file name. Otherwise, the user must still prompt adiabat_1ph to read in the relevant text or binary files (even when the '-m' run_adiabat.pl switch is used); a warning will be given if no files have been input.

    Unfortunately, the only short term solution to make run_adiabat.pl 'talk' directly to adiabat_1ph would be to use a program called 'Expect'. This would mean users would need to download and compile the Perl version of Expect. So that the adiabat_1ph package can be portable and require no previous experience with Perl, we hope that you will bear with us by reading in the melts_file with menu option 1 when necessary.


Basically the run_adiabat.pl script (1) does some stuff, (2) starts and hands over control to Adiabat_1ph, (3) waits for it to finish and (4) does some more stuff. The script does not track what you type in manually while Adiabat_1ph is running. Both '-o' and '-m' switches are used for telling the script which I/O files you are using so that it can do some file processing either before Adiabat_1ph is invoked (e.g. substituting values taken from the commands_file or table_file into the melts_file) or after it has exited (e.g. tidying up the outputted results in various ways and splitting then into separate files, as described in the manual).

The 'Please use melts file: Workman_Hart_DMM.melts' is directed at you, the user! The script is saying that it's done whatever manipulation of the melts_file you requested, if any, so you need to use that melts_file or the changes will not be picked up. If you use the automatic mode switch ('-a') then the name of the melts_file will be passed to Adiabat_1ph along with a simple set of menu commands and the 'Please use...' request will not be printed.

It's a similar story for the output files. If you want it to automatically save an output_file then set the ADIABAT_CRASH_FILE variable in your commands_file (you may want to set ADIABAT_SAVE_ALL to true also, depending on exactly what you are doing). In that case the run_adiabat.pl script knows the name of the output file as it's responsible for setting the environment variables in the first place, so you won't need a '-o' switch. But if you don't have a crash_file and instead use option 11 the '-o' switch allows you to tell run_adiabat.pl in advance what file you intend to use. You don't have to use the filename given with the '-o' switch, or indeed use the switch at all if typing the filename in twice is too much trouble, but then the file written with option 11 will not get tidied up.

Paula

P.S. I'm moving this topic as it applies equally to all operating systems