{"text": "module matrix_mod\n use, intrinsic :: iso_fortran_env, only : dp => REAL64\n implicit none\n public :: print_matrix\n\ncontains\n\n subroutine print_matrix(a)\n real(kind=dp), dimension(:,:), intent(in) :: a\n integer :: r\n do r = 1, size(a, 1)\n print *, a(r, :)\n end do\n end subroutine print_matrix\n\nend module matrix_mod\n", "meta": {"hexsha": "df17a5d2a76bccaed0eba3a4613e5b936edd850e", "size": 368, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "Debugging/Gdb/Fortran/matrix_mod.f90", "max_stars_repo_name": "Gjacquenot/training-material", "max_stars_repo_head_hexsha": "16b29962bf5683f97a1072d961dd9f31e7468b8d", "max_stars_repo_licenses": ["CC-BY-4.0"], "max_stars_count": 115, "max_stars_repo_stars_event_min_datetime": "2015-03-23T13:34:42.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-21T00:27:21.000Z", "max_issues_repo_path": "Debugging/Gdb/Fortran/matrix_mod.f90", "max_issues_repo_name": "Gjacquenot/training-material", "max_issues_repo_head_hexsha": "16b29962bf5683f97a1072d961dd9f31e7468b8d", "max_issues_repo_licenses": ["CC-BY-4.0"], "max_issues_count": 56, "max_issues_repo_issues_event_min_datetime": "2015-02-25T15:04:26.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-03T07:42:48.000Z", "max_forks_repo_path": "Debugging/Gdb/Fortran/matrix_mod.f90", "max_forks_repo_name": "Gjacquenot/training-material", "max_forks_repo_head_hexsha": "16b29962bf5683f97a1072d961dd9f31e7468b8d", "max_forks_repo_licenses": ["CC-BY-4.0"], "max_forks_count": 59, "max_forks_repo_forks_event_min_datetime": "2015-11-26T11:44:51.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-21T00:27:22.000Z", "avg_line_length": 21.6470588235, "max_line_length": 58, "alphanum_fraction": 0.5923913043, "num_tokens": 95, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO\n\n", "lm_q1_score": 0.5, "lm_q2_score": 0.19930799314806233, "lm_q1q2_score": 0.09965399657403116}}
{"text": "! This is the Fortran program containing \n! - introduction to conditional statements and \n! - the achar command\n! - and the index command\n\nprogram testingChars\n\nimplicit none\n\ncharacter(len=80) :: text\ninteger :: i\n\ntext = 'The intrinsic data type character stores characters and strings.' \n\ni = index(text, 'character') ! using index to find the first occurence of the string 'character'\n\nif (i /= 0) then \n print*, 'The word character found at position', i\n print*, 'in text: ', text\nend if\n\nend program testingChars\n", "meta": {"hexsha": "749c6bdc14e07b70d13fde686ad2c88eba5e8a57", "size": 525, "ext": "f95", "lang": "FORTRAN", "max_stars_repo_path": "FPL/class3/testingChars.f95", "max_stars_repo_name": "adisen99/fortran_programs", "max_stars_repo_head_hexsha": "04d3a528200e27a25b109f5d3a0aff66b22f94a1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "FPL/class3/testingChars.f95", "max_issues_repo_name": "adisen99/fortran_programs", "max_issues_repo_head_hexsha": "04d3a528200e27a25b109f5d3a0aff66b22f94a1", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "FPL/class3/testingChars.f95", "max_forks_repo_name": "adisen99/fortran_programs", "max_forks_repo_head_hexsha": "04d3a528200e27a25b109f5d3a0aff66b22f94a1", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 22.8260869565, "max_line_length": 96, "alphanum_fraction": 0.7219047619, "num_tokens": 127, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO\n\n", "lm_q1_score": 0.39981164073979497, "lm_q2_score": 0.24798743735585302, "lm_q1q2_score": 0.09914826421210071}}
{"text": "c adding external zone delay cost (extadd(mxext),extcst) to generalized cost field\nc station 1, adding 4500 cents to abcst and bacst\nc station 10 adding 1500 cents to abcst and bacst\nc station 10 adding 3000 cents to abcst and bacst - try upping to 3000 to increase trip lengths\nc station 11,12 adding 3000 cents to abcst and bacst\nc spd of hov is 5mph > sov spd \nc 1/25/05 \tadd code to automaticly generate turn prohibitors between two ramps if\nc \t\tintersect with none ramps\nc 2/2/05 cap fwy capacity to certain threashhold\nc hwycov to transcad conversion program\nc\n parameter (mxramp=2500,mxrlk=1000,mxrt=500,mxnrt=10,mxzrt=50,\n *mxradt=12999,mxadt=9999)\n common /reccom/ srec,rlkarr\n include 'sandag.inc'\n include 'tcov.inc'\n include 'zone.inc'\nc\nc program variables\nc\n logical uniq(mxhca),stop,inff,used,zoneo(mxzn),hov3,toll,hot3,\n *first,endf,entry(mxhcn),exit(mxhcn),tsm,new,nused(mxhcn)\n integer*2 pfc(15),pjur(6),psph(20),fcarr(mxhca),fwysta(mxid),\n *cnnode(mxhcn),snode(mxhcn),adtmtr(9999),xang(2,mxhca,3),angle(3),\n *mjur(mxfc),mway(mxfc),mspd(mxfc),mmed(mxfc),mln(mxfc),mlf(mxfc,8),\n *gcsig(4,9,9),gcstp4(9,9),gcstp2(9),mtspd(mxfc),\n *kdist(mxrlk),jur(mxrlk),med(mxrlk),tfln(3,mxrlk),lfcap(10),\n *tfaux(mxrlk),hov(mxrlk),tfcnt(mxrlk),\n *tftl(mxrlk),tfrl(mxrlk),tfll(mxrlk),tfgc(mxrlk),\n *tfotm(mxrlk),tfptm(mxrlk),xan(2),xbn(2)\n integer*4 n1arr(mxhca),n2arr(mxhca),tpxy(mxtpn),\n *xapp(mxhcn),xstop(mxhcn),xdapp(mxhcn),\n *rlkarr(mxhca),srec(mxhca),luno,hovfwy(mxid),\n *nid(mxid),krno(mxrlk),kid(mxrlk),fc(mxrlk),tplb(3,mxrt),\n *spd(mxrlk),tfcap(3,mxrlk),znspd(3),\n *aatxfc(2),zonety(mxzn),aatmln(2),\n *lbid(mxhca),lbfc(mxhca),lbrt(mxhca),lid,xlb(2,mxhca,3),hrpk(24),\n *nodemrt(mxhcn),nodert(mxtpn,mxnrt),\n *tdzmrt(mxtdz),tdzrt(mxtdz,mxzrt),\n *tdzrtnode(mxtdz,mxzrt),tdzrtid(mxtdz,mxzrt),taztdz(mxzn)\n real xtdz(mxtdz),ytdz(mxtdz),xnode(mxtpn),ynode(mxtpn),\n *tdzrtdist(mxtdz,mxzrt),adtvols(29),adthst(mxradt)\n real rsafac(6),bordel(5,3,2),fwycap,auxcap,extadd(mxext),\n *dsum(mxid),tisum(mxid),tasum(mxid),remtoll(3),\n *stappf(3,2,mxbsta),hrpct(24),pkmax(3),\n *frmile(17),flmile(3,17),fcmile(17),frhour(17),\n *jrmile(3,10),jlmile(3,10),jcmile(3,10),jrhour(3,10)\n character*1 intnam(8),c1\n character*32 extnam\n character*150 idat\n character*1 nln(10),nxl(10)\n character*2 cdir\n character*3 njur(6),nmed(3)\n character*4 nhov(4)\n character*6 ncnt(9)\n character*7 nway(2)\n character*11 nfc(12)\n character*12 nrdir(4)\n character*17 nmjur(10)\n character*19 nminc(3)\n character*20 nmarr(mxhca),kname(mxrlk),name1,nmhov(4)\n data angle/0,-90,90/\n data first/.true./,stop/.false./,lnode/5000/\n data znspd/20,30,45/,xan/2,1/,xbn/1,2/\n data hrpk/1,1,1,1,1,1,2,2,2,1,1,1,1,1,1,3,3,3,1,1,1,1,1,1/\n data mspd/65,45,40,35,30,40,35,65,30,30,50,25,25,30/\n data mtspd/55,45,40,35,30,40,35,55,30,30,50,25,25,30/\n data mmed/2,2,2,1,1,1,1,1,1,1,1,1,1,1/\n data mway/1,2,2,2,2,2,2,1,1,2,2,2,2,2/\n data mln/4,3,2,2,1,1,1,1,1,1,1,1,1,1/\n data mjur/1,5,5,6,6,6,6,1,1,6,6,6,6,1/\n data extadd/4500,0,0,0,0,0,0,0,0,3000,3000,3000/\n data ncnt/'0-none','1-sig ','2-4stp','3-2stp','4-mtr-',\n *'5-mtr+','6-lrt ','7-toll','8-prev'/\n data nfc/'1:freeway ','2:prime art',\n * '3:major art','4:collector', \n * '5:local col','6:rural col',\n * '7:local ','8:fwy-fwy ',\n * '9:ramp ','10:access ',\n * ' sub-total',' total '/\n data nminc/\n *'Incorporated Cities',\n *'Unincorporated Area',\n *'Regional Total '/\n data nmjur/\n *'Caltrans Freeways',\n *'Caltrans HOVs ',\n *'Caltrans Highways',\n *'Caltrans Ramps ',\n *'CMP Routes ',\n *'Non-CMP RSA Roads',\n *'Other RA Roads ',\n *'Other Major Roads',\n *'Other Local Roads',\n *'Total '/\t\n data njur/'1-s','2-c','3-r','4-r','5-m','6-l'/,rsafac/6*1.0/\n data nhov/'mix','hov2','hov3','toll'/\n data nln/'0','1','2','3','4','5','6','7','8','n'/\n data nxl/'0','1','2','3','4','5','6','f','x','n'/\n data nmed/'1:n','2:m','3:c'/\n data nrdir/'1-southbound','2-eastbound ','3-northbound',\n *'4-westbound '/\n data nway/'one-way','two-way'/\n data nmhov/'sbhov.sbfwy','nbhov.nbfwy',\n *'ebhov.ebfwy','wbhov.wbfwy'/\n data lfcap/250,250,150,100,100,100,100,100,100,0/\n data gcstp2/50,50,75,100,125,125,150,150,100/\n data lunin,lunerr,lunpr,luno,aatlun,natlun,lunsum,patlun,\n *seclun,luninf,lunsig,tatlun,lunxy,lunsta\n */11,12,13,14,15,16,17,18,19,20,21,22,23,24/\n data rlkarr/mxhca*99999999/\n data uniq/mxhca*.true./\n eject = ' '\n mlf(2,1)=2\n mlf(2,2)=1\n mlf(2,3)=1\n mlf(3,1)=1\n mlf(3,2)=1\n mlf(3,3)=1\n mlf(4,1)=1\n mlf(4,2)=1\n mlf(9,1)=1\n mlf(9,2)=1\n mlf(9,3)=1\n call dattim\nc\nc create output files\nc\n open (unit=lunerr,file='tchc.err')\n open (unit=lunsta,file='tchc-sta.prn')\n open (unit=luninf,file='tchc.info')\n open (unit=lunpr,file='tchc.pr')\n open (unit=luno,file='turns.csv')\n write(luno,20920)\n open (unit=lunsum,file='tchc.sum')\n open (unit=lunxy,file='zc.gen')\nc\nc read program control\nc\n psph(1)=9999\n pjur(1)=9999\n pfc(1)=1\n pfc(2)=2\n pfc(3)=3\n fnamo='tchc.in'\n open (unit=lunin,file=fnamo,status='old',err=9)\n read(lunin,10001) (psph(i),i=1,20)\n read(lunin,10001) (pjur(i),i=1,6)\n read(lunin,10001) (pfc(i),i=1,15)\n close(lunin)\nc\nc read printout heading\nc\n 9 fnami='head'\n call opendata(lunin)\n if(istat.ne.0) go to 9000\n read(lunin,10003) cheadi\n call cheadr\n close(lunin)\nc\nc read analysis year\nc\n fnamo='hwyyear'\n open (unit=lunin,file=fnamo,status='old',err=11)\n go to 12\n 11 fnamo='year'\n open (unit=lunin,file=fnamo,status='old',err=9000)\n 12 icol=1\n read(lunin,10000,iostat=istat) idata,adata\n if(istat.ne.0) go to 9001\n call sd_getdat(idata,adata,icol,iyear,i2,i3,lunerr)\n close(lunin)\n tsm=.false.\n if(iyear.gt.2015) tsm=.true.\n open (unit=lunin,file=fnamo,status='old',err=13)\n tsm=.false.\n 13 close(lunin)\n fnamo='notsm'\n if(iyear.lt.2010) go to 20\n if(.not.tsm) go to 20\n jyear=min(iyear,2020)\n xfac=1.0+(jyear-2010)*0.01\n do 14 i=1,4\n rsafac(i)=xfac\n 14 continue\nc read arterial traffic count\nc\n 20 if(iyear.eq.2010) iadtyr = iyear-1982+1\n \n\tfnami='../data/histfill1982_2010'\n call opendata(lunin)\n if(istat.ne.0) go to 9000\n read(lunin,10009,iostat=istat) c1\n if(istat.ne.0) go to 9000\n 16 read(lunin,10033,iostat=istat) aatadt,adtvols\n if(istat.ne.0) go to 18\n if(aatadt.lt.1.or.aatadt.gt.mxadt) go to 9030\n adthst(aatadt)=nint(adtvols(iadtyr)/100.0)\n go to 16\n 18 close(lunin)\n \nc\nc flag cbd zones (zonety=1)\nc\n icol=2\n fnamo='zone.avrzone'\n open (unit=lunin,file=fnamo,status='old',err=21)\n go to 22\n 21 fnamo='../data/zone.avrzone'\n open (unit=lunin,file=fnamo,status='old',err=9000)\n 22 read(lunin,10000,iostat=istat) idata,adata\n if(istat.ne.0) go to 23\n call sd_getdat(idata,adata,icol,izone,iavr,i3,lunerr)\n if(izone.lt.1.or.izone.gt.mxzn) go to 9001\n if(iavr.eq.1) zonety(izone)=1\n go to 22\n 23 close(lunin)\n call ozonep\n if(patio.ne.0) go to 9000\n patrec=2 \n 24 call rzonep\n if(patio.ne.0) go to 29\n if(patzon.lt.1.or.patzon.gt.mxzn) go to 9001\n mzone=max(mzone,patzon)\n xacres=patare/43560.\n if(zonety(patzon).lt.1) then\n zonety(patzon)=1\n if(xacres.gt.200) zonety(patzon)=2\n if(xacres.gt.5000) zonety(patzon)=3\n endif\n patrec=patrec+1\n go to 24\n 29 close(patlun)\nc\nc gcdata\nc\n 30 fnamo='gc'\n open (unit=lunin,file=fnamo,status='old',err=31)\n go to 33\n 31 fnamo='../data/gc'\n open (unit=lunin,file=fnamo,status='old',err=9000)\n 33 do 36 ifc=1,9\n read(lunin,10030,iostat=istat) (gcsig(4,ifc,itofc),itofc=1,9)\n if(istat.ne.0) go to 9000\n 36 continue\n do 37 ifc=1,9\n read(lunin,10030,iostat=istat) (gcsig(3,ifc,itofc),itofc=1,9)\n if(istat.ne.0) go to 9000\n 37 continue\n do 38 ifc=1,9\n read(lunin,10030,iostat=istat) (gcsig(2,ifc,itofc),itofc=1,9)\n if(istat.ne.0) go to 9000\n 38 continue\n do 39 ifc=1,9\n read(lunin,10030,iostat=istat) (gcstp4(ifc,itofc),itofc=1,9)\n if(istat.ne.0) go to 9000\n 39 continue\n close(lunin)\nc\nc border delay times\nc\n fnamo='border.del'\n open (unit=lunin,file=fnamo,status='old',err=41)\n go to 43\n 41 fnamo='../data/border.del'\n open (unit=lunin,file=fnamo,status='old',err=9000)\n 43 do 44 ibord=1,5\n read(lunin,10040,iostat=istat)\n *(bordel(ibord,ipk,1),bordel(ibord,ipk,2),ipk=1,3)\n if(istat.ne.0) go to 9000\n 44 continue\n close(lunin)\nc\nc read freeway-hov lane connections\nc\n icol=2\n do 59 ifile=1,4\n fnami=nmhov(ifile)\n call opendata(lunin)\n if(istat.ne.0) go to 9000\n 51 read(lunin,10000,iostat=istat) idata,adata\n if(istat.ne.0) go to 58\n call sd_getdat(idata,adata,icol,ihov,ifwy,i3,lunerr)\n if(ifwy.lt.1.or.ifwy.gt.mxid) go to 9001\n if(ihov.lt.1.or.ihov.gt.mxid) go to 51\n hovfwy(ihov)=ifwy\n go to 51\n 58 close(lunin)\n 59 continue\nc\nc adt links with new meters\nc\n fnamo='adtlk.mtr'\n open (unit=lunin,file=fnamo,status='old',err=61)\n go to 63\n 61 fnamo='../data/adtlk.mtr'\n open (unit=lunin,file=fnamo,status='old',err=9000)\n 63 read(lunin,10060,iostat=istat) aatadt,cdir\n if(istat.ne.0) go to 69\n idir=9\n i=index(cdir,'SB')\n if(i.gt.0) idir=1\n i=index(cdir,'EB')\n if(i.gt.0) idir=2\n i=index(cdir,'NB')\n if(i.gt.0) idir=3\n i=index(cdir,'WB')\n if(i.gt.0) idir=4\n adtmtr(aatadt)=idir\n go to 63\n 69 close(lunin)\n fnamo='sta.hrpct'\n open (unit=lunin,file=fnamo,status='old',err=71)\n go to 73\n 71 fnamo='../data/sta.hrpct'\n open (unit=lunin,file=fnamo,status='old',err=9000)\n read(lunin,10009,iostat=istat) c1\n if(istat.ne.0) go to 9000\n 73 read(lunin,10070,iostat=istat)\n *ista,idir,hrpct\n if(istat.ne.0) go to 79\n if(ista.lt.1.or.ista.gt.mxbsta) go to 9070\n do ipk=1,3\n pkmax(ipk)=0.0\n end do\nc \nc for peak periods use max hour\nc\n do ihr=1,24\n ipk=hrpk(ihr)\n if(ipk.ne.1) \n *pkmax(ipk)=max(pkmax(ipk),hrpct(ihr))\n end do\nc\nc for off-peak period use mid-day hour\nc\n do ihr=11,13\n ipk=hrpk(ihr)\n pkmax(ipk)=max(pkmax(ipk),hrpct(ihr))\n end do\n do ipk=1,3\n stappf(ipk,idir,ista)=1.0/pkmax(ipk)\n end do\n go to 73\n 79 close(lunin)\nc commented out until we decide on better way of handling peak spreading\nc if(iyear.lt.2020) go to 89\nc fnami='notdm'\nc call opendata(lunin)\nc if(istat.ne.0) go to 80\nc close(lunin)\nc go to 89\nc 80 do idir=1,2\nc do ipk=2,3\nc do ista=1,999\nc stappf(ipk,idir,ista)=3.0\nc end do\nc end do\nc end do\n 89 write(0,11002)\n fnami='../data/taz.tdz'\n call opendata(lunin)\n\tif(istat.ne.0) go to 9000\n 95 read(lunin,10000,iostat=istat) idata,adata\n if(istat.ne.0) go to 96\n call sd_getdat(idata,adata,icol,izone,itdz,i3,lunerr)\n if(izone.lt.1.or.izone.gt.mxzn) go to 9001\n taztdz(izone)=itdz\n go to 95\n 96 close(lunin)\n fnamo='../covs/tdzs/pat.adf'\n open(unit=patlun,convert='big_endian',file=fnamo,access=\n *'direct',form='unformatted',recl=12,status='old',err=9000)\n patrec=2 \n 98 call rzonep\t\n if(patio.ne.0) go to 99\n xtdz(patzon)=float(patx)\n ytdz(patzon)=float(paty)\t\n patrec=patrec+1\n go to 98\n 99 close(patlun)\n call ohca\n if(aatio.ne.0) go to 9000\n aatrec=1\n mid=0\nc\nc read hwycov aat and save data.\nc\n 100 call rhca\n if(aatio.ne.0) go to 129\n if(aathov(1).eq.3.and.(hov3.eq..false..or.hot3.eq..false.)) then\n hov3=.true. !flag whether any hov3+ facilities exist\n if(aattoll(1,1).gt.0.and.aatln(1,1,1).lt.9) hot3=.true. !flag whether any hot3+ facilities exist\n if(aattoll(2,1).gt.0.and.aatln(2,1,1).lt.9) hot3=.true. !flag whether any hot3+ facilities exist\n if(aattoll(3,1).gt.0.and.aatln(3,1,1).lt.9) hot3=.true. !flag whether any hot3+ facilities exist\n endif\n if(aathov(1).eq.4) toll=.true. !flag whether any toll facilities exist\t \n rlkarr(aatrec)=aatrt*1000+aatlk\n lbid(aatlb)=aatid\n lbfc(aatlb)=aatfc(1)\n lbrt(aatlb)=aatrt \n if(aatfc(1).eq.1) fwysta(aatid)=aatsta \n do idir=1,2 !loop through each direction for link\n in=aatarn(idir)\n itpn=aattpn(idir)\n\n if(in.lt.1.or.in.gt.mxhcn) then !check for valid node number\n write(lunerr,19100) aatrec,in,aatnm,aatxnm(idir)\n errf=.true.\n aatarn(idir)=mxhcn\n stop=.true.\n endif\n\n if(in.gt.mnode) mnode=in\n if(aattpn(idir).gt.mtpn) mtpn=aattpn(idir)\n if(aatfc(1).le.9) then !check for non-zone connector links\n xapp(in)=xapp(in)+1\n if(aatcnt(idir,1).eq.3) xstop(in)=xstop(in)+1\n if(aatway(1).eq.2.or.idir.eq.1) xdapp(in)=xdapp(in)+1\n\nc save route numbers at node\n\n mnrt=nodemrt(itpn)\n new=.true.\n if(mnrt.gt.0) then !if node-route connenctions already exist then find out if this is a new one\n do irt=1,mnrt !loop through routes at this node\n if(aatrt.eq.nodert(itpn,irt)) new=.false.\n end do !end of old route loop\n end if !end of old connection check\n\n if(new) then !if this is a new route connection then add to matrix \n mnrt=mnrt+1\n if(mnrt.gt.mxnrt) then\n write(lunerr,19104)\n errf=.true.\n go to 9999\n endif\n\n nodemrt(itpn)=mnrt\n nodert(itpn,mnrt)=aatrt\n end if !end of new route check\n end if !end of check for non-zone connector links\n end do ! end of directional loop\n\n if(aatfc(1).lt.1.or.aatfc(1).gt.mxfc) go to 128\n srec(aatrec)=aatrec\n nmarr(aatrec)=aatnm\n n1arr(aatrec)=aatarn(1)\n n2arr(aatrec)=aatarn(2)\n if(aatfc(1).eq.10) go to 120\n entry(aatarn(1))=.true.\n exit(aatarn(2))=.true.\n fcarr(aatrec)=aatfc(1)\n\nc for HOV lanes sum up unadjusted and adjusted times on adjacent main lanes\n\n if(aatfc(1).eq.1) then\n do id=1,mxid\n if(hovfwy(id).eq.aatid) then\n xdist=aatlen/5280.0\n dsum(id)=dsum(id)+xdist\n if(aatspd(1).lt.1.or.aatspd(1).gt.75) aatspd(1)=mspd(aatfc(1))\n if(aattspd(1).lt.1.or.aattspd(1).gt.75) \n * aattspd(1)=mtspd(aatfc(1))\n ispd=aatspd(1)\n tisum(id)=tisum(id)+xdist/float(ispd)\n if(aatasp.gt.0.and.aatasp.le.75) ispd=aatasp\n tasum(id)=tasum(id)+xdist/float(ispd)\n end if\n end do\n end if\n 107 if(aatway(1).eq.1) go to 128\n entry(aatarn(2))=.true.\n exit(aatarn(1))=.true.\n go to 128\n 120 fcarr(aatrec)=aatfc(1)\n go to 128\n 128 aatrec=aatrec+1\n if(aatrec.le.mxhca) go to 100\n write(lunerr,19128) \n errf=.true.\n go to 9999\n 129 if(stop) go to 9999\n naat=aatrec-1\n write(0,11004) naat\n if(stop) go to 9999\n do id=1,mxid\n denom=tisum(id)\n if(denom.gt.0.0)\n *tisum(id)=dsum(id)/denom\n denom=tasum(id)\n if(denom.gt.0.0)\n *tasum(id)=5.0+dsum(id)/denom\n end do\n fnamo='info/arc.dir'\n open(unit=lunin,convert='big_endian',file=fnamo,access=\n *'direct',form='unformatted',recl=95,status='old',err=9000)\n infrec=1\n 132 read(lunin,rec=infrec,iostat=istat) extnam,intnam,idat\n if(istat.ne.0) go to 9130\n i=index(extnam,'HWYCOV.TRN')\n if(i.gt.0) go to 133\n infrec=infrec+1\n go to 132\n 133 write(fnamo,20130) (intnam(i),i=4,7)\n close(lunin)\n open(unit=tatlun,convert='big_endian',file=fnamo,access=\n *'direct',form='unformatted',recl=7,status='old',err=9000) \nc\nc preset arcs on same route as through move\nc\n tatrec=1\n 134 call rhct\n if(tatio.ne.0) go to 139\n if(fcarr(tatlb2).eq.10) go to 138\n if(lbrt(tatlb1).ne.lbrt(tatlb2)) go to 138\n if(tatlb.eq.n1arr(tatlb1)) then\n idir=1\n else\n if(tatlb.eq.n2arr(tatlb1)) then\n idir=2\n else\n go to 9140\n endif\n endif\n ipos=1\n if(xlb(idir,tatlb1,ipos).gt.0) go to 138\n xlb(idir,tatlb1,ipos)=tatlb2\n xang(idir,tatlb1,ipos)=iang\n 138 tatrec=tatrec+1\n go to 134\n 139 tatrec=1\n 140 call rhct\n if(tatio.ne.0) go to 149\n if(fcarr(tatlb2).eq.10) go to 148\n if(lbrt(tatlb1).eq.lbrt(tatlb2)) go to 148\n iang=nint(tatang)\n if(tatlb.eq.n1arr(tatlb1)) then\n idir=1\n else\n if(tatlb.eq.n2arr(tatlb1)) then\n idir=2\n else\n go to 9140\n endif\n endif\n ipos=2\n if(iang.gt.0) ipos=3\n if(iang.gt.-45.and.iang.le.45) ipos=1\n if(tatlb1.eq.22011) then\n print *,tatlb1\n endif\n if(xlb(idir,tatlb1,ipos).gt.0) go to 141\n xlb(idir,tatlb1,ipos)=tatlb2\n xang(idir,tatlb1,ipos)=iang\n go to 148\n 141 idiff1=abs(angle(ipos)-xang(idir,tatlb1,ipos))\n idiff2=abs(angle(ipos)-iang)\n if(idiff1.gt.idiff2) go to 144\n mdiff=999\n mpos=0\n do 142 jpos=1,3\n if(jpos.eq.ipos) go to 142\n idiff=abs(angle(jpos)-iang)\n if(idiff.lt.mdiff) then\n mdiff=idiff\n mpos=jpos\n endif\n 142 continue\n if(xlb(idir,tatlb1,mpos).gt.0) go to 143\n xlb(idir,tatlb1,mpos)=tatlb2\n xang(idir,tatlb1,mpos)=iang\n go to 148\n 143 idiff1=abs(angle(mpos)-xang(idir,tatlb1,mpos))\n idiff2=abs(angle(mpos)-iang)\n if(idiff2.gt.idiff1) go to 148\n xlb(idir,tatlb1,mpos)=tatlb2\n xang(idir,tatlb1,mpos)=iang\n go to 148\n 144 kang=xang(idir,tatlb1,ipos)\n klb=xlb(idir,tatlb1,ipos)\n xlb(idir,tatlb1,ipos)=tatlb2\n xang(idir,tatlb1,ipos)=iang\n mdiff=999\n mpos=0\n do 145 jpos=1,3\n if(jpos.eq.ipos) go to 145\n idiff=abs(angle(jpos)-kang)\n if(idiff.lt.mdiff) then\n mdiff=idiff\n mpos=jpos\n endif\n 145 continue\n if(xlb(idir,tatlb1,mpos).gt.0) go to 146\n xlb(idir,tatlb1,mpos)=klb\n xang(idir,tatlb1,mpos)=kang\n go to 148\n 146 idiff1=abs(angle(mpos)-xang(idir,tatlb1,mpos))\n idiff2=abs(angle(mpos)-kang)\n if(idiff2.gt.idiff1) go to 148\n xlb(idir,tatlb1,mpos)=klb\n xang(idir,tatlb1,mpos)=kang\n 148 tatrec=tatrec+1\n go to 140\n 149 tatrec=1\n 150 call rhct\n if(tatio.ne.0) go to 159\n if(fcarr(tatlb2).ne.10) go to 158\n iang=nint(tatang)\n if(tatlb.eq.n1arr(tatlb1)) then\n idir=1\n else\n if(tatlb.eq.n2arr(tatlb1)) then\n idir=2\n else\n go to 9140\n endif\n endif\n ipos=2\n if(iang.gt.0) ipos=3\n if(iang.gt.-45.and.iang.le.45) ipos=1\n if(xlb(idir,tatlb1,ipos).gt.0) go to 158\n xlb(idir,tatlb1,ipos)=tatlb2\n xang(idir,tatlb1,ipos)=iang\n 158 tatrec=tatrec+1\n go to 150\nc\nc sort records end-to-end by name.\nc\n 159 write(0,11006)\n call recsrt\n do 398 i=1,naat\n if(srec(i).ne.0) go to 398\n write(0,19399) i\n stop=.true.\n 398 continue\n if(stop) go to 9999\n write(0,11008)\nc\nc rhca nat file\nc\n write(0,11010)\n call ohcn\n natrec=1\n\n\nc\nc read node point attribute table saving arrays of node data\nc for node\nc\n 410 call rhcn\n if(natio.ne.0) go to 419\n if(nattpn.lt.1.or.nattpn.gt.mxtpn) go to 9000\n xnode(nattpn)=float(natx)\n ynode(nattpn)=float(naty)\n nattmp=0\n if(natlb.gt.0.and.natlb.le.mnode) go to 412\n nattmp=1\n write(lunerr,19411) natlb,natxnm(1),natxnm(2)\n errf=.true.\n go to 418\n 412 snode(natlb)=natsph\n cnnode(natlb)=natcnt(1)\n if(xdapp(natlb).gt.4) xdapp(natlb)=4\n if(xdapp(natlb).lt.2) xdapp(natlb)=2\n if(nattpn.gt.0.and.nattpn.le.mxtpn) go to 413\n nattmp=2\n write(lunerr,19412) natlb,nattpn,natxnm(1),natxnm(2)\n errf=.true.\n go to 418\n 413 jjxy=natx+naty\n if(tpxy(nattpn).gt.0) go to 414\n tpxy(nattpn)=jjxy\n go to 418\n 414 if(tpxy(nattpn).eq.jjxy) go to 415\n nattmp=3\n write(lunerr,19413) natlb,nattpn,natxnm(1),natxnm(2)\n errf=.true.\n go to 418\n 415 if(xapp(natlb).lt.5) go to 416\n nattmp=4\n write(luninf,19414) natlb,natxnm(1),natxnm(2)\n inff=.true.\n go to 418\n 416 if(natcnt(1).ne.3) go to 418\n idiff=xapp(natlb)-xstop(natlb)\n if(idiff.lt.3) go to 418\n nattmp=5\n write(luninf,19415) natrec,natxnm(1),natxnm(2)\n inff=.true.\n 418 natiuc=(natcnt(1)+1)*10+1\nc\nc insert hnode into nodeid for exporting to transCAD \n natid=nattpn\n call whcn\n natrec=natrec+1\n go to 410\n 419 close(natlun)\nc\nc reread aat for final time in route-link order.\nc\n iaat=1\n iline=99\n ipage=1\n isec=20000\n secdst=0.0\n 500 irtno=rlkarr(iaat)/1000\n ilkno=rlkarr(iaat)-irtno*1000\n aatrec=srec(iaat)\n krec=0\n isec=isec+1\n secdst=0.0\n 501 call rhca\n if(aatio.ne.0) go to 9000\n if(aatarn(2).lt.1.or.aatarn(2).gt.mxhcn) aatarn(2)=mxhcn\n if(aatarn(1).lt.1.or.aatarn(1).gt.mxhcn) aatarn(1)=mxhcn\n\tif (aatfc(1).gt.1.and.aatfc(1).lt.8)then\n\t aatvol=0\n\t if (aatadt.gt.0.and.adthst(aatadt).gt.0)aatvol=adthst(aatadt)\n\tendif\n extcst=0\n isph=snode(aatarn(2))/100\n jsph=snode(aatarn(1))/100\n inc=1 \n if(isph.eq.19.or.jsph.eq.19) inc=2 \n ijur=aatjur(1)+3\n if(ijur.eq.4) ijur=3\n if(ijur.eq.3.and.aatfc(1).eq.1) ijur=1\n if(aatfc(1).eq.1.and.(aathov(1).eq.2.or.aathov(1).eq.3)) ijur=2\n if(ijur.eq.3.and.aatfc(1).eq.8) ijur=4\n if(ijur.eq.3.and.aatfc(1).eq.9) ijur=4\n if(nid(aatid).eq.0) go to 504\n do 502 i=1,mxid\n if(nid(i).eq.0) go to 504\n 502 continue\n go to 9502\n 503 aatid=i\n 504 nid(aatid)=nid(aatid)+1\n aattmp(1)=0\n aattmp(2)=0\n if(aatfc(1).eq.10) go to 511\n if(.not.entry(aatarn(2))) go to 505\n if(.not.exit(aatarn(2))) go to 505\n if(.not.entry(aatarn(1))) go to 505\n if(.not.exit(aatarn(1))) go to 505\n go to 510\n 505 write(luninf,19505)\n *aatid,aatnm,aatxnm(2),aatxnm(1),aatarn(2),aatarn(1)\n aattmp(1)=1\n inff=.true.\n 510 if(aatfc(1).ge.1.and.aatfc(1).le.mxfc) go to 511\n aattmp(1)=2\n write(lunerr,19510) aatid,aatnm,aatxnm(2),aatxnm(1),aatfc(1)\n errf=.true.\n stop=.true.\n go to 878\n 511 if(aatfc(1).eq.1) go to 516\n if(aatid.eq.14836) then\n print *, aatid\n endif\n do 513 idir=1,2\n if(aatway(1).eq.1.and.idir.gt.1) go to 513\n aattlb(idir)=xlb(idir,aatlb,1)\n aatrlb(idir)=xlb(idir,aatlb,2)\n aatllb(idir)=xlb(idir,aatlb,3)\nc\nc for ramps add turn probibitors for when through link is also a ramp and link\nc itersects with arterial\nc\n if(aatfc(1).eq.9) then\n ilb=aattlb(idir)\n if(ilb.gt.0.and.lbfc(ilb).eq.9) then\n id=lbid(ilb)\n ilb=(aatrlb(idir))\n irfc=0\n if(ilb.gt.0) irfc=lbfc(ilb)\n ilb=(aatllb(idir))\n ilfc=0\n if(ilb.gt.0) ilfc=lbfc(ilb)\n if(irfc.ge.2.and.irfc.le.7) then\n write(luno,20925) aatid,id\n else\n if(ilfc.ge.2.and.ilfc.le.7) write(luno,20925) aatid,id\n endif \n endif \n endif \n aatxfc(idir)=7\n tatlb1=xlb(idir,aatlb,2)\n tatlb2=xlb(idir,aatlb,3)\n ifc1=10\n ifc2=10\n if(tatlb1.gt.0) ifc1=fcarr(tatlb1)\n if(tatlb2.gt.0) ifc2=fcarr(tatlb2)\n if(ifc2.lt.ifc1) go to 512\n ifc=ifc1\n if(ifc.lt.10) aatxnm(idir)=nmarr(tatlb1)\n if(ifc.lt.2.or.ifc.gt.7) go to 513\n aatxfc(idir)=ifc \n go to 513\n 512 ifc=ifc2\n if(ifc.lt.10) aatxnm(idir)=nmarr(tatlb2)\n if(ifc.lt.2.or.ifc.gt.7) go to 513\n aatxfc(idir)=ifc\n 513 continue\n go to 520\n 516 aatxfc(1)=7\n aatxfc(2)=7\n 520 iln=aatln(1,1,1)+aatln(1,2,1)\n if(aatfc(1).eq.10) go to 580\n aatsec=aatadt\n if(aatsec.gt.0) go to 530\n secdst=secdst+aatlen\n if(aatxfc(1).le.3.and.secdst.gt.5280.0) go to 525\n aatsec=isec\n secdst=secdst+aatlen\n go to 530\n 525 isec=isec+1\n aatsec=isec\n secdst=aatlen\nc\nc fill in missing initial non-directional data with defaults.\nc\n 530 if(aatjur(1).lt.1.or.aatjur(1).gt.6) aatjur(1)=mjur(aatfc(1))\n if(aathov(1).lt.1.or.aathov(1).gt.4) aathov(1)=1\n if(aattrk(1).lt.1.or.aattrk(1).gt.7) aattrk(1)=1\n if(tasum(aatid).gt.50.0.and.tasum(aatid).lt.90.0) go to 531\n if(aatspd(1).lt.1.or.aatspd(1).gt.75) aatspd(1)=mspd(aatfc(1))\n if(aattspd(1).lt.1.or.aattspd(1).gt.75)\n * aattspd(1)=mtspd(aatfc(1))\n ispd=aatspd(1)\n if(aatasp.gt.0.and.aatasp.le.75) ispd=aatasp\n go to 532\n 531 ispd=nint(tisum(aatid))\n aatspd(1)=ispd\n ispd=nint(tasum(aatid))\n aatasp=ispd\n 532 if(aatway(1).lt.1.or.aatway(1).gt.2) aatway(1)=mway(aatfc(1))\n if(aatmed(1).lt.1.or.aatmed(1).gt.3) aatmed(1)=mmed(aatfc(1))\n do 539 idir=1,2\n if(idir.eq.2.and.aatway(1).eq.1) go to 537\n aatmln(idir)=0\n do 533 ipk=1,3\n if(aatln(ipk,idir,1).lt.1.or.aatln(ipk,idir,1).gt.8) go to 533\n aatmln(idir)=max(aatmln(idir),aatln(ipk,idir,1))\n 533 continue\n if(aatmln(idir).lt.1) aatmln(idir)=mln(aatfc(1))\n do 535 ipk=1,3\n if(aatln(ipk,idir,1).ge.1.and.aatln(ipk,idir,1).le.9) go to 535\n if(idir.eq.2) go to 534\n aatln(ipk,idir,1)=aatmln(idir)\n go to 535\n 534 aatln(ipk,idir,1)=aatln(ipk,1,1)\n 535 continue\n if(aataux(idir,1).lt.1.or.aataux(idir,1).gt.9) aataux(idir,1)=0\nc\nc determine control at aatarn(1) from node data\nc\n icnt=cnnode(aatarn(idir))\n if(icnt.eq.4.and.aatfc(1).eq.1) icnt=0\n if(icnt.eq.5.and.aatfc(1).eq.1) icnt=0\n if(icnt.eq.3) go to 536\n aatcnt(idir,1)=icnt\n if(aatcnt(idir,1).gt.8) aatcnt(idir,1)=0\n 536 if(aatcnt(idir,1).lt.1.or.aatcnt(idir,1).gt.7) go to 538\n if(aattl(idir,1).lt.1.or.aattl(idir,1).gt.9)\n *aattl(idir,1)=aatln(1,idir,1)\n if(aatrl(idir,1).lt.1.or.aatrl(idir,1).gt.9) aatrl(idir,1)=0\n if(aatll(idir,1).lt.1.or.aatll(idir,1).gt.9)\n *aatll(idir,1)=mlf(aatfc(1),aatcnt(idir,1))\n go to 539\n 537 aatln(1,idir,1)=0\n aatln(2,idir,1)=0\n aatln(3,idir,1)=0\n aataux(idir,1)=0\n aatcnt(idir,1)=0\n 538 aattl(idir,1)=0\n aatrl(idir,1)=0\n aatll(idir,1)=0\n 539 continue\n isph=snode(aatarn(2))/100\n jsph=snode(aatarn(1))/100\n go to 590\n 580 aatnm='zone connector'\n ian=aattpn(2)\n ibn=aattpn(1)\n in=ian\n jn=ibn\n if(ian.le.mxzn) go to 581\n if(ibn.le.mxzn) go to 582\n aattmp(1)=6\n write(lunerr,19580) aatid,ian,ibn,in\n errf=.true.\n go to 590\n 581 if(ibn.ge.mxzn) go to 583\n aattmp(1)=7\n write(lunerr,19581) aatrec,aatarn(2),aatarn(1),in\n errf=.true.\n go to 583\n 582 in=ibn\n jn=aatarn(2)\n aattmp(2)=1\n 583 zoneo(in)=.true.\n aatjur(1)=6\n aatway(1)=2\n aatspd(1)=znspd(zonety(in))\n aattspd(1)=znspd(zonety(in))\n ispd=aatspd(1)\n aatmed(1)=1\n aathov(1)=1\n aattrk(1)=1\n if (in.le.mxext) extcst=extadd(in)\n do 587 idir=1,2\n aataux(idir,1)=0\n aatln(1,idir,1)=1\n aatln(2,idir,1)=1\n aatln(3,idir,1)=1\n aatcnt(idir,1)=0\n aattl(idir,1)=0\n aatrl(idir,1)=0\n aatll(idir,1)=0\n 587 continue\n\nc save tdz nodes for shortest tdz connection to each route\n\n itdz=taztdz(in)\n aattmp(1)=itdz\n xz=xtdz(itdz)\n yz=ytdz(itdz)\n xn=xnode(jn)\n yn=ynode(jn)\n xdist=sqrt((xz-xn)**2+(yz-yn)**2) !distance from tdz centroid to node\n mzrt=tdzmrt(itdz)\n mnrt=nodemrt(jn)\n if(mzrt.gt.0) then !if tdz-route connenctions already exist then find out if this is a new one\n do irt=1,mnrt !loop through routes at this node\n irtno=nodert(jn,irt)\n new=.true.\n\n do jrt=1,mzrt !loop through existing connections\n jrtno=tdzrt(itdz,jrt)\n zdist=tdzrtdist(itdz,jrt)\n if(irtno.eq.jrtno) then !if new route matches old route then this isn't a new connection\n new=.false. \n if(xdist.lt.zdist) then !if it is an old connection this may be a shorter distance\n tdzrtdist(itdz,jrt)=xdist\n tdzrtnode(itdz,jrt)=jn\n end if !end of distance check\n end if !end of new connection check\n end do !end of extisting tdz-route connections loop\n\n if(new) then !if this is a new route connection then add to matrix \n mzrt=mzrt+1\n if(mzrt.gt.mxzrt) then\n write(lunerr,19582)\n errf=.true.\n go to 9999\n endif\n mmzrt=max(mmzrt,mzrt)\n tdzmrt(itdz)=mzrt\n tdzrt(itdz,mzrt)=irtno\n tdzrtdist(itdz,mzrt)=xdist\n tdzrtnode(itdz,mzrt)=jn\n tdzrtid(itdz,mzrt)=aatid !re-use id numbers for tdz connections\n endif !end of new check\n end do !end of loop through node routes\n else !this is the first connection for tdz\n\n do irt=1,mnrt !loop through routes at this node\n irtno=nodert(jn,irt)\n mzrt=mzrt+1\n tdzmrt(itdz)=mzrt\n tdzrt(itdz,mzrt)=irtno\n tdzrtdist(itdz,mzrt)=xdist\n tdzrtnode(itdz,mzrt)=jn\n tdzrtid(itdz,mzrt)=aatid !re-use id numbers for tdz connections\n end do !end of loop through node routes\n\n endif !end of number of connections check\nc\nc fill in fields needed for transcad\nc\n 590 xdist=aatlen/5280.0\n xspd=float(ispd)\n\nc convert per mile toll cost to actual toll\n\n do ipk=1,3\n xtoll=float(aattoll(ipk,1))*xdist+remtoll(ipk)\n itoll=nint(xtoll)\n remtoll(ipk)=xtoll-float(itoll)\nc added by jor and zou for ML tolling on very short links, July, 2010\n if(aattoll(ipk,1).gt.0.and.itoll.eq.0)itoll=1 \n aattoll(ipk,1)=itoll\n enddo\n xtime=xdist*60./xspd\n aatcst=xdist*15.\n ista=aatsta\n if(aathov(1).eq.2.or.aathov(1).eq.3) then\n ista=0\n ifwy=hovfwy(aatid)\n if(ifwy.gt.0) ista=fwysta(ifwy)\n endif\n if(ista.lt.1.or.ista.gt.mxbsta.or.aatfc(1).ne.1) ista=1\n do 699 idir=1,2\n aattc(idir)=999.999\n do 698 ipk=1,3\n aatlt(ipk,idir)=999.0\n aatxt(ipk,idir)=0.0\n aatlc(ipk,idir)=999999.0\n aatxc(ipk,idir)=999999.0 \n aathc(ipk,idir)=0.0\n if(aatway(1).eq.1.and.idir.eq.2) go to 698\n if(aatln(ipk,idir,1).eq.9) go to 698\n aatlt(ipk,idir)=xtime\n if(aatfc(1).eq.10) go to 698\n if(aatfc(1).eq.1) then\n iidir=1\n i=index(aatnm,'NB')\n if(i.gt.0) iidir=2\n i=index(aatnm,'WB')\n if(i.gt.0) iidir=2\n xppf=stappf(ipk,iidir,ista)\n if(xppf.lt.1.0.or.xppf.gt.15.0) then\n write(lunsta,19698) ista,xppf\nc errf=.true.\n xppf=stappf(ipk,iidir,1)\n endif\n else\n xppf=stappf(ipk,idir,ista)\n endif\n 591 fwycap=2000.0\n auxcap=1200.0\n iapp=xdapp(aatarn(idir))\n xadd=0.0\n if(aatfc(1).eq.1) go to 601\n if(aatfc(1).eq.8) go to 605\n if(aatfc(1).eq.9) go to 606\n if(aatplc(idir).eq.950.and.aatln(ipk,idir,1).lt.2) then\n xcap=950.0\n else\n xcap=float(aatln(ipk,idir,1))*1800.-300.\n if(aatmed(1).lt.2) xcap=xcap-200.\n endif\n go to 608\n 601 if(aathov(1).eq.2.or.aathov(1).eq.3) then\n !changed from 1600 to 2000. Consistent with GP Lanes\n xcap=float(aatln(ipk,idir,1))*2000.0 \n go to 608\n endif\n if(iyear.ge.2015) then\n if(aatadt.eq.552.or.aatadt.eq.553) aatplc(1)=2000\n if(aatsta.eq.935.or.aatsta.eq.980.or.aatsta.eq.999)\n * aatplc=2200\n endif\n if(aatplc(1).ge.1600.and.aatplc(1).le.2400)\n *fwycap=float(aatplc(1))\n fwycap=min(fwycap,2100.0)\n if(aatsta.ne.936) fwycap=max(fwycap,1900.0) ! don't let capacity go lower than 1900 except for SR-94 coming into CBD\n xcap=float(aatln(ipk,idir,1))*fwycap+float(aataux(idir,1))*auxcap\n if(.not.tsm) go to 608\n iadt=aatadt\n if(iadt.lt.1.or.iadt.gt.9999) iadt=9999\n imtr=adtmtr(iadt)\n if(imtr.lt.1) go to 608\n if(imtr.eq.9) go to 603\n iidir=0\n i=index(aatnm,'SB')\n if(i.gt.0) iidir=1\n i=index(aatnm,'EB')\n if(i.gt.0) iidir=2\n i=index(aatnm,'NB')\n if(i.gt.0) iidir=3\n i=index(aatnm,'WB')\n if(i.gt.0) iidir=4\n if(iidir.ne.imtr) go to 608\n 603 xcap=xcap*1.10\n fwycap=fwycap*1.10\n go to 608\n 605 i=index(aatnm,'ACCESS')\n if(i.gt.0) then\n aathc(ipk,idir)=9999\n aatlc(ipk,idir)=999999\n go to 609\n else\n xcap=float(aatln(ipk,idir,1))*1800.0\n go to 608\n endif\n 606 xcap=float(aatln(ipk,idir,1))*1200.0\n 608 aathc(ipk,idir)=xcap\n aatlc(ipk,idir)=xcap*xppf\n 609 ith=aattl(idir,1)\n irt=aatrl(idir,1)\n ilf=aatll(idir,1)\n if(ith.gt.7) ith=0\n if(irt.gt.7) irt=0\n if(ilf.gt.7) ilf=0\n if(ith.eq.7) ith=1\n if(irt.eq.7) irt=1\n if(ilf.eq.7) ilf=1\n if(ith.lt.1) then\n iapp=3\n if(irt.gt.ilf) then\n ith=irt\n irt=0\n else\n ith=ilf\n ilf=0\n endif\n endif\n if(aatcnt(idir,1).eq.1) go to 610\n if(aatcnt(idir,1).eq.2) go to 620\n if(aatcnt(idir,1).eq.3) go to 630\n if(aatcnt(idir,1).eq.4.and.ipk.gt.1) go to 640\n if(aatcnt(idir,1).eq.5.and.ipk.gt.1) go to 650\n if(aatcnt(idir,1).eq.6) go to 660\n if(aatcnt(idir,1).eq.7) go to 670 !toll booths\n go to 698\n 610 aatxt(ipk,idir)=0.17\n if(aatgc(idir).lt.10)\n *aatgc(idir)=gcsig(iapp,aatfc(1),aatxfc(idir))\n gcth=float(aatgc(idir))/100.0\n gcrt=float(aatgc(idir))/100.0\n xcap=float(ith)*1800.*gcth\n xlfcap=float((ilf+irt)*lfcap(aatfc(1)))\n xcap=xcap+xlfcap\n if(xcap.lt.1000.) xcap=1000.0\n aatxc(ipk,idir)=xcap*rsafac(aatjur(1))*xppf\n aathc(ipk,idir)=xcap*rsafac(aatjur(1))\n go to 698\n 620 aatxt(ipk,idir)=0.20\n if(aatgc(idir).lt.1)\n *aatgc(idir)=gcstp4(aatfc(1),aatxfc(idir))\n gcth=float(aatgc(idir))/100.0\n gcrt=float(aatgc(idir))/100.0\n xcap=float(ith)*1800.*gcth\n xlfcap=float((ilf+irt)*lfcap(aatfc(1)))\n xcap=xcap+xlfcap\n if(xcap.lt.500.) xcap=500.0\n aatxc(ipk,idir)=xcap*xppf\n aathc(ipk,idir)=xcap\n go to 698\n 630 aatxt(ipk,idir)=0.20\n aatgc(idir)=gcstp2(aatxfc(idir))\n gcth=float(aatgc(idir))/100.0\n gcrt=float(aatgc(idir))/100.0\n gclf=float(aatgc(idir))/100.0\n if(irt.ne.7) go to 632\n gcrt=1.0\n irt=1\n 632 xcap=float(ith)*500.*gcth+float(irt)*500.*gcrt+\n *float(ilf)*500.*gclf\n if(xcap.lt.500.) xcap=500.0\n aatxc(ipk,idir)=xcap*xppf\n aathc(ipk,idir)=xcap\n go to 698\n 640 aatxt(ipk,idir)=0.50\n xcap=1000.\n if(aatgc(idir).lt.1) go to 641\n gcth=float(aatgc(idir))/100.0\n xcap=xcap*gcth\n 641 aatxc(ipk,idir)=xcap*xppf\n aathc(ipk,idir)=xcap\n go to 698\n 650 aatxt(ipk,idir)=0.50\n xcap=1000.\n if(aatgc(idir).lt.1) go to 651\n gcth=float(aatgc(idir))/100.0\n xcap=xcap*gcth\n 651 aatxc(ipk,idir)=xcap*xppf\n aathc(ipk,idir)=xcap\n go to 698\nc 660 aatxc(ipk,idir)=float(ith+irt+ilf)*1300.*xppf !source of this equation is unknown\nc aathc(ipk,idir)=float(ith+irt+ilf)*1300.\n 660 aatxt(ipk,idir)=0.02 !RCU - changed to ~1 second delay/veh (T:\\data\\RailCrossingDelay.xls)\n go to 698\n 670 ith=aattl(idir,1)\n if(ith.lt.aatmln(idir)) ith=aatmln(idir)\n aatxc(ipk,idir)=float(ith)*500.*xppf !Period Intersection Capacity = 500 veh/lane/hr * # of lanes * peak period factor\n aathc(ipk,idir)=float(ith)*500. !Hourly Capacity = 500 veh/lane/hr * # of lanes\n i=index(aatnm,'BORDER')\n if(i.gt.0) go to 672\nc Sphere 3 = Coronado; Sphere 14 = City of SD; jsph = Destination Sphere\n if(jsph.ne.3.and.jsph.ne.14) go to 671\nc Coronado and City of SD section \n aatxt(ipk,idir)=1.0 !Intersection time = 1 minute\n if(ipk.eq.1.and.idir.eq.1) aatcst=aatcst+50.0 !Extra cost (toll booth) = 50 cents\n go to 698\nc Other Cities section\n 671 aatxt(ipk,idir)=1.0 !Intersection time = 1 minute\n if(ipk.eq.1.and.idir.eq.1) aatcst=aatcst+25.0 !Extra cost (toll booth) = 25 cents\n go to 698\n 672 i=index(aatnm,'YSIDRO')\n if(i.gt.0) ibord=1\n i=index(aatnm,'OTAY')\n if(i.gt.0) ibord=2\n i=index(aatnm,'EAST')\n if(i.gt.0) ibord=3\n i=index(aatnm,'TECATE')\n if(i.gt.0) ibord=4\n i=index(aatnm,'JACUMBA')\n if(i.gt.0) ibord=5\n iidir=1\n i=index(aatnm,'NB')\n if(i.gt.0) iidir=2\n aatxt(ipk,idir)=bordel(ibord,ipk,iidir)\n 698 continue\n if(aatfc(1).eq.1) aatplc(idir)=nint(fwycap)\n if(idir.ne.1) go to 6981\n if(aathov(1).eq.2.or.aathov(1).eq.3) go to 6981\n i=index(aatnm,'AUX')\n if(i.gt.0) go to 6981\n frmile(aatfc(1))=frmile(aatfc(1))+xdist\n if(aatfc(1).ne.10)\n *jrmile(inc,ijur)=jrmile(inc,ijur)+xdist\n 6981 if(aatway(1).eq.1.and.idir.eq.2) go to 699\n ihov=1\n if(aathov(1).eq.2.or.aathov(1).eq.3) ihov=2\n xlanes=float(aatln(2,idir,1))\n xauxlanes=float(aataux(idir,1))\n if(xlanes.gt.8) then\n xlanes=0.0\n else\n xlanes=xlanes+xauxlanes\n endif\n xmile=xdist*xlanes\n flmile(ihov,aatfc(1))=flmile(ihov,aatfc(1))+xmile\n fcmile(aatfc(1))=fcmile(aatfc(1))+xdist*aathc(2,idir)\nc\t August 4, 2009, modified by ZOU,\nc use AM period lane and AM period time,to avoid reversible lane with\nc abtmo = 999\n frhour(aatfc(1))=frhour(aatfc(1))+\n *aatlt(2,idir)*xlanes/60.0\n aattc(idir)=extcst+aatcst+(aatlt(1,idir)+aatxt(1,idir))*35.0+\n *float(aattoll(1,1)+aattoll(2,1))/2.0\n if(ibord.gt.0) then\n do 6982 i=1,3\n aatlt(i,idir)=aatlt(i,idir)+aatxt(1,idir)\n ibord=0\n 6982 continue\n end if\n if(aattc(idir).gt.999999.) aattc(idir)=999999.\n if(aatfc(1).eq.10) go to 699\n jlmile(inc,ijur)=jlmile(inc,ijur)+xmile\n jcmile(inc,ijur)=jcmile(inc,ijur)+xdist*aathc(2,idir)\nc\t August 4, 2009, modified by ZOU,\nc use AM period lane and AM period time,to avoid reversible lane with\nc abtmo = 999\n jrhour(inc,ijur)=jrhour(inc,ijur)+aatlt(2,idir)*xlanes/60.0\n 699 continue\n aatcc=aatfc(1)\n call whca\n idir=1\nc frmile(aatfc(1))=frmile(aatfc(1))+xdist\nc if(aatfc(1).ne.10)\nc *jrmile(inc,ijur)=jrmile(inc,ijur)+xdist\nc flmile(1,aatfc(1))=flmile(1,aatfc(1))+xdist\nc frhour(aatfc(1))=frhour(aatfc(1))+\nc *aatlt(1,idir)/60.0\nc\nc check to see whether link aatfc(1),jur,and gpa has been selected\nc for printing.\nc\n if(pfc(1).eq.9999) go to 864\n do 863 i=1,15\n if(pfc(i).eq.0) go to 878\n if(pfc(i).eq.aatfc(1)) go to 864\n 863 continue\n go to 878\n 864 if(pjur(1).eq.9999) go to 866\n do 865 i=1,4\n if(pjur(i).eq.0) go to 878\n if(pjur(i).eq.aatjur(1)) go to 866\n 865 continue\n go to 878\n 866 if(psph(1).eq.9999) go to 870\n do 867 i=1,20\n if(psph(i).eq.0) go to 878\n if(psph(i).eq.snode(aatarn(2))) go to 870\n if(psph(i).eq.snode(aatarn(1))) go to 870\n if(psph(i).eq.1400.and.isph.eq.14) go to 870\n if(psph(i).eq.1400.and.jsph.eq.14) go to 870\n if(psph(i).eq.1900.and.isph.eq.19) go to 870\n if(psph(i).eq.1900.and.jsph.eq.19) go to 870\n 867 continue\n go to 878\nc\nc print out from-to data\nc\n 870 ift=1\n if(first) go to 872\n\n if(iline.lt.60) go to 875\n iline=6\n write(lunpr,20000) eject,cdate,ipage,cheado\n eject = char(12)\n write(lunpr,20003)\n ipage=ipage+1\n go to 875\n 872 if(iline.lt.52) go to 873\n write(lunpr,20000) eject,cdate,ipage,cheado\n eject = char(12)\n ipage=ipage+1\n iline=5\n 873 write(lunpr,20001)\n *aatrt,aatnm,nway(aatway(1)),nrdir(aatdir),aatxnm(2)\n iline=iline+3\n first=.false.\n 875 xop=aatlt(3,1)\n xpk=aatlt(1,1)\n write(lunpr,20002) aatrec,aatid,aatxnm(1),\n *nfc(aatfc(1)),nhov(aathov(1)),njur(aatjur(1)),ispd,\n *nmed(aatmed(1)),(nln(aatln(idir,1,1)+1),idir=1,3),\n *aataux(1,1),ncnt(aatcnt(1,1)+1),nxl(aattl(1,1)+1),\n *nxl(aatrl(1,1)+1),nxl(aatll(1,1)+1),\n *aatgc(1),xdist,xop,xpk,\n *(aathc(idir,1),idir=1,3)\n iline=iline+1\nc\nc store tf data for printing at end of route\nc\n krec=krec+1\n if(krec.lt.mxrlk) go to 877\n write(lunerr,19875) mxrlk,aatnm\n errf=.true.\n krec=mxrlk\n 877 krno(krec)=aatrec\n kid(krec)=aatid\n kdist(krec)=idist\n kname(krec)=aatxnm(2)\n\n jur(krec)=aatjur(1)\n fc(krec)=aatfc(1)\n hov(krec)=aathov(1)\n spd(krec)=ispd\n med(krec)=aatmed(1)\n tfln(1,krec)=aatln(1,2,1)\n tfln(2,krec)=aatln(2,2,1)\n tfln(3,krec)=aatln(3,2,1)\n tfaux(krec)=aataux(2,1)\n tfcnt(krec)=aatcnt(2,1)\n tftl(krec)=aattl(2,1)\n tfrl(krec)=aatrl(2,1)\n tfll(krec)=aatll(2,1)\n tfgc(krec)=aatgc(2)\n tfotm(krec)=aatlt(3,2)\n tfptm(krec)=aatlt(1,2)\n tfcap(1,krec)=aatlc(1,2)\n tfcap(2,krec)=aatlc(2,2)\n tfcap(3,krec)=aatlc(3,2)\n name1=aatxnm(1)\n 878 iaat=iaat+1\n if(iaat.gt.naat) go to 879\n lrtno=aatrt\n irtno=rlkarr(iaat)/1000\n ilkno=rlkarr(iaat)-irtno*1000\n aatrec=srec(iaat)\n if(irtno.ne.lrtno) go to 880\n go to 501\n\n 879 endf=.true.\n 880 first=.true.\n if(aatway(1).eq.1) go to 889\n if(krec.lt.1) go to 889\n if(iline.lt.52) go to 882\n write(lunpr,20000) eject,cdate,ipage,cheado\n ipage=ipage+1\n iline=6\n 882 if(aatdir.eq.1) jdir=3\n if(aatdir.eq.2) jdir=4\n if(aatdir.eq.3) jdir=1\n if(aatdir.eq.4) jdir=2\n ift=2\n write(lunpr,20001) aatrt,aatnm,nway(aatway(1)),nrdir(jdir),name1\n iline=iline+3\n do 888 i=1,krec\n ii=krec-i+1\n if(iline.lt.60) go to 883\n iline=6\n write(lunpr,20000) eject,cdate,ipage\n write(lunpr,20003)\n ipage=ipage+1\n 883 aatrec=krno(ii)\n aatid=kid(ii)\n xdist=float(kdist(ii))/100.0\n aatxnm(1)=kname(ii)\n aatjur(1)=jur(ii)\n aatfc(1)=fc(ii)\n aathov(1)=hov(ii)\n ispd=spd(ii)\n aatmed(1)=med(ii)\n aatln(1,1,1)=tfln(1,ii)\n aatln(2,1,1)=tfln(2,ii)\n aatln(3,1,1)=tfln(3,ii)\n aataux(1,1)=tfaux(ii)\n aatcnt(1,1)=tfcnt(ii)\n aattl(1,1)=tftl(ii)\n aatrl(1,1)=tfrl(ii)\n aatll(1,1)=tfll(ii)\n aatgc(1)=tfgc(ii)\n xop=float(tfotm(ii))\n xpk=float(tfptm(ii))\n aatlc(1,1)=tfcap(1,ii)\n aatlc(2,1)=tfcap(2,ii)\n aatlc(3,1)=tfcap(3,ii)\n write(lunpr,20002) aatrec,aatid,aatxnm(1),\n *nfc(aatfc(1)),nhov(aathov(1)),njur(aatjur(1)),ispd,\n *nmed(aatmed(1)),(nln(aatln(idir,1,1)+1),idir=1,3),\n *aataux(1,1),ncnt(aatcnt(1,1)+1),nxl(aattl(1,1)+1),\n *nxl(aatrl(1,1)+1),nxl(aatll(1,1)+1),\n *aatgc(1),xdist,xop,xpk,\n *(aathc(idir,1),idir=1,3)\n iline=iline+1\n 888 continue\n 889 if(endf) go to 890\n go to 500\n 890 write(0,11011) naat\n close(lunin)\n\nc write out tdz zone connector generate records\n \n print *, mmzrt\n do itdz=1,mxtdz !loop through tdzs\n mzrt=tdzmrt(itdz)\n if(mzrt.lt.1) then !make sure at lest one connection was found for tdz\n write(lunerr,19891) itdz\n errf=.true.\n else\n \n do irt=1,mzrt !loop through route connections for this tdz\n in=tdzrtnode(itdz,irt)\n id=tdzrtid(itdz,irt)\n if(.not.nused(in)) then !check to see if tdz-node connection was already made for previous route\nC\tAdded by Ziying Ouyang, Oct 29, 2009 for error checking\t\n\t if (xtdz(itdz).gt.0.and.ytdz(itdz).gt.0) then\t \n write(lunxy,20401) \n * id,xtdz(itdz),ytdz(itdz),xnode(in),ynode(in)\n nused(in)=.true.\n\t else\n write(lunerr,19915) id,itdz !invalid x y coordinates\n\t endif\n\t endif\n end do !end of route connection loop\n\n\t do in=1,mxhcn !reset node used to zero\n nused(in)=.false.\n end do\n end if !end of check fo tdz connections\n end do ! end of tdz loop\n write(lunxy,20409) \nc\nc write out turn prohibitor records\nc\nc\nc open turnssec file\nc \n 900 endf=.false.\n call ohctus\n if(secio.ne.0) go to 9000\n secrec=1 \n call rhctus\n if(secio.ne.0) go to 9000\n if(alink.lt.1.or.alink.gt.mxhca) go to 9910\n aatid=lbid(alink)\n ifc=lbfc(alink)\n go to 917 \nc\nc read section attribute table saving aatlbs used as prohibitors\nc\n 911 call rhctus\n if(secio.ne.0) go to 919\n if(alink.lt.1.or.alink.gt.mxhca) go to 9910\n aatid=lbid(alink)\n ifc=lbfc(alink)\n if(rlink.ne.lrlink) go to 915\n id2=aatid\n if(ifc.ne.lfc) go to 912\n go to 918\n 912 write(luno,20925) lid,aatid\n used=.true.\n lfc=ifc\n lid=aatid\n go to 918\n 915 if(used) go to 917\n if(id1.gt.0.and.id2.gt.0) go to 916\nc write(lunerr,19920) id1,id2\n go to 917\n 916 write(luno,20925) id1,id2\n 917 id1=aatid\n lrlink=rlink\n lfc=ifc\n lid=aatid\n id2=0\n used=.false.\n 918 if(endf) go to 980\n secrec=secrec+1\n go to 911\n 919 endf=.true.\n go to 915\n 980 close(luno)\n write(lunsum,20980) ctime,cdate,cheado\n frmile(1)=frmile(1)/2.0\n jrmile(1,1)=jrmile(1,1)/2.0\n jrmile(2,1)=jrmile(2,1)/2.0\n do 981 ifc=1,9\n frmile(11)=frmile(11)+frmile(ifc)\n flmile(1,11)=flmile(1,11)+flmile(1,ifc)\n flmile(2,11)=flmile(2,11)+flmile(2,ifc)\n fcmile(11)=fcmile(11)+fcmile(ifc)\n frhour(11)=frhour(11)+frhour(ifc)\n 981 continue\n ifc=10\n frmile(12)=frmile(11)+frmile(ifc)\n flmile(1,12)=flmile(1,11)+flmile(1,ifc)\n flmile(2,12)=flmile(2,11)+flmile(2,ifc)\n fcmile(12)=fcmile(11)+fcmile(ifc)\n frhour(12)=frhour(11)+frhour(ifc)\n do 983 ihov=1,2\n do 982 ifc=1,12\n flmile(3,ifc)=flmile(3,ifc)+flmile(ihov,ifc)\n 982 continue\n 983 continue\n do 984 ifc=1,9\n if(frhour(ifc).lt.0.01) go to 984\n frhour(ifc)=flmile(3,ifc)/frhour(ifc)\n write(lunsum,20981)\n *nfc(ifc),frmile(ifc),flmile(3,ifc),fcmile(ifc),frhour(ifc)\n 984 continue\n ifc=11\n frhour(ifc)=flmile(3,ifc)/frhour(ifc)\n write(lunsum,20981)\n *nfc(ifc),frmile(ifc),flmile(3,ifc),fcmile(ifc),frhour(ifc)\n ifc=10\n frhour(ifc)=flmile(3,ifc)/frhour(ifc)\n write(lunsum,20981)\n *nfc(ifc),frmile(ifc),flmile(3,ifc),fcmile(ifc),frhour(ifc)\n ifc=12\n frhour(ifc)=flmile(3,ifc)/frhour(ifc)\n write(lunsum,20981)\n *nfc(ifc),frmile(ifc),flmile(3,ifc),fcmile(ifc),frhour(ifc)\n write(lunsum,20982) eject,ctime,cdate,cheado\n do inc=1,2\n do ijur=1,9\n jrmile(inc,10)=jrmile(inc,10)+jrmile(inc,ijur)\n jlmile(inc,10)=jlmile(inc,10)+jlmile(inc,ijur)\n jcmile(inc,10)=jcmile(inc,10)+jcmile(inc,ijur)\n jrhour(inc,10)=jrhour(inc,10)+jrhour(inc,ijur)\n end do\n end do\n do inc=1,2\n do ijur=1,10\n jrmile(3,ijur)=jrmile(3,ijur)+jrmile(inc,ijur)\n jlmile(3,ijur)=jlmile(3,ijur)+jlmile(inc,ijur)\n jcmile(3,ijur)=jcmile(3,ijur)+jcmile(inc,ijur)\n jrhour(3,ijur)=jrhour(3,ijur)+jrhour(inc,ijur)\n end do\n end do\n do inc=1,3\n do ijur=1,10\n if(jrhour(inc,ijur).gt.0.0) then\n jrhour(inc,ijur)=jlmile(inc,ijur)/jrhour(inc,ijur)\n write(lunsum,20983) nminc(inc),nmjur(ijur),jrmile(inc,ijur),\n *jlmile(inc,ijur),jcmile(inc,ijur),jrhour(inc,ijur)\n endif\n end do\n write(lunsum,20003)\n end do\n close(lunsum)\n open (unit=lunsum,file='summary.csv',access='append')\n ix=nint(flmile(3,1))\n write(lunsum,20901) ialt,cheadi,cdate,ctime,ix\n ix=nint(flmile(2,1))\n write(lunsum,20902) ialt,cheadi,cdate,ctime,ix\n close(lunsum)\n fnamo='complete'\n lunze=0\n do 992 i=1,mzone\n if(zoneo(i)) go to 992\n if(lunze.ne.0) go to 991\n write(lunerr,19991) i\n errf=.true.\n lunze=15\n open (unit=lunze,file='zone.err')\n 991 write(lunze,10001) i\n 992 continue\n if(lunze.ne.0) close(lunze)\n\nc if toll facilities or hov3+ facilities found then write out flag files\n\n fnami='hov3' \n call opendata(lunin)\n if(istat.eq.0) close(lunin,status='delete')\n if(hov3) then \n open(lunin,file='hov3')\n write(lunin,20003)\n close(lunin)\n endif\n\n fnami='hot3' \n call opendata(lunin)\n if(istat.eq.0) close(lunin,status='delete')\n if(hot3) then \n open(lunin,file='hot3')\n write(lunin,20003)\n close(lunin)\n endif\n\n fnami='toll' \n call opendata(lunin)\n if(istat.eq.0) close(lunin,status='delete')\n if(toll) then \n open(lunin,file='toll')\n write(lunin,20003)\n close(lunin)\n endif\n\n go to 9999\n\n 9000 write(lunerr,19000) fnamo\n errf=.true.\n go to 9999\n 9001 write(lunerr,19001) fnamo\n errf=.true.\n go to 9999\n 9030 write(lunerr,19030) aatadt\n errf=.true.\n go to 30\n 9070 write(lunerr,19070) fnamo,ista\n errf=.true.\n go to 9999\n 9130 write(lunerr,19130) \n errf=.true.\n go to 9999\n 9140 write(lunerr,19140) \n errf=.true.\n go to 9999\n 9502 write(lunerr,19502)\n errf=.true.\n go to 9999 \n 9910 write(lunerr,19910) alink,rlink\n errf=.true.\n go to 917\n10000 format(80i1,t1,80a1)\n10001 format(20i4)\n10002 format(i2,80a1)\n10003 format(80a1)\n10009 format(a1)\n10030 format(5x,9(3x,i2))\n10033 format(i7,29(f7.0,2x))\n10040 format(11x,6f6.1)\n10060 format(i8,a2)\n10070 format(2i5,24f5.2)\n11002 format(' ** reading and storing hwycov data ** ')\n11004 format(' ** ',i6,' records read - - initial reading of aat',\n *' complete **')\n11005 format(' ** finding cross street names **')\n11006 format(' ** sorting records end-to-end by name **')\n11008 format(' ** reading and writing node attribute table **')\n11010 format(' ** reading and writing arc attribute table **')\n11011 format(' ** ',i5,' records written - - successful program',\n *' completion **')\n19030 format(' data problem with histfill file:',i10)\n20000 format(a1,1x,a8,t57,'highway coverage arc data',\n *t130,'page',i4,/,t30,80a1,//,\n *' rec arc functional ',\n *'--lanes-- lanes ---minutes---',\n *' ------hourly-----'/,\n *' no id cross street name class hov jur spd med ',\n *' main aux control t r l gc miles offpeak peak',\n *' capacity')\n20001 format(/,t36,'route number: ',i4,' name: ',a20,1x,a7,1x,a12,/,\n *13x,a20)\n20002 format(2i6,1x,a20,1x,a11,1x,a4,1x,a3,i4,1x,a3,1x,2(a1,'/'),a1,\n *i4,2x,a6,3(1x,a1),i3,1x,f6.2,f8.2,f6.2,1x,2(f6.0,'/'),f6.0)\n20003 format(' ')\n20401 format(i10,/,f8.0,',',f8.0,/,f8.0,',',f8.0,/,'END')\n20409 format('END')\n20901 format(i2,','80a1,',47,total freeway lane miles,\"',\n *a7,'\",\"',a8,'\",',i10,',')\n20902 format(i2,','80a1,',48,hov freeway lane miles,\"',\n *a7,'\",\"',a8,'\",',i10,',')\n20920 format('from_id,to_id,penalty')\n20925 format(i5,',',i5)\n20980 format(1x,a8,t29,'highway network summary',t72,a8,/,80a1,//,\n *' functional',/,\n *' classification route miles lane miles',\n *' capacity miles average speed',/)\n20981 format(1x,a11,t20,f12.0,f14.0,f19.0,f16.1)\n20982 format(a1,a8,t37,'highway network summary',t78,a8,/,80a1,//,\n *'location jurisdiction route miles',\n *' lane miles capacity miles average speed',/)\n20983 format(a19,1x,a17,f19.0,f14.0,f19.0,f16.1)\n30001 format(i5,i5,i1,i4,'t',2i4,4i2,i6,i1,i5,'1')\n30002 format(i5,i5,i1,i4,'t',i4,4x,4i2,i6,i1,i5,'2')\n19000 format(a50,' not opened')\n19001 format(' data problem with file: ',a80/,80a1)\n19070 format(' data problem with file: ',a80/,i10)\n19100 format(' invalid node in arc attribute table: ',/,\n *' record=',i5,'node = ',i5,' name=',a20,'xname = ',a20)\n19101 format(' invalid node in arc attribute table: ',/,\n *' record=',i5,'from node = ',i5,'to node =',i5,\n *'name=',a20,'frname = ',a20,'toname = ',a20)\n19104 format(' increase size of mxnrt')\n19128 format(' increase size of mxhca')\n19130 format(' hwycov.trn not found in arc.dir file')\n19140 format(' node number mis-match')\n19399 format(' record not sorted',i6)\n19411 format('naterr#1 - invalid node in node attribute table: ',/,\n *'hwycov# = ',i5,\n *'1st cross street=',a20,'2nd cross street = ',a20)\n19412 format('naterr#2 - invalid tranplan node attribute table: ',/,\n *'hwycov# = ',i5,'hnode = ',i5,\n *'1st cross street=',a20,'2nd cross street = ',a20)\n19413 format('naterr#3 - tranplan node at more than one location: ',/, \n *'hwycov# = ',i5,'hnode = ',i5,\n *' 1st cross street=',a20,'2nd cross street = ',a20)\n19414 format('naterr#4 - more than four cross streets: ',/, \n *'hwycov# = ',i5,\n *'1st cross street=',a20,'2nd cross street = ',a20)\n19415 format('naterr#5 - two-way stop with 3+ unsigned streets: ',/, \n *'hwycov# = ',i5,\n *'1st cross street=',a20,'2nd cross street = ',a20)\n19502 format(' no unused id's)\n19505 format('aaterr#1 - entry/exit problem: ',/,\n *'id = ',i5,' name=',a20,' from = ',a20,\n *' to = ',a20,' nodes = ',2i6)\n19510 format('aaterr#2 - invalid functional class: ',/,\n *'id = ',i5,' name=',a20,' from = ',a20,' to = ',a20,' fc = ',i10)\n19526 format('aaterr#5 - duplicate arc: ',/,\n\n *'id = ',i5,' name=',a20,' from = ',a20,\n *' to = ',a20,' nodes = ',2i6)\n19580 format('aaterr#6 - zone connector with both ends at zone: ',/,\n *'id = ',i5,' nodes=',2i5,' zone = ',i4)\n19581 format('aaterr#7 - zone connector with neither at zone: ',/,\n *'id = ',i5,' nodes=',2i5,' zone = ',i4)\n19582 format(' increase size of mxzrt')\n19589 format('aaterr#8 - zone connector with neither end at street: ',/,\n *'id = ',i5,' nodes=',2i5,' zone = ',i4)\n19698 format('problem with station hour %s: station=',i4,' ppf=',f5.1)\n19875 format(' more than',i6,' links in route:',a21)\n19891 format(' missing zone connectors for tdz',i6)\n19902 format(' mis-matching nodes on hov ramp links :',3i10)\n19907 format(' no tranplan node at hov nodes:',5i10)\n19909 format(' hov ramp link not used:',i10)\n19910 format(' data problem with hwycov2.turnssec file:',2i10)\n19915 format(' hwycovtdz zone connector \n * invalid x, y coordinate for link id ',i8,'for tdz ',i8)\n19920 format(' more than 3 arcs on turn route :',4i10)\n19912 format(' more than 3 arcs on turn route :',i10)\n19922 format(' no matching nodes on turn route :',5i10)\n19991 format(' missing zone connector(s)',i5)\n20130 format('info/arc',4a1,'.dat')\n39999 format('[',a7,'] [',a8,'] [s9.10/tchc] [',a Tom Underwood \n!! \n !!
\n!!\n!! rng_mod
Documentation Author
\n!! Description
\n!! rng_mod
is a module which contains procedures for\n!! generating random numbers by the Mersenne twister MT19937 algorithm\n!! by acting as a wrapper for 'mt95.f90'), as well as a number of \n!! other useful random-number-related procedures.\n!! Dependencies
\n !! \n !!
\n !! kinds_mod
mt95
subroutine init_random_seed()
\n !! init_random_seed
initialises the random number generator\n !! using the (optional) integer seed specified in the argument. If there is\n !! no argument then a random seed is used - which is taken from the system\n !! clock.\n !!
Argument | \n !!Type | \n !!Description | \n !!
seed | \n !! integer, intent(in), optional | \n !! A specific seed for the random number generator. | \n !!
function get_random_number()
\n !! get_random_number
generates a random number between\n !! 0 and 1. We emphasise that this number may be 0, but not 1.\n !!
Returns: real(rk)
function top_hat_rand(L)
\n !! top_hat_rand
generates a random number between\n !! -L
and L
, where L>0
.\n !!
Argument | \n !!Type | \n !!Description | \n !!
L | \n !! real(rk), intent(in) | \n !! \n !! The highest magnitude of random number generated by the\n !! function.\n !! | \n !!
Returns: real(rk)
function bag_array(nspec)
\n !! This function returns a random array with the specified number of occurences of the numbers 1, 2, ...\n !! Its name reflects the fact that the array reflects drawing at random balls of various types from\n !! a 'bag' containing the specified number of each type of ball.\n !!
\n !!Argument | \n !!Type | \n !!Description | \n !!
nspec | \n !! integer(ik), dimension(:), allocatable, intent(in) | \n !! \n !! Array containing the number of occurences of each number to occur in the returned array:\n !! nspec(1) is the number of times 1 should occur; nspec(2) is the number\n !! of times 2 should occur; etc. E.g. nspec= \n !! This array should have 1 as its first index.\n !! | \n !!
Returns: integer(ik), dimension(:), allocatable