program motioncombine c this program reads the GPS Garmin data and Northseeker data and c combines the data for later use in ship motion correction. c this program writes out a daily file of data implicit real*8 (a-h,o-z) integer*4 ipos(11),isecg,isecn character garmin*100,norths*100,ayr*2,jday*3,ahr*2,rdling*90, x rdlinn*90 c open(unit=1,file='ship.inp') read(1,10) garmin read(1,10) norths 10 format(a100) ng = len_trim(garmin) ns = len_trim(norths) c print *, ng,ns read(1,*) idays,idaye read(1,*) iyear write(ayr(1:2),fmt='(i2.2)') iyear close(unit=1) c do 99 j = idays,idaye write(jday(1:3),fmt='(i3.3)') j open(unit=3,file='ship'//ayr//jday//'.dat') do 89 k = 1,24 write(ahr(1:2),fmt='(i2.2)') k-1 c print *, garmin(1:ng)//ayr//jday//ahr//'.p01' open(unit=1,err=88,file=garmin(1:ng)//ayr//jday//ahr// x '.p01',status='old') open(unit=2,err=88,file=norths(1:ns)//ayr//jday//ahr// x '.p02',status='old') read(1,12) rdling read(2,12) rdlinn read(rdling(10:11),fmt='(i2.2)') ihrsg read(rdling(13:14),fmt='(i2.2)') iminsg read(rdlinn(10:11),fmt='(i2.2)') ihrsn read(rdlinn(13:14),fmt='(i2.2)') iminsn c print *, iminsg,iminsn do 79 l = 1,4000 read(1,12,end=80) rdling read(2,12,end=80) rdlinn 12 format(a90) read(rdling(1:2),fmt='(i2.2)') iming read(rdling(3:7),fmt='(i5.5)') isecg read(rdlinn(1:2),fmt='(i2.2)') iminn read(rdlinn(3:7),fmt='(i5.5)') isecn fjdayg = float(j)+float(ihrsg)/(24.)+ x float(iminsg+iming)/(24.*60.)+ x float(isecg)/(1000.*24.*60.*60.) fjdayn = float(j)+float(ihrsn)/(24.)+ x float(iminsn+iminn)/(24.*60.)+ x float(isecn)/(1000.*24.*60.*60.) ncom = 0 do 16 mm = 7,90 if(rdling(mm:mm).eq.',') then ncom = ncom+1 ipos(ncom) = mm c print *, ncom,ipos(ncom) endif 16 continue kk = ipos(7)+1 ll = ipos(8)-1 c print *, kk,ll read(rdling(kk:ll),fmt='(f6.1)') speedknots kk = ipos(8)+1 ll = ipos(9)-1 read(rdling(kk:ll),fmt='(f6.1)') crsog ncom = 0 do 17 mm = 7,90 if(rdlinn(mm:mm).eq.',') then ncom = ncom+1 ipos(ncom) = mm endif 17 continue kk = ipos(1)+1 ll = ipos(2)-1 read(rdlinn(kk:ll),fmt='(f6.1)') heading c write(3,20) fjdayg,fjdayn,heading,crsog,spdknots 20 format(2(f10.6,1x),3(f6.1,1x)) c 79 continue 80 continue close(unit=1) close(unit=2) 88 continue 89 continue close(unit=3) 99 continue stop end