<div dir="ltr"><div><div><div><div><div><div>Hi John,<br><br></div>I'm seeing the same result. Its not clear to me that the site you refer to is an OpenDAP site? Do you know it to be one? I found some (possibly stale) info that suggested a DODS server would response with headers indicating it was a dods server:<br><br>(<a href="https://www.opendap.org/support/faq/server/test-dods">https://www.opendap.org/support/faq/server/test-dods</a>)<br><br></div>When I run:<br><br> wget -S <a href="http://nomads.ncep.noaa.gov:80">http://nomads.ncep.noaa.gov:80</a><br><br></div>I get:<br><br>-2018-04-05 19:52:17-- <a href="http://nomads.ncep.noaa.gov/">http://nomads.ncep.noaa.gov/</a><br>Resolving <a href="http://nomads.ncep.noaa.gov">nomads.ncep.noaa.gov</a> (<a href="http://nomads.ncep.noaa.gov">nomads.ncep.noaa.gov</a>)... 140.172.138.18<br>Connecting to <a href="http://nomads.ncep.noaa.gov">nomads.ncep.noaa.gov</a> (<a href="http://nomads.ncep.noaa.gov">nomads.ncep.noaa.gov</a>)|140.172.138.18|:80... connected.<br>HTTP request sent, awaiting response...<br> HTTP/1.1 200 OK<br> Date: Fri, 06 Apr 2018 01:54:09 GMT<br> Server: Apache<br> X-Frame-Options: SAMEORIGIN<br> X-Content-Type-Options: nosniff<br> X-XSS-Protection: 1; mode=block<br> Accept-Ranges: bytes<br> Cache-Control: max-age=14400<br> Expires: Fri, 06 Apr 2018 05:54:09 GMT<br> Vary: Accept-Encoding<br> Keep-Alive: timeout=300, max=100<br> Connection: Keep-Alive<br> Transfer-Encoding: chunked<br> Content-Type: text/html; charset=UTF-8<br>Length: unspecified [text/html]<br>Saving to: ‘index.html’<br><br> [ <=> ] 55,810 275KB/s in 0.2s<br><br>2018-04-05 19:52:18 (275 KB/s) - ‘index.html’ saved [55810]<br><br></div>which sort of indicates its just a generic web server. <br><br></div>I'm not an expert in this, just trying to help trouble shoot...<br></div>Rick<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 5, 2018 at 1:45 PM, Jon Meyer <span dir="ltr"><<a href="mailto:jonathan.meyer@aggiemail.usu.edu" target="_blank">jonathan.meyer@aggiemail.usu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Good day,<br><br></div>For several years I've used ncl's opendap functionality to access current operational NWP output from NOMADS servers to produce custom forecasting charts. (currently running most recent NCLv6.4.0. I've discovered that the opendap server lags a bit behind in hosting the most recent data when compared to grib2 data hosted on a different NOMADS server and hence decided to switch to the faster available data.<br><br></div>When modifying my ncl code to search the new server for grib2 data, I found the isfilepresent function is unable to successfully assess if these grib2 files are present. I've tried the fileexists function as well with similar results.<br><br></div>This is odd because I can hardcode wget code to successfully download from the same URL that both isfilepresent and fileexist functions return "False" on. I've confirmed the URLs are correct but can't get these ncl checks to work. My code is automated and runs as a cron-job, so I need a way to identify when the most recent files are populated on the servers without hardcoding.<br><br></div>My understanding is that grib2 is a supported file that isfilepresent should be capable of seeing--it worked great for the opendap servers. Perhaps there is something on the NOMADS side that prevents the file check, but given wget works without any certificate/user checks I would assume the issues lies on my end? I'm sure this is something minor that my tired eyes just aren't picking up on.<br><br><br><br></div>Here's a code snipit from part of the function doing this. Notice I've hardcoded in a valid URL for testing. This same URL will work in wget and manually pasting into browser. Here it is directly for any testing on your end. (note for readers coming across this down the road: there is a 7 day buffer after which the link should become void as new data replaces it.)<br><br>
<a href="http://nomads.ncep.noaa.gov/pub/data/nccf/com/nam/prod/nam.20180405/nam.t00z.awphys00.tm00.grib2" target="_blank">http://nomads.ncep.noaa.gov/<wbr>pub/data/nccf/com/nam/prod/<wbr>nam.20180405/nam.t00z.<wbr>awphys00.tm00.grib2</a>
<br><br></div>Any help is much appreciated!<br><div><br></div><div>SNIP==========================<wbr>==============================<wbr>======<br></div><div><br><br>;----CHECK IF MOST RECENT TIME HAS OUTPUT AVAILABLE<br>;----IF NOT, WORK BACKWARDS TO IDENTIFY MOST RECENT AVAILABLE DATE<br> MostRecent_Julian = toint(cd_inv_calendar(toint(<wbr>yyyy_current),mm_ind,toint(dd_<wbr>current),toint(<wbr>MostRecentInterval),0,0,units,<wbr>0))<br> MostRecent_Julian@units = units<br><br> ct = 0<br> do t = MostRecent_Julian, 0, 6<br> CheckTime = MostRecent_Julian - ct<br> CheckTime@units = units<br><br> MostRecent_UTC = cd_calendar(CheckTime,-3)<br><br> MostRecent_YYYYMMDD = str_get_cols(tostring(<wbr>MostRecent_UTC), 0, 7)<br> MostRecent_file = "nam.t"+str_get_cols(tostring(<wbr>MostRecent_UTC), 8,9) + "z.awphys00.tm00.grib2"<br> URL = dir + MostRecent_YYYYMMDD + "/" + MostRecent_file<br><br>;URL = "<a href="http://nomads.ncep.noaa.gov/pub/data/nccf/com/nam/prod/nam.20180405/nam.t00z.awphys00.tm00.grib2" target="_blank">http://nomads.ncep.noaa.gov/<wbr>pub/data/nccf/com/nam/prod/<wbr>nam.20180405/nam.t00z.<wbr>awphys00.tm00.grib2</a>"<br> if isfilepresent(URL)<br> print("Output is found: Most recent model is " + URL)<br> return(URL)<br> t = 0<br> else<br> print("Cant find file")<br> ct = ct + 6<br> end if<br> end do<span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><div><div><div><div><div><br>-- <br><div class="m_-1118339514774875760gmail_signature"><div dir="ltr"><div><div dir="ltr">Jonathan D.D. Meyer, Ph.D.<div>Utah State University<br><div>Department of Plants, Soils & Climate</div><div>Utah Climate Center</div></div></div></div></div></div>
</div></div></div></div></div></div></font></span></div></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>