0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

FortranAdvent Calendar 2018

Day 18

fortran Error(98) Unclassifiable statement, coding(66)

Last updated at Posted at 2019-08-07

計算物理学 Rubin H. Landau 参考文献・docker登録
https://qiita.com/kaizen_nagoya/items/af924f5ac71ff5cc8c89

<この項は書きかけです。順次追記します。>

docker/ubuntu
# cd /home/cp/HCPcode
# gfortran tune.f90 -o tune
tune.f90:2:4:

     by RH Landau, MJ Paez, and CC Bordeianu
    1
Error: Unclassifiable statement at (1)
tune.f90:3:4:

     Copyright Wiley-VCH Verlag GmbH & Co. KGaA, Berlin;  Copyright R Landau,
    1
Error: Unclassifiable statement at (1)
tune.f90:3:57:

     Copyright Wiley-VCH Verlag GmbH & Co. KGaA, Berlin;  Copyright R Landau,
                                                         1
Error: Unclassifiable statement at (1)
tune.f90:4:4:

     Oregon State Unv, MJ Paez, Univ Antioquia, C Bordeianu, Univ Bucharest, 2015.
    1
Error: Unclassifiable statement at (1)
tune.f90:5:4:

     Support by National Science Foundation
    1
Error: Unclassifiable statement at (1)
tune.f90:61:6:

   Stop
      1
Error: Blank required in STOP statement near (1)

commentと見なされなかったらしい。
エラーが出た行を!でコメントに

tune.f90
!   From "COMPUTATIONAL PHYSICS", 3rd Ed, Enlarged Python eTextBook  
!    by RH Landau, MJ Paez, and CC Bordeianu
!    Copyright Wiley-VCH Verlag GmbH & Co. KGaA, Berlin;  Copyright R Landau,
!    Oregon State Unv, MJ Paez, Univ Antioquia, C Bordeianu, Univ Bucharest, 2015.
!    Support by National Science Foundation
!			
! 	 tune.f90: matrix algebra program to be tuned for performance			

Program	 tune		

  parameter (ldim = 2050)		
	Implicit Double precision (a - h, o - z)		
	dimension ham(ldim, ldim), coef(ldim), sigma(ldim)		
                                       ! set up H and starting vector
	Do i = 1, ldim	 
	  Do j = 1, ldim		
		  If ( abs(j - i)  >  10) then		
			  ham(j, i) = 0.		
			else	 
			  ham(j, i) = 0.3**Abs(j - i)		
			EndIf		
	  End Do
		ham(i, i) = i		
		coef(i) = 0.	 
	End Do	 
	coef(1) = 1.		
                                                    ! start iterating
	err = 1.		
	iter = 0	 
 20		If (iter< 15 .and. err >1.e-6) then	 
	iter = iter + 1	
                                 ! compute current energy & normalize
	ener = 0.	 
	ovlp = 0.	 
	Do		i = 1, ldim	 
	  ovlp = ovlp + coef(i)*coef(i)	 
		sigma(i) = 0.		
		Do		 j = 1, ldim		
		  sigma(i) = sigma(i) + coef(j)*ham(j, i)	 
		End Do		
		ener = ener + coef(i)*sigma(i)
	End Do 
	ener = ener/ovlp	 
	Do		I = 1, ldim	 
    coef(i) = coef(i)/Sqrt(ovlp)		
		sigma(i) = sigma(i)/Sqrt(ovlp)		
	End Do	 
                                      ! compute update and error norm
	err = 0.		
	Do	i = 1, ldim	 
	  If (i == 1) goto 22	 
		step = (sigma(i) - ener*coef(i))/(ener - ham(i, i))		
		coef(i) = coef(i) + step		
		err = err + step**2	
 22 Continue
 23 End Do
   err = sqrt(err)	 
     write(*, '(1x, i2, 7f10.5)') iter, ener, err, coef(1)	 
	   goto 20		 
    Endif		
!  Stop	 
End Program tune

コンパイル&go

docker/ubuntu
# gfortran tune.f90
# ./a.out
  1   1.00000   0.30350   1.00000
  2   0.92179   0.05728   0.95690
  3   0.91720   0.01562   0.96664
  4   0.91691   0.00402   0.96348
  5   0.91688   0.00116   0.96414
  6   0.91688   0.00031   0.96391
  7   0.91688   0.00009   0.96397
  8   0.91688   0.00002   0.96395
  9   0.91688   0.00001   0.96395
 10   0.91688   0.00000   0.96395
 11   0.91688   0.00000   0.96395

Reference

無線網(Wi-Fi)空中線(antenna)(0) 記事一覧(118/300目標)
https://qiita.com/kaizen_nagoya/items/5e5464ac2b24bd4cd001

Ethernet 記事一覧 Ethernet(0)
https://qiita.com/kaizen_nagoya/items/88d35e99f74aefc98794

Wireshark 一覧 wireshark(0)、Ethernet(48) https://qiita.com/kaizen_nagoya/items/fbed841f61875c4731d0

仮説(0)一覧(目標100現在40)
https://qiita.com/kaizen_nagoya/items/f000506fe1837b3590df

安全(0)安全工学シンポジウムに向けて: 21
https://qiita.com/kaizen_nagoya/items/c5d78f3def8195cb2409

Qiita(0)Qiita関連記事一覧(自分)
https://qiita.com/kaizen_nagoya/items/58db5fbf036b28e9dfa6

鉄道(0)鉄道のシステム考察はてっちゃんがてつだってくれる
https://qiita.com/kaizen_nagoya/items/26bda595f341a27901a0

日本語(0)一欄
https://qiita.com/kaizen_nagoya/items/7498dcfa3a9ba7fd1e68

英語(0) 一覧
https://qiita.com/kaizen_nagoya/items/680e3f5cbf9430486c7d

転職(0)一覧
https://qiita.com/kaizen_nagoya/items/f77520d378d33451d6fe

数学関連記事100 
https://qiita.com/kaizen_nagoya/items/d8dadb49a6397e854c6d

物理記事 上位100
https://qiita.com/kaizen_nagoya/items/66e90fe31fbe3facc6ff

自動車 記事 100
https://qiita.com/kaizen_nagoya/items/f7f0b9ab36569ad409c5

言語・文学記事 100
https://qiita.com/kaizen_nagoya/items/42d58d5ef7fb53c407d6

医工連携関連記事 100
https://qiita.com/kaizen_nagoya/items/6ab51c12ba51bc260a82

通信記事100
https://qiita.com/kaizen_nagoya/items/1d67de5e1cd207b05ef7

OSEK OS設計の基礎 OSEK(100)
https://qiita.com/kaizen_nagoya/items/7528a22a14242d2d58a3

一覧:携帯計画者日記(0)
https://qiita.com/kaizen_nagoya/items/005d38c6f55c85570e74

AUTOSAR R22-11 Qiita記事一覧 20230421(1)
https://qiita.com/kaizen_nagoya/items/81a35774f1aa3d64d3f6

ボッシュ自動車handbook(英語)11版(0) 課題と記事一覧
https://qiita.com/kaizen_nagoya/items/dfa35aa6f669e5df983e

R3(0) on "What are the most important statistical ideas of the past 50 years? " Andrew Gelman, Aki Vehtari
https://qiita.com/kaizen_nagoya/items/a8eac9afbf16d2188901

官公庁・学校・公的団体(NPOを含む)システムの課題、官(0)
https://qiita.com/kaizen_nagoya/items/04ee6eaf7ec13d3af4c3

一覧の一覧( The directory of directories of mine.) Qiita(100)
https://qiita.com/kaizen_nagoya/items/7eb0e006543886138f39

プログラマが知っていると良い「公序良俗」
https://qiita.com/kaizen_nagoya/items/9fe7c0dfac2fbd77a945

LaTeX(0) 一覧 
https://qiita.com/kaizen_nagoya/items/e3f7dafacab58c499792

自動制御、制御工学一覧(0)
https://qiita.com/kaizen_nagoya/items/7767a4e19a6ae1479e6b

Rust(0) 一覧 
https://qiita.com/kaizen_nagoya/items/5e8bb080ba6ca0281927

小川清最終講義、最終講義(再)計画, Ethernet(100) 英語(100) 安全(100)
https://qiita.com/kaizen_nagoya/items/e2df642e3951e35e6a53

<この記事は個人の過去の経験に基づく個人の感想です。現在所属する組織、業務とは関係がありません。>
This article is an individual impression based on the individual's experience. It has nothing to do with the organization or business to which I currently belong.

文書履歴(document history)

ver. 0.01 初稿 20190807

最後までおよみいただきありがとうございました。

いいね 💚、フォローをお願いします。

Thank you very much for reading to the last sentence.

Please press the like icon 💚 and follow me for your happy life.

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?