1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-11-03 20:54:07 +01:00

Deploying to gh-pages from @ TREX-CoE/trexio@1cfa313d07 🚀

This commit is contained in:
scemama 2021-05-06 16:26:46 +00:00
parent 5d492fa530
commit eebfa52ded
5 changed files with 218 additions and 145 deletions

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-05-06 Thu 16:18 -->
<!-- 2021-05-06 Thu 16:26 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TREXIO source code documentation</title>
@ -341,7 +341,7 @@ and bug reports should be submitted at
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-05-06 Thu 16:18</p>
<p class="date">Created: 2021-05-06 Thu 16:26</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-05-06 Thu 16:18 -->
<!-- 2021-05-06 Thu 16:26 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TREXIO source code documentation</title>
@ -341,7 +341,7 @@ and bug reports should be submitted at
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-05-06 Thu 16:18</p>
<p class="date">Created: 2021-05-06 Thu 16:26</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,10 +3,10 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-05-06 Thu 16:18 -->
<!-- 2021-05-06 Thu 16:26 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Front end API</title>
<title>&lrm;</title>
<meta name="generator" content="Org mode" />
<meta name="author" content="TREX-CoE" />
<style type="text/css">
@ -306,50 +306,52 @@ for the JavaScript code in this tag.
|
<a accesskey="H" href="index.html"> HOME </a>
</div><div id="content">
<h1 class="title">Front end API</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orge2b0641">1. Coding conventions</a>
<li><a href="#org7e09a67">1. Coding conventions</a>
<ul>
<li><a href="#org099d29a">1.1. Memory allocation</a></li>
<li><a href="#org65f9c9f">1.1. Memory allocation</a></li>
</ul>
</li>
<li><a href="#org6b35e68">2. Front end</a>
<li><a href="#orga6c179d">2. Front end</a>
<ul>
<li><a href="#orgf638d5c">2.1. Error handling</a></li>
<li><a href="#org49b2479">2.2. Back ends</a></li>
<li><a href="#orgc79997a">2.3. Read/write behavior</a></li>
<li><a href="#org751ea56">2.4. TREXIO file type</a></li>
<li><a href="#org8755fc2">2.5. Polymorphism of the file handle</a></li>
<li><a href="#org6d23efd">2.6. File opening</a></li>
<li><a href="#org191f15f">2.7. File closing</a></li>
<li><a href="#orgcfdb6d4">2.1. Error handling</a></li>
<li><a href="#org561fe5a">2.2. Back ends</a></li>
<li><a href="#orgb5d6ad2">2.3. Read/write behavior</a></li>
<li><a href="#orga2a9354">2.4. TREXIO file type</a></li>
<li><a href="#org8afda3c">2.5. Polymorphism of the file handle</a></li>
<li><a href="#orge9d9442">2.6. File opening</a></li>
<li><a href="#orgeba6de8">2.7. File closing</a></li>
</ul>
</li>
<li><a href="#org065db97">3. Templates for front end</a>
<li><a href="#org502284a">3. Templates for front end</a>
<ul>
<li><a href="#org6a0a757">3.1. Templates for front end has/read/write a dimension</a>
<li><a href="#org5d551fe">3.1. Templates for front end has/read/write a dimension</a>
<ul>
<li><a href="#orgbb08814">3.1.1. C templates for front end</a></li>
<li><a href="#org78d8106">3.1.2. Fortran templates for front end</a></li>
<li><a href="#orgfca270d">3.1.1. C templates for front end</a></li>
<li><a href="#org70dfa9e">3.1.2. Fortran templates for front end</a></li>
</ul>
</li>
<li><a href="#orga0b02a7">3.2. Templates for front end has/read/write a dataset</a>
<li><a href="#orgeae4dcc">3.2. Templates for front end has/read/write a dataset</a>
<ul>
<li><a href="#org83c9397">3.2.1. C templates for front end</a></li>
<li><a href="#orge19c7c2">3.2.2. Fortran templates for front end</a></li>
<li><a href="#org57a212c">3.2.1. C templates for front end</a></li>
<li><a href="#orgd7ba6e6">3.2.2. Fortran templates for front end</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#org75da4f4">4. Fortran helper/wrapper functions</a></li>
<li><a href="#orgc444773">4. Fortran helper/wrapper functions</a></li>
</ul>
</div>
</div>
<p>
d+TITLE: Front end API
</p>
<div id="outline-container-orge2b0641" class="outline-2">
<h2 id="orge2b0641"><span class="section-number-2">1</span> Coding conventions</h2>
<div id="outline-container-org7e09a67" class="outline-2">
<h2 id="org7e09a67"><span class="section-number-2">1</span> Coding conventions</h2>
<div class="outline-text-2" id="text-1">
<ul class="org-ul">
<li>integer types will be defined using types given in <code>stdint.h</code></li>
@ -364,8 +366,8 @@ for the JavaScript code in this tag.
</ul>
</div>
<div id="outline-container-org099d29a" class="outline-3">
<h3 id="org099d29a"><span class="section-number-3">1.1</span> Memory allocation</h3>
<div id="outline-container-org65f9c9f" class="outline-3">
<h3 id="org65f9c9f"><span class="section-number-3">1.1</span> Memory allocation</h3>
<div class="outline-text-3" id="text-1-1">
<p>
Memory allocation of structures can be facilitated by using the
@ -399,19 +401,19 @@ The maximum string size for the filenames is 4096 characters.
</div>
</div>
</div>
<div id="outline-container-org6b35e68" class="outline-2">
<h2 id="org6b35e68"><span class="section-number-2">2</span> Front end</h2>
<div id="outline-container-orga6c179d" class="outline-2">
<h2 id="orga6c179d"><span class="section-number-2">2</span> Front end</h2>
<div class="outline-text-2" id="text-2">
<p>
All calls to TREXIO are thread-safe.
TREXIO front end is modular, which simplifies impelementation of new back ends.
TREXIO front end is modular, which simplifies implementation of new back ends.
</p>
</div>
<div id="outline-container-orgf638d5c" class="outline-3">
<h3 id="orgf638d5c"><span class="section-number-3">2.1</span> Error handling</h3>
<div id="outline-container-orgcfdb6d4" class="outline-3">
<h3 id="orgcfdb6d4"><span class="section-number-3">2.1</span> Error handling</h3>
<div class="outline-text-3" id="text-2-1">
<table id="org3e5bd15" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org58789fb" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -518,6 +520,54 @@ TREXIO front end is modular, which simplifies impelementation of new back ends.
<td class="org-right">13</td>
<td class="org-left">'This variable already exists'</td>
</tr>
<tr>
<td class="org-left"><code>TREXIO_OPEN_ERROR</code></td>
<td class="org-right">14</td>
<td class="org-left">'Error opening file'</td>
</tr>
<tr>
<td class="org-left"><code>TREXIO_LOCK_ERROR</code></td>
<td class="org-right">15</td>
<td class="org-left">'Error locking file'</td>
</tr>
<tr>
<td class="org-left"><code>TREXIO_UNLOCK_ERROR</code></td>
<td class="org-right">16</td>
<td class="org-left">'Error unlocking file'</td>
</tr>
<tr>
<td class="org-left"><code>TREXIO_FILE_ERROR</code></td>
<td class="org-right">17</td>
<td class="org-left">'Invalid file handle'</td>
</tr>
<tr>
<td class="org-left"><code>TREXIO_GROUP_READ_ERROR</code></td>
<td class="org-right">18</td>
<td class="org-left">'Error reading group'</td>
</tr>
<tr>
<td class="org-left"><code>TREXIO_GROUP_WRITE_ERROR</code></td>
<td class="org-right">19</td>
<td class="org-left">'Error writing group'</td>
</tr>
<tr>
<td class="org-left"><code>TREXIO_ELEM_READ_ERROR</code></td>
<td class="org-right">20</td>
<td class="org-left">'Error reading element'</td>
</tr>
<tr>
<td class="org-left"><code>TREXIO_ELEM_WRITE_ERROR</code></td>
<td class="org-right">21</td>
<td class="org-left">'Error writing element'</td>
</tr>
</tbody>
</table>
@ -595,6 +645,30 @@ The text strings are extracted from the previous table.
<span style="color: #a020f0;">case</span> TREXIO_NUM_ALREADY_EXISTS:
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"This variable already exists"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> TREXIO_OPEN_ERROR:
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Error opening file"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> TREXIO_LOCK_ERROR:
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Error locking file"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> TREXIO_UNLOCK_ERROR:
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Error unlocking file"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> TREXIO_FILE_ERROR:
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Invalid file handle"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> TREXIO_GROUP_READ_ERROR:
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Error reading group"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> TREXIO_GROUP_WRITE_ERROR:
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Error writing group"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> TREXIO_ELEM_READ_ERROR:
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Error reading element"</span>;
<span style="color: #a020f0;">break</span>;
<span style="color: #a020f0;">case</span> TREXIO_ELEM_WRITE_ERROR:
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Error writing element"</span>;
<span style="color: #a020f0;">break</span>;
}
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Unknown error"</span>;
}
@ -621,8 +695,8 @@ The text strings are extracted from the previous table.
</div>
</div>
<div id="outline-container-org49b2479" class="outline-3">
<h3 id="org49b2479"><span class="section-number-3">2.2</span> Back ends</h3>
<div id="outline-container-org561fe5a" class="outline-3">
<h3 id="org561fe5a"><span class="section-number-3">2.2</span> Back ends</h3>
<div class="outline-text-3" id="text-2-2">
<p>
TREXIO has several back ends:
@ -652,8 +726,8 @@ lines that correspond to the <code>TREXIO_JSON</code> back end (not implemented
</div>
</div>
</div>
<div id="outline-container-orgc79997a" class="outline-3">
<h3 id="orgc79997a"><span class="section-number-3">2.3</span> Read/write behavior</h3>
<div id="outline-container-orgb5d6ad2" class="outline-3">
<h3 id="orgb5d6ad2"><span class="section-number-3">2.3</span> Read/write behavior</h3>
<div class="outline-text-3" id="text-2-3">
<p>
Every time a reading function is called, the data is read from the
@ -681,8 +755,8 @@ concurrent programs, the behavior is not specified.
</p>
</div>
</div>
<div id="outline-container-org751ea56" class="outline-3">
<h3 id="org751ea56"><span class="section-number-3">2.4</span> TREXIO file type</h3>
<div id="outline-container-orga2a9354" class="outline-3">
<h3 id="orga2a9354"><span class="section-number-3">2.4</span> TREXIO file type</h3>
<div class="outline-text-3" id="text-2-4">
<p>
<code>trexio_s</code> is the the main type for TREXIO files, visible to the users
@ -714,8 +788,8 @@ TREXIO files will have as a first argument the TREXIO file handle.
</div>
</div>
</div>
<div id="outline-container-org8755fc2" class="outline-3">
<h3 id="org8755fc2"><span class="section-number-3">2.5</span> Polymorphism of the file handle</h3>
<div id="outline-container-org8afda3c" class="outline-3">
<h3 id="org8afda3c"><span class="section-number-3">2.5</span> Polymorphism of the file handle</h3>
<div class="outline-text-3" id="text-2-5">
<p>
Polymorphism of the <code>trexio_t</code> type is handled by ensuring that the
@ -734,8 +808,8 @@ corresponding types for all back ends can be safely casted to
</div>
</div>
<div id="outline-container-org6d23efd" class="outline-3">
<h3 id="org6d23efd"><span class="section-number-3">2.6</span> File opening</h3>
<div id="outline-container-orge9d9442" class="outline-3">
<h3 id="orge9d9442"><span class="section-number-3">2.6</span> File opening</h3>
<div class="outline-text-3" id="text-2-6">
<p>
<code>trexio_open</code> creates a new TREXIO file or opens existing one.
@ -828,7 +902,7 @@ should tend to avoid renaming the <code>.txt</code> data files.
/* <span style="color: #b22222;">Back end initialization </span>*/
rc = TREXIO_FAILURE;
rc = TREXIO_OPEN_ERROR;
<span style="color: #a020f0;">switch</span> (back_end) {
@ -854,7 +928,7 @@ should tend to avoid renaming the <code>.txt</code> data files.
/* <span style="color: #b22222;">File locking </span>*/
rc = TREXIO_FAILURE;
rc = TREXIO_LOCK_ERROR;
<span style="color: #a020f0;">switch</span> (back_end) {
@ -897,8 +971,8 @@ should tend to avoid renaming the <code>.txt</code> data files.
</div>
</div>
<div id="outline-container-org191f15f" class="outline-3">
<h3 id="org191f15f"><span class="section-number-3">2.7</span> File closing</h3>
<div id="outline-container-orgeba6de8" class="outline-3">
<h3 id="orgeba6de8"><span class="section-number-3">2.7</span> File closing</h3>
<div class="outline-text-3" id="text-2-7">
<p>
<code>trexio_close</code> closes an existing <code>trexio_t</code> file.
@ -919,7 +993,7 @@ output:
<span style="color: #0000ff;">trexio_close</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a0522d;">file</span>)
{
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_FAILURE;
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_FILE_ERROR;
<span style="color: #228b22;">trexio_exit_code</span> <span style="color: #a0522d;">rc</span>;
@ -945,12 +1019,12 @@ output:
<span style="color: #a020f0;">if</span> (rc != TREXIO_SUCCESS) {
FREE(file-&gt;file_name);
FREE(file);
<span style="color: #a020f0;">return</span> TREXIO_FAILURE;
<span style="color: #a020f0;">return</span> rc;
}
/* <span style="color: #b22222;">File unlocking </span>*/
rc = TREXIO_FAILURE;
rc = TREXIO_UNLOCK_ERROR;
<span style="color: #a020f0;">switch</span> (file-&gt;back_end) {
@ -977,7 +1051,7 @@ output:
free(file);
<span style="color: #a020f0;">if</span> (irc != 0) <span style="color: #a020f0;">return</span> TREXIO_ERRNO;
<span style="color: #a020f0;">if</span> (rc != TREXIO_SUCCESS) <span style="color: #a020f0;">return</span> TREXIO_FAILURE;
<span style="color: #a020f0;">if</span> (rc != TREXIO_SUCCESS) <span style="color: #a020f0;">return</span> rc;
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
}
@ -997,8 +1071,8 @@ output:
</div>
</div>
<div id="outline-container-org065db97" class="outline-2">
<h2 id="org065db97"><span class="section-number-2">3</span> Templates for front end</h2>
<div id="outline-container-org502284a" class="outline-2">
<h2 id="org502284a"><span class="section-number-2">3</span> Templates for front end</h2>
<div class="outline-text-2" id="text-3">
<p>
Consider the following block of <code>trex.json</code>:
@ -1159,8 +1233,8 @@ TREXIO supports I/O with single or double precision for integer and floating poi
</div>
<div id="outline-container-org6a0a757" class="outline-3">
<h3 id="org6a0a757"><span class="section-number-3">3.1</span> Templates for front end has/read/write a dimension</h3>
<div id="outline-container-org5d551fe" class="outline-3">
<h3 id="org5d551fe"><span class="section-number-3">3.1</span> Templates for front end has/read/write a dimension</h3>
<div class="outline-text-3" id="text-3-1">
<p>
This section concerns API calls related to dimensioning variables.
@ -1229,8 +1303,8 @@ This section concerns API calls related to dimensioning variables.
</table>
</div>
<div id="outline-container-orgbb08814" class="outline-4">
<h4 id="orgbb08814"><span class="section-number-4">3.1.1</span> C templates for front end</h4>
<div id="outline-container-orgfca270d" class="outline-4">
<h4 id="orgfca270d"><span class="section-number-4">3.1.1</span> C templates for front end</h4>
<div class="outline-text-4" id="text-3-1-1">
<p>
The <code>C</code> templates that correspond to each of the abovementioned functions can be found below.
@ -1248,7 +1322,7 @@ The basic (non-suffixed) API call on dimensioning variables deals with single pr
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1;
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">u_num</span> = 0;
<span style="color: #228b22;">trexio_exit_code</span> <span style="color: #a0522d;">rc</span> = TREXIO_FAILURE;
<span style="color: #228b22;">trexio_exit_code</span> <span style="color: #a0522d;">rc</span> = TREXIO_GROUP_READ_ERROR;
<span style="color: #a020f0;">switch</span> (file-&gt;back_end) {
@ -1281,7 +1355,7 @@ The basic (non-suffixed) API call on dimensioning variables deals with single pr
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1;
<span style="color: #a020f0;">if</span> (num &lt; 0 ) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_2;
<span style="color: #228b22;">trexio_exit_code</span> <span style="color: #a0522d;">rc</span> = TREXIO_FAILURE;
<span style="color: #228b22;">trexio_exit_code</span> <span style="color: #a0522d;">rc</span> = TREXIO_GROUP_WRITE_ERROR;
<span style="color: #a020f0;">switch</span> (file-&gt;back_end) {
@ -1312,7 +1386,7 @@ The basic (non-suffixed) API call on dimensioning variables deals with single pr
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1;
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">u_num</span> = 0;
<span style="color: #228b22;">trexio_exit_code</span> <span style="color: #a0522d;">rc</span> = TREXIO_FAILURE;
<span style="color: #228b22;">trexio_exit_code</span> <span style="color: #a0522d;">rc</span> = TREXIO_GROUP_READ_ERROR;
<span style="color: #a020f0;">switch</span> (file-&gt;back_end) {
@ -1346,7 +1420,7 @@ The basic (non-suffixed) API call on dimensioning variables deals with single pr
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1;
<span style="color: #a020f0;">if</span> (num &lt; 0 ) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_2;
<span style="color: #228b22;">trexio_exit_code</span> <span style="color: #a0522d;">rc</span> = TREXIO_FAILURE;
<span style="color: #228b22;">trexio_exit_code</span> <span style="color: #a0522d;">rc</span> = TREXIO_GROUP_WRITE_ERROR;
<span style="color: #a020f0;">switch</span> (file-&gt;back_end) {
@ -1419,8 +1493,8 @@ The basic (non-suffixed) API call on dimensioning variables deals with single pr
</div>
</div>
<div id="outline-container-org78d8106" class="outline-4">
<h4 id="org78d8106"><span class="section-number-4">3.1.2</span> Fortran templates for front end</h4>
<div id="outline-container-org70dfa9e" class="outline-4">
<h4 id="org70dfa9e"><span class="section-number-4">3.1.2</span> Fortran templates for front end</h4>
<div class="outline-text-4" id="text-3-1-2">
<p>
The <code>Fortran</code> templates that provide an access to the <code>C</code> API calls from Fortran.
@ -1506,9 +1580,8 @@ These templates are based on the use of <code>iso_c_binding</code>. Pointers hav
</div>
</div>
<div id="outline-container-orga0b02a7" class="outline-3">
<h3 id="orga0b02a7"><span class="section-number-3">3.2</span> Templates for front end has/read/write a dataset</h3>
<div id="outline-container-orgeae4dcc" class="outline-3">
<h3 id="orgeae4dcc"><span class="section-number-3">3.2</span> Templates for front end has/read/write a dataset</h3>
<div class="outline-text-3" id="text-3-2">
<p>
This section concerns API calls related to datasets.
@ -1577,8 +1650,8 @@ This section concerns API calls related to datasets.
</table>
</div>
<div id="outline-container-org83c9397" class="outline-4">
<h4 id="org83c9397"><span class="section-number-4">3.2.1</span> C templates for front end</h4>
<div id="outline-container-org57a212c" class="outline-4">
<h4 id="org57a212c"><span class="section-number-4">3.2.1</span> C templates for front end</h4>
<div class="outline-text-4" id="text-3-2-1">
<p>
The C templates that correspond to each of the abovementioned functions can be found below.
@ -1836,8 +1909,8 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
</div>
</div>
<div id="outline-container-orge19c7c2" class="outline-4">
<h4 id="orge19c7c2"><span class="section-number-4">3.2.2</span> Fortran templates for front end</h4>
<div id="outline-container-orgd7ba6e6" class="outline-4">
<h4 id="orgd7ba6e6"><span class="section-number-4">3.2.2</span> Fortran templates for front end</h4>
<div class="outline-text-4" id="text-3-2-2">
<p>
The <code>Fortran</code> templates that provide an access to the <code>C</code> API calls from <code>Fortran</code>.
@ -1924,8 +1997,8 @@ These templates are based on the use of <code>iso_c_binding</code>. Pointers hav
</div>
</div>
<div id="outline-container-org75da4f4" class="outline-2">
<h2 id="org75da4f4"><span class="section-number-2">4</span> Fortran helper/wrapper functions</h2>
<div id="outline-container-orgc444773" class="outline-2">
<h2 id="orgc444773"><span class="section-number-2">4</span> Fortran helper/wrapper functions</h2>
<div class="outline-text-2" id="text-4">
<p>
The function below adapts the original C-based <code>trexio_open</code> for Fortran.
@ -1954,7 +2027,7 @@ Note, that Fortran interface calls the main <code>TREXIO</code> API, which is wr
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-05-06 Thu 16:18</p>
<p class="date">Created: 2021-05-06 Thu 16:26</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-05-06 Thu 16:18 -->
<!-- 2021-05-06 Thu 16:26 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>HDF5 back end</title>
@ -311,25 +311,25 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org250f456">1. HDF5 back end</a>
<li><a href="#org420c928">1. HDF5 back end</a>
<ul>
<li><a href="#orgbbe7783">1.1. Template for HDF5 definitions</a></li>
<li><a href="#org9c9d175">1.2. Template for HDF5 structures</a></li>
<li><a href="#org0ae73d1">1.3. Template for HDF5 init/deinit</a></li>
<li><a href="#org6742765">1.4. Template for HDF5 has/read/write a number</a></li>
<li><a href="#orgf5faeea">1.5. Template for HDF5 has/read/write a dataset</a></li>
<li><a href="#org67cb711">1.1. Template for HDF5 definitions</a></li>
<li><a href="#org1d222fe">1.2. Template for HDF5 structures</a></li>
<li><a href="#orgcde6185">1.3. Template for HDF5 init/deinit</a></li>
<li><a href="#orgef68e6e">1.4. Template for HDF5 has/read/write a number</a></li>
<li><a href="#orga34644f">1.5. Template for HDF5 has/read/write a dataset</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-org250f456" class="outline-2">
<h2 id="org250f456"><span class="section-number-2">1</span> HDF5 back end</h2>
<div id="outline-container-org420c928" class="outline-2">
<h2 id="org420c928"><span class="section-number-2">1</span> HDF5 back end</h2>
<div class="outline-text-2" id="text-1">
</div>
<div id="outline-container-orgbbe7783" class="outline-3">
<h3 id="orgbbe7783"><span class="section-number-3">1.1</span> Template for HDF5 definitions</h3>
<div id="outline-container-org67cb711" class="outline-3">
<h3 id="org67cb711"><span class="section-number-3">1.1</span> Template for HDF5 definitions</h3>
<div class="outline-text-3" id="text-1-1">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #483d8b;">#define</span> $GROUP$_GROUP_NAME <span style="color: #8b2252;">"$group$"</span>
@ -340,8 +340,8 @@ for the JavaScript code in this tag.
</div>
</div>
<div id="outline-container-org9c9d175" class="outline-3">
<h3 id="org9c9d175"><span class="section-number-3">1.2</span> Template for HDF5 structures</h3>
<div id="outline-container-org1d222fe" class="outline-3">
<h3 id="org1d222fe"><span class="section-number-3">1.2</span> Template for HDF5 structures</h3>
<div class="outline-text-3" id="text-1-2">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">trexio_hdf5_s</span> {
@ -356,8 +356,8 @@ for the JavaScript code in this tag.
</div>
<div id="outline-container-org0ae73d1" class="outline-3">
<h3 id="org0ae73d1"><span class="section-number-3">1.3</span> Template for HDF5 init/deinit</h3>
<div id="outline-container-orgcde6185" class="outline-3">
<h3 id="orgcde6185"><span class="section-number-3">1.3</span> Template for HDF5 init/deinit</h3>
<div class="outline-text-3" id="text-1-3">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -440,8 +440,8 @@ for the JavaScript code in this tag.
</div>
</div>
<div id="outline-container-org6742765" class="outline-3">
<h3 id="org6742765"><span class="section-number-3">1.4</span> Template for HDF5 has/read/write a number</h3>
<div id="outline-container-orgef68e6e" class="outline-3">
<h3 id="orgef68e6e"><span class="section-number-3">1.4</span> Template for HDF5 has/read/write a number</h3>
<div class="outline-text-3" id="text-1-4">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -563,8 +563,8 @@ for the JavaScript code in this tag.
</div>
</div>
<div id="outline-container-orgf5faeea" class="outline-3">
<h3 id="orgf5faeea"><span class="section-number-3">1.5</span> Template for HDF5 has/read/write a dataset</h3>
<div id="outline-container-orga34644f" class="outline-3">
<h3 id="orga34644f"><span class="section-number-3">1.5</span> Template for HDF5 has/read/write a dataset</h3>
<div class="outline-text-3" id="text-1-5">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -698,7 +698,7 @@ for the JavaScript code in this tag.
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-05-06 Thu 16:18</p>
<p class="date">Created: 2021-05-06 Thu 16:26</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-05-06 Thu 16:18 -->
<!-- 2021-05-06 Thu 16:26 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TEXT back end</title>
@ -311,24 +311,24 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orga0e9ff4">1. TEXT back end</a>
<li><a href="#org1f49dec">1. TEXT back end</a>
<ul>
<li><a href="#orge09cfd2">1.1. Template for group-related structures in text back end</a></li>
<li><a href="#org3d40492">1.2. Template for general structure in text back end</a></li>
<li><a href="#org8abb301">1.3. Initialize function (constant part)</a></li>
<li><a href="#org0790568">1.4. Deinitialize function (templated part)</a></li>
<li><a href="#org883883d">1.5. Template for text read struct</a></li>
<li><a href="#orgd8377f2">1.6. Template for text flush struct</a></li>
<li><a href="#orge7122ee">1.7. Template for text free memory</a></li>
<li><a href="#org374659f">1.8. Template for has/read/write the <code>$group_num$</code> attribute</a></li>
<li><a href="#org7381fd3">1.9. Template for has/read/write the <code>$group_dset$</code> dataset</a></li>
<li><a href="#org77124ea">1.10. RDM struct (hard-coded)</a>
<li><a href="#org24ec271">1.1. Template for group-related structures in text back end</a></li>
<li><a href="#orgd4c9a41">1.2. Template for general structure in text back end</a></li>
<li><a href="#org67313c5">1.3. Initialize function (constant part)</a></li>
<li><a href="#org2ff193c">1.4. Deinitialize function (templated part)</a></li>
<li><a href="#org4666ed2">1.5. Template for text read struct</a></li>
<li><a href="#org87048a0">1.6. Template for text flush struct</a></li>
<li><a href="#org910e8de">1.7. Template for text free memory</a></li>
<li><a href="#orgdc0b7b9">1.8. Template for has/read/write the <code>$group_num$</code> attribute</a></li>
<li><a href="#org5ca2fe8">1.9. Template for has/read/write the <code>$group_dset$</code> dataset</a></li>
<li><a href="#org1d64f2c">1.10. RDM struct (hard-coded)</a>
<ul>
<li><a href="#org16780a6">1.10.1. Read the complete struct</a></li>
<li><a href="#orgf849898">1.10.2. Flush the complete struct</a></li>
<li><a href="#org333afd4">1.10.3. Free memory</a></li>
<li><a href="#org4060167">1.10.4. Read/Write the one<sub>e</sub> attribute</a></li>
<li><a href="#orgc3734be">1.10.5. Read/Write the two<sub>e</sub> attribute</a></li>
<li><a href="#orgbf33676">1.10.1. Read the complete struct</a></li>
<li><a href="#org23450f3">1.10.2. Flush the complete struct</a></li>
<li><a href="#org610ea72">1.10.3. Free memory</a></li>
<li><a href="#org7a191c5">1.10.4. Read/Write the one<sub>e</sub> attribute</a></li>
<li><a href="#org44fc972">1.10.5. Read/Write the two<sub>e</sub> attribute</a></li>
</ul>
</li>
</ul>
@ -337,8 +337,8 @@ for the JavaScript code in this tag.
</div>
</div>
<div id="outline-container-orga0e9ff4" class="outline-2">
<h2 id="orga0e9ff4"><span class="section-number-2">1</span> TEXT back end</h2>
<div id="outline-container-org1f49dec" class="outline-2">
<h2 id="org1f49dec"><span class="section-number-2">1</span> TEXT back end</h2>
<div class="outline-text-2" id="text-1">
<p>
The "file" produced by the text back end is a directory with one
@ -359,8 +359,8 @@ The file is written when closed, or when the flush function is called.
</p>
</div>
<div id="outline-container-orge09cfd2" class="outline-3">
<h3 id="orge09cfd2"><span class="section-number-3">1.1</span> Template for group-related structures in text back end</h3>
<div id="outline-container-org24ec271" class="outline-3">
<h3 id="org24ec271"><span class="section-number-3">1.1</span> Template for group-related structures in text back end</h3>
<div class="outline-text-3" id="text-1-1">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> $group$_s {
@ -376,8 +376,8 @@ The file is written when closed, or when the flush function is called.
</div>
</div>
<div id="outline-container-org3d40492" class="outline-3">
<h3 id="org3d40492"><span class="section-number-3">1.2</span> Template for general structure in text back end</h3>
<div id="outline-container-orgd4c9a41" class="outline-3">
<h3 id="orgd4c9a41"><span class="section-number-3">1.2</span> Template for general structure in text back end</h3>
<div class="outline-text-3" id="text-1-2">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">rdm_s</span> {
@ -403,8 +403,8 @@ The file is written when closed, or when the flush function is called.
</div>
</div>
<div id="outline-container-org8abb301" class="outline-3">
<h3 id="org8abb301"><span class="section-number-3">1.3</span> Initialize function (constant part)</h3>
<div id="outline-container-org67313c5" class="outline-3">
<h3 id="org67313c5"><span class="section-number-3">1.3</span> Initialize function (constant part)</h3>
<div class="outline-text-3" id="text-1-3">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -511,8 +511,8 @@ The file is written when closed, or when the flush function is called.
</div>
</div>
<div id="outline-container-org0790568" class="outline-3">
<h3 id="org0790568"><span class="section-number-3">1.4</span> Deinitialize function (templated part)</h3>
<div id="outline-container-org2ff193c" class="outline-3">
<h3 id="org2ff193c"><span class="section-number-3">1.4</span> Deinitialize function (templated part)</h3>
<div class="outline-text-3" id="text-1-4">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -536,8 +536,8 @@ The file is written when closed, or when the flush function is called.
</div>
</div>
<div id="outline-container-org883883d" class="outline-3">
<h3 id="org883883d"><span class="section-number-3">1.5</span> Template for text read struct</h3>
<div id="outline-container-org4666ed2" class="outline-3">
<h3 id="org4666ed2"><span class="section-number-3">1.5</span> Template for text read struct</h3>
<div class="outline-text-3" id="text-1-5">
<div class="org-src-container">
<pre class="src src-c">$group$_t*
@ -734,8 +734,8 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
</div>
</div>
<div id="outline-container-orgd8377f2" class="outline-3">
<h3 id="orgd8377f2"><span class="section-number-3">1.6</span> Template for text flush struct</h3>
<div id="outline-container-org87048a0" class="outline-3">
<h3 id="org87048a0"><span class="section-number-3">1.6</span> Template for text flush struct</h3>
<div class="outline-text-3" id="text-1-6">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -793,8 +793,8 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
</div>
</div>
<div id="outline-container-orge7122ee" class="outline-3">
<h3 id="orge7122ee"><span class="section-number-3">1.7</span> Template for text free memory</h3>
<div id="outline-container-org910e8de" class="outline-3">
<h3 id="org910e8de"><span class="section-number-3">1.7</span> Template for text free memory</h3>
<div class="outline-text-3" id="text-1-7">
<p>
Memory is allocated when reading. The following function frees memory.
@ -835,8 +835,8 @@ Memory is allocated when reading. The following function frees memory.
</div>
</div>
<div id="outline-container-org374659f" class="outline-3">
<h3 id="org374659f"><span class="section-number-3">1.8</span> Template for has/read/write the <code>$group_num$</code> attribute</h3>
<div id="outline-container-orgdc0b7b9" class="outline-3">
<h3 id="orgdc0b7b9"><span class="section-number-3">1.8</span> Template for has/read/write the <code>$group_num$</code> attribute</h3>
<div class="outline-text-3" id="text-1-8">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -898,8 +898,8 @@ Memory is allocated when reading. The following function frees memory.
</div>
</div>
<div id="outline-container-org7381fd3" class="outline-3">
<h3 id="org7381fd3"><span class="section-number-3">1.9</span> Template for has/read/write the <code>$group_dset$</code> dataset</h3>
<div id="outline-container-org5ca2fe8" class="outline-3">
<h3 id="org5ca2fe8"><span class="section-number-3">1.9</span> Template for has/read/write the <code>$group_dset$</code> dataset</h3>
<div class="outline-text-3" id="text-1-9">
<p>
The <code>group_dset</code> array is assumed allocated with the appropriate size.
@ -996,12 +996,12 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div>
</div>
<div id="outline-container-org77124ea" class="outline-3">
<h3 id="org77124ea"><span class="section-number-3">1.10</span> RDM struct (hard-coded)</h3>
<div id="outline-container-org1d64f2c" class="outline-3">
<h3 id="org1d64f2c"><span class="section-number-3">1.10</span> RDM struct (hard-coded)</h3>
<div class="outline-text-3" id="text-1-10">
</div>
<div id="outline-container-org16780a6" class="outline-4">
<h4 id="org16780a6"><span class="section-number-4">1.10.1</span> Read the complete struct</h4>
<div id="outline-container-orgbf33676" class="outline-4">
<h4 id="orgbf33676"><span class="section-number-4">1.10.1</span> Read the complete struct</h4>
<div class="outline-text-4" id="text-1-10-1">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">rdm_t</span>* <span style="color: #0000ff;">trexio_text_read_rdm</span>(<span style="color: #228b22;">trexio_text_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>);
@ -1109,8 +1109,8 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div>
</div>
<div id="outline-container-orgf849898" class="outline-4">
<h4 id="orgf849898"><span class="section-number-4">1.10.2</span> Flush the complete struct</h4>
<div id="outline-container-org23450f3" class="outline-4">
<h4 id="org23450f3"><span class="section-number-4">1.10.2</span> Flush the complete struct</h4>
<div class="outline-text-4" id="text-1-10-2">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <span style="color: #0000ff;">trexio_text_flush_rdm</span>(<span style="color: #228b22;">trexio_text_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>);
@ -1153,8 +1153,8 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div>
</div>
<div id="outline-container-org333afd4" class="outline-4">
<h4 id="org333afd4"><span class="section-number-4">1.10.3</span> Free memory</h4>
<div id="outline-container-org610ea72" class="outline-4">
<h4 id="org610ea72"><span class="section-number-4">1.10.3</span> Free memory</h4>
<div class="outline-text-4" id="text-1-10-3">
<p>
Memory is allocated when reading. The followig function frees memory.
@ -1199,8 +1199,8 @@ Memory is allocated when reading. The followig function frees memory.
</div>
</div>
<div id="outline-container-org4060167" class="outline-4">
<h4 id="org4060167"><span class="section-number-4">1.10.4</span> Read/Write the one<sub>e</sub> attribute</h4>
<div id="outline-container-org7a191c5" class="outline-4">
<h4 id="org7a191c5"><span class="section-number-4">1.10.4</span> Read/Write the one<sub>e</sub> attribute</h4>
<div class="outline-text-4" id="text-1-10-4">
<p>
The <code>one_e</code> array is assumed allocated with the appropriate size.
@ -1266,8 +1266,8 @@ The <code>one_e</code> array is assumed allocated with the appropriate size.
</div>
</div>
<div id="outline-container-orgc3734be" class="outline-4">
<h4 id="orgc3734be"><span class="section-number-4">1.10.5</span> Read/Write the two<sub>e</sub> attribute</h4>
<div id="outline-container-org44fc972" class="outline-4">
<h4 id="org44fc972"><span class="section-number-4">1.10.5</span> Read/Write the two<sub>e</sub> attribute</h4>
<div class="outline-text-4" id="text-1-10-5">
<p>
<code>two_e</code> is a sparse data structure, which can be too large to fit
@ -1375,7 +1375,7 @@ file for each sparse float structure.
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-05-06 Thu 16:18</p>
<p class="date">Created: 2021-05-06 Thu 16:26</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>