From c17bd1a67451cd1cad512e144f046bb51ca21f83 Mon Sep 17 00:00:00 2001 From: meihuisu Date: Tue, 14 Mar 2023 05:10:05 +0000 Subject: [PATCH] fix a typo + add result for the surface tests --- conf/template/ucvm_env.py | 2 +- examples/programs/surface/Makefile.am | 2 +- .../surface/run_ucvm2surface_cvms5.sh | 16 +-- .../surface/run_ucvm2surface_cvms5_c.sh | 103 ++++++++++++++++++ 4 files changed, 113 insertions(+), 10 deletions(-) create mode 100755 examples/programs/surface/run_ucvm2surface_cvms5_c.sh diff --git a/conf/template/ucvm_env.py b/conf/template/ucvm_env.py index f789b41..051760e 100644 --- a/conf/template/ucvm_env.py +++ b/conf/template/ucvm_env.py @@ -36,7 +36,7 @@ def setup_ucvm_env(): add2DYLD_LIBRARY_PATH(i) llist = [ %%UCVM_expandedLibrariesToInstall% ] - for i in list: + for i in llist: add2LD_LIBRARY_PATH(i) add2DYLD_LIBRARY_PATH(i) diff --git a/examples/programs/surface/Makefile.am b/examples/programs/surface/Makefile.am index 3d57932..16fa63e 100644 --- a/examples/programs/surface/Makefile.am +++ b/examples/programs/surface/Makefile.am @@ -6,7 +6,7 @@ bin_PROGRAMS= if UCVM_AM_ENABLE_CVMS5 bin_PROGRAMS += run_ucvm2surface_cvms5.sh run_ucvm2surface_cvms5_sh_SOURCES = run_ucvm2surface_cvms5.sh -bin_PROGRAMS += run_ucvm2surface_cvms5.sh +bin_PROGRAMS += run_ucvm2surface_cvms5_c.sh run_ucvm2surface_cvms5_c_sh_SOURCES = run_ucvm2surface_cvms5_c.sh endif diff --git a/examples/programs/surface/run_ucvm2surface_cvms5.sh b/examples/programs/surface/run_ucvm2surface_cvms5.sh index baf7c0b..a952d20 100755 --- a/examples/programs/surface/run_ucvm2surface_cvms5.sh +++ b/examples/programs/surface/run_ucvm2surface_cvms5.sh @@ -66,18 +66,18 @@ Using Geo Depth coordinates as default mode. -118.0642 34.2264 1000.000 1702.420 732.543 cvms5 4516.494 2413.833 2401.533 none 0.000 0.000 0.000 crust 4516.494 2413.833 2401.533 -118.0642 34.2264 10000.000 1702.420 732.543 cvms5 7047.448 4105.768 3019.017 none 0.000 0.000 0.000 crust 7047.448 4105.768 3019.017 Using Geo Depth coordinates as default mode. - -118.0000 34.0000 0.000 284.191 580.043 cvms5 2330.951 1188.185 2175.341 elygtl 0.000 580.043 0.000 taper 1700.000 500.000 1700.000 - -118.0000 34.0000 50.000 284.191 580.043 cvms5 2330.951 1188.185 2175.341 elygtl 0.000 580.043 0.000 taper 2356.576 817.904 2046.195 - -118.0000 34.0000 100.000 284.191 580.043 cvms5 2330.951 1188.185 2175.341 elygtl 0.000 580.043 0.000 taper 2521.668 963.692 2099.876 - -118.0000 34.0000 500.000 284.191 580.043 cvms5 2533.943 1307.287 2212.444 none 0.000 0.000 0.000 crust 2533.943 1307.287 2212.444 + -118.0000 34.0000 0.000 284.191 580.043 cvms5 2759.422 1496.229 2259.886 elygtl 0.000 580.043 0.000 taper 1700.000 500.000 1700.000 + -118.0000 34.0000 50.000 284.191 580.043 cvms5 2759.422 1496.229 2259.886 elygtl 0.000 580.043 0.000 taper 2156.420 725.405 1971.727 + -118.0000 34.0000 100.000 284.191 580.043 cvms5 2759.422 1496.229 2259.886 elygtl 0.000 580.043 0.000 taper 2452.764 887.057 2078.259 + -118.0000 34.0000 500.000 284.191 580.043 cvms5 2759.422 1496.229 2259.886 elygtl 0.000 580.043 0.000 taper 2533.943 1307.287 2212.444 -118.0000 34.0000 1000.000 284.191 580.043 cvms5 3097.641 1779.642 2312.024 none 0.000 0.000 0.000 crust 3097.641 1779.642 2312.024 Using Geo Depth coordinates as default mode. - -118.2851 34.0223 0.000 56.230 342.859 cvms5 2104.002 1038.465 2119.108 elygtl 0.000 342.859 0.000 taper 1700.000 500.000 1700.000 - -118.2851 34.0223 100.000 56.230 342.859 cvms5 2104.002 1038.465 2119.108 elygtl 0.000 342.859 0.000 taper 2141.855 711.403 1965.867 + -118.2851 34.0223 0.000 56.230 342.859 cvms5 2325.472 1177.614 2171.739 elygtl 0.000 342.859 0.000 taper 2294.078 500.000 1700.000 + -118.2851 34.0223 100.000 56.230 342.859 cvms5 2325.472 1177.614 2171.739 elygtl 0.000 342.859 0.000 taper 2016.826 590.154 1912.899 -118.2851 34.0223 1000.000 56.230 342.859 cvms5 2453.579 1298.713 2209.976 none 0.000 0.000 0.000 crust 2453.579 1298.713 2209.976 -118.2851 34.0223 10000.000 56.230 342.859 cvms5 6570.111 3702.746 2804.834 none 0.000 0.000 0.000 crust 6570.111 3702.746 2804.834 - -118.0642 34.2264 0.000 1702.420 732.543 cvms5 3492.268 1862.906 2324.520 elygtl 0.000 732.543 0.000 taper 1700.000 500.000 1700.000 - -118.0642 34.2264 100.000 1702.420 732.543 cvms5 3492.268 1862.906 2324.520 elygtl 0.000 732.543 0.000 taper 2021.212 1131.715 2155.472 + -118.0642 34.2264 0.000 1702.420 732.543 cvms5 4431.538 2346.506 2391.249 elygtl 0.000 732.543 0.000 taper 1700.000 500.000 1700.000 + -118.0642 34.2264 100.000 1702.420 732.543 cvms5 4431.538 2346.506 2391.249 elygtl 0.000 732.543 0.000 taper 2021.212 1131.715 2155.472 -118.0642 34.2264 1000.000 1702.420 732.543 cvms5 4516.494 2413.833 2401.533 none 0.000 0.000 0.000 crust 4516.494 2413.833 2401.533 -118.0642 34.2264 10000.000 1702.420 732.543 cvms5 7047.448 4105.768 3019.017 none 0.000 0.000 0.000 crust 7047.448 4105.768 3019.017 EOF_EXPECTED_RESULT diff --git a/examples/programs/surface/run_ucvm2surface_cvms5_c.sh b/examples/programs/surface/run_ucvm2surface_cvms5_c.sh new file mode 100755 index 0000000..a237140 --- /dev/null +++ b/examples/programs/surface/run_ucvm2surface_cvms5_c.sh @@ -0,0 +1,103 @@ +#!/bin/bash + +## run_ucvm2surface_cvmsi.sh + +if [ -z "$UCVM_INSTALL_PATH" ]; then + echo "Need to set UCVM_INSTALL_PATH to run >" ${0##*/} + exit +fi +source $UCVM_INSTALL_PATH/conf/ucvm_env.sh + +BIN_DIR=${UCVM_INSTALL_PATH}/bin +CONF_DIR=${UCVM_INSTALL_PATH}/conf +TEST_DIR=${UCVM_INSTALL_PATH}/tests/inputs +## no GTL +noGTL=cvms5 +## with Ely +elyGTL=cvms5,elygtl:ely +## with Taper +taperGTL=cvms5,elygtl:taper + +expect=$(mktemp) || exit 1 +result=$(mktemp) || (trap 'rm -f "$expect"'; exit 1) + +## +MODEL=${noGTL} +${BIN_DIR}/ucvm_query -c gd -m ${MODEL} -f ${CONF_DIR}/ucvm.conf < ${TEST_DIR}/test_latlons_cvms5_gd.txt >> $result 2>&1 +${BIN_DIR}/ucvm_query -c ge -m ${MODEL} -f ${CONF_DIR}/ucvm.conf < ${TEST_DIR}/test_latlons_cvms5_ge.txt >> $result 2>&1 + +MODEL=${elyGTL} +${BIN_DIR}/ucvm_query -c gd -m ${MODEL} -f ${CONF_DIR}/ucvm.conf < ${TEST_DIR}/test_latlons_cvms5_gd.txt >> $result 2>&1 +${BIN_DIR}/ucvm_query -c ge -m ${MODEL} -f ${CONF_DIR}/ucvm.conf < ${TEST_DIR}/test_latlons_cvms5_ge.txt >> $result 2>&1 + +MODEL=${taperGTL} +${BIN_DIR}/ucvm_query -c gd -m ${MODEL} -f ${CONF_DIR}/ucvm.conf < ${TEST_DIR}/test_latlons_cvms5_gd.txt >> $result 2>&1 +${BIN_DIR}/ucvm_query -c ge -m ${MODEL} -f ${CONF_DIR}/ucvm.conf < ${TEST_DIR}/test_latlons_cvms5_ge.txt >> $result 2>&1 + +cat > $expect << EOF_EXPECTED_RESULT +Using Geo Depth coordinates as z mode. + -118.2851 34.0223 0.000 56.230 342.859 cvms5 1786.518 902.161 2057.181 none 0.000 0.000 0.000 crust 1786.518 902.161 2057.181 + -118.2851 34.0223 100.000 56.230 342.859 cvms5 1877.227 941.105 2076.003 none 0.000 0.000 0.000 crust 1877.227 941.105 2076.003 + -118.2851 34.0223 1000.000 56.230 342.859 cvms5 2453.579 1298.713 2209.976 none 0.000 0.000 0.000 crust 2453.579 1298.713 2209.976 + -118.2851 34.0223 10000.000 56.230 342.859 cvms5 6570.111 3702.746 2804.834 none 0.000 0.000 0.000 crust 6570.111 3702.746 2804.834 + -118.0642 34.2264 0.000 1702.420 732.543 cvms5 1432.789 839.239 2024.749 none 0.000 0.000 0.000 crust 1432.789 839.239 2024.749 + -118.0642 34.2264 100.000 1702.420 732.543 cvms5 2021.212 1131.715 2155.472 none 0.000 0.000 0.000 crust 2021.212 1131.715 2155.472 + -118.0642 34.2264 1000.000 1702.420 732.543 cvms5 4516.494 2413.833 2401.533 none 0.000 0.000 0.000 crust 4516.494 2413.833 2401.533 + -118.0642 34.2264 10000.000 1702.420 732.543 cvms5 7047.448 4105.768 3019.017 none 0.000 0.000 0.000 crust 7047.448 4105.768 3019.017 +Using Geo Elevation coordinates as z mode. + -118.2851 34.0223 56.230 56.230 342.859 cvms5 1786.518 902.161 2057.181 none 0.000 0.000 0.000 crust 1786.518 902.161 2057.181 + -118.2851 34.0223 -43.770 56.230 342.859 cvms5 1877.228 941.105 2076.003 none 0.000 0.000 0.000 crust 1877.228 941.105 2076.003 + -118.2851 34.0223 -943.770 56.230 342.859 cvms5 2453.579 1298.713 2209.976 none 0.000 0.000 0.000 crust 2453.579 1298.713 2209.976 + -118.2851 34.0223 -9943.770 56.230 342.859 cvms5 6570.111 3702.746 2804.834 none 0.000 0.000 0.000 crust 6570.111 3702.746 2804.834 + -118.0642 34.2264 1702.281 1702.420 732.543 cvms5 1433.605 839.644 2024.967 none 0.000 0.000 0.000 crust 1433.605 839.644 2024.967 + -118.0642 34.2264 1602.281 1702.420 732.543 cvms5 2022.028 1132.121 2155.620 none 0.000 0.000 0.000 crust 2022.028 1132.121 2155.620 + -118.0642 34.2264 702.281 1702.420 732.543 cvms5 4516.580 2413.903 2401.544 none 0.000 0.000 0.000 crust 4516.580 2413.903 2401.544 + -118.0642 34.2264 -8297.719 1702.420 732.543 cvms5 7047.434 4105.757 3019.011 none 0.000 0.000 0.000 crust 7047.434 4105.757 3019.011 +Using Geo Depth coordinates as z mode. + -118.2851 34.0223 0.000 56.230 342.859 cvms5 2104.002 1038.465 2119.108 elygtl 0.000 342.859 0.000 ely 786.545 171.429 1045.579 + -118.2851 34.0223 100.000 56.230 342.859 cvms5 2104.002 1038.465 2119.108 elygtl 0.000 342.859 0.000 ely 2141.855 711.403 1965.867 + -118.2851 34.0223 1000.000 56.230 342.859 cvms5 2453.579 1298.713 2209.976 none 0.000 0.000 0.000 crust 2453.579 1298.713 2209.976 + -118.2851 34.0223 10000.000 56.230 342.859 cvms5 6570.111 3702.746 2804.834 none 0.000 0.000 0.000 crust 6570.111 3702.746 2804.834 + -118.0642 34.2264 0.000 1702.420 732.543 cvms5 3492.268 1862.906 2324.520 elygtl 0.000 732.543 0.000 ely 1066.624 366.272 1310.779 + -118.0642 34.2264 100.000 1702.420 732.543 cvms5 3492.268 1862.906 2324.520 elygtl 0.000 732.543 0.000 ely 3174.077 1369.878 2259.906 + -118.0642 34.2264 1000.000 1702.420 732.543 cvms5 4516.494 2413.833 2401.533 none 0.000 0.000 0.000 crust 4516.494 2413.833 2401.533 + -118.0642 34.2264 10000.000 1702.420 732.543 cvms5 7047.448 4105.768 3019.017 none 0.000 0.000 0.000 crust 7047.448 4105.768 3019.017 +Using Geo Elevation coordinates as z mode. + -118.2851 34.0223 56.230 56.230 342.859 cvms5 2104.002 1038.465 2119.108 elygtl 0.000 342.859 0.000 ely 789.123 171.992 1048.246 + -118.2851 34.0223 -43.770 56.230 342.859 cvms5 2104.002 1038.465 2119.108 elygtl 0.000 342.859 0.000 ely 2141.855 711.403 1965.868 + -118.2851 34.0223 -943.770 56.230 342.859 cvms5 2453.579 1298.713 2209.976 none 0.000 0.000 0.000 crust 2453.579 1298.713 2209.976 + -118.2851 34.0223 -9943.770 56.230 342.859 cvms5 6570.111 3702.746 2804.834 none 0.000 0.000 0.000 crust 6570.111 3702.746 2804.834 + -118.0642 34.2264 1702.281 1702.420 732.543 cvms5 3492.268 1862.906 2324.520 elygtl 0.000 732.543 0.000 ely 1192.090 409.794 1414.651 + -118.0642 34.2264 1602.281 1702.420 732.543 cvms5 3492.268 1862.906 2324.520 elygtl 0.000 732.543 0.000 ely 3174.726 1370.439 2260.033 + -118.0642 34.2264 702.281 1702.420 732.543 cvms5 4516.580 2413.903 2401.544 none 0.000 0.000 0.000 crust 4516.580 2413.903 2401.544 + -118.0642 34.2264 -8297.719 1702.420 732.543 cvms5 7047.434 4105.757 3019.011 none 0.000 0.000 0.000 crust 7047.434 4105.757 3019.011 +Using Geo Depth coordinates as z mode. + -118.2851 34.0223 0.000 56.230 342.859 cvms5 2325.472 1177.614 2171.739 elygtl 0.000 342.859 0.000 taper 2294.078 500.000 1700.000 + -118.2851 34.0223 100.000 56.230 342.859 cvms5 2325.472 1177.614 2171.739 elygtl 0.000 342.859 0.000 taper 2016.826 590.154 1912.899 + -118.2851 34.0223 1000.000 56.230 342.859 cvms5 2453.579 1298.713 2209.976 none 0.000 0.000 0.000 crust 2453.579 1298.713 2209.976 + -118.2851 34.0223 10000.000 56.230 342.859 cvms5 6570.111 3702.746 2804.834 none 0.000 0.000 0.000 crust 6570.111 3702.746 2804.834 + -118.0642 34.2264 0.000 1702.420 732.543 cvms5 4431.538 2346.506 2391.249 elygtl 0.000 732.543 0.000 taper 1700.000 500.000 1700.000 + -118.0642 34.2264 100.000 1702.420 732.543 cvms5 4431.538 2346.506 2391.249 elygtl 0.000 732.543 0.000 taper 2021.212 1131.715 2155.472 + -118.0642 34.2264 1000.000 1702.420 732.543 cvms5 4516.494 2413.833 2401.533 none 0.000 0.000 0.000 crust 4516.494 2413.833 2401.533 + -118.0642 34.2264 10000.000 1702.420 732.543 cvms5 7047.448 4105.768 3019.017 none 0.000 0.000 0.000 crust 7047.448 4105.768 3019.017 +Using Geo Elevation coordinates as z mode. + -118.2851 34.0223 56.230 56.230 342.859 cvms5 2325.472 1177.614 2171.739 elygtl 0.000 342.859 0.000 taper 2294.075 500.000 1700.000 + -118.2851 34.0223 -43.770 56.230 342.859 cvms5 2325.472 1177.614 2171.739 elygtl 0.000 342.859 0.000 taper 2016.827 590.154 1912.899 + -118.2851 34.0223 -943.770 56.230 342.859 cvms5 2453.579 1298.713 2209.976 none 0.000 0.000 0.000 crust 2453.579 1298.713 2209.976 + -118.2851 34.0223 -9943.770 56.230 342.859 cvms5 6570.111 3702.746 2804.834 none 0.000 0.000 0.000 crust 6570.111 3702.746 2804.834 + -118.0642 34.2264 1702.281 1702.420 732.543 cvms5 4431.538 2346.506 2391.249 elygtl 0.000 732.543 0.000 taper 1700.000 500.000 1700.000 + -118.0642 34.2264 1602.281 1702.420 732.543 cvms5 4431.538 2346.506 2391.249 elygtl 0.000 732.543 0.000 taper 2022.028 1132.121 2155.620 + -118.0642 34.2264 702.281 1702.420 732.543 cvms5 4516.580 2413.903 2401.544 none 0.000 0.000 0.000 crust 4516.580 2413.903 2401.544 + -118.0642 34.2264 -8297.719 1702.420 732.543 cvms5 7047.434 4105.757 3019.011 none 0.000 0.000 0.000 crust 7047.434 4105.757 3019.011 +EOF_EXPECTED_RESULT + +echo "Running examples_programs_surface ucvm2surface_cvms5_c" +if diff $result $expect > /dev/null 2>&1 +then + echo [SUCCESS] +else + echo [FAILURE] +fi + +trap 'rm -f "$expect" "$result"' exit +