NCEPLIBS-bufr  12.0.0
strcpt.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Specify a tank receipt time to be included in Section 1
3 C> when writing BUFR messages.
4 C>
5 C> @author J. Ator @date 2009-03-23
6 
7 C> This subroutine is used to specify a tank receipt time to be
8 C> included within Section 1 of all BUFR messages output by future calls
9 C> to [message-writing subroutines](@ref hierarchy) and
10 C> [subset-writing subroutines](@ref hierarchy).
11 C>
12 C> This subroutine can be called at any time after the first call
13 C> to subroutine openbf(), and the specified value for CF will remain
14 C> in effect for all future calls to
15 C> [message-writing subroutines](@ref hierarchy) and
16 C> [subset-writing subroutines](@ref hierarchy), for all Fortran logical
17 C> units that are open for output within the application program,
18 C> unless a subsequent call is made to this subroutine to reset the
19 C> value of CF again. If this subroutine is never called, a default
20 C> value of 'N' is used for CF, as set within subroutine bfrini().
21 C>
22 C> Whenever this subroutine is called with CF = 'N', the values in
23 C> IYR, IMO, IDY, IHR, and IMI are ignored.
24 C>
25 C> @remarks
26 C> - Tank receipt time is an NCEP extension to Section 1 of the
27 C> [official WMO BUFR regulations](@ref manual).
28 C> However, it's encoded by the BUFRLIB software in such a way that
29 C> its inclusion within an output BUFR message is still fully
30 C> compliant with the regulations.
31 C>
32 C> @param[in] CF - character*1: Flag indicating whether future BUFR
33 C> output messages should include the tank receipt
34 C> time defined by IYR, IMO, IDY, IHR, and IMI:
35 C> - 'N' = No (the default)
36 C> - 'Y' = Yes
37 C> @param[in] IYR - integer: Tank receipt year.
38 C> @param[in] IMO - integer: Tank receipt month.
39 C> @param[in] IDY - integer: Tank receipt day.
40 C> @param[in] IHR - integer: Tank receipt hour.
41 C> @param[in] IMI - integer: Tank receipt minute.
42 C>
43 C> @author J. Ator @date 2009-03-23
44  RECURSIVE SUBROUTINE strcpt(CF,IYR,IMO,IDY,IHR,IMI)
45 
46  USE modv_im8b
47 
48  COMMON /tnkrcp/ itryr,itrmo,itrdy,itrhr,itrmi,ctrt
49 
50  CHARACTER*128 bort_str
51  CHARACTER*1 ctrt, cf
52 
53 C-----------------------------------------------------------------------
54 C-----------------------------------------------------------------------
55 
56 C CHECK FOR I8 INTEGERS
57 C ---------------------
58 
59  IF(im8b) THEN
60  im8b=.false.
61 
62  CALL x84(iyr,my_iyr,1)
63  CALL x84(imo,my_imo,1)
64  CALL x84(idy,my_idy,1)
65  CALL x84(ihr,my_ihr,1)
66  CALL x84(imi,my_imi,1)
67  CALL strcpt(cf,my_iyr,my_imo,my_idy,my_ihr,my_imi)
68 
69  im8b=.true.
70  RETURN
71  ENDIF
72 
73  CALL capit(cf)
74  IF(cf.NE.'Y'.AND. cf.NE.'N') GOTO 900
75 
76  ctrt = cf
77  IF(ctrt.EQ.'Y') THEN
78  itryr = iyr
79  itrmo = imo
80  itrdy = idy
81  itrhr = ihr
82  itrmi = imi
83  ENDIF
84 
85 C EXITS
86 C -----
87 
88  RETURN
89 900 WRITE(bort_str,'("BUFRLIB: STRCPT - INPUT ARGUMENT IS ",A1,'//
90  . '", IT MUST BE EITHER Y OR N")') cf
91  CALL bort(bort_str)
92  END
subroutine bort(STR)
Log one error message and abort application program.
Definition: bort.f:18
subroutine capit(STR)
This subroutine capitalizes all of the alphabetic characters in a string.
Definition: capit.f:13
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 ...
recursive subroutine strcpt(CF, IYR, IMO, IDY, IHR, IMI)
This subroutine is used to specify a tank receipt time to be included within Section 1 of all BUFR me...
Definition: strcpt.f:45
subroutine x84(IIN8, IOUT4, NVAL)
Encode one or more 8-byte integer values as 4-byte integer values.
Definition: x84.F:19