2017年8月4日金曜日

GDLSSW003_en, sswdb and ON_IOERROR

Notebook for using SSW (Solar Soft Ware) on GDL (GNU Data Language).


In the previous article, ssw_gdl starts with error messages.

Next, I executed sswdb_upgrade.pro for install of SSWDB.

For SSWDB, one needs a text file (setup.sswdb_upgrade) made by selecting instruments.




Error of ON_IOERROR


In the following command, 'sswdb_upgrade' is executed.

GDL> sswdb_upgrade, /spawn, /loud

Then, the procedure show error messages in file_stat.pro and ssw_file_delete.pro on 'openr.'

% OPENR: Error opening file. Unit: 100, File:
% Execution halted at: FILE_STAT           69 /media/yamamoto/_dat11/ssw/gen/idl/system/file_stat.pro

Following lines are common in these procedures.

>      on_ioerror,err
>      openr,lun,/get_lun,files(i)

In IDL, when an error occurs in 'openr', a conditional expression 'on_ioerror' works, and then other lines are executed.

However, in GDL, this 'on_ioerror' does not work, and a procedure stop at 'openr'.

Then, I changed these lines as follows. (e.g., file_stat.pro)

>      on_ioerror,err
>      openr,lun,/get_lun,files(i)
>      fstat_lun = fstat(lun)
>      free_lun,lun

<      openr,lun,/get_lun,files(i),ERROR=err1
<      if err1 ne 0 then begin
<         fstat_lun = fstat(1)
<         fstat_lun.name=''
<         fstat_lun.size=0
<      endif else begin
<         fstat_lun = fstat(lun)
<         free_lun,lun
<      endelse

fstat_lun.name and fstat_lun.size are return values of 'file_stat'

Note that, in file_stat.pro,  'free_lun' is far from 'openr'.



Using the following command, I checked 'on_ioerror' in installed procedures.

$  find /???/ssw/ -type f -print | xargs grep 'on\_ioerror' > ioerror.txt

I found 265 lines.

Several lines are explanations. But, it is very difficult to modify these lines by hand.

I have not installed all SSW procedures.

I installed SSW of GOES, SOHO, Trace, Yohkoh, and SDO.

0 件のコメント:

コメントを投稿

注目の投稿

【貨幣循環】名目GDPと M=G+I と V=1/(1-β) の成長率

「 【貨幣循環】貨幣循環導入の3点セット 」では、貨幣循環の定式化である M=G+I と V=1/(1-β) を紹介した。「 【貨幣循環】歳出伸び率とGDP成長率の関係 」では、名目GDPの成長率と政府支出Gの成長率の関係を紹介した。本記事では、MとV、および名目GDPの成長率...

人気の投稿