Hi,
Can anyone tell me why IDL thinks that the variable in the for loop
below is a string?
Here's the offending part of the script. After I've opened the input
file, I'm trying to loop over the one of the dimensions in the file
(in this case the vertical layers of a file that contains gridded, 3-d
aircraft emissions). I want to plot the emissions at each layer. I
can hard code the layer number in the script and it works fine. When
I try to implement the for loop, IDL is complaining that "lay" is a
string.
In addition, I tried to take the for loop out altogether and just add
in a variable for the layer number, something like:
lay = 2
This gives the same type conversion error
What am I doing wrong here?
Thanks in advance, Zac
...
ni=n_elements(lon)
nj=n_elements(lat)
nz=n_elements(lev)
for lay=0,nz-1 do begin
air_pl=air[*,*,lay]
myct, 1, range=[0.4,1], /reverse
!P.font(0)=0
minvar=0
maxvar=1E9
layr=lay+1
Open_Device, /ps, /Color, filename=''+outdir+'/emissions_'+sim
+'_air_level_'+layr+'_'+pol+'.ps'
tvmap, air_pl, lon, lat, BLACK=1, NColors=225, Bottom = 20, /coasts, $
Title='Layer '+layr+' Aircraft '+pol+' Emissions - '+simtitle,$
/Continents,/Cylindrical,/SAMPLE,/isotropic, $
/CBAR, Divisions=3, min_valid=minvar, $
mindata=minvar, maxdata=maxvar, $
CBFORMAT='(e12.2)', CBMAX=maxvar, CBMIN=minvar,CBUNIT='molec/cm2-
sec',$
/landscape, /grid, /countries, xthick=4,$
ythick=4, thick=1.2, charthick=2, charsize=1, csfac=0.7,
tcsfac=0.
close_device
endfor ; layer loop
endfor ; pollutant loop
|