Interesting error. I cannot explain without testing this exact date with the mesonet option on our end.
The scripting was done to skip over dates where MADIS files are missing. But apparently that is not air tight for the code you have installed. I did have an issue some time back. Maybe 2 years ago where empty MADIS files were being downloaded and that passed through the file.exist() check function. Not sure that applies here because you hit the final check of the file where it skips if not present.
I did make an update though to check on whether or not the file is empty. Just not sure what version of the code you have. Which of the below fits what you have installed?
The old version would look something like this (R_db_code/MET_observation.read.R):
New version looks like this:
You can see a check on file size is done and if it is empty, the downloaded file is deleted and that triggers the script to push NA back to the main script where it skips that time.
At any rate, I did look at MADIS and this is the listing for Jul 6, 2017 mesonet. You can see the files for 0200 and 0300 UTC are odd size compared to the rest. This has me thinking that the files may have some issues. I’ll have to just test on our system.
With all of this said, there is a way to skip this time. With this option in your matching_surface.csh script. So for your case you’d run until the error at 0200 UTC. You can then set the first element in this SKIPIND array below to UTC hour+ 1. SO in the cast of your 0200 UTC fail, you can change 1 to 3 and the script will start off on time index 3 of the WRF output. If you leave the second element of the array as 1, all WRF outputs after the first one will reset back to time index 1.
setenv SKIPIND “1 1”
setenv SKIPIND “2 1”