Last active
November 19, 2018 03:05
-
-
Save komasaru/c604eccd4073dbb83765a5387e0082b6 to your computer and use it in GitHub Desktop.
Fortran 95 source code to compute the rosseland-maen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program rosseland_mean | |
implicit none | |
real(8) :: a(3) = (/1.0_8, 2.0_8, 3.0_8/) | |
write (*,*) rmean(a) | |
stop | |
contains | |
! Rosseland-mean 計算 | |
! | |
! :param integer x(:) | |
! :return read(8) | |
real(8) function rmean(x) | |
implicit none | |
real(8), intent(IN) :: x(:) ! 形状仮定配列 | |
rmean = size(x) / sum(1.0_8 / x) | |
end function rmean | |
end program rosseland_mean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment