Parameter space driver

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
hetland
Posts: 81
Joined: Thu Jul 03, 2003 3:39 pm
Location: TAMU,USA

Parameter space driver

#1 Unread post by hetland »

Often, I find that I want to run roms over some set of parameters. The best way to do this is to make critical parameters dependent on the USER parameters in the roms.in file. I have written a program in python which does just this, automatically.

The program, pspace.py, creates a series of input files using all permutations of parameters specified in a parameter file. The program then runs the code using a user specified run line. Here is the text you see when you run pspace.py - -help
SPACE runs a ROMS application over a series of parameters by modifying the
input file. Output file names are also changed to include the parameter
values of each particular run.

Usage: pspace [options] 〈base〉

Required argument 〈base〉 is the root of the input and output files.
Input, output, history, and other NetCDF output files are renamed in
a format like base_values.in or base_values_his.nc, where ‘values’ is
a string of parameters changed in the run separated by underscores.

Options are:
-b, - -basefile= Base input file, to be modified by parameters in
paramfile. Default is ‘base.in’.

-e, - -execstr= Execution string, e.g.,

‘nohup mpirun -np NP ./oceanM INFILE >& OUTFILE &’

values NP, INFILE, and OUTFILE are replaced with the
modified input file, output file. If present, NP is
replaced with NtileI*NtileJ.

-p, - -paramfile= Parameter file (default=base.param) with format:

VAR1:
value1
value2
VAR2:
value1 value2
value3 value4
[etc..]

-h, - -help Help
I wrote about this here first, but thought y'all might like to see it. Please send me any comments, suggestions, or, even better, improvements.

-Rob

Post Reply