Skip to content

Commit 0fb3a05

Browse files
vollib release 20250512
Fixed nsvb.f to calculate merch height for FIA (CTYPE='I') to be minimum 5, applied denProp based on DECAYCD to woodland species biomass, and added species check for 63 and 65 in woodland_bio.
1 parent ca32449 commit 0fb3a05

13 files changed

+446
-342
lines changed
Binary file not shown.
Binary file not shown.

.vs/volumelibrary/v17/DocumentLayout.backup.json

Lines changed: 131 additions & 132 deletions
Large diffs are not rendered by default.

.vs/volumelibrary/v17/DocumentLayout.json

Lines changed: 129 additions & 129 deletions
Large diffs are not rendered by default.

deployment/deployment.vdproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
{
135135
"Name" = "8:.NET Framework"
136136
"Message" = "8:[VSDNETMSG]"
137-
"FrameworkVersion" = "8:3.5.30729 "
137+
"FrameworkVersion" = "8:.NETFramework,Version=v3.5"
138138
"AllowLaterVersions" = "11:FALSE"
139139
"InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=76617"
140140
}
@@ -262,7 +262,7 @@
262262
"Name" = "8:Microsoft Visual Studio"
263263
"ProductName" = "8:NVEL Tester"
264264
"ProductCode" = "8:{359448E4-CB0E-493E-B782-BE292E7AC0AD}"
265-
"PackageCode" = "8:{B4F18088-B769-4AA7-9114-B28A08DECF35}"
265+
"PackageCode" = "8:{0DFCC2A7-7549-4B7B-9D71-FAD97B99F73C}"
266266
"UpgradeCode" = "8:{84FB9C77-82C4-444C-BE89-C8A6280AA94B}"
267267
"AspNetVersion" = "8:2.0.50727.0"
268268
"RestartWWWService" = "11:FALSE"

dvest.f

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,12 @@ SUBROUTINE DVEST(VOLEQ,DBHOB,DRC,HTTOT,MTOPP,FCLASS,HTLOG,HT1PRD,
137137
ENDIF
138138

139139
C ROUND ALL VOLUMES 10TH CUBIC AND CORD, NEAREST BDFT
140-
VOL(1) = ANINT(VOL(1)*10.0)/10.0
140+
!Changed to not rounding VOL(1) and VOL(4). They will be used for biomass calculation (2025/05/07)
141+
!VOL(1) = ANINT(VOL(1)*10.0)/10.0
141142
VOL(2) = ANINT(VOL(2))
142-
VOL(4) = ANINT(VOL(4)*10.0)/10.0
143+
!VOL(4) = ANINT(VOL(4)*10.0)/10.0
143144
VOL(6) = ANINT(VOL(6)*1000.0)/1000.0
144-
VOL(7) = ANINT(VOL(7)*10.0)/10.0
145+
!VOL(7) = ANINT(VOL(7)*10.0)/10.0
145146
VOL(9) = ANINT(VOL(9)*1000.0)/1000.0
146147
VOL(10) = ANINT(VOL(10))
147148

fia_rm.f

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ SUBROUTINE WOODLAND_BIO(SPCD, DRC,THT,STEMS,CV15,DRYBIO,ERRFLG)
215215
!First check if the SPCD is in the woodland species list
216216
!This is to match FIA BIOMASS_SP configuration
217217
!IF(SPN.EQ.62.OR.SPN.EQ.66)THEN
218-
IF(SPN.GE.57.AND.SPN.LE.66)THEN
218+
!Added check for species 63 and 65 (2025/05/08)
219+
IF((SPN.GE.57.AND.SPN.LE.66).AND.(SPN.NE.63.AND.SPN.NE.65))THEN
219220
SPN = 57
220221
ELSEIF(SPN.GE.133.AND.SPN.LE.143)THEN
221222
SPN = 106
@@ -256,6 +257,8 @@ SUBROUTINE WOODLAND_BIO(SPCD, DRC,THT,STEMS,CV15,DRYBIO,ERRFLG)
256257
!DRYBIO(4) = 3.14*(DRC/2/12)**2*SPSG*62.4
257258
! Get the BIO to 3" top
258259
CALL CHO_WDBK_1530(SPN,DRC,THT,CV15,STEMS,SPSG,BIO3)
260+
!Changed SPN to SPCD (2025/05/08)
261+
!CALL CHO_WDBK_1530(SPCD,DRC,THT,CV15,STEMS,SPSG,BIO3)
259262
DRYBIO(6) = BIO3
260263
! Get the tip from 3" to 1.5"
261264
!DRYBIO(10) = DRYBIO(2) - BIO3

fia_vol_r234.for

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
D2H = DRCOB*DRCOB*HTTOT
3131
X = D2H/1000.0
3232
READ(VOLEQ(8:10),'(I3)')SPN
33-
IF(MTOPP.LT.0.1) MTOPP = 3.0
33+
IF(MTOPP.LT.1.5) MTOPP = 1.5
34+
IF(MTOPP.GT.1.5) MTOPP = 3.0
3435
IF(SPN.EQ.63.OR.SPN.EQ.66)THEN
3536
B0 = 0.0255
3637
B1 = 1.7479

nsvb.f

Lines changed: 108 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -179,19 +179,37 @@ SUBROUTINE NVBC(REGN,FORST,DIST,VOLEQ,DBHOB,HTTOT,MTOPP,MTOPS,
179179
ENDIF
180180
ENDIF
181181
ENDIF
182+
!First call the mrules to get the region defaults
183+
V_EQN = VOLEQ(1:10)
184+
CALL MRULES(REGN,FORST,V_EQN,DBHOB,COR,EVOD,OPT,MAXLEN,
185+
> MINLEN,MERCHL,MINLENT,MTOPP,MTOPS,STUMP,TRIM,BTR,DBTBH,MINBFD,
186+
> PROD)
187+
IF(MTOPS.GT.MTOPP) MTOPS = MTOPP
188+
!If HTTOT is not provided, try to get an estimate from HT1PRD/MTOPP, HT2PRD/MTOPS
189+
IF(HTTOT.LE.0)THEN
190+
IF(HT2PRD.GT.0.AND.MTOPS.GT.0)THEN
191+
CALL NVB_ESTTHT(VOLEQ,DBHOB,HT2PRD,MTOPS,HTTOT,ERRFLG,
192+
& SPGRPCD,WDSG)
193+
ELSEIF(HT1PRD.GT.0.AND.MTOPP.GT.0)THEN
194+
CALL NVB_ESTTHT(VOLEQ,DBHOB,HT1PRD,MTOPP,HTTOT,ERRFLG,
195+
& SPGRPCD,WDSG)
196+
ENDIF
197+
ENDIF
198+
!If HTTOT still 0, check broken height
182199
IF(HTTOT.LE.0)THEN
183200
IF(BRKHT.LE.0.AND.BRKHTD.LE.0)THEN
184201
ERRFLG = 4
185-
RETURN
202+
!RETURN
186203
ELSEIF(BRKHT.LE.0.OR.BRKHTD.LE.0)THEN
187204
ERRFLG = 9
188-
RETURN
205+
!RETURN
189206
ELSEIF(BRKHT.GT.0.AND.BRKHTD.GT.0)THEN
190207
CALL NVB_ESTTHT(VOLEQ,DBHOB,BRKHT,BRKHTD,HTTOT,ERRFLG,
191208
& SPGRPCD,WDSG)
192209
ENDIF
193210
ENDIF
194-
211+
IF(HTTOT.LE.0) ERRFLG = 4
212+
IF(ERRFLG.GT.0) RETURN
195213
IF(BRKHT.LT.4.5) BRKHT = 0
196214
IF(BRKHT.GT.0)THEN
197215
CALL NVB_GetRatioCOEF(VOLEQ,Tbl5Cnt,SPCOEF,JKCOEF,a,b,SPGRPCD)
@@ -228,48 +246,44 @@ SUBROUTINE NVBC(REGN,FORST,DIST,VOLEQ,DBHOB,HTTOT,MTOPP,MTOPS,
228246
RemBrchProp = 0
229247
ENDIF
230248
!IF(SPCD.LT.300)THEN
231-
IF(SFTHRD.EQ.0)THEN
232-
IF(DECAYCD.eq.1)THEN
233-
DenProp = 0.97
234-
DeadCF = 0.501
235-
ELSEIF(DECAYCD.EQ.2)THEN
236-
DenProp = 1
237-
DeadCF = 0.504
238-
ELSEIF(DECAYCD.EQ.3)THEN
239-
DenProp = 0.92
240-
DeadCF = 0.506
241-
ELSEIF(DECAYCD.EQ.4)THEN
242-
DenProp = 0.55
243-
DeadCF = 0.52
244-
ELSEIF(DECAYCD.EQ.5)THEN
245-
DenProp = 0.55
246-
DeadCF = 0.527
247-
ENDIF
248-
ELSE
249-
IF(DECAYCD.eq.1)THEN
250-
DenProp = 0.99
251-
DeadCF = 0.47
252-
ELSEIF(DECAYCD.EQ.2)THEN
253-
DenProp = 0.8
254-
DeadCF = 0.473
255-
ELSEIF(DECAYCD.EQ.3)THEN
256-
DenProp = 0.54
257-
DeadCF = 0.481
258-
ELSEIF(DECAYCD.EQ.4)THEN
259-
DenProp = 0.43
260-
DeadCF = 0.48
261-
ELSEIF(DECAYCD.EQ.5)THEN
262-
DenProp = 0.43
263-
DeadCF = 0.472
264-
ENDIF
265-
ENDIF
249+
!Move the following code to DecayDenProp subroutine (2025/05/08)
250+
!IF(SFTHRD.EQ.0)THEN
251+
! IF(DECAYCD.eq.1)THEN
252+
! DenProp = 0.97
253+
! DeadCF = 0.501
254+
! ELSEIF(DECAYCD.EQ.2)THEN
255+
! DenProp = 1
256+
! DeadCF = 0.504
257+
! ELSEIF(DECAYCD.EQ.3)THEN
258+
! DenProp = 0.92
259+
! DeadCF = 0.506
260+
! ELSEIF(DECAYCD.EQ.4)THEN
261+
! DenProp = 0.55
262+
! DeadCF = 0.52
263+
! ELSEIF(DECAYCD.EQ.5)THEN
264+
! DenProp = 0.55
265+
! DeadCF = 0.527
266+
! ENDIF
267+
!ELSE
268+
! IF(DECAYCD.eq.1)THEN
269+
! DenProp = 0.99
270+
! DeadCF = 0.47
271+
! ELSEIF(DECAYCD.EQ.2)THEN
272+
! DenProp = 0.8
273+
! DeadCF = 0.473
274+
! ELSEIF(DECAYCD.EQ.3)THEN
275+
! DenProp = 0.54
276+
! DeadCF = 0.481
277+
! ELSEIF(DECAYCD.EQ.4)THEN
278+
! DenProp = 0.43
279+
! DeadCF = 0.48
280+
! ELSEIF(DECAYCD.EQ.5)THEN
281+
! DenProp = 0.43
282+
! DeadCF = 0.472
283+
! ENDIF
284+
!ENDIF
285+
CALL DecayDenProp(SFTHRD,DECAYCD,DenProp,DeadCF)
266286
ENDIF
267-
!First call the mrules to get the region defaults
268-
V_EQN = VOLEQ(1:10)
269-
CALL MRULES(REGN,FORST,V_EQN,DBHOB,COR,EVOD,OPT,MAXLEN,
270-
> MINLEN,MERCHL,MINLENT,MTOPP,MTOPS,STUMP,TRIM,BTR,DBTBH,MINBFD,
271-
> PROD)
272-
IF(MTOPS.GT.MTOPP) MTOPS = MTOPP
273287
! (1) calculate total stem wood volume inside bark
274288
CALL NVB_Vib(VOLEQ,DBHOB,HTTOT,Vtotib,ERRFLG,SPGRPCD,WDSG)
275289
IF(ERRFLG.GT.0) RETURN
@@ -313,7 +327,7 @@ SUBROUTINE NVBC(REGN,FORST,DIST,VOLEQ,DBHOB,HTTOT,MTOPP,MTOPS,
313327
ENDIF
314328
IF(HT1PRD.LT.STUMP) HT1PRD = STUMP
315329
!Calculate sawtimber volume for FIA
316-
!CTYPE = B is set in noinitnvb when VOLEQ is not NSVB EQ
330+
!CTYPE = B is set in volinitnvb when VOLEQ is not NSVB EQ
317331
IF(CTYPE.EQ.'I'.OR.CTYPE.EQ.'B')THEN
318332
CALL CalcRatio(HTTOT,HT1PRD,RatioEQ,a,b,Rsaw2)
319333
Vsawib2 = Vtotib*Rsaw2 - Vstumpib
@@ -606,6 +620,8 @@ SUBROUTINE NVB_HT2TOPDob(VOLEQ,DBHOB,HTTOT,Vob,TOPD,HT2,ERRFLG,
606620
CALL NVB_Vob(VOLEQ,DBHOB,HTTOT,Vob,ERRFLG,SPGRPCD,WDSG)
607621
ENDIF
608622
CALL NVB_CalcHT2TOPD(Vob,a,b,HTTOT,TOPD,HT2)
623+
!Added HT2 floor to 4.5 for merch height (2025/05/02)
624+
IF(HT2.LT.5.AND.TOPD.LT.DBHOB) HT2 = 5
609625
RETURN
610626
END
611627
!----------------------------------------------------------------------
@@ -856,7 +872,7 @@ SUBROUTINE CalcRatio(H,h1,equation,a,b,R)
856872
INTEGER equation
857873
REAL H,h1,a,b,R
858874
R=0
859-
IF(equation.EQ.6.AND.(h1.GT.0.AND.h1.LT.H))THEN
875+
IF(equation.EQ.6.AND.(h1.GT.0.AND.h1.LE.H))THEN
860876
R = (1-(1-h1/H)**a)**b
861877
ENDIF
862878
RETURN
@@ -942,12 +958,12 @@ SUBROUTINE NVB_CalcHT2TOPD(TCUFT,a,b,HTTOT,TOPD,HT2)
942958
hi = HTTOT
943959
diff = 1.0
944960
loopcnt = 0
945-
DO WHILE (ABS(diff).GT.0.01)
961+
DO WHILE (ABS(diff).GT.0.001)
946962
mid = (low+hi)/2
947963
X = mid/HTTOT
948964
diff = TOPD - ((TCUFT/0.005454154/HTTOT*a*b*
949965
+ (1-X)**(a-1)*(1-(1-X)**a)**(b-1)))**0.5
950-
IF(ABS(diff).LT.0.05) THEN
966+
IF(ABS(diff).LT.0.001) THEN
951967
EXIT
952968
ENDIF
953969
IF(diff.LT.0.0)THEN
@@ -958,7 +974,7 @@ SUBROUTINE NVB_CalcHT2TOPD(TCUFT,a,b,HTTOT,TOPD,HT2)
958974
loopcnt = loopcnt +1
959975
IF(loopcnt.GT.1000) EXIT
960976
ENDDO
961-
HT2 = mid
977+
HT2 = mid
962978
RETURN
963979
END
964980
C----------------------------------------------------------------------
@@ -1422,4 +1438,46 @@ SUBROUTINE GetRegnWF(REGN,FORST,SPCD,WtFac,DeadWF,PROD)
14221438
ENDIF
14231439
RETURN
14241440
END
1425-
1441+
!----------------------------------------------------------------------
1442+
SUBROUTINE DecayDenProp(SFTHRD,DECAYCD,DenProp,DeadCF)
1443+
IMPLICIT NONE
1444+
INTEGER SFTHRD,DECAYCD
1445+
REAL DenProp,DeadCF
1446+
1447+
IF(SFTHRD.EQ.0)THEN
1448+
IF(DECAYCD.eq.1)THEN
1449+
DenProp = 0.97
1450+
DeadCF = 0.501
1451+
ELSEIF(DECAYCD.EQ.2)THEN
1452+
DenProp = 1
1453+
DeadCF = 0.504
1454+
ELSEIF(DECAYCD.EQ.3)THEN
1455+
DenProp = 0.92
1456+
DeadCF = 0.506
1457+
ELSEIF(DECAYCD.EQ.4)THEN
1458+
DenProp = 0.55
1459+
DeadCF = 0.52
1460+
ELSEIF(DECAYCD.EQ.5)THEN
1461+
DenProp = 0.55
1462+
DeadCF = 0.527
1463+
ENDIF
1464+
ELSE
1465+
IF(DECAYCD.eq.1)THEN
1466+
DenProp = 0.99
1467+
DeadCF = 0.47
1468+
ELSEIF(DECAYCD.EQ.2)THEN
1469+
DenProp = 0.8
1470+
DeadCF = 0.473
1471+
ELSEIF(DECAYCD.EQ.3)THEN
1472+
DenProp = 0.54
1473+
DeadCF = 0.481
1474+
ELSEIF(DECAYCD.EQ.4)THEN
1475+
DenProp = 0.43
1476+
DeadCF = 0.48
1477+
ELSEIF(DECAYCD.EQ.5)THEN
1478+
DenProp = 0.43
1479+
DeadCF = 0.472
1480+
ENDIF
1481+
ENDIF
1482+
RETURN
1483+
END

vernum.f

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,12 @@ SUBROUTINE VERNUM(VERSION)
114114
!20241118 Modified VOLINITNVB to calculate GRNBIO using VOL and weight factor for cruise VOLEQ (not NVB equation)
115115
!20250227 Modified nsvb.f and voiinit.f to set log weight to LOGVOL for CTYPE=Cruise and
116116
! Updated R6_EQN for species Incense cedar(81) to use I00FW2W073 and Grand fir(17) to use I00FW2W017 in Willamette NF
117+
!20250310 Fixed r9logs to make sure even logs and modified R9 MINLEN = 2
117118
!20250325 Updated volinit.f for biomass adjustment for cruise VOLEQ (non-NSVB equation) and
118119
! updated R4 dead weight factor based on study data at Deer Hollow, Mt. Dutton, Navajo Basin
119-
!20250310 Fixed r9logs to make sure even logs and modified R9 MINLEN = 2
120+
!20250401 Fixed nsvb.f to make sure HTTOT>0 for calculation and added CTYPE='B' chek for DBH only tree.
121+
!20250512 Fixed nsvb.f to calculate merch height for FIA (CTYPE='I') to be minimum 5,
122+
! applied denProp based on DECAYCD to woodland species biomass, and added species checck for 63 and 65 in woodland_bio
120123
!... Contains the volume library version number
121124
!... This is simply the date of the latest release/version
122125

@@ -146,7 +149,7 @@ SUBROUTINE VERNUM(VERSION)
146149
! 15 FORMAT (A)
147150
! END IF
148151

149-
VERSION = 20250325
152+
VERSION = 20250512
150153
RETURN
151154
END SUBROUTINE VERNUM
152155

@@ -179,7 +182,7 @@ SUBROUTINE VERNUM2(VERSION)
179182
! 15 FORMAT (A)
180183
! END IF
181184

182-
VERSION = 20250325
185+
VERSION = 20250512
183186
RETURN
184187
END SUBROUTINE VERNUM2
185188

@@ -202,7 +205,7 @@ SUBROUTINE VERNUM_F(VERSION)
202205

203206
!---------------------------------------------------------------------
204207

205-
VERSION = 20250325
208+
VERSION = 20250512
206209

207210
PRINT '(I8)', VERSION
208211
RETURN
@@ -215,6 +218,6 @@ subroutine vernum_r(version)
215218
!DEC$ ATTRIBUTES C, REFERENCE, ALIAS:'vernum_r_'::vernum_r
216219

217220
integer version
218-
version = 20250325
221+
version = 20250512
219222
return
220223
end subroutine vernum_r

0 commit comments

Comments
 (0)