#! /usr/bin/perl use lib "/home1/web/root/lib"; use XMLlib; use XML::Parser; sub xml_gen; @dirs = split "/", $ENV{PWD}; $model = $dirs[$#dirs-1]; $hour = $dirs[$#dirs]; $label{"eta"} = "Eta"; $label{"ngm"} = "NGM"; $label{"avn"} = "Avn"; $label{"mrf"} = "MRF"; $dir{"eta"} = "eta"; $dir{"ngm"} = "ngm"; $dir{"avn"} = "aviation"; $dir{"mrf"} = "mrf"; $label{"init"} = "Initial"; $label{"6h"} = "6hr"; $label{"12h"} = "12hr"; $label{"18h"} = "18hr"; $label{"24h"} = "24hr"; $label{"30h"} = "30hr"; $label{"36h"} = "36hr"; $label{"42h"} = "42hr"; $label{"48h"} = "48hr"; $label{"54h"} = "54hr"; $label{"60h"} = "60hr"; $label{"pres"} = "SL Pres/Prec"; $label{"sfc"} = "Surface"; $label{"1000"} = "1000 mb"; $label{"850"} = "850 mb"; $label{"700"} = "700 mb"; $label{"500"} = "500 mb"; $label{"300"} = "300 mb"; $label{"rh"} = "Rel Hum/Lift"; $label{"4panel"} = "4 Panel"; $label{"norm"} = "Norm"; $label{"inv"} = "Inv"; $file{"norm"} = ""; $file{"inv"} = "_inv"; $desc{"pres"} = "The sea level pressure and precipitation forecast chart includes three parameters: sea level pressure (cyan lines), 1000-500 mb thickness (brown dotted lines, 5100, 5400, 5700 solid lines) and quantitative precipitation (color contours)."; $desc{"sfc"} = "The surface chart shows near surface weather conditions and is intended to aid in severe weather location. The parameters plotted are 2 meter above ground temperature in Celsius (in color contours, see color bar), convergence (black lines, interval=4, shaded > 0), 2 meter above ground dewpoints in Celsius (colored lines, interval=5, bold orange=20, bold white=15, bold red=0, bold magenta=-15, bold gray=-30) and winds plotted as white vectors."; $desc{"1000"} = "The 1000 mb chart also shows near surface weather conditions. The parameters plotted are 1000 mb temperature in Celsius (in color contours), convergence (black lines, interval=2, shaded > 0), 1000 mb dewpoints in Celsius (colored lines, interval=5, bold orange=20, bold white=15, bold red=0, bold magenta=-15, bold gray=-30) and winds plotted as vectors."; $desc{"850"} = "The 850 mb chart shows weather conditions at the 850 mb level or around 5000 feet above sea level. The parameters plotted are temperatures in Celsius (in color contours), heights in white lines and winds plotted as vectors."; $desc{"700"} = "The 700 mb chart shows the forecasted vertical velocities (colors), heights (bold white lines), temperature in Celsius (thin red lines) and wind vectors."; $desc{"500"} = "The 500 mb chart shows the absolute vorticity (in color contours), the height field (bold white lines),temperature in Celsius (thin red lines) and wind vectors."; $desc{"300"} = "The 300 mb chart shows the winds at the 300 mb level. The wind speeds are shown as color contours, the heights (bold white lines), temperatures in Celsius (thin red lines) and the vectors show wind direction and speed."; $desc{"rh"} = "The Relative Humidity/Lifted Index chart depicts two fields: integrated relative humdity from 850 to 500 mb (in color contours) and lifted index (in white line contours). Negative index values are shaded black."; my $p = new XML::Parser(ErrorContext => 2, Handlers => {Start => \&starthandler, End => \&endhandler, Char => \&charhandler, Comment => \&commenthandler } ); foreach $pplot ( "pres", "sfc", "1000", "850", "700", "500", "300", "rh" ){ xml_gen $pplot, "4panel", "norm", "1000x735"; xml_gen $pplot, "4panel", "inv", "1000x735"; } sub xml_gen { my( $plot, $hour, $type, $size ) = @_; $filename = "${model}_${plot}_${hour}$file{$type}.html"; $gifname = "${model}_${plot}_${hour}$file{$type}.gif"; `touch $gifname`; $title = "$label{$hour} Eta $label{$plot} Plot"; xml_init; xml_print ""; xml_print ""; xml_print ""; xml_print "$title"; xml_print ""; xml_print ""; foreach $pmodel ( "ngm", "eta", "avn", "mrf" ){ $link = "../../$dir{$pmodel}/4panel/${pmodel}_${plot}_4panel.html" if $pmodel eq "ngm" || $pmodel eq "eta"; $link = "../../$dir{$pmodel}/6panel/${pmodel}_${plot}_6panel.html" if $pmodel eq "avn"; $link = "../../$dir{$pmodel}/9panel/${pmodel}_${plot}_9panel.html" if $pmodel eq "mrf"; xml_print ""; } xml_print ""; # # Inverse Plot xml_print ""; $link = "${model}_${plot}_${hour}.html"; xml_print ""; $link = "${model}_${plot}_${hour}_inv.html"; xml_print ""; xml_print ""; xml_print ""; # # TIME Menu # xml_print ""; xml_print ""; # # Hourly Plots foreach $phour ( "init", "6h", "12h", "18h", "24h", "30h", "36h", "42h", "48h", "54h", "60h" ){ $link = "../$phour/${model}_${plot}_${phour}$file{$type}.html"; $text = $label{$phour}; xml_print ""; } # # 4 Panel Plot $link = "${model}_${plot}_4panel$file{$type}.html"; xml_print ""; # # Loop $link = "../loop/${model}_${plot}_loop.html"; xml_print ""; xml_print ""; xml_print ""; xml_print ""; xml_print ""; # # Plot types foreach $pplot ( "pres", "sfc", "1000", "850", "700", "500", "300", "rh", "4panel" ){ $link = "${model}_${pplot}_${hour}$file{$type}.html"; $text = $label{$pplot}; xml_print ""; } xml_print ""; xml_print ""; xml_print ""; xml_print ""; xml_print ""; xml_print ""; xml_print "$desc{$plot}"; xml_print ""; xml_print ""; xml_print ""; xml_print ""; xml_print ""; xml_print ""; $p->parse( xml_string ); }