Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A model adapter is the interface between a so-called model and the Delft-FEWS system. It enables FEWS to run such a model, thus providing the essential forecasting functionality. For each particular FEWS application applying a model, however, some aspects of this system have to be configured by the user in order for the system to work correctly. To achieve this, it is useful that the user has at least some basic understanding of the relation between Delft-FEWS, the model adapter and the forecasting model. In this section, a brief overview of this relation is provided. For more information, the user is referred to the FEWS manual: General Adapter..

NetCDF Files

Since FEWS 2014.01 it is possible to use only NetCDF files (no-xml) for the communication between FEWS and the model adapter. Good libraries for reading and writing NetCDF files exist for several languages. XML files are a lot more complex to read and to write.
Java: https://www.unidata.ucar.edu/software/thredds/current/netcdf-java/v4.2/javadoc/Image Removed
Fortran: https://www.unidata.ucar.edu/software/netcdf/docs/netcdf-f90/Image Removed
python, http://unidata.github.io/netcdf4-python/Image Removed
R-project http://cran.r-project.org/web/packages/RNetCDF/index.htmlImage Removed
C: http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-c/Image Removed
C++: http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-cxx/Image Removed

NetCDF time series and attributes can be read with just a few lines of source code.

...

To inspect the NetCDF files there are several viewers available.
They are all free and all have their strengths
Panoply : http://www.giss.nasa.gov/tools/panoply/Image Removed
ncBrowse: http://www.epic.noaa.gov/java/ncBrowseImage Removed
intel array visualizer: http://software.intel.com/en-us/articles/intel-array-visualizerImage Removed

CDL Format

For NetCDF there is also a text representation available.http://www.unidata.ucar.edu/software/netcdf/docs/netcdf/CDL-Syntax.htmlImage Removed
This is very useful for debugging, documentation and as input/output for unit tests
Converting from NetCDF to CDL
ncdump: https://www.unidata.ucar.edu/software/netcdf/docs/netcdf/ncdump.htmlImage Removed
Converting from CDL to NetCDF
ncgen: http://www.unidata.ucar.edu/software/netcdf/docs/netcdf/ncgen.htmlImage Removed

Model and Pre- and Post-adapters.

...

Code Block
netcdf run_info {
dimensions:
    path_length = 255 ;
    log_level_length = 5;
    input_netcdf_file_count = 2 ;
    input_state_file_count = 1 ;
    output_netcdf_file_count = 2 ;
variables:
    char log_level(log_level_length) ;
    double start_time ;
        start_time:long_name = "start_time" ;
        start_time:standard_name = "time" ;
        start_time:units = "minutes since 2002-11-26 00:00:00.0 +0000" ;
    double end_time ;
        end_time:long_name = "end_time" ;
        end_time:standard_name = "time" ;
        end_time:units = "minutes since 2002-11-26 00:00:00.0 +0000" ;
    char work_dir(path_length) ;
    char input_netcdf_files(input_netcdf_file_count, path_length) ;
    char input_state_files(input_state_file_count, path_length) ;
    char output_netcdf_files(output_netcdf_file_count, path_length) ;
    char properties ;
        properties:string_property = "zs_0 with spaces" ;
        properties:INT_property = 3 ;
        properties:float_PROPERTY = 3.5f ;
        properties:DOUBLE_PROPERTY_321 = 0.123456789 ;
        properties:logical_property_1 = "true" ;
        properties:logical_property_2 = "false" ;
 
// global attributes:
        :title = "Run file" ;
        :institution = "Deltares" ;
        :source = "Run file from Delft-FEWS" ;
        :history = "2014-03-18 12:22:55 GMT: exported from Delft-FEWS to D:\\fews\\workspace\\fews\\junit_test_output\\nl\\wldelft\\fews\\system\\plugin\\generaladapter\\exportDir\\run_info.nc" ;
        :references = "http://www.delft-fews.com" ;
data:
 logLevel = "debug";
 
 start_time = 0 ;
 
 end_time = 5880 ;
 
 work_dir = "..\\work" ;
 
 input_netcdf_files =
  "..\\work\\boundary_data.nc",
  "..\\work\\more_boundary_data.nc" ;
 
 input_state_files =
  "..\\input_state\\state.inp" ;
 
 output_netcdf_files =
  "..\\work\\model_output_data1.nc",
  "..\\work\\model_output_data2.nc" ;
 
 properties = " " ;
}

Logging.

...