SavanGowda
Mechanical
- Aug 13, 2015
- 8
Hi again!!
I have tried to code the fortran file and I don't know what is wrong with the file exactly. Below is my code
SUBROUTINE DISP(U,KSTEP,KINC,TIME,NODE,NOEL,JDOF,COORDS)
INCLUDE 'ABA_PARAM.INC'
INTEGER,PARAMETER::iwp=SELECTED_REAL_KIND(15)
REAL(iwp),INTENT(OUT)::U(1)
!DIMENSION U(3),TIME(2),COORDS(3)
REAL,DIMENSION(1:304,1:3)::A ! Matrix with dimension 304 x 3
REAL :: x, y, z
!COMPLEX,DIMENSION(1:304)::E
INTEGER :: i,j,k
OPEN(UNIT = 1, FILE = "Pressure_SAVAN_100Hz.txt",
1 FORM = "FORMATTED", STATUS = "OLD", ACTION = "READ") !text file which is a 304 x 3 Matrix
DO i=1,UBOUND(A,1)
READ(UNIT=7, FMT=*)x,y,z
DO k=1, UBOUND(A,1)
A(i,1) = x
A(i,2) = y !real part of the value
A(i,3) = z !complex part of the value
!E(i) = CMPLX(y,z)
ENDDO
ENDDO
DO j = 1, UBOUND(A,1)
IF (NODE.EQ.A(j,1)) THEN
IF(JDOF.EQ.1) THEN
U(j) = A(j,2)
ENDIF
ENDIF
ENDDO
END
My text file looks something like this:
1,0.020141,3.1217
2,0.096111,3.1203
3,0.23753,3.1128
4,0.45527,3.0884
5,0.75772,3.0285
6,1.1475,2.9033
7,1.6152,2.6715
The program is not going further with the iteration! I am stuck with this from past 2 weeks!. Any help is appreciated!!
Thanks in advance
Kind Regards
Savan
I have tried to code the fortran file and I don't know what is wrong with the file exactly. Below is my code
SUBROUTINE DISP(U,KSTEP,KINC,TIME,NODE,NOEL,JDOF,COORDS)
INCLUDE 'ABA_PARAM.INC'
INTEGER,PARAMETER::iwp=SELECTED_REAL_KIND(15)
REAL(iwp),INTENT(OUT)::U(1)
!DIMENSION U(3),TIME(2),COORDS(3)
REAL,DIMENSION(1:304,1:3)::A ! Matrix with dimension 304 x 3
REAL :: x, y, z
!COMPLEX,DIMENSION(1:304)::E
INTEGER :: i,j,k
OPEN(UNIT = 1, FILE = "Pressure_SAVAN_100Hz.txt",
1 FORM = "FORMATTED", STATUS = "OLD", ACTION = "READ") !text file which is a 304 x 3 Matrix
DO i=1,UBOUND(A,1)
READ(UNIT=7, FMT=*)x,y,z
DO k=1, UBOUND(A,1)
A(i,1) = x
A(i,2) = y !real part of the value
A(i,3) = z !complex part of the value
!E(i) = CMPLX(y,z)
ENDDO
ENDDO
DO j = 1, UBOUND(A,1)
IF (NODE.EQ.A(j,1)) THEN
IF(JDOF.EQ.1) THEN
U(j) = A(j,2)
ENDIF
ENDIF
ENDDO
END
My text file looks something like this:
1,0.020141,3.1217
2,0.096111,3.1203
3,0.23753,3.1128
4,0.45527,3.0884
5,0.75772,3.0285
6,1.1475,2.9033
7,1.6152,2.6715
The program is not going further with the iteration! I am stuck with this from past 2 weeks!. Any help is appreciated!!
Thanks in advance
Kind Regards
Savan