READSMET()
Fortran version:
LOGICAL FUNCTION READSMET( FDEV, JDATE, JTIME,
& NBORD, SBORD, EBORD, WBORD,
& MAXMET, NMET, IMET, RMET )
INTEGER FDEV ! unit number for input file
INTEGER JDATE, JTIME ! GMT date and time requested
REAL NBORD, SBORD, EBORD, WBORD ! acceptance window borders
INTEGER MAXMET ! max number of stationsallowed
INTEGER NMET ! number of stations found
INTEGER IMET ( MAXMET ) ! array of station ID's
REAL RMET ( 16, MAXMET ) ! station data
C version: none
Summary:
This should be considered obsolete—no more than a piece of
example-code of how to do proper encapsulation of
sequential-file handling—since they've changed the
ASCII-surface-met-file format so many times since it was written
;-(
READSMET()
reads one hour's data for stations within the
geographic window
SBORD <= latitude <= NBORD
WBORD <= longitude <= EBORD
from a
SURMET-format
surface meteorology observations file opened on unit FDEV. It handles
file indexing and header internally, requiring ONE READ PER HOUR.
Returns .TRUE. iff the read was successful. If
100 * JDATE + JTIME/10000 <= 0 ,
READSMET() sets JDATE:JTIME to file FDEV's starting date and time
and rewinds FDEV. (This may be used to find the starting date and
time for the file.) Station data as returned by READSMET() has the
following structure:
- NMET is the actual number of stations returned at this hour
- IMET( 1...NMET ) are station ID's
- RMET ( 1, 1...NMET ) -- latitude (deg) [ -90...90]
- RMET ( 2, 1...NMET ) -- longitude (deg) [-180...180]
- RMET ( 3, 1...NMET ) -- opaque sky cover percentage
- RMET ( 4, 1...NMET ) -- total sky cover classification
- 0 = clear
- 1 = partial obscuration
- 2 = thin scattered
- 3 = thin broken
- 4 = thin overcast
- 5 = scattered
- 6 = broken
- 7 = overcast
- 8 = obscured
- -999 = indeterminate
- RMET ( 5, 1...NMET ) -- lowest cloud cover percentage
- RMET ( 6, 1...NMET ) -- lowest cloud height (meters)
- RMET ( 7, 1...NMET ) -- 2nd lowest cloud cover percentage
- RMET ( 8, 1...NMET ) -- 2nd lowest cloud height (meters)
- RMET ( 9, 1...NMET ) -- 3rd lowest cloud cover percentage
- RMET ( 10, 1...NMET ) -- 3rd lowest cloud height (meters)
- RMET ( 11, 1...NMET ) -- sea level pressure (mb)
- RMET ( 12, 1...NMET ) -- wind direction (bearing, deg from N)
- RMET ( 13, 1...NMET ) -- wind speed (meters/second)
- RMET ( 14, 1...NMET ) -- temperature (deg C)
- RMET ( 15, 1...NMET ) -- dew point (deg C)
- RMET ( 16, 1...NMET ) -- station pressure (mb)
Preconditions:
1: Set environment variable SURMET_INT_IDS to
TRUE iff station IDs are (WBAN) integers in the ROM 2.2 style
(instead of character-string IDs of earlier styles).
2: FDEV is in the range 1:100 (e.g., as returned
by junit() or
PROMPTFFILE())
3: FDEV is the unit number for SURMET-format file
already opened by the caller.
4: DATE:JTIME represents
Greenwich Mean Time expressed according to
EDSS/Models-3 date and time conventions
Fortran Usage:
See example program SFCMET.
Previous: PROMPTMFILE
Next: SETENV
Up: Utility Routines
To: Models-3/EDSS I/O API: The Help Pages