89 implicit real*8(a-h,o-z)
90 parameter(maxplots=60)
94 character*10 olddtm,newdtm,od,nd
95 character*2 state,stdum
96 character*3 ele,elelat,elelon,eleeht,ele0
100 character*200 suffix1,suffix2,suffix3
101 character*200 suffix2t09,suffix2d3
102 character*200 wfname,gmtfile
105 character*200 bfnvsrddlat,bfnvsrddlon,bfnvmrddeht
106 character*200 bfnvmrddlat,bfnvmrddlon
109 character*200 rfnvsrddlat,rfnvsrddlon,rfnvmrddeht
110 character*200 rfnvmrddlat,rfnvmrddlon
113 character*200 gfncvrddlat,gfncvrddlon,gfncvrddeht
116 character*200 gfnvsrddlat,gfnvsrddlon,gfnvmrddeht
117 character*200 gfnvmrddlat,gfnvmrddlon
120 character*200 sadbfnvmtcdlat1000,sadbfnvmtcdlon1000
121 character*200 sadbfnvmtcdeht1000
122 character*200 sadbfnvstcdlat1000,sadbfnvstcdlon1000
125 character*200 bfnvsetelat,bfnvsetelon
126 character*200 bfnvmetelat,bfnvmetelon
127 character*200 bfnvmeteeht
132 character*200 bfnvsetelat0,bfnvsetelon0
133 character*200 bfnvmetelat0,bfnvmetelon0
134 character*200 bfnvmeteeht0
138 character*200 gfnvsrddhor,gfnvmrddhor
144 real*8 bw(maxplots),be(maxplots),bs(maxplots),bn(maxplots)
146 real*4 b1(maxplots),b2(maxplots)
147 character*10 fn(maxplots)
149 logical lrv(maxplots)
150 real*8 rv0x(maxplots),rv0y(maxplots),rl0y(maxplots)
156 character*1 rejlat,rejlon,rejeht
157 real*8 xlath,xlonh,xehth
158 real*8 dlatsec,dlonsec,dehtm
160 character*10 olddtm,newdtm,region
162 character*17 scunlat,scunlon,scuneht
165 real*8 lorvopc,lorvoglats,lorvoglatm,lorvoglons,lorvoglonm
168 real*8 lorvoghors,lorvoghorm
174 1001
format(
'BEGIN program makeplotfiles03.f')
182 read(5,
'(a)')agridsec
190 pi = 2.d0*dasin(1.d0)
197 read(agridsec,*)igridsec
198 suffix1=trim(olddtm)//
'.'//trim(newdtm)//
'.'//trim(region)
199 suffix2=trim(suffix1)//
'.'//trim(agridsec)
200 suffix3=trim(suffix2)//
'.'//trim(mapflag)
202 suffix2d3=trim(suffix2)//
'.d3' 203 suffix2t09=trim(suffix2)//
'.09' 214 sfn =
'dvstats.'//trim(suffix2)
215 open(1,file=sfn,status=
'old',form=
'formatted')
217 1004
format(6x,
'makeplotfiles03.f: Acquiring vectors ',
218 *
'stats from the dvstats file')
229 if(nlat0.ne.nlat)stop 10001
230 if(nlon0.ne.nlon)stop 10002
231 if(nhor0.ne.nhor)stop 10003
232 if(nhor.ne.nlat)stop 10004
233 if(nhor.ne.nlon)stop 10005
235 write(6,893)nlat,rlats,rlatm,
240 893
format(6x,
'makeplotfiles03.f: Vector Stats: ',/,
241 *10x,
'Number of Double Differenced Vectors in LAT: ',i10,/,
242 *10x,
'RMS length (arcseconds) : ',f10.3,/,
243 *10x,
'RMS length (meters) : ',f10.3,/,
244 *10x,
'Number of Double Differenced Vectors in LON: ',i10,/,
245 *10x,
'RMS length (arcseconds) : ',f10.3,/,
246 *10x,
'RMS length (meters) : ',f10.3,/,
247 *10x,
'Number of Double Differenced Vectors in HOR: ',i10,/,
248 *10x,
'RMS length (arcseconds) : ',f10.3,/,
249 *10x,
'RMS length (meters) : ',f10.3,/,
250 *10x,
'Number of Double Differenced Vectors in EHT: ',i10,/,
251 *10x,
'RMS length (arcseconds) : ',f10.3)
258 gmtfile =
'gmtbat06.'//trim(suffix3)
259 open(99,file=gmtfile,status=
'new',form=
'formatted')
260 write(6,1011)trim(gmtfile)
261 1011
format(6x,
'makeplotfiles03.f: Creating GMT batch file ',a)
262 write(99,1030)trim(gmtfile)
263 1030
format(
'echo BEGIN batch file ',a)
267 sadbfnvmtcdlat1000 =
'vmtcdlat.'//trim(suffix2d3)//
'.b' 268 sadbfnvstcdlat1000 =
'vstcdlat.'//trim(suffix2d3)//
'.b' 269 sadbfnvmtcdlon1000 =
'vmtcdlon.'//trim(suffix2d3)//
'.b' 270 sadbfnvstcdlon1000 =
'vstcdlon.'//trim(suffix2d3)//
'.b' 271 sadbfnvmtcdeht1000 =
'vmtcdeht.'//trim(suffix2d3)//
'.b' 274 bfnvsrddlat =
'vsrddlat.'//trim(suffix2t09)//
'.b' 275 bfnvsrddlon =
'vsrddlon.'//trim(suffix2t09)//
'.b' 276 bfnvmrddeht =
'vmrddeht.'//trim(suffix2t09)//
'.b' 277 bfnvmrddlat =
'vmrddlat.'//trim(suffix2t09)//
'.b' 278 bfnvmrddlon =
'vmrddlon.'//trim(suffix2t09)//
'.b' 281 bfnvsetelat =
'vsetelat.'//trim(suffix2)//
'.b' 282 bfnvsetelon =
'vsetelon.'//trim(suffix2)//
'.b' 283 bfnvmetelat =
'vmetelat.'//trim(suffix2)//
'.b' 284 bfnvmetelon =
'vmetelon.'//trim(suffix2)//
'.b' 285 bfnvmeteeht =
'vmeteeht.'//trim(suffix2)//
'.b' 301 if(trim(olddtm).ne.
'nad83_harn')
then 302 write(6,1012)trim(bfnvmetelat)
305 bfnvmetelat0 = trim(bfnvmetelat)//
'.premask' 306 write(6,1012)trim(bfnvmetelat0)
313 call cpt2(xmdlatme,2.d0,
314 * cptlolatme,cpthilatme,cptinlatme)
325 if(trim(olddtm).ne.
'nad83_harn')
then 326 write(6,1012)trim(bfnvsetelat)
329 bfnvsetelat0 = trim(bfnvsetelat)//
'.premask' 330 write(6,1012)trim(bfnvsetelat0)
337 call cpt2(xmdlatse,2.d0,
338 * cptlolatse,cpthilatse,cptinlatse)
351 if(trim(olddtm).ne.
'nad83_harn')
then 352 write(6,1012)trim(bfnvmetelon)
355 bfnvmetelon0 = trim(bfnvmetelon)//
'.premask' 356 write(6,1012)trim(bfnvmetelon0)
363 call cpt2(xmdlonme,2.d0,
364 * cptlolonme,cpthilonme,cptinlonme)
374 if(trim(olddtm).ne.
'nad83_harn')
then 375 write(6,1012)trim(bfnvsetelon)
378 bfnvsetelon0 = trim(bfnvsetelon)//
'.premask' 379 write(6,1012)trim(bfnvsetelon0)
386 call cpt2(xmdlonse,2.d0,
387 * cptlolonse,cpthilonse,cptinlonse)
400 if(trim(olddtm).ne.
'nad83_harn')
then 401 write(6,1012)trim(bfnvmeteeht)
404 bfnvmeteeht0 = trim(bfnvmeteeht)//
'.premask' 405 write(6,1012)trim(bfnvmeteeht0)
412 call cpt2(xmdehtme,2.d0,
413 * cptloehtme,cpthiehtme,cptinehtme)
429 *bw,be,bs,bn,jm,b1,b2,fn,lrv,rv0x,rv0y,rl0y)
441 write(6,1006)trim(region)
442 1006
format(6x,
'makeplotfiles03.f: Calling getmapbounds for region ',a)
455 lorvoglats =
onzd2(multiplierlorvog*rlats)
456 gs2pclat = lorvopc / lorvoglats
461 lorvoglatm =
onzd2(multiplierlorvog*rlatm)
462 gm2pclat = lorvopc / lorvoglatm
469 lorvoglons =
onzd2(multiplierlorvog*rlons)
470 gs2pclon = lorvopc / lorvoglons
475 lorvoglonm =
onzd2(multiplierlorvog*rlonm)
476 gm2pclon = lorvopc / lorvoglonm
483 lorvogehtm =
onzd2(multiplierlorvog*rehtm)
484 gm2pceht = lorvopc / lorvogehtm
487 if(nlon.ne.0 .and. nlat.ne.0)
then 491 lorvoghors =
onzd2(multiplierlorvog*rhors)
492 gs2pchor = lorvopc / lorvoghors
497 lorvoghorm =
onzd2(multiplierlorvog*rhorm)
498 gm2pchor = lorvopc / lorvoghorm
504 894
format(6x,
'makeplotfiles03.f: Info about plots:',/,
505 *8x,
'Number of sub-area plot sets to cover this region: ',i2)
510 write(6,896)i,bs(i),bn(i),bw(i),be(i),dns,dew
513 write(6,897)
'lat',lorvoglatm,lorvoglats,gm2pclat,gs2pclat
519 write(6,897)
'lon',lorvoglonm,lorvoglons,gm2pclon,gs2pclon
525 write(6,899)
'eht',lorvogehtm,gm2pceht
530 if(nlat.ne.0 .and. nlon.ne.0)
then 531 write(6,897)
'hor',lorvoghorm,lorvoghors,gm2pchor,gs2pchor
540 *10x,
'S/N/W/E/N-S/E-W = ',6f7.1)
542 *10x,a3,
' plots',13x,
':',/,
543 *12x,
'Reference Vector ( m) = ',f10.2,/,
544 *12x,
'Reference Vector ( s) = ',f10.6,/,
545 *12x,
'Ground M to Paper cm = ',f20.10,/,
546 *12x,
'Ground S to Paper cm = ',f20.10)
548 *10x,a3,
' plots',13x,
':',/,
549 *12x,
'Reference Vector ( m) = ',f10.2,/,
550 *12x,
'Ground M to Paper cm = ',f20.10)
552 *10x,a3,
' plots: No data available for plotting')
562 pvlat = (pvlat / 100.d0)
563 pvlon = (pvlon / 100.d0)
575 rfnvsrddlat =
'vsrddlat.'//trim(suffix2t09)//
'.grd' 576 rfnvsrddlon =
'vsrddlon.'//trim(suffix2t09)//
'.grd' 577 rfnvmrddeht =
'vmrddeht.'//trim(suffix2t09)//
'.grd' 578 rfnvmrddlat =
'vmrddlat.'//trim(suffix2t09)//
'.grd' 579 rfnvmrddlon =
'vmrddlon.'//trim(suffix2t09)//
'.grd' 581 gfnvsrddlat =
'vsrddlat.'//trim(suffix2)
582 gfnvsrddlon =
'vsrddlon.'//trim(suffix2)
583 gfnvmrddeht =
'vmrddeht.'//trim(suffix2)
584 gfnvmrddlat =
'vmrddlat.'//trim(suffix2)
585 gfnvmrddlon =
'vmrddlon.'//trim(suffix2)
586 gfnvsrddhor =
'vsrddhor.'//trim(suffix2)
587 gfnvmrddhor =
'vmrddhor.'//trim(suffix2)
589 gfncvrddlat =
'cvrddlat.'//trim(suffix2)
590 gfncvrddlon =
'cvrddlon.'//trim(suffix2)
591 gfncvrddeht =
'cvrddeht.'//trim(suffix2)
602 write(6,1012)trim(bfnvsrddlat)
607 call cpt2(xmdlats,3.d0,
608 * cptlolats,cpthilats,cptinlats)
610 write(6,1012)trim(bfnvmrddlat)
615 call cpt2(xmdlatm,3.d0,
616 * cptlolatm,cpthilatm,cptinlatm)
621 write(6,1012)trim(bfnvsrddlon)
626 call cpt2(xmdlons,3.d0,
627 * cptlolons,cpthilons,cptinlons)
629 write(6,1012)trim(bfnvmrddlon)
634 call cpt2(xmdlonm,3.d0,
635 * cptlolonm,cpthilonm,cptinlonm)
640 write(6,1012)trim(bfnvmrddeht)
645 call cpt2(xmdehtm,3.d0,
646 * cptloehtm,cpthiehtm,cptinehtm)
651 1012
format(6x,
'makeplotfiles03.f: Grabbing stats of grid: ',a)
662 write(99,990)trim(region),trim(fn(ij)),
663 * trim(region),trim(fn(ij))
671 *
call bwplotcv(
'lat',gfncvrddlat,bw,be,bs,bn,jm,
672 * b1,b2,maxplots,olddtm,newdtm,region,
'LAT',ij,
676 *
call bwplotcv(
'lon',gfncvrddlon,bw,be,bs,bn,jm,
677 * b1,b2,maxplots,olddtm,newdtm,region,
'LON',ij,
681 *
call bwplotcv(
'eht',gfncvrddeht,bw,be,bs,bn,jm,
682 * b1,b2,maxplots,olddtm,newdtm,region,
'EHT',ij,
730 call bwplotvc(
'lat',gfnvsrddlat,bw,be,bs,bn,jm,b1,b2,maxplots,
731 * olddtm,newdtm,region,
'LAT',ij,xvlon,xvlat,xllon,xllat,
732 * lorvoglats,lorvopc,igridsec,fn)
733 call bwplotvc(
'lat',gfnvmrddlat,bw,be,bs,bn,jm,b1,b2,maxplots,
734 * olddtm,newdtm,region,
'LAT',ij,xvlon,xvlat,xllon,xllat,
735 * lorvoglatm,lorvopc,igridsec,fn)
739 call bwplotvc(
'lon',gfnvsrddlon,bw,be,bs,bn,jm,b1,b2,maxplots,
740 * olddtm,newdtm,region,
'LON',ij,xvlon,xvlat,xllon,xllat,
741 * lorvoglons,lorvopc,igridsec,fn)
742 call bwplotvc(
'lon',gfnvmrddlon,bw,be,bs,bn,jm,b1,b2,maxplots,
743 * olddtm,newdtm,region,
'LON',ij,xvlon,xvlat,xllon,xllat,
744 * lorvoglonm,lorvopc,igridsec,fn)
748 call bwplotvc(
'eht',gfnvmrddeht,bw,be,bs,bn,jm,b1,b2,maxplots,
749 * olddtm,newdtm,region,
'EHT',ij,xvlon,xvlat,xllon,xllat,
750 * lorvogehtm,lorvopc,igridsec,fn)
753 if(nlon.ne.0 .and. nlat.ne.0)
then 754 call bwplotvc(
'hor',gfnvsrddhor,bw,be,bs,bn,jm,b1,b2,maxplots,
755 * olddtm,newdtm,region,
'HOR',ij,xvlon,xvlat,xllon,xllat,
756 * lorvoghors,lorvopc,igridsec,fn)
757 call bwplotvc(
'hor',gfnvmrddhor,bw,be,bs,bn,jm,b1,b2,maxplots,
758 * olddtm,newdtm,region,
'HOR',ij,xvlon,xvlat,xllon,xllat,
759 * lorvoghorm,lorvopc,igridsec,fn)
769 3101
format(
'echo Color Plots of RMS data...')
772 call coplot(
'lat',bfnvsrddlat,bw,be,bs,bn,jm,b1,b2,maxplots,
773 * olddtm,newdtm,region,
'LAT',ij,cptlolats,cpthilats,cptinlats,
774 * suffix2t09,igridsec,fn)
775 call coplot(
'lat',bfnvmrddlat,bw,be,bs,bn,jm,b1,b2,maxplots,
776 * olddtm,newdtm,region,
'LAT',ij,cptlolatm,cpthilatm,cptinlatm,
777 * suffix2t09,igridsec,fn)
781 call coplot(
'lon',bfnvsrddlon,bw,be,bs,bn,jm,b1,b2,maxplots,
782 * olddtm,newdtm,region,
'LON',ij,cptlolons,cpthilons,cptinlons,
783 * suffix2t09,igridsec,fn)
784 call coplot(
'lon',bfnvmrddlon,bw,be,bs,bn,jm,b1,b2,maxplots,
785 * olddtm,newdtm,region,
'LON',ij,cptlolonm,cpthilonm,cptinlonm,
786 * suffix2t09,igridsec,fn)
790 call coplot(
'eht',bfnvmrddeht,bw,be,bs,bn,jm,b1,b2,maxplots,
791 * olddtm,newdtm,region,
'EHT',ij,cptloehtm,cpthiehtm,cptinehtm,
792 * suffix2t09,igridsec,fn)
800 3102
format(
'echo Color Plots of Total Error grids...')
803 call coplot(
'lat',bfnvsetelat,bw,be,bs,bn,jm,b1,b2,maxplots,
804 * olddtm,newdtm,region,
'LAT',ij,cptlolatse,cpthilatse,
806 * suffix2,igridsec,fn)
807 call coplot(
'lat',bfnvmetelat,bw,be,bs,bn,jm,b1,b2,maxplots,
808 * olddtm,newdtm,region,
'LAT',ij,cptlolatme,cpthilatme,
810 * suffix2,igridsec,fn)
814 call coplot(
'lon',bfnvsetelon,bw,be,bs,bn,jm,b1,b2,maxplots,
815 * olddtm,newdtm,region,
'LON',ij,cptlolonse,cpthilonse,
817 * suffix2,igridsec,fn)
818 call coplot(
'lon',bfnvmetelon,bw,be,bs,bn,jm,b1,b2,maxplots,
819 * olddtm,newdtm,region,
'LON',ij,cptlolonme,cpthilonme,
821 * suffix2,igridsec,fn)
825 call coplot(
'eht',bfnvmeteeht,bw,be,bs,bn,jm,b1,b2,maxplots,
826 * olddtm,newdtm,region,
'EHT',ij,cptloehtme,cpthiehtme,
828 * suffix2,igridsec,fn)
833 *
'# ------------------------------',/,
834 *
'# Plots for region: ',a,
', sub-region: ',a,/,
835 *
'# ------------------------------',/,
836 *
'echo Creating plots for region: ',a,
', sub-region: ',a)
838 write(99,1031)trim(gmtfile)
839 1031
format(
'echo END batch file ',a)
843 9999
format(
'END program makeplotfiles03.f')
849 include
'Subs/getmapbounds.f' 850 include
'Subs/getmag.f' 851 include
'Subs/coplot.f' 852 include
'Subs/bwplotvc.f' 853 include
'Subs/bwplotcv.f' 854 include
'Subs/plotcoast.f' 855 include
'Subs/onzd2.f' 856 include
'Subs/gridstats.f' 857 include
'Subs/cpt2.f' 858 include
'Subs/select2_mod.for' 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 makeplotfiles03
Part of the NADCON5 process, generates gmtbat06
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 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.