        PROGRAM FP

********************************************************************* 
*                                                                   *
*       This program, named as FP including subroutines             *
*       init(fp0.3a.f), ellipse(fp0.3b.f), hyperbolic(fp0.3c.f),    *
*       output(fp0.3d.f), and final(fp0.3e.f) calculates the        *
*       spatial and temporal evolution of ionospheric F-region      *
*       perturbations generated by gravity waves.                   *
*                                                                   *
*       Version 0.3 - Last Modified 3/25/04                         *
*                                                                   *
*********************************************************************  

        COMMON /INTS/II,JJ,KK
        COMMON /TIMES/DT,T,TT
        COMMON /WX8/EPC,DPERP

        CALL INIT
        DO WHILE (T.LE.TT)
          CALL HYPERBOLIC
          CALL ELLIPSE
          IF (EPC.GT.100.0) THEN
            WRITE(6,*) 'Divergent Calculation - Program Aborted!'
            STOP
            END IF

*********************************************************************
*                                                                   *
*       Outputs initial data as well as every tenth iteration.      *
*                                                                   *
*********************************************************************

          IF (II.EQ.10) THEN
             CALL OUTPUT      
            ELSE
             II=II+1
             END IF

*********************************************************************
*                                                                   *
*         Writes loop values to a troubleshooting file              *
*         named "trouble.dat".                                      *
*                                                                   *
*********************************************************************

          OPEN (STATUS='OLD',ACCESS='APPEND',UNIT=8,FILE='trouble.dat')
          T=T+DT
	  WRITE(8,*)'epc=',EPC
          WRITE(8,*)'dt=',DT
          WRITE(8,*)'t=',T
          CLOSE(8)
          END DO
	CALL FINAL
        STOP
        END

**********************************************************************
*                                                                    *
*       These are the required files for the 5 subroutines           *
*                                                                    *
*       a - INIT                                                     *
*       b - ELLIPSE                                                  *
*       c - HYPERBOLIC                                               *
*       d - OUTPUT                                                   *
*       e - FINAL                                                    *
*                                                                    *
**********************************************************************

        INCLUDE "fp0.3a.f"
        INCLUDE "fp0.3b.f"
        INCLUDE "fp0.3c.f"
        INCLUDE "fp0.3d.f"
        INCLUDE "fp0.3e.f"

