#!/usr/bin/env perl
use strict;
my @dirs = ('../../ccsm_utils/Tools/per5lib', '../../ccsm_utils/Tools/perl5lib/Build');
unshift @INC, @dirs;
require Build::NamelistDefinition;
use lib "../../ccsm_utils/Tools/perl5lib";
my $image_dir = "./images";
print <<"END_of_Start";
CESM Component Models Namelist Definitions
Search or Browse DRV Component Model Namelist Variables
This page contains the complete list of DRV namelist 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.
Found standard names matching query:
END_of_Start
my $nldef_file = "../../../models/drv/bld/namelist_files/namelist_definition_drv.xml";
my $nldef = Build::NamelistDefinition->new($nldef_file);
# Get list of categories in the definition file.
my @nldef_cats = $nldef->get_categories();
# Construct hash from @nldef_cats and use it to keep track of
# the categories that aren't treated explicitly below, then add them to the
# table at the end.
my %nldef_cats = ();
foreach my $k (@nldef_cats) {
$nldef_cats{$k} = '';
}
# The default output will organize the namelist variables according to the
# "category" attribute which is part of the definition. The ordering of the
# categories is set in the @categories array. The table headings are defined
# in the %cat_heading hash (order is not important in the hash definition).
my @categories = qw/
seq_flds
expdef
control
domain_check
mapping
budget
history
orbital
time
ccsm_pes
performance
pio
/;
my %cat_heading = (
'seq_flds' => 'DRV: Component Field Exchange (drv_in) ',
'expdef' => 'DRV: Experiment Definition (drv_in)',
'control' => 'DRV: Control (drv_in)',
'domain_check' => 'DRV: Domain Check (drv_in)',
'mapping' => 'DRV: Mapping (seq_maps.rc)',
'budget' => 'DRV: Budgets (drv_in)',
'history' => 'DRV: History (drv_in)',
'orbital' => 'DRV: Orbital Control Settings (drv_in)',
'time' => 'DRV: Time Manager (drv_in)',
'ccsm_pes' => 'DRV: PE Layout (drv_in)',
'performance' => 'DRV: Performance Timers (drv_in)',
'pio' => 'DRV: Parallel I/O Settings (drv_in)',
);
foreach my $cat (@categories) {
unless ($cat_heading{$cat} eq 'exclude') {
# Print table
print_start_table($cat, $cat_heading{$cat});
# get alphabetized list all the variable names in the category
my @vars = $nldef->get_var_names('category'=>$cat);
# get corresponding type and documentation
foreach my $var (@vars) {
my $type = $nldef->get_var_type($var);
my $doc = $nldef->get_var_doc_html($var);
my $grp = $nldef->get_group_name($var);
print_row($var, $type, $doc, $grp);
}
# Finish table
print_end_table();
}
$nldef_cats{$cat} = 'done';
}
# Finish
print <<"END_of_html";