1. Engineering
  2. Computer Science
  3. please help will leave a great review in fortran ...

Question: please help will leave a great review in fortran ...

Question details

Please Help!!!! Will leave a great review!!!!

IN Fortran -----

  1. Reengineer the code for the subroutine JCLARK() to F95+ standards, changing its name tocalcLOGjclark(). Add appropriate error messages, and remove all legacy features.

  2. Add a function, calcLOGvolume(), which converts board feet to cubic metres.

  3. Here are the list of required subprograms. You may add any other additional functions you require.

    getLOGdata()
    • A function which reads the relevant log data required by calcLOGjclark() and

    calcLOGvolume()from the user.

    calcLOGvolume()
    

    • A function which calculates the volume of a log in cubic metres, using the data obtained bygetLOGdata().

    calcLOGjclark()
    

    • A function which calculates the volume of a log in board feet, using the data obtained bygetLOGdata().

--------------

-------------

SUBROUTINE JCLARK()

      SUBROUTINE JCLARK (DS,DL,TL,KERF,V)
C *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
C THIS SUBROUTINE WAS WRITTEN BY J.E.BRICKELL OF THE U.S.FOREST SERVICE
C TO CALCULATE BOARD FOOT VOLUME OF SAWLOGS BY THE INTERNATIONAL RULE.
C VARIABLES IN THE CALLING SEQUENCE ARE:
C       DS //diameter inside bark (DIB) at the log’s small end (scaling diameter) (inches)
C       DL //DIB at the logs large end:0.0 if the default taper option (1/2”) is to be used (inches) DIB at the log’s larger end otherwise
C       TL //total log length (feet)
C       KERF >0 IF KERF ASSUMPTION IS 1/4 INCH
C       KERF <0, OR = 0, IF KERF ASSUMPTION IS 1/8 INCH
C       V    = LOG VOLUME RETURNED TO THE CALLING PROGRAM
C *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
= LOG’S SCALING DIAMETER (INCHES)
= DIB AT LOG’S LARGE END (INCHES) (0.0 IF 1/2 INCH TAPER)
= TOTAL LOG LENGTH (FEET)
      V=0.0
C IF TOTAL LOG LENGTH IS LESS THAN FOUR FEET NO BOARD FOOT VOLUME WILL BE
C COMPUTED.
      IF(TL-4.0)10,1,1
C IF THE LOG’S LARGE END DIAMETER IS FURNISHED TO JCLARK A TAPER RATE
C WILL BE COMPUTED. IF DL=0 THE STANDARD ASSUMPTION OF 1/2 INCH PER 4
C FEET OF LOG LENGTH WILL BE USED.
    1 IF(DL)3,3,2
    2 T=4.0*(DL-DS)/TL

GO TO 4 3 T=0.5

C THE FOLLOWING LOOP (THROUGH STATEMENT 5) FINDS OUT HOW MANY FULL 4
C FOOT SEGMENTS THE LOG CONTAINS.
    4 DO 5 I=1,20
      IF(TL-FLOAT(4*I))6,5,5
    5 CONTINUE
    6 L=I-1
      SL=FLOAT(4*L)
C THE FOLLOWING STATEMENT MOVES THE SCALING DIAMETER DOWN TO THE END OF
C THE 4 FOOT SEGMENTS AND INCREASES IT ACCORDING TO TAPER.
      D=DS+(T/4.0)*(TL-SL)
C THE FOLLOWING LOOP (THROUGH STATEMENT 7) FINDS OUT HOW MANY FULL FEET
C OF LENGTH ARE IN THE SEGMENT LESS THAN 4 FEET LONG.
      DO 7 I=1,4
      XI=FLOAT(I)
      IF(SL-TL+XI)7,7,8
    7 CONTINUE
C THE NEXT THREE STATEMENTS CALCULATE LOG VOLUME IN THE 1, 2, OR 3 FOOT
C SEGMENT AT THE SMALL END OF THE LOG.
    8 XL=XI-1.0
      DEX=DS+(T/4.0)*(TL-SL-XL)
      VADD=0.055*XL*DEX*DEX-0.1775*XL*DEX
C THE FOLLOWING LOOP (THROUGH 9) CALCULATES VOLUME IN THE PORTION OF
C THE LOG CONTAINING WHOLE 4 FOOT SEGMENTS.

DO 9 I=1,L

      DC=D+T*FLOAT(I-1)
    9 V=V+0.22*DC*DC-0.71*DC
      V=V+VADD
C IF ‘KERF’ IS GREATER THAN ZERO, INTERNATIONAL 1/8 INCH VOLUME AS
C COMPUTED ABOVE WILL BE CONVERTED TO INTERNATIONAL 1/4 INCH VOLUME.
      IF (KERF)10,10,11
   10 RETURN
   11 V=0.905*V
      RETURN

END

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution