Hi all,
I'm in the process of debugging about 60 programs and could use a little help on this one before my brain is fried and fingers are cramped. I greatly appreciate your time. Thanks!
When I try to compile I receive the error:
In file dipole_tilt.f:30
% 19.3*cosd(3*al)
1
Error: Function 'cosd' at (1) has no implicit type
Here's my code:
subroutine dipole_tilt(glong, glat, utsec, tau, day, hgraze)
implicit none
real glong,glat,utsec,tau, season, cos tau, alpha, phi
real pi,c,theta, Sx, Sz, Nx, Nz, hgraze,Re,al,aet
integer*4 day
data alpha/.4089/
data pi/3.14159265/
data Re/6.37E3/
c = 2.*pi/360.
al = 278.895 + 0.985647*day
aet = -105.7*sind(al) + 596.2*sind(2*al) + 4.4*sind(3*al) -
% 12.7*sind(4*al) - 429.1*cosd(al) - 2.1*cosd(2*al) +
% 19.3*cosd(3*al)
season = 2.*pi*(day-173.21+((utsec-aet)/86400.))/365.25
phi = c*(glong + (utsec-aet)/240.)
theta = c*(90. - glat)
Sz = sin(alpha)*cos(season)
Sx = - sqrt(1-Sz*Sz)
Nx = cos(phi)*sin(theta)
Nz = cos(theta)
cos tau = Sx*Nx + Sz*Nz
tau = acos(cos tau)/c
hgraze = 0.
if(tau.eq.180.) hgraze = -1.
if ( (tau .gt. 90.) .and. (tau .ne. 180. ) ) then
hgraze = Re/sin((180.-tau)*c) - Re
end if
tau = tau - 90.
return
end
I'm in the process of debugging about 60 programs and could use a little help on this one before my brain is fried and fingers are cramped. I greatly appreciate your time. Thanks!
When I try to compile I receive the error:
In file dipole_tilt.f:30
% 19.3*cosd(3*al)
1
Error: Function 'cosd' at (1) has no implicit type
Here's my code:
subroutine dipole_tilt(glong, glat, utsec, tau, day, hgraze)
implicit none
real glong,glat,utsec,tau, season, cos tau, alpha, phi
real pi,c,theta, Sx, Sz, Nx, Nz, hgraze,Re,al,aet
integer*4 day
data alpha/.4089/
data pi/3.14159265/
data Re/6.37E3/
c = 2.*pi/360.
al = 278.895 + 0.985647*day
aet = -105.7*sind(al) + 596.2*sind(2*al) + 4.4*sind(3*al) -
% 12.7*sind(4*al) - 429.1*cosd(al) - 2.1*cosd(2*al) +
% 19.3*cosd(3*al)
season = 2.*pi*(day-173.21+((utsec-aet)/86400.))/365.25
phi = c*(glong + (utsec-aet)/240.)
theta = c*(90. - glat)
Sz = sin(alpha)*cos(season)
Sx = - sqrt(1-Sz*Sz)
Nx = cos(phi)*sin(theta)
Nz = cos(theta)
cos tau = Sx*Nx + Sz*Nz
tau = acos(cos tau)/c
hgraze = 0.
if(tau.eq.180.) hgraze = -1.
if ( (tau .gt. 90.) .and. (tau .ne. 180. ) ) then
hgraze = Re/sin((180.-tau)*c) - Re
end if
tau = tau - 90.
return
end