Skip to content

Commit

Permalink
Merge pull request ESCOMP#228 from ekluzek/wrkingtools
Browse files Browse the repository at this point in the history
Get tools and their testing working as well as build-namelist testing
  • Loading branch information
ekluzek authored Feb 2, 2018
2 parents d22e3f1 + a6ec443 commit 16c22af
Show file tree
Hide file tree
Showing 18 changed files with 73 additions and 20 deletions.
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,31 @@ CMakeFiles/
# don't ignore cism build utilities directory
!components/cism/**/build

# configure / build files
bld/*CESM_cppdefs
bld/*Filepath
bld/*config_cache.xml

# build-naemlist testing
bld/unit_testers/lnd_in*
bld/unit_testers/drv_flds_in*
bld/unit_testers/temp_file.txt*
bld/unit_testers/user_nl_clm_real_parameters*
bld/unit_testers/env_run.xml

# tools testing output
td.*.status
td.*.log
td.*.status.xFail
test_driver_*.sh

# mksurfdata output
surfdata_*.log
surfdata_*.namelist
clm.input_data_list
clm.input_data_list.previous


# build output
*.o
*.mod
Expand Down
13 changes: 13 additions & 0 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,19 @@ sub check_for_perl_utils {

# 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";

#-----------------------------------------------------------------------------
Expand Down
12 changes: 12 additions & 0 deletions bld/configure
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,18 @@ my %cfg = (); # build configuration
# 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/";

Expand Down
3 changes: 2 additions & 1 deletion bld/queryDefaultNamelist.pl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@

#-----------------------------------------------------------------------------------------------
# Add $cfgdir to the list of paths that Perl searches for modules
my @dirs = ( $cfgdir, "$cfgdir/../../../cime/utils/perl5lib" );
my @dirs = ( "$cfgdir/../cime/utils/perl5lib",
"$cfgdir/../../../cime/utils/perl5lib" );
unshift @INC, @dirs;
my $result = eval "require XML::Lite";
if ( ! defined($result) ) {
Expand Down
1 change: 1 addition & 0 deletions bld/unit_testers/xFail/expectedFail.pm
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ sub _readXml
#-----------------------------------------------------------------------------------------------
# Add $cfgdir to the list of paths that Perl searches for modules
my @dirs = ( $cfgdir, "$cfgdir/perl5lib",
"$cfgdir/../../../cime/utils/perl5lib",
"$cfgdir/../../../../cime/utils/perl5lib"
);
unshift @INC, @dirs;
Expand Down
2 changes: 1 addition & 1 deletion test/tools/TBLCFGtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if [ -n "${BL_ROOT}" ]; then
echo "TBLCFGtools.sh: generating baseline data from root $BL_ROOT - results in $BL_TESTDIR"

echo "TBLCFGtools.sh: calling ****baseline**** TSMCFGtools.sh for smoke test"
bl_dir=`/bin/ls -1d ${BL_ROOT}/components/clm/test/tools`
bl_dir=`/bin/ls -1d ${BL_ROOT}/test/tools`
env CLM_TESTDIR=${BL_TESTDIR} \
CLM_ROOT=${BL_ROOT} \
CLM_SCRIPTDIR=$bl_dir \
Expand Down
2 changes: 1 addition & 1 deletion test/tools/TBLscript_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ if [ -n "${BL_ROOT}" ]; then
echo "TBLscript_tools.sh: generating baseline data from root $BL_ROOT - results in $BL_TESTDIR"

echo "TBLscript_tools.sh: calling ****baseline**** TSMtools.sh for smoke test"
bl_dir=`/bin/ls -1d ${BL_ROOT}/components/clm/test/tools`
bl_dir=`/bin/ls -1d ${BL_ROOT}/test/tools`
env CLM_TESTDIR=${BL_TESTDIR} \
CLM_SCRIPTDIR=$bl_dir \
CLM_ROOT=$BL_ROOT \
Expand Down
2 changes: 1 addition & 1 deletion test/tools/TBLtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ if [ -n "${BL_ROOT}" ]; then
echo "TBLtools.sh: generating baseline data from root $BL_ROOT - results in $BL_TESTDIR"

echo "TBLtools.sh: calling ****baseline**** TSMtools.sh for smoke test"
bl_dir=`/bin/ls -1d ${BL_ROOT}/components/clm/test/tools`
bl_dir=`/bin/ls -1d ${BL_ROOT}/test/tools`
env CLM_TESTDIR=${BL_TESTDIR} \
CLM_ROOT=${BL_ROOT} \
CLM_SCRIPTDIR=$bl_dir \
Expand Down
2 changes: 1 addition & 1 deletion test/tools/TCBCFGtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then
fi
fi

cfgdir=`ls -1d ${CLM_ROOT}/components/clm/tools/${1}*`
cfgdir=`ls -1d ${CLM_ROOT}/tools/${1}*`
blddir=${CLM_TESTDIR}/${test_name}/src
if [ -d ${blddir} ]; then
rm -r ${blddir}
Expand Down
2 changes: 1 addition & 1 deletion test/tools/TCBscripttools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then
fi
fi

cfgdir=`ls -1d ${CLM_ROOT}/components/clm/tools/$1`
cfgdir=`ls -1d ${CLM_ROOT}/tools/$1`
blddir=${CLM_TESTDIR}/${test_name}
if [ -d ${blddir} ]; then
rm -r ${blddir}
Expand Down
2 changes: 1 addition & 1 deletion test/tools/TCBtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then
fi
fi

cfgdir=`ls -1d ${CLM_ROOT}/components/clm/tools/$1`
cfgdir=`ls -1d ${CLM_ROOT}/tools/$1`
blddir=${CLM_TESTDIR}/${test_name}/src
if [ -d ${blddir} ]; then
rm -r ${blddir}
Expand Down
2 changes: 1 addition & 1 deletion test/tools/TSMCFGtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if [ "$CLM_RERUN" != "yes" ] && [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; t
fi
fi

cfgdir=`ls -1d ${CLM_ROOT}/components/clm/tools/${1}*`
cfgdir=`ls -1d ${CLM_ROOT}/tools/${1}*`
rundir=${CLM_TESTDIR}/${test_name}
if [ -d ${rundir} ]; then
rm -r ${rundir}
Expand Down
2 changes: 1 addition & 1 deletion test/tools/TSMncl_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then
fi
fi

cfgdir=`ls -1d ${CLM_ROOT}/components/clm/tools/$1/ncl_scripts`
cfgdir=`ls -1d ${CLM_ROOT}/tools/$1/ncl_scripts`
rundir=${CLM_TESTDIR}/${test_name}
if [ -d ${rundir} ]; then
rm -r ${rundir}
Expand Down
2 changes: 1 addition & 1 deletion test/tools/TSMscript_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then
fi
fi

cfgdir=`ls -1d ${CLM_ROOT}/components/clm/tools/$1`
cfgdir=`ls -1d ${CLM_ROOT}/tools/$1`
rundir=${CLM_TESTDIR}/${test_name}
if [ -d ${rundir} ]; then
rm -r ${rundir}
Expand Down
2 changes: 1 addition & 1 deletion test/tools/TSMtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if [ "$CLM_RERUN" != "yes" ] && [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; t
fi
fi

cfgdir=`ls -1d ${CLM_ROOT}/components/clm/tools/$1`
cfgdir=`ls -1d ${CLM_ROOT}/tools/$1`
rundir=${CLM_TESTDIR}/${test_name}
if [ -d ${rundir} ]; then
rm -r ${rundir}
Expand Down
8 changes: 4 additions & 4 deletions test/tools/input_tests_master
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
smc#4 TSMscript_tools.sh mkprocdata_map mkprocdata_map_wrap mkprocdata_ne30_to_f19_I2000^tools__ds
blc#4 TBLscript_tools.sh mkprocdata_map mkprocdata_map_wrap mkprocdata_ne30_to_f19_I2000^tools__ds

sme14 TSMCFGtools.sh ../../../../cime/tools/mapping/gen_domain CFGtools__ds T31.runoptions
ble14 TBLCFGtools.sh ../../../../cime/tools/mapping/gen_domain CFGtools__ds T31.runoptions
sme@4 TSMCFGtools.sh ../../../../cime/tools/mapping/gen_domain CFGtools__ds ne30.runoptions
ble@4 TBLCFGtools.sh ../../../../cime/tools/mapping/gen_domain CFGtools__ds ne30.runoptions
sme14 TSMCFGtools.sh ../../cime/tools/mapping/gen_domain CFGtools__ds T31.runoptions
ble14 TBLCFGtools.sh ../../cime/tools/mapping/gen_domain CFGtools__ds T31.runoptions
sme@4 TSMCFGtools.sh ../../cime/tools/mapping/gen_domain CFGtools__ds ne30.runoptions
ble@4 TBLCFGtools.sh ../../cime/tools/mapping/gen_domain CFGtools__ds ne30.runoptions

smg54 TSMtools.sh mksurfdata_map tools__s namelist
blg54 TBLtools.sh mksurfdata_map tools__s namelist
Expand Down
8 changes: 4 additions & 4 deletions test/tools/test_driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,15 @@ fi
##establish script dir and clm_root
if [ -f \${initdir}/test_driver.sh ]; then
export CLM_SCRIPTDIR=\`cd \${initdir}; pwd \`
export CLM_ROOT=\`cd \${CLM_SCRIPTDIR}/../../../..; pwd \`
export CLM_ROOT=\`cd \${CLM_SCRIPTDIR}/../..; pwd \`
else
if [ -n "\${CLM_ROOT}" ] && [ -f \${CLM_ROOT}/components/clm/test/tools/test_driver.sh ]; then
export CLM_SCRIPTDIR=\`cd \${CLM_ROOT}/components/clm/test/tools; pwd \`
if [ -n "\${CLM_ROOT}" ] && [ -f \${CLM_ROOT}/test/tools/test_driver.sh ]; then
export CLM_SCRIPTDIR=\`cd \${CLM_ROOT}/test/tools; pwd \`
else
echo "ERROR: unable to determine script directory "
echo " if initiating batch job from directory other than the one containing test_driver.sh, "
echo " you must set the environment variable CLM_ROOT to the full path of directory containing "
echo " <components> and <cime/scripts>. "
echo " <cime/scripts>. "
exit 3
fi
fi
Expand Down
3 changes: 2 additions & 1 deletion tools/mksurfdata_map/mksurfdata.pl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@

#-----------------------------------------------------------------------------------------------
# Add $scrdir to the list of paths that Perl searches for modules
my @dirs = ( $scrdir, "$scrdir/../../../../cime/utils/perl5lib",
my @dirs = ( "$scrdir/../../cime/utils/perl5lib",
"$scrdir/../../../../cime/utils/perl5lib"
);
unshift @INC, @dirs;
my $result = eval "require XML::Lite";
Expand Down

0 comments on commit 16c22af

Please sign in to comment.