Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_mlt1 Initialization Failure: Fails on First Invocation #56

Open
lkncl opened this issue Jan 14, 2025 · 0 comments · May be fixed by #57
Open

get_mlt1 Initialization Failure: Fails on First Invocation #56

lkncl opened this issue Jan 14, 2025 · 0 comments · May be fixed by #57

Comments

@lkncl
Copy link

lkncl commented Jan 14, 2025

Hello,
I am reporting an error in the file source/onera_desp_lib.f.
The issue lies within the SUN function, which utilizes the variables pi and rad prior to their initialization.
To resolve this, a preliminary call to the initize function is required for proper functionality.

Simple fix :

C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      SUBROUTINE SUN(iyr,iday,secs,gst,Slong,Srasn,Sdec)
C
      IMPLICIT NONE
C
C program to calculate sideral, time and position of the Sun
C good for years 1901 through 2099. accuracy 0.006 degree
C input is iyr,iday (INTEGER*4s), and secs, defining universal time
C output is Greenwich mean sidereal time (gst) in degrees,
C longitude along ecliptic (Slong), and apparent right ascension
C and declination (Srasn,Sdec) of the Sun, all in degrees.
C
      INTEGER*4 iyr,iday
      INTEGER*4 iaux
      REAL*8    secs,gst,Slong,Srasn,Sdec
C
        REAL*8 aux
        REAL*8 dj,fday
      REAL*8 t,vl,g,obliq,slp,sind,cosd
        REAL*8     pi,rad
        common /rconst/rad,pi

+       CALL INITIZE

C
      IF (iyr.LT.1901 .OR. iyr.GT.2099) RETURN
C
      fday = secs/86400.D0
      dj   = 365.D0*(iyr-1900.D0) + INT((iyr-1901)/4)
     &       + iday + fday - 0.5D0
[...]

One consequence of this issue is that the get_mlt1 function invariably fails on its initial invocation.

@lkncl lkncl changed the title Missing initize in SUN function get_mlt1 Initialization Failure: Fails on First Invocation Jan 14, 2025
@lkncl lkncl linked a pull request Jan 15, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant