0)
$ANG = 180;
elseif ( ($ustm < 0) && ($vstm < 0))
$ANG = 0;
elseif ( ($ustm > 0) && ($vstm < 0))
$ANG = 360;
if($vstm == 0)
$vstm = .00000001;
$storm_direction = (180 / pi()) * atan($ustm / $vstm) + $ANG;
return $storm_direction;
}
function output_wind_data($FINAL_direction, $FINAL_speed)
{
if($FINAL_direction >= 349 and $FINAL_direction <= 360){
$provided_wind_data = " " . round($FINAL_speed,0) . ' | ';
}
elseif ($FINAL_direction >= 0 and $FINAL_direction <= 11){
$provided_wind_data = " " . round($FINAL_speed,0) . ' | ';
}
elseif ($FINAL_direction > 11 and $FINAL_direction <= 34){
$provided_wind_data = " " . round($FINAL_speed,0) . ' | ';
}
elseif ($FINAL_direction > 34 and $FINAL_direction <= 56){
$provided_wind_data = " " . round($FINAL_speed,0) . ' | ';
}
elseif ($FINAL_direction > 56 and $FINAL_direction <= 78){
$provided_wind_data = " " . round($FINAL_speed,0) . ' | ';
}
elseif ($FINAL_direction > 78 and $FINAL_direction <= 101){
$provided_wind_data = " " . round($FINAL_speed,0) . ' | ';
}
elseif ($FINAL_direction > 101 and $FINAL_direction <= 124){
$provided_wind_data = " " . round($FINAL_speed,0) . ' | ';
}
elseif ($FINAL_direction > 124 and $FINAL_direction <= 146){
$provided_wind_data = " " . round($FINAL_speed,0) . ' | ';
}
elseif ($FINAL_direction > 146 and $FINAL_direction <= 169){
$provided_wind_data = " " . round($FINAL_speed,0) . ' | ';
}
elseif ($FINAL_direction > 169 and $FINAL_direction <= 191){
$provided_wind_data = " " . round($FINAL_speed,0) . ' | ';
}
elseif ($FINAL_direction > 191 and $FINAL_direction <= 214){
$provided_wind_data = " " . round($FINAL_speed,0) . ' | ';
}
elseif ($FINAL_direction > 214 and $FINAL_direction <= 236){
$provided_wind_data = " " . round($FINAL_speed,0) . ' | ';
}
elseif ($FINAL_direction > 236 and $FINAL_direction <= 259){
$provided_wind_data = " " . round($FINAL_speed,0) . ' | ';
}
elseif ($FINAL_direction > 259 and $FINAL_direction <= 281){
$provided_wind_data = " " . round($FINAL_speed,0) . ' | ';
}
elseif ($FINAL_direction > 281 and $FINAL_direction <= 304){
$provided_wind_data = " " . round($FINAL_speed,0) . ' | ';
}
elseif ($FINAL_direction > 304 and $FINAL_direction <= 326){
$provided_wind_data = " " . round($FINAL_speed,0) . ' | ';
}
elseif ($FINAL_direction > 326 and $FINAL_direction <= 349){
$provided_wind_data = " " . round($FINAL_speed,0) . ' | ';
}
else
$provided_wind_data = "" . round($FINAL_direction,0) . ' | ';
return $provided_wind_data;
}
//$num_entries = 85;
$report_date = '';
$model_date = '';
$got_time = 0;
$ruc_counter = 0;
$i = 0;
$j = 0;
$k = 0;
$in_dst="false";
//if( (date("m")>=4) && (date("m")<=10) ) // IS CURRENT DATE INSIDE OF APRIL->OCT WINDOW?
//{
if( (date("m")>3) && (date("m")<11) ) //IS CURRENT DATE INSIDE MARCH->NOV WINDOW?
{
$in_dst="true";
}
elseif(date("m")=="3") //IS IT MARCH?
{
if( (date("j")>7) && (date("D")=="Sun") ) //IS IT THE SECOND SUN OF THE MONTH?
{
if(date("H")>"1") //IS IT PAST 2:00AM?
{
$in_dst="true";
}
}
}
elseif(date("m")=="11") //IS IT NOV?
{
if( (date("j")<=7) && (date("D")=="Sun") ) //IS IT THE FIRST SUN OF THE MONTH?
{
if(date("H")>"1") //IS IT PAST 2:00AM?
{
$in_dst="false";
}
}
}
//}
$time_offset = 0;
//echo $in_dst;
if($in_dst =="true") //INSIDE OF DST
$time_offset = 400;
else
$time_offset = 500;
if ( ! isset($_REQUEST['rapstation']) )
$_REQUEST['rapstation']="KABR";
if ( ! isset($_REQUEST['modelname']) )
$_REQUEST['modelname']="NAM";
$rapstation = $_REQUEST['rapstation'];
$modelname = $_REQUEST['modelname'];
if ($rapstation == "KMBG")
$rapstation = "KY26";
if ($modelname == "")
$modelname = "NAM";
if ($modelname == "HRRR") {
if ($rapstation == "KSAW"){
$rapstation1 = "727435";
}
elseif ($rapstation == "KLNL"){
$rapstation1 = "000396";
}
elseif ($rapstation == "MQTM"){
$rapstation1 = "000397";
}
elseif ($rapstation == "GRMM"){
$rapstation1 = "000398";
}
elseif ($rapstation == "KTNM"){
$rapstation1 = "000399";
}
else {
$rapstation1 = $rapstation;
}
}
else {
$rapstation1 = $rapstation;
}
//Set Length of data
if ($modelname == "NAM") {
$num_entries = 85;
$modelname1 = $modelname;
}
elseif ($modelname == "NAMNEST") {
$num_entries = 61;
$modelname1 = $modelname;
}
elseif ($modelname == "HRRR") {
$num_entries = 19;
$modelname1 = $modelname;
}
elseif ($modelname == "RAP") {
$num_entries = 22;
$modelname1 = $modelname;
}
elseif ($modelname == "GFS") {
$num_entries = 141;
$modelname1 = "GFS3";
}
$REPORT_TIME = array_fill(0,$num_entries,0);
$REPORT_TIME_RAW = array_fill(0,$num_entries,0);
$REPORT_DAY = array(0,0,0,0,0,0,0,0,0,0,0,0);
$SHO = array(0,0,0,0,0,0,0,0,0,0,0,0);
$LI = array(0,0,0,0,0,0,0,0,0,0,0,0);
$SWEAT = array(0,0,0,0,0,0,0,0,0,0,0,0);
$KIndex = array(0,0,0,0,0,0,0,0,0,0,0,0);
$LCL = array(0,0,0,0,0,0,0,0,0,0,0,0);
$LCLP = array(0,0,0,0,0,0,0,0,0,0,0,0);
$LCLT = array(0,0,0,0,0,0,0,0,0,0,0,0);
$PWAT = array(0,0,0,0,0,0,0,0,0,0,0,0);
$TTI = array(0,0,0,0,0,0,0,0,0,0,0,0);
$CAPE = array(0,0,0,0,0,0,0,0,0,0,0,0);
$NCAPE = array_fill(0,$num_entries,0);
$CINS= array(0,0,0,0,0,0,0,0,0,0,0,0);
$LID= array(0,0,0,0,0,0,0,0,0,0,0,0);
$EL= array(0,0,0,0,0,0,0,0,0,0,0,0);
$LFCT= array(0,0,0,0,0,0,0,0,0,0,0,0);
$BRCH = array(0,0,0,0,0,0,0,0,0,0,0,0);
$BRCHSHEAR = array(0,0,0,0,0,0,0,0,0,0,0,0);
$SRH = array(0,0,0,0,0,0,0,0,0,0,0,0);
$HLCY1K = array(0,0,0,0,0,0,0,0,0,0,0,0);
$STMOTION = array(0,0,0,0,0,0,0,0,0,0,0,0);
$EHI = array(0,0,0,0,0,0,0,0,0,0,0,0);
$SHEAR1KM = array(0,0,0,0,0,0,0,0,0,0,0,0);
$SHEAR3KM = array(0,0,0,0,0,0,0,0,0,0,0,0);
$SHEAR6KM = array(0,0,0,0,0,0,0,0,0,0,0,0);
$UVV = array(0,0,0,0,0,0,0,0,0,0,0,0);
$HAIL = array(0,0,0,0,0,0,0,0,0,0,0,0);
$WBZ = array(0,0,0,0,0,0,0,0,0,0,0,0);
$HEIGHT_0C = array(0,0,0,0,0,0,0,0,0,0,0,0);
$HEIGHT_20C = array(0,0,0,0,0,0,0,0,0,0,0,0);
$CravenSig = array(0,0,0,0,0,0,0,0,0,0,0,0);
$SCP = array(0,0,0,0,0,0,0,0,0,0,0,0);
$STP = array(0,0,0,0,0,0,0,0,0,0,0,0);
$EBWD = array(0,0,0,0,0,0,0,0,0,0,0,0);
$PCPN_TOT = array_fill(0,$num_entries,0);
$PCPN_HR = array_fill(0,$num_entries,0);
$a_surf_u = array(0,0,0,0,0,0,0,0,0,0,0,0);
$a_surf_v = array(0,0,0,0,0,0,0,0,0,0,0,0);
$a_1000_u = array(0,0,0,0,0,0,0,0,0,0,0,0);
$a_1000_v = array(0,0,0,0,0,0,0,0,0,0,0,0);
$uMean = array(0,0,0,0,0,0,0,0,0,0,0,0);
$uDelta = array(0,0,0,0,0,0,0,0,0,0,0,0);
$vMean = array(0,0,0,0,0,0,0,0,0,0,0,0);
$vDelta = array(0,0,0,0,0,0,0,0,0,0,0,0);
$SURF_T = array_fill(0,$num_entries,0);
$SURF_TC = array_fill(0,$num_entries,0);
$SURF_TD = array_fill(0,$num_entries,0);
$SURF_TA = array(0,0,0,0,0,0,0,0,0,0,0,0);
$SURF_WSPD = array(0,0,0,0,0,0,0,0,0,0,0,0);
$SURF_WDIR = array(0,0,0,0,0,0,0,0,0,0,0,0);
$SURF_RH = array_fill(0,$num_entries,0);
$MSLP_MB = array_fill(0,$num_entries,0);
$PCPN_HR = array_fill(0,$num_entries,0);
$PCPN_TOT = array_fill(0,$num_entries,0);
$MOMT_U = array();
$MOMT_V = array();
$MB850_HEIGHT = array_fill(0,$num_entries,0);
$MB700_HEIGHT = array_fill(0,$num_entries,0);
$MB850_TEMP = array_fill(0,$num_entries,0);
$MB925_HEIGHT = array_fill(0,$num_entries,0);
$MB925_TEMP = array_fill(0,$num_entries,0);
$MB850_DEWTEMP = array_fill(0,$num_entries,0);
$MB700_TEMP = array_fill(0,$num_entries,0);
$MB850_MB700_THICK = array_fill(0,$num_entries,0);
$SFC_MB925_LR = array_fill(0,$num_entries,0);
$SFC_MB850_LR = array_fill(0,$num_entries,0);
$SFC_3KM_LR = array_fill(0,$num_entries,0);
$SHERBS3 = array_fill(0,$num_entries,0);
// convert to upper case
// PSU Site - Stopped working on 10/22/16 - Possibly blocked server
$url = 'ftp://ftp.meteo.psu.edu/pub/bufkit/' . $modelname . '/latest/' . strtolower($modelname1) . '_' . strtolower($rapstation1) . '.buf';
// Bufkit Warehouse
//$url = 'http://www.meteor.iastate.edu/~ckarsten/bufkit/data/' . strtolower($modelname) . '/' . strtolower($modelname1) . '_' . strtolower($rapstation1) . '.buf';
$html = file_get_contents_curl($url);
if(empty($html)){
//PSU Site
$url = 'ftp://ftp.meteo.psu.edu/pub/bufkit/' . $modelname . '/latest/' . strtolower($modelname1) . '_' . strtolower(substr($rapstation1,1,3)) . '.buf';
//Bufkit Warehouse
//$url = 'http://www.meteor.iastate.edu/~ckarsten/bufkit/data/' . strtolower($modelname) . '/' . strtolower($modelname1) . '_' . strtolower(substr($rapstation1,1,3)) . '.buf';
$html = file_get_contents_curl($url);
}
// start the parsing
$lines = explode("\r\n", $html);
while ($i < count($lines)):
// time
if (preg_match("/TIME =/i", $lines[$i])) {
$ruc_counter = $ruc_counter +1;
// found time line - now process rest of info
$pos = strpos($lines[$i],'/');
if ($pos > 0 ){
$REPORT_TIME[$ruc_counter-1] = substr($lines[$i],$pos+1,4);
if($REPORT_TIME[$ruc_counter-1] > 0)
$REPORT_TIME[$ruc_counter-1] = $REPORT_TIME[$ruc_counter-1] / 100;
if($REPORT_TIME[$ruc_counter-1] == 0)
$REPORT_TIME[$ruc_counter-1] = 0;
$REPORT_TIME_RAW[$ruc_counter-1] = $REPORT_TIME[$ruc_counter-1];
$REPORT_TIME[$ruc_counter-1] = $REPORT_TIME[$ruc_counter-1] . " Z";
$REPORT_DAY[$ruc_counter-1] = substr($lines[$i],$pos-4,2) . '/' . substr($lines[$i],$pos-2,2);
$REPORT_MONTH[$ruc_counter-1] = substr($lines[$i],$pos-4,2);
$REPORT_YEAR[$ruc_counter-1] = '20' . substr($lines[$i],$pos-6,2);
$REPORT_DAY_MONTH[$ruc_counter-1] = substr($lines[$i],$pos-2,2);
$MODEL_RUN_HOUR[$ruc_counter-1] = substr($lines[$i],$pos+1,2);
$day_week = '20' . substr($lines[$i],$pos-6,2) . '-' . substr($lines[$i],$pos-4,2) . '-' . substr($lines[$i],$pos-2,2);
$REPORT_DAY_WEEK[$ruc_counter-1] = strftime("%a",strtotime($day_week));
if($got_time == 0){
$got_time = 1;
$report_date = substr($lines[$i],$pos-4,2) . '/' . substr($lines[$i],$pos-2,2) . '/20' . substr($lines[$i],$pos-6,2);
}
}
// Grab Station Elevation
$result = explode(" ",$lines[$i+1]);
$STNELEV = $result[8];
//echo $STNELEV;
$STNELEV_FT = $STNELEV * 3.28084;
//echo $STNELEV_FT;
// Grab Lat and Lon for Site
$result = explode(" ",$lines[$i+1]);
$STNLAT = $result[2];
$STNLON = $result[5];
// Showalter, Lifted Index, SWEAT,K Index
$i = $i + 4;
$result = explode(" ",$lines[$i]);
$SHO[$ruc_counter-1] = round($result[2],2);
$LI[$ruc_counter-1] = round($result[5],2);
$SWEAT[$ruc_counter-1] = round($result[8],2);
$KIndex[$ruc_counter-1] = round($result[11],2);
// Pressure @ LCL, PWAT (precipitable H2O), Totals Total Index,CAPE
$i = $i + 1;
$result = explode(" ",$lines[$i]);
$LCLP[$ruc_counter-1] = round($result[2],1);
$PWAT[$ruc_counter-1] = round($result[5] *.04,2);
$TTI[$ruc_counter-1] = round($result[8],2);
$CAPE[$ruc_counter-1] = $result[11];
if($result[11] <= 0 ){
$UVV[$ruc_counter-1] = '---';
$HAIL[$ruc_counter-1] = '---';
}
else {
$UVV[$ruc_counter-1] = round((sqrt($result[11] * 2)/2)/.5148);
$HAIL[$ruc_counter-1] = 2*((3*0.55*1.0033*($UVV[$ruc_counter-1] *$UVV[$ruc_counter-1] ))/(8*9.8*900))*100;
$HAIL[$ruc_counter-1] = round($HAIL[$ruc_counter-1],2);
}
// Temp @ LCL , CINS, EL,LFCT
$i = $i + 1;
$result = explode(" ",$lines[$i]);
$LCLT[$ruc_counter-1] = round($result[2] - 273.16,2);
$CINS[$ruc_counter-1] = $result[5];
$EL[$ruc_counter-1] = $result[8];
if($EL[$ruc_counter-1] < 0 )
$EL[$ruc_counter-1] = '---';
else{
$EL[$ruc_counter-1] = 15760.7 + (-25.7563*$EL[$ruc_counter-1])+0.0104482*($EL[$ruc_counter-1]*$EL[$ruc_counter-1]);
$EL[$ruc_counter-1] = round($EL[$ruc_counter-1] * 3.28);
}
$LFCT[$ruc_counter-1] = $result[11];
if($LFCT[$ruc_counter-1] < 0)
$LFCT[$ruc_counter-1] = '---';
else{
$LFCT[$ruc_counter-1] = 15760.7 + (-25.7563*$LFCT[$ruc_counter-1])+0.0104482*($LFCT[$ruc_counter-1]*$LFCT[$ruc_counter-1]);
$LFCT[$ruc_counter-1] = round($LFCT[$ruc_counter-1] * 3.28);
}
// NCAPE
if(( ($EL[$ruc_counter-1] /3.28) - ($LFCT[$ruc_counter-1]/3.28)) != 0 )
$NCAPE[$ruc_counter-1] = $CAPE[$ruc_counter-1]/( ($EL[$ruc_counter-1] /3.28) - ($LFCT[$ruc_counter-1]/3.28));
$NCAPE[$ruc_counter-1] = round($NCAPE[$ruc_counter-1],2);
// Bulk Richardson
$i = $i + 1;
$result = explode(" ",$lines[$i]);
$BRCH[$ruc_counter-1] = $result[2];
// Bulk Richardson SHEAR
if(($BRCH[$ruc_counter-1] > 0) and ($CAPE[$ruc_counter-1] > 0))
$BRCHSHEAR[$ruc_counter-1] = round($CAPE[$ruc_counter-1] / $BRCH[$ruc_counter-1],1);
// now grab rest of sounding info for wind stuff
// U-V wind components
// U = -(SPD * 0.5148) * Sin(DIR * (PI / 180))
// V = -(SPD * 0.5148) * Cos(DIR * (PI / 180))
$i = $i + 4;
$got_wbz_height = 0;
$got_wbz = 0;
$got_surface = 0;
$got_upper0_5K = 0;
$got_upper1K = 0;
$got_upper3K = 0;
$got_upper6K = 0;
$MaxTwAloft = -50;
$MaxTAloft = -50;
$got_ebwd_height = 0;
$got_lcl_height = 0;
$surf_u = 0;
$surf_v = 0;
$u_1000 = 0;
$v_1000 = 0;
$lcl_u = 0;
$lcl_v = 0;
$wbz_f = 0;
$pressure_mb = 0;
$height = 0;
$height_AGL = 0;
$old_pressure_mb = 0;
$temp=0;
$surface_pressure_mb = 0;
$old_WBc = 0;
$wb_temperature = 0;
$old_wb_temperature = 0;
$inc = 0;
$Q = 0;
$Qsw = 0;
$Qwmax = 0;
$old_wind_spd = 0;
$old_wind_dir = 0;
$wind_spd = 0;
$wind_dir = 0;
$old_height = 0;
$temp_spd = 0;
$temp_dir = 0;
$temp_temp = 0;
$temp = 0;
$Usr = 0;
$Vsr = 0;
$got_950mb = 0;
$got_925mb = 0;
$got_850mb = 0;
$got_700mb = 0;
$got_500mb = 0;
$got_250mb = 0;
$got_0CHeight = 0;
$got_20CHeight = 0;
$Tc = -9999;
$old_Tc = -9999;
$old_Tdc = -9999;
$mom_transfer = 0;
$got_thickness_height = 0;
$H1000_x = 0;
$H1000_v = 0;
$H1000_cm = 0;
// variables for slope and intercept for line equations
$m =0;
$b = 0;
$Qsw = 0;
$Qwmax = 0;
while((trim($lines[$i]) <> "") && (substr($lines[$i],0,3) <> "STN")){
$result = explode(" ",$lines[$i]);
$temp = $result[0];
if ($pressure_mb == 0){
$pressure_mb = $temp;
$old_pressure_mb = $temp;}
else{
$old_pressure_mb = $pressure_mb;
$pressure_mb = $temp;
}
if(($wind_spd == 0 ) and ($wind_dir == 0 )){
$wind_spd = $result[6];
$wind_dir = $result[5];
$old_wind_spd = $wind_spd;
$old_wind_dir = $wind_dir;
}
else
{
$old_wind_spd = $wind_spd;
$old_wind_dir = $wind_dir;
$wind_spd = $result[6];
$wind_dir = $result[5];
}
if($got_surface == 0){
$got_surface = 1;
$SURF_WSPD[$ruc_counter-1] = round($wind_spd);
$SURF_WDIR[$ruc_counter-1] = round($wind_dir);
$surf_u = get_U_comp($wind_spd,$wind_dir);
$surf_v = get_V_comp($wind_spd,$wind_dir);
$a_surf_u[$ruc_counter-1] = $surf_u;
$a_surf_v[$ruc_counter-1] = $surf_v;
// calculate LCL height in Ft here
$surface_pressure_mb = $pressure_mb;
$LCL[$ruc_counter-1] = round(($result[0] - $LCLP[$ruc_counter-1]) * 30);
}
if ($Tc == -9999) {
$Tc = $result[1];
$old_Tc = $Tc;
$Tdc = $result[3];
$old_Tdc = $Tdc;
}
else
{
$old_Tc = $Tc;
$Tc = $result[1];
$old_Tdc = $Tdc;
$Tdc = $result[3];
}
$Es= 6.11* pow(10,(7.5*$Tc/(237.7+$Tc)));
$E= 6.11* pow(10,(7.5*$Tdc/(237.7+$Tdc)));
$RH = ($E/$Es)*100;
$old_WBc = $WBc;
$WBc = (((0.00066 * $result[0]) * $Tc) + ((4098 * $E) / (pow(($Tdc + 237.7) , 2)) * $Tdc)) / ((0.00066 * $pressure_mb) + (4098 * $E) / (pow(($Tdc + 237.7), 2)));
$M= ((0.622*$E)/($result[0]-$E))*1000;
$Q = ($WBc + 273.15) * pow(( 1000 / $result[0]), 0.286) + (3 * $M);
if($pressure_mb > (500)){ // highest THETA-E in lowest 500 mb of atmosphere
//$Q = ($result[2] + 273.15) * pow(( 1000 / $pressure_mb ), 0.286) + (3 * $MR);
if($Q > $Qsw){
$Qsw= $Q;
//echo "Qsw " . $pressure_mb . " " . $Qsw . "
";
}
}
if($pressure_mb > ($surface_pressure_mb-100)){ // highest THETA-E in lowest 100 mb of atmosphere
//$Q = ($result[2] + 273.15) * pow(( 1000 / $pressure_mb ), 0.286) + (3 * $MR);
if($Q > $Qwmax){
$Qwmax = $Q;
//echo "Qwmax " . $pressure_mb . " " . $Qwmax . "
";
}
}
$wbz_f = $WBc ; // get wet bulb temp
if($wbz_f < 0) {
if($got_wbz == 0){
$got_wbz = 1;
$old_wb_temperature = $wb_temperature;
$wb_temperature = $wbz_f;
}
}
$i = $i + 1;
// get height and height AGL
$result = explode(" ",$lines[$i]);
$old_height = $height;
$old_height_AGL = $height_AGL;
if ($modelname == "GFS") {
$height = $result[0];
$height_AGL = ($result[0] - $STNELEV);
}
else {
$height = $result[1];
$height_AGL = ($result[1] - $STNELEV);
}
//Cal 1000mb Height
//if ($ruc_counter == 1){
// $H1000_x = $Es * $RH;
// $H1000_v = ($Tc + 273.15) / (1 - 0.379 * ($H1000_x / $pressure_mb));
// $H1000_cm = $H1000_v + 0.02774 * (1000 - $pressure_mb);
// $MB1000_HEIGHT[$ruc_counter-1] = (($height * 3.28084) * 0.3048 - (67.422 * log10(1000 / $pressure_mb) * $H1000_cm) / 3.28084);
// echo "1000H " . $MB1000_HEIGHT[$ruc_counter-1] . " ";
//}
//Get Pressure Levels for Mandatory Levels
if ($pressure_mb < 950){
if($got_950mb == 0){
$got_950mb = 1;
// extrapolate wind spd
//$temp_spd = extrap_wind_spd($wind_spd,$old_wind_spd,$pressure_mb,$old_pressure_mb,950);
// extrapolate wind dir
//$temp_dir = extrap_wind_dir($wind_dir,$old_wind_dir,$pressure_mb,$old_pressure_mb,950);
// Store 950mb Winds
//$MB950_DIR[$ruc_counter-1] = $temp_dir;
//$MB950_SPD[$ruc_counter-1] = $temp_spd;
// extrapolate temp
$temp_temp = extrap_wind_spd($Tc,$old_Tc,$pressure_mb,$old_pressure_mb,950);
$MB950_TEMP[$ruc_counter-1] = round($temp_temp,1);
// extrapolate height
$temp_height = extrap_wind_spd($height,$old_height,$pressure_mb,$old_pressure_mb,950);
$MB950_HEIGHT[$ruc_counter-1] = round($temp_height);
} // got 950mb
} // got pressure
if ($pressure_mb < 925){
if($got_925mb == 0){
$got_925mb = 1;
// extrapolate wind spd
$temp_spd = extrap_wind_spd($wind_spd,$old_wind_spd,$pressure_mb,$old_pressure_mb,925);
// extrapolate wind dir
$temp_dir = extrap_wind_dir($wind_dir,$old_wind_dir,$pressure_mb,$old_pressure_mb,925);
// Store 925mb Winds
$MB925_DIR[$ruc_counter-1] = $temp_dir;
$MB925_SPD[$ruc_counter-1] = $temp_spd;
// extrapolate temp
$temp_temp = extrap_wind_spd($Tc,$old_Tc,$pressure_mb,$old_pressure_mb,925);
$MB925_TEMP[$ruc_counter-1] = round($temp_temp,1);
// extrapolate height
$temp_height = extrap_wind_spd($height,$old_height,$pressure_mb,$old_pressure_mb,925);
$MB925_HEIGHT[$ruc_counter-1] = round($temp_height);
} // got 925mb
} // got pressure
if ($pressure_mb < 850){
if($got_850mb == 0){
$got_850mb = 1;
// extrapolate wind spd
$temp_spd = extrap_wind_spd($wind_spd,$old_wind_spd,$pressure_mb,$old_pressure_mb,850);
// extrapolate wind dir
$temp_dir = extrap_wind_dir($wind_dir,$old_wind_dir,$pressure_mb,$old_pressure_mb,850);
// Store 925mb Winds
$MB850_DIR[$ruc_counter-1] = $temp_dir;
$MB850_SPD[$ruc_counter-1] = $temp_spd;
// extrapolate temp
$temp_temp = extrap_wind_spd($Tc,$old_Tc,$pressure_mb,$old_pressure_mb,850);
$MB850_TEMP[$ruc_counter-1] = round($temp_temp,1);
// extrapolate dewpoint temp
$temp_dewtemp = extrap_wind_spd($Tdc,$old_Tdc,$pressure_mb,$old_pressure_mb,850);
$MB850_DEWTEMP[$ruc_counter-1] = round($temp_dewtemp,1);
// extrapolate height
$temp_height = extrap_wind_spd($height,$old_height,$pressure_mb,$old_pressure_mb,850);
$MB850_HEIGHT[$ruc_counter-1] = round($temp_height);
} // got 850mb
} // got pressure
if ($pressure_mb < 700){
if($got_700mb == 0){
$got_700mb = 1;
// extrapolate wind spd
$temp_spd = extrap_wind_spd($wind_spd,$old_wind_spd,$pressure_mb,$old_pressure_mb,700);
// extrapolate wind dir
$temp_dir = extrap_wind_dir($wind_dir,$old_wind_dir,$pressure_mb,$old_pressure_mb,700);
// Store 700mb Winds
$MB700_DIR[$ruc_counter-1] = $temp_dir;
$MB700_SPD[$ruc_counter-1] = $temp_spd;
// extrapolate temp
$temp_temp = extrap_wind_spd($Tc,$old_Tc,$pressure_mb,$old_pressure_mb,700);
$MB700_TEMP[$ruc_counter-1] = round($temp_temp,1);
// extrapolate dewpoint temp
$temp_dewtemp = extrap_wind_spd($Tdc,$old_Tdc,$pressure_mb,$old_pressure_mb,700);
$MB700_DEWTEMP[$ruc_counter-1] = round($temp_dewtemp,1);
// extrapolate height
$temp_height = extrap_wind_spd($height,$old_height,$pressure_mb,$old_pressure_mb,700);
$MB700_HEIGHT[$ruc_counter-1] = round($temp_height);
// Calc 850-700mb Lapse Rate
$MB850_MB700_LR[$ruc_counter-1] = round(($MB850_TEMP[$ruc_counter-1] - $MB700_TEMP[$ruc_counter-1]) / (($MB700_HEIGHT[$ruc_counter-1] - $MB850_HEIGHT[$ruc_counter-1]) / 1000),1);
} // got 700mb
} // got pressure
if ($pressure_mb < 500){
if($got_500mb == 0){
$got_500mb = 1;
// extrapolate wind spd
$temp_spd = extrap_wind_spd($wind_spd,$old_wind_spd,$pressure_mb,$old_pressure_mb,500);
// extrapolate wind dir
$temp_dir = extrap_wind_dir($wind_dir,$old_wind_dir,$pressure_mb,$old_pressure_mb,500);
// Store 500mb Winds
$MB500_DIR[$ruc_counter-1] = $temp_dir;
$MB500_SPD[$ruc_counter-1] = $temp_spd;
// extrapolate temp
$temp_temp = extrap_wind_spd($Tc,$old_Tc,$pressure_mb,$old_pressure_mb,500);
$MB500_TEMP[$ruc_counter-1] = round($temp_temp,1);
// extrapolate height
$temp_height = extrap_wind_spd($height,$old_height,$pressure_mb,$old_pressure_mb,500);
$MB500_HEIGHT[$ruc_counter-1] = round($temp_height);
// Calc 850-700mb Lapse Rate
$MB700_MB500_LR[$ruc_counter-1] = round(($MB700_TEMP[$ruc_counter-1] - $MB500_TEMP[$ruc_counter-1]) / (($MB500_HEIGHT[$ruc_counter-1] - $MB700_HEIGHT[$ruc_counter-1]) / 1000),1);
} // got 500mb
} // got pressure
if ($pressure_mb < 250){
if($got_250mb == 0){
$got_250mb = 1;
// extrapolate wind spd
$temp_spd = extrap_wind_spd($wind_spd,$old_wind_spd,$pressure_mb,$old_pressure_mb,250);
// extrapolate wind dir
$temp_dir = extrap_wind_dir($wind_dir,$old_wind_dir,$pressure_mb,$old_pressure_mb,250);
// Store 250mb Winds
$MB250_DIR[$ruc_counter-1] = $temp_dir;
$MB250_SPD[$ruc_counter-1] = $temp_spd;
// extrapolate temp
$temp_temp = extrap_wind_spd($Tc,$old_Tc,$pressure_mb,$old_pressure_mb,250);
$MB250_TEMP[$ruc_counter-1] = round($temp_temp,1);
} // got 250mb
} // got pressure
// Calc Thickness 850-700mb Thickness
if($got_thickness_height == 0){
if ($MB850_HEIGHT[$ruc_counter-1] != 0 and $MB700_HEIGHT[$ruc_counter-1] != 0) {
$MB850_MB700_THICK[$ruc_counter-1] = ($MB700_HEIGHT[$ruc_counter-1] - $MB850_HEIGHT[$ruc_counter-1]);
$got_thickness_height = 1;
//Calc of 1000MB Height and 1000-850mb/1000-500mb at bottom
}
}
if($got_wbz_height == 0){
if($got_wbz == 1){
// inc=(wettemplast)/(wettemplast-wettemp)
// htwbz=zz_S(i-1)+inc*(zz_S(i)-zz_S(i-1))
$inc = $old_wb_temperature / ($old_wb_temperature - $wb_temperature );
$temp = $old_pressure_mb + $inc * ($pressure_mb - $old_pressure_mb);
$WBZ[$ruc_counter-1] = round(($surface_pressure_mb - $temp) * 30);
$got_wbz_height = 1;
}
}
if($height > $LCL[$ruc_counter-1]/3.28) {
if($got_lcl_height == 0){
$got_lcl_height = 1;
$temp = $LCL[$ruc_counter-1]/3.28;
// extrapolate wind spd
$temp_spd = extrap_wind_spd($wind_spd,$old_wind_spd,$height,$old_height,$temp);
// extrapolate wind dir
$temp_dir = extrap_wind_dir($wind_dir,$old_wind_dir,$height,$old_height,$temp);
$lcl_u = get_U_comp($temp_spd,$temp_dir);
$lcl_v = get_V_comp($temp_spd,$temp_dir);
} // got_lcl_height
} // got height
if($height_AGL > 500) {
if($got_upper0_5K == 0){
$got_upper0_5K = 1;
// extrapolate wind spd
$temp_spd = extrap_wind_spd($wind_spd,$old_wind_spd,$height_AGL,$old_height_AGL,500);
// extrapolate wind dir
$temp_dir = extrap_wind_dir($wind_dir,$old_wind_dir,$height_AGL,$old_height_AGL,500);
// Store 0.5 km Winds
$KM_0_5_DIR[$ruc_counter-1] = $temp_dir;
$KM_0_5_SPD[$ruc_counter-1] = $temp_spd;
} // got 0.5K
} // got height
if($height_AGL > 1000) {
if($got_upper1K == 0){
$got_upper1K = 1;
// extrapolate wind spd
$temp_spd = extrap_wind_spd($wind_spd,$old_wind_spd,$height_AGL,$old_height_AGL,1000);
// extrapolate wind dir
$temp_dir = extrap_wind_dir($wind_dir,$old_wind_dir,$height_AGL,$old_height_AGL,1000);
// calculate 1KM shear
$u_1000 = get_U_comp($temp_spd,$temp_dir);
$v_1000 = get_V_comp($temp_spd,$temp_dir);
$a_1000_u[$ruc_counter-1] = $u_1000;
$a_1000_v[$ruc_counter-1] = $v_1000;
$uDiff = $u_1000 - $surf_u;
$vDiff = $v_1000 - $surf_v;
$shear_1KM = round(shear($uDiff,$vDiff));
if($ruc_counter <= $num_entries)
$SHEAR1KM[$ruc_counter-1] = $shear_1KM;
} // got upper1K
} // got height
if($height_AGL > 3000) {
if($got_upper3K == 0){
$got_upper3K = 1;
// extrapolate wind spd
$temp_spd = extrap_wind_spd($wind_spd,$old_wind_spd,$height_AGL,$old_height_AGL,3000);
// extrapolate wind dir
$temp_dir = extrap_wind_dir($wind_dir,$old_wind_dir,$height_AGL,$old_height_AGL,3000);
// calculate 3KM shear
$uDiff = get_U_comp($temp_spd,$temp_dir) - $surf_u;
$vDiff = get_V_comp($temp_spd,$temp_dir) - $surf_v;
$shear_3KM = round(shear($uDiff,$vDiff));
if($ruc_counter <= $num_entries){
$SHEAR3KM[$ruc_counter-1] = $shear_3KM;
}
// extrapolate temp
$temp_temp = extrap_wind_spd($Tc,$old_Tc,$height_AGL,$old_height_AGL,3000);
$TEMP_3KM[$ruc_counter-1] = round($temp_temp,1);
} // got upper3K
} // got height
if($height_AGL > 6000) {
if($got_upper6K == 0){
$got_upper6K = 1;
// extrapolate wind spd
$temp_spd = extrap_wind_spd($wind_spd,$old_wind_spd,$height_AGL,$old_height_AGL,6000);
// extrapolate wind dir
$temp_dir = extrap_wind_dir($wind_dir,$old_wind_dir,$height_AGL,$old_height_AGL,6000);
// calculate 6KM shear
$uDiff = get_U_comp($temp_spd,$temp_dir) - $surf_u;
$vDiff = get_V_comp($temp_spd,$temp_dir) - $surf_v;
if($ruc_counter <= $num_entries){
$SHEAR6KM[$ruc_counter-1] = round(shear($uDiff,$vDiff));
$CravenSig[$ruc_counter-1] = round(($CAPE[$ruc_counter-1] * $SHEAR6KM[$ruc_counter-1] * 0.5148 ) / 1000,2) ;
}
} // got upper6K
} // got height
// Calc MaxTwAloft
//echo "Pressure is $pressure_mb ";
//echo "Height is $height ";
//echo "MaxTwAloft is $MaxTwAloft ";
if($height_AGL > 610 && $pressure_mb >= 400) {
//echo "Pressure is $pressure_mb ";
//echo "Height is $height ";
//echo "WBc is $WBc ";
//echo "old_WBc is $old_WBc
";
if($WBc > $MaxTwAloft) {
$MaxTwAloft = $WBc;
}
//echo "MaxTwAloft is $MaxTwAloft
";
} // got height
//echo "
";
if ($pressure_mb < 400) {
$MAXTWALOFT[$ruc_counter-1] = round($MaxTwAloft,1);
}
// Calc MaxTAloft
if($height_AGL > 610 && $pressure_mb >= 400) {
if($Tc > $MaxTwAloft) {
$MaxTwAloft = $Tc;
}
} // got height
if ($pressure_mb < 400) {
$MAXTALOFT[$ruc_counter-1] = round($MaxTAloft,1);
}
if($Tc < 0) {
if($got_0CHeight == 0){
$got_0CHeight = 1;
// extrapolate height
$temp_height = extrap_wind_spd($height,$old_height,$Tc,$old_Tc,0);
$HEIGHT_0C[$ruc_counter-1] = round((($temp_height-$STNELEV)*3.28084)/1000,1);
// Calc 50DBZ Height
$temp_50DBZ = ($temp_height-$STNELEV);
$HEIGHT_50DBZ[$ruc_counter-1] = round((((0.00053532*(pow($temp_50DBZ,2)))-(0.573634*$temp_50DBZ)+4468.4)*3.28084)/1000,1);
} // got 0C Height
} // got height
if($Tc < -20) {
if($got_20CHeight == 0){
$got_20CHeight = 1;
// extrapolate height
$temp_height = extrap_wind_spd($height,$old_height,$Tc,$old_Tc,-20);
$HEIGHT_20C[$ruc_counter-1] = round((($temp_height-$STNELEV)*3.28084)/1000,1);
} // got -20C Height
} // got height
// get EBWD height from EL and LFC - close to inbound flow layer
if($height > ($EL[$ruc_counter-1] / 3.28)/2)
{
if($got_ebwd_height == 0){
$got_ebwd_height = 1;
$temp = ($EL[$ruc_counter-1] / 3.28)/2;
// extrapolate wind spd
$temp_spd = extrap_wind_spd($wind_spd,$old_wind_spd,$height,$old_height,$temp);
// extrapolate wind dir
$temp_dir = extrap_wind_dir($wind_dir,$old_wind_dir,$height,$old_height,$temp);
// calculate EBWD
$uDiff = get_U_comp($temp_spd,$temp_dir) - $lcl_u;
$vDiff = get_V_comp($temp_spd,$temp_dir) - $lcl_v;
if($ruc_counter <= $num_entries){
$EBWD[$ruc_counter-1] = round(shear($uDiff,$vDiff));
//echo $EBWD[$ruc_counter-1] . "
";
}
} // got_ebwd_height
} // $height > ($EL[$ruc_counter-1] / 3.28)/2
// Momentum Transfer and Mixed Layer Td Calculation - Added 6/6/2015 SRF
if ($old_pressure_mb != $pressure_mb) {
if ($mom_transfer == 0) {
//Calculate Lapse Rate
$LapseRate = (($old_Tc - $Tc) / (($height - $old_height)/1000));
if ($LapseRate > 7) {
//Store Wind Speed in Direction into Array
$MOMT_U[ ] = get_U_comp($wind_spd,$wind_dir);
$MOMT_V[ ] = get_V_comp($wind_spd,$wind_dir);
$A_ML_TDC[ ] = $Tdc;
}
else {
// Reached the top of the mixed layer - Give the Max Momentum Wind
$MIXHEIGHT[$ruc_counter-1] = round(($old_height-$STNELEV) * 3.28084);
// Commented out lines below, as it did not provide much value. SRF 7/27/15
//$MIXDOWNTC = ((($old_height-$STNELEV)/1000) * 9.8) + $old_Tc;
//$MIXDOWNTF = (($MIXDOWNTC * 9)/5)+32;
//$MIXDOWNT[$ruc_counter-1] = round($MIXDOWNTF);
$MOMT_MAX_WSPD[$ruc_counter-1] = $old_wind_spd;
$MOMT_MAX_WDIR[$ruc_counter-1] = $old_wind_dir;
//$ML_TDC[$ruc_counter-1] = (($old_Tdc * 9)/5)+32;
if (count($MOMT_U) > 0) {
//Calculate the Mean Momentum Transfer Wind
$temp_MOMT_U = array_sum($MOMT_U);
$temp_MOMT_V = array_sum($MOMT_V);
//Grab Mean TD in Mixed Layer
$temp_ML_TDC = array_sum($A_ML_TDC);
//Count Values in Array
$temp_MOMT_COUNT = count($MOMT_U);
//Calc Average ML Values
$avg_MOMT_U = $temp_MOMT_U / $temp_MOMT_COUNT;
$avg_MOMT_V = $temp_MOMT_V / $temp_MOMT_COUNT;
$avg_ML_TDC = $temp_ML_TDC / $temp_MOMT_COUNT;
$avg_MOMT_DIR = get_wind_dir($avg_MOMT_U,$avg_MOMT_V);
$avg_MOMT_SPD = round((sqrt(($avg_MOMT_U * $avg_MOMT_U) + ($avg_MOMT_V * $avg_MOMT_V))/.5148));
$MOMT_MEAN_WSPD[$ruc_counter-1] = $avg_MOMT_SPD;
$MOMT_MEAN_WDIR[$ruc_counter-1] = $avg_MOMT_DIR;
$ML_TDC_RAW[$ruc_counter-1] = $avg_ML_TDC;
$ML_TDC[$ruc_counter-1] = round((($avg_ML_TDC * 9)/5)+32);
$MOMT_U = array();
$MOMT_V = array();
$A_ML_TDC = array();
}
else {
//If there is no Momentum Transfer, give first model layer wind
$MOMT_MEAN_WSPD[$ruc_counter-1] = $old_wind_spd;
$MOMT_MEAN_WDIR[$ruc_counter-1] = $old_wind_dir;
$ML_TDC_RAW[$ruc_counter-1] = $old_Tdc;
$ML_TDC[$ruc_counter-1] = round((($old_Tdc * 9)/5)+32);
}
$mom_transfer = 1;
}
}
}
// Calculate Haines Index
//
// Haines Index = Stabilty Term (A) + Moisture Term (B)
// A = Tp1 - Tp2 (High 700-500MB, Med 850-700, Low 950-850)
// B = High (700 T-Td) or Med/Low (850 T-Td)
//
// Low Elevation
$STABILTY_RAW[$ruc_counter-1] = $MB950_TEMP[$ruc_counter-1] - $MB850_TEMP[$ruc_counter-1];
if ($STABILTY_RAW[$ruc_counter-1] < 4) {
$STABILTY_A[$ruc_counter-1] = 1;
}
elseif ($STABILTY_RAW[$ruc_counter-1] > 7) {
$STABILTY_A[$ruc_counter-1] = 3;
}
else {
$STABILTY_A[$ruc_counter-1] = 2;
}
$MOISTURE_RAW[$ruc_counter-1] = $MB850_TEMP[$ruc_counter-1] - $MB850_DEWTEMP[$ruc_counter-1];
if ($MOISTURE_RAW[$ruc_counter-1] < 6) {
$MOISTURE_B[$ruc_counter-1] = 1;
}
elseif ($MOISTURE_RAW[$ruc_counter-1] > 9) {
$MOISTURE_B[$ruc_counter-1] = 3;
}
else {
$MOISTURE_B[$ruc_counter-1] = 2;
}
$HAINES_LOW[$ruc_counter-1] = $STABILTY_A[$ruc_counter-1] + $MOISTURE_B[$ruc_counter-1];
//High Elevation
$STABILTY_RAW[$ruc_counter-1] = $MB700_TEMP[$ruc_counter-1] - $MB500_TEMP[$ruc_counter-1];
if ($STABILTY_RAW[$ruc_counter-1] < 18) {
$STABILTY_A[$ruc_counter-1] = 1;
}
elseif ($STABILTY_RAW[$ruc_counter-1] > 21) {
$STABILTY_A[$ruc_counter-1] = 3;
}
else {
$STABILTY_A[$ruc_counter-1] = 2;
}
$MOISTURE_RAW[$ruc_counter-1] = $MB700_TEMP[$ruc_counter-1] - $MB700_DEWTEMP[$ruc_counter-1];
if ($MOISTURE_RAW[$ruc_counter-1] < 15) {
$MOISTURE_B[$ruc_counter-1] = 1;
}
elseif ($MOISTURE_RAW[$ruc_counter-1] > 20) {
$MOISTURE_B[$ruc_counter-1] = 3;
}
else {
$MOISTURE_B[$ruc_counter-1] = 2;
}
$HAINES_HIGH[$ruc_counter-1] = $STABILTY_A[$ruc_counter-1] + $MOISTURE_B[$ruc_counter-1];
// Mid Elevation
$STABILTY_RAW[$ruc_counter-1] = $MB850_TEMP[$ruc_counter-1] - $MB700_TEMP[$ruc_counter-1];
if ($STABILTY_RAW[$ruc_counter-1] < 6) {
$STABILTY_A[$ruc_counter-1] = 1;
}
elseif ($STABILTY_RAW[$ruc_counter-1] > 10) {
$STABILTY_A[$ruc_counter-1] = 3;
}
else {
$STABILTY_A[$ruc_counter-1] = 2;
}
$MOISTURE_RAW[$ruc_counter-1] = $MB850_TEMP[$ruc_counter-1] - $MB850_DEWTEMP[$ruc_counter-1];
if ($MOISTURE_RAW[$ruc_counter-1] < 6) {
$MOISTURE_B[$ruc_counter-1] = 1;
}
elseif ($MOISTURE_RAW[$ruc_counter-1] > 12) {
$MOISTURE_B[$ruc_counter-1] = 3;
}
else {
$MOISTURE_B[$ruc_counter-1] = 2;
}
$HAINES_MID[$ruc_counter-1] = $STABILTY_A[$ruc_counter-1] + $MOISTURE_B[$ruc_counter-1];
// if ($STNELEV < 305) {
// $STABILTY_RAW[$ruc_counter-1] = $MB950_TEMP[$ruc_counter-1] - $MB850_TEMP[$ruc_counter-1];
// if ($STABILTY_RAW[$ruc_counter-1] < 4) {
// $STABILTY_A[$ruc_counter-1] = 1;
// }
// elseif ($STABILTY_RAW[$ruc_counter-1] > 7) {
// $STABILTY_A[$ruc_counter-1] = 3;
// }
// else {
// $STABILTY_A[$ruc_counter-1] = 2;
// }
// $MOISTURE_RAW[$ruc_counter-1] = $MB850_TEMP[$ruc_counter-1] - $MB850_DEWTEMP[$ruc_counter-1];
// if ($MOISTURE_RAW[$ruc_counter-1] < 6) {
// $MOISTURE_B[$ruc_counter-1] = 1;
// }
// elseif ($MOISTURE_RAW[$ruc_counter-1] > 9) {
// $MOISTURE_B[$ruc_counter-1] = 3;
// }
// else {
// $MOISTURE_B[$ruc_counter-1] = 2;
// }
// }
// //High Elevation
// elseif ($STNELEV > 914) {
// $STABILTY_RAW[$ruc_counter-1] = $MB700_TEMP[$ruc_counter-1] - $MB500_TEMP[$ruc_counter-1];
// if ($STABILTY_RAW[$ruc_counter-1] < 18) {
// $STABILTY_A[$ruc_counter-1] = 1;
// }
// elseif ($STABILTY_RAW[$ruc_counter-1] > 21) {
// $STABILTY_A[$ruc_counter-1] = 3;
// }
// else {
// $STABILTY_A[$ruc_counter-1] = 2;
// }
// $MOISTURE_RAW[$ruc_counter-1] = $MB700_TEMP[$ruc_counter-1] - $MB700_DEWTEMP[$ruc_counter-1];
// if ($MOISTURE_RAW[$ruc_counter-1] < 15) {
// $MOISTURE_B[$ruc_counter-1] = 1;
// }
// elseif ($MOISTURE_RAW[$ruc_counter-1] > 20) {
// $MOISTURE_B[$ruc_counter-1] = 3;
// }
// else {
// $MOISTURE_B[$ruc_counter-1] = 2;
// }
// }
// // Mid Elevation
// else {
// $STABILTY_RAW[$ruc_counter-1] = $MB850_TEMP[$ruc_counter-1] - $MB700_TEMP[$ruc_counter-1];
// if ($STABILTY_RAW[$ruc_counter-1] < 6) {
// $STABILTY_A[$ruc_counter-1] = 1;
// }
// elseif ($STABILTY_RAW[$ruc_counter-1] > 10) {
// $STABILTY_A[$ruc_counter-1] = 3;
// }
// else {
// $STABILTY_A[$ruc_counter-1] = 2;
// }
// $MOISTURE_RAW[$ruc_counter-1] = $MB850_TEMP[$ruc_counter-1] - $MB850_DEWTEMP[$ruc_counter-1];
// if ($MOISTURE_RAW[$ruc_counter-1] < 6) {
// $MOISTURE_B[$ruc_counter-1] = 1;
// }
// elseif ($MOISTURE_RAW[$ruc_counter-1] > 12) {
// $MOISTURE_B[$ruc_counter-1] = 3;
// }
// else {
// $MOISTURE_B[$ruc_counter-1] = 2;
// }
// }
// $HAINES[$ruc_counter-1] = $STABILTY_A[$ruc_counter-1] + $MOISTURE_B[$ruc_counter-1];
$i = $i + 1;
}
$LID[$ruc_counter-1] = round(($Qsw - $Qwmax),1);
}
if (preg_match("/STN YYMMDD/i", $lines[$i])) {
// found time line - now process rest of info
if ($modelname == "GFS") {
// Helicity
$i = $i + 4;
$ruc_counter = 0;
for($k=0;$k<$num_entries;$k++){
// First grab Surface T/Td/RH
$result = explode(" ",$lines[$i+2]);
$TcSurf = $result[1];
$SURF_TC[$ruc_counter] = $TcSurf;
$result = explode(" ",$lines[$i+3]);
$TdcSurf = $result[2];
$Es= 6.11* pow(10,(7.5*$TcSurf/(237.7+$TcSurf)));
$E= 6.11* pow(10,(7.5*$TdcSurf/(237.7+$TdcSurf)));
$RH = ($E/$Es)*100;
$SURF_RH[$ruc_counter] = round($RH);
$TcSurf = (($TcSurf * 9)/5)+32;
$SURF_T[$ruc_counter] = round($TcSurf);
$TdcSurf = (($TdcSurf * 9)/5)+32;
$SURF_TD[$ruc_counter] = round($TdcSurf);
// 10M Winds
$result = explode(" ",$lines[$i+1]);
$TEN_M_U = $result[5];
$result = explode(" ",$lines[$i+2]);
$TEN_M_V = $result[0];
$TEN_M_speed[$ruc_counter] = round((sqrt(($TEN_M_U * $TEN_M_U) + ($TEN_M_V * $TEN_M_V))/.5148));
$TEN_M_dir = get_wind_dir($TEN_M_U, $TEN_M_V);
$TEN_M_direction[$ruc_counter] = round($TEN_M_dir);
// Grab MSLP and Precip Data
$result = explode(" ",$lines[$i]);
$MSLP = $result[2];
$MSLP_MB[$ruc_counter] = round($MSLP,1);
// Calc Apparent Temperature
if ($TcSurf<=50) {
$SURF_TA[$ruc_counter] = round(35.74 + (0.6215 * $TcSurf) - (35.75 * pow(($TEN_M_speed[$ruc_counter] * 1.15078),0.16)) + (0.4275 * $TcSurf * pow(($TEN_M_speed[$ruc_counter] * 1.15078),0.16)));
if ($TEN_M_speed[$ruc_counter] <= 2) {
$SURF_TA[$ruc_counter] = round($TcSurf);
}
} elseif ($TcSurf>80) {
$SURF_TA[$ruc_counter] = round((-42.38) + (2.049 * $TcSurf) + (10.14 * $RH) + ((-0.2248) * $TcSurf * $RH) + ((-0.006838) * pow($TcSurf,2)) + ((-0.05482) * pow($RH,2)) + (0.001228 * pow($TcSurf,2) * $RH) + (0.0008528 * $TcSurf * pow($RH,2)) + ((-0.00000199) * pow($TcSurf,2) * pow($RH,2)));
} else {
$SURF_TA[$ruc_counter] = round($TcSurf);
}
// Calc Thickness 1000 Height and 1000-850mb/1000-500mb Thicknesses
//echo "MSLP " . $MSLP . " ";
//$MB1000_HEIGHT[$ruc_counter] = ($MSLP - 1000) * 8;
//echo "1000MB Height " . $MB1000_HEIGHT[$ruc_counter] . " ";
//$MB1000_MB850_THICK[$ruc_counter] = round(($MB850_HEIGHT[$ruc_counter] - $MB1000_HEIGHT[$ruc_counter]));
//$MB1000_MB500_THICK[$ruc_counter] = round(($MB500_HEIGHT[$ruc_counter] - $MB1000_HEIGHT[$ruc_counter]));
//if ($ruc_counter == 1){
// $H1000_x = $Es * $RH;
// $H1000_v = ($Tc + 273.15) / (1 - 0.379 * ($H1000_x / $pressure_mb));
// $H1000_cm = $H1000_v + 0.02774 * (1000 - $pressure_mb);
// $MB1000_HEIGHT[$ruc_counter-1] = (($height * 3.28084) * 0.3048 - (67.422 * log10(1000 / $pressure_mb) * $H1000_cm) / 3.28084);
// echo "1000H " . $MB1000_HEIGHT[$ruc_counter-1] . " ";
//}
// Calc Various Lapse Rates
$SFC_MB925_LR[$ruc_counter-1] = round(($SURF_TC[$ruc_counter] - $MB925_TEMP[$ruc_counter-1]) / (($MB925_HEIGHT[$ruc_counter-1] - $STNELEV) / 1000),1);
$SFC_MB850_LR[$ruc_counter-1] = round(($SURF_TC[$ruc_counter] - $MB850_TEMP[$ruc_counter-1]) / (($MB850_HEIGHT[$ruc_counter-1] - $STNELEV) / 1000),1);
$SFC_3KM_LR[$ruc_counter-1] = round(($SURF_TC[$ruc_counter] - $TEMP_3KM[$ruc_counter-1]) / ((3000 - $STNELEV) / 1000),1);
// Calc SHERBS3
$SHERBS3[$ruc_counter-1] = round((($SHEAR3KM[$ruc_counter-1]*0.514444)/26)*($SFC_3KM_LR[$ruc_counter-1] / 5.2)*($MB700_MB500_LR[$ruc_counter-1] / 5.6),1);
//Using Hypsometric Equation - SRF 6/8/15 - Diff from Bufkit by around 2m.
$result = explode(" ",$lines[$i+2]);
$Q_SURF = ($result[2] / 1000);
//echo "Q " . $Q_SURF . " ";
$HE_Tv = (1 + (0.61 * $Q_SURF)) * ($SURF_TC[$ruc_counter] + 273.15);
//echo "Tv " . $HE_Tv . " ";
$MB1000_HEIGHT[$ruc_counter] = -(((287 * $HE_Tv) / 9.81) * log(1000 / $MSLP));
//echo "H " . $MB1000_HEIGHT . " ";
$MB1000_MB850_THICK[$ruc_counter] = round(($MB850_HEIGHT[$ruc_counter] - $MB1000_HEIGHT[$ruc_counter]));
$MB1000_MB500_THICK[$ruc_counter] = round(($MB500_HEIGHT[$ruc_counter] - $MB1000_HEIGHT[$ruc_counter]));
$MB1000_MB700_THICK[$ruc_counter] = round(($MB700_HEIGHT[$ruc_counter] - $MB1000_HEIGHT[$ruc_counter]));
$result = explode(" ",$lines[$i]);
$PCPN = $result[7];
if($PCPN == -9999) {
$PCPN = 0;
$PCPN_TOT[$ruc_counter] = 0;
}
$PCPN = $PCPN * 0.0393701;
$PCPN_HR[$ruc_counter] = round($PCPN,2);
$PCPN_TOT[$ruc_counter] = $PCPN_TOT[$ruc_counter-1] + $PCPN_HR[$ruc_counter];
//Snow Placeholder
$SNRATIO[$ruc_counter] = "MM";
$SN1HR[$ruc_counter] = "MM";
$SN_TOT[$ruc_counter] = "MM";
//Model Wx Type
$result = explode(" ",$lines[$i+2]);
$WXSN[$ruc_counter] = $result[3];
$WXPL[$ruc_counter] = $result[4];
$WXZR[$ruc_counter] = $result[5];
$result = explode(" ",$lines[$i+3]);
$WXRA[$ruc_counter] = $result[0];
//VSBY Placeholder
$VSBY[$ruc_counter] = "MM";
// Grab Cloud Data
$result = explode(" ",$lines[$i+1]);
$LCLD[$ruc_counter] = round($result[2]);
$MCLD[$ruc_counter] = round($result[3]);
$HCLD[$ruc_counter] = round($result[4]);
//Grab rest of data
//$result = explode(" ",$lines[$i]);
//$ustm = $result[5];
//$result = explode(" ",$lines[$i+1]);
//$vstm = $result[0];
//$storm_speed = round((sqrt(($ustm * $ustm) + ($vstm * $vstm))/.5148));
// calculate storm direction
//if( $vstm > 0)
// $ANG = 180;
//elseif ( ($ustm < 0) && ($vstm < 0))
// $ANG = 0;
//elseif ( ($ustm > 0) && ($vstm < 0))
// $ANG = 360;
//if($vstm == 0)
// $vstm = .00000001;
//$storm_direction = (180 / pi()) * atan($ustm / $vstm) + $ANG;
//$storm_direction = round($storm_direction);
//$STMOTION[$ruc_counter] = $storm_direction . ' at ' . $storm_speed;
$STMOTION[$ruc_counter] = 'MMM at MM';
// 0 -1KM Helicity for STP parameter
// grab data for 1K helicity
//echo "Surf u - " . $a_surf_u[$ruc_counter] . " Surf v - " . $a_surf_v[$ruc_counter] . "
";
//echo "1000 u - " . $a_1000_u[$ruc_counter] . " 1000 v - " . $a_1000_v[$ruc_counter] . "
";
//$uDelta[$ruc_counter] = $a_1000_u[$ruc_counter] - $a_surf_u[$ruc_counter];
//$vDelta[$ruc_counter] = $a_1000_v[$ruc_counter] - $a_surf_v[$ruc_counter];
//echo " uDelta - " . $uDelta[$ruc_counter];
//echo " vDelta - " . $vDelta[$ruc_counter] . "
";
//$uMean[$ruc_counter] = ($a_1000_u[$ruc_counter] + $a_surf_u[$ruc_counter]) / 2;
//$vMean[$ruc_counter] = ($a_1000_v[$ruc_counter] + $a_surf_v[$ruc_counter]) / 2;
////echo "uMean - " . $uMean[$ruc_counter];
////echo " vMean - " . $vMean[$ruc_counter] . "
";
//$uDiff = $ustm; // get_U_comp($storm_speed, $storm_direction);
//$vDiff = $vstm; //get_V_comp($storm_speed, $storm_direction);
////echo "Storm u - " . $uDiff . "
";
////echo "Storm v - " . $vDiff . "
";
//$Usr = $uMean[$ruc_counter] - $uDiff;
//$Vsr = $vMean[$ruc_counter] - $vDiff;
////echo " Usr " . $Usr . "
";
////echo " Vsr " . $Vsr . "
";
////echo "( " . $Vsr . " * " . $uDelta[$ruc_counter] . ") - (" . $Usr . " * " . $vDelta[$ruc_counter] . ")
";
//$HLCY1K[$ruc_counter] = round(($Vsr* $uDelta[$ruc_counter]) - ($Usr*$vDelta[$ruc_counter]),2);
$HLCY1K[$ruc_counter] = "MM";
////echo $HLCY1K[$ruc_counter] . "
";
// get HELICITY
//$SRH[$ruc_counter] = round($result[1],1);
$SRH[$ruc_counter] = "MM";
// now we have helicity and cape, compute EHI
//$EHI[$ruc_counter] = round(($CAPE[$ruc_counter] * $SRH[$ruc_counter])/160000,2);
$EHI[$ruc_counter] = "MM";
//if($EHI[$ruc_counter] == -0)
// $EHI[$ruc_counter] = 0;
// now calculate SCP
// shear is in knots - convert to m/s by * by .5148
//$SCP[$ruc_counter] = ($CAPE[$ruc_counter]/1000) * ($SRH[$ruc_counter]/50) ;
$SCP[$ruc_counter] = "MM" ;
////echo $EBWD[$ruc_counter] . "
";
//$EBWD[$ruc_counter] = $EBWD[$ruc_counter] *.5148; // convert to m/s
$EBWD[$ruc_counter] = "MM"; // convert to m/s
//if($EBWD[$ruc_counter] < 10)
// $EBWD[$ruc_counter] = 0;
//elseif ($EBWD[$ruc_counter] > 20)
// $EBWD[$ruc_counter] = 1;
//else
// $EBWD[$ruc_counter] = $EBWD[$ruc_counter] /20;
//$SCP[$ruc_counter] = round($SCP[$ruc_counter] * $EBWD[$ruc_counter],1);
$SCP[$ruc_counter] = "MM";
//if($SCP[$ruc_counter] == -0)
// $SCP[$ruc_counter] = 0;
//$STP[$ruc_counter] = $CAPE[$ruc_counter]/1000 * ($HLCY1K[$ruc_counter]/100) * ((2000 - ($LCL[$ruc_counter]/3.28))/1500) * $EBWD[$ruc_counter];
$STP[$ruc_counter] = "MM";
//$STP[$ruc_counter] = round($STP[$ruc_counter],1);
//if($STP[$ruc_counter] == -0)
// $STP[$ruc_counter] = 0;
$ruc_counter = $ruc_counter +1;
$i = $i + 4;
}
}
else {
//1 hour Models
// Helicity
$i = $i + 9;
$ruc_counter = 0;
for($k=0;$k<$num_entries;$k++){
// First grab Surface T/Td/RH/Wind
$result = explode(" ",$lines[$i-1]);
$TcSurf = $result[5];
$SURF_TC[$ruc_counter] = $TcSurf;
// 10M Winds
$TEN_M_U = $result[1];
$TEN_M_V = $result[2];
$TEN_M_speed[$ruc_counter] = round((sqrt(($TEN_M_U * $TEN_M_U) + ($TEN_M_V * $TEN_M_V))/.5148));
$TEN_M_dir = get_wind_dir($TEN_M_U, $TEN_M_V);
$TEN_M_direction[$ruc_counter] = round($TEN_M_dir);
$result = explode(" ",$lines[$i+2]);
$TdcSurf = $result[0];
$Es= 6.11* pow(10,(7.5*$TcSurf/(237.7+$TcSurf)));
$E= 6.11* pow(10,(7.5*$TdcSurf/(237.7+$TdcSurf)));
$RH = ($E/$Es)*100;
$SURF_RH[$ruc_counter] = round($RH);
$TcSurf = (($TcSurf * 9)/5)+32;
$SURF_T[$ruc_counter] = round($TcSurf);
$TdcSurf = (($TdcSurf * 9)/5)+32;
$SURF_TD[$ruc_counter] = round($TdcSurf);
// Grab MSLP and Precip Data
$result = explode(" ",$lines[$i-3]);
$MSLP = $result[2];
$MSLP_MB[$ruc_counter] = round($MSLP,1);
// Calc Apparent Temperature
if ($TcSurf<=50) {
$SURF_TA[$ruc_counter] = round(35.74 + (0.6215 * $TcSurf) - (35.75 * pow(($TEN_M_speed[$ruc_counter] * 1.15078),0.16)) + (0.4275 * $TcSurf * pow(($TEN_M_speed[$ruc_counter] * 1.15078),0.16)));
if ($TEN_M_speed[$ruc_counter] <= 2) {
$SURF_TA[$ruc_counter] = round($TcSurf);
}
} elseif ($TcSurf>80) {
$SURF_TA[$ruc_counter] = round((-42.38) + (2.049 * $TcSurf) + (10.14 * $RH) + ((-0.2248) * $TcSurf * $RH) + ((-0.006838) * pow($TcSurf,2)) + ((-0.05482) * pow($RH,2)) + (0.001228 * pow($TcSurf,2) * $RH) + (0.0008528 * $TcSurf * pow($RH,2)) + ((-0.00000199) * pow($TcSurf,2) * pow($RH,2)));
} else {
$SURF_TA[$ruc_counter] = round($TcSurf);
}
// Calc Thickness 1000 Height and 1000-850mb/1000-500mb Thicknesses
// Basic Assumption - Diff from Bufkit by 6m
//echo "MSLP " . $MSLP . " ";
//$MB1000_HEIGHT[$ruc_counter] = ($MSLP - 1000) * 8.0;
//echo "1000MB Height " . $MB1000_HEIGHT[$ruc_counter] . " ";
//$MB1000_MB850_THICK[$ruc_counter] = round(($MB850_HEIGHT[$ruc_counter] - $MB1000_HEIGHT[$ruc_counter]));
//$MB1000_MB500_THICK[$ruc_counter] = round(($MB500_HEIGHT[$ruc_counter] - $MB1000_HEIGHT[$ruc_counter]));
//if ($ruc_counter == 1){
//$H1000_x = $Es * $RH;
//$H1000_v = ($SURF_TC[$ruc_counter] + 273.15) / (1 - 0.379 * ($H1000_x / $MSLP));
//$H1000_cm = $H1000_v + 0.02774 * (1000 - $MSLP);
//$MB1000_HEIGHT[$ruc_counter-1] = ($STNELEV_FT * 0.3048 - (67.422 * log10(1000 / $MSLP) * $H1000_cm));
//$MB1000_HEIGHT_SFC = $MB1000_HEIGHT[$ruc_counter-1] - $STNELEV;
//echo "1000H " . $MB1000_HEIGHT_SFC . " ";
//}
// Calc Various Lapse Rates
$SFC_MB925_LR[$ruc_counter-1] = round(($SURF_TC[$ruc_counter] - $MB925_TEMP[$ruc_counter-1]) / (($MB925_HEIGHT[$ruc_counter-1] - $STNELEV) / 1000),1);
$SFC_MB850_LR[$ruc_counter-1] = round(($SURF_TC[$ruc_counter] - $MB850_TEMP[$ruc_counter-1]) / (($MB850_HEIGHT[$ruc_counter-1] - $STNELEV) / 1000),1);
$SFC_3KM_LR[$ruc_counter-1] = round(($SURF_TC[$ruc_counter] - $TEMP_3KM[$ruc_counter-1]) / ((3000 - $STNELEV) / 1000),1);
// Calc SHERBS3
$SHERBS3[$ruc_counter-1] = round((($SHEAR3KM[$ruc_counter-1]*0.514444)/26)*($SFC_3KM_LR[$ruc_counter-1] / 5.2)*($MB700_MB500_LR[$ruc_counter-1] / 5.6),1);
//Using Hypsometric Equation - SRF 6/8/15 - Diff from Bufkit by around 2m.
$result = explode(" ",$lines[$i]);
$Q_SURF = ($result[0] / 1000);
//echo "Q " . $Q_SURF . " ";
$HE_Tv = (1 + (0.61 * $Q_SURF)) * ($SURF_TC[$ruc_counter] + 273.15);
//echo "Tv " . $HE_Tv . " ";
$MB1000_HEIGHT[$ruc_counter] = -(((287 * $HE_Tv) / 9.81) * log(1000 / $MSLP));
//echo "H " . $MB1000_HEIGHT . " ";
$MB1000_MB850_THICK[$ruc_counter] = round(($MB850_HEIGHT[$ruc_counter] - $MB1000_HEIGHT[$ruc_counter]));
$MB1000_MB500_THICK[$ruc_counter] = round(($MB500_HEIGHT[$ruc_counter] - $MB1000_HEIGHT[$ruc_counter]));
$MB1000_MB700_THICK[$ruc_counter] = round(($MB700_HEIGHT[$ruc_counter] - $MB1000_HEIGHT[$ruc_counter]));
// End Thickness Calc
$result = explode(" ",$lines[$i-2]);
$PCPN = $result[0];
if($PCPN == -9999) {
$PCPN = 0;
$PCPN_TOT[$ruc_counter] = 0;
}
$PCPN = $PCPN * 0.0393701;
$PCPN_HR[$ruc_counter] = round($PCPN,2);
$PCPN_TOT[$ruc_counter] = $PCPN_TOT[$ruc_counter-1] + $PCPN_HR[$ruc_counter];
//Grab Winter Surface Data
//SnowRatio %
$result = explode(" ",$lines[$i-1]);
$SNRATIO[$ruc_counter] = round($result[0],1);
//1hr Snowfall
$result = explode(" ",$lines[$i-3]);
if ($result[6] > -9999) {
if ($modelname == "RAP" OR $modelname == "HRRR") {
//$SN1HR[$ruc_counter] = round(($result[6] * 0.00393701),1); }
$SN1HR[$ruc_counter] = "MM";}
else {
$SN1HR[$ruc_counter] = round(($result[6]),1); }// * 0.0393701
$SN_TOT[$ruc_counter] = $SN_TOT[$ruc_counter-1] + $SN1HR[$ruc_counter];
}
else {
$SN1HR[$ruc_counter] = "MM";
$SN_TOT[$ruc_counter] = 0;
}
//Model Wx Type
$result = explode(" ",$lines[$i]);
$WXSN[$ruc_counter] = $result[1];
$WXPL[$ruc_counter] = $result[2];
$WXZR[$ruc_counter] = $result[3];
$WXRA[$ruc_counter] = $result[4];
//Grab VSBY Data
$result = explode(" ",$lines[$i+1]);
$VSBY[$ruc_counter] = $result[5];
// Grab Cloud Data
$result = explode(" ",$lines[$i-2]);
$LCLD[$ruc_counter] = round($result[3]);
$MCLD[$ruc_counter] = round($result[4]);
$HCLD[$ruc_counter] = round($result[5]);
//Grab rest of data
$result = explode(" ",$lines[$i]);
$ustm = $result[5];
$result = explode(" ",$lines[$i+1]);
$vstm = $result[0];
$storm_speed = round((sqrt(($ustm * $ustm) + ($vstm * $vstm))/.5148));
// calculate storm direction
if( $vstm > 0)
$ANG = 180;
elseif ( ($ustm < 0) && ($vstm < 0))
$ANG = 0;
elseif ( ($ustm > 0) && ($vstm < 0))
$ANG = 360;
if($vstm == 0)
$vstm = .00000001;
$storm_direction = (180 / pi()) * atan($ustm / $vstm) + $ANG;
$storm_direction = round($storm_direction);
$STMOTION[$ruc_counter] = $storm_direction . ' at ' . $storm_speed;
$STMOTION_DIR[$ruc_counter] = $storm_direction;
$STMOTION_SPD[$ruc_counter] = $storm_speed;
// 0 -1KM Helicity for STP parameter
// grab data for 1K helicity
//echo "Surf u - " . $a_surf_u[$ruc_counter] . " Surf v - " . $a_surf_v[$ruc_counter] . "
";
//echo "1000 u - " . $a_1000_u[$ruc_counter] . " 1000 v - " . $a_1000_v[$ruc_counter] . "
";
$uDelta[$ruc_counter] = $a_1000_u[$ruc_counter] - $a_surf_u[$ruc_counter];
$vDelta[$ruc_counter] = $a_1000_v[$ruc_counter] - $a_surf_v[$ruc_counter];
//echo " uDelta - " . $uDelta[$ruc_counter];
//echo " vDelta - " . $vDelta[$ruc_counter] . "
";
$uMean[$ruc_counter] = ($a_1000_u[$ruc_counter] + $a_surf_u[$ruc_counter]) / 2;
$vMean[$ruc_counter] = ($a_1000_v[$ruc_counter] + $a_surf_v[$ruc_counter]) / 2;
//echo "uMean - " . $uMean[$ruc_counter];
//echo " vMean - " . $vMean[$ruc_counter] . "
";
$uDiff = $ustm; // get_U_comp($storm_speed, $storm_direction);
$vDiff = $vstm; //get_V_comp($storm_speed, $storm_direction);
//echo "Storm u - " . $uDiff . "
";
//echo "Storm v - " . $vDiff . "
";
$Usr = $uMean[$ruc_counter] - $uDiff;
$Vsr = $vMean[$ruc_counter] - $vDiff;
//echo " Usr " . $Usr . "
";
//echo " Vsr " . $Vsr . "
";
//echo "( " . $Vsr . " * " . $uDelta[$ruc_counter] . ") - (" . $Usr . " * " . $vDelta[$ruc_counter] . ")
";
$HLCY1K[$ruc_counter] = round(($Vsr* $uDelta[$ruc_counter]) - ($Usr*$vDelta[$ruc_counter]),2);
//echo $HLCY1K[$ruc_counter] . "
";
// get HELICITY
$SRH[$ruc_counter] = round($result[1],1);
// now we have helicity and cape, compute EHI
$EHI[$ruc_counter] = round(($CAPE[$ruc_counter] * $SRH[$ruc_counter])/160000,2);
if($EHI[$ruc_counter] == -0)
$EHI[$ruc_counter] = 0;
// now calculate SCP
// shear is in knots - convert to m/s by * by .5148
$SCP[$ruc_counter] = ($CAPE[$ruc_counter]/1000) * ($SRH[$ruc_counter]/50) ;
//echo $EBWD[$ruc_counter] . "
";
$EBWD[$ruc_counter] = $EBWD[$ruc_counter] *.5148; // convert to m/s
if($EBWD[$ruc_counter] < 10)
$EBWD[$ruc_counter] = 0;
elseif ($EBWD[$ruc_counter] > 20)
$EBWD[$ruc_counter] = 1;
else
$EBWD[$ruc_counter] = $EBWD[$ruc_counter] /20;
$SCP[$ruc_counter] = round($SCP[$ruc_counter] * $EBWD[$ruc_counter],1);
if($SCP[$ruc_counter] == -0)
$SCP[$ruc_counter] = 0;
$STP[$ruc_counter] = $CAPE[$ruc_counter]/1000 * ($HLCY1K[$ruc_counter]/100) * ((2000 - ($LCL[$ruc_counter]/3.28))/1500) * $EBWD[$ruc_counter];
$STP[$ruc_counter] = round($STP[$ruc_counter],1);
if($STP[$ruc_counter] == -0)
$STP[$ruc_counter] = 0;
$ruc_counter = $ruc_counter +1;
$i = $i + 6;
}
}
}
$i++;
endwhile;
//------------------------------------------------------------------------------------------
function fetchUrlWithoutHanging($url,$cacheurl)
{
global $Status;
// Set maximum number of seconds (can have floating-point) to wait for feed before displaying page without feed
$numberOfSeconds=10;
// Suppress error reporting so Web site visitors are unaware if the feed fails
error_reporting(0);
// Extract resource path and domain from URL ready for fsockopen
$url = str_replace("http://","",$url);
$urlComponents = explode("/",$url);
$domain = $urlComponents[0];
$resourcePath = str_replace($domain,"",$url);
// Establish a connection
$socketConnection = fsockopen($domain, 21, $errno, $errstr, $numberOfSeconds);
if (!$socketConnection)
{
$Status .= "";
$html = implode('', file($cacheurl));
return($html);
// You may wish to remove the following debugging line on a live Web site
} // end if
else {
$xml = '';
fputs($socketConnection, "GET $resourcePath HTTP/1.0\r\nHost: $domain\r\nCache-Control: no-cache, must-revalidate\r\nCache-control: max-age=0\r\n\r\n");
// Loop until end of file
while (!feof($socketConnection))
{
$xml .= fgets($socketConnection, 8192);
} // end while
fclose ($socketConnection);
} // end else
return($xml);
} // end fetchUrlWithoutHanging function
//------------------------------------------------------------------------------------------
?>
Click group to view data |
" . $REPORT_DAY_WEEK[$j] . '';
}
?>
Date |
" . $REPORT_DAY[$j] . '';
}
?>
";
$Sounding3hr = array(0,3,6,9,12,15,18,21);
$Sounding6hr = array(0,6,12,18);
for($j=0;$j<$num_entries;$j++){
if (($modelname == "NAM") AND in_array($REPORT_TIME_RAW[$j], $Sounding3hr)) {
// Twisterdata Sounding
// echo " | ' . $REPORT_TIME_RAW[$j] . 'Z | ';
// Pivotal Weather Sounding
echo "' . $REPORT_TIME_RAW[$j] . 'Z | ';
}
elseif (($modelname == "NAM4KM") AND in_array($REPORT_TIME_RAW[$j], $Sounding3hr) AND ($j <=60)) {
// Twisterdata Sounding
// echo "' . $REPORT_TIME_RAW[$j] . 'Z | ';
// Pivotal Weather Sounding
echo "' . $REPORT_TIME_RAW[$j] . 'Z | ';
}
elseif ($modelname == "RAP" OR $modelname == "HRRR") {
// Twisterdata Sounding
// echo "' . $REPORT_TIME_RAW[$j] . 'Z | ';
// Pivotal Weather Sounding
echo "' . $REPORT_TIME_RAW[$j] . 'Z | ';
}
elseif (($modelname == "GFS") AND ($j <= 48) AND in_array($REPORT_TIME_RAW[$j], $Sounding3hr)) {
// Twisterdata Sounding
// echo "' . $REPORT_TIME_RAW[$j] . 'Z | ';
// Pivotal Weather Sounding
echo "' . $REPORT_TIME_RAW[$j] . 'Z | ';
}
elseif (($modelname == "GFS") AND ($j > 48) AND ($j <= 120) AND in_array($REPORT_TIME_RAW[$j], $Sounding6hr)) {
// Twisterdata Sounding
// echo "' . $REPORT_TIME_RAW[$j] . 'Z | ';
// Pivotal Weather Sounding
echo "' . $REPORT_TIME_RAW[$j] . 'Z | ';
}
elseif (($modelname == "GFS") AND ($j > 120) AND in_array($REPORT_TIME_RAW[$j], $Sounding6hr)) {
// Twisterdata Sounding
// echo "' . $REPORT_TIME_RAW[$j] . 'Z | ';
// Pivotal Weather Sounding
echo "' . $REPORT_TIME_RAW[$j] . 'Z | ';
}
else {
echo "" . $REPORT_TIME[$j] . ' | ';
}
}
?>
Surface Weather Data |
-----";
}
?>
2m Temp (F) |
= 90){
echo "" . $SURF_T[$j] . ' | ';
}
elseif ($SURF_T[$j] >= 80){
echo "" . $SURF_T[$j] . ' | ';
}
elseif ($SURF_T[$j] >= 70){
echo "" . $SURF_T[$j] . ' | ';
}
elseif ($SURF_T[$j] >= 40){
echo "" . $SURF_T[$j] . ' | ';
}
elseif ($SURF_T[$j] >= 33){
echo "" . $SURF_T[$j] . ' | ';
}
elseif ($SURF_T[$j] >= 28){
echo "" . $SURF_T[$j] . ' | ';
}
elseif ($SURF_T[$j] > 0){
echo "" . $SURF_T[$j] . ' | ';
}
else
echo "" . $SURF_T[$j] . ' | ';
}
?>
2m Apparent Temp (F) |
= 105){
echo "" . $SURF_TA[$j] . ' | ';
}
elseif ($SURF_TA[$j] >= 100){
echo "" . $SURF_TA[$j] . ' | ';
}
elseif ($SURF_TA[$j] >= 95){
echo "" . $SURF_TA[$j] . ' | ';
}
elseif ($SURF_TA[$j] >= 10){
echo "" . $SURF_TA[$j] . ' | ';
}
elseif ($SURF_TA[$j] >= 0){
echo "" . $SURF_TA[$j] . ' | ';
}
elseif ($SURF_TA[$j] > -25){
echo "" . $SURF_TA[$j] . ' | ';
}
elseif ($SURF_TA[$j] > -35){
echo "" . $SURF_TA[$j] . ' | ';
}
else
echo "" . $SURF_TA[$j] . ' | ';
}
?>
2m Dewpoint (F) |
= 70){
echo "" . $SURF_TD[$j] . ' | ';
}
elseif ($SURF_TD[$j] >= 60){
echo "" . $SURF_TD[$j] . ' | ';
}
elseif ($SURF_TD[$j] >= 50){
echo "" . $SURF_TD[$j] . ' | ';
}
else
echo "" . $SURF_TD[$j] . ' | ';
}
?>
ML Dewpoint (F) |
= 70){
echo "" . $ML_TDC[$j] . ' | ';
}
elseif ($ML_TDC[$j] >= 60){
echo "" . $ML_TDC[$j] . ' | ';
}
elseif ($ML_TDC[$j] >= 50){
echo "" . $ML_TDC[$j] . ' | ';
}
else
echo "" . $ML_TDC[$j] . ' | ';
}
?>
2m RH (%) |
= 95){
echo "" . $SURF_RH[$j] . ' | ';
}
elseif ($SURF_RH[$j] >= 90){
echo "" . $SURF_RH[$j] . ' | ';
}
elseif ($SURF_RH[$j] >= 75){
echo "" . $SURF_RH[$j] . ' | ';
}
elseif ($SURF_RH[$j] <= 25){
echo "" . $SURF_RH[$j] . ' | ';
}
elseif ($SURF_RH[$j] <= 40){
echo "" . $SURF_RH[$j] . ' | ';
}
else
echo "" . $SURF_RH[$j] . ' | ';
}
?>
ML RH (%) |
= 95){
echo "" . $ML_RH . ' | ';
}
elseif ($ML_RH >= 90){
echo "" . $ML_RH. ' | ';
}
elseif ($ML_RH >= 75){
echo "" . $ML_RH . ' | ';
}
elseif ($ML_RH <= 25){
echo "" . $ML_RH . ' | ';
}
elseif ($ML_RH <= 40){
echo "" . $ML_RH . ' | ';
}
else
echo "" . $ML_RH . ' | ';
}
?>
10m Wind Dir/Spd (kts) |
= 349 and $TEN_M_direction[$j] <= 360){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] >= 0 and $TEN_M_direction[$j] <= 11){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 11 and $TEN_M_direction[$j] <= 34){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 34 and $TEN_M_direction[$j] <= 56){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 56 and $TEN_M_direction[$j] <= 78){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 78 and $TEN_M_direction[$j] <= 101){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 101 and $TEN_M_direction[$j] <= 124){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 124 and $TEN_M_direction[$j] <= 146){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 146 and $TEN_M_direction[$j] <= 169){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 169 and $TEN_M_direction[$j] <= 191){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 191 and $TEN_M_direction[$j] <= 214){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 214 and $TEN_M_direction[$j] <= 236){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 236 and $TEN_M_direction[$j] <= 259){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 259 and $TEN_M_direction[$j] <= 281){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 281 and $TEN_M_direction[$j] <= 304){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 304 and $TEN_M_direction[$j] <= 326){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 326 and $TEN_M_direction[$j] <= 349){
echo " " . $TEN_M_speed[$j] . ' | ';
}
else
// echo "" . $TEN_M_direction[$j] . ' | ';
// echo "VRB" . $TEN_M_speed[$j] . ' | ';
echo "VRB 0 | ";
}
?>
Mean Momentum Transfer (kts) |
Max Momentum Transfer (kts) |
0.5 KM Winds (kts) |
Mixing Height (ft) |
" . $MIXHEIGHT[$j] . '';
}
?>
MSLP (mb) |
= 1035){
echo "" . $MSLP_MB[$j] . ' | ';
}
elseif($MSLP_MB[$j] >= 1020){
echo "" . $MSLP_MB[$j] . ' | ';
}
elseif ($MSLP_MB[$j] < 990){
echo "" . $MSLP_MB[$j] . ' | ';
}
elseif ($MSLP_MB[$j] < 1000){
echo "" . $MSLP_MB[$j] . ' | ';
}
else
echo "" . $MSLP_MB[$j] . ' | ';
}
?>
Visibility (mi) |
= 7.01){
echo "" . $VSBY[$j] . ' | ';
}
elseif ($VSBY[$j] >= 5.01){
echo "" . $VSBY[$j] . ' | ';
}
elseif ($VSBY[$j] >=3){
echo "" . $VSBY[$j] . ' | ';
}
elseif ($VSBY[$j] >=1){
echo "" . $VSBY[$j] . ' | ';
}
elseif ($VSBY[$j] >=0.50){
echo "" . $VSBY[$j] . ' | ';
}
elseif ($VSBY[$j] >=0.01){
echo "" . $VSBY[$j] . ' | ';
}
else
echo "" . $VSBY[$j] . ' | ';
}
?>
|
" . $REPORT_DAY_WEEK[$j] . '';
}
?>
Date |
" . $REPORT_DAY[$j] . '';
}
?>
" . $REPORT_TIME[$j] . ' | ';
}
?>
Precipitation and Clouds |
-----";
}
?>
Precip (in) |
= 0.3){
echo "" . $PCPN_HR[$j] . ' | ';
}
elseif ($PCPN_HR[$j] >= 0.2){
echo "" . $PCPN_HR[$j] . ' | ';
}
elseif ($PCPN_HR[$j] >= 0.1){
echo "" . $PCPN_HR[$j] . ' | ';
}
elseif ($PCPN_HR[$j] >= 0.05){
echo "" . $PCPN_HR[$j] . ' | ';
}
elseif ($PCPN_HR[$j] >= 0.01){
echo "" . $PCPN_HR[$j] . ' | ';
}
else
echo "" . $PCPN_HR[$j] . ' | ';
}
?>
Run Total Precip (in) |
= 2){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 1){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 0.75){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 0.5){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 0.25){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 0.1){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 0.05){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 0.01){
echo "" . $PCPN_TOT[$j] . ' | ';
}
else
echo "" . $PCPN_TOT[$j] . ' | ';
}
?>
Model P-Type |
SN";
elseif ($WXPL[$j] == 1){
echo "PL | ";
}
elseif ($WXZR[$j] == 1){
echo "ZR | ";
}
elseif ($WXRA[$j] == 1){
echo "RA | ";
}
else
echo "N/A | ";
}
?>
1hr Snowfall (in) |
= 2)
echo "" . $SN1HR[$j] . ' | ';
elseif ($SN1HR[$j] >= 1){
echo "" . $SN1HR[$j] . ' | ';
}
elseif ($SN1HR[$j] >= 0.5){
echo "" . $SN1HR[$j] . ' | ';
}
elseif ($SN1HR[$j] >= 0.3){
echo "" . $SN1HR[$j] . ' | ';
}
elseif ($SN1HR[$j] >= 0.1){
echo "" . $SN1HR[$j] . ' | ';
}
else
echo "" . $SN1HR[$j] . ' | ';
}
?>
Run Total Snowfall (in) |
= 24)
echo "" . $SN_TOT[$j] . ' | ';
elseif ($SN_TOT[$j] >= 18){
echo "" . $SN_TOT[$j] . ' | ';
}
elseif ($SN_TOT[$j] >= 12){
echo "" . $SN_TOT[$j] . ' | ';
}
elseif ($SN_TOT[$j] >= 8){
echo "" . $SN_TOT[$j] . ' | ';
}
elseif ($SN_TOT[$j] >= 6){
echo "" . $SN_TOT[$j] . ' | ';
}
elseif ($SN_TOT[$j] >= 4){
echo "" . $SN_TOT[$j] . ' | ';
}
elseif ($SN_TOT[$j] >= 3){
echo "" . $SN_TOT[$j] . ' | ';
}
elseif ($SN_TOT[$j] >= 2){
echo "" . $SN_TOT[$j] . ' | ';
}
elseif ($SN_TOT[$j] >= 1){
echo "" . $SN_TOT[$j] . ' | ';
}
elseif ($SN_TOT[$j] >= 0.1){
echo "" . $SN_TOT[$j] . ' | ';
}
else
echo "" . $SN_TOT[$j] . ' | ';
}
?>
Low Cloud (%) |
= 90){
echo "" . $LCLD[$j] . ' | ';
}
elseif ($LCLD[$j] >= 80){
echo "" . $LCLD[$j] . ' | ';
}
elseif ($LCLD[$j] >= 60){
echo "" . $LCLD[$j] . ' | ';
}
elseif ($LCLD[$j] >=40){
echo "" . $LCLD[$j] . ' | ';
}
elseif ($LCLD[$j] >=20){
echo "" . $LCLD[$j] . ' | ';
}
elseif ($LCLD[$j] == -9999){
echo "MM | ";
}
else
echo "" . $LCLD[$j] . ' | ';
}
?>
Medium Cloud (%) |
= 90){
echo "" . $MCLD[$j] . ' | ';
}
elseif ($MCLD[$j] >= 80){
echo "" . $MCLD[$j] . ' | ';
}
elseif ($MCLD[$j] >= 60){
echo "" . $MCLD[$j] . ' | ';
}
elseif ($MCLD[$j] >=40){
echo "" . $MCLD[$j] . ' | ';
}
elseif ($MCLD[$j] >=20){
echo "" . $MCLD[$j] . ' | ';
}
elseif ($MCLD[$j] == -9999){
echo "MM | ";
}
else
echo "" . $MCLD[$j] . ' | ';
}
?>
High Cloud (%) |
= 90){
echo "" . $HCLD[$j] . ' | ';
}
elseif ($HCLD[$j] >= 80){
echo "" . $HCLD[$j] . ' | ';
}
elseif ($HCLD[$j] >= 60){
echo "" . $HCLD[$j] . ' | ';
}
elseif ($HCLD[$j] >=40){
echo "" . $HCLD[$j] . ' | ';
}
elseif ($HCLD[$j] >=20){
echo "" . $HCLD[$j] . ' | ';
}
elseif ($HCLD[$j] == -9999){
echo "MM | ";
}
else
echo "" . $HCLD[$j] . ' | ';
}
?>
PRECIP WATER (in) |
= 2.00){
echo "" . $PWAT[$j] . ' | ';
}
elseif ($PWAT[$j] >= 1.5){
echo "" . $PWAT[$j] . ' | ';
}
elseif ($PWAT[$j] >= 1.25){
echo "" . $PWAT[$j] . ' | ';
}
elseif ($PWAT[$j] >= 1.00){
echo "" . $PWAT[$j] . ' | ';
}
elseif ($PWAT[$j] >= 0.75){
echo "" . $PWAT[$j] . ' | ';
}
elseif ($PWAT[$j] <= 0.25){
echo "" . $PWAT[$j] . ' | ';
}
elseif ($PWAT[$j] <= 0.50){
echo "" . $PWAT[$j] . ' | ';
}
else
echo "" . $PWAT[$j] . ' | ';
}
?>
|
" . $REPORT_DAY_WEEK[$j] . '';
}
?>
Date |
" . $REPORT_DAY[$j] . '';
}
?>
";
for($j=0;$j<$num_entries;$j++){
echo " | " . $REPORT_TIME[$j] . ' | ';
}
?>
Winter Weather Data |
-----";
}
?>
Snow Probability (%) |
" . $SNRATIO[$j] . '';
}
?>
1000-500mb Thickness |
= 5410){
echo "" . $MB1000_MB500_THICK[$j] . ' | ';
}
elseif ($MB1000_MB500_THICK[$j] >= 5390){
echo "" . $MB1000_MB500_THICK[$j] . ' | ';
}
else
echo "" . $MB1000_MB500_THICK[$j] . ' | ';
}
?>
1000-850mb Thickness |
= 1310){
echo "" . $MB1000_MB850_THICK[$j] . ' | ';
}
elseif ($MB1000_MB850_THICK[$j] >= 1300){
echo "" . $MB1000_MB850_THICK[$j] . ' | ';
}
else
echo "" . $MB1000_MB850_THICK[$j] . ' | ';
}
?>
1000-700mb Thickness |
= 2860){
echo "" . $MB1000_MB700_THICK[$j] . ' | ';
}
elseif ($MB1000_MB700_THICK[$j] >= 2840){
echo "" . $MB1000_MB700_THICK[$j] . ' | ';
}
elseif ($MB1000_MB700_THICK[$j] >= 2820){
echo "" . $MB1000_MB700_THICK[$j] . ' | ';
}
else
echo "" . $MB1000_MB700_THICK[$j] . ' | ';
}
?>
850-700mb Thickness |
= 1555){
echo "" . $MB850_MB700_THICK[$j] . ' | ';
}
elseif ($MB850_MB700_THICK[$j] >= 1540){
echo "" . $MB850_MB700_THICK[$j] . ' | ';
}
elseif ($MB850_MB700_THICK[$j] >= 1530){
echo "" . $MB850_MB700_THICK[$j] . ' | ';
}
else
echo "" . $MB850_MB700_THICK[$j] . ' | ';
}
?>
WBZ (Ft) |
= 1500)
echo "" . $WBZ[$j] . ' | ';
elseif ($WBZ[$j] >= 1200){
echo "" . $WBZ[$j] . ' | ';
}
elseif ($WBZ[$j] >= 1000){
echo "" . $WBZ[$j] . ' | ';
}
elseif ($WBZ[$j] >= 700){
echo "" . $WBZ[$j] . ' | ';
}
else
echo "" . $WBZ[$j] . ' | ';
}
?>
Top Down Temps |
-----";
}
?>
MaxTwAloft (C) |
= 3.25)
echo "" . $MAXTWALOFT[$j] . ' | ';
elseif ($MAXTWALOFT[$j] >= 1.5){
echo "" . $MAXTWALOFT[$j] . ' | ';
}
elseif ($MAXTWALOFT[$j] >= 0.7){
echo "" . $MAXTWALOFT[$j] . ' | ';
}
elseif ($MAXTWALOFT[$j] >= 0.1){
echo "" . $MAXTWALOFT[$j] . ' | ';
}
else
echo "" . $MAXTWALOFT[$j] . ' | ';
}
?>
MaxTAloft (C) |
= 3.25)
echo "" . $MAXTALOFT[$j] . ' | ';
elseif ($MAXTALOFT[$j] >= 1.5){
echo "" . $MAXTALOFT[$j] . ' | ';
}
elseif ($MAXTALOFT[$j] >= 0.7){
echo "" . $MAXTALOFT[$j] . ' | ';
}
elseif ($MAXTALOFT[$j] >= 0.1){
echo "" . $MAXTALOFT[$j] . ' | ';
}
else
echo "" . $MAXTALOFT[$j] . ' | ';
}
?>
700mb T (C) |
= 3)
echo "" . $MB700_TEMP[$j] . ' | ';
elseif ($MB700_TEMP[$j] >= 1.5){
echo "" . $MB700_TEMP[$j] . ' | ';
}
elseif ($MB700_TEMP[$j] >= 0.7){
echo "" . $MB700_TEMP[$j] . ' | ';
}
elseif ($MB700_TEMP[$j] >= 0.1){
echo "" . $MB700_TEMP[$j] . ' | ';
}
else
echo "" . $MB700_TEMP[$j] . ' | ';
}
?>
850mb T (C) |
= 3)
echo "" . $MB850_TEMP[$j] . ' | ';
elseif ($MB850_TEMP[$j] >= 1.5){
echo "" . $MB850_TEMP[$j] . ' | ';
}
elseif ($MB850_TEMP[$j] >= 0.7){
echo "" . $MB850_TEMP[$j] . ' | ';
}
elseif ($MB850_TEMP[$j] >= 0.1){
echo "" . $MB850_TEMP[$j] . ' | ';
}
else
echo "" . $MB850_TEMP[$j] . ' | ';
}
?>
925mb T (C) |
= 3)
echo "" . $MB925_TEMP[$j] . ' | ';
elseif ($MB925_TEMP[$j] >= 1.5){
echo "" . $MB925_TEMP[$j] . ' | ';
}
elseif ($MB925_TEMP[$j] >= 0.7){
echo "" . $MB925_TEMP[$j] . ' | ';
}
elseif ($MB925_TEMP[$j] >= 0.1){
echo "" . $MB925_TEMP[$j] . ' | ';
}
else
echo "" . $MB925_TEMP[$j] . ' | ';
}
?>
2m Temp (F) |
= 90){
echo "" . $SURF_T[$j] . ' | ';
}
elseif ($SURF_T[$j] >= 80){
echo "" . $SURF_T[$j] . ' | ';
}
elseif ($SURF_T[$j] >= 70){
echo "" . $SURF_T[$j] . ' | ';
}
elseif ($SURF_T[$j] >= 40){
echo "" . $SURF_T[$j] . ' | ';
}
elseif ($SURF_T[$j] >= 33){
echo "" . $SURF_T[$j] . ' | ';
}
elseif ($SURF_T[$j] >= 28){
echo "" . $SURF_T[$j] . ' | ';
}
elseif ($SURF_T[$j] > 0){
echo "" . $SURF_T[$j] . ' | ';
}
else
echo "" . $SURF_T[$j] . ' | ';
}
?>
Precip (in) |
= 0.3){
echo "" . $PCPN_HR[$j] . ' | ';
}
elseif ($PCPN_HR[$j] >= 0.2){
echo "" . $PCPN_HR[$j] . ' | ';
}
elseif ($PCPN_HR[$j] >= 0.1){
echo "" . $PCPN_HR[$j] . ' | ';
}
elseif ($PCPN_HR[$j] >= 0.05){
echo "" . $PCPN_HR[$j] . ' | ';
}
elseif ($PCPN_HR[$j] >= 0.01){
echo "" . $PCPN_HR[$j] . ' | ';
}
else
echo "" . $PCPN_HR[$j] . ' | ';
}
?>
Run Total Precip (in) |
= 2){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 1){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 0.75){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 0.5){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 0.25){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 0.1){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 0.05){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 0.01){
echo "" . $PCPN_TOT[$j] . ' | ';
}
else
echo "" . $PCPN_TOT[$j] . ' | ';
}
?>
Model P-Type |
SN";
elseif ($WXPL[$j] == 1){
echo "PL | ";
}
elseif ($WXZR[$j] == 1){
echo "ZR | ";
}
elseif ($WXRA[$j] == 1){
echo "RA | ";
}
else
echo " | ";
}
?>
|
" . $REPORT_DAY_WEEK[$j] . '';
}
?>
Date |
" . $REPORT_DAY[$j] . '';
}
?>
";
for($j=0;$j<$num_entries;$j++){
echo " | " . $REPORT_TIME[$j] . ' | ';
}
?>
Upper Air Data |
-----";
}
?>
Temps |
-----";
}
?>
500mb T (C) |
" . $MB500_TEMP[$j] . '';
}
?>
700mb T (C) |
= 14)
echo "" . $MB700_TEMP[$j] . ' | ';
elseif ($MB700_TEMP[$j] >= 10){
echo "" . $MB700_TEMP[$j] . ' | ';
}
else
echo "" . $MB700_TEMP[$j] . ' | ';
}
?>
850mb T (C) |
= 30)
echo "" . $MB850_TEMP[$j] . ' | ';
elseif ($MB850_TEMP[$j] >= 25){
echo "" . $MB850_TEMP[$j] . ' | ';
}
elseif ($MB850_TEMP[$j] >= 20){
echo "" . $MB850_TEMP[$j] . ' | ';
}
elseif ($MB850_TEMP[$j] >= 10){
echo "" . $MB850_TEMP[$j] . ' | ';
}
elseif ($MB850_TEMP[$j] >= 5){
echo "" . $MB850_TEMP[$j] . ' | ';
}
elseif ($MB850_TEMP[$j] >= 0){
echo "" . $MB850_TEMP[$j] . ' | ';
}
elseif ($MB850_TEMP[$j] >= -5){
echo "" . $MB850_TEMP[$j] . ' | ';
}
elseif ($MB850_TEMP[$j] >= -10){
echo "" . $MB850_TEMP[$j] . ' | ';
}
elseif ($MB850_TEMP[$j] >= -20){
echo "" . $MB850_TEMP[$j] . ' | ';
}
else
echo "" . $MB850_TEMP[$j] . ' | ';
}
?>
925mb T (C) |
= 30)
echo "" . $MB925_TEMP[$j] . ' | ';
elseif ($MB925_TEMP[$j] >= 25){
echo "" . $MB925_TEMP[$j] . ' | ';
}
elseif ($MB925_TEMP[$j] >= 20){
echo "" . $MB925_TEMP[$j] . ' | ';
}
elseif ($MB925_TEMP[$j] >= 10){
echo "" . $MB925_TEMP[$j] . ' | ';
}
elseif ($MB925_TEMP[$j] >= 5){
echo "" . $MB925_TEMP[$j] . ' | ';
}
elseif ($MB925_TEMP[$j] >= 0){
echo "" . $MB925_TEMP[$j] . ' | ';
}
elseif ($MB925_TEMP[$j] >= -5){
echo "" . $MB925_TEMP[$j] . ' | ';
}
elseif ($MB925_TEMP[$j] >= -10){
echo "" . $MB925_TEMP[$j] . ' | ';
}
elseif ($MB925_TEMP[$j] >= -20){
echo "" . $MB925_TEMP[$j] . ' | ';
}
else
echo "" . $MB925_TEMP[$j] . ' | ';
}
?>
Lapse Rates |
-----";
}
?>
700-500MB LR (C/KM) |
= 8){
echo "" . $MB700_MB500_LR[$j] . ' | ';
}
elseif ($MB700_MB500_LR[$j] >= 7){
echo "" . $MB700_MB500_LR[$j] . ' | ';
}
elseif ($MB700_MB500_LR[$j] >= 6){
echo "" . $MB700_MB500_LR[$j] . ' | ';
}
else
echo "" . $MB700_MB500_LR[$j] . ' | ';
}
?>
850-700MB LR (C/KM) |
= 8){
echo "" . $MB850_MB700_LR[$j] . ' | ';
}
elseif ($MB850_MB700_LR[$j] >= 7){
echo "" . $MB850_MB700_LR[$j] . ' | ';
}
elseif ($MB850_MB700_LR[$j] >= 6){
echo "" . $MB850_MB700_LR[$j] . ' | ';
}
else
echo "" . $MB850_MB700_LR[$j] . ' | ';
}
?>
SFC-850MB LR (C/KM) |
= 8){
echo "" . $SFC_MB850_LR[$j] . ' | ';
}
elseif ($SFC_MB850_LR[$j] >= 7){
echo "" . $SFC_MB850_LR[$j] . ' | ';
}
elseif ($SFC_MB850_LR[$j] >= 6){
echo "" . $SFC_MB850_LR[$j] . ' | ';
}
else
echo "" . $SFC_MB850_LR[$j] . ' | ';
}
?>
SFC-925MB LR (C/KM) |
= 8){
echo "" . $SFC_MB925_LR[$j] . ' | ';
}
elseif ($SFC_MB925_LR[$j] >= 7){
echo "" . $SFC_MB925_LR[$j] . ' | ';
}
elseif ($SFC_MB925_LR[$j] >= 6){
echo "" . $SFC_MB925_LR[$j] . ' | ';
}
else
echo "" . $SFC_MB925_LR[$j] . ' | ';
}
?>
Winds |
-----";
}
?>
250MB Wind (kts) |
500MB Wind (kts) |
700MB Wind (kts) |
850MB Wind (kts) |
925MB Wind (kts) |
|
" . $REPORT_DAY_WEEK[$j] . '';
}
?>
Date |
" . $REPORT_DAY[$j] . '';
}
?>
";
for($j=0;$j<$num_entries;$j++){
echo " | " . $REPORT_TIME[$j] . ' | ';
}
?>
Severe Weather Data (General) |
-----";
}
?>
General Thunderstorm |
-----";
}
?>
Upward Vert Vel (m/s) |
= 81){
echo "" . $UVV[$j] . ' | ';
}
elseif ($UVV[$j] >= 61){
echo "" . $UVV[$j] . ' | ';
}
elseif ($UVV[$j] >=41){
echo "" . $UVV[$j] . ' | ';
}
elseif ($UVV[$j] >=10){
echo "" . $UVV[$j] . ' | ';
}
else
echo "" . $UVV[$j] . ' | ';
}
?>
CAPE (J/Kg) |
=4000){
echo "" . $CAPE[$j] . ' | ';
}
elseif ($CAPE[$j] >= 3500){
echo "" . $CAPE[$j] . ' | ';
}
elseif ($CAPE[$j] >= 3000){
echo "" . $CAPE[$j] . ' | ';
}
elseif ($CAPE[$j] >= 2500){
echo "" . $CAPE[$j] . ' | ';
}
elseif ($CAPE[$j] >= 2000){
echo "" . $CAPE[$j] . ' | ';
}
elseif ($CAPE[$j] >= 1500){
echo "" . $CAPE[$j] . ' | ';
}
elseif ($CAPE[$j] >= 1000){
echo "" . $CAPE[$j] . ' | ';
}
elseif ($CAPE[$j] >= 750){
echo "" . $CAPE[$j] . ' | ';
}
elseif ($CAPE[$j] >= 500){
echo "" . $CAPE[$j] . ' | ';
}
elseif ($CAPE[$j] >= 250){
echo "" . $CAPE[$j] . ' | ';
}
elseif ($CAPE[$j] >= 100){
echo "" . $CAPE[$j] . ' | ';
}
else
echo "" . $CAPE[$j] . ' | ';
}
?>
NCAPE (J/Kg) |
= .30){
echo "" . $NCAPE[$j] . ' | ';
}
elseif ($NCAPE[$j] >= .20){
echo "" . $NCAPE[$j] . ' | ';
}
elseif ($NCAPE[$j] >= .10){
echo "" . $NCAPE[$j] . ' | ';
}
elseif ($NCAPE[$j] >= .05){
echo "" . $NCAPE[$j] . ' | ';
}
else
echo "" . $NCAPE[$j] . ' | ';
}
?>
CIN (J/Kg) |
" . $CINS[$j] . '';
}
elseif ($CINS[$j] <= -50){
echo "" . $CINS[$j] . ' | ';
}
elseif ($CINS[$j] <= -0.01){
echo "" . $CINS[$j] . ' | ';
}
else
echo "" . $CINS[$j] . ' | ';
}
?>
Lid Strength (C) |
= 1) and ($LID[$j] <= 3))
echo "" . $LID[$j] . ' | ';
elseif ($LID[$j] > 6){
echo "" . $LID[$j] . ' | ';
}
elseif ($LID[$j] > 3){
echo "" . $LID[$j] . ' | ';
}
else
echo "" . $LID[$j] . ' | ';
}
?>
Storm Motion (kts) |
SHOWALTER Index |
5){
echo "" . $SHO[$j] . ' | ';
}
elseif ($SHO[$j] >= 2){
echo "" . $SHO[$j] . ' | ';
}
elseif ($SHO[$j] >= 0){
echo "" . $SHO[$j] . ' | ';
}
elseif ($SHO[$j] >= -3.5){
echo "" . $SHO[$j] . ' | ';
}
elseif ($SHO[$j] >=-6.5){
echo "" . $SHO[$j] . ' | ';
}
elseif ($SHO[$j] >-9999){
echo "" . $SHO[$j] . ' | ';
}
else
echo "" . $SHO[$j] . ' | ';
}
?>
Lifted Index |
6){
echo "" . $LI[$j] . ' | ';
}
elseif ($LI[$j] >= 3){
echo "" . $LI[$j] . ' | ';
}
elseif ($LI[$j] >= 1){
echo "" . $LI[$j] . ' | ';
}
elseif ($LI[$j] >=0){
echo "" . $LI[$j] . ' | ';
}
elseif ($LI[$j] >=-4){
echo "" . $LI[$j] . ' | ';
}
elseif ($LI[$j] >=-7){
echo "" . $LI[$j] . ' | ';
}
elseif ($LI[$j] >-9999){
echo "" . $LI[$j] . ' | ';
}
else {
echo "" . $LI[$j] . ' | ';
}
}
?>
SWEAT Index |
800){
echo "" . $SWEAT[$j] . ' | ';
}
elseif ($SWEAT[$j]>= 600){
echo "" . $SWEAT[$j] . ' | ';
}
elseif ($SWEAT[$j]>=500){
echo "" . $SWEAT[$j] . ' | ';
}
elseif ($SWEAT[$j]>=400){
echo "" . $SWEAT[$j] . ' | ';
}
elseif ($SWEAT[$j]>=300){
echo "" . $SWEAT[$j] . ' | ';
}
elseif ($SWEAT[$j]>=150){
echo "" . $SWEAT[$j] . ' | ';
}
elseif ($SWEAT[$j]>-9999){
echo "" . $SWEAT[$j] . ' | ';
}
else
echo "" . $SWEAT[$j] . ' | ';
}
?>
K Index |
=40){
echo "" . $KIndex[$j] . ' | ';
}
elseif ($KIndex[$j] >= 26){
echo "" . $KIndex[$j] . ' | ';
}
elseif ($KIndex[$j] >=15){
echo "" . $KIndex[$j] . ' | ';
}
else
echo "" . $KIndex[$j] . ' | ';
}
?>
Total Totals (TT) |
55){
echo "" . $TTI[$j] . ' | ';
}
elseif ($TTI[$j] >=53){
echo "" . $TTI[$j] . ' | ';
}
elseif ($TTI[$j] >=50){
echo "" . $TTI[$j] . ' | ';
}
elseif ($TTI[$j] >=45){
echo "" . $TTI[$j] . ' | ';
}
elseif ($TTI[$j] >=40){
echo "" . $TTI[$j] . ' | ';
}
elseif ($TTI[$j] >-9999){
echo "" . $TTI[$j] . ' | ';
}
else
echo "" . $TTI[$j] . ' | ';
}
?>
6 KM Shear (Kts) |
=60){
echo "" . $SHEAR6KM[$j] . ' | ';
}
elseif ($SHEAR6KM[$j] >= 50){
echo "" . $SHEAR6KM[$j] . ' | ';
}
elseif ($SHEAR6KM[$j] >= 30){
echo "" . $SHEAR6KM[$j] . ' | ';
}
elseif ($SHEAR6KM[$j] >=15){
echo "" . $SHEAR6KM[$j] . ' | ';
}
else
echo "" . $SHEAR6KM[$j] . ' | ';
}
?>
BULK RICHARDSON |
500){
if ($BRCH[$j] >=45){
echo "" . $BRCH[$j] . ' | ';
}
elseif ($BRCH[$j] >20){
echo "" . $BRCH[$j] . ' | ';
}
elseif ($BRCH[$j] >10){
echo "" . $BRCH[$j] . ' | ';
}
else {
echo "" . $BRCH[$j] . ' | ';
}
} // CAPE
else
echo "--- | ";
}
?>
EQ LEVEL (Ft) |
" . $EL[$j] . '';
}
?>
CRAVEN SIG SEVERE |
20)
echo "" . $CravenSig[$j] . ' | ';
elseif ($CravenSig[$j] >= 9){
echo "" . $CravenSig[$j] . ' | ';
}
else
echo "" . $CravenSig[$j] . ' | ';
}
?>
Supercell Comp (SCP) |
= 10){
echo "" . $SCP[$j] . ' | ';
}
elseif (abs($SCP[$j])>=5.7){
echo "" . $SCP[$j] . ' | ';
}
elseif (abs($SCP[$j])>=3.2){
echo "" . $SCP[$j] . ' | ';
}
elseif (abs($SCP[$j])>=1.2){
echo "" . $SCP[$j] . ' | ';
}
elseif (abs($SCP[$j])>-9999){
echo "" . $SCP[$j] . ' | ';
}
else
echo "" . $SCP[$j] . ' | ';
}
?>
Severe Parms (TOR/Wind/Hail) |
-----";
}
?>
Tornado Parameters |
-----";
}
?>
1 KM Shear (Kts) |
= 30){
echo "" . $SHEAR1KM[$j] . ' | ';
}
elseif ($SHEAR1KM[$j] >= 20){
echo "" . $SHEAR1KM[$j] . ' | ';
}
elseif ($SHEAR1KM[$j] >= 15){
echo "" . $SHEAR1KM[$j] . ' | ';
}
elseif ($SHEAR1KM[$j] >= 10){
echo "" . $SHEAR1KM[$j] . ' | ';
}
else
echo "" . $SHEAR1KM[$j] . ' | ';
}
?>
BRN Shear (m/s) |
500){
if ($BRCHSHEAR[$j] >=40){
echo "" . $BRCHSHEAR[$j] . ' | ';
}
elseif ($BRCHSHEAR[$j] >35){
echo "" . $BRCHSHEAR[$j] . ' | ';
}
elseif ($BRCHSHEAR[$j] >20){
echo "" . $BRCHSHEAR[$j] . ' | ';
}
else {
echo "" . $BRCHSHEAR[$j] . ' | ';
}
} // CAPE
else
echo "--- | ";
} //for
?>
SRH ( 0 - 1Km) (m/s) |
400){
echo "" . $HLCY1K[$j] . ' | ';
}
elseif ($HLCY1K[$j] >= 300){
echo "" . $HLCY1K[$j] . ' | ';
}
elseif ($HLCY1K[$j] >=150){
echo "" . $HLCY1K[$j] . ' | ';
}
elseif ($HLCY1K[$j] >=100){
echo "" . $HLCY1K[$j] . ' | ';
}
elseif ($HLCY1K[$j] >-9999){
echo "" . $HLCY1K[$j] . ' | ';
}
else
echo "" . $HLCY1K[$j] . ' | ';
}
?>
SRH ( 0 - 3Km) (m/s) |
400){
echo "" . $SRH[$j] . ' | ';
}
elseif ($SRH[$j] >= 250){
echo "" . $SRH[$j] . ' | ';
}
elseif ($SRH[$j] >=150){
echo "" . $SRH[$j] . ' | ';
}
elseif ($SRH[$j] >=100){
echo "" . $SRH[$j] . ' | ';
}
elseif ($SRH[$j] >-9999){
echo "" . $SRH[$j] . ' | ';
}
else
echo "" . $SRH[$j] . ' | ';
}
?>
Energy Helicity (EHI) |
5){
echo "" . $EHI[$j] . ' | ';
}
elseif ($EHI[$j] >= 2){
echo "" . $EHI[$j] . ' | ';
}
elseif ($EHI[$j] >=1){
echo "" . $EHI[$j] . ' | ';
}
elseif ($EHI[$j] >=0.5){
echo "" . $EHI[$j] . ' | ';
}
elseif ($EHI[$j] >-9999){
echo "" . $EHI[$j] . ' | ';
}
else
echo "" . $EHI[$j] . ' | ';
}
?>
Sig Tornado (STP) |
= 1.8)
echo "" . $STP[$j] . ' | ';
elseif ($STP[$j] >= 0.5){
echo "" . $STP[$j] . ' | ';
}
elseif ($STP[$j] >= 0.1){
echo "" . $STP[$j] . ' | ';
}
else
echo "" . $STP[$j] . ' | ';
}
?>
SHERBS3 |
= 1){
echo "" . $SHERBS3[$j] . ' | ';
}
elseif ($SHERBS3[$j] >= 0.5){
echo "" . $SHERBS3[$j] . ' | ';
}
else
echo "" . $SHERBS3[$j] . ' | ';
}
?>
LFC (Ft) |
= 9800)
echo "" . $LFCT[$j] . ' | ';
elseif ($LFCT[$j] >= 8200){
echo "" . $LFCT[$j] . ' | ';
}
elseif ($LFCT[$j] >= 6550){
echo "" . $LFCT[$j] . ' | ';
}
elseif ($LFCT[$j] == "---"){
echo "" . $LFCT[$j] . ' | ';
}
else
echo "" . $LFCT[$j] . ' | ';
}
?>
LCL Height (m) |
45){
if(round($LCL[$j]/3.28,0) >= 1200)
echo "" . round($LCL[$j]/3.28,0) . ' | ';
elseif (round($LCL[$j]/3.28,0) >= 1000){
echo "" . round($LCL[$j]/3.28,0) . ' | ';
}
elseif (round($LCL[$j]/3.28,0) >= 700){
echo "" . round($LCL[$j]/3.28,0) . ' | ';
}
else
echo "" . round($LCL[$j]/3.28,0) . ' | ';
} // CAPE
else
echo "" . round($LCL[$j]/3.28,0) . ' | ';
}
?>
LCL Pressure (mb) |
" . $LCLP[$j] . '';
}
?>
LCL Temp (C) |
" . $LCLT[$j] . '';
}
?>
Damaging Wind & Hail Parms |
-----";
}
?>
0C Height (kft) |
" . $HEIGHT_0C[$j] . '';
}
?>
-20C Height (kft) |
" . $HEIGHT_20C[$j] . '';
}
?>
50dBZ Height (kft) |
" . $HEIGHT_50DBZ[$j] . '';
}
?>
WBZ (Ft) |
= 12000)
echo "" . $WBZ[$j] . ' | ';
elseif ($WBZ[$j] >= 11000){
echo "" . $WBZ[$j] . ' | ';
}
elseif ($WBZ[$j] >= 9000){
echo "" . $WBZ[$j] . ' | ';
}
elseif ($WBZ[$j] >= 8000){
echo "" . $WBZ[$j] . ' | ';
}
else
echo "" . $WBZ[$j] . ' | ';
}
?>
3KM Shear (Kts) |
= 40){
echo "" . $SHEAR3KM[$j] . ' | ';
}
elseif ($SHEAR3KM[$j] >= 30){
echo "" . $SHEAR3KM[$j] . ' | ';
}
elseif ($SHEAR3KM[$j] >= 15){
echo "" . $SHEAR3KM[$j] . ' | ';
}
else
echo "" . $SHEAR3KM[$j] . ' | ';
}
?>
|
" . $REPORT_DAY_WEEK[$j] . '';
}
?>
Date |
" . $REPORT_DAY[$j] . '';
}
?>
";
for($j=0;$j<$num_entries;$j++){
echo " | " . $REPORT_TIME[$j] . ' | ';
}
?>
Fire Weather Data |
-----";
}
?>
|
" . $REPORT_DAY_WEEK[$j] . '';
}
?>
Date |
" . $REPORT_DAY[$j] . '';
}
?>
";
for($j=0;$j<$num_entries;$j++){
echo " | " . $REPORT_TIME[$j] . ' | ';
}
?>
2m Temp (F) |
= 90){
echo "" . $SURF_T[$j] . ' | ';
}
elseif ($SURF_T[$j] >= 80){
echo "" . $SURF_T[$j] . ' | ';
}
elseif ($SURF_T[$j] >= 70){
echo "" . $SURF_T[$j] . ' | ';
}
elseif ($SURF_T[$j] >= 40){
echo "" . $SURF_T[$j] . ' | ';
}
elseif ($SURF_T[$j] >= 33){
echo "" . $SURF_T[$j] . ' | ';
}
elseif ($SURF_T[$j] >= 28){
echo "" . $SURF_T[$j] . ' | ';
}
elseif ($SURF_T[$j] > 0){
echo "" . $SURF_T[$j] . ' | ';
}
else
echo "" . $SURF_T[$j] . ' | ';
}
?>
2m Dewpoint (F) |
= 70){
echo "" . $SURF_TD[$j] . ' | ';
}
elseif ($SURF_TD[$j] >= 60){
echo "" . $SURF_TD[$j] . ' | ';
}
elseif ($SURF_TD[$j] >= 50){
echo "" . $SURF_TD[$j] . ' | ';
}
else
echo "" . $SURF_TD[$j] . ' | ';
}
?>
ML Dewpoint (F) |
= 70){
echo "" . $ML_TDC[$j] . ' | ';
}
elseif ($ML_TDC[$j] >= 60){
echo "" . $ML_TDC[$j] . ' | ';
}
elseif ($ML_TDC[$j] >= 50){
echo "" . $ML_TDC[$j] . ' | ';
}
else
echo "" . $ML_TDC[$j] . ' | ';
}
?>
2m RH (%) |
= 95){
echo "" . $SURF_RH[$j] . ' | ';
}
elseif ($SURF_RH[$j] >= 90){
echo "" . $SURF_RH[$j] . ' | ';
}
elseif ($SURF_RH[$j] >= 75){
echo "" . $SURF_RH[$j] . ' | ';
}
elseif ($SURF_RH[$j] <= 25){
echo "" . $SURF_RH[$j] . ' | ';
}
elseif ($SURF_RH[$j] <= 40){
echo "" . $SURF_RH[$j] . ' | ';
}
else
echo "" . $SURF_RH[$j] . ' | ';
}
?>
ML RH (%) |
= 95){
echo "" . $ML_RH . ' | ';
}
elseif ($ML_RH >= 90){
echo "" . $ML_RH. ' | ';
}
elseif ($ML_RH >= 75){
echo "" . $ML_RH . ' | ';
}
elseif ($ML_RH <= 25){
echo "" . $ML_RH . ' | ';
}
elseif ($ML_RH <= 40){
echo "" . $ML_RH . ' | ';
}
else
echo "" . $ML_RH . ' | ';
}
?>
10m Wind Dir/Spd (kts) |
= 349 and $TEN_M_direction[$j] <= 360){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] >= 0 and $TEN_M_direction[$j] <= 11){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 11 and $TEN_M_direction[$j] <= 34){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 34 and $TEN_M_direction[$j] <= 56){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 56 and $TEN_M_direction[$j] <= 78){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 78 and $TEN_M_direction[$j] <= 101){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 101 and $TEN_M_direction[$j] <= 124){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 124 and $TEN_M_direction[$j] <= 146){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 146 and $TEN_M_direction[$j] <= 169){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 169 and $TEN_M_direction[$j] <= 191){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 191 and $TEN_M_direction[$j] <= 214){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 214 and $TEN_M_direction[$j] <= 236){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 236 and $TEN_M_direction[$j] <= 259){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 259 and $TEN_M_direction[$j] <= 281){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 281 and $TEN_M_direction[$j] <= 304){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 304 and $TEN_M_direction[$j] <= 326){
echo " " . $TEN_M_speed[$j] . ' | ';
}
elseif ($TEN_M_direction[$j] > 326 and $TEN_M_direction[$j] <= 349){
echo " " . $TEN_M_speed[$j] . ' | ';
}
else
echo "" . $TEN_M_direction[$j] . ' | ';
}
?>
Transport Wind (kts) |
Precip (in) |
= 0.3){
echo "" . $PCPN_HR[$j] . ' | ';
}
elseif ($PCPN_HR[$j] >= 0.2){
echo "" . $PCPN_HR[$j] . ' | ';
}
elseif ($PCPN_HR[$j] >= 0.1){
echo "" . $PCPN_HR[$j] . ' | ';
}
elseif ($PCPN_HR[$j] >= 0.05){
echo "" . $PCPN_HR[$j] . ' | ';
}
elseif ($PCPN_HR[$j] >= 0.01){
echo "" . $PCPN_HR[$j] . ' | ';
}
else
echo "" . $PCPN_HR[$j] . ' | ';
}
?>
Run Total Precip (in) |
= 2){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 1){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 0.75){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 0.5){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 0.25){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 0.1){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 0.05){
echo "" . $PCPN_TOT[$j] . ' | ';
}
elseif ($PCPN_TOT[$j] >= 0.01){
echo "" . $PCPN_TOT[$j] . ' | ';
}
else
echo "" . $PCPN_TOT[$j] . ' | ';
}
?>
Mixing Height (ft) |
" . $MIXHEIGHT[$j] . '';
}
?>
Haines Index - Low";
}
else {
echo "Haines Index - Low | ";
}
for($j=0;$j<$num_entries;$j++){
if($HAINES_LOW[$j]>6){
echo "" . $HAINES_LOW[$j] . ' | ';
}
elseif ($HAINES_LOW[$j]>= 5){
echo "" . $HAINES_LOW[$j] . ' | ';
}
elseif ($HAINES_LOW[$j]>=4){
echo "" . $HAINES_LOW[$j] . ' | ';
}
elseif ($HAINES_LOW[$j]>=3){
echo "" . $HAINES_LOW[$j] . ' | ';
}
else
echo "" . $HAINES_LOW[$j] . ' | ';
}
?>
= 305 || $STNELEV <= 914) {
echo "Haines Index - Mid | ";
}
else {
echo "Haines Index - Mid | ";
}
for($j=0;$j<$num_entries;$j++){
if($HAINES_MID[$j]>6){
echo "" . $HAINES_MID[$j] . ' | ';
}
elseif ($HAINES_MID[$j]>= 5){
echo "" . $HAINES_MID[$j] . ' | ';
}
elseif ($HAINES_MID[$j]>=4){
echo "" . $HAINES_MID[$j] . ' | ';
}
elseif ($HAINES_MID[$j]>=3){
echo "" . $HAINES_MID[$j] . ' | ';
}
else
echo "" . $HAINES_MID[$j] . ' | ';
}
?>
914){
echo "Haines Index - High | ";
}
else {
echo "Haines Index - High | ";
}
for($j=0;$j<$num_entries;$j++){
if($HAINES_HIGH[$j]>6){
echo "" . $HAINES_HIGH[$j] . ' | ';
}
elseif ($HAINES_HIGH[$j]>= 5){
echo "" . $HAINES_HIGH[$j] . ' | ';
}
elseif ($HAINES_HIGH[$j]>=4){
echo "" . $HAINES_HIGH[$j] . ' | ';
}
elseif ($HAINES_HIGH[$j]>=3){
echo "" . $HAINES_HIGH[$j] . ' | ';
}
else
echo "" . $HAINES_HIGH[$j] . ' | ';
}
?>
Vent Rate |
150000){
echo "" . $VENTRATE[$j] . ' | ';
}
elseif ($VENTRATE[$j] >= 100000){
echo "" . $VENTRATE[$j] . ' | ';
}
elseif ($VENTRATE[$j] >= 60000){
echo "" . $VENTRATE[$j] . ' | ';
}
elseif ($VENTRATE[$j] >= 40000){
echo "" . $VENTRATE[$j] . ' | ';
}
else
echo "" . $VENTRATE[$j] . ' | ';
}
?>
|
" . $REPORT_DAY_WEEK[$j] . '';
}
?>
Date |
" . $REPORT_DAY[$j] . '';
}
?>
";
for($j=0;$j<$num_entries;$j++){
echo " | " . $REPORT_TIME[$j] . ' | ';
}
?>
* Move Mouse Over Colored Cells For Further Details
Sites available for Model Data
Version 2.4 - Added MaxTwAloft and 0.5km Winds. Fixed some 0-1/3/6km shear calcs to use AGL. by Steven Fleegel
Original page based off Code from PHP Severe Script Developed By Jim Wyman
SOUTHERN MARYLAND WEATHER - www.somdweather.com