diff --git a/.gitignore b/.gitignore index 7ec31341da..26dc864032 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 45431c9323..16882b0e50 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -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"; #----------------------------------------------------------------------------- diff --git a/bld/configure b/bld/configure index b333259a98..fb5fe9bf7f 100755 --- a/bld/configure +++ b/bld/configure @@ -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/"; diff --git a/bld/queryDefaultNamelist.pl b/bld/queryDefaultNamelist.pl index 97cd3d4394..eab81301d0 100755 --- a/bld/queryDefaultNamelist.pl +++ b/bld/queryDefaultNamelist.pl @@ -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) ) { diff --git a/bld/unit_testers/xFail/expectedFail.pm b/bld/unit_testers/xFail/expectedFail.pm index 04fc32726f..3e072f57bf 100755 --- a/bld/unit_testers/xFail/expectedFail.pm +++ b/bld/unit_testers/xFail/expectedFail.pm @@ -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; diff --git a/test/tools/TBLCFGtools.sh b/test/tools/TBLCFGtools.sh index e519ccdab1..6276c885e2 100755 --- a/test/tools/TBLCFGtools.sh +++ b/test/tools/TBLCFGtools.sh @@ -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 \ diff --git a/test/tools/TBLscript_tools.sh b/test/tools/TBLscript_tools.sh index 2b5a4b26ea..ff7afb0cd7 100755 --- a/test/tools/TBLscript_tools.sh +++ b/test/tools/TBLscript_tools.sh @@ -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 \ diff --git a/test/tools/TBLtools.sh b/test/tools/TBLtools.sh index 80826cff8f..555ea7d1be 100755 --- a/test/tools/TBLtools.sh +++ b/test/tools/TBLtools.sh @@ -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 \ diff --git a/test/tools/TCBCFGtools.sh b/test/tools/TCBCFGtools.sh index 26a2795138..3b7e6fc9d3 100755 --- a/test/tools/TCBCFGtools.sh +++ b/test/tools/TCBCFGtools.sh @@ -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} diff --git a/test/tools/TCBscripttools.sh b/test/tools/TCBscripttools.sh index df2389da9f..6153684e3d 100755 --- a/test/tools/TCBscripttools.sh +++ b/test/tools/TCBscripttools.sh @@ -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} diff --git a/test/tools/TCBtools.sh b/test/tools/TCBtools.sh index 63a01b4f91..b0ea9e4a87 100755 --- a/test/tools/TCBtools.sh +++ b/test/tools/TCBtools.sh @@ -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} diff --git a/test/tools/TSMCFGtools.sh b/test/tools/TSMCFGtools.sh index f65500a62d..b667a4c6ec 100755 --- a/test/tools/TSMCFGtools.sh +++ b/test/tools/TSMCFGtools.sh @@ -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} diff --git a/test/tools/TSMncl_tools.sh b/test/tools/TSMncl_tools.sh index 8b921604c1..eb82142e4d 100755 --- a/test/tools/TSMncl_tools.sh +++ b/test/tools/TSMncl_tools.sh @@ -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} diff --git a/test/tools/TSMscript_tools.sh b/test/tools/TSMscript_tools.sh index 00aa7b434e..7cd94afde7 100755 --- a/test/tools/TSMscript_tools.sh +++ b/test/tools/TSMscript_tools.sh @@ -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} diff --git a/test/tools/TSMtools.sh b/test/tools/TSMtools.sh index cb82679997..33a2316973 100755 --- a/test/tools/TSMtools.sh +++ b/test/tools/TSMtools.sh @@ -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} diff --git a/test/tools/input_tests_master b/test/tools/input_tests_master index 304409c6b7..82564fc2f9 100644 --- a/test/tools/input_tests_master +++ b/test/tools/input_tests_master @@ -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 diff --git a/test/tools/test_driver.sh b/test/tools/test_driver.sh index b37d7f8054..364c629579 100755 --- a/test/tools/test_driver.sh +++ b/test/tools/test_driver.sh @@ -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 " and . " + echo " . " exit 3 fi fi diff --git a/tools/mksurfdata_map/mksurfdata.pl b/tools/mksurfdata_map/mksurfdata.pl index 422b614fed..9670bafc7e 100755 --- a/tools/mksurfdata_map/mksurfdata.pl +++ b/tools/mksurfdata_map/mksurfdata.pl @@ -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";