59 implicit double precision(a-h,o-z)
60 parameter(maxplots=60)
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
76 real*8 lorvoghorm,lorvoghors
81 character*200 gfncvacdlat
82 character*200 gfncvacdlon
83 character*200 gfncvacdeht
86 character*200 gfnvmacdlat
87 character*200 gfnvmacdlon
88 character*200 gfnvmacdeht
89 character*200 gfnvmacdhor
92 character*200 gfnvsacdlat
93 character*200 gfnvsacdlon
94 character*200 gfnvsacdhor
97 real*8 bw(maxplots),be(maxplots),bs(maxplots),bn(maxplots)
99 real*4 b1(maxplots),b2(maxplots)
100 character*10 fn(maxplots)
102 logical lrv(maxplots)
103 real*8 rv0x(maxplots),rv0y(maxplots),rl0y(maxplots)
106 character*200 gmtfile
109 character*200 suffix1,suffix4
115 1001
format(
'BEGIN makeplotfiles01.f')
130 pi = 2.d0*dasin(1.d0)
147 suffix1=trim(olddtm)//
'.'//trim(newdtm)//
'.'//trim(region)
148 suffix4=trim(suffix1)//
'.'//trim(mapflag)
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)
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)
172 gfncvacdlat =
'cvacdlat.'//trim(suffix1)
173 open(11,file=gfncvacdlat,status=
'new',form=
'formatted')
174 write(6,1010)trim(gfncvacdlat)
176 gfncvacdlon =
'cvacdlon.'//trim(suffix1)
177 open(12,file=gfncvacdlon,status=
'new',form=
'formatted')
178 write(6,1010)trim(gfncvacdlon)
180 gfncvacdeht =
'cvacdeht.'//trim(suffix1)
181 open(13,file=gfncvacdeht,status=
'new',form=
'formatted')
182 write(6,1010)trim(gfncvacdeht)
185 gfnvmacdlat =
'vmacdlat.'//trim(suffix1)
186 open(21,file=gfnvmacdlat,status=
'new',form=
'formatted')
187 write(6,1010)trim(gfnvmacdlat)
189 gfnvmacdlon =
'vmacdlon.'//trim(suffix1)
190 open(22,file=gfnvmacdlon,status=
'new',form=
'formatted')
191 write(6,1010)trim(gfnvmacdlon)
193 gfnvmacdeht =
'vmacdeht.'//trim(suffix1)
194 open(23,file=gfnvmacdeht,status=
'new',form=
'formatted')
195 write(6,1010)trim(gfnvmacdeht)
197 gfnvmacdhor =
'vmacdhor.'//trim(suffix1)
198 open(24,file=gfnvmacdhor,status=
'new',form=
'formatted')
199 write(6,1010)trim(gfnvmacdhor)
202 gfnvsacdlat =
'vsacdlat.'//trim(suffix1)
203 open(31,file=gfnvsacdlat,status=
'new',form=
'formatted')
204 write(6,1010)trim(gfnvsacdlat)
206 gfnvsacdlon =
'vsacdlon.'//trim(suffix1)
207 open(32,file=gfnvsacdlon,status=
'new',form=
'formatted')
208 write(6,1010)trim(gfnvsacdlon)
210 gfnvsacdhor =
'vsacdhor.'//trim(suffix1)
211 open(34,file=gfnvsacdhor,status=
'new',form=
'formatted')
212 write(6,1010)trim(gfnvsacdhor)
214 1010
format(6x,
'makeplotfiles01.f: Creating file ',a)
226 891
read(1,104,end=892)pid,state,rejlat,rejlon,rejeht,
228 *dlatsec,dlonsec,dehtm,dhorsec,azhor,dlatm,dlonm,dhorm,
230 if(rejlat.eq.
' ' .and. rejlon.eq.
' ')
then 231 avedhorm = avedhorm + dhorm
232 avedhors = avedhors + dhorsec
235 if(rejeht.eq.
' ')
then 240 avedehtm = avedehtm + dabs(dehtm)
246 avedhorm = avedhorm / dble(ndhor)
247 avedhors = avedhors / dble(ndhor)
253 avedehtm = avedehtm / dble(ndeht)
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)
275 *bw,be,bs,bn,jm,b1,b2,fn,lrv,rv0x,rv0y,rl0y)
286 write(6,1006)trim(region)
287 1006
format(6x,
'makeplotfiles01.f: Calling getmapbounds for region ',a)
311 lorvoghorm =
onzd2(multiplierlorvog*avedhorm)
312 gm2pchor = lorvopc / lorvoghorm
317 lorvoghors =
onzd2(multiplierlorvog*avedhors)
318 gs2pchor = lorvopc / lorvoghors
325 lorvogehtm =
onzd2(multiplierlorvog*avedehtm)
326 gm2pceht = lorvopc / lorvogehtm
330 894
format(6x,
'makeplotfiles01.f: Info about plots:',/,
331 *8x,
'Number of sub-region plot sets ',
332 *
'being made for this region: ',i2)
337 write(6,896)i,region,fn(i),
338 * bs(i),bn(i),bw(i),be(i),dns,dew
340 write(6,897)lorvoghorm,lorvoghors,gm2pchor,gs2pchor
346 write(6,899)lorvogehtm,gm2pceht
353 896
format(50(
'-'),/,
356 *10x,
'S/N/W/E/N-S/E-W = ',6f7.1)
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)
364 *10x,
'Lat/Lon/Hor plots: ',/,
365 *12x,
'No horizontal data available for plotting')
367 *10x,
'Ell. Height plots: ',/,
368 *12x,
'Reference Vector ( m) = ',f10.2,/,
369 *12x,
'Ground M to Paper cm = ',f20.10)
371 *10x,
'Ell. Height plots: ',/,
372 *12x,
'No ellipsoid height data available for plotting')
380 pvlat = (pvlat / 100.d0)
381 pvlon = (pvlon / 100.d0)
404 1
read(1,104,end=2)pid,state,rejlat,rejlon,rejeht,xlath,xlonh,xehth,
405 *dlatsec,dlonsec,dehtm,dhorsec,azhor,dlatm,dlonm,dhorm,
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,
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)
418 1106
format(f16.10,1x,f15.10,1x,f6.2,1x,f12.2,1x,f9.5,1x,f9.3,1x,a6)
425 if(rejlat.eq.
' ')
then 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
444 if(rejlon.eq.
' ')
then 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
463 if(rejeht.eq.
' ')
then 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
480 if(rejlat.eq.
' ' .and. rejlon.eq.
' ')
then 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
506 write(6,778)n,ncvlat,ncvlon,ncveht,nvclat,nvclon,nvceht,nvchor
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)
541 800
format(6x,
'makeplotfiles01.f: Preparing GMT batch file')
547 801
format(6x,
'makeplotfiles01.f: GMT: Write header')
550 901
format(
'gmtset GRID_PEN_PRIMARY 0.25p,-')
553 902
format(
'gmtset BASEMAP_TYPE fancy',/,
554 *
'gmtset HEADER_FONT Helvetica',/,
555 *
'gmtset HEADER_FONT_SIZE 12p',/,
556 *
'gmtset HEADER_OFFSET 0.5c')
560 802
format(6x,
'makeplotfiles01.f: GMT: Num Plots Analysis')
561 write(6,1005)trim(region)
562 1005
format(6x,
'makeplotfiles01.f: REGION = ',a)
596 write(99,990)trim(region),trim(fn(ij)),
597 * trim(region),trim(fn(ij))
604 call bwplotcv(
'lat',gfncvacdlat,bw,be,bs,bn,jm,
605 * b1,b2,maxplots,olddtm,newdtm,region,
'LAT',ij,
608 call bwplotcv(
'lon',gfncvacdlon,bw,be,bs,bn,jm,
609 * b1,b2,maxplots,olddtm,newdtm,region,
'LON',ij,
612 call bwplotcv(
'eht',gfncvacdeht,bw,be,bs,bn,jm,
613 * b1,b2,maxplots,olddtm,newdtm,region,
'EHT',ij,
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)
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)
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)
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)
719 write(99,1031)trim(gmtfile)
720 1031
format(
'echo END batch file ',a)
724 9999
format(
'END makeplotfiles01.f')
729 *
'# ------------------------------',/,
730 *
'# Plots for region: ',a,
', sub-region: ',a,/,
731 *
'# ------------------------------',/,
732 *
'echo Creating plots for region: ',a,
', sub-region: ',a)
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.
real *8 function onzd2(x)
Function to round a digit to one significant figure (one non zero digit), double precision.
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 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.
program makeplotfiles01
Part of the NADCON5 process, generates gmtbat01.