Skip to content

Commit

Permalink
Update FATES submodule to aa3b3b931.
Browse files Browse the repository at this point in the history
Branch edge-area-202410: Fix and rename edge forest bin variables.
  • Loading branch information
samsrabin committed Oct 18, 2024
1 parent 0ad1c73 commit 2555078
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
[submodule "fates"]
path = src/fates
url = https://github.com/samsrabin/fates
fxtag = 60191cf4e5db9bea30170c35eb2f7ea1a6b90439 # isforest-20241016: Combine isforest functions into one.
fxtag = aa3b3b931bbb8199c21dd175fe2b2c9ddbf67d09 # edge-area-202410: Fix and rename edge forest bin variables.
fxrequired = AlwaysRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/NCAR/fates-release
Expand Down
2 changes: 1 addition & 1 deletion bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<!-- FATES default parameter file -->
<!-- ================================================================== -->

<fates_paramfile>/glade/u/home/samrabin/ctsm_fates-isforest/src/fates/parameter_files/fates_params_default.cdd58546a.nc</fates_paramfile>
<fates_paramfile>/glade/u/home/samrabin/ctsm_fates-isforest/src/fates/parameter_files/fates_params_default.5abc67356.nc</fates_paramfile>

<!-- ================================================================== -->
<!-- Default surface roughness parameterization -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ hist_fincl1 = 'FATES_TLONGTERM',
'FATES_IS_FOREST_PCT10', 'FATES_IS_FOREST_PCT10_0GRASS', 'FATES_IS_FOREST_PCT25',
'FATES_IS_FOREST_PCT25_0GRASS', 'FATES_IS_FOREST_PCT50', 'FATES_IS_FOREST_PCT50_0GRASS',
'FATES_IS_FOREST_PCT75', 'FATES_IS_FOREST_PCT75_0GRASS', 'FATES_IS_FOREST_PCT90',
'FATES_IS_FOREST_PCT90_0GRASS'
'FATES_IS_FOREST_PCT90_0GRASS', 'FATES_FOREST_AREA_EB'
8 changes: 8 additions & 0 deletions src/main/histFileMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module histFileMod
use EDParamsMod , only : nclmax
use EDParamsMod , only : nlevleaf
use FatesInterfaceTypesMod , only : nlevsclass, nlevage, nlevcoage
use FatesInterfaceTypesMod , only : nlevedgeforest
use FatesInterfaceTypesMod , only : nlevheight
use FatesInterfaceTypesMod , only : nlevdamage
use FatesConstantsMod , only : n_landuse_cats
Expand Down Expand Up @@ -2500,6 +2501,7 @@ subroutine htape_create (t, histrest)
call ncd_defdim(lnfid, 'fates_levcacls', nlevcoage, dimid)
call ncd_defdim(lnfid, 'fates_levpft', numpft_fates, dimid)
call ncd_defdim(lnfid, 'fates_levage', nlevage, dimid)
call ncd_defdim(lnfid, 'fates_levedge', nlevedgeforest, dimid)
call ncd_defdim(lnfid, 'fates_levheight', nlevheight, dimid)
call ncd_defdim(lnfid, 'fates_levfuel', nfsc, dimid)
call ncd_defdim(lnfid, 'fates_levcwdsc', ncwd, dimid)
Expand Down Expand Up @@ -3041,6 +3043,7 @@ subroutine htape_timeconst(t, mode)
use FatesInterfaceTypesMod, only : fates_hdim_pfmap_levcapf
use FatesInterfaceTypesMod, only : fates_hdim_camap_levcapf
use FatesInterfaceTypesMod, only : fates_hdim_levage
use FatesInterfaceTypesMod, only : fates_hdim_levedge
use FatesInterfaceTypesMod, only : fates_hdim_levheight
use FatesInterfaceTypesMod, only : fates_hdim_levpft
use FatesInterfaceTypesMod, only : fates_hdim_scmap_levscag
Expand Down Expand Up @@ -3191,6 +3194,8 @@ subroutine htape_timeconst(t, mode)
long_name='FATES cohort age index of the combined pft-cohort age dimension', units='-', ncid=nfid(t))
call ncd_defvar(varname='fates_levage',xtype=tape(t)%ncprec, dim1name='fates_levage', &
long_name='FATES patch age (yr)', ncid=nfid(t))
call ncd_defvar(varname='fates_levedge',xtype=tape(t)%ncprec, dim1name='fates_levedge', &
long_name='FATES edge number', ncid=nfid(t))
call ncd_defvar(varname='fates_levheight',xtype=tape(t)%ncprec, dim1name='fates_levheight', &
long_name='FATES height (m)', ncid=nfid(t))
call ncd_defvar(varname='fates_levpft',xtype=ncd_int, dim1name='fates_levpft', &
Expand Down Expand Up @@ -3304,6 +3309,7 @@ subroutine htape_timeconst(t, mode)
call ncd_io(varname='fates_pftmap_levcapf',data=fates_hdim_pfmap_levcapf, ncid=nfid(t), flag='write')
call ncd_io(varname='fates_camap_levcapf',data=fates_hdim_camap_levcapf, ncid=nfid(t), flag='write')
call ncd_io(varname='fates_levage',data=fates_hdim_levage, ncid=nfid(t), flag='write')
call ncd_io(varname='fates_levedge',data=fates_hdim_levedge, ncid=nfid(t), flag='write')
call ncd_io(varname='fates_levheight',data=fates_hdim_levheight, ncid=nfid(t), flag='write')
call ncd_io(varname='fates_levpft',data=fates_hdim_levpft, ncid=nfid(t), flag='write')
call ncd_io(varname='fates_levfuel',data=fates_hdim_levfuel, ncid=nfid(t), flag='write')
Expand Down Expand Up @@ -5589,6 +5595,8 @@ subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out,
num2d = numpft_fates
case ('fates_levage')
num2d = nlevage
case ('fates_levedge')
num2d = nlevedgeforest
case ('fates_levheight')
num2d = nlevheight
case ('fates_levfuel')
Expand Down
7 changes: 6 additions & 1 deletion src/utils/clmfates_interfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3284,6 +3284,7 @@ subroutine init_history_io(this,bounds_proc)
use FatesIOVariableKindMod, only : site_elcwd_r8, site_elage_r8, site_agefuel_r8
use FatesIOVariableKindMod, only : site_cdpf_r8, site_cdsc_r8, site_clscpf_r8
use FatesIOVariableKindMod, only : site_landuse_r8, site_lulu_r8
use FatesIOVariableKindMod, only : site_edgebin_r8
use FatesIODimensionsMod, only : fates_bounds_type


Expand Down Expand Up @@ -3389,7 +3390,7 @@ subroutine init_history_io(this,bounds_proc)
site_scagpft_r8, site_agepft_r8, site_elem_r8, site_elpft_r8, &
site_elcwd_r8, site_elage_r8, site_agefuel_r8, &
site_cdsc_r8, site_cdpf_r8, &
site_landuse_r8, site_lulu_r8)
site_landuse_r8, site_lulu_r8, site_edgebin_r8)


d_index = fates_hist%dim_kinds(dk_index)%dim2_index
Expand Down Expand Up @@ -3646,6 +3647,7 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates)

use FatesIODimensionsMod, only : fates_bounds_type
use FatesInterfaceTypesMod, only : nlevsclass, nlevage, nlevcoage
use FatesInterfaceTypesMod, only : nlevedgeforest
use FatesInterfaceTypesMod, only : nlevheight
use FatesInterfaceTypesMod, only : nlevdamage
use FatesLitterMod, only : nfsc
Expand Down Expand Up @@ -3687,6 +3689,9 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates)
fates%age_class_begin = 1
fates%age_class_end = nlevage

fates%edgeforest_class_begin = 1
fates%edgeforest_class_end = nlevedgeforest

fates%height_begin = 1
fates%height_end = nlevheight

Expand Down

0 comments on commit 2555078

Please sign in to comment.