CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Wiki > Out array 1.f90

Out array 1.f90

From CFD-Wiki

(Difference between revisions)
Jump to: navigation, search
 
(One intermediate revision not shown)
Line 1: Line 1:
-
Subroutine Output_all
+
<pre>
-
include 'icomm_1.f90'
+
!Sample program for solving Smith-Hutton Test using different schemes
 +
!of covective terms approximation -  Array output modul
 +
!Copyright (C) 2005  Michail Kirichkov
-
Dimension  X_inlet(nx),  &
+
!This program is free software; you can redistribute it and/or
 +
!modify it under the terms of the GNU General Public License
 +
!as published by the Free Software Foundation; either version 2
 +
!of the License, or (at your option) any later version.
-
T_inlet(nx),   &
+
!This program is distributed in the hope that it will be useful,
 +
!but WITHOUT ANY WARRANTY; without even the implied warranty of
 +
!MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +
!GNU General Public License for more details.
-
  X_outlet(nx)&
+
!You should have received a copy of the GNU General Public License
 +
!along with this program; if not, write to the Free Software
 +
!Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
T_outlet(nx)  
+
!***************************************************************************
 +
Subroutine Out_array(F_out,NImax,NJmax,Filename)
 +
Dimension F_out(500,500)
-
!--------------------------------------------------------------------------
+
Character  Filename*10
-
!--------------------------------------------------------------------------
+
Open(10,file=Filename)
-
!--------------------------------------------------------------------------
+
Do 12 J=1,NJmax
-
open (22,file='GRID_p.dat')  
+
! write(10,11)(F_out(i,j),i=1,NImax)
-
+
!      ^  now is "off"
-
WRITE(22,*)'VARIABLES = "X", "Y" '
+
 +
11 format(15F6.3)
-
      WRITE (22,*)' ZONE I=' ,NXmax, ', J=', NYmax, ', F=POINT'
+
12 continue
-
 
+
-
DO 1 J=1, NYmax
+
-
 
+
-
DO 1 I=1, NXmax
+
-
 
+
-
WRITE (22,*) X(I,J), Y(I,J) 
+
-
 
+
-
  1    continue
+
-
 
+
-
 
+
-
close(22)
+
-
 
+
-
!--------------------------------------------------------------------------
+
-
 
+
-
open (23,file='GRID_pp.dat')
+
-
WRITE(23,*)'VARIABLES = "Xp", "Yp"  '
+
close(10)
-
 
+
-
      WRITE (23,*)' ZONE I=' ,NXmaxP, ', J=', NYmaxP, ', F=POINT'
+
-
 
+
-
DO 2 J=1, NYmaxP
+
-
 
+
-
DO 2 I=1, NXmaxP
+
-
 
+
-
WRITE (23,*) Xp(I,J), Yp(I,J) 
+
-
 
+
-
  2    continue
+
-
 
+
-
close(23)
+
-
 
+
-
!--------------------------------------------------------------------------
+
-
 
+
-
open (23,file='Domain_all.dat')
+
-
+
-
WRITE(23,*)'VARIABLES = "Xp", "Yp" , "Up" , "Vp" , "Tp" '
+
-
 
+
-
      WRITE (23,*)' ZONE I=' ,NXmaxP, ', J=', NYmaxP, ', F=POINT'
+
-
 
+
-
DO 4 J=1, NYmaxP
+
-
 
+
-
DO 4 I=1, NXmaxP
+
-
 
+
-
WRITE (23,*) Xp(I,J), Yp(I,J) , F(i,j,1) , F(i,j,2) , F(i,j,5) 
+
-
 
+
-
  4    continue
+
-
 
+
-
close(23)
+
-
 
+
-
!--------------------------------------------------------------------------
+
-
 
+
-
!--------------------------------------------------------------------------
+
-
 
+
-
!--------------------------------------------------------------------------
+
-
 
+
-
!--------------------------------------------------------------------------
+
-
 
+
-
+
-
DO 6 I=1, NXmaxP
+
-
+
-
if (Xp(i,1)<0.) then
+
-
+
-
T_inlet(I) =  F(i,1,5)
+
-
 
+
-
    X_inlet(I) =  Xp(i,1)
+
-
 
+
-
Ibeg_inlet = 1
+
-
 
+
-
Iend_inlet = I
+
-
+
-
end if
+
-
 
+
-
if (Xp(i,1)>0.) then
+
-
+
-
I_outlet = I - Iend_inlet
+
-
 
+
-
  T_outlet(I_outlet) =  F(i,1,5)
+
-
 
+
-
    X_outlet(I_outlet)  =  Xp(i,1)
+
-
 
+
-
Ibeg_outlet = Iend_inlet + 1
+
-
 
+
-
Iend_outlet = I_outlet
+
-
+
-
end if
+
-
 
+
-
  6    continue
+
-
 
+
-
!--------------------------------------------------------------------------
+
-
 
+
-
open (23,file='Profiles.dat')
+
-
 
+
-
  WRITE(23,*)'VARIABLES = "Xp", "Tp"  '
+
-
 
+
-
WRITE (23,*) 'ZONE I=', Iend_inlet, ', F=POINT'
+
-
 
+
-
DO 12 I=Iend_inlet,1,-1
+
-
 
+
-
12 WRITE (23,*)  -1.* X_inlet(I),T_inlet(I)
+
-
 
+
-
WRITE (23,*) 'ZONE I=', Iend_outlet, ', F=POINT'
+
-
+
-
  DO 11 I=1,Iend_outlet
+
-
 
+
-
11 WRITE (23,*) X_outlet(I),T_outlet(I)
+
-
 
+
-
close(23)  
+
-
 
+
-
!--------------------------------------------------------------------------
+
Return
Return
-
 
+
End</pre>
-
End
+

Latest revision as of 15:39, 21 September 2005


!Sample program for solving Smith-Hutton Test using different schemes 
!of covective terms approximation -  Array output modul
!Copyright (C) 2005  Michail Kirichkov

!This program is free software; you can redistribute it and/or
!modify it under the terms of the GNU General Public License
!as published by the Free Software Foundation; either version 2
!of the License, or (at your option) any later version.

!This program is distributed in the hope that it will be useful,
!but WITHOUT ANY WARRANTY; without even the implied warranty of
!MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
!GNU General Public License for more details.

!You should have received a copy of the GNU General Public License
!along with this program; if not, write to the Free Software
!Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

!***************************************************************************
Subroutine Out_array(F_out,NImax,NJmax,Filename)

Dimension F_out(500,500)

Character  Filename*10

	Open(10,file=Filename)

		Do 12 J=1,NJmax

	!		write(10,11)(F_out(i,j),i=1,NImax) 
!       ^  now is "off"

		11 format(15F6.3)

		12 continue
	
	close(10)

Return
End
My wiki