Remove standard_wrf_dirs and use wildcard for WRF paths#248
Remove standard_wrf_dirs and use wildcard for WRF paths#248IncubatorShokuhou wants to merge 2 commits intowrf-model:developfrom
Conversation
|
However, caution should be used as both options do not appear in version order. The naming is also variable enough that POSIX |
I have abandoned the use of complex regular expressions and have instead opted for more explicit if statements. This should be more convenient for maintenance. |
|
|
Should this be instead? |
|
You're right, I confused the first and last character placement |
|
I'm not sure whether the incorporation of the This may be a bit clearer, since all keys are being sorted in reverse numerical order. |
| WRF_DIR="../WRF" | ||
| else | ||
| # If the WRF directory does not exist or libwrfio_nf.a is not found, search for directories starting with WRF-4 in descending order of version number | ||
| for dir in $(ls .. | grep '^WRF-4' | sort -rV); do |
There was a problem hiding this comment.
Following the discussion on this PR, I'd suggest we change sort -rV to sort -t. -k 1.5,1nr -k 2,2nr -k 3,3nr.
| # find WRF dir | ||
| if [ -e "../WRF/external/io_netcdf/libwrfio_nf.a" ]; then | ||
| echo "Found what looks like a valid WRF I/O library in ../WRF" | ||
| WRF_DIR="../WRF" |
There was a problem hiding this comment.
Here, as well as on lines 212 and 219, I think WRF_DIR should be wrf_dir; otherwise, the check on line 235 will fail.
In this PR, I removed the
standard_wrf_dirsvariable and switched to using regular expressions, so we don't need to modify the WRF directory name or update thestandard_wrf_dirsvariable every time a new version is released.