NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
ufbmns.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Read a specified data subset from internal arrays.
3 
4 C> This subroutine reads a specified data subset from internal
5 C> arrays in memory, so that it is now in scope for processing
6 C> via calls to any of the [values-reading subroutines](@ref hierarchy)
7 C> using the Fortran logical unit number IUNIT that was returned from
8 C> the most recent call to subroutine ufbmem().
9 C>
10 C> <p>This subroutine does not return any information about which
11 C> BUFR message within the internal arrays contained the specified data
12 C> subset.
13 C>
14 C> @author J. Woollen
15 C> @date 1994-01-06
16 C>
17 C> @param[in] IREP - integer: Number of data subset to be
18 C> read into scope for further processing,
19 C> counting from the beginning of the
20 C> internal arrays in memory
21 C> @param[out] SUBSET - character*8: Table A mnemonic for type of BUFR
22 C> message that was read into scope
23 C> (see [DX BUFR Tables](@ref dfbftab) for
24 C> further information about Table A mnemonics)
25 C> @param[out] IDATE - integer: Date-time stored within Section 1 of
26 C> BUFR message that was read into scope,
27 C> in format of either YYMMDDHH or YYYYMMDDHH,
28 C> depending on the most
29 C> recent call to subroutine datelen()
30 C>
31 C> <b>Program history log:</b>
32 C> - 1994-01-06 J. Woollen -- Original author
33 C> - 1998-07-08 J. Woollen -- Replaced call to Cray library routine
34 C> "ABORT" with call to new internal BUFRLIB
35 C> routine "BORT"
36 C> - 1999-11-18 J. Woollen -- Increased MAXMEM from 4 Mb to 8 Mb
37 C> - 2001-08-15 D. Keyser -- Increased MAXMEM from 8 Mb to 16 Mb
38 C> - 2004-11-15 D. Keyser -- Increased MAXMEM from 16 Mb to 50 Mb
39 C> - 2009-03-23 J. Ator -- Use ireadmm() instead of rdmemm();
40 C> simplify logic
41 C> - 2014-12-10 J. Ator -- Use modules instead of COMMON blocks
42 C>
43  SUBROUTINE ufbmns(IREP,SUBSET,IDATE)
44 
45  USE moda_msgmem
46 
47  CHARACTER*128 bort_str
48  CHARACTER*8 subset
49 
50 C-----------------------------------------------------------------------
51 C-----------------------------------------------------------------------
52 
53  jrep = 0
54  imsg = 1
55 
56 C READ SUBSET #ISUB FROM MEMORY MESSAGE #IMSG
57 C -------------------------------------------
58 
59  DO WHILE(ireadmm(imsg,subset,idate).EQ.0)
60  IF(jrep+nmsub(munit).GE.irep) THEN
61  CALL rdmems(irep-jrep,iret)
62  goto 100
63  ENDIF
64  jrep = jrep+nmsub(munit)
65  ENDDO
66  goto 900
67 
68 C EXITS
69 C -----
70 
71 100 RETURN
72 900 WRITE(bort_str,'("BUFRLIB: UFBMNS - REQ. SUBSET NO. TO READ IN '//
73  . '(",I5,") EXCEEDS TOTAL NO. OF SUBSETS IN THE COLLECTION OF '//
74  . 'MEMORY MESSAGES (",I5,")")') irep,jrep
75  CALL bort(bort_str)
76  END
This module contains array and variable declarations used to store the contents of one or more BUFR f...
Definition: moda_msgmem.F:14
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:48
function nmsub(LUNIT)
This function returns the total number of data subsets available within the BUFR message that was mos...
Definition: nmsub.f:31
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:43
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
function ireadmm(IMSG, SUBSET, IDATE)
This function calls BUFRLIB subroutine readmm() and passes back its return code as the function value...
Definition: ireadmm.f:41