NCEPLIBS-bufr 11.7.1
isize.f
Go to the documentation of this file.
1C> @file
2C> @author ATOR @date 2009-03-23
3
4C> THIS FUNCTION COMPUTES AND RETURNS THE NUMBER OF CHARACTERS
5C> NEEDED TO ENCODE THE INPUT INTEGER NUM AS A STRING. IT DOES NOT
6C> ACTUALLY ENCODE THE STRING BUT RATHER ONLY FIGURES OUT THE REQUIRED
7C> SIZE. NUM MUST BE AN INTEGER IN THE RANGE OF 0 TO 99999.
8C>
9C> PROGRAM HISTORY LOG:
10C> 2009-03-23 J. ATOR -- ORIGINAL AUTHOR
11C> 2016-02-12 J. ATOR -- MODIFIED FOR CRAYFTN COMPATIBILITY
12C>
13C> USAGE: CALL ISIZE ( NUM )
14C> INPUT ARGUMENT LIST:
15C> NUM - INTEGER: NUMBER TO BE ENCODED
16C>
17C> OUTPUT ARGUMENT LIST:
18C> ISIZE - INTEGER: NUMBER OF CHARACTERS NECESSARY TO ENCODE NUM
19C> AS A STRING
20C>
21C> REMARKS:
22C> THIS ROUTINE CALLS: BORT
23C> THIS ROUTINE IS CALLED BY: MTFNAM UFBDMP UFDUMP
24C> Normally not called by any application
25C> programs but it could be.
26C>
27 INTEGER FUNCTION isize (NUM)
28
29
30
31 CHARACTER*128 bort_str
32
33C-----------------------------------------------------------------------
34C-----------------------------------------------------------------------
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:28