C$Procedure GTARG C PROGRAM GTARG C C******************************************************************************* C C$ Purpose C C Ground track prediction and maneuver targeting for ground track C maintenence. C C Reference: B.E.Shapiro & R.S.Bhat,"GTARG-The TOPEX/POSEIDON C Ground Track Maintenance Maneuver Targeting Program," AIAA C Paper 93-1129, AIAA/AHS/ASEE Aerospace Design Conference, C Feb. 16-19, 1993, Irvine CA. See references of above reference C for further reference material. C C******************************************************************************* C C Copyright (C) 1993, California Institute of Technology. U.S. C Government Sponsorhip under NASA Contract NAS7-918 is C acknowledged. C C******************************************************************************* C C$ Log C C Date Name Description C ----------------------------------------------------------------------------- C 25-JUL-1990 Eric Cannell Creation of GTARG. C Targeting algorithm. C Mean element orbit propagation. C EZPLOT output. C Version 2.0 C 7-MAY-1991 Bruce Shapiro Average Orbital Density. C User control of plot format. C C Version 3.0 C 5-Aug-1991 Modify logic to prevent failure if initial C orbit is class 3 (DV too small) or C class 6 (DV is too large) in targeting C modes C Include Error Model, first guess logic, C user input of Gravity field. C Add second plot file for bias breakdown C C Version 3.1 C 20-APR-1992 Apply maneuver as Delta-V to cartesian C rather than only a Delta-a C Allow yaw/pitch offset for maneuver. C Interpretive listing of input control C parameters instead of namelist dump. C C Version 4.0 C 8-SEP-1992 User input of VMA table. C Interpretive listings of solar & geomagnetic C data and error sigmas. C C Version 5.0 C 16-FEB-1993 Table look-up for extra along-track forces. C Optional Constant-atmosphere density. C Optional Constant drag-area. C Remove dependence on JPL-library links C for COSMIC release. C Combine control (INPUT) namelist, gravity C field, astrodynamic constants, VMA C table, reference orbit grid all into C a single input namelist. C Tabular output of elements & ground track C for possible porting to spread sheet C for third party plotting. C User choice to print input data on output. C C Version 5.1 Table of dates in extra along-track forces C Feb. 16, 1993 rather than one point per date C C Version 5.2 Option of accumulating (a) daily drag errors C Feb. 26, 1993 and (b) daily boost errors either C (1) linearly or (2) in quadrature C Theory is that linear accumulation C treats each days error as completely C dependent of the previous days, while C accumulating in quadrature treats each C days error as a wholly independent event C from the previous days. C Table of daily boost errors C Daily boost in quadrature or linear accum. C Slope in solar flux, Kp C Bias in solar flux, Kp C C Version 5.3 Calculate Verification Site Overflight C 3-May-1993 Longitudinal Errors C C Version 6.0 Remove final known boo-boos for COSMIC C release C C$ Namelist_Input C C Namelist: $FLXKP (in FLUX_DATA file) C Name Type Dim Default Units Description C ----------------------------------------------------------------------------- C TEXT C*60 1 'no finger print' - finger print C NUMDAY I 1 0 - number of daily values in FLUX_DATA C DAYONE C*11 1 ' ' - epoch ('dd-mmm-yyyy') of the first C day in FLUX_DATA C FLX DP MXFLUX all 0D0 --> daily 10.7 solar flux values in C 10**-22 watts/m**2/cycle/sec C FLXBAR DP MXFLUX all 0D0 --> daily 81 day moving average of FLX C in 10**-22 watts/m**2/cycle/sec C KP DP MXFLUX all 0D0 - geomagnetic Kp planetary index C DFLX DP MXFLUX ALL 0.0 - ERROR IN FLUX C DFLXBAR DP MXFLUX ALL 0.0 - ERROR IN FBAR C DKP DP MXFLUX ALL 0.0 - ERROR IN KP C C Namelist: $GTBIAS: defines ground track biases (for drag usually) C C Name Type Dim Units Description C ----------------------------------------------------------------------------- C GTBIAS_DRAG C DP NGTBIAS_DRAG 0 km contribution to ground track C bias due to drag computation C errors, including solar flux C errors; a table of ground C track biases, one per day. C NGTBIAS_DRAG C I 1 0 days number of days of bias data C in GTBIAS_DRAG C C Namelist: $INPUT (in IN_GTARG file) C Name Type Dim Default Units Description C ----------------------------------------------------------------------------- C ATARGONLY L 1 F km if true, will only C perform a first guess targeting C calculation C ATDEN DP 1 kg/km3 default constant density atmosphere C ATDEN_POLY DP 5 Chebyshev polynomial for density C used when ATMOS = 'POLYNOMIAL' C ATDEN_SEMI DP 2 Magnitude & Phase for Semiannual C variation used when ATMOS C = 'POLYNOMIAL' C ATDEN_ANN DP 2 Magnitude & Phase used for Annual C variation used when ATMOS C = 'POLYNOMIAL' C ATMOS c*10 1 - 'TOPEXJR' - user JRSMPL2 C 'CONST' - use ATDEN C 'POLYNOMIAL' - use polynomial C in ATDEN_POLY C 'USER' - use user supplied function C BFILE C*25 1 'GTARG.BOOT' - GTARG bootstrap file name C BNDFUZ DP 1 .01D0 km if STRAT = 'LONG', BNDFUZ is the C fuzziness of BOUNDS(1). If the C west point of the ground track is C in the range BOUNDS(1) to BOUNDS(1) C + BNDFUZ, that is close enough. C Note that BNDFUZ is used only on C the east side of the west boundary. C Under no circumstances should the C spacecraft cross over the west C boundary. C BOOT L 1 F - if true, GTARG will write out the C final orbit and epoch to GTARG.BOOT C so the user can bootstrap into C the next run of GTARG. Basically, C GTARG.BOOT will contain values for C ORBIT and DATE. C BOUNDS DP 2 -1D0,+1D0 km the low and high boundaries (in C that order) of the valid ground C track band as measured from the C reference ground track. Usually, C BOUNDS will be something like C -/+ 1 km. But, BOUNDS could be C (.5,1.5), i.e., fully right of C the reference ground track. C BOUNDS is used only when DAYS=>0 C and STRAT not = 'RUNOUT'. See C Restriction #5. C CD DP 1 0D0 - if DRAG=T, constant of atmospheric C drag on s/c. i.e., about 2.3 C DATE C*25 1 ' ' - epoch of ORBIT in TIMETRANS C format, 'dd-mmm-yyyy hh:mm:ss.ffff' C DAYS I 1 0 days if STRAT = 'RUNOUT', then ground C track is run out DAYS days, C regardless of whether or not the C ground track lies within or without C the valid band defined by BOUNDS. C DELTA_A_OD DP 1 0d0 meters Delta-A error due to O.D. C DRAG L 1 T - if true, drag will be turned on C DRAGAREA DP 1 m**2 constant drag area (DRAGMODEL='CONST') C DRAGMODEL c*10 1 'VMA' - TOPEX VMA Model C 'CONSTANT' - use DRAGAREA C DRAGBIASMODE c*4 'FLUX' - 'FLUX' or 'GT' - which set of C sigmas to used for the C drag contribution to C ground track bias C DSMADT DP (2) 0d0 m/day additional (d/dt)(SMA) to add C to vector after all other C models are included C DSMADT_DATA DP MXFLUX 0d0 m/day daily array of decay rates C not accounted for by any C other model C DSMADT_DATES c*25 MXFLUX ' ' - DATES for data in dsmadt_data. C values have format such as C 23-jul-1993 09:17:23.1234 C will not be used unless C dsmadt_epoch = ' ' C DSMADT_EPOCH C*25 epoch of data in dsmadt_data; C The data in dsmadt_data is C assumed to have one point per C day starting with dsmadt_epoch. C Set this = ' ' to use dsmadt_dates C instead C DSMADT_DATA_SIGMA DP 1 Constant Sigma for dsmadt_data C if negative, will use array C of data in DSMADT_SIGMAS C DSMADT_SIGMAS DP MXFLUX Sigmas corresponding to dsmadt_datas C Will only be used if C DSMADT_DATA_SIGMA < 0.0 C DSMASWITCH C*25 1 time to switch dsmadt from (1) C value to (2) value C DV DP 1 0D0 mm/sec maneuver magnitude C DVQUANTA DP 1 0d0 mm/sec delta v quantization factor C DVbracket i 3 0,0,1 counts when dvquanta > 0, range of C runout runs to make after C targeting run, measured C with respect to the targeted C deltav; e.g., 2,3,1 means from C 2 quanta below to 3 quanta C above, in increments of 1 quanta C do a runout of the unbiased C ground track. C earth_rad DP 1 6378.140 kilomterst C ECHO_BIAS L 1 T - write bias data to output file C ECHO_FLUX L 1 T - write flux data to output file C ECHO_GRAV L 1 T - write gravity coefficients to C output file C ECHO_INPT L 1 F - echo the input namelist as is C ECHO_XING L 1 T - write equator crossing reference C to output file C ECHO_BOOST L 1 T - write out the table of da/dt if C one is supplied C ECHO_VMATAB L 1 T - if VMA model is used, print out C the VMA table which is supplied C EZHEAD L 1 T - if true, GTARG writes out the C $ZFRAME namelist into GTARG.Z C FBAR_BIAS DP 6 all 0.0 F10.7 bias polynominal C FBAR_SLOPE slope C FLUX_BIAS bias C FLUX_SLOPE slope C The above polynomials are C are applied (added) to the C FBAR & FLX arrays. SLOPE C accounts for SOLAR CYCLE C slopes, BIAS accounts for C prediction slopes. C (1) = constant C (2) = linear in time C (3) = t^2, (4) = t^3, (5) = t^4 C T = 0 at DAYONE of flux file C GTBIASFILE c*25 1 'GTBIAS.DAT' - name of file containing GT C biases information C JEARTH DP (2:29) all 0d0 - Earth zonal coefficients C LSFLAG L 1 T - if true, luni-solar gravitational C effects are on in LSRGP Library C LTOP I 1 0 - maximum L index in Earth gravity C model C M I 1 4 - forces GTARG to examine every M-th C ascending node. For example, one C hopes that M=4 is not only faster, C but almost as acurate as M=1. C M must be >= 1 and <= 10. C MAKE_BIAS_FILE L 1 T create a new bias file. C the name of the file is in C NEWBIASFILE; File will be create C if MAKE_BIAS_FILE = TRUE and C drag_BIAS_MODE = 'FLUX'; else C if drag_bias_mode = 'GT' than C an input file given by GTBIASFILE C is read in so new biases are C never calculated C MASS DP 1 0D0 kg if DRAG=T, mass of spacecraft C NEWBIASFILE C*80 1 'NEWBIASES.OUT' - C mu_earth DP 1 398600.44807345D0 kg**3/sec**2 C mu_moon DP 1 4902.7927809104D0 kg**3/sec**2 C mu_sun DP 1 132712441933.00783456D0 kg**3/sec**2 C NDSMADT_DATA I 1 0 - Number of days of data in DSMADT_DATA C NSITES I Number of sites (<10) given C in SITE_LOC C ODAYS r*4 1 300 days Number of days on EZPLOT C ODEVICE c*12 1 '/IMPRESS' - EZPLOT output device C OFILE C*25 1 'OUTPUT.LIS' - output file name C ORBIT DP 6 6*0D0 km,deg classical orbital elements C (a,e,i,LAN,w,M) C ORBITS I 1 - - number of equator crossings in C array XINGS C PITCH DP 1 0.0 deg Pitch angle for manevuer direction C PLOT C PLOTDATE C*25 1 DATE WHICH CORRESPONDS to t=0 on C the ground track plots C PLOT_COMPONENTS C PLOTCYCLE C PLOTTITLE C*80 Title for Plot C QUAD_ERR_BOOST L 1 T/F add successive orbital errors C in quadrature/linearly for boost C contribution. C QUAD_ERR_DRAG L 1 T/F add successive orbital errors C in quadrature/linearly for drag C contribution. C sid_day DP 1 86164.09055 seconds C SIGMA_DV_FIXED C DP 1 0D0 mm/sec Fixed error in DV execution C SIGMA_DV_PROP C DP 1 0d0 - Proportional error in DV execution C as a proportion of the delta v C SIGMA_DSMA DP 2 0d0 m/day Error Sigmas in dsmadt(i) C SIGMA_SF_DVOD C DP 1 1.0 - Scale factor to use for computing C the biased ground track based C upon contribution due to orbit C determination and maneuver ex- C cution errors. 1.645 = normal C distribution 95 percentile C errors. C SIGMA_SF_BOOST 1.0 C SIGMA_SF_DRAG C DP 1 1.0 - same as sigma_sf_DVOD but for drag C contribution C SITE_LOC 10 deg site_loc(1,I) = longitude C site_loc(2,I) = latitude C SITE_LOC_TYPE 1 'GEODETIC' 'GEODETIC' or 'GEOCENTRIC' C SITE_NAME 10 Names of site I C SITE_NODE 10 Ascending node # of orbit on C which overflight of sight I C takes place C SITE_STRAT 'PROP' 'PROP' or 'KEPLER' (KEPLER is C faster but less accurate) C SITE_SYM 10 PGPLOT graphics symbol for sites C SITES L 1 .false. Calculate site offset T/f C STRAT C*6 1 'RUNOUT' - see Purpose. C TARGET_STRAT C*8 1 'UNBIASED' - if STRAT is not 'RUNOUT' C 'UNBIASED', 'WESTGT', 'EASTGT' C selects which of the ground C tracks to do the targeting C on C TERMINAL C*12 1 'VT100' type of terminal C TESTCASE C*80 1 Label to print on page 1 of C report file C TIMFUZ DP 1 1D0 days if STRAT = 'EAST' or 'WEST', if C GTARG finds a ground track that C crosses a boundary within TIMFUZ C of TIMTGT, then that ground track C adequately targeted. C TIMTGT DP 1 0D0 days if STRAT = 'EAST' or 'WEST', the C desired time to the east or west C boundaries, respectively C WATCH L 1 T if true, monitor calculations C WATCHINT L 1 F if true, then GTARG also records C the intermediate ground tracks C that are found prior to the C properly targeted one C XINGS DP MXING - deg equator crossings of reference C ground track. C YAW DP 1 0 deg Yaw angle for maneuver direction C ZFILE C*25 1 'ground_track.plot' - EZPLOT data file name C ZFILE2 C*25 1 'bias_breakdown.plot' C C C$ Namelist_Output C C Namelist: $ZFRAME: defines plot frame, not the curves and text inside it C Name Type Dim Units Description C ----------------------------------------------------------------------------- C DEVICE C*12 1 - PGPLOT plot device /IMPRESS C SUMMRY L 1 - false, no EZPLOT summary file is written C TITLE C*60 1 - title depends on STRAT C WINDO R 4 --> PGPLOT window boundaries in world coords, C (left-x,right-x,bottom-y,top-y). Depends on C BOUNDS and y-axis runs from 0 to 300 days. C XTITLE C*23 1 - title of x-axis, 'ground track offset, km' C YTITLE C*35 1 - title of y-axis, 'days from' // DATE C C C Namelist: $ZLINE: defines boundary curves C Name Type Dim Units Description C ----------------------------------------------------------------------------- C NPTS I 1 - number of (x,y) data points C STYLE I 1 - PGPLOT line style: C STYLE = 2 --> dashed C X RL 2 - x-data of boundary C Y RL 2 - y-data (0 to 1000 just to be safe) C C$ Restrictions C C 1] Inclination of the satellite orbit cannot be zero. C C 2] If DRAG=T, then both spacecraft mass (MASS) and spacecraft coefficient C of atmospheric drag must be > 0. C C 3] The maximum L index in the Earth gravity model (LTOP) must be in C the range of [2..29]. C C 4] The number of daily values in the FLUX_DATA file (NUMDAY) must be in the C range of [1..MXFLUX]. C C 5] BOUNDS(1) + BNDFUZ < BOUNDS(2) C C 6] 1 <= M <= 10. C C$ Files C C File Name Unit Description C ----------------------------------------------------------------------------- C * * standard I/O C IN_GTARG 7 namelist_input_file with $INPUT C OFILE 8 text output file C FLUX_DATA 9 flux data file with $FLXKP C ZFILE 11 EZPLOT data file of ground track plot C BFILE 12 bootstrap file of final orbit and epoch C GTBIASFILE 14 File containing GT Biases due to FLUX C zfile2 16 EZPLOT data file with ground track bias plot C NEWBIASFILE 17 Output file containing calculated biases due C C$ Parameters C INTEGER MXFLUX PARAMETER ( MXFLUX = 1000 ) INTEGER MXINGS PARAMETER ( MXINGS = 200 ) INTEGER MX_BIAS_DAYS PARAMETER ( MX_BIAS_DAYS = 1000 ) INTEGER MX_SITES parameter ( MX_SITES = 10 ) INTEGER MX_OVERFLIGHTS parameter ( MX_OVERFLIGHTS = 100 ) double precision PI parameter ( PI = 3.14159265358979323846 ) C C$ Declarations_of_Input_and_Output_Arguments C C C Via $FLXKP. C CHARACTER*11 DAYONE DOUBLE PRECISION FLX ( MXFLUX ) DOUBLE PRECISION FLXBAR ( MXFLUX ) DOUBLE PRECISION KP ( MXFLUX ) DOUBLE PRECISION DFLX ( MXFLUX ) DOUBLE PRECISION DFLXBAR ( MXFLUX ) DOUBLE PRECISION DKP ( MXFLUX ) INTEGER NUMDAY CHARACTER*60 TEXT C C Via $INPUT. C LOGICAL ATARGONLY DOUBLE PRECISION ATDEN, ATDEN_POLY(5), ATDEN_SEMI(2) double precision ATDEN_ANN(2) CHARACTER*10 ATMOS CHARACTER*80 BFILE DOUBLE PRECISION BNDFUZ LOGICAL BOOT character*12 boost_ERROR_MODEL, DRAG_ERROR_MODEL DOUBLE PRECISION BOUNDS ( 2 ) DOUBLE PRECISION CD CHARACTER*25 DATE, DSMASWITCH, DSMADT_EPOCH character*25 dsmadt_dates(MXFLUX) double precision xdsmadt_dates(MXFLUX) INTEGER DAYS DOUBLE PRECISION DELTA_A_OD LOGICAL DRAG character*10 dragmodel double precision dragarea character*4 dragbiasmode, terminal*12 double precision dsmadt(2), tsmaswitch double precision dsmadt_data (MXFLUX) double precision dsmadt_data_sigma double precision DSMADT_SIGMAS(MXFLUX) integer ndsmadt_data DOUBLE PRECISION DV integer dvbracket ( 3 ) DOUBLE PRECISION DVQUANTA LOGICAL ECHO_bias, echo_flux, echo_grav LOGICAL echo_xing, echo_inpt, echo_boost LOGICAL sites LOGICAL EZHEAD, echo_VMATAB logical flux_slope_input, fbar_slope_input logical flux_bias_input, fbar_bias_input double precision FLUX_SLOPE(6), FBAR_SLOPE(6) double precision FLUX_BIAS(6), FBAR_BIAS(6) double precision jearth (2:29) LOGICAL LSFLAG INTEGER LTOP INTEGER M logical make_bias_file DOUBLE PRECISION MASS character*80 newbiasfile integer noverflights(MX_SITES) integer nsites REAL*4 ODAYS CHARACTER*12 ODEVICE CHARACTER*80 OFILE DOUBLE PRECISION ORBIT ( 6 ) INTEGER ORBITS double precision overflights(MX_SITES, MX_OVERFLIGHTS, 5) DOUBLE PRECISION PITCH character*25 plotdate logical plot, plotboost, plot_components logical plotcycle, plotsite character *80 PlotTitle, Testcase logical quad_err_boost, quad_err_drag integer REV DOUBLE PRECISION SIGMA_DV_FIXED, SIGMA_DSMA(2) DOUBLE PRECISION SIGMA_DV_PROP, sigma_SF_Boost DOUBLE PRECISION SIGMA_Sf_DVOD, sigma_sf_drag double precision SITE_LOC(2,MX_SITES) character*10 SITE_LOC_TYPE integer SITE_NODE(MX_SITES) character*10 SITE_NAME(MX_SITES) integer SITE_SYM(MX_SITES) CHARACTER*6 STRAT, SITE_STRAT character*80 GTBIASFILE character*8 target_strat DOUBLE PRECISION TIMFUZ DOUBLE PRECISION TIMTGT double precision vmatab (3,-90:90) double precision careas(2), breakpts(2) LOGICAL WATCH, WATCHINT DOUBLE PRECISION XINGS ( MXINGS ) DOUBLE PRECISION YAW CHARACTER*80 ZFILE, zfile2 C c VIA $GTBIAS C INTEGER NGTBIAS_DRAG DOUBLE PRECISION GTBIAS_DRAG (MX_BIAS_DAYS) C Via $ZFRAME. C CHARACTER*12 DEVICE LOGICAL SUMMRY CHARACTER*60 TITLE REAL WINDO ( 4 ) CHARACTER*50 XTITLE CHARACTER*35 YTITLE C C Via $ZLINE. C INTEGER NPTS, SYMBOL INTEGER STYLE REAL X ( MX_OVERFLIGHTS ), XTXT, YTXT REAL Y ( MX_OVERFLIGHTS) C C Global parameters C double precision earth_rad ! in kilomters double precision mu_earth ! km**3/sec double precision mu_moon ! km**3/sec double precision mu_sun ! km**3/sec double precision sid_day ! seconds C C - derived constants, in block physical_constants C double precision earth_freq ! radians / second double precision earth_rate ! meters / day double precision deg_to_km ! kilometers/deg C C$ Declarations_of_Local_Variables C CHARACTER*25 DATEND, sitedate character * 9 aday character * 8 atime real*4 plotdelta, plotepoch LOGICAL ERROR DOUBLE PRECISION ORBEND ( 6 ) character*2 II real cputime, elapsedtime,clockstart,clockend integer ipage character*80 input_file_name, flux_file_name, * boot_file_name, * gtbias_file_name, * plot_file_name, output_file_name, * table_file_name, output_message, * plot_file2_name, NEWBIASFILE_NAME C C$ External_Statements C logical checkdates external checkdates DOUBLE PRECISION RNG360 EXTERNAL RNG360 character*8 goto_string, YESNO*3, yesnostring*20 external goto_String, YESNO, yesnostring external setcpu real setcpu external getcpu real getcpu external ch2sec, ch2jd, sec2ch double precision ch2sec, ch2jd character*24 sec2ch, ajd(10) double precision xjd0,xjd(10) double precision SITE_GCLAT(MX_SITES), flat C C$ Namelists C NAMELIST / FLXKP / TEXT , NUMDAY , DAYONE , FLX , FLXBAR , & KP, DFLX, DFLXBAR, DKP NAMELIST / GTBIAS / NGTBIAS_DRAG, GTBIAS_DRAG NAMELIST / INPUT / & ATARGONLY, atden, ATDEN_ANN, ATDEN_POLY, & ATDEN_SEMI, atmos, BFILE, BNDFUZ, & BOOST_ERROR_MODEL, & BOOT, BOUNDS, breakpts, careas, CD, & DAYS, DATE, DELTA_A_OD, DRAG, dragarea, & DRAG_ERROR_MODEL, & dragmodel, dsmadt, dsmadt_data, & dsmadt_data_sigma, dsmadt_dates, dsmadt_epoch, & dsmadt_sigmas, dsmaswitch, DV, & dvbracket, DVQUANTA, earth_rad, echo_bias, echo_boost, & echo_flux, echo_grav, echo_inpt, & echo_vmatab, echo_xing, & EZHEAD, FBAR_BIAS, FBAR_SLOPE, FLAT, & FLUX_BIAS, FLUX_SLOPE, & GTBIASFILE, JEARTH, LSFLAG , LTOP , & M, make_bias_file, MASS, mu_earth, & mu_moon, mu_sun, ndsmadt_data, newbiasfile, NSITES, & ODAYS, & ODEVICE, OFILE, ORBIT, orbits, pitch, & PLOT, plotboost, PLOT_COMPONENTS, PLOTCYCLE, & plotdate, plotsite, plotTitle, & rev, sid_day, sigma_dsma, & SIGMA_DV_FIXED, SIGMA_DV_PROP, & sigma_sf_drag, sigma_sf_boost, SIGMA_SF_DVOD, & SITE_LOC, SITE_LOC_TYPE, SITE_NODE, SITE_NAME, Sites, & SITE_STRAT, SITE_SYM, & STRAT, target_strat, terminal, TESTCASE, & TIMFUZ, TIMTGT, vmatab, WATCH, WATCHINT, & xings, yaw, ZFILE, zfile2 NAMELIST / ZFRAME / DEVICE , SUMMRY , TITLE , WINDO , XTITLE , & YTITLE NAMELIST / ZLINE / NPTS , STYLE , X , Y, SYMBOL, XTXT, & YTXT, TEXT common /tt/ terminal common /boost/ ndsmadt_data, dsmadt_data, dsmadt_epoch, & dsmadt_data_sigma, plotboost, dsmadt_dates, & xdsmadt_dates, dsmadt_sigmas common /error_flags/ quad_err_boost, quad_err_drag common /dragblock/ dragmodel, dragarea, atmos, atden, & FLUX_SLOPE, FBAR_SLOPE, FLUX_BIAS, FBAR_BIAS, & ATDEN_POLY, ATDEN_ANN, ATDEN_SEMI common /vma/vmatab, careas, breakpts common / physical_constants / & earth_rad, earth_freq, earth_rate, mu_earth, & mu_moon, mu_sun, sid_day, deg_to_km, flat common /site_data/ NSITES, SITE_LOC, SITE_NODE, SITE_GCLAT, & SITE_NAME, SITE_STRAT, overflights, noverflights C C$ Data_Statements C DATA ATARGONLY /.false. / data atmos /'TOPEXJR'/ data atden /1.0d-6/ DATA ATDEN_POLY / 0.102444406127929688D+04, & 0.414349639892578125D+03, & -.581061572488852007D+01, & 0.720650161644122988D+00, & 0.842769258090778408D-04 / data ATDEN_SEMI /-0.0791350355550989d+00, & 5.4144904588160714d+00/ data ATDEN_ANN /0.0454889572120465d+00, & 6.1054952840340235d+00/ DATA BFILE / 'GTARG.BOOT' / DATA BOOST_ERROR_MODEL /'OPTIMISTIC'/ data breakpts /15.0, 75.0/ DATA BNDFUZ / .01D0 / DATA BOOT / .FALSE. / DATA BOUNDS / -1D0 , 1D0 / DATA CD / 0D0 / DATA DATE / ' ' / DATA DAYONE / ' ' / DATA DAYS / 0 / DATA DELTA_A_OD /0.0D0 / DATA DFLX / MXFLUX * 0D0 / DATA DFLXBAR / MXFLUX * 0D0 / DATA DKP / MXFLUX * 0D0 / DATA DRAG / .TRUE. / data dragarea /10.0/ data dragmodel /'VMA'/ DATA dragbiasmode / 'FLUX' / DATA DRAG_ERROR_MODEL /'PESSIMISTIC'/ DATA dsmadt / 2*0.0D0 / DATA dsmadt_DATA /MXFLUX * 0d0 / data dsmadt_dates /MXFLUX * ' '/ DATA dsmadt_DATA_SIGMA / 0d0 / data dsmadt_sigmas /mxflux * 0d0/ DATA sigma_dsma / 2*0.0D0 / data dsmaswitch /'Not Used'/ DATA DV / 0.0D0 / data DVBRACKET / 0, 0, 1 / DATA DVQUANTA/ 0.0D0 / data echo_bias /.true. / data echo_boost /.true. / data echo_flux /.true. / data echo_grav /.true. / data echo_xing /.true. / data echo_inpt /.false. / data echo_vmatab /.true. / DATA EZHEAD / .TRUE. / DATA FBAR_BIAS /6*0D0/ DATA FLAT /0.003352891869d0/ DATA FLUX_BIAS /6*0D0/ DATA FBAR_SLOPE /6*0D0/ DATA FLUX_SLOPE /6*0D0/ DATA FLX / MXFLUX * 0D0 / DATA FLXBAR / MXFLUX * 0D0 / DATA GTBIAS_DRAG / MX_BIAS_DAYS * 0D0 / DATA GTBIASFILE / 'GTBIAS.DAT' / data make_bias_File /.true. / data ipage / 1 / DATA KP / MXFLUX * 0D0 / DATA LSFLAG / .TRUE. / DATA LTOP / 0 / DATA M / 4 / DATA MASS / 0.0D0 / DATA newbiasfile /'newbiases.out'/ DATA NDSMADT_DATA /0/ data NOVERFLIGHTS/MX_SITES*0/ DATA NUMDAY / 0 / DATA NGTBIAS_DRAG / 1 / DATA NSITES /2/ DATA ODAYS / -1 / DATA ODEVICE / '/IMPRESS' / DATA OFILE / 'OUTPUT.LIS' / DATA ORBIT / 6 * 0.0D0 / DATA PITCH /0.0d0/ data plot /.true./ data plotboost /.false./ data plotcycle /.true./ data plot_components /.true./ data plotsite /.false./ DATA PLOTDATE /'?'/ DATA PlotTitle /'?'/ DATA QUAD_ERR_BOOST /.false./ DATA QUAD_ERR_DRAG /.false./ DATA REV /0 / DATA SIGMA_DV_FIXED / 0d0 / DATA SIGMA_DV_PROP / 0d0 / DATA SIGMA_SF_DVOD / 1.0d0 / data sigma_sf_drag / 1.0d0 / data sigma_sf_boost /1.0d0 / data site_LOC /239.31919, 34.4691, & 12.32054,35.54649,16*0.0d0/ data site_LOC_TYPE /'GEODETIC'/ data site_name /'NASA','CNES',8*'?'/ data site_NODE /22, 111,8*0/ data sites /.false. / data site_STRAT /'PROP'/ data site_SYM/0,7,5,2,4,6,3,12,8,9/ DATA STRAT / 'RUNOUT' / DATA target_strat / 'UNBIASED' / DATA TEXT / 'no finger print' / DATA TERMINAL /'VT100'/ DATA TESTCASE /'?'/ DATA TIMFUZ / 1D0 / DATA TIMTGT / 0D0 / DATA WATCH / .FALSE. / DATA WATCHINT/ .FALSE. / data YAW /0.0d0/ DATA ZFILE / 'GROUND_TRACK.PLOT' / DATA ZFILE2 / 'BIAS_BREAKDOWN.PLOT' / data JEARTH / & 0.10826258D-02 , -0.25338975D-05 , -0.16238211D-05 , & -0.22963180D-06 , 0.54309576D-06 , -0.35775823D-06 , & -0.20980278D-06 , -0.12070701D-06 , -0.24441360D-06 , & 0.23257025D-06 , -0.19259423D-06 , -0.22280385D-06 , & 0.11011675D-06 , -0.15949534D-07 , 0.41544562D-07 , & -0.87909637D-07 , -0.70704603D-07 , -0.45577223D-08 , & -0.17217485D-06 , 0.11404873D-09 , 0.16061855D-07 , & 0.14036748D-06 , 0.19771236D-07 , -0.10809433D-07 , & -0.59183191D-07 , -0.81329176D-07 , 0.17087477D-06 , & 0.86549317D-07 / data earth_rad / 6378.140 / data mu_earth / 398600.44807345D0 / data mu_moon / 4902.7927809104D0 / data mu_sun / 132712441933.00783456D0 / data sid_day / 86164.09055 / C C$ Method C-& CHARACTER*20 LINK_TIME, LNKTIM EXTERNAL LNKTIM C1 Print fingerprint information. cputime = setcpu () clockstart = secnds(0.0) LINK_TIME = LNKTIM() print *,' ' print *,' ' print *,' ' print *,'*************************************************', & '***************************' print *,'* GTARG Ground Track Targeting ', & 'Program Ver. 6.0 created '//link_time(1:18)//' *' print *,'*************************************************', & '***************************' print *,'* Copyright (C) 1993, California Institute of Tec', & 'hnology. *' print *,'* U.S. Government Sponsorship under NASA Contract', & ' NAS7-918 is acknowledged.*' print *,'*************************************************', & '***************************' print *, ' ' print *, 'Reading input namelist data ... ' C1 Use OPSFOR to open the input file. CALL OPSFOR ( 7 , 'IN_GTARG' , ERROR ) IF ( ERROR ) THEN WRITE(*,'(/1X,''GTARG: cannot open file IN_GTARG.'')') STOP END IF C1 Read the input namelist $INPUT and then close it. READ ( 7 , INPUT ) CLOSE ( 7 ) print *, 'Initializing ...' C1 Use OPSFN to open the output file. CALL OPSFN ( 8 , OFILE , ERROR ) call vmsdate ( aday ) call time ( atime ) write (8,11) LINK_TIME, aday, atime 11 format( ' ', & 79('*'), & /, ' ', '*',77x,'*', & /, ' ', '*',t36,'G T A R G',t80'*', & /, ' ', '*',t15,'Ground Track Maintenance ', & 'Maneuver Targeting Program',t80,'*', & /, ' ', '*',77x,'*', & /, ' ', 79('*'), & /, ' ', '*',77x,'*', & /, ' ', '* Version: ',A18, ' (6.0)', & t51, 'Run time: ',A9,' ',A8,' *', & /, ' ', '*',77x,'*', & /, ' ', 79('*'), & /,' * Copyright (C) 1993, California Institute ', & 'of Technology.',t80,'*', & /,' * U.S. Government Sponsorship under NASA Contract ', & 'NAS7-918 is acknowledged.', t80, '*', & /,' ',79('*')) IF ( ERROR ) THEN WRITE(*,'(/1X,''GTARG: cannot open file '',A,''.'')') OFILE STOP END IF IF (TESTCASE.EQ.'?') then IF (PLOTTITLE.EQ.'?') then TESTCASE = 'GTARG '//STRAT//' Test Case' else TESTCASE = PLOTTITLE end if end if i=80 do while ((TESTCASE(i:i).EQ.' ').and.(i.GT.1)) i=i-1 end do write(8,1001) testcase(1:i) 1001 format(/,1x,<(74-i)/2>x,('*'),/ & 1x,<(74-i)/2>x,'* ',a,' *'/ & 1x,<(74-i)/2>x,('*') ) C1 Check that BOUNDS(1) + BNDFUZ < BOUNDS(2). IF ( BOUNDS(1) + BNDFUZ .GE. BOUNDS(2) ) THEN WRITE(*,301) WRITE(8,301) 301 FORMAT(//,' GTARG: BOUNDS(1) + BNDFUZ < BOUNDS(2).') STOP END IF C1 Check that 1 <= M <= 10. IF ( M .LT. 1 .OR. 10 .LT. M ) THEN WRITE(*,302) M WRITE(8,302) M 302 FORMAT(//,' GTARG: M(',I,') must be in the range [1..10].') STOP END IF C1 Check that the inclination of satellite orbit is not zero. IF ( ORBIT( 3 ) .EQ. 0.0D0 ) THEN WRITE(*,303) WRITE(8,303) 303 FORMAT(//,' GTARG: Inclination cannot be zero.') STOP END IF C C Default start of plot to start of run C if (PLOTDATE(1:1).eq.'?') PLOTDATE = DATE TITLE = PLOTTITLE C C Command Line Input Files C inquire (FILE='IN_GTARG', NAME=input_file_name) inquire (FILE='FLUX_DATA', NAME=flux_file_name ) C C Input files with name specified in $INPUT C inquire (FILE=gtbiasfile, NAME=gtbias_file_name ) C C output files with name specified in $INPUT C C1 Convert the STRAT input to uppercase. CALL UPCASE( STRAT ) CALL UPCASE( TARGET_STRAT ) CALL UPCASE( BOOST_ERROR_MODEL ) CALL UPCASE( DRAG_ERROR_MODEL ) CALL UPCASE( DRAGMODEL ) CALL UPCASE( ATMOS ) C C For boost errors, C 'PESSIMISTIC' model - add daily errors linearly C 'OPTIMISTIC' model - add in quadrature (default) C IF (BOOST_ERROR_MODEL .EQ. 'PESSIMISTIC') THEN QUAD_ERR_BOOST = .FALSE. ELSE IF (BOOST_ERROR_MODEL .EQ. 'OPTIMISTIC') then quad_ERR_BOOST = .TRUE. ELSE write(8,*) '>>> Invalid BOOST_ERROR_MODEL = ', & BOOST_ERROR_MODEL,' input. Assumed OPTIMISTIC.' quad_ERR_BOOST = .TRUE. END IF C C Drag error model - either from a 'FILE' (old input DRAGBIASMODE='GT') C or based on solar flux sigmas (old input DRAGBIASMODE = 'FLUX') C If it is based on the solar flux sigmas, have a choice of C optimistic model - add daily errors in quadrature C pessimistic model - add daily errors linearly C default is "OPTIMSITIC" C IF (DRAG_ERROR_MODEL .eq. 'FILE') THEN DRAGBIASMODE = 'GT' ELSE DRAGBIASMODE = 'FLUX' IF (DRAG_ERROR_MODEL .EQ. 'PESSIMISTIC') THEN QUAD_ERR_DRAG = .FALSE. ELSE IF (DRAG_ERROR_MODEL .EQ. 'OPTIMISTIC') THEN QUAD_ERR_DRAG = .TRUE. ELSE write(8,*) '>>> Invalid DRAG_ERROR_MODEL = ', & DRAG_ERROR_MODEL,' input. Assumed OPTIMISTIC.' QUAD_ERR_DRAG = .TRUE. END IF END IF CALL UPCASE( DRAGBIASMODE ) if ( ODAYS .LT. 0 ) ODAYS = days C1 Map LAN, w, and M into [0..360]. ORBIT( 4 ) = RNG360( ORBIT( 4 ) ) ORBIT( 5 ) = RNG360( ORBIT( 5 ) ) ORBIT( 6 ) = RNG360( ORBIT( 6 ) ) C1 Echo initial orbit. WRITE(8,306) date, ORBIT(1), orbit(4), & orbit(2), orbit(5), orbit(3), orbit(6) 306 FORMAT( /35X,'Input Orbit',/ & ,35x,'-----------', & /,' ',t2,'Epoch:',A,t40, & /,' ',t6, 'a:', F20.12, ' km.', & t50, 'aop:',F20.8,' deg.', & /,' ',t6,'e:', F20.12, & t49:,'raan:',F20.8, ' deg.', & /,' ',t6,'i:', F16.8,' deg.', & t52,'M:',F20.8, ' deg.',/ ) C C Print the input parameters which will be used C if ( ATARGONLY ) then if ( strat .eq. 'RUNOUT' ) strat = 'LONG' write(8,1174) strat 1174 Format(' ',T21,'Constant-Flux First Guess Parameters',/, & ' ',T21,'------------------------------------',/, & ' ',t28,'Strategy:',T42,A10) else if ( strat .eq. 'RUNOUT') then write (8, 1180) 1180 Format(' ',T25,'Untargeted Runout Parameters',/, & ' ',T25,'----------------------------') else if (strat .eq. 'LONG' ) then write (8, 1182) 1182 Format(' ',T26,'Longitude Targeting Parameters',/, & ' ',T26,'------------------------------') else if (strat .eq. 'WEST' ) then write (8, 1185) 1185 Format( & ' ',T17, 'Time Targeting to Western Boundary Parameters',/, & ' ',T17,'---------------------------------------------') else if (strat .eq. 'EAST' ) then write (8, 1188) 1188 Format( & ' ',T17, 'Time Targeting to Eastern Boundary Parameters',/, & ' ',T17,'---------------------------------------------') else write (8, 1189) strat 1189 format(' >>>> Unknown strategy = ',A,/ & ' ERROR termination') stop end if if ( strat .ne. 'RUNOUT') then if ( target_strat .eq. 'WESTGT' ) then write (8, 1191) 1191 Format(' ',T15, ' Targeting Strategy:', & T42, ' 95% West' ) else if (target_strat .eq. 'EASTGT') then 1193 Format(' ',T15, ' Targeting Strategy:', & T42, ' 95% East' ) write (8, 1193) else if (target_strat .eq. 'UNBIASED' ) then write (8, 1195) 1195 Format(' ',T15, ' Targeting Strategy:', & T42, ' Unbiased' ) else write (8,*) '>>>> Unknown target_strat = ', & target_strat STOP end if end if write(8,1203) bounds 1203 Format(' ',T15, ' Western Boundary:', & T42,F10.3,' kilometers',/, & ' ',T15, ' Eastern Boundary:', & T42,F10.3,' kilometers') if ( strat .ne. 'RUNOUT') then write(8,1204) bndfuz 1204 Format(' ',T12, ' Ground track fuzziness:', & T42,F10.3,' kilometers') end if if ( strat .eq. 'RUNOUT') then Write (8,121) days 121 Format (' ',T15, ' Duration of run:',T42,I10,' days') end if if ( strat .eq. 'WEST' .or. & strat .eq. 'EAST' ) then Write (8,122) TIMTGT, TIMFUZ 122 Format (' ',T15, ' Time Target:', & T42,F10.3,' days',/ & ' ',T15, ' Time Fuzziness:', & T42,F10.3,' days') end if WRITE(8,1221) DV 1221 FORMAT (' ', t15, ' Initial Delta V:', & t42,F10.5,' mm/sec.') if ( dvquanta .gt. 0.0 ) then Write (8,1222) dvquanta 1222 format(' ',T15, ' Delta V Quantization:', & T42,F10.3,' mm/sec.') if (dvbracket(2) .gt. dvbracket(1)) then write(8,1226) dvbracket 1226 format(' ',T9, 'First post-targeting runout:', & T47,i5,' quanta wrt dv',/, & ' ',T9, ' Last post-targeting runout:', & T47,i5,' quanta',/, & ' ',T9, ' Interval between runouts:', & T47,i5,' quanta') else write(8,1227) 1227 format(' ',T15,'Post-targeting runout:',T39, & 'Not Requested') end if else write (8,1228) 1228 format(' ',T16,'Delta V Quantization:',T42,' Not Used') end if Write (8,123) sigma_dv_fixed, sigma_dv_prop, dragbiasmode, & delta_a_od, sigma_sf_dvod, sigma_sf_drag, Sigma_sf_boost 123 Format(/' ', & T29,'Error Model Parameters', & /,' ',T29,'----------------------',/, & ' ', 15x, 'Fixed Delta-V Error:',T42,F10.5, & ' mm/sec (one-sigma)',/ & ' ', 15x, ' Proportional Error:',T42, F10.5, & ' dv/v (one-sigma)',/, & ' ',T10, ' Drag bias mode:',T48,A4,/, & ' ',T10, 'Semimajor axis Uncertainty:',T42,F10.5, & ' meters',/, & ' ',T10, ' 95 % Scale Factor:',T42,F10.5, & ' sigma (DV & OD) ',/' ',T42,F10.5,' sigma (drag)', & /' ',T42, F10.5, ' sigma (boost)' & ) IF ( DSMADT_DATA_SIGMA .GE. 0.0d0) then write (8,12345) DSMADT_DATA_SIGMA*100.0 else write (8,12346) end if 12345 format(' ',T10, ' Boost Error:',T42,F10.5, & ' cm/sec (one-sigma)') 12346 format(' ',T10, ' Boost Error:',T42, & ' Table look-up.') write(8,1235) yesnostring(quad_err_boost, & 'Optimistic ', 'Pessimistic ') if (drag_error_model .ne. 'FILE') & write(8,12351) yesnostring(quad_err_drag, & 'Optimistic ', 'Pessimistic ') 1235 format(' ',T10,' Daily Boost Errors:', T45, A20) 12351 format(' ',T10,' Daily Drag Errors:', T45, A20) if (dsmaswitch.eq. 'Not Used') then dsmadt(1) = 0.0d0 dsmadt(2) = 0.0d0 TsmaSwitch = 0.0d0 sigma_dsma(1) = 0.0d0 sigma_dsma(2) = 0.0d0 Dsmaswitch = '04-JUL-2076 00:00:00.0000' TsmaSwitch = CH2SEC ( DSMASWITCH, .TRUE., ERROR ) else TsmaSwitch = CH2SEC ( DSMASWITCH, .TRUE., ERROR ) end if Write (8,124) ltop, m, yesno(drag), CD, yesno(lsflag), mass if (ndsmadt_data.lt.1) then Write(8, 1243) dsmadt, sigma_dsma, dsmaswitch plotboost = .false. else write(8,1247) 1247 format(' ',t5,' Boost - Extra (d/dt)(SMA):',T42, & ' Table look-up.') if (dsmadt_epoch.ne.' ') then write(8,12473) 12473 format(' ',t42,' Contains one value per day.') else write(8,12475) 12475 format(' ',t42,' Data time tagged & interpolated.') end if end if 124 Format (/' ', & ' ',T29,'Propagation Parameters', & /,' ',T29,'----------------------', & /,' ',t5,' Geopotential Field Truncation:',T50,I2, & /,' ',t5,' Integration Step Size:',T42,I10, & ' orbits', & /,' ',t5,' Use Drag Force:',T42,a10, & /,' ',t5,' Drag Coefficient:',T42,F10.3, & /,' ',t5,' Use Lunar/Solar Perturbation:',T42,a10 & /,' ',t5,' Satellite mass:', T42,f10.3, & ' kilograms') 1243 format(' ',t5,' Extra (d/dt)(SMA):',T42,2f10.6, & ' meters/day', & /,' ',t5,' Error Sigma in (d/dt)(SMA):',T42,2f10.6, & ' meters/day', & /,' ',t5,' (d/dt)(SMA) Switch point:',T42,A ) write(8,12482) DRAGMODEL 12482 format(' ',t5,' Drag Model:',T49,A10) if ( DRAGMODEL .EQ. 'CONSTANT' ) write (8,12485) DRAGAREA 12485 format(' ',t5,' Constant Area:',T42,F10.6, & ' m-2') write(8, 12487) ATMOS 12487 format(' ',t5,' Area Model:',T45,A10) if (ATMOS .EQ. 'CONSTANT') write (8,12489) ATDEN 12489 format(' ',t5,' Constant Density:',T42,F10.6, & 'kg/km-3') ipage = 2 CALL NEWPAGE(IPAGE,2) if ( (.not. ATARGONLY) .and. & (strat .ne. 'RUNOUT') ) then Write (8,125) 125 Format (' ',/, & ' ',T31,'First Guess Logic',/, & ' ',T31, '-----------------' ) if ( dv .gt. 0 ) then write ( 8,126) dv 126 Format ( ' ',T15,'Initial Delta V Guess:',T42,F10.3,/ & ' ',T30,'Method:',T42,' External'/) else write (8, 127) 127 Format ( ' ',T30,'Method:',T42,' Internal'/) end if end if if (ATMOS .EQ. 'POLYNOMIAL') then write(8,3049) ATDEN_POLY(1), ATDEN_SEMI(1), & ATDEN_POLY(2), ATDEN_SEMI(2), & ATDEN_POLY(3), & ATDEN_POLY(4), ATDEN_ANN(1), & ATDEN_POLY(5), ATDEN_ANN(2) 3049 format(19x,'Input Parameters for Polynomial Density Model',/ & 19x,'---------------------------------------------',/ & ' ', T10, 'Polynomial',T25,E15.7, & ' S/A Magnitude',T55,E15.7/ & ' ', T25,E15.7, & ' Phase',T55,E15.7,' radians'/ & ' ', T25,E15.7/ & ' ', T25,E15.7, & ' Ann Magnitude',T55,E15.7,/ & ' ', T25,E15.7, & ' Phase',T55,E15.7,' radians'/) end if write(8,3050) (flux_slope(i), fbar_slope(i), & flux_bias(i), fbar_bias(i), i=1,6) 3050 format(' ', T10,10x, 'F10.7',11x,'Fbar', & 10x, 'F10.7',11x,'Fbar' & /' ',T10,2(10x, 'Slope'), 2(11x, 'Bias'), & /' ',T10,4(1x,14('-')) & 6(/,T10,4E15.7)) C1 Use OPSFN to open the EZPLOT data file. if (plot) then CALL OPSFN ( 11 , ZFILE , ERROR ) IF ( ERROR ) THEN STOP '>>> ERROR: Unable to open PLOT File.' END IF end if C1 Use OPSFOR to open the GT Biases file. if (dragbiasmode .eq. 'GT' ) then CALL OPSFor ( 14 , GTBIASFILE , ERROR ) IF ( ERROR ) THEN write(8,*) '>>>>>>>>>>>>>>>>> WARNING >>>>>>>>>>>>>>>>>>' write(8,*) 'Unable to open GTBIAS file ',GTBIASFILE write(8,*) 'No ground track biases are assumed for drag.' write(8,*) '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>' ELSE READ ( 14 , GTBIAS ) CLOSE ( 14 ) END IF end if call init_parms if ( dragbiasmode .eq. 'FLUX' ) then if (make_bias_file) then CALL OPSFN ( 17 , NEWBIASFILE , ERROR ) IF ( ERROR ) THEN print *, '>>> ERROR: Cannot open new bias file:' print *, NEWBIASFILE STOP END IF end if end if C1 Use OPSFN to open the EZPLOT data file. if (plot .and. plot_components) then CALL OPSFN ( 16 , ZFILE2 , ERROR ) IF ( ERROR ) THEN STOP '>>> ERROR: Unable to open plot COMPONENTS file.' END IF end if IF ( BOOT ) THEN CALL OPSFN ( 12 , BFILE , ERROR ) IF ( ERROR ) THEN WRITE(*,'(/1X,''GTARG: cannot open GTARG.BOOT.'')') STOP END IF end if inquire (FILE=bfile, NAME=boot_file_name ) inquire (FILE=zfile, NAME=plot_file_name ) inquire (FILE=zfile2, NAME=plot_file2_name ) inquire (FILE=ofile, NAME=output_file_name ) inquire (FILE=newbiasfile, NAME=newbiasfile_NAME ) write (8,1305) & yesno(echo_inpt), yesno(boot), & yesno(echo_grav), & yesno(echo_xing), yesno(watch), & yesno(echo_flux), yesno(watchint), & yesno(echo_bias), yesno(plot), yesno(echo_boost), & yesno(echo_vmatab), & yesno(make_bias_file .and. (dragbiasmode.eq.'FLUX')), & yesno(sites) 1305 format (/' ',t31,'Output Parameters',/ & ' ', t31,'------------------',/, & ' ',T10,' Print input namelist:', T35,a3, & ' ',T45,' Write Boot file:', T70,a3,/ & ' ',T10,' Print Constants:', T35,a3, & ' ',T45,' Print Reference Grid:', T70,a3,/, & ' ',T10,'Monitor Interactively:', T35,a3, & ' ',t45,' Write flux & Kp:', T70,a3,/, & ' ',T5,'Print Targeting Iterations:',T35,a3, & ' ',T45,' Print g.t. biases:', T70,a3/ & ' ',T4,'Plot Ground Track in EZPLOT:', T35,a3, & T45,' Print Input da/dt:', T70,a3,/ & ' ',T10,' Print VMA Table:', T35,a3, & T45,' Write Bias File:', T70, a3,/ & ' ',T10,' Site Overflight GT:', t35,a3 ) if (plot) & write (8,13055) ODEVICE, plotdate, int(odays), & yesno(ezhead), yesno(plot_components), & yesno(plotcycle), yesno(plotboost), & yesno(plotsite.and.sites) 13055 format (/' ',t28, 'EZPLOT Plotting Parameters',/ & ' ', t28,'--------------------------',/, & ' ',T10,' Plotting Device:',T33,A10,/ & ' ',T3,'Starting Date of Plot Axis:',T33, A24,/ & ' ',T10,' Plot Scale (days):',T33,I5, & ' ',T45,'Write EZPLOT header:',T70,a3,/ & ' ',T8,'Plot GT Error Sources:',T35,a3, & ' ',T45,'Plot Cycle Boundary:',T70,a3,/ & ' ',T10,' Plot Boost da/dt:',T35,a3, & t43,'Plot Site Overflights:',t70,a3 & ) write ( 8, 149 ) input_file_name, flux_file_name, & gtbias_file_name, output_file_name if (plot) write(8,1491) plot_file_name if (plot .and. plot_components) & write(8,1492) plot_file2_name if (boot) write(8,1493) boot_file_name if ( (dragbiasmode .eq. 'FLUX') .and. make_bias_file ) & write(8,1495) newbiasfile_name 149 format(/' ',T34,'Input Files', & /,' ',T34,'-----------', & /,' ','Control:',T20,A, & /,' ','Flux Data:',T20,A, & /,' ','Biases:',T20,A,/, & /,' ',T34,'Output Files', & /,' ',T34,'------------', & /,' ','Summary:',T20,A ) 1491 format(' ','GT Plot:',T20,A) 1492 format(' ','Bias Plot:',T20,A) 1493 format(' ','Boot file:',T20,A) 1495 format( ' ','New Biases:',T20,A ) if (NDSMADT_DATA .GT. 0 ) then if (NDSMADT_DATA .GT. MXFLUX) NDSMADT_DATA = MXFLUX if (dsmadt_epoch .eq. ' ') then if ( .not. checkdates ( dsmadt_dates, & ndsmadt_data,ierror, & xdsmadt_dates) ) then write(8, *) '>>> ERROR: dsmadt_dates out of order ', & 'at array element ', ierror,' ',dsmadt_dates(ierror) write(6, *) '>>> ERROR: dsmadt_dates out of order ', & 'at array element ', ierror,' ',dsmadt_dates(ierror) stop 'ERROR EXIT.' end if end if if ( echo_boost .and. (dsmadt_epoch .eq. ' ') ) then C C use dsmadt_dates C do i=1,ndsmadt_data-99,100 CALL NEWPAGE(IPAGE,2) if (i.eq.1) write(8,14798) write (8,14799) do j=0,49 if (dsmadt_data_sigma .lt. 0.0) then write(8,14800) (dsmadt_dates(i+j+k*50)(1:17), & 100.0*dsmadt_data(i+j+k*50), & dsmadt_sigmas(i+j+k*50)*100.0, & k=0,1) else write(8,14800) (dsmadt_dates(i+j+k*50)(1:17), & 100.0*dsmadt_data(i+j+k*50), & dsmadt_data_sigma*100.0, & k=0,1) end if end do end do imax = i-1 if ( mod(ndsmadt_data,100) .ne. 0 ) then CALL NEWPAGE(IPAGE,2) write (8,14799) end if kk = mod(ndsmadt_data,100)/2 if (mod(ndsmadt_data,2).eq.0) kk = kk-1 do j=0,kk if (2+imax+j+kk.le.ndsmadt_data) then if (dsmadt_data_sigma .lt. 0.0) then write(8,14800) ( & dsmadt_dates(1+imax+j+k*kk+k)(1:17), & 100.0*dsmadt_data(1+imax+j+k*kk+k), & dsmadt_sigmas(1+imax+j+k*kk+k)*100.0, & k=0,1) else write(8,14800) ( & dsmadt_dates(1+imax+j+k*kk+k)(1:17), & 100.0*dsmadt_data(1+imax+j+k*kk+k), & dsmadt_data_sigma*100.0, & k=0,1) end if else if (dsmadt_data_sigma .lt. 0.0) then write(8,14800) dsmadt_dates(1+imax+j)(1:17), & 100.0*dsmadt_data(1+imax+j), & dsmadt_sigmas(1+imax+j)*100.0 else write(8,14800) dsmadt_dates(1+imax+j)(1:17), & 100.0*dsmadt_data(1+imax+j), & dsmadt_data_sigma*100.0 end if end if end do c do i=1,ndsmadt_data,2 c if (dsmadt_data_sigma .lt. 0.0) then c if (i.lt.ndsmadt_data) then c write(8,14800) (dsmadt_dates(j)(1:17), c & 100.0*dsmadt_data(j), c & dsmadt_sigmas(j)*100.0, c & j=i,i+1) c else c write(8,14800) dsmadt_dates(i)(1:17), c & 100.0*dsmadt_data(i) , c & dsmadt_sigmas(i)*100.0 c end if c else c if (i.lt.ndsmadt_data) then c write(8,14800) (dsmadt_dates(j)(1:17), c & 100.0*dsmadt_data(j), c & dsmadt_data_sigma*100.0, c & j=i,i+1) c else c write(8,14800) dsmadt_dates(i)(1:17), c & 100.0*dsmadt_data(i) , c & dsmadt_data_sigma*100.0 c end if c end if c if ( (mod(i+1,100).eq.0) .and. c & (i.lt.ndsmadt_data-1) ) then c write (8,3025) aday, atime, ipage c ipage = ipage + 1 c write (8,14799) c end if c end do c 14798 format(27x,'Extra Along Track Forces, cm/day') 14799 format(1x,13x,'Date',t23,'da/dt',' Sigma', & t40,13x, 'Date',t61,'da/dt',' Sigma', & /,1x,17('-'),1x,8('-'),1x,7('-'), & t40,17('-'),1x,8('-'),1x,7('-')) 14800 format(1x,a17, f9.2, f8.2, T40,a17,f9.2, f8.2) else if (Echo_boost) then C *************** C use dsmadt_epoch C CALL NEWPAGE(IPAGE,2) if (dsmadt_data_sigma.lt.0) then write(8,14991) dsmadt_epoch else write(8,1499) dsmadt_epoch, dsmadt_data_sigma end if 1499 format(18x,'Extra Along-Track Forces: da/dt, meters/day',/ & 18x,'-------------------------------------------'/, & 18x,'1st Date = ',A/, & 18x,'sigma = ', f9.4) 14991 format(18x,'Extra Along-Track Forces: da/dt, meters/day',/ & 18x,'-------------------------------------------'/, & 18x,'1st Date = ',A) xjd0=ch2jd(dsmadt_epoch,.true.,ERROR) do j = 1, (ndsmadt_data-1)/7 + 1 imin = j*7-6 imax = min(j*7, ndsmadt_data) if ( ( (dsmadt_data_sigma .lt. 0.0d0) .and. ^ (mod(j,12).eq.0) ) .or. & ( (dsmadt_data_sigma .ge. 0.0d0) .and. ^ ( mod(j,17).eq.0) ) ) then write (8,1496) ' ', (' ---------',i=imin,j*7) CALL NEWPAGE(IPAGE,2) write (8, 14995) 14995 format & (18x,'Extra Along-Track Forces: da/dt, meters/day',/ & 18x,'-------------------------------------------') end if do i=imin,imax xjd(i+1-imin)=xjd0 + dble(real(i)) - 1.0d0 ajd(i+1-imin)=sec2ch((xjd(i+1-imin)-2451545.0d0) & *86400.0d0) end do write (8,1496) ' ', (' ---------',i=imin,j*7) write (8,14975) 'Date:', & (ajd(i+1-imin)(1:6)//'-'//ajd(i+1-imin)(10:11), & i=imin,imax) write (8,1498) 'Boost:',(dsmadt_data(i),i=imin, imax) if (dsmadt_data_sigma .lt. 0) & write(8,1498) 'Sigma:',(dsmadt_sigmas(i),i=imin,imax) end do write (8,1496) ' ', (' -------',i=imin,imax) 1496 format ( 1x, a7, 7a10) 1497 format ( 1x, a7, 7(1x,i9) ) 14975 format (1x, a7,7(1x,a9)) 1498 format ( 1x, a7, 7(1x,f9.4) ) end if end if C1 If DRAG is true, then process the flux data file. IF ( DRAG ) THEN C2 Use OPSFOR to open the flux data file. CALL OPSFOR ( 9 , 'FLUX_DATA' , ERROR ) IF ( ERROR ) THEN print *, goto_string(7,1), & 'GTARG: cannot open file FLUX_DATA.' WRITE(8,'(/,1X,''GTARG: cannot open FLUX DATA FILE.'')') STOP END IF C2 Read the namelist $FLXKP, close the FLUX_DATA file, and then C2 print status. READ ( 9 , FLXKP ) CLOSE( 9 ) C2 If number of days is not in range of 1..MXFLUX, then error. IF ( NUMDAY .LT. 1 .OR. MXFLUX .LT. NUMDAY ) THEN WRITE(*,305) MXFLUX WRITE(8,305) MXFLUX 305 FORMAT(//,1X,'GTARG: NUMDAY is not in range [1,',I4,'].') STOP END IF C C APPLY BIASES TO FLUX DATA, IF REQUIRED C fbar_bias_input = .false. flux_bias_input = .false. fbar_slope_input = .false. flux_slope_input = .false. do i = 1,6 fbar_bias_input = fbar_bias_input .or. & (fbar_bias(i).ne.0.0d0) flux_bias_input = flux_bias_input .or. & (flux_bias(i).ne.0.0d0) fbar_slope_input = fbar_slope_input .or. & (fbar_slope(i).ne.0.0d0) flux_slope_input = flux_slope_input .or. & (flux_slope(i).ne.0.0d0) end do IF (FBAR_BIAS_INPUT .OR. FLUX_BIAS_INPUT .OR. & FBAR_SLOPE_INPUT .OR. FLUX_SLOPE_INPUT ) THEN do i = 2, NUMDAY if (fbar_bias_input) & flxbar(i) = flxbar(i) + & poly(dble(real(i-1)),fbar_bias,6) if (flux_bias_input) & flx(i) = flx(i) + & poly(dble(real(i-1)),flux_bias,6) if (fbar_slope_input) & flxbar(i) = flxbar(i) + & poly(dble(real(i-1)),fbar_slope,6) if (flux_slope_input) & flx(i) = flx(i) + & poly(dble(real(i-1)),flux_slope,6) end do END IF C2> Use CRMINI to compute and save daily ratios of: C2 C2 Cd * density C2 ------------ C2 mass C2 C2 where density is based upon the information in the FLUX_DATA file. C2 I am computing this ratio, rather than just density, in order to C2 avoid having to pass CD and MASS all over Hell. C2 C2 The alternate entry point, CRMGET, returns ratios for a given day C2 when needed (i.e., in PROP). CALL CRMINI( NUMDAY , DAYONE , FLX , FLXBAR , KP , CD , MASS, & DFLX, DFLXBAR, DKP ) END IF C C initialize site data call UPCASE(SITE_LOC_TYPE) call UPCASE(SITE_STRAT) if (.not.((site_strat.eq.'PROP').or. & (site_strat.eq.'KEPLER'))) then write(8,*) '>>> INVALID SITE_STRAT = ',SITE_STRAT write(8,*) ' PROP assumed.' SITE_STRAT = 'PROP' end if do i = 1, NSITES C C Make sure SITE_LOC(2,I) = geodetic latitude C and SITE_GCLAT(I) = geocentric latitude C if (site_loc_type .EQ. 'GEOCENTRIC') then C C input is in GEOCENTRIC COORDINATES, Convert to GEODETIC C SITE_GCLAT(I) = SITE_LOC(2,i) SITE_LOC(2,I) = tan(SITE_GCLAT(I)*PI/180.0)/ & ( 1.0d0 - FLAT )**2 SITE_LOC(2,i) = (180.0/PI)*ATAN(SITE_LOC(2,I)) else C C input is in GEODETIC COORDINATES, Convert to GEOCENTRIC C SITE_GCLAT(I) = ( 1.0d0 - FLAT )**2 & * tan ( SITE_LOC(2,I)*PI/180.0 ) SITE_GCLAT(I) = (180.0/PI) * ATAN ( SITE_GCLAT(I) ) if (Site_LOC_TYPE.NE.'GEODETIC') then write(8,*) '>>> WARNING: SITE_LOC_TYPE = ', & SITE_LOC_TYPE,' is invalid. ', & 'Input is assumed to be in GEODETIC ', & 'coordinates.' end if end if end do if (.not.sites) NSITES = 0 C if (NSITES .GT. 0 ) then C write(8,1133) (SITE_NAME(i), C & site_loc(2,i),site_gclat(i), C & site_loc(1,i),site_node(i),i=1,nsites) C1133 format (//T16,'Site',9x,'GD Lat',9x, 'GC Lat', 6x, C & 'Longitude',1x,'Node', C & /,T10,10('-'),3(1x,14('-')),1x,4('-') , C & (/,T10, A10,3F15.7,I5) ) C end if if (echo_grav) then if (ndsmadt_data .gt. 0 ) then CALL NEWPAGE(IPAGE,2) end if write(8,1135) 1135 format(' ',/, & ' ', 31x,'Physical Constants',/, & ' ', 31x,'------------------') write (8,114) (i,jearth(i),i=2,9),(i,jearth(i),i=10,29) 114 format(2(' ',2x,4(' J',i1,' =',e13.5),/), & 5(' ',2x,4(' J',i2,'=',e13.5),/)) write (8,1143) earth_rad, earth_freq, earth_rate,mu_earth, & mu_moon, mu_sun, sid_day, deg_to_km, 1.0d0/flat 1143 format(' ',t15,' Earth radius:', & t42, F20.10,' kilometers', & /,' ',t15,' Earth rotation rate:',t42,F20.18, & ' rad/sec',t75,'(*)', & /,' ',t42,F20.10,' meters/day',t75,'(*)', & /,' ',t25,' GM, earth:',t42,F20.10,' km**3/sec**2', & /,' ',t25,' GM, moon:',t42,F20.10,' km**3/sec**2', & /,' ',t25,' GM, sun:',t37,F25.10,' km**3/sec**2', & /,' ',T5, ' Length of Sidereal Day:', & T42,F20.10,' seconds', & /,' ',T5, ' 1 Deg. of Equatorial Longitude:', & T42,F20.10, ' kilometers',t75,'(*)', & /,' ',T14,' Earth Flattening, 1/f:', & T42,F20.10, & //,27x,'[ (*) Derived parameters. ]' & ) end if if (echo_xing) then CALL NEWPAGE(IPAGE,2) write (8, 110) orbits 110 format(' ',20x,i3,' Reference Equator Crossing Longitudes', & /,' ',20x,'-----------------------------------------') write (8, 111) ( xings(i), i=1,orbits) 111 format(' ', 5x, 7f10.4) end if if ( echo_bias .and. & drag .and. & (dragbiasmode .eq. 'GT') ) then CALL NEWPAGE(IPAGE,2) write (8, 112), ngtbias_drag write (8, 113) (gtbias_drag(i),i=1,ngtbias_drag) 112 format (' ',18x, & i4,' Days Ground Track Biases for Drag (in km)',/, & ' ',18x,'----------------------------------------------') 113 format (' ',5x,10f7.3) end if if ( echo_flux .and. drag ) then CALL NEWPAGE(IPAGE,0) WRITE(8,304) NUMDAY , DAYONE 304 FORMAT(/' ',22X,'FLUX & Geomagnetic Data Summary',/, & ' ',22x,'-------------------------------', & /,22X,i5, ' days starting ',a11) Write(8,30401) YesNo(Flux_Slope_Input), & YesNo(Fbar_Slope_Input), YesNo(Flux_bias_input), & YEsNo(Fbar_bias_Input) 30401 format (/' ','Includes: ', & ' F10.7 Slope:',A3,' Fbar Slope:',A3, & ' F10.7 Bias:', A3, ' Fbar Bias:', A3/ ) xjd0=ch2jd(dayone,.true.,ERROR) do j = 1, (numday-1)/10 + 1 imin = j*10-9 imax = min( j*10, NUMDAY) if (mod(j,10).eq.0) then write(8,3039) ' ',(' ------',i=imin,j*10) CALL NEWPAGE(IPAGE,2) write (8,30405) 30405 FORMAT(' ',22X,'FLUX & Geomagnetic Data Summary',/, & ' ',22x, '-------------------------------') end if do i=imin,imax xjd(i+1-imin)=xjd0 + dble(real(i)) - 1.0d0 ajd(i+1-imin)=sec2ch((xjd(i+1-imin)-2451545.0d0) & *86400.0d0) end do write(8,3039) ' ',(' ------',i=imin,j*10) C write(8,3037) 'Day:',(i-1,i=imin,imax) write(8,30375)'Date:',(ajd(i+1-imin)(1:6),i=imin,imax) write(8,3038) 'F10.7:',(flx(i),i=imin,imax) write(8,3038) 'Fbar:',(flxbar(i),i=imin,imax) write(8,3038) 'Kp:',(kp(i), i=imin,imax) end do write(8,3039) ' ',(' ------',i=imin, imax) 3037 format(1x,a7,10(1x,i6)) 30375 format(1x,a7,10(1x,a6)) 3038 format(1x,a7,10(1x,f6.2)) 3039 format(1x,a7,10(1x,a6)) 3041 format(2x, 4(' Flux Fbar Kp ')) 3045 format(2x, 4(f6.2,1x,f6.2,1x,f4.2,1x) ) if (dragbiasmode .eq. 'FLUX' ) then CALL NEWPAGE(IPAGE,2) WRITE(8,3046) 3046 FORMAT(' ',26X,'FLUX & Geomagetic Data Error Sigmas',/, & ' ',26x, '-----------------------------------') 3047 format(2x, 4(' dFlux dFbar dKp ')) do j = 1, (numday-1)/10 + 1 imin = j*10-9 imax = min( j*10, NUMDAY) if (mod(j,10).eq.0) then write(8,3039) ' ',(' ------',i=imin,j*10) CALL NEWPAGE(IPAGE,2) write (8,3046) end if do i=imin,imax xjd(i+1-imin)=xjd0 + dble(real(i)) - 1.0d0 ajd(i+1-imin)=sec2ch((xjd(i+1-imin)-2451545.0d0) & *86400.0d0) end do write(8,3039) ' ',(' ------',i=imin,j*10) C write(8,3037) 'Day:',(i-1,i=imin,imax) write(8,30375)'Date:',(ajd(i+1-imin)(1:6),i=imin,imax) write(8,3038) 'dF10.7:',(dflx(i),i=imin,imax) write(8,3038) 'dFbar:',(dflxbar(i),i=imin,imax) write(8,3038) 'dKp:',(dkp(i), i=imin,imax) end do write(8,3039) ' ',(' ------',i=imin,imax) end if end if C1 Echo $INPUT. if ( echo_inpt ) then CALL NEWPAGE(IPAGE,2) write (8,3053) 3053 format(' ','Input Namelist',/,' ','--------------') WRITE(8,INPUT) end if if (echo_vmatab) then CALL NEWPAGE(IPAGE,2) write(8,3054) 3054 format(1x,t34,'VMA Table',/t34,'---------',/ * 1x,4(' Beta Drag SRP ')/, * 1x,4(' Prime Area Area ')/, * 1x,4(' ----- ----- ----- ')) do i=0,45 write(8,3055)((vmatab(k,90-45*j-i),k=1,3),j=0,3) 3055 format(1x,4(f6.1,2f6.2,1x) ) end do write(8,3056) breakpts, careas 3056 format(//1x,'Note: SRP Area is not currently used by GTARG.', * //1x,'VMA Break Points: ', 2f6.2, * ' Constant Drag Areas:', 2f6.2 ) end if C1 If required, write out the $ZFRAME namelist to the EZPLOT data file. C1 Note that the range of the y-axis is arbitrarily set to 300 days. C1 The user can edit GTARG.Z after GTARG has terminated. Also, draw C1 in the boundaries using dashed lines. IF ( PLOT ) then IF ( EZHEAD ) THEN DEVICE = ODEVICE SUMMRY = .FALSE. IF ( TITLE .EQ. '?') then IF ( STRAT .EQ. 'RUNOUT' ) THEN TITLE = 'Ground Track Runout ' ELSE IF ( STRAT .EQ. 'LONG' ) THEN TITLE = 'Longitudinal Targeting ' & // 'to the West Boundary' ELSE IF ( STRAT .EQ. 'EAST' ) THEN TITLE = 'Time Targeting ' & // 'to the East Boundary' ELSE IF ( STRAT .EQ. 'WEST' ) THEN TITLE = 'Time Targeting ' & // 'to the West Boundary' ELSE WRITE(*,307) STRAT WRITE(8,307) STRAT 307 FORMAT(/,1X,'GTARG: STRAT("',A6,'") is invalid.') STOP END IF END IF plotdelta = ( CH2SEC ( date, .TRUE., ERROR ) - & CH2SEC ( plotdate, .TRUE., ERROR ) )/86400.0d0 WINDO(1) = BOUNDS(1) - .1 & - 0.18 * (BOUNDS(2)-BOUNDS(1)+0.2) WINDO(2) = BOUNDS(2) + .1 WINDO(3) = 0.0 + plotdelta WINDO(4) = ODAYS + plotdelta if (plotboost) then XTITLE = '\fr Ground Track, km, or Boost (da/dt) m/day' else XTITLE = '\frGround Track, km.' end if YTITLE = '\frDays From ' // PLOTDATE(1:11) title = '\fr'//title WRITE(11,ZFRAME) call write_line(11, -1.0, -1.0, 0.0+plotdelta, & 1000.0+plotdelta, 4) call write_line(11, 0.0, 0.0, 0.0+plotdelta, & 1000.0+plotdelta, 4) call write_line(11, 1.0, 1.0, 0.0+plotdelta, & 1000.0+plotdelta, 4) call write_label(11, windo(1), & 1.015*(windo(4)-windo(3))+windo(3), & '\fr'//plot_file_name) call write_label(11, & 0.7353*(windo(2)-windo(1))+windo(1), & 1.015*(windo(4)-windo(3))+windo(3), & '\fr'//'Created '//aday//' '//atime) if (plot_components) then title = '\frGround Track Biasing Components' write(16,zframe) call write_line(16, -1.0, -1.0, 0.0+plotdelta, & 1000.0+plotdelta, 2) call write_line(16, 0.0, 0.0, 0.0+plotdelta, & 1000.0+plotdelta, 2) call write_line(16, 1.0, 1.0, 0.0+plotdelta, & 1000.0+plotdelta, 2) call write_label(16, windo(1), & 1.015*(windo(4)-windo(3))+windo(3), & '\fr'//plot_file2_name) call write_label(16, & 0.7353*(windo(2)-windo(1))+windo(1), & 1.015*(windo(4)-windo(3))+windo(3), & '\fr'//'Created '//aday//' '//atime) call write_line ( 16, 0.1*(windo(2)-windo(1))+windo(1), & 0.2*(windo(2)-windo(1)) + windo(1), & 0.95*(windo(4)-windo(3)) + windo(3), & 0.95*(windo(4)-windo(3)) + windo(3), 1) call write_label(16, 0.22*(windo(2)-windo(1))+windo(1), & 0.95*(windo(4)-windo(3)) + windo(3), & 'Unbiased Track') call write_line ( 16, 0.1*(windo(2)-windo(1))+windo(1), & 0.2*(windo(2)-windo(1)) + windo(1), & 0.9*(windo(4)-windo(3)) + windo(3), & 0.9*(windo(4)-windo(3)) + windo(3), 2) call write_label(16, 0.22*(windo(2)-windo(1))+windo(1), & 0.9*(windo(4)-windo(3)) + windo(3), & 'OD Error Bias') call write_line ( 16, 0.1*(windo(2)-windo(1))+windo(1), & 0.2*(windo(2)-windo(1)) + windo(1), & 0.85*(windo(4)-windo(3)) + windo(3), & 0.85*(windo(4)-windo(3)) + windo(3), 3) call write_label(16, 0.22*(windo(2)-windo(1))+windo(1), & 0.85*(windo(4)-windo(3)) + windo(3), & 'DV Error bias') call write_line ( 16, 0.1*(windo(2)-windo(1))+windo(1), & 0.2*(windo(2)-windo(1)) + windo(1), & 0.80*(windo(4)-windo(3)) + windo(3), & 0.80*(windo(4)-windo(3)) + windo(3), 4) call write_label(16, 0.22*(windo(2)-windo(1))+windo(1), & 0.8*(windo(4)-windo(3)) + windo(3), & 'Density Prediction Bias') call write_line ( 16, 0.1*(windo(2)-windo(1))+windo(1), & 0.2*(windo(2)-windo(1)) + windo(1), & 0.75*(windo(4)-windo(3)) + windo(3), & 0.75*(windo(4)-windo(3)) + windo(3), 1) call write_label(16, 0.22*(windo(2)-windo(1))+windo(1), & 0.75*(windo(4)-windo(3)) + windo(3), & 'Boost Prediction Bias') call write_line ( 16, 0.1*(windo(2)-windo(1))+windo(1), & 0.2*(windo(2)-windo(1)) + windo(1), & 0.7*(windo(4)-windo(3)) + windo(3), & 0.7*(windo(4)-windo(3)) + windo(3), 5) call write_label( 16, 0.22*(windo(2)-windo(1))+windo(1), & 0.7*(windo(4)-windo(3)) + windo(3), 'RSS Bias') end if END IF END IF C C************************************************************************** C C Now that all the input has been read and the output files C initialized, do the targeting, FINALLY. C C************************************************************************** C C C1 Runout or target the ground track. TGTGT also writes $ZLINE namelists C1 to the EZPLOT data file. CALL TGTGT ( TESTCASE, & STRAT , target_strat , DAYS , & ORBIT , DATE , REV, & DV , PITCH, YAW, DVQUANTA, & M , JEARTH , LTOP , LSFLAG , DRAG , * cd, dsmadt, tsmaswitch, sigma_dsma, & dragbiasmode, & BOUNDS , BNDFUZ , TIMTGT , TIMFUZ , & ORBITS , XINGS , & WATCH , WATCHINT , & SIGMA_DV_FIXED, SIGMA_DV_PROP, DELTA_A_OD, & SIGMA_SF_DVOD, sigma_sf_drag, sigma_sf_boost, & NGTBIAS_DRAG, GTBIAS_DRAG, DVBRACKET, & ATARGONLY, ipage, & ORBEND , DATEND, PLOTDATE, WINDO, boot, & plot, plot_components, plotcycle & ) C C write overflight data to report file C if (sites) then CALL NEWPAGE(IPAGE, 2) WRITE(8, 11200) SITE_STRAT 11200 FORMAT (31x, 'Site Overflights'/ & 31x, '----------------'/ & 31x, 'Method = ', A6,/) write(8,11202) (SITE_NAME(i), & site_loc(2,i),site_gclat(i), & site_loc(1,i),site_node(i),i=1,nsites) 11202 format (T16,'Site',9x,'GD Lat',9x, 'GC Lat', 6x, & 'Longitude',1x,'Node', & /,T10,10('-'),3(1x,14('-')),1x,4('-') , & (/,T10, A10,3F15.7,I5) ) do i=1,nsites j = 10 do while((site_name(i)(j:j).eq.' ') .and. & (j.gt.1)) j = j-1 end do write(8,11203) site_name(i) write(8,11204) do j=1,noverflights(i) sitedate = sec2ch(overflights(i,j,1)) if (site_strat.eq.'KEPLER') then overflights(i,j,4) = & site_loc(1,i) - overflights(i,j,2)/deg_to_km end if write(8,11206) sitedate(1:17), & nint(overflights(i,j,5)), & nint(overflights(i,j,5)).eq.site_node(i), & overflights(i,j,3), & overflights(i,j,4), overflights(i,j,2) end do end do 11203 format(//1x,<(71-j)/2>x,'Site = ',a/ & 1x,<(71-j)/2>x,'-------',('-')) 11204 format(/ & 1x, 14x,'Overflight',3x,'Rev #',24x,'Longitudinal',/ & 1x, 11x,'UTC Date/Time Used Latitude', & ' Longitude Offset, Km',/ & 1x, 7x, '----------------- ------- -----------', & ' ---------- ------------') 11206 format(1x,7x, A17,1x, I5,1x,L1,F12.5,F11.5,F13.5) end if C C write overflight data to plot C plotepoch = CH2SEC ( date, .TRUE., ERROR ) if ( PLOTSITE) then do I=1,NSITES NPTS = NOVERFLIGHTS(I) STYLE = 0 SYMBOL = SITE_SYM(I) do j=1,NOVERFLIGHTS(I) C write(8,*) SITE_NAME(I), (OVERFLIGHTS(I,J,k),k=1,2) X(J) = OVERFLIGHTS(I,J,2) Y(J) = ( OVERFLIGHTS(I,J,1) - PLOTEPOCH )/86400.0d0 & + PLOTDELTA end do TEXT = CHAR(symbol)//' '//SITE_NAME(I) XTXT = WINDO(2)+(WINDO(2)-WINDO(1))*0.01 YTXT = WINDO(3)+ i * ( (WINDO(4)-WINDO(3))*0.05 ) write(11,ZLINE) end do end if C close files if (plot) CLOSE( 11 ) if (boot) close(12) if (plot .and. plot_components) CLOSE( 16 ) if ( dragbiasmode .eq. 'FLUX') then if (make_bias_file) then write(17,gtbias) close(17) end if end if cputime = getcpu() - cputime clockend = secnds(0.0) elapsedtime = clockend - clockstart if (elapsedtime .lt. 0.0) elapsedtime = elapsedtime+86400.0 call vmsdate (aday) call time (atime) write (8, * ) ' ' write (8, * ) 'GTARG run completed ',aday,' ',atime write ( 8, 1500 ) 'Total CPU time = ', cputime, ' seconds.' write (8, 1500) 'Elapsed time = ', elapsedtime, ' seconds.' write (8, 1500)'CPU Utilization = ', 100.0* cputime/elapsedtime, * ' percent.' close ( 8 ) 1500 FORMAT(1X,A,F12.1,A) 1501 format(1x,75('*')) print *, goto_string(24,1), 'Run completed.',aday,' ',atime write (6,1501) write (6, 1500 ) 'Total CPU time = ', cputime, ' seconds.' write (6, 1500) 'Elapsed time = ', elapsedtime, ' seconds.' write (6, 1500)'CPU Utilization = ',100.0*cputime/elapsedtime, * ' percent.' write (6,1501) WRITE (6,*) 'Output File: ',output_file_name if (plot) write (6,*) 'EZPLOT Files: ',plot_file_name if (plot .and. plot_components) * write (6,*) ' ',plot_file2_name if (boot) *write (6,*) 'Boot File: ',boot_file_name if ( (dragbiasmode .eq. 'FLUX') .and. MAKE_BIAS_FILE) &write(6,*) 'New Biases: ', newbiasfile_name write (6,1501) stop 'Thank you for using GTARG!' C1 End of GTARG. END