<!------------------------------------------------------------------------------------------------------------>
<!------------------------------------------------------------------------------------------------------------>
<!------------------------------------------------------------------------------------------------------------>
<!------------------------------------------------------------------------------------------------------------>
<!------------------------------------------------------------------------------------------------------------>
<!------------------------------------------------------------------------------------------------------------>
<!------------------------------------------------------------------------------------------------------------>
<!------------------------------------------------------------------------------------------------------------>
<!------------------------------------------------------------------------------------------------------------>
<!--template file for another mm5 page-->
<?php
$UnitContour=array("RAINN"=>"mm,2.",
"PSLV"=>"mb,5.",
"RAINC"=>"cm,1.",
"RAINT"=>"cm,1.",
"RTENDN"=>"mm,5.",
"RTENDC"=>"mm,5.",
"RTENDT"=>"mm,5.",
"PRH2O"=>"mm,2.",
"PSFC"=>"mb,10.",
"PTEND"=>"mb,1.",
"TGD"=>"C,2.",
"WIND"=>"m/s,5",
"QV"=>"g/kg,2.",
"RH"=>"%,10.",
"CLW"=>"g/kg,1.",
"RNW"=>"g/kg,1.",
"ICLW"=>"cm,1.",
"IRNW"=>"cm,1.",
"SNOW"=>"g/kg,1.",
"ICE"=>"g/kg,1.",
"HEIGHT"=>"m,40.",
"VOR"=>"10**5/s,10.",
"RDTEND"=>"k/day,.5",
"REGIME"=>"category,",
"PBLHGT"=>"m,200.",
"SHFLUX"=>"W/m^2,50.",
"LHFLUX"=>"W/m^2,50.",
"UST"=>"m/s,.2",
"SWDOWN"=>"W/m^2,50.",
"LWDOWN"=>"W/m^2,50.",
"SOIL T 1"=>"k,4.",
"SOIL T 2"=>"k,4.",
"SOIL T 3"=>"k,4.",
"SOIL T 4"=>"k,4.",
"SOIL T 5"=>"k,4.",
"SOIL T 6"=>"k,4.",
"P"=>"mb,4.",
"U"=>"m/s,10.",
"V"=>"m/s,10.",
"T"=>"C,5.",
"W"=>"cm/s,10.",
"VAB"=>"10**5/s,10.",
"DIV"=>"1/s,0.",
"MDIV"=>"1/s,0.",
"PP"=>"mb,1.",
"TD"=>"C,2.",
"TDD"=>"C,2.",
"THETA"=>"k,4.",
"THETAE"=>"k,4.",
"LI"=>"k,2.",
"MSE"=>"j/kg,1.",
"MSS"=>"j/kg,1.",
"PV"=>"Km/s^3Pa,1.",
"VESL"=>"m/s,10.");
//*****************************************
$title=":: mm5(timing) ::";
$body2_part1="
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\">
<title>$title</title>
</head>
<body link=\"#000000\" vlink=\"#000000\" alink=\"#000000\">
<form action=\"mm5.php?step=2&user=$user\" method=\"post\">
<input type=\"hidden\" value=\"y\" name=\"seem\">
<input type=\"hidden\" value=\"2\" name=\"formtype\">
<p align=\"center\"><font size=\"2\" color=\"#0000FF\"><b>
<img border=\"0\" src=\"images/step2.gif\" width=\"446\" height=\"117\"><span style=\"position: absolute; left: 738; top: 17; z-index:-1\">
<a href=\"http://www.mmm.ucar.edu/mm5/documents/MM5_tut_Web_notes/TutTOC.html\"><img border=\"0\" src=\"images/help_sm_wht.gif\" width=\"84\" height=\"84\"></a></span><br>
</b></font><font size=\"2\">Timing<br>
<br>
</font>
<div align=\"center\">
<center>
<table border=\"2\" width=\"600\" style=\"border-style:outset; border-collapse:collapse; padding-left:4; padding-right:4; padding-top:1; padding-bottom:1\" height=\"156\" bgcolor=\"#4870A8\" bordercolor=\"#000080\" cellspacing=\"10\" cellpadding=\"2\">
<tr>
<td width=\"318\" height=\"32\" style=\"border-left-style: solid; border-top-style: solid; border-bottom-style: solid\">
<p align=\"left\"><font size=\"2\"> Start Date<select size=\"1\" name=\"CmbBoxSDate\" onchange=\"WhenDateSelect(2,3)\">";
$body2_part3="</font></td>
<td width=\"330\" height=\"32\">
<font size=\"2\"> <a href=\"javascript:popUps('help/forecastingtime.html','800','200')\">Forecasting time</a> <input type=\"text\" name=\"EdtForcast\" size=\"3\">
(min)<br>
<a href=\"javascript:popUps('help/timestep.html','800','200')\">Time
step</a>
<input type=\"text\" name=\"EdtStep\" size=\"3\"> (sec)<br>
<a href=\"javascript:popUps('help/timeinterval.html','800','240')\">Time Interval</a> <input type=\"text\" name=\"EdtInterval\" size=\"3\">
(sec)<br>
</font></td>
</tr>
<tr>
<td width=\"261\" height=\"42\">
<font size=\"2\"> Global Modal <br>
<select size=\"1\" name=\"CmbBoxGlobal\">
<option>AVN</option>
<option>ETA</option>
</select></font></td>
<td width=\"211\" height=\"42\">
<font size=\"2\"> <a href=\"javascript:popUps('help/tapfrq.html','800','200')\">TAPFRQ</a> <input type=\"text\" name=\"EdtTapfrq\" size=\"3\">
(min)<br>
<a href=\"javascript:popUps('help/savfrq.html','800','200')\">SAVFRQ</a> <input type=\"text\" name=\"EdtSavfrq\" size=\"3\"> (min)</font></td>
</tr>
</center>
<tr>
<td width=\"472\" colspan=\"2\" height=\"40\">
<p align=\"center\">
<input type=\"button\" value=\"Prev Step\" name=\"BtnPre\" style=\"background-color: #6699FF; color: #FFCEAE; border-style: outset\" onclick=\"javascript:history.back(1)\">
<input type=\"submit\" value=\"Next Step\" name=\"BtnNext\" style=\"background-color: #6699FF; color: #FFCEAE; border-style: outset\"></td>
</tr>
</table>
<img border=\"0\" src=\"images/mr_alarm_clock_ringing_sm_wht.gif\" width=\"70\" height=\"56\">
</div>
</form>";
//------------------------------------------------------------------------------
$title=":: mm5(other parameters) ::";
$body3="
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\">
<title>$title</title>
</head>
<body link=\"#000000\" vlink=\"#000000\" alink=\"#000000\">
<form method=\"post\" action=\"mm5.php?step=2&user=$user\">
<input type=\"hidden\" value=\"y\" name=\"seem\">
<input type=\"hidden\" value=\"3\" name=\"formtype\">
<p align=\"center\"><font size=\"2\"><b><font color=\"#0000FF\">
<img border=\"0\" src=\"images/step3.gif\" width=\"446\" height=\"117\"><br>
</font></b>other parameters<br>
<br>
</font>
<div align=\"center\">
<center>
<table border=\"2\" width=\"600\" bgcolor=\"#4870A8\" bordercolor=\"#000080\" height=\"108\" cellspacing=\"10\" style=\"border-collapse: collapse; border-style: outset; padding: 0\" cellpadding=\"2\">
<tr>
<td width=\"34%\" height=\"77\">
<font size=\"2\">
<a href=\"javascript:popUps('help/radfrq.html','800','150')\">RADFRQ</a><input type=\"text\" name=\"EdtRadfrq\" size=\"1\" value=\"30\"><br>
<a href=\"javascript:popUps('help/ivtadv.html','800','150')\">IVTADV</a><select size=\"1\" name=\"CmbBoxIvtadv\">
<option selected>0</option>
<option>1</option>
</select><br>
<a href=\"javascript:popUps('help/imvdif.html','800','150')\">IMVDIF</a> <select size=\"1\" name=\"CmbBoxImvdif\">
<option>0</option>
<option selected>1</option>
</select></font></td>
<td width=\"33%\" height=\"77\">
<font size=\"2\"> <a href=\"javascript:popUps('help/ifdry.html','800','150')\">IFDRY</a> <select size=\"1\" name=\"CmbBoxIfdry\">
<option selected>0</option>
<option>1</option>
</select><br>
<font face=\"Arial\"><a href=\"javascript:popUps('help/itpdif.html','800','150')\">ITPDIF</a></font><select size=\"1\" name=\"CmbBoxItpdif\">
<option>0</option>
<option selected>1</option>
</select> <br>
<a href=\"javascript:popUps('help/ifupr.html','800','250')\">IFUPR</a> <select size=\"1\" name=\"CmbBoxIfupr\">
<option>0</option>
<option selected>1</option>
</select> </font></td>
<td width=\"33%\" height=\"77\">
<font size=\"2\"> <a href=\"javascript:popUps('help/ivqadv.html','800','150')\">IVQADV</a> <select size=\"1\" name=\"CmbBoxIvqadv\">
<option selected>0</option>
<option>1</option>
</select><br>
<a href=\"javascript:popUps('help/ithadv.html','800','150')\">ITHADV</a> <select size=\"1\" name=\"CmbBoxIthadv\">
<option selected>0</option>
<option>1</option>
</select> <br>
<a href=\"javascript:popUps('help/icor3d.html','800','150')\">ICOR3D</a> <select size=\"1\" name=\"CmbBoxIcor3d\">
<option>0</option>
<option selected>1</option>
</select> </font></td>
</tr>
<tr>
<td width=\"34%\" height=\"40\">
<font face=\"Arial\" size=\"2\"> <a href=\"javascript:popUps('help/zzlnd.html','800','150')\">ZZLND</a> </font><font size=\"2\"><input type=\"text\" name=\"EdtZzlnd\" size=\"2\" value=\"0.1\"><br>
<a href=\"javascript:popUps('help/conf.html','800','150')\">CONF</a> <input type=\"text\" name=\"EdtConf\" size=\"2\" value=\"1\"></font></td>
<td width=\"33%\" height=\"40\">
<font size=\"2\"> <a href=\"javascript:popUps('help/zzwtr.html','800','150')\">ZZWTR</a> <input type=\"text\" name=\"EdtZzwtr\" size=\"2\" value=\"0.0001\"><br>
<font face=\"Arial\"><a href=\"javascript:popUps('help/alblnd.html','800','150')\">ALBLND</a> </font><input type=\"text\" name=\"EdtAlblnd\" size=\"2\" value=\"0.15\"></font></td>
<td width=\"33%\" height=\"40\">
<font size=\"2\"> <a href=\"javascript:popUps('help/thinld.html','800','150')\">THINLD</a> <input type=\"text\" name=\"EdtThinld\" size=\"2\" value=\"0.04\"><br>
<font face=\"Arial\"><a href=\"javascript:popUps('help/xmava.html','800','150')\">XMAVA</a> </font><input type=\"text\" name=\"EdtXmava\" size=\"2\" value=\"0.3\"></font></td>
</tr>
<tr>
<td width=\"100%\" colspan=\"3\" height=\"1\">
<p align=\"center\"> Enter Unique Run Name
<input type=\"input\" name=\"EdtRunName\"></td>
</tr>
<tr>
<td width=\"100%\" colspan=\"3\" height=\"1\">
<p align=\"center\"> <input type=\"button\" value=\"Prev Step\" name=\"BtnPre\" style=\"background-color: #6699FF; color: #FFCEAE; border-style: outset\" onclick=\"javascript:history.back(1)\">
<input type=\"submit\" value=\"Run MM5\" name=\"BtnRun\" style=\"background-color: #6699FF; color: #FFCEAE; border-style: outset\"></td>
</tr>
</table>
</center>
</div>
<p align=\"center\"><b><font size=\"5\" color=\"#0000FF\">
<span style=\"position: absolute; left: 738; top: 17; z-index:-1\">
<a herf=\"http://www.mmm.ucar.edu/mm5/documents/MM5_tut_Web_notes/TutTOC.html\"><img border=\"0\" src=\"images/help_sm_wht.gif\" width=\"84\" height=\"84\"></a></span></font></b>
<p align=\"center\">
<img border=\"0\" src=\"images/monitor_accessories_information_highway_md_wht.gif\" width=\"110\" height=\"120\">
</form>";
//------------------------------------------------------------------------------
$top4part1="
<input type=\"hidden\" value=\"y\" name=\"seemout\">
<input type=\"hidden\" value=\"4\" name=\"formtype\">
<center>
<img border=\"0\" src=\"images/graph.gif\" width=\"500\" height=\"200\"><table border=\"0\" style=\"border-style:solid; border-width:2; border-collapse: collapse; padding-left:4; padding-right:4; padding-top:1; padding-bottom:1\" bordercolor=\"#000080\" width=\"600\" id=\"AutoNumber1\" height=\"380\">
<tr>
<td width=\"25%\" style=\"border-bottom-style: solid; border-bottom-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1; border-left-width:1; border-top-width:1\" height=\"23\" bgcolor=\"#7777BD\">
</td>
<td width=\"25%\" style=\"padding: 0; border-left-width:1; border-right-width:1; border-top-width:1; border-bottom-style:solid; border-bottom-width:1\" height=\"23\" bgcolor=\"#7777BD\">
<font size=\"2\"> Date";
$top4part21="<select size=\"1\" name=\"CmbBoxRunDate\" onchange=\"WhenDateSelect()\">
</select>
</font></td>
<td width=\"25%\" style=\"padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1; border-left-width:1; border-right-width:1; border-top-width:1; border-bottom-style:solid; border-bottom-width:1\" height=\"23\" bgcolor=\"#7777BD\">
<font size=\"2\">Run
<select size=\"1\" name=\"CmbBoxRunRun\">
</select></font></td>";
$top4part3="<td width=\"25%\" style=\"padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1; border-left-width:1; border-right-width:1; border-top-width:1; border-bottom-style:solid; border-bottom-width:1\" height=\"23\" bgcolor=\"#7777BD\"> </td>
</tr>
<tr>
<td width=\"25%\" style=\"border-right-style: solid; border-right-width: 2; border-bottom-style: solid; border-bottom-width: 2; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1\" height=\"23\" bgcolor=\"#ABABD6\">
<font color=\"#FFFFFF\" size=\"4\"> <a href=\"javascript:popUps('help/normal.html','800','600')\">Normal Field</a></font><font color=\"#FFFFFF\"><font size=\"2\"> </font>
<font size=\"4\">:</font></font></td>
<td width=\"25%\" style=\"padding: 0\" height=\"23\"><font size=\"2\"> </font></td>
<td width=\"25%\" style=\"padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1\" height=\"23\"><font size=\"2\"> </font></td>
<td width=\"25%\" style=\"padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1\" height=\"23\"><font size=\"2\"> </font></td>
</tr>
<tr>
<td width=\"25%\" height=\"28\"><font size=\"2\"> Field </font>
<font face=\"Times New Roman\">
<SELECT size=\"1\" name=\"CmbBoxField\" onchange=\"Unit(9,10,0)\">
<OPTION selected>CLW</OPTION> <OPTION>DIV</OPTION>
<OPTION>HEIGHT</OPTION> <OPTION>ICE</OPTION> <OPTION>ICLW</OPTION>
<OPTION>IRNW</OPTION> <OPTION>LHFLUX</OPTION> <OPTION>LI</OPTION>
<OPTION>LWDOWN</OPTION> <OPTION>MDIV</OPTION> <OPTION>MSE</OPTION>
<OPTION>MSS</OPTION> <OPTION>P</OPTION> <OPTION>PBLHGT</OPTION>
<OPTION>PP</OPTION> <OPTION>PRH2O</OPTION> <OPTION>PSFC</OPTION>
<OPTION>PSLV</OPTION> <OPTION>PTEND</OPTION> <OPTION>PV</OPTION>
<OPTION>QV</OPTION> <OPTION>RAINC</OPTION> <OPTION>RAINN</OPTION>
<OPTION>RAINT</OPTION> <OPTION>RDTEND</OPTION> <OPTION>REGIME</OPTION>
<OPTION>RH</OPTION> <OPTION>RNW</OPTION> <OPTION>RTENDC</OPTION>
<OPTION>RTENDN</OPTION> <OPTION>RTENDT</OPTION> <OPTION>SHFLUX</OPTION>
<OPTION>SNOW</OPTION> <OPTION>SOIL T 1</OPTION> <OPTION>SOIL T 2</OPTION>
<OPTION>SOIL T 3</OPTION> <OPTION>SOIL T 4</OPTION>
<OPTION>SOIL T 5</OPTION> <OPTION>SOIL T 6</OPTION>
<OPTION>SWDOWN</OPTION> <OPTION>T</OPTION> <OPTION>TD</OPTION>
<OPTION>TDD</OPTION> <OPTION>TGD</OPTION> <OPTION>THETA</OPTION>
<OPTION>THETAE</OPTION> <OPTION>U</OPTION> <OPTION>UST</OPTION>
<OPTION>V</OPTION> <OPTION>VAB</OPTION> <OPTION>VESL</OPTION>
<OPTION>VOR</OPTION> <OPTION>W</OPTION>
<OPTION>WIND</OPTION></SELECT></font></td>
<td width=\"25%\" height=\"28\" style=\"border-top-style: solid; border-top-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1\"><font size=\"2\"> Unit
<select size=\"1\" name=\"CmbBoxUnit\">
</select></font></td>
<td width=\"25%\" style=\"border-top-style: solid; border-top-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1\" height=\"28\"><font size=\"2\"> Contour
<input type=\"text\" name=\"EdtContour\" size=\"2\"></font></td>
<td width=\"25%\" rowspan=\"3\" height=\"80\">
<img border=\"0\" src=\"images/ag00434_.gif\" width=\"110\" height=\"79\"></td>
</tr>
<tr>
<td width=\"25%\" style=\"padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1\" height=\"27\">
<font size=\"2\">Type </font> <SELECT
size=\"1\" name=\"CmbBoxType\" onchange=\"Type()\"> <OPTION>Isentropic</OPTION>
<OPTION selected>Pressure</OPTION>
<option>Sigma</option>
</SELECT></td>
<td width=\"25%\" height=\"27\"><font size=\"2\"> Level
<input type=\"text\" name=\"EdtLevel\" size=\"7\"></font></td>
<td width=\"25%\" style=\"padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1\" height=\"27\"><font size=\"2\"> Smooth
<input type=\"text\" name=\"EdtSmooth\" size=\"3\"></font></td>
</tr>
<tr>
<td width=\"25%\" style=\"border-right-style: solid; border-right-width: 1; border-bottom-style: solid; border-bottom-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1\" height=\"25\" bgcolor=\"#C0C0C0\"><font size=\"4\" color=\"#000080\"> Overlay Field
:</font></td>
<td width=\"25%\" height=\"25\"><font size=\"2\" color=\"#FF0000\"> (optional
)</font></td>
<td width=\"25%\" height=\"25\"> </td>
</tr>
<tr>
<td width=\"25%\" height=\"26\"><font size=\"2\"> Field </font>
<font face=\"Times New Roman\">
<SELECT size=1 name=CmbBoxOverField onchange=\"Unit(15,16,-1)\">
<option selected></option>
<OPTION>CLW</OPTION> <OPTION>DIV</OPTION>
<OPTION>HEIGHT</OPTION> <OPTION>ICE</OPTION> <OPTION>ICLW</OPTION>
<OPTION>IRNW</OPTION> <OPTION>LHFLUX</OPTION> <OPTION>LI</OPTION>
<OPTION>LWDOWN</OPTION> <OPTION>MDIV</OPTION> <OPTION>MSE</OPTION>
<OPTION>MSS</OPTION> <OPTION>P</OPTION> <OPTION>PBLHGT</OPTION>
<OPTION>PP</OPTION> <OPTION>PRH2O</OPTION> <OPTION>PSFC</OPTION>
<OPTION>PSLV</OPTION> <OPTION>PTEND</OPTION> <OPTION>PV</OPTION>
<OPTION>QV</OPTION> <OPTION>RAINC</OPTION> <OPTION>RAINN</OPTION>
<OPTION>RAINT</OPTION> <OPTION>RDTEND</OPTION> <OPTION>REGIME</OPTION>
<OPTION>RH</OPTION> <OPTION>RNW</OPTION> <OPTION>RTENDC</OPTION>
<OPTION>RTENDN</OPTION> <OPTION>RTENDT</OPTION> <OPTION>SHFLUX</OPTION>
<OPTION>SNOW</OPTION> <OPTION>SOIL T 1</OPTION> <OPTION>SOIL T 2</OPTION>
<OPTION>SOIL T 3</OPTION> <OPTION>SOIL T 4</OPTION>
<OPTION>SOIL T 5</OPTION> <OPTION>SOIL T 6</OPTION>
<OPTION>SWDOWN</OPTION> <OPTION>T</OPTION> <OPTION>TD</OPTION>
<OPTION>TDD</OPTION> <OPTION>TGD</OPTION> <OPTION>THETA</OPTION>
<OPTION>THETAE</OPTION> <OPTION>U</OPTION> <OPTION>UST</OPTION>
<OPTION>V</OPTION> <OPTION>VAB</OPTION> <OPTION>VESL</OPTION>
<OPTION>VOR</OPTION> <OPTION>W</OPTION>
<OPTION>WIND</OPTION></SELECT></font></td>
<td width=\"25%\" height=\"24\"><font size=\"2\"> Unit
<select size=\"1\" name=\"CmbBoxOverUnit\">
</select></font></td>
<td width=\"25%\" height=\"24\"><font size=\"2\"> Contour
<input type=\"text\" name=\"EdtOverContour\" size=\"2\"></font></td>
<td width=\"25%\" height=\"24\"><font size=\"2\"> Smooth
<input type=\"text\" name=\"EdtOverSmooth\" size=\"3\"></font></td>
</tr>
<tr>
<td width=\"25%\" height=\"28\" style=\"border-left-width: 1; border-right-width: 1; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1\"> </td>
<td width=\"25%\" height=\"28\" style=\"border-left-width: 1; border-right-width: 1; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1\">
<input type=\"submit\" value=\"Add\" name=\"BtnNFAdd\" style=\"float: right\" onclick=\"Choice(1)\"></td>
<td width=\"25%\" height=\"28\" style=\"border-left-width: 1; border-right-width: 1; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1\"> </td>
<td width=\"25%\" height=\"28\" style=\"border-left-width: 1; border-right-width: 1; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1\"> </td>
</tr>
<tr>
<td width=\"25%\" height=\"18\"><hr color=\"#808000\" width=\"100\"></td>
<td width=\"25%\" height=\"18\"><hr color=\"#808000\" width=\"100\"></td>
<td width=\"25%\" height=\"18\"><hr color=\"#808000\" width=\"100\"></td>
<td width=\"25%\" height=\"18\"><hr color=\"#808000\" width=\"100\"></td>
</tr>
<tr>
<td width=\"25%\" style=\"border-style:solid; border-width:2; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1\" height=\"22\" bgcolor=\"#ABABD6\"><font size=\"4\"> <font color=\"#FFFFFF\"><a href=\"javascript:popUps('help/skewt.html','800','250')\">SKEWTLL :</a></font></font></td>
<td width=\"25%\" height=\"22\"> </td>
<td width=\"25%\" height=\"22\"> </td>
<td width=\"25%\" rowspan=\"3\" height=\"93\" style=\"border-bottom-style: solid; border-bottom-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1\">
<img border=\"0\" src=\"images/ag00433_2.gif\" width=\"128\" height=\"101\"></td>
</tr>
<tr>
<td width=\"25%\" height=\"33\" style=\"border-left-width: 1; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-width: 1\"><font size=\"2\"> Domain
";
//------------------------------------------------------------------------------
$mid4p1="
</font></td>
<td width=\"25%\" height=\"33\" style=\"border-left-width: 1; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-width: 1\"><font size=\"2\"> Longitude
<input type=\"text\" name=\"EdtLon\" size=\"6\"></font></td>
<td width=\"25%\" height=\"33\" style=\"border-left-width: 1; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-width: 1\"><font size=\"2\"> Latitude
<input type=\"text\" name=\"EdtLat\" size=\"6\"></font></td>
</tr>
<tr>
<td width=\"25%\" height=\"38\" style=\"border-left-width: 1; border-right-width: 1; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1\"> </td>
<td width=\"25%\" height=\"38\" style=\"border-left-width: 1; border-right-width: 1; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1\">
<input type=\"submit\" value=\"Add\" name=\"BtnSKWAdd\" style=\"float: right\" onclick=\"Choice(2)\"></td>
<td width=\"25%\" height=\"38\" style=\"border-left-width: 1; border-right-width: 1; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1\"> </td>
</tr>
<tr>
<td width=\"25%\" height=\"18\"><hr color=\"#808000\" width=\"100\"></td>
<td width=\"25%\" height=\"18\"><hr color=\"#808000\" width=\"100\"></td>
<td width=\"25%\" height=\"18\"><hr color=\"#808000\" width=\"100\"></td>
<td width=\"25%\" height=\"18\"><hr color=\"#808000\" width=\"100\"></td>
</tr>
<tr>
<td width=\"25%\" style=\"border-style:solid; border-width:2; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1\" height=\"23\" bgcolor=\"#ABABD6\">
<font color=\"#FFFFFF\"> </font><font color=\"#FFFFFF\" size=\"4\"><a href=\"javascript:popUps('help/cross.html','800','600')\">Cross Section :</a></font></td>
<td width=\"25%\" height=\"23\" style=\"border-left-width: 1; border-right-width: 1; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1\"> </td>
<td width=\"25%\" height=\"23\" style=\"border-left-width: 1; border-right-width: 1; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1\"> </td>
<td width=\"25%\" height=\"23\"> </td>
</tr>
<tr>
<td width=\"25%\" height=\"24\"><font size=\"2\"> Domain
<select size=\"1\" name=\"CmbBoxCrossDomain\">";
$mid4p2="
</select></font></td>
<td width=\"25%\" height=\"24\"><font size=\"2\"> X</font><font size=\"1\">1</font><font size=\"2\">
<input type=\"text\" name=\"EdtX1\" size=\"2\"> Y</font><font size=\"1\">1</font><font size=\"2\">
<input type=\"text\" name=\"EdtY1\" size=\"2\"></font></td>
<td width=\"25%\" height=\"24\"><font size=\"2\"> X</font><font size=\"1\">2</font><font size=\"2\">
<input type=\"text\" name=\"EdtX2\" size=\"2\"> Y</font><font size=\"1\">2</font><font size=\"2\">
<input type=\"text\" name=\"EdtY2\" size=\"2\"></font></td>
<td width=\"25%\" height=\"24\"><font size=\"2\"> </font></td>
</tr>
<tr>
<td width=\"25%\" height=\"26\"><font size=\"2\"> Field </font>
<font face=\"Times New Roman\">
<SELECT size=\"1\" name=\"CmbBoxCrossField\" onchange=\"Unit(29,30,0)\">
<OPTION>CLW</OPTION> <OPTION>DIV</OPTION>
<OPTION>HEIGHT</OPTION> <OPTION>ICE</OPTION> <OPTION>ICLW</OPTION>
<OPTION>IRNW</OPTION> <OPTION>LHFLUX</OPTION> <OPTION>LI</OPTION>
<OPTION>LWDOWN</OPTION> <OPTION>MDIV</OPTION> <OPTION>MSE</OPTION>
<OPTION>MSS</OPTION> <OPTION>P</OPTION> <OPTION>PBLHGT</OPTION>
<OPTION>PP</OPTION> <OPTION>PRH2O</OPTION> <OPTION>PSFC</OPTION>
<OPTION>PSLV</OPTION> <OPTION>PTEND</OPTION> <OPTION>PV</OPTION>
<OPTION>QV</OPTION> <OPTION>RAINC</OPTION> <OPTION>RAINN</OPTION>
<OPTION>RAINT</OPTION> <OPTION>RDTEND</OPTION> <OPTION>REGIME</OPTION>
<OPTION>RH</OPTION> <OPTION>RNW</OPTION> <OPTION>RTENDC</OPTION>
<OPTION>RTENDN</OPTION> <OPTION>RTENDT</OPTION> <OPTION>SHFLUX</OPTION>
<OPTION>SNOW</OPTION> <OPTION>SOIL T 1</OPTION> <OPTION>SOIL T 2</OPTION>
<OPTION>SOIL T 3</OPTION> <OPTION>SOIL T 4</OPTION>
<OPTION>SOIL T 5</OPTION> <OPTION>SOIL T 6</OPTION>
<OPTION>SWDOWN</OPTION> <OPTION>T</OPTION> <OPTION>TD</OPTION>
<OPTION>TDD</OPTION> <OPTION>TGD</OPTION> <OPTION>THETA</OPTION>
<OPTION>THETAE</OPTION> <OPTION>U</OPTION> <OPTION>UST</OPTION>
<OPTION>V</OPTION> <OPTION>VAB</OPTION> <OPTION>VESL</OPTION>
<OPTION>VOR</OPTION> <OPTION>W</OPTION>
<OPTION>WIND</OPTION></SELECT></font></td>
<td width=\"25%\" height=\"24\"><font size=\"2\"> Unit
<select size=\"1\" name=\"CmbBoxCrossUnit\">
</select></font></td>
<td width=\"25%\" height=\"24\"><font size=\"2\"> Contour
<input type=\"text\" name=\"EdtCrossContour\" size=\"2\"></font></td>
<td width=\"25%\" height=\"24\"><font size=\"2\"> Smooth
<input type=\"text\" name=\"EdtCrossSmooth\" size=\"3\"></font></td>
</tr>
<tr>
<td width=\"25%\" style=\"border-right-style: solid; border-right-width: 1; border-bottom-style: solid; border-bottom-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1\" height=\"25\" bgcolor=\"#C0C0C0\"> <font size=\"4\" color=\"#000080\">Overlay Field :</font></td>
<td width=\"25%\" height=\"25\"><font size=\"2\" color=\"#FF0000\"> (optional
)</font></td>
<td width=\"25%\" height=\"25\"> </td>
</tr>
<tr>
<td width=\"25%\" height=\"26\"><font size=\"2\"> Field </font>
<font face=\"Times New Roman\">
<SELECT size=\"1\" name=\"CmbBoxOverCrossField\" onchange=\"Unit(33,34,-1)\">
<option selected></option>
<OPTION>CLW</OPTION> <OPTION>DIV</OPTION>
<OPTION>HEIGHT</OPTION> <OPTION>ICE</OPTION> <OPTION>ICLW</OPTION>
<OPTION>IRNW</OPTION> <OPTION>LHFLUX</OPTION> <OPTION>LI</OPTION>
<OPTION>LWDOWN</OPTION> <OPTION>MDIV</OPTION> <OPTION>MSE</OPTION>
<OPTION>MSS</OPTION> <OPTION>P</OPTION> <OPTION>PBLHGT</OPTION>
<OPTION>PP</OPTION> <OPTION>PRH2O</OPTION> <OPTION>PSFC</OPTION>
<OPTION>PSLV</OPTION> <OPTION>PTEND</OPTION> <OPTION>PV</OPTION>
<OPTION>QV</OPTION> <OPTION>RAINC</OPTION> <OPTION>RAINN</OPTION>
<OPTION>RAINT</OPTION> <OPTION>RDTEND</OPTION> <OPTION>REGIME</OPTION>
<OPTION>RH</OPTION> <OPTION>RNW</OPTION> <OPTION>RTENDC</OPTION>
<OPTION>RTENDN</OPTION> <OPTION>RTENDT</OPTION> <OPTION>SHFLUX</OPTION>
<OPTION>SNOW</OPTION> <OPTION>SOIL T 1</OPTION> <OPTION>SOIL T 2</OPTION>
<OPTION>SOIL T 3</OPTION> <OPTION>SOIL T 4</OPTION>
<OPTION>SOIL T 5</OPTION> <OPTION>SOIL T 6</OPTION>
<OPTION>SWDOWN</OPTION> <OPTION>T</OPTION> <OPTION>TD</OPTION>
<OPTION>TDD</OPTION> <OPTION>TGD</OPTION> <OPTION>THETA</OPTION>
<OPTION>THETAE</OPTION> <OPTION>U</OPTION> <OPTION>UST</OPTION>
<OPTION>V</OPTION> <OPTION>VAB</OPTION> <OPTION>VESL</OPTION>
<OPTION>VOR</OPTION> <OPTION>W</OPTION>
<OPTION>WIND</OPTION></SELECT></font></td>
<td width=\"25%\" height=\"24\"><font size=\"2\"> Unit
<select size=\"1\" name=\"CmbBoxOverCrossUnit\">
</select></font></td>
<td width=\"25%\" height=\"24\"><font size=\"2\"> Contour
<input type=\"text\" name=\"EdtOverCrossContour\" size=\"2\"></font></td>
<td width=\"25%\" height=\"24\"><font size=\"2\"> Smooth
<input type=\"text\" name=\"EdtOverCrossSmooth\" size=\"3\"></font></td>
</tr>
<tr>
<td width=\"25%\" height=\"28\"> </td>
<td width=\"25%\" height=\"28\">
<input type=\"submit\" value=\"Add\" name=\"BtnCrossAdd\" style=\"float: right\" onclick=\"Choice(3)\"></td>
<td width=\"25%\" height=\"28\"> </td>
<td width=\"25%\" height=\"28\"> </td>
</tr>
</table>
<br>
<hr color=\"#C0C0C0\" width=\"600\" style=\"border-style: dotted; border-width: 1\">
<font color=\"#000080\" size=\"5\">Added Fields
</font><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"600\" id=\"AutoNumber2\">
<tr>
<td width=\"102\" align=\"center\" bgcolor=\"#000080\" style=\"border-style:solid; border-width:2; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1; color:#FFFFFF\">
<b>Field Name</b></td>
<td width=\"495\" align=\"center\" bgcolor=\"#000080\" style=\"border-style: solid; border-width: 2; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1; color:#FFFFFF\">
<b>Field Description</b></td>
</tr>";
//------------------------------------------------------------------------------
$bottom4="
</table>
<p>
<button name=\"BtnGraphRun\" style=\"width: 147; height: 26; border: 2px outset #ABABD6; \" type=\"button\" onclick=\"Choice(4)\">
<font color=\"#808000\">Click here to run Graph</font></button><br>
</p>
</center>
</div></form>";
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
$body5="
<frameset cols=\"213,*\">
<frame name=\"contents\" target=\"main\" src=\"mm5_p51.php\" scrolling=\"auto\" noresize>
<frame name=\"main\" src=\"mm5_p52.php\">
<noframes>
<body background=\"_themes/expeditn/exptextb.jpg\" bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#993300\" vlink=\"#666600\" alink=\"#CC3300\"><!--mstheme--><font face=\"Book Antiqua, Times New Roman, Times\">
<p>This page uses frames, but your browser doesn't support them.</p>
<!--mstheme--></font></body>
</noframes>
</frameset>
";
//------------------------------------------------------------------------------
function Modifier($filename,$dest,$src,$param)
{
$fout=fopen($dest.$filename,"w+");
$fin=fopen($src.$filename,"r");
$pindex=0;//array index
while(!feof($fin)){
$ch1=fgetc($fin);
if($ch1=="^"){
$ch2=$param[$pindex][0];
$i=1;
while($ch2!="#"){
fwrite($fout,$ch2);
$ch2=$param[$pindex][$i];
$i++;
}
$pindex++;
}
else fwrite($fout,$ch1);
}
fclose($fin);
fclose($fout);
//chmod($dest.$filename,0777);
}
function Terrain($user)
{
$param=array();
$fp=fopen("/mm5/files/user_folders/$user/domain.opt","r");
$line=fgets($fp,1024);
$fields=split(",",$line);
$MaxNestIX=0;
$MaxNestJX=0;
$param[2]=($fields[2]+$fields[4])/2; //PHIC
$param[3]=($fields[1]+$fields[3])/2; //XLON
$param[4]=$fields[22]; //IPROJ
while(!feof($fp)){
$param[5]=$fields[0];
$abs=abs($fields[2]-$fields[4]);
$tmp=round($abs*111/$fields[5]);
if($tmp>$MaxNestIX) $MaxNestIX=$tmp;
$param[6].=$tmp.","; //NestIX
$abs=abs($fields[1]-$fields[3]);
$tmp=round($abs*111/$fields[5]);
if($tmp>$MaxNestJX) $MaxNestJX=$tmp;
$param[7].=$tmp.","; //NestJY
$param[8].=$fields[5].","; //DIS
$param[9].=$fields[6].","; //NUMNC
$param[10].=round($fields[23]).","; //NESTI
$param[11].=round($fields[24]).","; //NESTJ
switch($fields[7]){//NTYPE
case "1 Deg":$param[12].="1,";break;
case "30 Min":$param[12].="2,";break;
case "10 Min":$param[12].="3,";break;
case "5 Min":$param[12].="4,";break;
case "2 Min":$param[12].="5,";break;
case "30 Sec":$param[12].="6,";break;
}
switch($fields[8]){//NSTTYPE
case "One way nest":$param[13].="1,";break;
case "Two way nest":$param[13].="2,";break;
}
$param[14].=$fields[4].","; //STARTLAT
$param[15].=$fields[2].","; //ENDLAT
$param[16].=$fields[1].","; //STRATLON
$param[17].=$fields[3].","; //ENDLON
$line=fgets($fp,1024);
$fields=split(",",$line);
}
fclose($fp);
$param[0]=$MaxNestIX; //IIMX
$param[1]=$MaxNestJX; //JJMX
for($i=0;$i<sizeof($param);$i++)
$param[$i].="#";
Modifier("terrain.deck","/mm5/TERRAIN/","/mm5/files/terrain/",$param);
}
function AryToStr($ary,$size){
$Str=$ary[0];
for($i=1;$i<$size;$i++)
$Str=$Str.",".$ary[$i];
return $Str;
}
function Config_user($user){
$param=array();
$fp=fopen("/mm5/files/user_folders/$user/domain.opt","r");
$line=fgets($fp,1024);
$fields=split(",",$line);
$DomainNO=0; //initialize
$MaxNestIX=0; //initialize
$MaxNestJX=0; //initialize
$MPHYS_ary=array(1,1,1,1,1,1,1,1,1,1); //init array for IMPHYS
$CUPA_ary=array(1,1,1,1,1,1,1,1,1,1); //init array for ICUPA
$BLTYP_ary=array(1,1,1,1,1,1,1,1,1,1); //init array for IBLTYP
$FRAd_ary=array(0,0,0,0,0); //init array for FRAD
$SHALLO_ary=array(0,0,0,0,0,0,0,0,0,0); //init array for ISHALLO
while(! feof($fp)){
$MPHYS_ary[$DomainNO]=$fields[25]; //IMPHYS
$CUPA_ary[$DomainNO]=$fields[26]; //ICUPA
$BLTYP_ary[$DomainNO]=$fields[27]; //IBLTYP
$FRAd_ary[$DomainNO]=$fields[28]; //FRAD
$SHALLO_ary[$DomainNO]=$fields[29]; //ISHALLO
$abs=abs($fields[2]-$fields[4]);
$tmp=round($abs*111/$fields[5]);
if($tmp>$MaxNestIX) $MaxNestIX=$tmp;
$abs=abs($fields[1]-$fields[3]);
$tmp=round($abs*111/$fields[5]);
if($tmp>$MaxNestJX) $MaxNestJX=$tmp;
$DomainNO++;
$line=fgets($fp,1024);
$fields=split(",",$line);
}
fclose($fp);
$param[0]=$DomainNO; //MAXNES
$param[1]=$MaxNestIX; //MIX
$param[2]=$MaxNestJX; //MJX
$param[3]=AryToStr($MPHYS_ary,10);
$param[4]=AryToStr($CUPA_ary,10);
$param[5]=AryToStr($BLTYP_ary,10);
$param[6]=AryToStr($FRAd_ary,5);
$param[7]=AryToStr($SHALLO_ary,10);
for($i=0;$i<sizeof($param);$i++)
$param[$i].="#";
Modifier("configure.user","/mm5/MM5/","/mm5/files/mm5/",$param);
}
function Rip($user){
$param=array();
$fp=fopen("/mm5/files/user_folders/$user/time.opt","r");
$line=fgets($fp,1024);
fclose($fp);
$fields=split(",",$line);
//all below fields have minute unit
$interval=$fields[8]; //tapfrq
$startpoint=0; //????
$endpoint=$fields[4]+$startpoint; //forecasting time
while($startpoint<=$endpoint){
$param[0].=$startpoint.","; //ptimes
$startpoint+=$interval;
}
for($i=0;$i<sizeof($param);$i++)
$param[$i].="#";
Modifier("rip_head","/mm5/files/user_folders/$user/","/mm5/files/rip/",$param);
Modifier("ripdp_sample.in","/mm5/RIP/","/mm5/files/rip/",$param);
}
function Pregrid($user)
{
$param=array();
$fp=fopen("/mm5/files/user_folders/$user/time.opt","r");
$line=fgets($fp,1024);
fclose($fp);
$fields=split(",",$line);
$start=split("[/.-]",$fields[0]);
$param[0]="/mm5/GLOBAL/".$fields[6]."/"."Tmp"."#"; //DATADIR
$param[1]=$start[2]."#"; //START_YEAR
$param[2]=$start[1]."#"; //START_MONTH
$param[3]=$start[0]."#"; //START_DAY
$param[4]=$fields[1]."#"; //START_HOUR
$end=split("[/.-]",$fields[2]);
$param[5]=$end[2]."#"; //END_YEAR
$param[6]=$end[1]."#"; //END_MONTH
$param[7]=$end[0]."#"; //END_DAY
$param[8]=$fields[3]."#"; //END_HOUR
$param[9]=$fields[7]."#"; //INTERVAL
Modifier("pregrid.csh","/mm5/REGRID/pregrid/","/mm5/files/regrid/",$param);
}
function Regridder($user)
{
$param=array();
$fp=fopen("/mm5/files/user_folders/$user/time.opt","r");
$line=fgets($fp,1024);
fclose($fp);
$fields=split(",",$line);
$start=split("[/.-]",$fields[0]);
$param[0]=$start[2]."#"; //START_YEAR
$param[1]=$start[1]."#"; //START_MONTH
$param[2]=$start[0]."#"; //START_DAY
$param[3]=$fields[1]."#"; //START_HOUR
$end=split("[/.-]",$fields[2]);
$param[4]=$end[2]."#"; //END_YEAR
$param[5]=$end[1]."#"; //END_MONTH
$param[6]=$end[0]."#"; //END_DAY
$param[7]=$fields[3]."#"; //END_HOUR
$param[8]=$fields[7]."#"; //INTERVAL
$fp=fopen("/mm5/files/user_folders/$user/domain.opt","r");
$line=fgets($fp,1024);
$fields=split(",",$line);
$param[9]=(($fields[2]+$fields[4])/2)."#"; //PHIC
$param[10]=(($fields[1]+$fields[3])/2)."#"; //XLON
Modifier("namelist.input","/mm5/REGRID/regridder/","/mm5/files/regrid/",$param);
}
function Interpf($user)
{
$param=array();
$fp=fopen("/mm5/files/user_folders/$user/time.opt","r");
$line=fgets($fp,1024);
fclose($fp);
$fields=split(",",$line);
$start=split("[/.-]",$fields[0]);
$param[0]=$start[2]."#"; //START_YEAR
$param[1]=$start[1]."#"; //START_MONTH
$param[2]=$start[0]."#"; //START_DAY
$param[3]=$fields[1]."#"; //START_HOUR
$end=split("[/.-]",$fields[2]);
$param[4]=$end[2]."#"; //END_YEAR
$param[5]=$end[1]."#"; //END_MONTH
$param[6]=$end[0]."#"; //END_DAY
$param[7]=$fields[3]."#"; //END_HOUR
$param[8]=$fields[7]."#"; //INTERVAL
Modifier("namelist.input","/mm5/INTERPF/","/mm5/files/interpf/",$param);
}
function Mm5($user)
{
$param=array();
$fp=fopen("/mm5/files/user_folders/$user/time.opt","r");
$line=fgets($fp,1024);
fclose($fp);
$fields=split(",",$line);
$start=split("[/.-]",$fields[0]);
$param[0]=$fields[4]; //TIMAX
$param[1]=$fields[5]; //TISTEP
$param[2]=$fields[9]; //SAVFRQ
$param[3]=$fields[8]; //TAPFRQ
$param[4]=$start[2]."-".$start[1]."-".$start[0]."_".$fields[1].":00:00"; //CDATEST
$fp=fopen("/mm5/files/user_folders/$user/mm5.opt","r");
$line=fgets($fp,1024);
fclose($fp);
$fields=split(",",$line);
$param[5]=$fields[0]; //RADFRQ
$param[6]=$fields[2]; //IMVDIF
$param[7]=$fields[3]; //IVQADV
$param[8]=$fields[4]; //IVTADV
$param[9]=$fields[5]; //ITHADV
$param[10]=$fields[6]; //ITPDIF
$param[11]=$fields[7]; //ICOR3D
$param[12]=$fields[8]; //IFUPR
$param[14]=$fields[1]; //IFDRY
$param[32]=$fields[9]; //ZZLND
$param[33]=$fields[10]; //ZZWTR
$param[34]=$fields[11]; //ALBLND
$param[35]=$fields[12]; //THINLD
$param[36]=$fields[13]; //XMAVA
$param[37]=$fields[14]; //CONF
$fp=fopen("/mm5/files/user_folders/$user/domain.opt","r");
$line=fgets($fp,1024);
$fields=split(",",$line);
while(!feof($fp)){
$param[13].=$fields[12].","; //IBOUDY
$param[15].=$fields[13].","; //IMOIAV
$param[16].=$fields[14].","; //IFSNOW
$param[17].=$fields[15].","; //ISFFLX
$param[18].=$fields[16].","; //ITGFLG
$param[19].=$fields[17].","; //ISFPAR
$param[20].=$fields[18].","; //ICLOUD
$param[21].=$fields[19].","; //IEVAP
$param[22].=$fields[11].","; //LEVIDN
$param[23].=$fields[6].","; //NUMNC
$abs=abs($fields[2]-$fields[4]);
$param[24].=round($abs*111/$fields[5]).","; //NestIX
$abs=abs($fields[1]-$fields[3]);
$param[25].=round($abs*111/$fields[5]).","; //NestJY
$param[26].=round($fields[23]).","; //NESTI
$param[27].=round($fields[24]).","; //NESTJ
$param[28].=$fields[9].","; //XSTNES
$param[29].=$fields[10].","; //XENNES
$param[30].=$fields[20].","; //IOVERW
$param[31].=$fields[21].","; //IACTIV
$line=fgets($fp,1024);
$fields=split(",",$line);
}
fclose($fp);
for($i=0;$i<sizeof($param);$i++)
$param[$i].="#";
Modifier("mm5.deck","/mm5/MM5/","/mm5/files/mm5/",$param);
}
function Little_R($user)
{
$param=array();
$fp=fopen("/mm5/files/user_folders/$user/time.opt","r");
$line=fgets($fp,1024);
fclose($fp);
$fields=split(",",$line);
$start=split("[/.-]",$fields[0]);
$param[0]=$start[2]."#"; //START_YEAR
$param[1]=$start[1]."#"; //START_MONTH
$param[2]=$start[0]."#"; //START_DAY
$param[3]=$fields[1]."#"; //START_HOUR
$end=split("[/.-]",$fields[2]);
$param[4]=$end[2]."#"; //END_YEAR
$param[5]=$end[1]."#"; //END_MONTH
$param[6]=$end[0]."#"; //END_DAY
$param[7]=$fields[3]."#"; //END_HOUR
$param[8]=$fields[7]."#"; //INTERVAL
$local="/mm5/LOCAL/";
$day=$start[0];
$month=$start[1];
$year=$start[2];
while(($day!=$end[0])or($month!=$end[1])or($year!=$end[2]))
{
$path=$local.$year.$month.$day;
$dh=opendir($path+"/obs");
while($file=readdir($dh))
$param[9].="'".$path."/obs/".$file."'"; //observatin data paths
closedir($dh);
$dh=opendir($path+"/sur");
while($file=readdir($dh))
$param[10].="'".$path."/sur/".$file."'"; //surface data paths
closedir($dh);
$day++;
switch($month){
case 2:$max=28;break;
case 4:
case 6:
case 9:
case 11:$max=30;break;
default:$max=31;
}
if($day>$max){$day=1;$month++;}
if($month>12){$month=1;$year++;}
}
Modifier("namelist.input","/mm5/LITTLE_R/","/mm5/files/little_r/",$param);
}
/**@correct dates that user select*/
function Correct_Date($line){
$fields=split(",",$line);
$parts=split("/",$fields[0]);
$syear=$parts[0];
$smonth=$parts[1];
$sday=$parts[2];
$shour=$fields[1];
$parts=split("/",$fields[2]);
$eyear=$parts[0];
$emonth=$parts[1];
$eday=$parts[2];
$ehour=$fields[3];
$tmp=$shour / 24;
$sday+=(int)$tmp;
$shour%=24;
switch($smonth){
case 2:$max=28;break;
case 4:
case 6:
case 9:
case 11:$max=30;break;
default:$max=31;
}
if($sday>$max){$sday=1;$smonth++;}
if($smonth>12){$smonth=1;$syear++;}
$tmp=$ehour / 24;
$eday+=(int)$tmp;
$ehour%=24;
switch($emonth){
case 2:$max=28;break;
case 4:
case 6:
case 9:
case 11:$max=30;break;
default:$max=31;
}
if($eday>$max){$eday=1;$emonth++;}
if($emonth>12){$emonth=1;$eyear++;}
if( ($ehour<10)and(strlen($ehour)<2) )$ehour="0".$ehour;
if( ($eday<10)and(strlen($eday)<2) )$eday="0".$eday;
if( ($emonth<10)and(strlen($emonth)<2) )$emonth="0".$emonth;
if( ($shour<10)and(strlen($shour)<2) )$shour="0".$shour;
if( ($sday<10)and(strlen($sday)<2) )$sday="0".$sday;
if( ($smonth<10)and(strlen($smonth)<2))$smonth="0".$smonth;
$line=$sday."/".$smonth."/".$syear.",".$shour.",".$eday."/".$emonth."/".$eyear.",".$ehour.",".
$fields[4].",".$fields[5].",".$fields[6].",".$fields[7].",".$fields[8].",".$fields[9].",";
return $line;
}
/**@copy need files to AVN/Tmp directory*/
function Copy_Need_Files_To_TmpDir($SDate,$SHour,$EDate,$EHour,$interval){
$SrcPath="/mm5/GLOBAL/AVN/";
$Dist="/mm5/GLOBAL/AVN/Tmp/";
system("rm /mm5/GLOBAL/AVN/Tmp/*");
$filename="gblav.t00z.pgrbf";
$parts=split("/",$SDate);
$syear=$parts[0];
$smonth=$parts[1];
$sday=$parts[2];
$parts=split("/",$EDate);
$eyear=$parts[0];
$emonth=$parts[1];
$eday=$parts[2];
$missfiles=array();
$suffix=0;
$step=$EHour;
$interval=(int)$interval/3600;
if( ($syear==$eyear)and($smonth==$emonth)and($sday==$eday) )$minimum=$SHour;
else $minimum=0;
while( ($syear<$eyear)or( ($syear==$eyear)and($smonth<$emonth) )or( ($syear==$eyear)and($smonth==$emonth)and($sday<=$eday) ) ){
$Src=$SrcPath.$eyear.$emonth.$eday."/";
while( $step>=$minimum ){
if( file_exists($Src.$filename.$step) ) copy($Src.$filename.$step,$Dist.$filename.$step."_".$suffix);
else array_push($missfiles,$step);
$step-=$interval;
$suffix++;
if( ($step>=0)and($step<10)and(strlen($step)) ) $step="0".$step;
}
$step%=24;
$eday--;
if($eday<1)$emonth--;
if($emonth<1){ $eyear--;$emonth=12;}
if($eday<1){
switch($emonth){
case 2:$eday=28;break;
case 4:
case 6:
case 9:
case 11:$eday=30;break;
default:$eday=31;break;
}
}
if( ($eday<10)and(strlen($eday)<2) )$eday="0".$eday;
if( ($emonth<10)and(strlen($emonth)<2) )$emonth="0".$emonth;
if( ($syear==$eyear)and($smonth==$emonth)and($sday>$eday) )break;
$i=0;
$Src=$SrcPath.$eyear.$emonth.$eday."/";
$len=sizeof($missfiles);
while($i<$len){
$misshour=array_shift($missfiles);
$misshour+=24;
if( file_exists($Src.$filename.$misshour) ) copy($Src.$filename.$misshour,$Dist.$filename.$misshour."_".$suffix);
else array_push($missfiles,$misshour);
$i++;
$suffix++;
}
}//end total while
}
//------------------------------------------------------------------------------
?>