Skip to content

Commit

Permalink
update elm build namelist for fates luh2
Browse files Browse the repository at this point in the history
  • Loading branch information
glemieux committed Aug 9, 2023
1 parent 4d2712a commit bd88d1c
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 2 deletions.
10 changes: 8 additions & 2 deletions components/elm/bld/ELMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -786,9 +786,9 @@ sub setup_cmdl_fates_mode {
# no need to set defaults, covered in a different routine
my @list = ( "fates_spitfire_mode", "use_vertsoilc", "use_century_decomp",
"use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys",
"use_fates_inventory_init", "use_fates_fixed_biogeog", "use_fates_nocomp","use_fates_sp",
"use_fates_inventory_init", "use_fates_fixed_biogeog", "use_fates_nocomp","use_fates_sp",
"fates_inventory_ctrl_filename","use_fates_logging", "use_fates_tree_damage",
"use_fates_parteh_mode","use_fates_cohort_age_tracking","use_snicar_ad");
"use_fates_parteh_mode","use_fates_cohort_age_tracking","use_snicar_ad", "use_fates_luh");
foreach my $var ( @list ) {
if ( defined($nl->get_value($var)) ) {
$nl_flags->{$var} = $nl->get_value($var);
Expand Down Expand Up @@ -848,6 +848,10 @@ sub setup_cmdl_fates_mode {
if ( defined($nl->get_value($var)) ) {
fatal_error("$var is being set, but can ONLY be set when -bgc fates option is used.\n");
}
$var = "use_fates_luh";
if ( defined($nl->get_value($var)) ) {
fatal_error("$var is being set, but can ONLY be set when -bgc fates option is used.\n");
}
$var = "fates_inventory_ctrl_filename";
if ( defined($nl->get_value($var)) ) {
fatal_error("$var is being set, but can ONLY be set when -bgc fates option is used.\n");
Expand Down Expand Up @@ -3173,7 +3177,9 @@ sub setup_logic_fates {
add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_sp', 'use_fates'=>$nl_flags->{'use_fates'});
add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_nocomp', 'use_fates'=>$nl_flags->{'use_fates'});
add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_tree_damage', 'use_fates'=>$nl_flags->{'use_fates'});
add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_luh', 'use_fates'=>$nl_flags->{'use_fates'});
add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fates_paramfile', 'phys'=>$nl_flags->{'phys'});
add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fluh_timeseries', 'phys'=>$nl_flags->{'phys'});

}
}
Expand Down
7 changes: 7 additions & 0 deletions components/elm/bld/namelist_files/namelist_defaults.xml
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,12 @@ lnd/clm2/surfdata_map/surfdata_conusx4v1_simyr2000_c160503.nc</fsurdat>
<flanduse_timeseries hgrid="ne30np4" rcp="2.6" sim_year_range="1850-2100"
use_crop=".false." >lnd/clm2/surfdata_map/surfdata.pftdyn_ne30np4_rcp2.6_simyr1850-2100_c130524.nc</flanduse_timeseries>

<!-- Land Use Harmonization unified data sets for dynamic FATES land use change -->

<fluh_timeseries hgrid="4x5" sim_year_range="1850-2015" use_cn=".false."
use_crop=".false." >lnd/clm2/luh/LUH2_states_transitions_management.timeseries_4x5_hist_simyr1850-2015_c230415.nc</fluh_timeseries>


<!-- GLC mask datasets (relative to {csmdata}) -->
<!-- Currently glc_grid is not being read from anywhere, so these rules are broken. -->
<!-- Until that is fixed, the first entry matching hgrid will be used. -->
Expand Down Expand Up @@ -2088,6 +2094,7 @@ this mask will have smb calculated over the entire global land surface
<use_fates_logging use_fates=".true.">.false.</use_fates_logging>
<use_fates_cohort_age_tracking use_fates=".true.">.false.</use_fates_cohort_age_tracking>
<use_fates_sp use_fates=".true.">.false.</use_fates_sp>
<use_fates_luh use_fates=".true.">.false.</use_fates_luh>
<fates_parteh_mode use_fates=".true.">1</fates_parteh_mode>
<use_fates_inventory_init use_fates=".true.">.false.</use_fates_inventory_init>
<fates_inventory_ctrl_filename use_fates=".true."> "/dev/null" </fates_inventory_ctrl_filename>
Expand Down
13 changes: 13 additions & 0 deletions components/elm/bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,12 @@ Full pathname of time varying PFT data file. This causes the land-use types of
the initial surface dataset to vary over time.
</entry>

<entry id="fluh_timeseries" type="char*256" category="datasets"
input_pathname="abs" group="dynamic_subgrid" valid_values="" >
Full pathname of unified land use harmonization data file. This causes the land-use
types to vary over time.
</entry>

<entry id="fsurdat" type="char*256" category="datasets"
input_pathname="abs" group="elm_inparm" valid_values="" >
Full pathname of surface data file.
Expand Down Expand Up @@ -1742,6 +1748,13 @@ If TRUE, apply harvest from flanduse_timeseries file.
(Also, only valid for use_cn = true.)
</entry>

<entry id="use_fates_luh" type="logical" category="physics"
group="dynamic_subgrid" valid_values="" >
If TRUE, enable use of land use state and transition data from luh_timeseries file.
(Only valid for fates land use change runs, where there is a luh_timeseries file.)
(Also, only valid for use_fates = true and is incompatible with transient runs currently.)
</entry>

<!-- ======================================================================================== -->
<!-- Namelist options related to finidat consistency checks -->
<!-- ======================================================================================== -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ module dynFATESLandUseChangeMod
'c3nfx_to_secdf','c3nfx_to_secdn','c3nfx_to_pastr','c3nfx_to_range','c3nfx_to_urban']

type(dyn_var_time_uninterp_type) :: landuse_transition_vars(num_landuse_transition_vars) ! value of each landuse variable
type(dyn_var_time_uninterp_type) :: landuse_state_vars(num_landuse_state_vars) ! value of each landuse variable

public :: dynFatesLandUseInit
public :: dynFatesLandUseInterp
Expand Down
3 changes: 3 additions & 0 deletions components/elm/src/main/controlMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ subroutine control_init( )
use_fates_nocomp, &
use_fates_sp, &
use_fates_luh, &
fluh_timeseries, &
fates_parteh_mode, &
use_fates_tree_damage

Expand Down Expand Up @@ -767,6 +768,7 @@ subroutine control_spmd()

call mpi_bcast (fates_spitfire_mode, 1, MPI_INTEGER, 0, mpicom, ier)
call mpi_bcast (fates_paramfile, len(fates_paramfile) , MPI_CHARACTER, 0, mpicom, ier)
call mpi_bcast (fluh_timeseries, len(fluh_timeseries) , MPI_CHARACTER, 0, mpicom, ier)
call mpi_bcast (use_fates_logging, 1, MPI_LOGICAL, 0, mpicom, ier)
call mpi_bcast (use_fates_planthydro, 1, MPI_LOGICAL, 0, mpicom, ier)
call mpi_bcast (use_fates_cohort_age_tracking, 1, MPI_LOGICAL, 0, mpicom, ier)
Expand Down Expand Up @@ -1175,6 +1177,7 @@ subroutine control_print ()
write(iulog, *) ' fates_spitfire_mode = ', fates_spitfire_mode
write(iulog, *) ' use_fates_logging = ', use_fates_logging
write(iulog, *) ' fates_paramfile = ', fates_paramfile
write(iulog, *) ' fluh_timeseries = ', fluh_timeseries
write(iulog, *) ' use_fates_planthydro = ', use_fates_planthydro
write(iulog, *) ' use_fates_tree_damage = ', use_fates_tree_damage
write(iulog, *) ' use_fates_cohort_age_tracking = ',use_fates_cohort_age_tracking
Expand Down
6 changes: 6 additions & 0 deletions components/elm/src/main/elm_initializeMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ subroutine initialize2( )
use clm_time_manager , only : get_curr_date, get_nstep, advance_timestep
use clm_time_manager , only : timemgr_init, timemgr_restart_io, timemgr_restart
use controlMod , only : nlfilename
use controlMod , only : fluh_timeseries
use decompMod , only : get_proc_clumps, get_proc_bounds, get_clump_bounds, bounds_type
use domainMod , only : ldomain
use initInterpMod , only : initInterp
Expand Down Expand Up @@ -733,6 +734,11 @@ subroutine initialize2( )
call dynSubgrid_init(bounds_proc, glc2lnd_vars, crop_vars)
call t_stopf('init_dyn_subgrid')

! Initialize fates LUH2 usage
if (use_fates_luh) then
call dynFatesLandUseInit(bounds_proc, fluh_timeseries)
end if

! ------------------------------------------------------------------------
! Initialize modules (after time-manager initialization in most cases)
! ------------------------------------------------------------------------
Expand Down

0 comments on commit bd88d1c

Please sign in to comment.