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

Executing multiple melts_files made from a table_file

Started by dbhw2, July 10, 2009, 07:38:55 AM

Previous topic - Next topic

dbhw2

Hello,

I'm fairly new to adiabat_1ph, and I'm having difficulty with the table_file option of the run_adiabat.pl script.  The command I'm using is:

run_adiabat.pl   -a   -m iceland.melts   -t iceland_comps.csv   -o iceland.out

which does make valid, multiple melts files as I need. But I only seem to get calculations and results from the first (template) melts file - it doesn't carry on to execute the others with this command.  The screen output from the first set of calculations ends with:

"Minimum Temperature reached
Successful return from adiabat_1..."

followed by the options menu again before exiting.

The manual says, "If you use automatic mode with a table_file then adiabat_1ph will read in and execute each file in turn, starting with the original template melts_file" which I thought was what I'm doing here - but maybe I'm doing something wrong!  I'd be very grateful if you could enlighten me.

The calculations I'm doing are isobaric fractional crystallisation.  Each melts_file made from the table_file does seem to work fine when run individually.  I've tried specifying the command_file and using a batch_file option too, using -f and -b in the command above, but the outcome is the same. My operating system is Linux (Fedora 8).

Thank you,

Ben

Paula

Hi Ben,

Sorry you've been having problems... but thanks for letting us know.  

There should be a file called 'auto_batch.dat' appearing when you use '-a'.  What is in that file?  Should help to narrow down what's going wrong.

Also maybe you can post your commands_file with the environment variables etc.?  I assume you are actually using '-f commands_file' with the -a switch as well as the -b one (or if you aren't then should be ;-) ).  If you use the adiabat_env.dat file for your commands_file then you do not need the -f and should write '-b batch_file' and not something like '-b -f batch_file' as run_adiabat.pl will not work properly otherwise.

More soon,
Paula

dbhw2

Hi Paula,
I managed to work around it my writing a simple script to run all of the files automatically, which works well for what I need.  So if it's just me being unable to do this and not a general problem, then it can be forgotten!  Thank you for your suggestions, though.

Here is the auto_batch.dat file anyway, if it is of any use at all... I tried lots of combinations of the commands including the ones that you mention, but had no luck in getting all the  .melts files to run:

1
iceland.melts
3
1
4
11
.out
0

I was using adiabat_env.dat and had edited it to give:
ADIABAT_VERSION MELTS
ADIABAT_MODE isobaric
ADIABAT_DELTAP 0
ADIABAT_DELTAT -1
ADIABAT_MAXP +30000
ADIABAT_MINP +0
ADIABAT_MAXT +2000
ADIABAT_MINT 1000
ADIABAT_MINF 0.005
!ADIABAT_FRACTIONATE_SOLIDS true
ADIABAT_MASSIN  0.001
ADIABAT_DO_TRACE true
ADIABAT_TRACE_DEFAULT_DPTX true
!ADIABAT_TRACE_INPUT_FILE filename
ADIABAT_TRACE_OUTPUT_FILE iceland-trace.out
ADIABAT_CELSIUS_OUTPUT true
!ADIABAT_CRASH_FILE filename
!ADIABAT_SAVE_ALL true

Other variables (fractionated phases, P, fO2 etc) are in the melts_file that I used as a template.

Extracting the data from all the output files was surprisingly easy with the column_pick.pl script - I've had awful trouble automatically getting all the data out of other programs modelling fractional crystallisation, so thanks for that!

Ben

Paula

Hi Ben,

I think I found the stupid bug (my mistake, you were doing everything correctly).  Please could you try changing '$table_file' on line 311 of run_adiabat.pl to '$table_row' and see if it works then?  I was trying this on a Mac and it did print 'iceland.out' rather than '.out'.  Will try it on Linux when get a chance.

You will need to set ADIABAT_SAVE_ALL to true so that all the output goes into the iceland.out file and not just the last run.  Not quite sure what will happen to the solids tables in this case, especially if you then use column_pick.pl to extract the data.  I guess it might be better to make separate output files for each run (the users who originally requested the table file function didn't need the solids file information).  The problem then is that run_adiabat.pl will only process one output file and split it into Liq_tbl.txt etc..  Hmm...

There's a new version of adiabat_1ph and run_adiabat.pl coming up sometime soon so I'll try to work out a better way to handle the output.

Thanks again for pointing out the problem.

Paula