- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone
I am using Intel Visual Fortran parallel studio 2015 with integration of Visual Studio 2013. I have faced a absolutely weird scenario!!!! I have developed a subroutine. The code is:
======================================================================================
- Subroutine Read_2DMeshSU2(Dim,MeshDim,NC,Corn,NP,X,Y,NBC,BCName,NEC,BEP)
- Implicit None
- !*******************************************************************************************
- Intent(In ) :: Dim
- Intent(Out ) :: MeshDim,NC,Corn,NP,X,Y,NBC,BCName,NEC,BEP
- Integer :: Dim,IO,MeshDim,NC,i,j,NP,NBC,NBE,Dumy
- Character*100 :: Temp
- Character*100,Dimension(1:10) :: BCName
- Integer,Dimension(1:Dim,1:10) :: Corn
- Integer,Dimension(1:Dim,1:3) :: BEP
- Integer,Dimension(1:10) :: NEC
- Real(8),Dimension(1:Dim) :: X,Y
- !*******************************************************************************************
- !Part 1: Opening the SU2 Mesh File
- Open(1,File='Mesh.su2')
- !Part 2: Read dimension of the space
- Read(1,*) Temp
- Do While (Temp(1:5) /= 'NDIME')
- Read(1,'(A100)',IOSTAT = IO) Temp
- End Do
- Read(Temp(7:100),*) MeshDim
- !Part 3: Read Number of the elements
- Read(1,*) Temp
- Do While (Temp(1:5) /= 'NELEM')
- Read(1,'(A100)',IOSTAT = IO) Temp
- End Do
- Read(Temp(7:100),*) NC
- !Part 4: The node number connectivity
- Corn(1:NC,1:5) = 0
- Do i=1,NC
- Read(1,"(I2,I2)",ADVANCE='NO') Corn(i,1)
- !Check the 'VTK' format
- If (Corn(i,1) == 5) Then
- !This is a triangular element and it contains only three nodes
- Read(1,*) Corn(i,2), Corn(i,3), Corn(i,4)
- Else If (Corn(i,1) == 9) Then
- !This is a quadrilateral element and it contains only four nodes
- Read(1,*) Corn(i,2), Corn(i,3), Corn(i,4), Corn(i,5)
- Else If (Corn(i,1) == 3) Then
- !This is a line element and it contains only two nodes
- Read(1,*) Corn(i,2), Corn(i,3)
- End If
- !Adding 1 for fitting the format for the tecplot
- Corn(i,2:5) = Corn(i,2:5) + 1
- End Do
- !Part 5: Read the Points Coordinates
- Read(1,*) Temp
- Do While (Temp(1:5) /= 'NPOIN')
- Read(1,'(A100)',IOSTAT = IO) Temp
- End Do
- Read(Temp(7:100),*) NP
- Do i=1,NP
- Read(1,*) X(i) , Y(i)
- End Do
- !Part 6: Reading the Boundaries data
- Read(1,*) Temp
- Do While (Temp(1:5) /= 'NMARK')
- Read(1,'(A100)',IOSTAT = IO) Temp
- End Do
- Read(Temp(7:100),*) NBC
- NBE = 0
- Do i=1,NBC
- !Read the boundary name
- Read(1,'(A100)',IOSTAT = IO) Temp
- Read(Temp(13:100),*) BCName(i)
- !Read the number of parts of each boundary
- Read(1,'(A100)',IOSTAT = IO) Temp
- Read(Temp(15:100),*) NEC(i)
- Do j=(1+NBE),(NBE+NEC(i))
- Read(1,*) BEP(j,1), BEP(j,2), BEP(j,3)
- BEP(j,2:3) = BEP(j,2:3) + 1
- End Do
- NBE = NBE + NEC(i)
- End Do
- Close(1)
- End Subroutine Read_2DMeshSU2
===================================================================
In line 34 the Corn(i,1) has been assigned through a specific file. Then in line 77 while I was reading that file for assigning the "BEP" variable, by assigning the BEP(j,3), the Corn(i,1) will be changed and get the value of BEP(j,3).
Does anyone know where the problem is?
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A couple of possibilities:
- The dimensions you pass in for BEP and Corn are incorrect, causing overwrites
- You are passing the same variable for both arguments, which is not legal in Fortran (with some exceptions)
We would, at a minimum, need to see the call to the subroutine and the declarations of all its arguments.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A couple of possibilities:
- The dimensions you pass in for BEP and Corn are incorrect, causing overwrites
- You are passing the same variable for both arguments, which is not legal in Fortran (with some exceptions)
We would, at a minimum, need to see the call to the subroutine and the declarations of all its arguments.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks is a simple a word for your precious advice, Mr.Lionel
The first point was the solution. I defined BEP in the main differently. I changed it and it works.
Again, Thanks a lot
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page