Skip to content

Commit

Permalink
Merge pull request #2 from glemieux/cross_grid_glemieux
Browse files Browse the repository at this point in the history
Update to `sci.1.57.2_api.23.0.0` and add distance utilities
  • Loading branch information
YanlanLiu authored Aug 4, 2022
2 parents 715f3b5 + 8186d50 commit fda77af
Show file tree
Hide file tree
Showing 57 changed files with 23,616 additions and 17,457 deletions.
Binary file added .github/images/logo_fates_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/logo_fates_medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/logo_fates_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# FATES

![FATES_logo](.github/images/logo_fates_small.png)
------------------------------
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3825473.svg)](https://doi.org/10.5281/zenodo.3825473)

This repository holds the Functionally Assembled Terrestrial Ecosystem Simulator (FATES). FATES is a numerical terrestrial ecosystem model. Its development and support is primarily supported by the Department of Energy's Office of Science, through the Next Generation Ecosystem Experiment - Tropics ([NGEE-T](https://ngee-tropics.lbl.gov/)) project.

For more information on the FATES model, see our [wiki](https://github.com/NGEET/fates/wiki) and [technical documentation](https://fates-docs.readthedocs.io/en/latest/index.html).
For more information on the FATES model, see our [User's Guide](https://fates-users-guide.readthedocs.io/en/latest/) and [technical documentation](https://fates-docs.readthedocs.io/en/latest/index.html).


## Important Guides:
------------------------------

[User's Guide](https://fates-users-guide.readthedocs.io/en/latest/)

[How to Contribute](https://github.com/NGEET/fates/blob/master/CONTRIBUTING.md)

[List of Unsupported or Broken Features](https://github.com/NGEET/fates/wiki/Current-Unsupported-or-Broken-Features)
[Table of FATES and Host Land Model API compatability](https://fates-users-guide.readthedocs.io/en/latest/user/Table-of-FATES-API-and-HLM-STATUS.html)

[List of Unsupported or Broken Features](https://fates-users-guide.readthedocs.io/en/latest/user/Current-Unsupported-or-Broken-Features.html)

[Code of Conduct](https://github.com/NGEET/fates/blob/master/CODE_OF_CONDUCT.md)

Expand All @@ -27,8 +32,6 @@ FATES has support to be run via the Energy Exascale Earth System Model (E3SM), t
https://github.com/E3SM-Project/E3SM

https://github.com/ESCOMP/cesm
https://github.com/ESCOMP/ctsm


## Important Note About Host-Models and Compatible Branches:
------------------------------------------------------------
Expand Down
3,555 changes: 1,856 additions & 1,699 deletions biogeochem/EDCanopyStructureMod.F90

Large diffs are not rendered by default.

918 changes: 485 additions & 433 deletions biogeochem/EDCohortDynamicsMod.F90

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions biogeochem/EDLoggingMortalityMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module EDLoggingMortalityMod
use EDParamsMod , only : logging_mechanical_frac
use EDParamsMod , only : logging_coll_under_frac
use EDParamsMod , only : logging_dbhmax_infra
use FatesInterfaceTypesMod , only : bc_in_type
use FatesInterfaceTypesMod , only : hlm_current_year
use FatesInterfaceTypesMod , only : hlm_current_month
use FatesInterfaceTypesMod , only : hlm_current_day
Expand Down Expand Up @@ -72,7 +73,8 @@ module EDLoggingMortalityMod
logical, protected :: logging_time ! If true, logging should be
! performed during the current time-step


logical, parameter :: debug = .false.

! harvest litter localization specifies how much of the litter from a falling
! tree lands within the newly generated patch, and how much lands outside of
! the new patch, and thus in the original patch. By setting this to zero,
Expand Down Expand Up @@ -257,7 +259,7 @@ subroutine LoggingMortality_frac( pft_i, dbh, canopy_layer, lmort_direct, &

! transfer of area to secondary land is based on overall area affected, not just logged crown area
! l_degrad accounts for the affected area between logged crowns
if(int(prt_params%woody(pft_i)) == 1)then ! only set logging rates for trees
if(prt_params%woody(pft_i) == itrue)then ! only set logging rates for trees

! direct logging rates, based on dbh min and max criteria
if (dbh >= logging_dbhmin .and. .not. &
Expand Down Expand Up @@ -394,7 +396,7 @@ end subroutine get_harvest_rate_area

! ============================================================================

subroutine logging_litter_fluxes(currentSite, currentPatch, newPatch, patch_site_areadis)
subroutine logging_litter_fluxes(currentSite, currentPatch, newPatch, patch_site_areadis, bc_in)

! -------------------------------------------------------------------------------------------
!
Expand Down Expand Up @@ -440,6 +442,8 @@ subroutine logging_litter_fluxes(currentSite, currentPatch, newPatch, patch_site
type(ed_patch_type) , intent(inout), target :: currentPatch
type(ed_patch_type) , intent(inout), target :: newPatch
real(r8) , intent(in) :: patch_site_areadis
type(bc_in_type) , intent(in) :: bc_in


!LOCAL VARIABLES:
type(ed_cohort_type), pointer :: currentCohort
Expand Down Expand Up @@ -539,7 +543,7 @@ subroutine logging_litter_fluxes(currentSite, currentPatch, newPatch, patch_site
! plants that were impacted. Thus, no direct dead can occur
! here, and indirect are impacts.

if(int(prt_params%woody(pft)) == itrue) then
if(prt_params%woody(pft) == itrue) then
direct_dead = 0.0_r8
indirect_dead = logging_coll_under_frac * &
(1._r8-currentPatch%fract_ldist_not_harvested) * currentCohort%n * &
Expand Down Expand Up @@ -567,7 +571,9 @@ subroutine logging_litter_fluxes(currentSite, currentPatch, newPatch, patch_site
! derived from the current patch, so we need to multiply by patch_areadis/np%area
! ----------------------------------------------------------------------------------------

call set_root_fraction(currentSite%rootfrac_scr, pft, currentSite%zi_soil)
call set_root_fraction(currentSite%rootfrac_scr, pft, &
currentSite%zi_soil, &
bc_in%max_rooting_depth_index_col)

ag_wood = (direct_dead+indirect_dead) * (struct_m + sapw_m ) * &
prt_params%allom_agb_frac(currentCohort%pft)
Expand Down
16 changes: 11 additions & 5 deletions biogeochem/EDMortalityFunctionsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ module EDMortalityFunctionsMod

use FatesConstantsMod , only : r8 => fates_r8
use FatesGlobals , only : fates_log
use FatesGlobals , only : endrun => fates_endrun
use FatesGlobals , only : fates_log
use EDPftvarcon , only : EDPftvarcon_inst
use EDTypesMod , only : ed_cohort_type
use EDTypesMod , only : ed_site_type
Expand All @@ -19,14 +21,18 @@ module EDMortalityFunctionsMod
use FatesInterfaceTypesMod , only : hlm_use_planthydro
use EDLoggingMortalityMod , only : LoggingMortality_frac
use EDParamsMod , only : fates_mortality_disturbance_fraction
use FatesInterfaceTypesMod , only : bc_in_type

use PRTGenericMod, only : all_carbon_elements
use PRTGenericMod, only : store_organ

use shr_log_mod , only : errMsg => shr_log_errMsg

implicit none
private


logical, parameter :: debug = .false.
character(len=*), parameter, private :: sourcefile = &
__FILE__

public :: mortality_rates
public :: Mortality_Derivative
Expand Down Expand Up @@ -62,7 +68,6 @@ subroutine mortality_rates( cohort_in,bc_in,cmort,hmort,bmort,frmort,smort,asmor
real(r8),intent(out) :: smort ! size dependent senescence term
real(r8),intent(out) :: asmort ! age dependent senescence term

integer :: ifp
real(r8) :: frac ! relativised stored carbohydrate
real(r8) :: leaf_c_target ! target leaf biomass kgC
real(r8) :: store_c
Expand Down Expand Up @@ -165,6 +170,7 @@ subroutine mortality_rates( cohort_in,bc_in,cmort,hmort,bmort,frmort,smort,asmor
else
write(fates_log(),*) 'dbh problem in mortality_rates', &
cohort_in%dbh,cohort_in%pft,cohort_in%n,cohort_in%canopy_layer
call endrun(msg=errMsg(sourcefile, __LINE__))
endif
!--------------------------------------------------------------------------------
! Mortality due to cold and freezing stress (frmort), based on ED2 and:
Expand All @@ -173,8 +179,8 @@ subroutine mortality_rates( cohort_in,bc_in,cmort,hmort,bmort,frmort,smort,asmor
! Eastern US carbon sink. Glob. Change Biol., 12, 2370-2390,
! doi: 10.1111/j.1365-2486.2006.01254.x

ifp = cohort_in%patchptr%patchno
temp_in_C = bc_in%t_veg24_pa(ifp) - tfrz
temp_in_C = cohort_in%patchptr%tveg24%GetMean() - tfrz

temp_dep_fraction = max(0.0_r8, min(1.0_r8, 1.0_r8 - (temp_in_C - &
EDPftvarcon_inst%freezetol(cohort_in%pft))/frost_mort_buffer) )
frmort = EDPftvarcon_inst%mort_scalar_coldstress(cohort_in%pft) * temp_dep_fraction
Expand Down
Loading

0 comments on commit fda77af

Please sign in to comment.