Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get tools and their testing working as well as build-namelist testing #228

Merged
merged 5 commits into from
Feb 2, 2018
Merged
Show file tree
Hide file tree
Changes from 4 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: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,24 @@ CMakeFiles/
# don't ignore cism build utilities directory
!components/cism/**/build

# configure / build files
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that all of these new entries are referring to files that appear in specific places in the directory tree? If so, the rules should be more specific, listing the exact paths where these files occur.

Also: I started doing this by having multiple .gitignore files in different places. However, I was just doing some googling, and it sounds like the most common convention is to put everything in this top-level .gitignore file. So I'd like to rework things to do that. So, for example, this entry in src/unit_test_stubs/utils/.gitignore: restUtilMod_stub.F90 would go in the top-level as /src/unit_test_stubs/utils/restUtilMod_stub.F90 (I think it's correct to have this leading slash here: I think this says to match exactly this path). I can do this myself in a following PR if you don't want to deal with it.

CESM_cppdefs
Filepath
config_cache.xml
clm.input_data_list
clm.input_data_list.previous

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

# mksurfdata output
surfdata_*.log
surfdata_*.namelist


# 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
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, "$cfgdir/../../../cime/utils/perl5lib",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this going to first look in $cfgdir/../../../cime/utils/perl5lib, then look in $cfgdir/../cime/utils/perl5lib? If so, I'd change the order of these. My rationale is: If you're within a standalone checkout, there's a chance that there would be an unrelated cime directory at $cfgdir/../../../cime/utils/perl5lib.

"$cfgdir/../cime/utils/perl5lib" );
unshift @INC, @dirs;
my $result = eval "require XML::Lite";
if ( ! defined($result) ) {
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
1 change: 1 addition & 0 deletions tools/mksurfdata_map/mksurfdata.pl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#-----------------------------------------------------------------------------------------------
# Add $scrdir to the list of paths that Perl searches for modules
my @dirs = ( $scrdir, "$scrdir/../../../../cime/utils/perl5lib",
"$scrdir/../../cime/utils/perl5lib"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, I'd change the order of these search paths.

);
unshift @INC, @dirs;
my $result = eval "require XML::Lite";
Expand Down