NADCON5-ng  0.0.1
NADCON5 Next Generation
getgridbounds.f
Go to the documentation of this file.
1 c> \ingroup core
2 c> Subroutine to collect up the GRID boundaries
3 c> for use in creating NADCON 5
4 c>
5 c> This CAN BE different than the MAP boundaries
6 c> as such:
7 c>
8 c> GRID boundaries will be just four values (n/s/w/e) for any region
9 c>
10 c> MAP boundaries will allow multiple maps to be made and may or may
11 c> not align with the GRID boundaries. Used to allow for more
12 c> "close up" maps and such, without the need to screw up the
13 c> MAP boundaries.
14 c>
15 c> \param[in] region Region Name
16 c> \param[out] xn north boundary for this region
17 c> \param[out] xs south boundary for this region
18 c> \param[out] xw west boundary for this region
19 c> \param[out] xe east boundary for this region
20 c>
21 c> ### Subroutine Input Files:
22 c>
23 c> - `Data/grid.parameters
24 c>
25  subroutine getgridbounds(region,xn,xs,xw,xe)
26 c
27 c - Subroutine to collect up the GRID boundaries
28 c - for use in creating NADCON 5
29 c
30 c - This CAN BE different than the MAP boundaries
31 c - as such:
32 c
33 c - GRID boundaries will be just four values (n/s/w/e) for any region
34 c
35 c - MAP boundaries will allow multiple maps to be made and may or may
36 c - not align with the GRID boundaries. Used to allow for more
37 c - "close up" maps and such, without the need to screw up the
38 c - MAP boundaries.
39 
40 c - Input:
41 c region
42 c - Output:
43 c xn,xs,xw,xe = N/S/W/E boundaries of the grid to be
44 c created for this region
45 
46  character*10 region
47  real*8 xn,xs,xw,xe
48  character*80 card
49 
50  ifile = 3
51 
52  open(ifile,
53  *file='Data/grid.parameters',
54  *status='old',form='formatted')
55 
56 c - Read 2 header lines
57  read(ifile,'(a)')card
58  read(ifile,'(a)')card
59 
60 c - Now loop and find our region
61  1 read(ifile,'(a)',end=2)card
62  if(trim(card(1:10)).eq.trim(region))then
63  read(card(14:23),*)xn
64  read(card(27:36),*)xs
65  read(card(40:49),*)xw
66  read(card(53:62),*)xe
67  close(ifile)
68  return
69  endif
70  goto 1
71 
72 c - If we get here, the region sent to this subroutine wasn't found
73 c - in our file /Data/grid.parameters. Crash and burn.
74  2 write(6,100)trim(region)
75  stop 10001
76  100 format(6x,'FATAL Subroutine getgridbounds: Unknown region: ',a)
77 
78  end
subroutine getgridbounds(region, xn, xs, xw, xe)
Subroutine to collect up the GRID boundaries for use in creating NADCON 5.
Definition: getgridbounds.f:26