Contact: | Tim Hoar |
Revision: | $Revision: 2818 $ |
Source: | $URL: http://subversion.ucar.edu/DAReS/DART/trunk/obs_sequence/merge_obs_seq.html $ |
Change Date: | $Date: 2007-04-06 16:15:48 -0600 (Fri, 06 Apr 2007) $ |
Change history: | try "svn log" or "svn diff" |
This program can merge two or more compatible observation sequences
and create a single observation sequence file with the
combined observations. The number of input files, their filenames,
and the output filename are read from the namelist file.
This program is also a convenient way to convert observation sequence
files from ASCII to (more compact) binary, or vice-versa. Simply specify
that there is 1 input file. The output format is specified by the
&obs_sequence_nml namelist
in file input.nml.
This routine also uses a MUCH faster insertion method than the
versions that used only two input files. A test on
merging two 40000 observation sequences now takes less than 6 seconds
compared to more than 170 seconds for the old version. Since observation
sequences are linked lists ordered by time, simply keeping track of
where you inserted the last one greatly simplifies the logic of where
one starts looking to insert the next observation. Consequently, inserting
and appending are now equally fast. Snappy!
merge_obs_seq can be used to sort observations in an
observation sequence as well as physically delete broken nodes from
the sequence. The only trick is to merge with an empty
obs_seq file. The empty obs_seq
must be specified first in the list of files to merge, it has to have a header,
and first = last = -1. Pretty Sneaky.
types_mod utilities_mod time_manager_mod obs_def_mod obs_sequence_mod
We adhere to the F90 standard of starting a namelist with an ampersand '&' and terminating with a slash '/'.
namelist / merge_obs_seq / num_input_files, filename_seq, filename_out
This routine is intended to consolidate observation sequence files. It can also be used to convert an observation sequence file from (large, but portable) ASCII to (compact, but impenetrable) binary throught the use of the write_binary_obs_sequence namelist variable.
This namelist is read in a file called input.nml
Contents | Type | Description |
---|---|---|
num_input_files | integer | The number of observation sequence files to merge. Maximum of 50. Default: 2 |
filename_seq | character(len=129) dim=50 | The array of names of the observation sequence files to merge. With the F90 namelist mechanism, it seems it is only necessary to specify the names you are going to use, not necessarily all 50. Default: 'obs_seq.one', 'obs_seq.two' |
filename_out | character(len=129) | The name of the resulting (merged) observation sequence file. Default: 'obs_seq.merged' |
Routine | Message | Comment |
---|---|---|
merge_obs_seq | num_input_files > max_num_input_files. change max_num_input_files in source file | The default is 50 files. If you're trying to merge more than that, you're going about it the wrong way ... |
merge_obs_seq | num_input_files and filename_seq mismatch | methinks you did not specify a file name for the number of files you told me you were merging. |
There are no known bugs. Really.
There are no future plans.