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

Update column weighting upon disturbance #4

Open
3 tasks
Tracked by #2
glemieux opened this issue Mar 27, 2024 · 1 comment
Open
3 tasks
Tracked by #2

Update column weighting upon disturbance #4

glemieux opened this issue Mar 27, 2024 · 1 comment

Comments

@glemieux
Copy link

glemieux commented Mar 27, 2024

The column weight for the various upstream types will need to the have the weights updated when a given soil column is disturbed.

See compute_higher_order_weights for reference:

do l = bounds%begl, bounds%endl
t = lun_pp%topounit(l)
lun_pp%wtgcell(l) = lun_pp%wttopounit(l) * top_pp%wtgcell(t)
end do
do c = bounds%begc, bounds%endc
l = col_pp%landunit(c)
col_pp%wttopounit(c) = col_pp%wtlunit(c) * lun_pp%wttopounit(l)
col_pp%wtgcell(c) = col_pp%wtlunit(c) * lun_pp%wtgcell(l)
end do
do p = bounds%begp, bounds%endp
c = veg_pp%column(p)
veg_pp%wtlunit(p) = veg_pp%wtcol(p) * col_pp%wtlunit(c)
veg_pp%wttopounit(p) = veg_pp%wtcol(p) * col_pp%wttopounit(c)
veg_pp%wtgcell(p) = veg_pp%wtcol(p) * col_pp%wtgcell(c)
end do
end subroutine compute_higher_order_weights

Note: lun_pp type is landunit_physical_properties

Tasks

Preview Give feedback
@glemieux
Copy link
Author

glemieux commented Mar 27, 2024

Note that the HLMs seem to have moved towards only using the no_special version of update_column_state:

! NOTE(wjs, 2017-02-24) The implementation involves a few levels of calls to get to the
! real work routine (update_column_state). This design made sense (in terms of removing
! code duplication) when there were a number of "front-end" routines, with different
! special handling. But now it seems we're moving towards having no special handling.
! If we ditch all of the special handling, we could also ditch these extra levels. This
! would make the code more straightforward, and would also improve performance.

A search through the dynColumnStateUpdatedMod module appears to confirm this. Additionally, the calls are never made by passing fractional_area. For example:

call update_column_state_no_special_handling( column_state_updater , &
bounds = bounds, &
clump_index = clump_index, &
var = decomp_cpools_vr(begc:endc, j, l), &
adjustment = adjustment_one_level(begc:endc))

As such, the gridcell column weight is used to determine the state update using the column_state_updater_type variable area_gained_col. Here is where gain is calculated:

this%cwtgcell_new(c) = col_pp%wtgcell(c)
this%area_gained_col(c) = this%cwtgcell_new(c) - this%cwtgcell_old(c)
if (this%area_gained_col(c) /= 0._r8) then
this%any_changes(clump_index) = .true.
end if

Note that the grid cell weight is also directly used in the state update:

if (fractional_area_new(c) /= 0._r8) then
var(c) = (this%cwtgcell_old(c) * var(c) * fractional_area_old(c) + mass_gained) / &
(this%cwtgcell_new(c) * fractional_area_new(c))
end if

Note that fractional_area_new is always one since it's never been used as an input (old as well):

if (present(fractional_area_new)) then
my_fractional_area_new(bounds%begc:bounds%endc) = fractional_area_new(bounds%begc:bounds%endc)
else
my_fractional_area_new(bounds%begc:bounds%endc) = 1._r8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant