Index: trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py
===================================================================
--- trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py	(revision 811)
+++ trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py	(revision 812)
@@ -26,4 +26,24 @@
 from PIL import Image
 
+
+
+### a function to read HTML arguments for coordinates
+def gethtmlcoord(userinput,defmin,defmax):
+   # accepted separators
+   separators = [":",";",",","/"] 
+   # initial values
+   val = -9999. ; vals = None ; vale = None ; foundinterv = False
+   if userinput == None:   userinput = "1"
+   # the main work. either all -- or an interval -- or a single value.
+   if userinput == "all":  isfree = 1 ; vals = defmin ; vale = defmax ; foundinterv = True
+   else:
+       for sep in separators:
+           isfree = 1 ; ind = userinput.find(sep)
+           if ind != -1: vals = float(userinput[:ind]) ; vale = float(userinput[ind+1:]) ; foundinterv = True
+   if not foundinterv: isfree = 0 ; val = float(userinput)
+   # return values
+   return isfree, val, vals, vale
+
+
 # for debugging in web browser
 cgitb.enable()
@@ -36,50 +56,18 @@
 query=mcd.mcd() #FG: import from module mcd
 
-# Get data from user-defined fields and define free dimensions
-# FG: add tests if var==None to have values in local without forms ones
-query.lat = -9999.
-getlat = form.getvalue("latitude")
-if getlat == None: getlat = "1"
-if getlat == "all":  islatfree = 1 ; query.lats = -90. ; query.late = 90.
-elif ";" in getlat:  islatfree = 1 ; ind = getlat.find(";") ; query.lats = float(getlat[:ind]) ; query.late = float(getlat[ind+1:])
-elif "," in getlat:  islatfree = 1 ; ind = getlat.find(",") ; query.lats = float(getlat[:ind]) ; query.late = float(getlat[ind+1:])
-elif "/" in getlat:  islatfree = 1 ; ind = getlat.find("/") ; query.lats = float(getlat[:ind]) ; query.late = float(getlat[ind+1:])
-else:                islatfree = 0 ; query.lat = float(getlat)
-
-query.lon = -9999.
-getlon = form.getvalue("longitude")
-if getlon == None: getlon = "1"
-if getlon == "all":  islonfree = 1 ; query.lons = -180. ; query.lone = 180.
-elif ";" in getlon:  islonfree = 1 ; ind = getlon.find(";") ; query.lons = float(getlon[:ind]) ; query.lone = float(getlon[ind+1:])
-elif "," in getlon:  islonfree = 1 ; ind = getlon.find(",") ; query.lons = float(getlon[:ind]) ; query.lone = float(getlon[ind+1:])
-elif "/" in getlon:  islonfree = 1 ; ind = getlon.find("/") ; query.lons = float(getlon[:ind]) ; query.lone = float(getlon[ind+1:])
-else:                islonfree = 0 ; query.lon = float(getlon)
-
-query.loct = -9999.
-getloct = form.getvalue("localtime")
-if getloct == None: getloct = "1"
-if getloct == "all": isloctfree = 1 ; query.locts = 0. ; query.locte = 24.
-elif ";" in getloct: isloctfree = 1 ; ind = getloct.find(";") ; query.locts = float(getloct[:ind]) ; query.locte = float(getloct[ind+1:])
-elif "," in getloct: isloctfree = 1 ; ind = getloct.find(",") ; query.locts = float(getloct[:ind]) ; query.locte = float(getloct[ind+1:])
-elif "/" in getloct: isloctfree = 1 ; ind = getloct.find("/") ; query.locts = float(getloct[:ind]) ; query.locte = float(getloct[ind+1:])
-else:                isloctfree = 0 ; query.loct = float(getloct)
-
+# Get the kind of vertical coordinates and choose default behavior for "all"
 try: query.zkey = int(form.getvalue("zkey"))
 except: query.zkey = int(3)
-
-query.xz = -9999.
-getalt = form.getvalue("altitude")
-if getalt == None: getalt = "1"
-if getalt == "all":  
-    isaltfree = 1 
-    if query.zkey == 2:    query.xzs = -5000.   ; query.xze = 100000.
-    elif query.zkey == 3:  query.xzs = 0.       ; query.xze = 120000.
-    elif query.zkey == 5:  query.xzs = -5000.   ; query.xze = 100000.
-    elif query.zkey == 4:  query.xzs = 1000.    ; query.xze = 0.001
-    elif query.zkey == 1:  query.xzs = 3396000. ; query.xze = 3596000.
-elif ";" in getalt:  isaltfree = 1 ; ind = getalt.find(";") ; query.xzs = float(getalt[:ind]) ; query.xze = float(getalt[ind+1:])
-elif "," in getalt:  isaltfree = 1 ; ind = getalt.find(",") ; query.xzs = float(getalt[:ind]) ; query.xze = float(getalt[ind+1:])
-elif "/" in getalt:  isaltfree = 1 ; ind = getalt.find("/") ; query.xzs = float(getalt[:ind]) ; query.xze = float(getalt[ind+1:])
-else:                isaltfree = 0 ; query.xz = float(getalt)
+if query.zkey == 2:    minxz = -5000.   ; maxxz = 100000.
+elif query.zkey == 3:  minxz = 0.       ; maxxz = 120000.
+elif query.zkey == 5:  minxz = -5000.   ; maxxz = 100000.
+elif query.zkey == 4:  minxz = 1000.    ; maxxz = 0.001
+elif query.zkey == 1:  minxz = 3396000. ; maxxz = 3596000.
+
+# Get data from user-defined fields and define free dimensions
+islatfree,  query.lat,  query.lats,  query.late  = gethtmlcoord( form.getvalue("latitude"),   -90.,  90. )
+islonfree,  query.lon,  query.lons,  query.lone  = gethtmlcoord( form.getvalue("longitude"), -180., 180. )
+isloctfree, query.loct, query.locts, query.locte = gethtmlcoord( form.getvalue("localtime"),    0.,  24. )
+isaltfree,  query.xz,   query.xzs,   query.xze   = gethtmlcoord( form.getvalue("altitude"),  minxz, maxxz)
 
 sumfree = islatfree + islonfree + isloctfree + isaltfree 
@@ -143,7 +131,7 @@
     ### getting data
     if isloctfree == 1:  	query.diurnal(nd=24) 
-    elif islonfree == 1: 	query.zonal()
-    elif islatfree == 1: 	query.meridional()
-    elif isaltfree == 1: 	query.profile()   
+    elif islonfree == 1: 	query.zonal(nd=64)
+    elif islatfree == 1: 	query.meridional(nd=48)
+    elif isaltfree == 1: 	query.profile(nd=35)   
     else:			exit()  
 
@@ -184,5 +172,7 @@
 #print "<br />"
 
-print "<a href='../index.html'>Click here to start a new query</a><br />"
+
+#print "<a href='../index.html'>Click here to start a new query</a><br />"
+#print "<hr>"
 
 ## Now the part which differs
@@ -191,4 +181,5 @@
 elif sumfree == 1:      
     print "<a href='"+txtname+"'>Click here to download an ASCII file containing data</a><br />"
+    print "<hr>"
     print "<img src='"+figname+"'><br />"
 else:			print "<h1>ERROR : sumfree is not or badly defined ...</h1></body></html>"
@@ -230,2 +221,3 @@
 ## Close opend file
 #fo.close()
+
Index: trunk/UTIL/PYTHON/mcd/proto/index.html
===================================================================
--- trunk/UTIL/PYTHON/mcd/proto/index.html	(revision 811)
+++ trunk/UTIL/PYTHON/mcd/proto/index.html	(revision 812)
@@ -15,10 +15,11 @@
 <!-- aussi possible: get a la place de post. pour avoir un beau lien -->
 
-<!--<form name="calendar" action="/marscgi-bin/mcdcgi.py" method="post"> <!--target="_new">-->
-<form name="calendar" action="./cgi-bin/mcdcgi.py" method="post"> <!--target="_new">-->
+<!--<form name="calendar" action="/marscgi-bin/mcdcgi.py" method="post"-->
+<form name="calendar" action="./cgi-bin/mcdcgi.py" method="post" target="_blank"> <!--target="_new">-->
 
 <center>
 <b style="font-size: 125%;">Mars Climate Database: The Web Interface</b><br>
-<img src="PIA03610_red.jpg" height=80 width=1200><br>
+<!--Welcome! To reset your query, click on the Mars panorama.-->
+<a href="index.html"><img src="PIA03610_red.jpg" height=80 width=1200></a><br>
 </center>
 
@@ -54,4 +55,5 @@
 Solar longitude <input type="text" size="3" name="ls"> degrees<br />
 Local Time <input type="text" size="4" name="localtime" value="0."> Martian hour<br />
+<br />
 <input type="radio" name="datekeyhtml" value="0">
 <b><font color="blue">EARTH date</font></b> 
@@ -62,8 +64,12 @@
 </td>
 <td align="center">
+Option for 2D maps: local time value is<br />
+<input type="radio" name="isfixedlt" value="off" checked /> at longitude 0
+<input type="radio" name="isfixedlt" value="on"          /> fixed for the whole planet<br />
+<hr>
 Earth Julian Date <input type="text" size="6" name="julian" readonly="readonly"><br />
-Martian year <input type="text" size="1" name="martianyear" readonly="readonly"> 
-month <input type="text" size="1" name="martianmonth" readonly="readonly"> / 12 <br />
-Martian sol <input type="text" size="2" name="sol" readonly="readonly"> / 669<br />
+Mars year <input type="text" size="1" name="martianyear" readonly="readonly"> 
+ - month <input type="text" size="1" name="martianmonth" readonly="readonly"><span style="font-size: 75%;"> / 12</span>
+ - sol <input type="text" size="2" name="sol" readonly="readonly"><span style="font-size: 75%;"> / 669</span><br />
 <input type="button" value="EARTH DATE >>> MARS DATE" onClick="Convert2Ls();"><br />
 </td>
@@ -107,9 +113,11 @@
 <li>Longitude <input type="text" size="7" name="longitude" value="0."> degree East
 <li>Altitude <input type="text" size="9" name="altitude" value="10."> <select name="zkey">
-<option value="1"         >m (O: Mars center)</option>
-<option value="2"         >m (O: "sea level")</option>
-<option value="3" selected>m (O: surface)</option>
-<option value="4"         >Pa (pressure)</option>
-<option value="5"         >m (O: 3396 km)</option>
+<option value="3" selected>m above surface</option>
+<option value="2"         >m above "sea level"</option>
+<option value="1"         >m from Mars center</option>
+<option value="4"         >Pa (pressure level)</option>
+<!--
+<option value="5"         >above 3396 km from Mars center</option>
+-->
 </select>
 <!--
@@ -189,8 +197,8 @@
 <option value="h2ovap"        >Water vapor vol. mixing ratio (mol/mol)</option>
 <option value="h2oice"        >Water ice mixing ratio (mol/mol)</option>
-<option value="ps_ddv"        >Surface pressure DTD RMS (Pa)</option>
+<option value="ps_ddv"        >Surf. pres. day to day variability (Pa)</option>
 <option value="co2ice"        >surface CO2 ice layer (kg/m2)</option>
 <option value="cp"            >Air heat capacity Cp (J kg-1 K-1)</option>
-<option value="rho_ddv"       >density DTD RMS (kg/m^3)</option>
+<option value="rho_ddv"       >density day to day variability (kg/m^3)</option>
 <option value="tsurfmx"       >daily max mean surf temperature (K)</option>
 <option value="tsurfmn"       >daily min mean surf temperature (K)</option>
@@ -218,8 +226,8 @@
 <option value="h2ovap"        >Water vapor vol. mixing ratio (mol/mol)</option>
 <option value="h2oice"        >Water ice mixing ratio (mol/mol)</option>
-<option value="ps_ddv"        >Surface pressure DTD RMS (Pa)</option>
+<option value="ps_ddv"        >Surf. pres. day to day variability (Pa)</option>
 <option value="co2ice"        >surface CO2 ice layer (kg/m2)</option>
 <option value="cp"            >Air heat capacity Cp (J kg-1 K-1)</option>
-<option value="rho_ddv"       >density DTD RMS (kg/m^3)</option>
+<option value="rho_ddv"       >density day to day variability (kg/m^3)</option>
 <option value="tsurfmx"       >daily max mean surf temperature (K)</option>
 <option value="tsurfmn"       >daily min mean surf temperature (K)</option>
@@ -247,8 +255,8 @@
 <option value="h2ovap"        >Water vapor vol. mixing ratio (mol/mol)</option>
 <option value="h2oice"        >Water ice mixing ratio (mol/mol)</option>
-<option value="ps_ddv"        >Surface pressure DTD RMS (Pa)</option>
+<option value="ps_ddv"        >Surf. pres. day to day variability (Pa)</option>
 <option value="co2ice"        >surface CO2 ice layer (kg/m2)</option>
 <option value="cp"            >Air heat capacity Cp (J kg-1 K-1)</option>
-<option value="rho_ddv"       >density DTD RMS (kg/m^3)</option>
+<option value="rho_ddv"       >density day to day variability (kg/m^3)</option>
 <option value="tsurfmx"       >daily max mean surf temperature (K)</option>
 <option value="tsurfmn"       >daily min mean surf temperature (K)</option>
@@ -276,8 +284,8 @@
 <option value="h2ovap"        >Water vapor vol. mixing ratio (mol/mol)</option>
 <option value="h2oice"        >Water ice mixing ratio (mol/mol)</option>
-<option value="ps_ddv"        >Surface pressure DTD RMS (Pa)</option>
+<option value="ps_ddv"        >Surf. pres. day to day variability (Pa)</option>
 <option value="co2ice"        >surface CO2 ice layer (kg/m2)</option>
 <option value="cp"            >Air heat capacity Cp (J kg-1 K-1)</option>
-<option value="rho_ddv"       >density DTD RMS (kg/m^3)</option>
+<option value="rho_ddv"       >density day to day variability (kg/m^3)</option>
 <option value="tsurfmx"       >daily max mean surf temperature (K)</option>
 <option value="tsurfmn"       >daily min mean surf temperature (K)</option>
@@ -298,7 +306,9 @@
 <input type="radio" name="iswind" value="off" checked /> No
 <input type="radio" name="iswind" value="on"          /> Yes</li>  
+<!--
 <li> Set same LT on whole planet
 <input type="radio" name="isfixedlt" value="off" checked /> No
 <input type="radio" name="isfixedlt" value="on"          /> Yes</li>
+-->
 <!--
 <li> Add another variable 
@@ -320,12 +330,13 @@
 <tr>
 <td align="center">
-<input type="submit" value="Values" style="font-weight:bold" />
-<input type="submit" value="Daily cycle" style="font-weight:bold" onClick="PlaceValues2('all')"/><br />
-<input type="submit" value="Vertical profile" style="font-weight:bold" onClick="PlaceValues3('all')"/>
-<input type="submit" value="Global map" style="font-weight:bold" onClick="PlaceValues('all','all')"/><br />
+<input type="button" value="Values" style="font-weight:bold" onClick="submit_form_beginner()"/>
+<input type="button" value="Daily cycle" style="font-weight:bold" onClick="PlaceValues2('all');submit_form_beginner()"/><br />
+<input type="button" value="Vertical profile" style="font-weight:bold" onClick="PlaceValues3('all');submit_form_beginner()"/>
+<input type="button" value="Global map" style="font-weight:bold" onClick="PlaceValues('all','all');submit_form_beginner()"/><br />
 </td>
 <td align="center">
 <input type="submit" value="SUBMIT" style="font-weight:bold"/>
-<input type="button" value="RESET" style="font-weight:bold" onClick="DefaultDateValues();DefaultTimeValues();Convert2Ls();PlaceValues(0.,0.);DefaultSpaceTime()"/><br />
+<!--<input type="button" value="RESET" style="font-weight:bold" onClick="DefaultDateValues();DefaultTimeValues();Convert2Ls();PlaceValues(0.,0.);DefaultSpaceTime()"/><br />-->
+<input type="button" value="RESET" style="font-weight:bold" onClick="window.open('index.html','_self')"/><br />
 </td>
 <td align="center">
Index: trunk/UTIL/PYTHON/mcd/proto/martian_time.js
===================================================================
--- trunk/UTIL/PYTHON/mcd/proto/martian_time.js	(revision 811)
+++ trunk/UTIL/PYTHON/mcd/proto/martian_time.js	(revision 812)
@@ -450,2 +450,13 @@
 }
 
+
+function submit_form_beginner() {
+document.calendar.submit();
+document.calendar.reset();
+DefaultDateValues();
+DefaultTimeValues();
+Convert2Ls();
+PlaceValues(0.,0.);
+DefaultSpaceTime()
+}
+
