#! /bin/bash # run all cligen stations listed in the cligen database index file. # get list of all [state number] [station number] pairs state=( `dm x1 < ./db/cligen/US_cligen_stations_WEPS.idx` ) station=( `dm x2 < ./db/cligen/US_cligen_stations_WEPS.idx` ) stcnt=`dm x1 < ./db/cligen/US_cligen_stations_WEPS.idx | stats n` # get list of all index line numbers that failed # linefail=( `cat runallcli.fail` ) # to run just this list, enable this section # linex ${linefail[@]} < ./db/cligen/US_cligen_stations_WEPS.idx # exit # set initial seconds to give small numbers basesec=`date +%s` # for cnt in ${linefail[@]} # loop through all running cligen and recording which station is running in seperate file # echo "" > runallcli.log for cnt in $(seq ${1} ${stcnt}) do if [[ cnt -ge ${1} ]] then let num=cnt-1 startsec=`date +%s` let start=startsec-basesec echo "Line ${cnt} Time ${start} -S${state[num]} -s${station[num]}" >> runallcli.log arch/windows/bin/cligen.exe -S${state[num]} -s${station[num]} -idb/cligen/US_cligen_stations.par -t5 -F -b01 -y100 -I3 -o"temp.cli" fi done # generate final line so last run has a time included startsec=`date +%s` let start=startsec-basesec let cnt=cnt+1 echo "Line ${cnt} Time ${start} -S0 -s0" >> runallcli.log rm temp.cli # create histgram of cligen run times dm x4 x4 < runallcli.log | dm y2 x1 | dm x2-x1 | desc -h -m -0.5 -i 1 > runallcli.hist # create list of long runtime stations dm x2-1 x4 x4 < runallcli.log | dm x1 y3 x2 | dm x1 x3-x2 | dm "if x2>15 then INPUT else SKIP" > runallcli.long # get list of lines that have long runtimes linelong=( `colex 1 < runallcli.long` ) # extract lines from index file and strip to state and station number and names linex ${linelong[@]} < ./db/cligen/US_cligen_stations_WEPS.idx | cut -c 1-10,46- > runallcli.tmp # append state and station number and names to each long runtime entry abut runallcli.long runallcli.tmp > runallcli.lsta # sort long runtime station list sort -k 2 < runallcli.lsta > runallcli.slsta rm runallcli.long rm runallcli.tmp rm runallcli.lsta