Posts

Showing posts with the label fortran90

How to use Real Array Index in Matrix dimension?

How to use Real Array Index in Matrix dimension? I am developing a Fortran code (.f90) which shall calculate some matrix in some time interval ( dt1=0.001 ) and these matrices have to be integrated in some time steps ( dt=0.1 ). Though I am experienced in FORTRAN 77, new to Fortran 90. I am unable to make dimension of matrix real (I think that is the problem, I may be wrong!). Below is the part of a long program. I am trying (from last 1 month) different methods but no success, output are NaN . I am using gfortran in Ubuntu 16.04 dt1=0.001 dt=0.1 NaN PROGRAM MODEL IMPLICIT NONE REAL::DT,DT1,DK2 INTEGER::I,J,IL,IM,E(100000),jm,DK1 REAL::XN2(1),XO2(1) REAL,DIMENSION(100000)::AN,BN,AN1,BN1 REAL,DIMENSION(21)::XA,XB REAL,DIMENSION(21,21)::WA,WB,WAB,WBA REAL,DIMENSION(21)::SUMA,SUMAB,SUMB,SUMBA XN2=1E-7 XO2=1E-8 OPEN(1,FILE='TEST1.dat') OPEN(2,FILE='TEST2.dat') OPEN(3,FILE='TEST3.dat') OPEN(4,FILE='TEST4.dat') DO I=1,21 read(1,*)(WA(I,J),J=1,21) read(2,*)(WB...