NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
isize.f
Go to the documentation of this file.
1 C> @file
2 C> @author ATOR @date 2009-03-23
3 
4 C> THIS FUNCTION COMPUTES AND RETURNS THE NUMBER OF CHARACTERS
5 C> NEEDED TO ENCODE THE INPUT INTEGER NUM AS A STRING. IT DOES NOT
6 C> ACTUALLY ENCODE THE STRING BUT RATHER ONLY FIGURES OUT THE REQUIRED
7 C> SIZE. NUM MUST BE AN INTEGER IN THE RANGE OF 0 TO 99999.
8 C>
9 C> PROGRAM HISTORY LOG:
10 C> 2009-03-23 J. ATOR -- ORIGINAL AUTHOR
11 C> 2016-02-12 J. ATOR -- MODIFIED FOR CRAYFTN COMPATIBILITY
12 C>
13 C> USAGE: CALL ISIZE ( NUM )
14 C> INPUT ARGUMENT LIST:
15 C> NUM - INTEGER: NUMBER TO BE ENCODED
16 C>
17 C> OUTPUT ARGUMENT LIST:
18 C> ISIZE - INTEGER: NUMBER OF CHARACTERS NECESSARY TO ENCODE NUM
19 C> AS A STRING
20 C>
21 C> REMARKS:
22 C> THIS ROUTINE CALLS: BORT
23 C> THIS ROUTINE IS CALLED BY: MTFNAM UFBDMP UFDUMP
24 C> Normally not called by any application
25 C> programs but it could be.
26 C>
27  INTEGER FUNCTION isize (NUM)
28 
29 
30 
31  CHARACTER*128 bort_str
32 
33 C-----------------------------------------------------------------------
34 C-----------------------------------------------------------------------
35 
36  IF ( num .GE. 0 ) THEN
37  DO isize = 1, 5
38  IF ( num .LT. 10**isize ) RETURN
39  ENDDO
40  ENDIF
41  WRITE(bort_str,'("BUFRLIB: ISIZE - INPUT NUMBER (",I7,'//
42  . '") IS OUT OF RANGE")') num
43  CALL bort(bort_str)
44 
45  RETURN
46  END
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
INTEGER function isize(NUM)
THIS FUNCTION COMPUTES AND RETURNS THE NUMBER OF CHARACTERS NEEDED TO ENCODE THE INPUT INTEGER NUM AS...
Definition: isize.f:27