subroutine find_subsolar_info(year,julianday,hour,minute,second) use ModAMIE use ModConstants implicit none integer, external :: jday integer, intent(in) :: year, julianday, hour, minute, second integer :: day_offset real :: run_pole_colat, run_pole_lon, rtime real :: sin_day, cos_day, sin_pole, cos_pole rtime = float(year) + float(julianday)/jday(year,12,31) call subsolr(year, julianday, hour, minute, second, & subsolar_lat, subsolar_lon) call mlt2alon (0., subsolar_lat, subsolar_lon, & pole_colat, pole_east_lon, apex_lon_midnight) apex_lon_midnight = apex_lon_midnight * dtor if (north) then run_pole_colat = pole_colat run_pole_lon = pole_east_lon day_offset = jday(year, 12, 21) else call find_south_pole(rtime, run_pole_colat, run_pole_lon) day_offset = jday(year, 6, 21) endif sin_pole = sin(run_pole_colat*dtor) cos_pole = sqrt(1. - sin_pole*sin_pole) sin_day = -sin(23.5*dtor)*cos(float(julianday-day_offset)*twopi/365.24) cos_day = sqrt(1. - sin_day*sin_day) cos_subsol_mag_colat = cos_pole * sin_day + & sin_pole * cos_day * cos((run_pole_lon + 15.*(UT-12.))*dtor) sin_subsol_mag_colat = sqrt(1.0 - & cos_subsol_mag_colat * cos_subsol_mag_colat) end subroutine find_subsolar_info