4){ $hr = '00'; } if($gmt_hr>10){ $hr = '06'; } if($gmt_hr>16){ $hr = '12'; } if($gmt_hr>22){ $hr = '18'; } //------ use command line hr if it's there ------------------------------------- if(isset($_GET['hr'])){ $hr = $_GET['hr']; } //$hr='00'; //------ build the batch file -------------------------------------------------- $bfs = "C:\n"; $bfs .= ""; $bfs .= "opengrads -l -b -c 'run gfs_wind $dtg" . "$hr 1000' -x\n"; $bfs .= "opengrads -l -b -c 'run gfs_wind $dtg" . "$hr 950' -x\n"; $bfs .= "opengrads -l -b -c 'run gfs_wind $dtg" . "$hr 900' -x\n"; $bfs .= "opengrads -l -b -c 'run gfs_wind $dtg" . "$hr 850' -x\n"; $bfs .= "opengrads -l -b -c 'run gfs_pbl $dtg" . "$hr' -x\n"; $bfs .= "opengrads -l -b -c 'run gfs_stream $dtg" . "$hr' -x\n"; $bfs .= "opengrads -l -b -c 'run nam_wind $dtg" . "$hr 1000' -x\n"; $bfs .= "opengrads -l -b -c 'run nam_wind $dtg" . "$hr 950' -x\n"; $bfs .= "opengrads -l -b -c 'run nam_wind $dtg" . "$hr 900' -x\n"; $bfs .= "opengrads -l -b -c 'run nam_wind $dtg" . "$hr 850' -x\n"; $bfs .= "opengrads -l -b -c 'run nam_pbl $dtg" . "$hr' -x\n"; $bfs .= "opengrads -l -b -c 'run nam_stream $dtg" . "$hr' -x\n"; $bfs .= "exit\n"; //note: command line switches: // -l = Run grads in landscape mode. The Portrait vs. Landscape question is not asked. // -b = Run grads in batch mode. No graphics output window is opened. // -c = Execute the supplied string as the first GrADS command to execute after GrADS is started. // -x = causes GrADS to automatically quit after the supplied command has been executed. //------ write the batch file to disk ------------------------------------------ $fh = fopen("make_grads_graphics_2.bat", 'w'); fwrite($fh, $bfs); fclose($fh); ?>