NADCON5-ng  0.0.2
NADCON5 Next Generation Documentation
makeplotfiles01.f
Go to the documentation of this file.
1 c> \ingroup doers
2 c> \if MANPAGE
3 c> \page makeplotfiles01
4 c> \endif
5 c>
6 c> Part of the NADCON5 process, generates gmtbat01
7 c>
8 c> Program to take a "work" file and create
9 c> a variety of GMT-ready data files of the following
10 c> 1. Coverage in latitude
11 c> 2. Coverage in longitude
12 c> 3. Coverage in ellipsoid height
13 c> 4. Vectors in latitude
14 c> 5. Vectors in longitude
15 c> 6. Vectors in ellipdoid height
16 c> 7. Vectors in horizontal (properly azimuthed)
17 c>
18 c> It furthermore will create batch file to run the
19 c> GMT scripts:
20 c>
21 c> gmtbat01.(olddtm).(newdtm).(region).(mapflag)
22 c>
23 c> ### Program arguments
24 c> Arguments are newline terminated and read from standard input
25 c>
26 c> They are enumerated here
27 c> \param oldtm Source Datum
28 c> \param newdtm Target Datum,region
29 c> \param region Conversion Region
30 c> \param mapflag Map Detail Level
31 c>
32 c> Example:
33 c>
34 c> olddatum = 'ussd'
35 c> newdatum = 'nad27'
36 c> region = 'conus'
37 c> mapflag = 0
38 c>
39 c> ### Program Inputs:
40 c>
41 c> ## Changelog
42 c>
43 c> ### 2016 08 26
44 c> Added new code to do reference vectors consistently
45 c> See DRU-12, p. 56-57
46 c> Also changing the call to "getmapbounds" to give it "olddatum" and "newdatum"
47 c> to aide in filtering out things like the Saint regions in Alaska
48 c> for unsupported transformations.
49 c>
50 c> ### 2016 07 29:
51 c> Scrapped the code for personalized reference vector location. Just put
52 c> all ref vectors outside/below plot.
53 c>
54 c> ### 2016 07 21:
55 c> Added code to allow for optional placement of reference vectors, coming from
56 c> "map.parameters" as read in subroutine "getmapbounds"
57 c>
59  implicit double precision(a-h,o-z)
60  parameter(maxplots=60)
61 
62 c - Stuff that is in the work file records:
63  character*6 pid
64  character*2 state
65  character*1 rejlat,rejlon,rejeht
66  real*8 xlath,xlonh,xehth
67  real*8 dlatsec,dlonsec,dehtm,dhorsec,azhor
68  real*8 dlatm,dlonm,dhorm
69  character*10 olddtm,newdtm,region
70 
71 c - Input work file:
72  character*200 wfname
73 
74 c - Plot/Scale stuff
75  real*8 lorvopc
76  real*8 lorvoghorm,lorvoghors
77  real*8 lorvogehtm
78 
79 c - Output GMT-ready files:
80 c - Coverage, All, Coordinate Differences
81  character*200 gfncvacdlat
82  character*200 gfncvacdlon
83  character*200 gfncvacdeht
84 
85 c - Vectors, All, Coordinate Differences, Meters
86  character*200 gfnvmacdlat
87  character*200 gfnvmacdlon
88  character*200 gfnvmacdeht
89  character*200 gfnvmacdhor
90 
91 c - Vectors, All, Coordinate Differences, ArcSeconds
92  character*200 gfnvsacdlat
93  character*200 gfnvsacdlon
94  character*200 gfnvsacdhor
95 
96 c - GMT stuff
97  real*8 bw(maxplots),be(maxplots),bs(maxplots),bn(maxplots)
98  real*4 jm(maxplots)
99  real*4 b1(maxplots),b2(maxplots)
100  character*10 fn(maxplots)
101 c - 2016 07 21:
102  logical lrv(maxplots)
103  real*8 rv0x(maxplots),rv0y(maxplots),rl0y(maxplots)
104 
105 c - Output GMT-batch file:
106  character*200 gmtfile
107 
108  character*1 mapflag
109  character*200 suffix1,suffix4
110 
111 c ------------------------------------------------------------------
112 c - BEGIN PROGRAM
113 c ------------------------------------------------------------------
114  write(6,1001)
115  1001 format('BEGIN makeplotfiles01.f')
116 
117 c--------------------------------------------
118 c - Some necessary constants
119 c
120 c - "lorvopc" = Length of Reference Vector on Paper in **CM**
121 c - *** CRITICAL: The units of centimeters align with
122 c - the use, in .gmtdefaults4, of:
123 c - MEASURE_UNIT = cm
124 c - If you change that value, then the units of lorvopc
125 c - will be whatever you change it too, which may prove
126 c - displeasing.
127 c -
128 c--------------------------------------------
129  lorvopc = 1.d0
130  pi = 2.d0*dasin(1.d0)
131  d2r = pi/180.d0
132  re = 6371000.d0
133 
134  multiplierlorvog = 2
135 
136 c--------------------------------------------
137 c - User-supplied input
138 c--------------------------------------------
139  read(5,'(a)')olddtm
140  read(5,'(a)')newdtm
141  read(5,'(a)')region
142  read(5,'(a)')mapflag
143 
144 c ------------------------------------------------------------------
145 c - Generate the suffixes used in all our files
146 c ------------------------------------------------------------------
147  suffix1=trim(olddtm)//'.'//trim(newdtm)//'.'//trim(region)
148  suffix4=trim(suffix1)//'.'//trim(mapflag)
149 
150 c ------------------------------------------------------------------
151 c - Create and open the work file
152 c ------------------------------------------------------------------
153  wfname='work.'//trim(suffix1)
154  open(1,file='Work/'//wfname,status='old',form='formatted')
155  write(6,1004)trim(wfname)
156  1004 format(6x,'makeplotfiles01.f: Opening work file ',a)
157 
158 c ------------------------------------------------------------------
159 c - Open the GMT batch file for plotting
160 c ------------------------------------------------------------------
161  gmtfile = 'gmtbat01.'//trim(suffix4)
162  open(99,file=gmtfile,status='new',form='formatted')
163  write(6,1011)trim(gmtfile)
164  1011 format(6x,'makeplotfiles01.f: Creating GMT batch file ',a)
165  write(99,1030)trim(gmtfile)
166  1030 format('echo BEGIN batch file ',a)
167 
168 
169 c ------------------------------------------------------------------
170 c - Open the output GMT-ready files
171 c ------------------------------------------------------------------
172  gfncvacdlat = 'cvacdlat.'//trim(suffix1)
173  open(11,file=gfncvacdlat,status='new',form='formatted')
174  write(6,1010)trim(gfncvacdlat)
175 
176  gfncvacdlon = 'cvacdlon.'//trim(suffix1)
177  open(12,file=gfncvacdlon,status='new',form='formatted')
178  write(6,1010)trim(gfncvacdlon)
179 
180  gfncvacdeht = 'cvacdeht.'//trim(suffix1)
181  open(13,file=gfncvacdeht,status='new',form='formatted')
182  write(6,1010)trim(gfncvacdeht)
183 
184 c - Vectors, Meters, All, Coordinate Differences
185  gfnvmacdlat = 'vmacdlat.'//trim(suffix1)
186  open(21,file=gfnvmacdlat,status='new',form='formatted')
187  write(6,1010)trim(gfnvmacdlat)
188 
189  gfnvmacdlon = 'vmacdlon.'//trim(suffix1)
190  open(22,file=gfnvmacdlon,status='new',form='formatted')
191  write(6,1010)trim(gfnvmacdlon)
192 
193  gfnvmacdeht = 'vmacdeht.'//trim(suffix1)
194  open(23,file=gfnvmacdeht,status='new',form='formatted')
195  write(6,1010)trim(gfnvmacdeht)
196 
197  gfnvmacdhor = 'vmacdhor.'//trim(suffix1)
198  open(24,file=gfnvmacdhor,status='new',form='formatted')
199  write(6,1010)trim(gfnvmacdhor)
200 
201 c - Vectors, ArcSeconds, All, Coordinate Differences
202  gfnvsacdlat = 'vsacdlat.'//trim(suffix1)
203  open(31,file=gfnvsacdlat,status='new',form='formatted')
204  write(6,1010)trim(gfnvsacdlat)
205 
206  gfnvsacdlon = 'vsacdlon.'//trim(suffix1)
207  open(32,file=gfnvsacdlon,status='new',form='formatted')
208  write(6,1010)trim(gfnvsacdlon)
209 
210  gfnvsacdhor = 'vsacdhor.'//trim(suffix1)
211  open(34,file=gfnvsacdhor,status='new',form='formatted')
212  write(6,1010)trim(gfnvsacdhor)
213 
214  1010 format(6x,'makeplotfiles01.f: Creating file ',a)
215 
216 c - LAZY CODING: Spin through work file, collecting stats
217 c - which we will use to scale the map and vectors, etc.
218 c - Then rewind the work file.
219 c - If I wasn't lazy, this would be a RAM-read, etc etc
220  ndhor = 0
221  ndeht = 0
222  avedhorm = 0.d0
223  avedhors = 0.d0
224  avedehtm = 0.d0
225 
226  891 read(1,104,end=892)pid,state,rejlat,rejlon,rejeht,
227  *xlath,xlonh,xehth,
228  *dlatsec,dlonsec,dehtm,dhorsec,azhor,dlatm,dlonm,dhorm,
229  *olddtm,newdtm
230  if(rejlat.eq.' ' .and. rejlon.eq.' ')then
231  avedhorm = avedhorm + dhorm
232  avedhors = avedhors + dhorsec
233  ndhor = ndhor + 1
234  endif
235  if(rejeht.eq.' ')then
236 c - Because they can be +/-, we and this is JUST for scaling the map,
237 c - we want the average MAGNITUDE...use ABS. This means that
238 c - I don't need to accept my own latter advice of returning
239 c - here and using RMS.
240  avedehtm = avedehtm + dabs(dehtm)
241  ndeht = ndeht + 1
242  endif
243  goto 891
244  892 continue
245  if(ndhor.gt.0)then
246  avedhorm = avedhorm / dble(ndhor)
247  avedhors = avedhors / dble(ndhor)
248  else
249  avedhorm = 0.d0
250  avedhors = 0.d0
251  endif
252  if(ndeht.gt.0)then
253  avedehtm = avedehtm / dble(ndeht)
254  else
255  avedehtm = 0.d0
256  endif
257  write(6,893)ndhor,avedhorm,avedhors,ndeht,avedehtm
258  893 format(6x,'makeplotfiles01.f: Vector Stats: ',/,
259  *10x,'Number of Good Horizontal Vectors : ',i10,/,
260  *10x,'Average length (meters) : ',f10.3,/,
261  *10x,'Average length (arcseconds) : ',f10.6,/,
262  *10x,'Number of Good Ell. Ht. Vectors : ',i10,/,
263  *10x,'Average length (meters) : ',f10.3)
264 
265 c - END OF LAZY CODING
266 
267 
268 c --------------------------------------------------------------
269 c - GMT Batch file: Determine Number of areas to plot (=nplots)
270 c - and Boundaries of plots and other stuff
271 c --------------------------------------------------------------
272 c - 2016 08 29:
273  call getmapbounds(mapflag,maxplots,region,nplots,
274  *olddtm,newdtm,
275  *bw,be,bs,bn,jm,b1,b2,fn,lrv,rv0x,rv0y,rl0y)
276 
277 c - 2016 08 26, DRU-12, p.56-57
278 c call getmapbounds(mapflag,maxplots,region,nplots,
279 c *bw,be,bs,bn,jm,b1,b2,fn,lrv,rv0x,rv0y,rl0y)
280 c - See DRU-11, p. 126 for choices on grid boundaries for NADCON v5.0
281 c - 2016 07 21:
282 c call getmapbounds(mapflag,maxplots,region,nplots,
283 c *bw,be,bs,bn,jm,b1,b2,fn,lrv,rv0x,rv0y)
284 c call getmapbounds(mapflag,maxplots,region,nplots,
285 c *bw,be,bs,bn,jm,b1,b2,fn)
286  write(6,1006)trim(region)
287  1006 format(6x,'makeplotfiles01.f: Calling getmapbounds for region ',a)
288 
289 c ---------------------------------------------------------------
290 c - Compute and report various things about our coverage
291 c - and vector plots.
292 c ---------------------------------------------------------------
293 c - Reference vector set to length of the average
294 c - absolute value of horizontal or ell ht shift.
295 
296 c - I keep flip-flopping about whether it's more visually
297 c - pleasing to use the average or twice the average.
298 
299 c - As of 2015 10 22, I go with "twice the average"
300 c - Thus: MultiplierLorvog = 2
301 
302 c - Note "gm2pc" = "ground meters to paper centimeters"
303 c - "gs2pc" = "ground arcseconds to paper centimeters"
304 c - "lorvog*s" = "length of reference vector on ground (element) in arcseconds"
305 c - "lorvog*m" = "length of reference vector on ground (element) in meters"
306 
307  if(ndhor.ne.0)then
308 c iqhorm = floor(log10(avedhorm))
309 c qqhorm = 10.d0**(iqhorm-1)
310 c lorvoghorm = MultiplierLorvog*qqhorm*nint(avedhorm/qqhorm)
311  lorvoghorm = onzd2(multiplierlorvog*avedhorm)
312  gm2pchor = lorvopc / lorvoghorm
313 
314 c iqhors = floor(log10(avedhors))
315 c qqhors = 10.d0**(iqhors-1)
316 c lorvoghors = MultiplierLorvog*qqhors*nint(avedhors/qqhors)
317  lorvoghors = onzd2(multiplierlorvog*avedhors)
318  gs2pchor = lorvopc / lorvoghors
319  endif
320 
321  if(ndeht.ne.0)then
322 c iqehtm = floor(log10(avedehtm))
323 c qqehtm = 10.d0**(iqehtm-1)
324 c lorvogehtm = MultiplierLorvog*qqehtm*nint(avedehtm/qqehtm)
325  lorvogehtm = onzd2(multiplierlorvog*avedehtm)
326  gm2pceht = lorvopc / lorvogehtm
327  endif
328 
329  write(6,894)nplots
330  894 format(6x,'makeplotfiles01.f: Info about plots:',/,
331  *8x,'Number of sub-region plot sets ',
332  *'being made for this region: ',i2)
333 
334  do 895 i=1,nplots
335  dns = bn(i) - bs(i)
336  dew = be(i) - bw(i)
337  write(6,896)i,region,fn(i),
338  * bs(i),bn(i),bw(i),be(i),dns,dew
339  if(ndhor.ne.0)then
340  write(6,897)lorvoghorm,lorvoghors,gm2pchor,gs2pchor
341  else
342  write(6,898)
343  endif
344 
345  if(ndeht.ne.0)then
346  write(6,899)lorvogehtm,gm2pceht
347  else
348  write(6,900)
349  endif
350 
351  895 continue
352 
353  896 format(50('-'),/,
354  *8x,'Plot # ',i2,
355  *'(',a,1x,a,')',/,
356  *10x,'S/N/W/E/N-S/E-W = ',6f7.1)
357  897 format(
358  *10x,'Lat/Lon/Hor plots: ',/,
359  *12x,'Reference Vector ( m) = ',f10.2,/,
360  *12x,'Reference Vector ( s) = ',f10.6,/,
361  *12x,'Ground M to Paper cm = ',f20.10,/,
362  *12x,'Ground S to Paper cm = ',f20.10)
363  898 format(
364  *10x,'Lat/Lon/Hor plots: ',/,
365  *12x,'No horizontal data available for plotting')
366  899 format(
367  *10x,'Ell. Height plots: ',/,
368  *12x,'Reference Vector ( m) = ',f10.2,/,
369  *12x,'Ground M to Paper cm = ',f20.10)
370  900 format(
371  *10x,'Ell. Height plots: ',/,
372  *12x,'No ellipsoid height data available for plotting')
373 
374 c - pvlon and pvlat are the percentage of the total lon/lat
375 c - span of the plot, from which the reference vector
376 c - begins, starting with the Lower Left corner
377  pvlon = 10.d0
378  pvlat = 10.d0
379 
380  pvlat = (pvlat / 100.d0)
381  pvlon = (pvlon / 100.d0)
382 
383 c --------------------------------------------------------------
384 c --------------------------------------------------------------
385 c --------------------------------------------------------------
386 c - MAIN LOOP: TOP
387 c --------------------------------------------------------------
388 c --------------------------------------------------------------
389 c --------------------------------------------------------------
390 c - Read in each record and produce GMT-ready data for
391 c - all appropriate non-rejected records.
392 
393  rewind(1)
394 
395  n=0
396  ncvlat = 0
397  ncvlon = 0
398  ncveht = 0
399  nvclat = 0
400  nvclon = 0
401  nvceht = 0
402  nvchor = 0
403 
404  1 read(1,104,end=2)pid,state,rejlat,rejlon,rejeht,xlath,xlonh,xehth,
405  *dlatsec,dlonsec,dehtm,dhorsec,azhor,dlatm,dlonm,dhorm,
406  *olddtm,newdtm
407 
408  104 format(a6,1x,a2,a1,a1,a1,1x,f14.10,1x,f14.10,1x,f8.3,1x,
409  *f9.5,1x,f9.5,1x,f9.3,1x,f9.5,1x,f9.5,1x,f9.3,1x,f9.3,1x,f9.3,
410  *1x,a10,1x,a10)
411 
412 
413 c - Experiment
414  105 format(f16.10,1x,f15.10,1x,f6.2,1x,f12.2,1x,f5.1)
415  1105 format(f16.10,1x,f15.10,1x,f6.2,1x,a6)
416 
417 c1106 format(f16.10,1x,f15.10,1x,f6.2,1x,f12.2,1x,f5.1,1x,f9.5,1x,a6)
418  1106 format(f16.10,1x,f15.10,1x,f6.2,1x,f12.2,1x,f9.5,1x,f9.3,1x,a6)
419 
420 c---------------------------------------------------------------------
421 c - If it's a good latitude point, write to:
422 c 11) Latitude Coverage File
423 c 21) Latitude Vector (meters) File
424 c 31) Latitude Vector (seconds) File
425  if(rejlat.eq.' ')then
426  if(dlatm.le.0)then
427  az = 180.d0
428  else
429  az = 0.d0
430  endif
431  vclatm = dabs(dlatm *gm2pchor)
432  vclats = dabs(dlatsec*gs2pchor)
433  write(11,1105)xlonh,xlath,sngl(1.0),pid
434  write(21,1106)xlonh,xlath,az,vclatm,dlatsec,dlatm,pid
435  write(31,1106)xlonh,xlath,az,vclats,dlatsec,dlatm,pid
436  ncvlat = ncvlat + 1
437  nvclat = nvclat + 1
438  endif
439 c---------------------------------------------------------------------
440 c - If it's a good longitude point, write to:
441 c 12) Longitude Coverage File
442 c 22) Longitude Vector (meters) File
443 c 32) Longitude Vector (seconds) File
444  if(rejlon.eq.' ')then
445  if(dlonm.le.0)then
446  az = 270.d0
447  else
448  az = 90.d0
449  endif
450  vclonm = dabs(dlonm *gm2pchor)
451  vclons = dabs(dlonsec*gs2pchor)
452  write(12,1105)xlonh,xlath,sngl(1.0),pid
453  write(22,1106)xlonh,xlath,az,vclonm,dlonsec,dlonm,pid
454  write(32,1106)xlonh,xlath,az,vclons,dlonsec,dlonm,pid
455 
456  ncvlon = ncvlon + 1
457  nvclon = nvclon + 1
458  endif
459 c---------------------------------------------------------------------
460 c - If it's a good ell ht point, write to:
461 c 13) Ell Ht Coverage File
462 c 23) Ell Ht Vector (meters) File
463  if(rejeht.eq.' ')then
464  if(dehtm.le.0)then
465  az = 180.d0
466  else
467  az = 0.d0
468  endif
469  vcehtm = dabs(dehtm*gm2pceht)
470  write(13,1105)xlonh,xlath,sngl(1.0),pid
471  write(23,1106)xlonh,xlath,az,vcehtm,0.d0,dehtm,pid
472 
473  ncveht = ncveht + 1
474  nvceht = nvceht + 1
475  endif
476 c---------------------------------------------------------------------
477 c - If it's a good latitude *and* good longitude point, write to:
478 c 24) Horizontal Vector (meters) File
479 c 34) Horizontal Vector (seconds) File
480  if(rejlat.eq.' ' .and. rejlon.eq.' ')then
481 c - No need for "dabs", since its already applied
482  vchorm = dhorm *gm2pchor
483  vchors = dhorsec*gs2pchor
484  write(24,1106)xlonh,xlath,azhor,vchorm,dhorsec,dhorm,pid
485  write(34,1106)xlonh,xlath,azhor,vchors,dhorsec,dhorm,pid
486 
487  nvchor = nvchor + 1
488  endif
489 
490 c - Count total number of points read in the work file
491  n=n+1
492 
493 
494  goto 1
495 
496 c --------------------------------------------------------------
497 c --------------------------------------------------------------
498 c --------------------------------------------------------------
499 c - MAIN LOOP: BOTTOM
500 c --------------------------------------------------------------
501 c --------------------------------------------------------------
502 c --------------------------------------------------------------
503 
504  2 continue
505 
506  write(6,778)n,ncvlat,ncvlon,ncveht,nvclat,nvclon,nvceht,nvchor
507 
508  778 format(6x,'makeplotfiles01.f: Statistics: ',/,
509  *10x,'Number of total records read : ',i10,/,
510  *10x,'Number of lat coverage records prepared: ',i10,/,
511  *10x,'Number of lon coverage records prepared: ',i10,/,
512  *10x,'Number of eht coverage records prepared: ',i10,/,
513  *10x,'Number of lat vector records prepared: ',i10,/,
514  *10x,'Number of lon vector records prepared: ',i10,/,
515  *10x,'Number of eht vector records prepared: ',i10,/,
516  *10x,'Number of hor vector records prepared: ',i10)
517 
518 c --------------------------------------------------------------
519 c --------------------------------------------------------------
520 c --------------------------------------------------------------
521 c - CREATE GMT BATCH FILE
522 c - There are multiple steps here:
523 c - 1) Determine how many maps to make (for example, for
524 c CONUS its a little easier to look at things when
525 c broken down into a 3x3 tile over CONUS, rather than
526 c one large plot)
527 c - 2) Determine the boundaries of each map to be created
528 c - 3) Determine which shoreline (GMT-provided, or Dru's
529 c personally created detailed shorelines of certain
530 c areas)
531 c - 4) The title of each plot
532 c - 5) The size of each plot
533 c - 6) The file name to use for each plot
534 c -
535 c - As each decision is made, make the right calls to the batch
536 c - file.
537 c --------------------------------------------------------------
538 c --------------------------------------------------------------
539 c --------------------------------------------------------------
540  write(6,800)
541  800 format(6x,'makeplotfiles01.f: Preparing GMT batch file')
542 
543 c --------------------------------------------------------------
544 c - GMT Batch file: Make header
545 c --------------------------------------------------------------
546  write(6,801)
547  801 format(6x,'makeplotfiles01.f: GMT: Write header')
548 
549  write(99,901)
550  901 format('gmtset GRID_PEN_PRIMARY 0.25p,-')
551  write(99,902)
552 c 902 format('gmtset BASEMAP_TYPE fancy')
553  902 format('gmtset BASEMAP_TYPE fancy',/,
554  *'gmtset HEADER_FONT Helvetica',/,
555  *'gmtset HEADER_FONT_SIZE 12p',/,
556  *'gmtset HEADER_OFFSET 0.5c')
557 
558 
559  write(6,802)
560  802 format(6x,'makeplotfiles01.f: GMT: Num Plots Analysis')
561  write(6,1005)trim(region)
562  1005 format(6x,'makeplotfiles01.f: REGION = ',a)
563 
564 
565 c --------------------------------------------------------------
566 c --------------------------------------------------------------
567 c --------------------------------------------------------------
568 c - GMT Batch creation loop TOP
569 c --------------------------------------------------------------
570 c --------------------------------------------------------------
571 c --------------------------------------------------------------
572 c - For each "ij" value, we will put GMT calls into batch
573 c - file "gmtbat01***" (unit 99) which will plot the following:
574 c - 1) Coverage in LAT
575 c - 2) Coverage in LON
576 c - 3) Coverage in EHT
577 c - 4) Vectors in LAT, meters
578 c - 5) Vectors in LON, meters
579 c - 6) Vectors in EHT, meters
580 c - 7) Vectors in HOR, meters
581 c - 8) Vectors in LAT, arcseconds
582 c - 9) Vectors in LON, arcseconds
583 c - 10) Vectors in HOR, arcseconds
584 c --------------------------------------------------------------
585 c
586 c - Note on "igridsec": Later in the NADCON5 processing,
587 c - "igridsec" will mean the number of arcseconds at which
588 c - thinnging and gridding occur. At this point, though,
589 c - it has not meaning. We set it to "-1" to tell the
590 c - plotting programs to ignore it.
591 
592 
593  igridsec = -1
594 
595  do 2001 ij=1,nplots
596  write(99,990)trim(region),trim(fn(ij)),
597  * trim(region),trim(fn(ij))
598 
599 c--------------------------------------
600 c - B/W COVERAGE PLOTS
601 c--------------------------------------
602 c - Make B/W Coverage Plots
603 c - Latitude
604  call bwplotcv('lat',gfncvacdlat,bw,be,bs,bn,jm,
605  * b1,b2,maxplots,olddtm,newdtm,region,'LAT',ij,
606  * igridsec,fn)
607 c - Longitude
608  call bwplotcv('lon',gfncvacdlon,bw,be,bs,bn,jm,
609  * b1,b2,maxplots,olddtm,newdtm,region,'LON',ij,
610  * igridsec,fn)
611 c - Ellipsoid Height
612  call bwplotcv('eht',gfncvacdeht,bw,be,bs,bn,jm,
613  * b1,b2,maxplots,olddtm,newdtm,region,'EHT',ij,
614  * igridsec,fn)
615 
616 c--------------------------------------
617 c - VECTORS
618 c--------------------------------------
619 c - Where is the start of the reference vector:
620 c - 2016 07 29: Decided to scrap personalized locations
621 c - and just put all reference vectors outside/below
622 c - the plots
623 
624 c - 2016 08 26
625  xvlon = rv0x(ij)
626  xvlat = rv0y(ij)
627 
628  xllon = xvlon
629  xllat = rl0y(ij)
630 
631 c - 2016 07 21:
632 c if(lrv(ij))then
633 c xvlon = rv0x(ij)
634 c xvlat = rv0y(ij)
635 c else
636 cccc xvlon = bw(ij) + (pvlon*(be(ij)-bw(ij)))
637 c xvlat = bs(ij) + (pvlat*(bn(ij)-bs(ij)))
638 cccc xvlat = bs(ij) - (pvlat*(bn(ij)-bs(ij)))
639 c endif
640 c - Where is the start of the label for the ref vector:
641 cccc xllon = xvlon
642 c - To prevent the label from going off the page on
643 c - plots that have very little N/S span, put in a
644 c - failsafe
645 c - 2016 07 21:
646 c if(lrv(ij))then
647 c xllat = xvlat - 0.1d0
648 c else
649 cccc if(bn(ij)-bs(ij).lt.2.0)then
650 c xllat = bs(ij) + ((pvlat*0.75d0)*(bn(ij)-bs(ij)))
651 cccc xllat = bs(ij) - ((pvlat*1.25d0)*(bn(ij)-bs(ij)))
652 cccc else
653 c xllat = bs(ij) + (pvlat*(bn(ij)-bs(ij))) - 0.1d0
654 cccc xllat = bs(ij) - (pvlat*(bn(ij)-bs(ij))) - 0.1d0
655 cccc endif
656 c endif
657 
658 c - Vectors in LAT
659  call bwplotvc('lat',gfnvmacdlat,bw,be,bs,bn,jm,b1,b2,maxplots,
660  * olddtm,newdtm,region,'LAT',ij,xvlon,xvlat,xllon,xllat,
661  * lorvoghorm,lorvopc,igridsec,fn)
662  call bwplotvc('lat',gfnvsacdlat,bw,be,bs,bn,jm,b1,b2,maxplots,
663  * olddtm,newdtm,region,'LAT',ij,xvlon,xvlat,xllon,xllat,
664  * lorvoghors,lorvopc,igridsec,fn)
665 c call bwplotvc('lat',gfnvmacdlat,bw,be,bs,bn,jm,b1,b2,maxplots,
666 c * olddtm,newdtm,region,'LAT',ij,xvlon,xvlat,xllon,xllat,ncmhor,
667 c * q1hor,igridsec,fn)
668 c call bwplotvc('lat',gfnvsacdlat,bw,be,bs,bn,jm,b1,b2,maxplots,
669 c * olddtm,newdtm,region,'LAT',ij,xvlon,xvlat,xllon,xllat,ncmhor,
670 c * q1hor,igridsec,fn)
671 
672 
673 c - Vectors in LON
674  call bwplotvc('lon',gfnvmacdlon,bw,be,bs,bn,jm,b1,b2,maxplots,
675  * olddtm,newdtm,region,'LON',ij,xvlon,xvlat,xllon,xllat,
676  * lorvoghorm,lorvopc,igridsec,fn)
677  call bwplotvc('lon',gfnvsacdlon,bw,be,bs,bn,jm,b1,b2,maxplots,
678  * olddtm,newdtm,region,'LON',ij,xvlon,xvlat,xllon,xllat,
679  * lorvoghors,lorvopc,igridsec,fn)
680 c call bwplotvc('lon',gfnvmacdlon,bw,be,bs,bn,jm,b1,b2,maxplots,
681 c * olddtm,newdtm,region,'LON',ij,xvlon,xvlat,xllon,xllat,ncmhor,
682 c * q1hor,igridsec,fn)
683 c call bwplotvc('lon',gfnvsacdlon,bw,be,bs,bn,jm,b1,b2,maxplots,
684 c * olddtm,newdtm,region,'LON',ij,xvlon,xvlat,xllon,xllat,ncmhor,
685 c * q1hor,igridsec,fn)
686 
687 c - Vectors in EHT
688  call bwplotvc('eht',gfnvmacdeht,bw,be,bs,bn,jm,b1,b2,maxplots,
689  * olddtm,newdtm,region,'EHT',ij,xvlon,xvlat,xllon,xllat,
690  * lorvogehtm,lorvopc,igridsec,fn)
691 c call bwplotvc('eht',gfnvmacdeht,bw,be,bs,bn,jm,b1,b2,maxplots,
692 c * olddtm,newdtm,region,'EHT',ij,xvlon,xvlat,xllon,xllat,ncmhor,
693 c * q1hor,igridsec,fn)
694 
695 c - Vectors in HOR
696  call bwplotvc('hor',gfnvmacdhor,bw,be,bs,bn,jm,b1,b2,maxplots,
697  * olddtm,newdtm,region,'HOR',ij,xvlon,xvlat,xllon,xllat,
698  * lorvoghorm,lorvopc,igridsec,fn)
699  call bwplotvc('hor',gfnvsacdhor,bw,be,bs,bn,jm,b1,b2,maxplots,
700  * olddtm,newdtm,region,'HOR',ij,xvlon,xvlat,xllon,xllat,
701  * lorvoghors,lorvopc,igridsec,fn)
702 c call bwplotvc('hor',gfnvmacdhor,bw,be,bs,bn,jm,b1,b2,maxplots,
703 c * olddtm,newdtm,region,'HOR',ij,xvlon,xvlat,xllon,xllat,ncmhor,
704 c * q1hor,igridsec,fn)
705 c call bwplotvc('hor',gfnvsacdhor,bw,be,bs,bn,jm,b1,b2,maxplots,
706 c * olddtm,newdtm,region,'HOR',ij,xvlon,xvlat,xllon,xllat,ncmhor,
707 c * q1hor,igridsec,fn)
708 
709  2001 continue
710 
711 c --------------------------------------------------------------
712 c --------------------------------------------------------------
713 c --------------------------------------------------------------
714 c - GMT Batch creation loop BOTTOM
715 c --------------------------------------------------------------
716 c --------------------------------------------------------------
717 c --------------------------------------------------------------
718 
719  write(99,1031)trim(gmtfile)
720  1031 format('echo END batch file ',a)
721  close(99)
722 
723  write(6,9999)
724  9999 format('END makeplotfiles01.f')
725 
726 
727 
728  990 format(
729  *'# ------------------------------',/,
730  *'# Plots for region: ',a,', sub-region: ',a,/,
731  *'# ------------------------------',/,
732  *'echo Creating plots for region: ',a,', sub-region: ',a)
733 
734  end
735 c
736 c
737 c
738  include 'Subs/getmapbounds.f'
739  include 'Subs/plotcoast.f'
740  include 'Subs/bwplotcv.f'
741  include 'Subs/bwplotvc.f'
742  include 'Subs/onzd2.f'
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
real *8 function onzd2(x)
Function to round a digit to one significant figure (one non zero digit), double precision.
Definition: onzd2.f:36
subroutine getmapbounds(mapflag, maxplots, region, nplots, olddtm, newdtm, bw, be, bs, bn, jm, b1, b2, fn, lrv, rv0x, rv0y, rl0y)
Subroutine to collect up the MAP boundaries for use in creating NADCON 5.
Definition: getmapbounds.f:77
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
program makeplotfiles01
Part of the NADCON5 process, generates gmtbat01.