check for unitialized AS variables
When a variable is uninitialized in the AS configuration, there is currently no way to detect it and this leads to unexpected results.
for example this code snippet :
[[ "%LPJG_CONFIG%" = *[!\ ]* ]] && lpjg=%LPJG_CONFIG% || lpjg=""
leads to the following result if LPJG_CONFIG is not defined:
lpjg=%LPJG_CONFIG%
whereas I would like lpjg="" as a result.
For the NFIXYR variable in auto-ecearth we use this workaround in test_model but it only works because we expect it to be a number, so it would not work in this case where we expect a string.
if [[ -z $NFIXYR ]]; then
echo $error_NFIXYR && get_out=true
else
if !(( $NFIXYR >= 0 )); then echo $error_NFIXYR; get_out=true; fi
fi
Can I please have a fast answer @dmanubens @lbatista ? Thanks