File: libration.f90

package info (click to toggle)
wsjtx 2.0.0%2Brepack-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 192,624 kB
  • sloc: cpp: 1,071,838; ansic: 60,751; f90: 25,266; python: 20,318; sh: 10,636; xml: 8,148; cs: 2,121; fortran: 2,051; yacc: 472; asm: 353; makefile: 316; perl: 19
file content (38 lines) | stat: -rw-r--r-- 1,178 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
subroutine libration(jd,RA,Dec,xl,b)

! Compute optical libration of moon at jd: that is, the sub-observer 
! point (xl,b) in selenographic coordinates.  RA and Dec are 
! topocentric values.

  implicit real*8 (a-h,o-z)
  parameter (RADS=0.0174532925199433d0)
  parameter (TWOPI=6.28318530717959d0)
  real*8 jd,j2000,mjd,lambda

  j2000=2451545.0d0
  RA2000=RA
  Dec2000=Dec
  year=2000.0d0 + (jd-j2000)/365.25d0
  mjd=jd-2400000.d0
  call sla_PRECES('FK5',year,2000.d0,RA2000,Dec2000)
  call sla_EQECL(RA2000,Dec2000,mjd,lambda,beta)
  day=jd - j2000
  t = day / 36525.d0
  xi = 1.54242 * RADS
  ft = 93.2720993 + 483202.0175273 * t - .0034029 * t * t
  b= ft / 360
  a = 360 * (b - floor(b))
  if (a.lt.0.d0) a = 360 + a;
  f=a/57.2957795131d0
  omega=sla_dranrm(2.182439196d0 - t*33.7570446085d0 + t*t*3.6236526d-5)
  w = lambda - omega
  y = sin(w) * cos(beta) * cos(xi) - sin(beta) * sin(xi)
  x = cos(w) * cos(beta)
  a = sla_dranrm(atan2(y, x))
  xl = a - f
  if(xl.lt.-0.25*TWOPI) xl=xl+TWOPI             !Fix 'round the back' angles
  if(xl.gt.0.25*TWOPI)  xl=xl-TWOPI
  b = asin(-sin(w) * cos(beta) * sin(xi) - sin(beta) * cos(xi))

  return
end subroutine libration