Skip to content
Merged
Changes from all commits
Commits
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
32 changes: 29 additions & 3 deletions src/biogeophys/PhotosynthesisMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ module PhotosynthesisMod
real(r8), pointer, public :: rc13_psnsun_patch (:) ! patch C13O2/C12O2 in sunlit canopy psn flux
real(r8), pointer, public :: rc13_psnsha_patch (:) ! patch C13O2/C12O2 in shaded canopy psn flux

real(r8), pointer, public :: rc14_canair_patch (:) ! patch C14O2/C12O2 in canopy air

real(r8), pointer, public :: psnsun_patch (:) ! patch sunlit leaf photosynthesis (umol CO2/m**2/s)
real(r8), pointer, public :: psnsha_patch (:) ! patch shaded leaf photosynthesis (umol CO2/m**2/s)
real(r8), pointer, public :: c13_psnsun_patch (:) ! patch c13 sunlit leaf photosynthesis (umol 13CO2/m**2/s)
Expand Down Expand Up @@ -346,6 +348,7 @@ subroutine InitAllocate(this, bounds)
allocate(this%rc13_canair_patch (begp:endp)) ; this%rc13_canair_patch (:) = nan
allocate(this%rc13_psnsun_patch (begp:endp)) ; this%rc13_psnsun_patch (:) = nan
allocate(this%rc13_psnsha_patch (begp:endp)) ; this%rc13_psnsha_patch (:) = nan
allocate(this%rc14_canair_patch (begp:endp)) ; this%rc14_canair_patch (:) = nan

allocate(this%cisun_z_patch (begp:endp,1:nlevcan)) ; this%cisun_z_patch (:,:) = nan
allocate(this%cisha_z_patch (begp:endp,1:nlevcan)) ; this%cisha_z_patch (:,:) = nan
Expand Down Expand Up @@ -449,6 +452,7 @@ subroutine Clean(this)
deallocate(this%rc13_canair_patch )
deallocate(this%rc13_psnsun_patch )
deallocate(this%rc13_psnsha_patch )
deallocate(this%rc14_canair_patch )

deallocate(this%cisun_z_patch )
deallocate(this%cisha_z_patch )
Expand Down Expand Up @@ -579,7 +583,7 @@ subroutine InitHistory(this, bounds)
this%rc13_canair_patch(begp:endp) = spval
call hist_addfld1d (fname='RC13_CANAIR', units='proportion', &
avgflag='A', long_name='C13/C(12+13) for canopy air', &
ptr_patch=this%rc13_canair_patch, default='inactive')
ptr_patch=this%rc13_canair_patch, set_spec=spval, default='inactive')
Comment thread
ekluzek marked this conversation as resolved.

this%rc13_psnsun_patch(begp:endp) = spval
call hist_addfld1d (fname='RC13_PSNSUN', units='proportion', &
Expand All @@ -592,6 +596,13 @@ subroutine InitHistory(this, bounds)
ptr_patch=this%rc13_psnsha_patch, default='inactive')
endif

if ( use_c14 ) then
this%rc14_canair_patch(begp:endp) = spval
call hist_addfld1d (fname='RC14_CANAIR', units='proportion', &
avgflag='A', long_name='C14/C(12+13) for canopy air', &
ptr_patch=this%rc14_canair_patch, set_spec=spval, default='inactive')
end if

! Canopy physiology

if ( use_c13 ) then
Expand Down Expand Up @@ -1034,6 +1045,11 @@ subroutine Restart(this, bounds, ncid, flag)
dim1name='pft', long_name='', units='', &
interpinic_flag='interp', readvar=readvar, data=this%rc13_psnsha_patch)
endif
if ( use_c14 ) then
call restartvar(ncid=ncid, flag=flag, varname='rc14_canair', xtype=ncd_double, &
dim1name='pft', long_name='', units='', &
interpinic_flag='interp', readvar=readvar, data=this%rc14_canair_patch)
end if

call restartvar(ncid=ncid, flag=flag, varname='GSSUN', xtype=ncd_double, &
dim1name='pft', dim2name='levcan', switchdim=.true., &
Expand Down Expand Up @@ -1173,10 +1189,13 @@ subroutine TimeStepInit (this, bounds)
.or. lun%itype(l) == istice &
.or. lun%itype(l) == istwet) then
if (use_c13) then
this%rc13_canair_patch(p) = 0._r8
this%rc13_canair_patch(p) = spval
this%rc13_psnsun_patch(p) = 0._r8
this%rc13_psnsha_patch(p) = 0._r8
end if
if (use_c14) then
this%rc14_canair_patch(p) = spval
end if
end if
end do

Expand All @@ -1197,11 +1216,15 @@ subroutine NewPatchInit (this, p)
if ( use_c13 ) then
this%alphapsnsun_patch(p) = 0._r8
this%alphapsnsha_patch(p) = 0._r8
this%rc13_canair_patch(p) = 0._r8
this%rc13_canair_patch(p) = spval
this%rc13_psnsun_patch(p) = 0._r8
this%rc13_psnsha_patch(p) = 0._r8
endif

if ( use_c14 ) then
this%rc14_canair_patch(p) = spval
Comment thread
ekluzek marked this conversation as resolved.
end if

this%psnsun_patch(p) = 0._r8
this%psnsha_patch(p) = 0._r8

Expand Down Expand Up @@ -2072,6 +2095,7 @@ subroutine PhotosynthesisTotal (fn, filterp, &
rc13_canair => photosyns_inst%rc13_canair_patch , & ! Output: [real(r8) (:) ] C13O2/C12O2 in canopy air
rc13_psnsun => photosyns_inst%rc13_psnsun_patch , & ! Output: [real(r8) (:) ] C13O2/C12O2 in sunlit canopy psn flux
rc13_psnsha => photosyns_inst%rc13_psnsha_patch , & ! Output: [real(r8) (:) ] C13O2/C12O2 in shaded canopy psn flux
rc14_canair => photosyns_inst%rc14_canair_patch , & ! Output: [real(r8) (:) ] C1342/C12O2 in canopy air
alphapsnsun => photosyns_inst%alphapsnsun_patch , & ! Output: [real(r8) (:) ] fractionation factor in sunlit canopy psn flux
alphapsnsha => photosyns_inst%alphapsnsha_patch , & ! Output: [real(r8) (:) ] fractionation factor in shaded canopy psn flux
psnsun_wc => photosyns_inst%psnsun_wc_patch , & ! Output: [real(r8) (:) ] Rubsico-limited sunlit leaf photosynthesis (umol CO2 /m**2/ s)
Expand Down Expand Up @@ -2142,6 +2166,8 @@ subroutine PhotosynthesisTotal (fn, filterp, &
sector_c14 = 3
endif

rc14_canair(p) = rc14_atm(sector_c14)

Comment thread
ekluzek marked this conversation as resolved.
c14_psnsun(p) = rc14_atm(sector_c14) * psnsun(p)
c14_psnsha(p) = rc14_atm(sector_c14) * psnsha(p)
endif
Expand Down