diff --git a/.config_files.xml b/.config_files.xml
index e07f99db..22860601 100644
--- a/.config_files.xml
+++ b/.config_files.xml
@@ -5,19 +5,19 @@
 <entry_id>
 
   <!-- This is the same as the default entry in
-       cime/config/cesm/config_files.xml except for the value for clm:
-       In a standalone clm checkout, COMP_ROOT_DIR_LND is $SRCROOT
-       rather than $SRCROOT/components/clm.
+       cime/config/cesm/config_files.xml except for the value for slim:
+       In a standalone slim checkout, COMP_ROOT_DIR_LND is $SRCROOT
+       rather than $SRCROOT/components/slim.
 
        However, because of the way overrides are handled, we need to
        re-specify the full information here rather than just overriding
-       the value for clm.
+       the value for slim.
   -->
   <entry id="COMP_ROOT_DIR_LND">
     <type>char</type>
     <default_value>unset</default_value>
     <values>
-      <value component="clm"       >$SRCROOT</value>
+      <value component="slim"      >$SRCROOT</value>
       <value component="dlnd"      >$CIMEROOT/src/components/data_comps/dlnd</value>
       <value component="slnd"      >$CIMEROOT/src/components/stub_comps/slnd</value>
       <value component="xlnd"      >$CIMEROOT/src/components/xcpl_comps/xlnd</value>
diff --git a/.gitignore b/.gitignore
index 5f93baa3..85538e29 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,3 +33,8 @@ core.*
 *.gz
 *.log !run.log
 *.pyc
+
+# buildnml testing
+cime_config/buildnml_test/run
+cime_config/buildnml_test/Buildconf
+cime_config/buildnml_test/buildnml.log
diff --git a/README b/README
index 45f7759c..ffaafcef 100644
--- a/README
+++ b/README
@@ -3,9 +3,7 @@ Important files in main directories:
 =============================================================================================
 
 Externals.cfg --------------- File for management of the main high level externals
-Externals_CLM.cfg ----------- File for management of the CLM specific externals (i.e. FATES)
-
-bld/configure --------------- Script to prepare CLM to be built.
+Externals_SLIM.cfg ---------- File for management of the SLIM specific externals (if any)
 
 =============================================================================================
     QUICKSTART: using the CPL7 scripts:
@@ -13,9 +11,9 @@ bld/configure --------------- Script to prepare CLM to be built.
 
          cd cime/scripts
          ./create_newcase            # get help on how to run create_newcase
-         ./create_newcase --case testI --res f19_g16 --compset I2000Clm50BgcCrop --mach cheyenne
+         ./create_newcase --case testI --res f19_g17 --compset I2000SlimRsGs --mach cheyenne
                                      # create new "I" case for cheyenne_intel at 1.9x2.5_gx1v7 res
-                                     # "I2000Clm50BgcCrop" case is clm5_0 active, datm8, and inactive ice/ocn
+                                     # "I2000SlimRsGs" case is SLIM active, datm8, and inactive ice/ocn/glc/rof
          cd testI
          ./case.setup                # create the $CASE.run file
          ./case.build                # build model and create namelists
diff --git a/bld/CESM_cppdefs b/bld/CESM_cppdefs
deleted file mode 100644
index 8d1c8b69..00000000
--- a/bld/CESM_cppdefs
+++ /dev/null
@@ -1 +0,0 @@
- 
diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm
deleted file mode 100644
index 70f3508a..00000000
--- a/bld/CLMBuildNamelist.pm
+++ /dev/null
@@ -1,1805 +0,0 @@
-# build-namelist
-#
-# This script builds the namelists for CLM
-#
-# The simplest use of build-namelist is to execute it from the build directory where configure
-# was run.  By default it will use the config_cache.xml file that was written by configure to
-# determine the build time properties of the executable, and will write the files that contain
-# the output namelists in that same directory.  But if multiple runs are to made using the
-# same executable, successive invocations of build-namelist will overwrite previously generated
-# namelist files.  So generally the best strategy is to invoke build-namelist from the run
-# directory and use the -config option to provide the filepath of the config_cache.xml file.
-#
-#
-# Date        Contributor      Modification
-# -------------------------------------------------------------------------------------------
-# 2009-01-20  Vertenstein      Original version
-# 2010-04-27  Kluzek           Add ndep streams capability
-# 2011-07-25  Kluzek           Add multiple ensemble's of namelists
-# 2012-03-23  Kluzek           Add megan namelist and do checking on it
-# 2012-07-01  Kluzek           Add some common CESM namelist options
-# 2013-12     Andre            Refactor everything into subroutines
-# 2013-12     Muszala          Add Ecosystem Demography functionality
-# 2017-08-17  Lague			   Add namelist options for simple land model (MML)
-#--------------------------------------------------------------------------------------------
-
-package CLMBuildNamelist;
-
-require 5;
-
-use strict;
-#use warnings;
-#use diagnostics;
-
-use Cwd qw(getcwd abs_path);
-use File::Basename qw(dirname);
-use English;
-use Getopt::Long;
-use IO::File;
-use File::Glob ':glob';
-
-#-------------------------------------------------------------------------------
-#
-# Define a small number of global variables
-#
-#-------------------------------------------------------------------------------
-
-(my $ProgName = $0) =~ s!(.*)/!!;      # name of this script
-my $ProgDir  = $1;
-$ProgName = "CLM " . "$ProgName";
-
-my $cwd = abs_path(getcwd());  # absolute path of the current working directory
-my $log;                       # Log messages object -- will be set in main, declaring it global here means it can be used everywhere
-
-#-------------------------------------------------------------------------------
-
-sub usage {
-    die <<EOF;
-SYNOPSIS
-     build-namelist [options]
-
-     Create the namelist for CLM
-REQUIRED OPTIONS
-     -cimeroot "directory"    Path to cime directory
-     -config "filepath"       Read the given CLM configuration cache file.
-                              Default: "config_cache.xml".
-     -d "directory"           Directory where output namelist file will be written
-                              Default: current working directory.
-     -envxml_dir "directory"  Directory name of env_*.xml case files to read in.
-                              (if read they allow user_nl_clm and CLM_BLDNML_OPTS to expand
-                               variables [for example to use \$DIN_LOC_ROOT])
-                              (default current directory)
-     -lnd_frac "domainfile"   Land fraction file (the input domain file)
-     -res "resolution"        Specify horizontal grid.  Use nlatxnlon for spectral grids;
-                              dlatxdlon for fv grids (dlat and dlon are the grid cell size
-                              in degrees for latitude and longitude respectively)
-                              "-res list" to list valid resolutions.
-                              (default: 0.9x1.25)
-     -sim_year "year"         Year to simulate for input datasets
-                              (i.e. 1850, 2000, 1850-2000, 1850-2100)
-                              "-sim_year list" to list valid simulation years
-                              (default 2000)
-OPTIONS
-     -[no-]chk_res            Also check [do NOT check] to make sure the resolution and
-                              land-mask is valid.
-     -clm_demand "list"       List of variables to require on clm namelist besides the usuals.
-                              "-clm_demand list" to list valid options.
-                              (can include a list member "null" which does nothing)
-     -clm_start_type "type"   Start type of simulation
-                              (default, cold, arb_ic, startup, continue, or branch)
-                              (default=do the default type for this configuration)
-                              (cold=always start with arbitrary initial conditions)
-                              (arb_ic=start with arbitrary initial conditions if
-                               initial conditions do not exist)
-                              (startup=ensure that initial conditions are being used)
-     -csmdata "dir"           Root directory of CESM input data.
-                              Can also be set by using the CSMDATA environment variable.
-     -help [or -h]            Print usage to STDOUT.
-     -ignore_ic_date          Ignore the date on the initial condition files
-                              when determining what input initial condition file to use.
-     -ignore_ic_year          Ignore just the year part of the date on the initial condition files
-                              when determining what input initial condition file to use.
-     -ignore_warnings         Allow build-namelist to continue, rather than stopping on 
-                              warnings
-     -infile "filepath"       Specify a file (or list of files) containing namelists to
-                              read values from.
-
-                              If used with a CLM build with multiple ensembles (ninst_lnd>1)
-                              and the filename entered is a directory to files of the
-                              form filepath/filepath and filepath/filepath_\$n where \$n
-                              is the ensemble member number. the "filepath/filepath"
-                              input namelist file is the master input namelist file
-                              that is applied to ALL ensemble members.
-
-                              (by default for CESM this is setup for files of the
-                               form \$CASEDIR/user_nl_clm/user_nl_clm_????)
-     -inputdata "filepath"    Writes out a list containing pathnames for required input datasets in
-                              file specified.
-     -l_ncpl "LND_NCPL"       Number of CLM coupling time-steps in a day.
-     -mask "landmask"         Type of land-mask (default, navy, gx3v5, gx1v5 etc.)
-                              "-mask list" to list valid land masks.
-     -namelist "namelist"     Specify namelist settings directly on the commandline by supplying
-                              a string containing FORTRAN namelist syntax, e.g.,
-                                 -namelist "&clm_inparm dt=1800 /"
-     -[no-]note               Add note to output namelist  [do NOT add note] about the
-                              arguments to build-namelist.
-     -output_reals <file>     Output real parameters to the given output file.
-     -rcp "value"             Representative concentration pathway (rcp) to use for
-                              future scenarios.
-                              "-rcp list" to list valid rcp settings.
-     -s                       Turns on silent mode - only fatal messages issued.
-     -test                    Enable checking that input datasets exist on local filesystem.
-     -use_case "case"         Specify a use case which will provide default values.
-                              "-use_case list" to list valid use-cases.
-     -verbose [or -v]         Turn on verbose echoing of informational messages.
-     -version                 Echo the SVN tag name used to check out this CLM distribution.
-
-
-Note: The precedence for setting the values of namelist variables is (highest to lowest):
-      0. namelist values set by specific command-line options, like, -d, -sim_year
-             (i.e.  compset choice and CLM_BLDNML_OPTS, LND_TUNING_MODE env_run variables)
-     (NOTE: If you try to contradict these settings by methods below, an error will be triggered)
-      1. values set on the command-line using the -namelist option,
-             (i.e. CLM_NAMELIST_OPTS env_run variable)
-      2. values read from the file(s) specified by -infile,
-             (i.e.  user_nl_clm files)
-      4. values set from a use-case scenario, e.g., -use_case
-             (i.e.  CLM_NML_USE_CASE env_run variable)
-      5. values from the namelist defaults file.
-EOF
-}
-
-#-------------------------------------------------------------------------------
-
-sub process_commandline {
-  # Process command-line options and return the hash
-  my ($nl_flags) = @_;
-
-  # Save the command line arguments to the script. NOTE: this must be
-  # before GetOptions() is called because items are removed from from
-  # the array!
-  $nl_flags->{'cmdline'} = "@ARGV";
-
-  my %opts = ( cimeroot              => undef,
-               config                => "config_cache.xml",
-               csmdata               => undef,
-               clm_demand            => "null",
-               help                  => 0,
-               l_ncpl                => undef,
-               lnd_frac              => undef,
-               dir                   => "$cwd",
-               rcp                   => "default",
-               sim_year              => "default",
-               chk_res               => undef,
-               note                  => undef,
-               output_reals_filename => undef,
-               res                   => "default",
-               silent                => 0,
-               ignore_warnings       => 0,
-               mask                  => "default",
-               test                  => 0,
-               bgc                   => "default",
-               envxml_dir            => ".",
-               maxpft                => "default",
-             );
-
-  GetOptions(
-             "cimeroot=s"                => \$opts{'cimeroot'},
-             "clm_demand=s"              => \$opts{'clm_demand'},
-             "config=s"                  => \$opts{'config'},
-             "csmdata=s"                 => \$opts{'csmdata'},
-             "envxml_dir=s"              => \$opts{'envxml_dir'},
-             "ignore_warnings!"          => \$opts{'ignore_warnings'},
-             "chk_res!"                  => \$opts{'chk_res'},
-             "note!"                     => \$opts{'note'},
-             "d:s"                       => \$opts{'dir'},
-             "h|help"                    => \$opts{'help'},
-             "ignore_ic_date"            => \$opts{'ignore_ic_date'},
-             "ignore_ic_year"            => \$opts{'ignore_ic_year'},
-             "infile=s"                  => \$opts{'infile'},
-             "lnd_frac=s"                => \$opts{'lnd_frac'},
-             "l_ncpl=i"                  => \$opts{'l_ncpl'},
-             "inputdata=s"               => \$opts{'inputdata'},
-             "mask=s"                    => \$opts{'mask'},
-             "namelist=s"                => \$opts{'namelist'},
-             "res=s"                     => \$opts{'res'},
-             "rcp=s"                     => \$opts{'rcp'},
-             "s|silent"                  => \$opts{'silent'},
-             "sim_year=s"                => \$opts{'sim_year'},
-             "output_reals=s"            => \$opts{'output_reals_filename'},
-             "clm_start_type=s"          => \$opts{'clm_start_type'},
-             "test"                      => \$opts{'test'},
-             "use_case=s"                => \$opts{'use_case'},
-             "bgc=s"                     => \$opts{'bgc'},
-             "maxpft=i"                  => \$opts{'maxpft'},
-             "v|verbose"                 => \$opts{'verbose'},
-             "version"                   => \$opts{'version'},
-            )  or usage();
-
-  # Give usage message.
-  usage() if $opts{'help'};
-
-  # Check for unparsed arguments
-  if (@ARGV) {
-    print "ERROR: unrecognized arguments: @ARGV\n";
-    usage();
-  }
-  return %opts;
-}
-
-#-------------------------------------------------------------------------------
-
-sub check_for_perl_utils {
-
-  my $cfgdir = shift;
-  my $opts_ref = shift;
-
-  # Determine CIME root directory and perl5lib root directory
-  my $cimeroot = $opts_ref->{'cimeroot'};
-  if ( ! defined($cimeroot) ) {
-    $cimeroot = "$cfgdir/../cime";
-    if (      -d $cimeroot ) {
-    } elsif ( -d "$cfgdir/../../../cime" ) {
-      $cimeroot = "$cfgdir/../../../cime";
-    } else {
-      die <<"EOF";
-** Cannot find the root of the cime directory  enter it using the -cimeroot option
-   Did you run the checkout_externals scripts?
-EOF
-    }
-  }
-
-  my $perl5lib_dir = "$cimeroot/utils/perl5lib";
-
-  #-----------------------------------------------------------------------------
-  # Add $perl5lib_dir to the list of paths that Perl searches for modules
-  my @dirs = ( $ProgDir, $cfgdir, "$perl5lib_dir");
-  unshift @INC, @dirs;
-
-  require config_files::clm_phys_vers;
-  require namelist_files::LogMessages;
-
-  my $locallog = namelist_files::LogMessages->new( $ProgName, $opts_ref );
-  # The XML::Lite module is required to parse the XML files.
-  (-f "$perl5lib_dir/XML/Lite.pm")  or
-      $locallog->fatal_error("Cannot find perl module \"XML/Lite.pm\" in directory\n" .
-                "\"$perl5lib_dir\"");
-
-  # The Build::Config module provides utilities to access the configuration information
-  # in the config_cache.xml file
-  (-f "$perl5lib_dir/Build/Config.pm")  or
-      $locallog->fatal_error("Cannot find perl module \"Build/Config.pm\" in directory\n" .
-                "\"$perl5lib_dir\"");
-
-  # The Build::NamelistDefinition module provides utilities to validate that the output
-  # namelists are consistent with the namelist definition file
-  (-f "$perl5lib_dir/Build/NamelistDefinition.pm")  or
-      $locallog->fatal_error("Cannot find perl module \"Build/NamelistDefinition.pm\" in directory\n" .
-		  "\"$perl5lib_dir\"");
-
-  # The Build::NamelistDefaults module provides a utility to obtain default values of namelist
-  # variables based on finding a best fit with the attributes specified in the defaults file.
-  (-f "$perl5lib_dir/Build/NamelistDefaults.pm")  or
-      $locallog->fatal_error("Cannot find perl module \"Build/NamelistDefaults.pm\" in directory\n" .
-		  "\"$perl5lib_dir\"");
-
-  # The Build::Namelist module provides utilities to parse input namelists, to query and modify
-  # namelists, and to write output namelists.
-  (-f "$perl5lib_dir/Build/Namelist.pm")  or
-      $locallog->fatal_error("Cannot find perl module \"Build/Namelist.pm\" in directory\n" .
-		  "\"$perl5lib_dir\"");
-
-
-  # required cesm perl modules
-  require XML::Lite;
-  require Build::Config;
-  require Build::NamelistDefinition;
-  require Build::NamelistDefaults;
-  require Build::Namelist;
-  require Config::SetupTools;
-}
-
-#-------------------------------------------------------------------------------
-
-sub read_configure_definition {
-  # Read the configure definition and specific config_cache file for this case
-  # configure are the build-time settings for CLM
-  my ($cfgdir, $opts) = @_;
-
-  $log->verbose_message("Setting CLM configuration script directory to $cfgdir");
-
-  # Create a configuration object from the default config_definition file
-  my $configfile;
-  if ( -f $opts->{'config'} ) {
-    $configfile = $opts->{'config'};
-  } else {
-    $configfile = "$cfgdir/config_files/config_definition.xml";
-  }
-
-  # Check that configuration cache file exists.
-  $log->verbose_message("Using CLM configuration cache file $opts->{'config'}");
-  if ( $configfile ne $opts->{'config'} ) {
-    $log->fatal_error("Cannot find configuration cache file: \"$opts->{'config'}\"");
-  }
-
-  my $cfg = Build::Config->new("$configfile");
-
-  return $cfg;
-}
-
-#-----------------------------------------------------------------------------------------------
-
-sub read_namelist_definition {
-  my ($cfgdir, $opts, $nl_flags, $physv) = @_;
-
-  # The namelist definition file contains entries for all namelist
-  # variables that can be output by build-namelist.
-  my $phys = $physv->as_filename( );
-  my @nl_definition_files = ( "$cfgdir/namelist_files/namelist_definition_drv.xml",
-                              "$cfgdir/namelist_files/namelist_definition_$phys.xml" );
-  foreach my $nl_defin_file  ( @nl_definition_files ) {
-    (-f "$nl_defin_file")  or  $log->fatal_error("Cannot find namelist definition file \"$nl_defin_file\"");
-
-    $log->verbose_message("Using namelist definition file $nl_defin_file");
-  }
-
-  # Create a namelist definition object.  This object provides a
-  # method for verifying that the output namelist variables are in the
-  # definition file, and are output in the correct namelist groups.
-  my $definition = Build::NamelistDefinition->new( shift(@nl_definition_files) );
-  foreach my $nl_defin_file ( @nl_definition_files ) {
-    $definition->add( "$nl_defin_file" );
-  }
-
-  return $definition;
-}
-
-#-----------------------------------------------------------------------------------------------
-
-sub read_envxml_case_files {
-  # read the contents of the env*.xml files in the case directory
-  my ($opts) = @_;
-
-  my %envxml = ();
-  if ( defined($opts->{'envxml_dir'}) ) {
-      (-d $opts->{'envxml_dir'})  or  $log->fatal_error( "envxml_dir is not a directory" );
-      my @files = glob( $opts->{'envxml_dir'}."/env_*xml" );
-      ($#files >= 0)              or  $log->fatal_error( "there are no env_*xml files in the envxml_dir" );
-      foreach my $file (@files) {
-          $log->verbose_message( "Open env.xml file: $file" );
-          my $xml = XML::Lite->new( "$file" );
-          my @e   = $xml->elements_by_name('entry');
-          while ( my $e = shift @e ) {
-              my %a = $e->get_attributes();
-              $envxml{$a{'id'}} = $a{'value'};
-          }
-      }
-      foreach my $attr (keys %envxml) {
-          if ( $envxml{$attr} =~ m/\$/ ) {
-             $envxml{$attr} = SetupTools::expand_xml_var( $envxml{$attr}, \%envxml );
-          }
-      }
-  } else {
-      $log->fatal_error( "The -envxml_dir option was NOT given and it is a REQUIRED option" );
-  }
-  return( %envxml );
-}
-
-#-----------------------------------------------------------------------------------------------
-
-sub read_namelist_defaults {
-  my ($cfgdir, $opts, $nl_flags, $cfg, $physv) = @_;
-
-  my $phys = $physv->as_filename( );
-  # The namelist defaults file contains default values for all required namelist variables.
-  my @nl_defaults_files = ( "$cfgdir/namelist_files/namelist_defaults_overall.xml",
-                            "$cfgdir/namelist_files/namelist_defaults_$phys.xml" );
-
-  # Add the location of the use case defaults files to the options hash
-  $opts->{'use_case_dir'} = "$cfgdir/namelist_files/use_cases";
-
-  if (defined $opts->{'use_case'}) {
-    if ( $opts->{'use_case'} ne "list" ) {
-      unshift( @nl_defaults_files, "$opts->{'use_case_dir'}/$opts->{'use_case'}.xml" );
-    }
-  }
-
-  foreach my $nl_defaults_file ( @nl_defaults_files ) {
-    (-f "$nl_defaults_file")  or  $log->fatal_error("Cannot find namelist defaults file \"$nl_defaults_file\"");
-
-    $log->verbose_message("Using namelist defaults file $nl_defaults_file");
-  }
-
-  # Create a namelist defaults object.  This object provides default
-  # values for variables contained in the input defaults file.  The
-  # configuration object provides attribute values that are relevent
-  # for the CLM executable for which the namelist is being produced.
-  my $defaults = Build::NamelistDefaults->new( shift( @nl_defaults_files ), $cfg);
-  foreach my $nl_defaults_file ( @nl_defaults_files ) {
-    $defaults->add( "$nl_defaults_file" );
-  }
-  return $defaults;
-}
-
-#-------------------------------------------------------------------------------
-
-sub check_cesm_inputdata {
-  # Check that the CESM inputdata root directory has been specified.  This must be
-  # a local or nfs mounted directory.
-
-  my ($opts, $nl_flags) = @_;
-
-  $nl_flags->{'inputdata_rootdir'} = undef;
-  if (defined($opts->{'csmdata'})) {
-    $nl_flags->{'inputdata_rootdir'} = $opts->{'csmdata'};
-  }
-  elsif (defined $ENV{'CSMDATA'}) {
-    $nl_flags->{'inputdata_rootdir'} = $ENV{'CSMDATA'};
-  }
-  else {
-    $log->fatal_error("CESM inputdata root directory must be specified by either -csmdata\n" .
-                "argument or by the CSMDATA environment variable.");
-  }
-  if ( ! defined($ENV{'DIN_LOC_ROOT'}) ) {
-    $ENV{'DIN_LOC_ROOT'} = $nl_flags->{'inputdata_rootdir'};
-  }
-
-  if ($opts->{'test'}) {
-    (-d $nl_flags->{'inputdata_rootdir'})  or  $log->fatal_error("CESM inputdata root is not a directory: \"$nl_flags->{'inputdata_rootdir'}\"");
-  }
-
-  $log->verbose_message("CESM inputdata root directory: $nl_flags->{'inputdata_rootdir'}");
-}
-
-#-------------------------------------------------------------------------------
-
-sub process_namelist_user_input {
-  # Process the user input in general by order of precedence.  At each point
-  # we'll only add new values to the namelist and not overwrite
-  # previously specified specified values which have higher
-  # precedence. The one exception to this rule are the specifc command-line
-  # options which are done last as if the user contradicts these settings
-  # CLM build-namelist will abort with an error.
-  #
-  # 1. values set on the command-line using the -namelist option,
-  #         (i.e. CLM_NAMELIST_OPTS env_run variable)
-  # 2. values read from the file(s) specified by -infile,
-  #         (i.e.  user_nl_clm files)
-  # After the above are done the command line options are processed and they
-  # are made sure the user hasn't contradicted any of their settings with
-  # anything above. Because of this they are condsidered to have the highest
-  # precedence.
-  # 0. namelist values set by specific command-line options, like, -d, -sim_year
-  #         (i.e.  CLM_BLDNML_OPTS env_run variable)
-  # The results of these are needed for the final two user input
-  # 4. values set from a use-case scenario, e.g., -use_case
-  #         (i.e.  CLM_NML_USE_CASE env_run variable)
-  #
-  # Finally after all the above is done, the defaults are found from the
-  # namelist defaults file (outside of this routine).
-  #
-
-
-  my ($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $envxml_ref, $physv) = @_;
-
-  # Get the inputs that will be coming from the user...
-  process_namelist_commandline_namelist($opts, $definition, $nl, $envxml_ref);
-  process_namelist_commandline_infile($opts, $definition, $nl, $envxml_ref);
-
-  # Apply the commandline options and make sure the user didn't change it above
-  process_namelist_commandline_options($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv);
-
-  # The last two process command line arguments for use_case
-  # They require that process_namelist_commandline_options was called before this
-  process_namelist_commandline_use_case($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $envxml_ref, $physv);
-
-  # Set the start_type by the command line setting for clm_start_type
-  process_namelist_commandline_clm_start_type($opts, $nl_flags, $definition, $defaults, $nl);
-
-}
-
-#-------------------------------------------------------------------------------
-
-sub process_namelist_commandline_options {
-  # First process the commandline args that provide specific namelist values.
-  #
-  # First get the command-line specified overall values or their defaults
-  # Obtain default values for the following build-namelist input arguments
-  # : res, mask, rcp, sim_year, sim_year_range.
-  #
-  my ($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv) = @_;
-
-  setup_cmdl_chk_res($opts, $defaults);
-  setup_cmdl_resolution($opts, $nl_flags, $definition, $defaults);
-  setup_cmdl_mask($opts, $nl_flags, $definition, $defaults, $nl);
-  setup_cmdl_maxpft($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv);
-  setup_cmdl_rcp($opts, $nl_flags, $definition, $defaults, $nl);
-  setup_cmdl_simulation_year($opts, $nl_flags, $definition, $defaults, $nl);
-  setup_cmdl_run_type($opts, $nl_flags, $definition, $defaults, $nl);
-  setup_cmdl_output_reals($opts, $nl_flags, $definition, $defaults, $nl, $physv);
-}
-
-#-------------------------------------------------------------------------------
-
-sub setup_cmdl_chk_res {
-  my ($opts, $defaults) = @_;
-
-  my $var = "chk_res";
-  if ( ! defined($opts->{$var}) ) {
-    $opts->{$var} = $defaults->get_value($var);
-  }
-}
-
-sub setup_cmdl_resolution {
-  my ($opts, $nl_flags, $definition, $defaults) = @_;
-
-  my $var = "res";
-  my $val;
-
-  if ( $opts->{$var} ne "default" ) {
-    $val = $opts->{$var};
-  } else {
-    $val= $defaults->get_value($var);
-  }
-
-  $nl_flags->{'res'} = $val;
-  $log->verbose_message("CLM atm resolution is $nl_flags->{'res'}");
-  $opts->{$var} = $val;
-  if ( $opts->{'chk_res'} ) {
-    $val = &quote_string( $nl_flags->{'res'} );
-    if (  ! $definition->is_valid_value( $var, $val ) ) {
-      my @valid_values   = $definition->get_valid_values( $var );
-      $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values");
-    }
-  }
-}
-
-#-------------------------------------------------------------------------------
-
-sub setup_cmdl_mask {
-  my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;
-
-  my $var = "mask";
-  my $val;
-
-  if ( $opts->{$var} ne "default" ) {
-    $val = $opts->{$var};
-  } else {
-    my %tmp = ( 'hgrid'=>$nl_flags->{'res'} );
-    $val = $defaults->get_value($var, \%tmp );
-  }
-
-  $nl_flags->{'mask'} = $val;
-  $opts->{'mask'} = $nl_flags->{'mask'};
-  if ( $opts->{'chk_res'} ) {
-    $val = &quote_string( $val );
-    my $group = $definition->get_group_name($var);
-    $nl->set_variable_value($group, $var, $val);
-    if (  ! $definition->is_valid_value( $var, $val ) ) {
-      my @valid_values   = $definition->get_valid_values( $var );
-      $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values");
-    }
-  }
-  $log->verbose_message("CLM land mask is $nl_flags->{'mask'}");
-}
-
-#-------------------------------------------------------------------------------
-
-sub setup_cmdl_maxpft {
-  my ($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv) = @_;
-
-  my $val;
-  my $var = "maxpft";
-  my $maxpatchpft = 17;
-  if ( $opts->{$var} ne "default") {
-    $val = $opts->{$var};
-  } else {
-    $val = $maxpatchpft;
-  }
-  $nl_flags->{'maxpft'} = $val;
-
-  if ( $nl_flags->{'maxpft'} > $maxpatchpft ) {
-    $log->fatal_error("** Max patch PFT's can NOT exceed $maxpatchpft\n" .
-                "**\n" .
-                "** Set maxpft by the following means from highest to lowest precedence:\n" .
-                "** * by the command-line options -maxpft\n" .
-                "** * by a default configuration file, specified by -defaults\n" .
-                "**");
-  }
-  if ( $nl_flags->{'maxpft'} != $maxpatchpft ) {
-    $log->warning("running with maxpft NOT equal to $maxpatchpft is " .
-            "NOT validated / scientifically supported." );
-  }
-}
-
-#-------------------------------------------------------------------------------
-
-sub setup_cmdl_rcp {
-  # representative concentration pathway
-  my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;
-
-  my $val;
-  my $var = "rcp";
-  if ( $opts->{$var} ne "default" ) {
-    $val = $opts->{$var};
-  } else {
-    $val = $defaults->get_value($var);
-  }
-  $nl_flags->{'rcp'} = $val;
-  $opts->{'rcp'} = $nl_flags->{'rcp'};
-  my $group = $definition->get_group_name($var);
-  $nl->set_variable_value($group, $var, $val);
-  if (  ! $definition->is_valid_value( $var, $val ) ) {
-    my @valid_values   = $definition->get_valid_values( $var );
-    $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values");
-  }
-  $log->verbose_message("CLM future scenario representative concentration is $nl_flags->{'rcp'}");
-}
-
-#-------------------------------------------------------------------------------
-
-sub setup_cmdl_simulation_year {
-  my ($opts, $nl_flags, $definition, $defaults, $nl, $cfg) = @_;
-
-  my $val;
-  my $var = "sim_year";
-  if ( $opts->{$var} ne "default" ) {
-    $val = $opts->{$var};
-  } else {
-    $val = $defaults->get_value($var);
-  }
-
-  $nl_flags->{'sim_year_range'} = $defaults->get_value("sim_year_range");
-  $nl_flags->{'sim_year'}       = $val;
-  if ( $val =~ /([0-9]+)-([0-9]+)/ ) {
-    $nl_flags->{'sim_year'}       = $1;
-    $nl_flags->{'sim_year_range'} = $val;
-  }
-  $val = $nl_flags->{'sim_year'};
-  my $group = $definition->get_group_name($var);
-  $nl->set_variable_value($group, $var, $val );
-  if (  ! $definition->is_valid_value( $var, $val, 'noquotes'=>1 ) ) {
-    my @valid_values   = $definition->get_valid_values( $var );
-    $log->fatal_error("$var of $val is NOT valid. Valid values are: @valid_values");
-  }
-  $nl->set_variable_value($group, $var, $val );
-  $log->verbose_message("CLM sim_year is $nl_flags->{'sim_year'}");
-
-  $var = "sim_year_range";
-  $val = $nl_flags->{'sim_year_range'};
-  if ( $val ne "constant" ) {
-    $opts->{$var}   = $val;
-    $group = $definition->get_group_name($var);
-    $nl->set_variable_value($group, $var, $val );
-    if (  ! $definition->is_valid_value( $var, $val, 'noquotes'=>1 ) ) {
-      my @valid_values   = $definition->get_valid_values( $var );
-      $log->fatal_error("$var of $val is NOT valid. Valid values are: @valid_values");
-    }
-    $val = "'".$defaults->get_value($var)."'";
-    $nl->set_variable_value($group, $var, $val );
-    $log->verbose_message("CLM sim_year_range is $nl_flags->{'sim_year_range'}");
-  }
-}
-
-#-------------------------------------------------------------------------------
-
-sub setup_cmdl_run_type {
-  my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;
-
-  my $val;
-  my $var = "clm_start_type";
-  if (defined $opts->{$var}) {
-    if ($opts->{$var} eq "default" ) {
-      add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var);
-    } else {
-      my $group = $definition->get_group_name($var);
-      $nl->set_variable_value($group, $var, quote_string( $opts->{$var} ) );
-    }
-  } else {
-    add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var);
-  }
-  $nl_flags->{'clm_start_type'} = $nl->get_value($var);
-}
-
-#-------------------------------------------------------------------------------
-
-sub setup_cmdl_output_reals {
-  my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;
-
-  my $var = "output_reals_filename";
-  my $file = $opts->{$var};
-  if ( defined($file) ) {
-     # Make sure can open file and if not die with an error
-     my $fh = IO::File->new($file, '>') or $log->fatal_error("can't create real parameter filename: $file");
-     $fh->close();
-  }
-}
-
-#-------------------------------------------------------------------------------
-
-sub process_namelist_commandline_namelist {
-  # Process the commandline '-namelist' arg.
-  my ($opts, $definition, $nl, $envxml_ref) = @_;
-
-  if (defined $opts->{'namelist'}) {
-    # Parse commandline namelist
-    my $nl_arg = Build::Namelist->new($opts->{'namelist'});
-
-    # Validate input namelist -- trap exceptions
-    my $nl_arg_valid;
-    eval { $nl_arg_valid = $definition->validate($nl_arg); };
-    if ($@) {
-      $log->fatal_error("Invalid namelist variable in commandline arg '-namelist'.\n $@");
-    }
-    # Go through all variables and expand any XML env settings in them
-    expand_xml_variables_in_namelist( $nl_arg_valid, $envxml_ref );
-
-    # Merge input values into namelist.  Previously specified values have higher precedence
-    # and are not overwritten.
-    $nl->merge_nl($nl_arg_valid);
-  }
-}
-
-#-------------------------------------------------------------------------------
-
-sub process_namelist_commandline_infile {
-  # Process the commandline '-infile' arg.
-  my ($opts, $definition, $nl, $envxml_ref) = @_;
-
-  if (defined $opts->{'infile'}) {
-    my @infiles = split( /,/, $opts->{'infile'} );
-    foreach my $infile ( @infiles ) {
-      # Make sure a valid file was found
-      if (    -f "$infile" ) {
-        # Otherwise abort as a valid file doesn't exist
-      } else {
-        $log->fatal_error("input namelist file does NOT exist $infile.\n $@");
-      }
-      # Parse namelist input from the next file
-      my $nl_infile = Build::Namelist->new($infile);
-
-      # Validate input namelist -- trap exceptions
-      my $nl_infile_valid;
-      eval { $nl_infile_valid = $definition->validate($nl_infile); };
-      if ($@) {
-        $log->fatal_error("Invalid namelist variable in '-infile' $infile.\n $@");
-      }
-      # Go through all variables and expand any XML env settings in them
-      expand_xml_variables_in_namelist( $nl_infile_valid, $envxml_ref );
-
-      # Merge input values into namelist.  Previously specified values have higher precedence
-      # and are not overwritten.
-      $nl->merge_nl($nl_infile_valid);
-    }
-  }
-}
-
-#-------------------------------------------------------------------------------
-
-sub process_namelist_commandline_use_case {
-  # Now process the -use_case arg.
-  my ($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $envxml_ref, $physv) = @_;
-
-  if (defined $opts->{'use_case'}) {
-
-    # The use case definition is contained in an xml file with the same format as the defaults file.
-    # Create a new NamelistDefaults object.
-    my $uc_defaults = Build::NamelistDefaults->new("$opts->{'use_case_dir'}/$opts->{'use_case'}.xml", $cfg);
-
-    my %settings;
-    $settings{'res'}            = $nl_flags->{'res'};
-    $settings{'rcp'}            = $nl_flags->{'rcp'};
-    $settings{'mask'}           = $nl_flags->{'mask'};
-    $settings{'sim_year'}       = $nl_flags->{'sim_year'};
-    $settings{'sim_year_range'} = $nl_flags->{'sim_year_range'};
-    $settings{'phys'}           = $nl_flags->{'phys'};
-    # Loop over the variables specified in the use case.
-    # Add each one to the namelist.
-    my @vars = $uc_defaults->get_variable_names();
-    my $nl_usecase = Build::Namelist->new();
-    foreach my $var (@vars) {
-      my $val = $uc_defaults->get_value($var, \%settings );
-
-      if ( defined($val) ) {
-        $log->message("CLM adding use_case $opts->{'use_case'} defaults for var '$var' with val '$val'");
-
-        add_default($opts,  $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl_usecase, $var, 'val'=>$val);
-      }
-    }
-    # Go through all variables and expand any XML env settings in them
-    expand_xml_variables_in_namelist( $nl_usecase, $envxml_ref );
-
-    # Merge input values into namelist.  Previously specified values have higher precedence
-    # and are not overwritten.
-    $nl->merge_nl($nl_usecase);
-  }
-}
-
-#-------------------------------------------------------------------------------
-
-sub process_namelist_commandline_clm_start_type {
-  # Set the start_type according to the command line clm_start_type option
-
-  my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;
-
-  # Run type for driver namelist - note that arb_ic implies that the run is startup
-  my $var = "start_type";
-  if ($nl_flags->{'clm_start_type'} eq "'cold'" || $nl_flags->{'clm_start_type'} eq "'arb_ic'") {
-    # Add default is used here, but the value is explicitly set
-    add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'val'=>'startup'   );
-  } else {
-    # Add default is used here, but the value is explicitly set
-    add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'val'=>$nl_flags->{'clm_start_type'} );
-  }
-}
-
-#-------------------------------------------------------------------------------
-
-sub process_namelist_inline_logic {
-  # Use the namelist default object to add default values for required
-  # namelist variables that have not been previously set.
-  my ($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $envxml_ref, $physv) = @_;
-
-
-  ##############################
-  # namelist group: clm_inparm #
-  ##############################
-  setup_logic_lnd_frac($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref);
-  setup_logic_start_type($opts, $nl_flags, $nl);
-  setup_logic_delta_time($opts, $nl_flags, $definition, $defaults, $nl);
-  setup_logic_decomp_performance($opts,  $nl_flags, $definition, $defaults, $nl);
-  setup_logic_demand($opts, $nl_flags, $definition, $defaults, $nl, $physv);
-  setup_logic_surface_dataset($opts,  $nl_flags, $definition, $defaults, $nl, $physv);
-  setup_logic_initial_conditions($opts, $nl_flags, $definition, $defaults, $nl, $physv);
-
-}
-
-#-------------------------------------------------------------------------------
-
-sub setup_logic_lnd_frac {
-
-  my ($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref) = @_;
-
-  my $var = "lnd_frac";
-  if ( defined($opts->{$var}) ) {
-    if ( defined($nl->get_value('fatmlndfrc')) ) {
-      $log->fatal_error("Can NOT set both -lnd_frac option (set via LND_DOMAIN_PATH/LND_DOMAIN_FILE " .
-                  "env variables) AND fatmlndfrac on namelist");
-    }
-    my $lnd_frac = SetupTools::expand_xml_var( $opts->{$var}, $envxml_ref);
-    add_default($opts,  $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fatmlndfrc','val'=>$lnd_frac );
-  }
-
-  # Get the fraction file
-  if (defined $nl->get_value('fatmlndfrc')) {
-    # do nothing - use value provided by config_grid.xml and clm.cpl7.template
-  } else {
-    $log->fatal_error("fatmlndfrc was NOT sent into CLM build-namelist.");
-  }
-}
-
-#-------------------------------------------------------------------------------
-
-sub setup_logic_start_type {
-  my ($opts, $nl_flags, $nl) = @_;
-
-  my $var = "start_type";
-  my $drv_start_type = $nl->get_value($var);
-  my $my_start_type  = $nl_flags->{'clm_start_type'};
-  my $nsrest         = $nl->get_value('override_nsrest');
-
-  if ( defined($nsrest) ) {
-    if ( $nsrest == 0 ) { $my_start_type = "startup";  }
-    if ( $nsrest == 1 ) { $my_start_type = "continue"; }
-    if ( $nsrest == 3 ) { $my_start_type = "branch";   }
-    if ( "$my_start_type" eq "$drv_start_type" ) {
-      $log->fatal_error("no need to set override_nsrest to same as start_type.");
-    }
-    if ( "$drv_start_type" !~ /startup/ ) {
-      $log->fatal_error("can NOT set override_nsrest if driver is NOT a startup type.");
-    }
-  }
-
-  if ( $my_start_type =~ /branch/ ) {
-    if (not defined $nl->get_value('nrevsn')) {
-      $log->fatal_error("nrevsn is required for a branch type.");
-    }
-  } else {
-    if (defined $nl->get_value('nrevsn')) {
-      $log->fatal_error("nrevsn should ONLY be set for a branch type.");
-    }
-  }
-}
-
-#-------------------------------------------------------------------------------
-
-sub setup_logic_delta_time {
-  my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;
-
-  if ( defined($opts->{'l_ncpl'}) ) {
-    my $l_ncpl = $opts->{'l_ncpl'};
-    if ( $l_ncpl <= 0 ) {
-      $log->fatal_error("bad value for -l_ncpl option.");
-    }
-    my $val = ( 3600 * 24 ) / $l_ncpl;
-    my $dtime = $nl->get_value('dtime');
-    if ( ! defined($dtime)  ) {
-      add_default($opts,  $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'dtime', 'val'=>$val);
-    } elsif ( $dtime ne $val ) {
-      $log->fatal_error("can NOT set both -l_ncpl option (via LND_NCPL env variable) AND dtime namelist variable.");
-    }
-  } else {
-    add_default($opts,  $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'dtime', 'hgrid'=>$nl_flags->{'res'});
-  }
-}
-
-#-------------------------------------------------------------------------------
-
-sub setup_logic_decomp_performance {
-  my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;
-
-  # Set the number of segments per clump
-  add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'nsegspc', 'hgrid'=>$nl_flags->{'res'});
-}
-
-#-------------------------------------------------------------------------------
-
-sub error_if_set {
-   # do a fatal_error and exit if any of the input variable names are set
-   my ($nl, $error, @list) = @_;
-   foreach my $var ( @list ) {
-      if ( defined($nl->get_value($var)) ) {
-        $log->fatal_error( "$var $error" );
-      }
-   }
-}
-
-#-------------------------------------------------------------------------------
-
-sub setup_logic_demand {
-  #
-  # Deal with options that the user has said are required...
-  #
-  my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;
-
-  my %settings;
-  $settings{'hgrid'}          = $nl_flags->{'res'};
-  $settings{'sim_year'}       = $nl_flags->{'sim_year'};
-  $settings{'sim_year_range'} = $nl_flags->{'sim_year_range'};
-  $settings{'mask'}           = $nl_flags->{'mask'};
-  $settings{'rcp'}            = $nl_flags->{'rcp'};
-  # necessary for demand to be set correctly
-
-  my $demand = $nl->get_value('clm_demand');
-  if (defined($demand)) {
-    $demand =~ s/\'//g;   # Remove quotes
-    if ( $demand =~ /.+/ ) {
-      $opts->{'clm_demand'} .= ",$demand";
-    }
-  }
-
-  $demand = $defaults->get_value('clm_demand', \%settings);
-  if (defined($demand)) {
-    $demand =~ s/\'//g;   # Remove quotes
-    if ( $demand =~ /.+/ ) {
-      $opts->{'clm_demand'} .= ",$demand";
-    }
-  }
-
-  my @demandlist = split( ",", $opts->{'clm_demand'} );
-  foreach my $item ( @demandlist ) {
-    if ( $item eq "null" ) {
-      next;
-    }
-    if ( $item eq "finidat" ) {
-        $log->fatal_error( "Do NOT put findat in the clm_demand list, set the clm_start_type=startup so initial conditions are required");
-    }
-    add_default($opts,  $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $item, %settings );
-  }
-}
-
-#-------------------------------------------------------------------------------
-
-sub setup_logic_surface_dataset {
-  #
-  # Get surface dataset after flanduse_timeseries so that we can get surface data
-  # consistent with it
-  # MUST BE AFTER: setup_logic_demand which is where flanduse_timeseries is set
-  #
-  my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;
-
-  $nl_flags->{'flanduse_timeseries'} = "null";
-  my $flanduse_timeseries = $nl->get_value('flanduse_timeseries');
-  if (defined($flanduse_timeseries)) {
-    $flanduse_timeseries =~ s!(.*)/!!;
-    $flanduse_timeseries =~ s/\'//;
-    $flanduse_timeseries =~ s/\"//;
-    if ( $flanduse_timeseries ne "" ) {
-      $nl_flags->{'flanduse_timeseries'} = $flanduse_timeseries;
-    }
-  }
-  $flanduse_timeseries = $nl_flags->{'flanduse_timeseries'};
-
-  # MML: try and add my own namelist variable for mml_surdat forcing file
-  add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'mml_surdat', 'hgrid'=>$nl_flags->{'res'});
-  
-  
-}
-
-#-------------------------------------------------------------------------------
-
-sub setup_logic_initial_conditions {
-  # Initial conditions
-  # The initial date is an attribute in the defaults file which should be matched unless
-  # the user explicitly requests to ignore the initial date via the -ignore_ic_date option,
-  # or just ignore the year of the initial date via the -ignore_ic_year option.
-  #
-  # MUST BE AFTER: setup_logic_demand   which is where flanduse_timeseries is set
-  my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;
-
-  my $var = "finidat";
-  my $finidat = $nl->get_value($var);
-  if ( $nl_flags->{'clm_start_type'} =~ /cold/ ) {
-    if (defined $finidat ) {
-      $log->warning("setting $var (either explicitly in your user_nl_clm or by doing a hybrid or branch RUN_TYPE)\n is incomptable with using a cold start" .
-              " (by setting CLM_FORCE_COLDSTART=on)." );
-      $log->warning("Overridding input $var file with one specifying that this is a cold start from arbitrary initial conditions." );
-      my $group = $definition->get_group_name($var);
-      $nl->set_variable_value($group, $var, "' '" );
-    }
-    add_default($opts,  $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl,
-                $var, 'val'=>"' '", 'no_abspath'=>1);
-    $finidat = $nl->get_value($var);
-  } elsif ( defined $finidat ) {
-    if ( string_is_undef_or_empty($finidat) ) {
-      print "You are setting $var to blank which signals arbitrary initial conditions.\n";
-      print "But, CLM_FORCE_COLDSTART is off which is a contradiction. For arbitrary initial conditions just use the CLM_FORCE_COLDSTART option\n";
-      $log->fatal_error("To do a cold-start set ./xmlchange CLM_FORCE_COLDSTART=on, and remove the setting of $var in the user_nl_clm file");
-    }
-  }
-  my $useinitvar = "use_init_interp";
-
-  if (not defined $finidat ) {
-    my $ic_date = $nl->get_value('start_ymd');
-    my $st_year = int( $ic_date / 10000);
-    my $nofail = 1;
-    my %settings;
-    $settings{'hgrid'}   = $nl_flags->{'res'};
-    $settings{'phys'}    = $physv->as_string();
-    $settings{'nofail'}  = $nofail;
-    #
-    # If not transient use sim_year, otherwise use date
-    #
-    if (string_is_undef_or_empty($nl->get_value('flanduse_timeseries'))) {
-       $settings{'sim_year'}     = $nl_flags->{'sim_year'};
-       $opts->{'ignore_ic_year'} = 1; 
-    } else {
-       delete( $settings{'sim_year'} );
-    }
-    foreach my $item ( "mask", "maxpft" ) {
-       $settings{$item}    = $nl_flags->{$item};
-    }
-    if ($opts->{'ignore_ic_year'}) {
-       $settings{'ic_md'} = $ic_date;
-    } else {
-       $settings{'ic_ymd'} = $ic_date;
-    }
-    my $try = 0;
-    my $done = 2;
-    my $use_init_interp_default = $nl->get_value($useinitvar);
-    if ( string_is_undef_or_empty( $use_init_interp_default ) ) {
-      $use_init_interp_default = ".false.";
-    }
-    $settings{$useinitvar} = $use_init_interp_default;
-    do {
-       $try++;
-       add_default($opts,  $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, %settings );
-       # If couldn't find a matching finidat file, check if can turn on interpolation and try to find one again
-       $finidat = $nl->get_value($var);
-       if ( not defined $finidat ) {
-          # Delete any date settings
-          delete( $settings{'ic_ymd'} );
-          delete( $settings{'ic_md'}  );
-          add_default($opts,  $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, "init_interp_sim_years" );
-          add_default($opts,  $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, "init_interp_how_close" );
-          foreach my $sim_yr ( split( /,/, $nl->get_value("init_interp_sim_years") )) {
-             if ( abs($st_year - $sim_yr) < $nl->get_value("init_interp_how_close") ) {
-                $settings{'sim_year'} = $sim_yr;
-             }
-          } 
-          add_default($opts,  $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $useinitvar,
-                     'phys'=>$physv->as_string(),
-                     'sim_year'=>$settings{'sim_year'}, 'nofail'=>1 );
-          $settings{$useinitvar} = $nl->get_value($useinitvar);
-          if ( $try > 1 ) {
-             my $group = $definition->get_group_name($useinitvar);
-             $nl->set_variable_value($group, $useinitvar, $use_init_interp_default );
-          }
-          if ( &value_is_true($nl->get_value($useinitvar) ) ) {
-
-             add_default($opts,  $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, "init_interp_attributes",
-                        'sim_year'=>$settings{'sim_year'},
-                        'nofail'=>1 );
-             my $attributes_string = remove_leading_and_trailing_quotes($nl->get_value("init_interp_attributes"));
-             foreach my $pair ( split( /\s/, $attributes_string) ) {
-                if ( $pair =~ /^([a-z_]+)=([a-z._0-9]+)$/ ) {
-                   $settings{$1} = $2;
-                } else {
-                   $log->fatal_error("Problem interpreting init_interp_attributes");
-                }
-             }
-          } else {
-             if ( $nl_flags->{'clm_start_type'} =~ /startup/  ) {
-                $log->fatal_error("clm_start_type is startup so an initial conditions ($var) file is required, but can't find one without $useinitvar being set to true");
-             }
-             $try = $done;
-          }
-       } else {
-         $try = $done
-       }
-    } while( ($try < $done) && (not defined $finidat ) );
-    if ( not defined $finidat  ) {
-      my $group = $definition->get_group_name($var);
-      $nl->set_variable_value($group, $var, "' '" );
-    }
-  }
-  $finidat = $nl->get_value($var);
-  if ( &value_is_true($nl->get_value($useinitvar) ) && string_is_undef_or_empty($finidat) ) {
-     $log->fatal_error("$useinitvar is set BUT $var is NOT, need to set both" );
-  }
-} # end initial conditions
-
-#-------------------------------------------------------------------------------
-
-sub write_output_files {
-  my ($opts, $nl_flags, $defaults, $nl, $physv) = @_;
-
-  my $note = "";
-  my $var = "note";
-  if ( ! defined($opts->{$var}) ) {
-    $opts->{$var} = $defaults->get_value($var);
-  }
-  if ( $opts->{$var} ) {
-    $note = "Comment:\n" .
-      "This namelist was created using the following command-line:\n" .
-        "    $nl_flags->{'cfgdir'}/$ProgName $nl_flags->{'cmdline'}\n" .
-          "For help on options use: $nl_flags->{'cfgdir'}/$ProgName -help";
-  }
-
-  # CLM component
-  my @groups = qw(clm_inparm 
-                 finidat_consistency_checks);
-#                clm_initinterp_inparm);
-
-  my $outfile;
-  $outfile = "$opts->{'dir'}/lnd_in";
-  $nl->write($outfile, 'groups'=>\@groups, 'note'=>"$note" );
-  $log->verbose_message("Writing clm namelist to $outfile");
-}
-
-sub write_output_real_parameter_file {
-  my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;
-
-  # Output real parameters
-  if ( defined($opts->{'output_reals_filename'}) ) {
-     my $file = $opts->{'output_reals_filename'};
-     my $fh = IO::File->new($file, '>>') or $log->fatal_error("can't create real parameter filename: $file");
-     foreach my $var ( $definition->get_var_names() ) {
-        my $type = $definition->get_var_type($var);
-        my $doc  = $definition->get_var_doc($var);
-        $doc =~ s/\n//g;
-        if ( $type =~ /real/ ) {
-           my $val = $nl->get_value($var);
-           if ( ! defined($val) ) { $val = "?.??"; }
-           print $fh "\! $doc\n$var = $val\n";
-        }
-     }
-     $fh->close();
-  }
-}
-
-#-------------------------------------------------------------------------------
-
-sub add_default {
-
-# Add a value for the specified variable to the specified namelist object.  The variables
-# already in the object have the higher precedence, so if the specified variable is already
-# defined in the object then don't overwrite it, just return.
-#
-# This method checks the definition file and adds the variable to the correct
-# namelist group.
-#
-# The value can be provided by using the optional argument key 'val' in the
-# calling list.  Otherwise a default value is obtained from the namelist
-# defaults object.  If no default value is found this method throws an exception
-# unless the 'nofail' option is set true.
-#
-# Example 1: Specify the default value $val for the namelist variable $var in namelist
-#            object $nl:
-#
-#  add_default($inputdata_rootdir, $definition, $defaults, $nl, $var, 'val'=>$val)
-#
-# Example 2: Add a default for variable $var if an appropriate value is found.  Otherwise
-#            don't add the variable
-#
-#  add_default($inputdata_rootdir, $definition, $defaults, $nl, $var, 'nofail'=>1)
-#
-#
-# ***** N.B. ***** This routine assumes the following variables are in package main::
-#  $definition        -- the namelist definition object
-#  $defaults          -- the namelist defaults object
-#  $inputdata_rootdir -- CESM inputdata root directory
-
-  my $opts = shift;
-  my $inputdata_rootdir = shift;
-  my $definition = shift;
-  my $defaults = shift;
-  my $nl = shift;
-  my $var = shift;
-  my %settings = @_;
-
-  my $test_files = $opts->{'test'};
-  #my $nl = shift;     # namelist object
-  #my $var = shift;    # name of namelist variable
-  #my %settings = @_;      # options
-
-  # If variable has quotes around it
-  if ( $var =~ /'(.+)'/ ) {
-    $var = $1;
-  }
-  # Query the definition to find which group the variable belongs to.  Exit if not found.
-
-  my $group = $definition->get_group_name($var);
-  unless ($group) {
-    my $fname = $definition->get_file_name();
-    $log->fatal_error("variable \"$var\" not found in namelist definition file $fname.");
-  }
-
-  # check whether the variable has a value in the namelist object -- if so then skip to end
-  my $val = $nl->get_variable_value($group, $var);
-  if (! defined $val) {
-
-    # Look for a specified value in the options hash
-
-    if (defined $settings{'val'}) {
-      $val = $settings{'val'};
-    }
-    # or else get a value from namelist defaults object.
-    # Note that if the 'val' key isn't in the hash, then just pass anything else
-    # in %settings to the get_value method to be used as attributes that are matched
-    # when looking for default values.
-    else {
-
-      $val = $defaults->get_value($var, \%settings);
-
-      # Truncate model_version appropriately
-
-      if ( $var eq "model_version" ) {
-        $val =~ /(URL: https:\/\/[a-zA-Z0-9._-]+\/)([a-zA-Z0-9\/._-]+)(\/bld\/.+)/;
-        $val = $2;
-      }
-    }
-
-    # if no value is found then exit w/ error (unless 'nofail' option set)
-    unless ( defined($val) ) {
-      unless ($settings{'nofail'}) {
-        if ($var eq 'finidat') {
-          $log->message("No default value found for $var.\n" .
-                  "            Are defaults provided for this resolution and land mask?" );
-        } else {
-          $log->fatal_error("No default value found for $var.\n" .
-                      "            Are defaults provided for this resolution and land mask?");
-        }
-      }
-      else {
-        return;
-      }
-    }
-
-    # query the definition to find out if the variable is an input pathname
-    my $is_input_pathname = $definition->is_input_pathname($var);
-
-    # The default values for input pathnames are relative.  If the namelist
-    # variable is defined to be an absolute pathname, then prepend
-    # the CESM inputdata root directory.
-    if (not defined $settings{'no_abspath'}) {
-      if (defined $settings{'set_abspath'}) {
-        $val = set_abs_filepath($val, $settings{'set_abspath'});
-      } else {
-        if ($is_input_pathname eq 'abs') {
-          $val = set_abs_filepath($val, $inputdata_rootdir);
-          if ( $test_files and ($val !~ /null/) and (! -f "$val") ) {
-            $log->fatal_error("file not found: $var = $val");
-          }
-        }
-      }
-    }
-
-    # query the definition to find out if the variable takes a string value.
-    # The returned string length will be >0 if $var is a string, and 0 if not.
-    my $str_len = $definition->get_str_len($var);
-
-    # If the variable is a string, then add quotes if they're missing
-    if ($str_len > 0) {
-      $val = quote_string($val);
-    }
-
-    # set the value in the namelist
-    $nl->set_variable_value($group, $var, $val);
-  }
-
-}
-
-#-------------------------------------------------------------------------------
-
-sub expand_xml_variables_in_namelist {
-   # Go through all variables in the namelist and expand any XML env settings in them
-   my ($nl, $xmlvar_ref) = @_;
-
-   foreach my $group ( $nl->get_group_names() ) {
-       foreach my $var ( $nl->get_variable_names($group) ) {
-          my $val    = $nl->get_variable_value($group, $var);
-          my $newval = SetupTools::expand_xml_var( $val, $xmlvar_ref );
-          if ( $newval ne $val ) {
-             $nl->set_variable_value($group, $var, $newval);
-          }
-       }
-   }
-}
-
-#-------------------------------------------------------------------------------
-
-sub check_input_files {
-
-# For each variable in the namelist which is an input dataset, check to see if it
-# exists locally.
-#
-# ***** N.B. ***** This routine assumes the following variables are in package main::
-#  $definition        -- the namelist definition object
-#  $nl                -- namelist object
-#  $inputdata_rootdir -- if false prints test, else creates inputdata file
-
-    my ($nl, $inputdata_rootdir, $outfile, $definition) = @_;
-
-    open(OUTFILE, ">>$outfile") if defined $inputdata_rootdir;
-
-    # Look through all namelist groups
-    my @groups = $nl->get_group_names();
-    foreach my $group (@groups) {
-
-        # Look through all variables in each group
-        my @vars = $nl->get_variable_names($group);
-        foreach my $var (@vars) {
-
-            # Is the variable an input dataset?
-            my $input_pathname_type = $definition->is_input_pathname($var);
-
-            # If it is, check whether it exists locally and print status
-            if ($input_pathname_type) {
-
-                # Get pathname of input dataset
-                my $pathname = $nl->get_variable_value($group, $var);
-                # Need to strip the quotes
-                $pathname =~ s/['"]//g;
-
-                if ($input_pathname_type eq 'abs') {
-                    if ($inputdata_rootdir) {
-                        #MV $pathname =~ s:$inputdata_rootdir::;
-                        print OUTFILE "$var = $pathname\n";
-                    }
-                    else {
-                        if (-e $pathname) {  # use -e rather than -f since the absolute pathname
-                                             # might be a directory
-                            print "OK -- found $var = $pathname\n";
-                        }
-                        else {
-                            print "NOT FOUND:  $var = $pathname\n";
-                        }
-                    }
-                }
-                elsif ($input_pathname_type =~ m/rel:(.+)/o) {
-                    # The match provides the namelist variable that contains the
-                    # root directory for a relative filename
-                    my $rootdir_var = $1;
-                    my $rootdir = $nl->get_variable_value($group, $rootdir_var);
-                    $rootdir =~ s/['"]//g;
-                    if ($inputdata_rootdir) {
-                        $pathname = "$rootdir/$pathname";
-                        #MV $pathname =~ s:$inputdata_rootdir::;
-                        print OUTFILE "$var = $pathname\n";
-                    }
-                    else {
-                        if (-f "$rootdir/$pathname") {
-                            print "OK -- found $var = $rootdir/$pathname\n";
-                        }
-                        else {
-                            print "NOT FOUND:  $var = $rootdir/$pathname\n";
-                        }
-                    }
-                }
-            }
-        }
-    }
-    close OUTFILE if defined $inputdata_rootdir;
-    return 0 if defined $inputdata_rootdir;
-}
-
-#-------------------------------------------------------------------------------
-
-sub set_abs_filepath {
-
-# check whether the input filepath is an absolute path, and if it isn't then
-# prepend a root directory
-
-    my ($filepath, $rootdir) = @_;
-
-    # strip any leading/trailing whitespace and quotes
-    $filepath = trim($filepath);
-    $filepath = remove_leading_and_trailing_quotes($filepath);
-    $rootdir  = trim($rootdir);
-    $rootdir = remove_leading_and_trailing_quotes($rootdir);
-
-    my $out = $filepath;
-    unless ( $filepath =~ /^\// ) {  # unless $filepath starts with a /
-        $out = "$rootdir/$filepath"; # prepend the root directory
-    }
-    return $out;
-}
-
-#-------------------------------------------------------------------------------
-
-sub valid_option {
-
-    my ($val, @expect) = @_;
-
-    my $expect;
-
-    $val = trim($val);
-
-    foreach $expect (@expect) {
-        if ($val =~ /^$expect$/i) { return $expect; }
-    }
-    return undef;
-}
-
-#-------------------------------------------------------------------------------
-
-sub check_use_case_name {
-#
-# Check the use-case name and ensure it follows the naming convention.
-#
-  my ($use_case) = @_;
-
-  my $diestring = "bad use_case name $use_case, follow the conventions " .
-                  "in namelist_files/use_cases/README\n";
-  my $desc = "[a-zA-Z0-9]*";
-  my $rcp  = "rcp[0-9\.]+";
-  if (      $use_case =~ /^[0-9]+-[0-9]+([a-zA-Z0-9_\.]*)_transient$/ ) {
-    my $string = $1;
-    if (      $string =~ /^_($rcp)_*($desc)$/ ) {
-       # valid name
-    } elsif ( $string =~ /^_*($desc)$/ ) {
-       # valid name
-    } else {
-      $log->fatal_error($diestring);
-    }
-  } elsif ( $use_case =~ /^20thC([a-zA-Z0-9_\.]*)_transient$/ ) {
-    my $string = $1;
-    if (      $string =~ /^_($rcp)_*($desc)$/ ) {
-       # valid name
-    } elsif ( $string =~ /^_*($desc)$/ ) {
-       # valid name
-    } else {
-      $log->fatal_error($diestring);
-    }
-  } elsif ( $use_case =~ /^([0-9]+)_*($desc)_control$/   ) {
-     # valid name
-  } elsif ( $use_case =~ /^($desc)_pd$/   ) {
-     # valid name
-  } else {
-      $log->fatal_error($diestring);
-  }
-}
-
-#-------------------------------------------------------------------------------
-
-sub validate_options {
-
-# $source -- text string declaring the source of the options being validated
-# $cfg    -- configure object
-# $opts   -- reference to hash that contains the options
-
-    my ($source, $cfg, $opts) = @_;
-
-    my ($opt, $old, @expect);
-
-    # use_case
-    $opt = 'use_case';
-    if (defined $opts->{$opt}) {
-
-        if ( $opts->{$opt} ne "list" ) {
-           # create the @expect array by listing the files in $use_case_dir
-           # and strip off the ".xml" part of the filename
-           @expect = ();
-           my @files = glob("$opts->{'use_case_dir'}/*.xml");
-           foreach my $file (@files) {
-               $file =~ m{.*/(.*)\.xml};
-               &check_use_case_name( $1 );
-               push @expect, $1;
-           }
-
-           $old = $opts->{$opt};
-           $opts->{$opt} = valid_option($old, @expect)
-               or $log->fatal_error("invalid value of $opt ($old) specified in $source\n" .
-                              "expected one of: @expect");
-        } else {
-           print "Use cases are:...\n\n";
-           my @ucases;
-           foreach my $file( sort( glob($opts->{'use_case_dir'}."/*.xml") ) ) {
-              my $use_case;
-              if ( $file =~ /\/([^\/]+)\.xml$/ ) {
-                 &check_use_case_name( $1 );
-                 $use_case = $1;
-              } else {
-                 $log->fatal_error("Bad name for use case file = $file");
-              }
-              my $uc_defaults = Build::NamelistDefaults->new("$file", $cfg);
-              printf "%15s = %s\n", $use_case, $uc_defaults->get_value("use_case_desc");
-              push @ucases, $use_case;
-           }
-           $log->exit_message("use cases : @ucases");
-        }
-    }
-}
-
-#-------------------------------------------------------------------------------
-
-sub list_options {
-#
-# List the options for different command line values if asked for
-#
-    my ($opts_cmdl, $definition, $defaults) = @_;
-
-    # options to list values that are in the defaults files
-    my @opts_list = ( "res", "mask", "sim_year", "rcp" );
-    my %opts_local;
-    foreach my $var ( "res", "mask", "sim_year", "rcp" ) {
-       my $val;
-       if (      $opts_cmdl->{$var} eq "list" ) {
-         $val = "default";
-       } elsif ( $opts_cmdl->{$var} eq "default" ) {
-         $val = $defaults->get_value($var, \%opts_local );
-       } else {
-         $val = $opts_cmdl->{$var};
-       }
-       my $vname = $var;
-       if ( $vname eq "res" ) { $vname = "hgrid"; }
-       $opts_local{$vname} = $val;
-    }
-    foreach my $var ( @opts_list ) {
-       if (defined $opts_cmdl->{$var}) {
-
-           if ( $opts_cmdl->{$var} eq "list" ) {
-               my @valid_values   = $definition->get_valid_values( $var );
-               if ( $var eq "sim_year" ) {
-                   unshift( @valid_values,
-                            $definition->get_valid_values( "sim_year_range" ) );
-               }
-               unshift( @valid_values, "default" );
-               # Strip out quotes and the constant value
-               for( my $i = 0; $i <= $#valid_values; $i++ ) {
-                  $valid_values[$i] =~ s/('|')//g;
-                  if ( $valid_values[$i] eq "constant" ) { $valid_values[$i] = undef; }
-               }
-               my $val= $defaults->get_value($var, \%opts_local);
-               my $doc = $definition->get_var_doc( $var );
-               $doc =~ s/\n//;
-               chomp( $doc );
-               $log->exit_message("valid values for $var ($doc) :\n" .
-                            "    Values: @valid_values\n" .
-                            "    Default = $val\n" .
-                            "    (NOTE: resolution and mask and other settings may influence what the default is)");
-           }
-       }
-    }
-    # clm_demand
-    my $var = 'clm_demand';
-    if (defined $opts_cmdl->{$var}) {
-
-        if ( $opts_cmdl->{$var} eq "list" ) {
-           my @vars = $definition->get_var_names( );
-           my @demands = ( "null" );
-           foreach my $var ( @vars ) {
-              if ( $definition->get_group_name( $var ) ne "clm_inparm" ) { next; }
-              if ( defined($defaults->get_value($var, $opts_cmdl ) ) ) {
-                 push( @demands, $var );
-              }
-           }
-           my $doc = $definition->get_var_doc( 'clm_demand' );
-           $doc =~ s/\n//;
-           chomp( $doc );
-           $log->exit_message("valid values for $var ($doc) :\n" .
-                        "Namelist options to require: @demands\n" .
-                        "any valid namelist item for clm_inparm can be set. However, not all are\n" .
-                        "available in the clm defaults file. The defaults are also dependent on\n" .
-                        "resolution and landmask, as well as other settings. Hence, the list above\n" .
-                        "will vary depending on what you set for resolution and landmask.");
-        }
-    }
-}
-
-#-------------------------------------------------------------------------------
-
-sub trim {
-   # remove leading and trailing whitespace from a string.
-   my ($str) = @_;
-   $str =~ s/^\s+//;
-   $str =~ s/\s+$//;
-   return $str;
-}
-
-#-------------------------------------------------------------------------------
-
-sub quote_string {
-   # Add quotes around a string, unless they are already there
-   my ($str) = @_;
-   $str = trim($str);
-   unless ($str =~ /^['"]/) {        #"'
-      $str = "\'$str\'";
-   }
-   return $str;
- }
-
-#-------------------------------------------------------------------------------
-
-sub remove_leading_and_trailing_quotes {
-   # Remove leading and trailing single and double quotes from a string. Also
-   # removes leading spaces before the leading quotes, and trailing spaces after
-   # the trailing quotes.
-
-   my ($str) = @_;
-
-   $str = trim($str);
-
-   # strip any leading/trailing quotes
-   $str =~ s/^['"]+//;
-   $str =~ s/["']+$//;
-
-   return $str;
-}
-
-#-------------------------------------------------------------------------------
-
-sub logical_to_fortran {
-   # Given a logical variable ('true' / 'false'), convert it to a fortran-style logical ('.true.' / '.false.')
-   # The result will be lowercase, regardless of the case of the input.
-   my ($var) = @_;
-   my $result;
-
-   if (lc($var) eq 'true') {
-      $result = ".true.";
-   }
-   elsif (lc($var) eq 'false') {
-      $result = ".false.";
-   }
-   else {
-      $log->fatal_error("Unexpected value in logical_to_fortran: $var");
-   }
-
-   return $result;
-}
-
-#-------------------------------------------------------------------------------
-
-sub string_is_undef_or_empty {
-   # Return true if the given string is undefined or only spaces, false otherwise.
-   # A quoted empty string (' ' or " ") is treated as being empty.
-   my ($str) = @_;
-   if (!defined($str)) {
-      return 1;
-   }
-   else {
-      $str = remove_leading_and_trailing_quotes($str);
-      if ($str =~ /^\s*$/) {
-         return 1;
-      }
-      else {
-         return 0;
-      }
-   }
-}
-
-#-------------------------------------------------------------------------------
-
-sub value_is_true {
-   # Return true if the given namelist value is .true.
-   # An undefined value is treated as false (with the assumption that false is the default in the code)
-   my ($val) = @_;
-
-   # Some regular expressions...
-   ###my $TRUE  = qr/\.true\./i;
-   ###my $FALSE = qr/\.false\./i;
-   # **N.B.** the use of qr// for precompiling regexps isn't supported until perl 5.005.
-   my $TRUE  = '\.?true\.?|[t]';
-   my $FALSE = '\.?false\.?|[f]';
-   my $is_true = 0;
-   if (defined($val)) {
-      if ($val =~ /$TRUE/i) {
-         $is_true = 1;
-      }
-   }
-
-   return $is_true;
-}
-
-#-------------------------------------------------------------------------------
-
-sub version {
-# The version is found in CLM ChangeLog file.
-# $cfgdir is set by the configure script to the name of its directory.
-
-    my ($cfgdir) = @_;
-
-    my $logfile = "$cfgdir/../doc/ChangeLog";
-
-    my $fh = IO::File->new($logfile, '<') or $log->fatal_error("can't open ChangeLog file: $logfile");
-
-    while (my $line = <$fh>) {
-
-        if ($line =~ /^Tag name:\s*([a-zA-Z0-9_. -]*[clmcesm0-9_.-]+)$/ ) {
-            $log->exit_message("$1");
-        }
-    }
-}
-
-#-------------------------------------------------------------------------------
-
-sub main {
-  my %nl_flags;
-  $nl_flags{'cfgdir'} = dirname(abs_path($0));
-
-  my %opts = process_commandline(\%nl_flags);
-  my $cfgdir = $nl_flags{'cfgdir'};
-  check_for_perl_utils($cfgdir, \%opts);
-
-  $log     = namelist_files::LogMessages->new( $ProgName, \%opts );   # global
-  version($cfgdir) if $opts{'version'};
-  my $cfg = read_configure_definition($cfgdir, \%opts);
-
-  my $physv      = config_files::clm_phys_vers->new( $cfg->get('phys') );
-  my $definition = read_namelist_definition($cfgdir, \%opts, \%nl_flags, $physv);
-  my $defaults   = read_namelist_defaults($cfgdir, \%opts, \%nl_flags, $cfg, $physv);
-
-  # List valid values if asked for
-  list_options(\%opts, $definition, $defaults);
-
-  # Validate some of the commandline option values.
-  validate_options("commandline", $cfg, \%opts);
-
-  # Create an empty namelist object.
-  my $nl = Build::Namelist->new();
-
-  check_cesm_inputdata(\%opts, \%nl_flags);
-
-  # Read in the env_*.xml files
-  my %env_xml    = read_envxml_case_files( \%opts );
-
-  # Process the user inputs
-  process_namelist_user_input(\%opts, \%nl_flags, $definition, $defaults, $nl, $cfg, \%env_xml, $physv );
-  # Get any other defaults needed from the namelist defaults file
-  process_namelist_inline_logic(\%opts, \%nl_flags, $definition, $defaults, $nl, $cfg, \%env_xml, $physv);
-
-  # Validate that the entire resultant namelist is valid
-  $definition->validate($nl);
-  write_output_files(\%opts, \%nl_flags, $defaults, $nl, $physv);
-  write_output_real_parameter_file(\%opts, \%nl_flags, $definition, $defaults, $nl, $physv);
-
-  if ($opts{'inputdata'}) {
-    check_input_files($nl, $nl_flags{'inputdata_rootdir'}, $opts{'inputdata'}, $definition);
-  }
-  $log->final_exit("Successfully made CLM namelist file");
-}
-
-#-------------------------------------------------------------------------------
-
-1;
diff --git a/bld/Filepath b/bld/Filepath
deleted file mode 100644
index b8ec46d2..00000000
--- a/bld/Filepath
+++ /dev/null
@@ -1,8 +0,0 @@
-../SourceMods/src.clm
-/glade/p/work/erik/SimpleLand/src/main
-/glade/p/work/erik/SimpleLand/src/biogeophys
-/glade/p/work/erik/SimpleLand/src/biogeochem
-/glade/p/work/erik/SimpleLand/src/soilbiogeochem
-/glade/p/work/erik/SimpleLand/src/init_interp
-/glade/p/work/erik/SimpleLand/src/utils
-/glade/p/work/erik/SimpleLand/src/cpl
diff --git a/bld/build-namelist b/bld/build-namelist
deleted file mode 100755
index 46e485d1..00000000
--- a/bld/build-namelist
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env perl
-#-----------------------------------------------------------------------------------------------
-#
-# clm build-namelist driver
-#
-# Placing all of build-namelist into CLMBuildNamelist.pm means we can unit test the module.
-#
-require 5;
-
-use strict;
-
-BEGIN {
-  # ensure that the cesm create_X scripts can find CLMBuildNamelist.pm
-  use File::Basename qw(dirname);
-  use Cwd qw(abs_path);
-  my $dirname = dirname(abs_path($0));
-  my @dirs = ($dirname, );
-  unshift @INC, @dirs;
-}
-
-use CLMBuildNamelist qw(main);
-
-CLMBuildNamelist::main();
diff --git a/bld/config_cache.xml b/bld/config_cache.xml
deleted file mode 100644
index 2875f0b1..00000000
--- a/bld/config_cache.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0"?>
-
-<config_definition>
-
-<commandline>
-/glade/p/work/erik/SimpleLand/bld/configure 
-</commandline>
-<entry id="clm_root" value="/glade/p/work/erik/SimpleLand" list="" valid_values="">
-Root directory of CLM source distribution (directory above CLM configure).
-</entry>
-<entry id="comp_intf" value="MCT" list="" valid_values="ESMF,MCT,cpl_\$COMP">
-Component framework interface to use 
-(Model Coupling Toolkit, or Earth System Modeling Framework)
-</entry>
-<entry id="cppdefs" value="" list="" valid_values="">
-User specified CPP defines to append to Makefile defaults.
-Note: It's recommended to use configure options to set standard CPP values rather
-than defining them here.
-</entry>
-<entry id="phys" value="clm5_0" list="" valid_values="clm4_5,clm5_0">
-Specifies either clm4_5, or clm5_0 physics
-</entry>
-<entry id="usr_src" value="" list="1" valid_values="">
-User source directories to prepend to the filepath.  Multiple directories
-are specified as a comma separated list with no embedded white space.
-Normally this is SourceMods/src.clm in your case.
-</entry>
-
-</config_definition>
diff --git a/bld/config_files/clm_phys_vers.pm b/bld/config_files/clm_phys_vers.pm
deleted file mode 100755
index efd83609..00000000
--- a/bld/config_files/clm_phys_vers.pm
+++ /dev/null
@@ -1,196 +0,0 @@
-package config_files::clm_phys_vers;
-my $pkg_nm = 'config_files::clm_phys_vers';
-#-----------------------------------------------------------------------------------------------
-#
-# SYNOPSIS
-#
-# require config_files::clm_phys_vers;
-#
-# my $phys = config_files::clm_phys_vers->new("clm4_5");
-# print $phys->as_float();
-# print $phys->as_long();
-# print $phys->as_string();
-# print $phys->as_filename();
-#
-# DESCRIPTION
-#
-# Enter the physics version as a string, with a list of valid versions, and have the ability to convert it to 
-# different formats.
-#
-# COLLABORATORS: None
-# 
-#-----------------------------------------------------------------------------------------------
-#
-# Date        Author                  Modification
-# 03/06/2014  Erik Kluzek             creation
-#
-#--------------------------------------------------------------------------------------------
-
-use strict;
-use bigint;
-#use warnings;
-#use diagnostics;
-
-my $major_mask      = 1000000;
-my $minor_mask      =    1000;
-my @version_strings = (  "clm4_5",                   "clm5_0" );
-my @version_long    = (  4*$major_mask+5*$minor_mask, 5*$major_mask );
-
-#-------------------------------------------------------------------------------
-
-sub new {
-    # Constructor, enter version string as argument
-    my $class       = shift;
-    my $vers_string = shift;
-
-    my $nm   = "$class\:\:new";
-    my $self = {};
-    bless($self, $class);
-    $self->__validate_vers__( $vers_string );
-    $self->{'vers_string'} = $vers_string;
-    return( $self );
-}
-
-#-------------------------------------------------------------------------------
-
-sub __validate_vers__ {
-   # Make sure the version string is a valid one
-   my $class       = shift;
-   my $vers_string = shift;
-
-   my $found = undef;
-   foreach  my $i (0..$#version_strings) {
-      if ( $vers_string eq $version_strings[$i] ) {
-         $found = 1;
-         last;
-      }
-   }
-   if ( ! defined($found) ) {
-      die "NOT a valid CLM version: $vers_string\n";
-   }
-}
-
-#-------------------------------------------------------------------------------
-
-sub as_long {
-# Return the physics version as a long
-  my $self = shift;
-  my $vers = shift;
-
-  if ( ! defined($vers) ) {
-     $vers = $self->{'vers_string'};
-  } else {
-     $self->__validate_vers__( $vers );
-  }
-  my $phys = undef;
-  for( my $i = 0; $i <= $#version_strings; $i++ ) {
-     if ( $vers eq $version_strings[$i] ) {
-        $phys = $version_long[$i];
-        last;
-     }
-  }
-  return( $phys );
-}
-
-#-------------------------------------------------------------------------------
-
-sub as_float {
-# Return the physics version as a float
-  my $self = shift;
-
-  my $long  = $self->as_long();
-  my $major = int($long / $major_mask);
-  my $minor = int(($long - $major*$major_mask)/ $minor_mask);
-  my $rev   =  $long - $major*$major_mask - $minor*$minor_mask;
-  {
-     no  bigint;
-     use bignum;
-
-     my $phys  = $major*1.0 + $minor/10.0   + $rev / 10000.0;
-     return( $phys );
-  }
-}
-
-#-------------------------------------------------------------------------------
-
-sub as_string {
-# Return the physics version as a string
-  my $self = shift;
-
-  my $phys = $self->{'vers_string'};
-  return( $phys );
-}
-
-#-------------------------------------------------------------------------------
-
-sub as_filename {
-# Return the physics version string with clm4_5 and clm5_0 pointing to the same name
-  my $self = shift;
-
-  my $phys = undef;
-  if ( $self->as_long() < 5*$major_mask ) {
-     $phys = $self->as_string();
-  } else {
-     $phys = "clm4_5";
-  }
-  return( $phys );
-}
-
-#-----------------------------------------------------------------------------------------------
-# Unit testing of above
-#-----------------------------------------------------------------------------------------------
-if ( ! defined(caller) && $#ARGV == -1 ) {
-   package phys_vers_unit_tester;
-
-   require Test::More;
-   Test::More->import( );
-
-   plan( tests=>8);
-
-   sub testit {
-      print "unit tester\n";
-      my %lastv;
-      my @vers_list = ( "clm4_5", "clm5_0" );
-      foreach my $vers ( @vers_list ) {
-         my $phys = config_files::clm_phys_vers->new($vers);
-         isa_ok($phys, "config_files::clm_phys_vers", "created clm_phys_vers object");
-         print "$vers: long: ".$phys->as_long()." float: ".$phys->as_float()." string: ".$phys->as_string()." file: ".$phys->as_filename()."\n";
-         if ( exists($lastv{"long"}) ) {
-            is( $phys->as_long() > $lastv{'long'}, 1, "Definition of long is not increasing\n" );
-         }
-         if ( exists($lastv{"float"}) ) {
-            is( $phys->as_float() > $lastv{'float'}, 1, "Definition of float is not increasing\n" );
-         }
-         # Check that also can get results of any valid value for long
-         foreach my $chvers ( @vers_list ) {
-            my $lvalue = $phys->as_long($chvers);
-            print "Long value of $chvers = $lvalue\n";
-         }
-         # Check that a bad value gives an error
-         eval { $phys->as_long('xxx'); };
-         like( $@, qr/NOT a valid CLM version:/, "check that a bad version fails" );
-         # Save last values to make sure increasing
-         $lastv{'long'}   = $phys->as_long();
-         $lastv{'float'}  = $phys->as_float();
-      }
-      my $phys = config_files::clm_phys_vers->new("clm4_5");
-      no  bigint;
-      use bignum;
-      is( 4.5, $phys->as_float(), "Make sure clm4_5 correct float value" );
-      no bignum;
-      use bigint;
-      $phys = config_files::clm_phys_vers->new("clm5_0");
-      is( 5.0, $phys->as_float(), "Make sure clm5_0 correct float value" );
-      print "\nSuccessfully ran all tests\n";
-   }
-}
-
-#-----------------------------------------------------------------------------------------------
-# Determine if you should run the unit test or if this is being called from a require statement
-#-----------------------------------------------------------------------------------------------
-
-if ( defined(caller) ) {
-   1   # to make use or require happy
-} elsif ( $#ARGV == -1 ) {
-   &phys_vers_unit_tester::testit();
-}
diff --git a/bld/config_files/config_defaults.xml b/bld/config_files/config_defaults.xml
deleted file mode 100644
index 09d5634b..00000000
--- a/bld/config_files/config_defaults.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-
-<?xml-stylesheet type="text/xsl" href="config_definition.xsl" ?>
-
-<config_definition>
-
-</config_definition>
diff --git a/bld/config_files/config_definition.xsl b/bld/config_files/config_definition.xsl
deleted file mode 100644
index f2f88609..00000000
--- a/bld/config_files/config_definition.xsl
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version='1.0'?>
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-
-<xsl:template match="/">
-  <html>
-    <xsl:apply-templates/>
-  </html>
-</xsl:template>
-
-<xsl:template match="config_definition">
-  <head>
-    <title>CLM Configuration Definition</title>
-  </head>
-  <body>
-    <h2>CLM Configuration Definition</h2>
-
-    <table border="1" cellpadding="10">
-    <caption><font size="larger"><bold>CLM Physics Configurations</bold></font></caption>
-    <tr>
-      <th rowspan="2">Name</th>
-      <th rowspan="2">Value</th>
-      <th>Description</th>
-    </tr>
-    <tr>
-      <th>Valid Values</th>
-    </tr>
-      <xsl:apply-templates select="entry[@category='physics']"/>
-    </table>
-
-    <table border="1" cellpadding="10">
-    <caption><font size="larger"><bold>CLM Biogeochemistry Configurations</bold></font></caption>
-    <tr>
-      <th rowspan="2">Name</th>
-      <th rowspan="2">Value</th>
-      <th>Description</th>
-    </tr>
-    <tr>
-      <th>Valid Value</th>
-    </tr>
-      <xsl:apply-templates select="entry[@category='bgc']"/>
-    </table>
-
-    <table border="1" cellpadding="10">
-    <caption><font size="larger"><bold>Configuration Directories</bold></font></caption>
-    <tr>
-      <th rowspan="2">Name</th>
-      <th rowspan="2">Value</th>
-      <th>Description</th>
-    </tr>
-    <tr>
-      <th>Valid Value</th>
-    </tr>
-      <xsl:apply-templates select="entry[@category='directories']"/>
-    </table>
-
-  </body>
-</xsl:template>
-
-<xsl:template match="entry">
-  <tr>
-    <td rowspan="2"><font color="#ff0000"><xsl:value-of select="@id"/></font></td>
-    <td rowspan="2"><xsl:value-of select="@value"/></td>
-    <td><xsl:apply-templates/></td>
-  </tr>
-  <tr>
-    <td><b>Valid values: </b> <xsl:value-of select="@valid_values"/></td>
-  </tr>
-</xsl:template>
-
-
-</xsl:stylesheet>
diff --git a/bld/config_files/config_definition_clm4_5.xml b/bld/config_files/config_definition_clm4_5.xml
deleted file mode 100644
index eb38cbe2..00000000
--- a/bld/config_files/config_definition_clm4_5.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0"?>
-
-<?xml-stylesheet type="text/xsl" href="config_definition.xsl" ?>
-
-<config_definition>
-
-<entry id="phys" 
-       valid_values="clm4_5,clm5_0"
-       value="clm4_5"
-       category="physics">
-Specifies either clm4_5, or clm5_0 physics
-</entry>
-
-<entry id="clm_root" 
-       value="" 
-       category="directories">
-Root directory of CLM source distribution (directory above CLM configure).
-</entry>
-
-<entry id="comp_intf" 
-       valid_values="ESMF,MCT,cpl_\$COMP" 
-       value="MCT"
-       category="directories">
-Component framework interface to use 
-(Model Coupling Toolkit, or Earth System Modeling Framework)
-</entry>
-
-<entry id="usr_src" 
-       value="" 
-       list="1" 
-       category="directories">
-User source directories to prepend to the filepath.  Multiple directories
-are specified as a comma separated list with no embedded white space.
-Normally this is SourceMods/src.clm in your case.
-</entry>
-
-<entry id="cppdefs" 
-       value="" 
-       category="physics">
-User specified CPP defines to append to Makefile defaults.
-Note: It's recommended to use configure options to set standard CPP values rather
-than defining them here.
-</entry>
-
-</config_definition>
diff --git a/bld/configure b/bld/configure
deleted file mode 100755
index b9b58f1b..00000000
--- a/bld/configure
+++ /dev/null
@@ -1,545 +0,0 @@
-#!/usr/bin/env perl
-#-----------------------------------------------------------------------------------------------
-#
-# configure
-#
-#
-# This utility allows the CLM user to specify compile-time configuration
-# options via a commandline interface.  The output from configure is a
-# Makefile and a cache file that contains all configuration parameters
-# required to produce the Makefile.  A subsequent invocation of configure
-# can use the cache file as input (via the -defaults argument) to reproduce
-# the CLM configuration contained in it.  Note that when a cache file is
-# used to set default values only the model parameters are used.  The
-# parameters that are platform dependent (e.g., compiler options, library
-# locations, etc) are ignored.
-#
-# As the build time configurable options of CLM are changed, this script
-# must also be changed.  Thus configure is maintained under revision
-# control in the CLM source tree and it is assumed that only the version of
-# configure in the source tree will be used to build CLM.  Thus we assume
-# that the root of the source tree can be derived from the location of this
-# script.
-#
-#-----------------------------------------------------------------------------------------------
-
-use strict;
-#use warnings;
-#use diagnostics;
-use Cwd qw(getcwd abs_path);
-use English;
-use Getopt::Long;
-use IO::File;
-use IO::Handle;
-use File::Copy;
-
-#-----------------------------------------------------------------------------------------------
-
-sub usage {
-    die <<EOF;
-SYNOPSIS
-     configure [options]
-
-     Configure CLM in preparation to be built.
-OPTIONS
-     User supplied values are denoted in angle brackets (<>).  Any value that contains
-     white-space must be quoted.  Long option names may be supplied with either single
-     or double leading dashes.  A consequence of this is that single letter options may
-     NOT be bundled.
-
-     -bgc <name>            Build CLM with BGC package [ none | cn ] 
-                            (default is none).
-     -cache <file>          Name of output cache file (default: config_cache.xml).
-     -cachedir <file>       Name of directory where output cache file is written 
-                            (default: CLM build directory).
-     -cimeroot <dir>        REQUIRED: Path to cime directory
-     -clm_root <dir>        Root directory of clm source code 
-                            (default: directory above location of this script)
-     -cppdefs <string>      A string of user specified CPP defines.  Appended to
-                            Makefile defaults.  e.g. -cppdefs '-DVAR1 -DVAR2'
-     -crop <name>           Toggle for prognostic crop model. [on | off] (default is off) 
-                            (can ONLY be turned on when BGC type is CN)
-     -comp_intf <name>      Component interface to use (ESMF or MCT) (default MCT)
-     -defaults <file>       Specify full path to a configuration file which will be used 
-                            to supply defaults instead of the defaults in bld/config_files.
-                            This file is used to specify model configuration parameters only.
-                            Parameters relating to the build which are system dependent will
-                            be ignored.
-     -help [or -h]          Print usage to STDOUT.
-     -noio                  Turn history output completely off (typically for testing).
-     -phys <name>           Value of clm4_5, or clm5_0 (default is clm4_5)   
-     -silent [or -s]        Turns on silent mode - only fatal messages issued.
-     -sitespf_pt <name>     Setup for the given site specific single-point resolution.
-     -snicar_frc <name>     Turn on SNICAR radiative forcing calculation. [on | off] 
-                            (default is off)
-     -usr_src <dir1>[,<dir2>[,<dir3>[...]]]
-                            Directories containing user source code.
-     -verbose [or -v]       Turn on verbose echoing of settings made by configure.
-     -version               Echo the SVN tag name used to check out this CLM distribution.
-EOF
-}
-
-#-----------------------------------------------------------------------------------------------
-# Setting autoflush (an IO::Handle method) on STDOUT helps in debugging.  It forces the test
-# descriptions to be printed to STDOUT before the error messages start.
-
-*STDOUT->autoflush();                  
-
-#-----------------------------------------------------------------------------------------------
-# Set the directory that contains the CLM configuration scripts.  If the configure command was
-# issued using a relative or absolute path, that path is in $ProgDir.  Otherwise assume the
-# command was issued from the current working directory.
-
-(my $ProgName = $0) =~ s!(.*)/!!;      # name of this script
-my $ProgDir = $1;                      # name of directory containing this script -- may be a
-                                       # relative or absolute path, or null if the script is in
-                                       # the user's PATH
-my $cwd = getcwd();                    # current working directory
-my $cfgdir;                            # absolute pathname of directory that contains this script
-if ($ProgDir) { 
-    $cfgdir = abs_path($ProgDir);
-} else {
-    $cfgdir = $cwd;
-}
-
-#-----------------------------------------------------------------------------------------------
-# Save commandline
-my $commandline = "$cfgdir/configure @ARGV";
-
-#-----------------------------------------------------------------------------------------------
-# Parse command-line options.
-my %opts = (
-	    cache       => "config_cache.xml",
-            phys        => "clm4_5",
-            noio        => undef,
-            cimeroot    => undef,
-            clm_root    => undef,
-	    );
-GetOptions(
-    "bgc=s"                     => \$opts{'bgc'}, 
-    "cache=s"                   => \$opts{'cache'},
-    "cachedir=s"                => \$opts{'cachedir'},
-    "snicar_frc=s"              => \$opts{'snicar_frc'},
-    "cimeroot=s"                => \$opts{'cimeroot'},       
-    "clm_root=s"                => \$opts{'clm_root'},
-    "cppdefs=s"                 => \$opts{'cppdefs'},
-    "comp_intf=s"               => \$opts{'comp_intf'},
-    "defaults=s"                => \$opts{'defaults'},
-    "clm4me=s"                  => \$opts{'clm4me'},
-    "h|help"                    => \$opts{'help'},
-    "noio"                      => \$opts{'noio'},
-    "phys=s"                    => \$opts{'phys'},
-    "snicar_frc=s"              => \$opts{'snicar_frc'}, 
-    "s|silent"                  => \$opts{'silent'},
-    "sitespf_pt=s"              => \$opts{'sitespf_pt'},
-    "usr_src=s"                 => \$opts{'usr_src'},
-    "v|verbose"                 => \$opts{'verbose'},
-    "version"                   => \$opts{'version'},
-    "crop=s"                    => \$opts{'crop'}, 
-)  or usage();
-
-# Give usage message.
-usage() if $opts{'help'};
-
-# Echo version info.
-version($cfgdir) if $opts{'version'};    
-
-# Check for unparsed arguments
-if (@ARGV) {
-    print "ERROR: unrecognized arguments: @ARGV\n";
-    usage();
-}
-
-# Define 3 print levels:
-# 0 - only issue fatal error messages
-# 1 - only informs what files are created (default)
-# 2 - verbose
-my $print = 1;
-if ($opts{'silent'})  { $print = 0; }
-if ($opts{'verbose'}) { $print = 2; }
-my $eol = "\n";
-
-my %cfg = ();           # build configuration
-
-#-----------------------------------------------------------------------------------------------
-# Make sure we can find required perl modules and configuration files.
-# Look for them in the directory that contains the configure script.
-
-my $cimeroot   = $opts{'cimeroot'};
-if ( ! defined($cimeroot) ) {
-  $cimeroot = "$cfgdir/../cime";
-  if (      -d $cimeroot ) {
-  } elsif ( -d "$cfgdir/../../../cime" ) {
-    $cimeroot = "$cfgdir/../../../cime";
-  } else {
-    die <<"EOF";
-** Cannot find the root of the cime directory  enter it using the -cimeroot option
-   Did you run the checkout_externals scripts?
-EOF
-  }
-}
-my $casecfgdir = "$cimeroot/scripts/Tools";
-my $perl5lib   = "$cimeroot/utils/perl5lib/";
-
-# The Build::Config module provides utilities to store and manipulate the configuration.
-my $file = "$perl5lib/Build/Config.pm";
-(-f "$file")  or  die <<"EOF";
-** Cannot find perl module \"Build/Config.pm\" in path
-    \"$file\" **
-EOF
-#-----------------------------------------------------------------------------------------------
-# Add $cfgdir/perl5lib to the list of paths that Perl searches for modules
-my @dirs = (  $cfgdir, "$perl5lib", $casecfgdir);
-unshift @INC, @dirs;
-require Build::Config;
-require config_files::clm_phys_vers;
-
-# Get the physics version
-my $phys = config_files::clm_phys_vers->new($opts{'phys'});
-
-# Check for the physics specific configuration definition file.
-my $phys_string = $phys->as_filename();
-
-my $config_def_file = "config_definition_$phys_string.xml";
-(-f "$cfgdir/config_files/$config_def_file")  or  die <<"EOF";
-** Cannot find configuration definition file \"$config_def_file\" in directory 
-    \"$cfgdir/config_files\" **
-EOF
-
-# The configuration defaults file modifies the generic defaults in the configuration
-# definition file.  Note that the -defaults option has precedence over all other options.
-my $config_defaults_file;
-my $std_config_defaults_file = "$cfgdir/config_files/config_defaults.xml";
-if    ($opts{'defaults'})           {
-    $config_defaults_file = $opts{'defaults'};
-} else {
-    $config_defaults_file = "$std_config_defaults_file";
-}
-(-f "$config_defaults_file")  or  die <<"EOF";
-** Cannot find configuration defaults file \"$config_defaults_file\" **
-EOF
-
-if ($print>=2) { print "Setting CLM configuration script directory to $cfgdir$eol"; }
-if ($print>=2) { print "Using configuration defaults file $config_defaults_file$eol"; }
-
-# Initialize the configuration.  The $config_def_file provides the definition of a CLM
-# configuration, and the $config_defaults_file provides default values for a specific CLM
-# configuration.   $cfg_ref is a reference to the new configuration object.
-my $cfg_ref = Build::Config->new("$cfgdir/config_files/$config_def_file", 
-				 "$config_defaults_file");
-
-#-----------------------------------------------------------------------------------------------
-# CLM root directory.  
-my $clm_root;
-
-if ( ! defined($opts{'clm_root'} ) ) {
-  $clm_root = abs_path("$cfgdir/..");
-} else {
-  $clm_root = $opts{'clm_root'};
-}
-
-if ( &is_valid_directory( "$clm_root/src", allowEnv=>0 ) ) {
-    $cfg_ref->set('clm_root', $clm_root);
-} else {
-    die <<"EOF";
-** Invalid CLM root directory: $clm_root
-** 
-** The CLM root directory must contain the subdirectory /src/.
-** clm_root can be entered on the command line or it will be derived
-** from the location of this script.
-EOF
-}
-
-if ($print>=2) { print "Setting CLM root directory to $clm_root$eol"; }
-
-#-----------------------------------------------------------------------------------------------
-# CLM build directory is current directory
-my $clm_bld = `pwd`;
-chomp( $clm_bld );
-
-# Make sure directory is valid
-if ( ! &is_valid_directory( $clm_bld ) and ! mkdirp($clm_bld)) {
-    die <<"EOF";
-** Could not create the specified CLM build directory: $clm_bld
-EOF
-}
-
-if ($print>=2) { print "Setting CLM build directory to $clm_bld$eol"; }
-
-#-----------------------------------------------------------------------------------------------
-# User source directories.
-my $usr_src = '';
-if (defined $opts{'usr_src'}) {
-    my @dirs = split ',', $opts{'usr_src'};
-    my @adirs;
-    while ( my $dir = shift @dirs ) {
-	if (&is_valid_directory( "$dir", allowEnv=>0 ) ) {
-	    push @adirs, $dir;
-	} else {
-	    die "** User source directory does not exist: $dir\n";
-	}
-    }
-    $usr_src = join ',', @adirs;
-    $cfg_ref->set('usr_src', $usr_src);
-}
-
-if ($print>=2) { print "Setting user source directories to $usr_src$eol"; }
-
-#-----------------------------------------------------------------------------------------------
-# configuration cache directory and file.
-my $config_cache_dir;
-my $config_cache_file;
-if (defined $opts{'cachedir'}) {
-    $config_cache_dir = abs_path($opts{'cachedir'});
-}
-else {
-    $config_cache_dir = $clm_bld;
-}
-
-if (&is_valid_directory( $config_cache_dir, allowEnv=>0 ) or mkdirp($config_cache_dir)) {
-    $config_cache_file = "$config_cache_dir/$opts{'cache'}";
-} else {
-    die <<"EOF";
-** Could not create the specified directory for configuration cache file: $config_cache_dir
-EOF
-}
-
-if ($print>=2) { print "The configuration cache file will be created in $config_cache_file$eol"; }
-
-
-#-----------------------------------------------------------------------------------------------
-# physics
-
-$cfg_ref->set('phys', $opts{'phys'});
-my $phys_string = $phys->as_string();
-if ($print>=2) { 
-   if( defined($opts{'phys'}) ) { 
-      print "Using version $phys_string physics.$eol"; 
-   }
-}
-
-#-----------------------------------------------------------------------------------------------
-# comp_intf option
-if (defined $opts{'comp_intf'}) {
-    $cfg_ref->set('comp_intf', $opts{'comp_intf'});
-}
-my $comp_intf = $cfg_ref->get('comp_intf');
-if ($print>=2) { print "Using $comp_intf for comp_intf.$eol"; }
-
-
-#-----------------------------------------------------------------------------------------------
-# Makefile configuration #######################################################################
-#-----------------------------------------------------------------------------------------------
-
-#-----------------------------------------------------------------------------------------------
-# Name of CLM executable.
-my $clm_exe = "clm";
-
-if ($print>=2) { print "Name of CLM executable: $clm_exe.$eol"; }
-
-#-----------------------------------------------------------------------------------------------
-# For the CPP tokens, start with the defaults (from defaults file) and append the specifications
-# from the commandline.  That way the user can override defaults since the commandline versions
-# occur last.
-my $usr_cppdefs = $cfg_ref->get('cppdefs');
-if (defined $opts{'cppdefs'}) {
-    $usr_cppdefs .= " $opts{'cppdefs'}";
-    print "Warning:: running with user defined cppdefs is NOT validated / " . 
-          "scientifically supported.$eol";
-}
-$cfg_ref->set('cppdefs', $usr_cppdefs);
-
-if ($usr_cppdefs and $print>=2) { print "Default and user CPP definitions: \'$usr_cppdefs\'$eol";}
-
-# The following CPP macro definitions are used to implement the compile-time options.  They are
-# determined by the configuration parameters that have been set above.  They will be appended to
-# the CPP definitions that were explicitly set in the defaults file or by the user on the commandline.
-my $cfg_cppdefs = '';
-if ($phys->as_long() >= $phys->as_long("clm4_5") ) {
-  # clm4_5 cppdefs -- SHOULD NOT BE ANY!
-  if ( $cfg_cppdefs ne '' ) {
-    die <<"EOF";
-** CPP definitions should be empty for clm5_0 and is NOT **
-EOF
-  }
-} elsif ($phys->as_long() == $phys->as_long("clm5_0") ) {
-  # clm5_0 cppdefs -- SHOULD NOT BE ANY!
-  if ( $cfg_cppdefs ne '' ) {
-    die <<"EOF";
-** CPP definitions should be empty for clm5_0 and is NOT **
-EOF
-  }
-} else {
-  # this should NOT happen
-  die <<"EOF";
-** Bad CLM physics version **
-EOF
-}
-# CPP defines to put on Makefile
-my $make_cppdefs = "$usr_cppdefs $cfg_cppdefs";
-
-if ($print>=2) { print "CPP definitions set by configure: \'$cfg_cppdefs\'$eol"; }
-
-#-----------------------------------------------------------------------------------------------
-# Write configuration files ####################################################################
-#-----------------------------------------------------------------------------------------------
-
-my $fp_filename      = 'Filepath';             # name of output filepath file
-my $cpp_filename     = 'CESM_cppdefs';         # name of output file for clm's cppdefs in cesm
-
-# Write the filepath file for cesm.
-write_filepath_cesmbld("$clm_bld/$fp_filename", $cfg_ref, $phys, allowEnv=>0 );
-if ($print>=2) { print "creating $clm_bld/$fp_filename\n"; }
-
-# Write the file for clm's cppdefs needed in cesm.
-write_cppdefs("$clm_bld/$cpp_filename", $make_cppdefs);
-if ($print>=2) { print "creating $clm_bld/$cpp_filename\n"; }
-
-# Write the configuration file.
-$cfg_ref->write_file($config_cache_file, $commandline);
-if ($print>=2) { print "creating $config_cache_file\n"; }
-
-#-----------------------------------------------------------------------------------------------
-# Done
-chdir( $cwd ) || die <<"EOF";
-** Trouble changing directory back to $cwd
-**
-EOF
-if ($print) { print "CLM configure done.\n"; }
-exit;
-
-#-----------------------------------------------------------------------------------------------
-# FINISHED ####################################################################################
-#-----------------------------------------------------------------------------------------------
-
-#-------------------------------------------------------------------------------
-
-sub write_filepath_cesmbld
-{
-    my ($file, $cfg_ref, $phys, %opts) = @_;
-    my  $fh = new IO::File;
-
-    $fh->open(">$file") or die "** can't open filepath file: $file\n";
-
-    # configuration parameters used to determine paths
-    my $usr_src  = $cfg_ref->get('usr_src');
-    my $clm_root = $cfg_ref->get('clm_root');
-
-    # User specified source directories.
-    if ($usr_src  =~ /\S+/) {
-       my @dirs = split ',', $usr_src;
-       while ( my $dir = shift @dirs ) {
-         print $fh "$dir\n";
-       }
-    } else {
-         print $fh "../SourceMods/src.clm\n";
-    }
-
-    if ($phys->as_long() == $phys->as_long("clm4_0") ) {
-	# source root
-	my $srcdir = "$clm_root/src_clm40";
-	if ( ! &is_valid_directory( "$srcdir", %opts )  ) { die "** source directory does not exist: $srcdir\n"; }
-
-	# source directories under root
-	my @dirs = ( "main", "biogeophys", "biogeochem" );
-	foreach my $dir ( @dirs ) {
-	    if ( &is_valid_directory( "$srcdir/$dir", %opts )  ) {
-		print $fh "$srcdir/$dir\n";
-	    } else {
-		die "** source directory does not exist: $srcdir/$dir\n";
-	    }
-	}
-    } else {
-	# source root
-	my $srcdir = "$clm_root/src";
-	if ( ! &is_valid_directory( "$srcdir", %opts )  ) { die "** source directory does not exist: $srcdir\n"; }
-
-	# source directories under root
-	my @dirs = ( "main", 
-		     "biogeophys", 
-		     "biogeochem", 
-		     "soilbiogeochem", 
-		     "init_interp",
-		     "utils", 
-		     "cpl" );
-
-	foreach my $dir ( @dirs ) {
-	    if ( &is_valid_directory( "$srcdir/$dir", %opts )  ) {
-		print $fh "$srcdir/$dir\n";
-	    } else {
-		die "** source directory does not exist: $srcdir/$dir\n";
-	    }
-	}
-    }
-
-
-    $fh->close;
-}
-#-------------------------------------------------------------------------------
-
-sub write_cppdefs
-{
-    my ($file, $make_cppdefs) = @_;
-    my  $fh = new IO::File;
-
-    $fh->open(">$file") or die "** can't open cpp defs file: $file\n";
-
-    print $fh "$make_cppdefs\n";
-    $fh->close;
-}
-
-#-------------------------------------------------------------------------------
-
-sub mkdirp {
-    my ($dir) = @_;
-    my (@dirs) = split /\//, $dir;
-    my (@subdirs, $path);
-
-    # if $dir is absolute pathname then @dirs will start with ""
-    if ($dirs[0] eq "") { push @subdirs, shift @dirs; }  
-
-    while ( @dirs ) { # check that each subdir exists and mkdir if it doesn't
-	push @subdirs, shift @dirs;
-	$path = join '/', @subdirs;
-	unless (-d $path or mkdir($path, 0777)) { return 0; }
-    }
-    return 1;
-}
-
-#-------------------------------------------------------------------------------
-
-sub version {
-# The version is found in CLM's ChangeLog file.
-# $cfgdir is set by the configure script to the name of its directory.
-
-    my ($cfgdir) = @_;
-
-    my $logfile = "$cfgdir/../doc/ChangeLog";
-
-    my $fh = IO::File->new($logfile, '<') or die "** can't open ChangeLog file: $logfile\n";
-
-    while (my $line = <$fh>) {
-
-	if ($line =~ /^Tag name:\s*[clm0-9_.-]*\s*[toin]*\s*([cesmclm0-9_.-]+)$/ ) {
-	    print "$1\n";
-	    exit;
-	}
-    }
-
-}
-
-#-------------------------------------------------------------------------------
-
-sub is_valid_directory {
-#
-# Validate that the input is a valid existing directory.
-#
-  my ($dir, %opts) = @_;
-  my $nm = "is_valid_directory";
-
-  my $valid = 0;
-  if ( -d $dir ) { $valid = 1; }
-  return( $valid );
-  
-}
-
diff --git a/bld/env_run.xml b/bld/env_run.xml
deleted file mode 100644
index 8bf59d09..00000000
--- a/bld/env_run.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0"?>
-
-<config_definition>
-
-<!--
-
-Sample env_run.xml file that allows build-namelist to be run for testing in this directory.
-
--->
-<entry id="DIN_LOC_ROOT"         value="MYDINLOCROOT"  /> 
-<entry id="GLC_TWO_WAY_COUPLING" value="FALSE"         /> 
-
-</config_definition>
diff --git a/bld/namelist_files/LogMessages.pm b/bld/namelist_files/LogMessages.pm
deleted file mode 100755
index 77f0569b..00000000
--- a/bld/namelist_files/LogMessages.pm
+++ /dev/null
@@ -1,244 +0,0 @@
-package namelist_files::LogMessages;
-my $pkg_nm = 'namelist_files::LogMessages';
-#-----------------------------------------------------------------------------------------------
-#
-# SYNOPSIS
-#
-# require namelist_files::LogMessages;
-#
-# my %opts;
-# my $log = namelist_files::LogMessages->new("ProgName", \%opts);
-# $log->message("message to print");
-# $log->verbose_message("message to print only if verbose mode is on");
-# $log->warning("Warning message");
-# $log->exit_message("clean exit");
-# $log->fatal_error("die with fatal error");
-# $log->final_exit("Final message to send (and exit");
-#
-#
-# DESCRIPTION
-#
-# Handles log messages for perl. Sets up log messages according to verbose
-# or silent setting. It also handles warnings printing them, but on finalization
-# aborting unless ignore_warnings was set.
-#
-# COLLABORATORS: None
-# 
-#-----------------------------------------------------------------------------------------------
-#
-# Date        Author                  Modification
-# 10/06/2017  Erik Kluzek             creation
-#
-#--------------------------------------------------------------------------------------------
-
-use strict;
-#use warnings;
-#use diagnostics;
-
-#-------------------------------------------------------------------------------
-
-sub new {
-    my $class    = shift;
-    my $ProgName = shift;
-    my %opts     = %{shift()};
-
-    my $nm   = "$class\:\:new";
-    my $self = {};
-    bless($self, $class);
-    $self->{'nwarns'}    = 0;
-    $self->{'verbosity'} = 1;
-    $self->{'NO_EXIT'}   = $opts{'NO_EXIT'};
-    $self->{'ProgName'}  = $ProgName;
-    $self->{'ignore_warnings'} = $opts{'ignore_warnings'};
-    $self->__set_print_level( \%opts );
-    return( $self );
-}
-
-
-#-------------------------------------------------------------------------------
-
-sub __set_print_level {
-  my $self        = shift;
-  # Define print levels:
-  # 0 - only issue fatal error messages
-  # 1 - only informs what files are created (default)
-  # 2 - verbose
-  my %opts = %{shift()};
-
-  if ( $opts{'silent'} && $opts{'verbose'} ) {
-     $self->fatal_error( "Can not set both the -silent and the -verbose options -- set one or the other" );
-  }
-  my $verbosity = 1;
-  if ($opts{'silent'})  { $verbosity = 0; }
-  if ($opts{'verbose'}) { $verbosity = 2; }
-  $self->{'verbosity'} = $verbosity;
-  $self->{'print_verbose'} = 2;
-}
-
-#-------------------------------------------------------------------------------
-
-sub message {
-  my $self = shift;
-  my ($message) = @_;
-  if ($self->{'verbosity'} > 0) {
-    print "$message\n";
-  }
-}
-
-#-------------------------------------------------------------------------------
-
-sub verbose_message {
-  my $self = shift;
-
-  my ($message) = @_;
-  if ($self->{'verbosity'} >= $self->{'print_verbose'}) {
-    print "$message\n";
-  }
-}
-#-------------------------------------------------------------------------------
-
-sub nwarns {
-  my $self = shift;
-
-  return( $self->{'nwarns'} );
-}
-
-#-------------------------------------------------------------------------------
-
-sub final_exit {
-  my $self = shift;
-  my ($message) = @_;
-  if ( $self->{'nwarns'} > 0 ) {
-    $self->message( "\n\nYou ran with the -ignore_warnings options and allowed $self->{'nwarns'} to go past\n" );
-  }
-  $self->verbose_message( $message );
-  if ( $self->{'NO_EXIT'} ) {
-    die
-  } else {
-    exit;
-  }
-}
-
-#-------------------------------------------------------------------------------
-# Some simple subroutines to do a clean exit, print warning, or a fatal error
-
-sub exit_message {
-  my $self = shift;
-  my ($message) = @_;
-  print "$self->{ProgName} : $message\n";
-  if ( $self->{'NO_EXIT'} ) {
-    die
-  } else {
-    exit;
-  }
-}
-
-#-------------------------------------------------------------------------------
-
-sub warning {
-  my $self      = shift;
-  my $message   = shift;
-
-  $self->{'nwarns'} = $self->{'nwarns'} + 1;
-  my $func_name = (caller(1))[3];
-  if ( $self->{'ignore_warnings'} ) {
-    print "Warning : $self->{ProgName}::${func_name}() : $message\n\n";
-  } else {
-    die "Warning : $self->{ProgName}::${func_name}() : $message\n" . 
-        " -- Add -ignore_warnings option to CLM_BLDNML_OPTS to ignore this warning\n\n";
-  }
-}
-
-#-------------------------------------------------------------------------------
-
-sub fatal_error {
-  my $self        = shift;
-  my ($message) = @_;
-  my $func_name = (caller(1))[3];
-  die "ERROR : $self->{ProgName}::${func_name}() : $message\n";
-}
-
-#-------------------------------------------------------------------------------
-
-#-----------------------------------------------------------------------------------------------
-# Unit testing of above
-#-----------------------------------------------------------------------------------------------
-if ( ! defined(caller) && $#ARGV == -1 ) {
-   package LogMessage_unit_tester;
-
-   require Test::More;
-   Test::More->import( );
-
-   plan( tests=>11 );
-
-   sub testit {
-      print "unit tester\n";
-      my %opts;
-      my $message;
-
-      # Standard verbose level, test all methods
-      $opts{'NO_EXIT'}         = 1;
-      my $log = namelist_files::LogMessages->new("ProgName", \%opts);
-      isa_ok($log, "namelist_files::LogMessages", "Created LogMessages object");
-      $log->message("message to print");
-      $log->verbose_message("YOU SHOULD NOT SEE THIS MESSAGE BECAUSE IT IS VERBOSE AND VERBOSE NOT ON");
-      $message = "Warning message";
-      is ( $log->nwarns(), 0, "Make sure have zero warnings" );
-      eval{ $log->warning($message); };
-      like( $@, qr/$message/, "check that a warning dies without ignore_warnings option" );
-      is ( $log->nwarns(), 1, "Make sure have one warning" );
-      $message = "die with fatal error";
-      eval{ $log->fatal_error($message); };
-      like( $@, qr/$message/, "check that a fatal_error dies" );
-      $message = "exit with exit message";
-      eval{ $log->exit_message($message); };
-      like( $@, qr/Died/, "check that a exit_message exits" );
-      $message = "Final message to send";
-      eval{ $log->final_exit($message); };
-      like( $@, qr/Died/, "check that a final exits" );
-
-      # Test ignore_warnings option and verbose mode
-      $opts{'ignore_warnings'} = 1;
-      $opts{'verbose'}         = 1;
-      $opts{'NO_EXIT'}         = 1;
-      $log = namelist_files::LogMessages->new("ProgName", \%opts);
-      isa_ok($log, "namelist_files::LogMessages", "Created LogMessages object");
-      $log->verbose_message("message to print only if verbose mode is on");
-      $log->warning("Warning message");
-      $log->warning("Warning message2");
-      $log->warning("Warning message3");
-      $log->warning("Warning message4");
-      $log->warning("Warning message5");
-      is ( $log->nwarns(), 5, "Make sure have five warnings" );
-      eval{ $log->final_exit($message); };
-      print "content: $@\n";
-      like( $@, qr/Died/, "check that a final_exit with warning exits" );
-      # silent mode
-      $opts{'ignore_warnings'} = 0;
-      $opts{'verbose'}         = 0;
-      $opts{'silent'}          = 1;
-      $opts{'NO_EXIT'}         = 1;
-      $log = namelist_files::LogMessages->new("ProgName", \%opts);
-      $log->message("YOU SHOULD NOT SEE THIS MESSAGE BECAUSE SILENT MODE IS ON");
-      $log->verbose_message("YOU SHOULD NOT SEE THIS VERBOSE MESSAGE BECAUSE SILENT MODE IS ON");
-      # Should die with error if both silent and verbose mode is on
-      $opts{'ignore_warnings'} = 0;
-      $opts{'verbose'}         = 1;
-      $opts{'silent'}          = 1;
-      $opts{'NO_EXIT'}         = 1;
-      eval{ $log = namelist_files::LogMessages->new("ProgName", \%opts); };
-      print "content: $@\n";
-      like( $@, qr/ERROR : /, "check that died if both verbose and silent mode is on" );
-      print "\nSuccessfully ran all tests\n";
-   }
-}
-
-#-----------------------------------------------------------------------------------------------
-# Determine if you should run the unit test or if this is being called from a require statement
-#-----------------------------------------------------------------------------------------------
-
-if ( defined(caller) ) {
-   1   # to make use or require happy
-} elsif ( $#ARGV == -1 ) {
-   &LogMessage_unit_tester::testit();
-}
diff --git a/bld/namelist_files/namelist_defaults.xsl b/bld/namelist_files/namelist_defaults.xsl
deleted file mode 100644
index 3085d98f..00000000
--- a/bld/namelist_files/namelist_defaults.xsl
+++ /dev/null
@@ -1,165 +0,0 @@
-<?xml version='1.0'?>
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-
-<xsl:template match="/">
-  <html>
-  <head>
-    <title>CLM Namelist Defaults</title>
-  </head>
-  <body>
-    <h2>Default Values for Namelist Variables</h2>
-    <p>Included in the table are the following pieces of information:</p>
-    <h3>Table headers include:</h3>
-    <ul>
-       <li>Name of variable</li>
-       <li>Horizontal grid resolution</li>
-       <li>Land ocean mask type</li>
-       <li>Simulation year</li>
-       <li>Simulation year range (for transient datasets)</li>
-    </ul>
-    <h3>Miscellaneous items include:</h3>
-    <ol>
-       <li>Biogeochemistry (BGC) type (none, CN)</li>
-       <li>Initial condition date (ymd - year month day)</li>
-       <li>Initial condition time of day (tod) (sec)</li>
-       <li>Maximum number of Plant Function Types (maxpft)</li>
-       <li>Site specific point name (sitespf_pt)</li>
-       <li>Crop model (crop)</li>
-       <li>Data model forcing source (forcing)</li>
-       <li>Representative concentration pathway for future scenarios (rcp)</li>
-       <li>New good wood harvest (newwoodharv)</li>
-       <li>Type of file (type)</li>
-       <li>Grid mapping to (to_hgrid)</li>
-       <li>Land-mask mapping to (to_lmask)</li>
-       <li>High resolution file? (hires)</li>
-    </ol>
-
-    <table border="1" cellpadding="10">
-    <caption>Namelist Defaults</caption>
-    <tr>
-      <th rowspan="2">Name</th>
-      <th>Horz. Grid</th>
-      <th>Mask</th>
-      <th>Sim year</th>
-      <th>Sim year range</th>
-      <th>Miscellaneous</th>
-    </tr>
-    <tr>
-      <th colspan="5">Default Value for this Configuration</th>
-    </tr>
-      <xsl:for-each select="namelist_defaults/*">
-      <xsl:sort select="name()"/>
-      <tr>
-        <td rowspan="2"><font color="#ff0000">
-        <xsl:value-of select="name()"/>
-        </font></td>
-        <td>
-        <xsl:choose>
-        <xsl:when test="string-length(@hgrid)>0">
-             <xsl:value-of select="@hgrid"/>
-        </xsl:when>
-        <xsl:when test="string-length(@frm_hgrid)>0">
-             <xsl:value-of select="@frm_hgrid"/>
-        </xsl:when>
-        <xsl:otherwise>
-             All res
-        </xsl:otherwise>
-        </xsl:choose>
-        </td>
-        <td>
-        <xsl:choose>
-        <xsl:when test="string-length(@mask)>0">
-             <xsl:value-of select="@mask"/>
-        </xsl:when>
-        <xsl:when test="string-length(@lmask)>0">
-             <xsl:value-of select="@lmask"/>
-        </xsl:when>
-        <xsl:when test="string-length(@frm_lmask)>0">
-             <xsl:value-of select="@frm_lmask"/>
-        </xsl:when>
-        <xsl:when test="name()='mksrf_fvegtyp'">
-             MODIS
-        </xsl:when>
-        <xsl:otherwise>
-             All masks
-        </xsl:otherwise>
-        </xsl:choose>
-        </td>
-        <td>
-        <xsl:choose>
-        <xsl:when test="string-length(@sim_year)>0">
-             <xsl:value-of select="@sim_year"/>
-        </xsl:when>
-        <xsl:otherwise>
-             All yrs
-        </xsl:otherwise>
-        </xsl:choose>
-        </td>
-        <td>
-        <xsl:choose>
-        <xsl:when test="string-length(@sim_year_range)>0">
-             <xsl:value-of select="@sim_year_range"/>
-        </xsl:when>
-        <xsl:otherwise>
-             All sim-yr-rng
-        </xsl:otherwise>
-        </xsl:choose>
-        </td>
-        <td>
-        <xsl:if test="string-length(@bgc)>0">
-        bgc=<xsl:value-of select="@bgc"/>
-        </xsl:if>
-        <xsl:if test="string-length(@ic_ymd)>0">
-        ymd=<xsl:value-of select="@ic_ymd"/>
-        </xsl:if>
-        <xsl:if test="string-length(@ic_tod)>0">
-        tod=<xsl:value-of select="@ic_tod"/>
-        </xsl:if>
-        <xsl:if test="string-length(@maxpft)>0">
-        maxpft=<xsl:value-of select="@maxpft"/>
-        </xsl:if>
-        <xsl:if test="string-length(@sitespf_pt)>0">
-        sitespf_pt=<xsl:value-of select="@sitespf_pt"/>
-        </xsl:if>
-        <xsl:if test="string-length(@datm_presaero)>0">
-        datm_presaero=<xsl:value-of select="@datm_presaero"/>
-        </xsl:if>
-        <xsl:if test="string-length(@crop)>0">
-        crop=<xsl:value-of select="@crop"/>
-        </xsl:if>
-        <xsl:if test="string-length(@source)>0">
-        forcing=<xsl:value-of select="@source"/>
-        </xsl:if>
-        <xsl:if test="string-length(@rcp)>0">
-        rcp=<xsl:value-of select="@rcp"/>
-        </xsl:if>
-        <xsl:if test="string-length(@ngwh)>0">
-        newwoodharv=<xsl:value-of select="@ngwh"/>
-        </xsl:if>
-        <xsl:if test="string-length(@type)>0">
-        type=<xsl:value-of select="@type"/>
-        </xsl:if>
-        <xsl:if test="string-length(@to_hgrid)>0">
-        to_hgrid=<xsl:value-of select="@to_hgrid"/>
-        </xsl:if>
-        <xsl:if test="string-length(@to_lmask)>0">
-        to_lmask=<xsl:value-of select="@to_lmask"/>
-        </xsl:if>
-        <xsl:if test="string-length(@hires)>0">
-        hires=<xsl:value-of select="@hires"/>
-        </xsl:if>
-        </td>
-      </tr>
-      <tr>
-        <td colspan="5"><b>Value: </b><xsl:value-of select="."      /></td>
-      </tr>
-      </xsl:for-each>
-    </table>
-
-  </body>
-
-  </html>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml
deleted file mode 100644
index 1c0cf2d0..00000000
--- a/bld/namelist_files/namelist_defaults_clm4_5.xml
+++ /dev/null
@@ -1,487 +0,0 @@
-<?xml version="1.0"?>
-
-<?xml-stylesheet type="text/xsl" href="namelist_defaults.xsl"?>
-
-<namelist_defaults>
-
-
-<!--
-Values to use by default for creation of CLM model namelists.
-The element names are the same as the corresponding namelist
-variables.  Values that depend on the model configuration use
-attributes to express the dependency.  The recognized attributes
-are: hgrid, defaults, mask, ic_ymd, ic_tod, sim_year and all configuration
-attributes from the config_cache.xml file (with keys converted to upper-case).
--->
-
-<!-- Default resolution -->
-<res>0.9x1.25</res>
-
-<sim_year>2000</sim_year>
-
-<!-- Default time step -->
-<dtime>1800</dtime>
-
-<!-- ================================================================== -->
-<!-- The default filenames are given relative to the root directory
-     for the CLM2 data in the CESM distribution -->
-<!-- Plant function types (relative to {csmdata}) -->
-
-<!--
-
-     Initial condition files to use and or interpolate from
-
--->
-
-<!-- How close in years should the date be to use initial conditions -->
-<init_interp_how_close>75</init_interp_how_close>
-
-<!-- What simulation years can find initial conditions to interpolate from (find one that's within the how_close years above)-->
-<init_interp_sim_years>1850,2000</init_interp_sim_years>
-
-<!-- Interpolate from an initial condition file at startup? -->
-<use_init_interp sim_year="1850">.true.</use_init_interp>
-<use_init_interp sim_year="2000">.true.</use_init_interp>
-<use_init_interp                >.false.</use_init_interp>
-
-<!--
-  Set attributes to find specific matching finidat files below
-  Each of these settings will correspond to a specific finidat that is
-  set up. If more finidat files are added you may need to add more of these.
-  Or one specific file will be chosen over another.
--->
-<init_interp_attributes sim_year="1850" lnd_tuning_mode="clm4_5_GSWP3v1"
->hgrid=0.9x1.25 maxpft=17 mask=gx1v6 
-</init_interp_attributes>
-
-<init_interp_attributes sim_year="1850" lnd_tuning_mode="clm4_5_CRUv7"
->hgrid=0.9x1.25 maxpft=17 mask=gx1v6 
-</init_interp_attributes>
-
-<init_interp_attributes sim_year="1850" lnd_tuning_mode="clm4_5_cam6.0"
->hgrid=0.9x1.25 maxpft=79 mask=gx1v7 
-</init_interp_attributes>
-
-<!--
-  Which is correct? The next or the previous one?
--->
-<init_interp_attributes sim_year="1850" lnd_tuning_mode="clm5_0_GSWP3v1"
->hgrid=0.9x1.25 maxpft=79 mask=gx1v6 
-</init_interp_attributes>
-
-<init_interp_attributes sim_year="1850" lnd_tuning_mode="clm5_0_CRUv7"
->hgrid=0.9x1.25 maxpft=79 mask=gx1v6 
-</init_interp_attributes>
-<!--
-  Which is correct? The next or the previous one?
--->
-<init_interp_attributes sim_year="1850" lnd_tuning_mode="clm5_0_CRUv7"
->hgrid=0.9x1.25 maxpft=17 mask=gx1v6 
-</init_interp_attributes>
-
-<init_interp_attributes sim_year="1850" lnd_tuning_mode="clm5_0_cam6.0"
->hgrid=0.9x1.25 maxpft=79 mask=gx1v7 
-</init_interp_attributes>
-
-<init_interp_attributes sim_year="2000" 
->hgrid=1.9x2.5 maxpft=79 mask=gx1v6 
-</init_interp_attributes>
-
-<!-- MML data sets --> 
-<!-- for any year (2000 or 1850) -->
-<mml_surdat hgrid="0.9x1.25">
-lnd/slim/surdat/slim_realistic_f19_20190110_reverse_cutout_to_f09_c20230224.nc</mml_surdat>
-<mml_surdat hgrid="1.9x2.5">
-lnd/slim/surdat/mml_1.9x2.5_default_cdf5_c20211105.nc</mml_surdat>
-<mml_surdat hgrid="4x5">
-lnd/slim/surdat/slim_realistic_f19_20190110_cutout_to_f45_c20230131.nc</mml_surdat>
-<mml_surdat hgrid="10x15">
-lnd/slim/surdat/slim_realistic_f19_20190110_cutout_to_f10_c20230131.nc</mml_surdat>
-
-
-<!--
-     1850 preindustrial IC (if use_init_interp is added and set to .true. then MUST still interpolate even on an exact match)
-                           (if it will work on an exact match, leave use_init_interp off)
--->
-
-<finidat hgrid="0.9x1.25"  maxpft="17"  mask="gx1v6"
-         ic_ymd="18500101" sim_year="1850"
-         ic_tod="0" 
-         lnd_tuning_mode="clm4_5_GSWP3v1"
->lnd/clm2/initdata_map/clmi.I1850Clm45BgcGs.0901-01-01.0.9x1.25_gx1v6_simyr1850_c180204.nc
-</finidat>
-
-<finidat hgrid="0.9x1.25"  maxpft="17"  mask="gx1v6"
-         ic_ymd="18500101" sim_year="1850"
-         ic_tod="0" 
-         lnd_tuning_mode="clm4_5_CRUv7"
->lnd/clm2/initdata_map/clmi.I1850Clm45BgcCruGs.1101-01-01.0.9x1.25_gx1v6_simyr1850_c180204.nc
-</finidat>
-
-<finidat hgrid="0.9x1.25"  maxpft="79"  mask="gx1v7"
-         ic_ymd="18500101" sim_year="1850"
-         ic_tod="0" 
-         lnd_tuning_mode="clm4_5_cam6.0"
->lnd/clm2/initdata_map/clmi.B1850.0161-01-01.0.9x1.25_gx1v7_simyr1850_c180130.nc
-</finidat>
-
-
-<finidat hgrid="0.9x1.25"  maxpft="17"  mask="gx1v6"
-         ic_ymd="18500101" sim_year="1850"
-         ic_tod="0" 
-         lnd_tuning_mode="clm5_0_GSWP3v1"
->lnd/clm2/initdata_map/clmi.I1850Clm50Sp.0181-01-01.0.9x1.25_gx1v6_simyr1850_c171214.nc
-</finidat>
-
-
-<finidat hgrid="0.9x1.25"  maxpft="79"  mask="gx1v6"
-         ic_ymd="18500101" sim_year="1850"
-         ic_tod="0" use_init_interp=".true."
-         lnd_tuning_mode="clm5_0_GSWP3v1"
->lnd/clm2/initdata_map/clmi.I1850Clm50BgcCrop.1366-01-01.0.9x1.25_gx1v6_simyr1850_c171213.nc
-</finidat>
-
-
-<finidat hgrid="0.9x1.25"  maxpft="79"  mask="gx1v6"
-         ic_ymd="18500101" sim_year="1850"
-         ic_tod="0" 
-         lnd_tuning_mode="clm5_0_CRUv7"
->lnd/clm2/initdata_map/clmi.I1850Clm50BgcCropCru.1526-01-01.0.9x1.25_gx1v6_simyr1850_c180109.nc
-</finidat>
-
-
-<finidat hgrid="0.9x1.25"  maxpft="79"  mask="gx1v7"
-         ic_ymd="18500101" sim_year="1850"
-         ic_tod="0" 
-         lnd_tuning_mode="clm5_0_cam6.0"
->lnd/clm2/initdata_map/clmi.B1850.0161-01-01.0.9x1.25_gx1v7_simyr1850_c180130.nc
-</finidat>
-
-<finidat hgrid="0.9x1.25"  maxpft="17"  mask="gx1v6"
-         ic_ymd="18500101" sim_year="1850"
-         ic_tod="0" 
-         lnd_tuning_mode="clm5_0_CRUv7"
->lnd/clm2/initdata_map/clmi.I1850Clm50SpCru.1706-01-01.0.9x1.25_gx1v6_simyr1850_c180110.nc
-</finidat>
-
-
-<!--
-     Present day IC (if use_init_interp is set and .true. then MUST still interpolate even on an exact match)
-                    (if it will work on an exact match, leave use_init_interp off)
--->
-
-<!-- Present day crop spinup at 2-degree with irrigation on -->
-<finidat hgrid="1.9x2.5"    maxpft="79"  mask="gx1v6"
-         ic_ymd="20110101" sim_year="2000"
-         ic_tod="0" use_init_interp=".true."
->lnd/clm2/initdata_map/clmi.IGM2000GSWP3CLM50BGCCROPIRR.2011-01-01.1.9x2.5_gx1v6_gl5_simyr2000_c170419.nc
-</finidat>
-
-<!-- for present day simulations - year 2000 -->
-<fsurdat hgrid="360x720cru"   sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_360x720cru_16pfts_Irrig_CMIP6_simyr2000_c170824.nc</fsurdat>
-<fsurdat hgrid="48x96"     sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_48x96_16pfts_Irrig_CMIP6_simyr2000_c170824.nc</fsurdat>
-
-<fsurdat hgrid="0.47x0.63"  sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_0.47x0.63_16pfts_Irrig_CMIP6_simyr2000_c170919.nc</fsurdat>
-<fsurdat hgrid="0.9x1.25"  sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_0.9x1.25_16pfts_Irrig_CMIP6_simyr2000_c170824.nc</fsurdat>
-<fsurdat hgrid="1.9x2.5"   sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_1.9x2.5_16pfts_Irrig_CMIP6_simyr2000_c170824.nc</fsurdat>
-<fsurdat hgrid="4x5"       sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_4x5_16pfts_Irrig_CMIP6_simyr2000_c170824.nc</fsurdat>
-<fsurdat hgrid="10x15"     sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_10x15_16pfts_Irrig_CMIP6_simyr2000_c170824.nc</fsurdat>
-
-<fsurdat hgrid="ne120np4"    sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_ne120np4_16pfts_Irrig_CMIP6_simyr2000_c170824.nc</fsurdat>
-<fsurdat hgrid="ne30np4"     sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_ne30np4_16pfts_Irrig_CMIP6_simyr2000_c170824.nc</fsurdat>
-<fsurdat hgrid="ne16np4"     sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_ne16np4_16pfts_Irrig_CMIP6_simyr2000_c170824.nc</fsurdat>
-
-<fsurdat hgrid="5x5_amazon"    sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_5x5_amazon_16pfts_Irrig_CMIP6_simyr2000_c171214.nc</fsurdat>
-<fsurdat hgrid="1x1_brazil"    sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_1x1_brazil_16pfts_Irrig_CMIP6_simyr2000_c171214.nc</fsurdat>
-
-<!-- Needed for SCAM (Single Column Atmosphere Model) -->
-<fsurdat hgrid="64x128"      sim_year="2000" 
->lnd/clm2/surfdata_map/surfdata_64x128_16pfts_Irrig_CMIP6_simyr2000_c170824.nc</fsurdat>
-
-<!-- Crop surface datasets -->
-<fsurdat hgrid="0.47x0.63"  sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_0.47x0.63_78pfts_CMIP6_simyr2000_c170919.nc</fsurdat>
-<fsurdat hgrid="0.9x1.25"  sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_0.9x1.25_78pfts_CMIP6_simyr2000_c170824.nc</fsurdat>
-<fsurdat hgrid="1.9x2.5"   sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_1.9x2.5_78pfts_CMIP6_simyr2000_c170824.nc</fsurdat>
-<fsurdat hgrid="0.125x0.125"  sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_0.125x0.125_mp24_simyr2000_c150114.nc</fsurdat>
-<fsurdat hgrid="10x15"     sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_10x15_78pfts_CMIP6_simyr2000_c170824.nc</fsurdat>
-<fsurdat hgrid="4x5"       sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_4x5_78pfts_CMIP6_simyr2000_c170824.nc</fsurdat>
-
-<fsurdat hgrid="ne120np4"    sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_ne120np4_78pfts_CMIP6_simyr2000_c170824.nc</fsurdat>
-<fsurdat hgrid="ne30np4"     sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_ne30np4_78pfts_CMIP6_simyr2000_c170824.nc</fsurdat>
-<fsurdat hgrid="ne16np4"     sim_year="2000" >
-lnd/clm2/surfdata_map/surfdata_ne16np4_78pfts_CMIP6_simyr2000_c170824.nc</fsurdat>
-
-<!-- for pre-industrial simulations - year 1850 without crop -->
-<fsurdat hgrid="360x720cru"   sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_360x720cru_16pfts_Irrig_CMIP6_simyr1850_c170824.nc</fsurdat>
-<fsurdat hgrid="48x96"        sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_48x96_16pfts_Irrig_CMIP6_simyr1850_c170824.nc</fsurdat>
-
-<fsurdat hgrid="0.47x0.63"  sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_0.47x0.63_16pfts_Irrig_CMIP6_simyr1850_c170919.nc</fsurdat>
-<fsurdat hgrid="0.9x1.25"     sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_0.9x1.25_16pfts_Irrig_CMIP6_simyr1850_c170824.nc</fsurdat>
-<fsurdat hgrid="1.9x2.5"      sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_1.9x2.5_16pfts_Irrig_CMIP6_simyr1850_c170824.nc</fsurdat>
-<fsurdat hgrid="10x15"        sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_10x15_16pfts_Irrig_CMIP6_simyr1850_c170824.nc</fsurdat>
-<fsurdat hgrid="4x5"          sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_4x5_16pfts_Irrig_CMIP6_simyr1850_c170824.nc</fsurdat>
-
-<fsurdat hgrid="1x1_brazil"    sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_1x1_brazil_16pfts_Irrig_CMIP6_simyr1850_c171214.nc</fsurdat>
-
-
-<fsurdat hgrid="ne120np4"     sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_ne120np4_16pfts_Irrig_CMIP6_simyr1850_c170824.nc</fsurdat>
-<fsurdat hgrid="ne30np4"      sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_ne30np4_16pfts_Irrig_CMIP6_simyr1850_c170824.nc</fsurdat>
-
-<!-- pre-industrial with crop -->
-<fsurdat hgrid="360x720cru"   sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_360x720cru_78pfts_CMIP6_simyr1850_c170824.nc</fsurdat>
-<fsurdat hgrid="48x96"        sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_48x96_78pfts_CMIP6_simyr1850_c170824.nc</fsurdat>
-
-<fsurdat hgrid="0.47x0.63"  sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_0.47x0.63_78pfts_CMIP6_simyr1850_c170919.nc</fsurdat>
-<fsurdat hgrid="0.9x1.25"  sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_0.9x1.25_78pfts_CMIP6_simyr1850_c170824.nc</fsurdat>
-<fsurdat hgrid="1.9x2.5"   sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_1.9x2.5_78pfts_CMIP6_simyr1850_c170824.nc</fsurdat>
-<fsurdat hgrid="10x15"     sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_10x15_78pfts_CMIP6_simyr1850_c170824.nc</fsurdat>
-<fsurdat hgrid="4x5"       sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_4x5_78pfts_CMIP6_simyr1850_c170824.nc</fsurdat>
-
-<fsurdat hgrid="1x1_brazil"    sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_1x1_brazil_78pfts_CMIP6_simyr1850_c171214.nc</fsurdat>
-
-<fsurdat hgrid="ne30np4"      sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_ne30np4_78pfts_CMIP6_simyr1850_c170824.nc</fsurdat>
-<fsurdat hgrid="ne120np4"     sim_year="1850" >
-lnd/clm2/surfdata_map/surfdata_ne120np4_78pfts_CMIP6_simyr1850_c170824.nc</fsurdat>
-
-<!-- Dynamic PFT surface datasets (relative to {csmdata}) -->
-
-<!-- Note that, to reduce the number of necessary datasets, we use an RCP
-     dataset (arbitrarily, RCP8.5) for the historical period, because all of the
-     RCP datasets contain the 1850-2000 period as well as the future period. -->
-
-<flanduse_timeseries hgrid="0.47x0.63"      sim_year_range="1850-2000" 
->lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c171025.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="360x720cru"    sim_year_range="1850-2000" 
->lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="0.9x1.25"      sim_year_range="1850-2000" 
->lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="1.9x2.5"       sim_year_range="1850-2000" 
->lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="10x15"         sim_year_range="1850-2000" 
- >lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="4x5"           sim_year_range="1850-2000" 
- >lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="48x96"         sim_year_range="1850-2000" 
- >lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-
-<flanduse_timeseries hgrid="1x1_brazil"    sim_year_range="1850-2000" 
- >lnd/clm2/surfdata_map/landuse.timeseries_1x1_brazil_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-
-<flanduse_timeseries hgrid="ne120np4"      sim_year_range="1850-2000"  
- >lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="ne30np4"       sim_year_range="1850-2000"  
- >lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-
-<!-- Dynamic PFT surface datasets for crop -->
-
-<flanduse_timeseries hgrid="360x720cru"    sim_year_range="1850-2000"
- >lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="0.9x1.25"      sim_year_range="1850-2000"
- >lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="1.9x2.5"       sim_year_range="1850-2000"
- >lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="10x15"         sim_year_range="1850-2000"
- >lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="4x5"           sim_year_range="1850-2000"
- >lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="48x96"         sim_year_range="1850-2000"
- >lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-
-<flanduse_timeseries hgrid="1x1_brazil"    sim_year_range="1850-2000"
- >lnd/clm2/surfdata_map/landuse.timeseries_1x1_brazil_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-
-<flanduse_timeseries hgrid="ne120np4"      sim_year_range="1850-2000" 
- >lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="ne30np4"       sim_year_range="1850-2000" 
- >lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-
-<!-- Dynamic PFT surface datasets for future scenarios(relative to {csmdata}) -->
-
-<!-- Other future scenario Dynamic PFT datasets with crop off -->
-<flanduse_timeseries hgrid="360x720cru"    rcp="8.5" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="0.9x1.25"      rcp="8.5" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="1.9x2.5"       rcp="8.5" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="10x15"         rcp="8.5" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="48x96"         rcp="8.5" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="ne30np4"       rcp="8.5" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="ne120np4"      rcp="8.5" sim_year_range="1850-2100"  
- >lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-
-<flanduse_timeseries hgrid="1x1_brazil"    rcp="8.5" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_1x1_brazil_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-
-<flanduse_timeseries hgrid="360x720cru"    rcp="6"   sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="0.9x1.25"      rcp="6"   sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="1.9x2.5"       rcp="6"   sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="10x15"         rcp="6"   sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="48x96"         rcp="6"   sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="ne30np4"       rcp="6"   sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-
-<flanduse_timeseries hgrid="360x720cru"    rcp="4.5" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="0.9x1.25"      rcp="4.5" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="1.9x2.5"       rcp="4.5" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="10x15"         rcp="4.5" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="48x96"         rcp="4.5" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="ne120np4"      rcp="4.5" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="ne30np4"       rcp="4.5" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-
-<flanduse_timeseries hgrid="360x720cru"    rcp="2.6" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="0.9x1.25"      rcp="2.6" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="1.9x2.5"       rcp="2.6" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="10x15"         rcp="2.6" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="48x96"         rcp="2.6" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="ne30np4"       rcp="2.6" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-
-<!-- Other future scenario Dynamic PFT datasets with crop on -->
-<flanduse_timeseries hgrid="360x720cru"    rcp="8.5" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="0.9x1.25"      rcp="8.5" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="1.9x2.5"       rcp="8.5" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="10x15"         rcp="8.5" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="4x5"           rcp="8.5" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="48x96"         rcp="8.5" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="ne30np4"       rcp="8.5" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="ne120np4"      rcp="8.5" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-
-<flanduse_timeseries hgrid="1x1_brazil"    rcp="8.5" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_1x1_brazil_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-
-<flanduse_timeseries hgrid="360x720cru"    rcp="6"   sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="0.9x1.25"      rcp="6"   sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="1.9x2.5"       rcp="6"   sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="10x15"         rcp="6"   sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="4x5"           rcp="6"   sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="48x96"         rcp="6"   sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="ne30np4"       rcp="6"   sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-
-<flanduse_timeseries hgrid="360x720cru"    rcp="4.5" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="0.9x1.25"      rcp="4.5" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="1.9x2.5"       rcp="4.5" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="10x15"         rcp="4.5" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="4x5"           rcp="4.5" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="48x96"         rcp="4.5" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="ne120np4"      rcp="4.5" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="ne30np4"       rcp="4.5" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-
-<flanduse_timeseries hgrid="360x720cru"    rcp="2.6" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="0.9x1.25"      rcp="2.6" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="1.9x2.5"       rcp="2.6" sim_year_range="1850-2100" 
- >lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="10x15"         rcp="2.6" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="4x5"           rcp="2.6" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="48x96"         rcp="2.6" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-<flanduse_timeseries hgrid="ne30np4"       rcp="2.6" sim_year_range="1850-2100"
- >lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc</flanduse_timeseries>
-
-<lai_mapalgo>bilinear</lai_mapalgo>
-
-<lai_mapalgo  hgrid="1x1_brazil"          >nn</lai_mapalgo>
-<lai_mapalgo  hgrid="5x5_amazon"          >nn</lai_mapalgo>
-<lai_mapalgo  hgrid="1x1_brazil"          >nn</lai_mapalgo>
-<lai_mapalgo  hgrid="5x5_amazon"          >nn</lai_mapalgo>
-
-<!-- =========================================  -->
-<!-- Performance issues                         -->
-<!-- =========================================  -->
-
-<nsegspc                   >35</nsegspc>
-
-<!-- =========================================  -->
-<!-- Defaults for modelio namelist              -->
-<!-- =========================================  -->
-
-<diri>.</diri>
-<diro>.</diro>
-
-</namelist_defaults>
diff --git a/bld/namelist_files/namelist_defaults_overall.xml b/bld/namelist_files/namelist_defaults_overall.xml
deleted file mode 100644
index a3e7e368..00000000
--- a/bld/namelist_files/namelist_defaults_overall.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0"?>
-
-<?xml-stylesheet type="text/xsl" href="namelist_defaults.xsl"?>
-
-<namelist_defaults>
-
-<!--
-Values to use by default for creation of CLM model namelists.
-These are overall settings used as defaults for the model
-configuration of all namelists. None of these are items
-in a namelist, but they are default values that will help
-determine default values for namelists.
--->
-
-<!-- Default CLM start-type -->
-<clm_start_type phys="clm4_5"                   >startup</clm_start_type>
-<clm_start_type phys="clm5_0"                   >startup</clm_start_type>
-
-<!-- Default location of {csmdata} -->
-<csmdata>/fs/cgd/csm/inputdata</csmdata>
-
-<!-- Default resolution -->
-<res sitespf_pt="none"               >1.9x2.5</res>
-<res sitespf_pt="1x1_brazil"         >1x1_brazil</res>
-<res sitespf_pt="5x5_amazon"         >5x5_amazon</res>
-
-<!-- Default simulation year -->
-<sim_year>2000</sim_year>
-
-<!-- Default simulation year range -->
-<sim_year_range>constant</sim_year_range>
-
-<!-- Check resolution and land/mask before continuing -->
-<chk_res mode="clm_stndln" >1</chk_res>
-<chk_res mode="ext_cesm"   >0</chk_res>
-
-<!-- Add note to namelist files documenting the options given to build-namelist -->
-<note mode="clm_stndln" >1</note>
-<note mode="ext_cesm"   >0</note>
-
-<!-- Default representative concentration pathway for future scenarios -->
-<rcp>-999.9</rcp>
-
-<!-- Default land/ocean mask type -->
-<mask hgrid="0.23x0.31"           >gx1v6</mask>
-<mask hgrid="0.47x0.63"           >gx1v6</mask>
-<mask hgrid="0.9x1.25"            >gx1v6</mask>
-<mask hgrid="1.9x2.5"             >gx1v6</mask>
-<mask hgrid="2.5x3.33"            >gx3v7</mask>
-<mask hgrid="4x5"                 >gx3v7</mask>
-<mask hgrid="10x15"               >USGS</mask>
-
-<mask hgrid="360x720cru"          >cruncep</mask>
-<mask hgrid="128x256"             >USGS</mask>
-<mask hgrid="64x128"              >USGS</mask>
-<mask hgrid="48x96"               >gx3v7</mask>
-<mask hgrid="32x64"               >USGS</mask>
-<mask hgrid="8x16"                >USGS</mask>
-
-<mask hgrid="94x192"              >T62</mask>
-
-<mask hgrid="ne120"               >gx1v6</mask>
-<mask hgrid="ne240"               >gx1v6</mask>
-<mask hgrid="ne30"                >gx1v6</mask>
-
-<mask hgrid="5x5_amazon"          >navy</mask>
-<mask hgrid="1x1_brazil"          >navy</mask>
-<mask                             >gx1v6</mask>
-
-</namelist_defaults>
diff --git a/bld/namelist_files/namelist_definition.xsl b/bld/namelist_files/namelist_definition.xsl
deleted file mode 100644
index a83d4d7d..00000000
--- a/bld/namelist_files/namelist_definition.xsl
+++ /dev/null
@@ -1,270 +0,0 @@
-<?xml version='1.0'?>
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-
-<xsl:template match="/">
-  <html>
-    <xsl:apply-templates/>
-  </html>
-</xsl:template>
-
-<xsl:template match="namelist_definition">
-  <head>
-    <title>CLM Namelist Definition</title>
-  </head>
-  <body>
-<p>
-</p>
-<hr/>
-<p>
-</p>
-    <h1>Definition of CLM namelist variables</h1>
-    <p>We list all of the relevant namelist variables for CLM I cases. This includes
-    CLM Namelist items as well as CLM build-namelist settings and namelist settings
-    for CLM offline tools.</p>
-<hr/>
-    <h2>Definition of CLM namelist variables</h2>
-    <p>Note, these all would go into the user_nl_clm file
-    before configure):</p>
-    <p>Included in the table are the following pieces of information:</p>
-    <ul>
-    <li>Variable name.</li>
-    <li>Variable type (<code>char</code>, <code>integer</code>,
-    <code>real</code>, or <code>logical</code>).  The type
-    <code>char</code> has the length appended
-    following an asterisk, e.g., <code>char*256</code>.  Variables that are
-    arrays have their dimension specifier appended inside parentheses.  For
-    example <code>char*1(6)</code> denotes a array of six
-    <code>char*1</code> values.
-    </li>
-    <li>Variable description (includes information on defaults).</li>
-    <li>Valid values (if restricted).</li>
-    </ul>
-
-    <table border="1" cellpadding="10">
-    <caption>CLM Namelist Physics Options</caption>
-      <tr>
-      <th rowspan="2">Name</th>
-      <th rowspan="2">Type</th>
-      <th>Description</th>
-      </tr>
-      <tr>
-      <th colspan="1">Valid values</th>
-      </tr>
-      <xsl:apply-templates select="entry[@category='clm_physics']"/>
-    </table>
-
-    <table border="1" cellpadding="10">
-    <caption>CLM Namelist Datasets</caption>
-      <tr>
-      <th rowspan="2">Name</th>
-      <th rowspan="2">Type</th>
-      <th>Description
-      </th>
-      </tr>
-      <tr>
-      <th colspan="1">Valid values</th>
-      </tr>
-      <xsl:apply-templates select="entry[@category='datasets']"/>
-    </table>
-
-    <table border="1" cellpadding="10">
-    <caption>CLM Namelist History output settings</caption>
-      <tr>
-      <th rowspan="2">Name</th>
-      <th rowspan="2">Type</th>
-      <th>Description</th>
-      </tr>
-      <tr>
-      <th colspan="1">Valid values</th>
-      </tr>
-      <xsl:apply-templates select="entry[@category='history']"/>
-    </table>
-
-    <table border="1" cellpadding="10">
-    <caption>CLM Namelist Restart settings</caption>
-      <tr>
-      <th rowspan="2">Name</th>
-      <th rowspan="2">Type</th>
-      <th>Description</th>
-      </tr>
-      <tr>
-      <th colspan="1">Valid values</th>
-      </tr>
-      <xsl:apply-templates select="entry[@category='clm_restart']"/>
-    </table>
-
-    <table border="1" cellpadding="10">
-    <caption>CLM Namelist Performance Tuning</caption>
-      <tr>
-      <th rowspan="2">Name</th>
-      <th rowspan="2">Type</th>
-      <th>Description</th>
-      </tr>
-      <tr>
-      <th colspan="1">Valid values</th>
-      </tr>
-      <xsl:apply-templates select="entry[@category='clm_performance']"/>
-    </table>
-
-<p>
-</p>
-<hr/>
-<p>
-</p>
-    <h2>Command Line Options to CLM Build-namelist</h2>
-    <p>Variables that are entered as options to build-namelist (but NOT used by 
-        namelists in code). Most of these are options that could be added to
-        CLM_BLDNML_OPTS. Included in the table are the following pieces 
-        of information:</p>
-    <ul>
-    <li>Variable name.</li>
-    <li>Type.</li>
-    <li>Valid values.</li>
-    <li>Variable description.</li>
-    </ul>
-
-    <table border="1" cellpadding="10">
-    <caption>CLM Namelist Default Settings</caption>
-      <tr>
-      <th rowspan="2">Name</th>
-      <th rowspan="2">Type</th>
-      <th>Description</th>
-      </tr>
-      <tr>
-      <th colspan="1">Valid values, if restricted at all</th>
-      </tr>
-      <xsl:apply-templates select="entry[@category='default_settings']"/>
-    </table>
-<p>
-</p>
-<hr/>
-<p>
-</p>
-    <h2>Command Line Options to CLM Build-namelist</h2>
-    <p>Variables that are entered as options to build-namelist (but NOT used by 
-        namelists in code). Most of these are options that could be added to
-        CLM_BLDNML_OPTS. Included in the table are the following pieces 
-        of information:</p>
-    <ul>
-    <li>Variable name.</li>
-    <li>Type.</li>
-    <li>Valid values.</li>
-    <li>Variable description.</li>
-    </ul>
-
-    <table border="1" cellpadding="10">
-    <caption>CLM Namelist Default Settings</caption>
-      <tr>
-      <th rowspan="2">Name</th>
-      <th rowspan="2">Type</th>
-      <th>Description</th>
-      </tr>
-      <tr>
-      <th colspan="1">Valid values, if restricted at all</th>
-      </tr>
-      <xsl:apply-templates select="entry[@category='default_settings']"/>
-    </table>
-<p>
-</p>
-<hr/>
-<p>
-</p>
-    <h2>Namelist items for CLM Tools</h2>
-    <p>These are namelist items that appear in the CLM Tools under components/clm/tools.
-    </p>
-    <table border="1" cellpadding="10">
-    <caption>CLM mksurfdata</caption>
-      <tr>
-      <th rowspan="2">Name</th>
-      <th rowspan="2">Type</th>
-      <th>Description</th>
-      </tr>
-      <tr>
-      <th colspan="1">Valid values</th>
-      </tr>
-      <xsl:apply-templates select="entry[@category='mksurfdata']"/>
-    </table>
-    <table border="1" cellpadding="10">
-    <caption>CLM mkgriddata</caption>
-      <tr>
-      <th rowspan="2">Name</th>
-      <th rowspan="2">Type</th>
-      <th>Description</th>
-      </tr>
-      <tr>
-      <th colspan="1">Valid values</th>
-      </tr>
-      <xsl:apply-templates select="entry[@category='mkgriddata']"/>
-    </table>
-    <table border="1" cellpadding="10">
-    <caption>CLM mkmapdata</caption>
-      <tr>
-      <th rowspan="2">Name</th>
-      <th rowspan="2">Type</th>
-      <th>Description</th>
-      </tr>
-      <tr>
-      <th colspan="1">Valid values</th>
-      </tr>
-      <xsl:apply-templates select="entry[@category='mkmapdata']"/>
-    </table>
-    <table border="1" cellpadding="10">
-    <caption>CLM mkgriddata</caption>
-      <tr>
-      <th rowspan="2">Name</th>
-      <th rowspan="2">Type</th>
-      <th>Description</th>
-      </tr>
-      <tr>
-      <th colspan="1">Valid values</th>
-      </tr>
-      <xsl:apply-templates select="entry[@category='mkgriddata']"/>
-    </table>
-    <table border="1" cellpadding="10">
-    <caption>Miscellaneous CLM tools</caption>
-      <tr>
-      <th rowspan="2">Name</th>
-      <th rowspan="2">Type</th>
-      <th>Description</th>
-      </tr>
-      <tr>
-      <th colspan="1">Valid values</th>
-      </tr>
-      <xsl:apply-templates select="entry[@category='tools']"/>
-    </table>
-
-<hr/>
-
-<h2>Namelist items for Driver Dry Deposition</h2>
-    <table border="1" cellpadding="10">
-    <caption>Driver Dry-Deposition Namelist Options</caption>
-      <tr>
-      <th rowspan="2">Name</th>
-      <th rowspan="2">Type</th>
-      <th>Description</th>
-      </tr>
-      <tr>
-      <th colspan="1">Valid values, if restricted at all</th>
-      </tr>
-      <xsl:apply-templates select="entry[@category='dry-deposition']"/>
-    </table>
-
-<hr/>
-
-  </body>
-</xsl:template>
-
-<xsl:template match="entry">
-  <tr>
-    <td rowspan="2"><font color="#ff0000"><xsl:value-of select="@id"/></font></td>
-    <td rowspan="2"><xsl:value-of select="@type"/></td>
-    <td><xsl:apply-templates/></td>
-  </tr>
-  <tr>
-    <td colspan="1"><xsl:if test="string-length(@valid_values)>0"><b>Valid Values: </b>
-         <xsl:value-of select="@valid_values"/></xsl:if></td>
-  </tr>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml
deleted file mode 100644
index e4c9ada8..00000000
--- a/bld/namelist_files/namelist_definition_clm4_5.xml
+++ /dev/null
@@ -1,388 +0,0 @@
-<?xml version="1.0"?>
-
-<?xml-stylesheet type="text/xsl" href="namelist_definition.xsl"?>
-
-<namelist_definition>
-
-<!-- ========================================================================================  -->
-<!-- CLM Namelist -->
-<!-- ========================================================================================  -->
-
-<entry id="finidat_interp_dest" 
-       type="char*256" 
-       category="datasets"
-       input_pathname="abs" 
-       group="clm_inparm" 
-       valid_values="" >
-If use_init_interp is set to .true., interpinic will be called to interpolate
-the file given by finidat, creating the output file specified by finidat_interp_dest.
-</entry>
-
-<entry id="finidat" 
-       type="char*256" 
-       category="datasets"
-       input_pathname="abs" 
-       group="clm_inparm" 
-       valid_values="" >
-Full pathname of initial conditions file. If blank CLM will startup from
-arbitrary initial conditions.
-</entry>
-
-<entry id="use_init_interp"
-       type="logical"
-       category="datasets"
-       group="clm_inparm"
-       valid_values="" >
-If set to .true., interpinic will be called to interpolate the file given by finidat,
-creating the output file specified by finidat_interp_dest.
-
-This requires that finidat be non-blank.
-</entry>
-
-<entry id="nrevsn" 
-       type="char*256" 
-       category="clm_restart"
-       input_pathname="abs" 
-       group="clm_inparm" 
-       valid_values="" >
-Full pathname of master restart file for a branch run. (only used if RUN_TYPE=branch)
-(Set with RUN_REFCASE and RUN_REFDATE)
-</entry>
-
-<entry id="fatmlndfrc" 
-       type="char*256" 
-       category="datasets"
-       input_pathname="abs" 
-       group="clm_inparm" 
-       valid_values="" >
-Full pathname of land fraction data file.
-</entry>
-
-<entry id="clump_pproc" type="integer" category="clm_performance"
-       group="clm_inparm" valid_values="" >
-Clumps per processor.
-</entry>
-
-<entry id="dtime" type="real"  category="clm_physics" 
-       group="clm_inparm" valid_values="">
-Time step (seconds)
-</entry>
-
-<entry id="override_nsrest" type="integer"  category="clm_restart" 
-       group="clm_inparm" valid_values="3">
-Override the start type from the driver: it can only be
-set to 3 meaning branch.
-</entry>
-
-<entry id="fsurdat" type="char*256"     category="datasets"
-       input_pathname="abs" group="clm_inparm" valid_values="" >
-Full pathname of surface data file.
-</entry>
-
-<entry id="mml_surdat" type="char*256"     category="datasets"
-       input_pathname="abs" group="clm_inparm" valid_values="" >
-Full pathname of MML surface data forcing file.
-</entry>
-
-<entry id="hist_avgflag_pertape" type="char*1(6)" category="history"
-       group="clm_inparm" valid_values="A,I,X,M" >
-Per file averaging flag.
-    'A' (average over history period)
-    'I' (instantaneous)
-    'X' (maximum over history period)
-    'M' (minimum over history period)
-</entry>
-
-<entry id="hist_type1d_pertape" type="char*4(6)" category="history"
-       group="clm_inparm" valid_values="GRID,LAND,COLS,PFTS, " >
-Averaging type of output for 1D vector output (when hist_dov2xy is false).
-    GRID means average all land-units up to the grid-point level
-    LAND means average all columns up to the land-unit level
-    COLS means average all PFT's up to the column level
-    PFTS means report everything on native PFT level
-</entry>
-
-<entry id="hist_dov2xy" type="logical(6)" category="history"
-       group="clm_inparm" valid_values="" >
-If TRUE, implies output data on a 2D latitude/longitude grid. False means
-output in 1D vector format.  One setting per history tape series.
-</entry>
-
-<entry id="hist_empty_htapes" type="logical" category="history"
-       group="clm_inparm" valid_values="" >
-If TRUE, indicates do NOT output any default history fields (requires you to use
-hist_fincl* to set the exact output fields to use)..
-</entry>
-
-<entry id="hist_fexcl1" type="char*64(1000)" category="history"
-       group="clm_inparm" valid_values="" >
-Fields to exclude from history tape series 1.
-</entry>
-
-<entry id="hist_fexcl2" type="char*64(1000)" category="history"
-       group="clm_inparm" valid_values="" >
-Fields to exclude from history tape series  2.
-</entry>
-
-<entry id="hist_fexcl3" type="char*64(1000)" category="history"
-       group="clm_inparm" valid_values="" >
-Fields to exclude from history tape series  3.
-</entry>
-
-<entry id="hist_fexcl4" type="char*64(1000)" category="history"
-       group="clm_inparm" valid_values="" >
-Fields to exclude from history tape series  4.
-</entry>
-
-<entry id="hist_fexcl5" type="char*64(1000)" category="history"
-       group="clm_inparm" valid_values="" >
-Fields to exclude from history tape series  5.
-</entry>
-
-<entry id="hist_fexcl6" type="char*64(1000)" category="history"
-       group="clm_inparm" valid_values="" >
-Fields to exclude from history tape series  6.
-</entry>
-
-<entry id="hist_fincl1" type="char*64(1000)" category="history"
-       group="clm_inparm" valid_values="" >
-Fields to add to history tape series  1.
-</entry>
-
-<entry id="hist_fincl2" type="char*64(1000)" category="history"
-       group="clm_inparm" valid_values="" >
-Fields to add to history tape series  2.
-</entry>
-
-<entry id="hist_fincl3" type="char*64(1000)" category="history"
-       group="clm_inparm" valid_values="" >
-Fields to add to history tape series  3.
-</entry>
-
-<entry id="hist_fincl4" type="char*64(1000)" category="history"
-       group="clm_inparm" valid_values="" >
-Fields to add to history tape series  4.
-</entry>
-
-<entry id="hist_fincl5" type="char*64(1000)" category="history"
-       group="clm_inparm" valid_values="" >
-Fields to add to history tape series  5.
-</entry>
-
-<entry id="hist_fincl6" type="char*64(1000)" category="history"
-       group="clm_inparm" valid_values="" >
-Fields to add to history tape series  6.
-</entry>
-
-<entry id="hist_mfilt" type="integer(6)" category="history"
-       group="clm_inparm" valid_values="" >
-Per tape series  maximum number of time samples.
-</entry>
-
-<entry id="hist_ndens" type="integer(6)" category="history"
-       group="clm_inparm" valid_values="1,2" >
-Per tape series  history file density (i.e. output precision) 
-    1=double precision
-    2=single precision
-<default>Default: 2,2,2,2,2,2</default>
-</entry>
-
-<entry id="hist_nhtfrq" type="integer(6)" category="history"
-       group="clm_inparm" valid_values="" >
-Per tape series history write frequency. 
-    positive means in time steps
-    0=monthly
-    negative means hours
-(i.e. 5 means every 24 time-steps and -24 means every day
-<default>Default: 0,-24,-24,-24,-24,-24</default>
-</entry>
-
-<entry id="nsegspc" type="integer" category="clm_performance"
-       group="clm_inparm" valid_values="" >
-number of segments per clump for decomposition
-<default>Default: 20</default>
-</entry>
-
-<entry id="pertlim" type="real" category="clm_physics"
-       group="clm_inparm" valid_values="" >
-Perturbation limit when doing error growth test
-</entry>
-
-<entry id="rest_flag" type="logical" category="clm_restart"
-       group="clm_inparm" valid_values="" >
-If FALSE, don't write any restart files.
-</entry>
-
-<entry id="wrtdia" type="logical" category="history"
-       group="clm_inparm" valid_values="" >
-If TRUE, write diagnostic of global radiative temperature written to CLM log file.
-</entry>
-
-<!-- ========================================================================================  -->
-<!-- Former CPP tokens -->
-<!-- ========================================================================================  -->
-
-<entry id="use_noio" type="logical" category="default_settings"
-       group="clm_inparm" valid_values="" value=".false." >
-Toggle to turn all history output completely OFF (possibly used for testing)
-</entry>
-
-<!-- ========================================================================================  -->
-<!-- Namelist items controlling fields sent to atmosphere                                      -->
-<!-- ========================================================================================  -->
-
-<entry id="diri" type="char*256" category="datm"
-       group="modelio" valid_values="">
-datm input directory
-</entry>
-<entry id="diro" type="char*256" category="datm"
-       group="modelio" valid_values="">
-datm output directory
-</entry>
-<entry id="logfile" type="char*256" category="datm"
-       group="modelio" valid_values="">
-Datm logfile name
-</entry>
-
-<!-- ========================================================================================  -->
-<!-- Mapping files                                                                             -->
-<!-- ========================================================================================  -->
-
-<entry id="map" type="char*256" category="mksurfdata"
-       input_pathname="abs" group="clmexp" valid_values="" >
-Mapping file to go from one resolution/land-mask to another resolution/land-mask
-</entry>
-
-<entry id="lmask" type="char*10" category="mksurfdata"
-       group="default_settings"  
-       valid_values="nomask,navy,AVHRR,MODIS,USGS,IGBPmergeICESatGIS,IGBP-GSDP,ISRIC-WISE,LandScan2004,GLOBE-Gardner,GLOBE-Gardner-mergeGIS,GRDC,HYDRO1K-merge-nomask,ORNL-Soil">
-Land mask description for mksurfdata input files
-</entry> 
-
-<entry id="hgrid" type="char*10" category="mksurfdata"
-       group="default_settings"  
-       valid_values="0.1x0.1,0.25x0.25,0.5x0.5,10x10min,5x5min,360x720cru,0.9x1.25,19basin,1km-merge-10min">
-Horizontal grid resolutions for mksurfdata input files
-</entry> 
-
-
-<!-- ========================================================================================  -->
-<!-- Generic issues (resolution, mask etc.)                                                    -->
-<!-- ========================================================================================  -->
-
-<entry id="chk_res" type="integer"  category="default_settings"
-       group="default_settings" valid_values="0,1" >
-Check that the resolution and land-mask is valid before continuing.
-</entry>
-
-<entry id="note" type="integer"  category="default_settings"
-       group="default_settings" valid_values="0,1" >
-Add a note to the output namelist about the options given to build-namelist
-</entry>
-
-<entry id="clm_start_type" type="char*8"  category="default_settings"
-       group="default_settings" valid_values="default,cold,arb_ic,startup,continue,branch" >
-CLM run type.  
-    'default' use the default type of clm_start type for this configuration
-    'cold' is a run from arbitrary initial conditions
-    'arb_ic' is a run using initial conditions if provided, OR arbitrary initial conditions if no files can be found
-    'startup' is an initial run with initial conditions provided.  
-    'continue' is a restart run.
-    'branch' is a restart run in which properties of the output history files may be changed.
-</entry>
-
-<entry id="res" type="char*30" category="default_settings"
-       group="default_settings"  
-       valid_values=
-"512x1024,360x720cru,128x256,64x128,48x96,32x64,8x16,94x192,0.23x0.31,0.47x0.63,0.9x1.25,1.9x2.5,2.5x3.33,4x5,10x15,5x5_amazon,1x1_brazil,0.1x0.1,0.25x0.25,0.5x0.5,3x3min,5x5min,10x10min,0.33x0.33,0.125x0.125,ne4np4,ne16np4,ne30np4,ne60np4,ne120np4,ne240np4,1km-merge-10min">
-Horizontal resolutions
-Note: 0.1x0.1, 0.25x0.25, 0.5x0.5, 5x5min, 10x10min, 3x3min and 0.33x0.33 are only used for CLM tools
-</entry> 
-
-<entry id="rcp" type="real" category="default_settings"
-       group="default_settings"  
-       valid_values="-999.9,2.6,4.5,6,8.5">
-Representative concentration pathway for future scenarios [radiative forcing at peak or 2100 in W/m^2]
--999.9 means do NOT use a future scenario, just use historical data.
-</entry> 
-
-<entry id="mask" type="char*10" category="default_settings"
-       group="default_settings"  
-       valid_values="USGS,gx3v7,gx1v6,gx1v7,navy,test,tx0.1v2,tx1v1,T62,cruncep">
-Land mask description
-</entry> 
-
-<entry id="lnd_tuning_mode" type="char*20" category="default_settings"
-       group="default_settings"
-       valid_values="clm4_5_CRUv7,clm4_5_GSWP3v1,clm4_5_cam6.0,clm5_0_cam6.0,clm5_0_CRUv7,clm5_0_GSWP3v1">
-General configuration of model version and atmospheric forcing to tune the model to run under.
-This sets the model to run with constants and initial conditions that were set to run well under 
-the configuration of model version and atmospheric forcing. To run well constants would need to be changed
-to run with a different type of atmospheric forcing.
-</entry> 
-
-<entry id="sim_year" type="integer" category="default_settings"
-       group="default_settings" valid_values=
-"1000,850,1100,1350,1600,1850,1855,1865,1875,1885,1895,1905,1915,1925,1935,1945,1955,1965,1975,1980,1985,1995,2000,2005,2015,2025,2035,2045,2055,2065,2075,2085,2095,2105">
-Year to simulate and to provide datasets for (such as surface datasets, initial conditions, aerosol-deposition, Nitrogen deposition rates etc.)
-A sim_year of 1000 corresponds to data used for testing only, NOT corresponding to any real datasets.
-A sim_year greater than 2005 corresponds to rcp scenario data
-Most years are only used for clm_tools and there aren't CLM datasets that correspond to them.
-CLM datasets exist for years: 1000 (for testing), 1850, and 2000
-</entry> 
-
-<entry id="sim_year_range" type="char*9" category="default_settings"
-       group="default_settings" valid_values=
-"constant,1000-1002,1000-1004,850-1100,1100-1350,1350-1600,1600-1850,1850-1855,1850-2000,1850-2005,1850-2100,1980-2015,2000-2100">
-Range of years to simulate transitory datasets for (such as dynamic: land-use datasets, aerosol-deposition, Nitrogen deposition rates etc.)
-Constant means simulation will be held at a constant year given in sim_year.
-A sim_year_range of 1000-1002 or 1000-1004 corresponds to data used for testing only, NOT corresponding to any real datasets.
-A sim_year_range that goes beyond 2005 corresponds to historical data until 2005 and then scenario data beyond that point.
-</entry> 
-
-<entry id="clm_demand" type="char*256" category="default_settings"
-       group="default_settings" valid_values="">
-Namelist entries to demand be provided on the namelist.
-</entry>
-
-<entry id="use_case_desc" type="char*256"  category="default_settings"
-       group="use_case_desc" valid_values="" >
-Description of the use case selected.
-</entry>
-
-<entry id="init_interp_attributes" type="char*256"  category="default_settings"
-       group="default_settings" valid_values="" >
-Attributes to use when looking for an initial condition file (finidat) if interpolation is turned on (use_init_interp is .true.)
-</entry>
-
-<entry id="init_interp_how_close" type="integer"  category="default_settings"
-       group="default_settings" valid_values="" >
-How close in years to use when looking for an initial condition file (finidat) if interpolation is turned on (use_init_interp is .true.)
-</entry>
-
-<entry id="init_interp_sim_years" type="integer(2)"  category="default_settings"
-       group="default_settings" valid_values="1850,2000" >
-Simulation years you can look for in initial condition files (finidat) if interpolation is turned on (use_init_interp is .true.)
-</entry>
-
-<!-- ========================================================================================  -->
-<!-- Namelist options related to finidat consistency checks                                    -->
-<!-- ========================================================================================  -->
-
-<entry id="check_finidat_year_consistency" type="logical" category="clm_restart"
-       group="finidat_consistency_checks" valid_values="" >
-If TRUE (which is the default), check consistency between year on the finidat file
-and the current model year. This check is only done for a transient run.
-</entry>
-
-<entry id="check_finidat_pct_consistency" type="logical" category="clm_restart"
-       group="finidat_consistency_checks" valid_values="" >
-If TRUE (which is the default), check consistency between pct_pft on the finidat file
-and pct_pft read from the surface dataset. This check is only done for a NON-transient run.
-</entry>
-
-<!-- ========================================================================================  -->
-<!-- Namelist options related to initInterp                                                    -->
-<!-- ========================================================================================  -->
-
-</namelist_definition>
diff --git a/bld/namelist_files/namelist_definition_drv.xml b/bld/namelist_files/namelist_definition_drv.xml
deleted file mode 100644
index 4c3c4004..00000000
--- a/bld/namelist_files/namelist_definition_drv.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-
-<namelist_definition>
-
-  <version>1.0</version>
-
-  <!-- The following entries are being used by CLM's build-namelist, 
-       which has not been converted to parse the version 2.0 schema for
-       a namelist_definition.xml file
-  -->
-
-  <entry id="start_type" type="char*64" category="expdef"   group="seq_infodata_inparm" valid_values="startup,branch,continue"> </entry>
-  <entry id="start_ymd"  type="integer" category="time"     group="seq_timemgr_inparm"> </entry>
-
-</namelist_definition>
-
diff --git a/bld/namelist_files/use_cases/1850_control.xml b/bld/namelist_files/use_cases/1850_control.xml
deleted file mode 100644
index 786b9ae9..00000000
--- a/bld/namelist_files/use_cases/1850_control.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0"?>
-
-<namelist_defaults>
-
-<use_case_desc>Conditions to simulate 1850 land-use</use_case_desc>
-
-<sim_year>1850</sim_year>
-
-<sim_year_range>constant</sim_year_range>
-
-</namelist_defaults>
diff --git a/bld/namelist_files/use_cases/2000_control.xml b/bld/namelist_files/use_cases/2000_control.xml
deleted file mode 100644
index c339f2d0..00000000
--- a/bld/namelist_files/use_cases/2000_control.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0"?>
-
-<namelist_defaults>
-
-<use_case_desc>Conditions to simulate 2000 land-use</use_case_desc>
-
-<sim_year>2000</sim_year>
-
-<sim_year_range>constant</sim_year_range>
-
-</namelist_defaults>
diff --git a/cime_config/buildlib b/cime_config/buildlib
index 43016826..598f5dc8 100755
--- a/cime_config/buildlib
+++ b/cime_config/buildlib
@@ -1,7 +1,7 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 """
-build clm library
+build slim ibrary
 """
 import sys, os, time, filecmp, shutil, imp
 
@@ -21,7 +21,7 @@ logger = logging.getLogger(__name__)
 
 ###############################################################################
 def _main_func():
-###############################################################################
+    ###############################################################################
 
     caseroot, libroot, bldroot = parse_input(sys.argv)
 
@@ -34,54 +34,56 @@ def _main_func():
         mach = case.get_value("MACH")
         nthrds = case.get_value("LND_NTHRDS")
 
-        clm_config_opts = case.get_value("CLM_CONFIG_OPTS")
-        if "clm4_5" in clm_config_opts:
-            clm_phys = "clm4_5"
-        elif "clm5_0" in clm_config_opts:
-            clm_phys = "clm5_0"
-        else:
-            expect(False, "CLM_CONFIG_OPTS must support either clm4_5 or clm5_0 physics")
-
-        if ( nthrds > 1 ):
-            expect(False, "LND_NTHRDS must be 1 as threading isn't implemented (see issue #14)" )
-
-        #-------------------------------------------------------
-        # create Filepath file for clm4_5 or clm5_0
-        #-------------------------------------------------------
-        filepath_file = os.path.join(bldroot,"Filepath")
+        if nthrds > 1:
+            expect(
+                False,
+                "LND_NTHRDS must be 1 as threading isn't implemented (see issue #14)",
+            )
+
+        # -------------------------------------------------------
+        # create Filepath file
+        # -------------------------------------------------------
+        filepath_file = os.path.join(bldroot, "Filepath")
         if not os.path.isfile(filepath_file):
             caseroot = case.get_value("CASEROOT")
-            paths = [os.path.join(caseroot,"SourceMods","src.clm"), 
-                     os.path.join(lnd_root,"src","main"),
-                     os.path.join(lnd_root,"src","biogeophys"),
-                     os.path.join(lnd_root,"src","biogeochem"),
-                     os.path.join(lnd_root,"src","soilbiogeochem"),
-                     os.path.join(lnd_root,"src","init_interp"),
-                     os.path.join(lnd_root,"src","utils"),
-                     os.path.join(lnd_root,"src","cpl")]
+            paths = [
+                os.path.join(caseroot, "SourceMods", "src.slim"),
+                os.path.join(lnd_root, "src", "main"),
+                os.path.join(lnd_root, "src", "init_interp"),
+                os.path.join(lnd_root, "src", "utils"),
+                os.path.join(lnd_root, "src", "cpl"),
+            ]
+            # Paths needed to build the current system, but won't be long term
+            paths.append(os.path.join(lnd_root, "src", "biogeophys"))
+            paths.append(os.path.join(lnd_root, "src", "biogeochem"))
+            paths.append(os.path.join(lnd_root, "src", "soilbiogeochem"))
 
             with open(filepath_file, "w") as filepath:
                 filepath.write("\n".join(paths))
                 filepath.write("\n")
-            
-        #-------------------------------------------------------
+
+        # -------------------------------------------------------
         # create the library in libroot
-        #-------------------------------------------------------
+        # -------------------------------------------------------
 
-        clm_config_opts = case.get_value("CLM_CONFIG_OPTS")
-        complib = os.path.join(libroot,"libclm.a")
+        complib = os.path.join(libroot, "liblnd.a")
         makefile = os.path.join(casetools, "Makefile")
-        macfile  = os.path.join(caseroot, "Macros.%s" % mach)
+        macfile = os.path.join(caseroot, "Macros.%s" % mach)
 
-        cmd = "%s complib -j %d MODEL=clm COMPLIB=%s -f %s MACFILE=%s " \
-               % (gmake, gmake_j, complib, makefile, macfile )
+        cmd = "%s complib -j %d MODEL=slim COMPLIB=%s -f %s MACFILE=%s " % (
+            gmake,
+            gmake_j,
+            complib,
+            makefile,
+            macfile,
+        )
 
         rc, out, err = run_cmd(cmd)
-        logger.info("%s: \n\n output:\n %s \n\n err:\n\n%s\n"%(cmd,out,err))
+        logger.info("%s: \n\n output:\n %s \n\n err:\n\n%s\n" % (cmd, out, err))
         expect(rc == 0, "Command %s failed with rc=%s" % (cmd, rc))
 
+
 ###############################################################################
 
 if __name__ == "__main__":
     _main_func()
-
diff --git a/cime_config/buildnml b/cime_config/buildnml
index 1548aa35..9c2a0c3f 100755
--- a/cime_config/buildnml
+++ b/cime_config/buildnml
@@ -1,231 +1,33 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 """
-CLM namelist creator
+SLIM namelist creator executable
 """
-import sys, os, time, shutil, re, imp, filecmp
+import sys, os
 
-_CIMEROOT = os.environ.get("CIMEROOT")
-if _CIMEROOT is None:
-    raise SystemExit("ERROR: must set CIMEROOT environment variable")
+_SLIM_PYTHON = os.path.normpath(
+    os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir, "python")
+)
+sys.path.insert(1, _SLIM_PYTHON)
 
-_LIBDIR = os.path.join(_CIMEROOT, "scripts", "Tools")
-sys.path.append(_LIBDIR)
+from slim import add_cime_to_path
+from slim import add_slim_cime_py_to_path
+from slim.slim_logging import setup_logging
 
-from standard_script_setup          import *
-from CIME.buildnml                  import create_namelist_infile, parse_input
-from CIME.case                      import Case
-from CIME.utils                     import expect, run_cmd
-
-logger = logging.getLogger(__name__)
-
-_config_cache_template = """
-<?xml version="1.0"?>
-<config_definition>
-<commandline></commandline>
-<entry id="phys" value="{clm_phys}" list="" valid_values="clm4_5,clm5_0">Specifies clm physics</entry>
-</config_definition>
-"""
-
-###############################################################################
-def buildnml(case, caseroot, compname):
-###############################################################################
-    """Build the clm namelist """
-
-    # Build the component namelist 
-    if compname != "clm":
-        raise AttributeError
-
-    lnd_root = case.get_value("COMP_ROOT_DIR_LND")
-    din_loc_root = case.get_value("DIN_LOC_ROOT")
-    clm_namelist_opts = case.get_value("CLM_NAMELIST_OPTS")
-    clm_bldnml_opts = case.get_value("CLM_BLDNML_OPTS")
-    clm_nml_use_case = case.get_value("CLM_NML_USE_CASE")
-    clm_force_coldstart = case.get_value("CLM_FORCE_COLDSTART")
-    comp_glc = case.get_value("COMP_GLC")
-    comp_atm = case.get_value("COMP_ATM")
-    lnd_grid = case.get_value("LND_GRID")
-    lnd_ncpl = case.get_value("LND_NCPL")
-    lnd_domain_path = case.get_value("LND_DOMAIN_PATH")
-    lnd_domain_file = case.get_value("LND_DOMAIN_FILE")
-    ninst_lnd = case.get_value("NINST_LND")
-    rundir = case.get_value("RUNDIR")
-    run_type = case.get_value("RUN_TYPE")
-    run_startdate = case.get_value("RUN_STARTDATE")
-    run_refcase = case.get_value("RUN_REFCASE")
-    run_refdate = case.get_value("RUN_REFDATE")
-    run_reftod = case.get_value("RUN_REFTOD")
-    mask = case.get_value("MASK_GRID")
-
-    # -----------------------------------------------------
-    # Clear out old data
-    # -----------------------------------------------------
-
-    input_data_list = os.path.join(caseroot,"Buildconf","clm.input_data_list")
-    if os.path.exists(input_data_list):
-        os.remove(input_data_list)
-
-    # -----------------------------------------------------
-    # Set clmconf
-    # -----------------------------------------------------
-
-    clmconf = os.path.join(caseroot, "Buildconf", "clmconf")
-    if not os.path.isdir(clmconf):
-        os.makedirs(clmconf)
-
-    # -----------------------------------------------------
-    # Create config_cache.xml file 
-    # -----------------------------------------------------
-
-    # Note that build-namelist utilizes the contents of the config_cache.xml file in 
-    # the namelist_defaults.xml file to obtain namelist variables
-
-    clm_config_opts = case.get_value("CLM_CONFIG_OPTS")
-    if "clm4_5" in clm_config_opts:
-        clm_phys = "clm4_5"
-    elif "clm5_0" in clm_config_opts:
-        clm_phys = "clm5_0"
-    else:
-        expect(False, "CLM_CONFIG_OPTS must support either clm4_5 or clm5_0 physics")
-
-    config_cache_text = _config_cache_template.format(clm_phys=clm_phys)
-    config_cache_path = os.path.join(caseroot, "Buildconf", "clmconf", "config_cache.xml")
-    with open(config_cache_path, 'w') as config_cache_file:
-        config_cache_file.write(config_cache_text)
-
-    # -----------------------------------------------------
-    # Determine input arguments into build-namelist
-    # -----------------------------------------------------
-
-    startfile_type = "finidat"
-    start_type = "default"
-    if run_type == "hybrid":
-        start_type = "startup"
-    elif run_type != "startup":
-        start_type = run_type
-
-    if run_type == "branch":
-        startfile_type = "nrevsn"
-        if clm_force_coldstart == "on":
-           clm_force_coldstart = "off"
-           logger.warning( "WARNING: You've turned on CLM_FORCE_COLDSTART for a branch run_type, which is a contradiction, the coldstart will be ignored\n" +
-                           "  turn off CLM_FORCE_COLDSTART, or set RUN_TYPE=hybrid to get rid of this warning"
-                         )
-
-    if (clm_force_coldstart == "on"):
-        logger.warning( "WARNING: CLM is starting up from a cold state" )
-        start_type = "cold"
-
-    if lnd_grid == 'T31':
-        lnd_grid = '48x96'
-    if lnd_grid == 'T42':
-        lnd_grid = '64x128'
-    if lnd_grid == 'T85':
-        lnd_grid = '128x256'
-    if lnd_grid == 'T341':
-        lnd_grid = '512x1024'
-
-    if clm_nml_use_case != "UNSET":
-        usecase = "-use_case %s" %clm_nml_use_case
-    else:
-        usecase = ""
-
-    if ( (mask != "null") and (mask != "UNSET") ):
-       gridmask = "-mask %s" %mask
-    else:
-       gridmask = ""
-
-    start_ymd = run_startdate.replace('-','')
-
-    if ('-01-01' in run_startdate) or ('-09-01' in run_startdate):
-        ignore = "-ignore_ic_year"
-    else:
-        ignore = "-ignore_ic_date"
-
-    infile = os.path.join(clmconf, "namelist")
-    
-    inputdata_file = os.path.join(caseroot,"Buildconf","clm.input_data_list")
-    
-    lndfrac_file = os.path.join(lnd_domain_path,lnd_domain_file)
-    
-    config_cache_file = os.path.join(caseroot,"Buildconf","clmconf","config_cache.xml")
-
-    # -----------------------------------------------------
-    # loop over instances
-    # -----------------------------------------------------
-
-    ninst = int(ninst_lnd)
-    for inst_counter in range(1, ninst+1):
-
-        # determine instance string
-        inst_string = ""
-        if ninst > 1:
-            inst_string = '_' + '%04d' % inst_counter
-
-        # If multi-instance case does not have restart file, use
-        # single-case restart for each instance
-        rpointer = "rpointer.lnd" 
-        if (os.path.isfile(os.path.join(rundir,rpointer)) and
-            (not os.path.isfile(os.path.join(rundir,rpointer + inst_string)))):
-            shutil.copy(os.path.join(rundir, rpointer),
-                        os.path.join(rundir, rpointer + inst_string))
-
-        # -----------------------------------------------------
-        # call build-namelist
-        # -----------------------------------------------------
-
-        if run_type == "hybrid" or run_type == "branch":
-            clm_startfile = "%s.clm2%s.r.%s-%s.nc"%(run_refcase,inst_string,run_refdate,run_reftod)
-            if not os.path.exists(os.path.join(rundir, clm_startfile)):
-                clm_startfile = "%s.clm2.r.%s-%s.nc"%(run_refcase,run_refdate,run_reftod)
-            clm_icfile = "%s = \'%s\'"%(startfile_type, clm_startfile)
-        else:
-            clm_icfile = ""
-
-        infile_lines = []
-        infile_lines.append(clm_icfile)
-
-        user_nl_file = os.path.join(caseroot, "user_nl_clm" + inst_string)
-        namelist_infile = os.path.join(clmconf, "namelist")
-
-        create_namelist_infile(case, user_nl_file, namelist_infile, "\n".join(infile_lines))
-
-        cmd = os.path.join(lnd_root,"bld","build-namelist")
-
-        command = ("%s -cimeroot %s -infile %s -csmdata %s -inputdata %s %s -namelist \"&clm_inparm  start_ymd=%s/ \" "
-                   "%s %s -res %s -clm_start_type %s -envxml_dir %s -l_ncpl %s "
-                   "-lnd_frac %s -config %s "
-                   "%s %s"
-                   %(cmd, _CIMEROOT, infile, din_loc_root, inputdata_file, ignore, start_ymd, clm_namelist_opts, 
-                     usecase, lnd_grid, start_type, caseroot, lnd_ncpl,
-                     lndfrac_file, config_cache_file, 
-                     clm_bldnml_opts, gridmask))
-
-        rc, out, err = run_cmd(command, from_dir=clmconf)
-        expect(rc==0,"Command %s failed rc=%d\nout=%s\nerr=%s"%(cmd,rc,out,err))
-        if out is not None:
-            logger.debug("     %s"%out)
-        if err is not None:
-            logger.debug("     %s"%err)
-
-        # -----------------------------------------------------
-        # copy resolved namelist to rundir
-        # -----------------------------------------------------
-
-        if os.path.isdir(rundir):
-            file1 = os.path.join(clmconf, "lnd_in")
-            file2 = os.path.join(rundir, "lnd_in")
-            if ninst > 1:
-                file2 += inst_string
-            logger.debug("CLM namelist copy: file1 %s file2 %s " %(file1, file2))
-            shutil.copy(file1,file2)
+from standard_script_setup import *
+from CIME.buildnml import parse_input
+from CIME.case import Case
+from slim_cime_py import buildnml
 
 ###############################################################################
 def _main_func():
 
     caseroot = parse_input(sys.argv)
+    level = logging.WARNING
+    setup_logging(level)
     with Case(caseroot) as case:
-        buildnml(case, caseroot, "clm")
+        buildnml(case, caseroot, "slim")
+
 
 if __name__ == "__main__":
     _main_func()
diff --git a/cime_config/buildnml_test/env_archive.xml b/cime_config/buildnml_test/env_archive.xml
new file mode 100644
index 00000000..21e8595f
--- /dev/null
+++ b/cime_config/buildnml_test/env_archive.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<file id="env_archive.xml" version="2.0">
+<header>
+</header>
+
+ <components version="2.0">
+ </components>
+
+</file>
diff --git a/cime_config/buildnml_test/env_batch.xml b/cime_config/buildnml_test/env_batch.xml
new file mode 100644
index 00000000..d9bc277d
--- /dev/null
+++ b/cime_config/buildnml_test/env_batch.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<file id="env_batch.xml" version="2.0">
+<header>
+</header>
+
+<!--
+
+-->
+<group id="config_batch">
+  <entry id="BATCH_SYSTEM" value="none">
+    <type>char</type> 
+  </entry>
+</group>
+
+  <batch_system type="none" >
+    <batch_query args=""></batch_query>
+    <batch_submit></batch_submit>
+    <batch_redirect></batch_redirect>
+    <batch_directive></batch_directive>
+    <directives>
+      <directive></directive>
+    </directives>
+  </batch_system>
+
+</file>
diff --git a/cime_config/buildnml_test/env_build.xml b/cime_config/buildnml_test/env_build.xml
new file mode 100644
index 00000000..3464158b
--- /dev/null
+++ b/cime_config/buildnml_test/env_build.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+
+<file id="env_build.xml" version="2.0">
+  <header>
+  </header>
+
+<!--
+
+-->
+  <group>
+    <entry id="LND_GRID" value="1.9x2.5">
+      <type>char</type>
+      <desc>Land (lnd) grid</desc>
+    </entry>
+    <entry id="LND_NX" value="720">
+    </entry>
+    <entry id="LND_NY" value="1">
+    </entry>
+
+    <entry id="OS" value="LINUX">
+    </entry>
+    <entry id="COMPILER" value="intel">
+    </entry>
+    <entry id="MPILIB" value="mpt">
+    </entry>
+  </group>
+
+</file>
diff --git a/cime_config/buildnml_test/env_case.xml b/cime_config/buildnml_test/env_case.xml
new file mode 100644
index 00000000..f6f4ef9d
--- /dev/null
+++ b/cime_config/buildnml_test/env_case.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+
+<file id="env_case.xml" version="2.0">
+  <header>
+  </header>
+
+<!--
+
+-->
+<group>
+    <entry id="COMP_CLASSES" value="CPL,ATM,LND,ROF"/>
+
+    <entry id="CONFIG_ROF_FILE" value="$COMP_ROOT_DIR_ROF/cime_config/config_component.xml">
+      <type>char</type>
+      <desc>file containing specification of component specific definitions and values(for documentation only - DO NOT EDIT)</desc>
+      <schema version="2.0">$CIMEROOT/config/xml_schemas/entry_id.xsd</schema>
+      <schema version="3.0">$CIMEROOT/config/xml_schemas/entry_id_version3.xsd</schema>
+    </entry>
+
+    <entry id="COMPSET" value="1850_DATM%GSWP3v1_SLIM_SICE_SOCN_SROF_SGLC_SWAV_SIAC_SESP">
+      <type>char</type>
+      <desc>Component set long name (for documentation only - DO NOT EDIT)</desc>
+    </entry>
+
+    <entry id="COMP_ROOT_DIR_LND" value="$SRCROOT">
+      <type>char</type>
+      <desc>Root directory of the case land model component  </desc>
+      <schema>$CIMEROOT/config/xml_schemas/config_compsets.xsd</schema>
+    </entry>
+
+    <entry id="COMP_LND" value="slim">
+      <type>char</type>
+      <valid_values>slim</valid_values>
+      <desc>Name of land component</desc>
+    </entry>
+
+    <entry id="SRCROOT" value="$ENV{PWD}/../..">
+      <type>char</type>
+      <desc>full pathname of source root directory</desc>
+    </entry>
+
+    <entry id="CASE" value="CASENAME">
+      <type>char</type>
+      <desc>case name</desc>
+    </entry>
+
+    <entry id="MODEL" value="cesm">
+      <type>char</type>
+      <desc>model system name</desc>
+    </entry>
+
+    <entry id="CASEROOT" value="$ENV{PWD}">
+      <type>char</type>
+      <desc>full pathname of case</desc>
+    </entry>
+
+    <entry id="LND_GRID" value="1.9x2.5}">
+      <type>char</type>
+      <desc>Land grid</desc>
+    </entry>
+</group>
+
+</file>
diff --git a/cime_config/buildnml_test/env_mach_pes.xml b/cime_config/buildnml_test/env_mach_pes.xml
new file mode 100644
index 00000000..5697d09f
--- /dev/null
+++ b/cime_config/buildnml_test/env_mach_pes.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0"?>
+
+<file id="env_mach_pes.xml" version="2.0">
+  <header>
+  </header>
+  <comment>
+  </comment>
+
+<!--
+
+-->
+  <group id="all">
+    <entry id="TOTALPES" value="72">
+       <type>integer</type>
+       <desc></desc>
+    </entry>
+    <entry id="NINST_MAX" value="1">
+       <type>integer</type>
+       <desc></desc>
+    </entry>
+    <entry id="MAX_TASKS_PER_NODE" value="36">
+       <type>integer</type>
+       <desc></desc>
+    </entry>
+    <entry id="MAX_MPITASKS_PER_NODE" value="36">
+       <type>integer</type>
+       <desc></desc>
+    </entry>
+    <entry id="FORCE_SPARE_NODES" value="-999">
+      <type>integer</type>
+      <desc>Force this exact number of spare nodes to be allocated</desc>
+    </entry>
+
+    <entry id="NTHRDS">
+       <type>integer</type>
+      <values>
+        <value compclass="ATM">1</value>
+        <value compclass="CPL">1</value>
+        <value compclass="ROF">1</value>
+        <value compclass="LND">1</value>
+      </values>
+      <desc></desc>
+    </entry>
+
+    <entry id="NTASKS">
+       <type>integer</type>
+      <values>
+        <value compclass="ATM">-2</value>
+        <value compclass="CPL">-2</value>
+        <value compclass="ROF">-2</value>
+        <value compclass="LND">-2</value>
+      </values>
+      <desc></desc>
+    </entry>
+
+    <entry id="ROOTPE">
+       <type>integer</type>
+      <values>
+        <value compclass="ATM">0</value>
+        <value compclass="CPL">0</value>
+        <value compclass="ROF">0</value>
+        <value compclass="LND">0</value>
+      </values>
+      <desc></desc>
+    </entry>
+
+    <entry id="NINST">
+       <type>integer</type>
+      <values>
+        <value compclass="ATM">1</value>
+        <value compclass="ROF">1</value>
+        <value compclass="LND">1</value>
+      </values>
+      <desc></desc>
+    </entry>
+
+    <entry id="PSTRID">
+       <type>integer</type>
+      <values>
+        <value compclass="ATM">1</value>
+        <value compclass="CPL">1</value>
+        <value compclass="ROF">1</value>
+        <value compclass="LND">1</value>
+      </values>
+      <desc></desc>
+    </entry>
+  </group>
+
+</file>
diff --git a/cime_config/buildnml_test/env_mach_specific.xml b/cime_config/buildnml_test/env_mach_specific.xml
new file mode 100644
index 00000000..c38d868a
--- /dev/null
+++ b/cime_config/buildnml_test/env_mach_specific.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+
+<file id="env_mach_specific.xml" version="2.0">
+
+<!--
+
+-->
+
+<header>
+</header>
+<group id="compliant_values">
+   <entry id="run_exe" value="${EXEROOT}/cesm.exe ">
+      <type>char</type>
+      <desc>executable name</desc>
+   </entry>
+</group>
+<module_system type="none">
+</module_system>
+<mpirun>
+   <executable></executable>
+</mpirun>
+
+
+</file>
diff --git a/cime_config/buildnml_test/env_run.xml b/cime_config/buildnml_test/env_run.xml
new file mode 100644
index 00000000..858cfc74
--- /dev/null
+++ b/cime_config/buildnml_test/env_run.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+
+<file id="env_run.xml" version="2.0">
+  <header>
+  </header>
+
+
+<!--
+
+Sample env_run.xml file that allows buildnml to be run for testing in this directory.
+
+-->
+<group>
+<entry id="DIN_LOC_ROOT"         value="/glade/p/cesmdata/cseg/inputdata"  /> 
+
+    <entry id="CASESTR" value="test">
+    </entry>
+    <entry id="RUNDIR" value="$CASEROOT/run">
+    </entry>
+    <entry id="RUN_TYPE" value="startup">
+    </entry>
+
+    <entry id="RUN_REFDIR" value="cesm2_init">
+    </entry>
+    <entry id="RUN_REFCASE" value="case.std">
+    </entry>
+    <entry id="RUN_REFDATE" value="0001-01-01">
+    </entry>
+    <entry id="RUN_REFTOD" value="00000">
+    </entry>
+    <entry id="GET_REFCASE" value="FALSE">
+    </entry>
+    <entry id="RUN_STARTDATE" value="0001-01-01">
+    </entry>
+
+    <entry id="NCPL_BASE_PERIOD" value="day">
+    </entry>
+    <entry id="LND_NCPL" value="48">
+    </entry>
+    <entry id="SLIM_SCENARIO" value="global_uniform">
+    </entry>
+    <entry id="SLIM_START_TYPE" value="cold">
+    </entry>
+    <entry id="LND_DOMAIN_FILE" value="domain.lnd.f19_gh72.151104.nc">
+    </entry>
+    <entry id="LND_DOMAIN_PATH" value="$DIN_LOC_ROOT/share/domains">
+    </entry>
+</group>
+
+</file>
diff --git a/cime_config/buildnml_test/env_workflow.xml b/cime_config/buildnml_test/env_workflow.xml
new file mode 100644
index 00000000..69c9aa80
--- /dev/null
+++ b/cime_config/buildnml_test/env_workflow.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+
+<file id="env_workflow.xml" version="2.0">
+<header>
+</header>
+
+<!--
+
+-->
+<group>
+</group>
+
+</file>
+
diff --git a/cime_config/buildnml_test/run_buildnml b/cime_config/buildnml_test/run_buildnml
new file mode 100755
index 00000000..2ad7a4a0
--- /dev/null
+++ b/cime_config/buildnml_test/run_buildnml
@@ -0,0 +1,4 @@
+#!/bin/bash
+rm Buildconf/slimconf/lnd_in
+env CIMEROOT=`pwd`/../../cime ../buildnml `pwd` --verbose --debug
+cat Buildconf/slimconf/lnd_in
diff --git a/cime_config/user_nl_clm b/cime_config/buildnml_test/user_nl_slim
similarity index 90%
rename from cime_config/user_nl_clm
rename to cime_config/buildnml_test/user_nl_slim
index 1df94b9d..43893a6e 100644
--- a/cime_config/user_nl_clm
+++ b/cime_config/buildnml_test/user_nl_slim
@@ -7,7 +7,7 @@
 ! Set fatmlndfrc         with LND_DOMAIN_PATH/LND_DOMAIN_FILE    options
 ! Set finidat            with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases
 !                        (includes $inst_string for multi-ensemble cases)
-!                        or with CLM_FORCE_COLDSTART to do a cold start
+!                        or with SLIM_START_TYPE=cold to do a cold start
 !                        or set it with an explicit filename here.
 !----------------------------------------------------------------------------------
 
diff --git a/cime_config/config_archive.xml b/cime_config/config_archive.xml
index 4c2412a0..9b3e93b7 100644
--- a/cime_config/config_archive.xml
+++ b/cime_config/config_archive.xml
@@ -1,5 +1,5 @@
 <components version="2.0">
-  <comp_archive_spec compname="clm" compclass="lnd">
+  <comp_archive_spec compname="slim" compclass="lnd">
     <rest_file_extension>r</rest_file_extension>
     <rest_file_extension>rh\d?</rest_file_extension>
     <hist_file_extension>h\d*.*\.nc$</hist_file_extension>
@@ -7,18 +7,18 @@
     <rest_history_varname>locfnh</rest_history_varname>
     <rpointer>
       <rpointer_file>rpointer.lnd$NINST_STRING</rpointer_file>
-      <rpointer_content>./$CASE.clm2$NINST_STRING.r.$DATENAME.nc</rpointer_content>
+      <rpointer_content>./$CASE.slim$NINST_STRING.r.$DATENAME.nc</rpointer_content>
     </rpointer>
     <test_file_names>
       <tfile disposition="copy">rpointer.lnd</tfile>
       <tfile disposition="copy">rpointer.lnd_9999</tfile>
-      <tfile disposition="copy">casename.clm2.r.1976-01-01-00000.nc</tfile>
-      <tfile disposition="copy">casename.clm2.rh4.1976-01-01-00000.nc</tfile>
-      <tfile disposition="move">casename.clm2.h0.1976-01-01-00000.nc</tfile>
-      <tfile disposition="ignore">casename.clm2.h0.1976-01-01-00000.nc.base</tfile>
-      <tfile disposition="move">casename.clm2_0002.e.postassim.1976-01-01-00000.nc</tfile>
-      <tfile disposition="move">casename.clm2_0002.e.preassim.1976-01-01-00000.nc</tfile>
-      <tfile disposition="ignore">anothercasename.clm2.i.1976-01-01-00000.nc</tfile>
+      <tfile disposition="copy">casename.slim.r.1976-01-01-00000.nc</tfile>
+      <tfile disposition="copy">casename.slim.rh4.1976-01-01-00000.nc</tfile>
+      <tfile disposition="move">casename.slim.h0.1976-01-01-00000.nc</tfile>
+      <tfile disposition="ignore">casename.slim.h0.1976-01-01-00000.nc.base</tfile>
+      <tfile disposition="move">casename.slim_0002.e.postassim.1976-01-01-00000.nc</tfile>
+      <tfile disposition="move">casename.slim_0002.e.preassim.1976-01-01-00000.nc</tfile>
+      <tfile disposition="ignore">anothercasename.slim.i.1976-01-01-00000.nc</tfile>
     </test_file_names>
   </comp_archive_spec>
 </components>
diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml
index b858907d..e90e3dcc 100644
--- a/cime_config/config_component.xml
+++ b/cime_config/config_component.xml
@@ -13,119 +13,62 @@
   -->
 
   <!-- Descriptions of all the different valid configurations for different model versions -->
-  <description modifier_mode="1">
-    <desc lnd="CLM45[%SP]">clm4.5:</desc>
-    <desc lnd="CLM50[%SP]">clm5.0:</desc>
-    <desc option="SP"     >Satellite phenology:</desc>
+  <description modifier_mode="?">
+    <desc lnd="SLIM" >Simple Land Model:</desc>
   </description>
 
   <entry id="COMP_LND">
     <type>char</type>
-    <valid_values>clm</valid_values>
-    <default_value>clm</default_value>
+    <valid_values>slim</valid_values>
+    <default_value>slim</default_value>
     <group>case_comp</group>
     <file>env_case.xml</file>
     <desc>Name of land component</desc>
   </entry>
 
-  <entry id="CLM_CONFIG_OPTS" >
+  <entry id="SLIM_SCENARIO">
     <type>char</type>
-    <default_value></default_value>
-    <values modifier='additive'>
-      <value compset="_CLM45"           >-phys clm4_5</value>
-      <value compset="_CLM50"           >-phys clm5_0</value>
-    </values>
-    <group>build_component_clm</group>
-    <file>env_build.xml</file>
-    <desc>Provides option(s) for the CLM configure utility.
-      CLM_CONFIG_OPTS are normally set as compset variables (e.g., -bgc cn)
-      and in general should not be modified for supported compsets.
-      It is recommended that if you want to modify this value for your experiment,
-      you should use your own user-defined component sets via using create_newcase
-      with a compset_file argument.
-      This is an advanced flag and should only be used by expert users.</desc>
-  </entry>
-
-  <entry id="CLM_NML_USE_CASE">
-    <type>char</type>
-    <default_value>UNSET</default_value>
-    <values>
-      <!-- Use rcp4.5 for PI to PDAY so will have data up to the current year available (for WACCM compsets that use PDAY) -->
-      <value compset="2000.*"		>2000_control</value>
-      <value compset="1850.*_"		>1850_control</value>
-    </values>
-    <group>run_component_clm</group>
-    <file>env_run.xml</file>
-    <desc>CLM namelist use_case.
-      Determines the use-case that will be sent to the CLM build-namelist utility.
-      This is normally set by the component set. This is an advanced flag and should only be
-      used by expert users.</desc>
-  </entry>
-
-  <!-- CLM_BLDNML_OPTS is not additive, we must list all possible combinations -->
-  <!-- ERROR: the node below is never matched, see bug 2025 -->
-  <entry id="CLM_BLDNML_OPTS">
-    <type>char</type>
-    <default_value></default_value>
+    <default_value>global_uniform</default_value>
+    <valid_values>global_uniform,realistic_from_1850,realistic_from_2000,user_defined</valid_values>
     <values>
-      <value compset="_CLM45%[^_]*SP"		 >-bgc sp</value>
-      <value compset="_CLM50%[^_]*SP"		 >-bgc sp</value>
+      <value compset="2000.*"   >realistic_from_2000</value>
+      <value compset="1850.*_"  >realistic_from_1850</value>
+      <value compset="HIST.*_"  >realistic_from_1850</value>
     </values>
-    <group>run_component_clm</group>
+    <group>run_component_slim</group>
     <file>env_run.xml</file>
-    <desc>CLM build-namelist options</desc>
+    <desc>SLIM namelist use_case scenario.
+      Determines the use-case scenario that will be used in the SLIM buildnml utility.
+      This is normally set by the component set.
+        'global_uniform' is for surface conditions are globally constant
+        'realistic_from_1850' are surface conditions taken from a 1850 control simulation with CTSM
+        'realistic_from_2000' are surface conditions taken from a 2000 control simulation with CTSM
+        'user_defined' means the user will provide their own surface condition file (mml_surdat)
+    </desc>
   </entry>
 
-  <entry id="CLM_CO2_TYPE">
+  <entry id="SLIM_START_TYPE">
     <type>char</type>
-    <valid_values>constant,diagnostic,prognostic</valid_values>
-    <default_value>constant</default_value>
+    <valid_values>cold,any,required</valid_values>
+    <default_value>any</default_value>
     <values>
-      <value compset="_CAM"     >diagnostic</value>
-      <value compset="HIST.*_DATM" >diagnostic</value>
+      <value run_type="branch" >required</value>
+      <value run_type="hybrid" >required</value>
+      <value run_type="startup">any</value>
     </values>
-    <group>run_component_clm</group>
-    <file>env_run.xml</file>
-    <desc>Determines how CLM will determine where CO2 is set.
-      If value is constant, it will be set to CCSM_CO2_PPMV,
-      if value is either diagnostic or prognostic, the atmosphere model
-      MUST send it to CLM. CLM_CO2_TYPE is normally set by the specific
-      compset, since it HAS to be coordinated with settings for the
-      atmospheric model. Do not modify this variable. If you want to modify for
-      your experiment, use your own user-defined component set
-      This is an advanced flag and should only be used by expert users.</desc>
-  </entry>
-
-  <entry id="CLM_NAMELIST_OPTS">
-    <type>char</type>
-    <default_value></default_value>
-    <group>run_component_clm</group>
-    <file>env_run.xml</file>
-    <desc>CLM-specific namelist settings for -namelist option in the CLM
-      build-namelist. CLM_NAMELIST_OPTS is normally set as a compset variable
-      and in general should not be modified for supported compsets.
-      It is recommended that if you want to modify this value for your experiment,
-      you should use your own user-defined component sets via using create_newcase
-      with a compset_file argument.
-      This is an advanced flag and should only be used by expert users.</desc>
-  </entry>
-
-  <entry id="CLM_FORCE_COLDSTART">
-    <type>char</type>
-    <valid_values>on,off</valid_values>
-    <default_value>off</default_value>
-    <group>run_component_clm</group>
+    <group>run_component_slim</group>
     <file>env_run.xml</file>
-    <desc>Flag to the CLM build-namelist command to force CLM to do a
-      cold start (finidat will be set to blanks).
-      A value of on forces the model to spin up from a cold-start
-      (arbitrary initial conditions). Setting this value in the xml file will take
-      precedence over any settings for finidat in the $CASEROOT/user_clm_clm file.</desc>
+    <desc>
+        SLIM run type.
+        'cold' is a cold start from arbitrary initial conditions, it will fail if you do provide initial conditions
+        'any' is a run using initial conditions if provided, OR arbitrary initial conditions if no files can be found
+        'required' is a run where starting from provided initial conditions is required, it will fail if they aren't
+    </desc>
   </entry>
 
   <help>
     =========================================
-    CLM naming conventions
+    SLIM naming conventions
     =========================================
     note: [^_]* means match zero or more of any character BUT an underbar.
     (in other words make sure there is NOT a underbar before the string afterwards)
diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml
index cd5da592..81d47dc9 100644
--- a/cime_config/config_compsets.xml
+++ b/cime_config/config_compsets.xml
@@ -14,7 +14,7 @@
     Where for the CAM specific compsets below the following is supported
     TIME = Time period (e.g. 2000, HIST, RCP8...)
     ATM  = [CAM40, CAM50, CAM55]
-    LND  = [CLM45, CLM50, SLND]
+    LND  = [SLIM, SLND]
     ICE  = [CICE, DICE, SICE]
     OCN  = [DOCN, ,AQUAP, SOCN]
     ROF  = [RTM, SROF]
@@ -41,30 +41,30 @@
   <!-- CAM6 -->
   <compset>
     <alias>ELT2000ClimoTESTC6I5Slim</alias>
-    <lname>2000_CAM60_CLM50%SP_CICE_DOCN%SOM_SROF_SGLC_SWAV</lname>
+    <lname>2000_CAM60_SLIM_CICE_DOCN%SOM_SROF_SGLC_SWAV</lname>
   </compset>
 
   <!-- This compset is currently not tested, but the 2000 one is -->
   <compset>
     <alias>ELT1850TESTC6I5Slim</alias>
-    <lname>1850_CAM60_CLM50%SP_CICE_DOCN%SOM_SROF_SGLC_SWAV</lname>
+    <lname>1850_CAM60_SLIM_CICE_DOCN%SOM_SROF_SGLC_SWAV</lname>
   </compset>
 
   <compset>
     <alias>FLT2000ClimoC6I5Slim</alias>
-    <lname>2000_CAM60_CLM50%SP_CICE%PRES_DOCN%DOM_SROF_SGLC_SWAV</lname>
+    <lname>2000_CAM60_SLIM_CICE%PRES_DOCN%DOM_SROF_SGLC_SWAV</lname>
   </compset>
   
   <!-- CAM5 -->
   <compset>
     <alias>ELT2000ClimoTESTC5I5Slim</alias>
-    <lname>2000_CAM50_CLM50%SP_CICE_DOCN%SOM_SROF_SGLC_SWAV</lname>
+    <lname>2000_CAM50_SLIM_CICE_DOCN%SOM_SROF_SGLC_SWAV</lname>
   </compset>
   
   <!-- CAM5 Historical -->
   <compset>
     <alias>FLTHISTC5I5Slim</alias>
-    <lname>HIST_CAM50_CLM50%SP_CICE%PRES_DOCN%DOM_SROF_SGLC_SWAV</lname>
+    <lname>HIST_CAM50_SLIM_CICE%PRES_DOCN%DOM_SROF_SGLC_SWAV</lname>
   </compset>
   
   <!--
@@ -74,36 +74,36 @@
   <!-- This compset currently is not tested -->
   <compset>
     <alias>IHistSlimRsGs</alias>
-    <lname>HIST_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_SROF_SGLC_SWAV</lname>
+    <lname>HIST_DATM%GSWP3v1_SLIM_SICE_SOCN_SROF_SGLC_SWAV</lname>
   </compset>
   <!-- Primarily for testing; uses Qian atmospheric forcing simply to give
        faster datm throughput-->
   <compset>
     <alias>IHistSlimQianRsGs</alias>
-    <lname>HIST_DATM%QIA_CLM50%SP_SICE_SOCN_SROF_SGLC_SWAV</lname>
+    <lname>HIST_DATM%QIA_SLIM_SICE_SOCN_SROF_SGLC_SWAV</lname>
   </compset>
 
   <compset>
     <alias>I2000SlimRsGs</alias>
-    <lname>2000_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_SROF_SGLC_SWAV</lname>
+    <lname>2000_DATM%GSWP3v1_SLIM_SICE_SOCN_SROF_SGLC_SWAV</lname>
   </compset>
 
   <!-- This compset currently is not tested -->
   <compset>
     <alias>I1850SlimRsGs</alias>
-    <lname>1850_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_SROF_SGLC_SWAV</lname>
+    <lname>1850_DATM%GSWP3v1_SLIM_SICE_SOCN_SROF_SGLC_SWAV</lname>
   </compset>
 
   <!-- This compset currently is not tested -->
   <compset>
     <alias>I1850SlimCruRsGs</alias>
-    <lname>1850_DATM%CRUv7_CLM50%SP_SICE_SOCN_SROF_SGLC_SWAV</lname>
+    <lname>1850_DATM%CRUv7_SLIM_SICE_SOCN_SROF_SGLC_SWAV</lname>
   </compset>
 
   <!-- This compset currently is not tested -->
   <compset>
     <alias>I1850SlimCplhistRsGs</alias>
-    <lname>1850_DATM%CPLHIST_CLM50%SP_SICE_SOCN_SROF_SGLC_SWAV</lname>
+    <lname>1850_DATM%CPLHIST_SLIM_SICE_SOCN_SROF_SGLC_SWAV</lname>
   </compset>
 
 
diff --git a/cime_config/config_pes.xml b/cime_config/config_pes.xml
index 0797bb4d..9e6fa44b 100644
--- a/cime_config/config_pes.xml
+++ b/cime_config/config_pes.xml
@@ -79,7 +79,7 @@
   </grid>
   <grid name="a%1.9x2.5.+l%1.9x2.5.+oi%gx1" >
     <mach name="cheyenne">
-      <pes pesize="any" compset="CAM.+CLM.+CICE.+DOCN.+">
+      <pes pesize="any" compset="CAM.+SLIM.+CICE.+DOCN.+">
 	<comment>Coupled to CAM for 2 degree on cheyenne</comment>
         <ntasks>
           <ntasks_atm>-10</ntasks_atm>
diff --git a/cime_config/namelist_definition.xsl b/cime_config/namelist_definition.xsl
new file mode 100644
index 00000000..62e02bf0
--- /dev/null
+++ b/cime_config/namelist_definition.xsl
@@ -0,0 +1,114 @@
+<?xml version='1.0'?>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+<xsl:template match="/">
+  <html>
+    <xsl:apply-templates/>
+  </html>
+</xsl:template>
+
+<xsl:template match="namelist_definition">
+  <head>
+    <title>SLIM Namelist Definition</title>
+  </head>
+  <body>
+<p>
+</p>
+<hr/>
+<p>
+</p>
+    <h1>Definition of SLIM namelist variables</h1>
+    <p>We list all of the relevant namelist variables for SLIM cases. This includes
+    SLIM Namelist items.</p>
+<hr/>
+    <h2>Definition of SLIM namelist variables</h2>
+    <p>Note, these all would go into the user_nl_slim file</p>
+    <p>Included in the table are the following pieces of information:</p>
+    <ul>
+    <li>Variable name.</li>
+    <li>Variable type (<code>char</code>, <code>integer</code>,
+    <code>real</code>, or <code>logical</code>).  The type
+    <code>char</code> has the length appended
+    following an asterisk, e.g., <code>char*256</code>.  Variables that are
+    arrays have their dimension specifier appended inside parentheses.  For
+    example <code>char*1(6)</code> denotes a array of six
+    <code>char*1</code> values.
+    </li>
+    <li>Variable description (includes information on defaults).</li>
+    <li>Valid values (if restricted).</li>
+    </ul>
+
+    <table border="1" cellpadding="10">
+    <caption>SLIM Namelist Physics Options</caption>
+      <tr>
+      <th rowspan="2">Name</th>
+      <th rowspan="2">Type</th>
+      <th>Description</th>
+      </tr>
+      <tr>
+      <th colspan="1">Valid values</th>
+      </tr>
+      <xsl:apply-templates select="entry[category='slim_physics']"/>
+    </table>
+
+    <table border="1" cellpadding="10">
+    <caption>SLIM Namelist Datasets</caption>
+      <tr>
+      <th rowspan="2">Name</th>
+      <th rowspan="2">Type</th>
+      <th>Description
+      </th>
+      </tr>
+      <tr>
+      <th colspan="1">Valid values</th>
+      </tr>
+      <xsl:apply-templates select="entry[category='datasets']"/>
+    </table>
+
+    <table border="1" cellpadding="10">
+    <caption>SLIM Namelist History output settings</caption>
+      <tr>
+      <th rowspan="2">Name</th>
+      <th rowspan="2">Type</th>
+      <th>Description</th>
+      </tr>
+      <tr>
+      <th colspan="1">Valid values</th>
+      </tr>
+      <xsl:apply-templates select="entry[category='history']"/>
+    </table>
+
+    <table border="1" cellpadding="10">
+    <caption>SLIM Namelist Performance Tuning</caption>
+      <tr>
+      <th rowspan="2">Name</th>
+      <th rowspan="2">Type</th>
+      <th>Description</th>
+      </tr>
+      <tr>
+      <th colspan="1">Valid values</th>
+      </tr>
+      <xsl:apply-templates select="entry[category='slim_performance']"/>
+    </table>
+
+<p>
+<hr/>
+
+</p>
+</body>
+</xsl:template>
+
+<xsl:template match="entry">
+  <tr>
+    <td rowspan="2"><font color="#ff0000"><xsl:value-of select="@id"/></font></td>
+    <td rowspan="2"><xsl:value-of select="type"/></td>
+    <td><xsl:value-of select="desc"/><xsl:apply-templates/></td>
+  </tr>
+  <tr>
+    <td colspan="1"><xsl:if test="string-length(valid_values)>0"><b>Valid Values: </b>
+         <xsl:value-of select="valid_values"/></xsl:if></td>
+  </tr>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/cime_config/namelist_definition_slim.xml b/cime_config/namelist_definition_slim.xml
new file mode 100644
index 00000000..99ed1089
--- /dev/null
+++ b/cime_config/namelist_definition_slim.xml
@@ -0,0 +1,355 @@
+<?xml version="1.0"?>
+
+<?xml-stylesheet type="text/xsl" href="namelist_definition.xsl"?>
+
+<entry_id version="2.0">
+
+  <!-- =============================================================  -->
+  <!-- datasets                                                       -->
+  <!-- mml_surdat and fatmlndfr are always required                   -->
+  <!-- finidat or nvesn must also be set                              -->
+  <!-- =============================================================  -->
+
+  <entry id="mml_surdat">
+     <type>char</type>
+     <category>datasets</category>
+     <input_pathname>abs</input_pathname> 
+     <group>slim_data_and_initial</group>
+     <values>
+       <value>UNSET</value>
+       <value slim_scenario="user_defined"                           >UNSET</value>
+       <value slim_scenario="global_uniform"      lnd_grid="1.9x2.5" >$DIN_LOC_ROOT/lnd/slim/surdat/globalconst_alpha0.2_soilcv2e6_hc0.1_rs100.0_glc_hc0.01_f19_cdf5_20211105.nc</value>
+       <value slim_scenario="realistic_from_1850" lnd_grid="1.9x2.5" >$DIN_LOC_ROOT/lnd/slim/surdat/slim_realistic_fromCLM5_alb1850_hc1850_rs1850_f19_20190110.nc</value>
+       <value slim_scenario="realistic_from_2000" lnd_grid="1.9x2.5" >$DIN_LOC_ROOT/lnd/slim/surdat/slim2deg_fromCMIP6-AMIP-1deg_ensemble001-010_1991to2010clim_max-ctrl-bucket_rs150_c20210401.nc</value>
+       <value slim_scenario="realistic_from_2000" lnd_grid="0.9x1.25">$DIN_LOC_ROOT/lnd/slim/surdat/slim_realistic_f19_20190110_reverse_cutout_to_f09_c20230224.nc</value>
+       <value slim_scenario="realistic_from_2000" lnd_grid="4x5"     >$DIN_LOC_ROOT/lnd/slim/surdat/slim_realistic_f19_20190110_cutout_to_f45_c20230131.nc</value>
+       <value slim_scenario="realistic_from_2000" lnd_grid="10x15"   >$DIN_LOC_ROOT/lnd/slim/surdat/slim_realistic_f19_20190110_cutout_to_f10_c20230131.nc</value>
+     </values>
+     <desc>
+           Surface dataset describing surface properties at each gridcell
+     </desc>
+  </entry>
+
+  <entry id="finidat_interp_dest" skip_default_entry="true">
+     <type>char</type> 
+     <category>datasets</category>
+     <input_pathname>abs</input_pathname> 
+     <group>slim_data_and_initial</group> 
+     <valid_values></valid_values>
+     <values>
+       <value>UNSET</value>
+     </values>
+     <desc>
+           If use_init_interp is set to .true., interpinic will be called to interpolate
+           the file given by finidat, creating the output file specified by finidat_interp_dest.
+     </desc>
+  </entry>
+
+  <entry id="finidat" skip_default_entry="true">
+     <type>char</type> 
+     <category>datasets</category>
+     <group>slim_data_and_initial</group> 
+     <valid_values></valid_values>
+     <values>
+       <value slim_start_type="cold">UNSET</value>
+       <value slim_start_type="any">UNSET</value>
+     </values>
+     <desc>
+           Full pathname of initial conditions file. If blank SLIM will startup from
+           arbitrary initial conditions.
+     </desc>
+  </entry>
+
+  <entry id="use_init_interp" skip_default_entry="true">
+     <type>logical</type>
+     <category>datasets</category>
+     <group>slim_data_and_initial</group>
+     <valid_values></valid_values>
+     <desc>
+           If set to .true., interpinic will be called to interpolate the file given by finidat,
+           creating the output file specified by finidat_interp_dest.
+
+           This requires that finidat be non-blank.
+     </desc>
+  </entry>
+
+  <entry id="nrevsn" skip_default_entry="true">
+     <type>char</type> 
+     <category>datasets</category>
+     <input_pathname>abs</input_pathname> 
+     <group>slim_data_and_initial</group> 
+     <valid_values></valid_values>
+     <desc>
+           Full pathname of master restart file for a branch run. (only used if RUN_TYPE=branch)
+           (Set with RUN_REFCASE and RUN_REFDATE)
+     </desc>
+  </entry>
+
+  <entry id="fatmlndfrc" modify_via_xml="LND_DOMAIN_FILE">
+     <type>char</type> 
+     <category>datasets</category>
+     <input_pathname>abs</input_pathname> 
+     <group>slim_data_and_initial</group> 
+     <valid_values></valid_values>
+     <values>
+       <value>$LND_DOMAIN_PATH/$LND_DOMAIN_FILE</value>
+     </values>
+     <desc>Full pathname of land fraction data file.</desc>
+  </entry>
+
+  <!-- =============================================================  -->
+  <!-- Performance                                                    -->
+  <!-- =============================================================  -->
+
+  <entry id="nsegspc">
+     <type>integer</type> 
+     <category>slim_performance</category>
+     <group>slim_perf</group>
+     <desc>number of segments per clump for decomposition</desc>
+     <default_value>35</default_value>
+     <values>
+       <value>35</value>
+     </values>
+  </entry>
+
+  <!-- =============================================================  -->
+  <!-- Physics: time-step, etc.                                  -->
+  <!-- =============================================================  -->
+
+  <entry id="dtime" modify_via_xml="LND_NCPL">
+    <type>real</type>  
+    <category>slim_physics</category> 
+    <group>slim_inparm</group>
+    <desc>Time step (seconds)</desc>
+  </entry>
+
+  <!-- =============================================================  -->
+  <!-- History fields                                                 -->
+  <!-- hist_nhtfrq is the one item always output                      -->
+  <!-- =============================================================  -->
+
+  <entry id="hist_avgflag_pertape" skip_default_entry="true">
+    <type>char(6)</type> 
+    <category>history</category>
+    <group>slim_history</group> 
+    <valid_values>A,I,X,M</valid_values>
+    <desc>
+          Per file averaging flag.
+          'A' (average over history period)
+          'I' (instantaneous)
+          'X' (maximum over history period)
+          'M' (minimum over history period)
+    </desc>
+  </entry>
+
+  <entry id="hist_empty_htapes" skip_default_entry="true">
+    <type>logical</type> 
+    <category>history</category>
+    <group>slim_history</group>
+    <desc>
+          If TRUE, indicates do NOT output any default history fields (requires you to use
+          hist_fincl* to set the exact output fields to use)..
+    </desc>
+  </entry>
+
+  <entry id="use_noio" skip_default_entry="true">
+    <type>logical</type> 
+    <category>history</category>
+    <group>slim_history</group>
+    <desc>
+          Toggle to turn all history output completely OFF (possibly used for testing)
+    </desc>
+  </entry>
+
+  <entry id="hist_fexcl1" skip_default_entry="true">
+     <type>char(1000)</type> 
+     <category>history</category>
+     <group>slim_history</group>
+     <desc>Fields to exclude from default history tape series 1.</desc>
+    <values>
+        <value>''</value>
+    </values>
+  </entry>
+
+  <entry id="hist_fincl1" skip_default_entry="true">
+    <type>char(1000)</type> 
+    <category>history</category>
+    <group>slim_history</group>
+    <desc>Fields to add to history tape series  1.</desc>
+    <values>
+        <value>''</value>
+    </values>
+  </entry>
+
+  <entry id="hist_fincl2" skip_default_entry="true">
+    <type>char(1000)</type> 
+    <category>history</category>
+    <group>slim_history</group>
+    <desc>Fields to add to history tape series  2.</desc>
+  </entry>
+
+  <entry id="hist_fincl3" skip_default_entry="true">
+    <type>char(1000)</type> 
+    <category>history</category>
+    <group>slim_history</group>
+    <desc>Fields to add to history tape series  3.</desc>
+  </entry>
+
+  <entry id="hist_fincl4" skip_default_entry="true">
+    <type>char(1000)</type> 
+    <category>history</category>
+    <group>slim_history</group>
+    <desc>Fields to add to history tape series  4.</desc>
+  </entry>
+
+  <entry id="hist_fincl5" skip_default_entry="true">
+    <type>char(1000)</type> 
+    <category>history</category>
+    <group>slim_history</group>
+    <desc>Fields to add to history tape series  5.</desc>
+  </entry>
+
+  <entry id="hist_fincl6" skip_default_entry="true">
+    <type>char(1000)</type> 
+    <category>history</category>
+    <group>slim_history</group>
+    <desc>Fields to add to history tape series  6.</desc>
+  </entry>
+
+  <entry id="hist_mfilt" skip_default_entry="true">
+    <type>integer(6)</type> 
+    <category>history</category>
+    <group>slim_history</group>
+    <desc>Per tape series  maximum number of time samples.</desc>
+    <values>
+      <value>1</value>
+    </values>
+  </entry>
+
+  <entry id="hist_ndens" skip_default_entry="true">
+    <type>integer(6)</type> 
+    <category>history</category>
+    <group>slim_history</group> 
+    <valid_values>1,2</valid_values>
+    <desc>
+          Per tape series  history file density (i.e. output precision)
+          1=double precision
+          2=single precision
+    </desc>
+    <default_value>2,2,2,2,2,2</default_value>
+    <values>
+      <value>2</value>
+    </values>
+  </entry>
+
+  <!-- hist_nhtfrq is the one history namelist item that will always be output -->
+  <entry id="hist_nhtfrq">
+    <type>integer(6)</type> 
+    <category>history</category>
+    <group>slim_history</group>
+    <desc>
+            Per tape series history write frequency.
+            positive means in time steps
+            0=monthly
+            negative means hours
+        (i.e. 5 means every 5 time-steps and -24 means every day
+    </desc>
+    <default_value>0,-24,-24,-24,-24,-24</default_value>
+    <values>
+      <value>0</value>
+    </values>
+  </entry>
+
+  <!-- =============================================================  -->
+  <!-- General settings: resolution etc.                              -->
+  <!-- =============================================================  -->
+
+  <entry id="slim_start_type" modify_via_xml="SLIM_START_TYPE">
+       <type>char</type>  
+       <category>default_settings</category>
+       <group>default_settings</group> 
+       <valid_values>cold,any,required</valid_values>
+       <values>
+           <value>$SLIM_START_TYPE</value>
+       </values>
+       <desc>
+             SLIM run type.
+             'cold' is a run from arbitrary initial conditions
+             'any' is a run using initial conditions if provided, OR arbitrary initial conditions if no files can be found
+             'required' is a startup run which requires setting initial conditions
+       </desc>
+  </entry>
+
+  <entry id="res" modify_via_xml="LND_GRID">
+       <type>char</type> 
+       <category>default_settings</category>
+       <group>default_settings</group>  
+       <values>
+           <value>$LND_GRID</value>
+       </values>
+      <desc>Horizontal resolutions</desc>
+  </entry>
+
+  <!-- =============================================================  -->
+  <!-- Initial interpolation namelists still in place                 -->
+  <!-- =============================================================  -->
+
+  <entry id="check_finidat_year_consistency">
+     <type>logical</type>
+     <category>datasets</category>
+     <group>finidat_consistency_checks</group>
+     <default_value>.false.</default_value>
+       <values>
+           <value>.false.</value>
+       </values>
+     <desc>
+           If TRUE, check consistency between year on the finidat file
+           and the current model year. This check is only done for a transient run.
+
+           This requires that finidat be non-blank.
+     </desc>
+  </entry>
+
+  <!-- =============================================================  -->
+  <!-- Namelist items currently not used that could be good to add    -->
+  <!-- back in                                                        -->
+  <!-- =============================================================  -->
+
+  <entry id="clump_pproc" skip_default_entry="true">
+     <type>integer</type>
+     <category>performance</category>
+     <group>clm_inparm</group>
+     <desc>
+           Number of processors to use per clump (when threading is implemented)
+           Currently has no effect
+           See this issue:
+                https://github.com/ESCOMP/SimpleLand/issues/29
+     </desc>
+  </entry>
+
+  <entry id="wrtdia" skip_default_entry="true">
+     <type>logical</type>
+     <category>datasets</category>
+     <group>clm_inparm</group>
+     <desc>
+           Write diagnostics out to the log file about global statistics
+           Currently is implemented, but should be removed.
+     </desc>
+  </entry>
+
+
+  <entry id="single_column" skip_default_entry="true">
+     <type>logical</type>
+     <category>datasets</category>
+     <group>clm_inparm</group>
+     <default_value>.false.</default_value>
+     <valid_values>.false.</valid_values>
+     <desc>
+           Run as a single column (NOT currently implemented)
+           See this issue:
+                https://github.com/ESCOMP/SimpleLand/issues/29
+     </desc>
+  </entry>
+
+
+</entry_id>
diff --git a/cime_config/slim_cime_py/__init__.py b/cime_config/slim_cime_py/__init__.py
new file mode 100644
index 00000000..f63ce26b
--- /dev/null
+++ b/cime_config/slim_cime_py/__init__.py
@@ -0,0 +1,2 @@
+# pylint: disable=missing-module-docstring
+from .buildnml import buildnml
diff --git a/cime_config/slim_cime_py/buildnml.py b/cime_config/slim_cime_py/buildnml.py
new file mode 100644
index 00000000..d3bf36af
--- /dev/null
+++ b/cime_config/slim_cime_py/buildnml.py
@@ -0,0 +1,523 @@
+"""
+SLIM namelist creator
+"""
+import os
+import shutil
+import logging
+import re
+
+from CIME.buildnml import create_namelist_infile
+from CIME.nmlgen import NamelistGenerator
+from CIME.namelist import literal_to_python_value
+from CIME.utils import expect
+
+logger = logging.getLogger(__name__)
+
+# pylint: disable=too-many-arguments,too-many-locals,too-many-branches,too-many-statements
+####################################################################################
+def check_nml_dtime(nmlgen, case):
+    ####################################################################################
+    """Set the namelist settings for time-step"""
+    # pylint: disable=global-statement
+    global logger
+    # ------------------------------------------------------
+    logger.debug(" check_nml_dtime")
+    ncpl_base_period = case.get_value("NCPL_BASE_PERIOD")
+    calendar = case.get_value("CALENDAR")
+    if ncpl_base_period == "hour":
+        basedt = 3600
+    elif ncpl_base_period == "day":
+        basedt = 3600 * 24
+    elif ncpl_base_period == "year":
+        if calendar == "NO_LEAP":
+            basedt = 3600 * 24 * 365
+        else:
+            logger.error("CALENDAR = %s", calendar)
+            expect(False, "Invalid CALENDAR for NCPL_BASE_PERIOD %s " % ncpl_base_period)
+    elif ncpl_base_period == "decade":
+        if calendar == "NO_LEAP":
+            basedt = 3600 * 24 * 365 * 10
+        else:
+            logger.error("CALENDAR = %s", calendar)
+            expect(
+                False,
+                "Invalid CALENDAR for NCPL_BASE_PERIOD %s " % ncpl_base_period,
+            )
+    else:
+        expect(False, "Invalid NCPL_BASE_PERIOD %s " % ncpl_base_period)
+
+    if basedt < 0:
+        expect(False, "basedt invalid overflow for NCPL_BASE_PERIOD %s " % ncpl_base_period)
+
+    lnd_ncpl = int(case.get_value("LND_NCPL"))
+    if basedt % lnd_ncpl != 0:
+        logger.error("CALENDAR = %s", calendar)
+        expect(
+            False,
+            "LND_NCPL=%s doesn't divide evenly into NCPL_BASE_PERIOD %s\n"
+            % (lnd_ncpl, ncpl_base_period),
+        )
+    else:
+        dtime = basedt // lnd_ncpl
+
+    expect(
+        dtime > 1,
+        "LND_NCPL=%s is too frequent which gives a time step that is too short\n" % lnd_ncpl,
+    )
+    expect(
+        dtime <= 86400,
+        "LND_NCPL=%s is too infrequent which gives a time step that is too long\n" % lnd_ncpl,
+    )
+    nmlgen.set_value("dtime", value=dtime)
+
+
+# pylint: disable=too-many-arguments,too-many-locals,too-many-branches,too-many-statements
+####################################################################################
+def check_nml_general(nmlgen):
+    ####################################################################################
+    """Set the namelist settings for general settings"""
+    # pylint: disable=global-statement
+    global logger
+    # ------------------------------------------------------
+    logger.debug(" check_nml_general")
+    for var in ("slim_start_type", "res"):
+        expect(nmlgen.get_value(var) is not None, var + " must be set")
+
+
+####################################################################################
+def check_file(filename, case):
+    ####################################################################################
+    """Check that the file exists"""
+    if os.path.isabs(filename):
+        expect(os.path.isfile(filename), "filename must exist:" + filename)
+    else:
+        rundir = case.get_value("RUNDIR")
+        fname = os.path.normpath(os.path.join(rundir, filename))
+        expect(os.path.isfile(fname), "filename must exist:" + fname)
+
+
+# pylint: disable=too-many-arguments,too-many-locals,too-many-branches,too-many-statements
+####################################################################################
+def check_nml_performance(nmlgen):
+    ####################################################################################
+    """Set the namelist settings for performance"""
+    # pylint: disable=global-statement
+    global logger
+    # ------------------------------------------------------
+    logger.debug(" check_nml_performance")
+    expect(int(nmlgen.get_value("nsegspc")) > 0, "nsegspc must be positive")
+
+
+# pylint: disable=too-many-arguments,too-many-locals,too-many-branches,too-many-statements
+####################################################################################
+def check_nml_history(nmlgen):
+    ####################################################################################
+    """Set the namelist settings for history"""
+    # pylint: disable=global-statement
+    global logger
+    # ------------------------------------------------------
+    logger.debug(" check_nml_history")
+
+    avg_opts = ("A", "I", "X", "M")
+    hist_mfilt = nmlgen.get_value("hist_mfilt")
+    for mfilt in hist_mfilt:
+        if mfilt is None:
+            break
+        if int(mfilt) <= 0:
+            raise SystemExit("hist_mfilt must be 1 or larger")
+
+    #
+    # Check the list of fincl for validity and get number of tapes
+    #
+    hist_empty_htapes = nmlgen.get_value("hist_empty_htapes")
+    if hist_empty_htapes is not None:
+        hist_empty = literal_to_python_value(hist_empty_htapes, type_="logical")
+    else:
+        hist_empty = False
+
+    if hist_empty:
+        num_tapes = 0
+    else:
+        num_tapes = 1
+
+    ftype = "fincl"
+    for tape in (1, 2, 3, 4, 5, 6):
+        var = "hist_" + ftype + str(tape)
+        val = nmlgen.get_value(var)
+        for field in val:
+            if field is None:
+                break
+            match = re.fullmatch(r"([A-Za-z0-9_.]+):*([A-Z0-9]*)\s*", field)
+            if match is None:
+                raise SystemExit(
+                    "History field name "
+                    + var
+                    + " has invalid characters or whitespace in it="
+                    + field
+                )
+            if match.group(2):
+                if match.group(2) not in avg_opts:
+                    raise SystemExit(
+                        "History averaging option "
+                        + match.group(2)
+                        + " is not valid in "
+                        + var
+                        + " = "
+                        + field
+                    )
+        if val != [None]:
+            num_tapes = tape
+    #
+    # hist_fexcl1 can only be set if hist_empty is NOT true
+    #
+    var = "hist_fexcl1"
+    val = nmlgen.get_value(var)
+    if hist_empty:
+        if val != [None]:
+            raise SystemExit("hist_fexcl1 can not be set if hist_empty_htapes is set to true")
+    else:
+        for field in val:
+            if field is None:
+                break
+            match = re.search(r"^[A-Za-z0-9_.]+\s*$", field)
+            if match is None:
+                raise SystemExit(
+                    "History field name "
+                    + var
+                    + " has invalid characters or whitespace in it="
+                    + field
+                )
+    #
+    # Loop through history array types and make sure array sizes
+    # are consistent and match the expected number
+    #
+    for var in (
+        "hist_mfilt",
+        "hist_ndens",
+        "hist_nhtfrq",
+        "hist_avgflag_pertape",
+    ):
+        val = nmlgen.get_value(var)
+        if val != [None]:
+            if len(val) != num_tapes:
+                raise SystemExit(
+                    var
+                    + " array size does not agree with the expected size of "
+                    + str(num_tapes)
+                    + " "
+                    + str(val)
+                )
+    #
+    # History options should not be used when use_noio is on, because it turns off all history...
+    #
+    use_noio = nmlgen.get_value("use_noio")
+    if use_noio is not None:
+        noio = literal_to_python_value(use_noio, type_="logical")
+    else:
+        noio = False
+
+    if noio:
+        # NOTE: hist_nhtfrq is excluded from this list since it is set by default
+        # Loop over the history array options
+        for var in (
+            "hist_fexcl1",
+            "hist_fincl1",
+            "hist_fincl2",
+            "hist_fincl3",
+            "hist_fincl4",
+            "hist_fincl5",
+            "hist_fincl6",
+            "hist_mfilt",
+            "hist_ndens",
+            "hist_avgflag_pertape",
+        ):
+            val = nmlgen.get_value(var)
+            if val != [None]:
+                raise SystemExit(
+                    "use_noio turns off all history output"
+                    + ", so no hist_ namelist option should also be set"
+                    + ", the %s array is also being set here" % var
+                )
+        # Loop over any history scalar options
+        for var in ("hist_empty_htapes",):
+            val = nmlgen.get_value(var)
+            if val is not None:
+                raise SystemExit(
+                    "use_noio turns off all history output"
+                    + ", so no hist_ namelist option should also be set"
+                    + ", %s is also being set here" % var
+                )
+
+
+# pylint: disable=too-many-arguments,too-many-locals,too-many-branches,too-many-statements
+####################################################################################
+def check_nml_initial_conditions(nmlgen, case, inst_string=""):
+    ####################################################################################
+    """Set the namelist settings for initial conditions"""
+    # pylint: disable=global-statement
+    global logger
+    # ------------------------------------------------------
+    logger.debug(" check_nml_initial_conditions")
+    start_type = case.get_value("SLIM_START_TYPE")
+    run_type = case.get_value("RUN_TYPE")
+    run_refcase = case.get_value("RUN_REFCASE")
+    run_refdate = case.get_value("RUN_REFDATE")
+    run_reftod = case.get_value("RUN_REFTOD")
+    rundir = case.get_value("RUNDIR")
+    if run_type in ("hybrid", "branch"):
+        slim_startfile = "%s.slim%s.r.%s-%s.nc" % (
+            run_refcase,
+            inst_string,
+            run_refdate,
+            run_reftod,
+        )
+        if not os.path.exists(os.path.join(rundir, slim_startfile)):
+            slim_startfile = "%s.slim.r.%s-%s.nc" % (
+                run_refcase,
+                run_refdate,
+                run_reftod,
+            )
+
+    nrevsn = nmlgen.get_value("nrevsn")
+    finidat = nmlgen.get_value("finidat")
+    #
+    # Non branch types
+    #
+    if run_type != "branch":
+        # Handle a cold start
+        if start_type == "cold":
+            if finidat != " " and finidat != "UNSET" and finidat is not None:
+                raise SystemExit(
+                    "finidat is set but SLIM_START_TYPE is cold which is a contradiction"
+                )
+            nmlgen.set_value("finidat", value=" ")
+
+        # Set to blank meaning a cold start if still UNSET
+        if finidat == " " or finidat == "UNSET" or finidat is None:
+            if run_type == "hybrid" and start_type != "cold":
+                finidat = slim_startfile
+                check_file(finidat, case)
+                nmlgen.set_value("finidat", value=finidat)
+            else:
+                nmlgen.set_value("finidat", value=" ")
+                logger.warning("WARNING: SLIM is starting up from a cold state")
+
+        else:
+            check_file(finidat, case)
+
+        if nrevsn is not None:
+            raise SystemExit("nrevsn can NOT be set except when RUN_TYPE is a branch")
+    #
+    # branch types
+    #
+    else:
+        if nrevsn is None:
+            nrevsn = slim_startfile
+            nmlgen.set_value("nrevsn", value=nrevsn)
+
+        check_file(nrevsn, case)
+        if finidat is not None:
+            raise SystemExit("finidat can NOT be set when RUN_TYPE is a branch")
+
+
+# pylint: disable=too-many-arguments,too-many-locals,too-many-branches,too-many-statements
+####################################################################################
+def check_nml_data(nmlgen, case):
+    ####################################################################################
+    """Set the namelist settings for data must be after check_nml_initial_conditions"""
+    # pylint: disable=global-statement
+    global logger
+    # ------------------------------------------------------
+    logger.debug(" check_nml_data")
+
+    mml_surdat = nmlgen.get_value("mml_surdat")
+    if mml_surdat == "UNSET":
+        slim_scenario = case.get_value("SLIM_SCENARIO")
+        if slim_scenario == "user_defined":
+            raise SystemExit(
+                "When SLIM_SCENARIO is set to user_defined, you must provide the mml_surdat "
+                + "file by adding it to the user_nl_slim file to add it to the namelist"
+            )
+        raise SystemExit("mml_surdat file is NOT set and is required")
+
+    #
+    # use_init_interp requires that finidat be set
+    #
+    finidat = nmlgen.get_value("finidat")
+    use_init_interp = nmlgen.get_value("use_init_interp")
+    if use_init_interp is not None:
+        interp = literal_to_python_value(use_init_interp, type_="logical")
+    else:
+        interp = False
+
+    if finidat == " " and interp:
+        raise SystemExit("use_init_interp can not be set to TRUE for a cold start")
+    #
+    # use_init_interp can not be set for a branch case
+    #
+    run_type = case.get_value("RUN_TYPE")
+    if run_type == "branch" and interp:
+        raise SystemExit("use_init_interp can NOT be set to TRUE for a branch run type")
+
+    #
+    # finidat destination file can only be set if interp is on
+    #
+    finidat_dest = nmlgen.get_value("finidat_interp_dest")
+    if finidat_dest is not None and not interp:
+        raise SystemExit("finidat_interp_dest can NOT be set if use_init_interp is not on")
+
+
+# pylint: disable=too-many-arguments,too-many-locals,too-many-branches,too-many-statements
+# Turn off unused-argument for inst_string, since isn't in place right now
+# pylint: disable=unused-argument
+####################################################################################
+def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path):
+    ####################################################################################
+    """Write out the namelist for this component.
+
+    Most arguments are the same as those for `NamelistGenerator`. The
+    `inst_string` argument is used as a suffix to distinguish files for
+    different instances. The `confdir` argument is used to specify the directory
+    in which output files will be placed.
+    """
+    # pylint: disable=global-statement
+    global logger
+    # ------------------------------------------------------
+    # Create config dictionary
+    # ------------------------------------------------------
+    config = {}
+    config["lnd_grid"] = case.get_value("LND_GRID")
+    config["compset"] = case.get_value("COMPSET")
+    config["slim_scenario"] = case.get_value("SLIM_SCENARIO")
+    config["slim_start_type"] = case.get_value("SLIM_START_TYPE")
+
+    logger.info(" SLIM lnd grid is %s", config["lnd_grid"])
+
+    # ------------------------------------------------------
+    # Initialize namelist defaults
+    # ------------------------------------------------------
+    nmlgen.init_defaults(infile, config)
+
+    # ------------------------------------------------------
+    #  Process different namelists and parts of the namelist
+    # ------------------------------------------------------
+    check_nml_dtime(nmlgen, case)
+    check_nml_general(nmlgen)
+    check_nml_performance(nmlgen)
+    check_nml_history(nmlgen)
+    check_nml_initial_conditions(nmlgen, case, inst_string)
+    check_nml_data(nmlgen, case)
+
+    # ----------------------------------------------------
+    # Write output namelist
+    # ----------------------------------------------------
+    logger.info("Write namelists")
+    namelist_file = os.path.join(confdir, "lnd_in")
+    nmlgen.write_output_file(
+        namelist_file,
+        data_list_path,
+        groups=[
+            "slim_inparm",
+            "slim_data_and_initial",
+            "slim_history",
+            "slim_perf",
+            "finidat_consistency_checks",
+        ],
+    )
+
+
+###############################################################################
+def buildnml(case, caseroot, compname):
+    ###############################################################################
+    """Build the slim namelist"""
+    # pylint: disable=global-statement
+    global logger
+
+    # Build the component namelist
+    if compname != "slim":
+        logger.error("compname = %s", compname)
+        raise AttributeError
+
+    lnd_root = case.get_value("COMP_ROOT_DIR_LND")
+
+    # -----------------------------------------------------
+    # Clear out old data
+    # -----------------------------------------------------
+
+    input_data_list = os.path.join(caseroot, "Buildconf", "slim.input_data_list")
+    if os.path.exists(input_data_list):
+        os.remove(input_data_list)
+
+    # -----------------------------------------------------
+    # Set confdir
+    # -----------------------------------------------------
+
+    confdir = os.path.join(caseroot, "Buildconf", "slimconf")
+    if not os.path.isdir(confdir):
+        os.makedirs(confdir)
+
+    # namelist definition file
+    namelist_xml_dir = os.path.join(lnd_root, "cime_config")
+    definition_file = [os.path.join(namelist_xml_dir, "namelist_definition_slim.xml")]
+    for file_ in definition_file:
+        expect(os.path.isfile(file_), "Namelist XML file %s not found!" % file_)
+
+    # Create the namelist generator object - independent of instance
+    nmlgen = NamelistGenerator(case, definition_file)
+
+    # ----------------------------------------------------
+    # Clear out old data list
+    # ----------------------------------------------------
+    data_list_path = os.path.join(case.get_case_root(), "Buildconf", "slim.input_data_list")
+    if os.path.exists(data_list_path):
+        os.remove(data_list_path)
+
+    ### Independent of instance...
+    rundir = case.get_value("RUNDIR")
+
+    # -----------------------------------------------------
+    # loop over instances
+    # -----------------------------------------------------
+
+    ninst_lnd = case.get_value("NINST_LND")
+    ninst = int(ninst_lnd)
+    for inst_counter in range(1, ninst + 1):
+
+        # determine instance string
+        inst_string = ""
+        if ninst > 1:
+            inst_string = "_" + "%04d" % inst_counter
+
+        # If multi-instance case does not have restart file, use
+        # single-case restart for each instance
+        rpointer = "rpointer.lnd"
+        if os.path.isfile(os.path.join(rundir, rpointer)) and (
+            not os.path.isfile(os.path.join(rundir, rpointer + inst_string))
+        ):
+            shutil.copy(
+                os.path.join(rundir, rpointer),
+                os.path.join(rundir, rpointer + inst_string),
+            )
+        ###
+        ### Namelist infile
+        ###
+        infile_lines = []
+
+        user_nl_file = os.path.join(caseroot, "user_nl_slim" + inst_string)
+        infile = os.path.join(confdir, "namelist_infile")
+
+        create_namelist_infile(case, user_nl_file, infile, "\n".join(infile_lines))
+        namelist_infile = [infile]
+
+        # create namelist
+        _create_namelists(case, confdir, inst_string, namelist_infile, nmlgen, data_list_path)
+        # -----------------------------------------------------
+        # copy resolved namelist to rundir
+        # -----------------------------------------------------
+        if os.path.isdir(rundir):
+            file1 = os.path.join(confdir, "lnd_in")
+            file2 = os.path.join(rundir, "lnd_in")
+            if ninst > 1:
+                file2 += inst_string
+            logger.debug("SLIM namelist copy: file1 %s file2 %s ", file1, file2)
+            shutil.copy(file1, file2)
diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml
index 23804416..2d940c46 100644
--- a/cime_config/testdefs/ExpectedTestFails.xml
+++ b/cime_config/testdefs/ExpectedTestFails.xml
@@ -29,6 +29,16 @@
 
   <!-- aux_slim test suite failures -->
 
+  <test name="ERS_Ld5.f10_f10_mg37.FLTHISTC5I5Slim.cheyenne_gnu.slim-default">
+    <phase name="SHAREDLIB_BUILD">
+      <status>FAIL</status>
+    </phase>
+  </test>
+  <test name="ERS_Ld5.f10_f10_mg37.FLTHISTC5I5Slim.cheyenne_intel.slim-default">
+    <phase name="SHAREDLIB_BUILD">
+      <status>FAIL</status>
+    </phase>
+  </test>
   <test name="SMS_PS.f19_f19_mg17.I2000SlimRsGs.cheyenne_intel.slim-global_uniform">
     <phase name="RUN">
       <status>FAIL</status>
diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_slim.xml
similarity index 100%
rename from cime_config/testdefs/testlist_clm.xml
rename to cime_config/testdefs/testlist_slim.xml
diff --git a/cime_config/testdefs/testmods_dirs/slim/2000_CMIP6_AMIP_1deg_ensemble_FHistMonthly/include_user_mods b/cime_config/testdefs/testmods_dirs/slim/2000_CMIP6_AMIP_1deg_ensemble_FHistMonthly/include_user_mods
new file mode 100644
index 00000000..7aeecdf4
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/slim/2000_CMIP6_AMIP_1deg_ensemble_FHistMonthly/include_user_mods
@@ -0,0 +1,2 @@
+../Monthly
+../2000_CMIP6_AMIP_1deg_ensemble
diff --git a/cime_config/testdefs/testmods_dirs/slim/2000_CMIP6_AMIP_ensemble/shell_commands b/cime_config/testdefs/testmods_dirs/slim/2000_CMIP6_AMIP_ensemble/shell_commands
index 5d354486..f3a1a014 100755
--- a/cime_config/testdefs/testmods_dirs/slim/2000_CMIP6_AMIP_ensemble/shell_commands
+++ b/cime_config/testdefs/testmods_dirs/slim/2000_CMIP6_AMIP_ensemble/shell_commands
@@ -1,2 +1,2 @@
 #!/bin/bash
-./xmlchange CLM_FORCE_COLDSTART="on"
+./xmlchange SLIM_START_TYPE="cold"
diff --git a/cime_config/testdefs/testmods_dirs/slim/2000_CMIP6_AMIP_ensemble/user_nl_clm b/cime_config/testdefs/testmods_dirs/slim/2000_CMIP6_AMIP_ensemble/user_nl_slim
similarity index 100%
rename from cime_config/testdefs/testmods_dirs/slim/2000_CMIP6_AMIP_ensemble/user_nl_clm
rename to cime_config/testdefs/testmods_dirs/slim/2000_CMIP6_AMIP_ensemble/user_nl_slim
diff --git a/cime_config/testdefs/testmods_dirs/slim/Monthly/user_nl_clm b/cime_config/testdefs/testmods_dirs/slim/Monthly/user_nl_slim
similarity index 100%
rename from cime_config/testdefs/testmods_dirs/slim/Monthly/user_nl_clm
rename to cime_config/testdefs/testmods_dirs/slim/Monthly/user_nl_slim
diff --git a/cime_config/testdefs/testmods_dirs/slim/default/shell_commands b/cime_config/testdefs/testmods_dirs/slim/default/shell_commands
index b212e325..f3a1a014 100755
--- a/cime_config/testdefs/testmods_dirs/slim/default/shell_commands
+++ b/cime_config/testdefs/testmods_dirs/slim/default/shell_commands
@@ -1,4 +1,2 @@
 #!/bin/bash
-./xmlchange CLM_FORCE_COLDSTART="on"
-./xmlchange CLM_CO2_TYPE="constant"
-./xmlchange CCSM_CO2_PPMV="999.99"
+./xmlchange SLIM_START_TYPE="cold"
diff --git a/cime_config/testdefs/testmods_dirs/slim/default/user_nl_clm b/cime_config/testdefs/testmods_dirs/slim/default/user_nl_slim
similarity index 100%
rename from cime_config/testdefs/testmods_dirs/slim/default/user_nl_clm
rename to cime_config/testdefs/testmods_dirs/slim/default/user_nl_slim
diff --git a/cime_config/testdefs/testmods_dirs/slim/g16_SOM/shell_commands b/cime_config/testdefs/testmods_dirs/slim/g16_SOM/shell_commands
index b7909fce..1638132d 100755
--- a/cime_config/testdefs/testmods_dirs/slim/g16_SOM/shell_commands
+++ b/cime_config/testdefs/testmods_dirs/slim/g16_SOM/shell_commands
@@ -1,4 +1,3 @@
 #!/bin/bash
 CIMEROOT=`./xmlquery --value -s CIMEROOT`
 cp $CIMEROOT/../cime_config/testdefs/testmods_dirs/slim/g16_SOM/user_docn* .
-./xmlchange CLM_CO2_TYPE="diagnostic"
diff --git a/cime_config/testdefs/testmods_dirs/slim/global_uniform/include_user_mods b/cime_config/testdefs/testmods_dirs/slim/global_uniform/include_user_mods
index d243c2a4..fe0e18cf 100644
--- a/cime_config/testdefs/testmods_dirs/slim/global_uniform/include_user_mods
+++ b/cime_config/testdefs/testmods_dirs/slim/global_uniform/include_user_mods
@@ -1,2 +1 @@
 ../default
-../../../../usermods_dirs/global_uniform
diff --git a/cime_config/testdefs/testmods_dirs/slim/global_uniform/shell_commands b/cime_config/testdefs/testmods_dirs/slim/global_uniform/shell_commands
new file mode 100755
index 00000000..9c10e11c
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/slim/global_uniform/shell_commands
@@ -0,0 +1,2 @@
+#!/bin/bash
+./xmlchange SLIM_SCENARIO="global_uniform"
diff --git a/cime_config/testdefs/testmods_dirs/slim/global_uniform_g16_SOM/shell_commands b/cime_config/testdefs/testmods_dirs/slim/global_uniform_g16_SOM/shell_commands
deleted file mode 100755
index 626ff59f..00000000
--- a/cime_config/testdefs/testmods_dirs/slim/global_uniform_g16_SOM/shell_commands
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-./xmlchange CLM_CO2_TYPE="diagnostic"
diff --git a/cime_config/testdefs/testmods_dirs/slim/realistic_fromCLM5_1850/include_user_mods b/cime_config/testdefs/testmods_dirs/slim/realistic_fromCLM5_1850/include_user_mods
index ad975dc0..fe0e18cf 100644
--- a/cime_config/testdefs/testmods_dirs/slim/realistic_fromCLM5_1850/include_user_mods
+++ b/cime_config/testdefs/testmods_dirs/slim/realistic_fromCLM5_1850/include_user_mods
@@ -1,2 +1 @@
 ../default
-../../../../usermods_dirs/realistic_fromCLM5_1850
diff --git a/cime_config/testdefs/testmods_dirs/slim/realistic_fromCLM5_1850_g16_SOM_save_cplhist/shell_commands b/cime_config/testdefs/testmods_dirs/slim/realistic_fromCLM5_1850_g16_SOM_save_cplhist/shell_commands
deleted file mode 100755
index 626ff59f..00000000
--- a/cime_config/testdefs/testmods_dirs/slim/realistic_fromCLM5_1850_g16_SOM_save_cplhist/shell_commands
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-./xmlchange CLM_CO2_TYPE="diagnostic"
diff --git a/cime_config/testdefs/testmods_dirs/slim/save_cplhist/shell_commands b/cime_config/testdefs/testmods_dirs/slim/save_cplhist/shell_commands
deleted file mode 100755
index 626ff59f..00000000
--- a/cime_config/testdefs/testmods_dirs/slim/save_cplhist/shell_commands
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-./xmlchange CLM_CO2_TYPE="diagnostic"
diff --git a/cime_config/user_nl_slim b/cime_config/user_nl_slim
new file mode 100644
index 00000000..43893a6e
--- /dev/null
+++ b/cime_config/user_nl_slim
@@ -0,0 +1,13 @@
+!----------------------------------------------------------------------------------
+! Users should add all user specific namelist changes below in the form of 
+! namelist_var = new_namelist_value 
+!
+! EXCEPTIONS: 
+! Set dtime              with L_NCPL                             option
+! Set fatmlndfrc         with LND_DOMAIN_PATH/LND_DOMAIN_FILE    options
+! Set finidat            with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases
+!                        (includes $inst_string for multi-ensemble cases)
+!                        or with SLIM_START_TYPE=cold to do a cold start
+!                        or set it with an explicit filename here.
+!----------------------------------------------------------------------------------
+
diff --git a/cime_config/usermods_dirs/global_uniform/user_nl_clm b/cime_config/usermods_dirs/global_uniform/user_nl_clm
deleted file mode 100644
index f84c9987..00000000
--- a/cime_config/usermods_dirs/global_uniform/user_nl_clm
+++ /dev/null
@@ -1 +0,0 @@
-mml_surdat = '$DIN_LOC_ROOT/lnd/slim/surdat/globalconst_alpha0.2_soilcv2e6_hc0.1_rs100.0_glc_hc0.01_f19_cdf5_20211105.nc'
diff --git a/cime_config/usermods_dirs/realistic_fromCLM5_1850/user_nl_clm b/cime_config/usermods_dirs/realistic_fromCLM5_1850/user_nl_clm
deleted file mode 100644
index f7953f1f..00000000
--- a/cime_config/usermods_dirs/realistic_fromCLM5_1850/user_nl_clm
+++ /dev/null
@@ -1 +0,0 @@
-mml_surdat = '$DIN_LOC_ROOT/lnd/slim/surdat/slim_realistic_fromCLM5_alb1850_hc1850_rs1850_f19_20190110.nc'
diff --git a/cime_config/usermods_dirs/realistic_fromCLM5_2000/user_nl_clm b/cime_config/usermods_dirs/realistic_fromCLM5_2000/user_nl_clm
deleted file mode 100644
index 171aa345..00000000
--- a/cime_config/usermods_dirs/realistic_fromCLM5_2000/user_nl_clm
+++ /dev/null
@@ -1 +0,0 @@
-mml_surdat = '$DIN_LOC_ROOT/lnd/slim/surdat/slim2deg_fromCMIP6-AMIP-1deg_ensemble001-010_1991to2010clim_max-ctrl-bucket_rs150_c20210401.nc'
diff --git a/py_env_create b/py_env_create
new file mode 100755
index 00000000..648f1e70
--- /dev/null
+++ b/py_env_create
@@ -0,0 +1,136 @@
+#!/bin/bash
+#
+# py_env_create -- setup the python environment in order to use SLIM python tools
+#
+# Simple bash script to setup the python environment for the user so they can run the SLIM
+# python tools using "conda".
+#
+dir=${0%/*}
+if [ "$dir" = "$0" ];then
+  dir="."
+fi
+
+# Check if conda is in your path
+conda --help >& condahelp.txt
+error=$?
+if [ $error != 0 ]; then
+   echo "conda is NOT in your path for the bash shell add it with modules or whatever is required on your system to get it in your path"
+   echo "on cheyenne/capser/etc use -- module load conda"
+   echo "on izumi/CGD systems use -- module load lang/python"
+   echo "For notes on installing on a user system see: https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html"
+   echo "Error code was $error"
+   cat condahelp.txt
+   exit -1
+fi
+rm condahelp.txt
+python_env=slim_pylib
+
+
+condadir="$dir/python"
+
+domain=`domainname`
+if [[ $domain =~ cgd.* ]]; then
+   condafile="conda_env_slim_py_cgd.txt"
+else
+   condafile="conda_env_slim_py.txt"
+fi
+#----------------------------------------------------------------------
+# Usage subroutine
+usage() {
+  echo ""
+  echo "***********************************************************************"
+  echo "usage:"
+  echo "./py_env_create"
+  echo ""
+  echo "valid arguments: "
+  echo "[-h|--help]  "
+  echo "     Displays this help message"
+  echo "[-v|--verbose]  "
+  echo "     Run with verbose mode for the install so you see the progress bar"
+  echo "[-f|--file <file>]  "
+  echo "     Conda environment file to use (can be a text format or YAML format)"
+  echo "     Assumed to be under the directory: $condadir"
+  echo "     Default is: $condafile"
+  echo "[--option <option>]  "
+  echo "     Option(s) to pass to 'conda install' step"
+  echo "***********************************************************************"
+}
+
+verbose="No"
+option=""
+while [ $# -gt 0 ]; do
+   case $1 in
+       -h|--help )
+           usage
+           exit 0
+           ;;
+       -v|--verbose )
+           verbose="Yes"
+           ;;
+       -f|--file )
+           condafile=$2
+           shift
+           ;;
+       --option )
+           option=$2
+           shift
+           ;;
+       * )
+           echo "ERROR:: invalid argument sent in: $2"
+           usage
+           exit 1
+           ;;
+   esac
+   shift
+done
+
+if [ ! -f $condadir/$condafile ]; then
+   echo "$condadir/$condafile does NOT exist"
+   echo "Use the --file option with a valid filename"
+   exit -1
+fi
+
+echo "Use conda to install the python environment needed to run the SLIM python tools in the conda environment: $python_env"
+echo "Using the file: $condadir/$condafile"
+
+# Check if the environment already exists, if it does continue, if not create it
+conda list -n $python_env >& /dev/null
+if [ $? != 0 ]; then
+   echo "Create $python_env"
+   cmd="conda create --force -n $python_env -q"
+   echo "$cmd"
+   $cmd
+   if [ $? != 0 ]; then
+      echo "Error creating conda environment $python_env"
+      exit -1
+   fi
+else
+   echo "$python_env environment already exists"
+fi
+echo "Install $python_env this can take a long time, be patient...."
+verbosity="-q"
+if [ "$verbose" == "Yes" ]; then
+  verbosity="-v"
+fi
+cmd="conda install --yes $verbosity -c conda-forge -n $python_env --file $condadir/$condafile $option"
+echo "$cmd"
+$cmd
+if [ $? != 0 ]; then
+   echo "Trouble installing the $python_env python environment"
+   echo "There must be a problem in the $condadir/$condafile conda specification environment file"
+   echo "Change the file and try again"
+   if [[ $domain =~ cgd.* ]]; then
+       pythonpath=`which python`
+       echo
+       echo "On CGD systems you may need to do the following..."
+       echo "Create a bin subdirectory and then link the python version into it..."
+       echo "   mkdir $HOME/.conda/envs/$python_env/bin/"
+       echo "   ln -s $pythonpath $HOME/.conda/envs/$python_env/bin/python3.7"
+       echo
+   fi
+   exit -2
+fi
+echo "Successfully installed the $python_env python environment"
+echo
+echo "activate the environment by doing the following..."
+echo "conda activate $python_env"
diff --git a/python/Makefile b/python/Makefile
new file mode 100644
index 00000000..c747736f
--- /dev/null
+++ b/python/Makefile
@@ -0,0 +1,62 @@
+# Makefile for running tests on the python code here
+
+# These variables can be overridden from the command-line
+python = not-set
+verbose = not-set
+debug = not-set
+
+ifneq ($(python), not-set)
+    PYTHON=$(python)
+else
+    PYTHON=python3
+endif
+
+ifneq ($(debug), not-set)
+    TEST_ARGS+=--debug
+endif
+ifneq ($(verbose), not-set)
+    TEST_ARGS+=--verbose
+endif
+
+PYLINT=pylint
+PYLINT_ARGS=-j 4 --rcfile=slim/.pylintrc
+DIR_SRC = \
+	slim \
+	../cime_config/slim_cime_py
+
+all: lint black test
+test: utest stest
+
+.PHONY: utest
+utest: FORCE
+	$(PYTHON) ./run_slim_py_tests $(TEST_ARGS) --unit
+
+.PHONY: stest
+stest: FORCE
+	$(PYTHON) ./run_slim_py_tests $(TEST_ARGS) --sys
+
+.PHONY: lint
+lint: FORCE
+	$(PYLINT) $(PYLINT_ARGS) $(DIR_SRC)
+
+.PHONY: black
+# Run black check on all of the python files here and undeneath.
+# Should be identical to run_black option below, other than the --check option added in
+# Use the black configure file to explicitly set a few things and specifiy the exact files.
+black: FORCE
+	black --check --config pyproject.toml $(DIR_SRC)
+
+.PHONY: run_black
+# Run black on all of the python files here and undeneath -- CHANGING THE FILES!
+# Should be identical to above, other than the "--check" option is removed.
+# Use the black configure file to explicitly set a few things and specifiy the exact files.
+run_black: FORCE
+	black --config pyproject.toml $(DIR_SRC)
+
+
+.PHONY: clean
+clean: FORCE
+	find . -name '*.pyc' -exec rm {} \;
+
+FORCE:
+
diff --git a/python/README.md b/python/README.md
new file mode 100644
index 00000000..ca864cc5
--- /dev/null
+++ b/python/README.md
@@ -0,0 +1,41 @@
+# Testing the code here
+
+## Running everything
+
+To run all tests (unit tests, system tests and pylint), simply run `make
+all` from this directory.
+
+## Python environment
+
+use the "npl" conda environment on cheyenne
+
+## Unit and system tests
+
+Unit and system tests can be run in one of two ways; these do the same
+thing, but support different options:
+
+1. via `make test`
+
+   You can specify a few arguments to this:
+   
+   - python version: `make python=python3.9 test` (defaults to `python3`; you should expect errors if trying to run with python2)
+   - verbose: `make verbose=true test`
+   - debug: `make debug=true test`
+
+   Note that unit tests and system tests can be run separately with
+   `make utest` or `make stest`, or they can all be run with `make
+   test`.
+
+2. via `./run_slim_py_tests`
+
+   You can specify various arguments to this; run `./run_slim_py_tests
+   -h` for details
+
+## pylint
+
+You can run pylint on everything in the slim package with `make lint`.
+
+## black
+
+You can run black on everything in the slim package with `make black`.
+
diff --git a/python/conda_env_slim_py.txt b/python/conda_env_slim_py.txt
new file mode 100644
index 00000000..5f165b47
--- /dev/null
+++ b/python/conda_env_slim_py.txt
@@ -0,0 +1,11 @@
+#
+#  NOTE: Changes here should be coordinated with the cgd python environment file
+#
+# To install this on cheyenne with conda loaded in modules
+# use the top level bash script:
+# ../py_env_create                                           # Do this each time you update your CTSM Version
+# conda activate ctsm_pylib                                  # Do this anytime you want to run a CTSM python script
+#
+python=3.7.9
+pylint=2.8.3
+black=22.6.0
diff --git a/python/conda_env_slim_py_cgd.txt b/python/conda_env_slim_py_cgd.txt
new file mode 100644
index 00000000..0a2ff073
--- /dev/null
+++ b/python/conda_env_slim_py_cgd.txt
@@ -0,0 +1,12 @@
+# NOTE: This version is just for cgd.ucar.edu systems, where conda limits python to version 3.7.0
+#       See issue https://github.com/ESCOMP/CTSM/issues/1792
+#
+#       This should be coordinated with the main python environment file!
+#
+# To install this on cheyenne with conda loaded in modules
+# use the top level bash script:
+# ../py_env_create                                           # Do this each time you update your CTSM Version
+#
+python=3.7.0     # The python version MUST match the python version available on CGD systems through modules exactly
+pylint=2.8.3
+black=22.6.0
diff --git a/python/pyproject.toml b/python/pyproject.toml
new file mode 100644
index 00000000..e5abbcb6
--- /dev/null
+++ b/python/pyproject.toml
@@ -0,0 +1,13 @@
+#
+# This is a configuration file for python projects.
+# Sepcifically covering build system requirements.
+#
+# Here we are just using a couple options to specify the operation
+# of the python formatter "black".
+#
+[tool.black]
+
+   line-length = 100                              # This is the black default
+   target-version = ['py37']
+   include = '(run_slim_py_tests|\.py$)'          # Files to include
+   exclude = '(\.pylintrc|\.pyc)'                 # Files to explicitly exclude pylint file and compiled python
diff --git a/python/run_slim_py_tests b/python/run_slim_py_tests
new file mode 100755
index 00000000..e609b318
--- /dev/null
+++ b/python/run_slim_py_tests
@@ -0,0 +1,12 @@
+#!/usr/bin/env python3
+"""Driver for running the unit tests of the python code
+
+We use this rather than simply relying on 'python -m unittest discover' so we can do some
+initial setup, like configuring logging, before running the unit tests.
+"""
+
+from slim import add_cime_to_path
+from slim.run_slim_py_tests import main
+
+if __name__ == "__main__":
+    main(__doc__)
diff --git a/python/slim/.pylintrc b/python/slim/.pylintrc
new file mode 100644
index 00000000..0c65eee9
--- /dev/null
+++ b/python/slim/.pylintrc
@@ -0,0 +1,578 @@
+[MASTER]
+
+# A comma-separated list of package or module names from where C extensions may
+# be loaded. Extensions are loading into the active Python interpreter and may
+# run arbitrary code.
+extension-pkg-whitelist=
+
+# Add files or directories to the blacklist. They should be base names, not
+# paths.
+ignore=CVS
+
+# Add files or directories matching the regex patterns to the blacklist. The
+# regex matches against base names, not paths.
+ignore-patterns=
+
+# Python code to execute, usually for sys.path manipulation such as
+# pygtk.require().
+init-hook="import imp, os; imp.load_source('import_hook', os.path.join( "slim", 'import_hook.py'))"
+
+# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
+# number of processors available to use.
+jobs=1
+
+# Control the amount of potential inferred values when inferring a single
+# object. This can help the performance when dealing with large functions or
+# complex, nested conditions.
+limit-inference-results=100
+
+# List of plugins (as comma separated values of python modules names) to load,
+# usually to register additional checkers.
+load-plugins=
+
+# Pickle collected data for later comparisons.
+persistent=yes
+
+# Specify a configuration file.
+#rcfile=
+
+# When enabled, pylint would attempt to guess common misconfiguration and emit
+# user-friendly hints instead of false-positive error messages.
+suggestion-mode=yes
+
+# Allow loading of arbitrary C extensions. Extensions are imported into the
+# active Python interpreter and may run arbitrary code.
+unsafe-load-any-extension=no
+
+
+[MESSAGES CONTROL]
+
+# Only show warnings with the listed confidence levels. Leave empty to show
+# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED.
+confidence=
+
+# Disable the message, report, category or checker with the given id(s). You
+# can either give multiple identifiers separated by comma (,) or put this
+# option multiple times (only on the command line, not in the configuration
+# file where it should appear only once). You can also use "--disable=all" to
+# disable everything first and then reenable specific checks. For example, if
+# you want to run only the similarities checker, you can use "--disable=all
+# --enable=similarities". If you want to run only the classes checker, but have
+# no Warning level messages displayed, use "--disable=all --enable=classes
+# --disable=W".
+disable=print-statement,
+        parameter-unpacking,
+        unpacking-in-except,
+        old-raise-syntax,
+        backtick,
+        long-suffix,
+        old-ne-operator,
+        old-octal-literal,
+        import-star-module-level,
+        non-ascii-bytes-literal,
+        raw-checker-failed,
+        bad-inline-option,
+        locally-disabled,
+        locally-enabled,
+        file-ignored,
+        suppressed-message,
+        useless-suppression,
+        deprecated-pragma,
+        use-symbolic-message-instead,
+        apply-builtin,
+        basestring-builtin,
+        buffer-builtin,
+        cmp-builtin,
+        coerce-builtin,
+        execfile-builtin,
+        file-builtin,
+        long-builtin,
+        raw_input-builtin,
+        reduce-builtin,
+        standarderror-builtin,
+        unicode-builtin,
+        xrange-builtin,
+        coerce-method,
+        delslice-method,
+        getslice-method,
+        setslice-method,
+        no-absolute-import,
+        old-division,
+        dict-iter-method,
+        dict-view-method,
+        next-method-called,
+        metaclass-assignment,
+        indexing-exception,
+        raising-string,
+        reload-builtin,
+        oct-method,
+        hex-method,
+        nonzero-method,
+        cmp-method,
+        input-builtin,
+        round-builtin,
+        intern-builtin,
+        unichr-builtin,
+        map-builtin-not-iterating,
+        zip-builtin-not-iterating,
+        range-builtin-not-iterating,
+        filter-builtin-not-iterating,
+        using-cmp-argument,
+        eq-without-hash,
+        div-method,
+        idiv-method,
+        rdiv-method,
+        exception-message-attribute,
+        invalid-str-codec,
+        sys-max-int,
+        bad-python3-import,
+        deprecated-string-function,
+        deprecated-str-translate-call,
+        deprecated-itertools-function,
+        deprecated-types-field,
+        next-method-defined,
+        dict-items-not-iterating,
+        dict-keys-not-iterating,
+        dict-values-not-iterating,
+        deprecated-operator-function,
+        deprecated-urllib-function,
+        xreadlines-attribute,
+        deprecated-sys-function,
+        exception-escape,
+        comprehension-escape,
+        R0801,                         # This option to the end are options required to use black formatter
+        W1515,
+        W1514,
+        R1732,
+        C0209,
+        C0326,                         # This and the next are the two options that black documentation tells us to ignore
+        C0330,                         # This is an option that the formatter "black" requires us to disable
+# --- default list is above here, our own list is below here ---
+# While pylint's recommendations to keep the number of arguments, local
+# variables and branches low is generally a good one, I don't want it to
+# be enforced, because there are times when it's okay to break these:
+        too-many-arguments,
+        too-many-branches,
+        too-many-locals,
+# Allow inheriting from object for the sake of python 2/3 compatibility (we need explicit inheritance from object in python2 to give new-style classes):
+        useless-object-inheritance
+
+# Enable the message, report, category or checker with the given id(s). You can
+# either give multiple identifier separated by comma (,) or put this option
+# multiple time (only on the command line, not in the configuration file where
+# it should appear only once). See also the "--disable" option for examples.
+enable=c-extension-no-member
+
+
+[REPORTS]
+
+# Python expression which should return a note less than 10 (10 is the highest
+# note). You have access to the variables errors warning, statement which
+# respectively contain the number of errors / warnings messages and the total
+# number of statements analyzed. This is used by the global evaluation report
+# (RP0004).
+evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
+
+# Template used to display messages. This is a python new-style format string
+# used to format the message information. See doc for all details.
+#msg-template=
+
+# Set the output format. Available formats are text, parseable, colorized, json
+# and msvs (visual studio). You can also give a reporter class, e.g.
+# mypackage.mymodule.MyReporterClass.
+output-format=text
+
+# Tells whether to display a full report or only the messages.
+reports=no
+
+# Activate the evaluation score.
+score=yes
+
+
+[REFACTORING]
+
+# Maximum number of nested blocks for function / method body
+max-nested-blocks=5
+
+# Complete name of functions that never returns. When checking for
+# inconsistent-return-statements if a never returning function is called then
+# it will be considered as an explicit return statement and no message will be
+# printed.
+never-returning-functions=sys.exit
+
+
+[LOGGING]
+
+# Logging modules to check that the string format arguments are in logging
+# function parameter format.
+logging-modules=logging
+
+
+[SPELLING]
+
+# Limits count of emitted suggestions for spelling mistakes.
+max-spelling-suggestions=4
+
+# Spelling dictionary name. Available dictionaries: none. To make it working
+# install python-enchant package..
+spelling-dict=
+
+# List of comma separated words that should not be checked.
+spelling-ignore-words=
+
+# A path to a file that contains private dictionary; one word per line.
+spelling-private-dict-file=
+
+# Tells whether to store unknown words to indicated private dictionary in
+# --spelling-private-dict-file option instead of raising a message.
+spelling-store-unknown-words=no
+
+
+[MISCELLANEOUS]
+
+# List of note tags to take in consideration, separated by a comma.
+notes=FIXME,
+      XXX
+# Removing TODO so we can use that to note long-term to do items
+      # TODO
+
+
+[TYPECHECK]
+
+# List of decorators that produce context managers, such as
+# contextlib.contextmanager. Add to this list to register other decorators that
+# produce valid context managers.
+contextmanager-decorators=contextlib.contextmanager
+
+# List of members which are set dynamically and missed by pylint inference
+# system, and so shouldn't trigger E1101 when accessed. Python regular
+# expressions are accepted.
+generated-members=
+
+# Tells whether missing members accessed in mixin class should be ignored. A
+# mixin class is detected if its name ends with "mixin" (case insensitive).
+ignore-mixin-members=yes
+
+# Tells whether to warn about missing members when the owner of the attribute
+# is inferred to be None.
+ignore-none=yes
+
+# This flag controls whether pylint should warn about no-member and similar
+# checks whenever an opaque object is returned when inferring. The inference
+# can return multiple potential results while evaluating a Python object, but
+# some branches might not be evaluated, which results in partial inference. In
+# that case, it might be useful to still emit no-member and other checks for
+# the rest of the inferred objects.
+ignore-on-opaque-inference=yes
+
+# List of class names for which member attributes should not be checked (useful
+# for classes with dynamically set attributes). This supports the use of
+# qualified names.
+ignored-classes=optparse.Values,thread._local,_thread._local
+
+# List of module names for which member attributes should not be checked
+# (useful for modules/projects where namespaces are manipulated during runtime
+# and thus existing member attributes cannot be deduced by static analysis. It
+# supports qualified module names, as well as Unix pattern matching.
+ignored-modules=
+
+# Show a hint with possible names when a member name was not found. The aspect
+# of finding the hint is based on edit distance.
+missing-member-hint=yes
+
+# The minimum edit distance a name should have in order to be considered a
+# similar match for a missing member name.
+missing-member-hint-distance=1
+
+# The total number of similar names that should be taken in consideration when
+# showing a hint for a missing member.
+missing-member-max-choices=1
+
+
+[VARIABLES]
+
+# List of additional names supposed to be defined in builtins. Remember that
+# you should avoid to define new builtins when possible.
+additional-builtins=
+
+# Tells whether unused global variables should be treated as a violation.
+allow-global-unused-variables=yes
+
+# List of strings which can identify a callback function by name. A callback
+# name must start or end with one of those strings.
+callbacks=cb_,
+          _cb
+
+# A regular expression matching the name of dummy variables (i.e. expected to
+# not be used).
+dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
+
+# Argument names that match this expression will be ignored. Default to name
+# with leading underscore.
+ignored-argument-names=_.*|^ignored_|^unused_
+
+# Tells whether we should check for unused import in __init__ files.
+init-import=no
+
+# List of qualified module names which can have objects that can redefine
+# builtins.
+redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
+
+
+[FORMAT]
+
+# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
+expected-line-ending-format=
+
+# Regexp for a line that is allowed to be longer than the limit.
+ignore-long-lines=^\s*(# )?<?https?://\S+>?$
+
+# Number of spaces of indent required inside a hanging  or continued line.
+indent-after-paren=4
+
+# String used as indentation unit. This is usually "    " (4 spaces) or "\t" (1
+# tab).
+indent-string='    '
+
+# Maximum number of characters on a single line.
+max-line-length=100       # Make sure this agrees with black
+
+# Maximum number of lines in a module.
+max-module-lines=1000
+
+# List of optional constructs for which whitespace checking is disabled. `dict-
+# separator` is used to allow tabulation in dicts, etc.: {1  : 1,\n222: 2}.
+# `trailing-comma` allows a space between comma and closing bracket: (a, ).
+# `empty-line` allows space-only lines.
+no-space-check=trailing-comma,
+               dict-separator
+
+# Allow the body of a class to be on the same line as the declaration if body
+# contains single statement.
+single-line-class-stmt=no
+
+# Allow the body of an if to be on the same line as the test if there is no
+# else.
+single-line-if-stmt=no
+
+
+[SIMILARITIES]
+
+# Ignore comments when computing similarities.
+ignore-comments=yes
+
+# Ignore docstrings when computing similarities.
+ignore-docstrings=yes
+
+# Ignore imports when computing similarities.
+ignore-imports=no
+
+# Minimum lines number of a similarity.
+min-similarity-lines=4
+
+
+[BASIC]
+
+# Naming style matching correct argument names.
+argument-naming-style=snake_case
+
+# Regular expression matching correct argument names. Overrides argument-
+# naming-style.
+#argument-rgx=
+
+# Naming style matching correct attribute names.
+attr-naming-style=snake_case
+
+# Regular expression matching correct attribute names. Overrides attr-naming-
+# style.
+#attr-rgx=
+
+# Bad variable names which should always be refused, separated by a comma.
+bad-names=foo,
+          bar,
+          baz,
+          toto,
+          tutu,
+          tata
+
+# Naming style matching correct class attribute names.
+class-attribute-naming-style=any
+
+# Regular expression matching correct class attribute names. Overrides class-
+# attribute-naming-style.
+#class-attribute-rgx=
+
+# Naming style matching correct class names.
+class-naming-style=PascalCase
+
+# Regular expression matching correct class names. Overrides class-naming-
+# style.
+#class-rgx=
+
+# Naming style matching correct constant names.
+const-naming-style=UPPER_CASE
+
+# Regular expression matching correct constant names. Overrides const-naming-
+# style.
+#const-rgx=
+
+# Minimum line length for functions/classes that require docstrings, shorter
+# ones are exempt.
+docstring-min-length=-1
+
+# Naming style matching correct function names.
+function-naming-style=snake_case
+
+# Regular expression matching correct function names. Overrides function-
+# naming-style.
+#function-rgx=
+
+# Good variable names which should always be accepted, separated by a comma.
+good-names=i,
+           j,
+           k,
+           ex,
+           Run,
+           _,
+# --- default list is above here, our own list is below here ---
+# Allow logger as a global name in each module, because this seems to follow general recommended convention:
+           logger
+
+# Include a hint for the correct naming format with invalid-name.
+include-naming-hint=no
+
+# Naming style matching correct inline iteration names.
+inlinevar-naming-style=any
+
+# Regular expression matching correct inline iteration names. Overrides
+# inlinevar-naming-style.
+#inlinevar-rgx=
+
+# Naming style matching correct method names.
+method-naming-style=snake_case
+
+# Regular expression matching correct method names. Overrides method-naming-
+# style.
+#method-rgx=
+
+# Naming style matching correct module names.
+module-naming-style=snake_case
+
+# Regular expression matching correct module names. Overrides module-naming-
+# style.
+#module-rgx=
+
+# Colon-delimited sets of names that determine each other's naming style when
+# the name regexes allow several styles.
+name-group=
+
+# Regular expression which should only match function or class names that do
+# not require a docstring.
+no-docstring-rgx=^_
+
+# List of decorators that produce properties, such as abc.abstractproperty. Add
+# to this list to register other decorators that produce valid properties.
+# These decorators are taken in consideration only for invalid-name.
+property-classes=abc.abstractproperty
+
+# Naming style matching correct variable names.
+variable-naming-style=snake_case
+
+# Regular expression matching correct variable names. Overrides variable-
+# naming-style.
+#variable-rgx=
+
+
+[IMPORTS]
+
+# Allow wildcard imports from modules that define __all__.
+allow-wildcard-with-all=no
+
+# Analyse import fallback blocks. This can be used to support both Python 2 and
+# 3 compatible code, which means that the block might have code that exists
+# only in one or another interpreter, leading to false positives when analysed.
+analyse-fallback-blocks=no
+
+# Deprecated modules which should not be used, separated by a comma.
+deprecated-modules=optparse,tkinter.tix
+
+# Create a graph of external dependencies in the given file (report RP0402 must
+# not be disabled).
+ext-import-graph=
+
+# Create a graph of every (i.e. internal and external) dependencies in the
+# given file (report RP0402 must not be disabled).
+import-graph=
+
+# Create a graph of internal dependencies in the given file (report RP0402 must
+# not be disabled).
+int-import-graph=
+
+# Force import order to recognize a module as part of the standard
+# compatibility libraries.
+known-standard-library=
+
+# Force import order to recognize a module as part of a third party library.
+known-third-party=enchant
+
+
+[CLASSES]
+
+# List of method names used to declare (i.e. assign) instance attributes.
+defining-attr-methods=__init__,
+                      __new__,
+                      setUp
+
+# List of member names, which should be excluded from the protected access
+# warning.
+exclude-protected=_asdict,
+                  _fields,
+                  _replace,
+                  _source,
+                  _make
+
+# List of valid names for the first argument in a class method.
+valid-classmethod-first-arg=cls
+
+# List of valid names for the first argument in a metaclass class method.
+valid-metaclass-classmethod-first-arg=cls
+
+
+[DESIGN]
+
+# Maximum number of arguments for function / method.
+max-args=5
+
+# Maximum number of attributes for a class (see R0902).
+max-attributes=7
+
+# Maximum number of boolean expressions in an if statement.
+max-bool-expr=5
+
+# Maximum number of branch for function / method body.
+max-branches=12
+
+# Maximum number of locals for function / method body.
+max-locals=15
+
+# Maximum number of parents for a class (see R0901).
+max-parents=7
+
+# Maximum number of public methods for a class (see R0904).
+max-public-methods=20
+
+# Maximum number of return / yield for function / method body.
+max-returns=6
+
+# Maximum number of statements in function / method body.
+max-statements=50
+
+# Minimum number of public methods for a class (see R0903).
+min-public-methods=2
+
+
+[EXCEPTIONS]
+
+# Exceptions that will emit a warning when being caught. Defaults to
+# "Exception".
+overgeneral-exceptions=Exception
diff --git a/python/slim/__init__.py b/python/slim/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/python/slim/add_cime_to_path.py b/python/slim/add_cime_to_path.py
new file mode 100644
index 00000000..c5998889
--- /dev/null
+++ b/python/slim/add_cime_to_path.py
@@ -0,0 +1,26 @@
+"""Adds cime lib to path
+
+Any file that can potentially be run as a top-level script (with an if __name__ ==
+'__main__' block) that needs cime should import this. This includes unit test
+modules. However: see the NOTE at the bottom of this documentation.
+
+This should be the very first slim module imported. That way, cime will be added to your
+path before other imports. That is, your script should have:
+
+# Standard library imports go here
+# Then something like this:
+_SLIM_PYTHON = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'python')
+sys.path.insert(1, _SLIM_PYTHON)
+# Then:
+from slim import add_cime_to_path
+
+NOTE: For top-level scripts that either (a) want to pass some argument(s) to
+add_cime_lib_to_path, or (b) want to store the returned value from add_cime_lib_to_path:
+they should include copies of what's in this module (adding the appropriate argument(s)),
+rather than actually importing this module. So this module should be viewed as a
+convenience that can be used by scripts with simple needs, but does not need to be used.
+"""
+
+from slim.path_utils import add_cime_lib_to_path
+
+_ = add_cime_lib_to_path()
diff --git a/python/slim/add_slim_cime_py_to_path.py b/python/slim/add_slim_cime_py_to_path.py
new file mode 100644
index 00000000..824c4558
--- /dev/null
+++ b/python/slim/add_slim_cime_py_to_path.py
@@ -0,0 +1,17 @@
+"""Adds slim_cime_py lib to path
+
+Any file that can potentially be run as a top-level script (with an if __name__ ==
+'__main__' block) that needs slim_cime_py should import this. This includes unit test
+modules.
+
+This should be the very first slim module imported. That way, slim_cime_py will be added to your
+path before other imports. That is, your script should have:
+
+# Standard library imports go here
+# Then:
+from slim import add_slim_cime_py_to_path
+"""
+
+from slim.path_utils import add_slim_cime_pylib_to_path
+
+_ = add_slim_cime_pylib_to_path()
diff --git a/python/slim/import_hook.py b/python/slim/import_hook.py
new file mode 100644
index 00000000..955e6bae
--- /dev/null
+++ b/python/slim/import_hook.py
@@ -0,0 +1,7 @@
+# pylint: disable=missing-module-docstring
+import sys
+import os
+
+_CIMEROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "cime")
+_LIB_DIR = os.path.join(_CIMEROOT, "scripts", "lib")
+sys.path.append(_LIB_DIR)
diff --git a/python/slim/path_utils.py b/python/slim/path_utils.py
new file mode 100644
index 00000000..724be4f4
--- /dev/null
+++ b/python/slim/path_utils.py
@@ -0,0 +1,131 @@
+"""Utility functions related to getting paths to various important places
+"""
+
+from __future__ import print_function
+
+import os
+import sys
+
+# ========================================================================
+# Constants that may need to be changed if directory structures change
+# ========================================================================
+
+# Path to the root directory of SLIM, based on the path of this file
+#
+# Note: It's important that this NOT end with a trailing slash;
+# os.path.normpath guarantees this.
+_SLIM_ROOT = os.path.normpath(
+    os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir, os.pardir)
+)
+_SLIM_CIME_PY_ROOT = os.path.join(_SLIM_ROOT, "cime_config")
+
+# Candidates for the last path components to the SLIM directory within a
+# CESM checkout
+_CESM_SLIM_PATHS = [os.path.join("components", "slim")]
+
+# ========================================================================
+# Public functions
+# ========================================================================
+
+
+def path_to_slim_cime_py_root():
+    """Returns the path to the buildnml directory of SLIM"""
+    if not os.path.isdir(_SLIM_CIME_PY_ROOT):
+        raise RuntimeError("Cannot find cime_config within SLIM checkout")
+
+    return _SLIM_CIME_PY_ROOT
+
+
+def path_to_slim_root():
+    """Returns the path to the root directory of SLIM"""
+    return _SLIM_ROOT
+
+
+def path_to_cime(standalone_only=False):
+    """Returns the path to cime, if it can be found
+
+    Raises a RuntimeError if it cannot be found
+
+    We first check in the location where cime should be in a standalone
+    checkout. If standalone_only is True, then we ONLY look for cime in
+    that location. If standalone_only is False, then we fall back to
+    checking where cime should be in a full CESM checkout.
+    """
+    cime_standalone_path = os.path.join(path_to_slim_root(), "cime")
+    if os.path.isdir(cime_standalone_path):
+        return cime_standalone_path
+
+    if standalone_only:
+        raise RuntimeError("Cannot find cime within standalone SLIM checkout")
+
+    cesm_path = _path_to_cesm_root()
+    if cesm_path is None:
+        raise RuntimeError(
+            "Cannot find cime within standalone SLIM checkout, "
+            "and we don't seem to be within a CESM checkout."
+        )
+
+    cime_in_cesm_path = os.path.join(cesm_path, "cime")
+    if os.path.isdir(cime_in_cesm_path):
+        return cime_in_cesm_path
+
+    raise RuntimeError(
+        "Cannot find cime within standalone SLIM checkout, "
+        "or within CESM checkout rooted at {}".format(cesm_path)
+    )
+
+
+def prepend_to_python_path(path):
+    """Adds the given path to python's sys.path if it isn't already in the path
+
+    The path is added near the beginning, so that it takes precedence over existing
+    entries in the path
+    """
+    if not path in sys.path:
+        # Insert at location 1 rather than 0, because 0 is special
+        sys.path.insert(1, path)
+
+
+def add_cime_lib_to_path(standalone_only=False):
+    """Adds the CIME python library to the python path, to allow importing
+    modules from that library
+
+    Returns the path to the top-level cime directory
+
+    For documentation on standalone_only: See documentation in
+    path_to_cime
+    """
+    cime_path = path_to_cime(standalone_only=standalone_only)
+    cime_lib_path = os.path.join(cime_path, "scripts", "lib")
+    prepend_to_python_path(cime_lib_path)
+    cime_lib_path = os.path.join(cime_path, "scripts", "Tools")
+    prepend_to_python_path(cime_lib_path)
+    return cime_path
+
+
+def add_slim_cime_pylib_to_path():
+    """Adds the slime_cime_py python library to the python path
+
+    Returns the path to the top-level slim_cime_py directory
+    """
+    slim_cime_py_path = path_to_slim_cime_py_root()
+    prepend_to_python_path(slim_cime_py_path)
+    return slim_cime_py_path
+
+
+# ========================================================================
+# Private functions
+# ========================================================================
+
+
+def _path_to_cesm_root():
+    """Returns the path to the root directory of CESM, if we appear to
+    be inside a CESM checkout. If we don't appear to be inside a CESM
+    checkout, then returns None.
+    """
+    slim_root = path_to_slim_root()
+    for candidate_path in _CESM_SLIM_PATHS:
+        if slim_root.endswith(candidate_path):
+            return os.path.normpath(slim_root[: -len(candidate_path)])
+
+    return None
diff --git a/python/slim/run_slim_py_tests.py b/python/slim/run_slim_py_tests.py
new file mode 100644
index 00000000..491f7ad9
--- /dev/null
+++ b/python/slim/run_slim_py_tests.py
@@ -0,0 +1,83 @@
+"""Runner for the python unit tests defined here
+
+This is the main implementation of the run_slim_py_tests script contained in the
+parent directory
+"""
+
+import unittest
+import os
+import argparse
+import logging
+from slim import unit_testing
+
+logger = logging.getLogger(__name__)
+
+
+def main(description):
+    """Main function called when run_tests is run from the command-line
+
+    Args:
+    description (str): description printed to usage message
+    """
+    args = _commandline_args(description)
+    verbosity = _get_verbosity_level(args)
+
+    if args.pattern is not None:
+        pattern = args.pattern
+    elif args.unit:
+        pattern = "test_unit*.py"
+    elif args.sys:
+        pattern = "test_sys*.py"
+    else:
+        pattern = "test*.py"
+
+    # This setup_for_tests call is the main motivation for having this wrapper script to
+    # run the tests rather than just using 'python -m unittest discover'
+    unit_testing.setup_for_tests(enable_critical_logs=args.debug)
+
+    mydir = os.path.dirname(os.path.abspath(__file__))
+    testsuite = unittest.defaultTestLoader.discover(start_dir=mydir, pattern=pattern)
+    # NOTE(wjs, 2018-08-29) We may want to change the meaning of '--debug'
+    # vs. '--verbose': I could imagine having --verbose set buffer=False, and --debug
+    # additionally sets the logging level to much higher - e.g., debug level.
+    testrunner = unittest.TextTestRunner(buffer=(not args.debug), verbosity=verbosity)
+    testrunner.run(testsuite)
+
+
+def _commandline_args(description):
+    """Parse and return command-line arguments"""
+    parser = argparse.ArgumentParser(
+        description=description, formatter_class=argparse.RawTextHelpFormatter
+    )
+
+    output_level = parser.add_mutually_exclusive_group()
+
+    output_level.add_argument(
+        "-v", "--verbose", action="store_true", help="Run tests with more verbosity"
+    )
+
+    output_level.add_argument(
+        "-d", "--debug", action="store_true", help="Run tests with even more verbosity"
+    )
+
+    test_subset = parser.add_mutually_exclusive_group()
+
+    test_subset.add_argument("-u", "--unit", action="store_true", help="Only run unit tests")
+
+    test_subset.add_argument("-s", "--sys", action="store_true", help="Only run system tests")
+
+    test_subset.add_argument(
+        "-p", "--pattern", help="File name pattern to match\n" "Default is test*.py"
+    )
+
+    args = parser.parse_args()
+
+    return args
+
+
+def _get_verbosity_level(args):
+    if args.debug or args.verbose:
+        verbosity = 2
+    else:
+        verbosity = 1
+    return verbosity
diff --git a/python/slim/slim_logging.py b/python/slim/slim_logging.py
new file mode 100644
index 00000000..dcbc2531
--- /dev/null
+++ b/python/slim/slim_logging.py
@@ -0,0 +1,98 @@
+"""Utilities to facilitate logging
+
+A guide to logging in slim python scripts:
+
+- At the top of each module, you should have:
+  logger = logging.getLogger(__name__)
+
+- Logging should be done via that logger, NOT via logging.[whatever]
+
+- If you want to allow the user to control logging via command-line arguments, you should:
+
+  (1) At the very start of a script / application, call setup_logging_pre_config(). (We
+      need to initialize logging to avoid errors from logging calls made very early in the
+      script.)
+
+  (2) When setting up the argument parser, call add_logging_args(parser)
+
+  (3) After parsing arguments, call process_logging_args(args)
+
+- If you don't want to allow the user to control logging via command-line arguments, then
+  simply:
+
+  (1) At the very start of a script / application, call setup_logging() with the desired
+      arguments
+
+- In unit tests, to avoid messages about loggers not being set up, you should call
+  setup_logging_for_tests (this is typically done via unit_testing.setup_for_tests)
+"""
+
+import logging
+
+logger = logging.getLogger(__name__)
+
+
+def setup_logging_pre_config():
+    """Setup logging for a script / application
+
+    This function should be called at the very start of a script / application where you
+    intend to allow the user to control logging preferences via command-line arguments.
+
+    This sets initial options that may be changed later by process_logging_args.
+    """
+    setup_logging(level=logging.WARNING)
+
+
+def setup_logging_for_tests(enable_critical=False):
+    """Setup logging as appropriate for unit tests"""
+    setup_logging(level=logging.CRITICAL)
+    if not enable_critical:
+        logging.disable(logging.CRITICAL)
+
+
+def setup_logging(level=logging.WARNING):
+    """Setup logging for a script / application
+
+    This function should be called at the very start of a script / application where you
+    do NOT intend to allow the user to control logging preferences via command-line
+    arguments, so that all of the final logging options are set here.
+    """
+    logging.basicConfig(format="%(levelname)s: %(message)s", level=level)
+
+
+def add_logging_args(parser):
+    """Add common logging-related options to the argument parser"""
+
+    logging_level = parser.add_mutually_exclusive_group()
+
+    logging_level.add_argument(
+        "-v", "--verbose", action="store_true", help="Output extra logging info"
+    )
+
+    logging_level.add_argument(
+        "--debug",
+        action="store_true",
+        help="Output even more logging info for debugging",
+    )
+
+
+def process_logging_args(args):
+    """Configure logging based on the logging-related args added by add_logging_args"""
+    root_logger = logging.getLogger()
+
+    if args.debug:
+        root_logger.setLevel(logging.DEBUG)
+    elif args.verbose:
+        root_logger.setLevel(logging.INFO)
+    else:
+        root_logger.setLevel(logging.WARNING)
+
+
+def output_to_file(file_path, message, log_to_logger=False):
+    """
+    helper function to write to log file.
+    """
+    with open(file_path, "a") as log_file:
+        log_file.write(message)
+    if log_to_logger:
+        logger.info(message)
diff --git a/python/slim/test/README b/python/slim/test/README
new file mode 100644
index 00000000..2dc5ef53
--- /dev/null
+++ b/python/slim/test/README
@@ -0,0 +1,23 @@
+SLIM-specific boiler-plate needed for most unit test modules:
+
+(1) If cime stuff is invoked by these unit tests (directly or
+    indirectly, then: the first slim import statement near the top of
+    the module should be:
+
+from slim import add_cime_to_path # pylint: disable=unused-import
+
+(2) Import the slim-specific unit_testing module:
+
+from slim import unit_testing
+
+(3) Allow names that pylint doesn't like:
+
+# Allow names that pylint doesn't like, because otherwise I find it hard
+# to make readable unit test names
+# pylint: disable=invalid-name
+
+(4) Have a 'main' block at the bottom:
+
+if __name__ == '__main__':
+    unit_testing.setup_for_tests()
+    unittest.main()
diff --git a/python/slim/test/__init__.py b/python/slim/test/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/python/slim/test/test_sys_buildnml.py b/python/slim/test/test_sys_buildnml.py
new file mode 100755
index 00000000..ea438743
--- /dev/null
+++ b/python/slim/test/test_sys_buildnml.py
@@ -0,0 +1,285 @@
+#!/usr/bin/env python3
+
+"""System tests for buildnml
+"""
+
+import unittest
+import tempfile
+import shutil
+import os
+import re
+import logging
+
+from pathlib import Path
+
+from CIME.BuildTools.configure import FakeCase
+from CIME.utils import expect
+
+# pylint: disable=wrong-import-order,unused-import
+from slim import add_slim_cime_py_to_path
+from slim import unit_testing
+
+from slim_cime_py.buildnml import buildnml
+
+logger = logging.getLogger(__name__)
+
+# Allow names that pylint doesn't like, because otherwise I find it hard
+# to make readable unit test names
+# pylint: disable=invalid-name
+
+
+def getVariableFromNML(nmlfile, variable):
+    """Get a variable from the namelist file"""
+    with open(nmlfile, "r") as nfile:
+        for line in nfile:
+            if re.search(r"^\s*" + variable + r"\s*=", line) is not None:
+                print("lnd_in:" + line)
+                match = re.search(r'= ["]*([ a-zA-Z0-9._//-]+)["]*', line)
+                if match is not None:
+                    return match.group(1)
+                match = re.search(r"= [']*([ a-zA-Z0-9._//-]+)[']*", line)
+                if match is not None:
+                    return match.group(1)
+    return None
+
+
+def addLinesToUserNL(user_nl_file, lines):
+    """Add some lines to the user_nl_file for SLIM"""
+    if os.path.exists(user_nl_file):
+        os.remove(user_nl_file)
+    print("Add lines to " + user_nl_file)
+    with open(user_nl_file, "x") as userfile:
+        for line in lines:
+            userfile.write(line + "\n")
+            print(line)
+    userfile.close()
+    print("Close file")
+
+
+class TestBuildNML(unittest.TestCase):
+    """System Tests of buildnml"""
+
+    def setUp(self):
+        """Initialize"""
+        self._testdir = tempfile.mkdtemp()
+        self.curdir = os.getcwd()
+        os.chdir(self._testdir)
+        # namelist definition file
+        lnd_root = os.path.normpath(
+            os.path.join(
+                os.path.dirname(os.path.abspath(__file__)), os.pardir, os.pardir, os.pardir
+            )
+        )
+        self.case = FakeCase(compiler=None, mpilib=None, debug=None)
+        self.case.set_value("CASEROOT", self._testdir)
+        self.case.set_value("COMPSET", "2000_DATM%GSWP3v1_SLIM_SICE_SOCN_SROF_SGLC_SWAV")
+        self.case.set_value("RUN_TYPE", "any")
+        self.case.set_value("RUN_STARTDATE", "2000-01-01")
+        self.case.set_value("RUN_REFCASE", "case.std")
+        self.case.set_value("RUN_REFDATE", "0001-01-01")
+        self.case.set_value("RUN_REFTOD", "00000")
+        self.case.set_value("RUN_REFDIR", "cesm2_init")
+        self.case.set_value("RUNDIR", ".")
+        self.case.set_value("CALENDAR", "NO_LEAP")
+        self.case.set_value("NINST_LND", 1)
+        self.case.set_value("NCPL_BASE_PERIOD", "day")
+        self.case.set_value("LND_NCPL", 48)
+        self.case.set_value("SLIM_SCENARIO", "global_uniform")
+        self.case.set_value("COMP_ROOT_DIR_LND", lnd_root)
+        self.case.set_value("DIN_LOC_ROOT", ".")
+        self.case.set_value("LND_DOMAIN_PATH", ".")
+        self.case.set_value("LND_DOMAIN_FILE", "domain.nc")
+        self.case.set_value("SLIM_START_TYPE", "cold")
+        self.case.set_value("LND_GRID", "1.9x2.5")
+
+    def tearDown(self):
+        """Finalize"""
+        os.chdir(self.curdir)
+        shutil.rmtree(self._testdir, ignore_errors=True)
+
+    def test_simple(self):
+        """Test a simple call of buildnml"""
+        for scenario in ("global_uniform", "realistic_from_1850", "realistic_from_2000"):
+            self.case.set_value("SLIM_SCENARIO", scenario)
+            buildnml(self.case, self._testdir, "slim")
+            expect(
+                os.path.isfile("Buildconf/slimconf/lnd_in"),
+                "Namelist file lnd_in should exist in Buildconf after running buildnml",
+            )
+            expect(
+                os.path.isfile("lnd_in"), "Namelist file lnd_in should exist after running buildnml"
+            )
+            expect(
+                os.path.isfile("Buildconf/slim.input_data_list"),
+                "Input data list file should exist after running buildnml",
+            )
+
+    def test_default_testmod(self):
+        """Test the default testmod options call of buildnml"""
+        lines = []
+        lines.append(
+            "mml_surdat='/glade/p/cesmdata/cseg/inputdata/lnd/slim/surdat/"
+            + "slim2deg_fromCMIP6-AMIP-1deg_ensemble001-010_1991to2010clim_max"
+            + "-ctrl-bucket_rs150_c20210401.nc'"
+        )
+        lines.append("hist_ndens     = 1")
+        lines.append("hist_nhtfrq    =-24")
+        lines.append("hist_mfilt     = 5")
+        lines.append("! Empty the default history tapes and just output the MML fields")
+        lines.append("hist_empty_htapes = .true.")
+        lines.append(
+            "hist_fincl1 = 'MML_snowmaskdepth', 'MML_evap_rs', 'MML_bucket_cap', 'MML_soiltype',"
+        )
+        lines.append(" 'MML_roughness', 'MML_fsds', 'MML_fsdsnd','MML_fsdsni',")
+        lines.append("'MML_fsdsvd', 'MML_fsdsvi', 'MML_lwdn', 'MML_zref', 'MML_tbot', 'MML_thref'")
+        lines.append(",'MML_qbot', 'MML_uref',")
+        lines.append("'MML_eref', 'MML_pbot', 'MML_psrf', 'MML_pco2', 'MML_rhomol', 'MML_rhoair'")
+        lines.append(", 'MML_cpair', 'MML_prec_liq',")
+        lines.append("'MML_prec_frz', 'MML_ts', 'MML_qs', 'MML_qa', 'MML_swabs', 'MML_fsr',")
+        lines.append(" 'MML_fsrnd', 'MML_fsrni',")
+        lines.append("'MML_fsrvd', 'MML_fsrvi', 'MML_snowmelt', 'MML_l2a_taux', 'MML_l2a_tauy',")
+        lines.append(" 'MML_lwup', 'MML_shflx', 'MML_lhflx',")
+        lines.append("'MML_gsoi', 'MML_gsnow', 'MML_evap', 'MML_ustar', 'MML_tstar', 'MML_qstar',")
+        lines.append(" 'MML_tvstar', 'MML_obu',")
+        lines.append("'MML_ram', 'MML_rah', 'MML_z0m', 'MML_z0h', 'MML_alb', 'MML_fsns',")
+        lines.append(" 'MML_flns', 'MML_maxice',")
+        lines.append("'MML_soilz', 'MML_soil_t', 'MML_soil_liq', 'MML_soil_ice', 'MML_dz',")
+        lines.append("'MML_zh', 'MML_tk', 'MML_tkh',")
+        lines.append("'MML_dtsoi', 'MML_cv', 'MML_water', 'MML_snow', 'MML_runoff',")
+        lines.append(" 'MML_l2a_tref2m', 'MML_l2a_qref2m', 'MML_l2a_uref10m',")
+        lines.append("'MML_diag1_1d', 'MML_diag2_1d', 'MML_diag3_1d', 'MML_diag1_2d',")
+        lines.append(" 'MML_diag2_2d', 'MML_diag3_2d', 'MML_q_excess',")
+        lines.append("'MML_lh_excess',")
+        lines.append("'MML_q_demand', 'MML_lh_demand', 'mml_err_h2o', 'mml_err_h2osno',")
+        lines.append("'mml_err_seb', 'mml_err_soi', 'mml_err_sol', 'WIND',")
+        lines.append("'THBOT', 'RAIN', 'SNOW', 'RH'")
+        addLinesToUserNL("user_nl_slim", lines)
+        buildnml(self.case, self._testdir, "slim")
+        expect(
+            os.path.isfile("Buildconf/slimconf/lnd_in"),
+            "Namelist file lnd_in should exist in Buildconf after running buildnml",
+        )
+        expect(os.path.isfile("lnd_in"), "Namelist file lnd_in should exist after running buildnml")
+        expect(
+            os.path.isfile("Buildconf/slim.input_data_list"),
+            "Input data list file should exist after running buildnml",
+        )
+
+    def test_hybrid_start(self):
+        """Test a hybrid startup call of buildnml"""
+        self.case.set_value("SLIM_START_TYPE", "required")
+        self.case.set_value("RUN_TYPE", "hybrid")
+        self.case.set_value("RUN_REFCASE", "TESTCASE")
+        self.case.set_value("RUN_REFDATE", "0001-01-01")
+        self.case.set_value("RUN_REFTOD", "00000")
+        Path("TESTCASE.slim.r.0001-01-01-00000.nc").touch()
+        buildnml(self.case, self._testdir, "slim")
+        expect(
+            os.path.isfile("Buildconf/slimconf/lnd_in"),
+            "Namelist file lnd_in should exist in Buildconf after running buildnml",
+        )
+        expect(os.path.isfile("lnd_in"), "Namelist file lnd_in should exist after running buildnml")
+        expect(
+            os.path.isfile("Buildconf/slim.input_data_list"),
+            "Input data list file should exist after running buildnml",
+        )
+        value = getVariableFromNML("lnd_in", "finidat")
+        self.assertEqual(
+            value, "TESTCASE.slim.r.0001-01-01-00000.nc", msg="finidat not set as expected"
+        )
+
+    def test_hybrid_start_override_cold(self):
+        """Test a hybrid startup call of buildnml where you override with a cold start"""
+        self.case.set_value("SLIM_START_TYPE", "required")
+        self.case.set_value("RUN_TYPE", "hybrid")
+        self.case.set_value("RUN_REFCASE", "TESTCASE")
+        self.case.set_value("RUN_REFDATE", "0001-01-01")
+        self.case.set_value("RUN_REFTOD", "00000")
+        Path("TESTCASE.slim.r.0001-01-01-00000.nc").touch()
+        self.case.set_value("SLIM_START_TYPE", "cold")  # Set start type to cold
+        buildnml(self.case, self._testdir, "slim")
+        expect(
+            os.path.isfile("Buildconf/slimconf/lnd_in"),
+            "Namelist file lnd_in should exist in Buildconf after running buildnml",
+        )
+        expect(os.path.isfile("lnd_in"), "Namelist file lnd_in should exist after running buildnml")
+        expect(
+            os.path.isfile("Buildconf/slim.input_data_list"),
+            "Input data list file should exist after running buildnml",
+        )
+        value = getVariableFromNML("lnd_in", "finidat")
+        self.assertEqual(value, " ", msg="finidat not set as expected")
+
+    def test_branch_start(self):
+        """Test a branch startup call of buildnml"""
+        self.case.set_value("SLIM_START_TYPE", "required")
+        self.case.set_value("RUN_TYPE", "branch")
+        self.case.set_value("RUN_REFCASE", "TESTCASE")
+        self.case.set_value("RUN_REFDATE", "0001-01-01")
+        self.case.set_value("RUN_REFTOD", "00000")
+        Path("TESTCASE.slim.r.0001-01-01-00000.nc").touch()
+        buildnml(self.case, self._testdir, "slim")
+        expect(
+            os.path.isfile("Buildconf/slimconf/lnd_in"),
+            "Namelist file lnd_in should exist in Buildconf after running buildnml",
+        )
+        expect(os.path.isfile("lnd_in"), "Namelist file lnd_in should exist after running buildnml")
+        expect(
+            os.path.isfile("Buildconf/slim.input_data_list"),
+            "Input data list file should exist after running buildnml",
+        )
+        value = getVariableFromNML("lnd_in", "nrevsn")
+        self.assertEqual(
+            value, "TESTCASE.slim.r.0001-01-01-00000.nc", msg="nrevsn not set as expected"
+        )
+
+    def test_start_types(self):
+        """Test start types of buildnml"""
+        # Cold start types
+        finidat = " "
+        lines = []
+        for stype in ("cold", "any", "required"):
+            print("Type: " + stype)
+            addLinesToUserNL("user_nl_slim", lines)
+
+            self.case.set_value("SLIM_START_TYPE", stype)
+            buildnml(self.case, self._testdir, "slim")
+            expect(
+                os.path.isfile("Buildconf/slimconf/lnd_in"),
+                "Namelist file lnd_in should exist in Buildconf after running buildnml",
+            )
+            expect(
+                os.path.isfile("lnd_in"), "Namelist file lnd_in should exist after running buildnml"
+            )
+            expect(
+                os.path.isfile("Buildconf/slim.input_data_list"),
+                "Input data list file should exist after running buildnml",
+            )
+            value = getVariableFromNML("lnd_in", "finidat")
+            self.assertEqual(value, finidat, msg="finidat not set as expected: type=" + stype)
+        stype = "required"
+        finidat = "TESTFINIDATFILENAME.nc"
+        Path(finidat).touch()
+        lines = ["finidat = '" + finidat + "'\n"]
+        print("Type: " + stype)
+        addLinesToUserNL("user_nl_slim", lines)
+
+        self.case.set_value("SLIM_START_TYPE", stype)
+        buildnml(self.case, self._testdir, "slim")
+        expect(
+            os.path.isfile("Buildconf/slimconf/lnd_in"),
+            "Namelist file lnd_in should exist in Buildconf after running buildnml",
+        )
+        expect(os.path.isfile("lnd_in"), "Namelist file lnd_in should exist after running buildnml")
+        expect(
+            os.path.isfile("Buildconf/slim.input_data_list"),
+            "Input data list file should exist after running buildnml",
+        )
+        value = getVariableFromNML("lnd_in", "finidat")
+        self.assertEqual(value, finidat, msg="finidat not set as expected")
+        os.remove("user_nl_slim")
+
+
+if __name__ == "__main__":
+    unit_testing.setup_for_tests()
+    unittest.main()
diff --git a/python/slim/test/test_unit_buildnml.py b/python/slim/test/test_unit_buildnml.py
new file mode 100755
index 00000000..5a2cd5d9
--- /dev/null
+++ b/python/slim/test/test_unit_buildnml.py
@@ -0,0 +1,498 @@
+#!/usr/bin/env python3
+
+"""Unit tests for buildnml
+"""
+
+import unittest
+import tempfile
+import shutil
+import os
+import logging
+
+from pathlib import Path
+
+from CIME.nmlgen import NamelistGenerator
+from CIME.BuildTools.configure import FakeCase
+from CIME.utils import expect
+
+# pylint: disable=wrong-import-order,unused-import
+from slim import add_slim_cime_py_to_path
+from slim import unit_testing
+from slim.slim_logging import setup_logging
+
+from slim_cime_py.buildnml import (
+    check_nml_dtime,
+    check_nml_performance,
+    check_nml_general,
+    check_nml_history,
+    check_nml_data,
+    check_nml_initial_conditions,
+)
+
+logger = logging.getLogger(__name__)
+
+# Allow names that pylint doesn't like, because otherwise I find it hard
+# to make readable unit test names
+# pylint: disable=invalid-name
+
+
+class TestPathUtils(unittest.TestCase):
+    # pylint: disable=too-many-public-methods
+    """Tests of buildnml"""
+
+    def setUp(self):
+        """Initialize"""
+        self._testdir = tempfile.mkdtemp()
+        self._pwd = os.getcwd()
+        # namelist definition file
+        lnd_root = os.path.normpath(
+            os.path.join(
+                os.path.dirname(os.path.abspath(__file__)), os.pardir, os.pardir, os.pardir
+            )
+        )
+        namelist_xml_dir = os.path.join(lnd_root, "cime_config")
+        self._definition_file = [os.path.join(namelist_xml_dir, "namelist_definition_slim.xml")]
+        for file_ in self._definition_file:
+            expect(os.path.isfile(file_), "Namelist XML file %s not found!" % file_)
+
+        setup_logging(logging.DEBUG)
+        os.chdir(self._testdir)
+        self.case = FakeCase(compiler=None, mpilib=None, debug=None)
+        self.case.set_value("RUNDIR", self._testdir)
+        self.case.set_value("RUN_TYPE", "startup")
+        self.case.set_value("RUN_STARTDATE", "2000-01-01")
+        self.case.set_value("RUN_REFCASE", "case.std")
+        self.case.set_value("RUN_REFDATE", "0001-01-01")
+        self.case.set_value("RUN_REFTOD", "00000")
+        self.case.set_value("RUN_REFDIR", "cesm2_init")
+        self.case.set_value("DIN_LOC_ROOT", ".")
+        self.case.set_value("CALENDAR", "NO_LEAP")
+        self.case.set_value("LND_DOMAIN_PATH", ".")
+        self.case.set_value("LND_DOMAIN_FILE", "domain.nc")
+        self.case.set_value("SLIM_SCENARIO", "global_uniform")
+        self.case.set_value("SLIM_START_TYPE", "any")
+        self.case.set_value("LND_GRID", "1.9x2.5")
+
+        self.InitNML()
+
+    def InitNML(self):
+        """Re initialize the Namelist"""
+
+        # Recreate the object so that it will start empty
+        self.nmlgen = NamelistGenerator(self.case, self._definition_file)
+        # ------------------------------------------------------
+        # Create config dictionary
+        # ------------------------------------------------------
+        self.config = {}
+        self.config["lnd_grid"] = self.case.get_value("LND_GRID")
+        self.config["slim_scenario"] = self.case.get_value("SLIM_SCENARIO")
+        self.config["slim_start_type"] = self.case.get_value("SLIM_START_TYPE")
+
+        # ------------------------------------------------------
+        # Initialize namelist defaults
+        # ------------------------------------------------------
+        self.nmlgen.init_defaults(infiles=[], config=self.config)
+
+    def tearDown(self):
+        """Finalize"""
+        shutil.rmtree(self._testdir, ignore_errors=True)
+        os.chdir(self._pwd)
+
+    def test_check_nml_performance(self):
+        """Test the check nml performance subroutine"""
+        self.nmlgen.set_value("nsegspc", 20)
+        check_nml_performance(self.nmlgen)
+        self.nmlgen.set_value("nsegspc", -1)
+        with self.assertRaisesRegex(SystemExit, "nsegspc must be positive"):
+            check_nml_performance(self.nmlgen)
+
+    def test_check_nml_history(self):
+        """Test the check nml history subroutine"""
+        self.nmlgen.set_value("hist_mfilt", [20])
+        check_nml_history(self.nmlgen)
+        self.nmlgen.set_value("hist_mfilt", [0])
+        with self.assertRaisesRegex(SystemExit, "hist_mfilt must be 1 or larger"):
+            check_nml_history(self.nmlgen)
+
+        self.InitNML()
+        # Make a list of settings to a list of history tape streams
+        self.nmlgen.set_value("use_noio", ".false.")
+        self.nmlgen.set_value("hist_empty_htapes", ".true.")
+        self.nmlgen.set_value("hist_mfilt", [1, 1, 2, 3, 4, 5])
+        self.nmlgen.set_value("hist_ndens", [1, 1, 2, 1, 1, 1])
+        self.nmlgen.set_value("hist_nhtfrq", [1, 1, -24, 2, 2, 2])
+        self.nmlgen.set_value("hist_avgflag_pertape", ["A", "I", "X", "M", "A", "A"])
+        self.nmlgen.set_value("hist_fincl1", ["A:I", "B:A", "C:X", "D:M", "E:A", "F:A"])
+        self.nmlgen.set_value("hist_fincl2", ["A", "B", "C", "D", "E", "F"])
+        self.nmlgen.set_value("hist_fincl3", ["A", "B", "C", "D", "E", "F"])
+        self.nmlgen.set_value("hist_fincl4", ["A", "B", "C", "D", "E", "F"])
+        self.nmlgen.set_value("hist_fincl5", ["A", "B", "C", "D", "E", "F"])
+        self.nmlgen.set_value("hist_fincl6", ["A", "B", "C", "D", "E", "F"])
+        check_nml_history(self.nmlgen)
+        # and another complex case
+        self.InitNML()
+        self.nmlgen.set_value("hist_empty_htapes", ".false.")
+        self.nmlgen.set_value("hist_fexcl1", ["A", "B", "C", "D", "E", "F"])
+        check_nml_history(self.nmlgen)
+        # Check that use_noio works if you don't set any hist_* options
+        self.InitNML()
+        self.nmlgen.set_value("use_noio", ".true.")
+        check_nml_history(self.nmlgen)
+
+    def test_check_nml_history_simple_fails_bad_timeavg(self):
+        """Test the check nml history subroutine for simple fails bad time avg"""
+        self.nmlgen.set_value("hist_fincl1", ["A:Z"])
+        with self.assertRaisesRegex(
+            SystemExit, "History averaging option Z is not valid in hist_fincl1"
+        ):
+            check_nml_history(self.nmlgen)
+
+    def test_check_nml_history_simple_fails_bad_characters(self):
+        """Test the check nml history subroutine for simple fails bad characters in field"""
+        self.nmlgen.set_value("hist_fincl1", ["A%$#@!~"])
+        with self.assertRaisesRegex(
+            SystemExit,
+            r"History field name hist_fincl1 has invalid characters or whitespace in it=",
+        ):
+            check_nml_history(self.nmlgen)
+
+    def test_check_nml_history_simple_fails_white_space_in_field(self):
+        """Test the check nml history subroutine for simple fails bad characters in field"""
+        self.nmlgen.set_value("hist_fincl1", [" "])
+        with self.assertRaisesRegex(
+            SystemExit,
+            r"History field name hist_fincl1 has invalid characters or whitespace in it=",
+        ):
+            check_nml_history(self.nmlgen)
+
+    def test_check_nml_history_complex_fails_array_size_not_consistent(self):
+        """Test the check nml history subroutine for complex fails array size not consistent"""
+        self.nmlgen.set_value("hist_mfilt", [1])
+        self.nmlgen.set_value("hist_ndens", [1, 1])
+        self.nmlgen.set_value("hist_fincl2", ["A"])
+        with self.assertRaisesRegex(
+            SystemExit, r"hist_mfilt array size does not agree with the expected size of 2"
+        ):
+            check_nml_history(self.nmlgen)
+
+    def test_check_nml_history_complex_fails_array_size(self):
+        """Test the check nml history subroutine for complex fails array size"""
+        self.nmlgen.set_value("hist_mfilt", [1, 1, 1, 1, 1, 1, 1])
+        self.nmlgen.set_value("hist_fincl2", ["A"])
+        self.nmlgen.set_value("hist_fincl3", ["A"])
+        self.nmlgen.set_value("hist_fincl4", ["A"])
+        self.nmlgen.set_value("hist_fincl5", ["A"])
+        self.nmlgen.set_value("hist_fincl6", ["A"])
+        with self.assertRaisesRegex(
+            SystemExit, r"hist_mfilt array size does not agree with the expected size of 6"
+        ):
+            check_nml_history(self.nmlgen)
+
+    def test_check_nml_history_complex_fails_excl_with_empty(self):
+        """Test the check nml history subroutine for complex fails exclude used with
+        empty history
+        """
+        self.nmlgen.set_value("hist_empty_htapes", ".true.")
+        self.nmlgen.set_value("hist_fexcl1", ["A"])
+        with self.assertRaisesRegex(
+            SystemExit, "hist_fexcl1 can not be set if hist_empty_htapes is set to true"
+        ):
+            check_nml_history(self.nmlgen)
+
+    def test_check_nml_history_fails_excl_use_noio(self):
+        """Test the check nml history subroutine for fails use_noio used with other
+        history settings
+        """
+        self.nmlgen.set_value("use_noio", ".true.")
+        self.nmlgen.set_value("hist_fincl1", ["A"])
+        with self.assertRaisesRegex(
+            SystemExit,
+            r"use_noio turns off all history output"
+            + ", so no hist_ namelist option should also be set.*",
+        ):
+            check_nml_history(self.nmlgen)
+
+    def test_check_nml_general(self):
+        """Test the check nml general subroutine"""
+        self.case.set_value("SLIM_START_TYPE", "cold")
+        self.InitNML()
+        self.nmlgen.set_value("res", self.case.get_value("LND_GRID"))
+        check_nml_general(self.nmlgen)
+        for var in ("slim_start_type", "res"):
+            val = self.nmlgen.get_value(var)
+            self.nmlgen.set_value(var, None)
+            with self.assertRaisesRegex(SystemExit, var + " must be set"):
+                check_nml_general(self.nmlgen)
+
+            self.nmlgen.set_value(var, val)
+
+    def test_check_nml_data(self):
+        """Test the check nml data subroutine"""
+        self.case.set_value("LND_GRID", "1.9x2.5")
+        self.nmlgen.set_value("res", self.case.get_value("LND_GRID"))
+        # Loop through the scenarios that we have datasets for
+        for scen in ("global_uniform", "realistic_from_1850", "realistic_from_2000"):
+            self.case.set_value("SLIM_SCENARIO", scen)
+            print("SLIM_SCENARIO = " + scen)
+            self.InitNML()
+            check_nml_data(self.nmlgen, self.case)
+        # 1-degree has one dataset
+        self.case.set_value("LND_GRID", "0.9x1.25")
+        self.case.set_value("SLIM_SCENARIO", "realistic_from_2000")
+        self.InitNML()
+        check_nml_data(self.nmlgen, self.case)
+        # Check that 1-degree for another scenario fails
+        self.case.set_value("SLIM_SCENARIO", "global_uniform")
+        self.InitNML()
+        with self.assertRaisesRegex(SystemExit, " file is NOT set and is required"):
+            check_nml_data(self.nmlgen, self.case)
+
+        # make the dataset unset and make sure it fails
+        var = "mml_surdat"
+        self.nmlgen.set_value(var, "UNSET")
+        with self.assertRaisesRegex(SystemExit, var + " file is NOT set and is required"):
+            check_nml_data(self.nmlgen, self.case)
+
+    def test_check_init_data(self):
+        """Test the check nml initial data subroutine"""
+        check_nml_initial_conditions(self.nmlgen, self.case)
+
+        #
+        # Check that normal startup acts as expected
+        #
+        # A cold start should have a blank finidat file
+        self.case.set_value("SLIM_START_TYPE", "cold")
+        self.InitNML()
+        check_nml_initial_conditions(self.nmlgen, self.case)
+        val = self.nmlgen.get_value("finidat")
+        expect("' '", val)
+        # If you have a cold-start and explicitly set the finidat file that should error out
+        self.nmlgen.set_value("finidat", "file_is_set.nc")
+        with self.assertRaisesRegex(
+            SystemExit, "finidat is set but SLIM_START_TYPE is cold which is a contradiction"
+        ):
+            check_nml_initial_conditions(self.nmlgen, self.case)
+        # Set to startup so that finidat is required
+        self.case.set_value("SLIM_START_TYPE", "startup")
+        self.InitNML()
+        self.nmlgen.set_value("finidat", "file_is_set.nc")
+        Path("file_is_set.nc").touch()
+        check_nml_initial_conditions(self.nmlgen, self.case)
+        # Don't set the IC file, so make sure it aborts
+        self.nmlgen.set_value("finidat", "UNSET")
+        check_nml_initial_conditions(self.nmlgen, self.case)
+        # Make sure nrevsn can't be set
+        self.nmlgen.set_value("nrevsn", "file_is_set.nc")
+        with self.assertRaisesRegex(
+            SystemExit, "nrevsn can NOT be set except when RUN_TYPE is a branch"
+        ):
+            check_nml_initial_conditions(self.nmlgen, self.case)
+
+    def test_check_set_user_defined(self):
+        """Test the check nml initial data subroutine for user_defined"""
+        self.case.set_value("SLIM_SCENARIO", "user_defined")
+        self.InitNML()
+        with self.assertRaisesRegex(
+            SystemExit, "When SLIM_SCENARIO is set to user_defined, you must provide the mml_surdat"
+        ):
+            check_nml_data(self.nmlgen, self.case)
+
+    def test_check_use_init_interp(self):
+        """Test the check nml initial data subroutine for use_init_interp options"""
+        self.case.set_value("SLIM_START_TYPE", "startup")
+        finidat = "finidat_file_to_interpolate_from.nc"
+        self.nmlgen.set_value("finidat", finidat)
+        Path(finidat).touch()
+        self.nmlgen.set_value("use_init_interp", ".true.")
+        finidat_dest = "finidat_file_to_create.nc"
+        self.nmlgen.set_value("finidat_interp_dest", finidat_dest)
+        check_nml_initial_conditions(self.nmlgen, self.case)
+        check_nml_data(self.nmlgen, self.case)
+
+    def test_check_use_init_interp_fails_cold(self):
+        """Test the check nml initial data subroutine for use_init_interp options that fail 1"""
+        # Cold start with use_init_interp should fail
+        self.case.set_value("SLIM_START_TYPE", "cold")
+        self.nmlgen.set_value("use_init_interp", ".true.")
+        check_nml_initial_conditions(self.nmlgen, self.case)
+        with self.assertRaisesRegex(
+            SystemExit, "use_init_interp can not be set to TRUE for a cold start"
+        ):
+            check_nml_data(self.nmlgen, self.case)
+
+    def test_check_use_init_interp_fails_setdest(self):
+        """Test the check nml initial data subroutine for use_init_interp options that fail 2"""
+        # Setting finidat_interp_dest without use_init_interp should fail
+        self.nmlgen.set_value("use_init_interp", ".false.")
+        finidat_dest = "finidat_file_to_create.nc"
+        self.nmlgen.set_value("finidat_interp_dest", finidat_dest)
+        check_nml_initial_conditions(self.nmlgen, self.case)
+        with self.assertRaisesRegex(
+            SystemExit, "finidat_interp_dest can NOT be set if use_init_interp is not on"
+        ):
+            check_nml_data(self.nmlgen, self.case)
+
+    def test_check_use_init_interp_fails_branch(self):
+        """Test the check nml initial data subroutine for use_init_interp options that fail 3"""
+        # Branch type should fail for use_init_interp set
+        self.case.set_value("RUN_TYPE", "branch")
+        self.case.set_value("SLIM_START_TYPE", "required")
+        self.case.set_value("RUN_REFCASE", "TESTCASE")
+        self.case.set_value("RUN_REFDATE", "0001-01-01")
+        nrevsn = "TESTCASE.slim.r.0001-01-01-00000.nc"
+        self.nmlgen.set_value("use_init_interp", ".true.")
+        Path(nrevsn).touch()
+        check_nml_initial_conditions(self.nmlgen, self.case)
+        with self.assertRaisesRegex(
+            SystemExit, "use_init_interp can NOT be set to TRUE for a branch run type"
+        ):
+            check_nml_data(self.nmlgen, self.case)
+
+    def test_check_init_data_branch(self):
+        """Test the check nml initial data subroutine for branch"""
+        #
+        # Check that a branch works correctly
+        #
+        self.case.set_value("RUN_TYPE", "branch")
+        self.case.set_value("SLIM_START_TYPE", "required")
+        self.case.set_value("RUN_REFCASE", "TESTCASE")
+        self.case.set_value("RUN_REFDATE", "0001-01-01")
+        nrevsn = "TESTCASE.slim.r.0001-01-01-00000.nc"
+        Path(nrevsn).touch()
+        self.InitNML()
+        check_nml_initial_conditions(self.nmlgen, self.case)
+        expect(
+            self.nmlgen.get_value("nrevsn"),
+            nrevsn,
+            "finidat should be set correctly for hybrid case",
+        )
+        # Make sure finidat can't be set
+        self.nmlgen.set_value("finidat", "file_is_set.nc")
+        with self.assertRaisesRegex(SystemExit, "finidat can NOT be set when RUN_TYPE is a branch"):
+            check_nml_initial_conditions(self.nmlgen, self.case)
+
+    def test_check_init_data_hybrid(self):
+        """Test the check nml initial data subroutine for hybrid"""
+        #
+        # Check that a hybrid works correctly
+        #
+        self.case.set_value("RUN_TYPE", "hybrid")
+        self.case.set_value("SLIM_START_TYPE", "required")
+        self.case.set_value("RUN_REFCASE", "TESTCASE")
+        self.case.set_value("RUN_REFDATE", "0001-01-01")
+        finidat = "TESTCASE.slim.r.0001-01-01-00000.nc"
+        Path(finidat).touch()
+        self.InitNML()
+        check_nml_initial_conditions(self.nmlgen, self.case)
+        expect(
+            self.nmlgen.get_value("finidat"),
+            finidat,
+            "finidat should be set correctly for hybrid case",
+        )
+
+    def test_check_dtime(self):
+        """Test the check nml dtime"""
+        self.case.set_value("NCPL_BASE_PERIOD", "hour")
+        self.case.set_value("CALENDAR", "GREGORIAN")
+        self.case.set_value("LND_NCPL", 1)
+        self.InitNML()
+        check_nml_dtime(self.nmlgen, self.case)
+        expect(
+            self.nmlgen.get_value("dtime"),
+            3600,
+            "dtime should be 3600 seconds for an hour",
+        )
+        self.case.set_value("NCPL_BASE_PERIOD", "day")
+        self.case.set_value("CALENDAR", "NO_LEAP")
+        self.case.set_value("LND_NCPL", 48)
+        self.InitNML()
+        check_nml_dtime(self.nmlgen, self.case)
+        expect(
+            self.nmlgen.get_value("dtime"),
+            1800,
+            "dtime should be 1800 seconds for 48 cycles per day",
+        )
+        self.case.set_value("NCPL_BASE_PERIOD", "year")
+        self.case.set_value("CALENDAR", "NO_LEAP")
+        self.case.set_value("LND_NCPL", 365)
+        self.InitNML()
+        check_nml_dtime(self.nmlgen, self.case)
+        expect(
+            self.nmlgen.get_value("dtime"),
+            86400,
+            "dtime should be 86400 seconds for 365 cycles per year",
+        )
+        self.case.set_value("NCPL_BASE_PERIOD", "year")
+        self.case.set_value("CALENDAR", "NO_LEAP")
+        self.case.set_value("LND_NCPL", 36500)
+        self.InitNML()
+        check_nml_dtime(self.nmlgen, self.case)
+        expect(
+            self.nmlgen.get_value("dtime"),
+            8640,
+            "dtime should be 8640 seconds for 36500 cycles per decade",
+        )
+
+    def test_check_dtime_fail_invalid_cal_year(self):
+        """Test the check nml dtime fail test for invalid calendar year"""
+        self.case.set_value("NCPL_BASE_PERIOD", "year")
+        self.case.set_value("CALENDAR", "GREGORIAN")
+        self.case.set_value("LND_NCPL", 1)
+        with self.assertRaisesRegex(
+            SystemExit, "ERROR: Invalid CALENDAR for NCPL_BASE_PERIOD year"
+        ):
+            check_nml_dtime(self.nmlgen, self.case)
+
+    def test_check_dtime_fail_invalid_cal_decade(self):
+        """Test the check nml dtime fail test for invalid calendar decade"""
+        self.case.set_value("NCPL_BASE_PERIOD", "decade")
+        self.case.set_value("CALENDAR", "GREGORIAN")
+        self.case.set_value("LND_NCPL", 1)
+        with self.assertRaisesRegex(
+            SystemExit, "ERROR: Invalid CALENDAR for NCPL_BASE_PERIOD decade"
+        ):
+            check_nml_dtime(self.nmlgen, self.case)
+
+    def test_check_dtime_fail_invalid_base_period(self):
+        """Test the check nml dtime fail test for invalid base period"""
+        self.case.set_value("NCPL_BASE_PERIOD", "minute")
+        self.case.set_value("CALENDAR", "GREGORIAN")
+        self.case.set_value("LND_NCPL", 1)
+        with self.assertRaisesRegex(SystemExit, "ERROR: Invalid NCPL_BASE_PERIOD "):
+            check_nml_dtime(self.nmlgen, self.case)
+
+    def test_check_dtime_fail_invalid_division(self):
+        """Test the check nml dtime fail test for invalid coupling division"""
+        self.case.set_value("NCPL_BASE_PERIOD", "day")
+        self.case.set_value("CALENDAR", "GREGORIAN")
+        self.case.set_value("LND_NCPL", 47)
+        with self.assertRaisesRegex(
+            SystemExit, "ERROR: LND_NCPL=47 doesn't divide evenly into NCPL_BASE_PERIOD day"
+        ):
+            check_nml_dtime(self.nmlgen, self.case)
+
+    def test_check_dtime_fail_too_short(self):
+        """Test the check nml dtime fail test for too short"""
+        self.case.set_value("NCPL_BASE_PERIOD", "hour")
+        self.case.set_value("LND_NCPL", 3600)
+        with self.assertRaisesRegex(
+            SystemExit,
+            "ERROR: LND_NCPL=3600 is too frequent which gives a time step that is too short",
+        ):
+            check_nml_dtime(self.nmlgen, self.case)
+
+    def test_check_dtime_fail_too_long(self):
+        """Test the check nml dtime fail test for too long"""
+        self.case.set_value("NCPL_BASE_PERIOD", "year")
+        self.case.set_value("CALENDAR", "NO_LEAP")
+        self.case.set_value("LND_NCPL", 5)
+        with self.assertRaisesRegex(
+            SystemExit,
+            "ERROR: LND_NCPL=5 is too infrequent which gives a time step that is too long",
+        ):
+            check_nml_dtime(self.nmlgen, self.case)
+
+
+if __name__ == "__main__":
+    unit_testing.setup_for_tests()
+    unittest.main()
diff --git a/python/slim/test/test_unit_path_utils.py b/python/slim/test/test_unit_path_utils.py
new file mode 100755
index 00000000..823bf109
--- /dev/null
+++ b/python/slim/test/test_unit_path_utils.py
@@ -0,0 +1,189 @@
+#!/usr/bin/env python3
+
+"""Unit tests for path_utils
+"""
+
+import unittest
+import tempfile
+import shutil
+import os
+
+from unittest import mock
+from slim import unit_testing
+from slim import path_utils
+
+# Allow names that pylint doesn't like, because otherwise I find it hard
+# to make readable unit test names
+# pylint: disable=invalid-name
+
+
+class TestPathUtils(unittest.TestCase):
+    """Tests of path_utils"""
+
+    def setUp(self):
+        self._testdir = tempfile.mkdtemp()
+
+    def tearDown(self):
+        shutil.rmtree(self._testdir, ignore_errors=True)
+
+    def _slim_cime_py_path_in_cesm(self):
+        """Returns the path to a cime_config directory inside a typical cesm
+        directory structure, where self._testdir is the root of cesm checkout
+        """
+        return os.path.join(self._slim_path_in_cesm(), "cime_config")
+
+    def _slim_path_in_cesm(self):
+        """Returns the path to a slim directory nested inside a typical cesm
+        directory structure, where self._testdir is the root of the cesm
+        checkout
+        """
+        return os.path.join(self._testdir, "components", "slim")
+
+    def _cime_path_in_cesm(self):
+        """Returns the path to a cime directory nested inside a typical
+        cesm directory structure, where self._testdir is the root of the
+        cesm checkout
+        """
+        return os.path.join(self._testdir, "cime")
+
+    def _make_cesm_dirs(self):
+        """Makes a directory structure for a typical CESM layout, where
+        self._testdir is the root of the CESM checkout.
+
+        This makes the slim directory, cime_config and the cime directory.
+
+        Returns a tuple, (slim_path, cime_config, cime_path)
+        """
+        slim_path = self._slim_path_in_cesm()
+        slim_cime_py_path = self._slim_cime_py_path_in_cesm()
+        cime_path = self._cime_path_in_cesm()
+        os.makedirs(slim_path)
+        os.makedirs(slim_cime_py_path)
+        os.makedirs(cime_path)
+        return (slim_path, slim_cime_py_path, cime_path)
+
+    def test_pathToCime_standaloneOnlyWithCime(self):
+        """Test path_to_cime with standalone_only, where cime is in the location
+        it should be with a standalone checkout
+        """
+        slim_path = os.path.join(self._testdir, "slim")
+        actual_cime_py_path = os.path.join(slim_path, "cime_config")
+        actual_path_to_cime = os.path.join(slim_path, "cime")
+        os.makedirs(actual_cime_py_path)
+        os.makedirs(actual_path_to_cime)
+
+        with mock.patch("slim.path_utils.path_to_slim_root", return_value=slim_path):
+            path_to_cime = path_utils.path_to_cime(standalone_only=True)
+            path_to_slim_cime_py = actual_cime_py_path
+
+        self.assertEqual(path_to_cime, actual_path_to_cime)
+        self.assertEqual(path_to_slim_cime_py, actual_cime_py_path)
+
+    def test_pathToCime_standaloneOnlyWithoutCime(self):
+        """Test path_to_cime with standalone_only, where cime is missing"""
+        slim_path = os.path.join(self._testdir, "slim")
+        actual_cime_py_path = os.path.join(slim_path, "cime_config")
+        os.makedirs(actual_cime_py_path)
+
+        with mock.patch("slim.path_utils.path_to_slim_root", return_value=slim_path):
+            path_to_slim_cime_py = actual_cime_py_path
+            with self.assertRaisesRegex(RuntimeError, "Cannot find cime"):
+                _ = path_utils.path_to_cime(standalone_only=True)
+
+        self.assertEqual(path_to_slim_cime_py, actual_cime_py_path)
+
+    def test_pathToCime_standaloneOnlyWithCimeInCesm(self):
+        """Test path_to_cime with standalone_only, where cime is missing from
+        the standalone structure, but cime is present in the CESM
+        directory structure: should raise an exception rather than
+        finding that cime
+        """
+        slim_path, actual_path_to_slim_cime_py, _ = self._make_cesm_dirs()
+
+        with mock.patch("slim.path_utils.path_to_slim_root", return_value=slim_path):
+            path_to_slim_cime_py = actual_path_to_slim_cime_py
+            with self.assertRaisesRegex(RuntimeError, "Cannot find cime"):
+                _ = path_utils.path_to_cime(standalone_only=True)
+
+        self.assertEqual(path_to_slim_cime_py, actual_path_to_slim_cime_py)
+
+    def test_pathToCime_cimeInCesm(self):
+        """Test path_to_cime, where cime is not in the standalone directory but
+        is present in the CESM directory structure
+        """
+        slim_path, actual_path_to_slim_cime_py, actual_path_to_cime = self._make_cesm_dirs()
+
+        with mock.patch("slim.path_utils.path_to_slim_root", return_value=slim_path):
+            path_to_slim_cime_py = actual_path_to_slim_cime_py
+            path_to_cime = path_utils.path_to_cime()
+
+        self.assertEqual(path_to_cime, actual_path_to_cime)
+        self.assertEqual(path_to_slim_cime_py, actual_path_to_slim_cime_py)
+
+    def test_pathToCime_notInCesmCheckout(self):
+        """Test path_to_cime, where cime is not in the standalone directory, and
+        we don't appear to be in a CESM checkout
+        """
+        slim_path = os.path.join(self._testdir, "components", "foo")
+        actual_cime_py_path = os.path.join(slim_path, "cime_config")
+        os.makedirs(actual_cime_py_path)
+        os.makedirs(self._cime_path_in_cesm())
+
+        with mock.patch("slim.path_utils.path_to_slim_root", return_value=slim_path):
+            path_to_slim_cime_py = actual_cime_py_path
+            with self.assertRaisesRegex(
+                RuntimeError,
+                "Cannot find cime.*don't seem to be within a CESM checkout",
+            ):
+                _ = path_utils.path_to_cime()
+
+        self.assertEqual(path_to_slim_cime_py, actual_cime_py_path)
+
+    def test_pathToCime_noCimeInCesm(self):
+        """Test path_to_cime, where we appear to be within a CESM checkout, but
+        there is no cime directory"""
+        slim_path = self._slim_path_in_cesm()
+        actual_cime_py_path = os.path.join(slim_path, "cime_config")
+        os.makedirs(actual_cime_py_path)
+
+        with mock.patch("slim.path_utils.path_to_slim_root", return_value=slim_path):
+            path_to_slim_cime_py = actual_cime_py_path
+            with self.assertRaisesRegex(RuntimeError, "Cannot find cime.*or within CESM checkout"):
+                _ = path_utils.path_to_cime()
+
+        self.assertEqual(path_to_slim_cime_py, actual_cime_py_path)
+
+    def test_pathToCime_cimeInStandaloneAndCesm(self):
+        """Test path_to_cime, where there is a cime directory both in the
+        standalone checkout and in the enclosing CESM checkout. Should
+        give us the cime in the standalone checkout.
+        """
+        slim_path, actual_cime_py_path, _ = self._make_cesm_dirs()
+        actual_path_to_cime = os.path.join(slim_path, "cime")
+        os.makedirs(actual_path_to_cime)
+
+        with mock.patch("slim.path_utils.path_to_slim_root", return_value=slim_path):
+            path_to_slim_cime_py = actual_cime_py_path
+            path_to_cime = path_utils.path_to_cime()
+
+        self.assertEqual(path_to_slim_cime_py, actual_cime_py_path)
+        self.assertEqual(path_to_cime, actual_path_to_cime)
+
+    def test_path_to_slim_and_slim_cime_py_work(self):
+        """Test that the methods to get the path to slim and the path to slim_cime_py both work
+        And check that they are as expected to expected relative path to current location
+        """
+        this_dir = os.path.dirname(os.path.abspath(__file__))
+        expected_slim_path = os.path.normpath(
+            os.path.join(this_dir, os.path.pardir, os.path.pardir, os.path.pardir)
+        )
+        expected_cime_py_path = os.path.join(expected_slim_path, "cime_config")
+        slim_path = path_utils.path_to_slim_root()
+        cime_py_path = path_utils.path_to_slim_cime_py_root()
+        self.assertEqual(slim_path, expected_slim_path)
+        self.assertEqual(cime_py_path, expected_cime_py_path)
+
+
+if __name__ == "__main__":
+    unit_testing.setup_for_tests()
+    unittest.main()
diff --git a/python/slim/unit_testing.py b/python/slim/unit_testing.py
new file mode 100644
index 00000000..38a85aad
--- /dev/null
+++ b/python/slim/unit_testing.py
@@ -0,0 +1,15 @@
+"""Functions to aid unit tests"""
+
+from slim.slim_logging import setup_logging_for_tests
+
+
+def setup_for_tests(enable_critical_logs=False):
+    """Call this at the beginning of unit testing
+
+    Does various setup that would normally be done by the top-level application/script
+
+    Args:
+    enable_critical_logs (bool): If True, then critical logging messages will be output;
+        if False, then even critical messages will be suppressed
+    """
+    setup_logging_for_tests(enable_critical_logs)
diff --git a/python/slim/utils.py b/python/slim/utils.py
new file mode 100644
index 00000000..964d2d6c
--- /dev/null
+++ b/python/slim/utils.py
@@ -0,0 +1,18 @@
+"""General-purpose utility functions"""
+
+import logging
+import sys
+import pdb
+
+logger = logging.getLogger(__name__)
+
+
+def abort(errmsg):
+    """Abort the program with the given error message
+
+    No traceback is given, but if the logging level is DEBUG, then we'll enter pdb
+    """
+    if logger.isEnabledFor(logging.DEBUG):
+        pdb.set_trace()
+
+    sys.exit("ERROR: {}".format(errmsg))
diff --git a/src/biogeophys/mml_main.F90 b/src/biogeophys/mml_main.F90
index 4e05c19b..2054c2b0 100644
--- a/src/biogeophys/mml_main.F90
+++ b/src/biogeophys/mml_main.F90
@@ -20,10 +20,12 @@ module mml_mainMod
 
   
   ! !USES:
+#include "shr_assert.h"
   ! MML: bounds & data type
 #include "shr_assert.h"
   use decompMod , 	only : bounds_type
   use spmdMod   ,       only : masterproc
+  use shr_sys_mod,      only : shr_sys_flush
   use atm2lndType,	only : atm2lnd_type
   use lnd2atmType, 	only : lnd2atm_type  ! MML: probably going to need a lnd2atm type
   ! to hand to the coupler as data coming from the land going to the atmosphere (l2x) 
@@ -52,9 +54,12 @@ module mml_mainMod
   
   ! !PUBLIC MEMBER FUNCTIONS:
   public :: mml_main
+
+  public :: readnml_datasets
   
   ! !PRIVATE MEMBER FUNCTIONS:
   private :: nc_import
+  private :: apply_use_init_interp  ! apply the use_init_interp namelist option, if set
   
   ! mml: can I store the subroutines in other files? (just to keep this one from getting outrageously long?
   ! try it... (move nc_import, for starters... )
@@ -79,13 +84,150 @@ module mml_mainMod
  			! then used those coeffs instead of the more recent one!) Instead, I'm using the equivalent, but newer, clm 
  			! function QSat, and doing the lhflx calculations with specific humidity rather than saturation vapour pressure
   
- 
+  character(len=*), parameter, private :: sourcefile = &
+       __FILE__
 
 contains
   
+  !-----------------------------------------------------------------------
+  subroutine readnml_datasets( NLFilename )
+    use shr_mpi_mod     , only : shr_mpi_bcast
+    use spmdMod         , only : mpicom
+    use clm_nlUtilsMod  , only : find_nlgroup_name
+    use clm_varctl      , only : finidat, fatmlndfrc, finidat_interp_dest, nsrest
+    use clm_varctl      , only : nrevsn, fname_len, mml_surdat, finidat_interp_source
+    use clm_varctl      , only : nsrStartup, nsrContinue, nsrBranch
+  
+    implicit none
+
+    character(len=*), intent(IN) :: NLFilename   ! Namelist file names
+    !-----------------------------------------------------------------------
+    ! !LOCAL VARIABLES:
+    integer                     :: nu_nml           ! Unit for namelist file
+    integer                     :: nml_error        ! Error code
+    logical                     :: use_init_interp  ! Turn on interpolation of initial conditions
+    character(len=*), parameter :: nml_name = 'slim_data_and_initial'
+    character(len=*), parameter :: subname = 'readnml_datasets'
+    namelist /slim_data_and_initial/ mml_surdat, finidat, fatmlndfrc
+    namelist /slim_data_and_initial/ finidat_interp_dest, nrevsn, use_init_interp
+    !-----------------------------------------------------------------------
+
+    fatmlndfrc = ' '
+    use_init_interp = .false.
+    if (masterproc) then
+       open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error )
+       call find_nlgroup_name(nu_nml, nml_name, status=nml_error) 
+       if (nml_error == 0) then
+          read(nu_nml, nml=slim_data_and_initial,iostat=nml_error)
+          if (nml_error /= 0) then
+             call endrun(subname // ':: ERROR reading '//nml_name//' namelist')
+          end if
+       else
+          call endrun(subname // ':: ERROR could NOT find '//nml_name//' namelist')
+       end if
+       close(nu_nml)
+    end if
+    call shr_mpi_bcast( mml_surdat, mpicom )
+    call shr_mpi_bcast( finidat, mpicom )
+    call shr_mpi_bcast( finidat_interp_dest, mpicom )
+    call shr_mpi_bcast( nrevsn, mpicom )
+    call shr_mpi_bcast( fatmlndfrc, mpicom )
+    call shr_mpi_bcast( use_init_interp, mpicom )
+
+    if (use_init_interp) then
+       call apply_use_init_interp(finidat, finidat_interp_source)
+    end if
+
+    if (masterproc) then
+       write(iulog,*) 'nrevsn              = ', trim(nrevsn)
+       write(iulog,*) 'finidat             = ', trim(finidat)
+       if ( use_init_interp )then
+          write(iulog,*) 'Interpolate initial conditions'
+          write(iulog,*) 'finidat_interp_dest = ', trim(finidat_interp_dest)
+       end if
+
+       if (fatmlndfrc == ' ') then
+          call endrun(subname // ':: ERROR fatmlndfrc was NOT set and needs to be' )
+       else
+          write(iulog,*) '   land frac data = ',trim(fatmlndfrc)
+       end if
+
+       if (mml_surdat == ' ') then
+           call endrun(subname // ':: ERROR mml_surdat was NOT set and needs to be' )
+       else
+           write(iulog,*) '   mml_surdat IS set, and = ',trim(mml_surdat)
+       end if
+
+       if (nsrest == nsrBranch .and. nrevsn == ' ') then
+          call endrun(msg=' ERROR: need to set restart data file name'//&
+               errMsg(sourcefile, __LINE__))
+       end if
+       ! Consistency settings for nrevsn
+
+       if (nsrest == nsrStartup ) nrevsn = ' '
+       if (nsrest == nsrContinue) nrevsn = 'set by restart pointer file file'
+       if (nsrest /= nsrStartup .and. nsrest /= nsrContinue .and. nsrest /= nsrBranch ) then
+          call endrun(msg=' ERROR: nsrest NOT set to a valid value'//&
+               errMsg(sourcefile, __LINE__))
+       end if
+       if (nsrest == nsrStartup) then
+          if (finidat /= ' ') then
+             write(iulog,*) '   initial data: ', trim(finidat)
+          else if (finidat_interp_source /= ' ') then
+             write(iulog,*) '   initial data interpolated from: ', trim(finidat_interp_source)
+          else
+             write(iulog,*) '   initial data created by model (cold start)'
+          end if
+       else
+          write(iulog,*) '   restart data   = ',trim(nrevsn)
+       end if
+
+    end if
+
+  end subroutine readnml_datasets
+
+  !-----------------------------------------------------------------------
+  subroutine apply_use_init_interp(finidat, finidat_interp_source)
+    !
+    ! !DESCRIPTION:
+    ! Applies the use_init_interp option, setting finidat_interp_source to
+    ! finidat
+    !
+    ! Should be called if use_init_interp is true.
+    !
+    ! Does error checking to ensure that it is valid to set use_init_interp to
+    ! true,
+    ! given the values of finidat and finidat_interp_source.
+    !
+    ! !USES:
+    !
+    ! !ARGUMENTS:
+    character(len=*), intent(inout) :: finidat
+    character(len=*), intent(inout) :: finidat_interp_source
+    !
+    ! !LOCAL VARIABLES:
+
+    character(len=*), parameter :: subname = 'apply_use_init_interp'
+    !-----------------------------------------------------------------------
+
+    if (finidat == ' ') then
+       call endrun(msg=subname//'::ERROR: Can only set use_init_interp if finidat is set')
+    end if
+
+    if (finidat_interp_source /= ' ') then
+       call endrun(msg=subname//'::ERROR: Cannot set use_init_interp if finidat_interp_source is &
+            &already set')
+    end if
+
+    finidat_interp_source = finidat
+    finidat = ' '
+
+  end subroutine apply_use_init_interp
+  
   !-----------------------------------------------------------------------
   subroutine mml_main (bounds, atm2lnd_inst, lnd2atm_inst) !lnd2atm_inst
   
+    use clm_varpar, only : numrad
     implicit none
   
     type(bounds_type), intent(in) :: bounds
@@ -444,6 +586,11 @@ subroutine mml_main (bounds, atm2lnd_inst, lnd2atm_inst) !lnd2atm_inst
          !         statment above and left all comments as I found them
  ! GBB: No need to use the separate values for t, u, q; only need zref
  ! MML: Keith said there are 3 separate ones for historical reasons, but all three should be the same as zref    
+     SHR_ASSERT(numrad == 2, errMsg(sourcefile, __LINE__))
+     SHR_ASSERT_ALL((ubound(fsds_dir) == (/bounds%endg,numrad/)), errMsg(sourcefile, __LINE__))
+     SHR_ASSERT_ALL((lbound(fsds_dir) == (/bounds%begg,1/)), errMsg(sourcefile, __LINE__))
+     SHR_ASSERT_ALL((ubound(atm2lnd_inst%forc_solad_grc) == (/bounds%endg,numrad/)), errMsg(sourcefile, __LINE__))
+     SHR_ASSERT_ALL((lbound(atm2lnd_inst%forc_solad_grc) == (/bounds%begg,1/)), errMsg(sourcefile, __LINE__))
          ! For checking the big neg lhflx:
      ! NOTE: this is NOT going to be consistent with CAM, still, if I use pbot and psrf as the "edges" of 
      ! my lowest atm layer; cam uses the actual pressure levels at the edges of the lowermost 
diff --git a/src/cpl/lnd_comp_mct.F90 b/src/cpl/lnd_comp_mct.F90
index 577d0f27..929651ec 100644
--- a/src/cpl/lnd_comp_mct.F90
+++ b/src/cpl/lnd_comp_mct.F90
@@ -459,9 +459,9 @@ subroutine lnd_run_mct(EClock, cdata_l, x2l_l, l2x_l)
 
        ! Advance clm time step
        !write(*,*)'MML advance clm timestep'
-       call t_startf ('lc_clm2_adv_timestep')
+       call t_startf ('lc_slim_adv_timestep')
        call advance_timestep()
-       call t_stopf ('lc_clm2_adv_timestep')
+       call t_stopf ('lc_slim_adv_timestep')
 
     end do
 
diff --git a/src/init_interp/initInterp.F90 b/src/init_interp/initInterp.F90
index 68f3365a..e9264493 100644
--- a/src/init_interp/initInterp.F90
+++ b/src/init_interp/initInterp.F90
@@ -31,7 +31,6 @@ module initInterpMod
 
   ! Public methods
 
-! public :: initInterp_readnl  ! Read namelist
   public :: initInterp
 
   ! Private methods
@@ -54,56 +53,6 @@ module initInterpMod
 
   !=======================================================================
 
-  !-----------------------------------------------------------------------
-! subroutine initInterp_readnl(NLFilename)
-!   !
-!   ! !DESCRIPTION:
-!   ! Read the namelist for initInterp
-!   !
-!   ! !USES:
-!   use fileutils      , only : getavu, relavu, opnfil
-!   use shr_nl_mod     , only : shr_nl_find_group_name
-!   use spmdMod        , only : masterproc, mpicom
-!   use shr_mpi_mod    , only : shr_mpi_bcast
-!   !
-!   ! !ARGUMENTS:
-!   character(len=*), intent(in) :: NLFilename ! Namelist filename
-!   !
-!   ! !LOCAL VARIABLES:
-!   integer :: ierr                 ! error code
-!   integer :: unitn                ! unit for namelist file
-
-!   character(len=*), parameter :: subname = 'initInterp_readnl'
-!   !-----------------------------------------------------------------------
-
-!   ! Initialize options to default values, in case they are not specified in the namelist
-
-!   if (masterproc) then
-!      unitn = getavu()
-!      write(iulog,*) 'Read in clm_initinterp_inparm  namelist'
-!      call opnfil (NLFilename, unitn, 'F')
-!      call shr_nl_find_group_name(unitn, 'clm_initinterp_inparm', status=ierr)
-!      if (ierr == 0) then
-!         read(unitn, clm_initinterp_inparm, iostat=ierr)
-!         if (ierr /= 0) then
-!            call endrun(msg="ERROR reading clm_initinterp_inparm namelist"//errmsg(sourcefile, __LINE__))
-!         end if
-!      else
-!         call endrun(msg="ERROR finding clm_initinterp_inparm namelist"//errmsg(sourcefile, __LINE__))
-!      end if
-!      call relavu( unitn )
-!   end if
-
-!   if (masterproc) then
-!      write(iulog,*) ' '
-!      write(iulog,*) 'initInterp settings:'
-!      write(iulog,nml=clm_initinterp_inparm)
-!      write(iulog,*) ' '
-!   end if
-
-! end subroutine initInterp_readnl
-
-
   subroutine initInterp (filei, fileo, bounds)
 
     !----------------------------------------------------------------------- 
diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90
index dea0af28..ad29d447 100644
--- a/src/main/clm_initializeMod.F90
+++ b/src/main/clm_initializeMod.F90
@@ -40,8 +40,9 @@ subroutine initialize1( )
     use decompInitMod    , only: decompInit_lnd, decompInit_clumps, decompInit_glcp
     use domainMod        , only: domain_check, ldomain, domain_init
     use surfrdMod        , only: surfrd_get_globmask, surfrd_get_grid
-    use controlMod       , only: control_init, control_print, NLFilename
+    use controlMod       , only: control_init, control_print, NLFilename, control_readNL_Physics, control_readNL_Perf
     use ncdio_pio        , only: ncd_pio_init
+    use mml_MainMod      , only: readnml_datasets
     !
     ! !LOCAL VARIABLES:
     integer           :: ier                     ! error status
@@ -66,11 +67,14 @@ subroutine initialize1( )
     if ( masterproc )then
        write(iulog,*) trim(version)
        write(iulog,*)
-       write(iulog,*) 'Attempting to initialize the land model .....'
+       write(iulog,*) 'Attempting to initialize the SLIM land model .....'
        write(iulog,*)
        call shr_sys_flush(iulog)
     endif
 
+    call control_readNL_Physics()
+    call readnml_datasets( NLFilename )
+    call control_readNL_Perf()
     call control_init()
     call clm_varpar_init()
     call clm_varcon_init()
@@ -171,6 +175,7 @@ subroutine initialize2( )
     use clm_time_manager      , only : timemgr_init, timemgr_restart_io, timemgr_restart
     use fileutils             , only : getfil
     use initInterpMod         , only : initInterp
+    use histFileMod           , only : hist_readNML
     use histFileMod           , only : hist_htapes_build, htapes_fieldlist, hist_printflds
     use histFileMod           , only : hist_addfld1d, hist_addfld2d
     use restFileMod           , only : restFile_getfile, restFile_open, restFile_close
@@ -224,6 +229,9 @@ subroutine initialize2( )
        call timemgr_restart()
     end if
 
+    ! History namelist read
+    call hist_readNML( NLFilename )
+
     ! ------------------------------------------------------------------------
     ! Initialize component data structures 
     ! ------------------------------------------------------------------------
diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90
index 22a35af2..a05ac5e5 100644
--- a/src/main/controlMod.F90
+++ b/src/main/controlMod.F90
@@ -18,18 +18,11 @@ module controlMod
   use spmdMod                          , only: masterproc
   use decompMod                        , only: clump_pproc
   use clm_varpar                       , only: numrad
-  use histFileMod                      , only: max_tapes, max_namlen 
-  use histFileMod                      , only: hist_empty_htapes, hist_dov2xy, hist_avgflag_pertape, hist_type1d_pertape 
-  use histFileMod                      , only: hist_nhtfrq, hist_ndens, hist_mfilt, hist_fincl1, hist_fincl2, hist_fincl3
-  use histFileMod                      , only: hist_fincl4, hist_fincl5, hist_fincl6, hist_fexcl1, hist_fexcl2, hist_fexcl3
-  use histFileMod                      , only: hist_fexcl4, hist_fexcl5, hist_fexcl6
-! use initInterpMod                    , only: initInterp_readnl
   use clm_varctl                       , only: iundef, rundef, nsrest, caseid, ctitle, nsrStartup, nsrContinue
   use clm_varctl                       , only: nsrBranch, brnch_retain_casename, hostname, username, source, version, conventions
-  use clm_varctl                       , only: iulog, outnc_large_files, finidat, fatmgrid, fatmlndfrc, nrevsn
-  use clm_varctl                       , only: mml_surdat, finidat_interp_source, finidat_interp_dest
+  use clm_varctl                       , only: iulog, outnc_large_files, finidat, fatmgrid
   use clm_varctl                       , only: wrtdia, nsegspc, rpntdir, rpntfil
-  use clm_varctl                       , only: use_noio, NLFilename_in
+  use clm_varctl                       , only: NLFilename_in
   use clm_varctl                       , only: clm_varctl_set
   use clm_varctl                       , only: single_column
   !
@@ -37,13 +30,11 @@ module controlMod
   implicit none
   !
   ! !PUBLIC MEMBER FUNCTIONS:
-  public :: control_setNL ! Set namelist filename
-  public :: control_init  ! initial run control information
-  public :: control_print ! print run control information
-  !
-  !
-  ! !PRIVATE MEMBER FUNCTIONS:
-  private :: apply_use_init_interp  ! apply the use_init_interp namelist option, if set
+  public :: control_setNL          ! Set namelist filename
+  public :: control_init           ! initial run control information
+  public :: control_readNL_Perf    ! read in the namelist for SLIM performance settings
+  public :: control_readNL_Physics ! read in the namelist for SLIM physics settings
+  public :: control_print          ! print run control information
   !
   ! !PRIVATE TYPES:
   character(len=  7) :: runtyp(4)                        ! run type
@@ -97,62 +88,30 @@ subroutine control_init( )
     ! Initialize CLM run control information
     !
     ! !USES:
-    use clm_time_manager                 , only : set_timemgr_init
     use fileutils                        , only : getavu, relavu
+    use clm_time_manager                 , only : get_step_size
     !
     ! !LOCAL VARIABLES:
     integer :: i                    ! loop indices
     integer :: ierr                 ! error code
     integer :: unitn                ! unit for namelist file
     integer :: dtime                ! Integer time-step
-    integer :: override_nsrest      ! If want to override the startup type sent from driver
-    logical :: use_init_interp      ! Apply initInterp to the file given by finidat
     !------------------------------------------------------------------------
 
     ! ----------------------------------------------------------------------
     ! Namelist Variables
     ! ----------------------------------------------------------------------
 
-    ! Time step
-    namelist / clm_inparm/ &
-    dtime
-
     ! CLM namelist settings
 
-    namelist /clm_inparm / &
-         fatmlndfrc, finidat, nrevsn, &
-         finidat_interp_dest, &
-         use_init_interp
-
     ! Input datasets
 
-	! MML Input datasets for simple model
-    namelist /clm_inparm/ &
-    	 mml_surdat			
-    	 ! MML forcing file w/ albedo, roughness, etc
-    	 ! /glade/p/work/mlague/cesm_source/cesm1_5_beta05_mml_land/components/clm/bld/namelist_files/namelist_defaults.xml
-    	 ! I think I need to modify one of the namelis_defaults xml files in the above folder in order for 
-    	 ! the model to know to accept my new namelist var... 
-
-    ! History, restart options
-
-    namelist /clm_inparm/  &
-         hist_empty_htapes, hist_dov2xy, &
-         hist_avgflag_pertape, hist_type1d_pertape, &
-         hist_nhtfrq,  hist_ndens, hist_mfilt, &
-         hist_fincl1,  hist_fincl2, hist_fincl3, &
-         hist_fincl4,  hist_fincl5, hist_fincl6, &
-         hist_fexcl1,  hist_fexcl2, hist_fexcl3, &
-         hist_fexcl4,  hist_fexcl5, hist_fexcl6
-
     ! Other options
 
     namelist /clm_inparm/  &
-         clump_pproc, wrtdia, &
-         nsegspc, override_nsrest
+         clump_pproc, wrtdia
 
     ! All old cpp-ifdefs are below and have been converted to namelist variables 
-    namelist /clm_inparm/ use_noio
 
     ! Items not really needed, but do need to be properly set as they are used
     namelist / clm_inparm/ single_column
@@ -181,14 +140,10 @@ subroutine control_init( )
     clump_pproc = 1
 #endif
 
-    override_nsrest = nsrest
-
-    use_init_interp = .false.
-
     if (masterproc) then
 
        ! ----------------------------------------------------------------------
-       ! Read namelist from standard input. 
+       ! Read namelist
        ! ----------------------------------------------------------------------
 
        if ( len_trim(NLFilename) == 0  )then
@@ -204,7 +159,7 @@ subroutine control_init( )
              call endrun(msg='ERROR reading clm_inparm namelist'//errMsg(sourcefile, __LINE__))
           end if
        else
-          call endrun(msg='ERROR finding clm_inparm namelist'//errMsg(sourcefile, __LINE__))
+          write(iulog,*) 'Could not find clm_inparm namelist'
        end if
 
        call relavu( unitn )
@@ -213,38 +168,11 @@ subroutine control_init( )
        ! Process some namelist variables, and perform consistency checks
        ! ----------------------------------------------------------------------
 
-       call set_timemgr_init( dtime_in=dtime )
-
        ! Check for namelist variables that SLIM can NOT use
        if ( single_column )then
           call endrun(msg='ERROR SLIM can NOT run with single_column on'//errMsg(sourcefile, __LINE__))
        end if
 
-       if (use_init_interp) then
-          call apply_use_init_interp(finidat, finidat_interp_source)
-       end if
-
-       ! History and restart files
-
-       do i = 1, max_tapes
-          if (hist_nhtfrq(i) == 0) then
-             hist_mfilt(i) = 1
-          else if (hist_nhtfrq(i) < 0) then
-             hist_nhtfrq(i) = nint(-hist_nhtfrq(i)*SHR_CONST_CDAY/(24._r8*dtime))
-          endif
-       end do
-
-       ! Override start-type (can only override to branch (3)  and only 
-       ! if the driver is a startup type
-       if ( override_nsrest /= nsrest )then
-           if ( override_nsrest /= nsrBranch .and. nsrest /= nsrStartup )then
-              call endrun(msg= ' ERROR: can ONLY override clm start-type ' // &
-                   'to branch type and ONLY if driver is a startup type'// &
-                   errMsg(sourcefile, __LINE__))
-           end if
-           call clm_varctl_set( nsrest_in=override_nsrest )
-       end if
-
     endif   ! end of if-masterproc if-block
 
     ! ----------------------------------------------------------------------
@@ -268,20 +196,6 @@ subroutine control_init( )
        call endrun(msg=' ERROR:: must set nsrest'//& 
             errMsg(sourcefile, __LINE__))
     end if
-    if (nsrest == nsrBranch .and. nrevsn == ' ') then
-       call endrun(msg=' ERROR: need to set restart data file name'//&
-            errMsg(sourcefile, __LINE__))
-    end if
-
-    ! Consistency settings for nrevsn
-
-    if (nsrest == nsrStartup ) nrevsn = ' '
-    if (nsrest == nsrContinue) nrevsn = 'set by restart pointer file file'
-    if (nsrest /= nsrStartup .and. nsrest /= nsrContinue .and. nsrest /= nsrBranch ) then
-       call endrun(msg=' ERROR: nsrest NOT set to a valid value'//&
-            errMsg(sourcefile, __LINE__))
-    end if
-
     if (masterproc) then
        write(iulog,*) 'Successfully initialized run control settings'
        write(iulog,*)
@@ -289,6 +203,113 @@ subroutine control_init( )
 
   end subroutine control_init
 
+  !------------------------------------------------------------------------
+  subroutine control_readNL_Physics( )
+    !
+    ! !DESCRIPTION:
+    ! Initialize SLIM run physics information
+    !
+    ! !USES:
+    use shr_mpi_mod     , only : shr_mpi_bcast
+    use clm_time_manager, only : set_timemgr_init
+    use spmdMod         , only : mpicom
+    !
+    ! !LOCAL VARIABLES:
+    integer :: i                    ! loop indices
+    integer :: ierr                 ! error code
+    integer :: unitn                ! unit for namelist file
+    integer :: dtime                ! Integer time-step
+    character(len=*), parameter :: subname = "control_readNL_Physics"
+    character(len=*), parameter :: nmlName = "slim_inparm"
+    !------------------------------------------------------------------------
+
+    ! ----------------------------------------------------------------------
+    ! Namelist Variables
+    ! ----------------------------------------------------------------------
+
+    ! Time step
+    namelist / slim_inparm/ dtime
+
+    if (masterproc) then
+
+       ! ----------------------------------------------------------------------
+       ! Read namelist
+       ! ----------------------------------------------------------------------
+
+       if ( len_trim(NLFilename) == 0  )then
+          call endrun(msg=subname//'::ERROR: nlfilename not set'//errMsg(sourcefile, __LINE__))
+       end if
+       write(iulog,*) 'Read in '//nmlName//' namelist from: ', trim(NLFilename)
+       open( newunit=unitn, file=trim(NLFilename), status='old' )
+       call shr_nl_find_group_name(unitn, nmlName, status=ierr)
+       if (ierr == 0) then
+          read(unitn, slim_inparm, iostat=ierr)
+          if (ierr /= 0) then
+             call endrun(msg=subname//'::ERROR reading '//nmlName//' namelist'//errMsg(sourcefile, __LINE__))
+          end if
+       else
+          call endrun(msg=subname//'::ERROR reading '//nmlName//' namelist'//errMsg(sourcefile, __LINE__))
+       end if
+       close(unitn)
+    end if
+    call shr_mpi_bcast( dtime, mpicom )
+
+    call set_timemgr_init( dtime_in=dtime )
+
+  end subroutine control_readNL_Physics
+
+  !------------------------------------------------------------------------
+  subroutine control_readNL_Perf( )
+    !
+    ! !DESCRIPTION:
+    ! Initialize SLIM run performance information
+    !
+    ! !USES:
+    use shr_mpi_mod     , only : shr_mpi_bcast
+    use clm_time_manager, only : set_timemgr_init
+    use spmdMod         , only : mpicom
+    !
+    ! !LOCAL VARIABLES:
+    integer :: i                    ! loop indices
+    integer :: ierr                 ! error code
+    integer :: unitn                ! unit for namelist file
+    character(len=*), parameter :: subname = "control_readNL_Perf"
+    character(len=*), parameter :: nmlName = "slim_perf"
+    !------------------------------------------------------------------------
+
+    ! ----------------------------------------------------------------------
+    ! Namelist Variables
+    ! ----------------------------------------------------------------------
+
+    ! Time step
+    namelist / slim_perf/ nsegspc
+
+    if (masterproc) then
+
+       ! ----------------------------------------------------------------------
+       ! Read namelist
+       ! ----------------------------------------------------------------------
+
+       if ( len_trim(NLFilename) == 0  )then
+          call endrun(msg=subname//'::ERROR: nlfilename not set'//errMsg(sourcefile, __LINE__))
+       end if
+       write(iulog,*) 'Read in '//nmlName//' namelist from: ', trim(NLFilename)
+       open( newunit=unitn, file=trim(NLFilename), status='old' )
+       call shr_nl_find_group_name(unitn, nmlName, status=ierr)
+       if (ierr == 0) then
+          read(unitn, slim_perf, iostat=ierr)
+          if (ierr /= 0) then
+             call endrun(msg=subname//'::ERROR reading '//nmlName//' namelist'//errMsg(sourcefile, __LINE__))
+          end if
+       else
+          call endrun(msg=subname//'::ERROR reading '//nmlName//' namelist'//errMsg(sourcefile, __LINE__))
+       end if
+       close(unitn)
+    end if
+    call shr_mpi_bcast( nsegspc, mpicom )
+
+  end subroutine control_readNL_Perf
+
   !------------------------------------------------------------------------
   subroutine control_spmd()
     !
@@ -316,44 +337,10 @@ subroutine control_spmd()
     call mpi_bcast (username, len(username), MPI_CHARACTER, 0, mpicom, ier)
     call mpi_bcast (nsrest, 1, MPI_INTEGER, 0, mpicom, ier)
 
-    call mpi_bcast (use_noio, 1, MPI_LOGICAL, 0, mpicom, ier)
-
-    ! initial file variables
-    call mpi_bcast (nrevsn, len(nrevsn), MPI_CHARACTER, 0, mpicom, ier)
-    call mpi_bcast (finidat, len(finidat), MPI_CHARACTER, 0, mpicom, ier)
-    call mpi_bcast (finidat_interp_source, len(finidat_interp_source), MPI_CHARACTER, 0, mpicom, ier)
-    call mpi_bcast (finidat_interp_dest, len(finidat_interp_dest), MPI_CHARACTER, 0, mpicom, ier)
-    call mpi_bcast (fatmlndfrc,len(fatmlndfrc),MPI_CHARACTER, 0, mpicom, ier)
-
-	! mml input file vars for simple model
-	call mpi_bcast (mml_surdat,  len(mml_surdat),   MPI_CHARACTER, 0, mpicom, ier)
-
     ! physics variables
-    call mpi_bcast (nsegspc, 1, MPI_INTEGER, 0, mpicom, ier)
     call mpi_bcast (wrtdia, 1, MPI_LOGICAL, 0, mpicom, ier)
     call mpi_bcast (single_column,1, MPI_LOGICAL, 0, mpicom, ier)
 
-    ! history file variables
-    call mpi_bcast (hist_empty_htapes, 1, MPI_LOGICAL, 0, mpicom, ier)
-    call mpi_bcast (hist_dov2xy, size(hist_dov2xy), MPI_LOGICAL, 0, mpicom, ier)
-    call mpi_bcast (hist_nhtfrq, size(hist_nhtfrq), MPI_INTEGER, 0, mpicom, ier)
-    call mpi_bcast (hist_mfilt, size(hist_mfilt), MPI_INTEGER, 0, mpicom, ier)
-    call mpi_bcast (hist_ndens, size(hist_ndens), MPI_INTEGER, 0, mpicom, ier)
-    call mpi_bcast (hist_avgflag_pertape, size(hist_avgflag_pertape), MPI_CHARACTER, 0, mpicom, ier)
-    call mpi_bcast (hist_type1d_pertape, max_namlen*size(hist_type1d_pertape), MPI_CHARACTER, 0, mpicom, ier)
-    call mpi_bcast (hist_fexcl1, max_namlen*size(hist_fexcl1), MPI_CHARACTER, 0, mpicom, ier)
-    call mpi_bcast (hist_fexcl2, max_namlen*size(hist_fexcl2), MPI_CHARACTER, 0, mpicom, ier)
-    call mpi_bcast (hist_fexcl3, max_namlen*size(hist_fexcl3), MPI_CHARACTER, 0, mpicom, ier)
-    call mpi_bcast (hist_fexcl4, max_namlen*size(hist_fexcl4), MPI_CHARACTER, 0, mpicom, ier)
-    call mpi_bcast (hist_fexcl5, max_namlen*size(hist_fexcl5), MPI_CHARACTER, 0, mpicom, ier)
-    call mpi_bcast (hist_fexcl6, max_namlen*size(hist_fexcl6), MPI_CHARACTER, 0, mpicom, ier)
-    call mpi_bcast (hist_fincl1, (max_namlen+2)*size(hist_fincl1), MPI_CHARACTER, 0, mpicom, ier)
-    call mpi_bcast (hist_fincl2, (max_namlen+2)*size(hist_fincl2), MPI_CHARACTER, 0, mpicom, ier)
-    call mpi_bcast (hist_fincl3, (max_namlen+2)*size(hist_fincl3), MPI_CHARACTER, 0, mpicom, ier)
-    call mpi_bcast (hist_fincl4, (max_namlen+2)*size(hist_fincl4), MPI_CHARACTER, 0, mpicom, ier)
-    call mpi_bcast (hist_fincl5, (max_namlen+2)*size(hist_fincl5), MPI_CHARACTER, 0, mpicom, ier)
-    call mpi_bcast (hist_fincl6, (max_namlen+2)*size(hist_fincl6), MPI_CHARACTER, 0, mpicom, ier)
-
     ! restart file variables
 
     call mpi_bcast (rpntfil, len(rpntfil), MPI_CHARACTER, 0, mpicom, ier)
@@ -386,31 +373,8 @@ subroutine control_print ()
     write(iulog,*) '   username              = ',trim(username)
     write(iulog,*) '   hostname              = ',trim(hostname)
     write(iulog,*) 'process control parameters:'
-    write(iulog,*) '    use_noio = ', use_noio
 
     write(iulog,*) 'input data files:'
-    if (fatmlndfrc == ' ') then
-       write(iulog,*) '   fatmlndfrc not set, setting frac/mask to 1'
-    else
-       write(iulog,*) '   land frac data = ',trim(fatmlndfrc)
-    end if
-    if (mml_surdat == ' ') then
-       write(iulog,*) '   mml_surdat NOT set, check that we are using the default'
-    else
-       write(iulog,*) '   mml_surdat IS set, and = ',trim(mml_surdat)
-    end if
-
-    if (nsrest == nsrStartup) then
-       if (finidat /= ' ') then
-          write(iulog,*) '   initial data: ', trim(finidat)
-       else if (finidat_interp_source /= ' ') then
-          write(iulog,*) '   initial data interpolated from: ', trim(finidat_interp_source)
-       else
-          write(iulog,*) '   initial data created by model (cold start)'
-       end if
-    else
-       write(iulog,*) '   restart data   = ',trim(nrevsn)
-    end if
 
     write(iulog,*) '   atmospheric forcing data is from cesm atm model'
     write(iulog,*) 'Restart parameters:'
@@ -428,47 +392,7 @@ subroutine control_print ()
        write(iulog,*) '   Namelist not checked for agreement with initial run.'
        write(iulog,*) '   Surface data set and reference date should not differ from initial run'
     end if
-    write(iulog,*) '   nsegspc              = ',nsegspc
 
   end subroutine control_print
 
-
-  !-----------------------------------------------------------------------
-  subroutine apply_use_init_interp(finidat, finidat_interp_source)
-    !
-    ! !DESCRIPTION:
-    ! Applies the use_init_interp option, setting finidat_interp_source to finidat
-    !
-    ! Should be called if use_init_interp is true.
-    !
-    ! Does error checking to ensure that it is valid to set use_init_interp to true,
-    ! given the values of finidat and finidat_interp_source.
-    !
-    ! !USES:
-    !
-    ! !ARGUMENTS:
-    character(len=*), intent(inout) :: finidat
-    character(len=*), intent(inout) :: finidat_interp_source
-    !
-    ! !LOCAL VARIABLES:
-
-    character(len=*), parameter :: subname = 'apply_use_init_interp'
-    !-----------------------------------------------------------------------
-
-    if (finidat == ' ') then
-       call endrun(msg=' ERROR: Can only set use_init_interp if finidat is set')
-    end if
-
-    if (finidat_interp_source /= ' ') then
-       call endrun(msg=' ERROR: Cannot set use_init_interp if finidat_interp_source is &
-            &already set')
-    end if
-
-    finidat_interp_source = finidat
-    finidat = ' '
-
-  end subroutine apply_use_init_interp
-
-
-
 end module controlMod
diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90
index c2e82f1c..bb85d4df 100644
--- a/src/main/histFileMod.F90
+++ b/src/main/histFileMod.F90
@@ -92,6 +92,7 @@ module histFileMod
   logical, private :: if_disphist(max_tapes)   ! restart, true => save history file
   !
   ! !PUBLIC MEMBER FUNCTIONS:
+  public :: hist_readNML         ! Read in the history namelist settings
   public :: hist_addfld1d        ! Add a 1d single-level field to the master field list
   public :: hist_addfld2d        ! Add a 2d multi-level field to the master field list
   public :: hist_add_subscript   ! Add a 2d subscript dimension
@@ -400,7 +401,7 @@ subroutine hist_htapes_build ()
     !-----------------------------------------------------------------------
 
     if (masterproc) then
-       write(iulog,*)  trim(subname),' Initializing clm2 history files'
+       write(iulog,*)  trim(subname),' Initializing slim history files'
        write(iulog,'(72a1)') ("-",i=1,60)
        call shr_sys_flush(iulog)
     endif
@@ -447,7 +448,7 @@ subroutine hist_htapes_build ()
     end do
 
     if (masterproc) then
-       write(iulog,*)  trim(subname),' Successfully initialized clm2 history files'
+       write(iulog,*)  trim(subname),' Successfully initialized slim history files'
        write(iulog,'(72a1)') ("-",i=1,60)
        call shr_sys_flush(iulog)
     endif
@@ -2460,7 +2461,7 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate)
 
           ! Create the restart history filename and open it
           write(hnum,'(i1.1)') t-1
-          locfnhr(t) = "./" // trim(caseid) //".clm2"// trim(inst_suffix) &
+          locfnhr(t) = "./" // trim(caseid) //".slim"// trim(inst_suffix) &
                         // ".rh" // hnum //"."// trim(rdate) //".nc"
 
           call htape_create( t, histrest=.true. )
@@ -3138,7 +3139,7 @@ character(len=max_length_filename) function set_hist_filename (hist_freq, hist_m
       write(cdate,'(i4.4,"-",i2.2,"-",i2.2,"-",i5.5)') yr,mon,day,sec
    endif
    write(hist_index,'(i1.1)') hist_file - 1
-   set_hist_filename = "./"//trim(caseid)//".clm2"//trim(inst_suffix)//&
+   set_hist_filename = "./"//trim(caseid)//".slim"//trim(inst_suffix)//&
                        ".h"//hist_index//"."//trim(cdate)//".nc"
 
    ! check to see if the concatenated filename exceeded the
@@ -3158,6 +3159,78 @@ character(len=max_length_filename) function set_hist_filename (hist_freq, hist_m
    end if
   end function set_hist_filename
 
+  !-----------------------------------------------------------------------
+  subroutine hist_readNML ( NLFilename )
+    use shr_mpi_mod     , only : shr_mpi_bcast
+    use spmdMod         , only : mpicom
+    use clm_nlUtilsMod  , only : find_nlgroup_name
+    use clm_varctl      , only : use_noio
+    use shr_const_mod   , only : SHR_CONST_CDAY
+    use clm_time_manager, only : get_step_size
+
+    implicit none
+
+    character(len=*), intent(IN) :: NLFilename   ! Namelist file names
+    !-----------------------------------------------------------------------
+    ! !LOCAL VARIABLES:
+    integer                     :: i                ! Indices
+    integer                     :: nu_nml           ! Unit for namelist file
+    integer                     :: nml_error        ! Error code
+    integer                     :: dtime            ! time step
+    character(len=*), parameter :: nml_name = 'slim_history'
+    character(len=*), parameter :: subname = 'hist_readNML'
+    namelist /slim_history/ use_noio, hist_empty_htapes
+    namelist /slim_history/ hist_avgflag_pertape
+    namelist /slim_history/ hist_nhtfrq, hist_ndens
+    namelist /slim_history/ hist_mfilt, hist_fincl1, hist_fincl2, hist_fincl3
+    namelist /slim_history/ hist_fincl4, hist_fincl5
+    namelist /slim_history/ hist_fincl6, hist_fexcl1
+    !-----------------------------------------------------------------------
+
+    if (masterproc) then
+       open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error )
+       call find_nlgroup_name(nu_nml, nml_name, status=nml_error)
+       if (nml_error == 0) then
+          read(nu_nml, nml=slim_history,iostat=nml_error)
+          if (nml_error /= 0) then
+             call endrun(subname // ':: ERROR reading '//nml_name//' namelist')
+          end if
+       else
+          call endrun(subname // ':: ERROR could NOT find '//nml_name//' namelist')
+       end if
+       close(nu_nml)
+    end if
+
+    call shr_mpi_bcast( use_noio, mpicom )
+    call shr_mpi_bcast( hist_empty_htapes, mpicom )
+    call shr_mpi_bcast( hist_avgflag_pertape, mpicom )
+    call shr_mpi_bcast( hist_nhtfrq, mpicom )
+    call shr_mpi_bcast( hist_ndens, mpicom )
+    call shr_mpi_bcast( hist_mfilt, mpicom )
+    call shr_mpi_bcast( hist_fincl1, mpicom )
+    call shr_mpi_bcast( hist_fincl2, mpicom )
+    call shr_mpi_bcast( hist_fincl3, mpicom )
+    call shr_mpi_bcast( hist_fincl4, mpicom )
+    call shr_mpi_bcast( hist_fincl5, mpicom )
+    call shr_mpi_bcast( hist_fincl6, mpicom )
+    call shr_mpi_bcast( hist_fexcl1, mpicom )
+
+    ! History and restart files
+
+    dtime = get_step_size()
+    do i = 1, max_tapes
+       if (hist_nhtfrq(i) == 0) then
+          hist_mfilt(i) = 1
+       else if (hist_nhtfrq(i) < 0) then
+          hist_nhtfrq(i) = nint(-hist_nhtfrq(i)*SHR_CONST_CDAY/(24._r8*dtime))
+       endif
+    end do
+    if ( masterproc )then
+       if ( use_noio ) write(iulog,*) ' History output is turned off with use_noio = ', use_noio
+    end if
+
+  end subroutine hist_readNML
+
   !-----------------------------------------------------------------------
   subroutine hist_addfld1d (fname, units, avgflag, long_name, type1d_out, &
                         ptr_gcell, ptr_lnd, ptr_atm, default)
diff --git a/src/main/restFileMod.F90 b/src/main/restFileMod.F90
index 2712a66c..531686d2 100644
--- a/src/main/restFileMod.F90
+++ b/src/main/restFileMod.F90
@@ -231,8 +231,8 @@ subroutine restFile_getfile( file, path )
        end if
        call getfil( path, file, 0 )
 
-       ! tcraig, adding xx. and .clm2 makes this more robust
-       ctest = 'xx.'//trim(caseid)//'.clm2'
+       ! tcraig, adding xx. and .slim makes this more robust
+       ctest = 'xx.'//trim(caseid)//'.slim'
        ftest = 'xx.'//trim(file)
        status = index(trim(ftest),trim(ctest))
        if (status /= 0 .and. .not.(brnch_retain_casename)) then
@@ -409,7 +409,7 @@ character(len=256) function restFile_filename( rdate )
     character(len=*), intent(in) :: rdate   ! input date for restart file name 
     !-----------------------------------------------------------------------
 
-    restFile_filename = "./"//trim(caseid)//".clm2"//trim(inst_suffix)//&
+    restFile_filename = "./"//trim(caseid)//".slim"//trim(inst_suffix)//&
          ".r."//trim(rdate)//".nc"
     if (masterproc) then
        write(iulog,*)'writing restart file ',trim(restFile_filename),' for model date = ',rdate
@@ -644,7 +644,7 @@ subroutine restFile_read_consistency_nl( &
              call endrun(msg='ERROR reading finidat_consistency_checks namelist'//errMsg(sourcefile, __LINE__))
           end if
        else
-          call endrun(msg='ERROR finding finidat_consistency_checks namelist'//errMsg(sourcefile, __LINE__))
+          call endrun(msg='ERROR Could not find finidat_consistency_checks namelist'//errMsg(sourcefile, __LINE__))
        end if
        close(nu_nml)
        call relavu( nu_nml )
