Orbits_Track Subroutine

public subroutine Orbits_Track(lons, lats, Sat_name, nymd, nhms, deltat, rc)

The subroutine Orbits_Track calculates the satellite ground track during a given time interval. These calculations are performed using pre-calculated coefficients using combination of coordinate transformations, optimization techniques and mathematical modeling techniques.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), pointer :: lons(:)
real(kind=dp), pointer :: lats(:)
character(len=*), intent(in) :: Sat_name
integer, intent(in) :: nymd(2)
integer, intent(in) :: nhms(2)
integer, intent(in) :: deltat
integer, intent(out) :: rc

Calls

proc~~orbits_track~~CallsGraph proc~orbits_track Orbits_Track interface~orbits_track0 Orbits_Track0 proc~orbits_track->interface~orbits_track0

Called by

proc~~orbits_track~~CalledByGraph proc~orbits_track Orbits_Track proc~orbits_swath Orbits_Swath proc~orbits_swath->proc~orbits_track

Source Code

  SUBROUTINE Orbits_Track(lons, lats, Sat_name, nymd, nhms, deltat, rc)

       IMPLICIT NONE
! !INPUT PARAMETERS:
      character(len=*), intent(in) :: Sat_name ! Satellite name
      integer, intent(in) :: nymd(2)  ! Beginning/ending date: YYYYMMDD
      integer, intent(in) :: nhms(2)  ! Beginning/ending time: HHMMSS
      integer, intent(in) :: deltat   ! Time step [secs]

! !OUTPUT PARAMETERS:
      real(dp), pointer       :: lons(:)  ! Ground track longitudes [degrees]  
      real(dp), pointer       :: lats(:)  ! Ground track latitudes  [degrees]  
      integer, intent(out):: rc       ! Error code = 0 all is well
                                      !            = 3 memory allocation error
      REAL(dp)    :: time_day
!
!     Other parameters!
      REAL(dp), DIMENSION(:), ALLOCATABLE  :: obstime
      real(dp)    :: sim_start, sim_end
      real(dp)    :: s_fraction2day, e_fraction2day
      INTEGER     :: ts, las, los
      integer     :: Sat
      integer     :: ierr1, ierr2, ierr3
      REAL(dp)    :: distlat  !lat is equal dis 
      INTEGER     :: say                   !()()()()()()
!     ............................................................................

      rc = 0 ! Initiate error code to 0
      CALL satname2int(Sat_name, Sat, rc)
      if ( rc /= 0 ) return
      CALL get_time(Sat, nymd(1), nhms(1), s_fraction2day, sim_start) ! handle time 
      CALL get_time(Sat, nymd(2), nhms(2), e_fraction2day, sim_end)

      time_day = deltat/(24.0*60.0*60.0)  !()()()()
      CALL built_vecsize(sim_start, sim_end, time_day, say) ! ()()()()()

      ALLOCATE(lons(1:say),  stat=ierr1) ! deallocate in the driver
      ALLOCATE(lats(1:say),  stat=ierr2) ! deallocate in the driver
      ALLOCATE(obstime(1:say),stat=ierr3) ! deallocate in the driver
      if ( ierr1 /= 0 .or. ierr2 /= 0 .or.  ierr3 /= 0 ) then
         rc = 3 !
         print*, rc
         return
      endif

      distlat = 1 !for flagauto 0 option it is not used. later change to optional 
      CALL find_waypointslat(Sat, deltat,sim_start,sim_end,distlat, &
                             obstime, lats, lons, ts, las, los, rc )
      if (rc>0) return

END SUBROUTINE Orbits_Track