NCEPLIBS-bufr  12.0.1
rtrcpt.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Read the tank receipt time from Section 1 of a BUFR message.
3 C>
4 C> @author J. Ator @date 2009-03-23
5 
6 C> This subroutine reads the tank receipt time (if one exists) from
7 C> Section 1 of a BUFR message. It is similar to subroutine rtrcptb(),
8 C> except that rtrcptb() operates on a BUFR message passed in via a
9 C> memory array, whereas this subroutine operates on the BUFR message
10 C> that was read into internal arrays via the most recent call to any
11 C> of the other [message-reading subroutines](@ref hierarchy) for a
12 C> specified Fortran logical unit.
13 C>
14 C> @param[in] LUNIT -- integer: Fortran logical unit number for
15 C> BUFR file
16 C> @param[out] IYR -- integer: Tank receipt year
17 C> @param[out] IMO -- integer: Tank receipt month
18 C> @param[out] IDY -- integer: Tank receipt day
19 C> @param[out] IHR -- integer: Tank receipt hour
20 C> @param[out] IMI -- integer: Tank receipt minute
21 C> @param[out] IRET -- integer: return code
22 C> - 0 = normal return
23 C> - -1 = no tank receipt time exists within the
24 C> BUFR message currently open for input
25 C> within internal arrays
26 C>
27 C> @author J. Ator @date 2009-03-23
28  RECURSIVE SUBROUTINE rtrcpt(LUNIT,IYR,IMO,IDY,IHR,IMI,IRET)
29 
30  USE modv_im8b
31  USE moda_bitbuf
32 
33 C-----------------------------------------------------------------------
34 C-----------------------------------------------------------------------
35 
36 C Check for I8 integers.
37 
38  IF(im8b) THEN
39  im8b=.false.
40 
41  CALL x84(lunit,my_lunit,1)
42  CALL rtrcpt(my_lunit,iyr,imo,idy,ihr,imi,iret)
43  CALL x48(iyr,iyr,1)
44  CALL x48(imo,imo,1)
45  CALL x48(idy,idy,1)
46  CALL x48(ihr,ihr,1)
47  CALL x48(imi,imi,1)
48  CALL x48(iret,iret,1)
49 
50  im8b=.true.
51  RETURN
52  ENDIF
53 
54 C Check the file status.
55 
56  CALL status(lunit,lun,il,im)
57  IF(il.EQ.0) GOTO 900
58  IF(il.GT.0) GOTO 901
59  IF(im.EQ.0) GOTO 902
60 
61 C Unpack the tank receipt time.
62 
63  CALL rtrcptb(mbay(1,lun),iyr,imo,idy,ihr,imi,iret)
64 
65 C EXITS
66 C -----
67 
68  RETURN
69 900 CALL bort('BUFRLIB: RTRCPT - INPUT BUFR FILE IS CLOSED; IT '//
70  . 'MUST BE OPEN FOR INPUT')
71 901 CALL bort('BUFRLIB: RTRCPT - INPUT BUFR FILE IS OPEN FOR '//
72  . 'OUTPUT; IT MUST BE OPEN FOR INPUT')
73 902 CALL bort('BUFRLIB: RTRCPT - A MESSAGE MUST BE OPEN IN INPUT '//
74  . 'BUFR FILE; NONE ARE')
75  END
subroutine bort(STR)
Log one error message and abort application program.
Definition: bort.f:18
This module contains array and variable declarations used to store BUFR messages internally for multi...
integer, dimension(:,:), allocatable mbay
Current BUFR message for each internal I/O stream.
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 rtrcpt(LUNIT, IYR, IMO, IDY, IHR, IMI, IRET)
This subroutine reads the tank receipt time (if one exists) from Section 1 of a BUFR message.
Definition: rtrcpt.f:29
recursive subroutine rtrcptb(MBAY, IYR, IMO, IDY, IHR, IMI, IRET)
This subroutine reads the tank receipt time (if one exists) from Section 1 of a BUFR message.
Definition: rtrcptb.f:26
recursive subroutine status(LUNIT, LUN, IL, IM)
Check whether a specified Fortran logical unit number is currently connected to the NCEPLIBS-bufr sof...
Definition: status.f:36
subroutine x48(IIN4, IOUT8, NVAL)
Encode one or more 4-byte integer values as 8-byte integer values.
Definition: x48.F:19
subroutine x84(IIN8, IOUT4, NVAL)
Encode one or more 8-byte integer values as 4-byte integer values.
Definition: x84.F:19