NADCON5-ng  0.0.2
NADCON5 Next Generation Documentation
bwplotcv.f
Go to the documentation of this file.
1 c> \ingroup core
2 c> \if MANPAGE
3 c> \page bwplotcv
4 c> \endif
5 c>
6 c> Subroutine to make GMT calls to do a B/W coverage plot
7 c>
8 c> ## Changelog
9 c>
10 c> ### 2016 08 29:
11 c> Updated the `-R` and `-B` initial calls to 6 decimal places
12 c>
13 c> ### 2016 08 25:
14 c> `.gmtdefaults4` has been changed so X_ORIGIN is equal to 0.0
15 c> Center the plot with "-Xc" at first "psxy" call
16 c> Remove all "-JM**i+" references, and just use the actual
17 c> width (jm) that came out of the "getmapbounds" routine and
18 c> was sent here.
19 c>
20 c> ### 2016 07 21:
21 c> Modified use of JM command based on new forced sizes.
22 c>
23 c> ### 2015 02 15:
24 c> Updated to allow this subroutine to work
25 c> earlier (in makeplotfiles01()), before `igridsec` was defined.
26 c> See DRU-11, p. 139
27 c>
28  subroutine bwplotcv(ele,fname,bw,be,bs,bn,jm,b1,b2,maxplots,
29  *olddtm,newdtm,region,elecap,ij,igridsec,fn)
30 
31 c - 2016 08 29:
32 c Updated the -R and -B initial calls to 6 decimal places
33 
34 c - 2016 08 25:
35 c .gmtdefaults4 has been changed so X_ORIGIN is equal to 0.0
36 c Center the plot with "-Xc" at first "psxy" call
37 c Remove all "-JM**i+" references, and just use the actual
38 c width (jm) that came out of the "getmapbounds" routine and
39 c was sent here.
40 
41 c - 2016 07 21:
42 c - Modified use of JM command based on new forced sizes.
43 
44 c - Subroutine to make GMT calls to do a B/W coverage plot
45 
46 c - Updated 10/2/2015 to allow this subroutine to work
47 c - earlier (in makeplotfiles01.f), before "igridsec" was defined.
48 c - See DRU-11, p. 139
49 
50  integer*4 maxplots
51  character*3 ele,elecap
52  character*200 fname
53  character*10 olddtm,newdtm,region
54  real*8 bw(maxplots),be(maxplots),bs(maxplots),bn(maxplots)
55  real*4 jm(maxplots)
56  real*4 b1(maxplots),b2(maxplots)
57  character*10 fn(maxplots)
58  character*5 extra
59  character*20 gridnote
60 
61 c ----------------------------------------------------
62 c - All coverage type files begin with "cv".
63 c - The 3rd element tells me all, thinned, dropped or RMS
64 c - The 4th/5th elements tell me if these are coordinate
65 c - differneces or double differences. Elements 6,7,8
66 c - tell me what data we're plotting.
67 c ----------------------------------------------------
68 
69 
70 c ----------------------------------------------------
71 c - FAILSAFES: BEGIN
72 c ----------------------------------------------------
73  if(fname(3:3).eq.'t')then
74  extra='-thin'
75  elseif(fname(3:3).eq.'d')then
76  extra='-drop'
77  elseif(fname(3:3).eq.'a')then
78  extra='-all '
79  elseif(fname(3:3).eq.'r')then
80  extra='-RMSd'
81  else
82  write(6,1)trim(fname)
83  stop
84  endif
85  1 format('FATAL in bwplotcv. Bad character in spot 3: ',a)
86 
87  if(fname(1:2).ne.'cv')then
88  write(6,2)trim(fname)
89  stop
90  endif
91  2 format('FATAL in bwplotcv. Bad character in spots 1-2: ',a)
92 
93  if(.not.(fname(4:5).eq.'cd' .or. fname(4:5).eq.'dd'))then
94  write(6,3)trim(fname)
95  stop
96  endif
97  3 format('FATAL in bwplotcv. Bad character in spots 4-5: ',a)
98 
99  if(fname(6:8).ne.ele)then
100  write(6,4)trim(fname),ele
101  stop
102  endif
103  4 format('FATAL in bwplotcv. Bad match of fname / ele: ',a,1x,a)
104 
105 c - Just in case we forgot to set "igridsec" to be -1
106 c - when we came here from makeplotfiles01:
107  if(fname(1:3).eq.'cvacd')then
108  igridsec = -1
109  endif
110 
111  if(igridsec.le.0)then
112  gridnote = ''
113  else
114  write(gridnote,10)igridsec
115  endif
116  10 format('(',i0,' sec)')
117 
118 
119 
120 c ----------------------------------------------------
121 c - FAILSAFES: END
122 c ----------------------------------------------------
123 
124 
125 
126 c ----------------------------------------------
127 c - GMT COMMANDS: BEGIN
128 c ----------------------------------------------
129 
130 c - Header of commands/echoes:
131  write(99,991)ele,extra,trim(region),trim(fn(ij)),
132  *ele,extra,trim(region),trim(fn(ij))
133 
134 c - Write out the actual dots, and the title, with PSXY command
135  write(99,904)trim(fname),bw(ij),be(ij),bs(ij),bn(ij),
136  *jm(ij),b1(ij),b2(ij),trim(newdtm),trim(olddtm),elecap,
137  *extra,trim(gridnote),trim(region),trim(fn(ij))
138 
139 c - ALWAYS plot the coast last, as it closes the PS file
140  call plotcoast(region,99)
141 
142 c - Convert PS to JPG
143  write(99,905)
144 
145 c - Rename the JPG to my naming scheme
146  write(99,910)trim(fname),trim(fn(ij))
147 c ----------------------------------------------
148 c - GMT COMMANDS: END
149 c ----------------------------------------------
150 
151 
152 
153  991 format(
154  *'# -----------------------------------------------------',/,
155  *'# coverage in ',a,a,1x,a,1x,a,/,
156  *'# -----------------------------------------------------',/,
157  *'echo ...coverage in ',a,a,1x,a,1x,a)
158 
159 
160 c - Plot the actual coverage points
161 c - 2016 08 29
162  904 format('psxy ',a,' -Xc -R',f0.6,'/',f0.6,'/',sp,f0.6,'/',f0.6,
163  * ss,' -JM',f3.1,'i -B',f0.6,'/',f0.6,':."',
164  * 'NADCON v5.0 ',a,' minus ',a,' ',a3,a5,a,
165  * 1x,a,'-',a,
166  * '": -Sc0.02i ',
167  * '-Gblack -K > plot.ps')
168 
169 
170 
171 c - 2016 08 25:
172 c 904 format('psxy ',a,' -Xc -R',f0.2,'/',f0.2,'/',sp,f0.2,'/',f0.2,
173 c * ss,' -JM',f3.1,'i -B',f0.2,'/',f0.2,':."',
174 c * 'NADCON v5.0 ',a,' minus ',a,' ',a3,a5,a,
175 c * 1x,a,'-',a,
176 c * '": -Sc0.02i ',
177 c * '-Gblack -K > plot.ps')
178 c - 2016 07 21
179 c 904 format('psxy ',a,' -R',f0.2,'/',f0.2,'/',sp,f0.2,'/',f0.2,
180 c * ss,' -JM',f3.1,'i -B',f0.2,'/',f0.2,':."',
181 c * 'NADCON v5.0 ',a,' minus ',a,' ',a3,a5,a,
182 c * 1x,a,'-',a,
183 c * '": -Sc0.02i ',
184 c * '-Gblack -K > plot.ps')
185 c 904 format('psxy ',a,' -R',f0.2,'/',f0.2,'/',sp,f0.2,'/',f0.2,
186 c * ss,' -JM',f3.1,'i+ -B',f0.2,'/',f0.2,':."',
187 c * 'NADCON v5.0 ',a,' minus ',a,' ',a3,a5,a,
188 c * 1x,a,'-',a,
189 c * '": -Sc0.02i ',
190 c * '-Gblack -K > plot.ps')
191 
192 c - 905 = Convert PS to JPG
193  905 format('ps2raster plot.ps -Tj -P -A ')
194 
195 
196 c - Renaming
197  910 format('mv -f plot.jpg ',a,'.',a,'.jpg',/,
198  *'rm -f plot.ps')
199 c 910 format('mv -f plot.jpg cv',a1,a3,'.',a,'.',a,'.',a,
200 c *'.',i0,'.',a,'.jpg',/,'rm -f plot.ps')
201  1910 format('mv -f plot.jpg cv',a3,'.',a,'.',a,'.',a,
202  *'.',a,'.jpg',/,'rm -f plot.ps')
203 
204  return
205  end
subroutine plotcoast(region, ifnum)
Subroutine to write GMT-based commands to create a shoreline Write GMT-based commands to create a sho...
Definition: plotcoast.f:44
subroutine bwplotcv(ele, fname, bw, be, bs, bn, jm, b1, b2, maxplots, olddtm, newdtm, region, elecap, ij, igridsec, fn)
Subroutine to make GMT calls to do a B/W coverage plot.
Definition: bwplotcv.f:30