NADCON5-ng  0.0.2
NADCON5 Next Generation Documentation
bwplotvc.f
Go to the documentation of this file.
1 c> \ingroup core
2 c> \if MANPAGE
3 c> \page bwplotvc
4 c> \endif
5 c>
6 c> Subroutine to make GMT calls to do a B/W vector plot
7 c>
8 c> ## Changelog
9 c>
10 c> ### 2016 08 29:
11 c> Expanded the refence vector calls to be 6 decimal places, as well
12 c> as the initial -R call for S/N/W/E
13 c> and also the -B part of that call
14 c>
15 c> ### 2016 08 25:
16 c> `.gmtdefaults4` has been changed so X_ORIGIN is equal to 0.0
17 c> Center the plot with "-Xc" at first "psxy" call
18 c> Remove all "-JM**i+" references, and just use the actual
19 c> width (jm) that came out of the "getmapbounds" routine and
20 c> was sent here.
21 c>
22 c> ### 2016 07 29:
23 c> Updated the reference vector call to
24 c> have the "-N" option, so it'll plot outside the map
25 c>
26 c> ### 2016 07 21:
27 c> Modified use of JM command based on new forced sizes.
28 c>
29 c> ### 2015 02 15:
30 c> Updated to allow this subroutine to work
31 c> earlier (in makeplotfiles01()), before `igridsec` was defined.
32 c> See DRU-11, p. 139
33 c>
34  subroutine bwplotvc(ele,fname,bw,be,bs,bn,jm,b1,b2,maxplots,
35  *olddtm,newdtm,region,elecap,ij,xvlon,xvlat,xllon,xllat,lorvog,
36  *lorvopc,igridsec,fn)
37 
38 c - 2016 08 29:
39 c Expanded the refence vector calls to be 6 decimal places, as well
40 c as the initial -R call for S/N/W/E
41 c and also the -B part of that call
42 
43 c - 2016 08 25:
44 c .gmtdefaults4 has been changed so X_ORIGIN is equal to 0.0
45 c Center the plot with "-Xc" at first "psxy" call
46 c Remove all "-JM**i+" references, and just use the actual
47 c width (jm) that came out of the "getmapbounds" routine and
48 c was sent here.
49 
50 
51 c - 2016 07 29: Updated the reference vector call to
52 c - have the "-N" option, so it'll plot outside the map
53 
54 c - 2016 07 21: Updated JM usage for new forced sizes
55 
56 c subroutine bwplotvc(ele,fname,bw,be,bs,bn,jm,b1,b2,maxplots,
57 c *olddtm,newdtm,region,elecap,ij,xvlon,xvlat,xllon,xllat,ncm,
58 c *q1,igridsec,fn)
59 c - Subroutine to make GMT calls to do a B/W vector plot
60 
61 c - Updated 10/2/2015 to allow this subroutine to work
62 c - earlier (in makeplotfiles01.f), before "igridsec" was defined.
63 c - See DRU-11, p. 139
64 
65  implicit real*8(a-h,o-z)
66  integer*4 maxplots
67  character*3 ele,elecap
68  character*200 fname
69  character*10 olddtm,newdtm,region
70  real*8 bw(maxplots),be(maxplots),bs(maxplots),bn(maxplots)
71  real*4 jm(maxplots)
72  real*4 b1(maxplots),b2(maxplots)
73  character*10 fn(maxplots)
74  character*5 extra
75  character*20 units
76  character*20 gridnote
77  character*20 gridnote2
78 
79  real*8 lorvopc,lorvog
80 
81 c ----------------------------------------------------
82 c - All vector type files begin with either "vm"
83 c - (meters) or "vs" (arcseconds).
84 c - The 3rd element tells me all, thinned, dropped or RMS
85 c - The 4th/5th elements tell me if these are coordinate
86 c - differnces or double differences. Elements 6,7,8
87 c - tell me what data we're plotting.
88 c ----------------------------------------------------
89 
90 
91 c ----------------------------------------------------
92 c - FAILSAFES: BEGIN
93 c ----------------------------------------------------
94  if(fname(3:3).eq.'t')then
95  extra='-thin'
96  elseif(fname(3:3).eq.'d')then
97  extra='-drop'
98  elseif(fname(3:3).eq.'a')then
99  extra='-all '
100  elseif(fname(3:3).eq.'r')then
101  extra='-RMSd'
102  else
103  write(6,1)trim(fname)
104  stop
105  endif
106  1 format('FATAL in bwplotvc. Bad character in spot 3: ',a)
107 
108  if(.not.(fname(1:2).eq.'vm'.or.fname(1:2).eq.'vs'))then
109  write(6,2)trim(fname)
110  stop
111  endif
112  2 format('FATAL in bwplotvc. Bad character in spots 1-2: ',a)
113 
114  if(.not.(fname(4:5).eq.'cd' .or. fname(4:5).eq.'dd' .or.
115  * fname(4:5).eq.'gi'))then
116  write(6,3)trim(fname)
117  stop
118  endif
119  3 format('FATAL in bwplotvc. Bad character in spots 4-5: ',a)
120 
121  if(fname(6:8).ne.ele)then
122  write(6,4)trim(fname),ele
123  stop
124  endif
125  4 format('FATAL in bwplotvc. Bad match of fname / ele: ',a,1x,a)
126 
127 c - Just in case we forgot to set "igridsec" to be -1
128 c - when we came here from makeplotfiles01:
129  if(fname(1:3).eq.'vmacd' .or. fname(1:3).eq.'vsacd')then
130  igridsec = -1
131  endif
132 
133  if (fname(2:2).eq.'m')then
134  units='meters'
135  elseif(fname(2:2).eq.'s')then
136  units='arcseconds'
137  else
138  write(6,5)trim(fname)
139  stop
140  endif
141  5 format('FATAL in bwplotvc. Bad units in name: ',a)
142 
143  if(igridsec.le.0)then
144  gridnote = ''
145  gridnote2 = ''
146  else
147  write(gridnote,10)igridsec
148  write(gridnote2,11)igridsec
149  endif
150  10 format('(',i0,' sec)')
151  11 format(i0,'.')
152 
153 c ----------------------------------------------------
154 c - FAILSAFES: END
155 c ----------------------------------------------------
156 
157 
158 c ----------------------------------------------
159 c - GMT COMMANDS: BEGIN
160 c ----------------------------------------------
161 
162 c - Header of commands/echoes:
163  write(99,991)ele,extra,trim(units),trim(region),trim(fn(ij)),
164  *ele,extra,trim(units),trim(region),trim(fn(ij))
165 
166 c - Plot the actual vectors, and the title, with PSXY command
167  write(99,903)trim(fname),bw(ij),be(ij),bs(ij),bn(ij),
168  *jm(ij),b1(ij),b2(ij),trim(newdtm),trim(olddtm),elecap,
169  *extra,trim(gridnote),trim(region),trim(fn(ij)),fname(2:5)
170 
171 
172 
173 c - Plot the reference vector
174  write(99,908)xvlon,xvlat,90.d0,lorvopc
175 c write(99,908)xvlon,xvlat,90.d0,q1
176 
177 c - Label the reference vector
178 c - HACK
179 c write(6,807)trim(fname),trim(units)
180 c 807 format('File: ',a,/,'Units: ',a)
181  if (trim(units).eq.'arcseconds')then
182  write(99,1909)xllon,xllat,lorvog,trim(units)
183  elseif(trim(units).eq.'meters')then
184  write(99, 909)xllon,xllat,lorvog,trim(units)
185  endif
186 
187 c - ALWAYS plot the coast last, as it closes the PS file
188  call plotcoast(region,99)
189 
190 c - Convert PS to JPG
191  write(99,905)
192 
193 c - Rename the JPG to my naming scheme
194 c write(99,906)trim(fname),trim(gridnote2),trim(fn(ij))
195  write(99,906)trim(fname),trim(fn(ij))
196 
197 c ----------------------------------------------
198 c - GMT COMMANDS: END
199 c ----------------------------------------------
200 
201  991 format(
202  *'# -----------------------------------------------------',/,
203  *'# vectors in ',a,a,1x,a,1x,a,1x,a,/,
204  *'# -----------------------------------------------------',/,
205  *'echo ...vectors in ',a,a,1x,a,1x,a,1x,a)
206 
207 c - Plot the actual vectors
208 c - 2016 08 29
209  903 format('psxy ',a,' -Xc -R',f0.6,'/',f0.6,'/',sp,f0.6,'/',f0.6,
210  * ss,' -JM',f3.1,'i -B',f0.6,'/',f0.6,':."',
211  * 'NADCON v5.0 ',a,' minus ',a,' ',a3,a5,a,
212  * 1x,a,'-',a,1x,a,
213  *'": -SV0.0001i/0.02i/0.02i ',
214  * '-Gblack -K > plot.ps')
215 c - 2016 08 25:
216 c 903 format('psxy ',a,' -Xc -R',f0.2,'/',f0.2,'/',sp,f0.2,'/',f0.2,
217 c * ss,' -JM',f3.1,'i -B',f0.2,'/',f0.2,':."',
218 c * 'NADCON v5.0 ',a,' minus ',a,' ',a3,a5,a,
219 c * 1x,a,'-',a,1x,a,
220 c *'": -SV0.0001i/0.02i/0.02i ',
221 c * '-Gblack -K > plot.ps')
222 
223 c 903 format('psxy ',a,' -R',f0.2,'/',f0.2,'/',sp,f0.2,'/',f0.2,
224 c * ss,' -JM',f3.1,'i -B',f0.2,'/',f0.2,':."',
225 c * 'NADCON v5.0 ',a,' minus ',a,' ',a3,a5,a,
226 c * 1x,a,'-',a,1x,a,
227 c *'": -SV0.0001i/0.02i/0.02i ',
228 c * '-Gblack -K > plot.ps')
229 c 903 format('psxy ',a,' -R',f0.2,'/',f0.2,'/',sp,f0.2,'/',f0.2,
230 c * ss,' -JM',f3.1,'i+ -B',f0.2,'/',f0.2,':."',
231 c * 'NADCON v5.0 ',a,' minus ',a,' ',a3,a5,a,
232 c * 1x,a,'-',a,1x,a,
233 c *'": -SV0.0001i/0.02i/0.02i ',
234 c * '-Gblack -K > plot.ps')
235 
236 c - 908 = Plot a REFERENCE vector
237 c - 2016 08 29: More decimal places
238  908 format('psxy -SV0.0001i/0.02i/0.02i -N -R -O -K -JM',
239  * ' -Gred >> plot.ps << !',/,
240  * f10.6,1x,f10.6,1x,f5.1,1x,f9.1,/,
241  * '!')
242 c - 2016 07 29: Make reference vector appear outside of map
243 c 908 format('psxy -SV0.0001i/0.02i/0.02i -N -R -O -K -JM',
244 c * ' -Gred >> plot.ps << !',/,
245 c * f6.2,1x,f6.2,1x,f5.1,1x,f9.1,/,
246 c * '!')
247 c 908 format('psxy -SV0.0001i/0.02i/0.02i -R -O -K -JM',
248 c * ' -Gred >> plot.ps << !',/,
249 c * f6.2,1x,f6.2,1x,f5.1,1x,f9.1,/,
250 c * '!')
251 
252 c - 909 = Label the REFERENCE vector
253 c - 2016 08 29: More decimal places
254  909 format('pstext -N -O -K -R -JM -Gred >> plot.ps << !',/,
255  * f10.6,1x,f10.6,1x,'12 0 1 TL ',f10.3,1x,a,/,
256  * '!')
257 c - 2016 07 29: Use -N to plot it outside
258 c 909 format('pstext -N -O -K -R -JM -Gred >> plot.ps << !',/,
259 c * f6.2,1x,f6.2,1x,'12 0 1 TL ',f10.3,1x,a,/,
260 c * '!')
261 c - 2016 08 29: More decimal places
262  1909 format('pstext -N -O -K -R -JM -Gred >> plot.ps << !',/,
263  * f10.6,1x,f10.6,1x,'12 0 1 TL ',f10.6,1x,a,/,
264  * '!')
265 c1909 format('pstext -N -O -K -R -JM -Gred >> plot.ps << !',/,
266 c * f6.2,1x,f6.2,1x,'12 0 1 TL ',f10.6,1x,a,/,
267 c * '!')
268 c 909 format('pstext -O -K -R -JM -Gred >> plot.ps << !',/,
269 c * f6.2,1x,f6.2,1x,'12 0 1 TL ',f10.3,1x,a,/,
270 c * '!')
271 c1909 format('pstext -O -K -R -JM -Gred >> plot.ps << !',/,
272 c * f6.2,1x,f6.2,1x,'12 0 1 TL ',f10.6,1x,a,/,
273 c * '!')
274 
275 c 909 format('pstext -O -K -R -JM -Gred >> plot.ps << !',/,
276 c * f6.2,1x,f6.2,1x,'12 0 1 TL ',i6,' cm',/,
277 c * '!')
278 
279 c - 905 = Convert PS to JPG
280  905 format('ps2raster plot.ps -Tj -P -A ')
281 
282 c - Rename to our naming scheme
283 c 906 format('mv -f plot.jpg ',a,
284 c *'.',a,a,'.jpg',/,'rm -f plot.ps')
285  906 format('mv -f plot.jpg ',a,
286  *'.',a,'.jpg',/,'rm -f plot.ps')
287 
288  return
289  end
subroutine bwplotvc(ele, fname, bw, be, bs, bn, jm, b1, b2, maxplots, olddtm, newdtm, region, elecap, ij, xvlon, xvlat, xllon, xllat, lorvog, lorvopc, igridsec, fn)
Subroutine to make GMT calls to do a B/W vector plot.
Definition: bwplotvc.f:37
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