NADCON5-ng  0.0.2
NADCON5 Next Generation Documentation
gscale.f
Go to the documentation of this file.
1 c> \ingroup core
2 c> \if MANPAGE
3 c> \page gscale
4 c> \endif
5 c>
6 c> Part of the NADCON5 \ref core , Scales a grid by a factor
7 c>
8 c>
9 c> ### Program arguments
10 c> Arguments are newline terminated and read from standard input
11 c>
12 c> When run from the command line, the program prints a prompt for each argument
13 c>
14 c> They are enumerated here
15 c> \param infile Input File Name
16 c> \param factor Scaling Factor
17 c> \param outfile Output File Name
18 c>
19 c> ### Program Inputs:
20 c>
21 c> - `lin1` Input File
22 c>
23 c> ### Program Outputs:
24 c>
25 c> - `lout` Output File
26 c>
27  program gscale
28 
29 *** scale grid by a factor
30 
31  implicit double precision(a-h,o-z)
32  character*88 fname
33  integer hrec1(200049)
34  real*4 zrec1(200049),factor
35  equivalence(hrec1(1),zrec1(1))
36 
37  lin1=1
38  lout=3
39 
40  write(6,*) 'program gscale'
41 
42  write(6,3)
43  3 format('Enter input file: ',$)
44  read(5,1) fname
45  1 format(a)
46  open(lin1,file=fname,status='old',form='unformatted')
47 
48  write(6,4)
49  4 format('Enter scale factor:',$)
50  read(*,*) factor
51 
52  write(6,2)
53  2 format('Enter output file: ',$)
54  read(5,1) fname
55  open(lout,file=fname,status='new',form='unformatted')
56 
57  read(lin1) glamn1,glomn1,dgla1,dglo1,nla1,nlo1,ikind1
58  write(lout) glamn1,glomn1,dgla1,dglo1,nla1,nlo1,ikind1
59 
60  if(ikind1.eq.0) then
61  do 10 irow=1,nla1
62  read (lin1) (hrec1(i),i=1,nlo1)
63  do 11 i=1,nlo1
64  11 hrec1(i)=nint(hrec1(i)*factor)
65  10 write(lout) (hrec1(i),i=1,nlo1)
66  else
67  do 20 irow=1,nla1
68  read (lin1) (zrec1(i),i=1,nlo1)
69  do 21 i=1,nlo1
70  21 zrec1(i)=zrec1(i)*factor
71  20 write(lout) (zrec1(i),i=1,nlo1)
72  endif
73 
74  stop
75  end
program gscale
Part of the NADCON5 NADCON5 Core Library , Scales a grid by a factor.
Definition: gscale.f:27