Please help me understand my code
- From: www <www@xxxxxxxxxx>
- Date: Thu, 28 Jun 2007 16:56:54 -0400
Hi,
I know a little about Fortran. I am reading a program. I have several questions.
SUBROUTINE XYZ
...
DO II = FGPM(7), 1, -1
IF (TSOIL(II) .LE. 0.) GOTO 6543
ENDDO
FRZD = 0.
IF (fgco(1) .LT. 0.) frzd = tsoil(8)
GOTO 6542
6543 IF (II .EQ. 1) THEN
DZ1 = - 0.5*FGPM(8)
ELSE
DZ1 = 0.5*(FGPM(7+II-1)-FGPM(7+II))
ENDIF
IF (TSOIL(II) .EQ. 0.) THEN
FRZD = - (DZ1+FGPM(7+II))*100.
ELSE
DZ2 = FGPM(7+II) - FGPM(7+II+1)
IF (II .NE. FGPM(7)) DZ2 = 0.5*DZ2
FRZD = (-TSOIL(II)*(DZ1+DZ2)/(TSOIL(II+1)-TSOIL(II))-
& (DZ1+FGPM(7+II)))*100.
ENDIF
6542 CONTINUE
IF (II .LT. IIPREV .AND. FGCO(1) .LE. FRSTPREV) FRZD =
& FRZPREV
IIPREV = II
FRSTPREV = FGCO(1)
FRZPREV = FRZD
...
END
My questions are:
1)What the "CONTINUE" at 6542 is doing? I have basic knowledge about looping and the keyword "CONTINUE". But here I cannot figure out what it is doing.
2)frzd only show up once and only once in the whole subroutine. It is not in common block, it is not a subroutine parameter. Suppose, frzd gets the value of tsoil(8) here, what is this for? since no where else frzd is mentioned or used.
3)Same question with tsoil array. It is not in common block. It is not a parameter. It is used once and only once here in the whole subroutine. I am wondering where tsoil(8) gets its value.
Thank you very much.
.
- Follow-Ups:
- Re: Please help me understand my code
- From: www
- Re: Please help me understand my code
- From: Wade Ward
- Re: Please help me understand my code
- From: Richard Maine
- Re: Please help me understand my code
- From: Steven G. Kargl
- Re: Please help me understand my code
- Prev by Date: Re: SAVE - Continued.....
- Next by Date: Re: Please help me understand my code
- Previous by thread: Help with LF90 error
- Next by thread: Re: Please help me understand my code
- Index(es):
Relevant Pages
|