-
Notifications
You must be signed in to change notification settings - Fork 0
/
bimg.html
194 lines (117 loc) · 14.4 KB
/
bimg.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
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
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.77 [en] (X11; U; Linux 2.4.3-20mdk i686) [Netscape]">
<meta name="AUTHOR" content="Jean-Marc">
<meta name="CREATED" content="20011123;14065100">
<meta name="CHANGEDBY" content="Jean-Marc">
<meta name="CHANGED" content="20011123;16515500">
</head>
<body>
<h1>
Le format BIMG</h1>
<div STYLE="font-weight: medium; text-decoration: none">Le format bimg
a été développé depuis 1991 dans l'équipe
MEOM dans le but d'uniformiser les fichiers représentant des données
bi-dimensionnelle semblables aux sorties de modèles d'océan,
par exemple.</div>
<div STYLE="font-weight: medium; text-decoration: none">Ce format a l'avantage
d'être compact et pratiquement autodescriptif (si on se limite à
des grilles régulières).</div>
<p STYLE="font-weight: medium; text-decoration: none">Chaque fichier bimg
est un fichier de type binaire, 'unformatted', créé par un
programme fortran. Une entête contient sur 6 records l'info concernant
le fichier, puis sur les records suivant les données proprement
dites, stockées sous forme de champ 2D.
<p STYLE="font-weight: medium; text-decoration: none">Plutot qu'un long
discours, je propose de de commenter un programme f77 lisant un fichier
bimg, pour expliquer le format:
<div STYLE="font-weight: medium; text-decoration: none"></div>
<div STYLE="font-weight: medium; text-decoration: none"></div>
<pre></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> PROGRAM bimg_demo_lec</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> IMPLICIT NONE</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> INTEGER jpi,jpj,jpk,jpt,jpdim</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> ...PARAMETER (jpi=100m,jpj=100,jpk=20)</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> PARAMETER (jpt=100,jpdim=2)</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> CHARACTER*80 comment1, comment2, comment3, comment4</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> INTEGER ni,nj,nk,nt,ndim,icod ! Real dimension of the field</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> REAL x1, y1, dx, dy , spval ! x1 = x of point(1,1)</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C ! y1 = y of point (1,1)</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C ! dx = x-grid spacing</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C ! dy = y-grid spacing</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C ! spval : missing/bad/masked</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C ! values are supposed spval</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> REAL dep(jpk) ! array for vertical dep</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> REAL time(jpt) ! array for times</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> REAL ptab(jpi,jpj,jpk,jpt,jpdim) ! data array</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C ! In application it can be</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C ! only 2D (jpi,jpj)</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C various</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> INTEGER numbimg ! logical unit for bimgfile</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> INTEGER ji,jj,jk,jt,jdim ! loop counter</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>CCC</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>CC Open file</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>CC</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> numbimg=10</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> OPEN (numbimg,file='filebimg',form='UNFORMATTED')</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C Read comment lines</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> READ(numbimg) comment!</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> READ(numbimg) comment2</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> READ(numbimg) comment3</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> READ(numbimg) comment4</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C Read grid dimensions</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> READ(numbimg) ni,nj,nk,nt,ndim,icod ! icod is spare</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C Read grid position and special values</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> READ(numbimg) x1,y1,dx,dy,spval</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C Read depth of levels</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> READ(numbimg) (dep(jk),jk=1,nk)</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C Enter the time loop</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> DO jt = 1, nt</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C read current time</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> READ(numbimg) time(jt)</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C enter vertical loop</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> DO jk=1,nk</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C at each level, many 'dimensions' can exists e.g. u,v,w for 3d vector</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> DO jdim = 1,jpdim</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C Note taht the i,j loop are implicit: ! rec hold 1 2D field.</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> READ(numbimg)(( ptab(ji,jj,jk,jt,jdim),ji=1,ni),jj=1,nj)</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C IF we use only 2D array, this is the place to work with the current</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C 2D field at ime jt, dep jk and dim jdim ...</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C</font></font></pre>
<pre><font face="Courier, monospace"><font size=+2>C...</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C...</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> END DO</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> END DO</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> END DO</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> CLOSE(numbimg)</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2>C Now enjoy working with ptab ...</font></font></pre>
<pre STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Courier, monospace"><font size=+2> END</font></font></pre>
<div STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none"><font face="Times, serif"><font size=-1>Le
format bimg est donc tres simple à lire ou à écrire.
Si l'on travaille avec une grille irrégulière, on définit
cette grille dans un fichier bimg indépendant á 1 niveau,
2 dim qui contient comme données, sur la dimension 1, les valeurs
x(ji,jj) et sur la dimension 2 les valeurs y(ji,jj).</font></font></div>
<br>
<br>
<br>
<br>
<p STYLE="margin-bottom: 0cm"><span STYLE="text-decoration: none"><span STYLE="font-weight: medium"><font face="Times, serif"><font size=-1>Le
format bimg a été étendu dans son idée à
des fichiers à accès direct: c'est le format dimg. <a href="dimg.html">Pour
en savoir plus sur dimg</a> ...</font></font></span></span>
<br>
<br>
</body>
</html>