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?

More than 3 years have passed since last update.

RADEXの環境構築で詰まったメモ

Posted at

#環境

・MacBook Pro 2017
・Mojave 10.14.5

#RADEXの環境構築

下記のページ通りに環境を構築する手順を踏む.

ソースコードをダウンロードし,解凍.

$ tar xf radex_public.tar

作成されたRadexディレクトリ内のsrcに移動.

$ cd Radex/src

Makefileを編集し,makeする際のコンパイラを指定.最初は編集せずにデフォルトのgfortranを使用する.

Radex.incを編集し,分子データの置き場所と光子の脱出確率の計算方法を指定.

parameter(radat   = '/.../Radex/data/')
parameter (method = 1)  ! uniform sphere

srcディレクトリで

$ make

を叩く.

すると長々とエラーーーーーー.

$ make
gfortran -O2   -c main.f -o main.o
gfortran -O2   -c io.f -o io.o
io.f:47:62:

   47 |      $     molfile = radat(1:length(radat))//molfile(1:length(molfile))
      |                                                              1
Warning: Character length of actual argument shorter than of dummy argument 'st' (120/200) at (1) [-Wargument-mismatch]
io.f:47:36:

   47 |      $     molfile = radat(1:length(radat))//molfile(1:length(molfile))
      |                                    1
Warning: Character length of actual argument shorter than of dummy argument 'st' (120/200) at (1) [-Wargument-mismatch]
io.f:47:36:

   47 |      $     molfile = radat(1:length(radat))//molfile(1:length(molfile))
      |                                    1
Warning: Character length of actual argument shorter than of dummy argument 'st' (120/200) at (1) [-Wargument-mismatch]
io.f:48:36:

   48 |       write(13,20) molfile(1:length(molfile))
      |                                    1
Warning: Character length of actual argument shorter than of dummy argument 'st' (120/200) at (1) [-Wargument-mismatch]
io.f:52:36:

   52 |       write(13,20) outfile(1:length(outfile))
      |                                    1
Warning: Character length of actual argument shorter than of dummy argument 'st' (120/200) at (1) [-Wargument-mismatch]
io.f:234:31:

  234 |      $      //version(1:length(version))
      |                               1
Warning: Character length of actual argument shorter than of dummy argument 'st' (20/200) at (1) [-Wargument-mismatch]
io.f:234:31:

  234 |      $      //version(1:length(version))
      |                               1
Warning: Character length of actual argument shorter than of dummy argument 'st' (20/200) at (1) [-Wargument-mismatch]
io.f:234:31:

  234 |      $      //version(1:length(version))
      |                               1
Warning: Character length of actual argument shorter than of dummy argument 'st' (20/200) at (1) [-Wargument-mismatch]
gfortran -O2   -c readdata.f -o readdata.o
gfortran -O2   -c matrix.f -o matrix.o
gfortran -O2   -c background.f -o background.o
background.f:405:72:

  405 |       if (h.eq.0.d0) pause 'Warning: bad xin input in splintrp '
      |                                                                        
Warning: Deleted feature: PAUSE statement at (1)
gfortran -O2   -c slatec.f -o slatec.o
slatec.f:824:72:

  824 |       IF (INCX .EQ. INCY) IF (INCX-1) 5,20,60
      |                                                                        
Warning: Fortran 2018 deleted feature: Arithmetic IF statement at (1)
slatec.f:1204:72:

 1204 |       IF (INCX .EQ. INCY) IF (INCX-1) 5,20,60
      |                                                                        
Warning: Fortran 2018 deleted feature: Arithmetic IF statement at (1)
slatec.f:1512:72:

 1512 |       IF (INCX .EQ. INCY) IF (INCX-1) 5,20,60
      |                                                                        
Warning: Fortran 2018 deleted feature: Arithmetic IF statement at (1)
gfortran -O2    main.o io.o readdata.o matrix.o background.o slatec.o -o radex
strip radex
install -m 755 -p -s radex ../bin/
rm *.o
rm radex

引数の文字数が合ってないらしいので,編集.

io.f内のFUNCTION length(str)を編集.radex.inc内のcharacterに一致させた.

CHARACTER*200 str → CHARACTER*120 str

すると,length(radat)に関するエラーは消えた.length(version)のエラーも消しにかかる.

radex.inc内のversioncharacterを変更.radatに揃える.

character*20 version → character*120 version

length(version)のエラーも消えた.

しかし,

gfortran -O2   -c background.f -o background.o
background.f:405:72:

  405 |       if (h.eq.0.d0) pause 'Warning: bad xin input in splintrp '
      |                                                                        
Warning: Deleted feature: PAUSE statement at (1)
gfortran -O2   -c slatec.f -o slatec.o
slatec.f:824:72:

  824 |       IF (INCX .EQ. INCY) IF (INCX-1) 5,20,60
      |                                                                        
Warning: Fortran 2018 deleted feature: Arithmetic IF statement at (1)

この2種類のエラーが消えない.

Homebrewで古いgccをダウンロードしてみる.現時点でもっとも新しいのは9.1.0なので一個前をインストール.

$ brew install gcc@8

その後,Makefileのコンパイラを

FC = gfortran-8

に変更.
するとFortran 2018 deleted featureのエラーは消え,PAUSE statementのみに.

直接background.fを編集.

if (h.eq.0.d0) pause 'Warning: bad xin input in splintrp '
→
if (h.eq.0.d0) then
      write(*,*) 'Warning: bad xin input in splintrp '
      read(*,*)
      endif

エラーなくなった!

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?