#!/usr/bin/env perl use strict; if ( $#ARGV != 0 ) { die "Wrong number of input arguments -- should just enter one filename\n"; } my $infilename = $ARGV[0]; if ( ! -f $infilename ) { die "Input file: $infilename does NOT exist\n"; } my @dirs = ('../../../../../../scripts/ccsm_utils/Tools/per5lib', '../../../../../../scripts//ccsm_utils/Tools/perl5lib/Build'); unshift @INC, @dirs; require XML::Lite; use lib "../../../../../../scripts/ccsm_utils/Tools/perl5lib"; my $image_dir = "./images"; print <<"END_of_Start"; CESM Component Models Namelist Definitions

Search or Browse supported component sets

This page contains the complete list of config_grid.xml variables available. They are grouped by categories designed to aid browsing. Clicking on the name of a variable will display descriptive information. If search terms are entered in the text box below, the list will be condensed to contain only matched variables.


(separate search terms with spaces)
END_of_Start my $xml = XML::Lite->new( $infilename ); my $root = $xml->root_element(); # Check for valid root node my $name = $root->get_name(); $name eq "config_compset" or die "file $infilename is not a compset definition file\n"; # Print table print_start_table("config_compsets.xml variables"); my @e = $xml->elements_by_name( "compset" ); my %a = (); while ( my $e = shift @e ) { %a = $e->get_attributes(); if ($a{'NAME'} =~ /I_/ ) { my $var = $a{'NAME'}; my $doc = "Description: $a{DESC} \n"; my $grp = "$a{SHORTNAME}"; print_row($var, $doc, $grp); } } print_end_table(); # Finish print <<"END_of_html"; END_of_html #-------------------------------------------------------------------------------------------- sub print_start_table { my $hdr = shift; print <<"START_table";

$hdr

START_table } #-------------------------------------------------------------------------------------------- sub print_row { my $name = shift; my $doc = shift; my $grp = shift; print <<"END_of_row"; END_of_row } #-------------------------------------------------------------------------------------------- sub print_end_table { print <<"END_table";
Compset Name Short Name
$name $grp
END_table } #--------------------------------------------------------------------------------------------