Переглянути джерело

Code indention and documentation update

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@52065 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 13 роки тому
батько
коміт
86bfbc0523

+ 9 - 9
raster3d/r3.out.netcdf/main.c

@@ -1,11 +1,11 @@
 
 
 /****************************************************************************
 /****************************************************************************
  *
  *
- * MODULE:       r3.out.netcdf 
+ * MODULE:       r3.out.netCDF 
  *   	    	
  *   	    	
  * AUTHOR(S):    Soeren Gebbert
  * AUTHOR(S):    Soeren Gebbert
  *
  *
- * PURPOSE:      Export a 3D raster map as netcdf file  
+ * PURPOSE:      Export a 3D raster map as netCDF file  
  *
  *
  * COPYRIGHT:    (C) 2012 by the GRASS Development Team
  * COPYRIGHT:    (C) 2012 by the GRASS Development Team
  *
  *
@@ -51,7 +51,7 @@
 #define UNITS "units"
 #define UNITS "units"
 #define DEGREES_EAST "degrees_east"
 #define DEGREES_EAST "degrees_east"
 #define DEGREES_NORTH "degrees_north"
 #define DEGREES_NORTH "degrees_north"
-#define HISTORY_TEXT "GRASS GIS 7 NetCDF export of r3.out.netcdf"
+#define HISTORY_TEXT "GRASS GIS 7 netCDF export of r3.out.netcdf"
 #define CF_SUPPORT "CF-1.5"
 #define CF_SUPPORT "CF-1.5"
 
 
 #define ERR(e) {fatalError(nc_strerror(e));}
 #define ERR(e) {fatalError(nc_strerror(e));}
@@ -94,7 +94,7 @@ static void setParams()
 
 
     param.output = G_define_standard_option(G_OPT_F_OUTPUT);
     param.output = G_define_standard_option(G_OPT_F_OUTPUT);
     param.output->key = "output";
     param.output->key = "output";
-    param.output->description = _("Name for netcdf output file");
+    param.output->description = _("Name for netCDF output file");
 
 
     param.null = G_define_option();
     param.null = G_define_option();
     param.null->key = "null";
     param.null->key = "null";
@@ -103,7 +103,7 @@ static void setParams()
     param.null->multiple = NO;
     param.null->multiple = NO;
     param.null->description =
     param.null->description =
 	_
 	_
-	("The value to be used for null values, default is the NetCDF standard");
+	("The value to be used for null values, default is the netCDF standard");
 
 
     param.proj = G_define_flag();
     param.proj = G_define_flag();
     param.proj->key = 'p';
     param.proj->key = 'p';
@@ -584,9 +584,9 @@ int main(int argc, char *argv[])
     G_gisinit(argv[0]);
     G_gisinit(argv[0]);
     module = G_define_module();
     module = G_define_module();
     G_add_keyword(_("raster3d"));
     G_add_keyword(_("raster3d"));
-    G_add_keyword(_("netcdf"));
+    G_add_keyword(_("netCDF"));
     G_add_keyword(_("export"));
     G_add_keyword(_("export"));
-    module->description = _("Export a 3D raster map as netcdf file.");
+    module->description = _("Export a 3D raster map as netCDF file.");
 
 
     /* Get parameters from user */
     /* Get parameters from user */
     setParams();
     setParams();
@@ -616,7 +616,7 @@ int main(int argc, char *argv[])
 	G_fatal_error(_("Error opening 3d raster map <%s>"),
 	G_fatal_error(_("Error opening 3d raster map <%s>"),
 		      param.input->answer);
 		      param.input->answer);
 
 
-    /* Create netcdf file */
+    /* Create netCDF file */
     if ((retval = nc_create(param.output->answer, NC_CLOBBER, &ncid)))
     if ((retval = nc_create(param.output->answer, NC_CLOBBER, &ncid)))
 	ERR(retval);
 	ERR(retval);
 
 
@@ -647,7 +647,7 @@ int main(int argc, char *argv[])
     if (!Rast3d_close(map))
     if (!Rast3d_close(map))
 	fatalError(_("Unable to close 3D raster map"));
 	fatalError(_("Unable to close 3D raster map"));
 
 
-    /* Close the netcdf file */
+    /* Close the netCDF file */
     if ((retval = nc_close(ncid)))
     if ((retval = nc_close(ncid)))
 	ERR(retval);
 	ERR(retval);
 
 

+ 185 - 157
raster3d/r3.out.netcdf/r3.out.netcdf.html

@@ -1,76 +1,80 @@
 <h2>DESCRIPTION</h2>
 <h2>DESCRIPTION</h2>
 
 
-The module <em>r3.out.netcdf</em> exports a 3D raster map as NetCDF file.
+The module <em>r3.out.netcdf</em> exports a 3D raster map as netCDF file.
 Maps are valid 3D raster maps in the current mapset search path. The
 Maps are valid 3D raster maps in the current mapset search path. The
-<em>output</em> parameter is the name of a NetCDF file that will be
+<em>output</em> parameter is the name of a netCDF file that will be
 written in the current working directory. The module is sensitive
 written in the current working directory. The module is sensitive
 to mapset region settings (set with <em>g.region</em>) and the vertical unit settings
 to mapset region settings (set with <em>g.region</em>) and the vertical unit settings
 of the 3D raster map. The vertical unit can be set with <a href="r3.support.html">r3.support</a>.
 of the 3D raster map. The vertical unit can be set with <a href="r3.support.html">r3.support</a>.
 
 
 <h2>Note</h2>
 <h2>Note</h2>
 
 
-The resulting NetCDF file will have time as third dimension in case a temporal 
+The resulting netCDF file will have time as third dimension in case a temporal 
 vertical unit is specified for the input map, otherwise the third dimension is assumed as spatial.
 vertical unit is specified for the input map, otherwise the third dimension is assumed as spatial.
 If the 3D raster map has a time stamp with absolute time, the start time will be 
 If the 3D raster map has a time stamp with absolute time, the start time will be 
-used as starting point for the NetCDF time series. If the absolute time stamp is missing
+used as starting point for the netCDF time series. If the absolute time stamp is missing
 the date "Jan. 01. 1900 00:00:00" will be used as default. In case of relative time stamp no start time
 the date "Jan. 01. 1900 00:00:00" will be used as default. In case of relative time stamp no start time
-is set in the NetCDF file. The number of depths of the 3D raster map are the number of time slices
-in the NetCDF file. You can use <em>t.rast.to.rast3</em> to convert a 
+is set in the netCDF file. The number of depths of the 3D raster map are the number of time slices
+in the netCDF file. You can use <em>t.rast.to.rast3</em> to convert a 
 space time raster dataset into a 3D raster map representing a space time voxel 
 space time raster dataset into a 3D raster map representing a space time voxel 
-cube, then export the raster time series as NetCDF file.
+cube, then export the raster time series as netCDF file.
 <p>
 <p>
-Spatial coordinates are exported as cell centered coordinates. The projection is stored
-in the metadata as <em>crs</em> attributes using a WKT parameter string. 
-The export of projection parameters is suppressed when the XY-projection is set. 
-The NetCDF projection metadata storage follows the spatial_ref GDAL/NetCDF suggestion
+Spatial coordinates are exported as cell centered coordinates. The projection can be optionally stored
+in the metadata as <em>crs</em> attributes . 
+The netCDF projection metadata storage follows the spatial_ref GDAL/netCDF suggestion
 <a href="http://www.gdal.org/frmt_netcdf.html">here</a> 
 <a href="http://www.gdal.org/frmt_netcdf.html">here</a> 
-and the NetCDF CF 1.6 convention 
+and the netCDF CF 1.6 convention 
 <a href="http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.6/cf-conventions.html#coordinate-system">here</a>  
 <a href="http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.6/cf-conventions.html#coordinate-system">here</a>  
 using WKT projection information. Additional a PROJ.4 string is
 using WKT projection information. Additional a PROJ.4 string is
 stored in the <em>crs</em> attribute section. 
 stored in the <em>crs</em> attribute section. 
+The export of projection parameters is suppressed when the XY-projection is set. 
+<p>
+The range of the 3D raster map is set in the netCDF output file. Optionally a the netCDF missing value and 
+_FillValue can be set using the <em>null</em> option. As default the netCDF floating point _FillValues are used
+to fill empty cell.
 <p>
 <p>
-The NetCDF library must be installed on the system and activated at configuration time to compile this module.
+The netCDF library must be installed on the system and activated at configuration time to compile this module.
 
 
 <h2>Examples</h2> 
 <h2>Examples</h2> 
 
 
-<h3>Using lat/lon projection without vertical unit specification</h3>
-
-<p>Lets create a 3D raster map without the specification of a vertical unit</p>
-
 <div class="code"><pre>
 <div class="code"><pre>
-g.region s=-90 n=90 w=-180 e=180 b=0 t=50 res=10 res3=2 -p3
-r3.mapcalc expr="volume_double = double(col() + row() + depth())"
-r3.info
+g.region s=-90 n=90 w=-180 e=180 b=0 t=5 res=10 res3=10 tbres=1 -p3
+
+#####################################################################
+# We create a simple volume map with floating point values
+#####################################################################
 
 
+r3.mapcalc --o expr="volume_float = float(col() + row() + depth())"
+r3.info volume_float
  +----------------------------------------------------------------------------+
  +----------------------------------------------------------------------------+
- | Layer:    volume_double                  Date: Wed May 16 20:08:22 2012    |
+ | Layer:    volume_float                   Date: Thu Jun 14 08:40:56 2012    |
  | Mapset:   PERMANENT                      Login of Creator: soeren          |
  | Mapset:   PERMANENT                      Login of Creator: soeren          |
  | Location: TestLL                                                           |
  | Location: TestLL                                                           |
  | DataBase: /1/soeren/grassdata                                              |
  | DataBase: /1/soeren/grassdata                                              |
- | Title:    volume_double                                                    |
+ | Title:    volume_float                                                     |
  | Units:    none                                                             |
  | Units:    none                                                             |
  | Vertical unit: units                                                       |
  | Vertical unit: units                                                       |
  | Timestamp: none                                                            |
  | Timestamp: none                                                            |
  |----------------------------------------------------------------------------|
  |----------------------------------------------------------------------------|
  |                                                                            |
  |                                                                            |
  |   Type of Map:  3d cell              Number of Categories: 0               |
  |   Type of Map:  3d cell              Number of Categories: 0               |
- |   Data Type:    DCELL                                                      |
- |   Rows:         90                                                         |
- |   Columns:      180                                                        |
- |   Depths:       25                                                         |
- |   Total Cells:  405000                                                     |
- |   Total size:           2835864 Bytes                                      |
- |   Number of tiles:      108                                                |
- |   Mean tile size:       26258 Bytes                                        |
- |   Tile size in memory:  32400 Bytes                                        |
- |   Number of tiles in x, y and  z:   6, 6, 3                                |
- |   Dimension of a tile in x, y, z:   30, 15, 9                              |
+ |   Data Type:    FCELL                                                      |
+ |   Rows:         18                                                         |
+ |   Columns:      36                                                         |
+ |   Depths:       5                                                          |
+ |   Total Cells:  3240                                                       |
+ |   Total size:           10114 Bytes                                        |
+ |   Number of tiles:      1                                                  |
+ |   Mean tile size:       10114 Bytes                                        |
+ |   Tile size in memory:  12960 Bytes                                        |
+ |   Number of tiles in x, y and  z:   1, 1, 1                                |
+ |   Dimension of a tile in x, y, z:   36, 18, 5                              |
  |                                                                            |
  |                                                                            |
  |        Projection: Latitude-Longitude (zone 0)                             |
  |        Projection: Latitude-Longitude (zone 0)                             |
- |            N:        90N    S:        90S   Res:     2                     |
- |            E:       180E    W:       180W   Res:     2                     |
- |            T:         50    B:          0   Res:     2                     |
- |   Range of data:   min =          3 max =        295                       |
+ |            N:        90N    S:        90S   Res:    10                     |
+ |            E:       180E    W:       180W   Res:    10                     |
+ |            T:          5    B:          0   Res:     1                     |
+ |   Range of data:   min =          3 max =         59                       |
  |                                                                            |
  |                                                                            |
  |   Data Source:                                                             |
  |   Data Source:                                                             |
  |                                                                            |
  |                                                                            |
@@ -80,147 +84,171 @@ r3.info
  |    generated by r3.mapcalc                                                 |
  |    generated by r3.mapcalc                                                 |
  |                                                                            |
  |                                                                            |
  |   Comments:                                                                |
  |   Comments:                                                                |
- |    r3.mapcalc expression="volume_double = double(col() + row() + depth(\   |
- |    ))"                                                                     |
+ |    r3.mapcalc expression="volume_float = float(col() + row() + depth())"   |
  |                                                                            |
  |                                                                            |
  +----------------------------------------------------------------------------+
  +----------------------------------------------------------------------------+
 
 
-</pre></div>
-<p>Export the map and show the NetCDF header</P>
-
-<div class="code"><pre>
-r3.out.netcdf input=volume_double output=test_double.nc
-ncdump -h test_double.nc
+#####################################################################
+# We use the netCDF ncdump tool to have a look at the header 
+# and coordinates of the exported netCDF file
+#####################################################################
 
 
-netcdf test_double {
+r3.out.netcdf --o input=volume_float output=test_float.nc
+ncdump -c test_float.nc
+ 
+netcdf test_float {
 dimensions:
 dimensions:
-	longitude = 180 ;
-	latitude = 90 ;
-	z = 25 ;
+        longitude = 36 ;
+        latitude = 18 ;
+        z = 5 ;
 variables:
 variables:
-	char crs ;
-		crs:crs_wkt = "GEOGCS[\"wgs84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]]" ;
-		crs:spatial_ref = "GEOGCS[\"wgs84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]]" ;
-		crs:crs_proj4 = " +proj=longlat +no_defs +a=6378137 +rf=298.257223563 +towgs84=0.000,0.000,0.000" ;
-	float longitude(longitude) ;
-		longitude:units = "degrees_east" ;
-		longitude:long_name = "Longitude values" ;
-		longitude:standard_name = "longitude" ;
-		longitude:axis = "X" ;
-	float latitude(latitude) ;
-		latitude:units = "degrees_north" ;
-		latitude:long_name = "Latitude values" ;
-		latitude:standard_name = "latitude" ;
-		latitude:axis = "Y" ;
-	float z(z) ;
-		z:units = "meter" ;
-		z:long_name = "z coordinate of projection" ;
-		z:standard_name = "projection_z_coordinate" ;
-		z:positive = "up" ;
-		z:axis = "Z" ;
-	double volume_double(z, latitude, longitude) ;
-		volume_double:grid_mapping = "crs" ;
+        float longitude(longitude) ;
+                longitude:units = "degrees_east" ;
+                longitude:long_name = "Longitude values" ;
+                longitude:standard_name = "longitude" ;
+                longitude:axis = "X" ;
+        float latitude(latitude) ;
+                latitude:units = "degrees_north" ;
+                latitude:long_name = "Latitude values" ;
+                latitude:standard_name = "latitude" ;
+                latitude:axis = "Y" ;
+        float z(z) ;
+                z:units = "meter" ;
+                z:long_name = "z coordinate of projection" ;
+                z:standard_name = "projection_z_coordinate" ;
+                z:positive = "up" ;
+                z:axis = "Z" ;
+        float volume_float(z, latitude, longitude) ;
+                volume_float:valid_min = 3.f ;
+                volume_float:valid_max = 59.f ;
 
 
 // global attributes:
 // global attributes:
-		:Conventions = "CF-1.5" ;
-		:history = "GRASS GIS 7 NetCDF export of r3.out.netcdf" ;
+                :Conventions = "CF-1.5" ;
+                :history = "GRASS GIS 7 netCDF export of r3.out.netcdf" ;
+data:
+
+ longitude = -175, -165, -155, -145, -135, -125, -115, -105, -95, -85, -75, 
+    -65, -55, -45, -35, -25, -15, -5, 5, 15, 25, 35, 45, 55, 65, 75, 85, 95, 
+    105, 115, 125, 135, 145, 155, 165, 175 ;
+
+ latitude = 85, 75, 65, 55, 45, 35, 25, 15, 5, -5, -15, -25, -35, -45, -55, 
+    -65, -75, -85 ;
+
+ z = 0.5, 1.5, 2.5, 3.5, 4.5 ;
 }
 }
-</pre></div>
 
 
-<p>Now we create a 3D raster map with a temporal vertical unit</p>
+#####################################################################
+# Exporting the projection specific settings and a null value
+#####################################################################
 
 
-<div class="code"><pre>
-g.region s=-90 n=90 w=-180 e=180 b=0 t=50 res=10 res3=2 -p3
-r3.mapcalc expr="volume_double = double(col() + row() + depth())"
-r3.timestamp map=volume_time_double date='1 Jan 2001'
-r3.support map=volume_time_double vunit="days"
-r3.info
+r3.out.netcdf --o -p null=-1 input=volume_float output=test_float.nc
+ncdump -c test_float.nc 
 
 
- +----------------------------------------------------------------------------+
- | Layer:    volume_time_double             Date: Wed May 16 20:26:28 2012    |
- | Mapset:   PERMANENT                      Login of Creator: soeren          |
- | Location: TestLL                                                           |
- | DataBase: /1/soeren/grassdata                                              |
- | Title:    volume_time_double                                               |
- | Units:    none                                                             |
- | Vertical unit: days                                                        |
- | Timestamp: 1 Jan 2001                                         |
- |----------------------------------------------------------------------------|
- |                                                                            |
- |   Type of Map:  3d cell              Number of Categories: 0               |
- |   Data Type:    DCELL                                                      |
- |   Rows:         90                                                         |
- |   Columns:      180                                                        |
- |   Depths:       25                                                         |
- |   Total Cells:  405000                                                     |
- |   Total size:           2835864 Bytes                                      |
- |   Number of tiles:      108                                                |
- |   Mean tile size:       26258 Bytes                                        |
- |   Tile size in memory:  32400 Bytes                                        |
- |   Number of tiles in x, y and  z:   6, 6, 3                                |
- |   Dimension of a tile in x, y, z:   30, 15, 9                              |
- |                                                                            |
- |        Projection: Latitude-Longitude (zone 0)                             |
- |            N:        90N    S:        90S   Res:     2                     |
- |            E:       180E    W:       180W   Res:     2                     |
- |            T:         50    B:          0   Res:     2                     |
- |   Range of data:   min =          3 max =        295                       |
- |                                                                            |
- |   Data Source:                                                             |
- |                                                                            |
- |                                                                            |
- |                                                                            |
- |   Data Description:                                                        |
- |    generated by r3.mapcalc                                                 |
- |                                                                            |
- |   Comments:                                                                |
- |    r3.mapcalc expression="volume_time_double = double(col() + row() + d\   |
- |    epth())"                                                                |
- |                                                                            |
- +----------------------------------------------------------------------------+
+netcdf test_float {
+dimensions:
+        longitude = 36 ;
+        latitude = 18 ;
+        z = 5 ;
+variables:
+        char crs ;
+                crs:crs_wkt = "GEOGCS[\"wgs84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]]" ;
+                crs:spatial_ref = "GEOGCS[\"wgs84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]]" ;
+                crs:crs_proj4 = " +proj=longlat +no_defs +a=6378137 +rf=298.257223563 +towgs84=0.000,0.000,0.000" ;
+        float longitude(longitude) ;
+                longitude:units = "degrees_east" ;
+                longitude:long_name = "Longitude values" ;
+                longitude:standard_name = "longitude" ;
+                longitude:axis = "X" ;
+        float latitude(latitude) ;
+                latitude:units = "degrees_north" ;
+                latitude:long_name = "Latitude values" ;
+                latitude:standard_name = "latitude" ;
+                latitude:axis = "Y" ;
+        float z(z) ;
+                z:units = "meter" ;
+                z:long_name = "z coordinate of projection" ;
+                z:standard_name = "projection_z_coordinate" ;
+                z:positive = "up" ;
+                z:axis = "Z" ;
+        float volume_float(z, latitude, longitude) ;
+                volume_float:valid_min = 3.f ;
+                volume_float:valid_max = 59.f ;
+                volume_float:missing_value = -1.f ;
+                volume_float:_FillValue = -1.f ;
+                volume_float:grid_mapping = "crs" ;
 
 
-</pre></div>
-<p>Export the map and show the NetCDF header</P>
+// global attributes:
+                :Conventions = "CF-1.5" ;
+                :history = "GRASS GIS 7 netCDF export of r3.out.netcdf" ;
+data:
 
 
-<p>NetCDF header of an exported 3D raster map with vertical temporal unit in a Lat/Lon projection:</P>
+ longitude = -175, -165, -155, -145, -135, -125, -115, -105, -95, -85, -75, 
+    -65, -55, -45, -35, -25, -15, -5, 5, 15, 25, 35, 45, 55, 65, 75, 85, 95, 
+    105, 115, 125, 135, 145, 155, 165, 175 ;
 
 
-<div class="code"><pre>
-r3.out.netcdf --o input=volume_time_double output=test_time_double.nc
-ncdump -h test_time_double.nc
+ latitude = 85, 75, 65, 55, 45, 35, 25, 15, 5, -5, -15, -25, -35, -45, -55, 
+    -65, -75, -85 ;
+
+ z = 0.5, 1.5, 2.5, 3.5, 4.5 ;
+}
 
 
-netcdf test_time_double {
+#####################################################################
+# Assigning time as vertical unit and setting an absolute time stamp
+#####################################################################
+
+r3.timestamp map=volume_float date='1 Jan 2001/5 Jan 2001'
+r3.support map=volume_float vunit="days"
+r3.out.netcdf --o -p null=-1 input=volume_float output=test_float.nc
+ncdump -c test_float.nc 
+
+netcdf test_float {
 dimensions:
 dimensions:
-	longitude = 180 ;
-	latitude = 90 ;
-	time = 25 ;
+        longitude = 36 ;
+        latitude = 18 ;
+        time = 5 ;
 variables:
 variables:
-	char crs ;
-		crs:crs_wkt = "GEOGCS[\"wgs84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]]" ;
-		crs:spatial_ref = "GEOGCS[\"wgs84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]]" ;
-		crs:crs_proj4 = " +proj=longlat +no_defs +a=6378137 +rf=298.257223563 +towgs84=0.000,0.000,0.000" ;
-	float longitude(longitude) ;
-		longitude:units = "degrees_east" ;
-		longitude:long_name = "Longitude values" ;
-		longitude:standard_name = "longitude" ;
-		longitude:axis = "X" ;
-	float latitude(latitude) ;
-		latitude:units = "degrees_north" ;
-		latitude:long_name = "Latitude values" ;
-		latitude:standard_name = "latitude" ;
-		latitude:axis = "Y" ;
-	int time(time) ;
-		time:units = "days since 2001-01-01 00:00:00" ;
-		time:long_name = "Time in days" ;
-		time:calendar = "gregorian" ;
-		time:positive = "up" ;
-		time:axis = "T" ;
-	double volume_time_double(time, latitude, longitude) ;
-		volume_time_double:grid_mapping = "crs" ;
+        char crs ;
+                crs:crs_wkt = "GEOGCS[\"wgs84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]]" ;
+                crs:spatial_ref = "GEOGCS[\"wgs84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]]" ;
+                crs:crs_proj4 = " +proj=longlat +no_defs +a=6378137 +rf=298.257223563 +towgs84=0.000,0.000,0.000" ;
+        float longitude(longitude) ;
+                longitude:units = "degrees_east" ;
+                longitude:long_name = "Longitude values" ;
+                longitude:standard_name = "longitude" ;
+                longitude:axis = "X" ;
+        float latitude(latitude) ;
+                latitude:units = "degrees_north" ;
+                latitude:long_name = "Latitude values" ;
+                latitude:standard_name = "latitude" ;
+                latitude:axis = "Y" ;
+        int time(time) ;
+                time:units = "days since 2001-01-01 00:00:00" ;
+                time:long_name = "Time in days" ;
+                time:calendar = "gregorian" ;
+                time:positive = "up" ;
+                time:axis = "T" ;
+        float volume_float(time, latitude, longitude) ;
+                volume_float:valid_min = 3.f ;
+                volume_float:valid_max = 59.f ;
+                volume_float:missing_value = -1.f ;
+                volume_float:_FillValue = -1.f ;
+                volume_float:grid_mapping = "crs" ;
 
 
 // global attributes:
 // global attributes:
-		:Conventions = "CF-1.5" ;
-		:history = "GRASS GIS 7 NetCDF export of r3.out.netcdf" ;
+                :Conventions = "CF-1.5" ;
+                :history = "GRASS GIS 7 netCDF export of r3.out.netcdf" ;
+data:
+
+ longitude = -175, -165, -155, -145, -135, -125, -115, -105, -95, -85, -75, 
+    -65, -55, -45, -35, -25, -15, -5, 5, 15, 25, 35, 45, 55, 65, 75, 85, 95, 
+    105, 115, 125, 135, 145, 155, 165, 175 ;
+
+ latitude = 85, 75, 65, 55, 45, 35, 25, 15, 5, -5, -15, -25, -35, -45, -55, 
+    -65, -75, -85 ;
+
+ time = 0, 1, 2, 3, 4 ;
 }
 }
+	
 </pre></div>
 </pre></div>
 
 
 <h2>SEE ALSO</h2>
 <h2>SEE ALSO</h2>

+ 10 - 9
raster3d/r3.out.netcdf/test_suite/test.r3.out.netcdf.sh

@@ -13,21 +13,22 @@ r3.mapcalc --o expr="volume_float = float(col() + row() + depth())"
 r3.mapcalc --o expr="volume_double = double(col() + row() + depth())"
 r3.mapcalc --o expr="volume_double = double(col() + row() + depth())"
 r3.mapcalc --o expr="volume_time_double = double(col() + row() + depth())"
 r3.mapcalc --o expr="volume_time_double = double(col() + row() + depth())"
 r3.mapcalc --o expr="volume_time_float = float(col() + row() + depth())"
 r3.mapcalc --o expr="volume_time_float = float(col() + row() + depth())"
-r3.timestamp map=volume_time_double date='1 Jan 1900/5 Jan 1900'
+r3.timestamp map=volume_time_double date='1 Jan 2001/5 Jan 2001'
 r3.support map=volume_time_double vunit="days"
 r3.support map=volume_time_double vunit="days"
 r3.timestamp map=volume_time_float date='5 seconds/10 seconds'
 r3.timestamp map=volume_time_float date='5 seconds/10 seconds'
 r3.support map=volume_time_float vunit="seconds"
 r3.support map=volume_time_float vunit="seconds"
 # @test
 # @test
 r3.out.netcdf --o input=volume_float output=test_float.nc
 r3.out.netcdf --o input=volume_float output=test_float.nc
-#r3.info volume_float
-#ncdump -h test_float.nc
+r3.info volume_float
+ncdump -h test_float.nc
 r3.out.netcdf --o null=-100 input=volume_double output=test_double.nc
 r3.out.netcdf --o null=-100 input=volume_double output=test_double.nc
-#r3.info volume_double
-#ncdump -h test_double.nc
+r3.info volume_double
+ncdump -h test_double.nc
 r3.out.netcdf --o -p input=volume_time_double output=test_time_double.nc
 r3.out.netcdf --o -p input=volume_time_double output=test_time_double.nc
-#r3.info volume_time_double
-#ncdump -h test_time_double.nc
+r3.info volume_time_double
+ncdump -h test_time_double.nc
 r3.out.netcdf --o -p null=-1000 input=volume_time_float output=test_time_float.nc
 r3.out.netcdf --o -p null=-1000 input=volume_time_float output=test_time_float.nc
-#r3.info volume_time_float
-#ncdump -h test_time_float.nc
+r3.info volume_time_float
+ncdump -h test_time_float.nc
 
 
+g.remove rast3=volume_float,volume_double,volume_time_double,volume_time_float