ÈÎÎñÃèÊö£º½«¸ß¿Õ±¨Îĵĸ÷²ãζȣ¨ÒѽâÂ룩ÓÃDelphiд³ÉGrADS¸ñʽµÄdatºÍctlÎļþ£¬²¢½«ÕâЩÎļþ´«Êäµ½LinuxÏ£¬ÔÚLinuxÏ»æÖÆAremÔ¤±¨½á¹ûʱ£¬Ìí¼Óʵ¿öÓÃÓڱȽÏÔ¤±¨ºÍʵ¿ö½á¹û¡£
Äѵ㣺ÓÃDelphiдGrADSÎļþ
DelphiдGrADSÎļþµÄ´úÂ룺[code] //дDatÎļþ£¨DataµÄÊý¾Ý¸ñʽÊÇSingle£©
strTemp:=ExtractFileName(strFileName);
fn:=ExtractFilePath(strFileName)+strTemp+'.dat';
fnCtl:=ExtractFilePath(strFileName)+strTemp+'.ctl';
assignfile(fdat, fn);
rewrite(fdat, 1);
for i:=Low(Data) to High(data) do begin
blockwrite(fdat, Data[i].T, SizeOf(Data[i].T));
end;
closefile(fdat);
//д¿ØÖÆÎļþ
AssignFile(ftxt,fnctl);
Rewrite(ftxt);
write(ftxt, 'dset ^'+ExtractFileName(fn)+chr(10)); //Ö±½ÓÓÃwritelnµÄ»°£¬ÔÚLinuxÏ»á³ö´í
write(ftxt, 'title real data'+chr(10));
write(ftxt, 'options little_endian'+chr(10));
write(ftxt, 'undef -9999.9'+chr(10));
write(ftxt, 'xdef 1 linear 1 1'+chr(10));
write(ftxt, 'ydef 1 linear 1 1'+chr(10));
write(ftxt, 'zdef '+inttostr(length(Data))+' levels '+chr(10));
strTemp:=' ';
for i:=0 to Length(Data)-1 do begin
strTemp:=strTemp+Floattostr(Data[i].H)+' ';
end;
Write(ftxt,strTemp+chr(10));
Write(ftxt, 'tdef 1 linear 12z12JAN2008 1hr'+chr(10));
Write(ftxt,'vars 1'+chr(10));
Write(ftxt,'T '+inttostr(length(Data))+' 0 Temperature'+chr(10));
Write(ftxt,'endvars'+chr(10));
CloseFile(ftxt);[/code]¶ÔLinuxÏÂgs½Å±¾µÄÐ޸ģº
ÐèҪעÒâµÄÊÇ£¬GrADSÏ£¬¿ÉÒÔʹÓò»Í¬ÎļþµÄ±äÁ¿£¬µ«ÊÇ£¬x,y,z,tÕâЩÁ¿Êǹ«Óõģ¬Èç¹ûÁ½¸öÎļþµÄάÊý²»Ò»Ñù£¬¾ÍÐèÒª¶Ôʵ¿öµÄά½øÐÐÉèÖ㬶øÉèÖÃÍê³Éºó£¬ÐèÒª»Ö¸´Ô¤±¨³¡µÄάÊýÉèÖá£ÕâÀZά¹Ì¶¨£¬Èç¹ûÉèÖò»Í¬£¬Õâ»æÖƳöÀ´µÄͼÓÐλÖÃÆ«ÒÆ¡£[code]***************************
'set lev 950 200' Zά²»±ä
'set vpage 0 11 0 8.5'
'set parea 0.7 3.7 4.3 8 '
'set lon 'cslon
'set lat 'cslat
'set xaxis -50 10 10'
'set yaxis 950 200 100' ÉèÖÿ̶ȣ¬ÔËÐÐʱ»á±¨¾¯£¬Ã»¹Øϵ
'd t-273.15'
'draw title cs hh cz 'strymdh
if ((substr(strymdh,9,2)='00' | substr(strymdh,9,2)='12'))
'open /home/disk3a/yaotest/frost/HFile/s57679'strymdh'.ctl'
'set dfile 2'
'set x 1'
'set y 1'
'set t 1' ¸ù¾Ýʵ¿öÎļþÉèÖø÷ά
'set xaxis -50 10 10'
'set yaxis 950 200 100'
'd t'
'close 2'
'set dfile 1'
'set t 't0Backup »Ö¸´Ê±¼äάµÄÉèÖ㬶øx,yάÔòÔÚºóÃæ»áÔÙ´ÎÉèÖã¬ËùÒÔÕâÀï²»ÐèÒª»Ö¸´¡£
endif
'set vpage 0 11 0 8.5'
'set parea 4.1 7.1 4.3 8 '
'set lon 'hhlon
'set lat 'hhlat
'set xaxis -50 10 10'
'set yaxis 950 200 100'
'd t-273.15'
if ((substr(strymdh,9,2)='00' | substr(strymdh,9,2)='12')) Lasg±àµÄÖÐÎÄÊÖ²áûÓÐÂß¼Óï·¨µÄ˵Ã÷£¬ÔÚGrADS¹Ù·½µÄÓ¢ÎÄ°æ˵Ã÷ÀïÓÐ
'open /home/disk3a/yaotest/frost/HFile/s57749'strymdh'.ctl'
'set dfile 2'
'set x 1'
'set y 1'
'set t 1'
'set xaxis -50 10 10'
'set yaxis 950 200 100'
'd t'
'close 2' ¹Ø±ÕÎļþ2
'set dfile 1'
'set t 't0Backup »Ö¸´Ê±¼äά
endif[/code]