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