Hi, I'd like to write out several variables at local noon from the Photosynthesis module, similar to GSSUNLN.
Starting with vegetation temperature (TV) I've made changes which successfully write out a new variable TV at local noon (TVLN). However, I'm doubting whether I'm recording the average temperature across PFT's at each grid cell.
The critical code I've added is (in the PhotosynthesisHydraulicStress subroutine):
if ( is_near_local_noon( grc%londeg(g), deltasec=3600 ) )then
t_vegln(p) = t_veg(p)
end if
But t_vegln above is storing a temperature for each patch/PFT. So I'm wondering whether the temperature I'm seeing in the netcdf file is actually just the last patch/PFT that was looped through and not an average across all patch/PFT's in the grid cell.
The code that writes out the above data is below. Clearly all patch/PFT temperatures are being passed to hist_addfld1d, but only one values gets written per grid cell, is there an averaging operation I'm unaware of (avgflag refers to time)? Or have I misunderstood what's happening?
ptr_1d => this%t_vegln_patch(begp:endp)
this%t_vegln_patch(begp:endp) = spval
call hist_addfld1d (fname='TVLN', units='K', &
avgflag='A', long_name='vegetation temperature at local noon', &
ptr_patch=this%t_vegln_patch)
Thanks.
Starting with vegetation temperature (TV) I've made changes which successfully write out a new variable TV at local noon (TVLN). However, I'm doubting whether I'm recording the average temperature across PFT's at each grid cell.
The critical code I've added is (in the PhotosynthesisHydraulicStress subroutine):
if ( is_near_local_noon( grc%londeg(g), deltasec=3600 ) )then
t_vegln(p) = t_veg(p)
end if
But t_vegln above is storing a temperature for each patch/PFT. So I'm wondering whether the temperature I'm seeing in the netcdf file is actually just the last patch/PFT that was looped through and not an average across all patch/PFT's in the grid cell.
The code that writes out the above data is below. Clearly all patch/PFT temperatures are being passed to hist_addfld1d, but only one values gets written per grid cell, is there an averaging operation I'm unaware of (avgflag refers to time)? Or have I misunderstood what's happening?
ptr_1d => this%t_vegln_patch(begp:endp)
this%t_vegln_patch(begp:endp) = spval
call hist_addfld1d (fname='TVLN', units='K', &
avgflag='A', long_name='vegetation temperature at local noon', &
ptr_patch=this%t_vegln_patch)
Thanks.