NCEPLIBS-bufr  12.0.0
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 C> @author J. Woollen @date 1998-07-08
5 
6 C> This subroutine is used to specify the format of Section 1
7 C> date-time values that will be output by future calls to
8 C> any of the BUFRLIB [message-reading subroutines](@ref hierarchy).
9 C>
10 C> This subroutine can be called at any time from within the
11 C> application program, and the specified value for LEN will remain
12 C> in effect for all future calls to any of the BUFRLIB subroutines
13 C> which read BUFR messages, unless a subsequent call is made to this
14 C> subroutine to reset the value of LEN again. If this subroutine is
15 C> never called, a default value of 8 is used for LEN, as set within
16 C> subroutine bfrini().
17 C>
18 C> @param[in] LEN -- integer: Length of Section 1 date-time
19 C> values to be output by all future calls
20 C> to message-reading subroutines
21 C> - 8 = YYMMDDHH format with 2-digit year
22 C> (the default)
23 C> - 10 = YYYYMMDDHH format with 4-digit year
24 C>
25 C> @author J. Woollen @date 1998-07-08
26 
27  RECURSIVE SUBROUTINE datelen(LEN)
28 
29  USE modv_im8b
30 
31  COMMON /dateln/ lendat
32 
33  CHARACTER*128 bort_str
34 
35 C-----------------------------------------------------------------------
36 C-----------------------------------------------------------------------
37 
38 C CHECK FOR I8 INTEGERS
39 C ---------------------
40 
41  IF(im8b) THEN
42  im8b=.false.
43 
44  CALL x84(len,my_len,1)
45  CALL datelen(my_len)
46 
47  im8b=.true.
48  RETURN
49  ENDIF
50 
51 C CALL SUBROUTINE WRDLEN TO INITIALIZE SOME IMPORTANT INFORMATION
52 C ABOUT THE LOCAL MACHINE (IN CASE IT HAS NOT YET BEEN CALLED)
53 C ---------------------------------------------------------------
54 
55  CALL wrdlen
56 
57  IF(len.NE.8 .AND. len.NE.10) GOTO 900
58  lendat = len
59 
60 C EXITS
61 C -----
62 
63  RETURN
64 900 WRITE(bort_str,'("BUFRLIB: DATELEN - INPUT ARGUMENT IS",I4," - '//
65  . 'IT MUST BE EITHER 8 OR 10")') len
66  CALL bort(bort_str)
67  END
subroutine bort(STR)
Log one error message and abort application program.
Definition: bort.f:18
recursive 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:28
This module declares and initializes the IM8B variable.
logical, public im8b
Status indicator to keep track of whether all future calls to BUFRLIB subroutines and functions from ...
subroutine wrdlen
Determine important information about the local machine.
Definition: wrdlen.F:25
subroutine x84(IIN8, IOUT4, NVAL)
Encode one or more 8-byte integer values as 4-byte integer values.
Definition: x84.F:19