-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmidas_design_philosophy.html
134 lines (126 loc) · 6.92 KB
/
midas_design_philosophy.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>MIDAS design philosophy — MIDAS documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/sphinxdoc.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
</head><body>
<div>
<img src="_static/MIDAS_header.png" alt="MIDAS" />
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="f-modindex.html" title="Fortran Module Index"
>fortran modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">MIDAS documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">MIDAS design philosophy</a></li>
</ul>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/midas_design_philosophy.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="midas-design-philosophy">
<h1>MIDAS design philosophy<a class="headerlink" href="#midas-design-philosophy" title="Permalink to this headline">¶</a></h1>
<ul class="simple">
<li><p>MIDAS uses the <strong>FORTRAN</strong> programming language exclusively.</p></li>
</ul>
<ul class="simple">
<li><p>We aim to apply <strong>an incremental approach</strong> to improving the design and
programming style of the MIDAS code. In particular, it is required that any
new code and significantly modified existing code is consistent with the
desired MIDAS code design and programming style. Otherwise, making arbitrary
changes to code design and style should be avoided, except for specific gitlab
issues focused soley on such improvements</p></li>
</ul>
<ul class="simple">
<li><p><strong>Object-oriented design:</strong> To the extent possible, data (i.e. derived type
definition and module variables) and related code (subroutines and functions)
should be grouped together within a FORTRAN module. Where appropriate, the
composition type of inheritance (i.e. “has a” inheritance) is used to
construct more complex object by combining several simpler objects. For
example, the <code class="docutils literal notranslate"><span class="pre">gridStateVector</span></code> object is composed of the objects defined in
the <code class="docutils literal notranslate"><span class="pre">horizontalCoord_mod</span></code>, <code class="docutils literal notranslate"><span class="pre">verticalCoord_mod</span></code> and <code class="docutils literal notranslate"><span class="pre">timeCoord_mod</span></code>
modules.</p></li>
</ul>
<ul class="simple">
<li><p><strong>Modularity and encapsulation:</strong> In FORTRAN this means avoiding the use of
<code class="docutils literal notranslate"><span class="pre">public</span></code> variables, except for very limited cases. In addition, subroutines
and functions should be <code class="docutils literal notranslate"><span class="pre">private</span></code> whenever appropriate. All subroutines,
functions and variables accessible by code outside of the module must be
explicitly defined as <code class="docutils literal notranslate"><span class="pre">public</span></code> at the beginning of the module, while the
default is set to <code class="docutils literal notranslate"><span class="pre">private</span></code> for all variables, subroutines and functions.</p></li>
</ul>
<ul class="simple">
<li><p><strong>Clear relationship between MIDAS modules:</strong> Each FORTRAN module in MIDAS has
a short (preferrably 3 letters) prefix associated with it to clearly identify
all public subroutines/functions/variables. In addition, public derived types
defined in a module are usually named with the prefix <code class="docutils literal notranslate"><span class="pre">struct_</span></code> followed by
the module prefix, for example, <code class="docutils literal notranslate"><span class="pre">struct_hco</span></code> for the module
<code class="docutils literal notranslate"><span class="pre">horizontalCoord_mod</span></code>. To make obvious the relationship between a FORTRAN
module and the rest of the MIDAS code, all <code class="docutils literal notranslate"><span class="pre">use</span></code> statements appear at the
beginning of the module declaration (and not within contained
subroutines/functions). For a similar reason, all public entities are
explicitly declared <code class="docutils literal notranslate"><span class="pre">public</span></code> near the beginning of the source file just
after the <code class="docutils literal notranslate"><span class="pre">use</span></code> statements.</p></li>
</ul>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="f-modindex.html" title="Fortran Module Index"
>fortran modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">MIDAS documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">MIDAS design philosophy</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2018, ECCC.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
</div>
</body>
</html>