Debian Codegraph @

packages/seacas/applications/blot/grycen.f

raw
1 C Copyright(C) 1999-2020 National Technology & Engineering Solutions
2 C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 C NTESS, the U.S. Government retains certain rights in this software.
4 C
5 C See packages/seacas/LICENSE for details
6
7 C=======================================================================
8 SUBROUTINE GRYCEN (CHLSIZ, TOPLIN, BOTLIN, NUMLIN, NUMOVR)
9 C=======================================================================
10
11 C --*** GRYCEN *** (GRPLIB) Find center line of text area
12 C -- Written by Amy Gilkey - revised 02/20/87
13 C --
14 C --GRYCEN finds the center of a section of screen and returns the
15 C --top and bottom line coordinates for the given number of lines.
16 C --
17 C --Parameters:
18 C -- CHLSIZ - IN - the size of a line of text
19 C -- TOPLIN, BOTLIN - IN/OUT - the device coordinates of the bottom of
20 C -- the top and bottom lines of text
21 C -- NUMLIN - IN/OUT - the number of lines requested, reduced by
22 C -- NUMOVR if too long
23 C -- NUMOVR - OUT - if the number of lines requested is greater than
24 C -- the number of lines allowed, NUMOVR is the number of lines
25 C -- deleted
26
27 MAXLIN = INT((TOPLIN - BOTLIN) / CHLSIZ + 1 + 0.25)
28 IF (NUMLIN .GT. MAXLIN) THEN
29 NUMOVR = NUMLIN - MAXLIN
30 NUMLIN = MAXLIN
31 ELSE
32 NUMOVR = 0
33 END IF
34 CEN = 0.5 * (TOPLIN + BOTLIN)
35 TOPLIN = CEN + 0.5 * (NUMLIN-1) * CHLSIZ
36 BOTLIN = TOPLIN - (NUMLIN-1) * CHLSIZ
37
38 RETURN
39 END