|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +#----------------------------------------------------------------------- |
| 4 | +# Create a regional esg grid. Output dominant soil and vegetation |
| 5 | +# categories and well as the percentage of each category. |
| 6 | +# Compare output to a set of baseline files using the 'nccmp' |
| 7 | +# utility. This script is run by the machine specific driver script. |
| 8 | +#----------------------------------------------------------------------- |
| 9 | + |
| 10 | +set -x |
| 11 | + |
| 12 | +TEST_NAME="esg.regional.pct.cat" |
| 13 | +export TEMP_DIR=${WORK_DIR}/${TEST_NAME}.work |
| 14 | +export out_dir=${WORK_DIR}/${TEST_NAME} |
| 15 | + |
| 16 | +export gtype=regional_esg |
| 17 | +export target_lon=-97.5 # Center longitude of the highest resolution tile |
| 18 | +export target_lat=35.5 # Center latitude of the highest resolution tile |
| 19 | +export idim=1301 # Dimension of grid in 'i' direction |
| 20 | +export jdim=600 # Dimension of grid in 'j' direction |
| 21 | +export delx=0.0145 # Grid spacing in degrees in 'i' direction |
| 22 | +export dely=0.0145 # Grid spacing in degrees in 'j' direction |
| 23 | +export halo=3 |
| 24 | +export vegsoilt_frac=.true. # Output dominant soil/veg categories as well |
| 25 | + # as the percentage of each category. |
| 26 | + |
| 27 | +NCCMP=${NCCMP:-$(which nccmp)} |
| 28 | + |
| 29 | +#----------------------------------------------------------------------- |
| 30 | +# Start script. |
| 31 | +#----------------------------------------------------------------------- |
| 32 | + |
| 33 | +echo "Starting at: " `date` |
| 34 | + |
| 35 | +$home_dir/ush/fv3gfs_driver_grid.sh |
| 36 | + |
| 37 | +iret=$? |
| 38 | +if [ $iret -ne 0 ]; then |
| 39 | + set +x |
| 40 | + echo "<<< ESG REGIONAL PERCENT CATEGORY TEST FAILED. <<<" |
| 41 | + exit $iret |
| 42 | +fi |
| 43 | + |
| 44 | +echo "Ending at: " `date` |
| 45 | + |
| 46 | +#----------------------------------------------------------------------------- |
| 47 | +# Compare output to baseline set of data. |
| 48 | +#----------------------------------------------------------------------------- |
| 49 | + |
| 50 | +cd $out_dir/C3113 |
| 51 | + |
| 52 | +test_failed=0 |
| 53 | +for files in *tile*.nc ./fix_sfc/*tile*.nc |
| 54 | +do |
| 55 | + if [ -f $files ]; then |
| 56 | + echo CHECK $files |
| 57 | + $NCCMP -dmfqS $files $HOMEreg/${TEST_NAME}/$files |
| 58 | + iret=$? |
| 59 | + if [ $iret -ne 0 ]; then |
| 60 | + test_failed=1 |
| 61 | + fi |
| 62 | + fi |
| 63 | +done |
| 64 | + |
| 65 | +set +x |
| 66 | +if [ $test_failed -ne 0 ]; then |
| 67 | + echo "<<< ESG REGIONAL PERCENT CATEGORY TEST FAILED. >>>" |
| 68 | + if [ "$UPDATE_BASELINE" = "TRUE" ]; then |
| 69 | + $home_dir/reg_tests/update_baseline.sh "${HOMEreg}/.." "${TEST_NAME}" $commit_num |
| 70 | + fi |
| 71 | +else |
| 72 | + echo "<<< ESG REGIONAL PERCENT CATEGORY TEST PASSED. >>>" |
| 73 | +fi |
| 74 | + |
| 75 | +exit 0 |
0 commit comments