NCEPLIBS-bufr  11.7.0
 All Data Structures Files Functions Variables Pages
datelen.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Specify format of Section 1 date-time when reading
3 C> BUFR messages.
4 
5 C> This subroutine is used to specify the format of Section 1
6 C> date-time values that will be output by future calls to
7 C> any of the BUFRLIB [message-reading subroutines](@ref hierarchy).
8 C>
9 C> @author J. Woollen
10 C> @date 1998-07-08
11 C>
12 C> @param[in] LEN -- integer: Length of Section 1 date-time
13 C> values to be output by all future calls
14 C> to message-reading subroutines
15 C> - 8 = YYMMDDHH format with 2-digit year
16 C> (the default)
17 C> - 10 = YYYYMMDDHH format with 4-digit year
18 C>
19 C> <p>This subroutine can be called at any time from within the
20 C> application program, and the specified value for LEN will remain
21 C> in effect for all future calls to any of the BUFRLIB subroutines
22 C> which read BUFR messages, unless a subsequent call is made to this
23 C> subroutine to reset the value of LEN again. If this subroutine is
24 C> never called, a default value of 8 is used for LEN, as set within
25 C> subroutine bfrini().
26 C>
27 C> <b>Program history log:</b>
28 C> | Date | Programmer | Comments |
29 C> | -----|------------|----------|
30 C> | 1998-07-08 | J. Woollen | Original author |
31 C> | 2002-05-14 | J. Woollen | Changed from an entry point in readmg() to stand-alone subroutine, to increase portability to other platforms |
32 C> | 2003-11-04 | J. Ator | Added documentation |
33 C> | 2004-12-20 | D. Keyser | Calls wrdlen() to initialize local machine information, in case it has not yet been called |
34 C>
35  SUBROUTINE datelen(LEN)
36 
37  COMMON /dateln/ lendat
38 
39  CHARACTER*128 bort_str
40 
41 C-----------------------------------------------------------------------
42 C-----------------------------------------------------------------------
43 
44 C CALL SUBROUTINE WRDLEN TO INITIALIZE SOME IMPORTANT INFORMATION
45 C ABOUT THE LOCAL MACHINE (IN CASE IT HAS NOT YET BEEN CALLED)
46 C ---------------------------------------------------------------
47 
48  CALL wrdlen
49 
50  IF(len.NE.8 .AND. len.NE.10) goto 900
51  lendat = len
52 
53 C EXITS
54 C -----
55 
56  RETURN
57 900 WRITE(bort_str,'("BUFRLIB: DATELEN - INPUT ARGUMENT IS",I4," - '//
58  . 'IT MUST BE EITHER 8 OR 10")') len
59  CALL bort(bort_str)
60  END
subroutine datelen(LEN)
This subroutine is used to specify the format of Section 1 date-time values that will be output by fu...
Definition: datelen.f:35
subroutine wrdlen
This subroutine figures out some important information about the local machine on which the BUFRLIB s...
Definition: wrdlen.F:35
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:22