Skip to content

Commit

Permalink
more cleanup for eventual removal of -w flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jbathegit committed Apr 3, 2023
1 parent 64c7d12 commit eb01fce
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 37 deletions.
27 changes: 13 additions & 14 deletions src/drfini.f
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,23 @@
C>
C> @author J. Woollen @date 2002-05-14

C> Initialize replication factors for delayed replication sequences.
C>
C> This subroutine explicitly initializes delayed replication factors
C> and allocates a corresponding amount of space within internal arrays,
C> thereby allowing the subsequent use of subroutine ufbseq() to write
C> data into delayed replication sequences.
C>
C> @param[in] LUNIT -- integer: Fortran logical unit number for BUFR
C> file
C> @param[in] MDRF -- integer(*): Array of delayed replication factors,
C> in one-to-one correspondence with the number
C> of occurrences of DRFTAG within the overall
C> subset definition, and explicitly defining
C> how much space (i.e. how many replications)
C> to allocate within each successive occurrence
C> @param[in] NDRF -- integer: Number of delayed replication factors
C> within MDRF
C> @param[in] DRFTAG -- character*(*): Table D sequence mnemonic,
C> bracketed by appropriate delayed replication
C> notation (e.g. {}, () OR <>)
C> @param[in] LUNIT - integer: Fortran logical unit number for BUFR file.
C> @param[in] MDRF - integer(*): Array of delayed replication factors,
C> in one-to-one correspondence with the number of occurrences of DRFTAG
C> within the overall subset definition, and explicitly defining how much
C> space (i.e. how many replications) to allocate within each successive
C> occurrence.
C> @param[in] NDRF - integer: Number of delayed replication factors
C> within MDRF.
C> @param[in] DRFTAG - character*(*): Table D sequence mnemonic, bracketed
C> by appropriate delayed replication notation (e.g. {}, () OR <>)
C>
C> Logical unit LUNIT should have already been opened for output
C> operations (i.e. writing/encoding BUFR) via a previous call to
Expand Down Expand Up @@ -72,7 +71,7 @@ RECURSIVE SUBROUTINE DRFINI(LUNIT,MDRF,NDRF,DRFTAG)

CALL X84(LUNIT,MY_LUNIT,1)
CALL X84(NDRF,MY_NDRF,1)
CALL X84(MDRF,MY_MDRF,MY_NDRF)
CALL X84(MDRF,MY_MDRF,MY_NDRF(1))
CALL DRFINI(MY_LUNIT,MY_MDRF,MY_NDRF,DRFTAG)

IM8B=.TRUE.
Expand Down
4 changes: 2 additions & 2 deletions src/idn30.f
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
C> @file
C> @brief Convert an FXY value from a character string to the
C> WMO bit-wise represtation.
C> WMO bit-wise representation.
C>
C> @author J. Woollen @date 1994-01-06

C> Convert an FXY value from a character string to the
C> WMO bit-wise represtation.
C> WMO bit-wise representation.
C>
C> For an description of the WMO bit-wise representation of the FXY
C> value, see ifxy().
Expand Down
39 changes: 18 additions & 21 deletions src/ufbmex.f
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,18 @@
C> with actual filenames on the local system, typically via a Fortran
C> "OPEN" statement.
C>
C> @param[in] LUNIT -- integer: Fortran logical unit number for BUFR
C> file
C> @param[in] LUNDX -- integer: Fortran logical unit number
C> containing DX BUFR table information
C> associated with BUFR messages in LUNIT
C> @param[in] INEW -- integer: Processing option
C> - 0 = Initialize the internal arrays, then
C> read all BUFR messages from LUNIT into
C> internal arrays
C> - Otherwise, read all BUFR messages from LUNIT
C> and append them to the existing messages
C> within the internal arrays
C> @param[out] IRET -- integer: Number of BUFR messages that were
C> read from LUNIT and stored into internal arrays
C> @param[out] MESG -- integer(*): Types of BUFR messages that were
C> read from LUNIT and stored into internal arrays
C> @param[in] LUNIT - integer: Fortran logical unit number for BUFR file.
C> @param[in] LUNDX - integer: Fortran logical unit number containing DX
C> BUFR table information associated with BUFR messages in LUNIT.
C> @param[in] INEW - integer: Processing option
C> - 0 = Initialize the internal arrays, then read all BUFR messages
C> from LUNIT into internal arrays
C> - Otherwise, read all BUFR messages from LUNIT and append them to the
C> existing messages within the internal arrays
C> @param[out] IRET - integer: Number of BUFR messages that were read
C> from LUNIT and stored into internal arrays.
C> @param[out] MESG - integer(*): Types of BUFR messages that were read
C> from LUNIT and stored into internal arrays.
C>
C> @author J. Woollen @date 2012-01-26
RECURSIVE SUBROUTINE UFBMEX(LUNIT,LUNDX,INEW,IRET,MESG)
Expand All @@ -53,7 +49,8 @@ RECURSIVE SUBROUTINE UFBMEX(LUNIT,LUNDX,INEW,IRET,MESG)

CHARACTER*128 BORT_STR,ERRSTR

INTEGER MESG(*), IRET(*)
INTEGER MESG(*), IRET(*), LUNIT(*), LUNDX(*), INEW(*)
INTEGER MY_LUNIT(1), MY_LUNDX(1), MY_INEW(1)

C-----------------------------------------------------------------------
C-----------------------------------------------------------------------
Expand All @@ -67,7 +64,7 @@ RECURSIVE SUBROUTINE UFBMEX(LUNIT,LUNDX,INEW,IRET,MESG)
CALL X84(LUNIT,MY_LUNIT,1)
CALL X84(LUNDX,MY_LUNDX,1)
CALL X84(INEW,MY_INEW,1)
IF (MY_INEW.EQ.0) THEN
IF (MY_INEW(1).EQ.0) THEN
NMESG = 0
ELSE
NMESG = MSGP(0)
Expand All @@ -86,7 +83,7 @@ RECURSIVE SUBROUTINE UFBMEX(LUNIT,LUNDX,INEW,IRET,MESG)

CALL OPENBF(LUNIT,'IN',LUNDX)

IF(INEW.EQ.0) THEN
IF(INEW(1).EQ.0) THEN
MSGP(0) = 0
MUNIT = 0
MLAST = 0
Expand Down Expand Up @@ -192,14 +189,14 @@ RECURSIVE SUBROUTINE UFBMEX(LUNIT,LUNDX,INEW,IRET,MESG)
CALL CLOSBF(LUNIT)
ELSE
IF(MUNIT.NE.0) CALL CLOSBF(LUNIT)
IF(MUNIT.EQ.0) MUNIT = LUNIT
IF(MUNIT.EQ.0) MUNIT = LUNIT(1)
ENDIF

C EXITS
C -----

RETURN
900 WRITE(BORT_STR,'("BUFRLIB: UFBMEX - ERROR READING MESSAGE '//
. 'NUMBER",I5," INTO MEMORY FROM UNIT",I3)') NMSG+1,LUNIT
. 'NUMBER",I5," INTO MEMORY FROM UNIT",I3)') NMSG+1,LUNIT(1)
CALL BORT(BORT_STR)
END

0 comments on commit eb01fce

Please sign in to comment.