-
Notifications
You must be signed in to change notification settings - Fork 1
/
Parameterless_RAMSES_attempt.yml
370 lines (368 loc) · 8.41 KB
/
Parameterless_RAMSES_attempt.yml
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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
#Parameterless RAMSES attempt
meta:
id: ramses_amr
id: gadget_format1
id: array_buffer
endian: le
#file-extension: out00001
ks-opaque-types: true
#ramses_amr, gadget, and array_buffer from astro-data-formats on github
#ramses_amr portion; ramses_amr.ksy
seq:
- id: header
type: ramses_header
- id: amr_info
type: ramses_amr_info
types:
ramses_amr_info:
seq:
- id: level_infos
type: ramses_amr_level_info(_index)
repeat: expr
repeat-expr: _root.header.nlevelmax.value[0].as<u4>
ramses_amr_level_info:
params:
- id: level
type: u4
seq:
- id: cpu_info
type:
switch-on: _root.header.numbl.vector[level].values[_index]
cases:
0: empty_type
_: ramses_level_cpu_info
repeat: expr
repeat-expr: _root.header.ncpu.value[0].as<u4> + _root.header.nboundary.value[0].as<u4>
ramses_level_cpu_info:
# This is where we need to check the number of grids here
# yt has:
# if icpu < ncpu:
# ng = numbl[ilevel, icpu]
# else:
# ng = ngridbound[icpu - ncpu + nboundary * ilevel]
# we should split this up and have it accept a parameter
seq:
- id: grid_index
type: fortran_skip
- id: grid_next
type: fortran_skip
- id: grid_prev
type: fortran_skip
- id: pos_x
type: fortran_vector_f8
- id: pos_y
type: fortran_vector_f8
- id: pos_z
type: fortran_vector_f8
- id: fields
type: fortran_skip
repeat: expr
repeat-expr: 31
ramses_header:
seq:
- id: ncpu
type: fortran_record(1, "u4")
- id: ndim
type: fortran_record(1, "u4")
- id: nx
type: fortran_record(3, "u4")
- id: nlevelmax
type: fortran_record(1, "u4")
- id: ngridmax
type: fortran_record(1, "u4")
- id: nboundary
type: fortran_record(1, "u4")
- id: ngrid_current
type: fortran_record(1, "u4")
- id: boxlen
type: fortran_record(1, "f8")
- id: nout
type: fortran_record(3, "u4")
- id: tout
type: fortran_record(nout.value[0].as<u4>, "f8")
- id: aout
type: fortran_record(nout.value[0].as<u4>, "f8")
- id: t
type: fortran_record(1, "f8")
- id: dtold
type: fortran_record(nlevelmax.value[0].as<u4>, "f8")
- id: dtnew
type: fortran_record(nlevelmax.value[0].as<u4>, "f8")
- id: nstep
type: fortran_record(2, "u4")
- id: stat
type: fortran_record(3, "f8")
- id: cosm
type: fortran_record(7, "f8")
- id: timing
type: fortran_record(5, "f8")
- id: mass_sph
type: fortran_record(1, "f8")
- id: headl
type: fortran_vector("u4")
- id: taill
type: fortran_vector("u4")
- id: numbl
# numbl is of shape [nlevelmax, ncpu+nboundary]
#type: fortran_vector("u4")
# This is set up so that the first is of shape nlevelmax and second is
# ncpu+nboundary.
# access like _root.header.numbl.vector[level].values[cpu]
type:
fortran_2d_vector("u4", nlevelmax.value[0].as<u4>)
- id: unk1
type: fortran_skip
- id: ngridbound
if: nboundary.value[0].as<u4> > 0
type: fortran_vector("u4")
- id: free_mem
type: fortran_record(5, "u4")
- id: ordering
type: charstring
- id: unk2
type: fortran_skip
repeat: expr
repeat-expr: 4
fortran_record:
params:
- id: num_records
type: u4
- id: record_type
type: str
seq:
- id: rec_size1
type: u4
- id: value
type:
switch-on: record_type
cases:
'"u4"': u4
'"u8"': u8
'"f8"': f8
'"f8"': f8
repeat: expr
repeat-expr: num_records
- id: rec_size2
type: u4
fortran_vector:
params:
- id: record_type
type: str
seq:
- id: rec_size1
type: u4
- id: vector
type: vector_values(record_type)
size: rec_size1
- id: rec_size2
type: u4
#Attempt to describe without parameters
fortran_vector_f8:
seq:
- id: rec_size1
type: u4
- id: raw_vector
size: rec_size1
# type: f8
# repeat: expr
# repeat-expr: rec_size1/8
- id: rec_size2
type: u4
instances:
vector_values:
type: f8
repeat: expr
repeat-expr: rec_size1/8
pos: 4
fortran_2d_vector:
params:
- id: record_type
type: str
- id: nrows
type: u4
seq:
- id: rec_size1
type: u4
- id: vector
type: vector_values(record_type)
repeat: expr
repeat-expr: nrows
size: rec_size1 / nrows
- id: rec_size2
type: u4
vector_values:
params:
- id: record_type
type: str
seq:
- id: values
type:
switch-on: record_type
cases:
'"u4"': u4
'"u8"': u8
'"f8"': f8
'"f8"': f8
repeat: eos
fortran_skip:
seq:
- id: rec_size1
type: u4
- id: contents
size: rec_size1
- id: rec_size2
type: u4
charstring:
seq:
- id: rec_size1
type: u4
- id: contents
type: str
size: rec_size1
encoding: ascii
- id: rec_size2
type: u4
empty_type:
seq: []
#array buffer portion; array_buffer.ksy
params:
- id: field_type
type: str
seq:
- id: buffer
size-eos: true
instances:
values:
pos: 0
size-eos: true
id: entries
type:
switch-on: field_type
cases:
'"f8"': f8
'"u4"': u4
'"f8"': f8
'"u8"': u8
_ : f8
repeat: eos
#gadget; gadget.ksy
seq:
- id: gadget_header
type: header
- id: coordinates
type: particle_fields('f4', 3, _root.field_counts.all_fields)
- id: velocities
type: particle_fields('f4', 3, _root.field_counts.all_fields)
- id: particle_ids
type: particle_fields('u4', 1, _root.field_counts.all_fields)
- id: mass
type: particle_fields('f4', 1, _root.field_counts.has_mass)
instances:
field_counts:
pos: 0
size: 1
type: has_fields
types:
header:
seq:
- id: recsize_0
type: u4
- id: npart
type: u4
repeat: expr
repeat-expr: 6
- id: massarr
type: f8
repeat: expr
repeat-expr: 6
- id: time
type: f8
- id: redshift
type: f8
- id: flag_sfr
type: u4
- id: flag_feedback
type: u4
- id: n_all
type: u4
repeat: expr
repeat-expr: 6
- id: flag_cooling
type: u4
- id: numfiles
type: u4
- id: boxsize
type: f8
- id: omega0
type: f8
- id: omega_lambda
type: f8
- id: hubble_param
type: f8
- id: flag_age
type: u4
- id: flag_metals
type: u4
- id: nall_hw
type: u4
repeat: expr
repeat-expr: 6
- id: unused
type: u4
repeat: expr
repeat-expr: 16
- id: recsize_1
type: u4
particle_fields:
params:
- id: field_type
type: str
- id: components
type: u4
- id: has_field
type: bool_value[]
seq:
- id: magic1
type: u4
- id: fields
type: field(_index, components, field_type, has_field[_index].value)
repeat: expr
repeat-expr: 6
- id: magic2
type: u4
field:
params:
- id: index
type: u4
- id: components
type: u4
- id: field_type
type: str
- id: has_field
type: bool
seq:
- id: field
if: has_field
size: _root.gadget_header.npart[index] * components * 4
type: array_buffer(field_type)
bool_value:
params:
- id: this_value
type: bool
instances:
value:
value: this_value
has_fields:
seq:
- id: all_fields
repeat: expr
repeat-expr: 6
type: bool_value(true)
- id: has_mass
repeat: expr
repeat-expr: 6
type: bool_value(_root.gadget_header.massarr[_index] == 0)
- id: has_gas
repeat: expr
repeat-expr: 6
type: bool_value(_index == 2)