NCEPLIBS-bufr  11.6.0
 All Data Structures Files Functions Variables Pages
ufbmms.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 provides a handy way to combine the functionality
5 C> of subroutines rdmemm() and rdmems() within a single subroutine
6 C> call.
7 C>
8 C> @author J. Woollen
9 C> @date 1994-01-06
10 C>
11 C> @param[in] IMSG -- integer: Number of BUFR message to be
12 C> read into scope for further processing,
13 C> counting from the beginning of the
14 C> internal arrays in memory
15 C> @param[in] ISUB -- integer: Number of data subset to be
16 C> read from the (IMSG)th BUFR message,
17 C> counting from the beginning of the message
18 C> @param[out] SUBSET -- character*8: Table A mnemonic for type of
19 C> (IMSG)th BUFR message
20 C> (see [DX BUFR Tables](@ref dfbftab) for
21 C> further information about Table A mnemonics)
22 C> @param[out] JDATE -- integer: Date-time stored within Section 1 of
23 C> (IMSG)th BUFR message, in format of either
24 C> YYMMDDHH or YYYYMMDDHH, depending on the most
25 C> recent call to subroutine datelen()
26 C>
27 C> <p>Whenever this subroutine returns successfully, the requested data
28 C> subset can now be easily manipulated or further parsed via calls to
29 C> any of the [values-reading subroutines](@ref hierarchy) using the
30 C> Fortran logical unit number IUNIT that was returned from the most
31 C> recent call to subroutine ufbmem().
32 C>
33 C> <b>Program history log:</b>
34 C> | Date | Programmer | Comments |
35 C> | -----|------------|----------|
36 C> | 1994-01-06 | J. Woollen | Original author |
37 C> | 1998-07-08 | J. Woollen | Replaced call to Cray library routine "ABORT" with call to new internal routine bort() |
38 C> | 1999-11-18 | J. Woollen | Increased MAXMEM from 4 Mb to 8 Mb |
39 C> | 2001-08-15 | D. Keyser | Increased MAXMEM from 8 Mb to 16 Mb |
40 C> | 2004-11-15 | D. Keyser | Increased MAXMEM from 16 Mb to 50 Mb |
41 C> | 2014-12-10 | J. Ator | Use modules instead of COMMON blocks |
42 C>
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 
51 C-----------------------------------------------------------------------
52 C-----------------------------------------------------------------------
53 
54 C READ SUBSET #ISUB FROM MEMORY MESSAGE #IMSG
55 C -------------------------------------------
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 
62 C EXITS
63 C -----
64 
65  RETURN
66 900 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)
75 901 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 ufbmms(IMSG, ISUB, SUBSET, JDATE)
This subroutine provides a handy way to combine the functionality of subroutines rdmemm() and rdmems(...
Definition: ufbmms.f:43
This module contains array and variable declarations used to store the contents of one or more BUFR f...
Definition: moda_msgmem.F:14
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:49
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
subroutine status(LUNIT, LUN, IL, IM)
This subroutine checks whether a specified Fortran logical unit number is currently connected to the ...
Definition: status.f:55
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:22