NCEPLIBS-bufr  11.5.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> - 1998-07-08 J. Woollen -- Original author
29 C> - 2002-05-14 J. Woollen -- Changed from an entry point in readmg()
30 C> to stand-alone subroutine, to increase
31 C> 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
34 C> information (in case it has not yet been
35 C> called), this routine does not require it
36 C> but it may someday call other routines that
37 C> do require it
38 C>
39  SUBROUTINE datelen(LEN)
40 
41  COMMON /dateln/ lendat
42 
43  CHARACTER*128 bort_str
44 
45 C-----------------------------------------------------------------------
46 C-----------------------------------------------------------------------
47 
48 C CALL SUBROUTINE WRDLEN TO INITIALIZE SOME IMPORTANT INFORMATION
49 C ABOUT THE LOCAL MACHINE (IN CASE IT HAS NOT YET BEEN CALLED)
50 C ---------------------------------------------------------------
51 
52  CALL wrdlen
53 
54  IF(len.NE.8 .AND. len.NE.10) goto 900
55  lendat = len
56 
57 C EXITS
58 C -----
59 
60  RETURN
61 900 WRITE(bort_str,'("BUFRLIB: DATELEN - INPUT ARGUMENT IS",I4," - '//
62  . 'IT MUST BE EITHER 8 OR 10")') len
63  CALL bort(bort_str)
64  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:39
subroutine wrdlen
This subroutine figures out some important information about the local machine on which the BUFRLIB s...
Definition: wrdlen.F:43
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23