Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
646 lines (577 sloc) 29 KB
<!DOCTYPE html>
<html>
<head>
<title>HRRR Custom</title>
<link rel="stylesheet" href="./css/brian_style.css" />
<script src="./js/site/siteopen.js"></script>
<script>
function GetUserLocation(){
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
alert('geolocation not working for some reason. Sorry :(');
}
}
function showPosition(position) {
document.getElementById('location').value = position.coords.latitude.toFixed(2) + ',' + position.coords.longitude.toFixed(2);
}
function ChangeImage(){
/*Create HTML string for changing picture*/
var $loadingmsg = document.getElementById('app-loading')
$loadingmsg.classList.remove('hidden')
var URL = 'http://home.chpc.utah.edu/~u0553130/Brian_Blaylock/cgi-bin/plot_hrrr_custom.cgi'
+ '?model=' + document.querySelector('input[name="model"]:checked').value
+ '&valid=' + document.getElementById('validdate').value + document.getElementById('validhour').value
+ '&fxx=' + document.getElementById('fxx').value
+ '&location=' + document.getElementById('location').value
+ '&plotcode=' + $('#plotcode').val()
+ '&dsize=' + document.querySelector('input[name="dsize"]:checked').value
+ '&background=' + document.querySelector('input[name="background"]:checked').value;
var dwnldURL = 'http://home.chpc.utah.edu/~u0553130/Brian_Blaylock/cgi-bin/hrrr_download.cgi'
+ '?model=oper'
+ '&field=sfc'
+ '&date=' + document.getElementById('validdate').value
+ '&link2=grib2';
/*
alert(URL);
alert(document.querySelector('input[name="background"]:checked').value);
*/
/*Set image as the new picture*/
document.getElementById('dwnldGRIB2').href = dwnldURL;
/*document.getElementById('MapLink').href = URL;*/
var hrrrimg = document.getElementById('MapImage')
hrrrimg.src = URL;
/* We need to find when the image is returned (Thank you Adam Abernathy for this snippiet)*/
var $appLoading = document.getElementById('app-loading');
$appLoading.classList.remove('hidden');
hrrrimg.onload = function () { (this.height && this.width) ? ($appLoading.classList.add('hidden')) : (console.warn('Image load error')) }
}
</script>
</head>
<body>
<a name="TOP"></a>
<script src="./js/site/sitemenu.js"></script>
<h1 align="center"><i class="far fa-map"></i> HRRR Custom Surface Maps
<a class='btn btn-primary' data-toggle="modal" data-target="#INSTRUCTIONSmodal">Instructions</a>
</h1>
<div id="content">
<script src='./js/HRRR_status.js'></script>
</div>
<center>
<div class="row" id="content">
<div class=" col-md-1">
</div>
<div class=" col-md-2">
<a class='btn btn-danger' role='button' href="http://home.chpc.utah.edu/~u0553130/Brian_Blaylock/hrrr_golf.html" style="width:100%"> <i class="fa fa-map-marker-alt"></i> Point Forecast</a>
</div>
<div class="col-md-2">
<a class='btn btn-danger' role='button' href="http://home.chpc.utah.edu/~u0553130/Brian_Blaylock/hrrr_fires.html" style="width:100%"><i class="fa fa-fire-extinguisher"></i> Fires Forecast</a>
</div>
<div class="col-md-2">
<a class='btn btn-danger active' role='button' href="http://home.chpc.utah.edu/~u0553130/Brian_Blaylock/hrrr_custom.html" style="width:100%"> <i class="far fa-map"></i> Custom Maps</a>
</div>
<div class="col-md-2">
<a class='btn btn-danger' role='button' href="http://home.chpc.utah.edu/~u0553130/Brian_Blaylock/cgi-bin/hrrrX-hrrr.cgi" style="width:100%"> <i class="fa fa-map"></i> Compare Maps</a>
</div>
<div class="col-md-2">
<a class='btn btn-danger' role='button' href="http://home.chpc.utah.edu/~u0553130/Brian_Blaylock/hrrr_FAQ.html" style="width:100%"> <i class="fa fa-database"></i> HRRR Archive</a>
</div>
</div>
</center>
<center>
<div class="row" style="margin:50px"><div class="col-sm-1"></div><div class="col-sm-3" style="min-width:400px">
<div id="container">
<form class="form-horizontal">
<div class="form-group">
<div class="col-sm-12">
<div class="btn-group btn-group-justified" data-toggle="buttons">
<label class="btn btn-default active">
<input type="radio" name="model" value='hrrr' checked> HRRR
</label>
<label class="btn btn-default">
<input type="radio" name="model" value='hrrrX'> HRRR-X
</label>
<label class="btn btn-default">
<input type="radio" name="model" value='hrrrak'> HRRR-Ak
</label>
</div>
</div>
</div>
<div class="input-group" title="Valid Date">
<span class="input-group-addon"><i class="fa fa-calendar fa-fw"></i></span>
<input name="date" type="date" required style="width:100%" class="form-control btn btn-default" id="validdate" min="2016-07-15">
</div>
<br>
<div class="input-group" title="Valid Hour">
<span class="input-group-addon"><i class="far fa-clock fa-fw"></i></span>
<select class="form-control" id="validhour">
<optgroup label="Valid Time">
<option value='_0000' selected >00:00 UTC</option>
<option value='_0100'>01:00 UTC</option>
<option value='_0200'>02:00 UTC</option>
<option value='_0300'>03:00 UTC</option>
<option value='_0400'>04:00 UTC</option>
<option value='_0500'>05:00 UTC</option>
<option value='_0600'>06:00 UTC</option>
<option value='_0700'>07:00 UTC</option>
<option value='_0800'>08:00 UTC</option>
<option value='_0900'>09:00 UTC</option>
<option value='_1000'>10:00 UTC</option>
<option value='_1100'>11:00 UTC</option>
<option value='_1200'>12:00 UTC</option>
<option value='_1300'>13:00 UTC</option>
<option value='_1400'>14:00 UTC</option>
<option value='_1500'>15:00 UTC</option>
<option value='_1600'>16:00 UTC</option>
<option value='_1700'>17:00 UTC</option>
<option value='_1800'>18:00 UTC</option>
<option value='_1900'>19:00 UTC</option>
<option value='_2000'>20:00 UTC</option>
<option value='_2100'>21:00 UTC</option>
<option value='_2200'>22:00 UTC</option>
<option value='_2300'>23:00 UTC</option>
</optgroup>
</select>
</div>
<br>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-forward fa-fw"></i></span>
<select class="form-control" id="fxx">
<optgroup label="Forecast Lead Time">
<option selected value='0'>f00</option>
<option value='1'>f01</option>
<option value='2'>f02</option>
<option value='3'>f03</option>
<option value='4'>f04</option>
<option value='5'>f05</option>
<option value='6'>f06</option>
<option value='7'>f07</option>
<option value='8'>f08</option>
<option value='9'>f09</option>
<option value='10'>f10</option>
<option value='11'>f11</option>
<option value='12'>f12</option>
<option value='13'>f13</option>
<option value='14'>f14</option>
<option value='15'>f15</option>
<option value='16'>f16</option>
<option value='17'>f17</option>
<option value='18'>f18</option>
</optgroup>
</select>
</div>
<br>
<div class="input-group" title="A MesoWest Station ID or comma separated lat,lon">
<span class="input-group-addon"><i class="fa fa-map-marker fa-fw"></i></span>
<div class="col-sm-8">
<input type="text" required class="form-control" id="location" placeholder="ex: KSLC or 40.8,-111.9">
</div>
<div class="col-sm-4">
<button title='Must be in CONUS' type="button" onclick="GetUserLocation();" class="btn btn-sm btn-default">My Location</button>
</div>
</div>
<br>
<div class="input-group" title="Hold ctrl to select multiple layers">
<span class="input-group-addon"><i class="fa fa-map-signs fa-fw"></i></span>
<select multiple class="form-control" id="plotcode" size=8>
<optgroup label="10-m Winds">
<option selected value='Wind_10-m_Fill'>10 m Wind: Fill</option>
<option value='Wind_10-m_Shade'>10 m Wind: High Winds</option>
<option value='Wind_10-m_Barbs'>10 m Wind: Barbs</option>
<option value='Wind_10-m_Quiver'>10 m Wind: Quiver</option>
<option value='Gust_surface_Hatch'>Surface Gust: Hatch</option>
<option value='Wind_10-m_p95'>10 m Wind Exceeding 95th Percentile</option>
</optgroup>
<optgroup label="80-m Winds">
<option value='Wind_80-m_Fill'>80 m Wind: Fill</option>
<option value='Wind_80-m_Shade'>80 m Wind: High Winds</option>
<option value='Wind_80-m_Barbs'>80 m Wind: Barbs</option>
<option value='Wind_80-m_Quiver'>80 m Wind: Quiver</option>
<option value='Wind_80-m_p95'>80 m Wind Exceeding 95th Percentile</option>
</optgroup>
<optgroup label='Near Surface Temperature'>
<option value='TMP_2-m_Fill'>2 m Temperature: Fill</option>
<option value='TMP_2-m_Contour_0'>2 m Temperature: 0&degC Line</option>
<option value='TMP_surface_Fill'>Skin Temperature: Fill</option>
<option value='POT_2-m_Fill'>2 m Potential Temperature: Fill</option>
<option value='TMP_2-m_p05p95'>2 m Temp > 95th and < 5th Percentile</option>
<optgroup label='Near Surface Humidity'>
<option value='DPT_2-m_Fill'>2 m Dew Point: Fill</option>
<option value='DPT_2-m_Contour_0'>2 m Temperature: 0&degC Line</option>
<option value='RH_2-m_Fill'>2 m Relative Humidity: Fill</option>
<option value='DPT_2-m_p05p95'>2 m Dew Point > 95th and < 5th Percentile</option>
<optgroup label='Reflectivity and Precipitation'>
<option value='dBZ_entire_Fill'>Radar Simulated: Fill</option>
<option value='dBZ_entire_Contour'>Radar Simulated: Contour</option>
<option value='dBZ_entire_Contour_20'>Radar Simulated: Contour 20 dBZ</option>
<option value='dBZ_entire_Contour_30'>Radar Simulated: Contour 30 dBZ</option>
<option value='dBZ_entire_Contour_40'>Radar Simulated: Contour 40 dBZ</option>
<option value='APCP_surface:0_Fill'>Precipitation, Accumulated: Fill</option>
<option value='APCP_surface_Fill'>Precipitation, 1 Hour: Fill</option>
<option value='SNOWC_surface_Fill'>Snow Cover: Fill</option>
<option value='PWAT_surface_Fill'>Precipitable Water: Fill</option>
<option value='TCDC_entire_Fill'>Total Cloud Cover: Fill</option>
</optgroup>
</optgroup>
<optgroup label='Stability'>
<option value='CAPE_surface_Fill'>CAPE Surface: Fill</option>
<option value='CIN_surface_Fill'>CIN Surface: Fill</option>
</optgroup>
<optgroup label='700 mb'>
<option value='TMP_700-mb_Fill'>700 mb Temperature: Fill</option>
<option value='TMP_700-mb_Contour_-12c0'>700 mb Temperature: -12&degC and 0&degC Line</option>
<option value='RH_700-mb_Fill'>700 mb RH: Fill</option>
<option value='HGT_700-mb_Contour'>700 mb Height: Contour</option>
<option value='Wind_700-mb_Fill'>700 mb Wind: Fill</option>
<option value='Wind_700-mb_Barbs'>700 mb Wind: Barbs</option>
<option value='Wind_700-mb_Quiver'>700 mb Wind: Quiver</option>
<option value='Wind_700-mb_Vorticity'>700 mb Vorticity: Fill</option>
<option value='Wind_700-mb_Convergence'>700 mb Convergence: Fill</option>
</optgroup>
<optgroup label='500 mb'>
<option value='TMP_500-mb_Fill'>500 mb Temperature: Fill</option>
<option value='TMP_500-mb_Contour_-12c0'>500 mb Temperature: -12&degC and 0&degC Line</option>
<option value='RH_500-mb_Fill'>500 mb RH: Fill</option>
<option value='HGT_500-mb_Contour'>500 mb Height: Contour</option>
<option value='HGT_500-mb_p05p95'>500 mb Height > 95th and < 5th Percentile</option>
<option value='Wind_500-mb_Fill'>500 mb Wind: Fill</option>
<option value='Wind_500-mb_Barbs'>500 mb Wind: Barbs</option>
<option value='Wind_500-mb_Quiver'>500 mb Wind: Quiver</option>
<option value='Wind_500-mb_Vorticity'>500 mb Vorticity: Fill</option>
<option value='Wind_500-mb_Convergence'>500 mb Convergence: Fill</option>
</optgroup>
<optgroup label='250 mb'>
<option value='Wind_250-mb_Fill'>250 mb Wind: Fill</option>
<option value='Wind_250-mb_Barbs'>250 mb Wind: Barbs</option>
<option value='Wind_250-mb_Quiver'>250 mb Wind: Quiver</option>
<option value='Wind_250-mb_Vorticity'>250 mb Vorticity: Fill</option>
<option value='Wind_250-mb_Convergence'>250 mb Convergence: Fill</option>
</optgroup>
<optgroup label='Sea Level'>
<option value='MSLP_sealevel_Contour'>Mean Sea Level: Contour</option>
<option value='MSLP_sealevel_Fill'>Mean Sea Level: Fill</option>
</optgroup>
<optgroup label='Fire Weather'>
<option value='REDFLAG_surface_Fill'>Red Flag Criteria: Fill</option>
<option value='REDFLAG_surface_Contour'>Red Flag Criteria: Contour</option>
<option value='REDFLAG_surface_Fill-Potential'>Red Flag Potential: Fill</option>
<option value='VPD_2-m_Fill'>Vapor Pressure Deficit: Fill</option>
<option value='VPD_2-m_Crossover'>Temperature/RH Crossover (TMP = RH): Contour</option>
</optgroup>
</select>
</div>
<label class="control-label">Domain Size</label>
<div class="form-group">
<div class="col-sm-12">
<div class="btn-group btn-group-justified" data-toggle="buttons">
<label class="btn btn-default" >
<input type="radio" name="dsize" value='small' > <i class="fa fa-stop fa-xs" title="50 km"></i>
</label>
<label class="btn btn-default">
<input type="radio" name="dsize" value='medium'> <i class="fa fa-stop fa-sm" title="125km"></i>
</label>
<label class="btn btn-default">
<input type="radio" name="dsize" value='large'> <i class="fa fa-stop" title="500 km"></i>
</label>
<label class="btn btn-default">
<input type="radio" name="dsize" value='xlarge'> <i class="fa fa-stop" title="1,000 km"></i>
</label>
<label class="btn btn-default">
<input type="radio" name="dsize" value='xxlarge'> <i class="fa fa-stop fa-lg" title="2,000 km"></i>
</label>
<label class="btn btn-default">
<input type="radio" name="dsize" value='xxxlarge'> <i class="fa fa-stop fa-2x" title="3,000 km"></i>
</label>
<label class="btn btn-default active">
<input type="radio" name="dsize" value='full' checked> <i class="fa fa-globe fa-2x" title="full"></i>
</label>
</div>
</div>
</div>
<label class="control-label">Background</label>
<div class="form-group">
<div class="col-sm-12">
<div class="btn-group btn-group-justified" data-toggle="buttons">
<label class="btn btn-default active">
<input type="radio" name="background" value='arcgis' checked>
<i class="fa fa-globe" title="ArcGIS Shaded Relief (not for CONUS)"></i>
</label>
<label class="btn btn-default">
<input type="radio" name="background" value='arcgisRoad'>
<i class="fa fa-road" title="ArcGIS Roads (not for CONUS)"></i>
</label>
<label class="btn btn-default">
<input type="radio" name="background" value='arcgisSat'>
<img src='./images/icon_satellite.svg' width='20px' title="ArcGIS Imagery (not for CONUS)">
</label>
<label class="btn btn-default">
<input type="radio" name="background" value='terrain'>
<i class="fa fa-wifi fa-rotate-180" title="Model Terrain (200m Contours)"></i>
</label>
<label class="btn btn-default">
<input type="radio" name="background" value='landuse'>
<i class="fa fa-tree" title="Model Landuse"></i>
</label>
<label class="btn btn-default">
<input type="radio" name="background" value='none'>
<i class="far fa-square" title='I despise background images'></i>
</label>
</div>
</div>
</div>
<label class="control-label">GOES16 (future layer, doesn't work yet)</label>
<div class="form-group">
<div class="col-sm-12">
<div class="btn-group btn-group-justified" data-toggle="buttons">
<label class="btn btn-default">
<input type="checkbox" name="GOES_TC" value='1'>
TrueColor
</label>
<label class="btn btn-default">
<input type="checkbox" name="GOES_FT" value='1'>
Fire Temperature
</label>
<label class="btn btn-default">
<input type="checkbox" name="GOES_GLM" value='1'>
<i class="fas fa-bolt"></i> GLM
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-9">
<button type="button" onclick="ChangeImage();" class="btn btn-lg btn-success" style="width:45%;min-width:100px">Submit</button>
</div>
</div>
</form>
</div>
</div>
<div class="col-sm-7">
<div class="row hidden" id="app-loading">
<div class="col-sm-12">
<div id="page-is-loading">
<div id="loading-progress" class="progress">
<div id="progress-bar" class="progress-bar progress-bar-danger progress-bar-striped active" role="progressbar" aria-valuemin="0"
aria-valuemax="100" style="width:100%">
<p style="font-size:20px">Generating New Image</p>
</div>
</div>
</div>
</div>
</div>
<img class='style1' id='MapImage' style="width:100%;max-width:700px" src='http://home.chpc.utah.edu/~u0553130/Brian_Blaylock/images/empty.jpg' onclick='window.open(this.src)'>
<br>
<p>Wind Barbs (if present): half=2.5, full=5, flag=25 m s<sup>-1</sup>
<p><a data-toggle="modal" data-target="#LUmodal">Landuse Legend</a>
<p><a data-toggle="modal" data-target="#RFmodal">Red Flag Legend</a>
<p><a href="#" id='dwnldGRIB2' class="btn btn-default" role="button"><i class="fa fa-download"></i> GRIB2</a>
<!-- Accordion Advanced Options-->
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" href="#collapse1">Future Features</a>
</h4>
</div>
<div id="collapse1" class="panel-collapse collapse">
<div class="panel-body">
<div class="form-group" style="margin-left:1px;margin-right:1px">
<p> Features coming soon, but can't now becuase CHPC doesn't have shapefile installed on this version of Python
<p><input type="checkbox" id="outlineFires"> Fire outlines</input>
<p><input type="checkbox" id="ScatterMesoWest"> MesoWest Station Locations</input>
<p><input type="checkbox" id="ScatterMesoWest"> GOES-16 Background Image</input>
<p><input type="checkbox" id="ScatterMesoWest"> User sets alpha image</input>
<p><input type="checkbox" id="ScatterMesoWest"> HRRR and HRRRx comparison</input>
<p><input type="checkbox" id="ScatterMesoWest"> Ability to loop through valid time and forecast time</input>
</div>
</div>
</div>
</div>
</div>
<p><a href="https://github.com/blaylockbk/Web-Homepage/blob/master/hrrr_custom.html" target="_blank"><i class="fab fa-github"></i> Page HTML code</a>
<a href="https://github.com/blaylockbk/Web-Homepage/blob/master/cgi-bin/plot_hrrr_custom.cgi" target="_blank"><i class="fab fa-github"></i> Image Python/CGI code</a>
</div><div class="col-sm-1"></div>
</div>
</center>
<br>
<!-- Instructions Modal -->
<div class="modal fade" id="INSTRUCTIONSmodal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">HRRR Custom Map Maker</div>
<div class="modal-body">
<h4>model</h4>
<ul>
<li>hrrr</li>
<li>hrrrX</li>
<li>hrrrak</li>
</ul>
<h4>valid</h4>
<p>The model valid time: YYYY-mm-dd_HHMM
<h4>fxx</h4>
<p>The forecast lead time: 0-18 for hrrr and hrrrX. 0-36 for hrrrak</p>
<h4>location</h4>
<ul>
<li>Mesowest ID: WBB</li>
<li>latitude,longitude: 40,-110</li>
</ul>
<h4>dsize</h4>
<ul>
<li>full: the full model domain</li>
<li>small</li>
<li>medium</li>
<li>large</li>
<li>xlarge</li>
<li>xxlarge</li>
<li>xxxlarge</li>
</ul>
<h4>background</h4>
<ul>
<li>arcgis: basic terrain/shaded relief</li>
<li>arcgisSatl: satellite image</li>
<li>arcgisRoad: roads</li>
<li>terrain: model terrain</li>
<li>landuse: model land surface classifications</li>
<li>none: plain white background</li>
</ul>
<p>If dsize=full, then the background will be a plain tan for land and light blue for water</p>
<h4>plotcode</h4>
<p>In general, requires 3-4 parts per code, separated by an underscore. Plots can be stacked by including many plotcodes, each separted by a comma.</p>
<p>[variable]_[level]_[plot type]_[contour interval (optional)]</p>
<ul>
<li>TMP or DPT
<ul>
<li>2-m</li>
<li>500-mb</li>
<li>700-mb</li>
<li>surface</li>
<ul>
<li>Fill</li>
<li>Contour</li>
<ul>
<li>contour interval is [0] by default</li>
<li>custom contour intervals is numbers separated by a c. Example: '0c10c20c'</li>
</ul>
<li>p05p95: 5th and 95th percentile depression/exceedance. (only for level=2-m)</li>
</ul>
</ul>
<li>Wind
<ul>
<li>10-m</li>
<li>80-m</li>
<li>250-mb</li>
<li>500-mb</li>
<li>700-mb</li>
<ul>
<li>Fill</li>
<li>p95: 95th percentile exceedance. (only for level=10-m or 80-m)</li>
<li>Shade: Shade areas with high winds</li>
<li>Barbs</li>
<li>Quiver</li>
<li>Vorticity</li>
<li>Convergence</li>
</ul>
</ul>
<li>RH
<ul>
<li>2-m</li>
<li>500-mb (computed from TMP and DPT)</li>
<li>700-mb (computed from TMP and DPT)</li>
<ul>
<li>Fill</li>
</ul>
</ul>
<li>dBZ: simulated composite reflectivity
<ul>
<li>entire</li>
<ul>
<li>Fill</li>
<li>Contour</li>
<ul>
<li>contour interval is [10,20,30,40,50] by default</li>
<li>custom contour intervals is numbers separated by a c. Example: '0c10c20c'</li>
</ul>
</ul>
</ul>
<li>APCP: Accumulated Precipitation
<ul>
<li>surface:0 (accumulation since f00)</li>
<li>surface (accumulation for previous hour only)</li>
<ul>
<li>Fill</li>
<li>masked</li>
</ul>
</ul>
<li>[any HRRR variable abbreviation]
<ul>
<li>[any level available for that variable]</li>
<ul>
<li>Fill</li>
<li>masked</li>
</ul>
</ul>
</ul>
</ul>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- end Red Flag legend Modal -->
<!-- Landuse Legend Modal -->
<div class="modal fade" id="LUmodal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-body">
<center><img src="./images/landuse_legend.png"></center>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- end landuse legend Modal -->
<!-- Red Flag Legend Modal -->
<div class="modal fade" id="RFmodal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-body">
<center>
<img src="./images/red_flag_criteria.png">
<img src="./images/red_flag_potential.png">
</center>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- end Red Flag legend Modal -->
<script>
var today = new Date();
var tomorrow
var dd = today.getDate();
var dd1 = today.getDate()+1;
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if(dd<10){
dd='0'+dd
}
if(mm<10){
mm='0'+mm
}
today = yyyy+'-'+mm+'-'+dd;
tomorrow = yyyy+'-'+mm+'-'+dd1;
document.getElementById("validdate").setAttribute("max", tomorrow);
document.getElementById("validdate").setAttribute("value", today);
</script>
<script src="./js/site/siteclose.js"></script>
</body>
</html>