<?php
system("/mm5/shells/checker.bash graph.bash",$retval);
if($retval != 0)
die('');
function assist($gpath,$userid){
$fp=fopen("$gpath/time.opt","r");
$line=fgets($fp,1024);
fclose($fp);
$ary=split(",",$line);
$start=split("[/.-]",$ary[0]);
// $end=split("[/.-]",$ary[2]);
$fp=fopen("$gpath/$userid/assist.tmp","w+");
$rec="TIME LEVELS: FROM ".$start[2]."-".$start[1]."-".$start[0]."_".$ary[1].":00 "." TO ".($start[2]+1)."-".$start[1]."-".$start[0]."_".$ary[1].":00 "." BY $ary[8]\nPRESSURE LEVEL MANDATORY: FROM SFC TO PTOP\nPRESSURE LEVEL NON STANDARD: FROM SFC TO PTOP BY 3\nSIGMA LEVEL: FROM 3 TO KMAX BY 5\nTITLE: STORM OF THE CENTURY - MM5V3\n-------------------------------------------\nPLOT | FIELD | UNITS | CONTOUR | SMOOTH ||\nT/F | | | INTERVAL | PASSES ||\n-----|-------|-------|----------|--------||\n\n";
fwrite($fp,$rec);
$fc=fopen("$gpath/$userid/outconf.opt","r");
while(!feof($fc)){
$line=fgets($fc,1024);
fwrite($fp,$line);
}
fclose($fc);
fclose($fp);
}
$gpath="/mm5/backup/".$gpath;
assist($gpath,$userid);
$fp=fopen("$gpath/time.opt","r");
$line=fgets($fp,1024);
fclose($fp);
$tik=split(",",$line);
$div=floor($tik[4]/$tik[8])+1;
$start=split("[/.-]",$tik[0]);
print $head;
print "<h1 align=\"center\">Graph is running</h1>";
print "<h4 align=\"center\">please wait...</h4>";
system("/loc/mm5/shells/graph.bash $div $tik[8] $start[2] $start[1] $start[0] $gpath $userid $grunname");
//print("/loc/mm5/shells/graph.bash $div $tik[8] $start[2] $start[1] $start[0] $gpath $userid");
?>