duplicate definitions of a few functions in CanopyFluxesMod.F90
- Dominant language
- Fortran
- Stars
- 352
- Forks
- 361
- Avg merge
- 6d 6h
- Merged PRs (30d)
- 8
Description
**Bill Sacks < sacks@ucar.edu > - 2013-07-23 21:57:40 -0600**
**Bugzilla Id:** [1769](http://bugz.cgd.ucar.edu/show_bug.cgi?id=1769)
**Bugzilla CC:** erik@ucar.edu, muszala@ucar.edu, rfisher@ucar.edu,
Starting in clm4_0_67 (Jinyun's changes), there are duplicate definitions of 3 functions: ft, fth, fth25.
It looks like Jinyun turned these into true functions, which is an improvement.
However, the old statement functions were never removed from the top of subroutine Photosynthesis:
real(r8) :: ft ! photosynthesis temperature response (statement function)
real(r8) :: fth ! photosynthesis temperature inhibition (statement function)
real(r8) :: fth25 ! ccaling factor for photosynthesis temperature inhibition (statement function)
...
ft(tl,ha) = exp( ha / (rgas*1.e-3_r8*(tfrz+25._r8)) * (1._r8 - (tfrz+25._r8)/tl) )
fth(tl,hd,se,cc) = cc / ( 1._r8 + exp( (-hd+se*tl) / (rgas*1.e-3_r8*tl) ) )
fth25(hd,se) = 1._r8 + exp( (-hd+se*(tfrz+25._r8)) / (rgas*1.e-3_r8*(tfrz+25._r8)) )
(Incidentally, I had to go to a fortran reference to even figure out what these lines were doing... now that they have served their educational purpose, I think these old statement functions should be purged.)
I'm guessing that the local statement functions take precedence over the module-level functions, so the module-level functions currently aren't being used. So we should (1) remove the above lines, and then (2) confirm that answers are bfb.
Contributor guide
Assessment
This issue has not been assessed yet.