Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Reengineer the code for the subroutine JCLARK() to F95+ standards, changing its name tocalcLOGjclark(). Add appropriate error messages, and remove all legacy features. Add a
-
Reengineer the code for the subroutine JCLARK() to F95+ standards, changing its name tocalcLOGjclark(). Add appropriate error messages, and remove all legacy features.
-
Add a function, calcLOGvolume(), which converts board feet to cubic metres.
--------------
-------------
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 logs 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 logs 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 *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
= LOGS SCALING DIAMETER (INCHES) = DIB AT LOGS 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 LOGS 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started