-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsmoother_mod.html
573 lines (486 loc) · 21.5 KB
/
smoother_mod.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
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
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>module smoother_mod</TITLE>
<link rel="stylesheet" type="text/css" href="../../../documentation/html/doc.css" />
<link href="../../../documentation/images/dart.ico" rel="shortcut icon" />
</HEAD>
<BODY>
<A NAME="TOP"></A>
<H1>MODULE smoother_mod</H1>
<A HREF="#Namelist">NAMELIST</A> /
<A HREF="#Modules">MODULES</A> /
<!-- <A HREF="#References">REFERENCES</A> / -->
<A HREF="#Errors">ERRORS</A> /
<H2>Overview</H2>
<P>
Main module for driving ensemble smoother assimilations.
Used by smoother.f90 and model_mod_check.f90.
</P>
<P>
<em class=program>smoother_mod</em> is a Fortran 90 module, and provides a large
number of options for controlling execution behavior and parameter configuration
that are driven from its namelist.
See the <a href=#Namelist>namelist</a> section below for more details.
The number of assimilation steps to be done
is controlled by the input observation sequence and by the
time-stepping capabilities of the model being used in the assimilation.
</P>
<P><!-- make sure the 'top' is aligned correctly --></P>
<!--==================================================================-->
<!--=================== DESCRIPTION OF A NAMELIST ====================-->
<!--==================================================================-->
<A NAME="Namelist"></A>
<div class="top">[<a href="#">top</a>]</div><hr />
<H2>NAMELIST</H2>
<P>
This namelist is read from the file <em class=file>input.nml</em>.
Namelists start with an ampersand
'&' and terminate with a slash '/'.
Character strings that contain a '/' must be
enclosed in quotes to prevent them from
prematurely terminating the namelist.
</P>
<div class=namelist>
<pre>
&smoother_nml
single_file_in = .false.,
input_state_files = '',
input_state_file_list = '',
perturb_from_single_instance = .false.,
perturbation_amplitude = 0.2,
stages_to_write = 'output'
single_file_out = .false.,
output_state_files = '',
output_state_file_list = '',
output_interval = 1,
output_members = .true.,
num_output_state_members = 0,
output_mean = .true.,
output_sd = .true.,
write_all_stages_at_end = .false.,
compute_posterior = .true.
ens_size = 20,
num_groups = 1,
distributed_state = .true.,
tasks_per_model_advance = 1,
obs_sequence_in_name = "obs_seq.out",
obs_sequence_out_name = "obs_seq.final",
num_output_obs_members = 0,
first_obs_days = -1,
first_obs_seconds = -1,
last_obs_days = -1,
last_obs_seconds = -1,
obs_window_days = -1,
obs_window_seconds = -1,
inf_flavor = 0, 0,
inf_initial_from_restart = .false., .false.,
inf_sd_initial_from_restart = .false., .false.,
inf_deterministic = .true., .true.,
inf_initial = 1.0, 1.0,
inf_lower_bound = 1.0, 1.0,
inf_upper_bound = 1000000.0, 1000000.0,
inf_damping = 1.0, 1.0,
inf_sd_initial = 0.0, 0.0,
inf_sd_lower_bound = 0.0, 0.0,
inf_sd_max_change = 1.05, 1.05,
trace_execution = .false.,
output_timestamps = .false.,
output_forward_op_errors = .false.,
write_obs_every_cycle = .false.,
silence = .false.,
/
</pre>
</div>
<br />
<br />
<P>
Particular options to be aware of are:
ens_size, cutoff (localization radius), inflation flavor, outlier_threshold,
restart filenames (including inflation), obs_sequence_in_name, horiz_dist_only,
binary or ascii controls for observation sequence file formats.
Some of these important items are located in other namelists, but all are in the
same input.nml file.
</P>
<P>
The inflation control variables are all dimensioned 2,
the first value controls the prior inflation
and the second controls the posterior inflation.
</P>
<br />
<div>
<TABLE border=0 cellpadding=10 width=100% summary='namelist description'>
<THEAD align=left>
<TR><TH> Item </TH>
<TH> Type </TH>
<TH> Description </TH> </TR>
</THEAD>
<TBODY valign=top>
<TR><TD>single_file_in</TD>
<TD>logical</TD>
<TD>True means all ensemble members are read from a single NetCDF file. False means
each member is in a separate file. NOT SUPPORTED as of March, 2017
only multiple files can be used.
</TD></TR>
<TR><TD>input_state_files</TD>
<TD>character(len=256) dimension(MAXFILES)</TD>
<TD>A list of the NetCDF files to open to read the state vectors.
Models using multiple domains must put the domain and ensemble numbers in the file names.
The order and format of those is to be determined.
NOT SUPPORTED as of March, 2017.
</TD></TR>
<TR><TD>input_state_file_list</TD>
<TD>character(len=256) dimension(MAXFILES)</TD>
<TD>A list of files, one per domain. Each file must be a text file containing
the names of the NetCDF files to open, one per ensemble member, one per line.
</TD></TR>
<TR><TD>perturb_from_single_instance</TD>
<TD>logical</TD>
<TD>False means start from an ensemble-sized set of restart files.
True means perturb a single state vector from one restart file.
This may be done by model_mod, if model_mod provides subroutine
<em class=code>pert_model_copies</em>.
</TD></TR>
<TR><TD>perturbation_amplitude</TD>
<TD>real(r8)</TD>
<TD>Standard deviation for the gaussian noise added when generating
perturbed ensemble members. Ignored if
<em class=code>perturb_from_single_instance = .false.</em>
or the perturbed ensemble is created in model_mod.
<br />Random noise values drawn from a gaussian distribution with this
standard deviation will be added to the data in a single initial
ensemble member to generate the rest of the members.
<br />This option is more frequently used in the low order models
and less frequently used in large models. This is in part due
to the different scales of real geophysical variable values, and the
resulting inconsistencies between related field values.
A more successful initial condition generation
strategy is to generate climatological distributions from long model
runs which have internally consistent structures and values and then
use observations with a 'spin-up' period of assimilation to shape
the initial states into a set of members with enough spread and which
match the current set of observations.
</TD></TR>
<TR><TD>stages_to_write</TD>
<TD>character(len=10) dimension(4)</TD>
<TD>Controls diagnostic and restart output. Valid values are 'input',
'preassim', 'postassim', 'output', and 'null'.
</TD></TR>
<TR><TD>single_file_out</TD>
<TD>logical</TD>
<TD>True means all ensemble members are written to a single NetCDF file. False means
each member is output in a separate file. NOT SUPPORTED as of March, 2017 - only multiple files
can be used.
</TD></TR>
<TR><TD>output_state_files</TD>
<TD>character(len=256) dimension(MAXFILES)</TD>
<TD>A list of the NetCDF files to open for writing updated state vectors.
Models using multiple domains must put the domain and ensemble numbers in the file names.
The order and format of those is to be determined.
NOT SUPPORTED as of March, 2017.
</TD></TR>
<TR><TD>output_state_file_list</TD>
<TD>character(len=256) dimension(MAXFILES)</TD>
<TD>A list of files, one per domain. Each file must be a text file containing
the names of the NetCDF files to open, one per ensemble member, one per line.
</TD></TR>
<TR><TD>output_interval</TD>
<TD>integer</TD>
<TD>Output state and observation diagnostics every 'N'th
assimilation time, N is output_interval.
</TD></TR>
<TR><TD>output_members</TD>
<TD>logical</TD>
<TD>True means output the ensemble members in any stage that is enabled.
</TD></TR>
<TR><TD>num_output_state_members</TD>
<TD>integer</TD>
<TD>Number of ensemble members to be included in the state
diagnostic output for stages 'preassim' and 'postassim'.
output_members must be TRUE.
</TD></TR>
<TR><TD>output_mean</TD>
<TD>logical</TD>
<TD>True means output the ensemble mean in any stage that is enabled.
</TD></TR>
<TR><TD>output_sd</TD>
<TD>logical</TD>
<TD>True means output the ensemble standard deviation (spread) in any stage that is enabled.
</TD></TR>
<TR><TD>write_all_stages_at_end</TD>
<TD>logical</TD>
<TD>For most cases this should be .false. and data will be output as it is
generated for the 'preassim', 'postassim' diagnostics, and then restart
data will be output at the end. However, if I/O time dominates the runtime,
setting this to .true. will store the data and it can all be written in parallel
at the end of the execution. This will require slightly more memory at
runtime, but can lower the cost of the job significantly in some cases.
</TD></TR>
<TR><TD>compute_posterior</TD>
<TD>logical</TD>
<TD>If .false., skip computing posterior forward operators and do not write
posterior values in the obs_seq.final file. Saves time and memory.
Cannot enable posterior inflation and skip computing the posteriors.
For backwards compatibility the default for this is .true.
</TD></TR>
<TR><TD>ens_size</TD>
<TD>integer</TD>
<TD>Size of ensemble.
</TD></TR>
<TR><TD>num_groups</TD>
<TD>integer</TD>
<TD>Number of groups for hierarchical filter. It should evenly divide ens_size.
</TD></TR>
<TR><TD>distributed_state</TD>
<TD>logical</TD>
<TD>True means the ensemble data is distributed across all tasks as it
is read in, so a single task never has to have enough memory to store
the data for an ensemble member. Large models should always set this
to .true., while for small models it may be faster to set this to .false.
This is different from <em> &assim_tools_mod :: distributed_mean </em>.
</TD></TR>
<TR><TD> tasks_per_model_advance </TD>
<TD>integer </TD>
<TD>Number of tasks to assign to each ensemble member advance. </TD>
</TD></TR>
<TR><TD>obs_sequence_in_name</TD>
<TD>character(len=256)</TD>
<TD>File name from which to read an observation sequence.
</TD></TR>
<TR><TD>obs_sequence_out_name</TD>
<TD>character(len=256)</TD>
<TD>File name to which to write output observation sequence.
</TD></TR>
<TR><TD>num_output_obs_members</TD>
<TD>integer</TD>
<TD>Number of ensemble members to be included in the
output observation sequence file.
</TD></TR>
<TR><TD>first_obs_days</TD>
<TD>integer</TD>
<TD>If negative, don't use. If non-negative, ignore all observations
before this time.
</TD></TR>
<TR><TD>first_obs_seconds</TD>
<TD>integer</TD>
<TD>If negative, don't use. If non-negative, ignore all observations
before this time.
</TD></TR>
<TR><TD>last_obs_days</TD>
<TD>integer</TD>
<TD>If negative, don't use. If non-negative, ignore all observations
after this time.
</TD></TR>
<TR><TD>last_obs_seconds</TD>
<TD>integer</TD>
<TD>If negative, don't use. If non-negative, ignore all observations
after this time.
</TD></TR>
<TR><TD>obs_window_days</TD>
<TD>integer</TD>
<TD>Assimilation window days; defaults to model timestep size.
</TD></TR>
<TR><TD>obs_window_seconds</TD>
<TD>integer</TD>
<TD>Assimilation window seconds; defaults to model timestep size.
</TD></TR>
<TR><TD colspan=3>All variables named inf_* are arrays of length 2.<br />
The first element controls the prior inflation, the second element
controls the posterior inflation.
See <A href="../../programs/filter/filter.html#Inflation">filter.html</A>
for a discussion of inflation and effective strategies.
</TD></TR>
<TR><TD>inf_flavor</TD>
<TD>integer array dimension(2)</TD>
<TD>Inflation flavor for [prior, posterior]
<UL>
<LI>0 = none</LI>
<LI>2 = spatially-varying state-space (gaussian)</LI>
<LI>3 = spatially-fixed state-space (gaussian)</LI>
<LI>4 = Relaxation To Prior Spread (Posterior inflation only) </LI>
<LI>5 = enhanced spatially-varying state-space (inverse gamma)</LI>
</UL>
(See inf_sd_initial below for how to set the time evolution options.)
</TD></TR>
<TR><TD>inf_initial_from_restart</TD>
<TD>logical array dimension(2)</TD>
<TD>If true, get initial mean values for inflation from restart file.
If false, use the corresponding namelist value
<em class=code>inf_initial</em>.
</TD></TR>
<TR><TD>inf_sd_initial_from_restart</TD>
<TD>logical array dimension(2)</TD>
<TD>If true, get initial standard deviation values for
inflation from restart file.
If false, use the corresponding namelist value
<em class=code>inf_sd_initial</em>.
</TD></TR>
<TR><TD>inf_deterministic</TD>
<TD>logical array dimension(2)</TD>
<TD>True means deterministic inflation, false means stochastic.
</TD></TR>
<TR><TD>inf_initial</TD>
<TD>real(r8) dimension(2)</TD>
<TD>Initial value of inflation if not read from restart file.
</TD></TR>
<TR><TD>inf_lower_bound</TD>
<TD>real(r8) dimension(2)</TD>
<TD>Lower bound for inflation value.
</TD></TR>
<TR><TD>inf_upper_bound</TD>
<TD>real(r8) dimension(2)</TD>
<TD>Upper bound for inflation value.
</TD></TR>
<TR><TD>inf_damping</TD>
<TD>real(r8) dimension(2)</TD>
<TD>Damping factor for inflation mean values.
The difference between the current inflation value and 1.0 is multiplied by
this factor before the next assimilation cycle. The value should be between
0.0 and 1.0. Setting a value of 0.0 is full damping, which in fact
turns all inflation off by fixing the inflation value at 1.0. A value
of 1.0 turns inflation damping off leaving the original inflation value
unchanged.
</TD></TR>
<TR><TD>inf_sd_initial</TD>
<TD>real(r8) dimension(2)</TD>
<TD>Initial value of inflation standard deviation if not read
from restart file. If ≤ 0, do not update the inflation
values, so they are time-constant. If positive, the inflation
values will adapt through time, so they are time-varying.
</TD></TR>
<TR><TD>inf_sd_lower_bound</TD>
<TD>real(r8) dimension(2)</TD>
<TD>Lower bound for inflation standard deviation.
If using a negative value for <em class=code>sd_initial</em>
this should also be negative to preserve the setting.
</TD></TR>
<TR><TD>inf_sd_max_change</TD>
<TD>real(r8) dimension(2)</TD>
<TD>For inflation type 5 (enhanced inflation), controls the maximum
change of the inflation standard deviation when adapting for the
next assimilation cycle. The value should be between 1.0 and 2.0.
1.0 prevents any changes, while 2.0 allows 100% change.
For the enhanced inflation option, if the standard deviation
initial value is equal to the standard deviation
lower bound the standard deviation will not adapt in time.
See <A href="../../programs/filter/filter.html#Inflation">this section</A>
for a discussion of how the standard deviation
adapts based on different types of inflation.
</TD></TR>
<TR><TD>trace_execution</TD>
<TD>logical</TD>
<TD>True means output very detailed messages about what routines
are being called in the main filter loop. Useful if a job
hangs or otherwise doesn't execute as expected.
</TD></TR>
<TR><TD>output_timestamps</TD>
<TD>logical</TD>
<TD>True means write timing information to the log before and after
the model advance and the observation assimilation phases.
</TD></TR>
<TR><TD>output_forward_op_errors</TD>
<TD>logical</TD>
<TD> True means output errors from forward observation operators. This is
the 'istatus' error return code from the model_interpolate routine.
An ascii text file
<em class=file>prior_forward_op_errors</em> and/or
<em class=file>post_forward_op_errors</em> will be
created in the current directory. For each ensemble member which returns a
non-zero return code, a line will be written to this file. Each line will
have three values listed: the observation number, the ensemble member number,
and the istatus return code. Be cautious when turning this option on. The
number of lines in this file can be up to the number of observations times
the number of ensemble members times the number of assimilation cycles
performed. This option is generally most useful when run with a small
observation sequence file and a small number of ensemble members to diagnose
forward operator problems.
</TD></TR>
<TR><TD>write_obs_every_cycle</TD>
<TD>logical</TD>
<TD>For debug use; this option can significantly slow the execution of filter.
True means to write the entire output observation sequence diagnostic file
each time through the main filter loop even though only observations with times
up to and including the current model time will have been assimilated.
Unassimilated observations have the value -888888.0 (the DART "missing value").
If filter crashes before finishing it may help to see the forward operator values
of observations that have been assimilated so far.
</TD></TR>
<TR><TD>silence</TD>
<TD>logical</TD>
<TD>True means output almost no runtime messages. Not recommended
for general use, but can speed long runs of the lower order models
if the execution time becomes dominated by the volume of output.
</TD></TR>
</TBODY>
</TABLE>
</div>
<br />
<br />
</div>
<P><!-- make sure the 'top' is aligned correctly --></P>
<!--==================================================================-->
<!-- Describe the modules used by this program. -->
<!--==================================================================-->
<A NAME="Modules"></A>
<div class="top">[<a href="#">top</a>]</div><hr />
<H2>MODULES USED</H2>
<PRE>
types_mod
obs_sequence_mod
obs_def_mod
obs_def_utilities_mod
time_manager_mod
utilities_mod
assim_model_mod
assim_tools_mod
obs_model_mod
ensemble_manager_mod
adaptive_inflate_mod
mpi_utilities_mod
smoother_mod
random_seq_mod
state_vector_io_mod
io_filenames_mod
forward_operator_mod
quality_control_mod
</PRE>
<P><!-- make sure the 'top' is aligned correctly --></P>
<!--==================================================================-->
<!-- Describe all the error conditions and codes. -->
<!--==================================================================-->
<A NAME="Errors"></A>
<div class="top">[<a href="#">top</a>]</div><hr />
<H2>ERROR CODES and CONDITIONS</H2>
<div class=errors>
<TABLE border=1 cellspacing=1 cellpadding=10 width=100% summary='error table'>
<TR><TH>Routine</TH><TH>Message</TH><TH>Comment</TH></TR>
<TR><!-- routine --><TD VALIGN=top>smoother_main</TD>
<!-- message --><TD VALIGN=top>ens_size in namelist is ###: Must be > 1</TD>
<!-- comment --><TD VALIGN=top>Ensemble size must be at least 2. </TD></TR>
<TR><!-- routine --><TD VALIGN=top>smoother_main</TD>
<!-- message --><TD VALIGN=top>inf_flavor= ### Must be 0, 2, 3.</TD>
<!-- comment --><TD VALIGN=top>Observation Inflation is no longer supported (i.e flavor 1). </TD></TR>
<TR><!-- routine --><TD VALIGN=top>smoother_main</TD>
<!-- message --><TD VALIGN=top>Posterior observation space inflation (type 1) not supported.</TD>
<!-- comment --><TD VALIGN=top>Posterior observation space inflation doesn't work. </TD></TR>
<TR><!-- routine --><TD VALIGN=top>smoother_main</TD>
<!-- message --><TD VALIGN=top>Number of processes > model size.</TD>
<!-- comment --><TD VALIGN=top>Number of processes can't exceed model size for now. </TD></TR>
<TR><!-- routine --><TD VALIGN=top>smoother_generate_copy_meta_data</TD>
<!-- message --><TD VALIGN=top>output metadata in smoother needs state ensemble size < 10000, not ###.</TD>
<!-- comment --><TD VALIGN=top>Only up to 10000 ensemble members with state output for now. </TD></TR>
<TR><!-- routine --><TD VALIGN=top>smoother_generate_copy_meta_data</TD>
<!-- message --><TD VALIGN=top>output metadata in smoother needs obs ensemble size < 10000, not ###.</TD>
<!-- comment --><TD VALIGN=top>Only up to 10000 ensemble members with obs space output for now. </TD></TR>
<TR><!-- routine --><TD VALIGN=top>smoother_setup_obs_sequence</TD>
<!-- message --><TD VALIGN=top>input obs_seq file has ### qc fields; must be < 2.</TD>
<!-- comment --><TD VALIGN=top>Only 0 or 1 qc fields in input obs sequence for now. </TD></TR>
<TR><!-- routine --><TD VALIGN=top>get_obs_copy_index</TD>
<!-- message --><TD VALIGN=top>Did not find observation copy with metadata observation.</TD>
<!-- comment --><TD VALIGN=top>Only 0 or 1 qc fields in input obs sequence for now. </TD></TR>
</TABLE>
</div>
<P><!-- make sure the 'top' is aligned correctly --></P>
</BODY>
</HTML>