NCEPLIBS-bufr  11.7.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> | Date | Programmer | Comments |
33 C> | -----|------------|----------|
34 C> | 1994-01-06 | J. Woollen | Original author |
35 C> | 1998-07-08 | J. Woollen | Replaced call to Cray library routine "ABORT" with call to new internal 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(); simplify logic |
40 C> | 2014-12-10 | J. Ator | Use modules instead of COMMON blocks |
41 C>
42  SUBROUTINE ufbmns(IREP,SUBSET,IDATE)
43 
44  USE moda_msgmem
45 
46  CHARACTER*128 bort_str
47  CHARACTER*8 subset
48 
49 C-----------------------------------------------------------------------
50 C-----------------------------------------------------------------------
51 
52  jrep = 0
53  imsg = 1
54 
55 C READ SUBSET #ISUB FROM MEMORY MESSAGE #IMSG
56 C -------------------------------------------
57 
58  DO WHILE(ireadmm(imsg,subset,idate).EQ.0)
59  IF(jrep+nmsub(munit).GE.irep) THEN
60  CALL rdmems(irep-jrep,iret)
61  goto 100
62  ENDIF
63  jrep = jrep+nmsub(munit)
64  ENDDO
65  goto 900
66 
67 C EXITS
68 C -----
69 
70 100 RETURN
71 900 WRITE(bort_str,'("BUFRLIB: UFBMNS - REQ. SUBSET NO. TO READ IN '//
72  . '(",I5,") EXCEEDS TOTAL NO. OF SUBSETS IN THE COLLECTION OF '//
73  . 'MEMORY MESSAGES (",I5,")")') irep,jrep
74  CALL bort(bort_str)
75  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:42
function nmsub(LUNIT)
This function returns the total number of data subsets available within the BUFR message that was mos...
Definition: nmsub.f:29
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:42
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:22
function ireadmm(IMSG, SUBSET, IDATE)
This function calls BUFRLIB subroutine readmm() and passes back its return code as the function value...
Definition: ireadmm.f:42