NCEPLIBS-bufr  12.0.1
ufbmns.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Read a specified data subset from internal arrays.
3 C>
4 C> @author J. Woollen @date 1994-01-06
5 
6 C> This subroutine reads a specified data subset from internal
7 C> arrays in memory, so that it is now in scope for processing
8 C> via calls to any of the [values-reading subroutines](@ref hierarchy)
9 C> using the Fortran logical unit number IUNIT that was returned from
10 C> the most recent call to subroutine ufbmem().
11 C>
12 C> This subroutine does not return any information about which
13 C> BUFR message within the internal arrays contained the specified data
14 C> subset.
15 C>
16 C> @param[in] IREP -- integer: Number of data subset to be
17 C> read into scope for further processing,
18 C> counting from the beginning of the
19 C> internal arrays in memory
20 C> @param[out] SUBSET -- character*8: Table A mnemonic for type of BUFR
21 C> message that was read into scope
22 C> (see [DX BUFR Tables](@ref dfbftab) for
23 C> further information about Table A mnemonics)
24 C> @param[out] IDATE -- integer: Date-time stored within Section 1 of
25 C> BUFR message that was read into scope,
26 C> in format of either YYMMDDHH or YYYYMMDDHH,
27 C> depending on the most
28 C> recent call to subroutine datelen()
29 C>
30 C> @author J. Woollen @date 1994-01-06
31  RECURSIVE SUBROUTINE ufbmns(IREP,SUBSET,IDATE)
32 
33  USE modv_im8b
34 
35  USE moda_msgmem
36 
37  CHARACTER*128 bort_str
38  CHARACTER*8 subset
39 
40 C-----------------------------------------------------------------------
41 C-----------------------------------------------------------------------
42 
43 C CHECK FOR I8 INTEGERS
44 C ---------------------
45 
46  IF(im8b) THEN
47  im8b=.false.
48 
49  CALL x84(irep,my_irep,1)
50  CALL ufbmns(my_irep,subset,idate)
51  CALL x48(idate,idate,1)
52 
53  im8b=.true.
54  RETURN
55  ENDIF
56 
57  jrep = 0
58  imsg = 1
59 
60 C READ SUBSET #ISUB FROM MEMORY MESSAGE #IMSG
61 C -------------------------------------------
62 
63  DO WHILE(ireadmm(imsg,subset,idate).EQ.0)
64  IF(jrep+nmsub(munit).GE.irep) THEN
65  CALL rdmems(irep-jrep,iret)
66  GOTO 100
67  ENDIF
68  jrep = jrep+nmsub(munit)
69  ENDDO
70  GOTO 900
71 
72 C EXITS
73 C -----
74 
75 100 RETURN
76 900 WRITE(bort_str,'("BUFRLIB: UFBMNS - REQ. SUBSET NO. TO READ IN '//
77  . '(",I5,") EXCEEDS TOTAL NO. OF SUBSETS IN THE COLLECTION OF '//
78  . 'MEMORY MESSAGES (",I5,")")') irep,jrep
79  CALL bort(bort_str)
80  END
subroutine bort(STR)
Log one error message and abort application program.
Definition: bort.f:18
recursive function ireadmm(IMSG, SUBSET, IDATE)
Read a BUFR message from internal arrays.
Definition: ireadmm.f:31
This module contains array and variable declarations used to store the contents of one or more BUFR f...
integer munit
Fortran logical unit number for use in accessing contents of BUFR files within internal memory.
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 function nmsub(LUNIT)
This function returns the total number of data subsets available within the BUFR message that was mos...
Definition: nmsub.f:22
recursive subroutine rdmems(ISUB, IRET)
This subroutine reads a specified data subset from the BUFR message that was most recently read via a...
Definition: rdmems.f:26
recursive subroutine ufbmns(IREP, SUBSET, IDATE)
This subroutine reads a specified data subset from internal arrays in memory, so that it is now in sc...
Definition: ufbmns.f:32
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