Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
SUBROUTINE ComputeTaxAndDepreciation
! SUBROUTINE INFORMATION:
! AUTHOR Jason Glazer of GARD Analytics, Inc.
! DATE WRITTEN August 2010
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Compute the present value after factoring in taxes
! and depreciation.
! METHODOLOGY EMPLOYED:
! REFERENCES:
! na
! USE STATEMENTS:
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
INTEGER, PARAMETER :: SizeDepr = 41
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64),DIMENSION(SizeDepr) :: DepreciationPercent !values expressed as percent 5% is 5.0 (based on tables)
REAL(r64) :: curCapital
INTEGER :: curDepYear
INTEGER :: iYear
INTEGER :: jYear
ALLOCATE(DepreciatedCapital(lengthStudyYears))
ALLOCATE(TaxableIncome(lengthStudyYears))
ALLOCATE(Taxes(lengthStudyYears))
ALLOCATE(AfterTaxCashFlow(lengthStudyYears))
ALLOCATE(AfterTaxPresentValue(lengthStudyYears))
! Depreciation factors are based on IRS Publication 946 for 2009 "How to Depreciate Property"
! The MACRS valus are based on Modified Accelerated Cost Recovery System GDS for 3, 5, 7, 10 year
! property are based on 200% depreciation method shown in Appendix A using half year. 15 and 20 are
! based on 150% (Chart 1). For Straight Line depreciation GDS is used for 27 years (actually 27.5)
! 31 years (actually 31.5 years) and 39 years using mid month. For 40 years ADS is used (chart 2)
! Table A-1 is used for 3, 4, 5, 10, 15 and 20 years. Table A-6 is for 27 years. Table A-7 for 31 years.
! Table A-7a for 39 years. Table A-13 for 40 years. These years are a classification of property
! and should not be confused with the length of the study. For 27 years, 31 years, 39 years and 40 years
! the June value was used.
DepreciationPercent = 0.0d0 !default all values to zero
SELECT CASE (depreciationMethod)
CASE(depMethMACRS3) ! IRS Publication 946 for 2009 Table A-1
DepreciationPercent(1) = 33.33d0
DepreciationPercent(2) = 44.45d0
DepreciationPercent(3) = 14.81d0
DepreciationPercent(4) = 7.41d0
CASE(depMethMACRS5) ! IRS Publication 946 for 2009 Table A-1
DepreciationPercent(1) = 20.0d0
DepreciationPercent(2) = 32.0d0
DepreciationPercent(3) = 19.2d0
DepreciationPercent(4) = 11.52d0
DepreciationPercent(5) = 11.52d0
DepreciationPercent(6) = 5.76d0
CASE(depMethMACRS7) ! IRS Publication 946 for 2009 Table A-1
DepreciationPercent(1) = 14.29d0
DepreciationPercent(2) = 24.49d0
DepreciationPercent(3) = 17.49d0
DepreciationPercent(4) = 12.49d0
DepreciationPercent(5) = 8.93d0
DepreciationPercent(6) = 8.92d0
DepreciationPercent(7) = 8.93d0
DepreciationPercent(8) = 4.46d0
CASE(depMethMACRS10) ! IRS Publication 946 for 2009 Table A-1
DepreciationPercent(1) = 10.0d0
DepreciationPercent(2) = 18.0d0
DepreciationPercent(3) = 14.4d0
DepreciationPercent(4) = 11.52d0
DepreciationPercent(5) = 9.22d0
DepreciationPercent(6) = 7.37d0
DepreciationPercent(7) = 6.55d0
DepreciationPercent(8) = 6.55d0
DepreciationPercent(9) = 6.56d0
DepreciationPercent(10) = 6.55d0
DepreciationPercent(11) = 3.28d0
CASE(depMethMACRS15) ! IRS Publication 946 for 2009 Table A-1
DepreciationPercent(1) = 5.0d0
DepreciationPercent(2) = 9.5d0
DepreciationPercent(3) = 8.55d0
DepreciationPercent(4) = 7.7d0
DepreciationPercent(5) = 6.93d0
DepreciationPercent(6) = 6.23d0
DepreciationPercent(7) = 5.9d0
DepreciationPercent(8) = 5.9d0
DepreciationPercent(9) = 5.91d0
DepreciationPercent(10) = 5.9d0
DepreciationPercent(11) = 5.91d0
DepreciationPercent(12) = 5.9d0
DepreciationPercent(13) = 5.91d0
DepreciationPercent(14) = 5.9d0
DepreciationPercent(15) = 5.91d0
DepreciationPercent(16) = 2.95d0
CASE(depMethMACRS20) ! IRS Publication 946 for 2009 Table A-1
DepreciationPercent(1) = 3.75d0
DepreciationPercent(2) = 7.219d0
DepreciationPercent(3) = 6.677d0
DepreciationPercent(4) = 6.177d0
DepreciationPercent(5) = 5.713d0
DepreciationPercent(6) = 5.285d0
DepreciationPercent(7) = 4.888d0
DepreciationPercent(8) = 4.522d0
DepreciationPercent(9) = 4.462d0
DepreciationPercent(10) = 4.461d0
DepreciationPercent(11) = 4.462d0
DepreciationPercent(12) = 4.461d0
DepreciationPercent(13) = 4.462d0
DepreciationPercent(14) = 4.461d0
DepreciationPercent(15) = 4.462d0
DepreciationPercent(16) = 4.461d0
DepreciationPercent(17) = 4.462d0
DepreciationPercent(18) = 4.461d0
DepreciationPercent(19) = 4.462d0
DepreciationPercent(20) = 4.461d0
DepreciationPercent(21) = 2.231d0
CASE(depMethStraight27) ! IRS Publication 946 for 2009 Table A-6 (June)
DepreciationPercent(1) = 1.97d0
DepreciationPercent(2) = 3.636d0
DepreciationPercent(3) = 3.636d0
DepreciationPercent(4) = 3.636d0
DepreciationPercent(5) = 3.636d0
DepreciationPercent(6) = 3.636d0
DepreciationPercent(7) = 3.636d0
DepreciationPercent(8) = 3.636d0
DepreciationPercent(9) = 3.636d0
DepreciationPercent(10) = 3.637d0
DepreciationPercent(11) = 3.636d0
DepreciationPercent(12) = 3.637d0
DepreciationPercent(13) = 3.636d0
DepreciationPercent(14) = 3.637d0
DepreciationPercent(15) = 3.636d0
DepreciationPercent(16) = 3.637d0
DepreciationPercent(17) = 3.636d0
DepreciationPercent(18) = 3.637d0
DepreciationPercent(19) = 3.636d0
DepreciationPercent(20) = 3.637d0
DepreciationPercent(21) = 3.636d0
DepreciationPercent(22) = 3.637d0
DepreciationPercent(23) = 3.636d0
DepreciationPercent(24) = 3.637d0
DepreciationPercent(25) = 3.636d0
DepreciationPercent(26) = 3.637d0
DepreciationPercent(27) = 3.636d0
DepreciationPercent(28) = 3.485d0
CASE(depMethStraight31) ! IRS Publication 946 for 2009 Table A-7 (June)
DepreciationPercent(1) = 1.72d0
DepreciationPercent(2) = 3.175d0
DepreciationPercent(3) = 3.175d0
DepreciationPercent(4) = 3.175d0
DepreciationPercent(5) = 3.175d0
DepreciationPercent(6) = 3.175d0
DepreciationPercent(7) = 3.175d0
DepreciationPercent(8) = 3.174d0
DepreciationPercent(9) = 3.175d0
DepreciationPercent(10) = 3.174d0
DepreciationPercent(11) = 3.175d0
DepreciationPercent(12) = 3.174d0
DepreciationPercent(13) = 3.175d0
DepreciationPercent(14) = 3.174d0
DepreciationPercent(15) = 3.175d0
DepreciationPercent(16) = 3.174d0
DepreciationPercent(17) = 3.175d0
DepreciationPercent(18) = 3.174d0
DepreciationPercent(19) = 3.175d0
DepreciationPercent(20) = 3.174d0
DepreciationPercent(21) = 3.175d0
DepreciationPercent(22) = 3.174d0
DepreciationPercent(23) = 3.175d0
DepreciationPercent(24) = 3.174d0
DepreciationPercent(25) = 3.175d0
DepreciationPercent(26) = 3.174d0
DepreciationPercent(27) = 3.175d0
DepreciationPercent(28) = 3.174d0
DepreciationPercent(29) = 3.175d0
DepreciationPercent(30) = 3.174d0
DepreciationPercent(31) = 3.175d0
DepreciationPercent(32) = 3.042d0
CASE(depMethStraight39) ! IRS Publication 946 for 2009 Table A-7a (June)
DepreciationPercent(1) = 1.391d0
DepreciationPercent(2) = 2.564d0
DepreciationPercent(3) = 2.564d0
DepreciationPercent(4) = 2.564d0
DepreciationPercent(5) = 2.564d0
DepreciationPercent(6) = 2.564d0
DepreciationPercent(7) = 2.564d0
DepreciationPercent(8) = 2.564d0
DepreciationPercent(9) = 2.564d0
DepreciationPercent(10) = 2.564d0
DepreciationPercent(11) = 2.564d0
DepreciationPercent(12) = 2.564d0
DepreciationPercent(13) = 2.564d0
DepreciationPercent(14) = 2.564d0
DepreciationPercent(15) = 2.564d0
DepreciationPercent(16) = 2.564d0
DepreciationPercent(17) = 2.564d0
DepreciationPercent(18) = 2.564d0
DepreciationPercent(19) = 2.564d0
DepreciationPercent(20) = 2.564d0
DepreciationPercent(21) = 2.564d0
DepreciationPercent(22) = 2.564d0
DepreciationPercent(23) = 2.564d0
DepreciationPercent(24) = 2.564d0
DepreciationPercent(25) = 2.564d0
DepreciationPercent(26) = 2.564d0
DepreciationPercent(27) = 2.564d0
DepreciationPercent(28) = 2.564d0
DepreciationPercent(29) = 2.564d0
DepreciationPercent(30) = 2.564d0
DepreciationPercent(31) = 2.564d0
DepreciationPercent(32) = 2.564d0
DepreciationPercent(33) = 2.564d0
DepreciationPercent(34) = 2.564d0
DepreciationPercent(35) = 2.564d0
DepreciationPercent(36) = 2.564d0
DepreciationPercent(37) = 2.564d0
DepreciationPercent(38) = 2.564d0
DepreciationPercent(39) = 2.564d0
DepreciationPercent(40) = 1.177d0
CASE(depMethStraight40) ! IRS Publication 946 for 2009 Table A-13 (June)
DepreciationPercent(1) = 1.354d0
DepreciationPercent(2) = 2.5d0
DepreciationPercent(3) = 2.5d0
DepreciationPercent(4) = 2.5d0
DepreciationPercent(5) = 2.5d0
DepreciationPercent(6) = 2.5d0
DepreciationPercent(7) = 2.5d0
DepreciationPercent(8) = 2.5d0
DepreciationPercent(9) = 2.5d0
DepreciationPercent(10) = 2.5d0
DepreciationPercent(11) = 2.5d0
DepreciationPercent(12) = 2.5d0
DepreciationPercent(13) = 2.5d0
DepreciationPercent(14) = 2.5d0
DepreciationPercent(15) = 2.5d0
DepreciationPercent(16) = 2.5d0
DepreciationPercent(17) = 2.5d0
DepreciationPercent(18) = 2.5d0
DepreciationPercent(19) = 2.5d0
DepreciationPercent(20) = 2.5d0
DepreciationPercent(21) = 2.5d0
DepreciationPercent(22) = 2.5d0
DepreciationPercent(23) = 2.5d0
DepreciationPercent(24) = 2.5d0
DepreciationPercent(25) = 2.5d0
DepreciationPercent(26) = 2.5d0
DepreciationPercent(27) = 2.5d0
DepreciationPercent(28) = 2.5d0
DepreciationPercent(29) = 2.5d0
DepreciationPercent(30) = 2.5d0
DepreciationPercent(31) = 2.5d0
DepreciationPercent(32) = 2.5d0
DepreciationPercent(33) = 2.5d0
DepreciationPercent(34) = 2.5d0
DepreciationPercent(35) = 2.5d0
DepreciationPercent(36) = 2.5d0
DepreciationPercent(37) = 2.5d0
DepreciationPercent(38) = 2.5d0
DepreciationPercent(39) = 2.5d0
DepreciationPercent(40) = 2.5d0
DepreciationPercent(41) = 1.146d0
END SELECT
! convert construction costs (not salvage) into depreciation
DepreciatedCapital = 0.0d0 ! set all years to zero
DO iYear = 1, lengthStudyYears
curCapital = CashFlow(costCatConstruction)%yrAmount(iYear) + CashFlow(costCatOtherCapital)%yrAmount(iYear)
DO jYear = 1, SizeDepr
curDepYear = iYear + jYear - 1 !start depreciating with the year that the capital was shown and go to years following
IF (curDepYear .LE. lengthStudyYears) THEN
DepreciatedCapital(curDepYear) = DepreciatedCapital(curDepYear) + curCapital * (DepreciationPercent(jYear) / 100)
END IF
END DO
END DO
! Using Newnan pg 3880
! before-tax cash flow
! depreciation
! taxable income (before-tax cash flow - depreciation)
! income taxes (taxable income x incremental tax rate)
! after-tax cash flow (before-tax cash flow - income taxes)
DO iYear = 1, lengthStudyYears
TaxableIncome(iYear) = CashFlow(costCatTotGrand)%yrAmount(iYear) - DepreciatedCapital(iYear)
Taxes(iYear) = TaxableIncome(iYear) * taxRate
AfterTaxCashFlow(iYear) = CashFlow(costCatTotGrand)%yrAmount(iYear) - Taxes(iYear)
! the present value after taxes is pretax present value minus the present value of the taxes
AfterTaxPresentValue(iYear) = CashFlow(costCatTotGrand)%yrPresVal(iYear) - Taxes(iYear) * SPV(iYear)
END DO
END SUBROUTINE ComputeTaxAndDepreciation