;+ ; NAME: ; CONVERT ; PURPOSE: ; Conversion from geographic coordinates to PACE geomagnetic ; coordinates (cf. Baker, K.B. and S. Wing, J. Geophys. Res., ; Vol. 94, pg. 9139, 1989) (PACE => Polar Anglo-american ; Conjugate Experiment) ; CATEGORY: ; Coordinate conversion ; CALLING SEQUENCE: ; CONVERT,YR,MON,DAY,HR,MIN,SEC,LAT,LON,ALT $ ; ,MLAT,MLT ; INPUTS: ; YR, MON, DAY: Specify the date (in Universal Time); ; HR, MIN, SEC: Specify the time (in Universal Time); ; LAT, LON, ALT: Specify the location (in degrees of N ; geographic latitude, E longitude, and ; kilometers). ; OPTIONAL INPUTS: ; None. ; KEYWORD PARAMETERS: ; None. ; OUTPUTS: ; MLAT, MLT: Return the geomagnetic latitude and magnetic ; local time (hours) of the specified location. ; OPTIONAL OUTPUTS: ; None. ; COMMON BLOCKS: ; None. ; SIDE EFFECTS: ; Three files are written in ~steele/PACE: scratch0.dat holds ; the input parameters, scratch1.dat holds the output ; parameters, and checkinp.dat holds the inputs as well as ; all parameters generated by the SPAWNed executable. ; RESTRICTIONS: ; PACE doesn't work for altitudes above 600 km. ; PROCEDURE: ; The inputs are written to a formatted file: scratch0.dat. ; An executable file is run via SPAWN, which reads the inputs, ; performs geographic->PACE conversion on them, and writes ; the MLAT and MLT to another formatted file: scratch1.dat. ; The contents of this file are then returned to the calling ; IDL routine. ; EXAMPLE: ; IDL> convert,1995,2,7,16,30,0,51.0800,245.8681,1.1154,mlat,mlt ; IDL> PRINT,mlat,mlt ; 58.6273 7.90959 ; SEE ALSO: ; ; MODIFICATION HISTORY: ; Written by: R A Doe, SRI International, 1993? ; Modified: D P Steele, ISR, U of Calgary, 950207. ;- PRO convert,yr,mon,day,hr,min,sec,lat,lon,alt,mlat,mlt ; This program is an IDL driver for the PACE geomagnetic ; model of Baker and Wing. UT hour, minute and seconds, as well ; as geographic latitude, longitude and altitude are written to ; a file scratch0.dat. The program then spawns out to the FORTRAN ; executable `convert' which converts the input coordinates to ; PACE geomagnetic latitude and magnetic local time. MLAT and MLT ; are then written to a file scratch1.dat and control passes back ; to the IDL program. CD,'~cnsr3/pace',CURRENT=old_dir OPENW,1,'scratch0.dat' PRINTF,1,FORMAT='(6(2x,i2),2x,f6.2,2x,f7.2,2x,f7.2)' $ ,yr MOD 1900,mon,day,hr,min,sec,lat,lon,alt CLOSE,1 SPAWN,"convert",/NOSHELL OPENR,1,'scratch1.dat' READF,1,mlat,mlt CLOSE,1 CD,old_dir RETURN END