This file is indexed.

/usr/share/doc/grads/html/gradcomdsdfwrite.html is in grads 2:2.0.1-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!--Copyright (C) 1988-2005 by the Institute of Global Environment and Society (IGES). See file COPYRIGHT for more information.-->

<html>
<head>
<title>GrADS Commands: sdfwrite</title>
</head>
<body bgcolor="e0f0ff" text="#000000">

<h2><b>sdfwrite</b></h2>
<p><code>sdfwrite <i>varname </i></code>
<p>This<code></code> command will write out a defined variable <code><i>varname </i></code>into a NetCDF formatted
  data file.  

<ul>
  <p>&nbsp;</p>
</ul>
<h3>Usage Notes</h3>

<p>
The <code>sdfwrite</code> command works with GrADS version 2.0.a3 (or higher). Changes to the command in version 2.0.a5 included the option to force the output to have 4 or 5 dimensions. Changes to include compression and floating-point output were added with version 2.0.a8. 
<p> The name of the output file will be <code>grads.sdfwrite.nc</code> unless specified otherwise with the <code><a href="gradcomdsetsdfwrite.html">set sdfwrite</a></code> command. If the 
  file exists, it will be replaced. The <a href="gradcomdqsdfwrite.html"><code>q sdfwrite</code></a> command
  returns the status of the <code>sdfwrite</code> options. 
<p>The dimensions of the variable written to file correspond to the dimension environment that is set when the variable is  defined. The dimension environment that is set when the 'sdfwrite' command is invoked is ignored. Note this behavior is different from the fwrite command.

<p>By default, the output file will have a coordinate variable only for  varying dimensions in the defined variable; non-varying dimensions will not appear as a coordinate variable with a size of 1. However, as of version 2.0.a5,  options have been added to the  <code><a href="gradcomdsetsdfwrite.html">set sdfwrite</a></code> command to  force the variable in the output file to have at least 4 or all 5 dimensions. When either of these options to   <code><a href="gradcomdsetsdfwrite.html">set sdfwrite</a></code>  are used,   the output file will retain information about the values of the  dimensions that were fixed when the variable was defined; non-varying dimensions will appear as a coordinate variable of size 1.

<p>The coordinate variables will be  type 'double' and have two default attributes (&quot;units&quot; and &quot;long_name&quot;) with values that are based on the GrADS 5-dimensional gridded data model. The data variable will also be  type 'double' by default; beginning with version 2.0.a8, you can also write out data of type 'float' if you use the -flt option with    <code><a href="gradcomdsetsdfwrite.html">set sdfwrite</a></code> command. Data variables will have a 'missing value' attribute. 
<p>For example, if <code><i>varname</i></code> is called &quot;testvar&quot; and varies in X, Y, Z, T, and E, then the output file might have a NetCDF header that looks like this: 
<p><code>netcdf foo {<br>
  dimensions:<br>
&nbsp;&nbsp;longitude = 9 ;<br>
&nbsp;&nbsp;latitude = 9 ;<br>
&nbsp;&nbsp;level = 9 ;<br>
&nbsp;&nbsp;time = 9 ;<br>
&nbsp;&nbsp;ensemble = 9 ;<br>
variables:<br>
&nbsp;&nbsp;double longitude(longitude) ;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;longitude:units = &quot;degrees_east&quot; ;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;longitude:long_name = &quot;Longitude&quot; ;<br>
&nbsp;&nbsp;double latitude(latitude) ;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;latitude:units = &quot;degrees_north&quot; ;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;latitude:long_name = &quot;Latitude&quot; ;<br>
&nbsp;&nbsp;double level(level) ;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;level:units = &quot;millibar&quot; ;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;level:long_name = &quot;Level&quot; ;<br>
&nbsp;&nbsp;double time(time) ;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;time:units = &quot;minutes since 01-01-0001 00:00&quot; ;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;time:long_name = &quot;Time&quot; ;<br>
&nbsp;&nbsp;double ensemble(ensemble) ;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ensemble:grads_dim = &quot;e&quot; ;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ensemble:long_name = &quot;Ensemble member&quot; ;<br>
&nbsp;&nbsp;double testvar(ensemble, time, level, latitude, longitude) ;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;testvar:missing_value = -888. ;<br>
}
</code>
<p>The time axis units will always be &quot;minutes since ...&quot; and the date of the time axis origin will correspond to the initial time of the defined variable. 
<p>If the variable has an ensemble dimension, the attribute &quot;grads_dim&quot; with the value &quot;e&quot; will always be present so that the resulting output file can be opened with GrADS using the 'sdfopen' command. 
<p>To supplement or override the default attributes of the output file, use the <code><a href="gradcomdsetsdfattr.html">set sdfattr</a></code> command. 
<p>Beginning with version 2.0.a8, the output file may also be a compressed netCDF file. Use the <code>-zip</code> option with the <code><a href="gradcomdsetsdfwrite.html">set sdfwrite</a></code> command to enable compression. Please see the documentation on <a href="compression.html">compression</a> for  more details.
<h3>Examples </h3>

<p>
The following commands produce a regional subset of a global precip forecast :
<ul>
  <p><code>open global_forecast.ctl<br>
  set lon -111.3 -103.8 <br>
  set lat 40.9 45.0 <br>
  set lev 1000 10<br>
  set t 1 last<br>
    set e 1 last<br>
  define precip = ptot</code><code><br>
    set sdfwrite wyoming_precip.nc<br>
    sdfwrite precip<br>
    <br>
  </code></p>
</ul>

<p>Suppose you want to write out a long time series in one file, but memory limits do not allow you to define the entire time series in a single variable. You can write out the variable in time chunks, and then concatenate them together sequentially using the NetCDF Operators. 
<p>
<p>
<pre>open long_run.ctl
</pre>

</body>
</html>