Skip to content

Commit

Permalink
fix issue in perl cice path was corrupted
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Aug 17, 2016
1 parent b33c9e1 commit 4107bad
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
3 changes: 3 additions & 0 deletions components/data_comps/dice/bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ if (defined $opts{'infile'}) {

my %xmlvars = ();
SetupTools::getxmlvars(${CASEROOT},\%xmlvars);
# need to expand DIN_LOC_ROOT first
$xmlvars{DIN_LOC_ROOT}=SetupTools::expand_xml_var($xmlvars{DIN_LOC_ROOT}, \%xmlvars);

foreach my $attr (keys %xmlvars) {
$xmlvars{$attr} = SetupTools::expand_xml_var($xmlvars{$attr}, \%xmlvars);
}
Expand Down
13 changes: 8 additions & 5 deletions utils/perl5lib/Streams/TemplateGeneric.pm
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,9 @@ sub GetDataFilenames {
#
# Get path
#

my $filepath = $self->GetDataFilepath( $type );

my $key = "fileNames";
my $info;
if ( $type eq "data" ) {
Expand Down Expand Up @@ -463,8 +465,8 @@ sub GetDataFilepath {
if ( ! defined($self->{'template'}) ) {
die "${nm}:: a template has NOT been read in yet -- abort.\n";
}
my $defaults_ref = $self->{'defaults'};
my %defaults = %$defaults_ref;
my %defaults = %{$self->{'defaults'}};

my $key;
if ( $type eq "data" ) {
$key = "fieldInfo";
Expand All @@ -473,13 +475,14 @@ sub GetDataFilepath {
} else {
die "${nm}:: bad input type to method: $type should be data or domain\n";
}

my $Info_ref = $defaults{$key};

if ( ref($Info_ref) ne "HASH" ) {
die "${nm}:: $key is NOT a hash -- something must have went wrong in the Read\n";
}
my %Info = %$Info_ref;
my $filepath = $self->__Sub__( $Info_ref, 'filePath');

my $filepath = $self->__Sub__( $Info_ref, 'filePath');
return( $filepath );
}

Expand All @@ -490,7 +493,6 @@ sub expandXMLVar {
my $value = shift;
my $varhash_ref = shift;
my $nm = "expandXMLVar";

if ( ! defined($value) ) {
die "${nm}:: a value was NOT input\n";
}
Expand Down Expand Up @@ -559,6 +561,7 @@ sub __Sub__ {
my $lastmonth = $opts{'lastmonth'};

my $value = $$Info_ref{$name};

$value =~ s/^[ \n]+//; # remove leading spaces
$value =~ s/[ \n]+$//; # remove ending spaces

Expand Down
4 changes: 3 additions & 1 deletion utils/python/CIME/buildnml.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ def _build_data_nml(case, caseroot, compclass):

rc, out, err = run_cmd(cmd, from_dir=confdir)
expect(rc==0,"Command %s failed rc=%d\nout=%s\nerr=%s"%(cmd,rc,out,err))

if out is not None:
logger.debug("cmd=%s"%cmd)
logger.info("out = %s"%out)
# copy namelist files and stream text files, to rundir
if os.path.isdir(rundir):
filename = compname + "_in"
Expand Down
2 changes: 0 additions & 2 deletions utils/python/CIME/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,6 @@ def create_clone(self, newcase, keepexe=False, mach_dir=None, project=None):
# create clone from self to case
clone_cimeroot = self.get_value("CIMEROOT")
if newcase_cimeroot != clone_cimeroot:
case_branch = get_current_branch(clone_cimeroot)
clone_branch = get_current_branch(newcase_cimeroot)
logger.warning(" case CIMEROOT is %s " %newcase_cimeroot)
logger.warning(" clone CIMEROOT is %s " %clone_cimeroot)
logger.warning(" It is NOT recommended to clone cases from different versions of CIME.")
Expand Down

0 comments on commit 4107bad

Please sign in to comment.