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