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