NCEPLIBS-bufr 11.7.1
ufbmms.f
Go to the documentation of this file.
1C> @file
2C> @brief Read a specified data subset from internal arrays.
3
4C> This subroutine provides a handy way to combine the functionality
5C> of subroutines rdmemm() and rdmems() within a single subroutine
6C> call.
7C>
8C> @author J. Woollen
9C> @date 1994-01-06
10C>
11C> @param[in] IMSG -- integer: Number of BUFR message to be
12C> read into scope for further processing,
13C> counting from the beginning of the
14C> internal arrays in memory
15C> @param[in] ISUB -- integer: Number of data subset to be
16C> read from the (IMSG)th BUFR message,
17C> counting from the beginning of the message
18C> @param[out] SUBSET -- character*8: Table A mnemonic for type of
19C> (IMSG)th BUFR message
20C> (see [DX BUFR Tables](@ref dfbftab) for
21C> further information about Table A mnemonics)
22C> @param[out] JDATE -- integer: Date-time stored within Section 1 of
23C> (IMSG)th BUFR message, in format of either
24C> YYMMDDHH or YYYYMMDDHH, depending on the most
25C> recent call to subroutine datelen()
26C>
27C> <p>Whenever this subroutine returns successfully, the requested data
28C> subset can now be easily manipulated or further parsed via calls to
29C> any of the [values-reading subroutines](@ref hierarchy) using the
30C> Fortran logical unit number IUNIT that was returned from the most
31C> recent call to subroutine ufbmem().
32C>
33C> <b>Program history log:</b>
34C> | Date | Programmer | Comments |
35C> | -----|------------|----------|
36C> | 1994-01-06 | J. Woollen | Original author |
37C> | 1998-07-08 | J. Woollen | Replaced call to Cray library routine "ABORT" with call to new internal routine bort() |
38C> | 1999-11-18 | J. Woollen | Increased MAXMEM from 4 Mb to 8 Mb |
39C> | 2001-08-15 | D. Keyser | Increased MAXMEM from 8 Mb to 16 Mb |
40C> | 2004-11-15 | D. Keyser | Increased MAXMEM from 16 Mb to 50 Mb |
41C> | 2014-12-10 | J. Ator | Use modules instead of COMMON blocks |
42C>
43 SUBROUTINE ufbmms(IMSG,ISUB,SUBSET,JDATE)
44
45 USE moda_msgcwd
46 USE moda_msgmem
47
48 CHARACTER*128 BORT_STR
49 CHARACTER*8 SUBSET
50
51C-----------------------------------------------------------------------
52C-----------------------------------------------------------------------
53
54C READ SUBSET #ISUB FROM MEMORY MESSAGE #IMSG
55C -------------------------------------------
56
57 CALL rdmemm(imsg,subset,jdate,iret)
58 IF(iret.LT.0) GOTO 900
59 CALL rdmems(isub,iret)
60 IF(iret.NE.0) GOTO 901
61
62C EXITS
63C -----
64
65 RETURN
66900 IF(imsg.GT.0) THEN
67 WRITE(bort_str,'("BUFRLIB: UFBMMS - REQUESTED MEMORY MESSAGE '//
68 . 'NUMBER TO READ IN (",I5,") EXCEEDS THE NUMBER OF MESSAGES IN '//
69 . 'MEMORY (",I5,")")') imsg,msgp(0)
70 ELSE
71 WRITE(bort_str,'("BUFRLIB: UFBMMS - REQUESTED MEMORY MESSAGE '//
72 . 'NUMBER TO READ IN IS ZERO - THIS IS NOT VALID")')
73 ENDIF
74 CALL bort(bort_str)
75901 CALL status(munit,lun,il,im)
76 WRITE(bort_str,'("BUFRLIB: UFBMMS - REQ. SUBSET NUMBER TO READ '//
77 . 'IN (",I3,") EXCEEDS THE NUMBER OF SUBSETS (",I3,") IN THE '//
78 . 'REG. MEMORY MESSAGE (",I5,")")') isub,msub(lun),imsg
79 CALL bort(bort_str)
80 END
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
This module contains array and variable declarations used to store the contents of one or more BUFR f...
Definition: moda_msgmem.F:14
integer munit
Fortran logical unit number for use in accessing contents of BUFR files within internal memory.
Definition: moda_msgmem.F:71
integer, dimension(:), allocatable msgp
Pointers to the beginning of each message within msgs (up to a maximum of MAXMSG, and where array ele...
Definition: moda_msgmem.F:79
subroutine rdmemm(IMSG, SUBSET, JDATE, IRET)
This subroutine reads a specified BUFR message from internal arrays in memory, so that it is now in s...
Definition: rdmemm.f:50
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:43
subroutine status(LUNIT, LUN, IL, IM)
This subroutine checks whether a specified Fortran logical unit number is currently connected to the ...
Definition: status.f:56
subroutine ufbmms(IMSG, ISUB, SUBSET, JDATE)
This subroutine provides a handy way to combine the functionality of subroutines rdmemm() and rdmems(...
Definition: ufbmms.f:44