Using Diva on web


Jump to: navigation, search


What is the Diva web-interface

The Diva web-interface (available at is a web service to interpolate ocean data on a regular grid. It uses Data-Interpolating Variational Analysis (Diva) for the interpolation.

If you use the results generated by Diva-on-web, please include the following citation:

A. Barth, A. Alvera-Azcárate, C. Troupin, M. Ouberdous, and J.-M. Beckers. A web interface for griding arbitrarily distributed in situ data based on Data-Interpolating Variational Analysis (Diva). Advances in Geosciences, 28:29–37, 2010. doi: 10.5194/adgeo-28-29-2010. URL

Using the Interface


Extracted data

The file containing the in situ data must must be an ASCII text file with three columns. The columns represent longitude, latitude and value of the observation respectively. For example:

     29.7667 45.15 16.146
     29.7667 45.15 16.346
     29.7667 45.15 16.526
     29.8167 45.15 2.016

The in situ data is thus extracted for a given time and depth (using programs such Ocean Data Data View).

ODV4 files

ODV4 files conforming to this standard ( can also be used. In addition to the variable to analyse, the ODV4 file must have the columns named Station, Longitude, Latitude, Depth and time_ISO8601 (for time in yyyy-mm-ddThh:mm:ss.sss).

Multiple ODV4 files can also be placed in a zip file. All files in zip file are interpreted as ODV4 files. However files ending with metadata.csv are ignored.


Longitude and Latitude must be specified in decimal degrees North and East respectively. For example the latitude 77° 2' 56.4" W must be specified as -77.049. The depth level represents the distance between the sea surface and the horizontal plane where the analysis is performed.

Velocity files

For the advection constraint, a velocity field on a regular longitude/latitude grid can be provided. The increments in longitude and latitude must be constant and cover the entire domain of the analysis. The NetCDF file must have the following structure.

netcdf example {
	lon = 100 ; 
	lat = 81 ;
	double lon(lon) ;
		lon:standard_name = "longitude" ;
		lon:units = "degree_east" ;
	double lat(lat) ;
		lat:standard_name = "latitude" ;
		lat:units = "degree_north" ;
	double u(lat, lon) ;
		u:standard_name = "northward_sea_water_velocity" ;
		u:units = "m s-1" ;
	double v(lat, lon) ;
		v:standard_name = "eastward_sea_water_velocity" ;
		v:units = "m s-1" ;

// global attributes:
		:Conventions = "CF-1.5" ;

This would be the output of the command ncdump -h Users of GNU Octave/Matlab could use the following code to generate a NetCDF file with the necessary format:

% load your data
%x = vector of longitude
%y = vector of latitude
%u = u-velocity (dimensions: longitude x latitude)
%v = v-velocity (dimensions: longitude x latitude)

filename = ''; 



ncwriteatt(filename,'u','units','m s-1');

ncwriteatt(filename,'v','units','m s-1');



For GNU Octave, the package is necessary to run this code.


Correlation length
represents the typical distance over which two points are correlation (specified in decimal degrees).
Signal to noise ratio

Embed in your web site

You may embed the results of the analysis on your web site. Copy the code fragment in the embed box and paste it at the place in the HTML code where you want the figure to appear.

The analysis produced on the gher-diva server are regularly erased unless you requested to save the analysis.

<iframe src ="" 
 width="620" height="500" frameborder="0">

The value of 'analysis' is a string which identified your analysis on our web server. It will be different for every analysis that you perform. You may change (or add) a posteriori the values of those parameters:

maximum relative error (default 1)
name of the analysis visible in the layer-switcher (default "Analysis");
name of the error mask visible in the layer-switcher (default "Error mask");
xmin, xmax, ymin, ymax
lon/lat range (default: query server; not always possible due to security restriction in the web-browser)
vmin, vmax
color-bar range (default: query server; not always possible due to security restriction in the web-browser)

A minimal example of an HTML page with embedded diva viewer:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" xml:lang="en" lang="en"></nowiki>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <title>Example for embeding mydiva</title>
    <h1>Example for embeding mydiva</h1>
     <p>Some text</p>
    <iframe src ="" 
       width="620" height="500" frameborder="0">
    <p>Some more text</p>

Tested browsers

  • Firefox
  • Google Chrome
  • Internet Explorer

CPU time limit

We limited the CPU time for each user to ensure availability of the web service.


A too small correlation length, a too large domain or too many observations can result in an analysis which exceeds the CPU time.

Memory usage

Memory usage of the browser were measured after using divafit and after analyzing the Black sea surface salinity sample data.

Browser OS Memory Usage
Firefox 3.0 Linux (Ubuntu 8.04.1) 30 Mb
Firefox 3.0 Windows XP SP2 45 Mb
Google Chrome 1.0 Windows XP SP2 59 Mb
Safari 3.2.1 Windows XP SP2 58 Mb
Internet Explorer 7.0 Windows XP SP2 236 Mb

Firefox memory usage where obtained with all Add-on disabled. The Internet Explorer memory usage is not a joke. If you use Internet Explorer and you experience that the use of this page slows down your computer, consider to use a different brower with a lower memory footprint.

Personal tools