FUNCTION map_keywords, ORB_VW=ORB_VW, XUMN=XUMN, XUMX=XUMX, YUMN=YUMN, $
YUMX=YUMX,ZUMN=ZUMN,ZUMX=ZUMX,RUMN=RUMN,RUMX=RUMX, DOYMARK=DOYMARK, $
HRMARK=HRMARK, HRTICK=HRTICK, MNTICK=MNTICK,MNMARK=MNMARK,LNTHICK=LNTHICK,$
CHTSIZE=CHTSIZE, BZ=BZ, PRESS=PRESS, STATION=station, $
IPROJ=IPROJ,LIM=LIM,LATDEL=LATDEL, LONDEL=LONDEL, $
Ttitle=TITLE,SYMSIZ=SYMSIZ,SYMCOL=SYMCOL,POLAT=POLAT,POLON=POLON,$
ROT=ROT, LNLABEL=LNLABEL, BSMP=BSMP, ATLB=ATLB, DTLB=DTLB,$
XSIZE=XSIZE,YSIZE=YSIZE,NOCONT=NOCONT,EQLSCL=EQLSCL,PANEL=PANEL,$
REPORT=reportflag, PID=PID,OUTDIR=OUTDIR, US=US,_extra=extras
status=0
catch, error_status
if(error_status ne 0) then begin
if (reportflag eq 1) then begin
printf, 1, 'STATUS=Error reading keyword file; Use defaults'
endif else begin
print, 'STATUS=Error reading keyword file; Use defaults'
endelse
return, -1
endif
get_lun, lun
filename=OUTDIR+'idl_'+strtrim(string(PID),2)+'.key'
print, "filename=",filename
OPENR,lun, filename
str_val=''
stations=strarr(150)
lats=fltarr(150)
lons=fltarr(150)
iscn=0
while(NOT EOF(lun)) do begin
readf, lun, str_val
parts = str_sep(str_val,'=')
key=strupcase(parts[0])
value=parts[1]
if(key eq 'LATMIN') then LIM=fltarr(4)
case key of
'STATION' : begin
stations[iscn]=value
readf, lun, str_val
parts = str_sep(str_val,'=')
key1=strupcase(parts[0])
val1=parts[1]
if(key1 eq 'LAT') then lats[iscn]=float(val1) else begin
printf, 1, 'STATUS=keyword file error'
printf, 1, 'ERROR=Missing keyword in file error LAT'
endelse
readf, lun, str_val
parts = str_sep(str_val,'=')
key2=strupcase(parts[0])
val2=parts[1]
if(key2 eq 'LON') then lons[iscn]=float(val2) else begin
printf, 1, 'STATUS=keyword file error'
printf, 1, 'ERROR=Missing keyword in file error LON'
endelse
iscn=iscn+1
end
'ORB_VW' : begin
orbs=str_sep(value,' ')
orbs=strlowcase(orbs)
ORB_VW=strarr(n_elements(orbs)+1)
ORB_VW=[orbs]
end
'CHARSIZE' : CHTSIZE=value
'TITLE' : TITLE=value
'LATMIN' : LIM[0]=value
'LONMIN' : LIM[1]=value
'LATMAX' : LIM[2]=value
'LONMAX' : LIM[3]=value
else: x1=execute(key+'='+value)
endcase
endwhile
if(iscn ne 0) then begin
station.num=iscn
ws=where(stations ne '',wsn)
fstat=stations[ws]
flat=lats[ws]
flon=lons[ws]
temp=create_struct('STATION',fstat,'LAT',flat,'LON',flon)
station=create_struct(station,temp)
endif
free_lun, lun
if((n_elements(POLAT) ne 0) and (n_elements(ROT) eq 0)) then ROT=0
if((n_elements(POLAT) ne 0) and (n_elements(POLON) eq 0)) then POLON=0
if((n_elements(POLON) ne 0) and (n_elements(ROT) eq 0)) then ROT=0
if((n_elements(POLON) ne 0) and (n_elements(POLAT) eq 0)) then POLAT=0
if((n_elements(ROT) ne 0) and (n_elements(POLON) eq 0)) then POLON=0
if((n_elements(ROT) ne 0) and (n_elements(POLAT) eq 0)) then POLAT=0
if(n_elements(ORB_VW) ne 0) then print,'ORB_VW=',ORB_VW
if(n_elements(XUMN) ne 0) then print,'XUMN=',XUMN
if(n_elements(YUMN) ne 0) then print,'YUMN=',YUMN
if(n_elements(ZUMN) ne 0) then print,'ZUMN=',ZUMN
if(n_elements(RUMN) ne 0) then print,'RUMN=',RUMN
if(n_elements(XUMX) ne 0) then print,'XUMX=',XUMX
if(n_elements(YUMX) ne 0) then print,'YUMX=',YUMX
if(n_elements(ZUMX) ne 0) then print,'ZUMX=',ZUMX
if(n_elements(RUMX) ne 0) then print,'RUMX=',RUMX
if(n_elements(DOYMARK) ne 0) then print,'DOYMARK=',DOYMARK
if(n_elements(HRMARK) ne 0) then print,'HRMARK=',HRMARK
if(n_elements(HRTICK) ne 0) then print,'HRTICK=',HRTICK
if(n_elements(MNMARK) ne 0) then print,'MNMARK=',MNMARK
if(n_elements(MNTICK) ne 0) then print,'MNTICK=',MNTICK
if(n_elements(CHTSIZE) ne 0) then print,'CHTSIZE=',CHTSIZE
if(n_elements(BZ) ne 0) then print,'BZ=', BZ
if(n_elements(PRESS) ne 0) then print,'PRESS=',PRESS
if(n_elements(station) ne 0) then print,'station=',station
if(n_elements(IPROJ) ne 0) then print,'IPROJ=',IPROJ
if(n_elements(LIM) ne 0) then print,'LIM=',LIM
if(n_elements(LATDEL) ne 0) then print,'LATDEL=',LATDEL
if(n_elements(LONDEL) ne 0) then print,'LONDEL=',LONDEL
if(n_elements(TITLE) ne 0) then print,'TITLE=',TITLE
if(n_elements(SYMSIZ) ne 0) then print,'SYMSIZ=',SYMSIZ
if(n_elements(SYMCOL) ne 0) then print,'SYMCOL=',SYMCOL
if(n_elements(LNLABEL) ne 0) then print,'LNLABEL=',LNLABEL
if(n_elements(LNTHICK) ne 0) then print,'LNTHICK=',LNTHICK
if(n_elements(reportflag) ne 0) then print,'reportflag=',reportflag
if(n_elements(PID) ne 0) then print,'PID=',PID
if(n_elements(OUTDIR) ne 0) then print,'OUTDIR=',OUTDIR
if(n_elements(US) ne 0) then print,'US=',US
if(n_elements(BSMP) ne 0) then print,'BSMP=',BSMP
if(n_elements(ATLB) ne 0) then print,'ATLB=',ATLB
if(n_elements(DTLB) ne 0) then print,'DTLB=',DTLB
if(n_elements(POLAT) ne 0) then print, 'POLAT=',POLAT
if(n_elements(POLON) ne 0) then print, 'POLON=',POLON
if(n_elements(ROT) ne 0) then print, 'ROT=',ROT
if(n_elements(NOCONT) ne 0) then print, 'NOCONT=',NOCONT
if(n_elements(EQLSCL) ne 0) then print, 'EQLSCL=',EQLSCL
if(n_elements(PANEL) ne 0) then print, 'PANEL=',PANEL
if(n_elements(XSIZE) ne 0) then print, 'XSIZE=',XSIZE
if(n_elements(YSIZE) ne 0) then print, 'YSIZE=',YSIZE
if(n_elements(extras) ne 0) then print,'extras=',extras
return, status
end