#!/usr/bin/env perl use strict; my @dirs = ('../../ccsm_utils/Tools/per5lib', '../../ccsm_utils/Tools/perl5lib/Build'); unshift @INC, @dirs; require XML::Lite; use lib "../../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 ($file) = "../../ccsm_utils/Case.template/config_compsets.xml"; my $xml = XML::Lite->new( $file ); my $root = $xml->root_element(); # Check for valid root node my $name = $root->get_name(); $name eq "config_compset" or die "file $file 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'}) { 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 } #--------------------------------------------------------------------------------------------