|
[Sponsors] |
April 9, 2018, 05:41 |
Debugging fortran loop
|
#1 |
New Member
ulfa
Join Date: Jan 2018
Posts: 6
Rep Power: 8 |
Dear everyone, I made a codes of Fortran for initial condition of CFD problem, for Velocity (U,V), Pressure (P), and Temperature (T) in one subroutine, but in that case, I want to display that values on the screen only for testing, but I got the problem, only the value of temperature that can appear on the screen. Meanwhile, when I save the data into a file, it is success. Anybody can help me??
this is my code: !###########################INITIAL CONDITION##################### PROGRAM CINITI implicit double precision (A-H) implicit double precision (O-Z) PARAMETER(NX0=20, NY0=20) COMMON/D1/NX,NY,NXU,NYV COMMON/D2/DX,DY,DT COMMON/D3/VIS,ALP,BUO COMMON/D4/RE,PR,GR,TIME,OMG,EPSP COMMON/D5/ICYCLE,ITR,IFLG COMMON/D6/DMAX COMMON/D7/ITYPE,ICOORD COMMON/ARRAY1/U0(0:NX0, 0:NY0+1),UN(0:NX0,0:NY0+1 ),& V0(0:NX0+1,0:NY0 ),VN(0:NX0+1,0:NY0 ),& P0(0:NX0+1,0:NY0+1),PN(0:NX0+1,0:NY0+1),& T0(0:NX0+1,0:NY0+1),TN(0:NX0+1,0:NY0+1) NX = NX0 NXU = NX0 NY = NY0 NYV = NY0 !#############START FOR TIME=0 (ICYCLE=0) !_____________SET U_______________ WRITE(*,*)'UX(I)=' DO 10 IXU=0,NXU DO 20 IY=0,NY+1 UN(IXU,IY) = 0.0D0 WRITE(*,*) UN(IXU,IY) 20 CONTINUE 10 CONTINUE !_____________SET V_______________ WRITE(*,*)'VY(I)=' DO 30 IYV=0,NYV DO 40 IX=0,NX+1 VN(IX,IYV) = 0.0D0 WRITE(*,*)VN(IX,IYV) 40 CONTINUE 30 CONTINUE !_____________SET P________________ WRITE(*,*)'P(Z)=' DO 50 IY=0,NY+1 DO 60 IX=0,NX+1 P0(IX,IY)=0.0D0 WRITE(*,*)P0(IX,IY) 60 CONTINUE 50 CONTINUE !_____________SET T________________ print*,'T(Z)=' DO 61 IY=0,NY+1 DO 62 IX=0,NX+1 TN(IX,IY)=0.0D0 WRITE(*,*)TN(IX,IY) 62 CONTINUE 61 CONTINUE !_________RIGHT SIDE______________ DO 70 IY=0,NY+1 TN(NX+1,IY)=2.0D0*(-0.5D0)-TN(NX,IY) 70 CONTINUE !_________LEFT SIDE_______________ DO 80 IY=0,NY+1 TN(0,IY)=2.0D0*(+0.5D0)-TN(NX,IY) 80 CONTINUE !___________UPPER_________________ DO 90 IX=1,NX TN(IX,NY+1)=TN(IX,NY) 90 CONTINUE !___________LOWER_________________ DO 95 IX=1,NX TN(IX,0)=TN(IX,1) 95 CONTINUE END CINITI Thank you very much. |
|
Tags |
fortran code, loop |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field | lakeat | OpenFOAM Community Contributions | 58 | December 23, 2021 03:36 |
[Other] refineWallLayer Error | Yuby | OpenFOAM Meshing & Mesh Conversion | 2 | November 11, 2021 12:04 |
[Gmsh] Problem with Gmsh | nishant_hull | OpenFOAM Meshing & Mesh Conversion | 23 | August 5, 2015 03:09 |
[CAD formats] my stl surface is seen as just a line | rcastilla | OpenFOAM Meshing & Mesh Conversion | 2 | January 6, 2010 02:30 |
NACA0012 geometry/design software needed | Franny | Main CFD Forum | 13 | July 7, 2007 16:57 |