Skip to content

Instantly share code, notes, and snippets.

@komasaru
Last active November 19, 2018 03:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save komasaru/c604eccd4073dbb83765a5387e0082b6 to your computer and use it in GitHub Desktop.
Save komasaru/c604eccd4073dbb83765a5387e0082b6 to your computer and use it in GitHub Desktop.
Fortran 95 source code to compute the rosseland-maen.
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