#!/bin/perl -Tw # CGI script that creates a fill-out form # and echoes back its values. use CGI qw/:standard/; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time); $year = $year + 1900; $jdate = sprintf("%04d%02.2d%02.2d%02.2d%02.2d",$year,$mon+1,$mday,$min,$sec); $check = 0; # Open Output file for permanent record of response, name according to # date/time for unique names print header, start_html('CEOP Land Cover and Soils Information'); if (param()) { # print h1('Your Response was: '); # Convert from param() to variable name so we can change the answers # to accomodate line breaks, hot links. @names = param(); for($i=0; $i<= $#names; $i++) { $key = $names[$i]; $value{$key} = param($names[$i]); # Look for url's or e-mail addresses in text, if found make # them hot links. @fields = split(/ /,$value{$key}); for($j=0; $j<= $#fields; $j++) { if ($fields[$j] =~ /\.\w{2,3}/ && $fields[$j] !~ /@/ ) { if($fields[$j] =~ /^http/) { #$fields[$j] = substr($fields[$j],7); #$fields[$j] ="".$fields[$j]."
\n"; } else { #$fields[$j] ="".$fields[$j]."
\n"; } } elsif($fields[$j] =~ /\.\w{2,3}/ && $fields[$j] =~ /@/ ) { #$fields[$j] ="".$fields[$j]."
\n"; } } # Put everything back together $value{$key} = join(" ",@fields); # Look for non-expected characters and remove for security sake unless ($value{$key} =~ /\/.gt./g; } # Look for line breaks from textarea replies and preserve # formatting for html. If no answer given, insert blank. if ($value{$key}) { # print OUTFIL "key is defined: $_\n"; $value{$key} =~ s/\r\n/
/g; $value{$key} =~ s/\r/
/g; # Look for non-expected characters and remove for security sake $value{$key} =~ s/\\//g; $value{$key} =~ s/\&/and/g; $test = 1; } else { # print OUTFIL "$_ is not defined\n"; $value{$key} = " "; } } # if( param('title') !~ /\w+/) { # # print h2('ERROR - Title field is missing, please fill in missing blank on form - Thanks!'),hr; # $check = 1; # # } elsif( param('corr_email') !~ /\w+/) { # # print h2('ERROR - e-mail address is missing, please fill in missing blank on form - Thanks!'),hr; # $check = 1; # # } $fname = param('cse'); $fname2 = param('stn'); $fname =~ s/\s/_/g; $file=$fname."_".$fname2."_".$jdate; $file =~ m/^([a-zA-Z0-9\._]+)$/ or die "Bad data in first argument"; if(param('confirmation') && $check != 1) { # Write user response to Output file open (OUTFIL,">/web/docs/ghp/ceopdm/webresponse/veg/$1.html"); open (OUTFIL2,">>/web/docs/ghp/ceopdm/webresponse/veg/data/$1.txt"); print OUTFIL start_html('CEOP Land Cover and Soils Information'); # Print answers to questionnaire print OUTFIL table({-border=>undef,-width=>'80%',align=>center}, caption(strong('CEOP Land Cover and Soils Information')), Tr({-align=>LEFT,-valign=>CENTER}, [ th({-bgcolor=>"#6677ff",colspan=>2,align=>center},'Minimum Requirements - All Reference Sites are requested to fill out this portion ',), th({-bgcolor=>"#e5ffff"},'Which CEOP Continental Scale Experiment (CSE) and Reference Site are these repsonses related to?: ').td([($value{'cse'})]), th({-bgcolor=>"#e5ffff"},'Which Station at the Reference Site are these repsonses related to?: ').td([($value{'stn'})]), th({-bgcolor=>"#ccddee",align=>center,colspan=>2},'Soils Minimum Requirement ',), th({-bgcolor=>"#e5ffff"},'Surface sand, silt and clay percentages; or
texture class ').td([($value{'soil_min1'})]), th({-bgcolor=>"#e5ffff"},'Surface porosity (%) ').td([($value{'soil_min2'})]), th({-bgcolor=>"#ccddee",align=>center,colspan=>2},'Land Cover Minimum Requirement ',), th({-bgcolor=>"#e5ffff"},'Dominant land cover at the ground measurement location (detailed description or USGS class preferred; other classification optional) ').td([($value{'land_min1'})]), th({-bgcolor=>"#e5ffff"},'Has there been a major change in land cover at the ground measurement site during the period from 1 October 2002 to 31 December 2004 (e.g. deforestation, crop rotation, fires, etc)? If yes, please provide details. ').td([($value{'land_min2'})]), th({-bgcolor=>"#ccddee",align=>center,colspan=>2},'Elevation Minimum Requirement ',), th({-bgcolor=>"#e5ffff"},'Elevation (m) at the ground measurement location ').td([($value{'elev_min1'})]), th({-bgcolor=>"#6677ff",colspan=>2,align=>center},'Enhanced Information - All Reference Sites may fill out this section, but BALTEX Lindenberg, CAMP Tongyu, GAPP Bondville and MDB are specifically requested to fill out this section. ',), th({-bgcolor=>"#ccddee",colspan=>2,align=>center},'Soils Enhanced Information ',), th({-bgcolor=>"#e5ffff"},'Textures in deeper soil layers ').td([($value{'soil_enh1'})]), th({-bgcolor=>"#e5ffff"},'Porosity (%) in deeper soil layers ').td([($value{'soil_enh2'})]), th({-bgcolor=>"#e5ffff"},'Soil infiltration rate (mm/hr) ').td([($value{'soil_enh3'})]), th({-bgcolor=>"#e5ffff"},'Bulk dry density (g/cm3) ').td([($value{'soil_enh4'})]), th({-bgcolor=>"#e5ffff"},'Saturated hydraulic conductivity (cm/s) ').td([($value{'soil_enh5'})]), th({-bgcolor=>"#e5ffff"},'Soil Reference Group(s) (from World Reference Base for Soil Resources) ').td([($value{'soil_enh6'})]), th({-bgcolor=>"#ccddee",colspan=>2,align=>center},'Land Cover Enhanced Information ',), th({-bgcolor=>"#e5ffff"},'Land cover (approximate percentages of each type) within 50 m of the measurement location ').td([($value{'land_enh1'})]), th({-bgcolor=>"#e5ffff"},'Land cover (approximate percentages of each type) within 500 m of the measurement location (1 km pixel) ').td([($value{'land_enh2'})]), th({-bgcolor=>"#e5ffff"},'Land cover (approximate percentages of each type) within 12 km of the measurement location (1/4 degree pixel) ').td([($value{'land_enh3'})]), th({-bgcolor=>"#e5ffff"},'Are there seasonal land cover changes at this station (e.g. greening/harvesting, etc)? If yes, please provide details. Also provide typical or maximum seasonal LAI values. ').td([($value{'land_enh4'})]), th({-bgcolor=>"#ccddee",colspan=>2,align=>center},'Elevation Enhanced Information ',), th({-bgcolor=>"#e5ffff"},'Slope at the ground measurement location ').td([($value{'elev_enh1'})]), th({-bgcolor=>"#e5ffff"},'Mean elevation (m) and range of elevations in 1 km pixel ').td([($value{'elev_enh2'})]), ] ) ),br; close(OUTFIL); # Write pertinent information to data file so information can be summarized # using Filemaker Pro or other such program (fields are comma delimited) foreach $field ( param() ) { $value = param($field); $value =~ s/,/ /g; print OUTFIL2 "$field, $value,\n"; } close(OUTFIL2); # Write confirmation message and output table to screen one last time print start_html('CEOP Land Cover and Soils Information'); print h2('Your information has been sent to the JOSS Server. Thank you for submitting your information. To submit information for another station click here to return to the questionnaire.'),hr; } # Print answers to questionnaire unless (param('confirmation')) { print h2('
Please review your responses below and if you are satisfied with them click the CONFIRM button to submit your responses. If you need to change anything, change your answers in the form below and click the Preview Response button at the bottom of the form.
'),hr; print start_form, submit(-name=>'confirmation', -value=>"CONFIRM-Below answers are correct"),hr; } print table({-border=>undef,-width=>'80%',align=>center}, caption(strong('CEOP Land Cover and Soils Information')), Tr({-align=>LEFT,-valign=>CENTER}, [ th({-bgcolor=>"#6677ff",colspan=>2,align=>center},'Minimum Requirements - All Reference Sites are requested to fill out this portion ',), th({-bgcolor=>"#e5ffff"},'Which CEOP Continental Scale Experiment (CSE) and Reference Site are these repsonses related to?: ').td([($value{'cse'})]), th({-bgcolor=>"#e5ffff"},'Which Station at the Reference Site are these repsonses related to?: ').td([($value{'stn'})]), th({-bgcolor=>"#ccddee",align=>center,colspan=>2},'Soils Minimum Requirement ',), th({-bgcolor=>"#e5ffff"},'Surface sand, silt and clay percentages; or texture class ').td([($value{'soil_min1'})]), th({-bgcolor=>"#e5ffff"},'Surface porosity (%) ').td([($value{'soil_min2'})]), th({-bgcolor=>"#ccddee",align=>center,colspan=>2},'Land Cover Minimum Requirement ',), th({-bgcolor=>"#e5ffff"},'Dominant land cover at the ground measurement location (detailed description or USGS class preferred; other classification optional) ').td([($value{'land_min1'})]), th({-bgcolor=>"#e5ffff"},'Has there been a major change in land cover at the ground measurement site during the period from 1 October 2002 to 31 December 2004 (e.g. deforestation, crop rotation, fires, etc)? If yes, please provide details. ').td([($value{'land_min2'})]), th({-bgcolor=>"#ccddee",align=>center,colspan=>2},'Elevation Minimum Requirement ',), th({-bgcolor=>"#e5ffff"},'Elevation (m) at the ground measurement location ').td([($value{'elev_min1'})]), th({-bgcolor=>"#6677ff",colspan=>2,align=>center},'Enhanced Information - All Reference Sites may fill out this section, but BALTEX Lindenberg, CAMP Tongyu, GAPP Bondville and MDB are specifically requested to fill out this section. ',), th({-bgcolor=>"#ccddee",colspan=>2,align=>center},'Soils Enhanced Information ',), th({-bgcolor=>"#e5ffff"},'Textures in deeper soil layers ').td([($value{'soil_enh1'})]), th({-bgcolor=>"#e5ffff"},'Porosity (%) in deeper soil layers ').td([($value{'soil_enh2'})]), th({-bgcolor=>"#e5ffff"},'Soil infiltration rate (mm/hr) ').td([($value{'soil_enh3'})]), th({-bgcolor=>"#e5ffff"},'Bulk dry density (g/cm3) ').td([($value{'soil_enh4'})]), th({-bgcolor=>"#e5ffff"},'Saturated hydraulic conductivity (cm/s) ').td([($value{'soil_enh5'})]), th({-bgcolor=>"#e5ffff"},'Soil Reference Group(s) (from World Reference Base for Soil Resources) ').td([($value{'soil_enh6'})]), th({-bgcolor=>"#ccddee",colspan=>2,align=>center},'Land Cover Enhanced Information ',), th({-bgcolor=>"#e5ffff"},'Land cover (approximate percentages of each type) within 50 m of the measurement location ').td([($value{'land_enh1'})]), th({-bgcolor=>"#e5ffff"},'Land cover (approximate percentages of each type) within 500 m of the measurement location (1 km pixel) ').td([($value{'land_enh2'})]), th({-bgcolor=>"#e5ffff"},'Land cover (approximate percentages of each type) within 12 km of the measurement location (1/4 degree pixel) ').td([($value{'land_enh3'})]), th({-bgcolor=>"#e5ffff"},'Are there seasonal land cover changes at this station (e.g. greening/harvesting, etc)? If yes, please provide details. Also provide typical or maximum seasonal LAI values. ').td([($value{'land_enh4'})]), th({-bgcolor=>"#ccddee",colspan=>2,align=>center},'Elevation Enhanced Information ',), th({-bgcolor=>"#e5ffff"},'Slope at the ground measurement location ').td([($value{'elev_enh1'})]), th({-bgcolor=>"#e5ffff"},'Mean elevation (m) and range of elevations in 1 km pixel ').td([($value{'elev_enh2'})]), ] ) ),br,hr,br,br; unless (param('confirmation')) { print h2('
If the above answers are correct please click the CONFIRM button to submit your responses. If you need to change anything, change your answers in the form below and click the Preview Response button at the bottom of the form.
'),hr; print start_form, submit(-name=>'confirmation', -value=>"CONFIRM-Above answers are correct"),hr; } } else { print start_form; } unless (param('confirmation')) { print h1('
Land Cover and Soils Questionnaire
'), '
The following questionnaire is being utilized to collect a set of land cover and soils information from every station at every CEOP Reference Site. You will need to fill out a separate form for every station at your reference site. Each Reference Site is requested to provide responses to the "Minimum Requirements" section. Each Reference Site may also respond to the "Enhanced Information" section, but the BALTEX Lindenberg, CAMP Tongyu, GAPP Bondville and MDB Reference Sites are specifically requested to provide responses to this section. After an initial study is completed, further information requirements will be determined and additional metadata may be requested.

Please fill out as completely as possible the sections that are required for your reference site. Once you have completed filling out your required sections click on the Preview Response button at the bottom of this web page. A summary of your responses will then appear above this questionnaire. Please check over your response for any errors or omissions and change as desired. In order for your response to be registered, you must click on the Confirm button on that page after you are satisfied with your responses.

', table({-border=>undef,width=>'80%',align=>center}, caption(strong(' ')), Tr({-align=>LEFT,-valign=>CENTER}, [ th({-bgcolor=>"#6677ff",colspan=>2,align=>center},['Minimum Requirements - All Reference Sites are requested to fill out this portion ',]), th({-bgcolor=>"#e5ffff"},['Which CEOP Continental Scale Experiment (CSE) and Reference Site are these responses related to?: ', popup_menu(-name=>'cse',-value=>['BALTEX Cabauw', 'BALTEX Lindenberg','BALTEX Norunda','BALTEX Sodankyla','CAMP Chao-Phraya River', 'CAMP Equatorial Island','CAMP Himalayas','CAMP Korean Haenam','CAMP Korean Peninsula', 'CAMP Mongolia', 'CAMP Northeast Thailand', 'CAMP Northern South China Sea - Southern Japan', 'CAMP Siberia Taiga','CAMP Siberia Tundra','CAMP Tibet','CAMP Tongyu','CAMP Western Pacific Ocean','CATCH Niamey', 'CATCH Oueme','GAPP Bondville','GAPP Ft. Peck','GAPP Mt. Bigelow','GAPP Oak Ridge','GAPP SGP', 'LBA Brasilia','LBA Caxiuana','LBA Manaus','LBA Pantanal','LBA Rondonia','LBA Santarem','MAGS BERMS', 'MDB Murrumbidgee','MDB Tumbarumba','Other ARM NSA','Other ARM TWP'])]), th({-bgcolor=>"#e5ffff"},['Which Station at the Reference Site are these responses related to?: ', textarea(-name=>'stn',-rows=>2,columns=>60)]), th({-bgcolor=>"#ccddee",colspan=>2,align=>center},['Soils Minimum Requirement ',]), th({-bgcolor=>"#e5ffff"},['Surface sand, silt and clay percentages; or texture class ', textarea(-name=>'soil_min1',-rows=>4,-columns=>60)]), th({-bgcolor=>"#e5ffff"},['Surface porosity (%) ', textarea(-name=>'soil_min2',-rows=>4,-columns=>60)]), th({-bgcolor=>"#ccddee",colspan=>2,align=>center},['Land Cover Minimum Requirement ',]), th({-bgcolor=>"#e5ffff"},['Dominant land cover at the ground measurement location (detailed description or USGS class preferred; other classification optional, but specify) ', textarea(-name=>'land_min1',-rows=>4,-columns=>60)]), th({-bgcolor=>"#e5ffff"},['Has there been a major change in land cover at the ground measurement site during the period from 1 October 2002 to 31 December 2004 (e.g. deforestation, crop rotation, fires, etc)? If yes, please provide details. ', textarea(-name=>'land_min2',-rows=>4,-columns=>60)]), th({-bgcolor=>"#ccddee",colspan=>2,align=>center},['Elevation Minimum Requirement ',]), th({-bgcolor=>"#e5ffff"},['Elevation (m) at the ground measurement location ', textarea(-name=>'elev_min1',-rows=>4,-columns=>60)]), th({-bgcolor=>"#ffffff",colspan=>2,align=>center},['  ',]), th({-bgcolor=>"#6677ff",colspan=>2,align=>center},['Enhanced Information - All Reference Sites may fill out this section, but BALTEX Lindenberg, CAMP Tongyu, GAPP Bondville and MDB are specifically requested to fill out this section. ',]), th({-bgcolor=>"#ccddee",colspan=>2,align=>center},['Soils Enhanced Information ',]), th({-bgcolor=>"#e5ffff"},['Textures in deeper soil layers
Layer sand, silt and clay percentages; or texture class
', textarea(-name=>'soil_enh1',-rows=>4,-columns=>60)]), th({-bgcolor=>"#e5ffff"},['Porosity (%) in deeper soil layers ', textarea(-name=>'soil_enh2',-rows=>4,-columns=>60)]), th({-bgcolor=>"#e5ffff"},['Soil infiltration rate (mm/hr) ', textarea(-name=>'soil_enh3',-rows=>4,-columns=>60)]), th({-bgcolor=>"#e5ffff"},['Bulk dry density (g/cm3) ', textarea(-name=>'soil_enh4',-rows=>4,-columns=>60)]), th({-bgcolor=>"#e5ffff"},['Saturated hydraulic conductivity (cm/s) ', textarea(-name=>'soil_enh5',-rows=>4,-columns=>60)]), th({-bgcolor=>"#e5ffff"},[' Soil Reference Group(s) (from World Reference Base for Soil Resources) ', textarea(-name=>'soil_enh6',-rows=>4,-columns=>60)]), th({-bgcolor=>"#ccddee",colspan=>2,align=>center},['Land Cover Enhanced Information ',]), th({-bgcolor=>"#e5ffff"},['Land cover (approximate percentages of each type) within 50 m of the measurement location
(detailed description or USGS class preferred; other classification optional, but specify)
', textarea(-name=>'land_enh1',-rows=>4,-columns=>60)]), th({-bgcolor=>"#e5ffff"},['Land cover (approximate percentages of each type) within 500 m of the measurement location (1 km pixel)
(detailed description or USGS class preferred; other classification optional, but specify)
', textarea(-name=>'land_enh2',-rows=>4,-columns=>60)]), th({-bgcolor=>"#e5ffff"},['Land cover (approximate percentages of each type) within 12 km of the measurement location (1/4 degree pixel)
(detailed description or USGS class preferred; other classification optional, but specify)
', textarea(-name=>'land_enh3',-rows=>4,-columns=>60)]), th({-bgcolor=>"#e5ffff"},['Are there seasonal land cover changes at this station (e.g. greening/harvesting, etc)? If yes, please provide details. Also provide typical or maximum seasonal LAI values. ', textarea(-name=>'land_enh4',-rows=>4,-columns=>60)]), th({-bgcolor=>"#ccddee",colspan=>2,align=>center},['Elevation Enhanced Information ',]), th({-bgcolor=>"#e5ffff"},['Slope at the ground measurement location ', textarea(-name=>'elev_enh1',-rows=>4,-columns=>60)]), th({-bgcolor=>"#e5ffff"},['Mean elevation (m) and range of elevations in 1 km pixel ', textarea(-name=>'elev_enh2',-rows=>4,-columns=>60)]), ] ) ), submit(-name=>'send',-value=>"Preview Response"), defaults(-name=>'Clear Form'), end_form, hr; }