ellipm
Programmer
- Apr 19, 2012
- 7
Hi,
I'm working on a code for some months now and i have this problem: I can't forward the solution more than 2 steps than the initial steps. I think that the problem is that I set NYI+2 out of the boundaries,but I'm not sure. And as I increase the number of iterations for i, it seems that j reduces from nyi+2 to nyi-1.
This is a part of my code:
! initial conditions
X(1)=0.0
Z(1)=0.0
DX(1)=0.0
DZ(1)=0.0
THETA(1)=THETAO
DELTA(1)=RAD ! mixing layer thickness
DMIX(1)=0.0
YCORE(1)=RAD
!into the boundaries
DO J=1,NYI+1
U(1,J)=1.0
V(1,J)=0.0
DR(1,J)=20.0
EV(1,J)=1.0e-03
CV(1,J)=1.0e-03/0.7
AL1=2.0*EV(1,J)
AL2=2.0*EV(1,J)
ENDDO
!out of the boundaries
DO J=NYI+2,NJ
U(1,J)=UA
V(1,J)=0.0
DR(1,J)=0.0
EV(1,J)=1.0E-06
CV(1,J)=1.0E-06/0.7
AL1=2.0*KV
AL2=2.0*KV
ENDDO
!BOUNDARY CONDITION
DO I=1,NI
V(I,1)=0.0
ENDDO
DO 20 I=1,NI
DO 10 J=2,NJ
U(I+1,J)=U(I,J)-DS*V(I,J)*(U(I,J+1)-U(I,J))/(DY*U(I,J))+DS*((Y(J)+Y(J+1))/(4.0*U(I,J)*Y(J)*DY**2.0)*SMUP(I,J)*(U(I,J+1)-U(I,J))-(Y(J)+Y(J-1))/(4.0*U(I,J)*Y(J)*DY**2.0)*SMUM(I,J)*(U(I,J)-U(I,J-1)))+DS*G/U(I,J)*DR(I,J)/DENSO*SIN(THETA(I))
UMEAN(I+1)=(U(I+1,1)+UA)/2.0
IF(U(I+1,J).LE.UMEAN(I+1)) then
GOTO 32
else
goto 10
end if
32 YUHALF(I+1)=(J-2)*DY+((Y(J)-Y(J-1))/(U(I+1,J)-U(I+1,J-1)))*(UMEAN(I+1)-U(I+1,J-1))
!outer boundary condition
UTEST(I+1,J)=(U(I+1,1)-U(I+1,J))/(U(I+1,1)-UA)
IF(UTEST(I+1,J).GE.0.99) THEN
GOTO 27
ELSE
GOTO 10
END IF
10 CONTINUE
27 DELTA(I+1)=(j-1)*DY
DMIX(I+1)=DELTA(I+1)-YCORE(I+1)
write(*,*) 'delta(i+1)=',delta(i+1)
write(*,*) 'dmix(i+1)=',dmix(i+1)
NY=J
write(*,*) 'ny=',ny
DO J=NY+1,NJ
EV(I+1,J)=1.0e-06
U(I+1,J)=UA
ENDDO
If anyone can guess my mistake, because I have no more inspiration to find it, I'd really appreciate it!
I'm working on a code for some months now and i have this problem: I can't forward the solution more than 2 steps than the initial steps. I think that the problem is that I set NYI+2 out of the boundaries,but I'm not sure. And as I increase the number of iterations for i, it seems that j reduces from nyi+2 to nyi-1.
This is a part of my code:
! initial conditions
X(1)=0.0
Z(1)=0.0
DX(1)=0.0
DZ(1)=0.0
THETA(1)=THETAO
DELTA(1)=RAD ! mixing layer thickness
DMIX(1)=0.0
YCORE(1)=RAD
!into the boundaries
DO J=1,NYI+1
U(1,J)=1.0
V(1,J)=0.0
DR(1,J)=20.0
EV(1,J)=1.0e-03
CV(1,J)=1.0e-03/0.7
AL1=2.0*EV(1,J)
AL2=2.0*EV(1,J)
ENDDO
!out of the boundaries
DO J=NYI+2,NJ
U(1,J)=UA
V(1,J)=0.0
DR(1,J)=0.0
EV(1,J)=1.0E-06
CV(1,J)=1.0E-06/0.7
AL1=2.0*KV
AL2=2.0*KV
ENDDO
!BOUNDARY CONDITION
DO I=1,NI
V(I,1)=0.0
ENDDO
DO 20 I=1,NI
DO 10 J=2,NJ
U(I+1,J)=U(I,J)-DS*V(I,J)*(U(I,J+1)-U(I,J))/(DY*U(I,J))+DS*((Y(J)+Y(J+1))/(4.0*U(I,J)*Y(J)*DY**2.0)*SMUP(I,J)*(U(I,J+1)-U(I,J))-(Y(J)+Y(J-1))/(4.0*U(I,J)*Y(J)*DY**2.0)*SMUM(I,J)*(U(I,J)-U(I,J-1)))+DS*G/U(I,J)*DR(I,J)/DENSO*SIN(THETA(I))
UMEAN(I+1)=(U(I+1,1)+UA)/2.0
IF(U(I+1,J).LE.UMEAN(I+1)) then
GOTO 32
else
goto 10
end if
32 YUHALF(I+1)=(J-2)*DY+((Y(J)-Y(J-1))/(U(I+1,J)-U(I+1,J-1)))*(UMEAN(I+1)-U(I+1,J-1))
!outer boundary condition
UTEST(I+1,J)=(U(I+1,1)-U(I+1,J))/(U(I+1,1)-UA)
IF(UTEST(I+1,J).GE.0.99) THEN
GOTO 27
ELSE
GOTO 10
END IF
10 CONTINUE
27 DELTA(I+1)=(j-1)*DY
DMIX(I+1)=DELTA(I+1)-YCORE(I+1)
write(*,*) 'delta(i+1)=',delta(i+1)
write(*,*) 'dmix(i+1)=',dmix(i+1)
NY=J
write(*,*) 'ny=',ny
DO J=NY+1,NJ
EV(I+1,J)=1.0e-06
U(I+1,J)=UA
ENDDO
If anyone can guess my mistake, because I have no more inspiration to find it, I'd really appreciate it!