/usr/share/doc/libetsf-io-doc/group_level/etsf_io_basisdata_def_f90.html is in libetsf-io-doc 1.0.4-2.
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 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | <?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" href="../robodoc.css" type="text/css" />
<title>./src/group_level/etsf_io_basisdata_def.f90</title>
<!-- Source: ./src/group_level/etsf_io_basisdata_def.f90 -->
<!-- Generated with ROBODoc Version 4.99.38 (May 3 2009) -->
</head>
<body>
<div id="logo">
<a name="robo_top_of_doc">ETSF_IO library - documentation pages</a>
</div> <!-- logo -->
<div id="navigation">
<a class="menuitem" href="../toc_index.html#top">Table of Contents</a>
<a class="menuitem" href="../robo_sourcefiles.html#top">Sourcefiles</a>
<a class="menuitem" href="../masterindex.html#top">Index</a>
<a class="menuitem" href="../robo_definitions.html#top">Definitions</a>
<a class="menuitem" href="../robo_tuto_cat.html#top">Tutorials</a>
<a class="menuitem" href="../robo_functions.html#top">Functions</a>
<a class="menuitem" href="../robo_sub_cat.html#top">Sub categories</a>
<a class="menuitem" href="../robo_modules.html#top">Modules</a>
<a class="menuitem" href="../robo_methods.html#top">Methods</a>
<a class="menuitem" href="../robo_strutures.html#top">Structures</a>
</div> <!-- navigation -->
<div id="content">
<h3>TABLE OF CONTENTS</h3>
<ul>
<li><a href="#robo18">etsf_io_basisdata_def</a></li>
</ul>
<hr />
<a name="etsf5fbasisdata2fetsf5fio5fbasisdata5fdef"></a>
<a name="robo18"></a><h2>etsf_io_basisdata_def</h2>
<p>[ <a href="#robo_top_of_doc">Top</a> ] [ <a href="./etsf_io_f90.html#robo8">etsf_basisdata</a> ] [ <a href="../robo_methods.html#robo_top_of_doc">Methods</a> ]</p>
<p class="item_name">NAME</p>
<p> <strong>etsf_io_basisdata_def</strong>
</p>
<p class="item_name">FUNCTION</p>
<p> The given ETSF file must be opened and in define state (see
<a href="../low_level/etsf_io_low_level_f90.html#robo88">etsf_io_low_set_define_mode</a>() to change it). Then, all variable of the group
are defined. All required dimensions must have already defined (see
<a href="./etsf_io_dims_def_f90.html#robo33">etsf_io_dims_def</a>(). If some dimensions are missing, then the variable
is not defined and no error are generated.
</p>
<p> One can specify which variable may be splitted using the optional argument
@split. For each associated array in this structure, variable with appropriated
dimensions will use my_<something> instead of <something>.
</p>
<p class="item_name">INPUTS</p>
<ul><li> ncid =
integer returned by an 'open' NetCDF call. The file can be
either in define or write mode. This status can be changed
by the call.
</li>
<li> k_dependent = (optional)
use this argument to set the attribute flag 'k_dependent' to 'yes'
or 'no' on variables that have it. If no variable in the group has
the attribute 'k_dependent', this argument has no effect. The default
value is .true. (which puts 'yes' in the file).
</li>
<li> flags = (optional)
One can choose the variables of the group
that will be defined (and disk allocated) using this flag. This is a sum
of values taken from #<a href="./etsf_io_f90.html#robo127">FLAGS_VARIABLES</a>.
</li>
<li> split <type(<a href="./etsf_io_f90.html#robo124">etsf_split</a>)> = (optional)
for each array associated in the type, the dimension used to declared the
variables sizes will be 'my_/something/'.
</li>
</ul>
<p></p>
<p class="item_name">OUTPUT</p>
<ul><li> lstat =
return .true. if all the actions succeed, if not the status
of the file is undefined.
</li>
<li> error_data <type(<a href="../low_level/public_variables_f90.html#robo68">etsf_io_low_error</a>)> =
contains the details of the error is @lstat is false.
</li>
</ul>
<p></p>
<p class="item_name">NOTES</p>
<p> This file has been automatically generated by the autogen_subroutines.py
script. Any change you would bring to it will systematically be
overwritten.
</p>
<p class="item_name">SOURCE</p>
<pre class="source"><span class="keyword">subroutine</span> <strong>etsf_io_basisdata_def</strong><span class="sign">(</span>ncid<span class="sign">,</span> lstat<span class="sign">,</span> error_data<span class="sign">,</span> k_dependent<span class="sign">,</span> flags<span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> split<span class="sign">)</span>
<span class="comment">!Arguments ------------------------------------</span>
<span class="keyword">integer</span><span class="sign">,</span> <span class="keyword">intent</span><span class="sign">(</span><span class="keyword">in</span><span class="sign">)</span> <span class="sign">:</span><span class="sign">:</span> ncid
<span class="keyword">logical</span><span class="sign">,</span> <span class="keyword">intent</span><span class="sign">(</span><span class="keyword">out</span><span class="sign">)</span> <span class="sign">:</span><span class="sign">:</span> lstat
<span class="keyword">type</span><span class="sign">(</span><a href="../low_level/public_variables_f90.html#robo68">etsf_io_low_error</a><span class="sign">)</span><span class="sign">,</span> <span class="keyword">intent</span><span class="sign">(</span><span class="keyword">out</span><span class="sign">)</span> <span class="sign">:</span><span class="sign">:</span> error_data
<span class="keyword">logical</span><span class="sign">,</span> <span class="keyword">optional</span><span class="sign">,</span> <span class="keyword">intent</span><span class="sign">(</span><span class="keyword">in</span><span class="sign">)</span> <span class="sign">:</span><span class="sign">:</span> k_dependent
<span class="keyword">integer</span><span class="sign">,</span> <span class="keyword">optional</span><span class="sign">,</span> <span class="keyword">intent</span><span class="sign">(</span><span class="keyword">in</span><span class="sign">)</span> <span class="sign">:</span><span class="sign">:</span> flags
<span class="keyword">type</span><span class="sign">(</span><a href="./etsf_io_f90.html#robo124">etsf_split</a><span class="sign">)</span><span class="sign">,</span> <span class="keyword">optional</span><span class="sign">,</span> <span class="keyword">intent</span><span class="sign">(</span><span class="keyword">in</span><span class="sign">)</span> <span class="sign">:</span><span class="sign">:</span> split
<span class="comment">!Local variables-------------------------------</span>
<span class="keyword">character</span><span class="sign">(</span><span class="keyword">len</span> <span class="sign">=</span> <span class="sign">*</span><span class="sign">)</span><span class="sign">,</span> <span class="keyword">parameter</span> <span class="sign">:</span><span class="sign">:</span> my_name <span class="sign">=</span> <span class="squote">'<strong>etsf_io_basisdata_def</strong>'</span>
<span class="keyword">logical</span> <span class="sign">:</span><span class="sign">:</span> my_k_dependent
<span class="keyword">integer</span> <span class="sign">:</span><span class="sign">:</span> my_flags
<span class="keyword">type</span><span class="sign">(</span><a href="./etsf_io_f90.html#robo124">etsf_split</a><span class="sign">)</span> <span class="sign">:</span><span class="sign">:</span> my_split
<span class="keyword">integer</span> <span class="sign">:</span><span class="sign">:</span> ivar
<span class="keyword">type</span><span class="sign">(</span>split_dim_names<span class="sign">)</span> <span class="sign">:</span><span class="sign">:</span> split_dims
<span class="comment">! *************************************************************************</span>
<span class="comment">!DEBUG</span>
<span class="comment">!write (*,*) '<strong>etsf_io_basisdata_def</strong> : enter'</span>
<span class="comment">!ENDDEBUG</span>
<span class="comment">! Get values for optional arguments, set default.</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="keyword">present</span><span class="sign">(</span>k_dependent<span class="sign">)</span><span class="sign">)</span> <span class="keyword">then</span>
my_k_dependent <span class="sign">=</span> k_dependent
<span class="keyword">else</span>
my_k_dependent <span class="sign">=</span> <span class="sign">.</span><span class="keyword">true</span><span class="sign">.</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="keyword">present</span><span class="sign">(</span>flags<span class="sign">)</span><span class="sign">)</span> <span class="keyword">then</span>
my_flags <span class="sign">=</span> flags
<span class="keyword">else</span>
my_flags <span class="sign">=</span> etsf_basisdata_all
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="comment">! Consistency checks.</span>
<span class="keyword">if</span> <span class="sign">(</span>my_flags <span class="sign"><</span> etsf_basisdata_none <span class="sign">.</span><span class="keyword">or</span><span class="sign">.</span> my_flags <span class="sign">></span> etsf_basisdata_all<span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo72">etsf_io_low_error_set</a><span class="sign">(</span>error_data<span class="sign">,</span> ERROR_MODE_DEF<span class="sign">,</span> ERROR_TYPE_ARG<span class="sign">,</span> my_name<span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> tgtname <span class="sign">=</span> <span class="quote">"flags"</span><span class="sign">,</span> errmess <span class="sign">=</span> <span class="quote">"value out of bounds"</span><span class="sign">)</span>
lstat <span class="sign">=</span> <span class="sign">.</span><span class="keyword">false</span><span class="sign">.</span>
<span class="keyword">return</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="comment">! Set the name for dimensions that could be splitted.</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="keyword">present</span><span class="sign">(</span>split<span class="sign">)</span><span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="keyword">associated</span><span class="sign">(</span>split<span class="sign">%</span>my_kpoints<span class="sign">)</span><span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">write</span><span class="sign">(</span>split_dims<span class="sign">%</span>number_of_kpoints<span class="sign">,</span> <span class="quote">"(A)"</span><span class="sign">)</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="quote">"my_number_of_kpoints"</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="keyword">associated</span><span class="sign">(</span>split<span class="sign">%</span>my_coefficients<span class="sign">)</span><span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">write</span><span class="sign">(</span>split_dims<span class="sign">%</span>max_number_of_coefficients<span class="sign">,</span> <span class="quote">"(A)"</span><span class="sign">)</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="quote">"my_max_number_of_coefficients"</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="keyword">iand</span><span class="sign">(</span>my_flags<span class="sign">,</span> etsf_basisdata_basis_set<span class="sign">)</span> <span class="sign">/</span><span class="sign">=</span> 0<span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo67">etsf_io_low_def_var</a><span class="sign">(</span>ncid<span class="sign">,</span> <span class="quote">"basis_set"</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> etsf_io_low_character<span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="sign">(</span><span class="sign">/</span> <a href="../low_level/etsf_io_low_level_f90.html#robo130">pad</a><span class="sign">(</span><span class="quote">"character_string_length"</span><span class="sign">)</span> <span class="sign">/</span><span class="sign">)</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> lstat<span class="sign">,</span> ncvarid <span class="sign">=</span> ivar<span class="sign">,</span> error_data <span class="sign">=</span> error_data<span class="sign">)</span>
<span class="comment">! We raise don't raise an error if a dimension is missing.</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="sign">.</span><span class="keyword">not</span><span class="sign">.</span> lstat <span class="sign">.</span><span class="keyword">and</span><span class="sign">.</span> <span class="sign">(</span>error_data<span class="sign">%</span>access_mode_id <span class="sign">/</span><span class="sign">=</span> ERROR_MODE_INQ <span class="sign">.</span><span class="keyword">or</span><span class="sign">.</span> <span class="sign">&</span>
<span class="sign">&</span> error_data<span class="sign">%</span>target_type_id <span class="sign">/</span><span class="sign">=</span> ERROR_TYPE_DID<span class="sign">)</span><span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo74">etsf_io_low_error_update</a><span class="sign">(</span>error_data<span class="sign">,</span> my_name<span class="sign">)</span>
<span class="keyword">return</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="keyword">iand</span><span class="sign">(</span>my_flags<span class="sign">,</span> etsf_basisdata_kin_cutoff<span class="sign">)</span> <span class="sign">/</span><span class="sign">=</span> 0<span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo67">etsf_io_low_def_var</a><span class="sign">(</span>ncid<span class="sign">,</span> <span class="quote">"kinetic_energy_cutoff"</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> etsf_io_low_double<span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> lstat<span class="sign">,</span> ncvarid <span class="sign">=</span> ivar<span class="sign">,</span> error_data <span class="sign">=</span> error_data<span class="sign">)</span>
<span class="comment">! We raise don't raise an error if a dimension is missing.</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="sign">.</span><span class="keyword">not</span><span class="sign">.</span> lstat <span class="sign">.</span><span class="keyword">and</span><span class="sign">.</span> <span class="sign">(</span>error_data<span class="sign">%</span>access_mode_id <span class="sign">/</span><span class="sign">=</span> ERROR_MODE_INQ <span class="sign">.</span><span class="keyword">or</span><span class="sign">.</span> <span class="sign">&</span>
<span class="sign">&</span> error_data<span class="sign">%</span>target_type_id <span class="sign">/</span><span class="sign">=</span> ERROR_TYPE_DID<span class="sign">)</span><span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo74">etsf_io_low_error_update</a><span class="sign">(</span>error_data<span class="sign">,</span> my_name<span class="sign">)</span>
<span class="keyword">return</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">if</span> <span class="sign">(</span>ivar <span class="sign">></span><span class="sign">=</span> 0<span class="sign">)</span> <span class="keyword">then</span>
<span class="comment">! Handle the units attribute.</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo96">etsf_io_low_write_att</a><span class="sign">(</span>ncid<span class="sign">,</span> ivar<span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="quote">"units"</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="quote">"atomic units"</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> lstat<span class="sign">,</span> error_data <span class="sign">=</span> error_data<span class="sign">)</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="sign">.</span><span class="keyword">not</span><span class="sign">.</span> lstat<span class="sign">)</span> <span class="keyword">return</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo96">etsf_io_low_write_att</a><span class="sign">(</span>ncid<span class="sign">,</span> ivar<span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="quote">"scale_to_atomic_units"</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> 1<span class="sign">.</span>0d0<span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> lstat<span class="sign">,</span> error_data <span class="sign">=</span> error_data<span class="sign">)</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="sign">.</span><span class="keyword">not</span><span class="sign">.</span> lstat<span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo74">etsf_io_low_error_update</a><span class="sign">(</span>error_data<span class="sign">,</span> my_name<span class="sign">)</span>
<span class="keyword">return</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="keyword">iand</span><span class="sign">(</span>my_flags<span class="sign">,</span> etsf_basisdata_n_coeff<span class="sign">)</span> <span class="sign">/</span><span class="sign">=</span> 0<span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo67">etsf_io_low_def_var</a><span class="sign">(</span>ncid<span class="sign">,</span> <span class="quote">"number_of_coefficients"</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> etsf_io_low_integer<span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="sign">(</span><span class="sign">/</span> split_dims<span class="sign">%</span>number_of_kpoints <span class="sign">/</span><span class="sign">)</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> lstat<span class="sign">,</span> ncvarid <span class="sign">=</span> ivar<span class="sign">,</span> error_data <span class="sign">=</span> error_data<span class="sign">)</span>
<span class="comment">! We raise don't raise an error if a dimension is missing.</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="sign">.</span><span class="keyword">not</span><span class="sign">.</span> lstat <span class="sign">.</span><span class="keyword">and</span><span class="sign">.</span> <span class="sign">(</span>error_data<span class="sign">%</span>access_mode_id <span class="sign">/</span><span class="sign">=</span> ERROR_MODE_INQ <span class="sign">.</span><span class="keyword">or</span><span class="sign">.</span> <span class="sign">&</span>
<span class="sign">&</span> error_data<span class="sign">%</span>target_type_id <span class="sign">/</span><span class="sign">=</span> ERROR_TYPE_DID<span class="sign">)</span><span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo74">etsf_io_low_error_update</a><span class="sign">(</span>error_data<span class="sign">,</span> my_name<span class="sign">)</span>
<span class="keyword">return</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">if</span> <span class="sign">(</span>ivar <span class="sign">></span><span class="sign">=</span> 0<span class="sign">)</span> <span class="keyword">then</span>
<span class="comment">! Handle the k_dependent attribute.</span>
<span class="keyword">if</span> <span class="sign">(</span>my_k_dependent<span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo96">etsf_io_low_write_att</a><span class="sign">(</span>ncid<span class="sign">,</span> ivar<span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="quote">"k_dependent"</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="quote">"yes"</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> lstat<span class="sign">,</span> error_data <span class="sign">=</span> error_data<span class="sign">)</span>
<span class="keyword">else</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo96">etsf_io_low_write_att</a><span class="sign">(</span>ncid<span class="sign">,</span> ivar<span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="quote">"k_dependent"</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="quote">"no"</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> lstat<span class="sign">,</span> error_data <span class="sign">=</span> error_data<span class="sign">)</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="sign">.</span><span class="keyword">not</span><span class="sign">.</span> lstat<span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo74">etsf_io_low_error_update</a><span class="sign">(</span>error_data<span class="sign">,</span> my_name<span class="sign">)</span>
<span class="keyword">return</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="keyword">iand</span><span class="sign">(</span>my_flags<span class="sign">,</span> etsf_basisdata_red_coord_pw<span class="sign">)</span> <span class="sign">/</span><span class="sign">=</span> 0<span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="sign">.</span><span class="keyword">not</span><span class="sign">.</span> my_k_dependent<span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo67">etsf_io_low_def_var</a><span class="sign">(</span>ncid<span class="sign">,</span> <span class="quote">"reduced_coordinates_of_plane_waves"</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> etsf_io_low_integer<span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="sign">(</span><span class="sign">/</span> <a href="../low_level/etsf_io_low_level_f90.html#robo130">pad</a><span class="sign">(</span><span class="quote">"number_of_reduced_dimensions"</span><span class="sign">)</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> split_dims<span class="sign">%</span>max_number_of_coefficients <span class="sign">/</span><span class="sign">)</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> lstat<span class="sign">,</span> ncvarid <span class="sign">=</span> ivar<span class="sign">,</span> error_data <span class="sign">=</span> error_data<span class="sign">)</span>
<span class="keyword">else</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo67">etsf_io_low_def_var</a><span class="sign">(</span>ncid<span class="sign">,</span> <span class="quote">"reduced_coordinates_of_plane_waves"</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> etsf_io_low_integer<span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="sign">(</span><span class="sign">/</span> <a href="../low_level/etsf_io_low_level_f90.html#robo130">pad</a><span class="sign">(</span><span class="quote">"number_of_reduced_dimensions"</span><span class="sign">)</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> split_dims<span class="sign">%</span>max_number_of_coefficients<span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> split_dims<span class="sign">%</span>number_of_kpoints <span class="sign">/</span><span class="sign">)</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> lstat<span class="sign">,</span> ncvarid <span class="sign">=</span> ivar<span class="sign">,</span> error_data <span class="sign">=</span> error_data<span class="sign">)</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="comment">! We raise don't raise an error if a dimension is missing.</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="sign">.</span><span class="keyword">not</span><span class="sign">.</span> lstat <span class="sign">.</span><span class="keyword">and</span><span class="sign">.</span> <span class="sign">(</span>error_data<span class="sign">%</span>access_mode_id <span class="sign">/</span><span class="sign">=</span> ERROR_MODE_INQ <span class="sign">.</span><span class="keyword">or</span><span class="sign">.</span> <span class="sign">&</span>
<span class="sign">&</span> error_data<span class="sign">%</span>target_type_id <span class="sign">/</span><span class="sign">=</span> ERROR_TYPE_DID<span class="sign">)</span><span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo74">etsf_io_low_error_update</a><span class="sign">(</span>error_data<span class="sign">,</span> my_name<span class="sign">)</span>
<span class="keyword">return</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">if</span> <span class="sign">(</span>ivar <span class="sign">></span><span class="sign">=</span> 0<span class="sign">)</span> <span class="keyword">then</span>
<span class="comment">! Handle the k_dependent attribute.</span>
<span class="keyword">if</span> <span class="sign">(</span>my_k_dependent<span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo96">etsf_io_low_write_att</a><span class="sign">(</span>ncid<span class="sign">,</span> ivar<span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="quote">"k_dependent"</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="quote">"yes"</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> lstat<span class="sign">,</span> error_data <span class="sign">=</span> error_data<span class="sign">)</span>
<span class="keyword">else</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo96">etsf_io_low_write_att</a><span class="sign">(</span>ncid<span class="sign">,</span> ivar<span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="quote">"k_dependent"</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="quote">"no"</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> lstat<span class="sign">,</span> error_data <span class="sign">=</span> error_data<span class="sign">)</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="sign">.</span><span class="keyword">not</span><span class="sign">.</span> lstat<span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo74">etsf_io_low_error_update</a><span class="sign">(</span>error_data<span class="sign">,</span> my_name<span class="sign">)</span>
<span class="keyword">return</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="keyword">iand</span><span class="sign">(</span>my_flags<span class="sign">,</span> etsf_basisdata_coord_grid<span class="sign">)</span> <span class="sign">/</span><span class="sign">=</span> 0<span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo67">etsf_io_low_def_var</a><span class="sign">(</span>ncid<span class="sign">,</span> <span class="quote">"coordinates_of_basis_grid_points"</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> etsf_io_low_integer<span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="sign">(</span><span class="sign">/</span> <a href="../low_level/etsf_io_low_level_f90.html#robo130">pad</a><span class="sign">(</span><span class="quote">"number_of_reduced_dimensions"</span><span class="sign">)</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <a href="../low_level/etsf_io_low_level_f90.html#robo130">pad</a><span class="sign">(</span><span class="quote">"max_number_of_basis_grid_points"</span><span class="sign">)</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <a href="../low_level/etsf_io_low_level_f90.html#robo130">pad</a><span class="sign">(</span><span class="quote">"number_of_localization_regions"</span><span class="sign">)</span> <span class="sign">/</span><span class="sign">)</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> lstat<span class="sign">,</span> ncvarid <span class="sign">=</span> ivar<span class="sign">,</span> error_data <span class="sign">=</span> error_data<span class="sign">)</span>
<span class="comment">! We raise don't raise an error if a dimension is missing.</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="sign">.</span><span class="keyword">not</span><span class="sign">.</span> lstat <span class="sign">.</span><span class="keyword">and</span><span class="sign">.</span> <span class="sign">(</span>error_data<span class="sign">%</span>access_mode_id <span class="sign">/</span><span class="sign">=</span> ERROR_MODE_INQ <span class="sign">.</span><span class="keyword">or</span><span class="sign">.</span> <span class="sign">&</span>
<span class="sign">&</span> error_data<span class="sign">%</span>target_type_id <span class="sign">/</span><span class="sign">=</span> ERROR_TYPE_DID<span class="sign">)</span><span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo74">etsf_io_low_error_update</a><span class="sign">(</span>error_data<span class="sign">,</span> my_name<span class="sign">)</span>
<span class="keyword">return</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="keyword">iand</span><span class="sign">(</span>my_flags<span class="sign">,</span> etsf_basisdata_n_coeff_grid<span class="sign">)</span> <span class="sign">/</span><span class="sign">=</span> 0<span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo67">etsf_io_low_def_var</a><span class="sign">(</span>ncid<span class="sign">,</span> <span class="quote">"number_of_coefficients_per_grid_point"</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> etsf_io_low_integer<span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <span class="sign">(</span><span class="sign">/</span> <a href="../low_level/etsf_io_low_level_f90.html#robo130">pad</a><span class="sign">(</span><span class="quote">"max_number_of_basis_grid_points"</span><span class="sign">)</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> <a href="../low_level/etsf_io_low_level_f90.html#robo130">pad</a><span class="sign">(</span><span class="quote">"number_of_localization_regions"</span><span class="sign">)</span> <span class="sign">/</span><span class="sign">)</span><span class="sign">,</span> <span class="sign">&</span>
<span class="sign">&</span> lstat<span class="sign">,</span> ncvarid <span class="sign">=</span> ivar<span class="sign">,</span> error_data <span class="sign">=</span> error_data<span class="sign">)</span>
<span class="comment">! We raise don't raise an error if a dimension is missing.</span>
<span class="keyword">if</span> <span class="sign">(</span><span class="sign">.</span><span class="keyword">not</span><span class="sign">.</span> lstat <span class="sign">.</span><span class="keyword">and</span><span class="sign">.</span> <span class="sign">(</span>error_data<span class="sign">%</span>access_mode_id <span class="sign">/</span><span class="sign">=</span> ERROR_MODE_INQ <span class="sign">.</span><span class="keyword">or</span><span class="sign">.</span> <span class="sign">&</span>
<span class="sign">&</span> error_data<span class="sign">%</span>target_type_id <span class="sign">/</span><span class="sign">=</span> ERROR_TYPE_DID<span class="sign">)</span><span class="sign">)</span> <span class="keyword">then</span>
<span class="keyword">call</span> <a href="../low_level/etsf_io_low_level_f90.html#robo74">etsf_io_low_error_update</a><span class="sign">(</span>error_data<span class="sign">,</span> my_name<span class="sign">)</span>
<span class="keyword">return</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="keyword">end</span> <span class="keyword">if</span>
<span class="comment">! If we reach the end, then it should be OK.</span>
lstat <span class="sign">=</span> <span class="sign">.</span><span class="keyword">true</span><span class="sign">.</span>
<span class="comment">!DEBUG</span>
<span class="comment">!write (*,*) '<strong>etsf_io_basisdata_def</strong> : exit'</span>
<span class="comment">!ENDDEBUG</span>
<span class="keyword">end</span> <span class="keyword">subroutine</span> <strong>etsf_io_basisdata_def</strong>
</pre>
</div> <!-- content -->
<div id="footer">
<p>Generated from ./src/group_level/etsf_io_basisdata_def.f90 with <a href="http://www.xs4all.nl/~rfsber/Robo/robodoc.html">ROBODoc</a> V4.99.38 on Fri Nov 25 2011 14:02:55
</p>
</div> <!-- footer -->
</body>
</html>
|