Skip to content

Commit

Permalink
fix a typo + add result for the surface tests
Browse files Browse the repository at this point in the history
  • Loading branch information
meihuisu committed Mar 14, 2023
1 parent 87faab4 commit c17bd1a
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 10 deletions.
2 changes: 1 addition & 1 deletion conf/template/ucvm_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion examples/programs/surface/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 8 additions & 8 deletions examples/programs/surface/run_ucvm2surface_cvms5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
103 changes: 103 additions & 0 deletions examples/programs/surface/run_ucvm2surface_cvms5_c.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c17bd1a

Please sign in to comment.