Reads a time series from a file (unit IUN)
and processes it with a filter.
Takes parameters that control the reading from string CREC.
Optionally reads filter control instruction string from file unit IUINS.
Processes time series with the filter.
File input is carried out with a call to read_fuf
to switch to one of three input types,
Bruxelles, Binary, Read_Fm_D.
Read_Fm_D reads ASCII-files with a variety of date
formats; from each record one time record
and one ordinate is read. Read_Fm_D is in ~/sas/p/readfmd.f.
Binary data is read with getts; routines are enclosed in ~/sas/p/ufios.f
CREC - char** - Command
line; replaced by filter line on return
IUINS - integer - log.unit for filter control parameters
IUN - integer - log.unit, returned
W(nyo) - real*8 - Data array, returned, original dimension NYO
N - integer - Length, returned
T,DT - real*8
V - real*8 - c.f. below, returned to calling program
Command line processing:
iun,'trg',rec_mrs,'(fmt[)opt]',khms,itz,lldf,vp [,dtr] [T0=value] [-DC] [AMP=value]
The seven parameters to the left on the command lines are read with free format; therefore, commas are needed, and strings must be given with enclosing quotes.
Depending on the value of lddf, Proc_F_On_Rec may continue to read from IUINS additional parameters (usually filter coefficients).
iun - integer - file unit for
trg - char*32 - target string for file positioning (read_fm_d only)
Special codes 'BIN' | 'BRX' to read binary or Bruxelles files.
Default mode is to call read_fm_d .
rec_mrs - real*8 - missing record symbol
fmt]opt - char*64 - format and option string | 'U' case 'BIN'ary files
case of 'BIN'ary files, segments from
multi-component files can be extracted by specifying the
label code here:
Labeled file: 'L:label'
files: If a format string is given it must be enclosed
in parenthesis. After the closing parenthesis additional
options can be entered (delimiter = `,´ )
The following are processed by read_fm_d:
DBG+ Debug mode on (excessive print)
P- Print mode off (very little will be printed)
T+x Add x [hours] to the file time.
options are processed by
read_fuf (ufios.f); some of them can be passed through the
Rwd rewind the file before
Y:y Floating point date records are decimal years.
Fix at specified year, Jan 1 (Read_FM_D only). TRG FMT
J:D Long Julian Day (incl.base 2400000)
J[D]:O RJD, Official definition of Julian date (new day
starts at noon), D for Long Julian Day
J[D]:I MJD, new day starts at midnight (default J:I) FMT
J+v Floating-point days. Record is interpreted as
days after Julian day v. If no epoch is defined
yet, it will be set at v. FMT
Fh:h fix origin time at this hour. TRG FMT
Dm:v Doubt-margin for read_fm_doubt (value) FMT
DF:code Date format code; avoid parenthesis ['I2,I4,I3'] FMT
M>0 Convert MRS's to zero FMT
DH+[h,s] Time record is date and a floating point number t.
Compute hour as h + t s.
DH+/[h,s] ... compute hour as h + t/s. Default h=0, s=1 FMT
T+x Add x [hours] to the file time. FMT
Y2K[:y] Convert for Year 2000. Years less than y are
assumed to be after 2000,
those between y and 100 before 2000. FMT
Some errors that are encountered trigger a counting
meachanism. In cases of doubt, invoke tslist with
the -DBG option. The input loop can be escaped using
the error-count option
,#E=n This will allow n errors at maximum
,#E=0 will print extra information at errors
,#E=-1 will permit infinitely many errors FMT
string will be analyzed by read_fm_d
to find out the kind of time-record format. Four cases
leading floating point number indicates Julian dates.
(2) If decimal years are to be input, Y:fixyear must be given.
(3) If a string precedes numeric input, read_fm_d assumes that
month is coded as a 3-char string. A special conversion
routine is called that reformats month prose into integer in-place.
The DF:code option is used to specify this intermediate format.
Therefore if a record is given as
it must be read with
(4) Else the system expects integer Year Month Day [Hour [Minute [Second]]]
Then, FMT must contain KHMS+3 integer fields in front of the
format for the ordinate value.
khms - integer - time record
"depth": read hours, minutes and seconds (0..3)
Applies to integer records (DH+ option inactive)
itz - integer - time zone (+1 for CET)
- integer -
0 or -2: Process with scaling.
The command line following contains the scale factor.
scale factor may be used for
converting air pressure into input-data units;
this is effectuated if the line contains "PCAL".
Recommended if air pressure results will be
combined into the present solution. Only inside urtap though!
-1 or -3: No scaling. No command line follows.
-2 or -3: Subtract DC-level. No command line follows.
-9: Scale factor from AMP=value option, default=1 No command line follows.
lddf > 0: Next command line describes filter:
Scale factor, NFM,NFP,SYMM.
Follow: NFP-NFM+1 filter coefficients.
- real*8 - constant. Needed e.g. for '+' (LINCOMB)
processing (the value is simply returned
through the call list of proc_f_on_rec and the calling program decides what to
do with it).
Default = -1.
[dtr] - real*8 - optional: sampling interval. If not given, dt from
the call list is used. Specify 0.0 to let the read
routine detect it.
T0=value option - Impose
value for t0 on the call to the read routine.
May be useful to resynch the times.
To be coded without blanks.
-DC option - Remove DC-level
AMP=value option - together with LDDF=-9. value is
either a numeric value or a name (char*16).
In the latter case, the names and associated values
must be passed to this routine via common blocks
/CPRFOR/ N, VALUES
Program urtap assigns variables named PTX and PTY (pole tide
amplitudes). They can be set through namelist.
If you want to scale the time-series that is described here with
that PTX value, add AMP=PTX at the end of the command line.
(i.e. to scale the IERS EOP X series). And likewise for Y.
Examples badly needed! Check with *.tse files and urtap.ins #-instructions.