OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
subsatxy.f
Go to the documentation of this file.
1  subroutine subsat(pi,rad,ylatp,xlonp,xinclp,altcor,
2  * tilt,xnu,pitch,roll,yaw,ylats,xlons)
3 c
4 c Calculates the satellite ground point latitude and longitude
5 c Input
6 c rad = radians/degrees conversion
7 c ylatp = latitude of pixel
8 c xlonp = longitude of pixel
9 c xinclp = equatorial trackline inclination = 9.28 deg.
10 c altcor = altitude correction factor = (R+H)/R = 1.149
11 c xnu = scan angle to pixel for zero tilt
12 c tilt = scan mirror tilt angle
13 c pitch = pitch angle of satellite
14 c roll = roll angle of satellite
15 c yaw = yaw of spacecraft
16 c Output
17 c ylats = latitude of spacecraft
18 c xlons = longitude of spacecraft
19 c
20  implicit real*8 (a-h,o-z)
21  real*4 ylatp,xlonp,tilt,pitch,roll,yaw
22 c
23  call czsuba(rad,altcor,tilt,xnu,pitch,roll,yaw,rpsi,rths,rth)
24 c
25  rlatp = ylatp/rad
26  rlonp = xlonp/rad
27  rinclp = xinclp/rad
28 c
29 c Set up quadratic variables from Scripps Algorithm Report; CZCS
30 c Geolocation Algorithms
31  a = sin(rlatp)-sin(rth)*sin(rpsi)*sin(rinclp)
32  b = cos(rth)
33  c = sin(rth)*cos(rpsi)
34  d = cos(rinclp)*cos(rinclp)
35  ab = a*b
36  xd = b*b + c*c
37  x = ab*ab - xd*(a*a - d*c*c)
38  xp = 0.0
39  if (x .gt. 1.0e-10)xp = sqrt(x)
40 c
41 c Get the +- values from the quadratic
42  x1 = (ab+xp)/xd
43  x2 = (ab-xp)/xd
44  rlats1 = asin(x1)
45  rlats2 = asin(x2)
46 c
47 c If tilt is positive use the negative quadratic and vice versa
48  if (tilt .lt. 0.0)then
49  rlats = rlats1
50  else
51  rlats = rlats2
52  endif
53  ylats1 = rlats1*rad
54  ylats2 = rlats2*rad
55  ylats = rlats*rad
56 c
57 c Comment out the following because not used
58 cc Calculate the true bearing from north to pixel
59 c rinclo = asin(sin(rinclp)/cos(rlats))
60 c if (rinclo .gt. rpsi)then
61 c rpsip = 2.0*pi + (rpsi - rinclo)
62 c else
63 c rpsip = rpsi - rinclo
64 c endif
65 cc
66 cc Calculate the longitude difference of G.P. to pixel
67 c x = sin(rpsip)*sin(rth)/cos(rlatp)
68 c dlam = asin(x)
69 c xlam = dlam*rad
70 c xlons = xlonp + xlam
71 c
72  return
73  end
#define real
Definition: DbAlgOcean.cpp:26
subroutine czsuba(rad, altcor, tilt, xnu, pitch, roll, yaw, rpsi, rths, rth)
Definition: czsuba.f:3
subroutine subsat(pi, rad, ylatp, xlonp, xinclp, altcor, tilt, xnu, pitch, roll, yaw, ylats, xlons)
Definition: subsatxy.f:3