#!/bin/bash
pool_size=$1
pool_rank=$2

nlmdz=71
nopa=360
nxios=1
rm -f run_file
for (( c=0; c<$pool_size; c++ ))
do
  whole_ensemble_rank=$((${pool_size}*${pool_rank}+$c))
  echo "${nlmdz}-8 env OMP_NUM_THREADS=8 MEMBER=${whole_ensemble_rank} ./script_lmdz.x.ksh" >> run_file
done  
for (( c=0; c<$pool_size; c++ ))
do
  whole_ensemble_rank=$((${pool_size}*${pool_rank}+$c))
  echo "${nopa}-1 env OMP_NUM_THREADS=1 MEMBER=${whole_ensemble_rank} ./script_opa.xx.ksh" >> run_file
done  
echo "${nxios}-1 env OMP_NUM_THREADS=1  ./script_xios.x.ksh" >> run_file

