# TNET Services, Inc.
#
# Copyright: (c) 1992-2007 Copyright TNET Services, Inc.
############################################################################
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
############################################################################
# This document uses Tab 4 Settings
############################################################################
/**************************** Version 20210421 ****************************/
$viewSource = false;
if (isset($_REQUEST['sce']) && strtolower($_REQUEST['sce']) == 'view' ) {
//--self downloader --
$filenameReal = __FILE__;
$download_size = filesize($filenameReal);
header('Pragma: public');
header('Cache-Control: private');
header('Cache-Control: no-cache, must-revalidate');
header("Content-type: text/plain");
header("Accept-Ranges: bytes");
header("Content-Length: $download_size");
header('Connection: close');
readfile($filenameReal);
exit;
}
############################################################################
$standAlone = false; // false if we run in the template environment
if ( $standAlone ) { ?>
'.$TITLE.'';
}
############################################################################
//$script_tz = date_default_timezone_get(); // Debug Code
//echo '$script_tz = '.$script_tz.'
'; // Debug Code
date_default_timezone_set("America/New_York");
$day_hour = date("G"); // The current hour
$day_minute = date("i"); // The current minute
$day_mon = date("d");
$cur_mon = date("n"); // The current month
$last_mon = ($cur_mon==1)?12:$cur_mon-1; // Last month
$lastDayThisMo = date('t',strtotime('today')); // Last Day This Month
$lastDayNextMo = date('t',strtotime('next month')); // Last Day Next Month
/*********************** Find the Third Thursday ***************************/
// Find the third Thursday's day of month by adding 2 wks. to first Thursday
$firstthurs=strtotime("next thursday",mktime(0,0,0,$cur_mon,1));
$firstthurs_day_no=date('d',$firstthurs);
$firstthurs_day_no==8?$firstthurs_day_no=1:8; //strtotime() fails when first Thursday is day 1 of month
$firstthurs_day_no==1?($firstthurs-=(60*60*24*7)):$firstthurs; // Correct strtotime() error
$thirdthurs_day_no=date('d',$firstthurs+(60*60*24*14));// Compute third thursday rather than first, so add two weeks
/********************** End Find the Third Thursday *************************/
/******************* Compute The Correct '$ourNumber' ***********************/
// '$ourNumber' selects which map to use depending upon which is the latest using the calendar.
$ourNumber = 5; // Default is '5'
if ( (($day_mon==$thirdthurs_day_no && ($day_hour>8 || ($day_hour==8 && $day_minute>=30)) )
// Are we past 8:30 AM on the third Thursday of the month,
|| $day_mon>$thirdthurs_day_no)) { // or are we past the third Thursday?
$ourNumber = 4; // If so, use 4.
if ($day_mon == $lastDayThisMo && ($day_hour>16 || ($day_hour==15 && $day_minute>=30))){
$ourNumber = 5; // Switch to '5' on the last day of the month after 3:30pm Eastern
}
}
/* Debug Code *
echo '
$day_hour: '.$day_hour.', $day_minute: '.$day_minute.', $day_mon: '.$day_mon.', $cur_mon: '.$cur_mon.', $last_mon: '.$last_mon.'
'; // Debug Code
echo '
$lastDayThisMo: '.$lastDayThisMo.', $lastDayNextMo: '.$lastDayNextMo.', $firstthurs: '.$firstthurs.', $firstthurs_day_no: '.$firstthurs_day_no.', $thirdthurs_day_no: '.$thirdthurs_day_no.'
';
/* End Debug Code */
/********************* End Compute The Correct 'ourNumber' ******************/
/*************************** When is it a Wednesday? ************************/
/********************** No longer used as of 2020 Jan 30 ********************/
$dayOfWeek = date("N"); // date("w") gives '0' for Sunday which doesn't work on Sunday!
//date("N") gives '7' for Sunday, which works and Mon-Thu become 1-4.
$nextWednesday = date('Ymd', strtotime("next Wednesday"));
$lastWednesday = date('Ymd', strtotime("last Wednesday"));
// The maps are located on the UNL server by Tuesday dates, so we need the correct Tuesday!
$nextTuesday = date('Ymd', strtotime("next Tuesday")); // Just checking the logic here.
$lastTuesday = date('Ymd', strtotime("last Tuesday"));
$yearMoDay = $lastTuesday; // Default
if ($dayOfWeek>2&&$dayOfWeek<4) $yearMoDay = date("Ymd",strtotime("last Tuesday")-(86400*7));
if ($dayOfWeek==4) {
if ($day_hour < 9 && $day_minute < 30) $yearMoDay = date("Ymd",strtotime("last Tuesday")-(86400*7));
}
/* Debug Code *
echo '
$nextWednesday: '.$nextWednesday.', $lastWednesday: '.$lastWednesday.', $dayOfWeek: '.$dayOfWeek.', $yearMoDay: ',$yearMoDay.'
';
echo '
$nextTuesday: '.$nextTuesday.', $lastTuesday: '.$lastTuesday.', $dayOfWeek: '.$dayOfWeek.', $yearMoDay: ',$yearMoDay.', $ourNumber: '.$ourNumber.'
';
/* End Debug Code */
/************************* End When is it a Wednesday? **********************/
############################################################################
?>
'; // Debug Code ?>
Climate Prediction Center Outlook and Drought Monitor
Click on product title to go to product page. Move cursor over product parameter name to display the graphic -- click to enlarge.
|
|
Images and Data from NOAA CPC
';
}
############################################################################
# End of Page
############################################################################
?>