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

Output variables for urban and rural land unit

Status
Not open for further replies.

KeerZ

Member
Hello,
I have a question on customizing CLM output. I would like to output the vapor pressure and friction velocity for urban and rural land units. I think the way to do this is to modify CLM scripts. First calculate vapor pressure and friction velocity in urban and rural patch, and then add the new variables into master field. I do not know the scripts well enough so I am not sure I did this in the right way. Could anyone with better knowledge on CLM code give me some suggestiona on my modification?

In attached txt files, I commented every modification with "Where Keer Modified" so that you can find them easily. Here are a summary of what I modified:

---------------------------------------calculating vapor pressure and friction velocity in urban and rural patch---------------------------------------------------------
In BareGroundFluxesMod.f90 and CanopyFluxesMod.f90, I added the following line at the (I think) proper location:
vap_ref2m_r => humanindex_inst%vap_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m height vapor pressure (Pa)
ustar_r => frictionvel_inst%fv_r_patch , & ! Output: [real(r8) (:) ] rural friction velocity(m/s)
------------------------------------------------------------------------------
ustar_r(p)=ustar(p)
------------------------------------------------------------------------------
vap_ref2m_r(p) = vap_ref2m(p)


In UrbanFluxesMod.f90, I added the following line at the (I think) proper location:
vap_ref2m_u => humanindex_inst%vap_ref2m_u_patch , & ! Output: [real(r8) (:) ] Urban 2 m height vapor pressure (Pa)
ustar_u => frictionvel_inst%fv_u_patch , & ! Output: [real(r8) (:) ] Urban friction velocity (m/s)
------------------------------------------------------------------------------
ustar_u(p) = ustar(l)
------------------------------------------------------------------------------
vap_ref2m_u(p) = vap_ref2m(p)

----------------------------------------------add the new variables into master field----------------------------------------------------------------
In HumanIndexMod.f90, I added the following line at the (I think) proper location:
type, public :: humanindex_type
real(r8), pointer :: vap_ref2m_r_patch (:) ! Patch Rural 2 m height vapor pressure (Pa)
real(r8), pointer :: vap_ref2m_u_patch (:) ! Patch Urban 2 m height vapor pressure (Pa)
------------------------------------------------------------------------------
begp = bounds%begp; endp= bounds%endp
allocate(this%vap_ref2m_patch (begp:endp)) ; this%vap_ref2m_patch (:) = nan
allocate(this%vap_ref2m_r_patch (begp:endp)) ; this%vap_ref2m_r_patch (:) = nan
allocate(this%vap_ref2m_u_patch (begp:endp)) ; this%vap_ref2m_u_patch (:) = nan
------------------------------------------------------------------------------
this%vap_ref2m_u_patch(begp:endp) = spval
call hist_addfld1d (fname='VAPOR_PRES_U', units='Pa', &
avgflag='A', long_name='Urban 2 m vapor pressure', &
ptr_patch=this%vap_ref2m_u_patch, set_nourb=spval)
this%vap_ref2m_r_patch(begp:endp) = spval
call hist_addfld1d (fname='VAPOR_PRES_R', units='Pa', &
avgflag='A', long_name='Rural 2 m vapor pressure', &
ptr_patch=this%vap_ref2m_r_patch, set_spec=spval)


In FrictionVelocityMod.f90, I added the following line at the (I think) proper location:
type, public :: frictionvel_type
real(r8), pointer, public :: fv_u_patch (:) ! Urban patch friction velocity (m/s) (for dust model)
real(r8), pointer, public :: fv_r_patch (:) ! Rural patch friction velocity (m/s) (for dust model)
------------------------------------------------------------------------------
begp = bounds%begp; endp= bounds%endp
begc = bounds%begc; endc= bounds%endc
allocate(this%fv_u_patch (begp:endp)) ; this%fv_u_patch (:) = nan
allocate(this%fv_r_patch (begp:endp)) ; this%fv_r_patch (:) = nan
------------------------------------------------------------------------------
this%fv_u_patch(begp:endp) = spval
call hist_addfld1d (fname='FV_U', units='m/s', &
avgflag='A', long_name='Urban friction velocity for dust model', &
ptr_patch=this%fv_u_patch, set_nourb=spval,default='inactive')
this%fv_r_patch(begp:endp) = spval
call hist_addfld1d (fname='FV_R', units='m/s', &
avgflag='A', long_name='Rural friction velocity for dust model', &
ptr_patch=this%fv_r_patch, set_spec=spval,default='inactive')

(Note that I move these two hist_addfld1d functions which add FV_U and FV_R into master field out of if(use_cn) block, because I am using I2000Clm50SpGs compsets. Is it alright to just ignore this if-block?)

Any opinion or suggestions are very much appreciated! Thank you!!
 

Attachments

  • BareGroundFluxesMod.txt
    32.7 KB · Views: 1
  • CanopyFluxesMod.txt
    82.5 KB · Views: 0
  • FrictionVelocityMod.txt
    38.3 KB · Views: 0
  • HumanIndexMod.txt
    60.7 KB · Views: 0
  • UrbanFluxesMod.txt
    66.5 KB · Views: 0
Status
Not open for further replies.
Top