75 implicit real*8(a-h,o-z)
76 parameter(maxplots=60)
80 character*10 olddtm,newdtm,od,nd
81 character*2 state,stdum
82 character*3 ele,elelat,elelon,eleeht,elehor,ele0
86 character*200 suffix1,suffix2,suffix3,suffix2d3
87 character*200 suffix2t04
88 character*200 wfname,gmtfile
89 character*200 gfncvtcdlat,gfncvtcdlon,gfncvtcdeht
90 character*200 gfncvdcdlat,gfncvdcdlon,gfncvdcdeht
92 character*200 bfnvmtcdlat,bfnvmtcdlon,bfnvmtcdeht
93 character*200 bfnvstcdlat,bfnvstcdlon
97 character*200 sadbfnvmtcdlat,sadbfnvmtcdlon,sadbfnvmtcdeht
98 character*200 sadbfnvstcdlat,sadbfnvstcdlon
100 character*200 gfnvmtcdlat,gfnvmtcdlon,gfnvmtcdeht,gfnvmtcdhor
101 character*200 gfnvstcdlat,gfnvstcdlon, gfnvstcdhor
103 character*200 gfnvmdcdlat,gfnvmdcdlon,gfnvmdcdeht,gfnvmdcdhor
104 character*200 gfnvsdcdlat,gfnvsdcdlon, gfnvsdcdhor
107 real*8 bw(maxplots),be(maxplots),bs(maxplots),bn(maxplots)
109 real*4 b1(maxplots),b2(maxplots)
110 character*10 fn(maxplots)
112 logical lrv(maxplots)
113 real*8 rv0x(maxplots),rv0y(maxplots),rl0y(maxplots)
118 character*1 rejlat,rejlon,rejeht
119 real*8 xlath,xlonh,xehth
120 real*8 dlatsec,dlonsec,dehtm,dhorsec,azhor
121 real*8 dlatm,dlonm,dhorm
122 character*10 olddtm,newdtm,region
124 character*17 scunlat,scunlon,scuneht,scunhor
129 real*8 lorvoghorm,lorvoghors
138 1001
format(
'BEGIN program makeplotfiles02.f')
158 pi = 2.d0*dasin(1.d0)
169 read(5,
'(a)')agridsec
175 read(agridsec,*)igridsec
176 suffix1=trim(olddtm)//
'.'//trim(newdtm)//
'.'//trim(region)
178 suffix2=trim(suffix1)//
'.'//trim(agridsec)
179 suffix2t04=trim(suffix2)//
'.04' 180 suffix2d3=trim(suffix2)//
'.d3' 182 suffix3=trim(suffix2)//
'.'//trim(mapflag)
191 wfname=
'work.'//trim(suffix1)
192 open(1,file=
'Work/'//wfname,status=
'old',form=
'formatted')
193 write(6,1004)trim(wfname)
194 1004
format(6x,
'makeplotfiles02.f: Opening work file ',a)
201 891
read(1,104,end=892)pid,state,rejlat,rejlon,rejeht,
203 *dlatsec,dlonsec,dehtm,dhorsec,azhor,dlatm,dlonm,dhorm,
205 if(rejlat.eq.
' ' .and. rejlon.eq.
' ')
then 206 avedhorm = avedhorm + dhorm
207 avedhors = avedhors + dhorsec
210 if(rejeht.eq.
' ')
then 213 avedehtm = avedehtm + dabs(dehtm)
219 avedhorm = avedhorm / dble(ndhor )
220 avedhors = avedhors / dble(ndhor )
226 avedehtm = avedehtm / dble(ndeht )
230 write(6,893)ndhor ,avedhorm,avedhors,ndeht ,avedehtm
231 893
format(6x,
'makeplotfiles02.f: Vector Stats: ',/,
232 *10x,
'Number of Good Horizontal Vectors : ',i10,/,
233 *10x,
'Average length (meters) : ',f10.3,/,
234 *10x,
'Average length (arcseconds) : ',f10.6,/,
235 *10x,
'Number of Good Ell. Ht. Vectors : ',i10,/,
236 *10x,
'Average length (meters) : ',f10.3)
237 104
format(a6,1x,a2,a1,a1,a1,1x,f14.10,1x,f14.10,1x,f8.3,1x,
238 *f9.5,1x,f9.5,1x,f9.3,1x,f9.5,1x,f9.5,1x,f9.3,1x,f9.3,1x,f9.3,
254 *bw,be,bs,bn,jm,b1,b2,fn,lrv,rv0x,rv0y,rl0y)
265 write(6,1006)trim(region)
266 1006
format(6x,
'makeplotfiles02.f: Calling getmapbounds for region ',a)
284 lorvoghorm =
onzd2(multiplierlorvog*avedhorm)
285 gm2pchor = lorvopc / lorvoghorm
290 lorvoghors =
onzd2(multiplierlorvog*avedhors)
291 gs2pchor = lorvopc / lorvoghors
298 lorvogehtm =
onzd2(multiplierlorvog*avedehtm)
299 gm2pceht = lorvopc / lorvogehtm
304 894
format(6x,
'makeplotfiles02.f: Info about plots:',/,
305 *8x,
'Number of sub-region plot sets to cover this region: ',i2)
310 write(6,896)i,bs(i),bn(i),bw(i),be(i),dns,dew
312 write(6,897)lorvoghorm,lorvoghors,gm2pchor,gs2pchor
318 write(6,899)lorvogehtm,gm2pceht
327 *10x,
'S/N/W/E/N-S/E-W = ',6f7.1)
329 *10x,
'Lat/Lon/Hor plots: ',/,
330 *12x,
'Reference Vector ( m) = ',f10.2,/,
331 *12x,
'Reference Vector ( s) = ',f10.6,/,
332 *12x,
'Ground M to Paper cm = ',f20.10,/,
333 *12x,
'Ground S to Paper cm = ',f20.10)
335 *10x,
'Lat/Lon/Hor plots: ',/,
336 *12x,
'No horizontal data available for plotting')
338 *10x,
'Ell. Height plots: ',/,
339 *12x,
'Reference Vector ( m) = ',f10.2,/,
340 *12x,
'Ground M to Paper cm = ',f20.10)
342 *10x,
'Ell. Height plots: ',/,
343 *12x,
'No ellipsoid height data available for plotting')
353 pvlat = (pvlat / 100.d0)
354 pvlon = (pvlon / 100.d0)
361 gmtfile =
'gmtbat03.'//trim(suffix3)
362 open(99,file=gmtfile,status=
'new',form=
'formatted')
363 write(6,1011)trim(gmtfile)
364 1011
format(6x,
'makeplotfiles02.f: Creating GMT batch file ',a)
365 write(99,1030)trim(gmtfile)
366 1030
format(
'echo BEGIN batch file ',a)
375 bfnvmtcdlat =
'vmtcdlat.'//trim(suffix2t04)//
'.b' 376 bfnvmtcdlon =
'vmtcdlon.'//trim(suffix2t04)//
'.b' 377 bfnvmtcdeht =
'vmtcdeht.'//trim(suffix2t04)//
'.b' 378 bfnvstcdlat =
'vstcdlat.'//trim(suffix2t04)//
'.b' 379 bfnvstcdlon =
'vstcdlon.'//trim(suffix2t04)//
'.b' 381 sadbfnvmtcdlat =
'vmtcdlat.'//trim(suffix2d3)//
'.b' 382 sadbfnvmtcdlon =
'vmtcdlon.'//trim(suffix2d3)//
'.b' 383 sadbfnvmtcdeht =
'vmtcdeht.'//trim(suffix2d3)//
'.b' 384 sadbfnvstcdlat =
'vstcdlat.'//trim(suffix2d3)//
'.b' 385 sadbfnvstcdlon =
'vstcdlon.'//trim(suffix2d3)//
'.b' 387 gfnvmtcdlat =
'vmtcdlat.'//trim(suffix2)
388 gfnvmtcdlon =
'vmtcdlon.'//trim(suffix2)
389 gfnvmtcdeht =
'vmtcdeht.'//trim(suffix2)
390 gfnvmtcdhor =
'vmtcdhor.'//trim(suffix2)
391 gfnvstcdlat =
'vstcdlat.'//trim(suffix2)
392 gfnvstcdlon =
'vstcdlon.'//trim(suffix2)
393 gfnvstcdhor =
'vstcdhor.'//trim(suffix2)
395 gfncvtcdlat =
'cvtcdlat.'//trim(suffix2)
396 gfncvtcdlon =
'cvtcdlon.'//trim(suffix2)
397 gfncvtcdeht =
'cvtcdeht.'//trim(suffix2)
399 gfnvmdcdlat =
'vmdcdlat.'//trim(suffix2)
400 gfnvmdcdlon =
'vmdcdlon.'//trim(suffix2)
401 gfnvmdcdeht =
'vmdcdeht.'//trim(suffix2)
402 gfnvmdcdhor =
'vmdcdhor.'//trim(suffix2)
403 gfnvsdcdlat =
'vsdcdlat.'//trim(suffix2)
404 gfnvsdcdlon =
'vsdcdlon.'//trim(suffix2)
405 gfnvsdcdhor =
'vsdcdhor.'//trim(suffix2)
407 gfncvdcdlat =
'cvdcdlat.'//trim(suffix2)
408 gfncvdcdlon =
'cvdcdlon.'//trim(suffix2)
409 gfncvdcdeht =
'cvdcdeht.'//trim(suffix2)
418 if(nthinhor.ne.0)
then 419 write(6,1012)trim(bfnvmtcdlat)
423 write(6,1012)trim(bfnvmtcdlon)
428 write(6,1012)trim(bfnvstcdlat)
432 write(6,1012)trim(bfnvstcdlon)
438 call cpt(avelatm,stdlatm,csm,cptlolatm,cpthilatm,cptinlatm)
441 call cpt(avelonm,stdlonm,csm,cptlolonm,cpthilonm,cptinlonm)
444 call cpt(avelats,stdlats,csm,cptlolats,cpthilats,cptinlats)
447 call cpt(avelons,stdlons,csm,cptlolons,cpthilons,cptinlons)
451 if(nthineht.ne.0)
then 452 write(6,1012)trim(bfnvmtcdeht)
458 call cpt(aveehtm,stdehtm,csm,cptloehtm,cpthiehtm,cptinehtm)
467 if(nthinhor.ne.0)
then 468 write(6,1012)trim(sadbfnvmtcdlat)
469 call gridstats(sadbfnvmtcdlat,ave,std,xmd)
473 write(6,1012)trim(sadbfnvmtcdlon)
474 call gridstats(sadbfnvmtcdlon,ave,std,xmd)
479 write(6,1012)trim(sadbfnvstcdlat)
480 call gridstats(sadbfnvstcdlat,ave,std,xmd)
484 write(6,1012)trim(sadbfnvstcdlon)
485 call gridstats(sadbfnvstcdlon,ave,std,xmd)
497 call cpt2(xmdlatmsad,2.d0,
498 * cptlolatmsad,cpthilatmsad,cptinlatmsad)
508 call cpt2(xmdlonmsad,2.d0,
509 * cptlolonmsad,cpthilonmsad,cptinlonmsad)
519 call cpt2(xmdlatssad,2.d0,
520 * cptlolatssad,cpthilatssad,cptinlatssad)
530 call cpt2(xmdlonssad,2.d0,
531 * cptlolonssad,cpthilonssad,cptinlonssad)
535 if(nthineht.ne.0)
then 536 write(6,1012)trim(sadbfnvmtcdeht)
537 call gridstats(sadbfnvmtcdeht,ave,std,xmd)
548 call cpt2(xmdehtmsad,2.d0,
549 * cptloehtmsad,cpthiehtmsad,cptinehtmsad)
561 1012
format(6x,
'makeplotfiles02.f: Grabbing stats of grid: ',a)
572 write(99,990)trim(region),trim(fn(ij)),
573 * trim(region),trim(fn(ij))
581 *
call bwplotcv(
'lat',gfncvtcdlat,bw,be,bs,bn,jm,
582 * b1,b2,maxplots,olddtm,newdtm,region,
'LAT',ij,
586 *
call bwplotcv(
'lon',gfncvtcdlon,bw,be,bs,bn,jm,
587 * b1,b2,maxplots,olddtm,newdtm,region,
'LON',ij,
591 *
call bwplotcv(
'eht',gfncvtcdeht,bw,be,bs,bn,jm,
592 * b1,b2,maxplots,olddtm,newdtm,region,
'EHT',ij,
598 *
call bwplotcv(
'lat',gfncvdcdlat,bw,be,bs,bn,jm,
599 * b1,b2,maxplots,olddtm,newdtm,region,
'LAT',ij,
603 *
call bwplotcv(
'lon',gfncvdcdlon,bw,be,bs,bn,jm,
604 * b1,b2,maxplots,olddtm,newdtm,region,
'LON',ij,
608 *
call bwplotcv(
'eht',gfncvdcdeht,bw,be,bs,bn,jm,
609 * b1,b2,maxplots,olddtm,newdtm,region,
'EHT',ij,
657 if(nthinhor.ne.0)
then 658 call bwplotvc(
'lat',gfnvmtcdlat,bw,be,bs,bn,jm,b1,b2,maxplots,
659 * olddtm,newdtm,region,
'LAT',ij,xvlon,xvlat,xllon,xllat,
660 * lorvoghorm,lorvopc,igridsec,fn)
661 call bwplotvc(
'lat',gfnvstcdlat,bw,be,bs,bn,jm,b1,b2,maxplots,
662 * olddtm,newdtm,region,
'LAT',ij,xvlon,xvlat,xllon,xllat,
663 * lorvoghors,lorvopc,igridsec,fn)
666 if(nthinhor.ne.0)
then 667 call bwplotvc(
'lon',gfnvmtcdlon,bw,be,bs,bn,jm,b1,b2,maxplots,
668 * olddtm,newdtm,region,
'LON',ij,xvlon,xvlat,xllon,xllat,
669 * lorvoghorm,lorvopc,igridsec,fn)
670 call bwplotvc(
'lon',gfnvstcdlon,bw,be,bs,bn,jm,b1,b2,maxplots,
671 * olddtm,newdtm,region,
'LON',ij,xvlon,xvlat,xllon,xllat,
672 * lorvoghors,lorvopc,igridsec,fn)
675 if(nthineht.ne.0)
then 676 call bwplotvc(
'eht',gfnvmtcdeht,bw,be,bs,bn,jm,b1,b2,maxplots,
677 * olddtm,newdtm,region,
'EHT',ij,xvlon,xvlat,xllon,xllat,
678 * lorvogehtm,lorvopc,igridsec,fn)
681 if(nthinhor.ne.0)
then 682 call bwplotvc(
'hor',gfnvmtcdhor,bw,be,bs,bn,jm,b1,b2,maxplots,
683 * olddtm,newdtm,region,
'HOR',ij,xvlon,xvlat,xllon,xllat,
684 * lorvoghorm,lorvopc,igridsec,fn)
685 call bwplotvc(
'hor',gfnvstcdhor,bw,be,bs,bn,jm,b1,b2,maxplots,
686 * olddtm,newdtm,region,
'HOR',ij,xvlon,xvlat,xllon,xllat,
687 * lorvoghors,lorvopc,igridsec,fn)
693 if(nthinhor.ne.0)
then 694 call bwplotvc(
'lat',gfnvmdcdlat,bw,be,bs,bn,jm,b1,b2,maxplots,
695 * olddtm,newdtm,region,
'LAT',ij,xvlon,xvlat,xllon,xllat,
696 * lorvoghorm,lorvopc,igridsec,fn)
697 call bwplotvc(
'lat',gfnvsdcdlat,bw,be,bs,bn,jm,b1,b2,maxplots,
698 * olddtm,newdtm,region,
'LAT',ij,xvlon,xvlat,xllon,xllat,
699 * lorvoghors,lorvopc,igridsec,fn)
702 if(nthinhor.ne.0)
then 703 call bwplotvc(
'lon',gfnvmdcdlon,bw,be,bs,bn,jm,b1,b2,maxplots,
704 * olddtm,newdtm,region,
'LON',ij,xvlon,xvlat,xllon,xllat,
705 * lorvoghorm,lorvopc,igridsec,fn)
706 call bwplotvc(
'lon',gfnvsdcdlon,bw,be,bs,bn,jm,b1,b2,maxplots,
707 * olddtm,newdtm,region,
'LON',ij,xvlon,xvlat,xllon,xllat,
708 * lorvoghors,lorvopc,igridsec,fn)
711 if(nthineht.ne.0)
then 712 call bwplotvc(
'eht',gfnvmdcdeht,bw,be,bs,bn,jm,b1,b2,maxplots,
713 * olddtm,newdtm,region,
'EHT',ij,xvlon,xvlat,xllon,xllat,
714 * lorvogehtm,lorvopc,igridsec,fn)
717 if(nthinhor.ne.0)
then 718 call bwplotvc(
'hor',gfnvmdcdhor,bw,be,bs,bn,jm,b1,b2,maxplots,
719 * olddtm,newdtm,region,
'HOR',ij,xvlon,xvlat,xllon,xllat,
720 * lorvoghorm,lorvopc,igridsec,fn)
721 call bwplotvc(
'hor',gfnvsdcdhor,bw,be,bs,bn,jm,b1,b2,maxplots,
722 * olddtm,newdtm,region,
'HOR',ij,xvlon,xvlat,xllon,xllat,
723 * lorvoghors,lorvopc,igridsec,fn)
733 if(nthinhor.ne.0)
then 734 call coplot(
'lat',bfnvmtcdlat,bw,be,bs,bn,jm,b1,b2,maxplots,
735 * olddtm,newdtm,region,
'LAT',ij,cptlolatm,cpthilatm,cptinlatm,
736 * suffix2t04,igridsec,fn)
737 call coplot(
'lat',bfnvstcdlat,bw,be,bs,bn,jm,b1,b2,maxplots,
738 * olddtm,newdtm,region,
'LAT',ij,cptlolats,cpthilats,cptinlats,
739 * suffix2t04,igridsec,fn)
742 if(nthinhor.ne.0)
then 743 call coplot(
'lon',bfnvmtcdlon,bw,be,bs,bn,jm,b1,b2,maxplots,
744 * olddtm,newdtm,region,
'LON',ij,cptlolonm,cpthilonm,cptinlonm,
745 * suffix2t04,igridsec,fn)
746 call coplot(
'lon',bfnvstcdlon,bw,be,bs,bn,jm,b1,b2,maxplots,
747 * olddtm,newdtm,region,
'LON',ij,cptlolons,cpthilons,cptinlons,
748 * suffix2t04,igridsec,fn)
751 if(nthineht.ne.0)
then 752 call coplot(
'eht',bfnvmtcdeht,bw,be,bs,bn,jm,b1,b2,maxplots,
753 * olddtm,newdtm,region,
'EHT',ij,cptloehtm,cpthiehtm,cptinehtm,
754 * suffix2t04,igridsec,fn)
764 if(nthinhor.ne.0)
then 765 call coplotwcv(
'lat',sadbfnvmtcdlat,bw,be,bs,bn,jm,b1,b2,
766 * maxplots,olddtm,newdtm,region,
'LAT',ij,cptlolatmsad,
767 * cpthilatmsad,cptinlatmsad,suffix2d3,igridsec,fn,
770 call coplotwcv(
'lat',sadbfnvstcdlat,bw,be,bs,bn,jm,b1,b2,
771 * maxplots,olddtm,newdtm,region,
'LAT',ij,cptlolatssad,
772 * cpthilatssad,cptinlatssad,suffix2d3,igridsec,fn,
776 if(nthinhor.ne.0)
then 777 call coplotwcv(
'lon',sadbfnvmtcdlon,bw,be,bs,bn,jm,b1,b2,
778 * maxplots,olddtm,newdtm,region,
'LON',ij,cptlolonmsad,
779 * cpthilonmsad,cptinlonmsad,suffix2d3,igridsec,fn,
782 call coplotwcv(
'lon',sadbfnvstcdlon,bw,be,bs,bn,jm,b1,b2,
783 * maxplots,olddtm,newdtm,region,
'LON',ij,cptlolonssad,
784 * cpthilonssad,cptinlonssad,suffix2d3,igridsec,fn,
788 if(nthineht.ne.0)
then 789 call coplotwcv(
'eht',sadbfnvmtcdeht,bw,be,bs,bn,jm,b1,b2,
790 * maxplots,olddtm,newdtm,region,
'EHT',ij,cptloehtmsad,
791 * cpthiehtmsad,cptinehtmsad,suffix2d3,igridsec,fn,
799 *
'# ------------------------------',/,
800 *
'# Plots for region: ',a,
', sub-region: ',a,/,
801 *
'# ------------------------------',/,
802 *
'echo Creating plots for region: ',a,
', sub-region: ',a)
804 write(99,1031)trim(gmtfile)
805 1031
format(
'echo END batch file ',a)
809 9999
format(
'END program makeplotfiles02.f')
816 include
'Subs/bwplotvc.f' 817 include
'Subs/bwplotcv.f' 818 include
'Subs/coplot.f' 819 include
'Subs/coplotwcv.f' 820 include
'Subs/plotcoast.f' 821 include
'Subs/getmapbounds.f' 822 include
'Subs/getmag.f' 824 include
'Subs/select2_mod.for' 825 include
'Subs/cpt2.f' 826 include
'Subs/gridstats.f' 827 include
'Subs/vecstats.f' subroutine coplotwcv(ele, fname, bw, be, bs, bn, jm, b1, b2, maxplots, olddtm, newdtm, region, elecap, ij, cptlo, cpthi, cptin6, suffixused, igridsec, fn, cvfname)
Subroutine to make GMT calls to do a color raster rendering of gridded data, with coverage overlaid...
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.
subroutine cpt2(med, csm, xlo, xhi, xin)
This subroutine generates the color pallette variables for a GMT color plot.
program makeplotfiles02
Part of the NADCON5 process, generates gmtbat03
real *8 function onzd2(x)
Function to round a digit to one significant figure (one non zero digit), double precision.
subroutine coplot(ele, fname, bw, be, bs, bn, jm, b1, b2, maxplots, olddtm, newdtm, region, elecap, ij, cptlo, cpthi, cptin6, suffixused, igridsec, fn)
Subroutine to make GMT calls to do Color Raster Rendering of Gridded Data.
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.
subroutine gridstats(fname, ave, std, med)
Subroutine to print grid statistics to stdout.
subroutine cpt(ave, std, csm, xlo, xhi, xin)
This subroutine generates the color pallette variables for a GMT color plot.
subroutine vecstats(fname, n)
Subroutine to tell us how many thinned vectors were used to make a grid.
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.