run_parameter_set 1.27 KB
NAME_FH="STP_DM_NLAYER"
RESULT_NAME_FH="STP_DM_NLAYER_RESULTS"
mkdir $RESULT_NAME_FH

while read  NLAYER NWINC NHINC NSAMPLES FMAX
do   

  echo "Parameters $NLAYER $NWINC $NHINC $NSAMPLES $FMAX"

  sed "s/#NLAYER/$NLAYER/g ; s/#NWINC/$NWINC/g; s/#NHINC/$NHINC/g; s/#NSAMPLES/$NSAMPLES/g; s/#FMAX/$FMAX/g" $NAME_FH/stp.cable_spec_TEMPLATE > $NAME_FH/stp.cable_spec
  sed "s/#NLAYER/$NLAYER/g ; s/#NWINC/$NWINC/g; s/#NHINC/$NHINC/g; s/#NSAMPLES/$NSAMPLES/g; s/#FMAX/$FMAX/g" $NAME_FH/stp.bundle_spec_TEMPLATE > $NAME_FH/stp.bundle_spec
  sed "s/#NLAYER/$NLAYER/g ; s/#NWINC/$NWINC/g; s/#NHINC/$NHINC/g; s/#NSAMPLES/$NSAMPLES/g; s/#FMAX/$FMAX/g" $NAME_FH/stp_ac.spice_model_spec_TEMPLATE > $NAME_FH/stp_ac.spice_model_spec
  generate_spice_cable_bundle_model run $NAME_FH

  RETURN_CODE=$?        
  if [[ $RETURN_CODE != 0 ]] ; then  
    echo "***** generate_spice_cable_bundle_model FAILED: $NAME_FH *****"
    exit 1   
  fi

# REMOVE ANY EXISTING RESULT AND COPY THE NEW RESULTS

  echo "COPY RESULTS to $RESULT_NAME_FH/${NAME_FH}_${NLAYER}_${NWINC}_${NHINC}_${NSAMPLES}_${FMAX}"
  
  rm -rf $RESULT_NAME_FH/${NAME_FH}_${NLAYER}_${NWINC}_${NHINC}_${NSAMPLES}_${FMAX}
  cp -r ${NAME_FH} $RESULT_NAME_FH/${NAME_FH}_${NLAYER}_${NWINC}_${NHINC}_${NSAMPLES}_${FMAX}

done < parameter_list.dat