-
Notifications
You must be signed in to change notification settings - Fork 296
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
Clean up CanopyHydrology #503
Comments
Refactoring snow cover fraction calculations in CanopyHydrology We'll keep in place the original fsca formulation (n&y 07) - probably giving it a better name than just origfflag [edit (2019-04-24) I think this meant 'oldfflag' rather than 'origfflag']. Note that that is the form used in Noah-MP. Note that, the way things are currently structured, it does the new frac_sno calculation, then possibly overwrites it with the old. And note that there are order differences for the new vs. old: New needs to compute Then this will be lumped with the FSCA block above it: whereas this will be lumped with the "original fsca formulation" below it: i.e., it is currently assumed that subgridflag==1 is combined with oldfflag==0, and vice versa (see also #502 ). So we'll end up with code that looks like this: select case (snow_cover_frac_method)
case (method_snow_cover_frac_clm5)
call snow_cover_frac_clm5(..., frac_sno, snow_depth)
case (method_snow_cover_frac_niu)
call snow_cover_frac_niu(..., frac_sno, snow_depth)
end select
subroutine snow_cover_frac_clm5(..., frac_sno, snow_depth)
! First, compute frac_sno
! Hmmmm, need to determine what to do about the lun%urbpoi check in the current code.
! (I feel like we had to deal with something similar for soil hydrology - i.e., urban
! always working the old way. Check how we handled that.)
if (frac_sno(c) > 0._r8)then
snow_depth(c)=snow_depth(c) + newsnow(c)/(bifall(c) * frac_sno(c))
else
snow_depth(c)=0._r8
end if
end subroutine snow_cover_frac_clm5
subroutine snow_cover_frac_niu(..., frac_sno, snow_depth)
snow_depth(c)=snow_depth(c)+newsnow(c)/bifall(c)
! Then compute frac_sno
end subroutine snow_cover_frac_niu |
The part that actually deals with canopy hydrology is done (will come to master in ctsm1.0.dev041). The other pieces (fractions and snow initialization) still need to be done. |
Add water tracers to CanopyHydrologyMod Major overhaul of CanopyHydrologyMod in order to support water tracers. The part of CanopyHydrology that was actually dealing with canopy hydrology has now been broken out into a number of small routines in order to separate flux calculations from state updates. This is needed in order to calculate tracer versions of the relevant variables, which is now done here. The parts of CanopyHydrology that were NOT dealing with canopy hydrology have been moved to more appropriate homes. They have not yet been tracerized, but will be soon. This also makes some minor changes to diagnostic fields related to canopy hydrology. Of particular note: QDRIP now has a different meaning: it now corresponds to the excess liquid water that runs off from the canopy (and is inactive by default). The design of this broken-out code was developed in consultation with Mike Barlage, Erik Kluzek, Negin Sobhani, Sean Swenson and Mariana Vertenstein. We plan to apply this design moving forward to other parts of the code that need tracerization. See also <https://github.com/billsacks/prototypes-ctsm-canopyhydrology_tracers>. - Resolves #360 - Implement water isotopes for CanopyHydrology - Resolves #709 - QDRIP diagnostic field misleadingly named - Partially addresses #503 - Clean up CanopyHydrology (We still need to clean up / tracerize the parts that have now been moved elsewhere.)
Add water tracers to CanopyHydrologyMod Major overhaul of CanopyHydrologyMod in order to support water tracers. The part of CanopyHydrology that was actually dealing with canopy hydrology has now been broken out into a number of small routines in order to separate flux calculations from state updates. This is needed in order to calculate tracer versions of the relevant variables, which is now done here. The parts of CanopyHydrology that were NOT dealing with canopy hydrology have been moved to more appropriate homes. They have not yet been tracerized, but will be soon. This also makes some minor changes to diagnostic fields related to canopy hydrology. Of particular note: QDRIP now has a different meaning: it now corresponds to the excess liquid water that runs off from the canopy (and is inactive by default). The design of this broken-out code was developed in consultation with Mike Barlage, Erik Kluzek, Negin Sobhani, Sean Swenson and Mariana Vertenstein. We plan to apply this design moving forward to other parts of the code that need tracerization. See also <https://github.com/billsacks/prototypes-ctsm-canopyhydrology_tracers>. - Resolves ESCOMP#360 - Implement water isotopes for CanopyHydrology - Resolves ESCOMP#709 - QDRIP diagnostic field misleadingly named - Partially addresses ESCOMP#503 - Clean up CanopyHydrology (We still need to clean up / tracerize the parts that have now been moved elsewhere.) Conflicts: src/biogeophys/CanopyHydrologyMod.F90
Modularize snow cover fraction method This tag moves the calculation of frac_sno - and the related updates of snow_depth - into a new set of classes, with one class for each parameterization (Niu & Yang 2007 and Swenson & Lawrence 2012). Previously, the code always calculated frac_sno the new way, but then possibly overwrote it if using the older Niu & Yang method. The new code cleans this up, only doing the calculations that are needed for each method. In addition, other code that is specific to one of the two methods is now moved to a home that makes this dependence on method explicit. This includes the addition of newsnow to int_snow: previously, int_snow was always updated using an equation specific to the newer CLM5 parameterization of frac_sno, which was not appropriate if using the Niu & Yang parameterization; this doesn't make a difference currently, since int_snow is only referenced if using the Swenson & Lawrence parameterization, but this clears up some confusion. Also, time-constant parameters read from namelist or the netCDF parameter file now reside in the appropriate class rather than being more global. This tag also renames two namelist options to increase clarity: - subgridflag is renamed to use_subgrid_fluxes, and is now a logical - oldfflag is renamed to snow_cover_fraction_method, and is now a string Resolves #502 Resolves #503 Resolves #571
Before implementing water isotopes in CanopyHydrology (#360 ), there is some general cleanup that needs to be done.
First, we should probably separate this into at least three routines:
We'll separate flux calculations from state updates so that we can make tracer update calls at the appropriate points.
For now, we'll keep state updates in this module, done at the point where they are currently done (though in separate subroutines). Later, we might merge some state updates (which would change answers).
The text was updated successfully, but these errors were encountered: