Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

leaf biophysics refactor and functional unit tests #1262

Open
wants to merge 65 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
9c87f9e
Functional Unit Testing for photosynthesis, leaf respiration and stom…
rgknox Oct 14, 2024
20d9791
update to leaf biophys funit test
rgknox Oct 14, 2024
11b92bf
removed leaf unit test script that is for another thing
rgknox Oct 14, 2024
379e4f1
Making some notes on leaf func utests
rgknox Oct 14, 2024
5c245ff
leaf functional unit tests
rgknox Oct 15, 2024
f7ad159
Updates to leaf unit tests
rgknox Oct 15, 2024
6e5e183
updates to leaf unit tests
rgknox Oct 16, 2024
36678f8
Started work on secant solver for photosynthesis
rgknox Oct 16, 2024
a827fe8
work towards leaf solver
rgknox Oct 17, 2024
9c45896
Added bisection to photo solver, testing non-convergences
rgknox Oct 18, 2024
77657ab
Added argument control to leaf func unit test
rgknox Oct 19, 2024
bd89109
added readme placeholder
rgknox Oct 19, 2024
c7af3ef
debugged bisection, leaf unit tests generating stable results
rgknox Oct 22, 2024
929df1d
Added updated bounding to leaf photo bisection solver
rgknox Oct 26, 2024
91ee74d
Merge branch 'main' into leaf_funcunit_tests_merged
rgknox Oct 26, 2024
6610b3f
adding ability to revert to older methods for testing during leaf bio…
rgknox Oct 28, 2024
dc4f85e
adding in reversion testing to leaf photo updates
rgknox Oct 28, 2024
a7d9851
adding more ways to revert code to match old results with photo refactor
rgknox Oct 30, 2024
af7dd30
adding in options to btran effects on stomatal intercept and jmax
rgknox Oct 31, 2024
f61a3e1
updates to options in leaf photo
rgknox Oct 31, 2024
3b3872f
minor updates to comments in photo refactor
rgknox Nov 1, 2024
ea852d7
text updates and parameter reporting for leaf biophysics
rgknox Nov 4, 2024
5ec4cca
Adding some test print statements
rgknox Nov 4, 2024
6f4a030
diagnostics
rgknox Nov 4, 2024
b57cbfe
diagnostics
rgknox Nov 4, 2024
5c17877
removed diagnostic print statements, fixed zeroing bug for psn arrays
rgknox Nov 4, 2024
707704f
Updates to photosynthesis refactor related to preserving b4b
rgknox Nov 4, 2024
8c6319d
merge resolution
rgknox Nov 4, 2024
1ff3f13
reverting base compare code in leafbiophys
rgknox Nov 5, 2024
e985043
added ci_tol as argument to leaf level photosynthesis
rgknox Nov 5, 2024
4a7c550
expanding func unit tests for leaf biophys
rgknox Nov 5, 2024
254fbf8
adding in btran controls on conductance and agross
rgknox Nov 7, 2024
a261993
updating btran control tests
rgknox Nov 8, 2024
8a96e99
updated arguments to allow btran scaling of gs0 gs1 etc
rgknox Nov 8, 2024
d0fa00a
added protections in medlyn conductance when g1 approaches zero (triv…
rgknox Nov 9, 2024
efc8458
fixes to build for leaf biogeophys, addes smoothing back to c4 agross
rgknox Nov 9, 2024
cf09bce
Merge branch 'leaf_funcunit_tests' of github.com:rgknox/fates into le…
rgknox Nov 9, 2024
7358255
Added failure flags for quadratic solves (will remove)
rgknox Nov 9, 2024
3fbd7df
Added another conductance scaling term
rgknox Nov 12, 2024
dcddf2e
Cleaned up alternative scaling of the gs2 term
rgknox Nov 12, 2024
78145a2
Added gs2 arguments
rgknox Nov 12, 2024
7f9c088
fixed math on the bisection minmax for c4, subtle improvement on bise…
rgknox Nov 12, 2024
75e8684
cleaning and text updates to the photosynthesis module. Also added a …
rgknox Nov 13, 2024
6458190
converted bisection end-point solutions to use quadratic
rgknox Nov 13, 2024
a27ddba
added arguments to bisection starting point error report
rgknox Nov 19, 2024
40fa80b
Added lower floor on vcmax and jmax
rgknox Nov 19, 2024
52883e6
included smoothing into the c4 bisection endpoints, added a return to…
rgknox Nov 20, 2024
adec08d
Added lower cap on gs0 for photosynthesis, created smoke test unit test
rgknox Nov 21, 2024
c44ddcf
Added in extremely high bisection starting range as a fall back.
rgknox Nov 25, 2024
527673e
minor fixes to radiation unit testing to allow coupling with photosyn…
rgknox Dec 6, 2024
3ff9321
removed commented out and deprecated code
rgknox Jan 15, 2025
b3088f6
Update biogeophys/FatesPlantRespPhotosynthMod.F90
rgknox Jan 15, 2025
40e68b1
adding in btran scaling model switches and enforcing PEP function call
rgknox Jan 15, 2025
24c6217
Merge branch 'leaf_funcunit_tests' of github.com:rgknox/fates into le…
rgknox Jan 15, 2025
936edab
conflict resolution, two branches added back in the old way of defini…
rgknox Jan 15, 2025
1ecc474
Added in checks on btran scaling methods, extended btran_stomatal sca…
rgknox Jan 22, 2025
ae8b2ed
updated comments
rgknox Jan 22, 2025
cb1bd92
Update biogeophys/LeafBiophysicsMod.F90
rgknox Feb 11, 2025
86bd24e
cleaned up some leaf biophysics parameter things, like removed duplic…
rgknox Feb 11, 2025
778ab4d
Update main/EDPftvarcon.F90
glemieux Feb 17, 2025
4afd3b3
Merge tag 'sci.1.80.14_api.37.0.0' into leaf_funcunit_tests
glemieux Feb 17, 2025
65ea562
reinstituted endrun in the quadratic solvers
rgknox Feb 18, 2025
f6f5dc2
changed countcohorts to num_cohorts
rgknox Feb 18, 2025
fe4b7bd
cleaned up variable declarations and labeling in FatesPlantRespPhotos…
rgknox Feb 18, 2025
7a13afc
removed unecessary folder holder
rgknox Feb 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed diagnostic print statements, fixed zeroing bug for psn arrays
  • Loading branch information
rgknox committed Nov 4, 2024
commit 5c17877a5a78e4b25d67a7e01c97f52edcf7cd65
56 changes: 19 additions & 37 deletions biogeophys/FatesPlantRespPhotosynthMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,14 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)
(nleafage > 1) .or. &
(hlm_parteh_mode .ne. prt_carbon_allom_hyp ) ) then


! These values are incremented, therefore since
! sometimes we re-do layers, we need to re-zero them as well
! since it is not an over-write
psn_z(iv,ft,cl) = 0._r8
anet_av_z(iv,ft,cl) = 0._r8
c13disc_z(iv,ft,cl) = 0._r8

if (hlm_use_planthydro.eq.itrue ) then

btran_eff = currentCohort%co_hydr%btran
Expand Down Expand Up @@ -727,31 +735,6 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)
hydr_k_lwp = 1._r8
end if

!print*,"vcmax:",vcmax_z,jmax_z
!print*,"tveg(c):",bc_in(s)%t_veg_pa(ifp)-273.15
!print*,"Pas:", bc_in(s)%forc_pbot,bc_in(s)%cair_pa(ifp),bc_in(s)%oair_pa(ifp)
!print*,"btran,gb_mol:",btran_eff,gb_mol*1.e-6
!print*,"vap,kco2,ko2,cc:",bc_in(s)%eair_pa(ifp),mm_kco2,mm_ko2,co2_cpoint

!print*,"PSN IN:",par_abs, & ! in
! leaf_area, & ! in
! ft, & ! in
! vcmax_z, & ! in
! jmax_z, & ! in
! kp_z, & ! in
! bc_in(s)%t_veg_pa(ifp), & ! in
! bc_in(s)%forc_pbot, & ! in
! bc_in(s)%cair_pa(ifp), & ! in
! bc_in(s)%oair_pa(ifp), & ! in
! btran_eff, & ! in
! gb_mol, & ! in
! bc_in(s)%eair_pa(ifp), & ! in
! mm_kco2, & ! in
! mm_ko2, & ! in
! co2_cpoint, & ! in
! lmr_z(iv,ft,cl)


call LeafLayerPhotosynthesis(par_per_sunla, & !
par_abs, & ! in
leaf_area, & ! in
Expand Down Expand Up @@ -811,9 +794,9 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)
end if rate_mask_if
end do leaf_layer_loop

if(maxval(psn_z(:,ft,cl))>nearzero .and. ico==2) then
print*,psn_z(1:8,ft,cl)
end if
!if(maxval(psn_z(:,ft,cl))>nearzero .and. ico==2) then
! print*,psn_z(1:8,ft,cl)
!end if

! Zero cohort flux accumulators.
currentCohort%npp_tstep = 0.0_r8
Expand Down Expand Up @@ -1101,15 +1084,14 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)
currentCohort => currentCohort%shorter
enddo do_cohort_drive


if(maxval(psn_z(:,1,1))>nearzero)then
currentCohort => currentPatch%tallest
do while (associated(currentCohort)) ! Cohort loop
print*,currentCohort%gpp_tstep,currentCohort%pft,currentCohort%canopy_layer
currentCohort => currentCohort%shorter
enddo
stop
end if
!if(maxval(psn_z(:,1,1))>nearzero)then
! currentCohort => currentPatch%tallest
! do while (associated(currentCohort)) ! Cohort loop
! print*,currentCohort%gpp_tstep,currentCohort%pft,currentCohort%canopy_layer
! currentCohort => currentCohort%shorter
! enddo
! stop
!end if
Comment on lines +1068 to +1075
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code for future work, or temporary code to be removed?


end if if_any_cohorts

Expand Down