PROGRAM LennardJones
implicit none
! 変数の定義
INTEGER, PARAMETER :: Nplot = 101 ! プロット数
REAL(8), PARAMETER :: R_ini = 0.95d0 ! 粒子間距離の最小値
REAL(8), PARAMETER :: R_end = 2.0d0 ! 粒子間距離の最大値
REAL(8), PARAMETER :: Eps = 1.0d0 ! Potential parameter 1
REAL(8), PARAMETER :: Sigma = 1.0d0 ! Potential parameter 2
INTEGER i
REAL(8) dR, R, pot
! 距離の増分
dR = (R_end - R_ini) / real(Nplot-1,8)
! print header
write(*,'(a)') '#R, Potential'
! 粒子間距離をスキャンしながらLJポテンシャルを計算&出力
do i= 1, Nplot
! 距離の計算
R = R_ini + dR * real(i-1,8)
! ポテンシャルエネルギーの計算
pot = 4.d0 * Eps * ( (Sigma/R)**12 - (Sigma/R)**6 )
! 出力
write(*,'(e12.6, e14.6)') R, pot
enddo ! i
END PROGRAM LennardJones
UFJPR1JBTSBMZW5uYXJkSm9uZXMKaW1wbGljaXQgbm9uZQoKISDlpInmlbDjga7lrprnvqkKSU5URUdFUiwgUEFSQU1FVEVSIDo6IE5wbG90ICA9IDEwMSAgICAgISDjg5fjg63jg4Pjg4jmlbAKUkVBTCg4KSwgUEFSQU1FVEVSIDo6IFJfaW5pICA9IDAuOTVkMCAgISDnspLlrZDplpPot53pm6Ljga7mnIDlsI/lgKQKUkVBTCg4KSwgUEFSQU1FVEVSIDo6IFJfZW5kICA9IDIuMGQwICAgISDnspLlrZDplpPot53pm6Ljga7mnIDlpKflgKQKUkVBTCg4KSwgUEFSQU1FVEVSIDo6IEVwcyAgICA9IDEuMGQwICAgISBQb3RlbnRpYWwgcGFyYW1ldGVyIDEKUkVBTCg4KSwgUEFSQU1FVEVSIDo6IFNpZ21hICA9IDEuMGQwICAgISBQb3RlbnRpYWwgcGFyYW1ldGVyIDIKCklOVEVHRVIgaQpSRUFMKDgpIGRSLCBSLCBwb3QKCiEg6Led6Zui44Gu5aKX5YiGCmRSID0gKFJfZW5kIC0gUl9pbmkpIC8gcmV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