Not sure how to use your qsub
There is a python script floating around in this users group, I think Derek Gaston shared it a while back and it may be in MOOSE somewhere now. That script varied input file parameters and submits jobs, you might have to search for it.
Or you could use my cheap and lazy method, create N input files and then send your jobs as a batch. Here I changed the boundary condition (a pressure) instead of initial condition but in principle anything could be used. I use python to change the input files:
import os
import subprocess
import numpy as np
os.chdir('/dir/')
pressure_vec = np.linspace(-1.0e-08,1.0e-08,121)
for t in range(0,121):
infile = open('/dir/vary_hydroP.i') # Define the base file we will be iteratively modifiying
outfile = open('/dir/newvary_hydroP-'+repr(t)+'.i', 'w') # Open the out file we will write at each step in the iteration
# Note that we are using -'+repr(t)+'.i' in order to loop over the path name. This is used again in the next line.
replace = {'pressure = default_pressure':'pressure = %s' % pressure_vec[t],'file_base = out_Surf_core_iso_shell':'file_base = out_Surf_core_iso_shell-'+repr(t)}
for ln in infile:
for src, target in replace.iteritems():
ln = ln.replace(src, target)
outfile.write(line)
infile.close()
outfile.close()
This just takes a base file and replaces the string (here I'm replacing all pressure = default_pressure to pressure = #) where # is a component of my N = 121 length vector. This is one way to do it, and we can thank a stackexchange post for this. If you try string replacing with other methods, sometimes it destroys the syntax of the input file, but this particular code preserves it.