Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Write out variables at local noon

nick

Herold
Member
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.
 

erik

Erik Kluzek
CSEG and Liaisons
Staff member
Yes, the default output is where everything is on a 2D grid and output one per gridcell. If you want to see each PFT patch, you have to turn off the 2D averaging and output everything on the PFT level

So add this to your user_nl_clm:
hist_dov2xy=T
hist_type1d_pertape='PFTS'
Then you have to figure out how to interpret the 1D vector of PFT patch data, which takes some work for a global case.
 

nick

Herold
Member
Thanks Erik. No actually I'm fine with one value per grid cell, I just want to confirm that the value being written out is the average across patches/PFT's and not something else. And it sounds like from your response that this is in fact what gets written out.
 
Top