$inittime ) { $inittime = $finit; } } } closedir($dc); // Based on the latest file available, get year/month/day/cycle and set a GMT time $yr = substr($inittime,0,4); $mn = substr($inittime,4,2); $dy = substr($inittime,6,2); $z = substr($inittime,8,2); $gmt = gmmktime($z,0,0,$mn,$dy,$yr); // Initialize arrays...there are 2 or 3 forecast times, (24,48,72). if ($fpd == 24) { $fhrarray = array ('024','048','072'); } else { $fhrarray = array ('048','072'); } $init_vtimes = array (); $end_vtimes = array (); $init_vtimes_full = array (); $end_vtimes_full = array (); $file_fullddates = array (); $init_vtimes_short = array (); $end_vtimes_short = array (); $end_vtimes_line1 = array (); $end_vtimes_line2 = array (); /* Based on initialization time and cycle, set the valid periods of the forecasts, and write them out in various formatted forms for the web page */ foreach ( $fhrarray as $fhr ) { $init_addhr = $fhr - $fpd; $init_vtime = strtotime("+$init_addhr hours", $gmt); $end_vtime = strtotime("+$fhr hours", $gmt); $init_vtimes[] = date("H\Z D m/d/Y", $init_vtime); $init_vtimes_short[] = date("H\Z m/d/Y", $init_vtime); $init_vtimes_full[] = date("H\Z F j, Y", $init_vtime); $end_vtimes_line1[] = date("H\Z l", $end_vtime); $end_vtimes_line2[] = date("F d, Y", $end_vtime); $end_vtimes[] = date("H\Z l F d, Y", $end_vtime); $end_vtimes_short[] = date("H\Z m/d/Y", $end_vtime); $end_vtimes_full[] = date("H\Z F j, Y", $end_vtime); $file_fullddates[] = "${inittime}"; } // Set additional arrays to contain the thresholds and some formats for output. if ($ptype == "snow") { $titletext = "Snowfall"; $tabletitle = "Snow"; $looptext = $ptype; if ($fpd == 24) { $tholdarray = array ('ge01','ge02','ge04','ge06','ge08','ge12','ge18'); $selarray = array ('01', '02','04','06','08','12','18'); $txtamtarray= array ('1', '2','4','6','8','12','18'); $txtamtarray_long = array ('1 inch', '2 inches', '4 inches', '6 inches', '8 inches', '12 inches', '18 inches'); } else { $tholdarray = array ('ge02','ge04','ge08','ge12','ge18','ge24','ge30'); $selarray = array ('02','04','08','12','18','24','30'); $txtamtarray= array ('2','4','8','12','18','24','30'); $txtamtarray_long = array ('2 inches', '4 inches', '8 inches', '12 inches', '18 inches', '24 inches', '30 inches'); } } else { $titletext = "Freezing Rain"; $tabletitle = "Freezing Rain"; $looptext = "freezing rain"; if ($fpd == 24) { $tholdarray = array ('ge01','ge10','ge25','ge50'); $selarray = array ('01','10','25','50'); $txtamtarray= array ('.01', '.10','.25','.50'); $txtamtarray_long = array ('.01 inch', '.10 inch', '.25 inch', '.50 inch'); } else { $tholdarray = array ('ge10','ge25','ge50','ge100'); $selarray = array ('10','25','50','100'); $txtamtarray= array ('.10','.25','.50','1.00'); $txtamtarray_long = array ('.10 inch', '.25 inch', '.50 inch', '1.00 inch'); } } ?> HPC <?php print $fpd;?>-Hour Probabilistic <?php print $titletext;?> Guidance for Days 1-3 EOF; ?>
 
HPC Probabilistic Winter Precipitation Guidance

 
 
For additional details, please read the official Product Description Document (PDD) for this guidance
(Note: The PDD is a pdf file and requires Adobe Acrobat Reader to view)
 
EOF; } else { print << EOF; } ?> EOF; } else { print << EOF; } ?> EOF; } else { print << EOF; } ?> EOF; } else { print << EOF; } ?>
24-Hour Forecasts   48-Hour Forecasts
 24-Hour Snowfall 
Probability Forecasts
 24-Hour Snowfall 
Probability Forecasts
 24-Hour Freezing Rain 
Probability Forecasts
 24-Hour Freezing Rain 
Probability Forecasts
 48-Hour Snowfall 
Probability Forecasts
 48-Hour Snowfall 
Probability Forecasts
 48-Hour Freezing Rain 
Probability Forecasts
 48-Hour Freezing Rain 
Probability Forecasts
99 ) { $fmt_pwpfthold = $pwpf_thold/100; $leftovr = $pwpf_thold % 100; if ( $leftovr != 0 ) { $tholdfile_fmt = "ge${fmt_pwpfthold}"; } else { $tholdfile_fmt = "ge${fmt_pwpfthold}.0"; } } } print <<
EOF; /* PRINT Day 1, Day 2, Day 3 ACROSS THE TOP, ABOVE THE VALID DATES */ if ($fpd == 24) { print <<  EOF; } else { print <<  EOF; } print << EOF; /* Inside of each threshold, we loop through and write the forecast valid periods. The print statements below will show the forecast valid periods in each column. */ $i = 1; while ( $i <= count($fhrarray)) { $ptr = $i-1; if ($i == 1 || $i == 2) { $tdclass = "taboff_first"; } else { $tdclass = "taboff"; } print << $end_vtimes_line1[$ptr]
$end_vtimes_line2[$ptr]
EOF; $i ++; } print <<
$fpd-Hour Probability of $tabletitle Accumulating ≥ $txtamtarray[$thold_counter]"
Day 1 Day 2 Day 3 Day 1-2 Day 2-3
Valid for the $fpd-hour
period ending:
EOF; /* Below is the print statements for the showing of the main image on the page */ $i = 1; while ($i <= count($fhrarray)) { if ($i == 1 && $thold_counter == 0) { $display = "block"; } else { $display = "none"; } $ptr = $i-1; print <<
$fpd-hour forecast valid $init_vtimes_full[$ptr] through $end_vtimes_full[$ptr]
${fpd}-Hour Probability of $tabletitle valid $end_vtimes_full[$ptr]
EOF; $i ++; } print <<
EOF; $thold_counter ++; } /* THE SECTION BELOW ARE THE DIVS FOR THE CYCLING THROUGH THE THRESHOLDS FOR A GIVEN FORECAST HOUR */ /* ----------------------------------------------------------------------------------------------- */ /* Here begins a large loop of print statements. We are looping through the forecast days here and writing a table. The first column contains the valid period and set of thresholds , the second contains the viewing options section */ $fhr_counter = 0; while ($fhr_counter < count($fhrarray)) { $id = ($fhr_counter*24) + $fpd; if ($id < 100) { $id = "0$id"; } $divid = "fpd$id"; print <<
Viewing Options
Choose an accumulation for the specified time:







EOF; } else { print <<






EOF; } } else { if ($fpd == 24) { print <<



EOF; } else { print <<



EOF; } } ?>
OR
Choose a period for the specified amount:

$init_vtimes_short[$fhr_counter] -
$end_vtimes_short[$fhr_counter]
EOF; $fhr_counter ++; } ?>
 
EOF; if ($fpd == 24) { print << Day 1-3 loop displaying the ${fpd}-hour probabilities of $looptext accumulating ≥ $txtamtarray[$thold_counter]" EOF; } print "
"; $thold_counter ++; } ?> EOF; $fhr_counter ++; } ?>