! 2.15a.f90 ! ! $Id: 2.15a.f90 1.2 2016/11/03 11:25:31 s Exp $ ! ! bc, Before-tax cash flow : ňø‚«‘OƒLƒƒƒbƒVƒ…Eƒtƒ[ ! da, Depletion : Œ¸‰¿ž‹p ! ti, Taxable income : ‰ÛÅ‘ÎÛŽû‰v ! tax : Å‹à ! ac, After-tax cash flow : ňø‚«ŒãƒLƒƒƒbƒVƒ…Eƒtƒ[ ! tr, tax rate : Å—¦ ! ir, infration rate : ƒCƒ“ƒtƒŒ—¦ ! ic, initial capital expenditure : ‰ŠúŽ‘–{”ï—p ! r, discount rate : ‹à—˜ ! df, discount factor : Š„ˆøŒW”(2011-10-29‰ü) ! ny : ”N” ! pvac, present value of ac : ňø‚«ŒãƒLƒƒƒbƒVƒ…Eƒtƒ[‚ÌŒ»Ý‰¿’l ! program ex2_15a implicit none character(100) :: fmt1, fmt2, fmt3 integer :: k, ny integer, dimension(0:10) :: i double precision :: ic, ir, r, sumpv, tr double precision :: ac(0:10), bc(0:10), da(0:10), df(0:10), pv(0:10) double precision :: tax(0:10), ti(0:10) ! input tr = 0.34d0 ir = 0.04d0 r = 0.12d0 ic = 10.0d6 ny = 5 i(0:ny) = (/(k, k = 0, ny)/) bc(0:ny) = (/-ic, 2990.0d3, 2990.0d3, 2990.0d3, 2990.0d3, 2990.0d3/) da(0:ny) = (/0.0d0, ic/ny, ic/ny, ic/ny, ic/ny, ic/ny/) ! calculation do k = 0, ny if(bc(k) - da(k) > 0) then ti(k) = bc(k) - da(k) else ti(k) = 0 end if end do tax(0:ny) = ti(0:ny) * tr ac(0:ny) = bc(0:ny) - tax(0:ny) df(0:ny) = 1.0d0 / (1d0 + r) ** i(0:ny) pv(0:ny) = ac(0:ny) * df(0:ny) sumpv = sum(pv(0:ny)) ! output fmt1 = '(a3, a10, a9, a13, a7, a10, a9, a17)' fmt2 = '(i3, i10, i9, i13, i7, i10, f9.2, i17)' fmt3 = '(a61,i17)' print *, '2.15a.f90' print fmt1, '”N', 'ňø‘OCF', 'Œ¸‰¿ž‹p', '‰ÛÅ‘ÎÛŽû‰v', 'Å‹à', & 'ňøŒãCF', 'Š„ˆøŒW”', 'ňøŒãCFŒ»Ý‰¿’l' print *, ('-', k = 1, 77) print fmt2, (i(k), nint(bc(k)), nint(da(k)), nint(ti(k)), nint(tax(k)), & nint(ac(k)), df(k), nint(pv(k)), k = 0, ny) print *, ('-', k = 1, 77) print fmt3, 'Œ»Ý‰¿’l=', nint(sumpv) stop end program ex2_15a