NCEPLIBS-bufr  11.6.0
 All Data Structures Files Functions Variables Pages
parutg.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine parutg (LUN, IO, UTG, NOD, KON, VAL)
 THIS SUBROUTINE PARSES A USER-SPECIFIED TAG (MNEMONIC) (UTG) THAT REPRESENTS A VALUE EITHER BEING DECODED FROM A BUFR FILE (IF IT IS BEING READ) OR ENCODED INTO A BUFR FILE (IF IT IS BEING WRITTEN). More...
 

Detailed Description

Author
WOOLLEN
Date
1994-01-06

Definition in file parutg.f.

Function/Subroutine Documentation

subroutine parutg (   LUN,
  IO,
character*(*)  UTG,
  NOD,
  KON,
  VAL 
)

THIS SUBROUTINE PARSES A USER-SPECIFIED TAG (MNEMONIC) (UTG) THAT REPRESENTS A VALUE EITHER BEING DECODED FROM A BUFR FILE (IF IT IS BEING READ) OR ENCODED INTO A BUFR FILE (IF IT IS BEING WRITTEN).

THIS SUBROUTINE FIRST CHECKS TO SEE IF THE TAG CONTAINS A CONDITION CHARACTER ('=', '!', '<', '>', '^' OR '#'). IF IT DOES NOT, NOTHING HAPPENS AT THIS POINT. IF IT DOES, THEN THE TYPE OF CONDITION CHARACTER IS NOTED AND THE TAG IS STRIPPED OF ALL CHARACTERS AT AND BEYOND THE CONDITION CHARACTER. IN EITHER EVENT, THE RESULTANT TAG IS CHECKED AGAINST THOSE IN THE INTERNAL JUMP/ LINK SUBSET TABLE (IN MODULE TABLES). IF FOUND, THE NODE ASSOCIATED WITH THE TAG IS RETURNED (AND IT IS EITHER A "CONDITION" NODE OR A "STORE" NODE DEPENDING OF THE PRESENCE OR ABSENCE OF A CONDITION CHARACTER IN UTG). OTHERWISE THE NODE IS RETURNED AS ZERO. IF THE TAG REPRESENTS A CONDITION NODE, THEN THE CONDITION VALUE (NUMERIC CHARACTERS BEYOND THE CONDITION CHARACTER IN THE USER-SPECIFIED TAG INPUT HERE) IS RETURNED.

AS AN EXAMPLE OF CONDITION CHARACTER USAGE, CONSIDER THE FOLLOWING EXAMPLE OF A CALL TO UFBINT:

REAL*8 USR(4,50) .... .... CALL UFBINT(LUNIN,USR,4,50,IRET,'PRLC<50000 TMDB WDIR WSPD')

ASSUMING THAT LUNIN POINTS TO A BUFR FILE OPEN FOR INPUT (READING), THEN THE USR ARRAY NOW CONTAINS IRET LEVELS OF DATA (UP TO A MAXIMUM OF 50!) WHERE THE VALUE OF PRLC IS/WAS LESS THAN 50000, ALONG WITH THE CORRESPONDING VALUES FOR TMDB, WDIR AND WSPD AT THOSE LEVELS.

AS ANOTHER EXAMPLE, CONSIDER THE FOLLOWING EXAMPLE OF A CALL TO READLC FOR A LONG CHARACTER STRING:

CHARACTER*200 LCHR .... .... CALL READLC(LUNIN,LCHR,'NUMID#3')

ASSUMING THAT LUNIN POINTS TO A BUFR FILE OPEN FOR INPUT (READING), THEN THE LCHR STRING NOW CONTAINS THE VALUE CORRESPONDING TO THE THIRD OCCURRENCE OF NUMID WITHIN THE CURRENT SUBSET.

VALID CONDITION CODES INCLUDE: '<' - LESS THAN '>' - GREATER THAN '=' - EQUAL TO '!' - NOT EQUAL TO '#' - ORDINAL IDENTIFIER FOR A PARTICULAR OCCURRENCE OF A LONG CHARACTER STRING

PROGRAM HISTORY LOG: 1994-01-06 J. WOOLLEN – ORIGINAL AUTHOR 1998-07-08 J. WOOLLEN – REPLACED CALL TO CRAY LIBRARY ROUTINE "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB ROUTINE "BORT" 1999-11-18 J. WOOLLEN – THE NUMBER OF BUFR FILES WHICH CAN BE OPENED AT ONE TIME INCREASED FROM 10 TO 32 (NECESSARY IN ORDER TO PROCESS MULTIPLE BUFR FILES UNDER THE MPI) 2003-11-04 S. BENDER – ADDED REMARKS/BUFRLIB ROUTINE INTERDEPENDENCIES 2003-11-04 D. KEYSER – MAXJL (MAXIMUM NUMBER OF JUMP/LINK ENTRIES) INCREASED FROM 15000 TO 16000 (WAS IN VERIFICATION VERSION); UNIFIED/PORTABLE FOR WRF; ADDED DOCUMENTATION (INCLUDING HISTORY); OUTPUTS MORE COMPLETE DIAGNOSTIC INFO WHEN ROUTINE TERMINATES ABNORMALLY; CHANGED CALL FROM BORT TO BORT2 IN SOME CASES; REPLACED PREVIOUS "RETURN 1" STATEMENT WITH "GOTO 900" (AND CALL TO BORT) SINCE THE ONLY ROUTINE THAT CALLS THIS ROUTINE, PARUSR, USED THIS ALTERNATE RETURN TO GO TO A STATEMENT WHICH CALLED BORT 2005-04-22 J. ATOR – HANDLED SITUATION WHERE INPUT TAG CONTAINS 1-BIT DELAYED REPLICATION, AND IMPROVED DOCUMENTATION 2009-03-23 J. ATOR – ADDED '#' CONDITION CODE 2014-12-10 J. ATOR – USE MODULES INSTEAD OF COMMON BLOCKS

USAGE: CALL PARUTG (LUN, IO, UTG, NOD, KON, VAL) INPUT ARGUMENT LIST: LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS IO - INTEGER: STATUS INDICATOR FOR BUFR FILE ASSOCIATED WITH LUN: 0 = input file 1 = output file UTG CHARACTER*(*): USER-SUPPLIED TAG REPRESENTING A VALUE TO BE ENCODED/DECODED TO/FROM BUFR FILE

OUTPUT ARGUMENT LIST: NOD - INTEGER: POSITIONAL INDEX IN INTERNAL JUMP/LINK SUBSET TABLE FOR TAG 0 = tag not found in table KON - INTEGER: INDICATOR FOR TYPE OF CONDITION CHARACTER FOUND IN UTG: 0 = no condition character found (NOD is a store node) 1 = character '=' found 2 = character '!' found 3 = character '<' found 4 = character '>' found 5 = character '^' found 6 = character '#' found (1-6 means NOD is a condition node, and specifically 5 is a "bump" node) VAL - REAL: CONDITION VALUE ASSOCIATED WITH CONDITION CHARACTER FOUND IN UTG 0 = UTG does not have a condition character

REMARKS: THIS ROUTINE CALLS: BORT BORT2 STRNUM THIS ROUTINE IS CALLED BY: PARUSR READLC WRITLC Normally not called by any application programs.

Definition at line 120 of file parutg.f.

References bort(), bort2(), and strnum().

Referenced by parusr(), readlc(), and writlc().