Ich bin neu und lerne IDL auf einer steilen Kurve. Ich habe 2 PROS erste folgtAufrufroutine in IDL-Programmiersprache
Pro READ_Netcdf1,infile,temperature,time,print_prompts=print_prompts
COMPILE_OPt IDL2
infile='D:/Rwork/dataset/monthly_mean/version_2C/air.2m.mon.mean.nc'
IF (N_Elements(infile) EQ 0) Then STOP,'You are being silly, you must specify infile on call'
print,infile
iid = NCDF_OPEN(infile)
NCDF_VARGET, iid, 'time', time ; Read time
NCDF_VARGET, iid, 'air', temperature ; Read surface average temperature
NCDF_VARGET, iid, 'lat', latitude ; Read Latitude
NCDF_VARGET, iid, 'lon', longitude ; Read Longitude
NCDF_CLOSE, iid ; Close Input File
Centigrade=temperature-273.15
print,'Time'
print,time[0:9]
Print, 'Latitude'
Print, latitude[0:9]
Print, 'Longitude'
Print, longitude[0:9]
print,'Temperature'
print, temperature[0:9]
Print, 'Centigrade'
Print, Centigrade[0:9]
;ENDIF
RETURN
END
Dies funktioniert perfekt. Mein zweiter Pro ist wie folgt: -
PRO Change_Kelvin_to_Cent,Temperature
;+ This programme take the temperature from the NETCDF file and converts
; to Centigrade
;Output
; The Month Mean Temperature in Centigrade
; Must have read ncdf1 in the directory run first
;
; -
COMPILE_OPt IDL2
infile='D:/Rwork/dataset/monthly_mean/version_2c/air.2m.mon.mean.nc'
read_netcdf1, infile, Temperature
Centigrade = Temperature-273.15
print,'Centigrade'
print,Centigrade[0:9]
RETURN
END
Dies funktioniert auch ich angewiesen bin wird die Variable „Temperatur“ von der ersten PRO nennen die Temperatur in der zweiten PRO ohne die Befehlszeile
zu berechnenread_netcdf1, Infile, Temperatur
Ich kann das nicht zur Arbeit bekommen. Kann mir jemand aus diesem Problem raten und mir helfen