...
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/
- Fortran: https://www.unidata.ucar.edu/software/netcdf/docs/netcdf-f90/
- python, http://unidata.github.io/netcdf4-python/
- R-project http://cran.r-project.org/web/packages/RNetCDF/index.html
- C: http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-c/
- C++: http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-cxx/
NetCDF time series and attributes can be read with just a few lines of source code.
Running model adapters within FEWS
If you create a model adapter in one of these languages, you can use the model adapter within FEWS in the following way:
- Java: Copy the *.jar files somewhere within your configuration (e.g. %REGION_HOME%/Modules/bin/<model_name>_adapter/. Refer to this location in the General Adapter when you want to execute (part of) the model adapter in an <executeActivity>.
- Fortran:
- python:
- R-project:
- C:
- C++:
NetCDF Viewers
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/
ncBrowse: http://www.epic.noaa.gov/java/ncBrowse
intel array visualizer: http://software.intel.com/en-us/articles/intel-array-visualizer
...
Example of the PI run file by ncdump.
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 = " " ;
}
|
...