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