?? sec6-1.htm
字號:
<table cellpadding=0 cellspacing=0>
<tr>
<td width=75 height=0></td>
</tr>
<tr>
<td></td>
<td><img width=400 height=315 src="Sec6-1.files/image003.gif" v:shapes="_x0000_s1028 _x0000_s1029 _x0000_s1030 _x0000_s1031 _x0000_s1032 _x0000_s1033 _x0000_s1034 _x0000_s1035 _x0000_s1036 _x0000_s1037"></td>
</tr>
</table>
</span><![endif]><!--[if gte vml 1]></o:wrapblock><![endif]--><br
style='mso-ignore:vglayout' clear=ALL>
<a name="第6_1_3"><span lang=EN-US style='font-size:16.0pt'>6.1.3</span></a><span
lang=EN-US style='font-size:16.0pt'> </span><span lang=ZH-CN style='font-size:
16.0pt;font-family:楷體_GB2312;color:red'>過程</span><span lang=EN-US
style='font-size:16.0pt'><o:p></o:p></span></p>
<p style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l2 level1 lfo4;
tab-stops:list 18.0pt'><a name="第6_1_3a"></a><![if !supportLists]><span
lang=EN-US style='font-family:宋體;mso-bidi-font-family:宋體;color:red'><span
style='mso-list:Ignore'>a)<span style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]><span lang=ZH-CN style='font-family:宋體;
color:red'>外部過程</span><span lang=EN-US style='font-family:宋體;color:red'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='line-height:17.0pt;mso-line-height-rule:
exactly'><span lang=ZH-CN>如果過程是一個獨立于主程序單元的程序單元,它就是外部過程。外部過程也可以通過非</span><span
lang=EN-US>Fortran</span><span lang=ZH-CN>語言</span><span lang=EN-US>(</span><span
lang=ZH-CN>通常是匯編語言</span><span lang=EN-US>)</span><span lang=ZH-CN>來定義。外部過程的形式有兩種:</span></p>
<p class=MsoBodyTextIndent2 style='line-height:15.0pt;mso-line-height-rule:
exactly'><span lang=ZH-CN style='color:fuchsia'>外部函數</span><span lang=EN-US
style='color:fuchsia'><span style='mso-spacerun:yes'> </span></span><span
lang=ZH-CN>:</span><span lang=EN-US>FUNCTION</span><span lang=ZH-CN>語句</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:122.4pt;mso-char-indent-count:
10.2;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>[</span><span lang=ZH-CN>說明部分</span><span lang=EN-US>]<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:122.4pt;mso-char-indent-count:
10.2;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>[</span><span lang=ZH-CN>可執行部分</span><span lang=EN-US>]<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:95.4pt;mso-char-indent-count:
7.95;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>[CONTAINS<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:122.4pt;mso-char-indent-count:
10.2;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=ZH-CN>內部過程</span><span lang=EN-US>]<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:95.4pt;mso-char-indent-count:
7.95;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>END [FUNTION</span><span lang=ZH-CN>函數名</span><span lang=EN-US>]</span></p>
<p class=MsoBodyTextIndent2 style='line-height:15.0pt;mso-line-height-rule:
exactly'><span lang=ZH-CN style='color:fuchsia'>外部子程序</span><span lang=ZH-CN>:</span><span
lang=EN-US>SUBROUTINE</span><span lang=ZH-CN>語句</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:122.4pt;mso-char-indent-count:
10.2;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>[</span><span lang=ZH-CN>說明部分</span><span lang=EN-US>]<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:122.4pt;mso-char-indent-count:
10.2;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>[</span><span lang=ZH-CN>可執行部分</span><span lang=EN-US>]<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:95.4pt;mso-char-indent-count:
7.95;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>[CONTAINS<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:122.4pt;mso-char-indent-count:
10.2;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=ZH-CN>內部過程</span><span lang=EN-US>]<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:95.4pt;mso-char-indent-count:
7.95;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>END [SUBROUTINE</span><span lang=ZH-CN>子程序名</span><span lang=EN-US>]</span></p>
<p style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l2 level1 lfo4;
tab-stops:list 18.0pt'><a name="第6_1_3b"></a><![if !supportLists]><span
lang=EN-US style='font-family:宋體;mso-bidi-font-family:宋體;color:red'><span
style='mso-list:Ignore'>b)<span style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]><span lang=ZH-CN style='font-family:宋體;
color:red'>內部過程</span><span lang=EN-US style='font-family:宋體;color:red'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='line-height:17.0pt;mso-line-height-rule:
exactly'><span lang=ZH-CN>內部過程是包含于外部過程、模塊或主程序單元之中的程序單元。在宿主程序單元中,以</span><span
lang=EN-US>CONTAINS</span><span lang=ZH-CN>語句把內部過程與其他部分分開。內部過程也具有兩種形式:</span></p>
<p class=MsoBodyTextIndent2 style='line-height:15.0pt;mso-line-height-rule:
exactly'><span lang=ZH-CN style='color:fuchsia'>內部函數</span><span lang=EN-US
style='color:fuchsia'><span style='mso-spacerun:yes'> </span></span><span
lang=ZH-CN>:</span><span lang=EN-US>FUNCTION</span><span lang=ZH-CN>語句</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:122.4pt;mso-char-indent-count:
10.2;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>[</span><span lang=ZH-CN>說明部分</span><span lang=EN-US>]<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:122.4pt;mso-char-indent-count:
10.2;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>[</span><span lang=ZH-CN>可執行部分</span><span lang=EN-US>]<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:95.4pt;mso-char-indent-count:
7.95;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>END [FUNTION</span><span lang=ZH-CN>函數名</span><span lang=EN-US>]</span></p>
<p class=MsoBodyTextIndent2 style='line-height:15.0pt;mso-line-height-rule:
exactly'><span lang=ZH-CN style='color:fuchsia'>內部子程序</span><span lang=ZH-CN>:</span><span
lang=EN-US>SUBROUTINE</span><span lang=ZH-CN>語句</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:122.4pt;mso-char-indent-count:
10.2;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>[</span><span lang=ZH-CN>說明部分</span><span lang=EN-US>]<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:122.4pt;mso-char-indent-count:
10.2;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>[</span><span lang=ZH-CN>可執行部分</span><span lang=EN-US>]<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:95.4pt;mso-char-indent-count:
7.95;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>END [SUBROUTINE</span><span lang=ZH-CN>子程序名</span><span lang=EN-US>]</span></p>
<p class=MsoBodyTextIndent2 style='line-height:17.0pt;mso-line-height-rule:
exactly'><span lang=ZH-CN>注意內部過程中不能再包含內部過程,即</span><span lang=EN-US>F90</span><span
lang=ZH-CN>不是過程嵌套式語言。</span></p>
<p style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l2 level1 lfo4;
tab-stops:list 18.0pt'><a name="第6_1_3c"></a><![if !supportLists]><span
lang=EN-US style='font-family:宋體;mso-bidi-font-family:宋體;color:red'><span
style='mso-list:Ignore'>c)<span style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]><span lang=ZH-CN style='font-family:宋體;
color:red'>內在過程</span><span lang=EN-US style='font-family:宋體;color:red'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='line-height:17.0pt;mso-line-height-rule:
exactly'><span lang=ZH-CN>內在過程是</span><span lang=EN-US>Fortran</span><span
lang=ZH-CN>含于編譯器程序庫中的過程,它不需任何其它聲明或說明即可使用。</span><span lang=EN-US>F90</span><span
lang=ZH-CN>中定義了</span><span lang=EN-US>113</span><span lang=ZH-CN>個內在過程,它們為科學計算提供了極大方便,內在過程除了第一章中介紹的部分內在函數和第五章中介紹的部分數組函數外,還有其他一些內在函數及內在子程序,其具體使用方法請查看</span><span
lang=EN-US>Visual Fortran</span><span lang=ZH-CN>的聯機幫助。內在過程共分為四類:</span></p>
<p class=MsoBodyTextIndent2 style='margin-left:42.0pt;text-indent:-18.0pt;
mso-char-indent-count:0;line-height:17.0pt;mso-line-height-rule:exactly;
mso-list:l0 level1 lfo6;tab-stops:list 42.0pt left 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><![if !supportLists]><span
lang=EN-US style='mso-bidi-font-family:宋體'><span style='mso-list:Ignore'>1、</span></span><![endif]><span
lang=ZH-CN>查詢函數:它們的返回值是根據變元的性質而非變元的取值。</span></p>
<p class=MsoBodyTextIndent2 style='margin-left:99.25pt;text-indent:-75.25pt;
mso-char-indent-count:0;line-height:17.0pt;mso-line-height-rule:exactly;
mso-list:l0 level1 lfo6;tab-stops:42.55pt list 127.6pt left 137.4pt 5.0cm 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><![if !supportLists]><span
lang=EN-US style='mso-bidi-font-family:宋體'><span style='mso-list:Ignore'>2、<span
style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span
lang=ZH-CN>基本過程:由標量變元指明的基本過程,但可以用標量或數組實元進行調用。有許多函數是這種基本函數,并有一種基本內在子程序</span><span
lang=EN-US>(MVBITS)</span><span lang=ZH-CN>。如果變元是標量,<span class=GramE>則結果</span>也是標量。如果變元是數組,則對數組的每個元素施加過程,其結果是與變元形狀相同的數組。例如,</span><span
lang=EN-US>a</span><span lang=ZH-CN>是數組的話,則</span><span lang=EN-US>b=sin(a)</span><span
lang=ZH-CN>也是數組。</span></p>
<p class=MsoBodyTextIndent2 style='margin-left:3.0cm;text-indent:-61.05pt;
mso-char-indent-count:0;line-height:17.0pt;mso-line-height-rule:exactly;
mso-list:l0 level1 lfo6;tab-stops:42.55pt list 127.6pt left 137.4pt 5.0cm 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><![if !supportLists]><span
lang=EN-US style='mso-bidi-font-family:宋體'><span style='mso-list:Ignore'>3、<span
style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span
lang=ZH-CN>變換函數:其變元是數組,但過程不施加于每個元素,而是把變元變換成另一數組。</span></p>
<p class=MsoBodyTextIndent2 style='margin-left:3.0cm;text-indent:-61.05pt;
mso-char-indent-count:0;line-height:17.0pt;mso-line-height-rule:exactly;
mso-list:l0 level1 lfo6;tab-stops:42.55pt list 127.6pt left 137.4pt 5.0cm 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><![if !supportLists]><span
lang=EN-US style='mso-bidi-font-family:宋體'><span style='mso-list:Ignore'>4、<span
style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span
lang=ZH-CN>非基本過程:只能以標量實元進行調用,除了</span><span lang=EN-US>MVBITS</span><span
lang=ZH-CN>以外的所有內在子程序都是非基本過程。</span></p>
<p class=MsoBodyTextIndent2 style='line-height:17.0pt;mso-line-height-rule:
exactly'><span lang=ZH-CN>如果要用內在過程名作為其它過程的實元,需要用</span><span lang=EN-US>INTRINSIC</span><span
lang=ZH-CN>語句加以聲明。</span></p>
<p class=MsoNormal align=center style='margin-top:15.6pt;margin-right:0cm;
margin-bottom:15.6pt;margin-left:0cm;mso-para-margin-top:1.0gd;mso-para-margin-right:
0cm;mso-para-margin-bottom:1.0gd;mso-para-margin-left:0cm;text-align:center'><a
name="第6_1_4"><span lang=EN-US style='font-size:16.0pt;mso-bidi-font-size:12.0pt;
mso-fareast-font-family:楷體_GB2312'>6.1.4</span></a><span lang=EN-US
style='font-size:16.0pt;mso-bidi-font-size:12.0pt;mso-fareast-font-family:楷體_GB2312'>
</span><span lang=ZH-CN style='font-size:16.0pt;mso-bidi-font-size:12.0pt;
font-family:楷體_GB2312;mso-ascii-font-family:"Times New Roman";color:red'>塊數據</span><b><span
lang=EN-US style='font-size:16.0pt;mso-bidi-font-size:12.0pt;mso-fareast-font-family:
楷體_GB2312'><o:p></o:p></span></b></p>
<p class=MsoBodyTextIndent2 style='line-height:17.0pt;mso-line-height-rule:
exactly'><span lang=ZH-CN>塊數據單元是一種為有名公用塊中的變量定義初始值的一種程序單元,它只包含數據聲明和初始值,不包含可執行語句。其一般形式為:</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:95.4pt;mso-char-indent-count:
7.95;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US style='color:#FF9900'>BLOCK DATA[</span><span lang=ZH-CN
style='color:#FF9900'>塊數據名</span><span lang=EN-US style='color:#FF9900'>]<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:121.45pt;mso-char-indent-count:
10.12;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:
12pt'><span lang=EN-US style='color:#FF9900'>[</span><span lang=ZH-CN
style='color:#FF9900'>說明部分</span><span lang=EN-US style='color:#FF9900'>]<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:95.4pt;mso-char-indent-count:
7.95;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US style='color:#FF9900'>END [BLOCK DATA[</span><span lang=ZH-CN
style='color:#FF9900'>塊數據名</span><span lang=EN-US style='color:#FF9900'>]]</span><span
lang=EN-US style='color:#FF6600'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='line-height:17.0pt;mso-line-height-rule:
exactly'><span lang=ZH-CN>變量一般由</span><span lang=EN-US>DATA</span><span
lang=ZH-CN>語句來初始化。公共塊中命名的變量<span class=GramE>只能在塊數據</span>單元或某個過程中初始化一次,或只能由所有的過程完全一致地初始化。更好的編程法是用模塊而不是塊數據單元<span
class=GramE>來聲明</span>和初始化變量。</span></p>
<p class=MsoBodyTextIndent2 style='line-height:17.0pt;mso-line-height-rule:
exactly'><span class=GramE><span lang=ZH-CN>在塊數據</span></span><span lang=ZH-CN>單元的說明部分,不能包含</span><span
lang=EN-US>ALLOCATABLE</span><span lang=ZH-CN>,</span><span lang=EN-US>AUTOMATIC</span><span
lang=ZH-CN>,</span><span lang=EN-US>EXTERNAL</span><span lang=ZH-CN>,</span><span
lang=EN-US>INTENT</span><span lang=ZH-CN>,</span><span lang=EN-US>OPTIONAL</span><span
lang=ZH-CN>,</span><span lang=EN-US>PRIVATE</span><span lang=ZH-CN>或</span><span
lang=EN-US>PUBLIC</span><span lang=ZH-CN>等屬性說明符。</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:47.4pt;mso-char-indent-count:
3.95;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=ZH-CN>例:</span><span lang=EN-US>BLOCK DATA BLKDAT<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:94.45pt;mso-char-indent-count:
7.87;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>INTEGER S<span class=GramE>,X</span><o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:94.45pt;mso-char-indent-count:
7.87;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>LOGICAL T<span class=GramE>,W</span><o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:94.45pt;mso-char-indent-count:
7.87;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>DOUBLE PRECISION U<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:94.45pt;mso-char-indent-count:
7.87;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>DIMENSION <span class=GramE>R(</span>3)<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:94.45pt;mso-char-indent-count:
7.87;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>COMMON/AREA1/R<span class=GramE>,S,U,T</span>/AREA2/W,X,Y<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:94.45pt;mso-char-indent-count:
7.87;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>DATA R/1.0,2*2.0/,T/.FALSE./,U/0.214537D-7/,W/.TRUE./,Y/3.5/<o:p></o:p></span></p>
<p class=MsoBodyTextIndent2 style='text-indent:72.0pt;mso-char-indent-count:
6.0;line-height:15.0pt;mso-line-height-rule:exactly;mso-char-indent-size:12pt'><span
lang=EN-US>END BLOCK DATA BLKDAT</span></p>
</div>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -