Skip to content

Commit

Permalink
Bugfix in output
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankThomasTveter committed May 12, 2017
1 parent ed3150b commit 5185540
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
10 changes: 10 additions & 0 deletions astro/src/astro/astroState.F
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ subroutine astroState(njd,JD30,lat,lon,hgt,crc250,irc)
!
character*1 c1
character*30 b30
integer lenb
integer, external :: length
real :: jd ! IAU, 0 Jan 2010, 0h TT
integer, parameter :: nbodies=11
real :: pole(6,nbodies) ! R.A., Dec, omega, domega/dt (deg/day) , orbits (index), xmu = G * Mass
Expand Down Expand Up @@ -94,6 +96,14 @@ subroutine astroState(njd,JD30,lat,lon,hgt,crc250,irc)
return
end if
CALL DATE2JD(JD2000(tt),YY,MM,DD,HH,MI,SEC)
! clean up
write(b30,'(F6.3)') sec
call chop0(b30,6)
lenb=length(b30,6,6)
write(jd30(tt),'(I4.4,"-",I2.2,"-",I2.2,"T",'//
& 'I2.2,":",I2.2,":",A,"Z")')
& YY,MM,DD,HH,MI,b30(1:lenb)

end do
!
! get planetary angular vectors in MJD2000
Expand Down
15 changes: 9 additions & 6 deletions astro/src/astro/event.F
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ subroutine event()
mode=0 ! initial
bdone=(ii.gt.lens)
do while (.not. bdone)
if (s1000(ii:ii).eq.'%') then ! special character
s1000(ii:ii+2)=' '
end if
if (mode.eq.0) then
if (s1000(ii:ii).eq.';'.or.s1000(ii:ii).eq.'&') then
ii=ii+1
Expand Down Expand Up @@ -220,7 +223,7 @@ subroutine event()
if (s1000(ii:ii).eq.'=') then
ii=ii+1
istart=ii
else if (s1000(ii:ii).eq.';') then
else if (s1000(ii:ii).eq.';'.or.s1000(ii:ii).eq.'&') then
if (bdeb) write(*,*) 'Found debug value: "'//
& s1000(istart:istop)//'"',ii,mode
read(s1000(istart:istop),*,iostat=irc) idebug
Expand All @@ -239,7 +242,7 @@ subroutine event()
if (s1000(ii:ii).eq.'=') then
ii=ii+1
istart=ii
else if (s1000(ii:ii).eq.';') then ! we are done
else if (s1000(ii:ii).eq.';'.or.s1000(ii:ii).eq.'&') then ! we are done
if (bdeb) write(*,*) 'Found start time: "'//
& s1000(istart:istop)//'"',ii,mode
read(s1000(istart:istop),*,iostat=irc)
Expand Down Expand Up @@ -275,7 +278,7 @@ subroutine event()
if (s1000(ii:ii).eq.'=') then
ii=ii+1
istart=ii
else if (s1000(ii:ii).eq.';') then ! we are done
else if (s1000(ii:ii).eq.';'.or.s1000(ii:ii).eq.'&') then ! we are done
if (bdeb) write(*,*) 'Found search code: "'//
& s1000(istart:istop)//'"',ii,mode
read(s1000(istart:istop),*,iostat=irc) searchCode
Expand All @@ -295,7 +298,7 @@ subroutine event()
if (s1000(ii:ii).eq.'=') then
ii=ii+1
istart=ii
else if (s1000(ii:ii).eq.';') then ! we are done
else if (s1000(ii:ii).eq.';'.or.s1000(ii:ii).eq.'&') then ! we are done
if (bdeb) write(*,*) 'Found stop time: "'//
& s1000(istart:istop)//'"',ii,mode
read(s1000(istart:istop),*,iostat=irc)
Expand Down Expand Up @@ -330,7 +333,7 @@ subroutine event()
if (s1000(ii:ii).eq.'=') then
ii=ii+1
istart=ii
else if (s1000(ii:ii).eq.';') then
else if (s1000(ii:ii).eq.';'.or.s1000(ii:ii).eq.'&') then
if (bdeb) write(*,*) 'Found event id: "'//
& s1000(istart:istop)//'"',ii,mode
read(s1000(istart:istop),*,iostat=irc) eventId
Expand Down Expand Up @@ -375,7 +378,7 @@ subroutine event()
if (s1000(ii:ii).eq.'=') then
ii=ii+1
istart=ii
else if (s1000(ii:ii).eq.';') then ! we are done
else if (s1000(ii:ii).eq.';'.or.s1000(ii:ii).eq.'&') then ! we are done
if (bdeb) write(*,*) 'Found value: "'//
& s1000(istart:istop)//'"',ii,mode,nval
read(s1000(istart:istop),*,iostat=irc)
Expand Down
11 changes: 7 additions & 4 deletions astro/src/astro/state.F
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ subroutine state()
mode=0 ! initial
bdone=(ii.gt.lens)
do while (.not. bdone)
if (s1000(ii:ii).eq.'%') then ! special character
s1000(ii:ii+2)=' '
end if
if (mode.eq.0) then
if (s1000(ii:ii).eq.';'.or.s1000(ii:ii).eq.'&') then
ii=ii+1
Expand Down Expand Up @@ -80,7 +83,7 @@ subroutine state()
if (s1000(ii:ii).eq.'=') then
ii=ii+1
istart=ii
else if (s1000(ii:ii).eq.';') then ! we are done
else if (s1000(ii:ii).eq.';'.or.s1000(ii:ii).eq.'&') then ! we are done
if (bdeb) write(*,*) 'Found lat: "'//
& s1000(istart:istop)//'"',ii,mode,nval
read(s1000(istart:istop),*,iostat=irc)
Expand All @@ -98,7 +101,7 @@ subroutine state()
if (s1000(ii:ii).eq.'=') then
ii=ii+1
istart=ii
else if (s1000(ii:ii).eq.';') then ! we are done
else if (s1000(ii:ii).eq.';'.or.s1000(ii:ii).eq.'&') then ! we are done
if (bdeb) write(*,*) 'Found lon: "'//
& s1000(istart:istop)//'"',ii,mode,nval
read(s1000(istart:istop),*,iostat=irc)
Expand All @@ -116,7 +119,7 @@ subroutine state()
if (s1000(ii:ii).eq.'=') then
ii=ii+1
istart=ii
else if (s1000(ii:ii).eq.';') then ! we are done
else if (s1000(ii:ii).eq.';'.or.s1000(ii:ii).eq.'&') then ! we are done
if (bdeb) write(*,*) 'Found hgt: "'//
& s1000(istart:istop)//'"',ii,mode,nval
read(s1000(istart:istop),*,iostat=irc)
Expand All @@ -134,7 +137,7 @@ subroutine state()
if (s1000(ii:ii).eq.'=') then
ii=ii+1
istart=ii
else if (s1000(ii:ii).eq.';') then ! we are done
else if (s1000(ii:ii).eq.';'.or.s1000(ii:ii).eq.'&') then ! we are done
if (bdeb) write(*,*) 'Found time: "'//
& s1000(istart:istop)//'"',ii,mode
njd=min(mjd,njd+1)
Expand Down

0 comments on commit 5185540

Please sign in to comment.