Skip to content

Commit

Permalink
deal with the bug when interval is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
cuizilu committed Apr 25, 2021
1 parent 9844e28 commit ab5a41b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions f90/m_rnxqce_rinexread.f90
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ subroutine read_rinex_head(path,rnxohd)
endif
if(tmp(61:68)=="INTERVAL")then
read(tmp,'(f10.3)')rnxohd%interval
if(rnxohd%interval==0)then
rnxohd%interval=30
endif
endif
if(tmp(61:77)=="TIME OF FIRST OBS")then
read(tmp,'(5i6,f13.7)')cal1%year,cal1%month,cal1%day,cal1%hour,cal1%minute,cal1%second
Expand Down Expand Up @@ -253,9 +256,15 @@ subroutine read_rinex_data(rnxohd,rnxodt,flag,epochsum)
pos(i)=get_satpos(prn)
rnxodt(epoch)%satobsdata(pos(i))%prn=prn
if(pos(i)/=0)then
if(.not.allocated(rnxodt(epoch)%satobsdata(pos(i))%obs))then
allocate(rnxodt(epoch)%satobsdata(pos(i))%obs(rnxohd%obstypenumber))
endif
if(.not.allocated(rnxodt(epoch)%satobsdata(pos(i))%lli))then
allocate(rnxodt(epoch)%satobsdata(pos(i))%lli(rnxohd%obstypenumber))
endif
if(.not.allocated(rnxodt(epoch)%satobsdata(pos(i))%signalstrength))then
allocate(rnxodt(epoch)%satobsdata(pos(i))%signalstrength(rnxohd%obstypenumber))
endif
endif
enddo
else
Expand Down Expand Up @@ -314,9 +323,15 @@ subroutine read_rinex_data(rnxohd,rnxodt,flag,epochsum)
rnxodt(epoch)%satobsdata(pos(1))%prn=tmp(1:3)
ix=index('GCE',tmp(1:1))
if(pos(1)/=0)then
if(.not.allocated(rnxodt(epoch)%satobsdata(pos(1))%obs))then
allocate(rnxodt(epoch)%satobsdata(pos(1))%obs(obstypenumber(ix)))
endif
if(.not.allocated(rnxodt(epoch)%satobsdata(pos(1))%lli))then
allocate(rnxodt(epoch)%satobsdata(pos(1))%lli(obstypenumber(ix)))
endif
if(.not.allocated(rnxodt(epoch)%satobsdata(pos(1))%signalstrength))then
allocate(rnxodt(epoch)%satobsdata(pos(1))%signalstrength(obstypenumber(ix)))
endif
endif
if(ix/=0)then
flag(epoch,pos(1))=0
Expand Down

0 comments on commit ab5a41b

Please sign in to comment.