[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
madst0.f
- Subject: madst0.f
- Date: 09 Jan 2006 13:44:43 -0700
Steve and Scott,
A user mentioned the failure of dcmsfc to decode buoys since Jan 1.
I found in madst0.f the code:
C
C* Get year of observation - (units digit of year only).
C* Values of 6 or more will be translated to 1996 - 1999, and
C* values less than 6 will be translated to 2000 - 2005.
C
fld1 = marrpt ( ip:ip )
CALL ST_INTG ( fld1, ival, ier )
IF ( ier .eq. 0 ) THEN
ip = ip + 2
IF ( ival .gt. 5 ) THEN
irptdt ( 1 ) = 1990 + ival
ELSE
irptdt ( 1 ) = 2000 + ival
END IF
ELSE
ierrno = 5
CALL MA_ERRS ( ierrno, marrpt, kret )
iret = 1
RETURN
END IF
I have replaced this with code that uses the RCTIM common value from
the madcod.f as follows:
C
C* Get year of observation - (units digit of year only).
C
fld1 = marrpt ( ip:ip )
CALL ST_INTG ( fld1, ival, ier )
IF ( ier .eq. 0 ) THEN
ip = ip + 2
C
C* Prevent report year from being grater than 1 more than
C* specified clock year.
C
iyrdif = ival - MOD ( INT ( rctim(2) ), 10 )
IF ( iyrdif .gt. 1 ) THEN
irptdt ( 1 ) = rctim(2) - 10 + iyrdif
ELSE
irptdt ( 1 ) = rctim(2) + iyrdif
END IF
ELSE
ierrno = 5
CALL MA_ERRS ( ierrno, marrpt, kret )
iret = 1
RETURN
END IF