NCEPLIBS-bufr 11.7.1
newwin.f
Go to the documentation of this file.
1C> @file
2C> @author WOOLLEN @date 1994-01-06
3
4C> GIVEN AN INDEX WITHIN THE INTERNAL JUMP/LINK TABLE WHICH
5C> POINTS TO THE START OF AN "RPC" WINDOW (I.E. ITERATION OF AN 8-BIT
6C> OR 16-BIT DELAYED REPLICATION SEQUENCE), THIS SUBROUTINE COMPUTES
7C> THE ENDING INDEX OF THE WINDOW. ALTERNATIVELY, IF THE GIVEN INDEX
8C> POINTS TO THE START OF A "SUB" WINDOW (I.E. THE FIRST NODE OF A
9C> SUBSET), THE SUBROUTINE RETURNS THE INDEX OF THE LAST NODE.
10C>
11C> PROGRAM HISTORY LOG:
12C> 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
13C> 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
14C> "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
15C> ROUTINE "BORT"
16C> 1999-11-18 J. WOOLLEN -- THE NUMBER OF BUFR FILES WHICH CAN BE
17C> OPENED AT ONE TIME INCREASED FROM 10 TO 32
18C> (NECESSARY IN ORDER TO PROCESS MULTIPLE
19C> BUFR FILES UNDER THE MPI)
20C> 2002-05-14 J. WOOLLEN -- REMOVED OLD CRAY COMPILER DIRECTIVES
21C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
22C> INTERDEPENDENCIES
23C> 2003-11-04 D. KEYSER -- MAXJL (MAXIMUM NUMBER OF JUMP/LINK ENTRIES)
24C> INCREASED FROM 15000 TO 16000 (WAS IN
25C> VERIFICATION VERSION); UNIFIED/PORTABLE FOR
26C> WRF; ADDED DOCUMENTATION (INCLUDING
27C> HISTORY); OUTPUTS MORE COMPLETE DIAGNOSTIC
28C> INFO WHEN ROUTINE TERMINATES ABNORMALLY
29C> 2009-03-31 J. WOOLLEN -- ADDED DOCUMENTATION
30C> 2009-05-07 J. ATOR -- USE LSTJPB INSTEAD OF LSTRPC
31C> 2014-12-10 J. ATOR -- USE MODULES INSTEAD OF COMMON BLOCKS
32C>
33C> USAGE: CALL NEWWIN (LUN, IWIN, JWIN)
34C> INPUT ARGUMENT LIST:
35C> LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS
36C> IWIN - INTEGER: STARTING INDEX OF WINDOW ITERATION
37C>
38C> OUTPUT ARGUMENT LIST:
39C> JWIN - INTEGER: ENDING INDEX OF WINDOW ITERATION
40C>
41C> REMARKS:
42C>
43C> SEE THE DOCBLOCK IN BUFR ARCHIVE LIBRARY SUBROUTINE GETWIN FOR AN
44C> EXPLANATION OF "WINDOWS" WITHIN THE CONTEXT OF A BUFR DATA SUBSET.
45C>
46C> THIS ROUTINE CALLS: BORT LSTJPB
47C> THIS ROUTINE IS CALLED BY: DRSTPL UFBRW
48C> Normally not called by any application
49C> programs.
50C>
51 SUBROUTINE newwin(LUN,IWIN,JWIN)
52
53 USE moda_usrint
54
55 CHARACTER*128 BORT_STR
56
57C----------------------------------------------------------------------
58C----------------------------------------------------------------------
59
60 IF(iwin.EQ.1) THEN
61
62C This is a "SUB" (subset) node, so return JWIN as pointing to
63C the last value of the entire subset.
64
65 jwin = nval(lun)
66 GOTO 100
67 ENDIF
68
69C Confirm that IWIN points to an RPC node and then compute JWIN.
70
71 node = inv(iwin,lun)
72 IF(lstjpb(node,lun,'RPC').NE.node) GOTO 900
73 jwin = iwin+val(iwin,lun)
74
75C EXITS
76C -----
77
78100 RETURN
79900 WRITE(bort_str,'("BUFRLIB: NEWWIN - LSTJPB FOR NODE",I6,'//
80 . '" (LSTJPB=",I5,") DOES NOT EQUAL VALUE OF NODE, NOT RPC '//
81 . '(IWIN =",I8,")")') node,lstjpb(node,lun,'RPC'),iwin
82 CALL bort(bort_str)
83 END
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
function lstjpb(NODE, LUN, JBTYP)
THIS FUNCTION SEARCHES BACKWARDS, BEGINNING FROM A GIVEN NODE WITHIN THE JUMP/LINK TABLE,...
Definition: lstjpb.f:58
subroutine newwin(LUN, IWIN, JWIN)
GIVEN AN INDEX WITHIN THE INTERNAL JUMP/LINK TABLE WHICH POINTS TO THE START OF AN "RPC" WINDOW (I....
Definition: newwin.f:52