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