!c Description: !c 線形計算ライブラリのラッパー !c !c Current Code Owner: !c sugiyama@gfd-dennou.org !c !c Copyright (C) SUGIYAMA Ko-ichiro, 2004, All rights reserved module linlib implicit none private public linlib_init !初期化 public linsolv !実 3 項行列の連立 1 次方程式(倍精度) character(1) :: LLib !用いるライブラリのフラグ save LLib contains subroutine linlib_init(N) use fileset, only: cfgfile use ssl2_linear, only: ssl2_ltx_init integer, intent(in) :: N !配列サイズ !--- NAMELIST の定義 NAMELIST /linlib/ LLib !--- 変数の取り出し open (10, FILE=cfgfile) read(10, NML=linlib) close(10) !--- 用いるライブラリの初期化 if (LLib == 's') then call ssl2_ltx_init(N) elseif (LLib == 'l') then write(*,*) "linlib.f90: sorry, LAPACK is not supported. " else write(*,*) "linlib.f90: unknown LLib ", LLib stop end if end subroutine linlib_init subroutine LinSolv(A, B, C, D) use ssl2_linear, only: ssl2_ltx real(8), intent(in) :: A(:) real(8), intent(in) :: B(:) real(8), intent(in) :: C(:) real(8), intent(inout) :: D(:) !--- 用いるライブラリの初期化 if (LLib == 's') then call ssl2_ltx(A, B, C, D) elseif (LLib == 'l') then write(*,*) "linlib.f90: sorry, LAPACK is not supported. " else write(*,*) "linlib.f90: unknown LLib ", LLib stop end if end subroutine LinSolv end module linlib