1

我正在运行可操作的海洋模型,所以我每天都将新的 netCDF 文件放入通过 opendap TDS 和 tomcat 提供服务的文件夹中。模型完成后,旧文件被新文件覆盖,它们具有相同的名称(!),但似乎服务器没有更新/提供新数据。如果我对系统磁盘文件执行 ncdump,我会得到一个值;如果我通过 opendap 使用访问,我得到的相同 ncdump不同,在我看来,它就像我想要的那样被缓存并保持而不是刷新。有没有办法通过 TDS opendap tomcat 禁用 netCDF 文件的缓存?谢谢,干杯伊维卡

4

1 回答 1

1

要确保 THREDDS 数据服务器 (TDS) 不缓存您的数据,您可以设置一个不缓存的 datasetRoot。这是我们用于海洋预报模型的实际示例,其中新的预报 NetCDF 文件每天简单地上传到服务器,使用相同的名称(此处为 NECOFS_GOM2_FORECAST.nc、NECOFS_GOM3_FORECAST.nc 等):

<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0"
  xmlns:xlink="http://www.w3.org/1999/xlink" name="THREDDS Catalog for NetCDF Files" version="1.0.1">

  <service name="allServices" serviceType="Compound" base="">
    <service name="ncdods" serviceType="OpenDAP" base="/thredds/dodsC/"/>
    <service name="HTTPServer" serviceType="HTTPServer" base="/thredds/fileServer/"/>
  </service>

  <datasetRoot path="FVCOM" location="/http/www/CODFISH/Data/FVCOM/" cache="false"/>

  <dataset name="NECOFS GOM2 Forecast" ID="gom2_nocache" serviceName="allServices"
    urlPath="FVCOM/NECOFS/Forecasts/NECOFS_GOM2_FORECAST.nc" dataType="Grid"/>

  <dataset name="NECOFS GOM3 Forecast" ID="gom3_nocache" serviceName="allServices"
    urlPath="FVCOM/NECOFS/Forecasts/NECOFS_GOM3_FORECAST.nc" dataType="Grid"/>

  <dataset name="NECOFS MET Forecast" ID="necofs_met" serviceName="allServices"
    urlPath="FVCOM/NECOFS/Forecasts/NECOFS_MET_FORECAST.nc" dataType="Grid"/>

  <dataset name="NECOFS GOM3 Wave Forecast" ID="necofs_gom3_wave" serviceName="allServices"
    urlPath="FVCOM/NECOFS/Forecasts/NECOFS_WAVE_FORECAST.nc" dataType="Grid"/>

  <dataset name="NECOFS MASSBAY Forecast" ID="massbay_nocache" serviceName="allServices"
    urlPath="FVCOM/NECOFS/Forecasts/NECOFS_FVCOM_OCEAN_MASSBAY_FORECAST.nc" dataType="Grid"/>

</catalog>

有关 https://www.unidata.ucar.edu/projects/THREDDS/tech/reference/ThreddsConfigXMLFile.html的更多信息,其中还说“看以下可能不起作用”,但可以肯定它适用于 TDS 4.2 .9,因为我们在这里使用它:http ://www.smast.umassd.edu:8080/thredds/forecasts.html

于 2013-01-31T12:13:19.910 回答