Please help me understand my code



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.














.



Relevant Pages

  • Re: Please help me understand my code
    ... I know a little about Fortran. ... FRZPREV = FRZD ... 2)frzd only show up once and only once in the whole subroutine. ... it is not a subroutine parameter. ...
    (comp.lang.fortran)
  • Re: Please help me understand my code
    ... Wade Ward wrote: ... FRZPREV = FRZD ... 2)frzd only show up once and only once in the whole subroutine. ... I'd recommend renaming variables to reflect a kinder, gentler fortran. ...
    (comp.lang.fortran)
  • Re: Please help me understand my code
    ... I know a little about Fortran. ... FRZPREV = FRZD ... 2)frzd only show up once and only once in the whole subroutine. ... it is not a subroutine parameter. ...
    (comp.lang.fortran)
  • Re: Please help me understand my code
    ... Wade Ward wrote: ... FRZPREV = FRZD ... 2)frzd only show up once and only once in the whole subroutine. ... I'd recommend renaming variables to reflect a kinder, gentler fortran. ...
    (comp.lang.fortran)
  • Re: VBA/FORTRAN/COMMON BLOCKS
    ... > I have a FORTRAN subroutine in which I have a few COMMON BLOCKS. ... Now I am trying to access a member in the COMMON BLOCK. ... > 2000 VBA to access the routine. ... Declare Sub iget Lib "test.dll" ...
    (comp.lang.fortran)