Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ SYNOPSIS
Create the namelist for CLM
REQUIRED OPTIONS
-cimeroot "directory" Path to cime directory
-landroot "directory" Path to the land models parent directory, ie <>/ctsm
-config "filepath" Read the given CLM configuration cache file.
Default: "config_cache.xml".
-configuration "cfg" The overall configuration being used [ clm | nwp ]
Expand Down Expand Up @@ -260,7 +259,6 @@ sub process_commandline {
$nl_flags->{'cmdline'} = "@ARGV\n";

my %opts = ( cimeroot => undef,
landroot => undef,
config => "config_cache.xml",
configuration => undef,
csmdata => undef,
Expand Down Expand Up @@ -302,7 +300,6 @@ sub process_commandline {

GetOptions(
"cimeroot=s" => \$opts{'cimeroot'},
"landroot=s" => \$opts{'landroot'},
"driver=s" => \$opts{'driver'},
"clm_demand=s" => \$opts{'clm_demand'},
"co2_ppmv=f" => \$opts{'co2_ppmv'},
Expand Down Expand Up @@ -5628,9 +5625,9 @@ sub add_default {
# 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 ($is_input_pathname eq 'landroot') {
if ($is_input_pathname eq 'lndroot') {
#my $landroot = $opts->{'landroot'};
$val = set_abs_filepath($val,$opts->{'landroot'});
$val = set_abs_filepath($val,$opts->{'lndroot'});
} else {
if (not defined $settings{'no_abspath'}) {
if (defined $settings{'set_abspath'}) {
Expand Down Expand Up @@ -5714,7 +5711,7 @@ sub check_input_files {
# Need to strip the quotes
$pathname =~ s/['"]//g;
next if ($pathname =~ /UNSET$/);
if ($input_pathname_type eq 'abs') {
if ($input_pathname_type eq 'abs' or $input_pathname_type eq 'lndroot' ) {
if ($inputdata_rootdir) {
if ( $pathname !~ /^\s*$/ ) { # If pathname isn't blank or null
print OUTFILE "$var = $pathname\n";
Expand Down Expand Up @@ -6156,7 +6153,12 @@ sub main {
$log = namelist_files::LogMessages->new( $ProgName, \%opts ); # global
version($cfgdir) if $opts{'version'};
my $cfg = read_configure_definition($cfgdir, \%opts);

# Read in the env_*.xml files
# moved to here from below check_cesm_inputdata() to assign some values that are not from cmdl
my %env_xml = read_envxml_case_files( \%opts );
# we assign it here, so we don't have to pass it around through command line
# this variable is in %opts, so that we don't change lots of add_default calls.
$opts{'lndroot'} = $env_xml{'COMP_ROOT_DIR_LND'};
my $physv = config_files::clm_phys_vers->new( $cfg->get('phys') );
my $definition = read_namelist_definition($cfgdir, \%opts, \%nl_flags);
my $defaults = read_namelist_defaults($cfgdir, \%opts, \%nl_flags, $cfg);
Expand All @@ -6172,8 +6174,6 @@ sub main {

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 );
Expand Down
2 changes: 1 addition & 1 deletion bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ constants for biogeochem modules
</entry>

<entry id="fates_paramfile" type="char*512" category="datasets"
input_pathname="landroot" group="clm_inparm" valid_values="" >
input_pathname="lndroot" group="clm_inparm" valid_values="" >
Full pathname datafile with fates parameters
(Only relevant if FATES is on).
</entry>
Expand Down
3 changes: 1 addition & 2 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -379,15 +379,14 @@ def buildnml(case, caseroot, compname):
cmd = os.path.join(lnd_root, "bld", "build-namelist")

command = (
'%s -cimeroot %s -landroot %s -infile %s -csmdata %s -inputdata %s %s -namelist "&clm_inparm start_ymd=%s %s/ " '
'%s -cimeroot %s -infile %s -csmdata %s -inputdata %s %s -namelist "&clm_inparm start_ymd=%s %s/ " '
"%s %s -res %s %s -clm_start_type %s -envxml_dir %s "
"-configuration %s -structure %s "
"%s -glc_nec %s %s -co2_ppmv %s -co2_type %s -config %s -driver %s "
"%s %s %s %s"
% (
cmd,
_CIMEROOT,
lnd_root,
infile,
din_loc_root,
inputdata_file,
Expand Down
Loading