2017-09-13 59 views
0

我是新人,在陡峭的曲线上学习IDL。我有2 PROS第一个如下IDL编程语言中的调用例程

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 

这完美的作品。我的第二个专业如下: -

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 

这也适用 我被指示致电从第一PRO变量“温度”来计算第二PRO 温度不命令行

read_netcdf1,infile,温度

我不能得到这个工作。任何人都可以建议并帮助我解决这个问题请

回答

0

我误会了。它不能完成。您必须拥有 “read_netcdf1,infile,温度”一段代码。虽然温度可以是任何标签,因为它的位置不在措辞中。 我希望这使得sence