Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

If (pmax-p(i))16,16,17

  1. Dec 19, 2011 #1
    Hi Community!

    I'm wondering what this Fortran statement does, per your opinion:

    IF(PMAX-P(I))16,16,17
    16 PMAX=P(I)
    ICAMAX=I
    17 CONTINUE

    This was done in Fortran 77. I'm trying to convert it to VB, and I Google-d it, researched it, but it's hard to understand. The IF statement looks for PMAX-P(I) to be TRUE, which makes no sense cause the variable type for PMAX & P(I) are both REAL, therefore their difference will be REAL too, and not LOGICAL. Then there is this 16,16,17… I guess it’s checking if PMAX-P(I) is zero, if it not zero, then it’ll execute label 16, which will force their difference to be zero.
    Does anybody know what 16,16,17 suppose to do? Maybe there is an hidden option for IF statement like this: IF(blablabla)>0,<0,0

    Thank you

    A.
     
  2. jcsd
  3. Dec 19, 2011 #2

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    Re: If(pmax-p(i))16,16,17

    This would be hard to find with google unless you knew it is called an arithmetic if statment. http://www-linac.kek.jp/cont/langinfo/web/Fortran/docs/lrm/lrm0128.htm

    This was the only type of IF statement in early versions of Fortran, but after the IF/THEN/ ELSE statement was added, it is hardly ever used.

    Your example means the same as

    IF (PMAX .LE. P(I)) THEN
    PMAX=P(I)
    ICAMAX=I
    ENDIF
     
  4. Dec 19, 2011 #3
    Re: If(pmax-p(i))16,16,17

    Alephzero

    Thanks a lot. This makes completely perfect sense.

    A.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: If (pmax-p(i))16,16,17
  1. 32 and 16 bit (Replies: 9)

  2. P = NP problem (Replies: 3)

  3. P=NP Explanation (Replies: 1)

  4. P does equal NP? (Replies: 5)

Loading...