diff --git a/Externals.cfg b/Externals.cfg
index 8fdff0ac4b..881b4e6ee7 100644
--- a/Externals.cfg
+++ b/Externals.cfg
@@ -8,7 +8,7 @@ required = True
local_path = components/cism
protocol = git
repo_url = https://github.com/ESCOMP/CISM-wrapper
-tag = cism2_1_78
+tag = cismwrap_2_1_83
externals = Externals_CISM.cfg
required = True
@@ -37,21 +37,22 @@ required = True
local_path = cime
protocol = git
repo_url = https://github.com/ESMCI/cime
-tag = branch_tags/cime5.8.42_a01
+tag = branch_tags/cime5.8.47_a01
required = True
[cmeps]
local_path = cime/src/drivers/nuopc/
protocol = git
repo_url = https://github.com/ESCOMP/CMEPS.git
-tag = v0.9.0
+tag = cmeps0.13.2
required = True
[cdeps]
local_path = components/cdeps
protocol = git
repo_url = https://github.com/ESCOMP/CDEPS.git
-tag = v0.6.0
+tag = cdeps0.12.11
+externals = Externals_CDEPS.cfg
required = True
[doc-builder]
diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg
index 4551c8a634..e24b102da1 100644
--- a/Externals_CLM.cfg
+++ b/Externals_CLM.cfg
@@ -2,7 +2,7 @@
local_path = src/fates
protocol = git
repo_url = https://github.com/NGEET/fates
-tag = sci.1.45.0_api.15.0.0
+tag = sci.1.46.2_api.16.1.0
required = True
[PTCLM]
diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm
index 359909f94b..d4575c4462 100755
--- a/bld/CLMBuildNamelist.pm
+++ b/bld/CLMBuildNamelist.pm
@@ -83,6 +83,7 @@ REQUIRED OPTIONS
(default 2000)
-structure "structure" The overall structure being used [ standard | fast ]
OPTIONS
+ -driver "value" mct or nuopc
-bgc "value" Build CLM with BGC package [ sp | cn | bgc | fates ]
(default is sp).
CLM Biogeochemistry mode
@@ -242,7 +243,7 @@ sub process_commandline {
# Save the command line arguments to the script. NOTE: this must be
# before GetOptions() is called because items are removed from from
# the array!
- $nl_flags->{'cmdline'} = "@ARGV";
+ $nl_flags->{'cmdline'} = "@ARGV\n";
my %opts = ( cimeroot => undef,
config => "config_cache.xml",
@@ -252,6 +253,7 @@ sub process_commandline {
co2_type => undef,
co2_ppmv => undef,
clm_demand => "null",
+ driver => "mct",
help => 0,
glc_nec => "default",
glc_use_antarctica => 0,
@@ -284,6 +286,7 @@ sub process_commandline {
GetOptions(
"cimeroot=s" => \$opts{'cimeroot'},
+ "driver=s" => \$opts{'driver'},
"clm_demand=s" => \$opts{'clm_demand'},
"co2_ppmv=f" => \$opts{'co2_ppmv'},
"co2_type=s" => \$opts{'co2_type'},
@@ -1645,11 +1648,6 @@ sub process_namelist_inline_logic {
#############################################
setup_logic_friction_vel($opts, $nl_flags, $definition, $defaults, $nl);
- ################################################
- # namelist group: century_soilbgcdecompcascade #
- ################################################
- setup_logic_century_soilbgcdecompcascade($opts, $nl_flags, $definition, $defaults, $nl);
-
#############################
# namelist group: cngeneral #
#############################
@@ -2925,15 +2923,13 @@ sub setup_logic_methane {
if ( &value_is_true($nl_flags->{'use_lch4'}) ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'finundation_method',
'use_cn'=>$nl_flags->{'use_cn'}, 'use_fates'=>$nl_flags->{'use_fates'} );
- #
- # Get resolution to read streams file for
- #
my $finundation_method = remove_leading_and_trailing_quotes($nl->get_value('finundation_method' ));
- add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'finundation_res',
- 'finundation_method'=>$finundation_method );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_ch4finundated',
- 'finundation_method'=>$finundation_method,
- 'finundation_res'=>$nl->get_value('finundation_res') );
+ 'finundation_method'=>$finundation_method);
+ if ($opts->{'driver'} eq "nuopc" ) {
+ add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_ch4finundated',
+ 'finundation_method'=>$finundation_method);
+ }
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_aereoxid_prog',
'use_cn'=>$nl_flags->{'use_cn'}, 'use_fates'=>$nl_flags->{'use_fates'} );
#
@@ -3216,7 +3212,6 @@ sub setup_logic_nitrogen_deposition {
#
# Nitrogen deposition for bgc=CN
#
-
if ( $nl_flags->{'bgc_mode'} =~/cn|bgc/ ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'ndepmapalgo', 'phys'=>$nl_flags->{'phys'},
'use_cn'=>$nl_flags->{'use_cn'}, 'hgrid'=>$nl_flags->{'res'},
@@ -3242,17 +3237,32 @@ sub setup_logic_nitrogen_deposition {
'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'},
'hgrid'=>"0.9x1.25", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'nofail'=>1 );
if ( ! defined($nl->get_value('stream_fldfilename_ndep') ) ) {
- # Also check at f19 resolution
- add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_ndep', 'phys'=>$nl_flags->{'phys'},
- 'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'},
- 'hgrid'=>"1.9x2.5", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'nofail'=>1 );
- # If not found report an error
- if ( ! defined($nl->get_value('stream_fldfilename_ndep') ) ) {
- $log->warning("Did NOT find the Nitrogen-deposition forcing file (stream_fldfilename_ndep) for this ssp_rcp\n" .
- "One way to get around this is to point to a file for another existing ssp_rcp in your user_nl_clm file.\n" .
- "If you are running with CAM and WACCM chemistry Nitrogen deposition will come through the coupler.\n" .
- "This file won't be used, so it doesn't matter what it points to -- but it's required to point to something.\n" )
- }
+ # Also check at f19 resolution
+ add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_ndep', 'phys'=>$nl_flags->{'phys'},
+ 'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'},
+ 'hgrid'=>"1.9x2.5", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'nofail'=>1 );
+ # If not found report an error
+ if ( ! defined($nl->get_value('stream_fldfilename_ndep') ) ) {
+ $log->warning("Did NOT find the Nitrogen-deposition forcing file (stream_fldfilename_ndep) for this ssp_rcp\n" .
+ "One way to get around this is to point to a file for another existing ssp_rcp in your user_nl_clm file.\n" .
+ "If you are running with CAM and WACCM chemistry Nitrogen deposition will come through the coupler.\n" .
+ "This file won't be used, so it doesn't matter what it points to -- but it's required to point to something.\n" )
+ }
+ }
+ if ($opts->{'driver'} eq "nuopc" ) {
+ add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_ndep', 'phys'=>$nl_flags->{'phys'},
+ 'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'},
+ 'hgrid'=>"0.9x1.25", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'nofail'=>1 );
+ if ( ! defined($nl->get_value('stream_fldfilename_ndep') ) ) {
+ # Also check at f19 resolution
+ add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_ndep', 'phys'=>$nl_flags->{'phys'},
+ 'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'},
+ 'hgrid'=>"1.9x2.5", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'nofail'=>1 );
+ # If not found report an error
+ if ( ! defined($nl->get_value('stream_meshfile_ndep') ) ) {
+ $log->warning("Did NOT find the Nitrogen-deposition meshfile file (stream_meshfilee_ndep) for this ssp_rcp. \n")
+ }
+ }
}
} else {
# If bgc is NOT CN/CNDV then make sure none of the ndep settings are set!
@@ -3363,6 +3373,29 @@ sub setup_logic_popd_streams {
}
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_popdens', 'phys'=>$nl_flags->{'phys'},
'cnfireson'=>$nl_flags->{'cnfireson'}, 'hgrid'=>"0.5x0.5", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'} );
+ #
+ # TODO (mvertens, 2021-06-22) the following is needed for MCT since a use case enforces this - so for now stream_meshfile_popdens will be added to the mct
+ # stream namelist but simply not used
+ if ($opts->{'driver'} eq "nuopc" ) {
+ add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_popdens', 'hgrid'=>"0.5x0.5");
+ my $inputdata_rootdir = $nl_flags->{'inputdata_rootdir'};
+ my $default_value = $nl->get_value('stream_meshfile_popdens');
+ my $none_filename = $inputdata_rootdir . '/none';
+ my $none_filename = "e_string($none_filename);
+ if ($default_value eq $none_filename) {
+ my $var = 'stream_meshfile_popdens';
+ my $group = $definition->get_group_name($var);
+ my $val = "none";
+ $val = "e_string( $val );
+ $nl->set_variable_value($group, $var, $val);
+ }
+ } else {
+ my $var = 'stream_meshfile_popdens';
+ my $group = $definition->get_group_name($var);
+ my $val = "none";
+ $val = "e_string( $val );
+ $nl->set_variable_value($group, $var, $val);
+ }
} else {
# If bgc is NOT CN/CNDV or fire_method==nofire then make sure none of the popdens settings are set
if ( defined($nl->get_value('stream_year_first_popdens')) ||
@@ -3399,6 +3432,10 @@ sub setup_logic_urbantv_streams {
}
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_urbantv', 'phys'=>$nl_flags->{'phys'},
'hgrid'=>"0.9x1.25" );
+ if ($opts->{'driver'} eq "nuopc" ) {
+ add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_urbantv', 'phys'=>$nl_flags->{'phys'},
+ 'hgrid'=>"0.9x1.25" );
+ }
}
#-------------------------------------------------------------------------------
@@ -3425,6 +3462,10 @@ sub setup_logic_lightning_streams {
}
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_lightng',
'hgrid'=>$nl_flags->{'light_res'} );
+ if ($opts->{'driver'} eq "nuopc" ) {
+ add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_lightng',
+ 'hgrid'=>$nl_flags->{'light_res'} );
+ }
} else {
# If bgc is NOT CN/CNDV then make sure none of the Lightng settings are set
if ( defined($nl->get_value('stream_year_first_lightng')) ||
@@ -3582,6 +3623,10 @@ sub setup_logic_lai_streams {
}
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_lai',
'hgrid'=>"360x720cru" );
+ if ($opts->{'driver'} eq "nuopc" ) {
+ add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_lai',
+ 'hgrid'=>"360x720cru" );
+ }
}
} else {
# If bgc is CN/CNDV then make sure none of the LAI settings are set
@@ -3621,23 +3666,6 @@ sub setup_logic_soilwater_movement {
}
#-------------------------------------------------------------------------------
-sub setup_logic_century_soilbgcdecompcascade {
- #
- my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;
-
- if ( (&value_is_true($nl->get_value('use_cn')) || &value_is_true($nl->get_value('use_fates'))) &&
- &value_is_true($nl->get_value('use_century_decomp')) ) {
- add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'initial_Cstocks',
- 'use_cn' => $nl->get_value('use_cn'), 'use_fates' => $nl->get_value('use_fates'),
- 'use_century_decomp' => $nl->get_value('use_century_decomp') );
- add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'initial_Cstocks_depth',
- 'use_cn' => $nl->get_value('use_cn'), 'use_fates' => $nl->get_value('use_fates'),
- 'use_century_decomp' => $nl->get_value('use_century_decomp') );
- }
-}
-
-#-------------------------------------------------------------------------------
-
sub setup_logic_cnvegcarbonstate {
# MUST be AFTER: setup_logic_dynamic_plant_nitrogen_alloc as depends on mm_nuptake_opt which is set there
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;
@@ -4131,7 +4159,7 @@ sub add_default {
} else {
if ($is_input_pathname eq 'abs') {
$val = set_abs_filepath($val, $inputdata_rootdir);
- if ( $test_files and ($val !~ /null/) and (! -f "$val") ) {
+ if ( $test_files and ($val !~ /null|none/) and (! -f "$val") ) {
$log->fatal_error("file not found: $var = $val");
}
}
diff --git a/bld/namelist_files/checkmapfiles.ncl b/bld/namelist_files/checkmapfiles.ncl
index c0751adcb0..f10a631f95 100644
--- a/bld/namelist_files/checkmapfiles.ncl
+++ b/bld/namelist_files/checkmapfiles.ncl
@@ -9,7 +9,7 @@
;
print( "Check that datm mapping files are consistent" );
- resolutions = (/ "128x256", "64x128", "48x96", "32x64", "8x16", "94x192", "0.23x0.31", "0.47x0.63", "0.9x1.25", "1.9x2.5", "2.5x3.33", "4x5", "10x15", "0.125nldas2", "5x5_amazon", "1x1_camdenNJ", "1x1_vancouverCAN", "1x1_mexicocityMEX", "1x1_asphaltjungleNJ", "1x1_brazil", "1x1_urbanc_alpha", "1x1_numaIA", "1x1_smallvilleIA", "ne4np4", "ne16np4", "ne30np4", "ne60np4", "ne120np4", "ne240np4" /);
+ resolutions = (/ "128x256", "64x128", "48x96", "94x192", "0.23x0.31", "0.47x0.63", "0.9x1.25", "1.9x2.5", "2.5x3.33", "4x5", "10x15", "0.125nldas2", "5x5_amazon", "1x1_camdenNJ", "1x1_vancouverCAN", "1x1_mexicocityMEX", "1x1_asphaltjungleNJ", "1x1_brazil", "1x1_urbanc_alpha", "1x1_numaIA", "1x1_smallvilleIA", "ne4np4", "ne16np4", "ne30np4", "ne60np4", "ne120np4", "ne240np4" /);
space = " ";
badres = 0
@@ -82,7 +82,7 @@ begin
print( "query string="+querynml )
- mapgrids = (/"0.5x0.5_MODIS", "0.5x0.5_AVHRR", "0.5x0.5_MODIS", "5x5min_nomask", "5x5min_IGBP-GSDP", "5x5min_ISRIC-WISE", "10x10min_nomask", "3x3min_MODIS", "3x3min_LandScan2004", "3x3min_GLOBE-Gardner", "3x3min_GLOBE-Gardner-mergeGIS", "0.9x1.25_GRDC", "360x720cru_cruncep", "1km-merge-10min_HYDRO1K-merge-nomask"/);
+ mapgrids = (/"0.5x0.5_nomask", "0.25x0.25_nomask", "0.125x0.125_nomask", "3x3min_nomask", "5x5min_nomask", "10x10min_nomask", "0.9x1.25_nomask", "1km-merge-10min_HYDRO1K-merge-nomask"/);
do i = 0, dimsizes(resolutions)-1
res = resolutions(i);
print( "Go through maps for Resolution: "+res );
diff --git a/bld/namelist_files/createMkSrfEntry.py b/bld/namelist_files/createMkSrfEntry.py
index b76e83af4d..3f12df1509 100755
--- a/bld/namelist_files/createMkSrfEntry.py
+++ b/bld/namelist_files/createMkSrfEntry.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os, sys
@@ -41,9 +41,9 @@ def parse_cmdline_args( self ):
def printentry( self, year ):
"Print a single entry"
- print 'lnd/clm2/rawdata/%s/mksrf_landuse_%s_%s.c%s.nc' % (self.subdir, self.desc, year, self.cdate)
- print '\n'
+ print( 'lnd/clm2/rawdata/%s/mksrf_landuse_%s_%s.c%s.nc' % (self.subdir, self.desc, year, self.cdate) )
+ print( '\n' )
entry = mksrfDataEntry_prog()
entry.parse_cmdline_args()
diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml
index d805f11dee..f97121ec56 100644
--- a/bld/namelist_files/namelist_defaults_ctsm.xml
+++ b/bld/namelist_files/namelist_defaults_ctsm.xml
@@ -483,15 +483,15 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
-lnd/clm2/paramdata/ctsm51_params.c210305.nc
-lnd/clm2/paramdata/clm50_params.c210217.nc
-lnd/clm2/paramdata/clm45_params.c210217.nc
+lnd/clm2/paramdata/ctsm51_params.c210528.nc
+lnd/clm2/paramdata/clm50_params.c210528.nc
+lnd/clm2/paramdata/clm45_params.c210528.nc
-lnd/clm2/paramdata/fates_params_api.14.0.0_12pft_c200921.nc
+lnd/clm2/paramdata/fates_params_api.16.1.0_12pft_c210630.nc
@@ -1422,20 +1422,6 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
0.015d00
0.015d00
-
-20.0d00, 20.0d00, 20.0d00
-200.0d00, 200.0d00, 200.0d00
-200.0d00, 200.0d00, 200.0d00
-20.0d00, 20.0d00, 20.0d00
-200.0d00, 200.0d00, 200.0d00
-200.0d00, 200.0d00, 200.0d00
-
-1.50d00
-1.50d00
-0.3
-1.50d00
-1.50d00
-0.3
100.d00
100.d00
@@ -1484,6 +1470,9 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc
lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc
+share/meshes/fv1.9x2.5_141008_ESMFmesh_c20191001.nc
+share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc
+
lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP5-8.5-WACCM_1849-2101_monthly_c191007.nc
@@ -1553,6 +1542,7 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
2001
lnd/clm2/lai_streams/MODISPFTLAI_0.5x0.5_c140711.nc
+lnd/clm2/lai_streams/MODISPFTLAI_0.5x0_ESMFmesh_cdf5_090621.nc
bilinear
@@ -1589,7 +1579,9 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
0001
atm/datm7/NASA_LIS/clmforc.Li_2012_climo1995-2011.T62.lnfm_Total_c140423.nc
+atm/datm7/NASA_LIS/clmforc.Li_2012_climo1995-2011.T62_ESMFmesh_cdf5_110621.nc
atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720.lnfm_Total_c160825.nc
+atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720_ESMFmesh_cdf5_150621.nc
bilinear
@@ -1686,6 +1678,8 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
lnd/clm2/firedata/clmforc.Li_2018_SSP5_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc
+lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0_ESMFmesh_cdf5_100621.nc
+
bilinear
nn
@@ -1739,12 +1733,18 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc
+lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1_ESMFmesh_cdf5_100621.nc
lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc
+lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1_ESMFmesh_cdf5_100621.nc
lnd/clm2/urbandata/CLM45_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc
+lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1_ESMFmesh_cdf5_100621.nc
nn
@@ -1791,974 +1791,436 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
-
-
-
-
+
+>lnd/clm2/mappingdata/maps/0.1x0.1/map_0.5x0.5_nomask_to_0.1x0.1_nomask_aave_da_c200206.nc
+
+
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/0.1x0.1/map_10x10min_nomask_to_0.1x0.1_nomask_aave_da_c200206.nc
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/0.1x0.1/map_5x5min_nomask_to_0.1x0.1_nomask_aave_da_c200309.nc
+
-
-
-
-
-
+
+>lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_0.5x0.5_nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c200206.nc
+
+
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_10x10min_nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c200206.nc
-
-
-
-
+>lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_5x5min_nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c200309.nc
+
-
-
-
-
-
+
+>lnd/clm2/mappingdata/maps/1x1_brazil/map_0.5x0.5_nomask_to_1x1_brazil_nomask_aave_da_c200206.nc
+
+
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/1x1_brazil/map_10x10min_nomask_to_1x1_brazil_nomask_aave_da_c200206.nc
-
-
-
-
+>lnd/clm2/mappingdata/maps/1x1_brazil/map_5x5min_nomask_to_1x1_brazil_nomask_aave_da_c200309.nc
+
-
-
-
-
-
+
+>lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_0.5x0.5_nomask_to_1x1_camdenNJ_nomask_aave_da_c200206.nc
+
+
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_10x10min_nomask_to_1x1_camdenNJ_nomask_aave_da_c200206.nc
-
-
-
-
+>lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_5x5min_nomask_to_1x1_camdenNJ_nomask_aave_da_c200309.nc
+
-
-
-
-
-
+
+>lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_0.5x0.5_nomask_to_1x1_mexicocityMEX_nomask_aave_da_c200206.nc
+
+
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_10x10min_nomask_to_1x1_mexicocityMEX_nomask_aave_da_c200206.nc
-
-
-
-
+>lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_5x5min_nomask_to_1x1_mexicocityMEX_nomask_aave_da_c200309.nc
+
-
-
-
-
-
+
+>lnd/clm2/mappingdata/maps/1x1_numaIA/map_0.5x0.5_nomask_to_1x1_numaIA_nomask_aave_da_c200206.nc
+
+
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/1x1_numaIA/map_10x10min_nomask_to_1x1_numaIA_nomask_aave_da_c200206.nc
-
-
-
-
+>lnd/clm2/mappingdata/maps/1x1_numaIA/map_5x5min_nomask_to_1x1_numaIA_nomask_aave_da_c200309.nc
+
-
-
-
-
-
+
+
+>lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_0.5x0.5_nomask_to_1x1_smallvilleIA_nomask_aave_da_c200206.nc
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_10x10min_nomask_to_1x1_smallvilleIA_nomask_aave_da_c200206.nc
+
-
-
-
-
+>lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_5x5min_nomask_to_1x1_smallvilleIA_nomask_aave_da_c200309.nc
+
-
-
-
-
-
+
+
+>lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_0.5x0.5_nomask_to_1x1_urbanc_alpha_nomask_aave_da_c200206.nc
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_10x10min_nomask_to_1x1_urbanc_alpha_nomask_aave_da_c200206.nc
+
-
-
-
-
+>lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_5x5min_nomask_to_1x1_urbanc_alpha_nomask_aave_da_c200309.nc
+
-
-
-
-
-
+
+
+>lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_0.5x0.5_nomask_to_1x1_vancouverCAN_nomask_aave_da_c200206.nc
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_10x10min_nomask_to_1x1_vancouverCAN_nomask_aave_da_c200206.nc
+
-
-
-
-
+>lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_5x5min_nomask_to_1x1_vancouverCAN_nomask_aave_da_c200309.nc
+
-
-
-
-
-
-
-
+
+
+
+>lnd/clm2/mappingdata/maps/0.47x0.63/map_10x10min_nomask_to_0.47x0.63_nomask_aave_da_c200206.nc
-
-
-
-
-
-
-
-
-
+
-
-
+>lnd/clm2/mappingdata/maps/0.47x0.63/map_5x5min_nomask_to_0.47x0.63_nomask_aave_da_c200309.nc
+
-
-
-
+
+
+
-
+>lnd/clm2/mappingdata/maps/0.9x1.25/map_10x10min_nomask_to_0.9x1.25_nomask_aave_da_c200206.nc
-
-
-
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/0.9x1.25/map_5x5min_nomask_to_0.9x1.25_nomask_aave_da_c200309.nc
+
+
-
-
-
+
+
+
-
+>lnd/clm2/mappingdata/maps/1.9x2.5/map_10x10min_nomask_to_1.9x2.5_nomask_aave_da_c200206.nc
-
-
-
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/1.9x2.5/map_5x5min_nomask_to_1.9x2.5_nomask_aave_da_c200309.nc
+
+
-
-
-
+
+
+
-
+>lnd/clm2/mappingdata/maps/10x15/map_10x10min_nomask_to_10x15_nomask_aave_da_c200206.nc
-
-
-
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/10x15/map_5x5min_nomask_to_10x15_nomask_aave_da_c200309.nc
+
+
-
-
-
+
+
+
-
+>lnd/clm2/mappingdata/maps/0.5x0.5/map_10x10min_nomask_to_0.5x0.5_nomask_aave_da_c200206.nc
-
-
-
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/0.5x0.5/map_5x5min_nomask_to_0.5x0.5_nomask_aave_da_c200309.nc
+
+
+>lnd/clm2/mappingdata/maps/0.5x0.5/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.5x0.5_nomask_aave_da_c130405.nc
-
-
-
+
+
+
-
+>lnd/clm2/mappingdata/maps/512x1024/map_10x10min_nomask_to_512x1024_nomask_aave_da_c200206.nc
-
-
-
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/512x1024/map_5x5min_nomask_to_512x1024_nomask_aave_da_c200309.nc
+
+
-
-
-
+
+
+
-
+>lnd/clm2/mappingdata/maps/128x256/map_10x10min_nomask_to_128x256_nomask_aave_da_c200206.nc
-
-
-
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/128x256/map_5x5min_nomask_to_128x256_nomask_aave_da_c200309.nc
+
+
-
-
-
+
+
+
-
+>lnd/clm2/mappingdata/maps/64x128/map_10x10min_nomask_to_64x128_nomask_aave_da_c200206.nc
-
-
-
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/64x128/map_5x5min_nomask_to_64x128_nomask_aave_da_c200309.nc
+
+
-
-
-
+
+
+
-
+>lnd/clm2/mappingdata/maps/48x96/map_10x10min_nomask_to_48x96_nomask_aave_da_c200206.nc
-
-
-
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/48x96/map_5x5min_nomask_to_48x96_nomask_aave_da_c200309.nc
+
+
-
-
-
+
+
+
-
+>lnd/clm2/mappingdata/maps/4x5/map_10x10min_nomask_to_4x5_nomask_aave_da_c200206.nc
-
-
-
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/4x5/map_5x5min_nomask_to_4x5_nomask_aave_da_c200309.nc
+
+
-
-
-
+
+
+
-
+>lnd/clm2/mappingdata/maps/0.23x0.31/map_10x10min_nomask_to_0.23x0.31_nomask_aave_da_c200206.nc
-
-
-
-
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/0.23x0.31/map_5x5min_nomask_to_0.23x0.31_nomask_aave_da_c200309.nc
+
+
-
-
-
+
+
+
-
+>lnd/clm2/mappingdata/maps/2.5x3.33/map_10x10min_nomask_to_2.5x3.33_nomask_aave_da_c200206.nc
-
-
-
-
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/2.5x3.33/map_5x5min_nomask_to_2.5x3.33_nomask_aave_da_c200309.nc
+
+
-
-
-
-
+
-
+>lnd/clm2/mappingdata/maps/0.5x0.5/map_0.5x0.5_nomask_to_0.5x0.5_nomask_aave_da_c200206.nc
-
+>lnd/clm2/mappingdata/maps/0.5x0.5/map_10x10min_nomask_to_0.5x0.5_nomask_aave_da_c200206.nc
+
+
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/0.5x0.5/map_5x5min_nomask_to_0.5x0.5_nomask_aave_da_c200309.nc
-
-
-
-
-
-
-
+>lnd/clm2/mappingdata/maps/0.5x0.5/map_0.1x0.1_nomask_to_0.5x0.5_nomask_aave_da_c200206.nc
+
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
lnd/clm2/mappingdata/maps/ne16np4/map_5x5min_nomask_to_ne16np4_nomask_aave_da_c110922.nc
-lnd/clm2/mappingdata/maps/ne16np4/map_5x5min_ISRIC-WISE_to_ne16np4_nomask_aave_da_c111115.nc
-lnd/clm2/mappingdata/maps/ne16np4/map_5x5min_ORNL-Soil_to_ne16np4_nomask_aave_da_c170706.nc
-lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_MODIS_to_ne16np4_nomask_aave_da_c111111.nc
-lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_MODIS-wCsp_to_ne16np4_nomask_aave_da_c160425.nc
-lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_USGS_to_ne16np4_nomask_aave_da_c120926.nc
-lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_LandScan2004_to_ne16np4_nomask_aave_da_c120518.nc
-lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_GLOBE-Gardner_to_ne16np4_nomask_aave_da_c120924.nc
-lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne16np4_nomask_aave_da_c120924.nc
-lnd/clm2/mappingdata/maps/ne16np4/map_0.9x1.25_GRDC_to_ne16np4_nomask_aave_da_c130308.nc
-lnd/clm2/mappingdata/maps/ne16np4/map_360x720_cruncep_to_ne16np4_nomask_aave_da_c130326.nc
+>lnd/clm2/mappingdata/maps/ne16np4/map_5x5min_nomask_to_ne16np4_nomask_aave_da_c200309.nc
+lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_nomask_to_ne16np4_nomask_aave_da_c210506.nc
+lnd/clm2/mappingdata/maps/ne16np4/map_0.9x1.25_nomask_to_ne16np4_nomask_aave_da_c200206.nc
lnd/clm2/mappingdata/maps/ne16np4/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne16np4_nomask_aave_da_c130408.nc
-lnd/clm2/mappingdata/maps/ne16np4/map_ne16np4_nomask_to_0.5x0.5_nomask_aave_da_c110922.nc
-lnd/clm2/mappingdata/maps/ne30np4/map_0.5x0.5_landuse_to_ne30np4_aave_da_110320.nc
-lnd/clm2/mappingdata/maps/ne30np4/map_0.25x0.25_MODIS_to_ne30np4_nomask_aave_da_c170321.nc
-lnd/clm2/mappingdata/maps/ne30np4/map_0.5x0.5_lanwat_to_ne30np4_aave_da_110320.nc
+lnd/clm2/mappingdata/maps/ne30np4/map_0.125x0.125_nomask_to_ne30np4_nomask_aave_da_c200206.nc
+lnd/clm2/mappingdata/maps/ne30np4/map_0.5x0.5_nomask_to_ne30np4_nomask_aave_da_c200206.nc
+lnd/clm2/mappingdata/maps/ne30np4/map_0.25x0.25_nomask_to_ne30np4_nomask_aave_da_c200309.nc
lnd/clm2/mappingdata/maps/ne30np4/map_10minx10min_topo_to_ne30np4_aave_da_110320.nc
-lnd/clm2/mappingdata/maps/ne30np4/map_5minx5min_soitex_to_ne30np4_aave_da_110320.nc
+>lnd/clm2/mappingdata/maps/ne30np4/map_10x10min_nomask_to_ne30np4_nomask_aave_da_c200206.nc
lnd/clm2/mappingdata/maps/ne30np4/map_5minx5min_irrig_to_ne30np4_aave_da_110720.nc
-lnd/clm2/mappingdata/maps/ne30np4/map_5x5min_ISRIC-WISE_to_ne30np4_nomask_aave_da_c111115.nc
-lnd/clm2/mappingdata/maps/ne30np4/map_5x5min_ORNL-Soil_to_ne30np4_nomask_aave_da_c170706.nc
-lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_MODIS_to_ne30np4_nomask_aave_da_c111111.nc
-lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_MODISv2_to_ne30np4_nomask_aave_da_c190507.nc
-lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_MODIS-wCsp_to_ne30np4_nomask_aave_da_c160425.nc
-lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_USGS_to_ne30np4_nomask_aave_da_c120926.nc
-lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_LandScan2004_to_ne30np4_nomask_aave_da_c120518.nc
-lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_GLOBE-Gardner_to_ne30np4_nomask_aave_da_c120924.nc
-lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne30np4_nomask_aave_da_c120924.nc
-lnd/clm2/mappingdata/maps/ne30np4/map_0.9x1.25_GRDC_to_ne30np4_nomask_aave_da_c130308.nc
-lnd/clm2/mappingdata/maps/ne30np4/map_360x720_cruncep_to_ne30np4_nomask_aave_da_c130326.nc
+>lnd/clm2/mappingdata/maps/ne30np4/map_5x5min_nomask_to_ne30np4_nomask_aave_da_c200309.nc
+lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_nomask_to_ne30np4_nomask_aave_da_c200309.nc
+lnd/clm2/mappingdata/maps/ne30np4/map_0.9x1.25_nomask_to_ne30np4_nomask_aave_da_c200206.nc
lnd/clm2/mappingdata/maps/ne30np4/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne30np4_nomask_aave_da_c130405.nc
-lnd/clm2/mappingdata/maps/ne30np4/map_ne30np4_to_0.5x0.5rtm_aave_da_110320.nc
-lnd/clm2/mappingdata/maps/ne60np4/map_0.5x0.5_MODIS_to_ne60np4_nomask_aave_da_c110922.nc
-lnd/clm2/mappingdata/maps/ne60np4/map_0.25x0.25_MODIS_to_ne60np4_nomask_aave_da_c170321.nc
-lnd/clm2/mappingdata/maps/ne60np4/map_0.5x0.5_AVHRR_to_ne60np4_nomask_aave_da_c110922.nc
+lnd/clm2/mappingdata/maps/ne60np4/map_0.125x0.125_nomask_to_ne60np4_nomask_aave_da_c200206.nc
+lnd/clm2/mappingdata/maps/ne60np4/map_0.5x0.5_nomask_to_ne60np4_nomask_aave_da_c200206.nc
+lnd/clm2/mappingdata/maps/ne60np4/map_0.25x0.25_nomask_to_ne60np4_nomask_aave_da_c200309.nc
lnd/clm2/mappingdata/maps/ne60np4/map_10x10min_nomask_to_ne60np4_nomask_aave_da_c110922.nc
-lnd/clm2/mappingdata/maps/ne60np4/map_5x5min_IGBP-GSDP_to_ne60np4_nomask_aave_da_c110922.nc
+>lnd/clm2/mappingdata/maps/ne60np4/map_10x10min_nomask_to_ne60np4_nomask_aave_da_c200206.nc
lnd/clm2/mappingdata/maps/ne60np4/map_5x5min_nomask_to_ne60np4_nomask_aave_da_c110922.nc
-lnd/clm2/mappingdata/maps/ne60np4/map_5x5min_ISRIC-WISE_to_ne60np4_nomask_aave_da_c111115.nc
-lnd/clm2/mappingdata/maps/ne60np4/map_5x5min_ORNL-Soil_to_ne60np4_nomask_aave_da_c170706.nc
-lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_MODIS_to_ne60np4_nomask_aave_da_c111111.nc
-lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_MODISv2_to_ne60np4_nomask_aave_da_c190507.nc
-lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_MODIS-wCsp_to_ne60np4_nomask_aave_da_c160425.nc
-lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_USGS_to_ne60np4_nomask_aave_da_c120926.nc
-lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_LandScan2004_to_ne60np4_nomask_aave_da_c120518.nc
-lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_GLOBE-Gardner_to_ne60np4_nomask_aave_da_c120924.nc
-lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne60np4_nomask_aave_da_c120924.nc
-lnd/clm2/mappingdata/maps/ne60np4/map_0.9x1.25_GRDC_to_ne60np4_nomask_aave_da_c130308.nc
-lnd/clm2/mappingdata/maps/ne60np4/map_360x720_cruncep_to_ne60np4_nomask_aave_da_c130326.nc
+>lnd/clm2/mappingdata/maps/ne60np4/map_5x5min_nomask_to_ne60np4_nomask_aave_da_c200309.nc
+lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_nomask_to_ne60np4_nomask_aave_da_c200309.nc
+lnd/clm2/mappingdata/maps/ne60np4/map_0.9x1.25_nomask_to_ne60np4_nomask_aave_da_c200206.nc
lnd/clm2/mappingdata/maps/ne60np4/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne60np4_nomask_aave_da_c130405.nc
-lnd/clm2/mappingdata/maps/ne60np4/map_ne60np4_nomask_to_0.5x0.5_nomask_aave_da_c110922.nc
-
-lnd/clm2/mappingdata/maps/ne120np4/map_0.5x0.5_landuse_to_ne120np4_aave_da_110320.nc
-lnd/clm2/mappingdata/maps/ne120np4/map_0.25x0.25_MODIS_to_ne120np4_nomask_aave_da_c170321.nc
-lnd/clm2/mappingdata/maps/ne120np4/map_0.5x0.5_lanwat_to_ne120np4_aave_da_110320.nc
+
+lnd/clm2/mappingdata/maps/ne120np4/map_0.125x0.125_nomask_to_ne120np4_nomask_aave_da_c200206.nc
+lnd/clm2/mappingdata/maps/ne120np4/map_0.5x0.5_nomask_to_ne120np4_nomask_aave_da_c200206.nc
+lnd/clm2/mappingdata/maps/ne120np4/map_0.25x0.25_nomask_to_ne120np4_nomask_aave_da_c200309.nc
lnd/clm2/mappingdata/maps/ne120np4/map_10minx10min_topo_to_ne120np4_aave_da_110320.nc
-lnd/clm2/mappingdata/maps/ne120np4/map_5minx5min_soitex_to_ne120np4_aave_da_110320.nc
-lnd/clm2/mappingdata/maps/ne120np4/map_5x5min_ISRIC-WISE_to_ne120np4_nomask_aave_da_c111115.nc
-lnd/clm2/mappingdata/maps/ne120np4/map_5x5min_ORNL-Soil_to_ne120np4_nomask_aave_da_c170706.nc
+>lnd/clm2/mappingdata/maps/ne120np4/map_10x10min_nomask_to_ne120np4_nomask_aave_da_c200206.nc
lnd/clm2/mappingdata/maps/ne120np4/map_5minx5min_irrig_to_ne120np4_aave_da_110817.nc
-lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_MODIS_to_ne120np4_nomask_aave_da_c111111.nc
-lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_MODISv2_to_ne120np4_nomask_aave_da_c190514.nc
-lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_MODIS-wCsp_to_ne120np4_nomask_aave_da_c160425.nc
-lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_USGS_to_ne120np4_nomask_aave_da_c120913.nc
-lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_LandScan2004_to_ne120np4_nomask_aave_da_c120518.nc
-lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_GLOBE-Gardner_to_ne120np4_nomask_aave_da_c120924.nc
-lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne120np4_nomask_aave_da_c120924.nc
-lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_USGS_to_ne120np4_nomask_aave_da_c120913.nc
-lnd/clm2/mappingdata/maps/ne120np4/map_0.9x1.25_GRDC_to_ne120np4_nomask_aave_da_c130308.nc
-lnd/clm2/mappingdata/maps/ne120np4/map_360x720_cruncep_to_ne120np4_nomask_aave_da_c130326.nc
+>lnd/clm2/mappingdata/maps/ne120np4/map_5x5min_nomask_to_ne120np4_nomask_aave_da_c200309.nc
+lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_nomask_to_ne120np4_nomask_aave_da_c210506.nc
+lnd/clm2/mappingdata/maps/ne120np4/map_0.9x1.25_nomask_to_ne120np4_nomask_aave_da_c200206.nc
lnd/clm2/mappingdata/maps/ne120np4/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne120np4_nomask_aave_da_c130405.nc
-lnd/clm2/mappingdata/maps/ne120np4/map_0.1x0.1_nomask_to_ne120np4_nomask_aave_da_c120706.nc
+lnd/clm2/mappingdata/maps/0.125x0.125/map_0.125x0.125_nomask_to_0.125nldas2_nomask_aave_da_c200206.nc
+lnd/clm2/mappingdata/maps/0.125x0.125/map_0.5x0.5_nomask_to_0.125nldas2_nomask_aave_da_c200206.nc
+lnd/clm2/mappingdata/maps/0.125x0.125/map_0.25x0.25_nomask_to_0.125nldas2_nomask_aave_da_c200309.nc
+lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_nomask_to_0.125nldas2_nomask_aave_da_c200309.nc
lnd/clm2/mappingdata/maps/0.125nldas2/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.125nldas2_nomask_aave_da_c190408.nc
+>lnd/clm2/mappingdata/maps/0.125x0.125/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.125nldas2_nomask_aave_da_c140702.nc
lnd/clm2/mappingdata/maps/0.125nldas2/map_5x5min_nomask_to_0.125nldas2_nomask_aave_da_c190408.nc
-lnd/clm2/mappingdata/maps/0.125nldas2/map_0.25x0.25_MODIS_to_0.125nldas2_nomask_aave_da_c190408.nc
-lnd/clm2/mappingdata/maps/0.125nldas2/map_0.9x1.25_GRDC_to_0.125nldas2_nomask_aave_da_c190408.nc
+>lnd/clm2/mappingdata/maps/0.125x0.125/map_5x5min_nomask_to_0.125nldas2_nomask_aave_da_c200309.nc
lnd/clm2/mappingdata/maps/0.125nldas2/map_10x10min_nomask_to_0.125nldas2_nomask_aave_da_c190408.nc
-lnd/clm2/mappingdata/maps/0.125nldas2/map_360x720cru_cruncep_to_0.125nldas2_nomask_aave_da_c190408.nc
-lnd/clm2/mappingdata/maps/0.125nldas2/map_3x3min_LandScan2004_to_0.125nldas2_nomask_aave_da_c190408.nc
-lnd/clm2/mappingdata/maps/0.125nldas2/map_10x10min_IGBPmergeICESatGIS_to_0.125nldas2_nomask_aave_da_c190408.nc
-lnd/clm2/mappingdata/maps/0.125nldas2/map_3x3min_MODIS_to_0.125nldas2_nomask_aave_da_c190412.nc
-lnd/clm2/mappingdata/maps/0.125nldas2/map_3x3min_MODIS-wCsp_to_0.125nldas2_nomask_aave_da_c190408.nc
-lnd/clm2/mappingdata/maps/0.125nldas2/map_0.5x0.5_MODIS_to_0.125nldas2_nomask_aave_da_c190408.nc
-lnd/clm2/mappingdata/maps/0.125nldas2/map_3x3min_GLOBE-Gardner-mergeGIS_to_0.125nldas2_nomask_aave_da_c190408.nc
-lnd/clm2/mappingdata/maps/0.125nldas2/map_5x5min_ISRIC-WISE_to_0.125nldas2_nomask_aave_da_c190408.nc
-lnd/clm2/mappingdata/maps/0.125nldas2/map_3x3min_GLOBE-Gardner_to_0.125nldas2_nomask_aave_da_c190408.nc
-lnd/clm2/mappingdata/maps/0.125nldas2/map_0.5x0.5_AVHRR_to_0.125nldas2_nomask_aave_da_c190408.nc
-lnd/clm2/mappingdata/maps/0.125nldas2/map_3x3min_USGS_to_0.125nldas2_nomask_aave_da_c190408.nc
-lnd/clm2/mappingdata/maps/0.125nldas2/map_5x5min_IGBP-GSDP_to_0.125nldas2_nomask_aave_da_c190408.nc
-lnd/clm2/mappingdata/maps/0.125nldas2/map_5x5min_ORNL-Soil_to_0.125nldas2_nomask_aave_da_c190408.nc
+>lnd/clm2/mappingdata/maps/0.125x0.125/map_10x10min_nomask_to_0.125nldas2_nomask_aave_da_c200206.nc
+lnd/clm2/mappingdata/maps/0.125x0.125/map_0.9x1.25_nomask_to_0.125nldas2_nomask_aave_da_c200206.nc
+lnd/clm2/mappingdata/maps/5x5_amazon/map_0.125x0.125_nomask_to_5x5_amazon_nomask_aave_da_c200206.nc
+lnd/clm2/mappingdata/maps/5x5_amazon/map_0.5x0.5_nomask_to_5x5_amazon_nomask_aave_da_c200206.nc
+lnd/clm2/mappingdata/maps/5x5_amazon/map_0.25x0.25_nomask_to_5x5_amazon_nomask_aave_da_c200309.nc
-
-lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_5x5min_ORNL-Soil_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_3x3min_MODIS-wCsp_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_5x5min_ISRIC-WISE_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_0.9x1.25_GRDC_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc
lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_5x5min_nomask_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_3x3min_GLOBE-Gardner_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_3x3min_LandScan2004_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_360x720cru_cruncep_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_5x5min_IGBP-GSDP_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_3x3min_USGS_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc
lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_10x10min_nomask_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_3x3min_MODISv2_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_0.5x0.5_AVHRR_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_0.25x0.25_MODIS_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_0.5x0.5_MODIS_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc
lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_10x10min_IGBPmergeICESatGIS_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc
-
-lnd/clm2/mappingdata/maps/5x5_amazon/map_0.5x0.5_MODIS_to_5x5_amazon_nomask_aave_da_c110920.nc
-lnd/clm2/mappingdata/maps/5x5_amazon/map_0.25x0.25_MODIS_to_5x5_amazon_nomask_aave_da_c170321.nc
-lnd/clm2/mappingdata/maps/5x5_amazon/map_0.5x0.5_AVHRR_to_5x5_amazon_nomask_aave_da_c110920.nc
lnd/clm2/mappingdata/maps/5x5_amazon/map_10x10min_nomask_to_5x5_amazon_nomask_aave_da_c110920.nc
-lnd/clm2/mappingdata/maps/5x5_amazon/map_5x5min_IGBP-GSDP_to_5x5_amazon_nomask_aave_da_c110920.nc
+>lnd/clm2/mappingdata/maps/5x5_amazon/map_10x10min_nomask_to_5x5_amazon_nomask_aave_da_c200206.nc
lnd/clm2/mappingdata/maps/5x5_amazon/map_5x5min_nomask_to_5x5_amazon_nomask_aave_da_c110920.nc
-lnd/clm2/mappingdata/maps/5x5_amazon/map_5x5min_ISRIC-WISE_to_5x5_amazon_nomask_aave_da_c111115.nc
-lnd/clm2/mappingdata/maps/5x5_amazon/map_5x5min_ORNL-Soil_to_5x5_amazon_nomask_aave_da_c170706.nc
-lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_MODIS_to_5x5_amazon_nomask_aave_da_c111111.nc
-lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_MODISv2_to_5x5_amazon_nomask_aave_da_c190505.nc
-lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_MODIS-wCsp_to_5x5_amazon_nomask_aave_da_c160425.nc
-lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_USGS_to_5x5_amazon_nomask_aave_da_c120927.nc
-lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_LandScan2004_to_5x5_amazon_nomask_aave_da_c120518.nc
-lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_GLOBE-Gardner_to_5x5_amazon_nomask_aave_da_c120923.nc
-lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_GLOBE-Gardner-mergeGIS_to_5x5_amazon_nomask_aave_da_c120923.nc
-lnd/clm2/mappingdata/maps/5x5_amazon/map_0.9x1.25_GRDC_to_5x5_amazon_nomask_aave_da_c130309.nc
-lnd/clm2/mappingdata/maps/5x5_amazon/map_360x720_cruncep_to_5x5_amazon_nomask_aave_da_c130326.nc
+>lnd/clm2/mappingdata/maps/5x5_amazon/map_5x5min_nomask_to_5x5_amazon_nomask_aave_da_c200309.nc
+lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_nomask_to_5x5_amazon_nomask_aave_da_c200309.nc
+lnd/clm2/mappingdata/maps/5x5_amazon/map_0.9x1.25_nomask_to_5x5_amazon_nomask_aave_da_c200206.nc
lnd/clm2/mappingdata/maps/5x5_amazon/map_1km-merge-10min_HYDRO1K-merge-nomask_to_5x5_amazon_nomask_aave_da_c130403.nc
-lnd/clm2/mappingdata/maps/ne240np4/map_0.5x0.5_MODIS_to_ne240np4_nomask_aave_da_c110922.nc
-lnd/clm2/mappingdata/maps/ne240np4/map_0.25x0.25_MODIS_to_ne240np4_nomask_aave_da_c170321.nc
-lnd/clm2/mappingdata/maps/ne240np4/map_0.5x0.5_AVHRR_to_ne240np4_nomask_aave_da_c110922.nc
+lnd/clm2/mappingdata/maps/ne240np4/map_0.125x0.125_nomask_to_ne240np4_nomask_aave_da_c200206.nc
lnd/clm2/mappingdata/maps/ne240np4/map_10x10min_nomask_to_ne240np4_nomask_aave_da_c110922.nc
-lnd/clm2/mappingdata/maps/ne240np4/map_5x5min_IGBP-GSDP_to_ne240np4_nomask_aave_da_c110922.nc
+>lnd/clm2/mappingdata/maps/ne240np4/map_10x10min_nomask_to_ne240np4_nomask_aave_da_c200206.nc
+lnd/clm2/mappingdata/maps/ne240np4/map_0.5x0.5_nomask_to_ne240np4_nomask_aave_da_c200206.nc
+lnd/clm2/mappingdata/maps/ne240np4/map_0.25x0.25_nomask_to_ne240np4_nomask_aave_da_c200309.nc
+lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_nomask_to_ne240np4_nomask_aave_da_c200309.nc
lnd/clm2/mappingdata/maps/ne240np4/map_5x5min_nomask_to_ne240np4_nomask_aave_da_c110922.nc
-lnd/clm2/mappingdata/maps/ne240np4/map_5x5min_ISRIC-WISE_to_ne240np4_nomask_aave_da_c111115.nc
-lnd/clm2/mappingdata/maps/ne240np4/map_5x5min_ORNL-Soil_to_ne240np4_nomask_aave_da_c170706.nc
-lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_MODIS_to_ne240np4_nomask_aave_da_c111111.nc
-lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_MODISv2_to_ne240np4_nomask_aave_da_c190514.nc
-lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_MODIS-wCsp_to_ne240np4_nomask_aave_da_c160425.nc
-lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_USGS_to_ne240np4_nomask_aave_da_c120926.nc
-lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_LandScan2004_to_ne240np4_nomask_aave_da_c120521.nc
-lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_GLOBE-Gardner_to_ne240np4_nomask_aave_da_c120925.nc
-lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne240np4_nomask_aave_da_c120925.nc
-lnd/clm2/mappingdata/maps/ne240np4/map_0.9x1.25_GRDC_to_ne240np4_nomask_aave_da_c130308.nc
-lnd/clm2/mappingdata/maps/ne240np4/map_360x720_cruncep_to_ne240np4_nomask_aave_da_c130326.nc
+>lnd/clm2/mappingdata/maps/ne240np4/map_5x5min_nomask_to_ne240np4_nomask_aave_da_c200309.nc
+lnd/clm2/mappingdata/maps/ne240np4/map_0.9x1.25_nomask_to_ne240np4_nomask_aave_da_c200206.nc
lnd/clm2/mappingdata/maps/ne240np4/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne240np4_nomask_aave_da_c130405.nc
-lnd/clm2/mappingdata/maps/ne240np4/map_ne240np4_nomask_to_0.5x0.5_nomask_aave_da_c110922.nc
-lnd/clm2/mappingdata/maps/0.125x0.125/map_0.5x0.5_AVHRR_to_0.125x0.125_nomask_aave_da_c140702.nc
-lnd/clm2/mappingdata/maps/0.125x0.125/map_0.5x0.5_MODIS_to_0.125x0.125_nomask_aave_da_c140702.nc
-lnd/clm2/mappingdata/maps/0.125x0.125/map_0.25x0.25_MODIS_to_0.125x0.125_nomask_aave_da_c170321.nc
-lnd/clm2/mappingdata/maps/0.125x0.125/map_0.9x1.25_GRDC_to_0.125x0.125_nomask_aave_da_c140702.nc
-lnd/clm2/mappingdata/maps/0.125x0.125/map_10x10min_IGBPmergeICESatGIS_to_0.125x0.125_nomask_aave_da_c140702.nc
+lnd/clm2/mappingdata/maps/0.125x0.125/map_0.125x0.125_nomask_to_0.125x0.125_nomask_aave_da_c200206.nc
lnd/clm2/mappingdata/maps/0.125x0.125/map_10x10min_nomask_to_0.125x0.125_nomask_aave_da_c140702.nc
+>lnd/clm2/mappingdata/maps/0.125x0.125/map_10x10min_nomask_to_0.125x0.125_nomask_aave_da_c200206.nc
lnd/clm2/mappingdata/maps/0.125x0.125/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.125x0.125_nomask_aave_da_c140702.nc
-lnd/clm2/mappingdata/maps/0.125x0.125/map_360x720cru_cruncep_to_0.125x0.125_nomask_aave_da_c140702.nc
-lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_GLOBE-Gardner-mergeGIS_to_0.125x0.125_nomask_aave_da_c140702.nc
-lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_GLOBE-Gardner_to_0.125x0.125_nomask_aave_da_c140702.nc
-lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_LandScan2004_to_0.125x0.125_nomask_aave_da_c140702.nc
-lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_MODIS_to_0.125x0.125_nomask_aave_da_c140702.nc
-lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_MODISv2_to_0.125x0.125_nomask_aave_da_c190613.nc
-lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_MODIS-wCsp_to_0.125x0.125_nomask_aave_da_c160427.nc
-lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_USGS_to_0.125x0.125_nomask_aave_da_c140702.nc
-lnd/clm2/mappingdata/maps/0.125x0.125/map_5x5min_IGBP-GSDP_to_0.125x0.125_nomask_aave_da_c140702.nc
-lnd/clm2/mappingdata/maps/0.125x0.125/map_5x5min_ISRIC-WISE_to_0.125x0.125_nomask_aave_da_c140702.nc
-lnd/clm2/mappingdata/maps/0.125x0.125/map_5x5min_ORNL-Soil_to_0.125x0.125_nomask_aave_da_c170706.nc
+>lnd/clm2/mappingdata/maps/0.125x0.125/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.125x0.125_nomask_aave_da_c200206.nc
+lnd/clm2/mappingdata/maps/0.125x0.125/map_0.5x0.5_nomask_to_0.125x0.125_nomask_aave_da_c200206.nc
+lnd/clm2/mappingdata/maps/0.125x0.125/map_0.25x0.25_nomask_to_0.125x0.125_nomask_aave_da_c200309.nc
+lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_nomask_to_0.125x0.125_nomask_aave_da_c200309.nc
lnd/clm2/mappingdata/maps/0.125x0.125/map_5x5min_nomask_to_0.125x0.125_nomask_aave_da_c140702.nc
+>lnd/clm2/mappingdata/maps/0.125x0.125/map_5x5min_nomask_to_0.125x0.125_nomask_aave_da_c200309.nc
+lnd/clm2/mappingdata/maps/0.125x0.125/map_0.9x1.25_nomask_to_0.125x0.125_nomask_aave_da_c200206.nc
+
+
+lnd/clm2/mappingdata/maps/1km/map_0.5x0.5_nomask_to_1km-merge-10min_HYDRO1K-merge-nomask_aave_da_c200206.nc
+
+
+
-lnd/clm2/mappingdata/maps/94x192/map_3x3min_USGS_to_94x192_nomask_aave_da_c120926.nc
lnd/clm2/mappingdata/maps/94x192/map_0.5x0.5_nomask_to_94x192_nomask_aave_da_c110823.nc
-lnd/clm2/mappingdata/maps/94x192/map_5x5min_ORNL-Soil_to_94x192_nomask_aave_da_c190521.nc
lnd/clm2/mappingdata/maps/94x192/map_94x192_nomask_to_0.5x0.5_nomask_aave_da_c110823.nc
-lnd/clm2/mappingdata/maps/94x192/map_5x5min_IGBP-GSDP_to_94x192_nomask_aave_da_c110823.nc
-lnd/clm2/mappingdata/maps/94x192/map_3x3min_MODIS-wCsp_to_94x192_nomask_aave_da_c190521.nc
lnd/clm2/mappingdata/maps/94x192/map_1km-merge-10min_HYDRO1K-merge-nomask_to_94x192_nomask_aave_da_c190521.nc
-lnd/clm2/mappingdata/maps/94x192/map_0.5x0.5_MODIS_to_94x192_nomask_aave_da_c110823.nc
lnd/clm2/mappingdata/maps/94x192/map_5x5min_nomask_to_94x192_nomask_aave_da_c110823.nc
-lnd/clm2/mappingdata/maps/94x192/map_0.5x0.5_USGS_to_94x192_nomask_aave_da_c110823.nc
-lnd/clm2/mappingdata/maps/94x192/map_0.9x1.25_GRDC_to_94x192_nomask_aave_da_c190521.nc
lnd/clm2/mappingdata/maps/94x192/map_10x10min_nomask_to_94x192_nomask_aave_da_c110823.nc
-lnd/clm2/mappingdata/maps/94x192/map_10x10min_IGBPmergeICESatGIS_to_94x192_nomask_aave_da_c110823.nc
-lnd/clm2/mappingdata/maps/94x192/map_3x3min_LandScan2004_to_94x192_nomask_aave_da_c190521.nc
-lnd/clm2/mappingdata/maps/94x192/map_360x720cru_cruncep_to_94x192_nomask_aave_da_c190521.nc
-lnd/clm2/mappingdata/maps/94x192/map_3x3min_GLOBE-Gardner_to_94x192_nomask_aave_da_c190521.nc
-lnd/clm2/mappingdata/maps/94x192/map_0.25x0.25_MODIS_to_94x192_nomask_aave_da_c190521.nc
-lnd/clm2/mappingdata/maps/94x192/map_0.5x0.5_AVHRR_to_94x192_nomask_aave_da_c110823.nc
-lnd/clm2/mappingdata/maps/94x192/map_5x5min_ISRIC-WISE_to_94x192_nomask_aave_da_c190521.nc
-lnd/clm2/mappingdata/maps/94x192/map_3x3min_GLOBE-Gardner-mergeGIS_to_94x192_nomask_aave_da_c190521.nc
-lnd/clm2/mappingdata/maps/94x192/map_3x3min_MODISv2_to_94x192_nomask_aave_da_c190521.nc
-lnd/clm2/mappingdata/maps/ARCTIC/map_3x3min_USGS_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTIC/map_0.9x1.25_GRDC_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTIC/map_360x720cru_cruncep_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTIC/map_5x5min_ISRIC-WISE_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTIC/map_0.5x0.5_AVHRR_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTIC/map_3x3min_GLOBE-Gardner_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc
lnd/clm2/mappingdata/maps/ARCTIC/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc
lnd/clm2/mappingdata/maps/ARCTIC/map_5x5min_nomask_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTIC/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTIC/map_5x5min_IGBP-GSDP_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTIC/map_0.5x0.5_MODIS_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTIC/map_3x3min_MODISv2_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTIC/map_0.25x0.25_MODIS_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTIC/map_3x3min_MODIS-wCsp_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc
lnd/clm2/mappingdata/maps/ARCTIC/map_10x10min_nomask_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTIC/map_5x5min_ORNL-Soil_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTIC/map_3x3min_LandScan2004_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTIC/map_10x10min_IGBPmergeICESatGIS_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc
@@ -3393,38 +2486,8 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
>lnd/clm2/mappingdata/maps/ARCTICGRIS/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc
lnd/clm2/mappingdata/maps/ARCTICGRIS/map_5x5min_nomask_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTICGRIS/map_0.5x0.5_MODIS_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTICGRIS/map_3x3min_MODISv2_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTICGRIS/map_5x5min_ORNL-Soil_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTICGRIS/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTICGRIS/map_3x3min_MODIS-wCsp_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTICGRIS/map_0.5x0.5_AVHRR_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTICGRIS/map_3x3min_GLOBE-Gardner_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc
lnd/clm2/mappingdata/maps/ARCTICGRIS/map_10x10min_nomask_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTICGRIS/map_5x5min_ISRIC-WISE_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTICGRIS/map_360x720cru_cruncep_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTICGRIS/map_10x10min_IGBPmergeICESatGIS_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTICGRIS/map_5x5min_IGBP-GSDP_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTICGRIS/map_0.25x0.25_MODIS_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTICGRIS/map_3x3min_USGS_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTICGRIS/map_0.9x1.25_GRDC_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ARCTICGRIS/map_3x3min_LandScan2004_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc
@@ -3433,82 +2496,22 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
lnd/clm2/mappingdata/maps/ne30np4.pg2/map_5x5min_nomask_to_ne30np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30np4.pg2/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne30np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30np4.pg2/map_3x3min_MODIS-wCsp_to_ne30np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30np4.pg2/map_5x5min_IGBP-GSDP_to_ne30np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30np4.pg2/map_3x3min_LandScan2004_to_ne30np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30np4.pg2/map_360x720cru_cruncep_to_ne30np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30np4.pg2/map_3x3min_USGS_to_ne30np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30np4.pg2/map_0.9x1.25_GRDC_to_ne30np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30np4.pg2/map_0.5x0.5_AVHRR_to_ne30np4.pg2_nomask_aave_da_c200426.nc
lnd/clm2/mappingdata/maps/ne30np4.pg2/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne30np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30np4.pg2/map_10x10min_IGBPmergeICESatGIS_to_ne30np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30np4.pg2/map_0.5x0.5_MODIS_to_ne30np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30np4.pg2/map_5x5min_ISRIC-WISE_to_ne30np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30np4.pg2/map_3x3min_MODISv2_to_ne30np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30np4.pg2/map_3x3min_GLOBE-Gardner_to_ne30np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30np4.pg2/map_5x5min_ORNL-Soil_to_ne30np4.pg2_nomask_aave_da_c200426.nc
lnd/clm2/mappingdata/maps/ne30np4.pg2/map_10x10min_nomask_to_ne30np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30np4.pg2/map_0.25x0.25_MODIS_to_ne30np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30pg3/map_3x3min_USGS_to_ne30np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30pg3/map_0.25x0.25_MODIS_to_ne30np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30pg3/map_5x5min_ORNL-Soil_to_ne30np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30pg3/map_3x3min_LandScan2004_to_ne30np4.pg3_nomask_aave_da_c200426.nc
lnd/clm2/mappingdata/maps/ne30pg3/map_5x5min_nomask_to_ne30np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30pg3/map_0.9x1.25_GRDC_to_ne30np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30pg3/map_3x3min_MODISv2_to_ne30np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30pg3/map_5x5min_ISRIC-WISE_to_ne30np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30pg3/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne30np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30pg3/map_5x5min_IGBP-GSDP_to_ne30np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30pg3/map_3x3min_MODIS-wCsp_to_ne30np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30pg3/map_3x3min_GLOBE-Gardner_to_ne30np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30pg3/map_10x10min_IGBPmergeICESatGIS_to_ne30np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30pg3/map_360x720cru_cruncep_to_ne30np4.pg3_nomask_aave_da_c200426.nc
lnd/clm2/mappingdata/maps/ne30pg3/map_10x10min_nomask_to_ne30np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30pg3/map_0.5x0.5_MODIS_to_ne30np4.pg3_nomask_aave_da_c200426.nc
lnd/clm2/mappingdata/maps/ne30pg3/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne30np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne30pg3/map_0.5x0.5_AVHRR_to_ne30np4.pg3_nomask_aave_da_c200426.nc
@@ -3517,38 +2520,8 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
lnd/clm2/mappingdata/maps/ne120np4.pg2/map_10x10min_nomask_to_ne120np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg2/map_5x5min_ISRIC-WISE_to_ne120np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg2/map_360x720cru_cruncep_to_ne120np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg2/map_5x5min_IGBP-GSDP_to_ne120np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg2/map_0.25x0.25_MODIS_to_ne120np4.pg2_nomask_aave_da_c200426.nc
lnd/clm2/mappingdata/maps/ne120np4.pg2/map_5x5min_nomask_to_ne120np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg2/map_3x3min_USGS_to_ne120np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg2/map_3x3min_LandScan2004_to_ne120np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg2/map_0.5x0.5_MODIS_to_ne120np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg2/map_3x3min_MODISv2_to_ne120np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg2/map_10x10min_IGBPmergeICESatGIS_to_ne120np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg2/map_0.9x1.25_GRDC_to_ne120np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg2/map_0.5x0.5_AVHRR_to_ne120np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg2/map_5x5min_ORNL-Soil_to_ne120np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg2/map_3x3min_MODIS-wCsp_to_ne120np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg2/map_3x3min_GLOBE-Gardner_to_ne120np4.pg2_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg2/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne120np4.pg2_nomask_aave_da_c200426.nc
lnd/clm2/mappingdata/maps/ne120np4.pg2/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne120np4.pg2_nomask_aave_da_c200426.nc
@@ -3557,42 +2530,12 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
-lnd/clm2/mappingdata/maps/ne120np4.pg3/map_0.5x0.5_MODIS_to_ne120np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg3/map_5x5min_ORNL-Soil_to_ne120np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg3/map_10x10min_IGBPmergeICESatGIS_to_ne120np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg3/map_0.25x0.25_MODIS_to_ne120np4.pg3_nomask_aave_da_c200426.nc
lnd/clm2/mappingdata/maps/ne120np4.pg3/map_10x10min_nomask_to_ne120np4.pg3_nomask_aave_da_c200426.nc
lnd/clm2/mappingdata/maps/ne120np4.pg3/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne120np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg3/map_3x3min_MODIS-wCsp_to_ne120np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg3/map_360x720cru_cruncep_to_ne120np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg3/map_3x3min_LandScan2004_to_ne120np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg3/map_0.5x0.5_AVHRR_to_ne120np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg3/map_3x3min_USGS_to_ne120np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg3/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne120np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg3/map_3x3min_GLOBE-Gardner_to_ne120np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg3/map_0.9x1.25_GRDC_to_ne120np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg3/map_5x5min_IGBP-GSDP_to_ne120np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg3/map_5x5min_ISRIC-WISE_to_ne120np4.pg3_nomask_aave_da_c200426.nc
lnd/clm2/mappingdata/maps/ne120np4.pg3/map_5x5min_nomask_to_ne120np4.pg3_nomask_aave_da_c200426.nc
-lnd/clm2/mappingdata/maps/ne120np4.pg3/map_3x3min_MODISv2_to_ne120np4.pg3_nomask_aave_da_c200426.nc
@@ -3612,14 +2555,16 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
.true.
.true.
-1.9x2.5
-1.9x2.5
-
-lnd/clm2/paramdata/finundated_inversiondata_0.9x1.25_c170706.nc
-lnd/clm2/paramdata/finundated_inversiondata_0.9x1.25_c170706.nc
+lnd/clm2/paramdata/finundated_inversiondata_0.9x1_ESMFmesh_cdf5_130621.nc
+lnd/clm2/paramdata/finundated_inversiondata_0.9x1_ESMFmesh_cdf5_130621.nc
+
diff --git a/bld/namelist_files/namelist_defaults_ctsm_tools.xml b/bld/namelist_files/namelist_defaults_ctsm_tools.xml
index 78ab368110..0f79ff53d6 100644
--- a/bld/namelist_files/namelist_defaults_ctsm_tools.xml
+++ b/bld/namelist_files/namelist_defaults_ctsm_tools.xml
@@ -71,51 +71,17 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
>lnd/clm2/mappingdata/grids/SCRIPgrid_0.1x0.1_nomask_c110712.nc
lnd/clm2/mappingdata/grids/SCRIPgrid_0.5x0.5_nomask_c110308.nc
-lnd/clm2/mappingdata/grids/SCRIPgrid_0.5x0.5_AVHRR_c110228.nc
-lnd/clm2/mappingdata/grids/SCRIPgrid_0.5x0.5_MODIS_c110228.nc
-lnd/clm2/mappingdata/grids/SCRIPgrid_0.25x0.25_MODIS_c170321.nc
+lnd/clm2/mappingdata/grids/SCRIPgrid_0.25x0.25_nomask_c200309.nc
lnd/clm2/mappingdata/grids/SCRIPgrid_5x5min_nomask_c110530.nc
-lnd/clm2/mappingdata/grids/SCRIPgrid_5x5min_IGBP-GSDP_c110228.nc
-lnd/clm2/mappingdata/grids/SCRIPgrid_5x5min_ISRIC-WISE_c111114.nc
-lnd/clm2/mappingdata/grids/SCRIPgrid_5x5min_ORNL-Soil_c170630.nc
+ >lnd/clm2/mappingdata/grids/SCRIPgrid_5x5min_nomask_c200309.nc
lnd/clm2/mappingdata/grids/SCRIPgrid_10x10min_nomask_c110228.nc
-lnd/clm2/mappingdata/grids/SCRIPgrid_10x10min_IGBPmergeICESatGIS_c110818.nc
-lnd/clm2/mappingdata/grids/SCRIPgrid_3minx3min_MODIS_c110915.nc
-lnd/clm2/mappingdata/grids/SCRIPgrid_3minx3min_MODISv2_c190503.nc
-lnd/clm2/mappingdata/grids/SCRIPgrid_3minx3min_MODISwcspsea_c151020.nc
-64bit_offset
-64bit_offset
-64bit_offset
-lnd/clm2/mappingdata/grids/SCRIPgrid_3x3_USGS_c120912.nc
-64bit_offset
-lnd/clm2/mappingdata/grids/SCRIPgrid_3minx3min_LandScan2004_c120517.nc
-64bit_offset
-lnd/clm2/mappingdata/grids/SCRIPgrid_3minx3min_GLOBE-Gardner_c120922.nc
-64bit_offset
-lnd/clm2/mappingdata/grids/SCRIPgrid_3minx3min_GLOBE-Gardner-mergeGIS_c120922.nc
-64bit_offset
-lnd/clm2/mappingdata/grids/SCRIPgrid_360x720_cruncep_c120830.nc
-lnd/clm2/mappingdata/grids/SCRIPgrid_360x720_nomask_c120830.nc
-lnd/clm2/mappingdata/grids/SCRIPgrid_0.9x1.25_GRDC_c130307.nc
+lnd/clm2/mappingdata/grids/SCRIPgrid_3x3min_nomask_c200309.nc
+64bit_offset
+
@@ -145,33 +111,56 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
/glade/proj3/cseg/mapping/grids/tx1v1_090122.nc
/glade/proj3/cseg/mapping/grids/tx0.1v2_090127.nc
+
+
+
-MODIS-wCsp
-AVHRR
-AVHRR
-MODIS
-MODISv2
-MODIS
-MODISv2
-MODIS
-LandScan2004
-MODIS
-MODISv2
-ISRIC-WISE
-GLOBE-Gardner
-GLOBE-Gardner-mergeGIS
+nomask
+nomask
+nomask
+nomask
+nomask
+nomask
+nomask
+nomask
+nomask
+nomask
+nomask
+nomask
+nomask
+nomask
nomask
-USGS
+nomask
nomask
nomask
-IGBP-GSDP
-AVHRR
-AVHRR
-ORNL-Soil
-AVHRR
+nomask
+nomask
+nomask
+nomask
+nomask
HYDRO1K-merge-nomask
-GRDC
-cruncep
+nomask
+nomask
3x3min
@@ -188,7 +177,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
5x5min
3x3min
10x10min
-3x3min
+0.125x0.125
5x5min
10x10min
5x5min
@@ -198,7 +187,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
0.5x0.5
1km-merge-10min
0.9x1.25
-360x720cru
+0.5x0.5
mksrf_flakwat
@@ -228,11 +217,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
-lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190116/mksrf_lai_histclm52deg005_earthstatmirca_2005.c190119.nc
-lnd/clm2/rawdata/pftcftlandusedynharv.0.25x0.25.MODIS.simyr1850-2015.c170412/mksrf_lai_78pfts_simyr2005.c170413.nc
@@ -240,38 +229,38 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
lnd/clm2/rawdata/mksrf_irrig_2160x4320_simyr2000.c110527.nc
-lnd/clm2/rawdata/mksrf_soitex.10level.c010119.nc
-lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190116/mksrf_soilcolor_histclm52deg005_earthstatmirca_2005.c190116.nc
-lnd/clm2/rawdata/pftcftlandusedynharv.0.25x0.25.MODIS.simyr1850-2015.c170412/mksrf_soilcolor_CMIP6_simyr2005.c170623.nc
-lnd/clm2/rawdata/mksrf_organic_10level_5x5min_ISRIC-WISE-NCSCD_nlev7_c120830.nc
-lnd/clm2/rawdata/mksrf_fmax_3x3min_USGS_c120911.nc
+lnd/clm2/rawdata/mksrf_fmax_0.125x0.125_c200220.nc
-lnd/clm2/rawdata/mksrf_LakePnDepth_3x3min_simyr2004_csplk_c151015.nc
-lnd/clm2/rawdata/mksrf_lanwat.050425.nc
-lnd/clm2/rawdata/mksrf_vocef_0.5x0.5_simyr2000.c110531.nc
-lnd/clm2/rawdata/mksrf_urban_0.05x0.05_simyr2000.c120621.nc
-lnd/clm2/rawdata/mksrf_urban_0.05x0.05_zerourbanpct.c181014.nc
@@ -287,45 +276,45 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
initial conditions to match CISM. At that point, the need for the "mergeGreenland"
version of the raw dataset will probably go away.
-->
-lnd/clm2/rawdata/mksrf_glacier_3x3min_simyr2000.c120926.nc
-lnd/clm2/rawdata/mksrf_glacier_3x3min_simyr2000_mergeGreenland.c120921.nc
lnd/clm2/rawdata/mksrf_GlacierRegion_10x10min_nomask_c170616.nc
+>lnd/clm2/rawdata/mksrf_GlacierRegion_10x10min_nomask_c191120.nc
lnd/clm2/rawdata/mksrf_topo.10min.c080912.nc
+>lnd/clm2/rawdata/mksrf_topo.10min.c191120.nc
-lnd/clm2/rawdata/mksrf_gdp_0.5x0.5_AVHRR_simyr2000.c130228.nc
-lnd/clm2/rawdata/mksrf_gdp_0.5x0_zerogdp.c200413.nc
-lnd/clm2/rawdata/mksrf_peatf_0.5x0.5_AVHRR_simyr2000.c130228.nc
-lnd/clm2/rawdata/mksf_soilthk_5x5min_ORNL-Soil_simyr1900-2015_c170630.nc
-lnd/clm2/rawdata/mksrf_abm_0.5x0.5_AVHRR_simyr2000.c130201.nc
-lnd/clm2/rawdata/mksrf_abm_0.5x0.5_missingabm.c200413.nc
lnd/clm2/rawdata/mksrf_topostats_1km-merge-10min_HYDRO1K-merge-nomask_simyr2000.c130402.nc
-lnd/clm2/rawdata/mksrf_vic_0.9x1.25_GRDC_simyr2000.c130307.nc
-lnd/clm2/rawdata/mksrf_ch4inversion_360x720_cruncep_simyr2000.c130322.nc
+lnd/clm2/rawdata/mksrf_ch4inversion_0.5x0.5_cruncep_simyr2000.c191112.nc
diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml
index d74989889c..a310182849 100644
--- a/bld/namelist_files/namelist_definition_ctsm.xml
+++ b/bld/namelist_files/namelist_definition_ctsm.xml
@@ -306,16 +306,6 @@ Critical threshold of negative Nitrogen to die (abort when Nitrogen states are b
Critical threshold of negative Carbon to die (abort when Carbon states are below this value)
-
-Initial stocks of Carbon to use in soil organic matter pools for CENTURY decomposition
-
-
-
-Soil depth to place initial stocks of Carbon in soil organic matter pools for CENTURY decomposition
-
-
Slope of free living Nitrogen fixation with annual ET
@@ -1636,6 +1626,11 @@ Simulation year that aligns with stream_year_first_ndep value
Filename of input stream data for Nitrogen Deposition
+
+Stream meshfile for Nitrogen Deposition data
+
+
Time interpolation mode to determine how to handle data before and after the times in the file
@@ -1676,6 +1671,12 @@ Filename of input stream data for finundated inversion of observed (from Prigent
to hydrologic variables (either TWS or ZWT)
+
+mesh filename of input stream data for finundated inversion of observed (from Prigent dataset)
+to hydrologic variables (either TWS or ZWT)
+
+
@@ -1751,6 +1752,11 @@ Simulation year that aligns with stream_year_first_lai value
Filename of input stream data for LAI
+
+Filename of input stream data for LAI
+
+
Time interpolation method to use with LAI streams
@@ -1792,6 +1798,11 @@ Simulation year that aligns with stream_year_first_lightng value
Filename of input stream data for Lightning
+
+Stream meshfile for Nitrogen Deposition data
+
+
Time interpolation method to use with Lightning streams
@@ -1834,6 +1845,11 @@ Simulation year that aligns with stream_year_first_popdens value
Filename of input stream data for human population density
+
+mesh file for input stream data for human population density
+
+
Time interpolation method to use with human population density streams
@@ -1876,6 +1892,11 @@ Simulation year that aligns with stream_year_first_urbantv value
Filename of input stream data for urban time varying
+
+mesh filename of input stream data for urban time varying
+
+
Time interpolation method to use with urban time varying streams
diff --git a/bld/namelist_files/use_cases/1850_noanthro_control.xml b/bld/namelist_files/use_cases/1850_noanthro_control.xml
index c998d97608..59d06b83b5 100644
--- a/bld/namelist_files/use_cases/1850_noanthro_control.xml
+++ b/bld/namelist_files/use_cases/1850_noanthro_control.xml
@@ -34,6 +34,7 @@
lnd/clm2/firedata/clmforc.no_anthro_zero_hdm_1x1_simyr1925_181113.nc
+none
nn
1850
diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl
index c12b0b211f..9282c5cfeb 100755
--- a/bld/unit_testers/build-namelist_test.pl
+++ b/bld/unit_testers/build-namelist_test.pl
@@ -84,6 +84,31 @@ sub make_config_cache {
$fh->close();
}
+sub cat_and_create_namelistinfile {
+#
+# Concatenate the user_nl_clm files together and turn it into a namelist input file
+# that can be read in by build-namelist
+#
+ my ($file1, $file2, $outfile) = @_;
+
+ my $fh = IO::File->new($file1, '<') or die "can't open file: $file1";
+ my $outfh = IO::File->new($outfile, '>') or die "can't open file: $outfile";
+ print $outfh "&clm_settings\n\n";
+ while ( my $line = <$fh> ) {
+ print $outfh " $line";
+ }
+ $fh->close();
+ if ( defined($file2) ) {
+ my $fh = IO::File->new($file2, '<') or die "can't open file: $file2";
+ while ( my $line = <$fh> ) {
+ print $outfh " $line";
+ }
+ }
+ print $outfh "\n/\n";
+ $fh->close();
+ $outfh->close();
+}
+
#
# Process command-line options.
#
@@ -138,9 +163,9 @@ sub make_config_cache {
#
# Figure out number of tests that will run
#
-my $ntests = 1552;
+my $ntests = 1740;
if ( defined($opts{'compare'}) ) {
- $ntests += 1044;
+ $ntests += 1185;
}
plan( tests=>$ntests );
@@ -323,6 +348,56 @@ sub make_config_cache {
}
&cleanup();
}
+print "\n===============================================================================\n";
+print "Test the NEON sites\n";
+print "=================================================================================\n";
+my $phys = "clm5_1";
+$mode = "-phys $phys";
+&make_config_cache($phys);
+my $neondir = "../../cime_config/usermods_dirs/NEON";
+foreach my $site ( "ABBY", "BLAN", "CPER", "DEJU", "GRSM", "HEAL", "KONA", "LENO", "NIWO",
+ "ONAQ", "PUUM", "SERC", "SRER", "TALL", "TREE", "WOOD", "BARR", "BONA",
+ "DCFS", "DELA", "GUAN", "JERC", "KONZ", "MLBS", "NOGP", "ORNL", "RMNP",
+ "SJER", "STEI", "TEAK", "UKFS", "WREF", "BART", "CLBJ", "DSNY", "HARV",
+ "JORN", "LAJA", "MOAB", "OAES", "OSBS", "SCBI", "SOAP", "STER", "TOOL",
+ "UNDE", "YELL"
+ ) {
+ &make_env_run();
+ #
+ # Concatonate default usermods and specific sitetogether expanding env variables while doing that
+ #
+ if ( ! -d "$neondir/$site" ) {
+ print "NEON directory is not there: $neondir/$site\n";
+ die "ERROR:: NEON site does not exist: $site\n";
+ }
+ my $neondefaultfile = "$neondir/defaults/user_nl_clm";
+ my $neonsitefile = "$neondir/$site/user_nl_clm";
+ if ( ! -f $neonsitefile ) {
+ $neonsitefile = undef;
+ }
+ $ENV{'NEONSITE'} = $site;
+ my $namelistfile = "temp.namelistinfile_$site";
+ &cat_and_create_namelistinfile( $neondefaultfile, $neonsitefile, $namelistfile );
+ #
+ # Now run the site
+ #
+ my $options = "-res CLM_USRDAT -clm_usr_name NEON -no-megan -bgc bgc -sim_year 2000 -infile $namelistfile";
+ eval{ system( "$bldnml -envxml_dir . $options > $tempfile 2>&1 " ); };
+ is( $@, '', "options: $options" );
+ $cfiles->checkfilesexist( "$options", $mode );
+ $cfiles->shownmldiff( "default", $mode );
+ if ( defined($opts{'compare'}) ) {
+ $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode );
+ $cfiles->dodiffonfile( "lnd_in", "$options", $mode );
+ $cfiles->dodiffonfile( "$real_par_file", "$options", $mode );
+ $cfiles->comparefiles( "$options", $mode, $opts{'compare'} );
+ }
+ if ( defined($opts{'generate'}) ) {
+ $cfiles->copyfiles( "$options", $mode );
+ }
+ system( "/bin/rm $namelistfile" );
+ &cleanup();
+}
print "\n===============================================================================\n";
print "Test some CAM specific setups for special grids \n";
diff --git a/cime_config/buildlib b/cime_config/buildlib
index 55c47be4e9..9b9b7da78f 100755
--- a/cime_config/buildlib
+++ b/cime_config/buildlib
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
build ctsm library
diff --git a/cime_config/buildnml b/cime_config/buildnml
index 725f636642..e3f6a5b933 100755
--- a/cime_config/buildnml
+++ b/cime_config/buildnml
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
CTSM namelist creator
@@ -62,6 +62,7 @@ def buildnml(case, caseroot, compname):
glc_nec = case.get_value("GLC_NEC")
cism_use_antarctica = case.get_value("CISM_USE_ANTARCTICA")
mask = case.get_value("MASK_GRID")
+ driver = case.get_value("COMP_INTERFACE").lower()
# -----------------------------------------------------
# Set ctsmconf
@@ -231,12 +232,12 @@ def buildnml(case, caseroot, compname):
command = ("%s -cimeroot %s -infile %s -csmdata %s -inputdata %s %s -namelist \"&clm_inparm start_ymd=%s %s/ \" "
"%s %s -res %s %s -clm_start_type %s -envxml_dir %s "
"-configuration %s -structure %s "
- "-lnd_frac %s -glc_nec %s %s -co2_ppmv %s -co2_type %s -config %s "
+ "-lnd_frac %s -glc_nec %s %s -co2_ppmv %s -co2_type %s -config %s -driver %s "
"%s %s %s %s"
%(cmd, _CIMEROOT, infile, din_loc_root, inputdata_file, ignore, start_ymd, clm_namelist_opts,
nomeg, usecase, lnd_grid, clmusr, start_type, caseroot,
configuration, structure,
- lndfrac_file, glc_nec, glc_use_antarctica_flag, ccsm_co2_ppmv, clm_co2_type, config_cache_file,
+ lndfrac_file, glc_nec, glc_use_antarctica_flag, ccsm_co2_ppmv, clm_co2_type, config_cache_file, driver,
clm_bldnml_opts, spinup, tuning, gridmask))
rc, out, err = run_cmd(command, from_dir=ctsmconf)
diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml
index 51f8e4bd96..f1a57c8da0 100644
--- a/cime_config/config_component.xml
+++ b/cime_config/config_component.xml
@@ -288,7 +288,20 @@
User mods to apply to specific compset matches.
-
+
+ char
+
+ ABBY,BLAN,CPER,DEJU,GRSM,HEAL,KONA,LENO,NIWO,ONAQ,PUUM,SERC,SRER,TALL,TREE,WOOD,
+ BARR,BONA,DCFS,DELA,GUAN,JERC,KONZ,MLBS,NOGP,ORNL,RMNP,SJER,STEI,TEAK,UKFS,WREF,
+ BART,CLBJ,DSNY,HARV,JORN,LAJA,MOAB,OAES,OSBS,SCBI,SOAP,STER,TOOL,UNDE,YELL
+
+
+ run_component_ctsm
+ env_run.xml
+ Name of site for NEON tower data
+
+
+
=========================================
CLM naming conventions
=========================================
diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml
index 3c7e196178..421b4d5035 100644
--- a/cime_config/config_compsets.xml
+++ b/cime_config/config_compsets.xml
@@ -36,6 +36,16 @@
+
+ I1PtClm51Bgc
+ 2000_DATM%1PT_CLM51%BGC_SICE_SOCN_SROF_SGLC_SWAV
+
+
+
+ IHist1PtClm51Bgc
+ HIST_DATM%1PT_CLM51%BGC_SICE_SOCN_SROF_SGLC_SWAV
+
+
I1PtClm51SpRs
2000_DATM%1PT_CLM51%SP_SICE_SOCN_SROF_SGLC_SWAV
diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml
index 0de093b7c4..f0e7ac509b 100644
--- a/cime_config/testdefs/ExpectedTestFails.xml
+++ b/cime_config/testdefs/ExpectedTestFails.xml
@@ -30,73 +30,87 @@
-
-
+
+
FAIL
- #1117
+ ESCOMP/CMEPS#175
-
+
+
+ FAIL
+ ESMCI/cime#3915
+
+
+
+
+
+ FAIL
+ ESMCI/cime#3915
+
+
+
+
FAIL
- ESCOMP/CMEPS#175
+ #1317
-
+
FAIL
- ESMCI/cime#3905
+ #1317
-
-
+
+
FAIL
- ESMCI/cime#3905
+ #1356
-
-
+
+
FAIL
- ESMCI/cime#3915
+ #1356
-
-
+
+
FAIL
- ESMCI/cime#3915
+ #1356
-
+
FAIL
- #1317
+ #1356
-
+
FAIL
- #1317
+ #1356
-
-
+
+
FAIL
- ESMCI/cime#3496
+ #1356
-
-
+
+
FAIL
- ESMCI/cime#3496
+ #1356
diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml
index f7f2e3391e..9d37f60c48 100644
--- a/cime_config/testdefs/testlist_clm.xml
+++ b/cime_config/testdefs/testlist_clm.xml
@@ -271,6 +271,14 @@
+
+
+
+
+
+
+
+
@@ -948,7 +956,7 @@
-
+
@@ -957,7 +965,7 @@
-
+
@@ -1157,7 +1165,7 @@
-
+
@@ -1191,7 +1199,7 @@
-
+
@@ -1200,7 +1208,7 @@
-
+
@@ -1521,7 +1529,7 @@
-
+
@@ -1529,7 +1537,7 @@
-
+
@@ -1537,7 +1545,7 @@
-
+
@@ -1662,7 +1670,7 @@
-
+
@@ -1672,7 +1680,18 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1680,9 +1699,10 @@
+
-
+
@@ -1754,7 +1774,7 @@
-
+
@@ -2314,7 +2334,19 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cime_config/testdefs/testmods_dirs/clm/CLM1PTStartDate/shell_commands b/cime_config/testdefs/testmods_dirs/clm/CLM1PTStartDate/shell_commands
new file mode 100644
index 0000000000..51be6f9abb
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/CLM1PTStartDate/shell_commands
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+if [ "`./xmlquery ATM_GRID --value`" == "1x1_vancouverCAN" ]; then
+ # Go one day in, so don't have to set the TOD as well
+ ./xmlchange RUN_STARTDATE="1992-08-13"
+elif [ "`./xmlquery ATM_GRID --value`" == "1x1_mexicocityMEX" ]; then
+ # Go one day in, so don't have to set the TOD as well
+ ./xmlchange RUN_STARTDATE="1993-12-02"
+elif [ "`./xmlquery ATM_GRID --value`" == "1x1_urbanc_alpha" ]; then
+ # Go one day in, so don't have to set the TOD as well
+ ./xmlchange RUN_STARTDATE="0001-08-13"
+#
+# Otherwise let this be set by the specific site
+#
+fi
+
diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDefCH4/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefCH4/include_user_mods
new file mode 100644
index 0000000000..1f2c03aebe
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefCH4/include_user_mods
@@ -0,0 +1 @@
+../FatesColdDef
diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDefCH4/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefCH4/user_nl_clm
new file mode 100644
index 0000000000..10ce93bcd1
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefCH4/user_nl_clm
@@ -0,0 +1 @@
+use_lch4 = .true.
diff --git a/cime_config/testdefs/testmods_dirs/clm/NEON_NIWO/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/NEON_NIWO/include_user_mods
new file mode 100644
index 0000000000..56aab07c3e
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/NEON_NIWO/include_user_mods
@@ -0,0 +1 @@
+../../../../usermods_dirs/NEON/NIWO
diff --git a/cime_config/testdefs/testmods_dirs/clm/USUMB_mct/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/USUMB_mct/include_user_mods
new file mode 100644
index 0000000000..3e31b09d16
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/USUMB_mct/include_user_mods
@@ -0,0 +1 @@
+../CLM1PTStartDate
diff --git a/cime_config/testdefs/testmods_dirs/clm/USUMB/shell_commands b/cime_config/testdefs/testmods_dirs/clm/USUMB_mct/shell_commands
similarity index 100%
rename from cime_config/testdefs/testmods_dirs/clm/USUMB/shell_commands
rename to cime_config/testdefs/testmods_dirs/clm/USUMB_mct/shell_commands
diff --git a/cime_config/testdefs/testmods_dirs/clm/USUMB/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/USUMB_mct/user_nl_clm
similarity index 100%
rename from cime_config/testdefs/testmods_dirs/clm/USUMB/user_nl_clm
rename to cime_config/testdefs/testmods_dirs/clm/USUMB_mct/user_nl_clm
diff --git a/cime_config/testdefs/testmods_dirs/clm/USUMB_nuopc/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/USUMB_nuopc/include_user_mods
new file mode 100644
index 0000000000..3e31b09d16
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/USUMB_nuopc/include_user_mods
@@ -0,0 +1 @@
+../CLM1PTStartDate
diff --git a/cime_config/testdefs/testmods_dirs/clm/USUMB_nuopc/shell_commands b/cime_config/testdefs/testmods_dirs/clm/USUMB_nuopc/shell_commands
new file mode 100755
index 0000000000..08a9014abe
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/USUMB_nuopc/shell_commands
@@ -0,0 +1,17 @@
+# shell commands to execute xmlchange commands written by PTCLMmkdata:
+# ./PTCLMmkdata --cesm_root ../../../.. -s US-UMB -d /glade/p/cesm/cseg/inputdata --mydatadir=/glade/p/cesm/cseg/inputdata/lnd/clm2/PTCLMmydatafiles.c171024
+./xmlchange CLM_USRDAT_NAME=1x1pt_US-UMB
+./xmlchange DATM_YR_START=1999
+./xmlchange DATM_YR_END=2006
+# Comment this out if NINST_LND is greater than 1 (see: http://bugs.cgd.ucar.edu/show_bug.cgi?id=2521)
+./xmlchange MPILIB=mpi-serial
+./xmlchange --append CLM_BLDNML_OPTS='-mask navy -no-crop'
+./xmlchange CALENDAR=GREGORIAN
+./xmlchange DOUT_S=FALSE
+./xmlchange ATM_NCPL=24
+./xmlchange RUN_STARTDATE=1999-01-01
+./xmlchange DATM_YR_ALIGN=1999
+./xmlchange DIN_LOC_ROOT=/glade/p/cesm/cseg/inputdata
+./xmlchange DIN_LOC_ROOT_CLMFORC=/glade/p/cesm/cseg/inputdata/lnd/clm2/PTCLMmydatafiles.c171024
+./xmlchange PTS_LON=275.2862
+./xmlchange PTS_LAT=45.5598
diff --git a/cime_config/testdefs/testmods_dirs/clm/USUMB_nuopc/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/USUMB_nuopc/user_nl_clm
new file mode 100644
index 0000000000..38ce400297
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/USUMB_nuopc/user_nl_clm
@@ -0,0 +1,5 @@
+! user_nl_clm namelist options written by PTCLMmkdata:
+! ./PTCLMmkdata --cesm_root ../../../.. -s US-UMB -d /glade/p/cesm/cseg/inputdata --mydatadir=/glade/p/cesm/cseg/inputdata/lnd/clm2/PTCLMmydatafiles.c171024
+ fsurdat = '/glade/p/cesm/cseg/inputdata/lnd/clm2/PTCLMmydatafiles.c171024/1x1pt_US-UMB/surfdata_1x1pt_US-UMB_16pfts_Irrig_CMIP6_simyr2000_c171024.nc'
+ hist_nhtfrq = 0
+ hist_mfilt = 1200
diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/README b/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/README
new file mode 100644
index 0000000000..e8eee75e53
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/README
@@ -0,0 +1,8 @@
+This points to an alternate params file with
+rf_cwdl2_bgc = 0.5
+rf_cwdl3_bgc = 0.5
+while by default these parameters equal zero.
+
+The test outputs inactive history fields that would contain zeros
+when running with the default params file and should be greater than zero
+when running with the alternate params file.
diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/include_user_mods
new file mode 100644
index 0000000000..ce640345c5
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/include_user_mods
@@ -0,0 +1 @@
+../ciso
diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm
new file mode 100644
index 0000000000..7f8887875c
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm
@@ -0,0 +1,2 @@
+paramfile = '/glade/p/cesm/cseg/inputdata/lnd/clm2/paramdata/ctsm51_params.c210624.nc'
+hist_fincl1 = 'CWDC_HR','C13_CWDC_HR','C14_CWDC_HR','CWD_HR_L2','CWD_HR_L2_vr','CWD_HR_L3','CWD_HR_L3_vr'
diff --git a/cime_config/testdefs/testmods_dirs/clm/cplhist/shell_commands b/cime_config/testdefs/testmods_dirs/clm/cplhist/shell_commands
index f33e602348..ac079d5334 100755
--- a/cime_config/testdefs/testmods_dirs/clm/cplhist/shell_commands
+++ b/cime_config/testdefs/testmods_dirs/clm/cplhist/shell_commands
@@ -1,5 +1,12 @@
+driver=`./xmlquery --value COMP_INTERFACE`
+if [ "$driver" = "nuopc" ]; then
+ ./xmlchange DATM_YR_ALIGN=1
+ ./xmlchange DATM_YR_END=84
+ ./xmlchange DATM_YR_START=82
+else
+ ./xmlchange DATM_CPLHIST_YR_ALIGN=1
+ ./xmlchange DATM_CPLHIST_YR_END=84
+ ./xmlchange DATM_CPLHIST_YR_START=82
+fi
./xmlchange DATM_CPLHIST_CASE=b.e20.B1850.f09_g17.pi_control.all.221.cplhist
./xmlchange DATM_CPLHIST_DIR=/glade/p/cesm/bgcwg_dev/forcing/b.e20.B1850.f09_g17.pi_control.all.221.cplhist/cpl/hist.mon
-./xmlchange DATM_CPLHIST_YR_ALIGN=1
-./xmlchange DATM_CPLHIST_YR_END=84
-./xmlchange DATM_CPLHIST_YR_START=82
diff --git a/cime_config/testdefs/testmods_dirs/clm/default/shell_commands b/cime_config/testdefs/testmods_dirs/clm/default/shell_commands
index adebdc5743..45eb822729 100644
--- a/cime_config/testdefs/testmods_dirs/clm/default/shell_commands
+++ b/cime_config/testdefs/testmods_dirs/clm/default/shell_commands
@@ -2,4 +2,3 @@
./xmlchange CLM_BLDNML_OPTS="-fire_emis" --append
./xmlchange BFBFLAG="TRUE"
-
diff --git a/cime_config/testdefs/testmods_dirs/clm/output_sp_highfreq/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/output_sp_highfreq/include_user_mods
index 8c117e01ed..2df730d2d0 100644
--- a/cime_config/testdefs/testmods_dirs/clm/output_sp_highfreq/include_user_mods
+++ b/cime_config/testdefs/testmods_dirs/clm/output_sp_highfreq/include_user_mods
@@ -1,2 +1,3 @@
+../CLM1PTStartDate
../../../../usermods_dirs/output_sp_highfreq
../basic
diff --git a/cime_config/usermods_dirs/NEON/ABBY/include_user_mods b/cime_config/usermods_dirs/NEON/ABBY/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/ABBY/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/ABBY/shell_commands b/cime_config/usermods_dirs/NEON/ABBY/shell_commands
new file mode 100644
index 0000000000..08f6e7cdef
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/ABBY/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=ABBY
+./xmlchange PTS_LON=237.67032799999998
+./xmlchange PTS_LAT=45.762378
diff --git a/cime_config/usermods_dirs/NEON/BARR/include_user_mods b/cime_config/usermods_dirs/NEON/BARR/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/BARR/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/BARR/shell_commands b/cime_config/usermods_dirs/NEON/BARR/shell_commands
new file mode 100644
index 0000000000..4a5a06b0bd
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/BARR/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=BARR
+./xmlchange PTS_LON=203.349781
+./xmlchange PTS_LAT=71.281711
diff --git a/cime_config/usermods_dirs/NEON/BART/include_user_mods b/cime_config/usermods_dirs/NEON/BART/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/BART/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/BART/shell_commands b/cime_config/usermods_dirs/NEON/BART/shell_commands
new file mode 100644
index 0000000000..a4e86a1b8c
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/BART/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=BART
+./xmlchange PTS_LON=288.71166
+./xmlchange PTS_LAT=44.06516
diff --git a/cime_config/usermods_dirs/NEON/BLAN/include_user_mods b/cime_config/usermods_dirs/NEON/BLAN/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/BLAN/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/BLAN/shell_commands b/cime_config/usermods_dirs/NEON/BLAN/shell_commands
new file mode 100644
index 0000000000..cb093d806a
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/BLAN/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=BLAN
+./xmlchange PTS_LON=281.92885
+./xmlchange PTS_LAT=39.06044
diff --git a/cime_config/usermods_dirs/NEON/BONA/include_user_mods b/cime_config/usermods_dirs/NEON/BONA/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/BONA/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/BONA/shell_commands b/cime_config/usermods_dirs/NEON/BONA/shell_commands
new file mode 100644
index 0000000000..2a66d148b4
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/BONA/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=BONA
+./xmlchange PTS_LON=212.49806
+./xmlchange PTS_LAT=65.15333
diff --git a/cime_config/usermods_dirs/NEON/CLBJ/include_user_mods b/cime_config/usermods_dirs/NEON/CLBJ/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/CLBJ/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/CLBJ/shell_commands b/cime_config/usermods_dirs/NEON/CLBJ/shell_commands
new file mode 100644
index 0000000000..c1b9154027
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/CLBJ/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=CLBJ
+./xmlchange PTS_LON=262.43275
+./xmlchange PTS_LAT=33.40143
diff --git a/cime_config/usermods_dirs/NEON/CPER/include_user_mods b/cime_config/usermods_dirs/NEON/CPER/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/CPER/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/CPER/shell_commands b/cime_config/usermods_dirs/NEON/CPER/shell_commands
new file mode 100644
index 0000000000..169b358a40
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/CPER/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=CPER
+./xmlchange PTS_LON=255.25545
+./xmlchange PTS_LAT=40.81297
diff --git a/cime_config/usermods_dirs/NEON/DCFS/include_user_mods b/cime_config/usermods_dirs/NEON/DCFS/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/DCFS/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/DCFS/shell_commands b/cime_config/usermods_dirs/NEON/DCFS/shell_commands
new file mode 100644
index 0000000000..a6cbed64e1
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/DCFS/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=DCFS
+./xmlchange PTS_LON=260.88749
+./xmlchange PTS_LAT=47.15919
diff --git a/cime_config/usermods_dirs/NEON/DEJU/include_user_mods b/cime_config/usermods_dirs/NEON/DEJU/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/DEJU/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/DEJU/shell_commands b/cime_config/usermods_dirs/NEON/DEJU/shell_commands
new file mode 100644
index 0000000000..fce519d559
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/DEJU/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=DEJU
+./xmlchange PTS_LON=214.25235
+./xmlchange PTS_LAT=63.87983
diff --git a/cime_config/usermods_dirs/NEON/DELA/include_user_mods b/cime_config/usermods_dirs/NEON/DELA/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/DELA/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/DELA/shell_commands b/cime_config/usermods_dirs/NEON/DELA/shell_commands
new file mode 100644
index 0000000000..f3acbb8fd3
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/DELA/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=DELA
+./xmlchange PTS_LON=272.19659
+./xmlchange PTS_LAT=32.54092
diff --git a/cime_config/usermods_dirs/NEON/DSNY/include_user_mods b/cime_config/usermods_dirs/NEON/DSNY/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/DSNY/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/DSNY/shell_commands b/cime_config/usermods_dirs/NEON/DSNY/shell_commands
new file mode 100644
index 0000000000..8304c91d48
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/DSNY/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=DSNY
+./xmlchange PTS_LON=278.56606
+./xmlchange PTS_LAT=28.12919
diff --git a/cime_config/usermods_dirs/NEON/GRSM/include_user_mods b/cime_config/usermods_dirs/NEON/GRSM/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/GRSM/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/GRSM/shell_commands b/cime_config/usermods_dirs/NEON/GRSM/shell_commands
new file mode 100644
index 0000000000..e52a633408
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/GRSM/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=GRSM
+./xmlchange PTS_LON=276.49815
+./xmlchange PTS_LAT=35.68839
diff --git a/cime_config/usermods_dirs/NEON/GUAN/include_user_mods b/cime_config/usermods_dirs/NEON/GUAN/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/GUAN/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/GUAN/shell_commands b/cime_config/usermods_dirs/NEON/GUAN/shell_commands
new file mode 100644
index 0000000000..4d750b77f8
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/GUAN/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=GUAN
+./xmlchange PTS_LON=293.13112
+./xmlchange PTS_LAT=17.96882
diff --git a/cime_config/usermods_dirs/NEON/HARV/include_user_mods b/cime_config/usermods_dirs/NEON/HARV/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/HARV/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/HARV/shell_commands b/cime_config/usermods_dirs/NEON/HARV/shell_commands
new file mode 100644
index 0000000000..839ccf5d8f
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/HARV/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=HARV
+./xmlchange PTS_LON=287.82438
+./xmlchange PTS_LAT=42.53562
diff --git a/cime_config/usermods_dirs/NEON/HEAL/include_user_mods b/cime_config/usermods_dirs/NEON/HEAL/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/HEAL/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/HEAL/shell_commands b/cime_config/usermods_dirs/NEON/HEAL/shell_commands
new file mode 100644
index 0000000000..21892219e0
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/HEAL/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=HEAL
+./xmlchange PTS_LON=210.78461
+./xmlchange PTS_LAT=63.8798
diff --git a/cime_config/usermods_dirs/NEON/JERC/include_user_mods b/cime_config/usermods_dirs/NEON/JERC/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/JERC/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/JERC/shell_commands b/cime_config/usermods_dirs/NEON/JERC/shell_commands
new file mode 100644
index 0000000000..80f66d23a2
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/JERC/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=JERC
+./xmlchange PTS_LON=275.53353
+./xmlchange PTS_LAT=31.19608
diff --git a/cime_config/usermods_dirs/NEON/JORN/include_user_mods b/cime_config/usermods_dirs/NEON/JORN/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/JORN/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/JORN/shell_commands b/cime_config/usermods_dirs/NEON/JORN/shell_commands
new file mode 100644
index 0000000000..87fc3b8c1e
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/JORN/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=JORN
+./xmlchange PTS_LON=253.15623
+./xmlchange PTS_LAT=32.59052
diff --git a/cime_config/usermods_dirs/NEON/KONA/include_user_mods b/cime_config/usermods_dirs/NEON/KONA/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/KONA/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/KONA/shell_commands b/cime_config/usermods_dirs/NEON/KONA/shell_commands
new file mode 100644
index 0000000000..c00e220e77
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/KONA/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=KONA
+./xmlchange PTS_LON=263.38956
+./xmlchange PTS_LAT=39.10828
diff --git a/cime_config/usermods_dirs/NEON/KONZ/include_user_mods b/cime_config/usermods_dirs/NEON/KONZ/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/KONZ/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/KONZ/shell_commands b/cime_config/usermods_dirs/NEON/KONZ/shell_commands
new file mode 100644
index 0000000000..bda370c170
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/KONZ/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=KONZ
+./xmlchange PTS_LON=263.43773
+./xmlchange PTS_LAT=39.1007
diff --git a/cime_config/usermods_dirs/NEON/LAJA/include_user_mods b/cime_config/usermods_dirs/NEON/LAJA/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/LAJA/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/LAJA/shell_commands b/cime_config/usermods_dirs/NEON/LAJA/shell_commands
new file mode 100644
index 0000000000..330690c330
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/LAJA/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=LAJA
+./xmlchange PTS_LON=292.92392
+./xmlchange PTS_LAT=18.02184
diff --git a/cime_config/usermods_dirs/NEON/LENO/include_user_mods b/cime_config/usermods_dirs/NEON/LENO/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/LENO/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/LENO/shell_commands b/cime_config/usermods_dirs/NEON/LENO/shell_commands
new file mode 100644
index 0000000000..57ad7f93dc
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/LENO/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=LENO
+./xmlchange PTS_LON=271.83897
+./xmlchange PTS_LAT=31.8531
diff --git a/cime_config/usermods_dirs/NEON/MLBS/include_user_mods b/cime_config/usermods_dirs/NEON/MLBS/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/MLBS/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/MLBS/shell_commands b/cime_config/usermods_dirs/NEON/MLBS/shell_commands
new file mode 100644
index 0000000000..1be53ef6f7
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/MLBS/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=MLBS
+./xmlchange PTS_LON=279.47575
+./xmlchange PTS_LAT=37.37783
diff --git a/cime_config/usermods_dirs/NEON/MOAB/include_user_mods b/cime_config/usermods_dirs/NEON/MOAB/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/MOAB/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/MOAB/shell_commands b/cime_config/usermods_dirs/NEON/MOAB/shell_commands
new file mode 100644
index 0000000000..5d422153a4
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/MOAB/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=MOAB
+./xmlchange PTS_LON=250.61118
+./xmlchange PTS_LAT=38.25136
diff --git a/cime_config/usermods_dirs/NEON/NIWO/include_user_mods b/cime_config/usermods_dirs/NEON/NIWO/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/NIWO/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/NIWO/shell_commands b/cime_config/usermods_dirs/NEON/NIWO/shell_commands
new file mode 100644
index 0000000000..a3e73ca343
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/NIWO/shell_commands
@@ -0,0 +1,4 @@
+./xmlchange NEONSITE=NIWO
+./xmlchange PTS_LON=254.41676
+./xmlchange PTS_LAT=40.05236
+./xmlchange DATM_YR_END=2018
diff --git a/cime_config/usermods_dirs/NEON/NOGP/include_user_mods b/cime_config/usermods_dirs/NEON/NOGP/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/NOGP/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/NOGP/shell_commands b/cime_config/usermods_dirs/NEON/NOGP/shell_commands
new file mode 100644
index 0000000000..ad3ef69cd2
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/NOGP/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=NOGP
+./xmlchange PTS_LON=259.08168
+./xmlchange PTS_LAT=46.76846
diff --git a/cime_config/usermods_dirs/NEON/OAES/include_user_mods b/cime_config/usermods_dirs/NEON/OAES/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/OAES/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/OAES/shell_commands b/cime_config/usermods_dirs/NEON/OAES/shell_commands
new file mode 100644
index 0000000000..2a5cfb87e4
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/OAES/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=OAES
+./xmlchange PTS_LON=260.93956000000003
+./xmlchange PTS_LAT=35.41062
diff --git a/cime_config/usermods_dirs/NEON/ONAQ/include_user_mods b/cime_config/usermods_dirs/NEON/ONAQ/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/ONAQ/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/ONAQ/shell_commands b/cime_config/usermods_dirs/NEON/ONAQ/shell_commands
new file mode 100644
index 0000000000..0f8ca8b0dd
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/ONAQ/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=ONAQ
+./xmlchange PTS_LON=276.49815
+./xmlchange PTS_LAT=35.68839
diff --git a/cime_config/usermods_dirs/NEON/ORNL/include_user_mods b/cime_config/usermods_dirs/NEON/ORNL/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/ORNL/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/ORNL/shell_commands b/cime_config/usermods_dirs/NEON/ORNL/shell_commands
new file mode 100644
index 0000000000..264d451753
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/ORNL/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=ORNL
+./xmlchange PTS_LON=275.83419000000004
+./xmlchange PTS_LAT=35.57525
diff --git a/cime_config/usermods_dirs/NEON/OSBS/include_user_mods b/cime_config/usermods_dirs/NEON/OSBS/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/OSBS/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/OSBS/shell_commands b/cime_config/usermods_dirs/NEON/OSBS/shell_commands
new file mode 100644
index 0000000000..385021f98a
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/OSBS/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=OSBS
+./xmlchange PTS_LON=278.00655
+./xmlchange PTS_LAT=29.68819
diff --git a/cime_config/usermods_dirs/NEON/PUUM/include_user_mods b/cime_config/usermods_dirs/NEON/PUUM/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/PUUM/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/PUUM/shell_commands b/cime_config/usermods_dirs/NEON/PUUM/shell_commands
new file mode 100644
index 0000000000..07c4331769
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/PUUM/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=PUUM
+./xmlchange PTS_LON=204.68269
+./xmlchange PTS_LAT=19.55309
diff --git a/cime_config/usermods_dirs/NEON/RMNP/include_user_mods b/cime_config/usermods_dirs/NEON/RMNP/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/RMNP/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/RMNP/shell_commands b/cime_config/usermods_dirs/NEON/RMNP/shell_commands
new file mode 100644
index 0000000000..8dfbf0fa0d
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/RMNP/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=RMNP
+./xmlchange PTS_LON=254.45476
+./xmlchange PTS_LAT=40.27707
diff --git a/cime_config/usermods_dirs/NEON/SCBI/include_user_mods b/cime_config/usermods_dirs/NEON/SCBI/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/SCBI/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/SCBI/shell_commands b/cime_config/usermods_dirs/NEON/SCBI/shell_commands
new file mode 100644
index 0000000000..aa42b8022c
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/SCBI/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=SCBI
+./xmlchange PTS_LON=281.86235999999997
+./xmlchange PTS_LAT=38.89209
diff --git a/cime_config/usermods_dirs/NEON/SERC/include_user_mods b/cime_config/usermods_dirs/NEON/SERC/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/SERC/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/SERC/shell_commands b/cime_config/usermods_dirs/NEON/SERC/shell_commands
new file mode 100644
index 0000000000..1053e2dc17
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/SERC/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=SERC
+./xmlchange PTS_LON=283.44115999999997
+./xmlchange PTS_LAT=38.89124
diff --git a/cime_config/usermods_dirs/NEON/SJER/include_user_mods b/cime_config/usermods_dirs/NEON/SJER/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/SJER/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/SJER/shell_commands b/cime_config/usermods_dirs/NEON/SJER/shell_commands
new file mode 100644
index 0000000000..45de246989
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/SJER/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=SJER
+./xmlchange PTS_LON=240.267
+./xmlchange PTS_LAT=37.107117
diff --git a/cime_config/usermods_dirs/NEON/SOAP/include_user_mods b/cime_config/usermods_dirs/NEON/SOAP/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/SOAP/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/SOAP/shell_commands b/cime_config/usermods_dirs/NEON/SOAP/shell_commands
new file mode 100644
index 0000000000..c10274c047
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/SOAP/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=SOAP
+./xmlchange PTS_LON=240.7379
+./xmlchange PTS_LAT=37.03269
diff --git a/cime_config/usermods_dirs/NEON/SRER/include_user_mods b/cime_config/usermods_dirs/NEON/SRER/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/SRER/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/SRER/shell_commands b/cime_config/usermods_dirs/NEON/SRER/shell_commands
new file mode 100644
index 0000000000..be1bec52d3
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/SRER/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=SRER
+./xmlchange PTS_LON=249.16451
+./xmlchange PTS_LAT=31.91068
diff --git a/cime_config/usermods_dirs/NEON/STEI/include_user_mods b/cime_config/usermods_dirs/NEON/STEI/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/STEI/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/STEI/shell_commands b/cime_config/usermods_dirs/NEON/STEI/shell_commands
new file mode 100644
index 0000000000..c2aced2c2e
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/STEI/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=STEI
+./xmlchange PTS_LON=270.4112
+./xmlchange PTS_LAT=45.5076
diff --git a/cime_config/usermods_dirs/NEON/STER/include_user_mods b/cime_config/usermods_dirs/NEON/STER/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/STER/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/STER/shell_commands b/cime_config/usermods_dirs/NEON/STER/shell_commands
new file mode 100644
index 0000000000..2c1699fc9c
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/STER/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=STER
+./xmlchange PTS_LON=256.96992
+./xmlchange PTS_LAT=40.45984
diff --git a/cime_config/usermods_dirs/NEON/TALL/include_user_mods b/cime_config/usermods_dirs/NEON/TALL/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/TALL/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/TALL/shell_commands b/cime_config/usermods_dirs/NEON/TALL/shell_commands
new file mode 100644
index 0000000000..1a176ae23f
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/TALL/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=TALL
+./xmlchange PTS_LON=272.6059
+./xmlchange PTS_LAT=32.95106
diff --git a/cime_config/usermods_dirs/NEON/TEAK/include_user_mods b/cime_config/usermods_dirs/NEON/TEAK/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/TEAK/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/TEAK/shell_commands b/cime_config/usermods_dirs/NEON/TEAK/shell_commands
new file mode 100644
index 0000000000..53ebedc664
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/TEAK/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=TEAK
+./xmlchange PTS_LON=240.99424199999999
+./xmlchange PTS_LAT=37.006472
diff --git a/cime_config/usermods_dirs/NEON/TOOL/include_user_mods b/cime_config/usermods_dirs/NEON/TOOL/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/TOOL/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/TOOL/shell_commands b/cime_config/usermods_dirs/NEON/TOOL/shell_commands
new file mode 100644
index 0000000000..21dee1eba2
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/TOOL/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=TOOL
+./xmlchange PTS_LON=210.629872
+./xmlchange PTS_LAT=68.66045
diff --git a/cime_config/usermods_dirs/NEON/TREE/include_user_mods b/cime_config/usermods_dirs/NEON/TREE/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/TREE/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/TREE/shell_commands b/cime_config/usermods_dirs/NEON/TREE/shell_commands
new file mode 100644
index 0000000000..6d0a4aa1fa
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/TREE/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=TREE
+./xmlchange PTS_LON=270.41252
+./xmlchange PTS_LAT=45.49266
diff --git a/cime_config/usermods_dirs/NEON/UKFS/include_user_mods b/cime_config/usermods_dirs/NEON/UKFS/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/UKFS/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/UKFS/shell_commands b/cime_config/usermods_dirs/NEON/UKFS/shell_commands
new file mode 100644
index 0000000000..7c8d4f8829
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/UKFS/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=UKFS
+./xmlchange PTS_LON=264.79505
+./xmlchange PTS_LAT=39.04168
diff --git a/cime_config/usermods_dirs/NEON/UNDE/include_user_mods b/cime_config/usermods_dirs/NEON/UNDE/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/UNDE/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/UNDE/shell_commands b/cime_config/usermods_dirs/NEON/UNDE/shell_commands
new file mode 100644
index 0000000000..79688e0a8f
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/UNDE/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=UNDE
+./xmlchange PTS_LON=270.6779
+./xmlchange PTS_LAT=46.14103
diff --git a/cime_config/usermods_dirs/NEON/WOOD/include_user_mods b/cime_config/usermods_dirs/NEON/WOOD/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/WOOD/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/WOOD/shell_commands b/cime_config/usermods_dirs/NEON/WOOD/shell_commands
new file mode 100644
index 0000000000..48ff0ef999
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/WOOD/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=WOOD
+./xmlchange PTS_LON=260.76093000000003
+./xmlchange PTS_LAT=47.12833
diff --git a/cime_config/usermods_dirs/NEON/WREF/include_user_mods b/cime_config/usermods_dirs/NEON/WREF/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/WREF/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/WREF/shell_commands b/cime_config/usermods_dirs/NEON/WREF/shell_commands
new file mode 100644
index 0000000000..77a0b750cd
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/WREF/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=WREF
+./xmlchange PTS_LON=238.04162
+./xmlchange PTS_LAT=45.81637
diff --git a/cime_config/usermods_dirs/NEON/YELL/include_user_mods b/cime_config/usermods_dirs/NEON/YELL/include_user_mods
new file mode 100644
index 0000000000..b152996d95
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/YELL/include_user_mods
@@ -0,0 +1 @@
+../defaults
diff --git a/cime_config/usermods_dirs/NEON/YELL/shell_commands b/cime_config/usermods_dirs/NEON/YELL/shell_commands
new file mode 100644
index 0000000000..a40ef81477
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/YELL/shell_commands
@@ -0,0 +1,3 @@
+./xmlchange NEONSITE=YELL
+./xmlchange PTS_LON=249.45803999999998
+./xmlchange PTS_LAT=44.95597
diff --git a/cime_config/usermods_dirs/NEON/defaults/shell_commands b/cime_config/usermods_dirs/NEON/defaults/shell_commands
new file mode 100644
index 0000000000..2ebe1b4f86
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/defaults/shell_commands
@@ -0,0 +1,6 @@
+./xmlchange CLM_USRDAT_NAME=NEON
+./xmlchange RUN_STARTDATE=2018-01-01
+./xmlchange CLM_NML_USE_CASE=1850-2100_SSP3-7.0_transient
+./xmlchange CCSM_CO2_PPMV=408.83
+./xmlchange DATM_PRESAERO=SSP3-7.0
+./xmlchange DATM_YR_ALIGN=2018,DATM_YR_END=2019,DATM_YR_START=2018
diff --git a/cime_config/usermods_dirs/NEON/defaults/user_nl_clm b/cime_config/usermods_dirs/NEON/defaults/user_nl_clm
new file mode 100644
index 0000000000..01db7d0380
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/defaults/user_nl_clm
@@ -0,0 +1,31 @@
+!----------------------------------------------------------------------------------
+! Users should add all user specific namelist changes below in the form of
+! namelist_var = new_namelist_value
+!
+! EXCEPTIONS:
+! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting
+! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting
+! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting
+! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting
+! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting
+! Set co2_ppmv with CCSM_CO2_PPMV option
+! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options
+! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases
+! (includes $inst_string for multi-ensemble cases)
+! or with CLM_FORCE_COLDSTART to do a cold start
+! or set it with an explicit filename here.
+! Set maxpatch_glcmec with GLC_NEC option
+! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable
+!----------------------------------------------------------------------------------
+
+flanduse_timeseries = ' ' ! This isn't needed for a non transient case, but will be once we start using transient compsets
+fsurdat = "$DIN_LOC_ROOT/lnd/clm2/surfdata_map/NEON/surfdata_hist_16pfts_Irrig_CMIP6_simyr2000_${NEONSITE}_c210513.nc"
+model_year_align_urbantv = 2018
+stream_year_first_urbantv = 2018
+stream_year_last_urbantv = 2019
+stream_year_first_ndep = 2018
+model_year_align_ndep = 2018
+stream_year_last_ndep = 2019
+model_year_align_popdens = 2018
+stream_year_first_popdens = 2018
+stream_year_last_popdens = 2019
diff --git a/cime_config/usermods_dirs/NEON/defaults/user_nl_cpl b/cime_config/usermods_dirs/NEON/defaults/user_nl_cpl
new file mode 100644
index 0000000000..e7f6c90a86
--- /dev/null
+++ b/cime_config/usermods_dirs/NEON/defaults/user_nl_cpl
@@ -0,0 +1,20 @@
+!------------------------------------------------------------------------
+! Users should ONLY USE user_nl_cpl to change namelists variables
+! for namelist variables in drv_in (except for the ones below) and
+! any keyword/values in seq_maps.rc
+! Users should add ALL user specific namelist and seq_maps.rc changes below
+! using the following syntax
+! namelist_var = new_namelist_value
+! or
+! mapname = new_map_name
+! For example to change the default value of ocn2atm_fmapname to 'foo' use
+! ocn2atm_fmapname = 'foo'
+!
+! Note that some namelist variables MAY NOT be changed in user_nl_cpl -
+! they are defined in a $CASEROOT xml file and must be changed with
+! xmlchange.
+!
+! For example, rather than set username to 'foo' in user_nl_cpl, call
+! ./xmlchange USER=foo
+!------------------------------------------------------------------------
+orb_iyear = 2018
diff --git a/cime_config/usermods_dirs/output_bgc/user_nl_clm b/cime_config/usermods_dirs/output_bgc/user_nl_clm
index 0c0bcd52ff..f7aaa09911 100644
--- a/cime_config/usermods_dirs/output_bgc/user_nl_clm
+++ b/cime_config/usermods_dirs/output_bgc/user_nl_clm
@@ -3,8 +3,8 @@
!----------------------------------------------------------------------------------
! h0 stream (monthly average, gridcell-level)
-hist_fexcl1 += 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'SOILC_vr','SOILN_vr', 'CWDC_vr', 'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr', 'CWDN_vr', 'SMIN_NO3_vr', 'CONC_O2_UNSAT', 'CONC_O2_SAT','SMIN_NH4_vr','SMINN_vr'
-hist_fincl1 += 'LEAFC_TO_LITTER', 'FROOTC_TO_LITTER','LITR1C_TO_SOIL1C','LITR1N_TO_SOIL1N','LITR2C_TO_SOIL1C', 'LITR2N_TO_SOIL1N','LITR3C_TO_SOIL2C','LITR3N_TO_SOIL2N','DWT_WOOD_PRODUCTC_GAIN_PATCH'
+hist_fexcl1 += 'ACT_SOMC_vr', 'ACT_SOMN_vr', 'SLO_SOMC_vr', 'SLO_SOMN_vr', 'PAS_SOMC_vr', 'PAS_SOMN_vr', 'SOILC_vr','SOILN_vr', 'CWDC_vr', 'MET_LITC_vr', 'CEL_LITC_vr', 'LIG_LITC_vr', 'MET_LITN_vr', 'CEL_LITN_vr', 'LIG_LITN_vr', 'CWDN_vr', 'SMIN_NO3_vr', 'CONC_O2_UNSAT', 'CONC_O2_SAT','SMIN_NH4_vr','SMINN_vr'
+hist_fincl1 += 'LEAFC_TO_LITTER', 'FROOTC_TO_LITTER','MET_LITC_TO_ACT_SOMC','MET_LITN_TO_ACT_SOMN','CEL_LITC_TO_ACT_SOMC', 'CEL_LITN_TO_ACT_SOMN','LIG_LITC_TO_SLO_SOMC','LIG_LITN_TO_SLO_SOMN','DWT_WOOD_PRODUCTC_GAIN_PATCH'
! h1 stream (monthly average, finest sub-grid)
hist_fincl2 += 'GPP', 'NPP', 'AGNPP', 'TOTVEGC', 'NPP_NUPTAKE', 'AR', 'HR', 'HTOP'
@@ -14,7 +14,7 @@ hist_fincl2 += 'GPP', 'NPP', 'AGNPP', 'TOTVEGC', 'NPP_NUPTAKE', 'AR', 'HR', 'HTO
hist_fincl3 += 'GPP', 'NPP', 'AR', 'HR', 'DWT_CONV_CFLUX_PATCH', 'WOOD_HARVESTC', 'DWT_WOOD_PRODUCTC_GAIN_PATCH', 'SLASH_HARVESTC', 'COL_FIRE_CLOSS', 'FROOTC:I', 'HTOP'
! h3 stream (yearly average, gridcell-level)
-hist_fincl4 += 'SOILC_vr', 'SOILN_vr', 'CWDC_vr', 'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr','CWDN_vr', 'TOTLITC:I', 'TOT_WOODPRODC:I', 'TOTSOMC:I','TOTVEGC:I'
+hist_fincl4 += 'SOILC_vr', 'SOILN_vr', 'CWDC_vr', 'MET_LITC_vr', 'CEL_LITC_vr', 'LIG_LITC_vr', 'MET_LITN_vr', 'CEL_LITN_vr', 'LIG_LITN_vr','CWDN_vr', 'TOTLITC:I', 'TOT_WOODPRODC:I', 'TOTSOMC:I','TOTVEGC:I'
! h4 stream (yearly average, landunit-level)
hist_fincl5 += 'TOTSOMC:I', 'TOTSOMC_1m:I', 'TOTECOSYSC:I', 'TOTVEGC:I', 'WOODC:I', 'TOTLITC:I', 'LIVECROOTC:I', 'DEADCROOTC:I', 'FROOTC:I'
diff --git a/doc/ChangeLog b/doc/ChangeLog
index fbdd413d1e..f8747837c6 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,4 +1,1165 @@
===============================================================
+Tag name: ctsm5.1.dev048
+Originator(s): slevis (Samuel Levis,SLevis Consulting,303-665-1310)
+Date: Sat Jul 10 11:39:55 MDT 2021
+One-line Summary: Make certain history fields descriptive inst. of labeling by number
+
+Purpose and description of changes
+----------------------------------
+
+ I used existing infrastructure to add descriptive strings to certain history
+ fields that I had labeled by number in #1340. While doing this, I applied the
+ change to a bunch of other history fields that needed it.
+
+ Some variable names for pools was also changed to use terms consistent with the new
+ names as well.
+
+
+Significant changes to scientifically-supported configurations
+--------------------------------------------------------------
+
+Does this tag change answers significantly for any of the following physics configurations?
+(Details of any changes will be given in the "Answer changes" section below.)
+
+ [Put an [X] in the box for any configuration with significant answer changes.]
+
+[ ] clm5_1
+
+[ ] clm5_0
+
+[ ] ctsm5_0-nwp
+
+[ ] clm4_5
+
+
+Bugs fixed or introduced
+------------------------
+Issues fixed (include CTSM Issue #): #1392
+ #1392 -- Some soil decomposition history fields have the pool number rather than a description in their name
+
+
+Notes of particular relevance for users
+---------------------------------------
+Caveats for users (e.g., need to interpolate initial conditions):
+ The names of certain history fields have changed to be more descriptive
+ in place of using numbers to differentiate them.
+
+ history field name change as follows...
+ LITR1 becomes MET_LIT (metabolic)
+ LITR2 becomes CEL_LIT (cellulosic)
+ LITR3 becomes LIG_LIT (lignin)
+ SOIL1 becomes ACT_SOM (active)
+ SOIL2 becomes SLO_SOM (slow)
+ SOIL3 becomes PAS_SOM (passive)
+
+Testing summary:
+----------------
+
+ build-namelist tests (if CLMBuildNamelist.pm has changed):
+
+ cheyenne - PASS
+
+ python testing (if python code has changed; see instructions in python/README.md; document testing done):
+
+ cheyenne - PASS
+
+ [PASS means all tests PASS; OK means tests PASS other than expected fails.]
+
+ regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):
+
+ cheyenne ---- OK
+ izumi ------- OK
+
+
+Answer changes
+--------------
+Changes answers relative to baseline: NO bit-for-bit
+
+
+Other details
+-------------
+Pull Requests that document the changes (include PR ids):
+ https://github.com/ESCOMP/ctsm/pull/1413
+
+===============================================================
+===============================================================
+Tag name: ctsm5.1.dev047
+Originator(s): mvertens (Mariana Vertenstein)
+Date: Thu Jul 8 12:03:31 MDT 2021
+One-line Summary: Start bounds at 1; remove references to MCT
+
+Purpose and description of changes
+----------------------------------
+
+Users: take note of (1), and in particular the caveat for users noted
+below (in the "Notes of particular relevance for users").
+
+(1) All global index arrays on a given processor now have a starting index of 1
+ - bounds_proc for each subgrid level has a starting index of 1 for each level
+ - bounds_clump for each subgrid level has a starting index of 1 for just
+ the first clump on the processor - but all the other clumps on the
+ processor do not start at 1 - but rather are offset with the number of
+ gridcells, columns, ...etc on the preceeding clumps
+
+(2) There are no longer any references to any mct data structures other than in the mct cap
+ - All references to gsmap have been removed from decompMod.F90 and
+ replaced with new global index arrays for the various subgrid levels
+ - decompInitMod has been refactored to calculated these global index
+ arrays using pure MPI rather than mct
+ - ncdio_pio_F90.in has been refactored to use the new global index
+ arrays rather than the gsmap data structures
+ - the data struture ldecomp is no longer needed
+ - the module spmdGathScatMod.F90 is no longer needed and has been removed
+
+Significant changes to scientifically-supported configurations
+--------------------------------------------------------------
+
+Does this tag change answers significantly for any of the following physics configurations?
+(Details of any changes will be given in the "Answer changes" section below.)
+
+ [Put an [X] in the box for any configuration with significant answer changes.]
+
+[ ] clm5_1
+
+[ ] clm5_0
+
+[ ] ctsm5_0-nwp
+
+[ ] clm4_5
+
+
+Bugs fixed or introduced
+------------------------
+Issues fixed (include CTSM Issue #):
+- Addresses the first part of ESCOMP/CTSM#293 (Rework threading to be
+ done at a higher level, simplifying array argument passing)
+
+Notes of particular relevance for users
+---------------------------------------
+Caveats for users (e.g., need to interpolate initial conditions):
+- Until now, if the model produced an error message with a gridcell or
+ subgrid index (e.g., "Error at p = 1234"), you could rerun the model
+ with write statements in conditionals like "if (p == 1234) then". With
+ the changes in this tag, this simple conditional is no longer
+ possible. Instead, you will need to also reference the processor
+ number that produces the error.
+
+ If the error message is produced in the lnd log file, then you can
+ have a conditional like:
+ if (masterproc .and. p == 1234) then
+
+ If the error message is produced in the cesm log file, then you can
+ have a conditional like:
+ if (iam == X .and. p == 1234) then
+
+ where X is the processor number that produced the message. On some
+ machines (including cheyenne), this processor number is printed at the
+ start of each line in the cesm log file. In addition, some aborts will
+ now print "proc_id = X", and that value can be used.
+
+ Soon we will update
+ https://escomp.github.io/ctsm-docs/versions/master/html/users_guide/trouble-shooting/trouble-shooting.html
+ to document the new recommended procedure.
+
+Testing summary:
+----------------
+ regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):
+
+ cheyenne ---- ok
+ izumi ------- ok
+
+Answer changes
+--------------
+
+Changes answers relative to baseline: NO
+
+Other details
+-------------
+Pull Requests that document the changes (include PR ids):
+https://github.com/ESCOMP/CTSM/pull/1420
+
+===============================================================
+===============================================================
+Tag name: ctsm5.1.dev046
+Originator(s): rgknox (Ryan Knox,,,)
+Date: Fri Jul 2 14:36:44 MDT 2021
+One-line Summary: Updating external fates has to tag sci.1.46.2_api.16.1.0. FATES side changes expand the FATES parameter file to include new fields (unused at present). This also includes sci.1.46.1_api.16.0.0 which contained a sublte bug-fix on how FATES passes fragmentation fluxes (correcting seed decay fragmentation).
+
+Purpose and description of changes
+----------------------------------
+
+ This change brings the fates external up to sci.1.46.2_api.16.1.0. FATES side changes expand
+ the FATES parameter file to include new fields.
+
+ New and UNUSED parameters include:
+ fates_hydr_htftype_node
+ fates_prt_organ_id
+ fates_hydr_organname_node
+ fates_litterclass_name
+ fates_allom_zroot_k
+ fates_allom_zroot_max_dbh
+ fates_allom_zroot_max_z
+ fates_allom_zroot_min_dbh
+ fates_allom_zroot_min_z
+ fates_hydr_k_lwp
+ fates_hydr_vg_alpha_node
+ fates_hydr_vg_m_node
+ fates_hydr_vg_n_node
+ fates_hlm_pft_map
+ fates_maintresp_model
+ fates_photo_temp_acclim_timescale
+ fates_photo_tempsens_model
+ fates_vai_top_bin_width
+ fates_vai_width_increase_factor
+
+ New parameters that now over-ride previously hard-coded parameters:
+ fates_theta_cj_c3
+ fates_theta_cj_c4
+
+
+ New parameters that are unset for developer convenience:
+ fates_dev_arbitrary_pft
+ fates_dev_arbitrary
+
+Significant changes to scientifically-supported configurations
+--------------------------------------------------------------
+
+Does this tag change answers significantly for any of the following physics configurations? No
+(Details of any changes will be given in the "Answer changes" section below.)
+
+ [Put an [X] in the box for any configuration with significant answer changes.]
+
+[ ] clm5_1
+
+[ ] clm5_0
+
+[ ] ctsm5_0-nwp
+
+[ ] clm4_5
+
+
+Bugs fixed or introduced
+------------------------
+
+Issues fixed (include CTSM Issue #):
+ Fixes #1383 -- changes shebang lines to python3
+
+ fates issue: https://github.com/NGEET/fates/issues/753
+
+Notes of particular relevance for users
+---------------------------------------
+
+ The FATES parameter file now contains new fields. Users must update their personal parameter
+ files to contain these new fields. See src/fates/parameter_files/fates_params_default.cdl
+
+Notes of particular relevance for developers:
+---------------------------------------------
+
+Caveats for developers (e.g., code that is duplicated that requires double maintenance):
+
+ Developers should also be aware of the new fates parameter file format.
+
+Changes to tests or testing: None
+
+Testing summary: regular
+----------------
+ [PASS means all tests PASS; OK means tests PASS other than expected fails.]
+
+ build-namelist tests (if CLMBuildNamelist.pm has changed):
+
+ cheyenne - PASS (60 compare tests differ to previous tag)
+
+ python testing (if python code has changed; see instructions in python/README.md; document testing done):
+
+ cheyenne - PASS
+
+ regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):
+
+ cheyenne ---- OK
+ izumi ------- OK
+
+ fates tests:
+ cheyenne ---- OK
+
+ any other testing (give details below):
+
+If the tag used for baseline comparisons was NOT the previous tag, note that here:
+ Original testing was done compared to ctsm5.1.dev044, but testing is being rerun now
+
+
+Answer changes
+--------------
+
+Changes answers relative to baseline: Just for FATES
+
+ Summarize any changes to answers, i.e.,
+ - what code configurations: Just when running FATES
+ - what platforms/compilers: All
+ - nature of change: minor changes related to a bug-fix
+
+Other details
+-------------
+
+List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): FATES
+ fates to sci.1.46.2_api.16.1.0
+
+Pull Requests that document the changes (include PR ids):
+(https://github.com/ESCOMP/ctsm/pull)
+
+ #1414 -- Fates api16.1 (parameter file updates)
+
+===============================================================
+===============================================================
+Tag name: ctsm5.1.dev045
+Originator(s): slevis (Samuel Levis,SLevis Consulting,303-665-1310)
+Date: Tue Jun 29 20:05:21 MDT 2021
+One-line Summary: Include CWD in heterotrophic respiration (HR)
+
+Purpose and description of changes
+----------------------------------
+
+ Params file sets the respiration fractions for CWD to zero:
+ rf_cwdl2_bgc = 0
+ rf_cwdl3_bgc = 0
+ The model has no code to handle rf_cwd* > 0. So...
+ - I have introduced cwdhr_col to track this HR the same way that we track
+ lithr_col for litter.
+ - I have removed if-statements that prevented CWD HR pools and decomposition
+ from writing to history.
+ - I have introduced a new test to the cheyenne test-suite that makes active
+ seven history fields pertaining to CWD HR and points to a params file with
+ rf_cwd* > 0. I have confirmed that the new test returns the new active
+ variables as greater than 0 when pointing to the new params file and equal
+ to 0 when pointing to the default params file.
+
+
+Significant changes to scientifically-supported configurations
+--------------------------------------------------------------
+
+Does this tag change answers significantly for any of the following physics configurations?
+(Details of any changes will be given in the "Answer changes" section below.)
+
+ [Put an [X] in the box for any configuration with significant answer changes.]
+
+[ ] clm5_1
+
+[ ] clm5_0
+
+[ ] ctsm5_0-nwp
+
+[ ] clm4_5
+
+
+Bugs fixed or introduced
+------------------------
+
+
+Notes of particular relevance for users
+---------------------------------------
+
+Notes of particular relevance for developers:
+---------------------------------------------
+
+
+Testing summary:
+----------------
+
+ [PASS means all tests PASS; OK means tests PASS other than expected fails.]
+
+ build-namelist tests (if CLMBuildNamelist.pm has changed):
+
+ cheyenne - OK (2 tests fail compare because of fix in #1417)
+
+ python testing (if python code has changed; see instructions in python/README.md; document testing done):
+
+ cheyenne - PASS
+
+ regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):
+
+ cheyenne ---- OK
+ izumi ------- OK
+
+
+Answer changes
+--------------
+Changes answers relative to baseline: No
+
+
+Other details
+-------------
+Pull Requests that document the changes (include PR ids):
+ https://github.com/ESCOMP/CTSM/pull/1414
+
+===============================================================
+===============================================================
+Tag name: ctsm5.1.dev044
+Originator(s): mvertens (Mariana Vertenstein)
+Date: Thu Jun 24 15:59:08 MDT 2021
+One-line Summary: New stream functionality when using NUOPC or LILAC
+
+Purpose and description of changes
+----------------------------------
+
+This tag creates new stream functionality when using the NUOPC and LILAC
+caps, and maintains backwards compatibility with the older CPL7 stream
+functionality when using the MCT cap.
+
+- New stream code has been placed in src/cpl/share_esmf (so that they
+ can also be leveraged by LILAC)
+- Older stream code for mct is now in src/cpl/mct
+- LILAC interface has been changed to leverage the new stream code as well
+
+Where possible share code was used. In particular, this holds for SatellitePhenologyMod.F90.
+
+Significant changes to scientifically-supported configurations
+--------------------------------------------------------------
+
+Does this tag change answers significantly for any of the following physics configurations?
+(Details of any changes will be given in the "Answer changes" section below.)
+
+ [Put an [X] in the box for any configuration with significant answer changes.]
+
+[ ] clm5_1
+
+[ ] clm5_0
+
+[ ] ctsm5_0-nwp
+
+[ ] clm4_5
+
+
+Notes of particular relevance for users
+---------------------------------------
+
+Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables):
+- New mesh stream entries are needed now for NUOPC and LILAC compsets
+
+Substantial timing or memory changes: None for mct. For
+ERS_Ly3_P72x2_Vnuopc.f10_f10_mg37.IHistClm50BgcCropG.cheyenne_intel.clm-cropMonthOutput,
+overall run time is slightly less than the baseline - probably within
+machine variability. A more careful investigation would be needed to
+determine if the CDEPS streams have changed performance significantly
+relative to the MCT-based streams, but the overall timing suggests that
+there probably aren't *large* differences.
+
+Testing summary:
+----------------
+
+ regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):
+
+ cheyenne ---- ok
+ izumi ------- ok
+
+ Ran most testing on eb696be8d; from this hash, there were FIELDLIST
+ diffs for SP cases. Reran the tests with FIELDLIST diffs from the
+ final version and generated new, fixed baselines.
+
+Answer changes
+--------------
+
+Changes answers relative to baseline: YES, just for NUOPC/LILAC configurations
+
+ Summarize any changes to answers, i.e.,
+ - what code configurations: NUOPC/LILAC
+ - what platforms/compilers: all
+ - nature of change (roundoff; larger than roundoff/same climate; new climate):
+ Larger than roundoff / same climate. Diffs arise due to changes in
+ the interpolation used in cdeps streams vs. the old mct-based
+ streams. Diffs generally keep 3-4 digits of equivalence or better.
+
+Other details
+-------------
+
+List any externals directories updated (cime, rtm, mosart, cism, fates, etc.):
+- cime: cime5.8.47 -> branch_tags/cime5.8.47_a01
+- cdeps: cdeps0.12.4 -> cdeps0.12.11
+
+Pull Requests that document the changes (include PR ids):
+https://github.com/escomp/ctsm/issues/1356
+
+===============================================================
+===============================================================
+Tag name: ctsm5.1.dev043
+Originator(s): slevis/ekluzek (Samuel Levis,SLevis Consulting,303-665-1310)
+Date: Thu Jun 3 17:14:30 MDT 2021
+One-line Summary: Refactor in preparation for MIMICS
+
+Purpose and description of changes
+----------------------------------
+
+ Refactor aspects of the CTSM in preparation for our introduction of
+ MIMICS, which has started in #1318 .
+
+
+Significant changes to scientifically-supported configurations
+--------------------------------------------------------------
+
+Does this tag change answers significantly for any of the following physics configurations? NO
+(Details of any changes will be given in the "Answer changes" section below.)
+
+ [Put an [X] in the box for any configuration with significant answer changes.]
+
+[ ] clm5_1
+
+[ ] clm5_0
+
+[ ] ctsm5_0-nwp
+
+[ ] clm4_5
+
+
+Bugs fixed or introduced
+------------------------
+Known bugs introduced in this tag (include issue #): #1356, #1392
+ #1356 -- CN is no longer just deprecated it breaks when you try to use it
+ #1392 -- Some soil decomposition history fields have the pool number rather than a descr.
+
+Notes of particular relevance for users
+---------------------------------------
+Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables):
+ Moved initial_Cstocks_depth_bgc and initial_Cstocks_bgc from the
+ namelist to the params file. Also renamed tau_cwd to tau_cwd_bgc and
+ k_frag to k_frag_cn in the params file according to the models that use
+ these parameters.
+
+Changes made to namelist defaults (e.g., changed parameter values):
+ initial_Cstocks_depth_bgc and initial_Cstocks_bgc are not namelist
+ variables anymore.
+
+Changes to the datasets (e.g., parameter, surface or initial files):
+ There are new params files for clm45, clm50, and ctsm51.
+
+Substantial timing or memory changes:
+ FAIL PFS_Ld20.f09_g17.I2000Clm50BgcCrop.cheyenne_intel MEMCOMP Error: Memory usage increase > 10% from baseline
+ Throughput doesn't seem to change. There might be an increase in memory as it's indicated for 20 tests.
+ And some arrays were changed to add an extra dimension.
+
+Testing summary:
+----------------
+
+ [PASS means all tests PASS; OK means tests PASS other than expected fails.]
+
+ build-namelist tests (if CLMBuildNamelist.pm has changed):
+
+ cheyenne - PASS (785 tests are different because of new params files and removed namelist items)
+
+ python testing (if python code has changed; see instructions in python/README.md; document testing done):
+
+ cheyenne - PASS
+
+ regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):
+
+ cheyenne ---- OK (read above in "bugs introduced" about CN failures)
+ izumi ------- OK (read below in "other testing" about pgi failures)
+
+ any other testing (give details below):
+ Two unexpected tests fail on izumi, so I performed additional testing.
+ The tests that fail:
+ 1) SMS_D.f10_f10_mg37.I2000Clm51BgcCrop.izumi_pgi.clm-crop
+ BASELINE ctsm5.1.dev042: DIFF roundoff
+ 2) SMS.f10_f10_mg37.I2000Clm50BgcCrop.izumi_pgi.clm-crop
+ BASELINE ctsm5.1.dev042: DIFF greater than roundoff for CH4-related vars
+ I confirmed same result with my earlier commit against BASELINE dev033.
+
+ Same tests but with gnu/intel instead of pgi pass on izumi for both
+ comparisons to dev042 and to dev033. These tests are part of the izumi
+ test-suite already.
+
+ Additional testing:
+ Repeated these gnu/intel tests (had to run for baseline first) on cheyenne
+ and they passed.
+
+If the tag used for baseline comparisons was NOT the previous tag, note that here:
+
+
+Answer changes
+--------------
+
+Changes answers relative to baseline: NO
+
+
+Other details
+-------------
+
+Pull Requests that document the changes (include PR ids):
+ https://github.com/ESCOMP/CTSM/pull/1340
+
+===============================================================
+===============================================================
+Tag name: ctsm5.1.dev042
+Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326)
+Date: Fri May 28 14:07:45 MDT 2021
+One-line Summary: Small answer changes for double precision constants and limit on organic soil
+
+Purpose and description of changes
+----------------------------------
+
+Change more constants to double precision. Add in limits on organic matter in
+soil that @olyson added to the PPE branch (Perturbed Parameter Ensemble).
+
+
+Significant changes to scientifically-supported configurations
+--------------------------------------------------------------
+
+Does this tag change answers significantly for any of the following physics configurations?
+(Details of any changes will be given in the "Answer changes" section below.)
+
+ [Put an [X] in the box for any configuration with significant answer changes.]
+
+[ ] clm5_1
+
+[ ] clm5_0
+
+[ ] ctsm5_0-nwp
+
+[ ] clm4_5
+
+
+Bugs fixed or introduced
+------------------------
+
+Issues fixed (include CTSM Issue #):
+ #1380 -- Missing NCL script
+ #142 --- hard coded constants aren't all double precision (some work was done on this)
+
+Notes of particular relevance for developers:
+---------------------------------------------
+NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide
+
+Caveats for developers (e.g., code that is duplicated that requires double maintenance):
+
+ There are still more constants that should be converted to double precision.
+
+Testing summary: regular
+----------------
+ [PASS means all tests PASS; OK means tests PASS other than expected fails.]
+
+ build-namelist tests (if CLMBuildNamelist.pm has changed):
+
+ cheyenne - PASS
+
+ python testing (if python code has changed; see instructions in python/README.md; document testing done):
+
+ cheyenne - PASS
+
+ regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):
+
+ cheyenne ---- OK
+ izumi ------- OK
+
+If the tag used for baseline comparisons was NOT the previous tag, note that here:
+
+
+Answer changes
+--------------
+
+Changes answers relative to baseline: Yes!
+
+ Summarize any changes to answers, i.e.,
+ - what code configurations: All
+ - what platforms/compilers: All
+ - nature of change: mostly single-precision roundoff
+ many constants that were single precision are now double
+ some limits put on soil organic that weren't there previously
+
+Other details
+-------------
+
+Pull Requests that document the changes (include PR ids):
+(https://github.com/ESCOMP/ctsm/pull)
+ #1384 -- Change some constants to double precision, and add some soil limits
+
+===============================================================
+===============================================================
+Tag name: ctsm5.1.dev041
+Originator(s): Ryan Knox
+Date: Thu May 27 01:10:40 MDT 2021
+One-line Summary: Updates to coupling interface to enable FATES-CH4, and to be compatible with FATES-CNP.
+
+Purpose and description of changes
+----------------------------------
+
+These changes are only relegated to the API with FATES. Boundary conditions were prepared within
+FATES to enable proper use of the methane model. Further, some minor changes were made to the FATES
+interface code (clmfates_interfaceMod.F90) allowing compatibility with FATES tag sci.1.46.0_api.16.0.0
+(https://github.com/NGEET/fates/releases/tag/sci.1.46.0_api.16.0.0). Most of these changes have to do
+with how the FATES history interface is instantiated.
+
+Significant changes to scientifically-supported configurations
+--------------------------------------------------------------
+
+[ ] clm5_1
+
+[ ] clm5_0
+
+[ ] ctsm5_0-nwp
+
+[ ] clm4_5
+
+
+Bugs fixed or introduced
+------------------------
+
+No bugs fixed or introduced.
+
+
+Notes of particular relevance for users
+---------------------------------------
+
+This tag brings compatibility with FATES tag: sci.1.46.0_api.16.0.0
+
+CTSM-FATES users should also be aware that the FATES parameter file has been
+updated. An example is found here:
+
+https://github.com/NGEET/fates/blob/sci.1.46.0_api.16.0.0/parameter_files/fates_params_default.cdl
+
+Notes of particular relevance for developers:
+---------------------------------------------
+
+A new test was added to check FATES-CH4 coupling:
+
+ERS_Ld9.f10_f10_mg37.I2000Clm50FatesCru.cheyenne_intel.clm-FatesColdDefCH4
+
+
+Testing summary:
+----------------
+
+ build-namelist tests (if CLMBuildNamelist.pm has changed):
+
+ cheyenne - PASS (60 test different because of fates paramfile)
+
+ python testing (if python code has changed; see instructions in python/README.md; document testing done):
+
+ cheyenne - PASS
+
+ regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):
+
+ cheyenne ---- OK
+ izumi ------- OK
+
+ fates tests:
+ cheyenne ---- OK
+
+
+Answer changes
+--------------
+
+Changes answers relative to baseline:
+
+All FATES tests will have different answers with tag: sci.1.46.0_api.16.0.0
+
+This is mostly due to the passing of thaw-depth into more of the rooting depth algorithm.
+
+List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): fates
+ fates to sci.1.46.0_api.16.0.0
+
+Pull Requests that document the changes (include PR ids): #1371
+(https://github.com/ESCOMP/ctsm/pull)
+ #1371 -- FATES parteh scale fixes api (ie nutrient + methane coupling)
+
+===============================================================
+
+===============================================================
+Tag name: ctsm5.1.dev040
+Originator(s): slevis (Samuel Levis,SLevis Consulting,303-665-1310)
+Date: Thu May 20 08:28:20 MDT 2021
+One-line Summary: Replace masked with "nomask" SRC files for use with mkmapdata and mksurfdata_map
+
+Purpose and description of changes
+----------------------------------
+
+ 1) Collapse multiple source (SRC) files of a given resolution to a
+ single "nomask" SRC file per SRC resolution. The mask variable is now
+ set to 1 everywhere in all SRC files and mkmapdata.sh generates
+ a single map_ file (aka weight file) per destination (DST) resolution.
+ 2) The executable mksurfdata_map now applies the SRC mask found in the
+ raw datasets, since the map_ files do not contain this information.
+
+ These changes simplify the introduction of new surface variables with
+ raw data in one of our existing SRC resolutions because we need not
+ create new SRC files for such variables. To introduce new surface
+ variables with raw data in new resolutions, the corresponding new SRC
+ files need mask equal to 1 everywhere.
+
+ NOTE: Answer-changing modifications have been made in mksurfdata_map,
+ but we have NOT recreated the out-of-the-box surface datasets. This
+ means that, if you create new surface datasets, you should expect small
+ answer changes relative to the current out-of-the-box surface datasets.
+
+Significant changes to scientifically-supported configurations
+--------------------------------------------------------------
+
+Does this tag change answers significantly for any of the following physics configurations?
+(Details of any changes will be given in the "Answer changes" section below.)
+
+ [Put an [X] in the box for any configuration with significant answer changes.]
+
+[ ] clm5_1
+
+[ ] clm5_0
+
+[ ] ctsm5_0-nwp
+
+[ ] clm4_5
+
+
+Bugs fixed or introduced
+------------------------
+
+Issues fixed (include CTSM Issue #): #286
+
+
+Notes of particular relevance for users
+---------------------------------------
+
+Caveats for users (e.g., need to interpolate initial conditions):
+ These changes are transparent to users making surface datasets using
+ default SRC resolutions. Users using non-default SRC resolutions or
+ users introducing new surface variables with raw data in non-default
+ SRC resolutions, will create new SRC file(s) with mask always set to 1
+ everywhere.
+
+ Note, though, that the out-of-the-box surface datasets now differ
+ slightly from what you would produce by running mksurfdata_map. So
+ answer changes should be expected relative to the out-of-the-box
+ surface datasets if you create a new surface dataset.
+
+Changes made to namelist defaults (e.g., changed parameter values):
+ Changed the names of most default SRC files and default map_ files to
+ the names of the "nomask" versions of these files.
+
+Changes to the datasets (e.g., parameter, surface or initial files):
+ Replaced SRC files and map_ files with "nomask" versions. Most SRC
+ resolutions already had nomask files available, so I created such files
+ for 0.25x0.25, 0.9x1.25, 3x3min, 5x5min, and 0.125x0.125. I changed all
+ of the map_ files except
+ map_1km-merge-10min_HYDRO1K-merge-nomask SRC resolution.
+ I ran the rimport command as follows:
+ ./rimport -list /glade/work/slevis/git/mksurfdata_maps_wo_src_masks/PR_823_new_file_list
+
+Substantial timing or memory changes:
+ - We end up with fewer SRC and map_ files by replacing multiple custom
+ grids per SRC resolution with one nomask grid. I list here resolutions
+ that had multiple custom grids per resolution before the switch to
+ nomask:
+ 0.5x0.5: AVHRR, MODIS, and 360x720cru_cruncep
+ 3x3min: GLOBE-Gardner-mergeGIS, GLOBE-Gardner, LandScan2004, MODIS-wCsp
+ 5x5min: IGBP-GSDP, ISRIC-WISE, ORNL
+ 10x10min_IGBPmergeICESatGIS
+
+ UNSTRUCT info shown for comparison. NOT switching to UNSTRUCT files at
+ this time.
+
+ - The nomask map_ files are larger now. E.g.:
+2754246572 map_3x3min_GLOBE-Gardner_to_0.9x1.25_nomask_aave_da_c191101.nc MASKED SCRIP
+3051641404 map_3x3min_nomask_to_0.9x1.25_nomask_aave_da_c191109.nc NOMASK SCRIP
+2974797264 map_3x3min_nomask_to_0.9x1.25_nomask_aave_da_c191115.nc NOMASK UNSTRUCT
+
+ - Although the nomask SCRIP cases shown below are slower because each
+ individual mapping file takes longer to create, the total time to
+ generate mapping files is reduced, possibly significantly, due to the
+ need for fewer mapping files in total. Note the increase in time
+ savings from the 0.5x0.5 to the 10x10min resolution, which suggests
+ even greater time savings for the 3x3min and 5x5min that went from a
+ total of 7 to 2 map_ files. Sample timing data:
+mkmapdata 0.5x0.5 to 0.9x1.25 MASKED (2 grids) 78.0u 1.30s 1:20.08 99.1%
+mkmapdata 0.5x0.5 to 0.9x1.25 NOMASK SCRIP 51.199u 0.85s 0:52.61 98.8%
+mkmapdata 0.5x0.5 to 0.9x1.25 NOMASK UNSTRUC 38.316u 0.69s 0:39.51 98.7%
+
+mkmapdata 0.25x0.25 to 0.9x1.25 MASKED SCRI 129.288u 1.46s 2:11.38 99.5%
+mkmapdata 0.25x0.25 to 0.9x1.25 NOMASK SCRI 168.443u 1.69s 2:50.77 99.6%
+mkmapdata 0.25x0.25 to 0.9x1.25 NOMASK UNST 110.875u 1.46s 1:52.80 99.5%
+
+mkmapdata 0.125x0.125 to 0.9x1.25 MASKED SC 489.651u 3.67s 8:14.58 99.7%
+mkmapdata 0.125x0.125 to 0.9x1.25 NOMASK SC 646.372u 5.07s 10:54 99.5%
+mkmapdata 0.125x0.125 to 0.9x1.25 NOMASK UN 388.842u 4.20s 6:33 99.7%
+
+mkmapdata 10x10min to 0.9x1.25 MASKED (2 grids) 639.7u 4.8s 10:46 99.7%
+mkmapdata 10x10min to 0.9x1.25 NOMASK SCRIP 380.3u 3.1s 6:24 99.7%
+mkmapdata 10x10min to 0.9x1.25 NOMASK UNSTRUCT 264.2u 2.6s 4:27 99.6%
+
+mksurfdata_map 0.9x1.25 MASKED SCRIP: 65.846u 18.204s 1:42.64 81.8%
+mksurfdata_map 0.9x1.25 NOMASK SCRIP: 74.439u 18.502s 1:57.48 79.1%
+
+Notes of particular relevance for developers:
+---------------------------------------------
+
+Caveats for developers (e.g., code that is duplicated that requires double maintenance):
+- The out-of-the-box surface datasets now differ slightly from what you
+ would produce by running mksurfdata_map. So answer changes should be
+ expected relative to the out-of-the-box surface datasets if you create
+ a new surface dataset.
+- We were not able to run the check_maps tool on the new mapping files:
+ this generated a seg fault (see
+ https://github.com/ESCOMP/CTSM/pull/823#issuecomment-846248591)
+
+Testing summary: tools
+----------------
+
+[... Remove before making master tag. Available test levels:
+
+ a) regular (must be run before handing off a tag to SEs and must be run
+ before committing a tag)
+ b) build_namelist (if namelists and/or build_system changed))
+ c) tools (only if tools are modified and no CTSM source is modified)
+ d) short (for use during development and in rare cases where only a small
+ change with known behavior is added ... eg. a minor bug fix)
+ e) doc (no source testing required)
+
+... ]
+
+ [PASS means all tests PASS and OK means tests PASS other than expected fails.]
+
+ build-namelist tests (if CLMBuildNamelist.pm has changed):
+
+ cheyenne -
+
+ tools-tests (test/tools) (if tools have been changed):
+
+ cheyenne - OK
+ izumi - OK
+
+ regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):
+
+ cheyenne ----
+ izumi -------
+
+
+ any other testing:
+
+ 1) Ran in /glade/scratch/slevis/temp_work/surfdata
+ make -f /glade/work/slevis/git/mksurfdata_maps_wo_src_masks/tools/mksurfdata_map/Makefile.data_slevis all
+ to generate all surface datasets. In early 2020 this triggered an error:
+
+ gridmap_check ERROR from mklakwat: mapping areas not conserved
+ global sum output field = 0.1513392154E+09
+ global sum input field = 0.1513334049E+09
+
+ which goes away with Bob Oehmke's new ESMF build.
+
+ 2) qcmd -- ./create_test ERP_D_Ld3_P36x2.f10_f10_mg37.I2000Clm50BgcCru.cheyenne_intel.clm-default -c /glade/p/cgd/tss/ctsm_baselines/ctsm5.1.dev038
+ PASSES w default fsurdat = '/glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_10x15_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc'
+ gives differences from baseline as expected w new fsurdat that differs
+ more than roundoff from the default one = ‘/glade/p/cesm/cseg/inputdata/lnd/clm2/surfdata_map/surfdata_10x15_hist_16pfts_Irrig_CMIP6_simyr2000_c210503.nc’
+
+If the tag used for baseline comparisons was NOT the previous tag, note that here:
+
+
+Answer changes
+--------------
+
+Changes answers relative to baseline: YES, but for now the model results
+are the same: there will be changes to surface datasets when they are
+remade, but so far we are still pointing to unchanged out-of-the-box
+surface datasets.
+
+ Summarize any changes to answers, i.e.,
+ - what code configurations: ALL
+ - what platforms/compilers: ALL
+ - nature of change: larger than roundoff/same climate
+
+ For now, model results are unchanged because we are still using the old
+ surface datasets. However, this tag changes answers in any new surface
+ datasets that are created.
+
+ I performed testing at the 0.9x1.25 degree resolution.
+
+ Code changes were tested by comparing baseline files (a)
+ surfdata_0.9x1.25_hist_78pfts_CMIP6_simyr2000_c191101.nc
+ surfdata_0.9x1.25_hist_78pfts_CMIP6_simyr2000_c191101.log
+ generated by running baseline code pointing to masked map_ files
+ to (b)
+ surfdata_0.9x1.25_new_hist_78pfts_CMIP6_simyr2000_c191101.nc
+ surfdata_0.9x1.25_new_hist_78pfts_CMIP6_simyr2000_c191101.log
+ generated by running the new code still pointing to masked map_ files
+ and then comparing to (c)
+ surfdata_0.9x1.25_nomask_78pfts_CMIP6_simyr2000_c191101.nc
+ surfdata_0.9x1.25_nomask_78pfts_CMIP6_simyr2000_c191101.log
+ generated by running the new code pointing to nomask map_ files.
+
+ We set an expectation of max abs relative differences of less than
+ roughly 1e-13. I got an actual max abs relative difference of 7e-12 in
+ PCT_NAT_PFT for (a) vs (b) and (a) vs (c). I refer to these here as
+ small diffs.
+
+ All other variables gave smaller diffs except the four VIC variables
+ binfil, Ws, Ds, Dsmax between (b) and (c). These diffs appear in 5 grid
+ cells (along two meridians that got shifted in longitude by less than
+ 1e-13 degrees) that vic considers land in the baseline and
+ ocean in the nomask case. Vic provides valid generic data for ocean
+ grid cells and, therefore, also where the discrepancies occur. This
+ means that if the land model treats these grid cells as land, the
+ model will work.
+
+ I had to generate new masked map_ files for (a) and (b) because
+ changes in ESMF codes over the years were leading to large differences
+ between all three (a) vs (b) vs (c). Generating new masked map_ files
+ brought the diffs back to small.
+
+ For the 3x3min and 5x5min SRC resolutions, I made six temporary
+ nomask SRC files, one per surface variable pointing to 3x3min
+ map_ files and one per surface variable pointing to 5x5min map_ files.
+ I did this to get small differences relative to the baseline. I created
+ the temporary files by making copies of the correspoding masked SRC
+ files and changing mask to 1 everywhere. The temporary files had diffs
+ less than roughly 1e-5 from generic nomask files generated by running
+ mkscripgrid.ncl for 3x3min and 5x5min. Ultimately we are replacing the
+ temporary files with the generic nomask files, which leads to larger
+ diffs in the surface datasets.
+
+ This testing occurred in late 2019 or early 2020. To confirm the
+ results I generated a new set of map_ files for 0.9x1.25 and then
+ created new fsurdat files with the baseline code and with the branch.
+ Only PCT_NAT_PFT triggers the error check for max abs relative
+ diff > 1e-13 with a max abs relative diff = 9e-12.
+
+
+Other details
+-------------
+
+Pull Requests that document the changes (include PR ids):
+ https://github.com/ESCOMP/CTSM/pull/823
+
+===============================================================
+===============================================================
+Tag name: ctsm5.1.dev039
+Originator(s): jedwards4b/erik (Erik Kluzek,UCAR/TSS,303-497-1326)
+Date: Tue May 18 14:36:25 MDT 2021
+One-line Summary: Add NEON sites
+
+Purpose and description of changes
+----------------------------------
+
+Add NEON sites. Add cime/cdeps support and capability to run NEON tower sites.
+
+This also brings in Negin's first version of the subset_data.py script to create
+datasets for single-point and regional cases. And a version of it was run to
+create the NEON surface datasets.
+
+To setup a NEON site do the following
+
+cd cime/scripts
+./create_newcase --case myNEONtest --res CLM_USRDAT --compset IHist1PtClm51Bgc \
+--user-mods-dir NEON/NIWO --driver nuopc --run-unsupported
+
+(There's also a I1PtClm51Bgc compset that can be used for fixed conditions)
+
+Note, also that several externals were updated to the version in cesm2_3_alpha03a. This means that
+answers change when CISM is turned on. Some of the grids for compsets tested were updated to
+use the new grid name "gris" in place of the older "gland".
+
+Significant changes to scientifically-supported configurations
+--------------------------------------------------------------
+
+Does this tag change answers significantly for any of the following physics configurations?
+(Details of any changes will be given in the "Answer changes" section below.)
+
+ [Put an [X] in the box for any configuration with significant answer changes.]
+
+[ ] clm5_1
+
+[ ] clm5_0
+
+[ ] ctsm5_0-nwp
+
+[ ] clm4_5
+
+
+Bugs fixed or introduced
+------------------------
+
+Issues fixed (include CTSM Issue #):
+ #1368 -- Longitude isn't correct for NEON singlept fsurdat files.
+ #1353 -- Modify NEON surface data
+
+Known bugs introduced in this tag (include issue #):
+ #1364 -- Change NEON surface datasets to 79PFT files to facilitate the crop sites
+ #1368 -- Additional modifications to subset_data.py
+ #1363 -- 2018 and 2018-PD compsets for NEON single point ty
+ #1354 -- Batch run single point sites, including NEON
+ #1355 -- Python scripts for NEON analyses
+ cime/#3970 -- cdeps library fails to build on izumi: nag, intel, and gnu compilers
+
+Known bugs found since the previous tag (include issue #):
+ #1351 -- HR fluxes don't include CWD
+
+
+Notes of particular relevance for users
+---------------------------------------
+
+Caveats for users (e.g., need to interpolate initial conditions):
+ Data coming from NEON -- may be updated after it's uploaded. As such you may need to delete
+ previous downloaded data in order to download the latest.
+
+Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): Yes add NEONSITE, two new compsets
+ Add new compset aliases: I1PtClm51Bgc, and IHist1PtClm51Bgc
+ NEONSITE added to the env_run.xml for a case. Only used for a NEON site with the CLM_USRDAT resolution
+
+Changes to the datasets (e.g., parameter, surface or initial files):
+ Surface datasets for NEON added to the NEON user-mod-directory
+
+Notes of particular relevance for developers:
+---------------------------------------------
+NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide
+
+Caveats for developers (e.g., code that is duplicated that requires double maintenance):
+ The two USUMB test-mods duplicate some settings and could have a parent version to inherit from
+
+Changes to tests or testing:
+ Change _gl4 tests to _gris4
+ Single point tower site tests use the CLM1PTStartDate test-mod
+ Add a NEON test for the NIWO site
+ USUMB testmod needs a MCT and NUOPC version
+
+
+Testing summary: regular
+----------------
+ [PASS means all tests PASS; OK means tests PASS other than expected fails.]
+
+ build-namelist tests (if CLMBuildNamelist.pm has changed):
+
+ cheyenne - PASS (141 new tests for NEON sites)
+
+ python testing (if python code has changed; see instructions in python/README.md; document testing done):
+
+ cheyenne -- PASS
+
+ regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):
+
+ cheyenne ---- OK
+ izumi ------- OK
+
+ any other testing (give details below):
+
+If the tag used for baseline comparisons was NOT the previous tag, note that here:
+
+
+Answer changes
+--------------
+
+Changes answers relative to baseline: Yes (but only when CISM is on)
+
+ Summarize any changes to answers, i.e.,
+ - what code configurations: Only with CISM on (compsets that end with G)
+ - what platforms/compilers: All
+ - nature of change: similar climate
+
+Other details
+-------------
+
+List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, cism, cmeps, cdeps
+ cime to cime5.8.47
+ cism to cismwrap_2_1_83
+ cmeps to cmeps0.13.2
+ cdeps to cdeps0.12.4
+
+Pull Requests that document the changes (include PR ids):
+(https://github.com/ESCOMP/ctsm/pull)
+ #1278 -- Neon compsets
+ #1360 -- Singlept and regional subsetting script (initial version)
+
+===============================================================
+===============================================================
Tag name: ctsm5.1.dev038
Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326)
Date: Tue Apr 27 23:51:04 MDT 2021
diff --git a/doc/ChangeSum b/doc/ChangeSum
index 5d0692ad68..7b2b7cce94 100644
--- a/doc/ChangeSum
+++ b/doc/ChangeSum
@@ -1,5 +1,15 @@
Tag Who Date Summary
============================================================================================================================
+ ctsm5.1.dev048 slevis 07/10/2021 Make certain history fields descriptive inst. of labeling by number
+ ctsm5.1.dev047 mvertens 07/08/2021 Start bounds at 1; remove references to MCT
+ ctsm5.1.dev046 rgknox 07/02/2021 Updating external fates has to tag sci.1.46.2_api.16.1.0
+ ctsm5.1.dev045 slevis 06/29/2021 Include CWD in heterotrophic respiration
+ ctsm5.1.dev044 mvertens 06/24/2021 New stream functionality when using NUOPC or LILAC
+ ctsm5.1.dev043 slevis 06/03/2021 Refactor of CascadeBGC code in preparation for MIMICS
+ ctsm5.1.dev042 erik 05/28/2021 Small answer changes for double precision constants and soil limits
+ ctsm5.1.dev041 rgknox 05/27/2021 bring FATES API up to sci.1.46.0_api.16.0.0 (methane and cn hooks)
+ ctsm5.1.dev040 slevis 05/20/2021 mksurfdata_map: replace SRC files of various masks with SRC files w no mask
+ ctsm5.1.dev039 jedwards 05/18/2021 Add NEON sites
ctsm5.1.dev038 erik 04/27/2021 Bring in minor changes from the cesm2.2.0 release tag
release-cesm2.2.01 erik 09/02/2020 Fix clm4_5 initial conditions
ctsm5.1.dev037 slevis 04/23/2021 Correct vertical interpolation in init_interp when soil thicknesses change
diff --git a/doc/source/users_guide/setting-up-and-running-a-case/master_list_file.rst b/doc/source/users_guide/setting-up-and-running-a-case/master_list_file.rst
index 610975876b..0d3eb7e61c 100644
--- a/doc/source/users_guide/setting-up-and-running-a-case/master_list_file.rst
+++ b/doc/source/users_guide/setting-up-and-running-a-case/master_list_file.rst
@@ -13,1262 +13,1283 @@ CTSM History Fields
4 ACTUAL_IMMOB_NH4 immobilization of NH4 gN/m^3/s F
5 ACTUAL_IMMOB_NO3 immobilization of NO3 gN/m^3/s F
6 ACTUAL_IMMOB_vr actual N immobilization gN/m^3/s F
- 7 AGNPP aboveground NPP gC/m^2/s T
- 8 ALBD surface albedo (direct) proportion T
- 9 ALBDSF diagnostic snow-free surface albedo (direct) proportion T
- 10 ALBGRD ground albedo (direct) proportion F
- 11 ALBGRI ground albedo (indirect) proportion F
- 12 ALBI surface albedo (indirect) proportion T
- 13 ALBISF diagnostic snow-free surface albedo (indirect) proportion T
- 14 ALPHA alpha coefficient for VOC calc non F
- 15 ALT current active layer thickness m T
- 16 ALTMAX maximum annual active layer thickness m T
- 17 ALTMAX_LASTYEAR maximum prior year active layer thickness m F
- 18 ANNAVG_T2M annual average 2m air temperature K F
- 19 ANNMAX_RETRANSN annual max of retranslocated N pool gN/m^2 F
- 20 ANNSUM_COUNTER seconds since last annual accumulator turnover s F
- 21 ANNSUM_NPP annual sum of NPP gC/m^2/yr F
- 22 ANNSUM_POTENTIAL_GPP annual sum of potential GPP gN/m^2/yr F
- 23 APPAR_TEMP 2 m apparent temperature C T
- 24 APPAR_TEMP_R Rural 2 m apparent temperature C T
- 25 APPAR_TEMP_U Urban 2 m apparent temperature C T
- 26 AR autotrophic respiration (MR + GR) gC/m^2/s T
- 27 ATM_TOPO atmospheric surface height m T
- 28 AVAILC C flux available for allocation gC/m^2/s F
- 29 AVAIL_RETRANSN N flux available from retranslocation pool gN/m^2/s F
- 30 AnnET Annual ET mm/s F
- 31 BAF_CROP fractional area burned for crop s-1 T
- 32 BAF_PEATF fractional area burned in peatland s-1 T
- 33 BCDEP total BC deposition (dry+wet) from atmosphere kg/m^2/s T
- 34 BETA coefficient of convective velocity none F
- 35 BGLFR background litterfall rate 1/s F
- 36 BGNPP belowground NPP gC/m^2/s T
- 37 BGTR background transfer growth rate 1/s F
- 38 BTRANMN daily minimum of transpiration beta factor unitless T
- 39 CANNAVG_T2M annual average of 2m air temperature K F
- 40 CANNSUM_NPP annual sum of column-level NPP gC/m^2/s F
- 41 CGRND deriv. of soil energy flux wrt to soil temp W/m^2/K F
- 42 CGRNDL deriv. of soil latent heat flux wrt soil temp W/m^2/K F
- 43 CGRNDS deriv. of soil sensible heat flux wrt soil temp W/m^2/K F
- 44 CH4PROD Gridcell total production of CH4 gC/m2/s T
- 45 CH4_EBUL_TOTAL_SAT ebullition surface CH4 flux; (+ to atm) mol/m2/s F
- 46 CH4_EBUL_TOTAL_UNSAT ebullition surface CH4 flux; (+ to atm) mol/m2/s F
- 47 CH4_SURF_AERE_SAT aerenchyma surface CH4 flux for inundated area; (+ to atm) mol/m2/s T
- 48 CH4_SURF_AERE_UNSAT aerenchyma surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T
- 49 CH4_SURF_DIFF_SAT diffusive surface CH4 flux for inundated / lake area; (+ to atm) mol/m2/s T
- 50 CH4_SURF_DIFF_UNSAT diffusive surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T
- 51 CH4_SURF_EBUL_SAT ebullition surface CH4 flux for inundated / lake area; (+ to atm) mol/m2/s T
- 52 CH4_SURF_EBUL_UNSAT ebullition surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T
- 53 COL_CTRUNC column-level sink for C truncation gC/m^2 F
- 54 COL_FIRE_CLOSS total column-level fire C loss for non-peat fires outside land-type converted region gC/m^2/s T
- 55 COL_FIRE_NLOSS total column-level fire N loss gN/m^2/s T
- 56 COL_NTRUNC column-level sink for N truncation gN/m^2 F
- 57 CONC_CH4_SAT CH4 soil Concentration for inundated / lake area mol/m3 F
- 58 CONC_CH4_UNSAT CH4 soil Concentration for non-inundated area mol/m3 F
- 59 CONC_O2_SAT O2 soil Concentration for inundated / lake area mol/m3 T
- 60 CONC_O2_UNSAT O2 soil Concentration for non-inundated area mol/m3 T
- 61 COST_NACTIVE Cost of active uptake gN/gC T
- 62 COST_NFIX Cost of fixation gN/gC T
- 63 COST_NRETRANS Cost of retranslocation gN/gC T
- 64 COSZEN cosine of solar zenith angle none F
- 65 CPHASE crop phenology phase 0-not planted, 1-planted, 2-leaf emerge, 3-grain fill, 4-harvest T
- 66 CPOOL temporary photosynthate C pool gC/m^2 T
- 67 CPOOL_DEADCROOT_GR dead coarse root growth respiration gC/m^2/s F
- 68 CPOOL_DEADCROOT_STORAGE_GR dead coarse root growth respiration to storage gC/m^2/s F
- 69 CPOOL_DEADSTEM_GR dead stem growth respiration gC/m^2/s F
- 70 CPOOL_DEADSTEM_STORAGE_GR dead stem growth respiration to storage gC/m^2/s F
- 71 CPOOL_FROOT_GR fine root growth respiration gC/m^2/s F
- 72 CPOOL_FROOT_STORAGE_GR fine root growth respiration to storage gC/m^2/s F
- 73 CPOOL_LEAF_GR leaf growth respiration gC/m^2/s F
- 74 CPOOL_LEAF_STORAGE_GR leaf growth respiration to storage gC/m^2/s F
- 75 CPOOL_LIVECROOT_GR live coarse root growth respiration gC/m^2/s F
- 76 CPOOL_LIVECROOT_STORAGE_GR live coarse root growth respiration to storage gC/m^2/s F
- 77 CPOOL_LIVESTEM_GR live stem growth respiration gC/m^2/s F
- 78 CPOOL_LIVESTEM_STORAGE_GR live stem growth respiration to storage gC/m^2/s F
- 79 CPOOL_TO_DEADCROOTC allocation to dead coarse root C gC/m^2/s F
- 80 CPOOL_TO_DEADCROOTC_STORAGE allocation to dead coarse root C storage gC/m^2/s F
- 81 CPOOL_TO_DEADSTEMC allocation to dead stem C gC/m^2/s F
- 82 CPOOL_TO_DEADSTEMC_STORAGE allocation to dead stem C storage gC/m^2/s F
- 83 CPOOL_TO_FROOTC allocation to fine root C gC/m^2/s F
- 84 CPOOL_TO_FROOTC_STORAGE allocation to fine root C storage gC/m^2/s F
- 85 CPOOL_TO_GRESP_STORAGE allocation to growth respiration storage gC/m^2/s F
- 86 CPOOL_TO_LEAFC allocation to leaf C gC/m^2/s F
- 87 CPOOL_TO_LEAFC_STORAGE allocation to leaf C storage gC/m^2/s F
- 88 CPOOL_TO_LIVECROOTC allocation to live coarse root C gC/m^2/s F
- 89 CPOOL_TO_LIVECROOTC_STORAGE allocation to live coarse root C storage gC/m^2/s F
- 90 CPOOL_TO_LIVESTEMC allocation to live stem C gC/m^2/s F
- 91 CPOOL_TO_LIVESTEMC_STORAGE allocation to live stem C storage gC/m^2/s F
- 92 CROOT_PROF profile for litter C and N inputs from coarse roots 1/m F
- 93 CROPPROD1C 1-yr crop product (grain+biofuel) C gC/m^2 T
- 94 CROPPROD1C_LOSS loss from 1-yr crop product pool gC/m^2/s T
- 95 CROPPROD1N 1-yr crop product (grain+biofuel) N gN/m^2 T
- 96 CROPPROD1N_LOSS loss from 1-yr crop product pool gN/m^2/s T
- 97 CROPSEEDC_DEFICIT C used for crop seed that needs to be repaid gC/m^2 T
- 98 CROPSEEDN_DEFICIT N used for crop seed that needs to be repaid gN/m^2 F
- 99 CROP_SEEDC_TO_LEAF crop seed source to leaf gC/m^2/s F
- 100 CROP_SEEDN_TO_LEAF crop seed source to leaf gN/m^2/s F
- 101 CURRENT_GR growth resp for new growth displayed in this timestep gC/m^2/s F
- 102 CWDC CWD C gC/m^2 T
- 103 CWDC_1m CWD C to 1 meter gC/m^2 F
- 104 CWDC_LOSS coarse woody debris C loss gC/m^2/s T
- 105 CWDC_TO_LITR2C decomp. of coarse woody debris C to litter 2 C gC/m^2/s F
- 106 CWDC_TO_LITR2C_vr decomp. of coarse woody debris C to litter 2 C gC/m^3/s F
- 107 CWDC_TO_LITR3C decomp. of coarse woody debris C to litter 3 C gC/m^2/s F
- 108 CWDC_TO_LITR3C_vr decomp. of coarse woody debris C to litter 3 C gC/m^3/s F
- 109 CWDC_vr CWD C (vertically resolved) gC/m^3 T
- 110 CWDN CWD N gN/m^2 T
- 111 CWDN_1m CWD N to 1 meter gN/m^2 F
- 112 CWDN_TO_LITR2N decomp. of coarse woody debris N to litter 2 N gN/m^2 F
- 113 CWDN_TO_LITR2N_vr decomp. of coarse woody debris N to litter 2 N gN/m^3 F
- 114 CWDN_TO_LITR3N decomp. of coarse woody debris N to litter 3 N gN/m^2 F
- 115 CWDN_TO_LITR3N_vr decomp. of coarse woody debris N to litter 3 N gN/m^3 F
- 116 CWDN_vr CWD N (vertically resolved) gN/m^3 T
- 117 C_ALLOMETRY C allocation index none F
- 118 DAYL daylength s F
- 119 DAYS_ACTIVE number of days since last dormancy days F
- 120 DEADCROOTC dead coarse root C gC/m^2 T
- 121 DEADCROOTC_STORAGE dead coarse root C storage gC/m^2 F
- 122 DEADCROOTC_STORAGE_TO_XFER dead coarse root C shift storage to transfer gC/m^2/s F
- 123 DEADCROOTC_XFER dead coarse root C transfer gC/m^2 F
- 124 DEADCROOTC_XFER_TO_DEADCROOTC dead coarse root C growth from storage gC/m^2/s F
- 125 DEADCROOTN dead coarse root N gN/m^2 T
- 126 DEADCROOTN_STORAGE dead coarse root N storage gN/m^2 F
- 127 DEADCROOTN_STORAGE_TO_XFER dead coarse root N shift storage to transfer gN/m^2/s F
- 128 DEADCROOTN_XFER dead coarse root N transfer gN/m^2 F
- 129 DEADCROOTN_XFER_TO_DEADCROOTN dead coarse root N growth from storage gN/m^2/s F
- 130 DEADSTEMC dead stem C gC/m^2 T
- 131 DEADSTEMC_STORAGE dead stem C storage gC/m^2 F
- 132 DEADSTEMC_STORAGE_TO_XFER dead stem C shift storage to transfer gC/m^2/s F
- 133 DEADSTEMC_XFER dead stem C transfer gC/m^2 F
- 134 DEADSTEMC_XFER_TO_DEADSTEMC dead stem C growth from storage gC/m^2/s F
- 135 DEADSTEMN dead stem N gN/m^2 T
- 136 DEADSTEMN_STORAGE dead stem N storage gN/m^2 F
- 137 DEADSTEMN_STORAGE_TO_XFER dead stem N shift storage to transfer gN/m^2/s F
- 138 DEADSTEMN_XFER dead stem N transfer gN/m^2 F
- 139 DEADSTEMN_XFER_TO_DEADSTEMN dead stem N growth from storage gN/m^2/s F
- 140 DENIT total rate of denitrification gN/m^2/s T
- 141 DGNETDT derivative of net ground heat flux wrt soil temp W/m^2/K F
- 142 DISCOI 2 m Discomfort Index C T
- 143 DISCOIS 2 m Stull Discomfort Index C T
- 144 DISCOIS_R Rural 2 m Stull Discomfort Index C T
- 145 DISCOIS_U Urban 2 m Stull Discomfort Index C T
- 146 DISCOI_R Rural 2 m Discomfort Index C T
- 147 DISCOI_U Urban 2 m Discomfort Index C T
- 148 DISPLA displacement height m F
- 149 DISPVEGC displayed veg carbon, excluding storage and cpool gC/m^2 T
- 150 DISPVEGN displayed vegetation nitrogen gN/m^2 T
- 151 DLRAD downward longwave radiation below the canopy W/m^2 F
- 152 DORMANT_FLAG dormancy flag none F
- 153 DOWNREG fractional reduction in GPP due to N limitation proportion F
- 154 DPVLTRB1 turbulent deposition velocity 1 m/s F
- 155 DPVLTRB2 turbulent deposition velocity 2 m/s F
- 156 DPVLTRB3 turbulent deposition velocity 3 m/s F
- 157 DPVLTRB4 turbulent deposition velocity 4 m/s F
- 158 DSL dry surface layer thickness mm T
- 159 DSTDEP total dust deposition (dry+wet) from atmosphere kg/m^2/s T
- 160 DSTFLXT total surface dust emission kg/m2/s T
- 161 DT_VEG change in t_veg, last iteration K F
- 162 DWT_CONV_CFLUX conversion C flux (immediate loss to atm) (0 at all times except first timestep of year) gC/m^2/s T
- 163 DWT_CONV_CFLUX_DRIBBLED conversion C flux (immediate loss to atm), dribbled throughout the year gC/m^2/s T
- 164 DWT_CONV_CFLUX_PATCH patch-level conversion C flux (immediate loss to atm) (0 at all times except first timestep of gC/m^2/s F
- 165 DWT_CONV_NFLUX conversion N flux (immediate loss to atm) (0 at all times except first timestep of year) gN/m^2/s T
- 166 DWT_CONV_NFLUX_PATCH patch-level conversion N flux (immediate loss to atm) (0 at all times except first timestep of gN/m^2/s F
- 167 DWT_CROPPROD1C_GAIN landcover change-driven addition to 1-year crop product pool gC/m^2/s T
- 168 DWT_CROPPROD1N_GAIN landcover change-driven addition to 1-year crop product pool gN/m^2/s T
- 169 DWT_DEADCROOTC_TO_CWDC dead coarse root to CWD due to landcover change gC/m^2/s F
- 170 DWT_DEADCROOTN_TO_CWDN dead coarse root to CWD due to landcover change gN/m^2/s F
- 171 DWT_FROOTC_TO_LITR_CEL_C fine root to litter due to landcover change gC/m^2/s F
- 172 DWT_FROOTC_TO_LITR_LIG_C fine root to litter due to landcover change gC/m^2/s F
- 173 DWT_FROOTC_TO_LITR_MET_C fine root to litter due to landcover change gC/m^2/s F
- 174 DWT_FROOTN_TO_LITR_CEL_N fine root to litter due to landcover change gN/m^2/s F
- 175 DWT_FROOTN_TO_LITR_LIG_N fine root to litter due to landcover change gN/m^2/s F
- 176 DWT_FROOTN_TO_LITR_MET_N fine root to litter due to landcover change gN/m^2/s F
- 177 DWT_LIVECROOTC_TO_CWDC live coarse root to CWD due to landcover change gC/m^2/s F
- 178 DWT_LIVECROOTN_TO_CWDN live coarse root to CWD due to landcover change gN/m^2/s F
- 179 DWT_PROD100C_GAIN landcover change-driven addition to 100-yr wood product pool gC/m^2/s F
- 180 DWT_PROD100N_GAIN landcover change-driven addition to 100-yr wood product pool gN/m^2/s F
- 181 DWT_PROD10C_GAIN landcover change-driven addition to 10-yr wood product pool gC/m^2/s F
- 182 DWT_PROD10N_GAIN landcover change-driven addition to 10-yr wood product pool gN/m^2/s F
- 183 DWT_SEEDC_TO_DEADSTEM seed source to patch-level deadstem gC/m^2/s F
- 184 DWT_SEEDC_TO_DEADSTEM_PATCH patch-level seed source to patch-level deadstem (per-area-gridcell; only makes sense with dov2 gC/m^2/s F
- 185 DWT_SEEDC_TO_LEAF seed source to patch-level leaf gC/m^2/s F
- 186 DWT_SEEDC_TO_LEAF_PATCH patch-level seed source to patch-level leaf (per-area-gridcell; only makes sense with dov2xy=. gC/m^2/s F
- 187 DWT_SEEDN_TO_DEADSTEM seed source to patch-level deadstem gN/m^2/s T
- 188 DWT_SEEDN_TO_DEADSTEM_PATCH patch-level seed source to patch-level deadstem (per-area-gridcell; only makes sense with dov2 gN/m^2/s F
- 189 DWT_SEEDN_TO_LEAF seed source to patch-level leaf gN/m^2/s T
- 190 DWT_SEEDN_TO_LEAF_PATCH patch-level seed source to patch-level leaf (per-area-gridcell; only makes sense with dov2xy=. gN/m^2/s F
- 191 DWT_SLASH_CFLUX slash C flux (to litter diagnostic only) (0 at all times except first timestep of year) gC/m^2/s T
- 192 DWT_SLASH_CFLUX_PATCH patch-level slash C flux (to litter diagnostic only) (0 at all times except first timestep of gC/m^2/s F
- 193 DWT_WOODPRODC_GAIN landcover change-driven addition to wood product pools gC/m^2/s T
- 194 DWT_WOODPRODN_GAIN landcover change-driven addition to wood product pools gN/m^2/s T
- 195 DWT_WOOD_PRODUCTC_GAIN_PATCH patch-level landcover change-driven addition to wood product pools(0 at all times except first gC/m^2/s F
- 196 DYN_COL_ADJUSTMENTS_CH4 Adjustments in ch4 due to dynamic column areas; only makes sense at the column level: should n gC/m^2 F
- 197 DYN_COL_SOIL_ADJUSTMENTS_C Adjustments in soil carbon due to dynamic column areas; only makes sense at the column level: gC/m^2 F
- 198 DYN_COL_SOIL_ADJUSTMENTS_N Adjustments in soil nitrogen due to dynamic column areas; only makes sense at the column level gN/m^2 F
- 199 DYN_COL_SOIL_ADJUSTMENTS_NH4 Adjustments in soil NH4 due to dynamic column areas; only makes sense at the column level: sho gN/m^2 F
- 200 DYN_COL_SOIL_ADJUSTMENTS_NO3 Adjustments in soil NO3 due to dynamic column areas; only makes sense at the column level: sho gN/m^2 F
- 201 EFF_POROSITY effective porosity = porosity - vol_ice proportion F
- 202 EFLXBUILD building heat flux from change in interior building air temperature W/m^2 T
- 203 EFLX_DYNBAL dynamic land cover change conversion energy flux W/m^2 T
- 204 EFLX_GNET net heat flux into ground W/m^2 F
- 205 EFLX_GRND_LAKE net heat flux into lake/snow surface, excluding light transmission W/m^2 T
- 206 EFLX_LH_TOT total latent heat flux [+ to atm] W/m^2 T
- 207 EFLX_LH_TOT_ICE total latent heat flux [+ to atm] (ice landunits only) W/m^2 F
- 208 EFLX_LH_TOT_R Rural total evaporation W/m^2 T
- 209 EFLX_LH_TOT_U Urban total evaporation W/m^2 F
- 210 EFLX_SOIL_GRND soil heat flux [+ into soil] W/m^2 F
- 211 ELAI exposed one-sided leaf area index m^2/m^2 T
- 212 EMG ground emissivity proportion F
- 213 EMV vegetation emissivity proportion F
- 214 EOPT Eopt coefficient for VOC calc non F
- 215 EPT 2 m Equiv Pot Temp K T
- 216 EPT_R Rural 2 m Equiv Pot Temp K T
- 217 EPT_U Urban 2 m Equiv Pot Temp K T
- 218 ER total ecosystem respiration, autotrophic + heterotrophic gC/m^2/s T
- 219 ERRH2O total water conservation error mm T
- 220 ERRH2OSNO imbalance in snow depth (liquid water) mm T
- 221 ERRSEB surface energy conservation error W/m^2 T
- 222 ERRSOI soil/lake energy conservation error W/m^2 T
- 223 ERRSOL solar radiation conservation error W/m^2 T
- 224 ESAI exposed one-sided stem area index m^2/m^2 T
- 225 EXCESSC_MR excess C maintenance respiration gC/m^2/s F
- 226 EXCESS_CFLUX C flux not allocated due to downregulation gC/m^2/s F
- 227 FAREA_BURNED timestep fractional area burned s-1 T
- 228 FCANSNO fraction of canopy that is wet proportion F
- 229 FCEV canopy evaporation W/m^2 T
- 230 FCH4 Gridcell surface CH4 flux to atmosphere (+ to atm) kgC/m2/s T
- 231 FCH4TOCO2 Gridcell oxidation of CH4 to CO2 gC/m2/s T
- 232 FCH4_DFSAT CH4 additional flux due to changing fsat, natural vegetated and crop landunits only kgC/m2/s T
- 233 FCO2 CO2 flux to atmosphere (+ to atm) kgCO2/m2/s F
- 234 FCOV fractional impermeable area unitless T
- 235 FCTR canopy transpiration W/m^2 T
- 236 FDRY fraction of foliage that is green and dry proportion F
- 237 FERTNITRO Nitrogen fertilizer for each crop gN/m2/yr F
- 238 FERT_COUNTER time left to fertilize seconds F
- 239 FERT_TO_SMINN fertilizer to soil mineral N gN/m^2/s F
- 240 FFIX_TO_SMINN free living N fixation to soil mineral N gN/m^2/s T
- 241 FGEV ground evaporation W/m^2 T
- 242 FGR heat flux into soil/snow including snow melt and lake / snow light transmission W/m^2 T
- 243 FGR12 heat flux between soil layers 1 and 2 W/m^2 T
- 244 FGR_ICE heat flux into soil/snow including snow melt and lake / snow light transmission (ice landunits W/m^2 F
- 245 FGR_R Rural heat flux into soil/snow including snow melt and snow light transmission W/m^2 F
- 246 FGR_SOIL_R Rural downward heat flux at interface below each soil layer watt/m^2 F
- 247 FGR_U Urban heat flux into soil/snow including snow melt W/m^2 F
- 248 FH2OSFC fraction of ground covered by surface water unitless T
- 249 FH2OSFC_NOSNOW fraction of ground covered by surface water (if no snow present) unitless F
- 250 FINUNDATED fractional inundated area of vegetated columns unitless T
- 251 FINUNDATED_LAG time-lagged inundated fraction of vegetated columns unitless F
- 252 FIRA net infrared (longwave) radiation W/m^2 T
- 253 FIRA_ICE net infrared (longwave) radiation (ice landunits only) W/m^2 F
- 254 FIRA_R Rural net infrared (longwave) radiation W/m^2 T
- 255 FIRA_U Urban net infrared (longwave) radiation W/m^2 F
- 256 FIRE emitted infrared (longwave) radiation W/m^2 T
- 257 FIRE_ICE emitted infrared (longwave) radiation (ice landunits only) W/m^2 F
- 258 FIRE_R Rural emitted infrared (longwave) radiation W/m^2 T
- 259 FIRE_U Urban emitted infrared (longwave) radiation W/m^2 F
- 260 FLDS atmospheric longwave radiation (downscaled to columns in glacier regions) W/m^2 T
- 261 FLDS_ICE atmospheric longwave radiation (downscaled to columns in glacier regions) (ice landunits only) W/m^2 F
- 262 FMAX_DENIT_CARBONSUBSTRATE FMAX_DENIT_CARBONSUBSTRATE gN/m^3/s F
- 263 FMAX_DENIT_NITRATE FMAX_DENIT_NITRATE gN/m^3/s F
- 264 FPI fraction of potential immobilization proportion T
- 265 FPI_vr fraction of potential immobilization proportion F
- 266 FPSN photosynthesis umol m-2 s-1 T
- 267 FPSN24 24 hour accumulative patch photosynthesis starting from mid-night umol CO2/m^2 ground/day F
- 268 FPSN_WC Rubisco-limited photosynthesis umol m-2 s-1 F
- 269 FPSN_WJ RuBP-limited photosynthesis umol m-2 s-1 F
- 270 FPSN_WP Product-limited photosynthesis umol m-2 s-1 F
- 271 FRAC_ICEOLD fraction of ice relative to the tot water proportion F
- 272 FREE_RETRANSN_TO_NPOOL deployment of retranslocated N gN/m^2/s T
- 273 FROOTC fine root C gC/m^2 T
- 274 FROOTC_ALLOC fine root C allocation gC/m^2/s T
- 275 FROOTC_LOSS fine root C loss gC/m^2/s T
- 276 FROOTC_STORAGE fine root C storage gC/m^2 F
- 277 FROOTC_STORAGE_TO_XFER fine root C shift storage to transfer gC/m^2/s F
- 278 FROOTC_TO_LITTER fine root C litterfall gC/m^2/s F
- 279 FROOTC_XFER fine root C transfer gC/m^2 F
- 280 FROOTC_XFER_TO_FROOTC fine root C growth from storage gC/m^2/s F
- 281 FROOTN fine root N gN/m^2 T
- 282 FROOTN_STORAGE fine root N storage gN/m^2 F
- 283 FROOTN_STORAGE_TO_XFER fine root N shift storage to transfer gN/m^2/s F
- 284 FROOTN_TO_LITTER fine root N litterfall gN/m^2/s F
- 285 FROOTN_XFER fine root N transfer gN/m^2 F
- 286 FROOTN_XFER_TO_FROOTN fine root N growth from storage gN/m^2/s F
- 287 FROOT_MR fine root maintenance respiration gC/m^2/s F
- 288 FROOT_PROF profile for litter C and N inputs from fine roots 1/m F
- 289 FROST_TABLE frost table depth (natural vegetated and crop landunits only) m F
- 290 FSA absorbed solar radiation W/m^2 T
- 291 FSAT fractional area with water table at surface unitless T
- 292 FSA_ICE absorbed solar radiation (ice landunits only) W/m^2 F
- 293 FSA_R Rural absorbed solar radiation W/m^2 F
- 294 FSA_U Urban absorbed solar radiation W/m^2 F
- 295 FSD24 direct radiation (last 24hrs) K F
- 296 FSD240 direct radiation (last 240hrs) K F
- 297 FSDS atmospheric incident solar radiation W/m^2 T
- 298 FSDSND direct nir incident solar radiation W/m^2 T
- 299 FSDSNDLN direct nir incident solar radiation at local noon W/m^2 T
- 300 FSDSNI diffuse nir incident solar radiation W/m^2 T
- 301 FSDSVD direct vis incident solar radiation W/m^2 T
- 302 FSDSVDLN direct vis incident solar radiation at local noon W/m^2 T
- 303 FSDSVI diffuse vis incident solar radiation W/m^2 T
- 304 FSDSVILN diffuse vis incident solar radiation at local noon W/m^2 T
- 305 FSH sensible heat not including correction for land use change and rain/snow conversion W/m^2 T
- 306 FSH_G sensible heat from ground W/m^2 T
- 307 FSH_ICE sensible heat not including correction for land use change and rain/snow conversion (ice landu W/m^2 F
- 308 FSH_PRECIP_CONVERSION Sensible heat flux from conversion of rain/snow atm forcing W/m^2 T
- 309 FSH_R Rural sensible heat W/m^2 T
- 310 FSH_RUNOFF_ICE_TO_LIQ sensible heat flux generated from conversion of ice runoff to liquid W/m^2 T
- 311 FSH_TO_COUPLER sensible heat sent to coupler (includes corrections for land use change, rain/snow conversion W/m^2 T
- 312 FSH_U Urban sensible heat W/m^2 F
- 313 FSH_V sensible heat from veg W/m^2 T
- 314 FSI24 indirect radiation (last 24hrs) K F
- 315 FSI240 indirect radiation (last 240hrs) K F
- 316 FSM snow melt heat flux W/m^2 T
- 317 FSM_ICE snow melt heat flux (ice landunits only) W/m^2 F
- 318 FSM_R Rural snow melt heat flux W/m^2 F
- 319 FSM_U Urban snow melt heat flux W/m^2 F
- 320 FSNO fraction of ground covered by snow unitless T
- 321 FSNO_EFF effective fraction of ground covered by snow unitless T
- 322 FSNO_ICE fraction of ground covered by snow (ice landunits only) unitless F
- 323 FSR reflected solar radiation W/m^2 T
- 324 FSRND direct nir reflected solar radiation W/m^2 T
- 325 FSRNDLN direct nir reflected solar radiation at local noon W/m^2 T
- 326 FSRNI diffuse nir reflected solar radiation W/m^2 T
- 327 FSRSF reflected solar radiation W/m^2 T
- 328 FSRSFND direct nir reflected solar radiation W/m^2 T
- 329 FSRSFNDLN direct nir reflected solar radiation at local noon W/m^2 T
- 330 FSRSFNI diffuse nir reflected solar radiation W/m^2 T
- 331 FSRSFVD direct vis reflected solar radiation W/m^2 T
- 332 FSRSFVDLN direct vis reflected solar radiation at local noon W/m^2 T
- 333 FSRSFVI diffuse vis reflected solar radiation W/m^2 T
- 334 FSRVD direct vis reflected solar radiation W/m^2 T
- 335 FSRVDLN direct vis reflected solar radiation at local noon W/m^2 T
- 336 FSRVI diffuse vis reflected solar radiation W/m^2 T
- 337 FSR_ICE reflected solar radiation (ice landunits only) W/m^2 F
- 338 FSUN sunlit fraction of canopy proportion F
- 339 FSUN24 fraction sunlit (last 24hrs) K F
- 340 FSUN240 fraction sunlit (last 240hrs) K F
- 341 FUELC fuel load gC/m^2 T
- 342 FV friction velocity for dust model m/s F
- 343 FWET fraction of canopy that is wet proportion F
- 344 F_DENIT denitrification flux gN/m^2/s T
- 345 F_DENIT_BASE F_DENIT_BASE gN/m^3/s F
- 346 F_DENIT_vr denitrification flux gN/m^3/s F
- 347 F_N2O_DENIT denitrification N2O flux gN/m^2/s T
- 348 F_N2O_NIT nitrification N2O flux gN/m^2/s T
- 349 F_NIT nitrification flux gN/m^2/s T
- 350 F_NIT_vr nitrification flux gN/m^3/s F
- 351 FireComp_BC fire emissions flux of BC kg/m2/sec F
- 352 FireComp_OC fire emissions flux of OC kg/m2/sec F
- 353 FireComp_SO2 fire emissions flux of SO2 kg/m2/sec F
- 354 FireEmis_TOT Total fire emissions flux gC/m2/sec F
- 355 FireEmis_ZTOP Top of vertical fire emissions distribution m F
- 356 FireMech_SO2 fire emissions flux of SO2 kg/m2/sec F
- 357 FireMech_bc_a1 fire emissions flux of bc_a1 kg/m2/sec F
- 358 FireMech_pom_a1 fire emissions flux of pom_a1 kg/m2/sec F
- 359 GAMMA total gamma for VOC calc non F
- 360 GAMMAA gamma A for VOC calc non F
- 361 GAMMAC gamma C for VOC calc non F
- 362 GAMMAL gamma L for VOC calc non F
- 363 GAMMAP gamma P for VOC calc non F
- 364 GAMMAS gamma S for VOC calc non F
- 365 GAMMAT gamma T for VOC calc non F
- 366 GDD0 Growing degree days base 0C from planting ddays F
- 367 GDD020 Twenty year average of growing degree days base 0C from planting ddays F
- 368 GDD10 Growing degree days base 10C from planting ddays F
- 369 GDD1020 Twenty year average of growing degree days base 10C from planting ddays F
- 370 GDD8 Growing degree days base 8C from planting ddays F
- 371 GDD820 Twenty year average of growing degree days base 8C from planting ddays F
- 372 GDDHARV Growing degree days (gdd) needed to harvest ddays F
- 373 GDDPLANT Accumulated growing degree days past planting date for crop ddays F
- 374 GDDTSOI Growing degree-days from planting (top two soil layers) ddays F
- 375 GPP gross primary production gC/m^2/s T
- 376 GR total growth respiration gC/m^2/s T
- 377 GRAINC grain C (does not equal yield) gC/m^2 T
- 378 GRAINC_TO_FOOD grain C to food gC/m^2/s T
- 379 GRAINC_TO_SEED grain C to seed gC/m^2/s T
- 380 GRAINN grain N gN/m^2 T
- 381 GRESP_STORAGE growth respiration storage gC/m^2 F
- 382 GRESP_STORAGE_TO_XFER growth respiration shift storage to transfer gC/m^2/s F
- 383 GRESP_XFER growth respiration transfer gC/m^2 F
- 384 GROSS_NMIN gross rate of N mineralization gN/m^2/s T
- 385 GROSS_NMIN_vr gross rate of N mineralization gN/m^3/s F
- 386 GSSHA shaded leaf stomatal conductance umol H20/m2/s T
- 387 GSSHALN shaded leaf stomatal conductance at local noon umol H20/m2/s T
- 388 GSSUN sunlit leaf stomatal conductance umol H20/m2/s T
- 389 GSSUNLN sunlit leaf stomatal conductance at local noon umol H20/m2/s T
- 390 H2OCAN intercepted water mm T
- 391 H2OSFC surface water depth mm T
- 392 H2OSNO snow depth (liquid water) mm T
- 393 H2OSNO_ICE snow depth (liquid water, ice landunits only) mm F
- 394 H2OSNO_TOP mass of snow in top snow layer kg/m2 T
- 395 H2OSOI volumetric soil water (natural vegetated and crop landunits only) mm3/mm3 T
- 396 HBOT canopy bottom m F
- 397 HEAT_CONTENT1 initial gridcell total heat content J/m^2 T
- 398 HEAT_CONTENT1_VEG initial gridcell total heat content - natural vegetated and crop landunits only J/m^2 F
- 399 HEAT_CONTENT2 post land cover change total heat content J/m^2 F
- 400 HEAT_FROM_AC sensible heat flux put into canyon due to heat removed from air conditioning W/m^2 T
- 401 HIA 2 m NWS Heat Index C T
- 402 HIA_R Rural 2 m NWS Heat Index C T
- 403 HIA_U Urban 2 m NWS Heat Index C T
- 404 HK hydraulic conductivity (natural vegetated and crop landunits only) mm/s F
- 405 HR total heterotrophic respiration gC/m^2/s T
- 406 HR_vr total vertically resolved heterotrophic respiration gC/m^3/s T
- 407 HTOP canopy top m T
- 408 HUMIDEX 2 m Humidex C T
- 409 HUMIDEX_R Rural 2 m Humidex C T
- 410 HUMIDEX_U Urban 2 m Humidex C T
- 411 ICE_CONTENT1 initial gridcell total ice content mm T
- 412 ICE_CONTENT2 post land cover change total ice content mm F
- 413 ICE_MODEL_FRACTION Ice sheet model fractional coverage unitless F
- 414 INIT_GPP GPP flux before downregulation gC/m^2/s F
- 415 INT_SNOW accumulated swe (natural vegetated and crop landunits only) mm F
- 416 INT_SNOW_ICE accumulated swe (ice landunits only) mm F
- 417 JMX25T canopy profile of jmax umol/m2/s T
- 418 Jmx25Z maximum rate of electron transport at 25 Celcius for canopy layers umol electrons/m2/s T
- 419 KROOT root conductance each soil layer 1/s F
- 420 KSOIL soil conductance in each soil layer 1/s F
- 421 K_CWD coarse woody debris potential loss coefficient 1/s F
- 422 K_LITR1 litter 1 potential loss coefficient 1/s F
- 423 K_LITR2 litter 2 potential loss coefficient 1/s F
- 424 K_LITR3 litter 3 potential loss coefficient 1/s F
- 425 K_NITR K_NITR 1/s F
- 426 K_NITR_H2O K_NITR_H2O unitless F
- 427 K_NITR_PH K_NITR_PH unitless F
- 428 K_NITR_T K_NITR_T unitless F
- 429 K_SOIL1 soil 1 potential loss coefficient 1/s F
- 430 K_SOIL2 soil 2 potential loss coefficient 1/s F
- 431 K_SOIL3 soil 3 potential loss coefficient 1/s F
- 432 LAI240 240hr average of leaf area index m^2/m^2 F
- 433 LAISHA shaded projected leaf area index m^2/m^2 T
- 434 LAISUN sunlit projected leaf area index m^2/m^2 T
- 435 LAKEICEFRAC lake layer ice mass fraction unitless F
- 436 LAKEICEFRAC_SURF surface lake layer ice mass fraction unitless T
- 437 LAKEICETHICK thickness of lake ice (including physical expansion on freezing) m T
- 438 LAND_USE_FLUX total C emitted from land cover conversion (smoothed over the year) and wood and grain product gC/m^2/s T
- 439 LATBASET latitude vary base temperature for gddplant degree C F
- 440 LEAFC leaf C gC/m^2 T
- 441 LEAFCN Leaf CN ratio used for flexible CN gC/gN T
- 442 LEAFCN_OFFSET Leaf C:N used by FUN unitless F
- 443 LEAFCN_STORAGE Storage Leaf CN ratio used for flexible CN gC/gN F
- 444 LEAFC_ALLOC leaf C allocation gC/m^2/s T
- 445 LEAFC_CHANGE C change in leaf gC/m^2/s T
- 446 LEAFC_LOSS leaf C loss gC/m^2/s T
- 447 LEAFC_STORAGE leaf C storage gC/m^2 F
- 448 LEAFC_STORAGE_TO_XFER leaf C shift storage to transfer gC/m^2/s F
- 449 LEAFC_STORAGE_XFER_ACC Accumulated leaf C transfer gC/m^2 F
- 450 LEAFC_TO_BIOFUELC leaf C to biofuel C gC/m^2/s T
- 451 LEAFC_TO_LITTER leaf C litterfall gC/m^2/s F
- 452 LEAFC_TO_LITTER_FUN leaf C litterfall used by FUN gC/m^2/s T
- 453 LEAFC_XFER leaf C transfer gC/m^2 F
- 454 LEAFC_XFER_TO_LEAFC leaf C growth from storage gC/m^2/s F
- 455 LEAFN leaf N gN/m^2 T
- 456 LEAFN_STORAGE leaf N storage gN/m^2 F
- 457 LEAFN_STORAGE_TO_XFER leaf N shift storage to transfer gN/m^2/s F
- 458 LEAFN_STORAGE_XFER_ACC Accmulated leaf N transfer gN/m^2 F
- 459 LEAFN_TO_LITTER leaf N litterfall gN/m^2/s T
- 460 LEAFN_TO_RETRANSN leaf N to retranslocated N pool gN/m^2/s F
- 461 LEAFN_XFER leaf N transfer gN/m^2 F
- 462 LEAFN_XFER_TO_LEAFN leaf N growth from storage gN/m^2/s F
- 463 LEAF_MR leaf maintenance respiration gC/m^2/s T
- 464 LEAF_PROF profile for litter C and N inputs from leaves 1/m F
- 465 LFC2 conversion area fraction of BET and BDT that burned per sec T
- 466 LGSF long growing season factor proportion F
- 467 LIQCAN intercepted liquid water mm T
- 468 LIQUID_CONTENT1 initial gridcell total liq content mm T
- 469 LIQUID_CONTENT2 post landuse change gridcell total liq content mm F
- 470 LIQUID_WATER_TEMP1 initial gridcell weighted average liquid water temperature K F
- 471 LITFALL litterfall (leaves and fine roots) gC/m^2/s T
- 472 LITFIRE litter fire losses gC/m^2/s F
- 473 LITR1C LITR1 C gC/m^2 T
- 474 LITR1C_1m LITR1 C to 1 meter gC/m^2 F
- 475 LITR1C_TNDNCY_VERT_TRANS litter 1 C tendency due to vertical transport gC/m^3/s F
- 476 LITR1C_TO_SOIL1C decomp. of litter 1 C to soil 1 C gC/m^2/s F
- 477 LITR1C_TO_SOIL1C_vr decomp. of litter 1 C to soil 1 C gC/m^3/s F
- 478 LITR1C_vr LITR1 C (vertically resolved) gC/m^3 T
- 479 LITR1N LITR1 N gN/m^2 T
- 480 LITR1N_1m LITR1 N to 1 meter gN/m^2 F
- 481 LITR1N_TNDNCY_VERT_TRANS litter 1 N tendency due to vertical transport gN/m^3/s F
- 482 LITR1N_TO_SOIL1N decomp. of litter 1 N to soil 1 N gN/m^2 F
- 483 LITR1N_TO_SOIL1N_vr decomp. of litter 1 N to soil 1 N gN/m^3 F
- 484 LITR1N_vr LITR1 N (vertically resolved) gN/m^3 T
- 485 LITR1_HR Het. Resp. from litter 1 gC/m^2/s F
- 486 LITR1_HR_vr Het. Resp. from litter 1 gC/m^3/s F
- 487 LITR2C LITR2 C gC/m^2 T
- 488 LITR2C_1m LITR2 C to 1 meter gC/m^2 F
- 489 LITR2C_TNDNCY_VERT_TRANS litter 2 C tendency due to vertical transport gC/m^3/s F
- 490 LITR2C_TO_SOIL1C decomp. of litter 2 C to soil 1 C gC/m^2/s F
- 491 LITR2C_TO_SOIL1C_vr decomp. of litter 2 C to soil 1 C gC/m^3/s F
- 492 LITR2C_vr LITR2 C (vertically resolved) gC/m^3 T
- 493 LITR2N LITR2 N gN/m^2 T
- 494 LITR2N_1m LITR2 N to 1 meter gN/m^2 F
- 495 LITR2N_TNDNCY_VERT_TRANS litter 2 N tendency due to vertical transport gN/m^3/s F
- 496 LITR2N_TO_SOIL1N decomp. of litter 2 N to soil 1 N gN/m^2 F
- 497 LITR2N_TO_SOIL1N_vr decomp. of litter 2 N to soil 1 N gN/m^3 F
- 498 LITR2N_vr LITR2 N (vertically resolved) gN/m^3 T
- 499 LITR2_HR Het. Resp. from litter 2 gC/m^2/s F
- 500 LITR2_HR_vr Het. Resp. from litter 2 gC/m^3/s F
- 501 LITR3C LITR3 C gC/m^2 T
- 502 LITR3C_1m LITR3 C to 1 meter gC/m^2 F
- 503 LITR3C_TNDNCY_VERT_TRANS litter 3 C tendency due to vertical transport gC/m^3/s F
- 504 LITR3C_TO_SOIL2C decomp. of litter 3 C to soil 2 C gC/m^2/s F
- 505 LITR3C_TO_SOIL2C_vr decomp. of litter 3 C to soil 2 C gC/m^3/s F
- 506 LITR3C_vr LITR3 C (vertically resolved) gC/m^3 T
- 507 LITR3N LITR3 N gN/m^2 T
- 508 LITR3N_1m LITR3 N to 1 meter gN/m^2 F
- 509 LITR3N_TNDNCY_VERT_TRANS litter 3 N tendency due to vertical transport gN/m^3/s F
- 510 LITR3N_TO_SOIL2N decomp. of litter 3 N to soil 2 N gN/m^2 F
- 511 LITR3N_TO_SOIL2N_vr decomp. of litter 3 N to soil 2 N gN/m^3 F
- 512 LITR3N_vr LITR3 N (vertically resolved) gN/m^3 T
- 513 LITR3_HR Het. Resp. from litter 3 gC/m^2/s F
- 514 LITR3_HR_vr Het. Resp. from litter 3 gC/m^3/s F
- 515 LITTERC_HR litter C heterotrophic respiration gC/m^2/s T
- 516 LITTERC_LOSS litter C loss gC/m^2/s T
- 517 LIVECROOTC live coarse root C gC/m^2 T
- 518 LIVECROOTC_STORAGE live coarse root C storage gC/m^2 F
- 519 LIVECROOTC_STORAGE_TO_XFER live coarse root C shift storage to transfer gC/m^2/s F
- 520 LIVECROOTC_TO_DEADCROOTC live coarse root C turnover gC/m^2/s F
- 521 LIVECROOTC_XFER live coarse root C transfer gC/m^2 F
- 522 LIVECROOTC_XFER_TO_LIVECROOTC live coarse root C growth from storage gC/m^2/s F
- 523 LIVECROOTN live coarse root N gN/m^2 T
- 524 LIVECROOTN_STORAGE live coarse root N storage gN/m^2 F
- 525 LIVECROOTN_STORAGE_TO_XFER live coarse root N shift storage to transfer gN/m^2/s F
- 526 LIVECROOTN_TO_DEADCROOTN live coarse root N turnover gN/m^2/s F
- 527 LIVECROOTN_TO_RETRANSN live coarse root N to retranslocated N pool gN/m^2/s F
- 528 LIVECROOTN_XFER live coarse root N transfer gN/m^2 F
- 529 LIVECROOTN_XFER_TO_LIVECROOTN live coarse root N growth from storage gN/m^2/s F
- 530 LIVECROOT_MR live coarse root maintenance respiration gC/m^2/s F
- 531 LIVESTEMC live stem C gC/m^2 T
- 532 LIVESTEMC_STORAGE live stem C storage gC/m^2 F
- 533 LIVESTEMC_STORAGE_TO_XFER live stem C shift storage to transfer gC/m^2/s F
- 534 LIVESTEMC_TO_BIOFUELC livestem C to biofuel C gC/m^2/s T
- 535 LIVESTEMC_TO_DEADSTEMC live stem C turnover gC/m^2/s F
- 536 LIVESTEMC_XFER live stem C transfer gC/m^2 F
- 537 LIVESTEMC_XFER_TO_LIVESTEMC live stem C growth from storage gC/m^2/s F
- 538 LIVESTEMN live stem N gN/m^2 T
- 539 LIVESTEMN_STORAGE live stem N storage gN/m^2 F
- 540 LIVESTEMN_STORAGE_TO_XFER live stem N shift storage to transfer gN/m^2/s F
- 541 LIVESTEMN_TO_DEADSTEMN live stem N turnover gN/m^2/s F
- 542 LIVESTEMN_TO_RETRANSN live stem N to retranslocated N pool gN/m^2/s F
- 543 LIVESTEMN_XFER live stem N transfer gN/m^2 F
- 544 LIVESTEMN_XFER_TO_LIVESTEMN live stem N growth from storage gN/m^2/s F
- 545 LIVESTEM_MR live stem maintenance respiration gC/m^2/s F
- 546 LNC leaf N concentration gN leaf/m^2 T
- 547 LWdown atmospheric longwave radiation (downscaled to columns in glacier regions) W/m^2 F
- 548 LWup upwelling longwave radiation W/m^2 F
- 549 MEG_acetaldehyde MEGAN flux kg/m2/sec T
- 550 MEG_acetic_acid MEGAN flux kg/m2/sec T
- 551 MEG_acetone MEGAN flux kg/m2/sec T
- 552 MEG_carene_3 MEGAN flux kg/m2/sec T
- 553 MEG_ethanol MEGAN flux kg/m2/sec T
- 554 MEG_formaldehyde MEGAN flux kg/m2/sec T
- 555 MEG_isoprene MEGAN flux kg/m2/sec T
- 556 MEG_methanol MEGAN flux kg/m2/sec T
- 557 MEG_pinene_a MEGAN flux kg/m2/sec T
- 558 MEG_thujene_a MEGAN flux kg/m2/sec T
- 559 MR maintenance respiration gC/m^2/s T
- 560 M_CWDC_TO_FIRE coarse woody debris C fire loss gC/m^2/s F
- 561 M_CWDC_TO_FIRE_vr coarse woody debris C fire loss gC/m^3/s F
- 562 M_CWDN_TO_FIRE coarse woody debris N fire loss gN/m^2 F
- 563 M_CWDN_TO_FIRE_vr coarse woody debris N fire loss gN/m^3 F
- 564 M_DEADCROOTC_STORAGE_TO_LITTER dead coarse root C storage mortality gC/m^2/s F
- 565 M_DEADCROOTC_STORAGE_TO_LITTER_FIRE dead coarse root C storage fire mortality to litter gC/m^2/s F
- 566 M_DEADCROOTC_TO_LITTER dead coarse root C mortality gC/m^2/s F
- 567 M_DEADCROOTC_XFER_TO_LITTER dead coarse root C transfer mortality gC/m^2/s F
- 568 M_DEADCROOTN_STORAGE_TO_FIRE dead coarse root N storage fire loss gN/m^2/s F
- 569 M_DEADCROOTN_STORAGE_TO_LITTER dead coarse root N storage mortality gN/m^2/s F
- 570 M_DEADCROOTN_TO_FIRE dead coarse root N fire loss gN/m^2/s F
- 571 M_DEADCROOTN_TO_LITTER dead coarse root N mortality gN/m^2/s F
- 572 M_DEADCROOTN_TO_LITTER_FIRE dead coarse root N fire mortality to litter gN/m^2/s F
- 573 M_DEADCROOTN_XFER_TO_FIRE dead coarse root N transfer fire loss gN/m^2/s F
- 574 M_DEADCROOTN_XFER_TO_LITTER dead coarse root N transfer mortality gN/m^2/s F
- 575 M_DEADROOTC_STORAGE_TO_FIRE dead root C storage fire loss gC/m^2/s F
- 576 M_DEADROOTC_STORAGE_TO_LITTER_FIRE dead root C storage fire mortality to litter gC/m^2/s F
- 577 M_DEADROOTC_TO_FIRE dead root C fire loss gC/m^2/s F
- 578 M_DEADROOTC_TO_LITTER_FIRE dead root C fire mortality to litter gC/m^2/s F
- 579 M_DEADROOTC_XFER_TO_FIRE dead root C transfer fire loss gC/m^2/s F
- 580 M_DEADROOTC_XFER_TO_LITTER_FIRE dead root C transfer fire mortality to litter gC/m^2/s F
- 581 M_DEADSTEMC_STORAGE_TO_FIRE dead stem C storage fire loss gC/m^2/s F
- 582 M_DEADSTEMC_STORAGE_TO_LITTER dead stem C storage mortality gC/m^2/s F
- 583 M_DEADSTEMC_STORAGE_TO_LITTER_FIRE dead stem C storage fire mortality to litter gC/m^2/s F
- 584 M_DEADSTEMC_TO_FIRE dead stem C fire loss gC/m^2/s F
- 585 M_DEADSTEMC_TO_LITTER dead stem C mortality gC/m^2/s F
- 586 M_DEADSTEMC_TO_LITTER_FIRE dead stem C fire mortality to litter gC/m^2/s F
- 587 M_DEADSTEMC_XFER_TO_FIRE dead stem C transfer fire loss gC/m^2/s F
- 588 M_DEADSTEMC_XFER_TO_LITTER dead stem C transfer mortality gC/m^2/s F
- 589 M_DEADSTEMC_XFER_TO_LITTER_FIRE dead stem C transfer fire mortality to litter gC/m^2/s F
- 590 M_DEADSTEMN_STORAGE_TO_FIRE dead stem N storage fire loss gN/m^2/s F
- 591 M_DEADSTEMN_STORAGE_TO_LITTER dead stem N storage mortality gN/m^2/s F
- 592 M_DEADSTEMN_TO_FIRE dead stem N fire loss gN/m^2/s F
- 593 M_DEADSTEMN_TO_LITTER dead stem N mortality gN/m^2/s F
- 594 M_DEADSTEMN_TO_LITTER_FIRE dead stem N fire mortality to litter gN/m^2/s F
- 595 M_DEADSTEMN_XFER_TO_FIRE dead stem N transfer fire loss gN/m^2/s F
- 596 M_DEADSTEMN_XFER_TO_LITTER dead stem N transfer mortality gN/m^2/s F
- 597 M_FROOTC_STORAGE_TO_FIRE fine root C storage fire loss gC/m^2/s F
- 598 M_FROOTC_STORAGE_TO_LITTER fine root C storage mortality gC/m^2/s F
- 599 M_FROOTC_STORAGE_TO_LITTER_FIRE fine root C storage fire mortality to litter gC/m^2/s F
- 600 M_FROOTC_TO_FIRE fine root C fire loss gC/m^2/s F
- 601 M_FROOTC_TO_LITTER fine root C mortality gC/m^2/s F
- 602 M_FROOTC_TO_LITTER_FIRE fine root C fire mortality to litter gC/m^2/s F
- 603 M_FROOTC_XFER_TO_FIRE fine root C transfer fire loss gC/m^2/s F
- 604 M_FROOTC_XFER_TO_LITTER fine root C transfer mortality gC/m^2/s F
- 605 M_FROOTC_XFER_TO_LITTER_FIRE fine root C transfer fire mortality to litter gC/m^2/s F
- 606 M_FROOTN_STORAGE_TO_FIRE fine root N storage fire loss gN/m^2/s F
- 607 M_FROOTN_STORAGE_TO_LITTER fine root N storage mortality gN/m^2/s F
- 608 M_FROOTN_TO_FIRE fine root N fire loss gN/m^2/s F
- 609 M_FROOTN_TO_LITTER fine root N mortality gN/m^2/s F
- 610 M_FROOTN_XFER_TO_FIRE fine root N transfer fire loss gN/m^2/s F
- 611 M_FROOTN_XFER_TO_LITTER fine root N transfer mortality gN/m^2/s F
- 612 M_GRESP_STORAGE_TO_FIRE growth respiration storage fire loss gC/m^2/s F
- 613 M_GRESP_STORAGE_TO_LITTER growth respiration storage mortality gC/m^2/s F
- 614 M_GRESP_STORAGE_TO_LITTER_FIRE growth respiration storage fire mortality to litter gC/m^2/s F
- 615 M_GRESP_XFER_TO_FIRE growth respiration transfer fire loss gC/m^2/s F
- 616 M_GRESP_XFER_TO_LITTER growth respiration transfer mortality gC/m^2/s F
- 617 M_GRESP_XFER_TO_LITTER_FIRE growth respiration transfer fire mortality to litter gC/m^2/s F
- 618 M_LEAFC_STORAGE_TO_FIRE leaf C storage fire loss gC/m^2/s F
- 619 M_LEAFC_STORAGE_TO_LITTER leaf C storage mortality gC/m^2/s F
- 620 M_LEAFC_STORAGE_TO_LITTER_FIRE leaf C fire mortality to litter gC/m^2/s F
- 621 M_LEAFC_TO_FIRE leaf C fire loss gC/m^2/s F
- 622 M_LEAFC_TO_LITTER leaf C mortality gC/m^2/s F
- 623 M_LEAFC_TO_LITTER_FIRE leaf C fire mortality to litter gC/m^2/s F
- 624 M_LEAFC_XFER_TO_FIRE leaf C transfer fire loss gC/m^2/s F
- 625 M_LEAFC_XFER_TO_LITTER leaf C transfer mortality gC/m^2/s F
- 626 M_LEAFC_XFER_TO_LITTER_FIRE leaf C transfer fire mortality to litter gC/m^2/s F
- 627 M_LEAFN_STORAGE_TO_FIRE leaf N storage fire loss gN/m^2/s F
- 628 M_LEAFN_STORAGE_TO_LITTER leaf N storage mortality gN/m^2/s F
- 629 M_LEAFN_TO_FIRE leaf N fire loss gN/m^2/s F
- 630 M_LEAFN_TO_LITTER leaf N mortality gN/m^2/s F
- 631 M_LEAFN_XFER_TO_FIRE leaf N transfer fire loss gN/m^2/s F
- 632 M_LEAFN_XFER_TO_LITTER leaf N transfer mortality gN/m^2/s F
- 633 M_LITR1C_TO_FIRE litter 1 C fire loss gC/m^2/s F
- 634 M_LITR1C_TO_FIRE_vr litter 1 C fire loss gC/m^3/s F
- 635 M_LITR1C_TO_LEACHING litter 1 C leaching loss gC/m^2/s F
- 636 M_LITR1N_TO_FIRE litter 1 N fire loss gN/m^2 F
- 637 M_LITR1N_TO_FIRE_vr litter 1 N fire loss gN/m^3 F
- 638 M_LITR1N_TO_LEACHING litter 1 N leaching loss gN/m^2/s F
- 639 M_LITR2C_TO_FIRE litter 2 C fire loss gC/m^2/s F
- 640 M_LITR2C_TO_FIRE_vr litter 2 C fire loss gC/m^3/s F
- 641 M_LITR2C_TO_LEACHING litter 2 C leaching loss gC/m^2/s F
- 642 M_LITR2N_TO_FIRE litter 2 N fire loss gN/m^2 F
- 643 M_LITR2N_TO_FIRE_vr litter 2 N fire loss gN/m^3 F
- 644 M_LITR2N_TO_LEACHING litter 2 N leaching loss gN/m^2/s F
- 645 M_LITR3C_TO_FIRE litter 3 C fire loss gC/m^2/s F
- 646 M_LITR3C_TO_FIRE_vr litter 3 C fire loss gC/m^3/s F
- 647 M_LITR3C_TO_LEACHING litter 3 C leaching loss gC/m^2/s F
- 648 M_LITR3N_TO_FIRE litter 3 N fire loss gN/m^2 F
- 649 M_LITR3N_TO_FIRE_vr litter 3 N fire loss gN/m^3 F
- 650 M_LITR3N_TO_LEACHING litter 3 N leaching loss gN/m^2/s F
- 651 M_LIVECROOTC_STORAGE_TO_LITTER live coarse root C storage mortality gC/m^2/s F
- 652 M_LIVECROOTC_STORAGE_TO_LITTER_FIRE live coarse root C fire mortality to litter gC/m^2/s F
- 653 M_LIVECROOTC_TO_LITTER live coarse root C mortality gC/m^2/s F
- 654 M_LIVECROOTC_XFER_TO_LITTER live coarse root C transfer mortality gC/m^2/s F
- 655 M_LIVECROOTN_STORAGE_TO_FIRE live coarse root N storage fire loss gN/m^2/s F
- 656 M_LIVECROOTN_STORAGE_TO_LITTER live coarse root N storage mortality gN/m^2/s F
- 657 M_LIVECROOTN_TO_FIRE live coarse root N fire loss gN/m^2/s F
- 658 M_LIVECROOTN_TO_LITTER live coarse root N mortality gN/m^2/s F
- 659 M_LIVECROOTN_XFER_TO_FIRE live coarse root N transfer fire loss gN/m^2/s F
- 660 M_LIVECROOTN_XFER_TO_LITTER live coarse root N transfer mortality gN/m^2/s F
- 661 M_LIVEROOTC_STORAGE_TO_FIRE live root C storage fire loss gC/m^2/s F
- 662 M_LIVEROOTC_STORAGE_TO_LITTER_FIRE live root C storage fire mortality to litter gC/m^2/s F
- 663 M_LIVEROOTC_TO_DEADROOTC_FIRE live root C fire mortality to dead root C gC/m^2/s F
- 664 M_LIVEROOTC_TO_FIRE live root C fire loss gC/m^2/s F
- 665 M_LIVEROOTC_TO_LITTER_FIRE live root C fire mortality to litter gC/m^2/s F
- 666 M_LIVEROOTC_XFER_TO_FIRE live root C transfer fire loss gC/m^2/s F
- 667 M_LIVEROOTC_XFER_TO_LITTER_FIRE live root C transfer fire mortality to litter gC/m^2/s F
- 668 M_LIVESTEMC_STORAGE_TO_FIRE live stem C storage fire loss gC/m^2/s F
- 669 M_LIVESTEMC_STORAGE_TO_LITTER live stem C storage mortality gC/m^2/s F
- 670 M_LIVESTEMC_STORAGE_TO_LITTER_FIRE live stem C storage fire mortality to litter gC/m^2/s F
- 671 M_LIVESTEMC_TO_DEADSTEMC_FIRE live stem C fire mortality to dead stem C gC/m^2/s F
- 672 M_LIVESTEMC_TO_FIRE live stem C fire loss gC/m^2/s F
- 673 M_LIVESTEMC_TO_LITTER live stem C mortality gC/m^2/s F
- 674 M_LIVESTEMC_TO_LITTER_FIRE live stem C fire mortality to litter gC/m^2/s F
- 675 M_LIVESTEMC_XFER_TO_FIRE live stem C transfer fire loss gC/m^2/s F
- 676 M_LIVESTEMC_XFER_TO_LITTER live stem C transfer mortality gC/m^2/s F
- 677 M_LIVESTEMC_XFER_TO_LITTER_FIRE live stem C transfer fire mortality to litter gC/m^2/s F
- 678 M_LIVESTEMN_STORAGE_TO_FIRE live stem N storage fire loss gN/m^2/s F
- 679 M_LIVESTEMN_STORAGE_TO_LITTER live stem N storage mortality gN/m^2/s F
- 680 M_LIVESTEMN_TO_FIRE live stem N fire loss gN/m^2/s F
- 681 M_LIVESTEMN_TO_LITTER live stem N mortality gN/m^2/s F
- 682 M_LIVESTEMN_XFER_TO_FIRE live stem N transfer fire loss gN/m^2/s F
- 683 M_LIVESTEMN_XFER_TO_LITTER live stem N transfer mortality gN/m^2/s F
- 684 M_RETRANSN_TO_FIRE retranslocated N pool fire loss gN/m^2/s F
- 685 M_RETRANSN_TO_LITTER retranslocated N pool mortality gN/m^2/s F
- 686 M_SOIL1C_TO_LEACHING soil 1 C leaching loss gC/m^2/s F
- 687 M_SOIL1N_TO_LEACHING soil 1 N leaching loss gN/m^2/s F
- 688 M_SOIL2C_TO_LEACHING soil 2 C leaching loss gC/m^2/s F
- 689 M_SOIL2N_TO_LEACHING soil 2 N leaching loss gN/m^2/s F
- 690 M_SOIL3C_TO_LEACHING soil 3 C leaching loss gC/m^2/s F
- 691 M_SOIL3N_TO_LEACHING soil 3 N leaching loss gN/m^2/s F
- 692 NACTIVE Mycorrhizal N uptake flux gN/m^2/s T
- 693 NACTIVE_NH4 Mycorrhizal N uptake flux gN/m^2/s T
- 694 NACTIVE_NO3 Mycorrhizal N uptake flux gN/m^2/s T
- 695 NAM AM-associated N uptake flux gN/m^2/s T
- 696 NAM_NH4 AM-associated N uptake flux gN/m^2/s T
- 697 NAM_NO3 AM-associated N uptake flux gN/m^2/s T
- 698 NBP net biome production, includes fire, landuse, harvest and hrv_xsmrpool flux (latter smoothed o gC/m^2/s T
- 699 NDEPLOY total N deployed in new growth gN/m^2/s T
- 700 NDEP_PROF profile for atmospheric N deposition 1/m F
- 701 NDEP_TO_SMINN atmospheric N deposition to soil mineral N gN/m^2/s T
- 702 NECM ECM-associated N uptake flux gN/m^2/s T
- 703 NECM_NH4 ECM-associated N uptake flux gN/m^2/s T
- 704 NECM_NO3 ECM-associated N uptake flux gN/m^2/s T
- 705 NEE net ecosystem exchange of carbon, includes fire and hrv_xsmrpool (latter smoothed over the yea gC/m^2/s T
- 706 NEM Gridcell net adjustment to net carbon exchange passed to atm. for methane production gC/m2/s T
- 707 NEP net ecosystem production, excludes fire, landuse, and harvest flux, positive for sink gC/m^2/s T
- 708 NET_NMIN net rate of N mineralization gN/m^2/s T
- 709 NET_NMIN_vr net rate of N mineralization gN/m^3/s F
- 710 NFERTILIZATION fertilizer added gN/m^2/s T
- 711 NFIRE fire counts valid only in Reg.C counts/km2/sec T
- 712 NFIX Symbiotic BNF uptake flux gN/m^2/s T
- 713 NFIXATION_PROF profile for biological N fixation 1/m F
- 714 NFIX_TO_SMINN symbiotic/asymbiotic N fixation to soil mineral N gN/m^2/s F
- 715 NNONMYC Non-mycorrhizal N uptake flux gN/m^2/s T
- 716 NNONMYC_NH4 Non-mycorrhizal N uptake flux gN/m^2/s T
- 717 NNONMYC_NO3 Non-mycorrhizal N uptake flux gN/m^2/s T
- 718 NPASSIVE Passive N uptake flux gN/m^2/s T
- 719 NPOOL temporary plant N pool gN/m^2 T
- 720 NPOOL_TO_DEADCROOTN allocation to dead coarse root N gN/m^2/s F
- 721 NPOOL_TO_DEADCROOTN_STORAGE allocation to dead coarse root N storage gN/m^2/s F
- 722 NPOOL_TO_DEADSTEMN allocation to dead stem N gN/m^2/s F
- 723 NPOOL_TO_DEADSTEMN_STORAGE allocation to dead stem N storage gN/m^2/s F
- 724 NPOOL_TO_FROOTN allocation to fine root N gN/m^2/s F
- 725 NPOOL_TO_FROOTN_STORAGE allocation to fine root N storage gN/m^2/s F
- 726 NPOOL_TO_LEAFN allocation to leaf N gN/m^2/s F
- 727 NPOOL_TO_LEAFN_STORAGE allocation to leaf N storage gN/m^2/s F
- 728 NPOOL_TO_LIVECROOTN allocation to live coarse root N gN/m^2/s F
- 729 NPOOL_TO_LIVECROOTN_STORAGE allocation to live coarse root N storage gN/m^2/s F
- 730 NPOOL_TO_LIVESTEMN allocation to live stem N gN/m^2/s F
- 731 NPOOL_TO_LIVESTEMN_STORAGE allocation to live stem N storage gN/m^2/s F
- 732 NPP net primary production gC/m^2/s T
- 733 NPP_BURNEDOFF C that cannot be used for N uptake gC/m^2/s F
- 734 NPP_GROWTH Total C used for growth in FUN gC/m^2/s T
- 735 NPP_NACTIVE Mycorrhizal N uptake used C gC/m^2/s T
- 736 NPP_NACTIVE_NH4 Mycorrhizal N uptake use C gC/m^2/s T
- 737 NPP_NACTIVE_NO3 Mycorrhizal N uptake used C gC/m^2/s T
- 738 NPP_NAM AM-associated N uptake used C gC/m^2/s T
- 739 NPP_NAM_NH4 AM-associated N uptake use C gC/m^2/s T
- 740 NPP_NAM_NO3 AM-associated N uptake use C gC/m^2/s T
- 741 NPP_NECM ECM-associated N uptake used C gC/m^2/s T
- 742 NPP_NECM_NH4 ECM-associated N uptake use C gC/m^2/s T
- 743 NPP_NECM_NO3 ECM-associated N uptake used C gC/m^2/s T
- 744 NPP_NFIX Symbiotic BNF uptake used C gC/m^2/s T
- 745 NPP_NNONMYC Non-mycorrhizal N uptake used C gC/m^2/s T
- 746 NPP_NNONMYC_NH4 Non-mycorrhizal N uptake use C gC/m^2/s T
- 747 NPP_NNONMYC_NO3 Non-mycorrhizal N uptake use C gC/m^2/s T
- 748 NPP_NRETRANS Retranslocated N uptake flux gC/m^2/s T
- 749 NPP_NUPTAKE Total C used by N uptake in FUN gC/m^2/s T
- 750 NRETRANS Retranslocated N uptake flux gN/m^2/s T
- 751 NRETRANS_REG Retranslocated N uptake flux gN/m^2/s T
- 752 NRETRANS_SEASON Retranslocated N uptake flux gN/m^2/s T
- 753 NRETRANS_STRESS Retranslocated N uptake flux gN/m^2/s T
- 754 NSUBSTEPS number of adaptive timesteps in CLM timestep unitless F
- 755 NUPTAKE Total N uptake of FUN gN/m^2/s T
- 756 NUPTAKE_NPP_FRACTION frac of NPP used in N uptake - T
- 757 N_ALLOMETRY N allocation index none F
- 758 O2_DECOMP_DEPTH_UNSAT O2 consumption from HR and AR for non-inundated area mol/m3/s F
- 759 OCDEP total OC deposition (dry+wet) from atmosphere kg/m^2/s T
- 760 OFFSET_COUNTER offset days counter days F
- 761 OFFSET_FDD offset freezing degree days counter C degree-days F
- 762 OFFSET_FLAG offset flag none F
- 763 OFFSET_SWI offset soil water index none F
- 764 ONSET_COUNTER onset days counter days F
- 765 ONSET_FDD onset freezing degree days counter C degree-days F
- 766 ONSET_FLAG onset flag none F
- 767 ONSET_GDD onset growing degree days C degree-days F
- 768 ONSET_GDDFLAG onset flag for growing degree day sum none F
- 769 ONSET_SWI onset soil water index none F
- 770 O_SCALAR fraction by which decomposition is reduced due to anoxia unitless T
- 771 PAR240DZ 10-day running mean of daytime patch absorbed PAR for leaves for top canopy layer W/m^2 F
- 772 PAR240XZ 10-day running mean of maximum patch absorbed PAR for leaves for top canopy layer W/m^2 F
- 773 PAR240_shade shade PAR (240 hrs) umol/m2/s F
- 774 PAR240_sun sunlit PAR (240 hrs) umol/m2/s F
- 775 PAR24_shade shade PAR (24 hrs) umol/m2/s F
- 776 PAR24_sun sunlit PAR (24 hrs) umol/m2/s F
- 777 PARVEGLN absorbed par by vegetation at local noon W/m^2 T
- 778 PAR_shade shade PAR umol/m2/s F
- 779 PAR_sun sunlit PAR umol/m2/s F
- 780 PBOT atmospheric pressure at surface (downscaled to columns in glacier regions) Pa T
- 781 PBOT_240 10 day running mean of air pressure Pa F
- 782 PCH4 atmospheric partial pressure of CH4 Pa T
- 783 PCO2 atmospheric partial pressure of CO2 Pa T
- 784 PCO2_240 10 day running mean of CO2 pressure Pa F
- 785 PFT_CTRUNC patch-level sink for C truncation gC/m^2 F
- 786 PFT_FIRE_CLOSS total patch-level fire C loss for non-peat fires outside land-type converted region gC/m^2/s T
- 787 PFT_FIRE_NLOSS total patch-level fire N loss gN/m^2/s T
- 788 PFT_NTRUNC patch-level sink for N truncation gN/m^2 F
- 789 PLANTCN Plant C:N used by FUN unitless F
- 790 PLANT_CALLOC total allocated C flux gC/m^2/s F
- 791 PLANT_NALLOC total allocated N flux gN/m^2/s F
- 792 PLANT_NDEMAND N flux required to support initial GPP gN/m^2/s T
- 793 PNLCZ Proportion of nitrogen allocated for light capture unitless F
- 794 PO2_240 10 day running mean of O2 pressure Pa F
- 795 POTENTIAL_IMMOB potential N immobilization gN/m^2/s T
- 796 POTENTIAL_IMMOB_vr potential N immobilization gN/m^3/s F
- 797 POT_F_DENIT potential denitrification flux gN/m^2/s T
- 798 POT_F_DENIT_vr potential denitrification flux gN/m^3/s F
- 799 POT_F_NIT potential nitrification flux gN/m^2/s T
- 800 POT_F_NIT_vr potential nitrification flux gN/m^3/s F
- 801 PREC10 10-day running mean of PREC MM H2O/S F
- 802 PREC60 60-day running mean of PREC MM H2O/S F
- 803 PREV_DAYL daylength from previous timestep s F
- 804 PREV_FROOTC_TO_LITTER previous timestep froot C litterfall flux gC/m^2/s F
- 805 PREV_LEAFC_TO_LITTER previous timestep leaf C litterfall flux gC/m^2/s F
- 806 PROD100C 100-yr wood product C gC/m^2 F
- 807 PROD100C_LOSS loss from 100-yr wood product pool gC/m^2/s F
- 808 PROD100N 100-yr wood product N gN/m^2 F
- 809 PROD100N_LOSS loss from 100-yr wood product pool gN/m^2/s F
- 810 PROD10C 10-yr wood product C gC/m^2 F
- 811 PROD10C_LOSS loss from 10-yr wood product pool gC/m^2/s F
- 812 PROD10N 10-yr wood product N gN/m^2 F
- 813 PROD10N_LOSS loss from 10-yr wood product pool gN/m^2/s F
- 814 PSNSHA shaded leaf photosynthesis umolCO2/m^2/s T
- 815 PSNSHADE_TO_CPOOL C fixation from shaded canopy gC/m^2/s T
- 816 PSNSUN sunlit leaf photosynthesis umolCO2/m^2/s T
- 817 PSNSUN_TO_CPOOL C fixation from sunlit canopy gC/m^2/s T
- 818 PSurf atmospheric pressure at surface (downscaled to columns in glacier regions) Pa F
- 819 Q2M 2m specific humidity kg/kg T
- 820 QBOT atmospheric specific humidity (downscaled to columns in glacier regions) kg/kg T
- 821 QCHARGE aquifer recharge rate (natural vegetated and crop landunits only) mm/s T
- 822 QDIRECT_THROUGHFALL direct throughfall of liquid (rain + above-canopy irrigation) mm/s F
- 823 QDIRECT_THROUGHFALL_SNOW direct throughfall of snow mm/s F
- 824 QDRAI sub-surface drainage mm/s T
- 825 QDRAI_PERCH perched wt drainage mm/s T
- 826 QDRAI_XS saturation excess drainage mm/s T
- 827 QDRIP rate of excess canopy liquid falling off canopy mm/s F
- 828 QDRIP_SNOW rate of excess canopy snow falling off canopy mm/s F
- 829 QFLOOD runoff from river flooding mm/s T
- 830 QFLX_EVAP_TOT qflx_evap_soi + qflx_evap_can + qflx_tran_veg kg m-2 s-1 T
- 831 QFLX_EVAP_VEG vegetation evaporation mm H2O/s F
- 832 QFLX_ICE_DYNBAL ice dynamic land cover change conversion runoff flux mm/s T
- 833 QFLX_LIQDEW_TO_TOP_LAYER rate of liquid water deposited on top soil or snow layer (dew) mm H2O/s T
- 834 QFLX_LIQEVAP_FROM_TOP_LAYER rate of liquid water evaporated from top soil or snow layer mm H2O/s T
- 835 QFLX_LIQ_DYNBAL liq dynamic land cover change conversion runoff flux mm/s T
- 836 QFLX_LIQ_GRND liquid (rain+irrigation) on ground after interception mm H2O/s F
- 837 QFLX_SNOW_DRAIN drainage from snow pack mm/s T
- 838 QFLX_SNOW_DRAIN_ICE drainage from snow pack melt (ice landunits only) mm/s T
- 839 QFLX_SNOW_GRND snow on ground after interception mm H2O/s F
- 840 QFLX_SOLIDDEW_TO_TOP_LAYER rate of solid water deposited on top soil or snow layer (frost) mm H2O/s T
- 841 QFLX_SOLIDEVAP_FROM_TOP_LAYER rate of ice evaporated from top soil or snow layer (sublimation) (also includes bare ice subli mm H2O/s T
- 842 QFLX_SOLIDEVAP_FROM_TOP_LAYER_ICE rate of ice evaporated from top soil or snow layer (sublimation) (also includes bare ice subli mm H2O/s F
- 843 QH2OSFC surface water runoff mm/s T
- 844 QH2OSFC_TO_ICE surface water converted to ice mm/s F
- 845 QHR hydraulic redistribution mm/s T
- 846 QICE ice growth/melt mm/s T
- 847 QICE_FORC qice forcing sent to GLC mm/s F
- 848 QICE_FRZ ice growth mm/s T
- 849 QICE_MELT ice melt mm/s T
- 850 QINFL infiltration mm/s T
- 851 QINTR interception mm/s T
- 852 QIRRIG_DEMAND irrigation demand mm/s F
- 853 QIRRIG_DRIP water added via drip irrigation mm/s F
- 854 QIRRIG_FROM_GW_CONFINED water added through confined groundwater irrigation mm/s T
- 855 QIRRIG_FROM_GW_UNCONFINED water added through unconfined groundwater irrigation mm/s T
- 856 QIRRIG_FROM_SURFACE water added through surface water irrigation mm/s T
- 857 QIRRIG_SPRINKLER water added via sprinkler irrigation mm/s F
- 858 QOVER total surface runoff (includes QH2OSFC) mm/s T
- 859 QOVER_LAG time-lagged surface runoff for soil columns mm/s F
- 860 QPHSNEG net negative hydraulic redistribution flux mm/s F
- 861 QRGWL surface runoff at glaciers (liquid only), wetlands, lakes; also includes melted ice runoff fro mm/s T
- 862 QROOTSINK water flux from soil to root in each soil-layer mm/s F
- 863 QRUNOFF total liquid runoff not including correction for land use change mm/s T
- 864 QRUNOFF_ICE total liquid runoff not incl corret for LULCC (ice landunits only) mm/s T
- 865 QRUNOFF_ICE_TO_COUPLER total ice runoff sent to coupler (includes corrections for land use change) mm/s T
- 866 QRUNOFF_ICE_TO_LIQ liquid runoff from converted ice runoff mm/s F
- 867 QRUNOFF_R Rural total runoff mm/s F
- 868 QRUNOFF_TO_COUPLER total liquid runoff sent to coupler (includes corrections for land use change) mm/s T
- 869 QRUNOFF_U Urban total runoff mm/s F
- 870 QSNOCPLIQ excess liquid h2o due to snow capping not including correction for land use change mm H2O/s T
- 871 QSNOEVAP evaporation from snow (only when snl<0, otherwise it is equal to qflx_ev_soil) mm/s T
- 872 QSNOFRZ column-integrated snow freezing rate kg/m2/s T
- 873 QSNOFRZ_ICE column-integrated snow freezing rate (ice landunits only) mm/s T
- 874 QSNOMELT snow melt rate mm/s T
- 875 QSNOMELT_ICE snow melt (ice landunits only) mm/s T
- 876 QSNOUNLOAD canopy snow unloading mm/s T
- 877 QSNO_TEMPUNLOAD canopy snow temp unloading mm/s T
- 878 QSNO_WINDUNLOAD canopy snow wind unloading mm/s T
- 879 QSNWCPICE excess solid h2o due to snow capping not including correction for land use change mm H2O/s T
- 880 QSOIL Ground evaporation (soil/snow evaporation + soil/snow sublimation - dew) mm/s T
- 881 QSOIL_ICE Ground evaporation (ice landunits only) mm/s T
- 882 QTOPSOIL water input to surface mm/s F
- 883 QVEGE canopy evaporation mm/s T
- 884 QVEGT canopy transpiration mm/s T
- 885 Qair atmospheric specific humidity (downscaled to columns in glacier regions) kg/kg F
- 886 Qh sensible heat W/m^2 F
- 887 Qle total evaporation W/m^2 F
- 888 Qstor storage heat flux (includes snowmelt) W/m^2 F
- 889 Qtau momentum flux kg/m/s^2 F
- 890 RAIN atmospheric rain, after rain/snow repartitioning based on temperature mm/s T
- 891 RAIN_FROM_ATM atmospheric rain received from atmosphere (pre-repartitioning) mm/s T
- 892 RAIN_ICE atmospheric rain, after rain/snow repartitioning based on temperature (ice landunits only) mm/s F
- 893 RAM1 aerodynamical resistance s/m F
- 894 RAM_LAKE aerodynamic resistance for momentum (lakes only) s/m F
- 895 RB10 10 day running mean boundary layer resistance s/m F
- 896 RETRANSN plant pool of retranslocated N gN/m^2 T
- 897 RETRANSN_TO_NPOOL deployment of retranslocated N gN/m^2/s T
- 898 RH atmospheric relative humidity % F
- 899 RH2M 2m relative humidity % T
- 900 RH2M_R Rural 2m specific humidity % F
- 901 RH2M_U Urban 2m relative humidity % F
- 902 RH30 30-day running mean of relative humidity % F
- 903 RHAF fractional humidity of canopy air fraction F
- 904 RHAF10 10 day running mean of fractional humidity of canopy air fraction F
- 905 RH_LEAF fractional humidity at leaf surface fraction F
- 906 ROOTR effective fraction of roots in each soil layer (SMS method) proportion F
- 907 RR root respiration (fine root MR + total root GR) gC/m^2/s T
- 908 RRESIS root resistance in each soil layer proportion F
- 909 RSSHA shaded leaf stomatal resistance s/m T
- 910 RSSUN sunlit leaf stomatal resistance s/m T
- 911 Rainf atmospheric rain, after rain/snow repartitioning based on temperature mm/s F
- 912 Rnet net radiation W/m^2 F
- 913 SABG solar rad absorbed by ground W/m^2 T
- 914 SABG_PEN Rural solar rad penetrating top soil or snow layer watt/m^2 T
- 915 SABV solar rad absorbed by veg W/m^2 T
- 916 SEEDC pool for seeding new PFTs via dynamic landcover gC/m^2 T
- 917 SEEDN pool for seeding new PFTs via dynamic landcover gN/m^2 T
- 918 SLASH_HARVESTC slash harvest carbon (to litter) gC/m^2/s T
- 919 SMINN soil mineral N gN/m^2 T
- 920 SMINN_TO_NPOOL deployment of soil mineral N uptake gN/m^2/s T
- 921 SMINN_TO_PLANT plant uptake of soil mineral N gN/m^2/s T
- 922 SMINN_TO_PLANT_FUN Total soil N uptake of FUN gN/m^2/s T
- 923 SMINN_TO_PLANT_vr plant uptake of soil mineral N gN/m^3/s F
- 924 SMINN_TO_SOIL1N_L1 mineral N flux for decomp. of LITR1to SOIL1 gN/m^2 F
- 925 SMINN_TO_SOIL1N_L1_vr mineral N flux for decomp. of LITR1to SOIL1 gN/m^3 F
- 926 SMINN_TO_SOIL1N_L2 mineral N flux for decomp. of LITR2to SOIL1 gN/m^2 F
- 927 SMINN_TO_SOIL1N_L2_vr mineral N flux for decomp. of LITR2to SOIL1 gN/m^3 F
- 928 SMINN_TO_SOIL1N_S2 mineral N flux for decomp. of SOIL2to SOIL1 gN/m^2 F
- 929 SMINN_TO_SOIL1N_S2_vr mineral N flux for decomp. of SOIL2to SOIL1 gN/m^3 F
- 930 SMINN_TO_SOIL1N_S3 mineral N flux for decomp. of SOIL3to SOIL1 gN/m^2 F
- 931 SMINN_TO_SOIL1N_S3_vr mineral N flux for decomp. of SOIL3to SOIL1 gN/m^3 F
- 932 SMINN_TO_SOIL2N_L3 mineral N flux for decomp. of LITR3to SOIL2 gN/m^2 F
- 933 SMINN_TO_SOIL2N_L3_vr mineral N flux for decomp. of LITR3to SOIL2 gN/m^3 F
- 934 SMINN_TO_SOIL2N_S1 mineral N flux for decomp. of SOIL1to SOIL2 gN/m^2 F
- 935 SMINN_TO_SOIL2N_S1_vr mineral N flux for decomp. of SOIL1to SOIL2 gN/m^3 F
- 936 SMINN_TO_SOIL3N_S1 mineral N flux for decomp. of SOIL1to SOIL3 gN/m^2 F
- 937 SMINN_TO_SOIL3N_S1_vr mineral N flux for decomp. of SOIL1to SOIL3 gN/m^3 F
- 938 SMINN_TO_SOIL3N_S2 mineral N flux for decomp. of SOIL2to SOIL3 gN/m^2 F
- 939 SMINN_TO_SOIL3N_S2_vr mineral N flux for decomp. of SOIL2to SOIL3 gN/m^3 F
- 940 SMINN_vr soil mineral N gN/m^3 T
- 941 SMIN_NH4 soil mineral NH4 gN/m^2 T
- 942 SMIN_NH4_TO_PLANT plant uptake of NH4 gN/m^3/s F
- 943 SMIN_NH4_vr soil mineral NH4 (vert. res.) gN/m^3 T
- 944 SMIN_NO3 soil mineral NO3 gN/m^2 T
- 945 SMIN_NO3_LEACHED soil NO3 pool loss to leaching gN/m^2/s T
- 946 SMIN_NO3_LEACHED_vr soil NO3 pool loss to leaching gN/m^3/s F
- 947 SMIN_NO3_MASSDENS SMIN_NO3_MASSDENS ugN/cm^3 soil F
- 948 SMIN_NO3_RUNOFF soil NO3 pool loss to runoff gN/m^2/s T
- 949 SMIN_NO3_RUNOFF_vr soil NO3 pool loss to runoff gN/m^3/s F
- 950 SMIN_NO3_TO_PLANT plant uptake of NO3 gN/m^3/s F
- 951 SMIN_NO3_vr soil mineral NO3 (vert. res.) gN/m^3 T
- 952 SMP soil matric potential (natural vegetated and crop landunits only) mm T
- 953 SNOBCMCL mass of BC in snow column kg/m2 T
- 954 SNOBCMSL mass of BC in top snow layer kg/m2 T
- 955 SNOCAN intercepted snow mm T
- 956 SNODSTMCL mass of dust in snow column kg/m2 T
- 957 SNODSTMSL mass of dust in top snow layer kg/m2 T
- 958 SNOFSDSND direct nir incident solar radiation on snow W/m^2 F
- 959 SNOFSDSNI diffuse nir incident solar radiation on snow W/m^2 F
- 960 SNOFSDSVD direct vis incident solar radiation on snow W/m^2 F
- 961 SNOFSDSVI diffuse vis incident solar radiation on snow W/m^2 F
- 962 SNOFSRND direct nir reflected solar radiation from snow W/m^2 T
- 963 SNOFSRNI diffuse nir reflected solar radiation from snow W/m^2 T
- 964 SNOFSRVD direct vis reflected solar radiation from snow W/m^2 T
- 965 SNOFSRVI diffuse vis reflected solar radiation from snow W/m^2 T
- 966 SNOINTABS Fraction of incoming solar absorbed by lower snow layers - T
- 967 SNOLIQFL top snow layer liquid water fraction (land) fraction F
- 968 SNOOCMCL mass of OC in snow column kg/m2 T
- 969 SNOOCMSL mass of OC in top snow layer kg/m2 T
- 970 SNORDSL top snow layer effective grain radius m^-6 F
- 971 SNOTTOPL snow temperature (top layer) K F
- 972 SNOTTOPL_ICE snow temperature (top layer, ice landunits only) K F
- 973 SNOTXMASS snow temperature times layer mass, layer sum; to get mass-weighted temperature, divide by (SNO K kg/m2 T
- 974 SNOTXMASS_ICE snow temperature times layer mass, layer sum (ice landunits only); to get mass-weighted temper K kg/m2 F
- 975 SNOW atmospheric snow, after rain/snow repartitioning based on temperature mm/s T
- 976 SNOWDP gridcell mean snow height m T
- 977 SNOWICE snow ice kg/m2 T
- 978 SNOWICE_ICE snow ice (ice landunits only) kg/m2 F
- 979 SNOWLIQ snow liquid water kg/m2 T
- 980 SNOWLIQ_ICE snow liquid water (ice landunits only) kg/m2 F
- 981 SNOW_DEPTH snow height of snow covered area m T
- 982 SNOW_DEPTH_ICE snow height of snow covered area (ice landunits only) m F
- 983 SNOW_FROM_ATM atmospheric snow received from atmosphere (pre-repartitioning) mm/s T
- 984 SNOW_ICE atmospheric snow, after rain/snow repartitioning based on temperature (ice landunits only) mm/s F
- 985 SNOW_PERSISTENCE Length of time of continuous snow cover (nat. veg. landunits only) seconds T
- 986 SNOW_SINKS snow sinks (liquid water) mm/s T
- 987 SNOW_SOURCES snow sources (liquid water) mm/s T
- 988 SNO_ABS Absorbed solar radiation in each snow layer W/m^2 F
- 989 SNO_ABS_ICE Absorbed solar radiation in each snow layer (ice landunits only) W/m^2 F
- 990 SNO_BW Partial density of water in the snow pack (ice + liquid) kg/m3 F
- 991 SNO_BW_ICE Partial density of water in the snow pack (ice + liquid, ice landunits only) kg/m3 F
- 992 SNO_EXISTENCE Fraction of averaging period for which each snow layer existed unitless F
- 993 SNO_FRZ snow freezing rate in each snow layer kg/m2/s F
- 994 SNO_FRZ_ICE snow freezing rate in each snow layer (ice landunits only) mm/s F
- 995 SNO_GS Mean snow grain size Microns F
- 996 SNO_GS_ICE Mean snow grain size (ice landunits only) Microns F
- 997 SNO_ICE Snow ice content kg/m2 F
- 998 SNO_LIQH2O Snow liquid water content kg/m2 F
- 999 SNO_MELT snow melt rate in each snow layer mm/s F
-1000 SNO_MELT_ICE snow melt rate in each snow layer (ice landunits only) mm/s F
-1001 SNO_T Snow temperatures K F
-1002 SNO_TK Thermal conductivity W/m-K F
-1003 SNO_TK_ICE Thermal conductivity (ice landunits only) W/m-K F
-1004 SNO_T_ICE Snow temperatures (ice landunits only) K F
-1005 SNO_Z Snow layer thicknesses m F
-1006 SNO_Z_ICE Snow layer thicknesses (ice landunits only) m F
-1007 SNOdTdzL top snow layer temperature gradient (land) K/m F
-1008 SOIL1C SOIL1 C gC/m^2 T
-1009 SOIL1C_1m SOIL1 C to 1 meter gC/m^2 F
-1010 SOIL1C_TNDNCY_VERT_TRANS soil 1 C tendency due to vertical transport gC/m^3/s F
-1011 SOIL1C_TO_SOIL2C decomp. of soil 1 C to soil 2 C gC/m^2/s F
-1012 SOIL1C_TO_SOIL2C_vr decomp. of soil 1 C to soil 2 C gC/m^3/s F
-1013 SOIL1C_TO_SOIL3C decomp. of soil 1 C to soil 3 C gC/m^2/s F
-1014 SOIL1C_TO_SOIL3C_vr decomp. of soil 1 C to soil 3 C gC/m^3/s F
-1015 SOIL1C_vr SOIL1 C (vertically resolved) gC/m^3 T
-1016 SOIL1N SOIL1 N gN/m^2 T
-1017 SOIL1N_1m SOIL1 N to 1 meter gN/m^2 F
-1018 SOIL1N_TNDNCY_VERT_TRANS soil 1 N tendency due to vertical transport gN/m^3/s F
-1019 SOIL1N_TO_SOIL2N decomp. of soil 1 N to soil 2 N gN/m^2 F
-1020 SOIL1N_TO_SOIL2N_vr decomp. of soil 1 N to soil 2 N gN/m^3 F
-1021 SOIL1N_TO_SOIL3N decomp. of soil 1 N to soil 3 N gN/m^2 F
-1022 SOIL1N_TO_SOIL3N_vr decomp. of soil 1 N to soil 3 N gN/m^3 F
-1023 SOIL1N_vr SOIL1 N (vertically resolved) gN/m^3 T
-1024 SOIL1_HR_S2 Het. Resp. from soil 1 gC/m^2/s F
-1025 SOIL1_HR_S2_vr Het. Resp. from soil 1 gC/m^3/s F
-1026 SOIL1_HR_S3 Het. Resp. from soil 1 gC/m^2/s F
-1027 SOIL1_HR_S3_vr Het. Resp. from soil 1 gC/m^3/s F
-1028 SOIL2C SOIL2 C gC/m^2 T
-1029 SOIL2C_1m SOIL2 C to 1 meter gC/m^2 F
-1030 SOIL2C_TNDNCY_VERT_TRANS soil 2 C tendency due to vertical transport gC/m^3/s F
-1031 SOIL2C_TO_SOIL1C decomp. of soil 2 C to soil 1 C gC/m^2/s F
-1032 SOIL2C_TO_SOIL1C_vr decomp. of soil 2 C to soil 1 C gC/m^3/s F
-1033 SOIL2C_TO_SOIL3C decomp. of soil 2 C to soil 3 C gC/m^2/s F
-1034 SOIL2C_TO_SOIL3C_vr decomp. of soil 2 C to soil 3 C gC/m^3/s F
-1035 SOIL2C_vr SOIL2 C (vertically resolved) gC/m^3 T
-1036 SOIL2N SOIL2 N gN/m^2 T
-1037 SOIL2N_1m SOIL2 N to 1 meter gN/m^2 F
-1038 SOIL2N_TNDNCY_VERT_TRANS soil 2 N tendency due to vertical transport gN/m^3/s F
-1039 SOIL2N_TO_SOIL1N decomp. of soil 2 N to soil 1 N gN/m^2 F
-1040 SOIL2N_TO_SOIL1N_vr decomp. of soil 2 N to soil 1 N gN/m^3 F
-1041 SOIL2N_TO_SOIL3N decomp. of soil 2 N to soil 3 N gN/m^2 F
-1042 SOIL2N_TO_SOIL3N_vr decomp. of soil 2 N to soil 3 N gN/m^3 F
-1043 SOIL2N_vr SOIL2 N (vertically resolved) gN/m^3 T
-1044 SOIL2_HR_S1 Het. Resp. from soil 2 gC/m^2/s F
-1045 SOIL2_HR_S1_vr Het. Resp. from soil 2 gC/m^3/s F
-1046 SOIL2_HR_S3 Het. Resp. from soil 2 gC/m^2/s F
-1047 SOIL2_HR_S3_vr Het. Resp. from soil 2 gC/m^3/s F
-1048 SOIL3C SOIL3 C gC/m^2 T
-1049 SOIL3C_1m SOIL3 C to 1 meter gC/m^2 F
-1050 SOIL3C_TNDNCY_VERT_TRANS soil 3 C tendency due to vertical transport gC/m^3/s F
-1051 SOIL3C_TO_SOIL1C decomp. of soil 3 C to soil 1 C gC/m^2/s F
-1052 SOIL3C_TO_SOIL1C_vr decomp. of soil 3 C to soil 1 C gC/m^3/s F
-1053 SOIL3C_vr SOIL3 C (vertically resolved) gC/m^3 T
-1054 SOIL3N SOIL3 N gN/m^2 T
-1055 SOIL3N_1m SOIL3 N to 1 meter gN/m^2 F
-1056 SOIL3N_TNDNCY_VERT_TRANS soil 3 N tendency due to vertical transport gN/m^3/s F
-1057 SOIL3N_TO_SOIL1N decomp. of soil 3 N to soil 1 N gN/m^2 F
-1058 SOIL3N_TO_SOIL1N_vr decomp. of soil 3 N to soil 1 N gN/m^3 F
-1059 SOIL3N_vr SOIL3 N (vertically resolved) gN/m^3 T
-1060 SOIL3_HR Het. Resp. from soil 3 gC/m^2/s F
-1061 SOIL3_HR_vr Het. Resp. from soil 3 gC/m^3/s F
-1062 SOILC_CHANGE C change in soil gC/m^2/s T
-1063 SOILC_HR soil C heterotrophic respiration gC/m^2/s T
-1064 SOILC_vr SOIL C (vertically resolved) gC/m^3 T
-1065 SOILICE soil ice (natural vegetated and crop landunits only) kg/m2 T
-1066 SOILLIQ soil liquid water (natural vegetated and crop landunits only) kg/m2 T
-1067 SOILN_vr SOIL N (vertically resolved) gN/m^3 T
-1068 SOILPSI soil water potential in each soil layer MPa F
-1069 SOILRESIS soil resistance to evaporation s/m T
-1070 SOILWATER_10CM soil liquid water + ice in top 10cm of soil (veg landunits only) kg/m2 T
-1071 SOMC_FIRE C loss due to peat burning gC/m^2/s T
-1072 SOMFIRE soil organic matter fire losses gC/m^2/s F
-1073 SOM_ADV_COEF advection term for vertical SOM translocation m/s F
-1074 SOM_C_LEACHED total flux of C from SOM pools due to leaching gC/m^2/s T
-1075 SOM_DIFFUS_COEF diffusion coefficient for vertical SOM translocation m^2/s F
-1076 SOM_N_LEACHED total flux of N from SOM pools due to leaching gN/m^2/s F
-1077 SR total soil respiration (HR + root resp) gC/m^2/s T
-1078 SSRE_FSR surface snow effect on reflected solar radiation W/m^2 T
-1079 SSRE_FSRND surface snow effect on direct nir reflected solar radiation W/m^2 T
-1080 SSRE_FSRNDLN surface snow effect on direct nir reflected solar radiation at local noon W/m^2 T
-1081 SSRE_FSRNI surface snow effect on diffuse nir reflected solar radiation W/m^2 T
-1082 SSRE_FSRVD surface snow radiatve effect on direct vis reflected solar radiation W/m^2 T
-1083 SSRE_FSRVDLN surface snow radiatve effect on direct vis reflected solar radiation at local noon W/m^2 T
-1084 SSRE_FSRVI surface snow radiatve effect on diffuse vis reflected solar radiation W/m^2 T
-1085 STEM_PROF profile for litter C and N inputs from stems 1/m F
-1086 STORAGE_CDEMAND C use from the C storage pool gC/m^2 F
-1087 STORAGE_GR growth resp for growth sent to storage for later display gC/m^2/s F
-1088 STORAGE_NDEMAND N demand during the offset period gN/m^2 F
-1089 STORVEGC stored vegetation carbon, excluding cpool gC/m^2 T
-1090 STORVEGN stored vegetation nitrogen gN/m^2 T
-1091 SUPPLEMENT_TO_SMINN supplemental N supply gN/m^2/s T
-1092 SUPPLEMENT_TO_SMINN_vr supplemental N supply gN/m^3/s F
-1093 SWBGT 2 m Simplified Wetbulb Globe Temp C T
-1094 SWBGT_R Rural 2 m Simplified Wetbulb Globe Temp C T
-1095 SWBGT_U Urban 2 m Simplified Wetbulb Globe Temp C T
-1096 SWMP65 2 m Swamp Cooler Temp 65% Eff C T
-1097 SWMP65_R Rural 2 m Swamp Cooler Temp 65% Eff C T
-1098 SWMP65_U Urban 2 m Swamp Cooler Temp 65% Eff C T
-1099 SWMP80 2 m Swamp Cooler Temp 80% Eff C T
-1100 SWMP80_R Rural 2 m Swamp Cooler Temp 80% Eff C T
-1101 SWMP80_U Urban 2 m Swamp Cooler Temp 80% Eff C T
-1102 SWdown atmospheric incident solar radiation W/m^2 F
-1103 SWup upwelling shortwave radiation W/m^2 F
-1104 SoilAlpha factor limiting ground evap unitless F
-1105 SoilAlpha_U urban factor limiting ground evap unitless F
-1106 T10 10-day running mean of 2-m temperature K F
-1107 TAUX zonal surface stress kg/m/s^2 T
-1108 TAUY meridional surface stress kg/m/s^2 T
-1109 TBOT atmospheric air temperature (downscaled to columns in glacier regions) K T
-1110 TBUILD internal urban building air temperature K T
-1111 TBUILD_MAX prescribed maximum interior building temperature K F
-1112 TEMPAVG_T2M temporary average 2m air temperature K F
-1113 TEMPMAX_RETRANSN temporary annual max of retranslocated N pool gN/m^2 F
-1114 TEMPSUM_POTENTIAL_GPP temporary annual sum of potential GPP gC/m^2/yr F
-1115 TEQ 2 m Equiv Temp K T
-1116 TEQ_R Rural 2 m Equiv Temp K T
-1117 TEQ_U Urban 2 m Equiv Temp K T
-1118 TFLOOR floor temperature K F
-1119 TG ground temperature K T
-1120 TG_ICE ground temperature (ice landunits only) K F
-1121 TG_R Rural ground temperature K F
-1122 TG_U Urban ground temperature K F
-1123 TH2OSFC surface water temperature K T
-1124 THBOT atmospheric air potential temperature (downscaled to columns in glacier regions) K T
-1125 THIC 2 m Temp Hum Index Comfort C T
-1126 THIC_R Rural 2 m Temp Hum Index Comfort C T
-1127 THIC_U Urban 2 m Temp Hum Index Comfort C T
-1128 THIP 2 m Temp Hum Index Physiology C T
-1129 THIP_R Rural 2 m Temp Hum Index Physiology C T
-1130 THIP_U Urban 2 m Temp Hum Index Physiology C T
-1131 TKE1 top lake level eddy thermal conductivity W/(mK) T
-1132 TLAI total projected leaf area index m^2/m^2 T
-1133 TLAKE lake temperature K T
-1134 TOPO_COL column-level topographic height m F
-1135 TOPO_COL_ICE column-level topographic height (ice landunits only) m F
-1136 TOPO_FORC topograephic height sent to GLC m F
-1137 TOPT topt coefficient for VOC calc non F
-1138 TOTCOLC total column carbon, incl veg and cpool but excl product pools gC/m^2 T
-1139 TOTCOLCH4 total belowground CH4 (0 for non-lake special landunits in the absence of dynamic landunits) gC/m2 T
-1140 TOTCOLN total column-level N, excluding product pools gN/m^2 T
-1141 TOTECOSYSC total ecosystem carbon, incl veg but excl cpool and product pools gC/m^2 T
-1142 TOTECOSYSN total ecosystem N, excluding product pools gN/m^2 T
-1143 TOTFIRE total ecosystem fire losses gC/m^2/s F
-1144 TOTLITC total litter carbon gC/m^2 T
-1145 TOTLITC_1m total litter carbon to 1 meter depth gC/m^2 T
-1146 TOTLITN total litter N gN/m^2 T
-1147 TOTLITN_1m total litter N to 1 meter gN/m^2 T
-1148 TOTPFTC total patch-level carbon, including cpool gC/m^2 T
-1149 TOTPFTN total patch-level nitrogen gN/m^2 T
-1150 TOTSOILICE vertically summed soil cie (veg landunits only) kg/m2 T
-1151 TOTSOILLIQ vertically summed soil liquid water (veg landunits only) kg/m2 T
-1152 TOTSOMC total soil organic matter carbon gC/m^2 T
-1153 TOTSOMC_1m total soil organic matter carbon to 1 meter depth gC/m^2 T
-1154 TOTSOMN total soil organic matter N gN/m^2 T
-1155 TOTSOMN_1m total soil organic matter N to 1 meter gN/m^2 T
-1156 TOTVEGC total vegetation carbon, excluding cpool gC/m^2 T
-1157 TOTVEGN total vegetation nitrogen gN/m^2 T
-1158 TOT_WOODPRODC total wood product C gC/m^2 T
-1159 TOT_WOODPRODC_LOSS total loss from wood product pools gC/m^2/s T
-1160 TOT_WOODPRODN total wood product N gN/m^2 T
-1161 TOT_WOODPRODN_LOSS total loss from wood product pools gN/m^2/s T
-1162 TPU25T canopy profile of tpu umol/m2/s T
-1163 TRAFFICFLUX sensible heat flux from urban traffic W/m^2 F
-1164 TRANSFER_DEADCROOT_GR dead coarse root growth respiration from storage gC/m^2/s F
-1165 TRANSFER_DEADSTEM_GR dead stem growth respiration from storage gC/m^2/s F
-1166 TRANSFER_FROOT_GR fine root growth respiration from storage gC/m^2/s F
-1167 TRANSFER_GR growth resp for transfer growth displayed in this timestep gC/m^2/s F
-1168 TRANSFER_LEAF_GR leaf growth respiration from storage gC/m^2/s F
-1169 TRANSFER_LIVECROOT_GR live coarse root growth respiration from storage gC/m^2/s F
-1170 TRANSFER_LIVESTEM_GR live stem growth respiration from storage gC/m^2/s F
-1171 TREFMNAV daily minimum of average 2-m temperature K T
-1172 TREFMNAV_R Rural daily minimum of average 2-m temperature K F
-1173 TREFMNAV_U Urban daily minimum of average 2-m temperature K F
-1174 TREFMXAV daily maximum of average 2-m temperature K T
-1175 TREFMXAV_R Rural daily maximum of average 2-m temperature K F
-1176 TREFMXAV_U Urban daily maximum of average 2-m temperature K F
-1177 TROOF_INNER roof inside surface temperature K F
-1178 TSA 2m air temperature K T
-1179 TSAI total projected stem area index m^2/m^2 T
-1180 TSA_ICE 2m air temperature (ice landunits only) K F
-1181 TSA_R Rural 2m air temperature K F
-1182 TSA_U Urban 2m air temperature K F
-1183 TSHDW_INNER shadewall inside surface temperature K F
-1184 TSKIN skin temperature K T
-1185 TSL temperature of near-surface soil layer (natural vegetated and crop landunits only) K T
-1186 TSOI soil temperature (natural vegetated and crop landunits only) K T
-1187 TSOI_10CM soil temperature in top 10cm of soil K T
-1188 TSOI_ICE soil temperature (ice landunits only) K T
-1189 TSRF_FORC surface temperature sent to GLC K F
-1190 TSUNW_INNER sunwall inside surface temperature K F
-1191 TV vegetation temperature K T
-1192 TV24 vegetation temperature (last 24hrs) K F
-1193 TV240 vegetation temperature (last 240hrs) K F
-1194 TVEGD10 10 day running mean of patch daytime vegetation temperature Kelvin F
-1195 TVEGN10 10 day running mean of patch night-time vegetation temperature Kelvin F
-1196 TWS total water storage mm T
-1197 T_SCALAR temperature inhibition of decomposition unitless T
-1198 Tair atmospheric air temperature (downscaled to columns in glacier regions) K F
-1199 Tair_from_atm atmospheric air temperature received from atmosphere (pre-downscaling) K F
-1200 U10 10-m wind m/s T
-1201 U10_DUST 10-m wind for dust model m/s T
-1202 U10_ICE 10-m wind (ice landunits only) m/s F
-1203 ULRAD upward longwave radiation above the canopy W/m^2 F
-1204 URBAN_AC urban air conditioning flux W/m^2 T
-1205 URBAN_HEAT urban heating flux W/m^2 T
-1206 UST_LAKE friction velocity (lakes only) m/s F
-1207 VA atmospheric wind speed plus convective velocity m/s F
-1208 VCMX25T canopy profile of vcmax25 umol/m2/s T
-1209 VEGWP vegetation water matric potential for sun/sha canopy,xyl,root segments mm T
-1210 VEGWPLN vegetation water matric potential for sun/sha canopy,xyl,root at local noon mm T
-1211 VEGWPPD predawn vegetation water matric potential for sun/sha canopy,xyl,root mm T
-1212 VOCFLXT total VOC flux into atmosphere moles/m2/sec F
-1213 VOLR river channel total water storage m3 T
-1214 VOLRMCH river channel main channel water storage m3 T
-1215 VPD_CAN canopy vapor pressure deficit kPa T
-1216 Vcmx25Z canopy profile of vcmax25 predicted by LUNA model umol/m2/s T
-1217 WA water in the unconfined aquifer (natural vegetated and crop landunits only) mm T
-1218 WASTEHEAT sensible heat flux from heating/cooling sources of urban waste heat W/m^2 T
-1219 WBA 2 m Wet Bulb C T
-1220 WBA_R Rural 2 m Wet Bulb C T
-1221 WBA_U Urban 2 m Wet Bulb C T
-1222 WBT 2 m Stull Wet Bulb C T
-1223 WBT_R Rural 2 m Stull Wet Bulb C T
-1224 WBT_U Urban 2 m Stull Wet Bulb C T
-1225 WF soil water as frac. of whc for top 0.05 m proportion F
-1226 WFPS WFPS percent F
-1227 WIND atmospheric wind velocity magnitude m/s T
-1228 WOODC wood C gC/m^2 T
-1229 WOODC_ALLOC wood C eallocation gC/m^2/s T
-1230 WOODC_LOSS wood C loss gC/m^2/s T
-1231 WOOD_HARVESTC wood harvest carbon (to product pools) gC/m^2/s T
-1232 WOOD_HARVESTN wood harvest N (to product pools) gN/m^2/s T
-1233 WTGQ surface tracer conductance m/s T
-1234 W_SCALAR Moisture (dryness) inhibition of decomposition unitless T
-1235 Wind atmospheric wind velocity magnitude m/s F
-1236 XSMRPOOL temporary photosynthate C pool gC/m^2 T
-1237 XSMRPOOL_LOSS temporary photosynthate C pool loss gC/m^2 F
-1238 XSMRPOOL_RECOVER C flux assigned to recovery of negative xsmrpool gC/m^2/s T
-1239 Z0HG roughness length over ground, sensible heat m F
-1240 Z0HV roughness length over vegetation, sensible heat m F
-1241 Z0M momentum roughness length m F
-1242 Z0MG roughness length over ground, momentum m F
-1243 Z0MV roughness length over vegetation, momentum m F
-1244 Z0M_TO_COUPLER roughness length, momentum: gridcell average sent to coupler m F
-1245 Z0QG roughness length over ground, latent heat m F
-1246 Z0QV roughness length over vegetation, latent heat m F
-1247 ZBOT atmospheric reference height m T
-1248 ZII convective boundary height m F
-1249 ZWT water table depth (natural vegetated and crop landunits only) m T
-1250 ZWT_CH4_UNSAT depth of water table for methane production used in non-inundated area m T
-1251 ZWT_PERCH perched water table depth (natural vegetated and crop landunits only) m T
-1252 anaerobic_frac anaerobic_frac m3/m3 F
-1253 bsw clap and hornberger B unitless F
-1254 currentPatch currentPatch coefficient for VOC calc non F
-1255 diffus diffusivity m^2/s F
-1256 fr_WFPS fr_WFPS fraction F
-1257 n2_n2o_ratio_denit n2_n2o_ratio_denit gN/gN F
-1258 r_psi r_psi m F
-1259 ratio_k1 ratio_k1 none F
-1260 ratio_no3_co2 ratio_no3_co2 ratio F
-1261 soil_bulkdensity soil_bulkdensity kg/m3 F
-1262 soil_co2_prod soil_co2_prod ug C / g soil / day F
-1263 watfc water field capacity m^3/m^3 F
-1264 watsat water saturated m^3/m^3 F
+ 7 ACT_SOMC ACT_SOM C gC/m^2 T
+ 8 ACT_SOMC_1m ACT_SOM C to 1 meter gC/m^2 F
+ 9 ACT_SOMC_TNDNCY_VERT_TRA active soil organic C tendency due to vertical transport gC/m^3/s F
+ 10 ACT_SOMC_TO_PAS_SOMC decomp. of active soil organic C to passive soil organic C gC/m^2/s F
+ 11 ACT_SOMC_TO_PAS_SOMC_vr decomp. of active soil organic C to passive soil organic C gC/m^3/s F
+ 12 ACT_SOMC_TO_SLO_SOMC decomp. of active soil organic C to slow soil organic ma C gC/m^2/s F
+ 13 ACT_SOMC_TO_SLO_SOMC_vr decomp. of active soil organic C to slow soil organic ma C gC/m^3/s F
+ 14 ACT_SOMC_vr ACT_SOM C (vertically resolved) gC/m^3 T
+ 15 ACT_SOMN ACT_SOM N gN/m^2 T
+ 16 ACT_SOMN_1m ACT_SOM N to 1 meter gN/m^2 F
+ 17 ACT_SOMN_TNDNCY_VERT_TRA active soil organic N tendency due to vertical transport gN/m^3/s F
+ 18 ACT_SOMN_TO_PAS_SOMN decomp. of active soil organic N to passive soil organic N gN/m^2 F
+ 19 ACT_SOMN_TO_PAS_SOMN_vr decomp. of active soil organic N to passive soil organic N gN/m^3 F
+ 20 ACT_SOMN_TO_SLO_SOMN decomp. of active soil organic N to slow soil organic ma N gN/m^2 F
+ 21 ACT_SOMN_TO_SLO_SOMN_vr decomp. of active soil organic N to slow soil organic ma N gN/m^3 F
+ 22 ACT_SOMN_vr ACT_SOM N (vertically resolved) gN/m^3 T
+ 23 ACT_SOM_HR_S2 Het. Resp. from active soil organic gC/m^2/s F
+ 24 ACT_SOM_HR_S2_vr Het. Resp. from active soil organic gC/m^3/s F
+ 25 ACT_SOM_HR_S3 Het. Resp. from active soil organic gC/m^2/s F
+ 26 ACT_SOM_HR_S3_vr Het. Resp. from active soil organic gC/m^3/s F
+ 27 AGLB Aboveground leaf biomass kg/m^2 F
+ 28 AGNPP aboveground NPP gC/m^2/s T
+ 29 AGSB Aboveground stem biomass kg/m^2 F
+ 30 ALBD surface albedo (direct) proportion T
+ 31 ALBDSF diagnostic snow-free surface albedo (direct) proportion T
+ 32 ALBGRD ground albedo (direct) proportion F
+ 33 ALBGRI ground albedo (indirect) proportion F
+ 34 ALBI surface albedo (indirect) proportion T
+ 35 ALBISF diagnostic snow-free surface albedo (indirect) proportion T
+ 36 ALPHA alpha coefficient for VOC calc non F
+ 37 ALT current active layer thickness m T
+ 38 ALTMAX maximum annual active layer thickness m T
+ 39 ALTMAX_LASTYEAR maximum prior year active layer thickness m F
+ 40 ANNAVG_T2M annual average 2m air temperature K F
+ 41 ANNMAX_RETRANSN annual max of retranslocated N pool gN/m^2 F
+ 42 ANNSUM_COUNTER seconds since last annual accumulator turnover s F
+ 43 ANNSUM_NPP annual sum of NPP gC/m^2/yr F
+ 44 ANNSUM_POTENTIAL_GPP annual sum of potential GPP gN/m^2/yr F
+ 45 APPAR_TEMP 2 m apparent temperature C T
+ 46 APPAR_TEMP_R Rural 2 m apparent temperature C T
+ 47 APPAR_TEMP_U Urban 2 m apparent temperature C T
+ 48 AR autotrophic respiration (MR + GR) gC/m^2/s T
+ 49 ATM_TOPO atmospheric surface height m T
+ 50 AVAILC C flux available for allocation gC/m^2/s F
+ 51 AVAIL_RETRANSN N flux available from retranslocation pool gN/m^2/s F
+ 52 AnnET Annual ET mm/s F
+ 53 BAF_CROP fractional area burned for crop s-1 T
+ 54 BAF_PEATF fractional area burned in peatland s-1 T
+ 55 BCDEP total BC deposition (dry+wet) from atmosphere kg/m^2/s T
+ 56 BETA coefficient of convective velocity none F
+ 57 BGLFR background litterfall rate 1/s F
+ 58 BGNPP belowground NPP gC/m^2/s T
+ 59 BGTR background transfer growth rate 1/s F
+ 60 BTRANMN daily minimum of transpiration beta factor unitless T
+ 61 CANNAVG_T2M annual average of 2m air temperature K F
+ 62 CANNSUM_NPP annual sum of column-level NPP gC/m^2/s F
+ 63 CEL_LITC CEL_LIT C gC/m^2 T
+ 64 CEL_LITC_1m CEL_LIT C to 1 meter gC/m^2 F
+ 65 CEL_LITC_TNDNCY_VERT_TRA cellulosic litter C tendency due to vertical transport gC/m^3/s F
+ 66 CEL_LITC_TO_ACT_SOMC decomp. of cellulosic litter C to active soil organic C gC/m^2/s F
+ 67 CEL_LITC_TO_ACT_SOMC_vr decomp. of cellulosic litter C to active soil organic C gC/m^3/s F
+ 68 CEL_LITC_vr CEL_LIT C (vertically resolved) gC/m^3 T
+ 69 CEL_LITN CEL_LIT N gN/m^2 T
+ 70 CEL_LITN_1m CEL_LIT N to 1 meter gN/m^2 F
+ 71 CEL_LITN_TNDNCY_VERT_TRA cellulosic litter N tendency due to vertical transport gN/m^3/s F
+ 72 CEL_LITN_TO_ACT_SOMN decomp. of cellulosic litter N to active soil organic N gN/m^2 F
+ 73 CEL_LITN_TO_ACT_SOMN_vr decomp. of cellulosic litter N to active soil organic N gN/m^3 F
+ 74 CEL_LITN_vr CEL_LIT N (vertically resolved) gN/m^3 T
+ 75 CEL_LIT_HR Het. Resp. from cellulosic litter gC/m^2/s F
+ 76 CEL_LIT_HR_vr Het. Resp. from cellulosic litter gC/m^3/s F
+ 77 CGRND deriv. of soil energy flux wrt to soil temp W/m^2/K F
+ 78 CGRNDL deriv. of soil latent heat flux wrt soil temp W/m^2/K F
+ 79 CGRNDS deriv. of soil sensible heat flux wrt soil temp W/m^2/K F
+ 80 CH4PROD Gridcell total production of CH4 gC/m2/s T
+ 81 CH4_EBUL_TOTAL_SAT ebullition surface CH4 flux; (+ to atm) mol/m2/s F
+ 82 CH4_EBUL_TOTAL_UNSAT ebullition surface CH4 flux; (+ to atm) mol/m2/s F
+ 83 CH4_SURF_AERE_SAT aerenchyma surface CH4 flux for inundated area; (+ to atm) mol/m2/s T
+ 84 CH4_SURF_AERE_UNSAT aerenchyma surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T
+ 85 CH4_SURF_DIFF_SAT diffusive surface CH4 flux for inundated / lake area; (+ to atm) mol/m2/s T
+ 86 CH4_SURF_DIFF_UNSAT diffusive surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T
+ 87 CH4_SURF_EBUL_SAT ebullition surface CH4 flux for inundated / lake area; (+ to atm) mol/m2/s T
+ 88 CH4_SURF_EBUL_UNSAT ebullition surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T
+ 89 COL_CTRUNC column-level sink for C truncation gC/m^2 F
+ 90 COL_FIRE_CLOSS total column-level fire C loss for non-peat fires outside land-type converted region gC/m^2/s T
+ 91 COL_FIRE_NLOSS total column-level fire N loss gN/m^2/s T
+ 92 COL_NTRUNC column-level sink for N truncation gN/m^2 F
+ 93 CONC_CH4_SAT CH4 soil Concentration for inundated / lake area mol/m3 F
+ 94 CONC_CH4_UNSAT CH4 soil Concentration for non-inundated area mol/m3 F
+ 95 CONC_O2_SAT O2 soil Concentration for inundated / lake area mol/m3 T
+ 96 CONC_O2_UNSAT O2 soil Concentration for non-inundated area mol/m3 T
+ 97 COST_NACTIVE Cost of active uptake gN/gC T
+ 98 COST_NFIX Cost of fixation gN/gC T
+ 99 COST_NRETRANS Cost of retranslocation gN/gC T
+ 100 COSZEN cosine of solar zenith angle none F
+ 101 CPHASE crop phenology phase 0-not planted, 1-planted, 2-leaf emerge, 3-grain fill, 4-harvest T
+ 102 CPOOL temporary photosynthate C pool gC/m^2 T
+ 103 CPOOL_DEADCROOT_GR dead coarse root growth respiration gC/m^2/s F
+ 104 CPOOL_DEADCROOT_STORAGE_GR dead coarse root growth respiration to storage gC/m^2/s F
+ 105 CPOOL_DEADSTEM_GR dead stem growth respiration gC/m^2/s F
+ 106 CPOOL_DEADSTEM_STORAGE_GR dead stem growth respiration to storage gC/m^2/s F
+ 107 CPOOL_FROOT_GR fine root growth respiration gC/m^2/s F
+ 108 CPOOL_FROOT_STORAGE_GR fine root growth respiration to storage gC/m^2/s F
+ 109 CPOOL_LEAF_GR leaf growth respiration gC/m^2/s F
+ 110 CPOOL_LEAF_STORAGE_GR leaf growth respiration to storage gC/m^2/s F
+ 111 CPOOL_LIVECROOT_GR live coarse root growth respiration gC/m^2/s F
+ 112 CPOOL_LIVECROOT_STORAGE_GR live coarse root growth respiration to storage gC/m^2/s F
+ 113 CPOOL_LIVESTEM_GR live stem growth respiration gC/m^2/s F
+ 114 CPOOL_LIVESTEM_STORAGE_GR live stem growth respiration to storage gC/m^2/s F
+ 115 CPOOL_TO_DEADCROOTC allocation to dead coarse root C gC/m^2/s F
+ 116 CPOOL_TO_DEADCROOTC_STORAGE allocation to dead coarse root C storage gC/m^2/s F
+ 117 CPOOL_TO_DEADSTEMC allocation to dead stem C gC/m^2/s F
+ 118 CPOOL_TO_DEADSTEMC_STORAGE allocation to dead stem C storage gC/m^2/s F
+ 119 CPOOL_TO_FROOTC allocation to fine root C gC/m^2/s F
+ 120 CPOOL_TO_FROOTC_STORAGE allocation to fine root C storage gC/m^2/s F
+ 121 CPOOL_TO_GRESP_STORAGE allocation to growth respiration storage gC/m^2/s F
+ 122 CPOOL_TO_LEAFC allocation to leaf C gC/m^2/s F
+ 123 CPOOL_TO_LEAFC_STORAGE allocation to leaf C storage gC/m^2/s F
+ 124 CPOOL_TO_LIVECROOTC allocation to live coarse root C gC/m^2/s F
+ 125 CPOOL_TO_LIVECROOTC_STORAGE allocation to live coarse root C storage gC/m^2/s F
+ 126 CPOOL_TO_LIVESTEMC allocation to live stem C gC/m^2/s F
+ 127 CPOOL_TO_LIVESTEMC_STORAGE allocation to live stem C storage gC/m^2/s F
+ 128 CROOT_PROF profile for litter C and N inputs from coarse roots 1/m F
+ 129 CROPPROD1C 1-yr crop product (grain+biofuel) C gC/m^2 T
+ 130 CROPPROD1C_LOSS loss from 1-yr crop product pool gC/m^2/s T
+ 131 CROPPROD1N 1-yr crop product (grain+biofuel) N gN/m^2 T
+ 132 CROPPROD1N_LOSS loss from 1-yr crop product pool gN/m^2/s T
+ 133 CROPSEEDC_DEFICIT C used for crop seed that needs to be repaid gC/m^2 T
+ 134 CROPSEEDN_DEFICIT N used for crop seed that needs to be repaid gN/m^2 F
+ 135 CROP_SEEDC_TO_LEAF crop seed source to leaf gC/m^2/s F
+ 136 CROP_SEEDN_TO_LEAF crop seed source to leaf gN/m^2/s F
+ 137 CURRENT_GR growth resp for new growth displayed in this timestep gC/m^2/s F
+ 138 CWDC CWD C gC/m^2 T
+ 139 CWDC_1m CWD C to 1 meter gC/m^2 F
+ 140 CWDC_HR cwd C heterotrophic respiration gC/m^2/s F
+ 141 CWDC_LOSS coarse woody debris C loss gC/m^2/s T
+ 142 CWDC_TO_CEL_LITC decomp. of coarse woody debris C to cellulosic litter C gC/m^2/s F
+ 143 CWDC_TO_CEL_LITC_vr decomp. of coarse woody debris C to cellulosic litter C gC/m^3/s F
+ 144 CWDC_TO_LIG_LITC decomp. of coarse woody debris C to lignin litter C gC/m^2/s F
+ 145 CWDC_TO_LIG_LITC_vr decomp. of coarse woody debris C to lignin litter C gC/m^3/s F
+ 146 CWDC_vr CWD C (vertically resolved) gC/m^3 T
+ 147 CWDN CWD N gN/m^2 T
+ 148 CWDN_1m CWD N to 1 meter gN/m^2 F
+ 149 CWDN_TO_CEL_LITN decomp. of coarse woody debris N to cellulosic litter N gN/m^2 F
+ 150 CWDN_TO_CEL_LITN_vr decomp. of coarse woody debris N to cellulosic litter N gN/m^3 F
+ 151 CWDN_TO_LIG_LITN decomp. of coarse woody debris N to lignin litter N gN/m^2 F
+ 152 CWDN_TO_LIG_LITN_vr decomp. of coarse woody debris N to lignin litter N gN/m^3 F
+ 153 CWDN_vr CWD N (vertically resolved) gN/m^3 T
+ 154 CWD_HR_L2 Het. Resp. from coarse woody debris gC/m^2/s F
+ 155 CWD_HR_L2_vr Het. Resp. from coarse woody debris gC/m^3/s F
+ 156 CWD_HR_L3 Het. Resp. from coarse woody debris gC/m^2/s F
+ 157 CWD_HR_L3_vr Het. Resp. from coarse woody debris gC/m^3/s F
+ 158 C_ALLOMETRY C allocation index none F
+ 159 DAYL daylength s F
+ 160 DAYS_ACTIVE number of days since last dormancy days F
+ 161 DEADCROOTC dead coarse root C gC/m^2 T
+ 162 DEADCROOTC_STORAGE dead coarse root C storage gC/m^2 F
+ 163 DEADCROOTC_STORAGE_TO_XFER dead coarse root C shift storage to transfer gC/m^2/s F
+ 164 DEADCROOTC_XFER dead coarse root C transfer gC/m^2 F
+ 165 DEADCROOTC_XFER_TO_DEADCROOTC dead coarse root C growth from storage gC/m^2/s F
+ 166 DEADCROOTN dead coarse root N gN/m^2 T
+ 167 DEADCROOTN_STORAGE dead coarse root N storage gN/m^2 F
+ 168 DEADCROOTN_STORAGE_TO_XFER dead coarse root N shift storage to transfer gN/m^2/s F
+ 169 DEADCROOTN_XFER dead coarse root N transfer gN/m^2 F
+ 170 DEADCROOTN_XFER_TO_DEADCROOTN dead coarse root N growth from storage gN/m^2/s F
+ 171 DEADSTEMC dead stem C gC/m^2 T
+ 172 DEADSTEMC_STORAGE dead stem C storage gC/m^2 F
+ 173 DEADSTEMC_STORAGE_TO_XFER dead stem C shift storage to transfer gC/m^2/s F
+ 174 DEADSTEMC_XFER dead stem C transfer gC/m^2 F
+ 175 DEADSTEMC_XFER_TO_DEADSTEMC dead stem C growth from storage gC/m^2/s F
+ 176 DEADSTEMN dead stem N gN/m^2 T
+ 177 DEADSTEMN_STORAGE dead stem N storage gN/m^2 F
+ 178 DEADSTEMN_STORAGE_TO_XFER dead stem N shift storage to transfer gN/m^2/s F
+ 179 DEADSTEMN_XFER dead stem N transfer gN/m^2 F
+ 180 DEADSTEMN_XFER_TO_DEADSTEMN dead stem N growth from storage gN/m^2/s F
+ 181 DENIT total rate of denitrification gN/m^2/s T
+ 182 DGNETDT derivative of net ground heat flux wrt soil temp W/m^2/K F
+ 183 DISCOI 2 m Discomfort Index C T
+ 184 DISCOIS 2 m Stull Discomfort Index C T
+ 185 DISCOIS_R Rural 2 m Stull Discomfort Index C T
+ 186 DISCOIS_U Urban 2 m Stull Discomfort Index C T
+ 187 DISCOI_R Rural 2 m Discomfort Index C T
+ 188 DISCOI_U Urban 2 m Discomfort Index C T
+ 189 DISPLA displacement height m F
+ 190 DISPVEGC displayed veg carbon, excluding storage and cpool gC/m^2 T
+ 191 DISPVEGN displayed vegetation nitrogen gN/m^2 T
+ 192 DLRAD downward longwave radiation below the canopy W/m^2 F
+ 193 DORMANT_FLAG dormancy flag none F
+ 194 DOWNREG fractional reduction in GPP due to N limitation proportion F
+ 195 DPVLTRB1 turbulent deposition velocity 1 m/s F
+ 196 DPVLTRB2 turbulent deposition velocity 2 m/s F
+ 197 DPVLTRB3 turbulent deposition velocity 3 m/s F
+ 198 DPVLTRB4 turbulent deposition velocity 4 m/s F
+ 199 DSL dry surface layer thickness mm T
+ 200 DSTDEP total dust deposition (dry+wet) from atmosphere kg/m^2/s T
+ 201 DSTFLXT total surface dust emission kg/m2/s T
+ 202 DT_VEG change in t_veg, last iteration K F
+ 203 DWT_CONV_CFLUX conversion C flux (immediate loss to atm) (0 at all times except first timestep of year) gC/m^2/s T
+ 204 DWT_CONV_CFLUX_DRIBBLED conversion C flux (immediate loss to atm), dribbled throughout the year gC/m^2/s T
+ 205 DWT_CONV_CFLUX_PATCH patch-level conversion C flux (immediate loss to atm) (0 at all times except first timestep of gC/m^2/s F
+ 206 DWT_CONV_NFLUX conversion N flux (immediate loss to atm) (0 at all times except first timestep of year) gN/m^2/s T
+ 207 DWT_CONV_NFLUX_PATCH patch-level conversion N flux (immediate loss to atm) (0 at all times except first timestep of gN/m^2/s F
+ 208 DWT_CROPPROD1C_GAIN landcover change-driven addition to 1-year crop product pool gC/m^2/s T
+ 209 DWT_CROPPROD1N_GAIN landcover change-driven addition to 1-year crop product pool gN/m^2/s T
+ 210 DWT_DEADCROOTC_TO_CWDC dead coarse root to CWD due to landcover change gC/m^2/s F
+ 211 DWT_DEADCROOTN_TO_CWDN dead coarse root to CWD due to landcover change gN/m^2/s F
+ 212 DWT_FROOTC_TO_CEL_LIT_C fine root to cellulosic litter due to landcover change gC/m^2/s F
+ 213 DWT_FROOTC_TO_LIG_LIT_C fine root to lignin litter due to landcover change gC/m^2/s F
+ 214 DWT_FROOTC_TO_MET_LIT_C fine root to metabolic litter due to landcover change gC/m^2/s F
+ 215 DWT_FROOTN_TO_CEL_LIT_N fine root N to cellulosic litter due to landcover change gN/m^2/s F
+ 216 DWT_FROOTN_TO_LIG_LIT_N fine root N to lignin litter due to landcover change gN/m^2/s F
+ 217 DWT_FROOTN_TO_MET_LIT_N fine root N to metabolic litter due to landcover change gN/m^2/s F
+ 218 DWT_LIVECROOTC_TO_CWDC live coarse root to CWD due to landcover change gC/m^2/s F
+ 219 DWT_LIVECROOTN_TO_CWDN live coarse root to CWD due to landcover change gN/m^2/s F
+ 220 DWT_PROD100C_GAIN landcover change-driven addition to 100-yr wood product pool gC/m^2/s F
+ 221 DWT_PROD100N_GAIN landcover change-driven addition to 100-yr wood product pool gN/m^2/s F
+ 222 DWT_PROD10C_GAIN landcover change-driven addition to 10-yr wood product pool gC/m^2/s F
+ 223 DWT_PROD10N_GAIN landcover change-driven addition to 10-yr wood product pool gN/m^2/s F
+ 224 DWT_SEEDC_TO_DEADSTEM seed source to patch-level deadstem gC/m^2/s F
+ 225 DWT_SEEDC_TO_DEADSTEM_PATCH patch-level seed source to patch-level deadstem (per-area-gridcell; only makes sense with dov2 gC/m^2/s F
+ 226 DWT_SEEDC_TO_LEAF seed source to patch-level leaf gC/m^2/s F
+ 227 DWT_SEEDC_TO_LEAF_PATCH patch-level seed source to patch-level leaf (per-area-gridcell; only makes sense with dov2xy=. gC/m^2/s F
+ 228 DWT_SEEDN_TO_DEADSTEM seed source to patch-level deadstem gN/m^2/s T
+ 229 DWT_SEEDN_TO_DEADSTEM_PATCH patch-level seed source to patch-level deadstem (per-area-gridcell; only makes sense with dov2 gN/m^2/s F
+ 230 DWT_SEEDN_TO_LEAF seed source to patch-level leaf gN/m^2/s T
+ 231 DWT_SEEDN_TO_LEAF_PATCH patch-level seed source to patch-level leaf (per-area-gridcell; only makes sense with dov2xy=. gN/m^2/s F
+ 232 DWT_SLASH_CFLUX slash C flux (to litter diagnostic only) (0 at all times except first timestep of year) gC/m^2/s T
+ 233 DWT_SLASH_CFLUX_PATCH patch-level slash C flux (to litter diagnostic only) (0 at all times except first timestep of gC/m^2/s F
+ 234 DWT_WOODPRODC_GAIN landcover change-driven addition to wood product pools gC/m^2/s T
+ 235 DWT_WOODPRODN_GAIN landcover change-driven addition to wood product pools gN/m^2/s T
+ 236 DWT_WOOD_PRODUCTC_GAIN_PATCH patch-level landcover change-driven addition to wood product pools(0 at all times except first gC/m^2/s F
+ 237 DYN_COL_ADJUSTMENTS_CH4 Adjustments in ch4 due to dynamic column areas; only makes sense at the column level: should n gC/m^2 F
+ 238 DYN_COL_SOIL_ADJUSTMENTS_C Adjustments in soil carbon due to dynamic column areas; only makes sense at the column level: gC/m^2 F
+ 239 DYN_COL_SOIL_ADJUSTMENTS_N Adjustments in soil nitrogen due to dynamic column areas; only makes sense at the column level gN/m^2 F
+ 240 DYN_COL_SOIL_ADJUSTMENTS_NH4 Adjustments in soil NH4 due to dynamic column areas; only makes sense at the column level: sho gN/m^2 F
+ 241 DYN_COL_SOIL_ADJUSTMENTS_NO3 Adjustments in soil NO3 due to dynamic column areas; only makes sense at the column level: sho gN/m^2 F
+ 242 EFF_POROSITY effective porosity = porosity - vol_ice proportion F
+ 243 EFLXBUILD building heat flux from change in interior building air temperature W/m^2 T
+ 244 EFLX_DYNBAL dynamic land cover change conversion energy flux W/m^2 T
+ 245 EFLX_GNET net heat flux into ground W/m^2 F
+ 246 EFLX_GRND_LAKE net heat flux into lake/snow surface, excluding light transmission W/m^2 T
+ 247 EFLX_LH_TOT total latent heat flux [+ to atm] W/m^2 T
+ 248 EFLX_LH_TOT_ICE total latent heat flux [+ to atm] (ice landunits only) W/m^2 F
+ 249 EFLX_LH_TOT_R Rural total evaporation W/m^2 T
+ 250 EFLX_LH_TOT_U Urban total evaporation W/m^2 F
+ 251 EFLX_SOIL_GRND soil heat flux [+ into soil] W/m^2 F
+ 252 ELAI exposed one-sided leaf area index m^2/m^2 T
+ 253 EMG ground emissivity proportion F
+ 254 EMV vegetation emissivity proportion F
+ 255 EOPT Eopt coefficient for VOC calc non F
+ 256 EPT 2 m Equiv Pot Temp K T
+ 257 EPT_R Rural 2 m Equiv Pot Temp K T
+ 258 EPT_U Urban 2 m Equiv Pot Temp K T
+ 259 ER total ecosystem respiration, autotrophic + heterotrophic gC/m^2/s T
+ 260 ERRH2O total water conservation error mm T
+ 261 ERRH2OSNO imbalance in snow depth (liquid water) mm T
+ 262 ERRSEB surface energy conservation error W/m^2 T
+ 263 ERRSOI soil/lake energy conservation error W/m^2 T
+ 264 ERRSOL solar radiation conservation error W/m^2 T
+ 265 ESAI exposed one-sided stem area index m^2/m^2 T
+ 266 EXCESSC_MR excess C maintenance respiration gC/m^2/s F
+ 267 EXCESS_CFLUX C flux not allocated due to downregulation gC/m^2/s F
+ 268 FAREA_BURNED timestep fractional area burned s-1 T
+ 269 FCANSNO fraction of canopy that is wet proportion F
+ 270 FCEV canopy evaporation W/m^2 T
+ 271 FCH4 Gridcell surface CH4 flux to atmosphere (+ to atm) kgC/m2/s T
+ 272 FCH4TOCO2 Gridcell oxidation of CH4 to CO2 gC/m2/s T
+ 273 FCH4_DFSAT CH4 additional flux due to changing fsat, natural vegetated and crop landunits only kgC/m2/s T
+ 274 FCO2 CO2 flux to atmosphere (+ to atm) kgCO2/m2/s F
+ 275 FCOV fractional impermeable area unitless T
+ 276 FCTR canopy transpiration W/m^2 T
+ 277 FDRY fraction of foliage that is green and dry proportion F
+ 278 FERTNITRO Nitrogen fertilizer for each crop gN/m2/yr F
+ 279 FERT_COUNTER time left to fertilize seconds F
+ 280 FERT_TO_SMINN fertilizer to soil mineral N gN/m^2/s F
+ 281 FFIX_TO_SMINN free living N fixation to soil mineral N gN/m^2/s T
+ 282 FGEV ground evaporation W/m^2 T
+ 283 FGR heat flux into soil/snow including snow melt and lake / snow light transmission W/m^2 T
+ 284 FGR12 heat flux between soil layers 1 and 2 W/m^2 T
+ 285 FGR_ICE heat flux into soil/snow including snow melt and lake / snow light transmission (ice landunits W/m^2 F
+ 286 FGR_R Rural heat flux into soil/snow including snow melt and snow light transmission W/m^2 F
+ 287 FGR_SOIL_R Rural downward heat flux at interface below each soil layer watt/m^2 F
+ 288 FGR_U Urban heat flux into soil/snow including snow melt W/m^2 F
+ 289 FH2OSFC fraction of ground covered by surface water unitless T
+ 290 FH2OSFC_NOSNOW fraction of ground covered by surface water (if no snow present) unitless F
+ 291 FINUNDATED fractional inundated area of vegetated columns unitless T
+ 292 FINUNDATED_LAG time-lagged inundated fraction of vegetated columns unitless F
+ 293 FIRA net infrared (longwave) radiation W/m^2 T
+ 294 FIRA_ICE net infrared (longwave) radiation (ice landunits only) W/m^2 F
+ 295 FIRA_R Rural net infrared (longwave) radiation W/m^2 T
+ 296 FIRA_U Urban net infrared (longwave) radiation W/m^2 F
+ 297 FIRE emitted infrared (longwave) radiation W/m^2 T
+ 298 FIRE_ICE emitted infrared (longwave) radiation (ice landunits only) W/m^2 F
+ 299 FIRE_R Rural emitted infrared (longwave) radiation W/m^2 T
+ 300 FIRE_U Urban emitted infrared (longwave) radiation W/m^2 F
+ 301 FLDS atmospheric longwave radiation (downscaled to columns in glacier regions) W/m^2 T
+ 302 FLDS_ICE atmospheric longwave radiation (downscaled to columns in glacier regions) (ice landunits only) W/m^2 F
+ 303 FMAX_DENIT_CARBONSUBSTRATE FMAX_DENIT_CARBONSUBSTRATE gN/m^3/s F
+ 304 FMAX_DENIT_NITRATE FMAX_DENIT_NITRATE gN/m^3/s F
+ 305 FPI fraction of potential immobilization proportion T
+ 306 FPI_vr fraction of potential immobilization proportion F
+ 307 FPSN photosynthesis umol m-2 s-1 T
+ 308 FPSN24 24 hour accumulative patch photosynthesis starting from mid-night umol CO2/m^2 ground/day F
+ 309 FPSN_WC Rubisco-limited photosynthesis umol m-2 s-1 F
+ 310 FPSN_WJ RuBP-limited photosynthesis umol m-2 s-1 F
+ 311 FPSN_WP Product-limited photosynthesis umol m-2 s-1 F
+ 312 FRAC_ICEOLD fraction of ice relative to the tot water proportion F
+ 313 FREE_RETRANSN_TO_NPOOL deployment of retranslocated N gN/m^2/s T
+ 314 FROOTC fine root C gC/m^2 T
+ 315 FROOTC_ALLOC fine root C allocation gC/m^2/s T
+ 316 FROOTC_LOSS fine root C loss gC/m^2/s T
+ 317 FROOTC_STORAGE fine root C storage gC/m^2 F
+ 318 FROOTC_STORAGE_TO_XFER fine root C shift storage to transfer gC/m^2/s F
+ 319 FROOTC_TO_LITTER fine root C litterfall gC/m^2/s F
+ 320 FROOTC_XFER fine root C transfer gC/m^2 F
+ 321 FROOTC_XFER_TO_FROOTC fine root C growth from storage gC/m^2/s F
+ 322 FROOTN fine root N gN/m^2 T
+ 323 FROOTN_STORAGE fine root N storage gN/m^2 F
+ 324 FROOTN_STORAGE_TO_XFER fine root N shift storage to transfer gN/m^2/s F
+ 325 FROOTN_TO_LITTER fine root N litterfall gN/m^2/s F
+ 326 FROOTN_XFER fine root N transfer gN/m^2 F
+ 327 FROOTN_XFER_TO_FROOTN fine root N growth from storage gN/m^2/s F
+ 328 FROOT_MR fine root maintenance respiration gC/m^2/s F
+ 329 FROOT_PROF profile for litter C and N inputs from fine roots 1/m F
+ 330 FROST_TABLE frost table depth (natural vegetated and crop landunits only) m F
+ 331 FSA absorbed solar radiation W/m^2 T
+ 332 FSAT fractional area with water table at surface unitless T
+ 333 FSA_ICE absorbed solar radiation (ice landunits only) W/m^2 F
+ 334 FSA_R Rural absorbed solar radiation W/m^2 F
+ 335 FSA_U Urban absorbed solar radiation W/m^2 F
+ 336 FSD24 direct radiation (last 24hrs) K F
+ 337 FSD240 direct radiation (last 240hrs) K F
+ 338 FSDS atmospheric incident solar radiation W/m^2 T
+ 339 FSDSND direct nir incident solar radiation W/m^2 T
+ 340 FSDSNDLN direct nir incident solar radiation at local noon W/m^2 T
+ 341 FSDSNI diffuse nir incident solar radiation W/m^2 T
+ 342 FSDSVD direct vis incident solar radiation W/m^2 T
+ 343 FSDSVDLN direct vis incident solar radiation at local noon W/m^2 T
+ 344 FSDSVI diffuse vis incident solar radiation W/m^2 T
+ 345 FSDSVILN diffuse vis incident solar radiation at local noon W/m^2 T
+ 346 FSH sensible heat not including correction for land use change and rain/snow conversion W/m^2 T
+ 347 FSH_G sensible heat from ground W/m^2 T
+ 348 FSH_ICE sensible heat not including correction for land use change and rain/snow conversion (ice landu W/m^2 F
+ 349 FSH_PRECIP_CONVERSION Sensible heat flux from conversion of rain/snow atm forcing W/m^2 T
+ 350 FSH_R Rural sensible heat W/m^2 T
+ 351 FSH_RUNOFF_ICE_TO_LIQ sensible heat flux generated from conversion of ice runoff to liquid W/m^2 T
+ 352 FSH_TO_COUPLER sensible heat sent to coupler (includes corrections for land use change, rain/snow conversion W/m^2 T
+ 353 FSH_U Urban sensible heat W/m^2 F
+ 354 FSH_V sensible heat from veg W/m^2 T
+ 355 FSI24 indirect radiation (last 24hrs) K F
+ 356 FSI240 indirect radiation (last 240hrs) K F
+ 357 FSM snow melt heat flux W/m^2 T
+ 358 FSM_ICE snow melt heat flux (ice landunits only) W/m^2 F
+ 359 FSM_R Rural snow melt heat flux W/m^2 F
+ 360 FSM_U Urban snow melt heat flux W/m^2 F
+ 361 FSNO fraction of ground covered by snow unitless T
+ 362 FSNO_EFF effective fraction of ground covered by snow unitless T
+ 363 FSNO_ICE fraction of ground covered by snow (ice landunits only) unitless F
+ 364 FSR reflected solar radiation W/m^2 T
+ 365 FSRND direct nir reflected solar radiation W/m^2 T
+ 366 FSRNDLN direct nir reflected solar radiation at local noon W/m^2 T
+ 367 FSRNI diffuse nir reflected solar radiation W/m^2 T
+ 368 FSRSF reflected solar radiation W/m^2 T
+ 369 FSRSFND direct nir reflected solar radiation W/m^2 T
+ 370 FSRSFNDLN direct nir reflected solar radiation at local noon W/m^2 T
+ 371 FSRSFNI diffuse nir reflected solar radiation W/m^2 T
+ 372 FSRSFVD direct vis reflected solar radiation W/m^2 T
+ 373 FSRSFVDLN direct vis reflected solar radiation at local noon W/m^2 T
+ 374 FSRSFVI diffuse vis reflected solar radiation W/m^2 T
+ 375 FSRVD direct vis reflected solar radiation W/m^2 T
+ 376 FSRVDLN direct vis reflected solar radiation at local noon W/m^2 T
+ 377 FSRVI diffuse vis reflected solar radiation W/m^2 T
+ 378 FSR_ICE reflected solar radiation (ice landunits only) W/m^2 F
+ 379 FSUN sunlit fraction of canopy proportion F
+ 380 FSUN24 fraction sunlit (last 24hrs) K F
+ 381 FSUN240 fraction sunlit (last 240hrs) K F
+ 382 FUELC fuel load gC/m^2 T
+ 383 FV friction velocity for dust model m/s F
+ 384 FWET fraction of canopy that is wet proportion F
+ 385 F_DENIT denitrification flux gN/m^2/s T
+ 386 F_DENIT_BASE F_DENIT_BASE gN/m^3/s F
+ 387 F_DENIT_vr denitrification flux gN/m^3/s F
+ 388 F_N2O_DENIT denitrification N2O flux gN/m^2/s T
+ 389 F_N2O_NIT nitrification N2O flux gN/m^2/s T
+ 390 F_NIT nitrification flux gN/m^2/s T
+ 391 F_NIT_vr nitrification flux gN/m^3/s F
+ 392 FireComp_BC fire emissions flux of BC kg/m2/sec F
+ 393 FireComp_OC fire emissions flux of OC kg/m2/sec F
+ 394 FireComp_SO2 fire emissions flux of SO2 kg/m2/sec F
+ 395 FireEmis_TOT Total fire emissions flux gC/m2/sec F
+ 396 FireEmis_ZTOP Top of vertical fire emissions distribution m F
+ 397 FireMech_SO2 fire emissions flux of SO2 kg/m2/sec F
+ 398 FireMech_bc_a1 fire emissions flux of bc_a1 kg/m2/sec F
+ 399 FireMech_pom_a1 fire emissions flux of pom_a1 kg/m2/sec F
+ 400 GAMMA total gamma for VOC calc non F
+ 401 GAMMAA gamma A for VOC calc non F
+ 402 GAMMAC gamma C for VOC calc non F
+ 403 GAMMAL gamma L for VOC calc non F
+ 404 GAMMAP gamma P for VOC calc non F
+ 405 GAMMAS gamma S for VOC calc non F
+ 406 GAMMAT gamma T for VOC calc non F
+ 407 GDD0 Growing degree days base 0C from planting ddays F
+ 408 GDD020 Twenty year average of growing degree days base 0C from planting ddays F
+ 409 GDD10 Growing degree days base 10C from planting ddays F
+ 410 GDD1020 Twenty year average of growing degree days base 10C from planting ddays F
+ 411 GDD8 Growing degree days base 8C from planting ddays F
+ 412 GDD820 Twenty year average of growing degree days base 8C from planting ddays F
+ 413 GDDHARV Growing degree days (gdd) needed to harvest ddays F
+ 414 GDDPLANT Accumulated growing degree days past planting date for crop ddays F
+ 415 GDDTSOI Growing degree-days from planting (top two soil layers) ddays F
+ 416 GPP gross primary production gC/m^2/s T
+ 417 GR total growth respiration gC/m^2/s T
+ 418 GRAINC grain C (does not equal yield) gC/m^2 T
+ 419 GRAINC_TO_FOOD grain C to food gC/m^2/s T
+ 420 GRAINC_TO_SEED grain C to seed gC/m^2/s T
+ 421 GRAINN grain N gN/m^2 T
+ 422 GRESP_STORAGE growth respiration storage gC/m^2 F
+ 423 GRESP_STORAGE_TO_XFER growth respiration shift storage to transfer gC/m^2/s F
+ 424 GRESP_XFER growth respiration transfer gC/m^2 F
+ 425 GROSS_NMIN gross rate of N mineralization gN/m^2/s T
+ 426 GROSS_NMIN_vr gross rate of N mineralization gN/m^3/s F
+ 427 GSSHA shaded leaf stomatal conductance umol H20/m2/s T
+ 428 GSSHALN shaded leaf stomatal conductance at local noon umol H20/m2/s T
+ 429 GSSUN sunlit leaf stomatal conductance umol H20/m2/s T
+ 430 GSSUNLN sunlit leaf stomatal conductance at local noon umol H20/m2/s T
+ 431 H2OCAN intercepted water mm T
+ 432 H2OSFC surface water depth mm T
+ 433 H2OSNO snow depth (liquid water) mm T
+ 434 H2OSNO_ICE snow depth (liquid water, ice landunits only) mm F
+ 435 H2OSNO_TOP mass of snow in top snow layer kg/m2 T
+ 436 H2OSOI volumetric soil water (natural vegetated and crop landunits only) mm3/mm3 T
+ 437 HBOT canopy bottom m F
+ 438 HEAT_CONTENT1 initial gridcell total heat content J/m^2 T
+ 439 HEAT_CONTENT1_VEG initial gridcell total heat content - natural vegetated and crop landunits only J/m^2 F
+ 440 HEAT_CONTENT2 post land cover change total heat content J/m^2 F
+ 441 HEAT_FROM_AC sensible heat flux put into canyon due to heat removed from air conditioning W/m^2 T
+ 442 HIA 2 m NWS Heat Index C T
+ 443 HIA_R Rural 2 m NWS Heat Index C T
+ 444 HIA_U Urban 2 m NWS Heat Index C T
+ 445 HK hydraulic conductivity (natural vegetated and crop landunits only) mm/s F
+ 446 HR total heterotrophic respiration gC/m^2/s T
+ 447 HR_vr total vertically resolved heterotrophic respiration gC/m^3/s T
+ 448 HTOP canopy top m T
+ 449 HUMIDEX 2 m Humidex C T
+ 450 HUMIDEX_R Rural 2 m Humidex C T
+ 451 HUMIDEX_U Urban 2 m Humidex C T
+ 452 ICE_CONTENT1 initial gridcell total ice content mm T
+ 453 ICE_CONTENT2 post land cover change total ice content mm F
+ 454 ICE_MODEL_FRACTION Ice sheet model fractional coverage unitless F
+ 455 INIT_GPP GPP flux before downregulation gC/m^2/s F
+ 456 INT_SNOW accumulated swe (natural vegetated and crop landunits only) mm F
+ 457 INT_SNOW_ICE accumulated swe (ice landunits only) mm F
+ 458 JMX25T canopy profile of jmax umol/m2/s T
+ 459 Jmx25Z maximum rate of electron transport at 25 Celcius for canopy layers umol electrons/m2/s T
+ 460 KROOT root conductance each soil layer 1/s F
+ 461 KSOIL soil conductance in each soil layer 1/s F
+ 462 K_ACT_SOM active soil organic potential loss coefficient 1/s F
+ 463 K_CEL_LIT cellulosic litter potential loss coefficient 1/s F
+ 464 K_CWD coarse woody debris potential loss coefficient 1/s F
+ 465 K_LIG_LIT lignin litter potential loss coefficient 1/s F
+ 466 K_MET_LIT metabolic litter potential loss coefficient 1/s F
+ 467 K_NITR K_NITR 1/s F
+ 468 K_NITR_H2O K_NITR_H2O unitless F
+ 469 K_NITR_PH K_NITR_PH unitless F
+ 470 K_NITR_T K_NITR_T unitless F
+ 471 K_PAS_SOM passive soil organic potential loss coefficient 1/s F
+ 472 K_SLO_SOM slow soil organic ma potential loss coefficient 1/s F
+ 473 LAI240 240hr average of leaf area index m^2/m^2 F
+ 474 LAISHA shaded projected leaf area index m^2/m^2 T
+ 475 LAISUN sunlit projected leaf area index m^2/m^2 T
+ 476 LAKEICEFRAC lake layer ice mass fraction unitless F
+ 477 LAKEICEFRAC_SURF surface lake layer ice mass fraction unitless T
+ 478 LAKEICETHICK thickness of lake ice (including physical expansion on freezing) m T
+ 479 LAND_USE_FLUX total C emitted from land cover conversion (smoothed over the year) and wood and grain product gC/m^2/s T
+ 480 LATBASET latitude vary base temperature for gddplant degree C F
+ 481 LEAFC leaf C gC/m^2 T
+ 482 LEAFCN Leaf CN ratio used for flexible CN gC/gN T
+ 483 LEAFCN_OFFSET Leaf C:N used by FUN unitless F
+ 484 LEAFCN_STORAGE Storage Leaf CN ratio used for flexible CN gC/gN F
+ 485 LEAFC_ALLOC leaf C allocation gC/m^2/s T
+ 486 LEAFC_CHANGE C change in leaf gC/m^2/s T
+ 487 LEAFC_LOSS leaf C loss gC/m^2/s T
+ 488 LEAFC_STORAGE leaf C storage gC/m^2 F
+ 489 LEAFC_STORAGE_TO_XFER leaf C shift storage to transfer gC/m^2/s F
+ 490 LEAFC_STORAGE_XFER_ACC Accumulated leaf C transfer gC/m^2 F
+ 491 LEAFC_TO_BIOFUELC leaf C to biofuel C gC/m^2/s T
+ 492 LEAFC_TO_LITTER leaf C litterfall gC/m^2/s F
+ 493 LEAFC_TO_LITTER_FUN leaf C litterfall used by FUN gC/m^2/s T
+ 494 LEAFC_XFER leaf C transfer gC/m^2 F
+ 495 LEAFC_XFER_TO_LEAFC leaf C growth from storage gC/m^2/s F
+ 496 LEAFN leaf N gN/m^2 T
+ 497 LEAFN_STORAGE leaf N storage gN/m^2 F
+ 498 LEAFN_STORAGE_TO_XFER leaf N shift storage to transfer gN/m^2/s F
+ 499 LEAFN_STORAGE_XFER_ACC Accmulated leaf N transfer gN/m^2 F
+ 500 LEAFN_TO_LITTER leaf N litterfall gN/m^2/s T
+ 501 LEAFN_TO_RETRANSN leaf N to retranslocated N pool gN/m^2/s F
+ 502 LEAFN_XFER leaf N transfer gN/m^2 F
+ 503 LEAFN_XFER_TO_LEAFN leaf N growth from storage gN/m^2/s F
+ 504 LEAF_MR leaf maintenance respiration gC/m^2/s T
+ 505 LEAF_PROF profile for litter C and N inputs from leaves 1/m F
+ 506 LFC2 conversion area fraction of BET and BDT that burned per sec T
+ 507 LGSF long growing season factor proportion F
+ 508 LIG_LITC LIG_LIT C gC/m^2 T
+ 509 LIG_LITC_1m LIG_LIT C to 1 meter gC/m^2 F
+ 510 LIG_LITC_TNDNCY_VERT_TRA lignin litter C tendency due to vertical transport gC/m^3/s F
+ 511 LIG_LITC_TO_SLO_SOMC decomp. of lignin litter C to slow soil organic ma C gC/m^2/s F
+ 512 LIG_LITC_TO_SLO_SOMC_vr decomp. of lignin litter C to slow soil organic ma C gC/m^3/s F
+ 513 LIG_LITC_vr LIG_LIT C (vertically resolved) gC/m^3 T
+ 514 LIG_LITN LIG_LIT N gN/m^2 T
+ 515 LIG_LITN_1m LIG_LIT N to 1 meter gN/m^2 F
+ 516 LIG_LITN_TNDNCY_VERT_TRA lignin litter N tendency due to vertical transport gN/m^3/s F
+ 517 LIG_LITN_TO_SLO_SOMN decomp. of lignin litter N to slow soil organic ma N gN/m^2 F
+ 518 LIG_LITN_TO_SLO_SOMN_vr decomp. of lignin litter N to slow soil organic ma N gN/m^3 F
+ 519 LIG_LITN_vr LIG_LIT N (vertically resolved) gN/m^3 T
+ 520 LIG_LIT_HR Het. Resp. from lignin litter gC/m^2/s F
+ 521 LIG_LIT_HR_vr Het. Resp. from lignin litter gC/m^3/s F
+ 522 LIQCAN intercepted liquid water mm T
+ 523 LIQUID_CONTENT1 initial gridcell total liq content mm T
+ 524 LIQUID_CONTENT2 post landuse change gridcell total liq content mm F
+ 525 LIQUID_WATER_TEMP1 initial gridcell weighted average liquid water temperature K F
+ 526 LITFALL litterfall (leaves and fine roots) gC/m^2/s T
+ 527 LITFIRE litter fire losses gC/m^2/s F
+ 528 LITTERC_HR litter C heterotrophic respiration gC/m^2/s T
+ 529 LITTERC_LOSS litter C loss gC/m^2/s T
+ 530 LIVECROOTC live coarse root C gC/m^2 T
+ 531 LIVECROOTC_STORAGE live coarse root C storage gC/m^2 F
+ 532 LIVECROOTC_STORAGE_TO_XFER live coarse root C shift storage to transfer gC/m^2/s F
+ 533 LIVECROOTC_TO_DEADCROOTC live coarse root C turnover gC/m^2/s F
+ 534 LIVECROOTC_XFER live coarse root C transfer gC/m^2 F
+ 535 LIVECROOTC_XFER_TO_LIVECROOTC live coarse root C growth from storage gC/m^2/s F
+ 536 LIVECROOTN live coarse root N gN/m^2 T
+ 537 LIVECROOTN_STORAGE live coarse root N storage gN/m^2 F
+ 538 LIVECROOTN_STORAGE_TO_XFER live coarse root N shift storage to transfer gN/m^2/s F
+ 539 LIVECROOTN_TO_DEADCROOTN live coarse root N turnover gN/m^2/s F
+ 540 LIVECROOTN_TO_RETRANSN live coarse root N to retranslocated N pool gN/m^2/s F
+ 541 LIVECROOTN_XFER live coarse root N transfer gN/m^2 F
+ 542 LIVECROOTN_XFER_TO_LIVECROOTN live coarse root N growth from storage gN/m^2/s F
+ 543 LIVECROOT_MR live coarse root maintenance respiration gC/m^2/s F
+ 544 LIVESTEMC live stem C gC/m^2 T
+ 545 LIVESTEMC_STORAGE live stem C storage gC/m^2 F
+ 546 LIVESTEMC_STORAGE_TO_XFER live stem C shift storage to transfer gC/m^2/s F
+ 547 LIVESTEMC_TO_BIOFUELC livestem C to biofuel C gC/m^2/s T
+ 548 LIVESTEMC_TO_DEADSTEMC live stem C turnover gC/m^2/s F
+ 549 LIVESTEMC_XFER live stem C transfer gC/m^2 F
+ 550 LIVESTEMC_XFER_TO_LIVESTEMC live stem C growth from storage gC/m^2/s F
+ 551 LIVESTEMN live stem N gN/m^2 T
+ 552 LIVESTEMN_STORAGE live stem N storage gN/m^2 F
+ 553 LIVESTEMN_STORAGE_TO_XFER live stem N shift storage to transfer gN/m^2/s F
+ 554 LIVESTEMN_TO_DEADSTEMN live stem N turnover gN/m^2/s F
+ 555 LIVESTEMN_TO_RETRANSN live stem N to retranslocated N pool gN/m^2/s F
+ 556 LIVESTEMN_XFER live stem N transfer gN/m^2 F
+ 557 LIVESTEMN_XFER_TO_LIVESTEMN live stem N growth from storage gN/m^2/s F
+ 558 LIVESTEM_MR live stem maintenance respiration gC/m^2/s F
+ 559 LNC leaf N concentration gN leaf/m^2 T
+ 560 LWdown atmospheric longwave radiation (downscaled to columns in glacier regions) W/m^2 F
+ 561 LWup upwelling longwave radiation W/m^2 F
+ 562 MEG_acetaldehyde MEGAN flux kg/m2/sec T
+ 563 MEG_acetic_acid MEGAN flux kg/m2/sec T
+ 564 MEG_acetone MEGAN flux kg/m2/sec T
+ 565 MEG_carene_3 MEGAN flux kg/m2/sec T
+ 566 MEG_ethanol MEGAN flux kg/m2/sec T
+ 567 MEG_formaldehyde MEGAN flux kg/m2/sec T
+ 568 MEG_isoprene MEGAN flux kg/m2/sec T
+ 569 MEG_methanol MEGAN flux kg/m2/sec T
+ 570 MEG_pinene_a MEGAN flux kg/m2/sec T
+ 571 MEG_thujene_a MEGAN flux kg/m2/sec T
+ 572 MET_LITC MET_LIT C gC/m^2 T
+ 573 MET_LITC_1m MET_LIT C to 1 meter gC/m^2 F
+ 574 MET_LITC_TNDNCY_VERT_TRA metabolic litter C tendency due to vertical transport gC/m^3/s F
+ 575 MET_LITC_TO_ACT_SOMC decomp. of metabolic litter C to active soil organic C gC/m^2/s F
+ 576 MET_LITC_TO_ACT_SOMC_vr decomp. of metabolic litter C to active soil organic C gC/m^3/s F
+ 577 MET_LITC_vr MET_LIT C (vertically resolved) gC/m^3 T
+ 578 MET_LITN MET_LIT N gN/m^2 T
+ 579 MET_LITN_1m MET_LIT N to 1 meter gN/m^2 F
+ 580 MET_LITN_TNDNCY_VERT_TRA metabolic litter N tendency due to vertical transport gN/m^3/s F
+ 581 MET_LITN_TO_ACT_SOMN decomp. of metabolic litter N to active soil organic N gN/m^2 F
+ 582 MET_LITN_TO_ACT_SOMN_vr decomp. of metabolic litter N to active soil organic N gN/m^3 F
+ 583 MET_LITN_vr MET_LIT N (vertically resolved) gN/m^3 T
+ 584 MET_LIT_HR Het. Resp. from metabolic litter gC/m^2/s F
+ 585 MET_LIT_HR_vr Het. Resp. from metabolic litter gC/m^3/s F
+ 586 MR maintenance respiration gC/m^2/s T
+ 587 M_ACT_SOMC_TO_LEACHING active soil organic C leaching loss gC/m^2/s F
+ 588 M_ACT_SOMN_TO_LEACHING active soil organic N leaching loss gN/m^2/s F
+ 589 M_CEL_LITC_TO_FIRE cellulosic litter C fire loss gC/m^2/s F
+ 590 M_CEL_LITC_TO_FIRE_vr cellulosic litter C fire loss gC/m^3/s F
+ 591 M_CEL_LITC_TO_LEACHING cellulosic litter C leaching loss gC/m^2/s F
+ 592 M_CEL_LITN_TO_FIRE cellulosic litter N fire loss gN/m^2 F
+ 593 M_CEL_LITN_TO_FIRE_vr cellulosic litter N fire loss gN/m^3 F
+ 594 M_CEL_LITN_TO_LEACHING cellulosic litter N leaching loss gN/m^2/s F
+ 595 M_CWDC_TO_FIRE coarse woody debris C fire loss gC/m^2/s F
+ 596 M_CWDC_TO_FIRE_vr coarse woody debris C fire loss gC/m^3/s F
+ 597 M_CWDN_TO_FIRE coarse woody debris N fire loss gN/m^2 F
+ 598 M_CWDN_TO_FIRE_vr coarse woody debris N fire loss gN/m^3 F
+ 599 M_DEADCROOTC_STORAGE_TO_LITTER dead coarse root C storage mortality gC/m^2/s F
+ 600 M_DEADCROOTC_STORAGE_TO_LITTER_FIRE dead coarse root C storage fire mortality to litter gC/m^2/s F
+ 601 M_DEADCROOTC_TO_LITTER dead coarse root C mortality gC/m^2/s F
+ 602 M_DEADCROOTC_XFER_TO_LITTER dead coarse root C transfer mortality gC/m^2/s F
+ 603 M_DEADCROOTN_STORAGE_TO_FIRE dead coarse root N storage fire loss gN/m^2/s F
+ 604 M_DEADCROOTN_STORAGE_TO_LITTER dead coarse root N storage mortality gN/m^2/s F
+ 605 M_DEADCROOTN_TO_FIRE dead coarse root N fire loss gN/m^2/s F
+ 606 M_DEADCROOTN_TO_LITTER dead coarse root N mortality gN/m^2/s F
+ 607 M_DEADCROOTN_TO_LITTER_FIRE dead coarse root N fire mortality to litter gN/m^2/s F
+ 608 M_DEADCROOTN_XFER_TO_FIRE dead coarse root N transfer fire loss gN/m^2/s F
+ 609 M_DEADCROOTN_XFER_TO_LITTER dead coarse root N transfer mortality gN/m^2/s F
+ 610 M_DEADROOTC_STORAGE_TO_FIRE dead root C storage fire loss gC/m^2/s F
+ 611 M_DEADROOTC_STORAGE_TO_LITTER_FIRE dead root C storage fire mortality to litter gC/m^2/s F
+ 612 M_DEADROOTC_TO_FIRE dead root C fire loss gC/m^2/s F
+ 613 M_DEADROOTC_TO_LITTER_FIRE dead root C fire mortality to litter gC/m^2/s F
+ 614 M_DEADROOTC_XFER_TO_FIRE dead root C transfer fire loss gC/m^2/s F
+ 615 M_DEADROOTC_XFER_TO_LITTER_FIRE dead root C transfer fire mortality to litter gC/m^2/s F
+ 616 M_DEADSTEMC_STORAGE_TO_FIRE dead stem C storage fire loss gC/m^2/s F
+ 617 M_DEADSTEMC_STORAGE_TO_LITTER dead stem C storage mortality gC/m^2/s F
+ 618 M_DEADSTEMC_STORAGE_TO_LITTER_FIRE dead stem C storage fire mortality to litter gC/m^2/s F
+ 619 M_DEADSTEMC_TO_FIRE dead stem C fire loss gC/m^2/s F
+ 620 M_DEADSTEMC_TO_LITTER dead stem C mortality gC/m^2/s F
+ 621 M_DEADSTEMC_TO_LITTER_FIRE dead stem C fire mortality to litter gC/m^2/s F
+ 622 M_DEADSTEMC_XFER_TO_FIRE dead stem C transfer fire loss gC/m^2/s F
+ 623 M_DEADSTEMC_XFER_TO_LITTER dead stem C transfer mortality gC/m^2/s F
+ 624 M_DEADSTEMC_XFER_TO_LITTER_FIRE dead stem C transfer fire mortality to litter gC/m^2/s F
+ 625 M_DEADSTEMN_STORAGE_TO_FIRE dead stem N storage fire loss gN/m^2/s F
+ 626 M_DEADSTEMN_STORAGE_TO_LITTER dead stem N storage mortality gN/m^2/s F
+ 627 M_DEADSTEMN_TO_FIRE dead stem N fire loss gN/m^2/s F
+ 628 M_DEADSTEMN_TO_LITTER dead stem N mortality gN/m^2/s F
+ 629 M_DEADSTEMN_TO_LITTER_FIRE dead stem N fire mortality to litter gN/m^2/s F
+ 630 M_DEADSTEMN_XFER_TO_FIRE dead stem N transfer fire loss gN/m^2/s F
+ 631 M_DEADSTEMN_XFER_TO_LITTER dead stem N transfer mortality gN/m^2/s F
+ 632 M_FROOTC_STORAGE_TO_FIRE fine root C storage fire loss gC/m^2/s F
+ 633 M_FROOTC_STORAGE_TO_LITTER fine root C storage mortality gC/m^2/s F
+ 634 M_FROOTC_STORAGE_TO_LITTER_FIRE fine root C storage fire mortality to litter gC/m^2/s F
+ 635 M_FROOTC_TO_FIRE fine root C fire loss gC/m^2/s F
+ 636 M_FROOTC_TO_LITTER fine root C mortality gC/m^2/s F
+ 637 M_FROOTC_TO_LITTER_FIRE fine root C fire mortality to litter gC/m^2/s F
+ 638 M_FROOTC_XFER_TO_FIRE fine root C transfer fire loss gC/m^2/s F
+ 639 M_FROOTC_XFER_TO_LITTER fine root C transfer mortality gC/m^2/s F
+ 640 M_FROOTC_XFER_TO_LITTER_FIRE fine root C transfer fire mortality to litter gC/m^2/s F
+ 641 M_FROOTN_STORAGE_TO_FIRE fine root N storage fire loss gN/m^2/s F
+ 642 M_FROOTN_STORAGE_TO_LITTER fine root N storage mortality gN/m^2/s F
+ 643 M_FROOTN_TO_FIRE fine root N fire loss gN/m^2/s F
+ 644 M_FROOTN_TO_LITTER fine root N mortality gN/m^2/s F
+ 645 M_FROOTN_XFER_TO_FIRE fine root N transfer fire loss gN/m^2/s F
+ 646 M_FROOTN_XFER_TO_LITTER fine root N transfer mortality gN/m^2/s F
+ 647 M_GRESP_STORAGE_TO_FIRE growth respiration storage fire loss gC/m^2/s F
+ 648 M_GRESP_STORAGE_TO_LITTER growth respiration storage mortality gC/m^2/s F
+ 649 M_GRESP_STORAGE_TO_LITTER_FIRE growth respiration storage fire mortality to litter gC/m^2/s F
+ 650 M_GRESP_XFER_TO_FIRE growth respiration transfer fire loss gC/m^2/s F
+ 651 M_GRESP_XFER_TO_LITTER growth respiration transfer mortality gC/m^2/s F
+ 652 M_GRESP_XFER_TO_LITTER_FIRE growth respiration transfer fire mortality to litter gC/m^2/s F
+ 653 M_LEAFC_STORAGE_TO_FIRE leaf C storage fire loss gC/m^2/s F
+ 654 M_LEAFC_STORAGE_TO_LITTER leaf C storage mortality gC/m^2/s F
+ 655 M_LEAFC_STORAGE_TO_LITTER_FIRE leaf C fire mortality to litter gC/m^2/s F
+ 656 M_LEAFC_TO_FIRE leaf C fire loss gC/m^2/s F
+ 657 M_LEAFC_TO_LITTER leaf C mortality gC/m^2/s F
+ 658 M_LEAFC_TO_LITTER_FIRE leaf C fire mortality to litter gC/m^2/s F
+ 659 M_LEAFC_XFER_TO_FIRE leaf C transfer fire loss gC/m^2/s F
+ 660 M_LEAFC_XFER_TO_LITTER leaf C transfer mortality gC/m^2/s F
+ 661 M_LEAFC_XFER_TO_LITTER_FIRE leaf C transfer fire mortality to litter gC/m^2/s F
+ 662 M_LEAFN_STORAGE_TO_FIRE leaf N storage fire loss gN/m^2/s F
+ 663 M_LEAFN_STORAGE_TO_LITTER leaf N storage mortality gN/m^2/s F
+ 664 M_LEAFN_TO_FIRE leaf N fire loss gN/m^2/s F
+ 665 M_LEAFN_TO_LITTER leaf N mortality gN/m^2/s F
+ 666 M_LEAFN_XFER_TO_FIRE leaf N transfer fire loss gN/m^2/s F
+ 667 M_LEAFN_XFER_TO_LITTER leaf N transfer mortality gN/m^2/s F
+ 668 M_LIG_LITC_TO_FIRE lignin litter C fire loss gC/m^2/s F
+ 669 M_LIG_LITC_TO_FIRE_vr lignin litter C fire loss gC/m^3/s F
+ 670 M_LIG_LITC_TO_LEACHING lignin litter C leaching loss gC/m^2/s F
+ 671 M_LIG_LITN_TO_FIRE lignin litter N fire loss gN/m^2 F
+ 672 M_LIG_LITN_TO_FIRE_vr lignin litter N fire loss gN/m^3 F
+ 673 M_LIG_LITN_TO_LEACHING lignin litter N leaching loss gN/m^2/s F
+ 674 M_LIVECROOTC_STORAGE_TO_LITTER live coarse root C storage mortality gC/m^2/s F
+ 675 M_LIVECROOTC_STORAGE_TO_LITTER_FIRE live coarse root C fire mortality to litter gC/m^2/s F
+ 676 M_LIVECROOTC_TO_LITTER live coarse root C mortality gC/m^2/s F
+ 677 M_LIVECROOTC_XFER_TO_LITTER live coarse root C transfer mortality gC/m^2/s F
+ 678 M_LIVECROOTN_STORAGE_TO_FIRE live coarse root N storage fire loss gN/m^2/s F
+ 679 M_LIVECROOTN_STORAGE_TO_LITTER live coarse root N storage mortality gN/m^2/s F
+ 680 M_LIVECROOTN_TO_FIRE live coarse root N fire loss gN/m^2/s F
+ 681 M_LIVECROOTN_TO_LITTER live coarse root N mortality gN/m^2/s F
+ 682 M_LIVECROOTN_XFER_TO_FIRE live coarse root N transfer fire loss gN/m^2/s F
+ 683 M_LIVECROOTN_XFER_TO_LITTER live coarse root N transfer mortality gN/m^2/s F
+ 684 M_LIVEROOTC_STORAGE_TO_FIRE live root C storage fire loss gC/m^2/s F
+ 685 M_LIVEROOTC_STORAGE_TO_LITTER_FIRE live root C storage fire mortality to litter gC/m^2/s F
+ 686 M_LIVEROOTC_TO_DEADROOTC_FIRE live root C fire mortality to dead root C gC/m^2/s F
+ 687 M_LIVEROOTC_TO_FIRE live root C fire loss gC/m^2/s F
+ 688 M_LIVEROOTC_TO_LITTER_FIRE live root C fire mortality to litter gC/m^2/s F
+ 689 M_LIVEROOTC_XFER_TO_FIRE live root C transfer fire loss gC/m^2/s F
+ 690 M_LIVEROOTC_XFER_TO_LITTER_FIRE live root C transfer fire mortality to litter gC/m^2/s F
+ 691 M_LIVESTEMC_STORAGE_TO_FIRE live stem C storage fire loss gC/m^2/s F
+ 692 M_LIVESTEMC_STORAGE_TO_LITTER live stem C storage mortality gC/m^2/s F
+ 693 M_LIVESTEMC_STORAGE_TO_LITTER_FIRE live stem C storage fire mortality to litter gC/m^2/s F
+ 694 M_LIVESTEMC_TO_DEADSTEMC_FIRE live stem C fire mortality to dead stem C gC/m^2/s F
+ 695 M_LIVESTEMC_TO_FIRE live stem C fire loss gC/m^2/s F
+ 696 M_LIVESTEMC_TO_LITTER live stem C mortality gC/m^2/s F
+ 697 M_LIVESTEMC_TO_LITTER_FIRE live stem C fire mortality to litter gC/m^2/s F
+ 698 M_LIVESTEMC_XFER_TO_FIRE live stem C transfer fire loss gC/m^2/s F
+ 699 M_LIVESTEMC_XFER_TO_LITTER live stem C transfer mortality gC/m^2/s F
+ 700 M_LIVESTEMC_XFER_TO_LITTER_FIRE live stem C transfer fire mortality to litter gC/m^2/s F
+ 701 M_LIVESTEMN_STORAGE_TO_FIRE live stem N storage fire loss gN/m^2/s F
+ 702 M_LIVESTEMN_STORAGE_TO_LITTER live stem N storage mortality gN/m^2/s F
+ 703 M_LIVESTEMN_TO_FIRE live stem N fire loss gN/m^2/s F
+ 704 M_LIVESTEMN_TO_LITTER live stem N mortality gN/m^2/s F
+ 705 M_LIVESTEMN_XFER_TO_FIRE live stem N transfer fire loss gN/m^2/s F
+ 706 M_LIVESTEMN_XFER_TO_LITTER live stem N transfer mortality gN/m^2/s F
+ 707 M_MET_LITC_TO_FIRE metabolic litter C fire loss gC/m^2/s F
+ 708 M_MET_LITC_TO_FIRE_vr metabolic litter C fire loss gC/m^3/s F
+ 709 M_MET_LITC_TO_LEACHING metabolic litter C leaching loss gC/m^2/s F
+ 710 M_MET_LITN_TO_FIRE metabolic litter N fire loss gN/m^2 F
+ 711 M_MET_LITN_TO_FIRE_vr metabolic litter N fire loss gN/m^3 F
+ 712 M_MET_LITN_TO_LEACHING metabolic litter N leaching loss gN/m^2/s F
+ 713 M_PAS_SOMC_TO_LEACHING passive soil organic C leaching loss gC/m^2/s F
+ 714 M_PAS_SOMN_TO_LEACHING passive soil organic N leaching loss gN/m^2/s F
+ 715 M_RETRANSN_TO_FIRE retranslocated N pool fire loss gN/m^2/s F
+ 716 M_RETRANSN_TO_LITTER retranslocated N pool mortality gN/m^2/s F
+ 717 M_SLO_SOMC_TO_LEACHING slow soil organic ma C leaching loss gC/m^2/s F
+ 718 M_SLO_SOMN_TO_LEACHING slow soil organic ma N leaching loss gN/m^2/s F
+ 719 NACTIVE Mycorrhizal N uptake flux gN/m^2/s T
+ 720 NACTIVE_NH4 Mycorrhizal N uptake flux gN/m^2/s T
+ 721 NACTIVE_NO3 Mycorrhizal N uptake flux gN/m^2/s T
+ 722 NAM AM-associated N uptake flux gN/m^2/s T
+ 723 NAM_NH4 AM-associated N uptake flux gN/m^2/s T
+ 724 NAM_NO3 AM-associated N uptake flux gN/m^2/s T
+ 725 NBP net biome production, includes fire, landuse, harvest and hrv_xsmrpool flux (latter smoothed o gC/m^2/s T
+ 726 NDEPLOY total N deployed in new growth gN/m^2/s T
+ 727 NDEP_PROF profile for atmospheric N deposition 1/m F
+ 728 NDEP_TO_SMINN atmospheric N deposition to soil mineral N gN/m^2/s T
+ 729 NECM ECM-associated N uptake flux gN/m^2/s T
+ 730 NECM_NH4 ECM-associated N uptake flux gN/m^2/s T
+ 731 NECM_NO3 ECM-associated N uptake flux gN/m^2/s T
+ 732 NEE net ecosystem exchange of carbon, includes fire and hrv_xsmrpool (latter smoothed over the yea gC/m^2/s T
+ 733 NEM Gridcell net adjustment to net carbon exchange passed to atm. for methane production gC/m2/s T
+ 734 NEP net ecosystem production, excludes fire, landuse, and harvest flux, positive for sink gC/m^2/s T
+ 735 NET_NMIN net rate of N mineralization gN/m^2/s T
+ 736 NET_NMIN_vr net rate of N mineralization gN/m^3/s F
+ 737 NFERTILIZATION fertilizer added gN/m^2/s T
+ 738 NFIRE fire counts valid only in Reg.C counts/km2/sec T
+ 739 NFIX Symbiotic BNF uptake flux gN/m^2/s T
+ 740 NFIXATION_PROF profile for biological N fixation 1/m F
+ 741 NFIX_TO_SMINN symbiotic/asymbiotic N fixation to soil mineral N gN/m^2/s F
+ 742 NNONMYC Non-mycorrhizal N uptake flux gN/m^2/s T
+ 743 NNONMYC_NH4 Non-mycorrhizal N uptake flux gN/m^2/s T
+ 744 NNONMYC_NO3 Non-mycorrhizal N uptake flux gN/m^2/s T
+ 745 NPASSIVE Passive N uptake flux gN/m^2/s T
+ 746 NPOOL temporary plant N pool gN/m^2 T
+ 747 NPOOL_TO_DEADCROOTN allocation to dead coarse root N gN/m^2/s F
+ 748 NPOOL_TO_DEADCROOTN_STORAGE allocation to dead coarse root N storage gN/m^2/s F
+ 749 NPOOL_TO_DEADSTEMN allocation to dead stem N gN/m^2/s F
+ 750 NPOOL_TO_DEADSTEMN_STORAGE allocation to dead stem N storage gN/m^2/s F
+ 751 NPOOL_TO_FROOTN allocation to fine root N gN/m^2/s F
+ 752 NPOOL_TO_FROOTN_STORAGE allocation to fine root N storage gN/m^2/s F
+ 753 NPOOL_TO_LEAFN allocation to leaf N gN/m^2/s F
+ 754 NPOOL_TO_LEAFN_STORAGE allocation to leaf N storage gN/m^2/s F
+ 755 NPOOL_TO_LIVECROOTN allocation to live coarse root N gN/m^2/s F
+ 756 NPOOL_TO_LIVECROOTN_STORAGE allocation to live coarse root N storage gN/m^2/s F
+ 757 NPOOL_TO_LIVESTEMN allocation to live stem N gN/m^2/s F
+ 758 NPOOL_TO_LIVESTEMN_STORAGE allocation to live stem N storage gN/m^2/s F
+ 759 NPP net primary production gC/m^2/s T
+ 760 NPP_BURNEDOFF C that cannot be used for N uptake gC/m^2/s F
+ 761 NPP_GROWTH Total C used for growth in FUN gC/m^2/s T
+ 762 NPP_NACTIVE Mycorrhizal N uptake used C gC/m^2/s T
+ 763 NPP_NACTIVE_NH4 Mycorrhizal N uptake use C gC/m^2/s T
+ 764 NPP_NACTIVE_NO3 Mycorrhizal N uptake used C gC/m^2/s T
+ 765 NPP_NAM AM-associated N uptake used C gC/m^2/s T
+ 766 NPP_NAM_NH4 AM-associated N uptake use C gC/m^2/s T
+ 767 NPP_NAM_NO3 AM-associated N uptake use C gC/m^2/s T
+ 768 NPP_NECM ECM-associated N uptake used C gC/m^2/s T
+ 769 NPP_NECM_NH4 ECM-associated N uptake use C gC/m^2/s T
+ 770 NPP_NECM_NO3 ECM-associated N uptake used C gC/m^2/s T
+ 771 NPP_NFIX Symbiotic BNF uptake used C gC/m^2/s T
+ 772 NPP_NNONMYC Non-mycorrhizal N uptake used C gC/m^2/s T
+ 773 NPP_NNONMYC_NH4 Non-mycorrhizal N uptake use C gC/m^2/s T
+ 774 NPP_NNONMYC_NO3 Non-mycorrhizal N uptake use C gC/m^2/s T
+ 775 NPP_NRETRANS Retranslocated N uptake flux gC/m^2/s T
+ 776 NPP_NUPTAKE Total C used by N uptake in FUN gC/m^2/s T
+ 777 NRETRANS Retranslocated N uptake flux gN/m^2/s T
+ 778 NRETRANS_REG Retranslocated N uptake flux gN/m^2/s T
+ 779 NRETRANS_SEASON Retranslocated N uptake flux gN/m^2/s T
+ 780 NRETRANS_STRESS Retranslocated N uptake flux gN/m^2/s T
+ 781 NSUBSTEPS number of adaptive timesteps in CLM timestep unitless F
+ 782 NUPTAKE Total N uptake of FUN gN/m^2/s T
+ 783 NUPTAKE_NPP_FRACTION frac of NPP used in N uptake - T
+ 784 N_ALLOMETRY N allocation index none F
+ 785 O2_DECOMP_DEPTH_UNSAT O2 consumption from HR and AR for non-inundated area mol/m3/s F
+ 786 OBU Monin-Obukhov length m F
+ 787 OCDEP total OC deposition (dry+wet) from atmosphere kg/m^2/s T
+ 788 OFFSET_COUNTER offset days counter days F
+ 789 OFFSET_FDD offset freezing degree days counter C degree-days F
+ 790 OFFSET_FLAG offset flag none F
+ 791 OFFSET_SWI offset soil water index none F
+ 792 ONSET_COUNTER onset days counter days F
+ 793 ONSET_FDD onset freezing degree days counter C degree-days F
+ 794 ONSET_FLAG onset flag none F
+ 795 ONSET_GDD onset growing degree days C degree-days F
+ 796 ONSET_GDDFLAG onset flag for growing degree day sum none F
+ 797 ONSET_SWI onset soil water index none F
+ 798 O_SCALAR fraction by which decomposition is reduced due to anoxia unitless T
+ 799 PAR240DZ 10-day running mean of daytime patch absorbed PAR for leaves for top canopy layer W/m^2 F
+ 800 PAR240XZ 10-day running mean of maximum patch absorbed PAR for leaves for top canopy layer W/m^2 F
+ 801 PAR240_shade shade PAR (240 hrs) umol/m2/s F
+ 802 PAR240_sun sunlit PAR (240 hrs) umol/m2/s F
+ 803 PAR24_shade shade PAR (24 hrs) umol/m2/s F
+ 804 PAR24_sun sunlit PAR (24 hrs) umol/m2/s F
+ 805 PARVEGLN absorbed par by vegetation at local noon W/m^2 T
+ 806 PAR_shade shade PAR umol/m2/s F
+ 807 PAR_sun sunlit PAR umol/m2/s F
+ 808 PAS_SOMC PAS_SOM C gC/m^2 T
+ 809 PAS_SOMC_1m PAS_SOM C to 1 meter gC/m^2 F
+ 810 PAS_SOMC_TNDNCY_VERT_TRA passive soil organic C tendency due to vertical transport gC/m^3/s F
+ 811 PAS_SOMC_TO_ACT_SOMC decomp. of passive soil organic C to active soil organic C gC/m^2/s F
+ 812 PAS_SOMC_TO_ACT_SOMC_vr decomp. of passive soil organic C to active soil organic C gC/m^3/s F
+ 813 PAS_SOMC_vr PAS_SOM C (vertically resolved) gC/m^3 T
+ 814 PAS_SOMN PAS_SOM N gN/m^2 T
+ 815 PAS_SOMN_1m PAS_SOM N to 1 meter gN/m^2 F
+ 816 PAS_SOMN_TNDNCY_VERT_TRA passive soil organic N tendency due to vertical transport gN/m^3/s F
+ 817 PAS_SOMN_TO_ACT_SOMN decomp. of passive soil organic N to active soil organic N gN/m^2 F
+ 818 PAS_SOMN_TO_ACT_SOMN_vr decomp. of passive soil organic N to active soil organic N gN/m^3 F
+ 819 PAS_SOMN_vr PAS_SOM N (vertically resolved) gN/m^3 T
+ 820 PAS_SOM_HR Het. Resp. from passive soil organic gC/m^2/s F
+ 821 PAS_SOM_HR_vr Het. Resp. from passive soil organic gC/m^3/s F
+ 822 PBOT atmospheric pressure at surface (downscaled to columns in glacier regions) Pa T
+ 823 PBOT_240 10 day running mean of air pressure Pa F
+ 824 PCH4 atmospheric partial pressure of CH4 Pa T
+ 825 PCO2 atmospheric partial pressure of CO2 Pa T
+ 826 PCO2_240 10 day running mean of CO2 pressure Pa F
+ 827 PFT_CTRUNC patch-level sink for C truncation gC/m^2 F
+ 828 PFT_FIRE_CLOSS total patch-level fire C loss for non-peat fires outside land-type converted region gC/m^2/s T
+ 829 PFT_FIRE_NLOSS total patch-level fire N loss gN/m^2/s T
+ 830 PFT_NTRUNC patch-level sink for N truncation gN/m^2 F
+ 831 PLANTCN Plant C:N used by FUN unitless F
+ 832 PLANT_CALLOC total allocated C flux gC/m^2/s F
+ 833 PLANT_NALLOC total allocated N flux gN/m^2/s F
+ 834 PLANT_NDEMAND N flux required to support initial GPP gN/m^2/s T
+ 835 PNLCZ Proportion of nitrogen allocated for light capture unitless F
+ 836 PO2_240 10 day running mean of O2 pressure Pa F
+ 837 POTENTIAL_IMMOB potential N immobilization gN/m^2/s T
+ 838 POTENTIAL_IMMOB_vr potential N immobilization gN/m^3/s F
+ 839 POT_F_DENIT potential denitrification flux gN/m^2/s T
+ 840 POT_F_DENIT_vr potential denitrification flux gN/m^3/s F
+ 841 POT_F_NIT potential nitrification flux gN/m^2/s T
+ 842 POT_F_NIT_vr potential nitrification flux gN/m^3/s F
+ 843 PREC10 10-day running mean of PREC MM H2O/S F
+ 844 PREC60 60-day running mean of PREC MM H2O/S F
+ 845 PREV_DAYL daylength from previous timestep s F
+ 846 PREV_FROOTC_TO_LITTER previous timestep froot C litterfall flux gC/m^2/s F
+ 847 PREV_LEAFC_TO_LITTER previous timestep leaf C litterfall flux gC/m^2/s F
+ 848 PROD100C 100-yr wood product C gC/m^2 F
+ 849 PROD100C_LOSS loss from 100-yr wood product pool gC/m^2/s F
+ 850 PROD100N 100-yr wood product N gN/m^2 F
+ 851 PROD100N_LOSS loss from 100-yr wood product pool gN/m^2/s F
+ 852 PROD10C 10-yr wood product C gC/m^2 F
+ 853 PROD10C_LOSS loss from 10-yr wood product pool gC/m^2/s F
+ 854 PROD10N 10-yr wood product N gN/m^2 F
+ 855 PROD10N_LOSS loss from 10-yr wood product pool gN/m^2/s F
+ 856 PSNSHA shaded leaf photosynthesis umolCO2/m^2/s T
+ 857 PSNSHADE_TO_CPOOL C fixation from shaded canopy gC/m^2/s T
+ 858 PSNSUN sunlit leaf photosynthesis umolCO2/m^2/s T
+ 859 PSNSUN_TO_CPOOL C fixation from sunlit canopy gC/m^2/s T
+ 860 PSurf atmospheric pressure at surface (downscaled to columns in glacier regions) Pa F
+ 861 Q2M 2m specific humidity kg/kg T
+ 862 QAF canopy air humidity kg/kg F
+ 863 QBOT atmospheric specific humidity (downscaled to columns in glacier regions) kg/kg T
+ 864 QDIRECT_THROUGHFALL direct throughfall of liquid (rain + above-canopy irrigation) mm/s F
+ 865 QDIRECT_THROUGHFALL_SNOW direct throughfall of snow mm/s F
+ 866 QDRAI sub-surface drainage mm/s T
+ 867 QDRAI_PERCH perched wt drainage mm/s T
+ 868 QDRAI_XS saturation excess drainage mm/s T
+ 869 QDRIP rate of excess canopy liquid falling off canopy mm/s F
+ 870 QDRIP_SNOW rate of excess canopy snow falling off canopy mm/s F
+ 871 QFLOOD runoff from river flooding mm/s T
+ 872 QFLX_EVAP_TOT qflx_evap_soi + qflx_evap_can + qflx_tran_veg kg m-2 s-1 T
+ 873 QFLX_EVAP_VEG vegetation evaporation mm H2O/s F
+ 874 QFLX_ICE_DYNBAL ice dynamic land cover change conversion runoff flux mm/s T
+ 875 QFLX_LIQDEW_TO_TOP_LAYER rate of liquid water deposited on top soil or snow layer (dew) mm H2O/s T
+ 876 QFLX_LIQEVAP_FROM_TOP_LAYER rate of liquid water evaporated from top soil or snow layer mm H2O/s T
+ 877 QFLX_LIQ_DYNBAL liq dynamic land cover change conversion runoff flux mm/s T
+ 878 QFLX_LIQ_GRND liquid (rain+irrigation) on ground after interception mm H2O/s F
+ 879 QFLX_SNOW_DRAIN drainage from snow pack mm/s T
+ 880 QFLX_SNOW_DRAIN_ICE drainage from snow pack melt (ice landunits only) mm/s T
+ 881 QFLX_SNOW_GRND snow on ground after interception mm H2O/s F
+ 882 QFLX_SOLIDDEW_TO_TOP_LAYER rate of solid water deposited on top soil or snow layer (frost) mm H2O/s T
+ 883 QFLX_SOLIDEVAP_FROM_TOP_LAYER rate of ice evaporated from top soil or snow layer (sublimation) (also includes bare ice subli mm H2O/s T
+ 884 QFLX_SOLIDEVAP_FROM_TOP_LAYER_ICE rate of ice evaporated from top soil or snow layer (sublimation) (also includes bare ice subli mm H2O/s F
+ 885 QH2OSFC surface water runoff mm/s T
+ 886 QH2OSFC_TO_ICE surface water converted to ice mm/s F
+ 887 QHR hydraulic redistribution mm/s T
+ 888 QICE ice growth/melt mm/s T
+ 889 QICE_FORC qice forcing sent to GLC mm/s F
+ 890 QICE_FRZ ice growth mm/s T
+ 891 QICE_MELT ice melt mm/s T
+ 892 QINFL infiltration mm/s T
+ 893 QINTR interception mm/s T
+ 894 QIRRIG_DEMAND irrigation demand mm/s F
+ 895 QIRRIG_DRIP water added via drip irrigation mm/s F
+ 896 QIRRIG_FROM_GW_CONFINED water added through confined groundwater irrigation mm/s T
+ 897 QIRRIG_FROM_GW_UNCONFINED water added through unconfined groundwater irrigation mm/s T
+ 898 QIRRIG_FROM_SURFACE water added through surface water irrigation mm/s T
+ 899 QIRRIG_SPRINKLER water added via sprinkler irrigation mm/s F
+ 900 QOVER total surface runoff (includes QH2OSFC) mm/s T
+ 901 QOVER_LAG time-lagged surface runoff for soil columns mm/s F
+ 902 QPHSNEG net negative hydraulic redistribution flux mm/s F
+ 903 QRGWL surface runoff at glaciers (liquid only), wetlands, lakes; also includes melted ice runoff fro mm/s T
+ 904 QROOTSINK water flux from soil to root in each soil-layer mm/s F
+ 905 QRUNOFF total liquid runoff not including correction for land use change mm/s T
+ 906 QRUNOFF_ICE total liquid runoff not incl corret for LULCC (ice landunits only) mm/s T
+ 907 QRUNOFF_ICE_TO_COUPLER total ice runoff sent to coupler (includes corrections for land use change) mm/s T
+ 908 QRUNOFF_ICE_TO_LIQ liquid runoff from converted ice runoff mm/s F
+ 909 QRUNOFF_R Rural total runoff mm/s F
+ 910 QRUNOFF_TO_COUPLER total liquid runoff sent to coupler (includes corrections for land use change) mm/s T
+ 911 QRUNOFF_U Urban total runoff mm/s F
+ 912 QSNOCPLIQ excess liquid h2o due to snow capping not including correction for land use change mm H2O/s T
+ 913 QSNOEVAP evaporation from snow (only when snl<0, otherwise it is equal to qflx_ev_soil) mm/s T
+ 914 QSNOFRZ column-integrated snow freezing rate kg/m2/s T
+ 915 QSNOFRZ_ICE column-integrated snow freezing rate (ice landunits only) mm/s T
+ 916 QSNOMELT snow melt rate mm/s T
+ 917 QSNOMELT_ICE snow melt (ice landunits only) mm/s T
+ 918 QSNOUNLOAD canopy snow unloading mm/s T
+ 919 QSNO_TEMPUNLOAD canopy snow temp unloading mm/s T
+ 920 QSNO_WINDUNLOAD canopy snow wind unloading mm/s T
+ 921 QSNWCPICE excess solid h2o due to snow capping not including correction for land use change mm H2O/s T
+ 922 QSOIL Ground evaporation (soil/snow evaporation + soil/snow sublimation - dew) mm/s T
+ 923 QSOIL_ICE Ground evaporation (ice landunits only) mm/s T
+ 924 QTOPSOIL water input to surface mm/s F
+ 925 QVEGE canopy evaporation mm/s T
+ 926 QVEGT canopy transpiration mm/s T
+ 927 Qair atmospheric specific humidity (downscaled to columns in glacier regions) kg/kg F
+ 928 Qh sensible heat W/m^2 F
+ 929 Qle total evaporation W/m^2 F
+ 930 Qstor storage heat flux (includes snowmelt) W/m^2 F
+ 931 Qtau momentum flux kg/m/s^2 F
+ 932 RAH1 aerodynamical resistance s/m F
+ 933 RAH2 aerodynamical resistance s/m F
+ 934 RAIN atmospheric rain, after rain/snow repartitioning based on temperature mm/s T
+ 935 RAIN_FROM_ATM atmospheric rain received from atmosphere (pre-repartitioning) mm/s T
+ 936 RAIN_ICE atmospheric rain, after rain/snow repartitioning based on temperature (ice landunits only) mm/s F
+ 937 RAM1 aerodynamical resistance s/m F
+ 938 RAM_LAKE aerodynamic resistance for momentum (lakes only) s/m F
+ 939 RAW1 aerodynamical resistance s/m F
+ 940 RAW2 aerodynamical resistance s/m F
+ 941 RB leaf boundary resistance s/m F
+ 942 RB10 10 day running mean boundary layer resistance s/m F
+ 943 RETRANSN plant pool of retranslocated N gN/m^2 T
+ 944 RETRANSN_TO_NPOOL deployment of retranslocated N gN/m^2/s T
+ 945 RH atmospheric relative humidity % F
+ 946 RH2M 2m relative humidity % T
+ 947 RH2M_R Rural 2m specific humidity % F
+ 948 RH2M_U Urban 2m relative humidity % F
+ 949 RH30 30-day running mean of relative humidity % F
+ 950 RHAF fractional humidity of canopy air fraction F
+ 951 RHAF10 10 day running mean of fractional humidity of canopy air fraction F
+ 952 RH_LEAF fractional humidity at leaf surface fraction F
+ 953 ROOTR effective fraction of roots in each soil layer (SMS method) proportion F
+ 954 RR root respiration (fine root MR + total root GR) gC/m^2/s T
+ 955 RRESIS root resistance in each soil layer proportion F
+ 956 RSSHA shaded leaf stomatal resistance s/m T
+ 957 RSSUN sunlit leaf stomatal resistance s/m T
+ 958 Rainf atmospheric rain, after rain/snow repartitioning based on temperature mm/s F
+ 959 Rnet net radiation W/m^2 F
+ 960 SABG solar rad absorbed by ground W/m^2 T
+ 961 SABG_PEN Rural solar rad penetrating top soil or snow layer watt/m^2 T
+ 962 SABV solar rad absorbed by veg W/m^2 T
+ 963 SEEDC pool for seeding new PFTs via dynamic landcover gC/m^2 T
+ 964 SEEDN pool for seeding new PFTs via dynamic landcover gN/m^2 T
+ 965 SLASH_HARVESTC slash harvest carbon (to litter) gC/m^2/s T
+ 966 SLO_SOMC SLO_SOM C gC/m^2 T
+ 967 SLO_SOMC_1m SLO_SOM C to 1 meter gC/m^2 F
+ 968 SLO_SOMC_TNDNCY_VERT_TRA slow soil organic ma C tendency due to vertical transport gC/m^3/s F
+ 969 SLO_SOMC_TO_ACT_SOMC decomp. of slow soil organic ma C to active soil organic C gC/m^2/s F
+ 970 SLO_SOMC_TO_ACT_SOMC_vr decomp. of slow soil organic ma C to active soil organic C gC/m^3/s F
+ 971 SLO_SOMC_TO_PAS_SOMC decomp. of slow soil organic ma C to passive soil organic C gC/m^2/s F
+ 972 SLO_SOMC_TO_PAS_SOMC_vr decomp. of slow soil organic ma C to passive soil organic C gC/m^3/s F
+ 973 SLO_SOMC_vr SLO_SOM C (vertically resolved) gC/m^3 T
+ 974 SLO_SOMN SLO_SOM N gN/m^2 T
+ 975 SLO_SOMN_1m SLO_SOM N to 1 meter gN/m^2 F
+ 976 SLO_SOMN_TNDNCY_VERT_TRA slow soil organic ma N tendency due to vertical transport gN/m^3/s F
+ 977 SLO_SOMN_TO_ACT_SOMN decomp. of slow soil organic ma N to active soil organic N gN/m^2 F
+ 978 SLO_SOMN_TO_ACT_SOMN_vr decomp. of slow soil organic ma N to active soil organic N gN/m^3 F
+ 979 SLO_SOMN_TO_PAS_SOMN decomp. of slow soil organic ma N to passive soil organic N gN/m^2 F
+ 980 SLO_SOMN_TO_PAS_SOMN_vr decomp. of slow soil organic ma N to passive soil organic N gN/m^3 F
+ 981 SLO_SOMN_vr SLO_SOM N (vertically resolved) gN/m^3 T
+ 982 SLO_SOM_HR_S1 Het. Resp. from slow soil organic ma gC/m^2/s F
+ 983 SLO_SOM_HR_S1_vr Het. Resp. from slow soil organic ma gC/m^3/s F
+ 984 SLO_SOM_HR_S3 Het. Resp. from slow soil organic ma gC/m^2/s F
+ 985 SLO_SOM_HR_S3_vr Het. Resp. from slow soil organic ma gC/m^3/s F
+ 986 SMINN soil mineral N gN/m^2 T
+ 987 SMINN_TO_NPOOL deployment of soil mineral N uptake gN/m^2/s T
+ 988 SMINN_TO_PLANT plant uptake of soil mineral N gN/m^2/s T
+ 989 SMINN_TO_PLANT_FUN Total soil N uptake of FUN gN/m^2/s T
+ 990 SMINN_TO_PLANT_vr plant uptake of soil mineral N gN/m^3/s F
+ 991 SMINN_TO_S1N_L1 mineral N flux for decomp. of MET_LITto ACT_SOM gN/m^2 F
+ 992 SMINN_TO_S1N_L1_vr mineral N flux for decomp. of MET_LITto ACT_SOM gN/m^3 F
+ 993 SMINN_TO_S1N_L2 mineral N flux for decomp. of CEL_LITto ACT_SOM gN/m^2 F
+ 994 SMINN_TO_S1N_L2_vr mineral N flux for decomp. of CEL_LITto ACT_SOM gN/m^3 F
+ 995 SMINN_TO_S1N_S2 mineral N flux for decomp. of SLO_SOMto ACT_SOM gN/m^2 F
+ 996 SMINN_TO_S1N_S2_vr mineral N flux for decomp. of SLO_SOMto ACT_SOM gN/m^3 F
+ 997 SMINN_TO_S1N_S3 mineral N flux for decomp. of PAS_SOMto ACT_SOM gN/m^2 F
+ 998 SMINN_TO_S1N_S3_vr mineral N flux for decomp. of PAS_SOMto ACT_SOM gN/m^3 F
+ 999 SMINN_TO_S2N_L3 mineral N flux for decomp. of LIG_LITto SLO_SOM gN/m^2 F
+1000 SMINN_TO_S2N_L3_vr mineral N flux for decomp. of LIG_LITto SLO_SOM gN/m^3 F
+1001 SMINN_TO_S2N_S1 mineral N flux for decomp. of ACT_SOMto SLO_SOM gN/m^2 F
+1002 SMINN_TO_S2N_S1_vr mineral N flux for decomp. of ACT_SOMto SLO_SOM gN/m^3 F
+1003 SMINN_TO_S3N_S1 mineral N flux for decomp. of ACT_SOMto PAS_SOM gN/m^2 F
+1004 SMINN_TO_S3N_S1_vr mineral N flux for decomp. of ACT_SOMto PAS_SOM gN/m^3 F
+1005 SMINN_TO_S3N_S2 mineral N flux for decomp. of SLO_SOMto PAS_SOM gN/m^2 F
+1006 SMINN_TO_S3N_S2_vr mineral N flux for decomp. of SLO_SOMto PAS_SOM gN/m^3 F
+1007 SMINN_vr soil mineral N gN/m^3 T
+1008 SMIN_NH4 soil mineral NH4 gN/m^2 T
+1009 SMIN_NH4_TO_PLANT plant uptake of NH4 gN/m^3/s F
+1010 SMIN_NH4_vr soil mineral NH4 (vert. res.) gN/m^3 T
+1011 SMIN_NO3 soil mineral NO3 gN/m^2 T
+1012 SMIN_NO3_LEACHED soil NO3 pool loss to leaching gN/m^2/s T
+1013 SMIN_NO3_LEACHED_vr soil NO3 pool loss to leaching gN/m^3/s F
+1014 SMIN_NO3_MASSDENS SMIN_NO3_MASSDENS ugN/cm^3 soil F
+1015 SMIN_NO3_RUNOFF soil NO3 pool loss to runoff gN/m^2/s T
+1016 SMIN_NO3_RUNOFF_vr soil NO3 pool loss to runoff gN/m^3/s F
+1017 SMIN_NO3_TO_PLANT plant uptake of NO3 gN/m^3/s F
+1018 SMIN_NO3_vr soil mineral NO3 (vert. res.) gN/m^3 T
+1019 SMP soil matric potential (natural vegetated and crop landunits only) mm T
+1020 SNOBCMCL mass of BC in snow column kg/m2 T
+1021 SNOBCMSL mass of BC in top snow layer kg/m2 T
+1022 SNOCAN intercepted snow mm T
+1023 SNODSTMCL mass of dust in snow column kg/m2 T
+1024 SNODSTMSL mass of dust in top snow layer kg/m2 T
+1025 SNOFSDSND direct nir incident solar radiation on snow W/m^2 F
+1026 SNOFSDSNI diffuse nir incident solar radiation on snow W/m^2 F
+1027 SNOFSDSVD direct vis incident solar radiation on snow W/m^2 F
+1028 SNOFSDSVI diffuse vis incident solar radiation on snow W/m^2 F
+1029 SNOFSRND direct nir reflected solar radiation from snow W/m^2 T
+1030 SNOFSRNI diffuse nir reflected solar radiation from snow W/m^2 T
+1031 SNOFSRVD direct vis reflected solar radiation from snow W/m^2 T
+1032 SNOFSRVI diffuse vis reflected solar radiation from snow W/m^2 T
+1033 SNOINTABS Fraction of incoming solar absorbed by lower snow layers - T
+1034 SNOLIQFL top snow layer liquid water fraction (land) fraction F
+1035 SNOOCMCL mass of OC in snow column kg/m2 T
+1036 SNOOCMSL mass of OC in top snow layer kg/m2 T
+1037 SNORDSL top snow layer effective grain radius m^-6 F
+1038 SNOTTOPL snow temperature (top layer) K F
+1039 SNOTTOPL_ICE snow temperature (top layer, ice landunits only) K F
+1040 SNOTXMASS snow temperature times layer mass, layer sum; to get mass-weighted temperature, divide by (SNO K kg/m2 T
+1041 SNOTXMASS_ICE snow temperature times layer mass, layer sum (ice landunits only); to get mass-weighted temper K kg/m2 F
+1042 SNOW atmospheric snow, after rain/snow repartitioning based on temperature mm/s T
+1043 SNOWDP gridcell mean snow height m T
+1044 SNOWICE snow ice kg/m2 T
+1045 SNOWICE_ICE snow ice (ice landunits only) kg/m2 F
+1046 SNOWLIQ snow liquid water kg/m2 T
+1047 SNOWLIQ_ICE snow liquid water (ice landunits only) kg/m2 F
+1048 SNOW_5D 5day snow avg m F
+1049 SNOW_DEPTH snow height of snow covered area m T
+1050 SNOW_DEPTH_ICE snow height of snow covered area (ice landunits only) m F
+1051 SNOW_FROM_ATM atmospheric snow received from atmosphere (pre-repartitioning) mm/s T
+1052 SNOW_ICE atmospheric snow, after rain/snow repartitioning based on temperature (ice landunits only) mm/s F
+1053 SNOW_PERSISTENCE Length of time of continuous snow cover (nat. veg. landunits only) seconds T
+1054 SNOW_SINKS snow sinks (liquid water) mm/s T
+1055 SNOW_SOURCES snow sources (liquid water) mm/s T
+1056 SNO_ABS Absorbed solar radiation in each snow layer W/m^2 F
+1057 SNO_ABS_ICE Absorbed solar radiation in each snow layer (ice landunits only) W/m^2 F
+1058 SNO_BW Partial density of water in the snow pack (ice + liquid) kg/m3 F
+1059 SNO_BW_ICE Partial density of water in the snow pack (ice + liquid, ice landunits only) kg/m3 F
+1060 SNO_EXISTENCE Fraction of averaging period for which each snow layer existed unitless F
+1061 SNO_FRZ snow freezing rate in each snow layer kg/m2/s F
+1062 SNO_FRZ_ICE snow freezing rate in each snow layer (ice landunits only) mm/s F
+1063 SNO_GS Mean snow grain size Microns F
+1064 SNO_GS_ICE Mean snow grain size (ice landunits only) Microns F
+1065 SNO_ICE Snow ice content kg/m2 F
+1066 SNO_LIQH2O Snow liquid water content kg/m2 F
+1067 SNO_MELT snow melt rate in each snow layer mm/s F
+1068 SNO_MELT_ICE snow melt rate in each snow layer (ice landunits only) mm/s F
+1069 SNO_T Snow temperatures K F
+1070 SNO_TK Thermal conductivity W/m-K F
+1071 SNO_TK_ICE Thermal conductivity (ice landunits only) W/m-K F
+1072 SNO_T_ICE Snow temperatures (ice landunits only) K F
+1073 SNO_Z Snow layer thicknesses m F
+1074 SNO_Z_ICE Snow layer thicknesses (ice landunits only) m F
+1075 SNOdTdzL top snow layer temperature gradient (land) K/m F
+1076 SOIL10 10-day running mean of 12cm layer soil K F
+1077 SOILC_CHANGE C change in soil gC/m^2/s T
+1078 SOILC_HR soil C heterotrophic respiration gC/m^2/s T
+1079 SOILC_vr SOIL C (vertically resolved) gC/m^3 T
+1080 SOILICE soil ice (natural vegetated and crop landunits only) kg/m2 T
+1081 SOILLIQ soil liquid water (natural vegetated and crop landunits only) kg/m2 T
+1082 SOILN_vr SOIL N (vertically resolved) gN/m^3 T
+1083 SOILPSI soil water potential in each soil layer MPa F
+1084 SOILRESIS soil resistance to evaporation s/m T
+1085 SOILWATER_10CM soil liquid water + ice in top 10cm of soil (veg landunits only) kg/m2 T
+1086 SOMC_FIRE C loss due to peat burning gC/m^2/s T
+1087 SOMFIRE soil organic matter fire losses gC/m^2/s F
+1088 SOM_ADV_COEF advection term for vertical SOM translocation m/s F
+1089 SOM_C_LEACHED total flux of C from SOM pools due to leaching gC/m^2/s T
+1090 SOM_DIFFUS_COEF diffusion coefficient for vertical SOM translocation m^2/s F
+1091 SOM_N_LEACHED total flux of N from SOM pools due to leaching gN/m^2/s F
+1092 SR total soil respiration (HR + root resp) gC/m^2/s T
+1093 SSRE_FSR surface snow effect on reflected solar radiation W/m^2 T
+1094 SSRE_FSRND surface snow effect on direct nir reflected solar radiation W/m^2 T
+1095 SSRE_FSRNDLN surface snow effect on direct nir reflected solar radiation at local noon W/m^2 T
+1096 SSRE_FSRNI surface snow effect on diffuse nir reflected solar radiation W/m^2 T
+1097 SSRE_FSRVD surface snow radiatve effect on direct vis reflected solar radiation W/m^2 T
+1098 SSRE_FSRVDLN surface snow radiatve effect on direct vis reflected solar radiation at local noon W/m^2 T
+1099 SSRE_FSRVI surface snow radiatve effect on diffuse vis reflected solar radiation W/m^2 T
+1100 STEM_PROF profile for litter C and N inputs from stems 1/m F
+1101 STORAGE_CDEMAND C use from the C storage pool gC/m^2 F
+1102 STORAGE_GR growth resp for growth sent to storage for later display gC/m^2/s F
+1103 STORAGE_NDEMAND N demand during the offset period gN/m^2 F
+1104 STORVEGC stored vegetation carbon, excluding cpool gC/m^2 T
+1105 STORVEGN stored vegetation nitrogen gN/m^2 T
+1106 SUPPLEMENT_TO_SMINN supplemental N supply gN/m^2/s T
+1107 SUPPLEMENT_TO_SMINN_vr supplemental N supply gN/m^3/s F
+1108 SWBGT 2 m Simplified Wetbulb Globe Temp C T
+1109 SWBGT_R Rural 2 m Simplified Wetbulb Globe Temp C T
+1110 SWBGT_U Urban 2 m Simplified Wetbulb Globe Temp C T
+1111 SWMP65 2 m Swamp Cooler Temp 65% Eff C T
+1112 SWMP65_R Rural 2 m Swamp Cooler Temp 65% Eff C T
+1113 SWMP65_U Urban 2 m Swamp Cooler Temp 65% Eff C T
+1114 SWMP80 2 m Swamp Cooler Temp 80% Eff C T
+1115 SWMP80_R Rural 2 m Swamp Cooler Temp 80% Eff C T
+1116 SWMP80_U Urban 2 m Swamp Cooler Temp 80% Eff C T
+1117 SWdown atmospheric incident solar radiation W/m^2 F
+1118 SWup upwelling shortwave radiation W/m^2 F
+1119 SoilAlpha factor limiting ground evap unitless F
+1120 SoilAlpha_U urban factor limiting ground evap unitless F
+1121 T10 10-day running mean of 2-m temperature K F
+1122 TAF canopy air temperature K F
+1123 TAUX zonal surface stress kg/m/s^2 T
+1124 TAUY meridional surface stress kg/m/s^2 T
+1125 TBOT atmospheric air temperature (downscaled to columns in glacier regions) K T
+1126 TBUILD internal urban building air temperature K T
+1127 TBUILD_MAX prescribed maximum interior building temperature K F
+1128 TEMPAVG_T2M temporary average 2m air temperature K F
+1129 TEMPMAX_RETRANSN temporary annual max of retranslocated N pool gN/m^2 F
+1130 TEMPSUM_POTENTIAL_GPP temporary annual sum of potential GPP gC/m^2/yr F
+1131 TEQ 2 m Equiv Temp K T
+1132 TEQ_R Rural 2 m Equiv Temp K T
+1133 TEQ_U Urban 2 m Equiv Temp K T
+1134 TFLOOR floor temperature K F
+1135 TG ground temperature K T
+1136 TG_ICE ground temperature (ice landunits only) K F
+1137 TG_R Rural ground temperature K F
+1138 TG_U Urban ground temperature K F
+1139 TH2OSFC surface water temperature K T
+1140 THBOT atmospheric air potential temperature (downscaled to columns in glacier regions) K T
+1141 THIC 2 m Temp Hum Index Comfort C T
+1142 THIC_R Rural 2 m Temp Hum Index Comfort C T
+1143 THIC_U Urban 2 m Temp Hum Index Comfort C T
+1144 THIP 2 m Temp Hum Index Physiology C T
+1145 THIP_R Rural 2 m Temp Hum Index Physiology C T
+1146 THIP_U Urban 2 m Temp Hum Index Physiology C T
+1147 TKE1 top lake level eddy thermal conductivity W/(mK) T
+1148 TLAI total projected leaf area index m^2/m^2 T
+1149 TLAKE lake temperature K T
+1150 TOPO_COL column-level topographic height m F
+1151 TOPO_COL_ICE column-level topographic height (ice landunits only) m F
+1152 TOPO_FORC topograephic height sent to GLC m F
+1153 TOPT topt coefficient for VOC calc non F
+1154 TOTCOLC total column carbon, incl veg and cpool but excl product pools gC/m^2 T
+1155 TOTCOLCH4 total belowground CH4 (0 for non-lake special landunits in the absence of dynamic landunits) gC/m2 T
+1156 TOTCOLN total column-level N, excluding product pools gN/m^2 T
+1157 TOTECOSYSC total ecosystem carbon, incl veg but excl cpool and product pools gC/m^2 T
+1158 TOTECOSYSN total ecosystem N, excluding product pools gN/m^2 T
+1159 TOTFIRE total ecosystem fire losses gC/m^2/s F
+1160 TOTLITC total litter carbon gC/m^2 T
+1161 TOTLITC_1m total litter carbon to 1 meter depth gC/m^2 T
+1162 TOTLITN total litter N gN/m^2 T
+1163 TOTLITN_1m total litter N to 1 meter gN/m^2 T
+1164 TOTPFTC total patch-level carbon, including cpool gC/m^2 T
+1165 TOTPFTN total patch-level nitrogen gN/m^2 T
+1166 TOTSOILICE vertically summed soil cie (veg landunits only) kg/m2 T
+1167 TOTSOILLIQ vertically summed soil liquid water (veg landunits only) kg/m2 T
+1168 TOTSOMC total soil organic matter carbon gC/m^2 T
+1169 TOTSOMC_1m total soil organic matter carbon to 1 meter depth gC/m^2 T
+1170 TOTSOMN total soil organic matter N gN/m^2 T
+1171 TOTSOMN_1m total soil organic matter N to 1 meter gN/m^2 T
+1172 TOTVEGC total vegetation carbon, excluding cpool gC/m^2 T
+1173 TOTVEGN total vegetation nitrogen gN/m^2 T
+1174 TOT_WOODPRODC total wood product C gC/m^2 T
+1175 TOT_WOODPRODC_LOSS total loss from wood product pools gC/m^2/s T
+1176 TOT_WOODPRODN total wood product N gN/m^2 T
+1177 TOT_WOODPRODN_LOSS total loss from wood product pools gN/m^2/s T
+1178 TPU25T canopy profile of tpu umol/m2/s T
+1179 TRAFFICFLUX sensible heat flux from urban traffic W/m^2 F
+1180 TRANSFER_DEADCROOT_GR dead coarse root growth respiration from storage gC/m^2/s F
+1181 TRANSFER_DEADSTEM_GR dead stem growth respiration from storage gC/m^2/s F
+1182 TRANSFER_FROOT_GR fine root growth respiration from storage gC/m^2/s F
+1183 TRANSFER_GR growth resp for transfer growth displayed in this timestep gC/m^2/s F
+1184 TRANSFER_LEAF_GR leaf growth respiration from storage gC/m^2/s F
+1185 TRANSFER_LIVECROOT_GR live coarse root growth respiration from storage gC/m^2/s F
+1186 TRANSFER_LIVESTEM_GR live stem growth respiration from storage gC/m^2/s F
+1187 TREFMNAV daily minimum of average 2-m temperature K T
+1188 TREFMNAV_R Rural daily minimum of average 2-m temperature K F
+1189 TREFMNAV_U Urban daily minimum of average 2-m temperature K F
+1190 TREFMXAV daily maximum of average 2-m temperature K T
+1191 TREFMXAV_R Rural daily maximum of average 2-m temperature K F
+1192 TREFMXAV_U Urban daily maximum of average 2-m temperature K F
+1193 TROOF_INNER roof inside surface temperature K F
+1194 TSA 2m air temperature K T
+1195 TSAI total projected stem area index m^2/m^2 T
+1196 TSA_ICE 2m air temperature (ice landunits only) K F
+1197 TSA_R Rural 2m air temperature K F
+1198 TSA_U Urban 2m air temperature K F
+1199 TSHDW_INNER shadewall inside surface temperature K F
+1200 TSKIN skin temperature K T
+1201 TSL temperature of near-surface soil layer (natural vegetated and crop landunits only) K T
+1202 TSOI soil temperature (natural vegetated and crop landunits only) K T
+1203 TSOI_10CM soil temperature in top 10cm of soil K T
+1204 TSOI_ICE soil temperature (ice landunits only) K T
+1205 TSRF_FORC surface temperature sent to GLC K F
+1206 TSUNW_INNER sunwall inside surface temperature K F
+1207 TV vegetation temperature K T
+1208 TV24 vegetation temperature (last 24hrs) K F
+1209 TV240 vegetation temperature (last 240hrs) K F
+1210 TVEGD10 10 day running mean of patch daytime vegetation temperature Kelvin F
+1211 TVEGN10 10 day running mean of patch night-time vegetation temperature Kelvin F
+1212 TWS total water storage mm T
+1213 T_SCALAR temperature inhibition of decomposition unitless T
+1214 Tair atmospheric air temperature (downscaled to columns in glacier regions) K F
+1215 Tair_from_atm atmospheric air temperature received from atmosphere (pre-downscaling) K F
+1216 U10 10-m wind m/s T
+1217 U10_DUST 10-m wind for dust model m/s T
+1218 U10_ICE 10-m wind (ice landunits only) m/s F
+1219 UAF canopy air speed m/s F
+1220 ULRAD upward longwave radiation above the canopy W/m^2 F
+1221 UM wind speed plus stability effect m/s F
+1222 URBAN_AC urban air conditioning flux W/m^2 T
+1223 URBAN_HEAT urban heating flux W/m^2 T
+1224 USTAR aerodynamical resistance s/m F
+1225 UST_LAKE friction velocity (lakes only) m/s F
+1226 VA atmospheric wind speed plus convective velocity m/s F
+1227 VCMX25T canopy profile of vcmax25 umol/m2/s T
+1228 VEGWP vegetation water matric potential for sun/sha canopy,xyl,root segments mm T
+1229 VEGWPLN vegetation water matric potential for sun/sha canopy,xyl,root at local noon mm T
+1230 VEGWPPD predawn vegetation water matric potential for sun/sha canopy,xyl,root mm T
+1231 VOCFLXT total VOC flux into atmosphere moles/m2/sec F
+1232 VOLR river channel total water storage m3 T
+1233 VOLRMCH river channel main channel water storage m3 T
+1234 VPD vpd Pa F
+1235 VPD_CAN canopy vapor pressure deficit kPa T
+1236 Vcmx25Z canopy profile of vcmax25 predicted by LUNA model umol/m2/s T
+1237 WASTEHEAT sensible heat flux from heating/cooling sources of urban waste heat W/m^2 T
+1238 WBA 2 m Wet Bulb C T
+1239 WBA_R Rural 2 m Wet Bulb C T
+1240 WBA_U Urban 2 m Wet Bulb C T
+1241 WBT 2 m Stull Wet Bulb C T
+1242 WBT_R Rural 2 m Stull Wet Bulb C T
+1243 WBT_U Urban 2 m Stull Wet Bulb C T
+1244 WF soil water as frac. of whc for top 0.05 m proportion F
+1245 WFPS WFPS percent F
+1246 WIND atmospheric wind velocity magnitude m/s T
+1247 WOODC wood C gC/m^2 T
+1248 WOODC_ALLOC wood C eallocation gC/m^2/s T
+1249 WOODC_LOSS wood C loss gC/m^2/s T
+1250 WOOD_HARVESTC wood harvest carbon (to product pools) gC/m^2/s T
+1251 WOOD_HARVESTN wood harvest N (to product pools) gN/m^2/s T
+1252 WTGQ surface tracer conductance m/s T
+1253 W_SCALAR Moisture (dryness) inhibition of decomposition unitless T
+1254 Wind atmospheric wind velocity magnitude m/s F
+1255 XSMRPOOL temporary photosynthate C pool gC/m^2 T
+1256 XSMRPOOL_LOSS temporary photosynthate C pool loss gC/m^2 F
+1257 XSMRPOOL_RECOVER C flux assigned to recovery of negative xsmrpool gC/m^2/s T
+1258 Z0HG roughness length over ground, sensible heat m F
+1259 Z0HV roughness length over vegetation, sensible heat m F
+1260 Z0M momentum roughness length m F
+1261 Z0MG roughness length over ground, momentum m F
+1262 Z0MV roughness length over vegetation, momentum m F
+1263 Z0M_TO_COUPLER roughness length, momentum: gridcell average sent to coupler m F
+1264 Z0QG roughness length over ground, latent heat m F
+1265 Z0QV roughness length over vegetation, latent heat m F
+1266 ZBOT atmospheric reference height m T
+1267 ZETA dimensionless stability parameter unitless F
+1268 ZII convective boundary height m F
+1269 ZWT water table depth (natural vegetated and crop landunits only) m T
+1270 ZWT_CH4_UNSAT depth of water table for methane production used in non-inundated area m T
+1271 ZWT_PERCH perched water table depth (natural vegetated and crop landunits only) m T
+1272 anaerobic_frac anaerobic_frac m3/m3 F
+1273 bsw clap and hornberger B unitless F
+1274 currentPatch currentPatch coefficient for VOC calc non F
+1275 diffus diffusivity m^2/s F
+1276 fr_WFPS fr_WFPS fraction F
+1277 n2_n2o_ratio_denit n2_n2o_ratio_denit gN/gN F
+1278 num_iter number of iterations unitless F
+1279 r_psi r_psi m F
+1280 ratio_k1 ratio_k1 none F
+1281 ratio_no3_co2 ratio_no3_co2 ratio F
+1282 soil_bulkdensity soil_bulkdensity kg/m3 F
+1283 soil_co2_prod soil_co2_prod ug C / g soil / day F
+1284 watfc water field capacity m^3/m^3 F
+1285 watsat water saturated m^3/m^3 F
==== =================================== ============================================================================================== ================================================================= =======
diff --git a/lilac/bld_templates/lilac_in_template b/lilac/bld_templates/lilac_in_template
index 78a8ab75cf..1543ed2a0e 100644
--- a/lilac/bld_templates/lilac_in_template
+++ b/lilac/bld_templates/lilac_in_template
@@ -14,6 +14,7 @@
/
&atmaero_stream
stream_fldfilename='$INPUTDATA/atm/cam/chem/trop_mozart_aero/aero/aerosoldep_WACCM.ensmean_monthly_hist_1849-2015_0.9x1.25_CMIP6_c180926.nc'
+ stream_meshfile = '$INPUTDATA/share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc'
stream_year_first = 2000
stream_year_last = 2000
/
diff --git a/lilac/src/lilac_atmaero.F90 b/lilac/src/lilac_atmaero.F90
index f9098f4a89..8832c78417 100644
--- a/lilac/src/lilac_atmaero.F90
+++ b/lilac/src/lilac_atmaero.F90
@@ -14,25 +14,16 @@ module lilac_atmaero
use shr_nl_mod , only : shr_nl_find_group_name
use shr_log_mod , only : shr_log_errMsg
use shr_mpi_mod , only : shr_mpi_bcast
- use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create
- use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance
- use shr_string_mod , only : shr_string_listAppend
use shr_cal_mod , only : shr_cal_ymd2date
- use shr_pio_mod , only : shr_pio_getiotype
- use mct_mod , only : mct_avect_indexra, mct_gsmap, mct_ggrid
- use mct_mod , only : mct_gsmap_init, mct_gsmap_orderedpoints
- use mct_mod , only : mct_ggrid_init, mct_ggrid_importIAttr, mct_ggrid_importRattr
- ! ctsm uses
- use ncdio_pio , only : pio_subsystem
- use domainMod , only : ldomain
- use clm_time_manager , only : get_calendar
+ ! cdeps uses
+ use dshr_methods_mod , only : dshr_fldbun_getfldptr
+ use dshr_strdata_mod , only : shr_strdata_type, shr_strdata_init_from_inline, shr_strdata_advance
! lilac uses
- use lilac_atmcap , only : gindex_atm
use lilac_methods , only : chkerr
use lilac_methods , only : lilac_methods_FB_getFieldN
- use lilac_constants , only : field_index_unset
+ use lilac_constants , only : field_index_unset, logunit
use ctsm_LilacCouplingFields, only : a2l_fields, lilac_atm2lnd
use ctsm_LilacCouplingFieldIndices
@@ -44,8 +35,8 @@ module lilac_atmaero
integer :: field_index = field_index_unset
end type field_mapping_type
- public :: lilac_atmaero_init ! initialize stream data type sdat
- public :: lilac_atmaero_interp ! interpolates between two years of ndep file data
+ public :: lilac_atmaero_init ! initialize stream data type sdat
+ public :: lilac_atmaero_interp ! interpolates between two years of ndep file data
! module data
type(shr_strdata_type) :: sdat ! input data stream
@@ -63,7 +54,7 @@ module lilac_atmaero
contains
!==============================================================================
- subroutine lilac_atmaero_init(atm2cpl_state, rc)
+ subroutine lilac_atmaero_init(atm2cpl_state, lilac_clock, rc)
! ----------------------------------------
! Initialize data stream information.
@@ -71,45 +62,35 @@ subroutine lilac_atmaero_init(atm2cpl_state, rc)
! input/output variables
type(ESMF_State) , intent(inout) :: atm2cpl_state
+ type(ESMF_Clock) , intent(inout) :: lilac_clock
integer , intent(out) :: rc
! local variables
type(ESMF_VM) :: vm
- type(ESMF_Mesh) :: lmesh
+ type(ESMF_Mesh) :: mesh
type(ESMF_FieldBundle) :: lfieldbundle
type(ESMF_Field) :: lfield
- type(mct_ggrid) :: ggrid_atm ! domain information
- type(mct_gsmap) :: gsmap_atm ! decompositoin info
+ integer :: mytask ! mpi task number
+ integer :: mpicom ! mpi communicator
+ integer :: n, nfld ! indices
+ integer :: field_index ! field index
+ integer :: nunit ! namelist input unit
+ integer :: ierr ! namelist i/o error flag
+ character(len=cl) :: stream_fldfilename ! name of input stream datafile
+ character(len=cl) :: stream_meshfile ! name of input stream meshfile
+ character(len=CL) :: mapalgo = 'bilinear' ! type of 2d mapping
+ character(len=CS) :: taxmode = 'extend' ! time extrapolation
+ integer :: stream_year_first ! first year in stream to use
+ integer :: stream_year_last ! last year in stream to use
+ integer :: model_year_align ! align stream_year_first with model year
type(field_mapping_type), allocatable :: all_fields(:) ! all fields that can possibly be read from data
- integer :: mytask ! mpi task number
- integer :: mpicom ! mpi communicator
- integer :: n ! index
- integer :: field_index
- integer :: lsize ! local size
- integer :: gsize ! global size
- integer :: nunit ! namelist input unit
- integer :: ierr ! namelist i/o error flag
- character(len=cl) :: stream_fldfilename ! name of input stream file
- character(len=CL) :: mapalgo = 'bilinear' ! type of 2d mapping
- character(len=CS) :: taxmode = 'extend' ! time extrapolation
- character(len=CL) :: fldlistFile ! name of fields in input stream file
- character(len=CL) :: fldlistModel ! name of fields in model
- integer :: stream_year_first ! first year in stream to use
- integer :: stream_year_last ! last year in stream to use
- integer :: model_year_align ! align stream_year_first with model year
- integer :: spatialDim
- integer :: numOwnedElements
- real(r8), pointer :: ownedElemCoords(:)
- real(r8), pointer :: mesh_lons(:)
- real(r8), pointer :: mesh_lats(:)
- real(r8), pointer :: mesh_areas(:)
- real(r8), pointer :: rdata(:)
- integer , pointer :: idata(:)
+ character(len=CS), allocatable :: fldlistFile(:)
+ character(len=CS), allocatable :: fldlistModel(:)
!-----------------------------------------------------------------------
namelist /atmaero_stream/ &
stream_year_first, stream_year_last, model_year_align, &
- stream_fldfilename
+ stream_fldfilename, stream_meshfile
rc = ESMF_SUCCESS
@@ -129,29 +110,40 @@ subroutine lilac_atmaero_init(atm2cpl_state, rc)
field_mapping_type('DSTX04WD', lilac_a2l_Faxa_dstwet4), &
field_mapping_type('DSTX04DD', lilac_a2l_Faxa_dstdry4)]
- num_fields_to_read = 0
- allocate(fields_to_read(size(all_fields)))
- fldlistFile = ' '
- fldlistModel = ' '
+ nfld = 0
do n = 1, size(all_fields)
field_index = all_fields(n)%field_index
if (a2l_fields%is_needed_from_data(field_index)) then
- num_fields_to_read = num_fields_to_read + 1
- fields_to_read(num_fields_to_read) = all_fields(n)
- call shr_string_listAppend(fldlistFile, fields_to_read(num_fields_to_read)%field_name)
- call shr_string_listAppend(fldlistModel, a2l_fields%get_fieldname(field_index))
+ nfld = nfld + 1
end if
end do
+ num_fields_to_read = nfld
+
if (num_fields_to_read == 0) then
return
end if
+ allocate(fields_to_read(num_fields_to_read))
+ allocate(fldlistFile(num_fields_to_read))
+ allocate(fldlistModel(num_fields_to_read))
+ nfld = 0
+ do n = 1, size(all_fields)
+ field_index = all_fields(n)%field_index
+ if (a2l_fields%is_needed_from_data(field_index)) then
+ nfld = nfld + 1
+ fields_to_read(nfld) = all_fields(n)
+ fldListFile(nfld) = trim(fields_to_read(nfld)%field_name)
+ fldListModel(nfld) = trim(a2l_fields%get_fieldname(field_index))
+ end if
+ end do
+
! default values for namelist
stream_year_first = 1 ! first year in stream to use
stream_year_last = 1 ! last year in stream to use
model_year_align = 1 ! align stream_year_first with this model year
stream_fldFileName = ' '
+ stream_meshfile = ' '
! get mytask and mpicom
call ESMF_VMGetCurrent(vm, rc=rc)
@@ -177,107 +169,57 @@ subroutine lilac_atmaero_init(atm2cpl_state, rc)
call shr_mpi_bcast(stream_year_last , mpicom)
call shr_mpi_bcast(model_year_align , mpicom)
call shr_mpi_bcast(stream_fldfilename, mpicom)
+ call shr_mpi_bcast(stream_meshfile , mpicom)
if (mytask == 0) then
print *, ' '
- print *, 'atmaero stream settings:'
- print *, ' stream_year_first = ',stream_year_first
- print *, ' stream_year_last = ',stream_year_last
- print *, ' model_year_align = ',model_year_align
- print *, ' stream_fldFileName = ',stream_fldFileName
+ write(logunit,'(a)') 'atmaero stream settings:'
+ write(logunit,'(a,i8)')' stream_year_first = ',stream_year_first
+ write(logunit,'(a,i8)')' stream_year_last = ',stream_year_last
+ write(logunit,'(a,i8)')' model_year_align = ',model_year_align
+ write(logunit,'(a)' )' stream_fldFileName = ',trim(stream_fldFileName)
+ write(logunit,'(a)' )' stream_meshfile = ',trim(stream_meshfile)
print *, ' '
endif
! ------------------------------
- ! create the mct gsmap
- ! ------------------------------
- lsize = size(gindex_atm)
- gsize = ldomain%ni * ldomain%nj
- call mct_gsmap_init( gsmap_atm, gindex_atm, mpicom, 1, lsize, gsize )
-
- ! ------------------------------
- ! obtain mesh lats, lons and areas
+ ! obtain atm mesh
! ------------------------------
call ESMF_StateGet(atm2cpl_state, 'a2c_fb', lfieldbundle, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
-
call lilac_methods_FB_getFieldN(lfieldbundle, fieldnum=1, field=lfield, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
-
- call ESMF_FieldGet(lfield, mesh=lmesh, rc=rc)
+ call ESMF_FieldGet(lfield, mesh=mesh, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
- call ESMF_MeshGet(lmesh, spatialDim=spatialDim, numOwnedElements=numOwnedElements, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
-
- if (numOwnedElements /= lsize) then
- call shr_sys_abort('ERROR: numOwnedElements is not equal to lsize')
- end if
- allocate(ownedElemCoords(spatialDim*numOwnedElements))
-
- call ESMF_MeshGet(lmesh, ownedElemCoords=ownedElemCoords, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
-
- allocate(mesh_lons(numOwnedElements))
- allocate(mesh_lats(numOwnedElements))
- allocate(mesh_areas(numOwnedElements))
- do n = 1,numOwnedElements
- mesh_lons(n) = ownedElemCoords(2*n-1)
- mesh_lats(n) = ownedElemCoords(2*n)
- mesh_areas(n) = 1.e36 ! hard-wire for now for testing
- end do
-
- ! ------------------------------
- ! create the mct ggrid
- ! ------------------------------
- call mct_ggrid_init( ggrid=ggrid_atm, CoordChars='lat:lon:hgt', OtherChars='area:aream:mask:frac', lsize=lsize)
- call mct_gsmap_orderedpoints(gsmap_atm, mytask, idata)
- call mct_gGrid_importIAttr(ggrid_atm,'GlobGridNum', idata, lsize)
- call mct_gGrid_importRattr(ggrid_atm,"lon" , mesh_lons , lsize)
- call mct_gGrid_importRattr(ggrid_atm,"lat" , mesh_lats , lsize)
- call mct_gGrid_importRattr(ggrid_atm,"area", mesh_areas, lsize)
- allocate(rdata(lsize))
- rdata(:) = 1._R8
- call mct_gGrid_importRattr(ggrid_atm,"mask", rdata, lsize)
- deallocate(mesh_lons, mesh_lats, mesh_areas, rdata)
-
! ------------------------------
! create the stream data sdat
! ------------------------------
- call shr_strdata_create(sdat,&
- name = "atmaero", &
- pio_subsystem = pio_subsystem, &
- pio_iotype = shr_pio_getiotype(compid= 1), &
- mpicom = mpicom, &
- compid = 1, &
- gsmap = gsmap_atm, &
- ggrid = ggrid_atm, &
- nxg = ldomain%ni, &
- nyg = ldomain%nj, &
- yearFirst = stream_year_first, &
- yearLast = stream_year_last, &
- yearAlign = model_year_align, &
- offset = 0, &
- domFilePath = '', &
- domfilename = trim(stream_fldfilename), &
- domTvarName = 'time', &
- domXvarName = 'lon' , &
- domYvarName = 'lat' , &
- domAreaName = 'area', &
- domMaskName = 'mask', &
- filePath = '', &
- filename = (/trim(stream_fldfilename)/), &
- fldListFile = trim(fldlistFile), &
- fldListModel = trim(fldlistModel), &
- fillalgo = 'none', &
- mapalgo = mapalgo, &
- calendar = get_calendar(), &
- taxmode = taxmode )
-
- if (mytask == 0) then
- call shr_strdata_print(sdat,'ATMAERO data')
- endif
+ call shr_strdata_init_from_inline(sdat, &
+ my_task = mytask, &
+ logunit = logunit, &
+ compname = 'LND', &
+ model_clock = lilac_clock, &
+ model_mesh = mesh, &
+ stream_meshfile = trim(stream_meshfile), &
+ stream_lev_dimname = 'null', &
+ stream_mapalgo = trim(mapalgo), &
+ stream_filenames = (/trim(stream_fldfilename)/), &
+ stream_fldlistFile = fldlistFile, &
+ stream_fldListModel = fldlistModel, &
+ stream_yearFirst = stream_year_first, &
+ stream_yearLast = stream_year_last, &
+ stream_yearAlign = model_year_align, &
+ stream_offset = 0, &
+ stream_taxmode = taxmode, &
+ stream_dtlimit = 1.5_r8, &
+ stream_tintalgo = 'linear', &
+ stream_name = 'ATMAERO data ', &
+ rc = rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
end subroutine lilac_atmaero_init
@@ -290,13 +232,12 @@ subroutine lilac_atmaero_interp(clock, rc)
integer, intent(out) :: rc
! local variables
- type(ESMF_VM) :: vm
- integer :: mpicom ! mpi communicator
- integer :: mytask ! mpi task number
- type(ESMF_FieldBundle) :: lfieldbundle
- type(ESMF_Time) :: currTime
- integer :: yy, mm, dd, sec, curr_ymd
- integer :: n
+ type(ESMF_Time) :: currTime
+ integer :: yy, mm, dd, sec, curr_ymd
+ integer :: n
+ integer :: field_index
+ character(len=CS) :: stream_varname
+ real(r8), pointer :: dataptr1d(:)
character(len=*), parameter :: subname='lilac_atmaero: [lilac_atmaero_interp]'
!-----------------------------------------------------------------------
@@ -306,43 +247,32 @@ subroutine lilac_atmaero_interp(clock, rc)
return
end if
- ! get mytask and mpicom
- call ESMF_VMGetCurrent(vm, rc=rc)
- if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
- call ESMF_VMGet(vm, localPet=mytask, mpiCommunicator=mpicom, rc=rc)
- if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
-
! get current time info
call ESMF_ClockGet( clock, currTime=currTime, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
-
call ESMF_TimeGet( currTime, yy=yy, mm=mm, dd=dd, s=sec, rc=rc )
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call shr_cal_ymd2date(yy,mm,dd,curr_ymd)
! advance the streams
- call shr_strdata_advance(sdat, curr_ymd, sec, mpicom, 'atmaero')
+ call shr_strdata_advance(sdat, ymd=curr_ymd, tod=sec, logunit=logunit, istr='atmaero', rc=rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+ ! obtain the stream data
do n = 1, num_fields_to_read
- call set_field(n)
+ field_index = fields_to_read(n)%field_index
+ stream_varname = a2l_fields%get_fieldname(field_index)
+ write(6,*)'DEBUG: stream_varname = ',trim(stream_varname)
+ call dshr_fldbun_getFldPtr(sdat%pstrm(1)%fldbun_model, trim(stream_varname), fldptr1=dataptr1d, rc=rc)
+
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+ call lilac_atm2lnd(field_index, dataptr1d)
end do
end subroutine lilac_atmaero_interp
- !==============================================================================
-
- subroutine set_field(fieldnum)
-
- ! input/output data
- integer, intent(in) :: fieldnum ! index into fields_to_read and sdat (which are assumed to have the same ordering)
-
- ! local data
- integer :: field_index ! index in a2l_fields
- !-----------------------------------------------------------------------
-
- field_index = fields_to_read(fieldnum)%field_index
- call lilac_atm2lnd(field_index, sdat%avs(1)%rAttr(fieldnum,:))
-
- end subroutine set_field
-
end module lilac_atmaero
diff --git a/lilac/src/lilac_mod.F90 b/lilac/src/lilac_mod.F90
index d98e3e080c..6eb17d008c 100644
--- a/lilac/src/lilac_mod.F90
+++ b/lilac/src/lilac_mod.F90
@@ -151,7 +151,6 @@ subroutine lilac_init2(mpicom, atm_global_index, atm_lons, atm_lats, &
integer, pointer :: mycomms(:) ! for mct
integer, pointer :: myids(:) ! for mct
integer :: compids(1) = (/1/) ! for pio_init2 - array with component ids
- integer :: comms(1) ! for both mct and pio_init2 - array with mpicoms
character(len=32) :: compLabels(1) = (/'LND'/) ! for pio_init2
character(len=64) :: comp_name(1) = (/'LND'/) ! for pio_init2
logical :: comp_iamin(1) = (/.true./) ! for pio init2
@@ -485,7 +484,7 @@ subroutine lilac_init2(mpicom, atm_global_index, atm_lons, atm_lats, &
! Initialize atmaero stream data (using share strearm capability from CIME)
!-------------------------------------------------------------------------
- call lilac_atmaero_init(atm2cpl_state, rc)
+ call lilac_atmaero_init(atm2cpl_state, lilac_clock, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) call shr_sys_abort("lilac error in initializing lilac_atmaero_init")
!-------------------------------------------------------------------------
diff --git a/python/ctsm/lilac_make_runtime_inputs.py b/python/ctsm/lilac_make_runtime_inputs.py
index 2119c0e225..ff292cb660 100644
--- a/python/ctsm/lilac_make_runtime_inputs.py
+++ b/python/ctsm/lilac_make_runtime_inputs.py
@@ -233,6 +233,7 @@ def buildnml(cime_path, rundir):
# call build-namelist
cmd = os.path.abspath(os.path.join(path_to_ctsm_root(), "bld", "build-namelist"))
command = [cmd,
+ '-driver', 'nuopc',
'-cimeroot', cime_path,
'-infile', infile,
'-csmdata', inputdata_path,
diff --git a/src/biogeochem/CNC14DecayMod.F90 b/src/biogeochem/CNC14DecayMod.F90
index 435ec27519..5a172fcb6e 100644
--- a/src/biogeochem/CNC14DecayMod.F90
+++ b/src/biogeochem/CNC14DecayMod.F90
@@ -6,7 +6,7 @@ module CNC14DecayMod
! !USES:
use shr_kind_mod , only : r8 => shr_kind_r8
use clm_time_manager , only : get_step_size_real, get_days_per_year
- use clm_varpar , only : ndecomp_cascade_transitions, nlevdecomp, ndecomp_pools
+ use clm_varpar , only : nlevdecomp, ndecomp_pools
use clm_varcon , only : secspday
use clm_varctl , only : spinup_state
use decompMod , only : bounds_type
@@ -107,7 +107,7 @@ subroutine C14Decay( bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, &
spinup_term = spinup_term * get_spinup_latitude_term(grc%latdeg(col%gridcell(c)))
endif
else
- spinup_term = 1.
+ spinup_term = 1._r8
endif
decomp_cpools_vr(c,j,l) = decomp_cpools_vr(c,j,l) * (1._r8 - decay_const * spinup_term * dt)
end do
diff --git a/src/biogeochem/CNCIsoFluxMod.F90 b/src/biogeochem/CNCIsoFluxMod.F90
index 922378b01f..09702f21b5 100644
--- a/src/biogeochem/CNCIsoFluxMod.F90
+++ b/src/biogeochem/CNCIsoFluxMod.F90
@@ -8,6 +8,7 @@ module CNCIsoFluxMod
use shr_log_mod , only : errMsg => shr_log_errMsg
use clm_varpar , only : ndecomp_cascade_transitions, nlevdecomp, ndecomp_pools
use clm_varpar , only : max_patch_per_col, maxsoil_patches
+ use clm_varpar , only : i_litr_min, i_litr_max, i_met_lit
use abortutils , only : endrun
use pftconMod , only : pftcon
use CNVegCarbonStateType , only : cnveg_carbonstate_type
@@ -845,7 +846,7 @@ subroutine CIsoFlux3(num_soilc , filter_soilc, num_soilp , filter_soilp, &
character(len=*) , intent(in) :: isotope ! 'c13' or 'c14'
!
! !LOCAL VARIABLES:
- integer :: pi,pp,l,fc,cc,j
+ integer :: pi,pp,l,fc,cc,j,i
!-----------------------------------------------------------------------
associate( &
@@ -861,12 +862,8 @@ subroutine CIsoFlux3(num_soilc , filter_soilc, num_soilp , filter_soilp, &
iso_cnveg_cf => iso_cnveg_carbonflux_inst , &
iso_cnveg_cs => iso_cnveg_carbonstate_inst , &
iso_soilbiogeochem_cs => iso_soilbiogeochem_carbonstate_inst , &
- lf_flab => pftcon%lf_flab , & ! Input: [real(r8) (:) ] leaf litter labile fraction
- lf_fcel => pftcon%lf_fcel , & ! Input: [real(r8) (:) ] leaf litter cellulose fraction
- lf_flig => pftcon%lf_flig , & ! Input: [real(r8) (:) ] leaf litter lignin fraction
- fr_flab => pftcon%fr_flab , & ! Input: [real(r8) (:) ] fine root litter labile fraction
- fr_fcel => pftcon%fr_fcel , & ! Input: [real(r8) (:) ] fine root litter cellulose fraction
- fr_flig => pftcon%fr_flig & ! Input: [real(r8) (:) ] fine root litter lignin fraction
+ lf_f => pftcon%lf_f , & ! Input: [real(r8) (:,:)] leaf litter fractions
+ fr_f => pftcon%fr_f & ! Input: [real(r8) (:,:)] fine root litter fractions
)
! patch-level fire mortality fluxes
@@ -1132,13 +1129,14 @@ subroutine CIsoFlux3(num_soilc , filter_soilc, num_soilp , filter_soilp, &
pp = col%patchi(cc) + pi - 1
if (patch%active(pp)) then
do j = 1, nlevdecomp
- iso_cnveg_cf%m_c_to_litr_met_fire_col(cc,j) = iso_cnveg_cf%m_c_to_litr_met_fire_col(cc,j) + &
- ((iso_cnveg_cf%m_leafc_to_litter_fire_patch(pp)*lf_flab(ivt(pp)) &
+ iso_cnveg_cf%m_c_to_litr_fire_col(cc,j,i_met_lit) = &
+ iso_cnveg_cf%m_c_to_litr_fire_col(cc,j,i_met_lit) + &
+ ((iso_cnveg_cf%m_leafc_to_litter_fire_patch(pp) * lf_f(ivt(pp),i_met_lit) &
+iso_cnveg_cf%m_leafc_storage_to_litter_fire_patch(pp) + &
iso_cnveg_cf%m_leafc_xfer_to_litter_fire_patch(pp) + &
iso_cnveg_cf%m_gresp_storage_to_litter_fire_patch(pp) &
+iso_cnveg_cf%m_gresp_xfer_to_litter_fire_patch(pp))*leaf_prof(pp,j) + &
- (iso_cnveg_cf%m_frootc_to_litter_fire_patch(pp)*fr_flab(ivt(pp)) &
+ (iso_cnveg_cf%m_frootc_to_litter_fire_patch(pp) * fr_f(ivt(pp),i_met_lit) &
+iso_cnveg_cf%m_frootc_storage_to_litter_fire_patch(pp) + &
iso_cnveg_cf%m_frootc_xfer_to_litter_fire_patch(pp))*froot_prof(pp,j) &
+(iso_cnveg_cf%m_livestemc_storage_to_litter_fire_patch(pp) + &
@@ -1150,13 +1148,15 @@ subroutine CIsoFlux3(num_soilc , filter_soilc, num_soilp , filter_soilp, &
+iso_cnveg_cf%m_deadcrootc_storage_to_litter_fire_patch(pp) + &
iso_cnveg_cf%m_deadcrootc_xfer_to_litter_fire_patch(pp))* croot_prof(pp,j)) * patch%wtcol(pp)
- iso_cnveg_cf%m_c_to_litr_cel_fire_col(cc,j) = iso_cnveg_cf%m_c_to_litr_cel_fire_col(cc,j) + &
- (iso_cnveg_cf%m_leafc_to_litter_fire_patch(pp)*lf_fcel(ivt(pp))*leaf_prof(pp,j) + &
- iso_cnveg_cf%m_frootc_to_litter_fire_patch(pp)*fr_fcel(ivt(pp))*froot_prof(pp,j)) * patch%wtcol(pp)
-
- iso_cnveg_cf%m_c_to_litr_lig_fire_col(cc,j) = iso_cnveg_cf%m_c_to_litr_lig_fire_col(cc,j) + &
- (iso_cnveg_cf%m_leafc_to_litter_fire_patch(pp)*lf_flig(ivt(pp))*leaf_prof(pp,j) + &
- iso_cnveg_cf%m_frootc_to_litter_fire_patch(pp)*fr_flig(ivt(pp))*froot_prof(pp,j)) * patch%wtcol(pp)
+ ! Here metabolic litter is treated differently than other
+ ! types of litter, so it remains outside this litter loop,
+ ! in the line above
+ do i = i_met_lit+1, i_litr_max
+ iso_cnveg_cf%m_c_to_litr_fire_col(cc,j,i) = &
+ iso_cnveg_cf%m_c_to_litr_fire_col(cc,j,i) + &
+ (iso_cnveg_cf%m_leafc_to_litter_fire_patch(pp) * lf_f(ivt(pp),i) * leaf_prof(pp,j) + &
+ iso_cnveg_cf%m_frootc_to_litter_fire_patch(pp) * fr_f(ivt(pp),i) * froot_prof(pp,j)) * patch%wtcol(pp)
+ end do
end do
end if
end if
@@ -1188,19 +1188,15 @@ subroutine CNCIsoLitterToColumn (num_soilc, filter_soilc, &
type(cnveg_carbonflux_type) , intent(inout) :: iso_cnveg_carbonflux_inst
!
! !LOCAL VARIABLES:
- integer :: fc,c,pi,p,j
+ integer :: fc,c,pi,p,j,i
!-----------------------------------------------------------------------
associate( &
ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type
wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] weight (relative to column) for this patch (0-1)
- lf_flab => pftcon%lf_flab , & ! Input: leaf litter labile fraction
- lf_fcel => pftcon%lf_fcel , & ! Input: leaf litter cellulose fraction
- lf_flig => pftcon%lf_flig , & ! Input: leaf litter lignin fraction
- fr_flab => pftcon%fr_flab , & ! Input: fine root litter labile fraction
- fr_fcel => pftcon%fr_fcel , & ! Input: fine root litter cellulose fraction
- fr_flig => pftcon%fr_flig , & ! Input: fine root litter lignin fraction
+ lf_f => pftcon%lf_f , & ! Input: [real(r8) (:,:) ] leaf litter fractions
+ fr_f => pftcon%fr_f , & ! Input: [real(r8) (:,:) ] fine root litter fractions
leaf_prof => soilbiogeochem_state_inst%leaf_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of leaves
froot_prof => soilbiogeochem_state_inst%froot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of fine roots
@@ -1211,9 +1207,7 @@ subroutine CNCIsoLitterToColumn (num_soilc, filter_soilc, &
livestemc_to_litter => iso_cnveg_carbonflux_inst%livestemc_to_litter_patch , & ! Input: [real(r8) (:) ]
grainc_to_food => iso_cnveg_carbonflux_inst%grainc_to_food_patch , & ! Input: [real(r8) (:) ]
!DML
- phenology_c_to_litr_met_c => iso_cnveg_carbonflux_inst%phenology_c_to_litr_met_c_col , & ! InOut: [real(r8) (:,:) ] C fluxes associated with phenology (litterfall and crop) to litter metabolic pool (gC/m3/s)
- phenology_c_to_litr_cel_c => iso_cnveg_carbonflux_inst%phenology_c_to_litr_cel_c_col , & ! InOut: [real(r8) (:,:) ] C fluxes associated with phenology (litterfall and crop) to litter cellulose pool (gC/m3/s)
- phenology_c_to_litr_lig_c => iso_cnveg_carbonflux_inst%phenology_c_to_litr_lig_c_col & ! InOut: [real(r8) (:,:) ] C fluxes associated with phenology (litterfall and crop) to litter lignin pool (gC/m3/s)
+ phenology_c_to_litr_c => iso_cnveg_carbonflux_inst%phenology_c_to_litr_c_col & ! InOut: [real(r8) (:,:,:) ] C fluxes associated with phenology (litterfall and crop) to litter pools (gC/m3/s)
)
do j = 1, nlevdecomp
@@ -1224,40 +1218,31 @@ subroutine CNCIsoLitterToColumn (num_soilc, filter_soilc, &
if ( pi <= col%npatches(c) ) then
p = col%patchi(c) + pi - 1
if (patch%active(p)) then
- ! leaf litter carbon fluxes
- phenology_c_to_litr_met_c(c,j) = phenology_c_to_litr_met_c(c,j) &
- + leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- phenology_c_to_litr_cel_c(c,j) = phenology_c_to_litr_cel_c(c,j) &
- + leafc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- phenology_c_to_litr_lig_c(c,j) = phenology_c_to_litr_lig_c(c,j) &
- + leafc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j)
-
- ! fine root litter carbon fluxes
- phenology_c_to_litr_met_c(c,j) = phenology_c_to_litr_met_c(c,j) &
- + frootc_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) * froot_prof(p,j)
- phenology_c_to_litr_cel_c(c,j) = phenology_c_to_litr_cel_c(c,j) &
- + frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j)
- phenology_c_to_litr_lig_c(c,j) = phenology_c_to_litr_lig_c(c,j) &
- + frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j)
+ do i = i_litr_min, i_litr_max
+ phenology_c_to_litr_c(c,j,i) = &
+ phenology_c_to_litr_c(c,j,i) + &
+ ! leaf litter carbon fluxes
+ leafc_to_litter(p) * lf_f(ivt(p),i) * wtcol(p) * leaf_prof(p,j) + &
+ ! fine root litter carbon fluxes
+ frootc_to_litter(p) * fr_f(ivt(p),i) * wtcol(p) * froot_prof(p,j)
+ end do
!DML
if (ivt(p) >= npcropmin) then ! add livestemc to litter
! stem litter carbon fluxes
- phenology_c_to_litr_met_c(c,j) = phenology_c_to_litr_met_c(c,j) &
- + livestemc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- phenology_c_to_litr_cel_c(c,j) = phenology_c_to_litr_cel_c(c,j) &
- + livestemc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- phenology_c_to_litr_lig_c(c,j) = phenology_c_to_litr_lig_c(c,j) &
- + livestemc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j)
+ do i = i_litr_min, i_litr_max
+ phenology_c_to_litr_c(c,j,i) = &
+ phenology_c_to_litr_c(c,j,i) + &
+ livestemc_to_litter(p) * lf_f(ivt(p),i) * wtcol(p) * leaf_prof(p,j)
+ end do
if (.not. use_grainproduct) then
- ! grain litter carbon fluxes
- phenology_c_to_litr_met_c(c,j) = phenology_c_to_litr_met_c(c,j) &
- + grainc_to_food(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- phenology_c_to_litr_cel_c(c,j) = phenology_c_to_litr_cel_c(c,j) &
- + grainc_to_food(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- phenology_c_to_litr_lig_c(c,j) = phenology_c_to_litr_lig_c(c,j) &
- + grainc_to_food(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j)
+ ! grain litter carbon fluxes
+ do i = i_litr_min, i_litr_max
+ phenology_c_to_litr_c(c,j,i) = &
+ phenology_c_to_litr_c(c,j,i) + &
+ grainc_to_food(p) * lf_f(ivt(p),i) * wtcol(p) * leaf_prof(p,j)
+ end do
end if
end if
@@ -1289,19 +1274,15 @@ subroutine CNCIsoGapPftToColumn (num_soilc, filter_soilc, &
type(cnveg_carbonflux_type) , intent(inout) :: iso_cnveg_carbonflux_inst
!
! !LOCAL VARIABLES:
- integer :: fc,c,pi,p,j ! indices
+ integer :: fc,c,pi,p,j,i ! indices
!-----------------------------------------------------------------------
associate( &
ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type
wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] patch weight relative to column (0-1)
- lf_flab => pftcon%lf_flab , & ! Input: leaf litter labile fraction
- lf_fcel => pftcon%lf_fcel , & ! Input: leaf litter cellulose fraction
- lf_flig => pftcon%lf_flig , & ! Input: leaf litter lignin fraction
- fr_flab => pftcon%fr_flab , & ! Input: fine root litter labile fraction
- fr_fcel => pftcon%fr_fcel , & ! Input: fine root litter cellulose fraction
- fr_flig => pftcon%fr_flig , & ! Input: fine root litter lignin fraction
+ lf_f => pftcon%lf_f , & ! Input: leaf litter fractions
+ fr_f => pftcon%fr_f , & ! Input: fine root litter fractions
leaf_prof => soilbiogeochem_state_inst%leaf_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of leaves
froot_prof => soilbiogeochem_state_inst%froot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of fine roots
@@ -1329,9 +1310,7 @@ subroutine CNCIsoGapPftToColumn (num_soilc, filter_soilc, &
m_deadcrootc_xfer_to_litter => iso_cnveg_carbonflux_inst%m_deadcrootc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ]
m_gresp_xfer_to_litter => iso_cnveg_carbonflux_inst%m_gresp_xfer_to_litter_patch , & ! Input: [real(r8) (:) ]
- gap_mortality_c_to_litr_met_c => iso_cnveg_carbonflux_inst%gap_mortality_c_to_litr_met_c_col , & ! InOut: [real(r8) (:,:) ] C fluxes associated with gap mortality to litter metabolic pool (gC/m3/s)
- gap_mortality_c_to_litr_cel_c => iso_cnveg_carbonflux_inst%gap_mortality_c_to_litr_cel_c_col , & ! InOut: [real(r8) (:,:) ] C fluxes associated with gap mortality to litter cellulose pool (gC/m3/s)
- gap_mortality_c_to_litr_lig_c => iso_cnveg_carbonflux_inst%gap_mortality_c_to_litr_lig_c_col , & ! InOut: [real(r8) (:,:) ] C fluxes associated with gap mortality to litter lignin pool (gC/m3/s)
+ gap_mortality_c_to_litr_c => iso_cnveg_carbonflux_inst%gap_mortality_c_to_litr_c_col , & ! InOut: [real(r8) (:,:,:) ] C fluxes associated with gap mortality to litter pools (gC/m3/s)
gap_mortality_c_to_cwdc => iso_cnveg_carbonflux_inst%gap_mortality_c_to_cwdc_col & ! InOut: [real(r8) (:,:) ] C fluxes associated with gap mortality to CWD pool (gC/m3/s)
)
@@ -1345,21 +1324,16 @@ subroutine CNCIsoGapPftToColumn (num_soilc, filter_soilc, &
if (patch%active(p)) then
- ! leaf gap mortality carbon fluxes
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- gap_mortality_c_to_litr_cel_c(c,j) = gap_mortality_c_to_litr_cel_c(c,j) + &
- m_leafc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- gap_mortality_c_to_litr_lig_c(c,j) = gap_mortality_c_to_litr_lig_c(c,j) + &
- m_leafc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j)
-
- ! fine root gap mortality carbon fluxes
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_frootc_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) * froot_prof(p,j)
- gap_mortality_c_to_litr_cel_c(c,j) = gap_mortality_c_to_litr_cel_c(c,j) + &
- m_frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j)
- gap_mortality_c_to_litr_lig_c(c,j) = gap_mortality_c_to_litr_lig_c(c,j) + &
- m_frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j)
+ do i = i_litr_min, i_litr_max
+ ! leaf gap mortality carbon fluxes
+ gap_mortality_c_to_litr_c(c,j,i) = &
+ gap_mortality_c_to_litr_c(c,j,i) + &
+ m_leafc_to_litter(p) * lf_f(ivt(p),i) * wtcol(p) * leaf_prof(p,j)
+ ! fine root gap mortality carbon fluxes
+ gap_mortality_c_to_litr_c(c,j,i) = &
+ gap_mortality_c_to_litr_c(c,j,i) + &
+ m_frootc_to_litter(p) * fr_f(ivt(p),i) * wtcol(p) * froot_prof(p,j)
+ end do
! wood gap mortality carbon fluxes
gap_mortality_c_to_cwdc(c,j) = gap_mortality_c_to_cwdc(c,j) + &
@@ -1371,37 +1345,27 @@ subroutine CNCIsoGapPftToColumn (num_soilc, filter_soilc, &
gap_mortality_c_to_cwdc(c,j) = gap_mortality_c_to_cwdc(c,j) + &
m_deadcrootc_to_litter(p) * wtcol(p) * croot_prof(p,j)
- ! storage gap mortality carbon fluxes
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_leafc_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j)
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_frootc_storage_to_litter(p) * wtcol(p) * froot_prof(p,j)
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_livestemc_storage_to_litter(p) * wtcol(p) * stem_prof(p,j)
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_deadstemc_storage_to_litter(p) * wtcol(p) * stem_prof(p,j)
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_livecrootc_storage_to_litter(p) * wtcol(p) * croot_prof(p,j)
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_deadcrootc_storage_to_litter(p) * wtcol(p) * croot_prof(p,j)
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_gresp_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j)
-
- ! transfer gap mortality carbon fluxes
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_leafc_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j)
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_frootc_xfer_to_litter(p) * wtcol(p) * froot_prof(p,j)
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_livestemc_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j)
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_deadstemc_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j)
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_livecrootc_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j)
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_deadcrootc_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j)
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_gresp_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j)
+ ! Metabolic litter is treated differently than other types
+ ! of litter, so it gets this additional line after the
+ ! most recent loop over all litter types
+ gap_mortality_c_to_litr_c(c,j,i_met_lit) = &
+ gap_mortality_c_to_litr_c(c,j,i_met_lit) + &
+ ! storage gap mortality carbon fluxes
+ m_leafc_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j) + &
+ m_frootc_storage_to_litter(p) * wtcol(p) * froot_prof(p,j) + &
+ m_livestemc_storage_to_litter(p) * wtcol(p) * stem_prof(p,j) + &
+ m_deadstemc_storage_to_litter(p) * wtcol(p) * stem_prof(p,j) + &
+ m_livecrootc_storage_to_litter(p) * wtcol(p) * croot_prof(p,j) + &
+ m_deadcrootc_storage_to_litter(p) * wtcol(p) * croot_prof(p,j) + &
+ m_gresp_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j) + &
+ ! transfer gap mortality carbon fluxes
+ m_leafc_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j) + &
+ m_frootc_xfer_to_litter(p) * wtcol(p) * froot_prof(p,j) + &
+ m_livestemc_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j) + &
+ m_deadstemc_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j) + &
+ m_livecrootc_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j) + &
+ m_deadcrootc_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j) + &
+ m_gresp_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j)
end if
end if
@@ -1430,20 +1394,16 @@ subroutine CNCIsoHarvestPftToColumn (num_soilc, filter_soilc, &
type(cnveg_carbonflux_type) , intent(inout) :: iso_cnveg_carbonflux_inst
!
! !LOCAL VARIABLES:
- integer :: fc,c,pi,p,j ! indices
+ integer :: fc,c,pi,p,j,i ! indices
!-----------------------------------------------------------------------
associate( &
ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type
wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] patch weight relative to column (0-1)
- lf_flab => pftcon%lf_flab , & ! Input: leaf litter labile fraction
- lf_fcel => pftcon%lf_fcel , & ! Input: leaf litter cellulose fraction
- lf_flig => pftcon%lf_flig , & ! Input: leaf litter lignin fraction
- fr_flab => pftcon%fr_flab , & ! Input: fine root litter labile fraction
- fr_fcel => pftcon%fr_fcel , & ! Input: fine root litter cellulose fraction
- fr_flig => pftcon%fr_flig , & ! Input: fine root litter lignin fraction
-
+ lf_f => pftcon%lf_f , & ! Input: leaf litter fractions
+ fr_f => pftcon%fr_f , & ! Input: fine root litter fractions
+
leaf_prof => soilbiogeochem_state_inst%leaf_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of leaves
froot_prof => soilbiogeochem_state_inst%froot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of fine roots
croot_prof => soilbiogeochem_state_inst%croot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of coarse roots
@@ -1470,9 +1430,7 @@ subroutine CNCIsoHarvestPftToColumn (num_soilc, filter_soilc, &
hrv_deadcrootc_xfer_to_litter => iso_cnveg_carbonflux_inst%hrv_deadcrootc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ]
hrv_gresp_xfer_to_litter => iso_cnveg_carbonflux_inst%hrv_gresp_xfer_to_litter_patch , & ! Input: [real(r8) (:) ]
cwood_harvestc => iso_cnveg_carbonflux_inst%wood_harvestc_col , & ! Output: [real(r8) (:) ]
- harvest_c_to_litr_met_c => iso_cnveg_carbonflux_inst%harvest_c_to_litr_met_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with harvest to litter metabolic pool (gC/m3/s)
- harvest_c_to_litr_cel_c => iso_cnveg_carbonflux_inst%harvest_c_to_litr_cel_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with harvest to litter cellulose pool (gC/m3/s)
- harvest_c_to_litr_lig_c => iso_cnveg_carbonflux_inst%harvest_c_to_litr_lig_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with harvest to litter lignin pool (gC/m3/s)
+ harvest_c_to_litr_c => iso_cnveg_carbonflux_inst%harvest_c_to_litr_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with harvest to litter pools (gC/m3/s)
harvest_c_to_cwdc => iso_cnveg_carbonflux_inst%harvest_c_to_cwdc_col & ! Output: [real(r8) (:,:) ] C fluxes associated with harvest to CWD pool (gC/m3/s)
)
@@ -1486,21 +1444,17 @@ subroutine CNCIsoHarvestPftToColumn (num_soilc, filter_soilc, &
if (patch%active(p)) then
- ! leaf harvest mortality carbon fluxes
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- harvest_c_to_litr_cel_c(c,j) = harvest_c_to_litr_cel_c(c,j) + &
- hrv_leafc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- harvest_c_to_litr_lig_c(c,j) = harvest_c_to_litr_lig_c(c,j) + &
- hrv_leafc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j)
-
- ! fine root harvest mortality carbon fluxes
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_frootc_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) * froot_prof(p,j)
- harvest_c_to_litr_cel_c(c,j) = harvest_c_to_litr_cel_c(c,j) + &
- hrv_frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j)
- harvest_c_to_litr_lig_c(c,j) = harvest_c_to_litr_lig_c(c,j) + &
- hrv_frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j)
+ do i = i_litr_min, i_litr_max
+ ! leaf harvest mortality carbon fluxes
+ harvest_c_to_litr_c(c,j,i) = &
+ harvest_c_to_litr_c(c,j,i) + &
+ hrv_leafc_to_litter(p) * lf_f(ivt(p),i) * wtcol(p) * leaf_prof(p,j)
+
+ ! fine root harvest mortality carbon fluxes
+ harvest_c_to_litr_c(c,j,i) = &
+ harvest_c_to_litr_c(c,j,i) + &
+ hrv_frootc_to_litter(p) * fr_f(ivt(p),i) * wtcol(p) * froot_prof(p,j)
+ end do
! wood harvest mortality carbon fluxes
harvest_c_to_cwdc(c,j) = harvest_c_to_cwdc(c,j) + &
@@ -1510,37 +1464,27 @@ subroutine CNCIsoHarvestPftToColumn (num_soilc, filter_soilc, &
harvest_c_to_cwdc(c,j) = harvest_c_to_cwdc(c,j) + &
hrv_deadcrootc_to_litter(p) * wtcol(p) * croot_prof(p,j)
- ! storage harvest mortality carbon fluxes
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_leafc_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_frootc_storage_to_litter(p) * wtcol(p) * froot_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_livestemc_storage_to_litter(p) * wtcol(p) * stem_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_deadstemc_storage_to_litter(p) * wtcol(p) * stem_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_livecrootc_storage_to_litter(p) * wtcol(p) * croot_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_deadcrootc_storage_to_litter(p) * wtcol(p) * croot_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_gresp_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j)
-
- ! transfer harvest mortality carbon fluxes
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_leafc_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_frootc_xfer_to_litter(p) * wtcol(p) * froot_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_livestemc_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_deadstemc_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_livecrootc_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_deadcrootc_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_gresp_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j)
+ ! Metabolic litter is treated differently than other types
+ ! of litter, so it gets this additional line after the
+ ! most recent loop over all litter types
+ harvest_c_to_litr_c(c,j,i_met_lit) = &
+ harvest_c_to_litr_c(c,j,i_met_lit) + &
+ ! storage harvest mortality carbon fluxes
+ hrv_leafc_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j) + &
+ hrv_frootc_storage_to_litter(p) * wtcol(p) * froot_prof(p,j) + &
+ hrv_livestemc_storage_to_litter(p) * wtcol(p) * stem_prof(p,j) + &
+ hrv_deadstemc_storage_to_litter(p) * wtcol(p) * stem_prof(p,j) + &
+ hrv_livecrootc_storage_to_litter(p) * wtcol(p) * croot_prof(p,j) + &
+ hrv_deadcrootc_storage_to_litter(p) * wtcol(p) * croot_prof(p,j) + &
+ hrv_gresp_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j) + &
+ ! transfer harvest mortality carbon fluxes
+ hrv_leafc_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j) + &
+ hrv_frootc_xfer_to_litter(p) * wtcol(p) * froot_prof(p,j) + &
+ hrv_livestemc_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j) + &
+ hrv_deadstemc_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j) + &
+ hrv_livecrootc_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j) + &
+ hrv_deadcrootc_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j) + &
+ hrv_gresp_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j)
end if
end if
diff --git a/src/biogeochem/CNCStateUpdate1Mod.F90 b/src/biogeochem/CNCStateUpdate1Mod.F90
index c5a717f2bc..f7d097ab2b 100644
--- a/src/biogeochem/CNCStateUpdate1Mod.F90
+++ b/src/biogeochem/CNCStateUpdate1Mod.F90
@@ -8,7 +8,7 @@ module CNCStateUpdate1Mod
use shr_log_mod , only : errMsg => shr_log_errMsg
use clm_varpar , only : ndecomp_cascade_transitions, nlevdecomp
use clm_time_manager , only : get_step_size_real
- use clm_varpar , only : i_met_lit, i_cel_lit, i_lig_lit, i_cwd
+ use clm_varpar , only : i_litr_min, i_litr_max, i_cwd
use pftconMod , only : npcropmin, nc3crop, pftcon
use abortutils , only : endrun
use decompMod , only : bounds_type
@@ -52,6 +52,7 @@ subroutine CStateUpdateDynPatch(bounds, num_soilc_with_inactive, filter_soilc_wi
integer :: fc ! column filter index
integer :: g ! gridcell index
integer :: j ! level index
+ integer :: i ! litter pool index
real(r8) :: dt ! time step (seconds)
character(len=*), parameter :: subname = 'CStateUpdateDynPatch'
@@ -69,12 +70,11 @@ subroutine CStateUpdateDynPatch(bounds, num_soilc_with_inactive, filter_soilc_wi
do j = 1,nlevdecomp
do fc = 1, num_soilc_with_inactive
c = filter_soilc_with_inactive(fc)
- cs_soil%decomp_cpools_vr_col(c,j,i_met_lit) = cs_soil%decomp_cpools_vr_col(c,j,i_met_lit) + &
- cf_veg%dwt_frootc_to_litr_met_c_col(c,j) * dt
- cs_soil%decomp_cpools_vr_col(c,j,i_cel_lit) = cs_soil%decomp_cpools_vr_col(c,j,i_cel_lit) + &
- cf_veg%dwt_frootc_to_litr_cel_c_col(c,j) * dt
- cs_soil%decomp_cpools_vr_col(c,j,i_lig_lit) = cs_soil%decomp_cpools_vr_col(c,j,i_lig_lit) + &
- cf_veg%dwt_frootc_to_litr_lig_c_col(c,j) * dt
+ do i = i_litr_min, i_litr_max
+ cs_soil%decomp_cpools_vr_col(c,j,i) = &
+ cs_soil%decomp_cpools_vr_col(c,j,i) + &
+ cf_veg%dwt_frootc_to_litr_c_col(c,j,i) * dt
+ end do
cs_soil%decomp_cpools_vr_col(c,j,i_cwd) = cs_soil%decomp_cpools_vr_col(c,j,i_cwd) + &
( cf_veg%dwt_livecrootc_to_cwdc_col(c,j) + cf_veg%dwt_deadcrootc_to_cwdc_col(c,j) ) * dt
end do
@@ -87,13 +87,6 @@ subroutine CStateUpdateDynPatch(bounds, num_soilc_with_inactive, filter_soilc_wi
end if
- ! TODO(wjs, 2017-01-02) Do we need to move some of the FATES fluxes into here (from
- ! CStateUpdate1) if use_fates is true? Specifically, some portion or all of the fluxes
- ! from these updates in CStateUpdate1:
- ! cf_soil%decomp_cpools_sourcesink_col(c,j,i_met_lit) = cf_soil%FATES_c_to_litr_lab_c_col(c,j) * dt
- ! cf_soil%decomp_cpools_sourcesink_col(c,j,i_cel_lit) = cf_soil%FATES_c_to_litr_cel_c_col(c,j) * dt
- ! cf_soil%decomp_cpools_sourcesink_col(c,j,i_lig_lit) = cf_soil%FATES_c_to_litr_lig_c_col(c,j) * dt
-
end associate
end subroutine CStateUpdateDynPatch
@@ -161,12 +154,12 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, &
logical , intent(in) :: dribble_crophrv_xsmrpool_2atm
!
! !LOCAL VARIABLES:
- integer :: c,p,j,k,l ! indices
+ integer :: c,p,j,k,l,i ! indices
integer :: fp,fc ! filter indices
real(r8) :: dt ! radiation time step (seconds)
real(r8) :: check_cpool
real(r8) :: cpool_delta
- real(r8), parameter :: kprod05 = 1.44e-7 ! decay constant for 0.5-year product pool (1/s) (lose ~90% over a half year)
+ real(r8), parameter :: kprod05 = 1.44e-7_r8 ! decay constant for 0.5-year product pool (1/s) (lose ~90% over a half year)
!-----------------------------------------------------------------------
associate( &
@@ -195,13 +188,11 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, &
do fc = 1,num_soilc
c = filter_soilc(fc)
! phenology and dynamic land cover fluxes
- cf_soil%decomp_cpools_sourcesink_col(c,j,i_met_lit) = &
- cf_veg%phenology_c_to_litr_met_c_col(c,j) *dt
- cf_soil%decomp_cpools_sourcesink_col(c,j,i_cel_lit) = &
- cf_veg%phenology_c_to_litr_cel_c_col(c,j) *dt
- cf_soil%decomp_cpools_sourcesink_col(c,j,i_lig_lit) = &
- cf_veg%phenology_c_to_litr_lig_c_col(c,j) *dt
-
+ do i = i_litr_min, i_litr_max
+ cf_soil%decomp_cpools_sourcesink_col(c,j,i) = &
+ cf_veg%phenology_c_to_litr_c_col(c,j,i) * dt
+ end do
+
! NOTE(wjs, 2017-01-02) This used to be set to a non-zero value, but the
! terms have been moved to CStateUpdateDynPatch. I think this is zeroed every
! time step, but to be safe, I'm explicitly setting it to zero here.
@@ -215,9 +206,10 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, &
c = filter_soilc(fc)
! TODO(wjs, 2017-01-02) Should some portion or all of the following fluxes
! be moved to the updates in CStateUpdateDynPatch?
- cf_soil%decomp_cpools_sourcesink_col(c,j,i_met_lit) = cf_soil%FATES_c_to_litr_lab_c_col(c,j) * dt
- cf_soil%decomp_cpools_sourcesink_col(c,j,i_cel_lit) = cf_soil%FATES_c_to_litr_cel_c_col(c,j) * dt
- cf_soil%decomp_cpools_sourcesink_col(c,j,i_lig_lit) = cf_soil%FATES_c_to_litr_lig_c_col(c,j) * dt
+ do i = i_litr_min, i_litr_max
+ cf_soil%decomp_cpools_sourcesink_col(c,j,i) = &
+ cf_soil%FATES_c_to_litr_c_col(c,j,i) * dt
+ end do
end do
end do
endif
diff --git a/src/biogeochem/CNCStateUpdate2Mod.F90 b/src/biogeochem/CNCStateUpdate2Mod.F90
index 276141271b..395fc7ee3b 100644
--- a/src/biogeochem/CNCStateUpdate2Mod.F90
+++ b/src/biogeochem/CNCStateUpdate2Mod.F90
@@ -9,7 +9,7 @@ module CNCStateUpdate2Mod
use shr_log_mod , only : errMsg => shr_log_errMsg
use abortutils , only : endrun
use clm_time_manager , only : get_step_size_real
- use clm_varpar , only : nlevdecomp, i_met_lit, i_cel_lit, i_lig_lit, i_cwd
+ use clm_varpar , only : i_litr_min, i_litr_max, nlevdecomp, i_cwd
use CNvegCarbonStateType , only : cnveg_carbonstate_type
use CNVegCarbonFluxType , only : cnveg_carbonflux_type
use SoilBiogeochemCarbonStatetype , only : soilbiogeochem_carbonstate_type
@@ -42,7 +42,7 @@ subroutine CStateUpdate2(num_soilc, filter_soilc, num_soilp, filter_soilp, &
type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst
!
! !LOCAL VARIABLES:
- integer :: c ,p,j ! indices
+ integer :: c,p,j,i ! indices
integer :: fp,fc ! lake filter indices
real(r8) :: dt ! radiation time step (seconds)
!-----------------------------------------------------------------------
@@ -64,12 +64,13 @@ subroutine CStateUpdate2(num_soilc, filter_soilc, num_soilp, filter_soilp, &
c = filter_soilc(fc)
! column gap mortality fluxes
- cs_soil%decomp_cpools_vr_col(c,j,i_met_lit) = &
- cs_soil%decomp_cpools_vr_col(c,j,i_met_lit) + cf_veg%gap_mortality_c_to_litr_met_c_col(c,j) * dt
- cs_soil%decomp_cpools_vr_col(c,j,i_cel_lit) = &
- cs_soil%decomp_cpools_vr_col(c,j,i_cel_lit) + cf_veg%gap_mortality_c_to_litr_cel_c_col(c,j) * dt
- cs_soil%decomp_cpools_vr_col(c,j,i_lig_lit) = &
- cs_soil%decomp_cpools_vr_col(c,j,i_lig_lit) + cf_veg%gap_mortality_c_to_litr_lig_c_col(c,j) * dt
+ do i = i_litr_min, i_litr_max
+ cs_soil%decomp_cpools_vr_col(c,j,i) = &
+ cs_soil%decomp_cpools_vr_col(c,j,i) + &
+ cf_veg%gap_mortality_c_to_litr_c_col(c,j,i) * dt
+ end do
+ ! Currently i_cwd .ne. i_litr_max + 1 if .not. fates and
+ ! i_cwd = 0 if fates, so not including in the i-loop
cs_soil%decomp_cpools_vr_col(c,j,i_cwd) = &
cs_soil%decomp_cpools_vr_col(c,j,i_cwd) + cf_veg%gap_mortality_c_to_cwdc_col(c,j) * dt
@@ -150,7 +151,7 @@ subroutine CStateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp, &
type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst
!
! !LOCAL VARIABLES:
- integer :: c,p,j,k,l ! indices
+ integer :: c,p,j,k,l,i ! indices
integer :: fp,fc ! lake filter indices
real(r8):: dt ! radiation time step (seconds)
!-----------------------------------------------------------------------
@@ -170,12 +171,13 @@ subroutine CStateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp, &
c = filter_soilc(fc)
! column harvest fluxes
- cs_soil%decomp_cpools_vr_col(c,j,i_met_lit) = &
- cs_soil%decomp_cpools_vr_col(c,j,i_met_lit) + cf_veg%harvest_c_to_litr_met_c_col(c,j) * dt
- cs_soil%decomp_cpools_vr_col(c,j,i_cel_lit) = &
- cs_soil%decomp_cpools_vr_col(c,j,i_cel_lit) + cf_veg%harvest_c_to_litr_cel_c_col(c,j) * dt
- cs_soil%decomp_cpools_vr_col(c,j,i_lig_lit) = &
- cs_soil%decomp_cpools_vr_col(c,j,i_lig_lit) + cf_veg%harvest_c_to_litr_lig_c_col(c,j) * dt
+ do i = i_litr_min, i_litr_max
+ cs_soil%decomp_cpools_vr_col(c,j,i) = &
+ cs_soil%decomp_cpools_vr_col(c,j,i) + &
+ cf_veg%harvest_c_to_litr_c_col(c,j,i) * dt
+ end do
+ ! Currently i_cwd .ne. i_litr_max + 1 if .not. fates and
+ ! i_cwd = 0 if fates, so not including in the i-loop
cs_soil%decomp_cpools_vr_col(c,j,i_cwd) = &
cs_soil%decomp_cpools_vr_col(c,j,i_cwd) + cf_veg%harvest_c_to_cwdc_col(c,j) * dt
diff --git a/src/biogeochem/CNCStateUpdate3Mod.F90 b/src/biogeochem/CNCStateUpdate3Mod.F90
index aa5320efc1..8a54a7efc7 100644
--- a/src/biogeochem/CNCStateUpdate3Mod.F90
+++ b/src/biogeochem/CNCStateUpdate3Mod.F90
@@ -9,7 +9,7 @@ module CNCStateUpdate3Mod
use shr_log_mod , only : errMsg => shr_log_errMsg
use abortutils , only : endrun
use clm_time_manager , only : get_step_size_real
- use clm_varpar , only : nlevdecomp, ndecomp_pools, i_cwd, i_met_lit, i_cel_lit, i_lig_lit
+ use clm_varpar , only : nlevdecomp, ndecomp_pools, i_cwd, i_litr_min, i_litr_max
use CNVegCarbonStateType , only : cnveg_carbonstate_type
use CNVegCarbonFluxType , only : cnveg_carbonflux_type
use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type
@@ -41,7 +41,7 @@ subroutine CStateUpdate3( num_soilc, filter_soilc, num_soilp, filter_soilp, &
type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst
!
! !LOCAL VARIABLES:
- integer :: c,p,j,l,k ! indices
+ integer :: c,p,j,l,k,i ! indices
integer :: fp,fc ! lake filter indices
real(r8):: dt ! radiation time step (seconds)
!-----------------------------------------------------------------------
@@ -64,12 +64,11 @@ subroutine CStateUpdate3( num_soilc, filter_soilc, num_soilp, filter_soilp, &
cf_veg%fire_mortality_c_to_cwdc_col(c,j) * dt
! patch-level wood to column-level litter (uncombusted wood)
- cs_soil%decomp_cpools_vr_col(c,j,i_met_lit) = cs_soil%decomp_cpools_vr_col(c,j,i_met_lit) + &
- cf_veg%m_c_to_litr_met_fire_col(c,j)* dt
- cs_soil%decomp_cpools_vr_col(c,j,i_cel_lit) = cs_soil%decomp_cpools_vr_col(c,j,i_cel_lit) + &
- cf_veg%m_c_to_litr_cel_fire_col(c,j)* dt
- cs_soil%decomp_cpools_vr_col(c,j,i_lig_lit) = cs_soil%decomp_cpools_vr_col(c,j,i_lig_lit) + &
- cf_veg%m_c_to_litr_lig_fire_col(c,j)* dt
+ do i = i_litr_min, i_litr_max
+ cs_soil%decomp_cpools_vr_col(c,j,i) = &
+ cs_soil%decomp_cpools_vr_col(c,j,i) + &
+ cf_veg%m_c_to_litr_fire_col(c,j,i) * dt
+ end do
end do
end do
diff --git a/src/biogeochem/CNDVEstablishmentMod.F90 b/src/biogeochem/CNDVEstablishmentMod.F90
index 985af76a12..ffd213e3a3 100644
--- a/src/biogeochem/CNDVEstablishmentMod.F90
+++ b/src/biogeochem/CNDVEstablishmentMod.F90
@@ -82,7 +82,7 @@ subroutine Establishment(bounds, &
real(r8):: bm_delta
! parameters
- real(r8), parameter :: ramp_agddtw = 300.0
+ real(r8), parameter :: ramp_agddtw = 300.0_r8
! minimum individual density for persistence of PATCH (indiv/m2)
real(r8), parameter :: nind_min = 1.0e-10_r8
@@ -425,8 +425,8 @@ subroutine Establishment(bounds, &
greffic(p) = bm_delta / (lm_ind * slatop(ivt(p)))
end if
else
- greffic(p) = 0.
- heatstress(p) = 0.
+ greffic(p) = 0._r8
+ heatstress(p) = 0._r8
end if
end do
diff --git a/src/biogeochem/CNDriverMod.F90 b/src/biogeochem/CNDriverMod.F90
index b5d5ce97cd..84f9164b16 100644
--- a/src/biogeochem/CNDriverMod.F90
+++ b/src/biogeochem/CNDriverMod.F90
@@ -1036,6 +1036,7 @@ subroutine CNDriverSummarizeFluxes(bounds, &
call cnveg_carbonflux_inst%Summary(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, &
isotope='bulk', &
soilbiogeochem_hr_col=soilbiogeochem_carbonflux_inst%hr_col(begc:endc), &
+ soilbiogeochem_cwdhr_col=soilbiogeochem_carbonflux_inst%cwdhr_col(begc:endc), &
soilbiogeochem_lithr_col=soilbiogeochem_carbonflux_inst%lithr_col(begc:endc), &
soilbiogeochem_decomp_cascade_ctransfer_col=&
soilbiogeochem_carbonflux_inst%decomp_cascade_ctransfer_col(begc:endc,1:ndecomp_cascade_transitions), &
@@ -1045,6 +1046,7 @@ subroutine CNDriverSummarizeFluxes(bounds, &
call c13_cnveg_carbonflux_inst%Summary(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, &
isotope='c13', &
soilbiogeochem_hr_col=c13_soilbiogeochem_carbonflux_inst%hr_col(begc:endc), &
+ soilbiogeochem_cwdhr_col=c13_soilbiogeochem_carbonflux_inst%cwdhr_col(begc:endc), &
soilbiogeochem_lithr_col=c13_soilbiogeochem_carbonflux_inst%lithr_col(begc:endc), &
soilbiogeochem_decomp_cascade_ctransfer_col=&
c13_soilbiogeochem_carbonflux_inst%decomp_cascade_ctransfer_col(begc:endc,1:ndecomp_cascade_transitions), &
@@ -1055,6 +1057,7 @@ subroutine CNDriverSummarizeFluxes(bounds, &
call c14_cnveg_carbonflux_inst%Summary(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, &
isotope='c14', &
soilbiogeochem_hr_col=c14_soilbiogeochem_carbonflux_inst%hr_col(begc:endc), &
+ soilbiogeochem_cwdhr_col=c14_soilbiogeochem_carbonflux_inst%cwdhr_col(begc:endc), &
soilbiogeochem_lithr_col=c14_soilbiogeochem_carbonflux_inst%lithr_col(begc:endc), &
soilbiogeochem_decomp_cascade_ctransfer_col=&
c14_soilbiogeochem_carbonflux_inst%decomp_cascade_ctransfer_col(begc:endc,1:ndecomp_cascade_transitions), &
diff --git a/src/biogeochem/CNFUNMod.F90 b/src/biogeochem/CNFUNMod.F90
index 6ab724aae2..57e8e11c86 100644
--- a/src/biogeochem/CNFUNMod.F90
+++ b/src/biogeochem/CNFUNMod.F90
@@ -1233,13 +1233,13 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp&
! C used for uptake is reduced if the cost of N is very high
frac_ideal_C_use = max(0.0_r8,1.0_r8 - (total_N_resistance-fun_cn_flex_a(ivt(p)))/fun_cn_flex_b(ivt(p)) )
! then, if the plant is very much in need of N, the C used for uptake is increased accordingly.
- if(delta_CN.lt.0.0)then
+ if(delta_CN.lt.0.0_r8)then
frac_ideal_C_use = frac_ideal_C_use + (1.0_r8-frac_ideal_C_use)*min(1.0_r8, delta_CN/fun_cn_flex_c(ivt(p)))
end if
! If we have too much N (e.g. from free N retranslocation) then make frac_ideal_c_use even lower.
! For a CN delta of fun_cn_flex_c, then we reduce C expendiure to the minimum of 0.5.
! This seems a little intense?
- if(delta_CN .gt.0.and. frac_ideal_C_use.lt.1.0)then
+ if(delta_CN .gt.0._r8 .and. frac_ideal_C_use.lt.1.0_r8)then
frac_ideal_C_use = frac_ideal_C_use + 0.5_r8*(1.0_r8*delta_CN/fun_cn_flex_c(ivt(p)))
end if
! don't let this go above 1 or below an arbitrary minimum (to prevent zero N uptake).
diff --git a/src/biogeochem/CNFireBaseMod.F90 b/src/biogeochem/CNFireBaseMod.F90
index b9c125716e..e929757af6 100644
--- a/src/biogeochem/CNFireBaseMod.F90
+++ b/src/biogeochem/CNFireBaseMod.F90
@@ -445,7 +445,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte
use clm_varcon , only: secspday
use pftconMod , only: nc3crop
use dynSubgridControlMod , only: run_has_transient_landcover
- use clm_varpar , only: nlevdecomp_full, ndecomp_pools, nlevdecomp
+ use clm_varpar , only: nlevdecomp_full, ndecomp_pools, nlevdecomp, i_litr_max, i_met_lit
!
! !ARGUMENTS:
class(cnfire_base_type) :: this
@@ -470,7 +470,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte
real(r8) , intent(out) :: somc_fire_col(bounds%begc:) ! (gC/m2/s) fire C emissions due to peat burning
!
! !LOCAL VARIABLES:
- integer :: g,c,p,j,l,kyr, kmo, kda, mcsec ! indices
+ integer :: i,g,c,p,j,l,kyr, kmo, kda, mcsec ! indices
integer :: fp,fc ! filter indices
real(r8):: f ! rate for fire effects (1/s)
real(r8):: m ! acceleration factor for fuel carbon
@@ -524,12 +524,8 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte
fm_root => pftcon%fm_root , & ! Input:
fm_lroot => pftcon%fm_lroot , & ! Input:
fm_droot => pftcon%fm_droot , & ! Input:
- lf_flab => pftcon%lf_flab , & ! Input:
- lf_fcel => pftcon%lf_fcel , & ! Input:
- lf_flig => pftcon%lf_flig , & ! Input:
- fr_flab => pftcon%fr_flab , & ! Input:
- fr_fcel => pftcon%fr_fcel , & ! Input:
- fr_flig => pftcon%fr_flig , & ! Input:
+ lf_f => pftcon%lf_f , & ! Input:
+ fr_f => pftcon%fr_f , & ! Input:
cmb_cmplt_fact_litter => cnfire_const%cmb_cmplt_fact_litter , & ! Input: [real(r8) (:) ] Combustion completion factor for litter (unitless)
cmb_cmplt_fact_cwd => cnfire_const%cmb_cmplt_fact_cwd , & ! Input: [real(r8) (:) ] Combustion completion factor for CWD (unitless)
@@ -634,9 +630,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte
m_gresp_storage_to_litter_fire => cnveg_carbonflux_inst%m_gresp_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ]
m_gresp_xfer_to_litter_fire => cnveg_carbonflux_inst%m_gresp_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ]
m_decomp_cpools_to_fire_vr => cnveg_carbonflux_inst%m_decomp_cpools_to_fire_vr_col , & ! Output: [real(r8) (:,:,:) ] (gC/m3/s) VR decomp. C fire loss
- m_c_to_litr_met_fire => cnveg_carbonflux_inst%m_c_to_litr_met_fire_col , & ! Output: [real(r8) (:,:) ]
- m_c_to_litr_cel_fire => cnveg_carbonflux_inst%m_c_to_litr_cel_fire_col , & ! Output: [real(r8) (:,:) ]
- m_c_to_litr_lig_fire => cnveg_carbonflux_inst%m_c_to_litr_lig_fire_col , & ! Output: [real(r8) (:,:) ]
+ m_c_to_litr_fire => cnveg_carbonflux_inst%m_c_to_litr_fire_col , & ! Output: [real(r8) (:,:,:) ]
fire_mortality_n_to_cwdn => cnveg_nitrogenflux_inst%fire_mortality_n_to_cwdn_col , & ! Input: [real(r8) (:,:) ] N flux fire mortality to CWD (gN/m3/s)
m_leafn_to_fire => cnveg_nitrogenflux_inst%m_leafn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. leafn
@@ -680,9 +674,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte
m_deadcrootn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_deadcrootn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ]
m_retransn_to_litter_fire => cnveg_nitrogenflux_inst%m_retransn_to_litter_fire_patch , & ! Output: [real(r8) (:) ]
m_decomp_npools_to_fire_vr => cnveg_nitrogenflux_inst%m_decomp_npools_to_fire_vr_col , & ! Output: [real(r8) (:,:,:) ] VR decomp. N fire loss (gN/m3/s)
- m_n_to_litr_met_fire => cnveg_nitrogenflux_inst%m_n_to_litr_met_fire_col , & ! Output: [real(r8) (:,:) ]
- m_n_to_litr_cel_fire => cnveg_nitrogenflux_inst%m_n_to_litr_cel_fire_col , & ! Output: [real(r8) (:,:) ]
- m_n_to_litr_lig_fire => cnveg_nitrogenflux_inst%m_n_to_litr_lig_fire_col & ! Output: [real(r8) (:,:) ]
+ m_n_to_litr_fire => cnveg_nitrogenflux_inst%m_n_to_litr_fire_col & ! Output: [real(r8) (:,:,:) ]
)
transient_landcover = run_has_transient_landcover()
@@ -947,13 +939,14 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte
m_livecrootn_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j)
- m_c_to_litr_met_fire(c,j)=m_c_to_litr_met_fire(c,j) + &
- ((m_leafc_to_litter_fire(p)*lf_flab(patch%itype(p)) &
+ m_c_to_litr_fire(c,j,i_met_lit) = &
+ m_c_to_litr_fire(c,j,i_met_lit) + &
+ ((m_leafc_to_litter_fire(p) * lf_f(patch%itype(p),i_met_lit) &
+m_leafc_storage_to_litter_fire(p) + &
m_leafc_xfer_to_litter_fire(p) + &
m_gresp_storage_to_litter_fire(p) &
+m_gresp_xfer_to_litter_fire(p))*leaf_prof(p,j) + &
- (m_frootc_to_litter_fire(p)*fr_flab(patch%itype(p)) &
+ (m_frootc_to_litter_fire(p) * fr_f(patch%itype(p),i_met_lit) &
+m_frootc_storage_to_litter_fire(p) + &
m_frootc_xfer_to_litter_fire(p))*froot_prof(p,j) &
+(m_livestemc_storage_to_litter_fire(p) + &
@@ -964,34 +957,41 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte
m_livecrootc_xfer_to_litter_fire(p) &
+m_deadcrootc_storage_to_litter_fire(p) + &
m_deadcrootc_xfer_to_litter_fire(p))* croot_prof(p,j))* patch%wtcol(p)
- m_c_to_litr_cel_fire(c,j)=m_c_to_litr_cel_fire(c,j) + &
- (m_leafc_to_litter_fire(p)*lf_fcel(patch%itype(p))*leaf_prof(p,j) + &
- m_frootc_to_litter_fire(p)*fr_fcel(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p)
- m_c_to_litr_lig_fire(c,j)=m_c_to_litr_lig_fire(c,j) + &
- (m_leafc_to_litter_fire(p)*lf_flig(patch%itype(p))*leaf_prof(p,j) + &
- m_frootc_to_litter_fire(p)*fr_flig(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p)
-
- m_n_to_litr_met_fire(c,j)=m_n_to_litr_met_fire(c,j) + &
- ((m_leafn_to_litter_fire(p)*lf_flab(patch%itype(p)) &
- +m_leafn_storage_to_litter_fire(p) + &
- m_leafn_xfer_to_litter_fire(p)+m_retransn_to_litter_fire(p)) &
- *leaf_prof(p,j) +(m_frootn_to_litter_fire(p)*fr_flab(patch%itype(p)) &
- +m_frootn_storage_to_litter_fire(p) + &
- m_frootn_xfer_to_litter_fire(p))*froot_prof(p,j) &
- +(m_livestemn_storage_to_litter_fire(p) + &
- m_livestemn_xfer_to_litter_fire(p) &
- +m_deadstemn_storage_to_litter_fire(p) + &
- m_deadstemn_xfer_to_litter_fire(p))* stem_prof(p,j)&
- +(m_livecrootn_storage_to_litter_fire(p) + &
- m_livecrootn_xfer_to_litter_fire(p) &
- +m_deadcrootn_storage_to_litter_fire(p) + &
- m_deadcrootn_xfer_to_litter_fire(p))* croot_prof(p,j))* patch%wtcol(p)
- m_n_to_litr_cel_fire(c,j)=m_n_to_litr_cel_fire(c,j) + &
- (m_leafn_to_litter_fire(p)*lf_fcel(patch%itype(p))*leaf_prof(p,j) + &
- m_frootn_to_litter_fire(p)*fr_fcel(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p)
- m_n_to_litr_lig_fire(c,j)=m_n_to_litr_lig_fire(c,j) + &
- (m_leafn_to_litter_fire(p)*lf_flig(patch%itype(p))*leaf_prof(p,j) + &
- m_frootn_to_litter_fire(p)*fr_flig(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p)
+ ! Here metabolic litter is treated differently than other
+ ! types of litter, so it remains outside this litter loop,
+ ! in the line above
+ do i = i_met_lit+1, i_litr_max
+ m_c_to_litr_fire(c,j,i) = m_c_to_litr_fire(c,j,i) + &
+ (m_leafc_to_litter_fire(p) * lf_f(patch%itype(p),i) * leaf_prof(p,j) + &
+ m_frootc_to_litter_fire(p) * fr_f(patch%itype(p),i) * froot_prof(p,j)) * patch%wtcol(p)
+ end do
+
+ m_n_to_litr_fire(c,j,i_met_lit) = &
+ m_n_to_litr_fire(c,j,i_met_lit) + &
+ ((m_leafn_to_litter_fire(p) * lf_f(patch%itype(p),i_met_lit) + &
+ m_leafn_storage_to_litter_fire(p) + &
+ m_leafn_xfer_to_litter_fire(p) + &
+ m_retransn_to_litter_fire(p)) * leaf_prof(p,j) + &
+ (m_frootn_to_litter_fire(p) * fr_f(patch%itype(p),i_met_lit) + &
+ m_frootn_storage_to_litter_fire(p) + &
+ m_frootn_xfer_to_litter_fire(p)) * froot_prof(p,j) + &
+ (m_livestemn_storage_to_litter_fire(p) + &
+ m_livestemn_xfer_to_litter_fire(p) + &
+ m_deadstemn_storage_to_litter_fire(p) + &
+ m_deadstemn_xfer_to_litter_fire(p)) * stem_prof(p,j) + &
+ (m_livecrootn_storage_to_litter_fire(p) + &
+ m_livecrootn_xfer_to_litter_fire(p) + &
+ m_deadcrootn_storage_to_litter_fire(p) + &
+ m_deadcrootn_xfer_to_litter_fire(p)) * croot_prof(p,j)) * patch%wtcol(p)
+ ! Here metabolic litter is treated differently than other
+ ! types of litter, so it remains outside this litter loop,
+ ! in the line above
+ do i = i_met_lit+1, i_litr_max
+ m_n_to_litr_fire(c,j,i) = &
+ m_n_to_litr_fire(c,j,i) + &
+ (m_leafn_to_litter_fire(p) * lf_f(patch%itype(p),i) * leaf_prof(p,j) + &
+ m_frootn_to_litter_fire(p) * fr_f(patch%itype(p),i) * froot_prof(p,j)) * patch%wtcol(p)
+ end do
end do
end do
!
@@ -1042,7 +1042,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte
if( trotr1_col(c)+trotr2_col(c) > 0.6_r8 .and. dtrotr_col(c) > 0._r8 .and. &
lfc(c) > 0._r8 .and. fbac1(c) == 0._r8) then
lfc2(c) = max(0._r8, min(lfc(c), (farea_burned(c)-baf_crop(c) - &
- baf_peatf(c))/2.0*dt))/(dtrotr_col(c)*dayspyr*secspday/dt)/dt
+ baf_peatf(c))/2.0_r8*dt))/(dtrotr_col(c)*dayspyr*secspday/dt)/dt
lfc(c) = lfc(c) - max(0._r8, min(lfc(c), (farea_burned(c)-baf_crop(c) - &
baf_peatf(c))*dt/2.0_r8))
end if
diff --git a/src/biogeochem/CNFireLi2014Mod.F90 b/src/biogeochem/CNFireLi2014Mod.F90
index e8fd78230e..b9a6f705d0 100644
--- a/src/biogeochem/CNFireLi2014Mod.F90
+++ b/src/biogeochem/CNFireLi2014Mod.F90
@@ -559,7 +559,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_
g = col%gridcell(c)
hdmlf=this%forc_hdm(g)
nfire(c) = 0._r8
- if( cropf_col(c) < 1.0 )then
+ if( cropf_col(c) < 1.0_r8 )then
if (trotr1_col(c)+trotr2_col(c)>0.6_r8) then
farea_burned(c)=min(1.0_r8,baf_crop(c)+baf_peatf(c))
else
@@ -649,6 +649,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte
use clm_time_manager , only: get_step_size_real,get_days_per_year,get_curr_date
use clm_varctl , only: use_cndv
use clm_varcon , only: secspday
+ use clm_varpar , only: i_met_lit, i_litr_max
use pftconMod , only: nc3crop
use dynSubgridControlMod , only: run_has_transient_landcover
!
@@ -675,7 +676,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte
real(r8) , intent(out) :: somc_fire_col(bounds%begc:) ! (gC/m2/s) fire C emissions due to peat burning
!
! !LOCAL VARIABLES:
- integer :: g,c,p,j,l,pi,kyr, kmo, kda, mcsec ! indices
+ integer :: i,g,c,p,j,l,pi,kyr, kmo, kda, mcsec ! indices
integer :: fp,fc ! filter indices
real(r8):: f ! rate for fire effects (1/s)
real(r8):: m ! acceleration factor for fuel carbon
@@ -729,12 +730,8 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte
fm_root => pftcon%fm_root , & ! Input:
fm_lroot => pftcon%fm_lroot , & ! Input:
fm_droot => pftcon%fm_droot , & ! Input:
- lf_flab => pftcon%lf_flab , & ! Input:
- lf_fcel => pftcon%lf_fcel , & ! Input:
- lf_flig => pftcon%lf_flig , & ! Input:
- fr_flab => pftcon%fr_flab , & ! Input:
- fr_fcel => pftcon%fr_fcel , & ! Input:
- fr_flig => pftcon%fr_flig , & ! Input:
+ lf_f => pftcon%lf_f , & ! Input:
+ fr_f => pftcon%fr_f , & ! Input:
nind => dgvs_inst%nind_patch , & ! Input: [real(r8) (:) ] number of individuals (#/m2)
@@ -836,9 +833,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte
m_gresp_storage_to_litter_fire => cnveg_carbonflux_inst%m_gresp_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ]
m_gresp_xfer_to_litter_fire => cnveg_carbonflux_inst%m_gresp_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ]
m_decomp_cpools_to_fire_vr => cnveg_carbonflux_inst%m_decomp_cpools_to_fire_vr_col , & ! Output: [real(r8) (:,:,:) ] (gC/m3/s) VR decomp. C fire loss
- m_c_to_litr_met_fire => cnveg_carbonflux_inst%m_c_to_litr_met_fire_col , & ! Output: [real(r8) (:,:) ]
- m_c_to_litr_cel_fire => cnveg_carbonflux_inst%m_c_to_litr_cel_fire_col , & ! Output: [real(r8) (:,:) ]
- m_c_to_litr_lig_fire => cnveg_carbonflux_inst%m_c_to_litr_lig_fire_col , & ! Output: [real(r8) (:,:) ]
+ m_c_to_litr_fire => cnveg_carbonflux_inst%m_c_to_litr_fire_col , & ! Output: [real(r8) (:,:,:) ]
fire_mortality_n_to_cwdn => cnveg_nitrogenflux_inst%fire_mortality_n_to_cwdn_col , & ! Input: [real(r8) (:,:) ] N flux fire mortality to CWD (gN/m3/s)
m_leafn_to_fire => cnveg_nitrogenflux_inst%m_leafn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. leafn
@@ -882,9 +877,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte
m_deadcrootn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_deadcrootn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ]
m_retransn_to_litter_fire => cnveg_nitrogenflux_inst%m_retransn_to_litter_fire_patch , & ! Output: [real(r8) (:) ]
m_decomp_npools_to_fire_vr => cnveg_nitrogenflux_inst%m_decomp_npools_to_fire_vr_col , & ! Output: [real(r8) (:,:,:) ] VR decomp. N fire loss (gN/m3/s)
- m_n_to_litr_met_fire => cnveg_nitrogenflux_inst%m_n_to_litr_met_fire_col , & ! Output: [real(r8) (:,:) ]
- m_n_to_litr_cel_fire => cnveg_nitrogenflux_inst%m_n_to_litr_cel_fire_col , & ! Output: [real(r8) (:,:) ]
- m_n_to_litr_lig_fire => cnveg_nitrogenflux_inst%m_n_to_litr_lig_fire_col & ! Output: [real(r8) (:,:) ]
+ m_n_to_litr_fire => cnveg_nitrogenflux_inst%m_n_to_litr_fire_col & ! Output: [real(r8) (:,:,:) ]
)
transient_landcover = run_has_transient_landcover()
@@ -1133,13 +1126,14 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte
m_livecrootn_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j)
- m_c_to_litr_met_fire(c,j)=m_c_to_litr_met_fire(c,j) + &
- ((m_leafc_to_litter_fire(p)*lf_flab(patch%itype(p)) &
+ m_c_to_litr_fire(c,j,i_met_lit) = &
+ m_c_to_litr_fire(c,j,i_met_lit) + &
+ ((m_leafc_to_litter_fire(p) * lf_f(patch%itype(p),i_met_lit) &
+m_leafc_storage_to_litter_fire(p) + &
m_leafc_xfer_to_litter_fire(p) + &
m_gresp_storage_to_litter_fire(p) &
+m_gresp_xfer_to_litter_fire(p))*leaf_prof(p,j) + &
- (m_frootc_to_litter_fire(p)*fr_flab(patch%itype(p)) &
+ (m_frootc_to_litter_fire(p) * fr_f(patch%itype(p),i_met_lit) &
+m_frootc_storage_to_litter_fire(p) + &
m_frootc_xfer_to_litter_fire(p))*froot_prof(p,j) &
+(m_livestemc_storage_to_litter_fire(p) + &
@@ -1150,34 +1144,35 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte
m_livecrootc_xfer_to_litter_fire(p) &
+m_deadcrootc_storage_to_litter_fire(p) + &
m_deadcrootc_xfer_to_litter_fire(p))* croot_prof(p,j))* patch%wtcol(p)
- m_c_to_litr_cel_fire(c,j)=m_c_to_litr_cel_fire(c,j) + &
- (m_leafc_to_litter_fire(p)*lf_fcel(patch%itype(p))*leaf_prof(p,j) + &
- m_frootc_to_litter_fire(p)*fr_fcel(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p)
- m_c_to_litr_lig_fire(c,j)=m_c_to_litr_lig_fire(c,j) + &
- (m_leafc_to_litter_fire(p)*lf_flig(patch%itype(p))*leaf_prof(p,j) + &
- m_frootc_to_litter_fire(p)*fr_flig(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p)
-
- m_n_to_litr_met_fire(c,j)=m_n_to_litr_met_fire(c,j) + &
- ((m_leafn_to_litter_fire(p)*lf_flab(patch%itype(p)) &
- +m_leafn_storage_to_litter_fire(p) + &
- m_leafn_xfer_to_litter_fire(p)+m_retransn_to_litter_fire(p)) &
- *leaf_prof(p,j) +(m_frootn_to_litter_fire(p)*fr_flab(patch%itype(p)) &
- +m_frootn_storage_to_litter_fire(p) + &
- m_frootn_xfer_to_litter_fire(p))*froot_prof(p,j) &
- +(m_livestemn_storage_to_litter_fire(p) + &
- m_livestemn_xfer_to_litter_fire(p) &
- +m_deadstemn_storage_to_litter_fire(p) + &
- m_deadstemn_xfer_to_litter_fire(p))* stem_prof(p,j)&
- +(m_livecrootn_storage_to_litter_fire(p) + &
- m_livecrootn_xfer_to_litter_fire(p) &
- +m_deadcrootn_storage_to_litter_fire(p) + &
- m_deadcrootn_xfer_to_litter_fire(p))* croot_prof(p,j))* patch%wtcol(p)
- m_n_to_litr_cel_fire(c,j)=m_n_to_litr_cel_fire(c,j) + &
- (m_leafn_to_litter_fire(p)*lf_fcel(patch%itype(p))*leaf_prof(p,j) + &
- m_frootn_to_litter_fire(p)*fr_fcel(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p)
- m_n_to_litr_lig_fire(c,j)=m_n_to_litr_lig_fire(c,j) + &
- (m_leafn_to_litter_fire(p)*lf_flig(patch%itype(p))*leaf_prof(p,j) + &
- m_frootn_to_litter_fire(p)*fr_flig(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p)
+ do i = i_met_lit+1, i_litr_max
+ m_c_to_litr_fire(c,j,i) = m_c_to_litr_fire(c,j,i) + &
+ (m_leafc_to_litter_fire(p) * lf_f(patch%itype(p),i) * leaf_prof(p,j) + &
+ m_frootc_to_litter_fire(p) * fr_f(patch%itype(p),i) * froot_prof(p,j)) * patch%wtcol(p)
+ end do
+
+ m_n_to_litr_fire(c,j,i_met_lit) = &
+ m_n_to_litr_fire(c,j,i_met_lit) + &
+ ((m_leafn_to_litter_fire(p) * lf_f(patch%itype(p),i_met_lit) + &
+ m_leafn_storage_to_litter_fire(p) + &
+ m_leafn_xfer_to_litter_fire(p) + &
+ m_retransn_to_litter_fire(p)) * leaf_prof(p,j) + &
+ (m_frootn_to_litter_fire(p) * fr_f(patch%itype(p),i_met_lit) + &
+ m_frootn_storage_to_litter_fire(p) + &
+ m_frootn_xfer_to_litter_fire(p)) * froot_prof(p,j) + &
+ (m_livestemn_storage_to_litter_fire(p) + &
+ m_livestemn_xfer_to_litter_fire(p) + &
+ m_deadstemn_storage_to_litter_fire(p) + &
+ m_deadstemn_xfer_to_litter_fire(p)) * stem_prof(p,j) + &
+ (m_livecrootn_storage_to_litter_fire(p) + &
+ m_livecrootn_xfer_to_litter_fire(p) + &
+ m_deadcrootn_storage_to_litter_fire(p) + &
+ m_deadcrootn_xfer_to_litter_fire(p)) * croot_prof(p,j)) * patch%wtcol(p)
+ do i = i_met_lit+1, i_litr_max
+ m_n_to_litr_fire(c,j,i) = &
+ m_n_to_litr_fire(c,j,i) + &
+ (m_leafn_to_litter_fire(p) * lf_f(patch%itype(p),i) * leaf_prof(p,j) + &
+ m_frootn_to_litter_fire(p) * fr_f(patch%itype(p),i) * froot_prof(p,j)) * patch%wtcol(p)
+ end do
end do
end do
!
@@ -1228,7 +1223,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte
if( trotr1_col(c)+trotr2_col(c) > 0.6_r8 .and. dtrotr_col(c) > 0._r8 .and. &
lfc(c) > 0._r8 .and. fbac1(c) == 0._r8) then
lfc2(c) = max(0._r8, min(lfc(c), (farea_burned(c)-baf_crop(c) - &
- baf_peatf(c))/2.0*dt))/(dtrotr_col(c)*dayspyr*secspday/dt)/dt
+ baf_peatf(c))/2.0_r8*dt))/(dtrotr_col(c)*dayspyr*secspday/dt)/dt
lfc(c) = lfc(c) - max(0._r8, min(lfc(c), (farea_burned(c)-baf_crop(c) - &
baf_peatf(c))*dt/2.0_r8))
end if
diff --git a/src/biogeochem/CNGapMortalityMod.F90 b/src/biogeochem/CNGapMortalityMod.F90
index cd02221de4..060a183688 100644
--- a/src/biogeochem/CNGapMortalityMod.F90
+++ b/src/biogeochem/CNGapMortalityMod.F90
@@ -112,12 +112,12 @@ subroutine CNGapMortality (bounds, num_soilc, filter_soilc, num_soilp, filter_so
real(r8) , intent(in) :: stem_prof_patch(bounds%begp:,1:)
!
! !LOCAL VARIABLES:
- integer :: p ! patch index
- integer :: fp ! patch filter index
- real(r8):: am ! rate for fractional mortality (1/yr)
- real(r8):: m ! rate for fractional mortality (1/s)
- real(r8):: mort_max ! asymptotic max mortality rate (/yr)
- real(r8):: k_mort = 0.3 ! coeff of growth efficiency in mortality equation
+ integer :: p ! patch index
+ integer :: fp ! patch filter index
+ real(r8):: am ! rate for fractional mortality (1/yr)
+ real(r8):: m ! rate for fractional mortality (1/s)
+ real(r8):: mort_max ! asymptotic max mortality rate (/yr)
+ real(r8):: k_mort = 0.3_r8 ! coeff of growth efficiency in mortality equation
!-----------------------------------------------------------------------
SHR_ASSERT_ALL_FL((ubound(leaf_prof_patch) == (/bounds%endp,nlevdecomp_full/)), sourcefile, __LINE__)
@@ -287,7 +287,7 @@ subroutine CNGap_PatchToColumn (bounds, num_soilc, filter_soilc, &
! assigns them to the three litter pools
!
! !USES:
- use clm_varpar , only : maxsoil_patches, nlevdecomp, nlevdecomp_full
+ use clm_varpar , only : maxsoil_patches, nlevdecomp, nlevdecomp_full, i_litr_min, i_litr_max, i_met_lit
!
! !ARGUMENTS:
type(bounds_type) , intent(in) :: bounds
@@ -301,7 +301,7 @@ subroutine CNGap_PatchToColumn (bounds, num_soilc, filter_soilc, &
real(r8) , intent(in) :: stem_prof_patch(bounds%begp:,1:)
!
! !LOCAL VARIABLES:
- integer :: fc,c,pi,p,j ! indices
+ integer :: fc,c,pi,p,j,i ! indices
!-----------------------------------------------------------------------
SHR_ASSERT_ALL_FL((ubound(leaf_prof_patch) == (/bounds%endp,nlevdecomp_full/)), sourcefile, __LINE__)
@@ -318,12 +318,8 @@ subroutine CNGap_PatchToColumn (bounds, num_soilc, filter_soilc, &
ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type
wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] patch weight relative to column (0-1)
- lf_flab => pftcon%lf_flab , & ! Input: [real(r8) (:) ] leaf litter labile fraction
- lf_fcel => pftcon%lf_fcel , & ! Input: [real(r8) (:) ] leaf litter cellulose fraction
- lf_flig => pftcon%lf_flig , & ! Input: [real(r8) (:) ] leaf litter lignin fraction
- fr_flab => pftcon%fr_flab , & ! Input: [real(r8) (:) ] fine root litter labile fraction
- fr_fcel => pftcon%fr_fcel , & ! Input: [real(r8) (:) ] fine root litter cellulose fraction
- fr_flig => pftcon%fr_flig , & ! Input: [real(r8) (:) ] fine root litter lignin fraction
+ lf_f => pftcon%lf_f , & ! Input: [real(r8) (:,:) ] leaf litter fractions
+ fr_f => pftcon%fr_f , & ! Input: [real(r8) (:,:) ] fine root litter fractions
m_leafc_to_litter => cnveg_carbonflux_inst%m_leafc_to_litter_patch , & ! Input: [real(r8) (:) ]
m_frootc_to_litter => cnveg_carbonflux_inst%m_frootc_to_litter_patch , & ! Input: [real(r8) (:) ]
@@ -345,9 +341,7 @@ subroutine CNGap_PatchToColumn (bounds, num_soilc, filter_soilc, &
m_livecrootc_xfer_to_litter => cnveg_carbonflux_inst%m_livecrootc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ]
m_deadcrootc_xfer_to_litter => cnveg_carbonflux_inst%m_deadcrootc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ]
m_gresp_xfer_to_litter => cnveg_carbonflux_inst%m_gresp_xfer_to_litter_patch , & ! Input: [real(r8) (:) ]
- gap_mortality_c_to_litr_met_c => cnveg_carbonflux_inst%gap_mortality_c_to_litr_met_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with gap mortality to litter metabolic pool (gC/m3/s)
- gap_mortality_c_to_litr_cel_c => cnveg_carbonflux_inst%gap_mortality_c_to_litr_cel_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with gap mortality to litter cellulose pool (gC/m3/s)
- gap_mortality_c_to_litr_lig_c => cnveg_carbonflux_inst%gap_mortality_c_to_litr_lig_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with gap mortality to litter lignin pool (gC/m3/s)
+ gap_mortality_c_to_litr_c => cnveg_carbonflux_inst%gap_mortality_c_to_litr_c_col , & ! Output: [real(r8) (:,:,:) ] C fluxes associated with gap mortality to litter pools (gC/m3/s)
gap_mortality_c_to_cwdc => cnveg_carbonflux_inst%gap_mortality_c_to_cwdc_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with gap mortality to CWD pool (gC/m3/s)
m_leafn_to_litter => cnveg_nitrogenflux_inst%m_leafn_to_litter_patch , & ! Input: [real(r8) (:) ]
@@ -369,9 +363,7 @@ subroutine CNGap_PatchToColumn (bounds, num_soilc, filter_soilc, &
m_deadstemn_xfer_to_litter => cnveg_nitrogenflux_inst%m_deadstemn_xfer_to_litter_patch , & ! Input: [real(r8) (:) ]
m_livecrootn_xfer_to_litter => cnveg_nitrogenflux_inst%m_livecrootn_xfer_to_litter_patch , & ! Input: [real(r8) (:) ]
m_deadcrootn_xfer_to_litter => cnveg_nitrogenflux_inst%m_deadcrootn_xfer_to_litter_patch , & ! Input: [real(r8) (:) ]
- gap_mortality_n_to_litr_met_n => cnveg_nitrogenflux_inst%gap_mortality_n_to_litr_met_n_col , & ! Output: [real(r8) (:,:) ] N fluxes associated with gap mortality to litter metabolic pool (gN/m3/s)
- gap_mortality_n_to_litr_cel_n => cnveg_nitrogenflux_inst%gap_mortality_n_to_litr_cel_n_col , & ! Output: [real(r8) (:,:) ] N fluxes associated with gap mortality to litter cellulose pool (gN/m3/s)
- gap_mortality_n_to_litr_lig_n => cnveg_nitrogenflux_inst%gap_mortality_n_to_litr_lig_n_col , & ! Output: [real(r8) (:,:) ] N fluxes associated with gap mortality to litter lignin pool (gN/m3/s)
+ gap_mortality_n_to_litr_n => cnveg_nitrogenflux_inst%gap_mortality_n_to_litr_n_col , & ! Output: [real(r8) (:,:,:)] N fluxes associated with gap mortality to litter pools (gN/m3/s)
gap_mortality_n_to_cwdn => cnveg_nitrogenflux_inst%gap_mortality_n_to_cwdn_col & ! Output: [real(r8) (:,:) ] N fluxes associated with gap mortality to CWD pool (gN/m3/s)
)
@@ -385,21 +377,14 @@ subroutine CNGap_PatchToColumn (bounds, num_soilc, filter_soilc, &
if (patch%active(p)) then
- ! leaf gap mortality carbon fluxes
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- gap_mortality_c_to_litr_cel_c(c,j) = gap_mortality_c_to_litr_cel_c(c,j) + &
- m_leafc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- gap_mortality_c_to_litr_lig_c(c,j) = gap_mortality_c_to_litr_lig_c(c,j) + &
- m_leafc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j)
-
- ! fine root gap mortality carbon fluxes
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_frootc_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) * froot_prof(p,j)
- gap_mortality_c_to_litr_cel_c(c,j) = gap_mortality_c_to_litr_cel_c(c,j) + &
- m_frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j)
- gap_mortality_c_to_litr_lig_c(c,j) = gap_mortality_c_to_litr_lig_c(c,j) + &
- m_frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j)
+ do i = i_litr_min, i_litr_max
+ gap_mortality_c_to_litr_c(c,j,i) = &
+ gap_mortality_c_to_litr_c(c,j,i) + &
+ ! leaf gap mortality carbon fluxes
+ m_leafc_to_litter(p) * lf_f(ivt(p),i) * wtcol(p) * leaf_prof(p,j) + &
+ ! fine root gap mortality carbon fluxes
+ m_frootc_to_litter(p) * fr_f(ivt(p),i) * wtcol(p) * froot_prof(p,j)
+ end do
! wood gap mortality carbon fluxes
gap_mortality_c_to_cwdc(c,j) = gap_mortality_c_to_cwdc(c,j) + &
@@ -408,40 +393,30 @@ subroutine CNGap_PatchToColumn (bounds, num_soilc, filter_soilc, &
(m_livecrootc_to_litter(p) + m_deadcrootc_to_litter(p)) * wtcol(p) * croot_prof(p,j)
! storage gap mortality carbon fluxes
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- (m_leafc_storage_to_litter(p) + m_gresp_storage_to_litter(p)) * wtcol(p) * leaf_prof(p,j)
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_frootc_storage_to_litter(p) * wtcol(p) * froot_prof(p,j)
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- (m_livestemc_storage_to_litter(p) + m_deadstemc_storage_to_litter(p)) * wtcol(p) * stem_prof(p,j)
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- (m_livecrootc_storage_to_litter(p) + m_deadcrootc_storage_to_litter(p)) * wtcol(p) * croot_prof(p,j)
+ ! Metabolic litter is treated differently than other types
+ ! of litter, so it gets this additional line after the
+ ! most recent loop over all litter types
+ gap_mortality_c_to_litr_c(c,j,i_met_lit) = &
+ gap_mortality_c_to_litr_c(c,j,i_met_lit) + &
+ (m_leafc_storage_to_litter(p) + m_gresp_storage_to_litter(p)) * wtcol(p) * leaf_prof(p,j) + &
+ m_frootc_storage_to_litter(p) * wtcol(p) * froot_prof(p,j) + &
+ (m_livestemc_storage_to_litter(p) + m_deadstemc_storage_to_litter(p)) * wtcol(p) * stem_prof(p,j) + &
+ (m_livecrootc_storage_to_litter(p) + m_deadcrootc_storage_to_litter(p)) * wtcol(p) * croot_prof(p,j) + &
! transfer gap mortality carbon fluxes
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- (m_leafc_xfer_to_litter(p) + m_gresp_xfer_to_litter(p)) * wtcol(p) * leaf_prof(p,j)
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- m_frootc_xfer_to_litter(p) * wtcol(p) * froot_prof(p,j)
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- (m_livestemc_xfer_to_litter(p) + m_deadstemc_xfer_to_litter(p)) * wtcol(p) * stem_prof(p,j)
- gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + &
- (m_livecrootc_xfer_to_litter(p) + m_deadcrootc_xfer_to_litter(p)) * wtcol(p) * croot_prof(p,j)
-
- ! leaf gap mortality nitrogen fluxes
- gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + &
- m_leafn_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- gap_mortality_n_to_litr_cel_n(c,j) = gap_mortality_n_to_litr_cel_n(c,j) + &
- m_leafn_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- gap_mortality_n_to_litr_lig_n(c,j) = gap_mortality_n_to_litr_lig_n(c,j) + &
- m_leafn_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j)
-
- ! fine root litter nitrogen fluxes
- gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + &
- m_frootn_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) * froot_prof(p,j)
- gap_mortality_n_to_litr_cel_n(c,j) = gap_mortality_n_to_litr_cel_n(c,j) + &
- m_frootn_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j)
- gap_mortality_n_to_litr_lig_n(c,j) = gap_mortality_n_to_litr_lig_n(c,j) + &
- m_frootn_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j)
+ (m_leafc_xfer_to_litter(p) + m_gresp_xfer_to_litter(p)) * wtcol(p) * leaf_prof(p,j) + &
+ m_frootc_xfer_to_litter(p) * wtcol(p) * froot_prof(p,j) + &
+ (m_livestemc_xfer_to_litter(p) + m_deadstemc_xfer_to_litter(p)) * wtcol(p) * stem_prof(p,j) + &
+ (m_livecrootc_xfer_to_litter(p) + m_deadcrootc_xfer_to_litter(p)) * wtcol(p) * croot_prof(p,j)
+
+ do i = i_litr_min, i_litr_max
+ gap_mortality_n_to_litr_n(c,j,i) = &
+ gap_mortality_n_to_litr_n(c,j,i) + &
+ ! leaf gap mortality nitrogen fluxes
+ m_leafn_to_litter(p) * lf_f(ivt(p),i) * wtcol(p) * leaf_prof(p,j) + &
+ ! fine root litter nitrogen fluxes
+ m_frootn_to_litter(p) * fr_f(ivt(p),i) * wtcol(p) * froot_prof(p,j)
+ end do
! wood gap mortality nitrogen fluxes
gap_mortality_n_to_cwdn(c,j) = gap_mortality_n_to_cwdn(c,j) + &
@@ -449,30 +424,23 @@ subroutine CNGap_PatchToColumn (bounds, num_soilc, filter_soilc, &
gap_mortality_n_to_cwdn(c,j) = gap_mortality_n_to_cwdn(c,j) + &
(m_livecrootn_to_litter(p) + m_deadcrootn_to_litter(p)) * wtcol(p) * croot_prof(p,j)
- ! retranslocated N pool gap mortality fluxes
- gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + &
- m_retransn_to_litter(p) * wtcol(p) * leaf_prof(p,j)
-
- ! storage gap mortality nitrogen fluxes
- gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + &
- m_leafn_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j)
- gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + &
- m_frootn_storage_to_litter(p) * wtcol(p) * froot_prof(p,j)
- gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + &
- (m_livestemn_storage_to_litter(p) + m_deadstemn_storage_to_litter(p)) * wtcol(p) * stem_prof(p,j)
- gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + &
- (m_livecrootn_storage_to_litter(p) + m_deadcrootn_storage_to_litter(p)) * wtcol(p) * croot_prof(p,j)
-
- ! transfer gap mortality nitrogen fluxes
- gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + &
- m_leafn_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j)
- gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + &
- m_frootn_xfer_to_litter(p) * wtcol(p) * froot_prof(p,j)
- gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + &
- (m_livestemn_xfer_to_litter(p) + m_deadstemn_xfer_to_litter(p)) * wtcol(p) * stem_prof(p,j)
- gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + &
- (m_livecrootn_xfer_to_litter(p) + m_deadcrootn_xfer_to_litter(p)) * wtcol(p) * croot_prof(p,j)
-
+ ! Metabolic litter is treated differently than other types
+ ! of litter, so it gets this additional line after the
+ ! most recent loop over all litter types
+ gap_mortality_n_to_litr_n(c,j,i_met_lit) = &
+ gap_mortality_n_to_litr_n(c,j,i_met_lit) + &
+ ! retranslocated N pool gap mortality fluxes
+ m_retransn_to_litter(p) * wtcol(p) * leaf_prof(p,j) + &
+ ! storage gap mortality nitrogen fluxes
+ m_leafn_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j) + &
+ m_frootn_storage_to_litter(p) * wtcol(p) * froot_prof(p,j) + &
+ (m_livestemn_storage_to_litter(p) + m_deadstemn_storage_to_litter(p)) * wtcol(p) * stem_prof(p,j) + &
+ (m_livecrootn_storage_to_litter(p) + m_deadcrootn_storage_to_litter(p)) * wtcol(p) * croot_prof(p,j) + &
+ ! transfer gap mortality nitrogen fluxes
+ m_leafn_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j) + &
+ m_frootn_xfer_to_litter(p) * wtcol(p) * froot_prof(p,j) + &
+ (m_livestemn_xfer_to_litter(p) + m_deadstemn_xfer_to_litter(p)) * wtcol(p) * stem_prof(p,j) + &
+ (m_livecrootn_xfer_to_litter(p) + m_deadcrootn_xfer_to_litter(p)) * wtcol(p) * croot_prof(p,j)
end if
end if
diff --git a/src/biogeochem/CNNStateUpdate1Mod.F90 b/src/biogeochem/CNNStateUpdate1Mod.F90
index bee931e7fc..72a7ff64e3 100644
--- a/src/biogeochem/CNNStateUpdate1Mod.F90
+++ b/src/biogeochem/CNNStateUpdate1Mod.F90
@@ -7,8 +7,8 @@ module CNNStateUpdate1Mod
! !USES:
use shr_kind_mod , only: r8 => shr_kind_r8
use clm_time_manager , only : get_step_size_real
- use clm_varpar , only : nlevdecomp, ndecomp_pools, ndecomp_cascade_transitions
- use clm_varpar , only : i_met_lit, i_cel_lit, i_lig_lit, i_cwd
+ use clm_varpar , only : nlevdecomp
+ use clm_varpar , only : i_litr_min, i_litr_max, i_cwd
use clm_varctl , only : iulog, use_nitrif_denitrif
use clm_varcon , only : nitrif_n2o_loss_frac
use pftconMod , only : npcropmin, pftcon
@@ -49,6 +49,7 @@ subroutine NStateUpdateDynPatch(bounds, num_soilc_with_inactive, filter_soilc_wi
integer :: g ! gridcell index
integer :: fc ! column filter index
integer :: j ! level index
+ integer :: i ! litter pool index
real(r8) :: dt ! time step (seconds)
character(len=*), parameter :: subname = 'NStateUpdateDynPatch'
@@ -65,12 +66,11 @@ subroutine NStateUpdateDynPatch(bounds, num_soilc_with_inactive, filter_soilc_wi
do j = 1, nlevdecomp
do fc = 1, num_soilc_with_inactive
c = filter_soilc_with_inactive(fc)
- ns_soil%decomp_npools_vr_col(c,j,i_met_lit) = ns_soil%decomp_npools_vr_col(c,j,i_met_lit) + &
- nf_veg%dwt_frootn_to_litr_met_n_col(c,j) * dt
- ns_soil%decomp_npools_vr_col(c,j,i_cel_lit) = ns_soil%decomp_npools_vr_col(c,j,i_cel_lit) + &
- nf_veg%dwt_frootn_to_litr_cel_n_col(c,j) * dt
- ns_soil%decomp_npools_vr_col(c,j,i_lig_lit) = ns_soil%decomp_npools_vr_col(c,j,i_lig_lit) + &
- nf_veg%dwt_frootn_to_litr_lig_n_col(c,j) * dt
+ do i = i_litr_min, i_litr_max
+ ns_soil%decomp_npools_vr_col(c,j,i) = &
+ ns_soil%decomp_npools_vr_col(c,j,i) + &
+ nf_veg%dwt_frootn_to_litr_n_col(c,j,i) * dt
+ end do
ns_soil%decomp_npools_vr_col(c,j,i_cwd) = ns_soil%decomp_npools_vr_col(c,j,i_cwd) + &
( nf_veg%dwt_livecrootn_to_cwdn_col(c,j) + nf_veg%dwt_deadcrootn_to_cwdn_col(c,j) ) * dt
end do
@@ -104,7 +104,7 @@ subroutine NStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp, &
type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst
!
! !LOCAL VARIABLES:
- integer :: c,p,j,l,g,k ! indices
+ integer :: c,p,j,l,g,k,i ! indices
integer :: fp,fc ! lake filter indices
real(r8):: dt ! radiation time step (seconds)
!-----------------------------------------------------------------------
@@ -128,15 +128,10 @@ subroutine NStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp, &
do j = 1, nlevdecomp
do fc = 1,num_soilc
c = filter_soilc(fc)
-
- nf_soil%decomp_npools_sourcesink_col(c,j,i_met_lit) = &
- nf_veg%phenology_n_to_litr_met_n_col(c,j) * dt
-
- nf_soil%decomp_npools_sourcesink_col(c,j,i_cel_lit) = &
- nf_veg%phenology_n_to_litr_cel_n_col(c,j) * dt
-
- nf_soil%decomp_npools_sourcesink_col(c,j,i_lig_lit) = &
- nf_veg%phenology_n_to_litr_lig_n_col(c,j) * dt
+ do i = i_litr_min, i_litr_max
+ nf_soil%decomp_npools_sourcesink_col(c,j,i) = &
+ nf_veg%phenology_n_to_litr_n_col(c,j,i) * dt
+ end do
! NOTE(wjs, 2017-01-02) This used to be set to a non-zero value, but the
! terms have been moved to CStateUpdateDynPatch. I think this is zeroed every
diff --git a/src/biogeochem/CNNStateUpdate2Mod.F90 b/src/biogeochem/CNNStateUpdate2Mod.F90
index b55a10c299..9b0a794a1a 100644
--- a/src/biogeochem/CNNStateUpdate2Mod.F90
+++ b/src/biogeochem/CNNStateUpdate2Mod.F90
@@ -8,7 +8,7 @@ module CNNStateUpdate2Mod
use shr_kind_mod , only : r8 => shr_kind_r8
use clm_time_manager , only : get_step_size_real
use clm_varpar , only : nlevsoi, nlevdecomp
- use clm_varpar , only : i_met_lit, i_cel_lit, i_lig_lit, i_cwd
+ use clm_varpar , only : i_litr_min, i_litr_max, i_cwd
use clm_varctl , only : iulog
use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type
use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type
@@ -44,7 +44,7 @@ subroutine NStateUpdate2(num_soilc, filter_soilc, num_soilp, filter_soilp, &
type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst
!
! !LOCAL VARIABLES:
- integer :: c,p,j,l ! indices
+ integer :: c,p,j,l,i ! indices
integer :: fp,fc ! lake filter indices
real(r8) :: dt ! radiation time step (seconds)
!-----------------------------------------------------------------------
@@ -63,13 +63,13 @@ subroutine NStateUpdate2(num_soilc, filter_soilc, num_soilp, filter_soilp, &
do j = 1, nlevdecomp
do fc = 1,num_soilc
c = filter_soilc(fc)
-
- ns_soil%decomp_npools_vr_col(c,j,i_met_lit) = &
- ns_soil%decomp_npools_vr_col(c,j,i_met_lit) + nf_veg%gap_mortality_n_to_litr_met_n_col(c,j) * dt
- ns_soil%decomp_npools_vr_col(c,j,i_cel_lit) = &
- ns_soil%decomp_npools_vr_col(c,j,i_cel_lit) + nf_veg%gap_mortality_n_to_litr_cel_n_col(c,j) * dt
- ns_soil%decomp_npools_vr_col(c,j,i_lig_lit) = &
- ns_soil%decomp_npools_vr_col(c,j,i_lig_lit) + nf_veg%gap_mortality_n_to_litr_lig_n_col(c,j) * dt
+ do i = i_litr_min, i_litr_max
+ ns_soil%decomp_npools_vr_col(c,j,i) = &
+ ns_soil%decomp_npools_vr_col(c,j,i) + &
+ nf_veg%gap_mortality_n_to_litr_n_col(c,j,i) * dt
+ end do
+ ! Currently i_cwd .ne. i_litr_max + 1 if .not. fates and
+ ! i_cwd = 0 if fates, so not including in the i-loop
ns_soil%decomp_npools_vr_col(c,j,i_cwd) = &
ns_soil%decomp_npools_vr_col(c,j,i_cwd) + nf_veg%gap_mortality_n_to_cwdn_col(c,j) * dt
end do
@@ -150,7 +150,7 @@ subroutine NStateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp, &
type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst
!
! !LOCAL VARIABLES:
- integer :: c,p,j,l ! indices
+ integer :: c,p,j,l,i ! indices
integer :: fp,fc ! lake filter indices
real(r8):: dt ! radiation time step (seconds)
!-----------------------------------------------------------------------
@@ -169,12 +169,13 @@ subroutine NStateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp, &
do j = 1,nlevdecomp
do fc = 1,num_soilc
c = filter_soilc(fc)
- ns_soil%decomp_npools_vr_col(c,j,i_met_lit) = &
- ns_soil%decomp_npools_vr_col(c,j,i_met_lit) + nf_veg%harvest_n_to_litr_met_n_col(c,j) * dt
- ns_soil%decomp_npools_vr_col(c,j,i_cel_lit) = &
- ns_soil%decomp_npools_vr_col(c,j,i_cel_lit) + nf_veg%harvest_n_to_litr_cel_n_col(c,j) * dt
- ns_soil%decomp_npools_vr_col(c,j,i_lig_lit) = &
- ns_soil%decomp_npools_vr_col(c,j,i_lig_lit) + nf_veg%harvest_n_to_litr_lig_n_col(c,j) * dt
+ do i = i_litr_min, i_litr_max
+ ns_soil%decomp_npools_vr_col(c,j,i) = &
+ ns_soil%decomp_npools_vr_col(c,j,i) + &
+ nf_veg%harvest_n_to_litr_n_col(c,j,i) * dt
+ end do
+ ! Currently i_cwd .ne. i_litr_max + 1 if .not. fates and
+ ! i_cwd = 0 if fates, so not including in the i-loop
ns_soil%decomp_npools_vr_col(c,j,i_cwd) = &
ns_soil%decomp_npools_vr_col(c,j,i_cwd) + nf_veg%harvest_n_to_cwdn_col(c,j) * dt
end do
diff --git a/src/biogeochem/CNNStateUpdate3Mod.F90 b/src/biogeochem/CNNStateUpdate3Mod.F90
index 64ca7b51eb..d9753957f2 100644
--- a/src/biogeochem/CNNStateUpdate3Mod.F90
+++ b/src/biogeochem/CNNStateUpdate3Mod.F90
@@ -10,7 +10,7 @@ module CNNStateUpdate3Mod
use clm_varpar , only: nlevdecomp, ndecomp_pools
use clm_time_manager , only : get_step_size_real
use clm_varctl , only : iulog, use_nitrif_denitrif
- use clm_varpar , only : i_cwd, i_met_lit, i_cel_lit, i_lig_lit
+ use clm_varpar , only : i_litr_min, i_litr_max, i_cwd
use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type
use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type
use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type
@@ -84,12 +84,11 @@ subroutine NStateUpdate3(num_soilc, filter_soilc, num_soilp, filter_soilp, &
nf_veg%fire_mortality_n_to_cwdn_col(c,j) * dt
! patch-level wood to column-level litter (uncombusted wood)
- ns_soil%decomp_npools_vr_col(c,j,i_met_lit) = ns_soil%decomp_npools_vr_col(c,j,i_met_lit) + &
- nf_veg%m_n_to_litr_met_fire_col(c,j)* dt
- ns_soil%decomp_npools_vr_col(c,j,i_cel_lit) = ns_soil%decomp_npools_vr_col(c,j,i_cel_lit) + &
- nf_veg%m_n_to_litr_cel_fire_col(c,j)* dt
- ns_soil%decomp_npools_vr_col(c,j,i_lig_lit) = ns_soil%decomp_npools_vr_col(c,j,i_lig_lit) + &
- nf_veg%m_n_to_litr_lig_fire_col(c,j)* dt
+ do k = i_litr_min, i_litr_max
+ ns_soil%decomp_npools_vr_col(c,j,k) = &
+ ns_soil%decomp_npools_vr_col(c,j,k) + &
+ nf_veg%m_n_to_litr_fire_col(c,j,k) * dt
+ end do
end do ! end of column loop
end do
diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90
index e81883ea91..b01294e45b 100644
--- a/src/biogeochem/CNPhenologyMod.F90
+++ b/src/biogeochem/CNPhenologyMod.F90
@@ -15,6 +15,7 @@ module CNPhenologyMod
use shr_sys_mod , only : shr_sys_flush
use decompMod , only : bounds_type
use clm_varpar , only : maxveg, nlevdecomp_full
+ use clm_varpar , only : i_litr_min, i_litr_max
use clm_varctl , only : iulog, use_cndv
use clm_varcon , only : tfrz
use abortutils , only : endrun
@@ -2914,7 +2915,7 @@ subroutine CNLitterToColumn (bounds, num_soilc, filter_soilc, &
real(r8) , intent(in) :: froot_prof_patch(bounds%begp:,1:)
!
! !LOCAL VARIABLES:
- integer :: fc,c,pi,p,j ! indices
+ integer :: fc,c,pi,p,j,i ! indices
!-----------------------------------------------------------------------
SHR_ASSERT_ALL_FL((ubound(leaf_prof_patch) == (/bounds%endp,nlevdecomp_full/)), sourcefile, __LINE__)
@@ -2927,28 +2928,20 @@ subroutine CNLitterToColumn (bounds, num_soilc, filter_soilc, &
ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type
wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] weight (relative to column) for this patch (0-1)
- lf_flab => pftcon%lf_flab , & ! Input: leaf litter labile fraction
- lf_fcel => pftcon%lf_fcel , & ! Input: leaf litter cellulose fraction
- lf_flig => pftcon%lf_flig , & ! Input: leaf litter lignin fraction
- fr_flab => pftcon%fr_flab , & ! Input: fine root litter labile fraction
- fr_fcel => pftcon%fr_fcel , & ! Input: fine root litter cellulose fraction
- fr_flig => pftcon%fr_flig , & ! Input: fine root litter lignin fraction
+ lf_f => pftcon%lf_f , & ! Input: leaf litter fractions
+ fr_f => pftcon%fr_f , & ! Input: fine root litter fractions
leafc_to_litter => cnveg_carbonflux_inst%leafc_to_litter_patch , & ! Input: [real(r8) (:) ] leaf C litterfall (gC/m2/s)
frootc_to_litter => cnveg_carbonflux_inst%frootc_to_litter_patch , & ! Input: [real(r8) (:) ] fine root N litterfall (gN/m2/s)
livestemc_to_litter => cnveg_carbonflux_inst%livestemc_to_litter_patch , & ! Input: [real(r8) (:) ] live stem C litterfall (gC/m2/s)
grainc_to_food => cnveg_carbonflux_inst%grainc_to_food_patch , & ! Input: [real(r8) (:) ] grain C to food (gC/m2/s)
- phenology_c_to_litr_met_c => cnveg_carbonflux_inst%phenology_c_to_litr_met_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with phenology (litterfall and crop) to litter metabolic pool (gC/m3/s)
- phenology_c_to_litr_cel_c => cnveg_carbonflux_inst%phenology_c_to_litr_cel_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with phenology (litterfall and crop) to litter cellulose pool (gC/m3/s)
- phenology_c_to_litr_lig_c => cnveg_carbonflux_inst%phenology_c_to_litr_lig_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with phenology (litterfall and crop) to litter lignin pool (gC/m3/s)
+ phenology_c_to_litr_c => cnveg_carbonflux_inst%phenology_c_to_litr_c_col , & ! Output: [real(r8) (:,:,:) ] C fluxes associated with phenology (litterfall and crop) to litter pools (gC/m3/s)
livestemn_to_litter => cnveg_nitrogenflux_inst%livestemn_to_litter_patch , & ! Input: [real(r8) (:) ] livestem N to litter (gN/m2/s)
grainn_to_food => cnveg_nitrogenflux_inst%grainn_to_food_patch , & ! Input: [real(r8) (:) ] grain N to food (gN/m2/s)
leafn_to_litter => cnveg_nitrogenflux_inst%leafn_to_litter_patch , & ! Input: [real(r8) (:) ] leaf N litterfall (gN/m2/s)
frootn_to_litter => cnveg_nitrogenflux_inst%frootn_to_litter_patch , & ! Input: [real(r8) (:) ] fine root N litterfall (gN/m2/s)
- phenology_n_to_litr_met_n => cnveg_nitrogenflux_inst%phenology_n_to_litr_met_n_col , & ! Output: [real(r8) (:,:) ] N fluxes associated with phenology (litterfall and crop) to litter metabolic pool (gN/m3/s)
- phenology_n_to_litr_cel_n => cnveg_nitrogenflux_inst%phenology_n_to_litr_cel_n_col , & ! Output: [real(r8) (:,:) ] N fluxes associated with phenology (litterfall and crop) to litter cellulose pool (gN/m3/s)
- phenology_n_to_litr_lig_n => cnveg_nitrogenflux_inst%phenology_n_to_litr_lig_n_col & ! Output: [real(r8) (:,:) ] N fluxes associated with phenology (litterfall and crop) to litter lignin pool (gN/m3/s)
+ phenology_n_to_litr_n => cnveg_nitrogenflux_inst%phenology_n_to_litr_n_col & ! Output: [real(r8) (:,:,:) ] N fluxes associated with phenology (litterfall and crop) to litter pools (gN/m3/s)
)
do j = 1, nlevdecomp
@@ -2960,37 +2953,27 @@ subroutine CNLitterToColumn (bounds, num_soilc, filter_soilc, &
p = col%patchi(c) + pi - 1
if (patch%active(p)) then
- ! leaf litter carbon fluxes
- phenology_c_to_litr_met_c(c,j) = phenology_c_to_litr_met_c(c,j) &
- + leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- phenology_c_to_litr_cel_c(c,j) = phenology_c_to_litr_cel_c(c,j) &
- + leafc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- phenology_c_to_litr_lig_c(c,j) = phenology_c_to_litr_lig_c(c,j) &
- + leafc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j)
-
- ! leaf litter nitrogen fluxes
- phenology_n_to_litr_met_n(c,j) = phenology_n_to_litr_met_n(c,j) &
- + leafn_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- phenology_n_to_litr_cel_n(c,j) = phenology_n_to_litr_cel_n(c,j) &
- + leafn_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- phenology_n_to_litr_lig_n(c,j) = phenology_n_to_litr_lig_n(c,j) &
- + leafn_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j)
-
- ! fine root litter carbon fluxes
- phenology_c_to_litr_met_c(c,j) = phenology_c_to_litr_met_c(c,j) &
- + frootc_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) * froot_prof(p,j)
- phenology_c_to_litr_cel_c(c,j) = phenology_c_to_litr_cel_c(c,j) &
- + frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j)
- phenology_c_to_litr_lig_c(c,j) = phenology_c_to_litr_lig_c(c,j) &
- + frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j)
-
- ! fine root litter nitrogen fluxes
- phenology_n_to_litr_met_n(c,j) = phenology_n_to_litr_met_n(c,j) &
- + frootn_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) * froot_prof(p,j)
- phenology_n_to_litr_cel_n(c,j) = phenology_n_to_litr_cel_n(c,j) &
- + frootn_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j)
- phenology_n_to_litr_lig_n(c,j) = phenology_n_to_litr_lig_n(c,j) &
- + frootn_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j)
+ do i = i_litr_min, i_litr_max
+ ! leaf litter carbon fluxes
+ phenology_c_to_litr_c(c,j,i) = &
+ phenology_c_to_litr_c(c,j,i) + &
+ leafc_to_litter(p) * lf_f(ivt(p),i) * wtcol(p) * leaf_prof(p,j)
+
+ ! leaf litter nitrogen fluxes
+ phenology_n_to_litr_n(c,j,i) = &
+ phenology_n_to_litr_n(c,j,i) + &
+ leafn_to_litter(p) * lf_f(ivt(p),i) * wtcol(p) * leaf_prof(p,j)
+
+ ! fine root litter carbon fluxes
+ phenology_c_to_litr_c(c,j,i) = &
+ phenology_c_to_litr_c(c,j,i) + &
+ frootc_to_litter(p) * fr_f(ivt(p),i) * wtcol(p) * froot_prof(p,j)
+
+ ! fine root litter nitrogen fluxes
+ phenology_n_to_litr_n(c,j,i) = &
+ phenology_n_to_litr_n(c,j,i) + &
+ frootn_to_litter(p) * fr_f(ivt(p),i) * wtcol(p) * froot_prof(p,j)
+ end do
! agroibis puts crop stem litter together with leaf litter
! so I've used the leaf lf_f* parameters instead of making
@@ -2998,38 +2981,30 @@ subroutine CNLitterToColumn (bounds, num_soilc, filter_soilc, &
! also for simplicity I've put "food" into the litter pools
if (ivt(p) >= npcropmin) then ! add livestemc to litter
- ! stem litter carbon fluxes
- phenology_c_to_litr_met_c(c,j) = phenology_c_to_litr_met_c(c,j) &
- + livestemc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- phenology_c_to_litr_cel_c(c,j) = phenology_c_to_litr_cel_c(c,j) &
- + livestemc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- phenology_c_to_litr_lig_c(c,j) = phenology_c_to_litr_lig_c(c,j) &
- + livestemc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j)
-
- ! stem litter nitrogen fluxes
- phenology_n_to_litr_met_n(c,j) = phenology_n_to_litr_met_n(c,j) &
- + livestemn_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- phenology_n_to_litr_cel_n(c,j) = phenology_n_to_litr_cel_n(c,j) &
- + livestemn_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- phenology_n_to_litr_lig_n(c,j) = phenology_n_to_litr_lig_n(c,j) &
- + livestemn_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j)
+ do i = i_litr_min, i_litr_max
+ ! stem litter carbon fluxes
+ phenology_c_to_litr_c(c,j,i) = &
+ phenology_c_to_litr_c(c,j,i) + &
+ livestemc_to_litter(p) * lf_f(ivt(p),i) * wtcol(p) * leaf_prof(p,j)
+
+ ! stem litter nitrogen fluxes
+ phenology_n_to_litr_n(c,j,i) = &
+ phenology_n_to_litr_n(c,j,i) + &
+ livestemn_to_litter(p) * lf_f(ivt(p),i) * wtcol(p) * leaf_prof(p,j)
+ end do
if (.not. use_grainproduct) then
- ! grain litter carbon fluxes
- phenology_c_to_litr_met_c(c,j) = phenology_c_to_litr_met_c(c,j) &
- + grainc_to_food(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- phenology_c_to_litr_cel_c(c,j) = phenology_c_to_litr_cel_c(c,j) &
- + grainc_to_food(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- phenology_c_to_litr_lig_c(c,j) = phenology_c_to_litr_lig_c(c,j) &
- + grainc_to_food(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j)
+ do i = i_litr_min, i_litr_max
+ ! grain litter carbon fluxes
+ phenology_c_to_litr_c(c,j,i) = &
+ phenology_c_to_litr_c(c,j,i) + &
+ grainc_to_food(p) * lf_f(ivt(p),i) * wtcol(p) * leaf_prof(p,j)
- ! grain litter nitrogen fluxes
- phenology_n_to_litr_met_n(c,j) = phenology_n_to_litr_met_n(c,j) &
- + grainn_to_food(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- phenology_n_to_litr_cel_n(c,j) = phenology_n_to_litr_cel_n(c,j) &
- + grainn_to_food(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- phenology_n_to_litr_lig_n(c,j) = phenology_n_to_litr_lig_n(c,j) &
- + grainn_to_food(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j)
+ ! grain litter nitrogen fluxes
+ phenology_n_to_litr_n(c,j,i) = &
+ phenology_n_to_litr_n(c,j,i) + &
+ grainn_to_food(p) * lf_f(ivt(p),i) * wtcol(p) * leaf_prof(p,j)
+ end do
end if
diff --git a/src/biogeochem/CNProductsMod.F90 b/src/biogeochem/CNProductsMod.F90
index 0586815ee1..617672d78c 100644
--- a/src/biogeochem/CNProductsMod.F90
+++ b/src/biogeochem/CNProductsMod.F90
@@ -493,9 +493,9 @@ subroutine UpdateProducts(this, bounds, &
! calculate losses from product pools
! the following (1/s) rate constants result in ~90% loss of initial state over 1, 10 and 100 years,
! respectively, using a discrete-time fractional decay algorithm.
- kprod1 = 7.2e-8
- kprod10 = 7.2e-9
- kprod100 = 7.2e-10
+ kprod1 = 7.2e-8_r8
+ kprod10 = 7.2e-9_r8
+ kprod100 = 7.2e-10_r8
do g = bounds%begg, bounds%endg
! calculate fluxes out of product pools (1/sec)
diff --git a/src/biogeochem/CNVegCarbonFluxType.F90 b/src/biogeochem/CNVegCarbonFluxType.F90
index 16b0ada09b..9eb226d67f 100644
--- a/src/biogeochem/CNVegCarbonFluxType.F90
+++ b/src/biogeochem/CNVegCarbonFluxType.F90
@@ -11,7 +11,7 @@ module CNVegCarbonFluxType
use decompMod , only : bounds_type
use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con
use clm_varpar , only : ndecomp_cascade_transitions, ndecomp_pools
- use clm_varpar , only : nlevdecomp_full, nlevgrnd, nlevdecomp
+ use clm_varpar , only : nlevdecomp_full, nlevdecomp, i_litr_min, i_litr_max
use clm_varcon , only : spval, dzsoi_decomp
use clm_varctl , only : use_cndv, use_c13, use_nitrif_denitrif, use_crop
use clm_varctl , only : use_grainproduct
@@ -230,23 +230,17 @@ module CNVegCarbonFluxType
real(r8), pointer :: livecrootc_to_deadcrootc_patch (:) ! live coarse root C turnover (gC/m2/s)
! phenology: litterfall and crop fluxes
- real(r8), pointer :: phenology_c_to_litr_met_c_col (:,:) ! C fluxes associated with phenology (litterfall and crop) to litter metabolic pool (gC/m3/s)
- real(r8), pointer :: phenology_c_to_litr_cel_c_col (:,:) ! C fluxes associated with phenology (litterfall and crop) to litter cellulose pool (gC/m3/s)
- real(r8), pointer :: phenology_c_to_litr_lig_c_col (:,:) ! C fluxes associated with phenology (litterfall and crop) to litter lignin pool (gC/m3/s)
+ real(r8), pointer :: phenology_c_to_litr_c_col (:,:,:) ! C fluxes associated with phenology (litterfall and crop) to litter pools (gC/m3/s)
! gap mortality
- real(r8), pointer :: gap_mortality_c_to_litr_met_c_col (:,:) ! C fluxes associated with gap mortality to litter metabolic pool (gC/m3/s)
- real(r8), pointer :: gap_mortality_c_to_litr_cel_c_col (:,:) ! C fluxes associated with gap mortality to litter cellulose pool (gC/m3/s)
- real(r8), pointer :: gap_mortality_c_to_litr_lig_c_col (:,:) ! C fluxes associated with gap mortality to litter lignin pool (gC/m3/s)
+ real(r8), pointer :: gap_mortality_c_to_litr_c_col (:,:,:) ! C fluxes associated with gap mortality to litter pools (gC/m3/s)
real(r8), pointer :: gap_mortality_c_to_cwdc_col (:,:) ! C fluxes associated with gap mortality to CWD pool (gC/m3/s)
! fire
real(r8), pointer :: fire_mortality_c_to_cwdc_col (:,:) ! C fluxes associated with fire mortality to CWD pool (gC/m3/s)
! harvest
- real(r8), pointer :: harvest_c_to_litr_met_c_col (:,:) ! C fluxes associated with harvest to litter metabolic pool (gC/m3/s)
- real(r8), pointer :: harvest_c_to_litr_cel_c_col (:,:) ! C fluxes associated with harvest to litter cellulose pool (gC/m3/s)
- real(r8), pointer :: harvest_c_to_litr_lig_c_col (:,:) ! C fluxes associated with harvest to litter lignin pool (gC/m3/s)
+ real(r8), pointer :: harvest_c_to_litr_c_col (:,:,:) ! C fluxes associated with harvest to litter pools (gC/m3/s)
real(r8), pointer :: harvest_c_to_cwdc_col (:,:) ! C fluxes associated with harvest to CWD pool (gC/m3/s)
real(r8), pointer :: grainc_to_cropprodc_patch (:) ! grain C to crop product pool (gC/m2/s)
real(r8), pointer :: grainc_to_cropprodc_col (:) ! grain C to crop product pool (gC/m2/s)
@@ -254,9 +248,7 @@ module CNVegCarbonFluxType
! fire fluxes
real(r8), pointer :: m_decomp_cpools_to_fire_vr_col (:,:,:) ! vertically-resolved decomposing C fire loss (gC/m3/s)
real(r8), pointer :: m_decomp_cpools_to_fire_col (:,:) ! vertically-integrated (diagnostic) decomposing C fire loss (gC/m2/s)
- real(r8), pointer :: m_c_to_litr_met_fire_col (:,:) ! C from leaf, froot, xfer and storage C to litter labile C by fire (gC/m3/s)
- real(r8), pointer :: m_c_to_litr_cel_fire_col (:,:) ! C from leaf, froot, xfer and storage C to litter cellulose C by fire (gC/m3/s)
- real(r8), pointer :: m_c_to_litr_lig_fire_col (:,:) ! C from leaf, froot, xfer and storage C to litter lignin C by fire (gC/m3/s)
+ real(r8), pointer :: m_c_to_litr_fire_col (:,:,:) ! C from leaf, froot, xfer and storage C to litter C by fire (gC/m3/s)
! dynamic landcover fluxes
real(r8), pointer :: dwt_seedc_to_leaf_patch (:) ! (gC/m2/s) seed source to patch-level; although this is a patch-level flux, it is expressed per unit GRIDCELL area
@@ -270,9 +262,7 @@ module CNVegCarbonFluxType
real(r8), pointer :: dwt_crop_productc_gain_patch (:) ! (gC/m2/s) addition to crop product pools from landcover change; although this is a patch-level flux, it is expressed per unit GRIDCELL area
real(r8), pointer :: dwt_slash_cflux_patch (:) ! (gC/m2/s) conversion slash flux due to landcover change
real(r8), pointer :: dwt_slash_cflux_grc (:) ! (gC/m2/s) dwt_slash_cflux_patch summed to the gridcell-level
- real(r8), pointer :: dwt_frootc_to_litr_met_c_col (:,:) ! (gC/m3/s) fine root to litter due to landcover change
- real(r8), pointer :: dwt_frootc_to_litr_cel_c_col (:,:) ! (gC/m3/s) fine root to litter due to landcover change
- real(r8), pointer :: dwt_frootc_to_litr_lig_c_col (:,:) ! (gC/m3/s) fine root to litter due to landcover change
+ real(r8), pointer :: dwt_frootc_to_litr_c_col (:,:,:) ! (gC/m3/s) fine root to litter due to landcover change
real(r8), pointer :: dwt_livecrootc_to_cwdc_col (:,:) ! (gC/m3/s) live coarse root to CWD due to landcover change
real(r8), pointer :: dwt_deadcrootc_to_cwdc_col (:,:) ! (gC/m3/s) dead coarse root to CWD due to landcover change
@@ -292,7 +282,6 @@ module CNVegCarbonFluxType
real(r8), pointer :: xsmrpool_recover_patch (:) ! (gC/m2/s) C flux assigned to recovery of negative cpool
real(r8), pointer :: xsmrpool_c13ratio_patch (:) ! C13/C(12+13) ratio for xsmrpool (proportion)
- real(r8), pointer :: cwdc_hr_col (:) ! (gC/m2/s) col-level coarse woody debris C heterotrophic respiration
real(r8), pointer :: cwdc_loss_col (:) ! (gC/m2/s) col-level coarse woody debris C loss
real(r8), pointer :: litterc_loss_col (:) ! (gC/m2/s) col-level litter C loss
real(r8), pointer :: frootc_alloc_patch (:) ! (gC/m2/s) patch-level fine root C alloc
@@ -622,31 +611,22 @@ subroutine InitAllocate(this, bounds, carbon_type)
allocate(this%woodc_alloc_patch (begp:endp)) ; this%woodc_alloc_patch (:) = nan
allocate(this%woodc_loss_patch (begp:endp)) ; this%woodc_loss_patch (:) = nan
- allocate(this%phenology_c_to_litr_met_c_col (begc:endc,1:nlevdecomp_full));
- this%phenology_c_to_litr_met_c_col (:,:)=nan
-
- allocate(this%phenology_c_to_litr_cel_c_col (begc:endc,1:nlevdecomp_full)); this%phenology_c_to_litr_cel_c_col (:,:)=nan
- allocate(this%phenology_c_to_litr_lig_c_col (begc:endc,1:nlevdecomp_full)); this%phenology_c_to_litr_lig_c_col (:,:)=nan
-
- allocate(this%gap_mortality_c_to_litr_met_c_col (begc:endc,1:nlevdecomp_full)); this%gap_mortality_c_to_litr_met_c_col(:,:)=nan
- allocate(this%gap_mortality_c_to_litr_cel_c_col (begc:endc,1:nlevdecomp_full)); this%gap_mortality_c_to_litr_cel_c_col(:,:)=nan
- allocate(this%gap_mortality_c_to_litr_lig_c_col (begc:endc,1:nlevdecomp_full)); this%gap_mortality_c_to_litr_lig_c_col(:,:)=nan
+ ! Third dimension not i_litr_max because that parameter may obtain its
+ ! value after we've been through here
+ allocate(this%phenology_c_to_litr_c_col (begc:endc,1:nlevdecomp_full,1:ndecomp_pools)); this%phenology_c_to_litr_c_col (:,:,:)=nan
+ allocate(this%gap_mortality_c_to_litr_c_col (begc:endc,1:nlevdecomp_full,1:ndecomp_pools)); this%gap_mortality_c_to_litr_c_col(:,:,:)=nan
allocate(this%gap_mortality_c_to_cwdc_col (begc:endc,1:nlevdecomp_full)); this%gap_mortality_c_to_cwdc_col (:,:)=nan
allocate(this%fire_mortality_c_to_cwdc_col (begc:endc,1:nlevdecomp_full)); this%fire_mortality_c_to_cwdc_col (:,:)=nan
- allocate(this%m_c_to_litr_met_fire_col (begc:endc,1:nlevdecomp_full)); this%m_c_to_litr_met_fire_col (:,:)=nan
- allocate(this%m_c_to_litr_cel_fire_col (begc:endc,1:nlevdecomp_full)); this%m_c_to_litr_cel_fire_col (:,:)=nan
- allocate(this%m_c_to_litr_lig_fire_col (begc:endc,1:nlevdecomp_full)); this%m_c_to_litr_lig_fire_col (:,:)=nan
- allocate(this%harvest_c_to_litr_met_c_col (begc:endc,1:nlevdecomp_full)); this%harvest_c_to_litr_met_c_col (:,:)=nan
- allocate(this%harvest_c_to_litr_cel_c_col (begc:endc,1:nlevdecomp_full)); this%harvest_c_to_litr_cel_c_col (:,:)=nan
- allocate(this%harvest_c_to_litr_lig_c_col (begc:endc,1:nlevdecomp_full)); this%harvest_c_to_litr_lig_c_col (:,:)=nan
+ allocate(this%m_c_to_litr_fire_col (begc:endc,1:nlevdecomp_full,1:ndecomp_pools)); this%m_c_to_litr_fire_col (:,:,:)=nan
+ allocate(this%harvest_c_to_litr_c_col (begc:endc,1:nlevdecomp_full,1:ndecomp_pools)); this%harvest_c_to_litr_c_col (:,:,:)=nan
allocate(this%harvest_c_to_cwdc_col (begc:endc,1:nlevdecomp_full)); this%harvest_c_to_cwdc_col (:,:)=nan
allocate(this%dwt_slash_cflux_patch (begp:endp)) ; this%dwt_slash_cflux_patch (:) =nan
allocate(this%dwt_slash_cflux_grc (begg:endg)) ; this%dwt_slash_cflux_grc (:) =nan
- allocate(this%dwt_frootc_to_litr_met_c_col (begc:endc,1:nlevdecomp_full)); this%dwt_frootc_to_litr_met_c_col (:,:)=nan
- allocate(this%dwt_frootc_to_litr_cel_c_col (begc:endc,1:nlevdecomp_full)); this%dwt_frootc_to_litr_cel_c_col (:,:)=nan
- allocate(this%dwt_frootc_to_litr_lig_c_col (begc:endc,1:nlevdecomp_full)); this%dwt_frootc_to_litr_lig_c_col (:,:)=nan
+ ! Third dimension not i_litr_max because that parameter may obtain its
+ ! value after we've been through here
+ allocate(this%dwt_frootc_to_litr_c_col (begc:endc,1:nlevdecomp_full,1:ndecomp_pools)); this%dwt_frootc_to_litr_c_col (:,:,:)=nan
allocate(this%dwt_livecrootc_to_cwdc_col (begc:endc,1:nlevdecomp_full)); this%dwt_livecrootc_to_cwdc_col (:,:)=nan
allocate(this%dwt_deadcrootc_to_cwdc_col (begc:endc,1:nlevdecomp_full)); this%dwt_deadcrootc_to_cwdc_col (:,:)=nan
@@ -662,7 +642,6 @@ subroutine InitAllocate(this, bounds, carbon_type)
allocate(this%crop_seedc_to_leaf_patch (begp:endp)) ; this%crop_seedc_to_leaf_patch (:) =nan
- allocate(this%cwdc_hr_col (begc:endc)) ; this%cwdc_hr_col (:) =nan
allocate(this%cwdc_loss_col (begc:endc)) ; this%cwdc_loss_col (:) =nan
allocate(this%litterc_loss_col (begc:endc)) ; this%litterc_loss_col (:) =nan
@@ -792,7 +771,6 @@ subroutine InitHistory(this, bounds, carbon_type)
! add history fields for all CN variables, always set as default='inactive'
!
! !USES:
- use clm_varpar , only : nlevdecomp, nlevdecomp_full, nlevgrnd
use clm_varctl , only : hist_wrtch4diag
use CNSharedParamsMod, only: use_fun
use histFileMod, only : hist_addfld1d, hist_addfld2d, hist_addfld_decomp
@@ -803,7 +781,7 @@ subroutine InitHistory(this, bounds, carbon_type)
character(len=3) , intent(in) :: carbon_type ! one of ['c12', c13','c14']
!
! !LOCAL VARIABLES:
- integer :: k,l,ii,jj
+ integer :: k,l,ii,jj
character(8) :: vr_suffix
character(10) :: active
integer :: begp,endp
@@ -2914,20 +2892,15 @@ subroutine InitHistory(this, bounds, carbon_type)
'(per-area-gridcell; only makes sense with dov2xy=.false.)', &
ptr_patch=this%dwt_slash_cflux_patch, default='inactive')
- this%dwt_frootc_to_litr_met_c_col(begc:endc,:) = spval
- call hist_addfld_decomp (fname='DWT_FROOTC_TO_LITR_MET_C', units='gC/m^2/s', type2d='levdcmp', &
- avgflag='A', long_name='fine root to litter due to landcover change', &
- ptr_col=this%dwt_frootc_to_litr_met_c_col, default='inactive')
-
- this%dwt_frootc_to_litr_cel_c_col(begc:endc,:) = spval
- call hist_addfld_decomp (fname='DWT_FROOTC_TO_LITR_CEL_C', units='gC/m^2/s', type2d='levdcmp', &
- avgflag='A', long_name='fine root to litter due to landcover change', &
- ptr_col=this%dwt_frootc_to_litr_cel_c_col, default='inactive')
-
- this%dwt_frootc_to_litr_lig_c_col(begc:endc,:) = spval
- call hist_addfld_decomp (fname='DWT_FROOTC_TO_LITR_LIG_C', units='gC/m^2/s', type2d='levdcmp', &
- avgflag='A', long_name='fine root to litter due to landcover change', &
- ptr_col=this%dwt_frootc_to_litr_lig_c_col, default='inactive')
+ do k = i_litr_min, i_litr_max
+ this%dwt_frootc_to_litr_c_col(begc:endc,:,k) = spval
+ data2dptr => this%dwt_frootc_to_litr_c_col(begc:endc,:,k)
+ fieldname = 'DWT_FROOTC_TO_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'_C'
+ longname = 'fine root to '//trim(decomp_cascade_con%decomp_pool_name_long(k))//' due to landcover change'
+ call hist_addfld_decomp (fname=fieldname, units='gC/m^2/s', type2d='levdcmp', &
+ avgflag='A', long_name=longname, &
+ ptr_col=data2dptr, default='inactive')
+ end do
this%dwt_livecrootc_to_cwdc_col(begc:endc,:) = spval
call hist_addfld_decomp (fname='DWT_LIVECROOTC_TO_CWDC', units='gC/m^2/s', type2d='levdcmp', &
@@ -3097,20 +3070,15 @@ subroutine InitHistory(this, bounds, carbon_type)
'(per-area-gridcell; only makes sense with dov2xy=.false.)', &
ptr_patch=this%dwt_slash_cflux_patch, default='inactive')
- this%dwt_frootc_to_litr_met_c_col(begc:endc,:) = spval
- call hist_addfld_decomp (fname='C13_DWT_FROOTC_TO_LITR_MET_C', units='gC13/m^2/s', type2d='levdcmp', &
- avgflag='A', long_name='C13 fine root to litter due to landcover change', &
- ptr_col=this%dwt_frootc_to_litr_met_c_col, default='inactive')
-
- this%dwt_frootc_to_litr_cel_c_col(begc:endc,:) = spval
- call hist_addfld_decomp (fname='C13_DWT_FROOTC_TO_LITR_CEL_C', units='gC13/m^2/s', type2d='levdcmp', &
- avgflag='A', long_name='C13 fine root to litter due to landcover change', &
- ptr_col=this%dwt_frootc_to_litr_cel_c_col, default='inactive')
-
- this%dwt_frootc_to_litr_lig_c_col(begc:endc,:) = spval
- call hist_addfld_decomp (fname='C13_DWT_FROOTC_TO_LITR_LIG_C', units='gC13/m^2/s', type2d='levdcmp', &
- avgflag='A', long_name='C13 fine root to litter due to landcover change', &
- ptr_col=this%dwt_frootc_to_litr_lig_c_col, default='inactive')
+ do k = i_litr_min, i_litr_max
+ this%dwt_frootc_to_litr_c_col(begc:endc,:,k) = spval
+ data2dptr => this%dwt_frootc_to_litr_c_col(begc:endc,:,k)
+ fieldname = 'C13_DWT_FROOTC_TO_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'_C'
+ longname = 'C13 fine root to '//trim(decomp_cascade_con%decomp_pool_name_long(k))//' due to landcover change'
+ call hist_addfld_decomp (fname=fieldname, units='gC/m^2/s', type2d='levdcmp', &
+ avgflag='A', long_name=longname, &
+ ptr_col=data2dptr, default='inactive')
+ end do
this%dwt_livecrootc_to_cwdc_col(begc:endc,:) = spval
call hist_addfld_decomp (fname='C13_DWT_LIVECROOTC_TO_CWDC', units='gC13/m^2/s', type2d='levdcmp', &
@@ -3262,20 +3230,15 @@ subroutine InitHistory(this, bounds, carbon_type)
'(per-area-gridcell; only makes sense with dov2xy=.false.)', &
ptr_patch=this%dwt_slash_cflux_patch, default='inactive')
- this%dwt_frootc_to_litr_met_c_col(begc:endc,:) = spval
- call hist_addfld_decomp (fname='C14_DWT_FROOTC_TO_LITR_MET_C', units='gC14/m^2/s', type2d='levdcmp', &
- avgflag='A', long_name='C14 fine root to litter due to landcover change', &
- ptr_col=this%dwt_frootc_to_litr_met_c_col, default='inactive')
-
- this%dwt_frootc_to_litr_cel_c_col(begc:endc,:) = spval
- call hist_addfld_decomp (fname='C14_DWT_FROOTC_TO_LITR_CEL_C', units='gC14/m^2/s', type2d='levdcmp', &
- avgflag='A', long_name='C14 fine root to litter due to landcover change', &
- ptr_col=this%dwt_frootc_to_litr_cel_c_col, default='inactive')
-
- this%dwt_frootc_to_litr_lig_c_col(begc:endc,:) = spval
- call hist_addfld_decomp (fname='C14_DWT_FROOTC_TO_LITR_LIG_C', units='gC14/m^2/s', type2d='levdcmp', &
- avgflag='A', long_name='C14 fine root to litter due to landcover change', &
- ptr_col=this%dwt_frootc_to_litr_lig_c_col, default='inactive')
+ do k = i_litr_min, i_litr_max
+ this%dwt_frootc_to_litr_c_col(begc:endc,:,k) = spval
+ data2dptr => this%dwt_frootc_to_litr_c_col(begc:endc,:,k)
+ fieldname = 'C14_DWT_FROOTC_TO_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'_C'
+ longname = 'C14 fine root to '//trim(decomp_cascade_con%decomp_pool_name_long(k))//' due to landcover change'
+ call hist_addfld_decomp (fname=fieldname, units='gC/m^2/s', type2d='levdcmp', &
+ avgflag='A', long_name=longname, &
+ ptr_col=data2dptr, default='inactive')
+ end do
this%dwt_livecrootc_to_cwdc_col(begc:endc,:) = spval
call hist_addfld_decomp (fname='C14_DWT_LIVECROOTC_TO_CWDC', units='gC14/m^2/s', type2d='levdcmp', &
@@ -3351,7 +3314,7 @@ subroutine InitCold(this, bounds)
type(bounds_type), intent(in) :: bounds
!
! !LOCAL VARIABLES:
- integer :: p, c, l, j
+ integer :: p, c, l, j, i
integer :: fc ! filter index
integer :: num_special_col ! number of good values in special_col filter
integer :: num_special_patch ! number of good values in special_patch filter
@@ -3416,9 +3379,9 @@ subroutine InitCold(this, bounds)
! real values on first timestep, prior to calling pftdyn_cnbal
if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then
do j = 1, nlevdecomp_full
- this%dwt_frootc_to_litr_met_c_col(c,j) = 0._r8
- this%dwt_frootc_to_litr_cel_c_col(c,j) = 0._r8
- this%dwt_frootc_to_litr_lig_c_col(c,j) = 0._r8
+ do i = i_litr_min, i_litr_max
+ this%dwt_frootc_to_litr_c_col(c,j,i) = 0._r8
+ end do
this%dwt_livecrootc_to_cwdc_col(c,j) = 0._r8
this%dwt_deadcrootc_to_cwdc_col(c,j) = 0._r8
end do
@@ -3889,25 +3852,15 @@ subroutine SetValues ( this, &
do fi = 1,num_column
i = filter_column(fi)
- this%phenology_c_to_litr_met_c_col(i,j) = value_column
- this%phenology_c_to_litr_cel_c_col(i,j) = value_column
- this%phenology_c_to_litr_lig_c_col(i,j) = value_column
-
- this%gap_mortality_c_to_litr_met_c_col(i,j) = value_column
- this%gap_mortality_c_to_litr_cel_c_col(i,j) = value_column
- this%gap_mortality_c_to_litr_lig_c_col(i,j) = value_column
+ do k = i_litr_min, i_litr_max
+ this%phenology_c_to_litr_c_col(i,j,k) = value_column
+ this%gap_mortality_c_to_litr_c_col(i,j,k) = value_column
+ this%harvest_c_to_litr_c_col(i,j,k) = value_column
+ this%m_c_to_litr_fire_col(i,j,k) = value_column
+ end do
this%gap_mortality_c_to_cwdc_col(i,j) = value_column
-
this%fire_mortality_c_to_cwdc_col(i,j) = value_column
- this%m_c_to_litr_met_fire_col(i,j) = value_column
- this%m_c_to_litr_cel_fire_col(i,j) = value_column
- this%m_c_to_litr_lig_fire_col(i,j) = value_column
-
- this%harvest_c_to_litr_met_c_col(i,j) = value_column
- this%harvest_c_to_litr_cel_c_col(i,j) = value_column
- this%harvest_c_to_litr_lig_c_col(i,j) = value_column
this%harvest_c_to_cwdc_col(i,j) = value_column
-
end do
end do
@@ -3931,7 +3884,6 @@ subroutine SetValues ( this, &
i = filter_column(fi)
this%grainc_to_cropprodc_col(i) = value_column
- this%cwdc_hr_col(i) = value_column
this%cwdc_loss_col(i) = value_column
this%litterc_loss_col(i) = value_column
@@ -4012,7 +3964,7 @@ subroutine ZeroDwt( this, bounds )
type(bounds_type), intent(in) :: bounds
!
! !LOCAL VARIABLES:
- integer :: c, g, j ! indices
+ integer :: c, g, j, i ! indices
!-----------------------------------------------------------------------
! set conversion and product pool fluxes to 0 at the beginning of every timestep
@@ -4026,9 +3978,9 @@ subroutine ZeroDwt( this, bounds )
do j = 1, nlevdecomp_full
do c = bounds%begc,bounds%endc
- this%dwt_frootc_to_litr_met_c_col(c,j) = 0._r8
- this%dwt_frootc_to_litr_cel_c_col(c,j) = 0._r8
- this%dwt_frootc_to_litr_lig_c_col(c,j) = 0._r8
+ do i = i_litr_min, i_litr_max
+ this%dwt_frootc_to_litr_c_col(c,j,i) = 0._r8
+ end do
this%dwt_livecrootc_to_cwdc_col(c,j) = 0._r8
this%dwt_deadcrootc_to_cwdc_col(c,j) = 0._r8
end do
@@ -4038,8 +3990,8 @@ end subroutine ZeroDwt
!-----------------------------------------------------------------------
subroutine Summary_carbonflux(this, &
- bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, &
- isotope, soilbiogeochem_hr_col, soilbiogeochem_lithr_col, &
+ bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, isotope, &
+ soilbiogeochem_hr_col, soilbiogeochem_cwdhr_col, soilbiogeochem_lithr_col, &
soilbiogeochem_decomp_cascade_ctransfer_col, &
product_closs_grc)
!
@@ -4063,6 +4015,7 @@ subroutine Summary_carbonflux(this, &
integer , intent(in) :: filter_soilp(:) ! filter for soil patches
character(len=*) , intent(in) :: isotope
real(r8) , intent(in) :: soilbiogeochem_hr_col(bounds%begc:)
+ real(r8) , intent(in) :: soilbiogeochem_cwdhr_col(bounds%begc:)
real(r8) , intent(in) :: soilbiogeochem_lithr_col(bounds%begc:)
real(r8) , intent(in) :: soilbiogeochem_decomp_cascade_ctransfer_col(bounds%begc:,1:)
real(r8) , intent(in) :: product_closs_grc(bounds%begg:)
@@ -4553,9 +4506,6 @@ subroutine Summary_carbonflux(this, &
this%ar_col(c) + &
soilbiogeochem_hr_col(c)
- ! coarse woody debris heterotrophic respiration
- this%cwdc_hr_col(c) = 0._r8
-
! net ecosystem production, excludes fire flux, landcover change,
! and loss from wood products, positive for sink (NEP)
this%nep_col(c) = &
@@ -4617,7 +4567,7 @@ subroutine Summary_carbonflux(this, &
! coarse woody debris C loss
do fc = 1,num_soilc
c = filter_soilc(fc)
- this%cwdc_loss_col(c) = 0._r8
+ this%cwdc_loss_col(c) = soilbiogeochem_cwdhr_col(c)
end do
associate(is_cwd => decomp_cascade_con%is_cwd) ! TRUE => pool is a cwd pool
do l = 1, ndecomp_pools
diff --git a/src/biogeochem/CNVegNitrogenFluxType.F90 b/src/biogeochem/CNVegNitrogenFluxType.F90
index 1da724382b..e2ba082084 100644
--- a/src/biogeochem/CNVegNitrogenFluxType.F90
+++ b/src/biogeochem/CNVegNitrogenFluxType.F90
@@ -4,7 +4,7 @@ module CNVegNitrogenFluxType
use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=)
use shr_log_mod , only : errMsg => shr_log_errMsg
use clm_varpar , only : ndecomp_cascade_transitions, ndecomp_pools
- use clm_varpar , only : nlevdecomp_full, nlevdecomp
+ use clm_varpar , only : nlevdecomp_full, nlevdecomp, i_litr_min, i_litr_max
use clm_varcon , only : spval, ispval, dzsoi_decomp
use clm_varctl , only : use_nitrif_denitrif, use_vertsoilc, use_crop
use CNSharedParamsMod , only : use_fun
@@ -63,12 +63,8 @@ module CNVegNitrogenFluxType
real(r8), pointer :: hrv_retransn_to_litter_patch (:) ! patch retranslocated N pool harvest mortality (gN/m2/s)
real(r8), pointer :: grainn_to_cropprodn_patch (:) ! patch grain N to crop product pool (gN/m2/s)
real(r8), pointer :: grainn_to_cropprodn_col (:) ! col grain N to crop product pool (gN/m2/s)
- real(r8), pointer :: m_n_to_litr_met_fire_col (:,:) ! col N from leaf, froot, xfer and storage N to litter labile N by fire (gN/m3/s)
- real(r8), pointer :: m_n_to_litr_cel_fire_col (:,:) ! col N from leaf, froot, xfer and storage N to litter cellulose N by fire (gN/m3/s)
- real(r8), pointer :: m_n_to_litr_lig_fire_col (:,:) ! col N from leaf, froot, xfer and storage N to litter lignin N by fire (gN/m3/s)
- real(r8), pointer :: harvest_n_to_litr_met_n_col (:,:) ! col N fluxes associated with harvest to litter metabolic pool (gN/m3/s)
- real(r8), pointer :: harvest_n_to_litr_cel_n_col (:,:) ! col N fluxes associated with harvest to litter cellulose pool (gN/m3/s)
- real(r8), pointer :: harvest_n_to_litr_lig_n_col (:,:) ! col N fluxes associated with harvest to litter lignin pool (gN/m3/s)
+ real(r8), pointer :: m_n_to_litr_fire_col (:,:,:) ! col N from leaf, froot, xfer and storage N to litter N by fire (gN/m3/s)
+ real(r8), pointer :: harvest_n_to_litr_n_col (:,:,:) ! col N fluxes associated with harvest to litter pools (gN/m3/s)
real(r8), pointer :: harvest_n_to_cwdn_col (:,:) ! col N fluxes associated with harvest to CWD pool (gN/m3/s)
! fire N fluxes
@@ -181,14 +177,10 @@ module CNVegNitrogenFluxType
real(r8), pointer :: wood_harvestn_patch (:) ! patch total N losses to wood product pools (gN/m2/s)
real(r8), pointer :: wood_harvestn_col (:) ! col total N losses to wood product pools (gN/m2/s) (p2c)
! phenology: litterfall and crop fluxes
- real(r8), pointer :: phenology_n_to_litr_met_n_col (:,:) ! col N fluxes associated with phenology (litterfall and crop) to litter metabolic pool (gN/m3/s)
- real(r8), pointer :: phenology_n_to_litr_cel_n_col (:,:) ! col N fluxes associated with phenology (litterfall and crop) to litter cellulose pool (gN/m3/s)
- real(r8), pointer :: phenology_n_to_litr_lig_n_col (:,:) ! col N fluxes associated with phenology (litterfall and crop) to litter lignin pool (gN/m3/s)
+ real(r8), pointer :: phenology_n_to_litr_n_col (:,:,:) ! col N fluxes associated with phenology (litterfall and crop) to litter pools (gN/m3/s)
! gap mortality fluxes
- real(r8), pointer :: gap_mortality_n_to_litr_met_n_col (:,:) ! col N fluxes associated with gap mortality to litter metabolic pool (gN/m3/s)
- real(r8), pointer :: gap_mortality_n_to_litr_cel_n_col (:,:) ! col N fluxes associated with gap mortality to litter cellulose pool (gN/m3/s)
- real(r8), pointer :: gap_mortality_n_to_litr_lig_n_col (:,:) ! col N fluxes associated with gap mortality to litter lignin pool (gN/m3/s)
+ real(r8), pointer :: gap_mortality_n_to_litr_n_col (:,:,:) ! col N fluxes associated with gap mortality to litter pools (gN/m3/s)
real(r8), pointer :: gap_mortality_n_to_cwdn_col (:,:) ! col N fluxes associated with gap mortality to CWD pool (gN/m3/s)
! dynamic landcover fluxes
@@ -200,9 +192,7 @@ module CNVegNitrogenFluxType
real(r8), pointer :: dwt_conv_nflux_grc (:) ! (gN/m2/s) dwt_conv_nflux_patch summed to the gridcell-level
real(r8), pointer :: dwt_wood_productn_gain_patch (:) ! patch (gN/m2/s) addition to wood product pools from landcover change; even though this is a patch-level flux, it is expressed per unit GRIDCELL area
real(r8), pointer :: dwt_crop_productn_gain_patch (:) ! patch (gN/m2/s) addition to crop product pool from landcover change; even though this is a patch-level flux, it is expressed per unit GRIDCELL area
- real(r8), pointer :: dwt_frootn_to_litr_met_n_col (:,:) ! col (gN/m3/s) fine root to litter due to landcover change
- real(r8), pointer :: dwt_frootn_to_litr_cel_n_col (:,:) ! col (gN/m3/s) fine root to litter due to landcover change
- real(r8), pointer :: dwt_frootn_to_litr_lig_n_col (:,:) ! col (gN/m3/s) fine root to litter due to landcover change
+ real(r8), pointer :: dwt_frootn_to_litr_n_col (:,:,:) ! col (gN/m3/s) fine root to litter due to landcover change
real(r8), pointer :: dwt_livecrootn_to_cwdn_col (:,:) ! col (gN/m3/s) live coarse root to CWD due to landcover change
real(r8), pointer :: dwt_deadcrootn_to_cwdn_col (:,:) ! col (gN/m3/s) dead coarse root to CWD due to landcover change
@@ -430,9 +420,7 @@ subroutine InitAllocate(this, bounds)
allocate(this%fire_nloss_col (begc:endc)) ; this%fire_nloss_col (:) = nan
allocate(this%fire_nloss_p2c_col (begc:endc)) ; this%fire_nloss_p2c_col (:) = nan
- allocate(this%m_n_to_litr_met_fire_col (begc:endc,1:nlevdecomp_full)) ; this%m_n_to_litr_met_fire_col (:,:) = nan
- allocate(this%m_n_to_litr_cel_fire_col (begc:endc,1:nlevdecomp_full)) ; this%m_n_to_litr_cel_fire_col (:,:) = nan
- allocate(this%m_n_to_litr_lig_fire_col (begc:endc,1:nlevdecomp_full)) ; this%m_n_to_litr_lig_fire_col (:,:) = nan
+ allocate(this%m_n_to_litr_fire_col (begc:endc,1:nlevdecomp_full,1:ndecomp_pools)) ; this%m_n_to_litr_fire_col (:,:,:) = nan
allocate(this%dwt_seedn_to_leaf_patch (begp:endp)) ; this%dwt_seedn_to_leaf_patch (:) = nan
allocate(this%dwt_seedn_to_leaf_grc (begg:endg)) ; this%dwt_seedn_to_leaf_grc (:) = nan
@@ -444,9 +432,7 @@ subroutine InitAllocate(this, bounds)
allocate(this%dwt_crop_productn_gain_patch (begp:endp)) ; this%dwt_crop_productn_gain_patch (:) = nan
allocate(this%wood_harvestn_col (begc:endc)) ; this%wood_harvestn_col (:) = nan
- allocate(this%dwt_frootn_to_litr_met_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_met_n_col (:,:) = nan
- allocate(this%dwt_frootn_to_litr_cel_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_cel_n_col (:,:) = nan
- allocate(this%dwt_frootn_to_litr_lig_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_lig_n_col (:,:) = nan
+ allocate(this%dwt_frootn_to_litr_n_col (begc:endc,1:nlevdecomp_full,1:i_litr_max)) ; this%dwt_frootn_to_litr_n_col (:,:,:) = nan
allocate(this%dwt_livecrootn_to_cwdn_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_livecrootn_to_cwdn_col (:,:) = nan
allocate(this%dwt_deadcrootn_to_cwdn_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_deadcrootn_to_cwdn_col (:,:) = nan
@@ -458,30 +444,18 @@ subroutine InitAllocate(this, bounds)
this%m_decomp_npools_to_fire_vr_col (:,:,:) = nan
this%m_decomp_npools_to_fire_col (:,:) = nan
- allocate(this%phenology_n_to_litr_met_n_col (begc:endc, 1:nlevdecomp_full))
- allocate(this%phenology_n_to_litr_cel_n_col (begc:endc, 1:nlevdecomp_full))
- allocate(this%phenology_n_to_litr_lig_n_col (begc:endc, 1:nlevdecomp_full))
- allocate(this%gap_mortality_n_to_litr_met_n_col (begc:endc, 1:nlevdecomp_full))
- allocate(this%gap_mortality_n_to_litr_cel_n_col (begc:endc, 1:nlevdecomp_full))
- allocate(this%gap_mortality_n_to_litr_lig_n_col (begc:endc, 1:nlevdecomp_full))
+ allocate(this%phenology_n_to_litr_n_col (begc:endc, 1:nlevdecomp_full, 1:ndecomp_pools))
+ allocate(this%gap_mortality_n_to_litr_n_col (begc:endc, 1:nlevdecomp_full, 1:ndecomp_pools))
allocate(this%gap_mortality_n_to_cwdn_col (begc:endc, 1:nlevdecomp_full))
allocate(this%fire_mortality_n_to_cwdn_col (begc:endc, 1:nlevdecomp_full))
- allocate(this%harvest_n_to_litr_met_n_col (begc:endc, 1:nlevdecomp_full))
- allocate(this%harvest_n_to_litr_cel_n_col (begc:endc, 1:nlevdecomp_full))
- allocate(this%harvest_n_to_litr_lig_n_col (begc:endc, 1:nlevdecomp_full))
+ allocate(this%harvest_n_to_litr_n_col (begc:endc, 1:nlevdecomp_full, 1:ndecomp_pools))
allocate(this%harvest_n_to_cwdn_col (begc:endc, 1:nlevdecomp_full))
- this%phenology_n_to_litr_met_n_col (:,:) = nan
- this%phenology_n_to_litr_cel_n_col (:,:) = nan
- this%phenology_n_to_litr_lig_n_col (:,:) = nan
- this%gap_mortality_n_to_litr_met_n_col (:,:) = nan
- this%gap_mortality_n_to_litr_cel_n_col (:,:) = nan
- this%gap_mortality_n_to_litr_lig_n_col (:,:) = nan
+ this%phenology_n_to_litr_n_col (:,:,:) = nan
+ this%gap_mortality_n_to_litr_n_col (:,:,:) = nan
this%gap_mortality_n_to_cwdn_col (:,:) = nan
this%fire_mortality_n_to_cwdn_col (:,:) = nan
- this%harvest_n_to_litr_met_n_col (:,:) = nan
- this%harvest_n_to_litr_cel_n_col (:,:) = nan
- this%harvest_n_to_litr_lig_n_col (:,:) = nan
+ this%harvest_n_to_litr_n_col (:,:,:) = nan
this%harvest_n_to_cwdn_col (:,:) = nan
allocate(this%plant_ndemand_patch (begp:endp)) ; this%plant_ndemand_patch (:) = nan
@@ -1037,20 +1011,15 @@ subroutine InitHistory(this, bounds)
'(per-area-gridcell; only makes sense with dov2xy=.false.)', &
ptr_patch=this%dwt_conv_nflux_patch, default='inactive')
- this%dwt_frootn_to_litr_met_n_col(begc:endc,:) = spval
- call hist_addfld_decomp (fname='DWT_FROOTN_TO_LITR_MET_N', units='gN/m^2/s', type2d='levdcmp', &
- avgflag='A', long_name='fine root to litter due to landcover change', &
- ptr_col=this%dwt_frootn_to_litr_met_n_col, default='inactive')
-
- this%dwt_frootn_to_litr_cel_n_col(begc:endc,:) = spval
- call hist_addfld_decomp (fname='DWT_FROOTN_TO_LITR_CEL_N', units='gN/m^2/s', type2d='levdcmp', &
- avgflag='A', long_name='fine root to litter due to landcover change', &
- ptr_col=this%dwt_frootn_to_litr_cel_n_col, default='inactive')
-
- this%dwt_frootn_to_litr_lig_n_col(begc:endc,:) = spval
- call hist_addfld_decomp (fname='DWT_FROOTN_TO_LITR_LIG_N', units='gN/m^2/s', type2d='levdcmp', &
- avgflag='A', long_name='fine root to litter due to landcover change', &
- ptr_col=this%dwt_frootn_to_litr_lig_n_col, default='inactive')
+ do k = i_litr_min, i_litr_max
+ this%dwt_frootn_to_litr_n_col(begc:endc,:,k) = spval
+ data2dptr => this%dwt_frootn_to_litr_n_col(begc:endc,:,k)
+ fieldname = 'DWT_FROOTN_TO_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'_N'
+ longname = 'fine root N to '//trim(decomp_cascade_con%decomp_pool_name_long(k))//' due to landcover change'
+ call hist_addfld_decomp (fname=fieldname, units='gN/m^2/s', type2d='levdcmp', &
+ avgflag='A', long_name=longname, &
+ ptr_col=data2dptr, default='inactive')
+ end do
this%dwt_livecrootn_to_cwdn_col(begc:endc,:) = spval
call hist_addfld_decomp (fname='DWT_LIVECROOTN_TO_CWDN', units='gN/m^2/s', type2d='levdcmp', &
@@ -1699,27 +1668,15 @@ subroutine SetValues ( this, &
do fi = 1,num_column
i = filter_column(fi)
- ! phenology: litterfall and crop fluxes associated wit
- this%phenology_n_to_litr_met_n_col(i,j) = value_column
- this%phenology_n_to_litr_cel_n_col(i,j) = value_column
- this%phenology_n_to_litr_lig_n_col(i,j) = value_column
+ do k = i_litr_min, i_litr_max
+ this%phenology_n_to_litr_n_col(i,j,k) = value_column
+ this%gap_mortality_n_to_litr_n_col(i,j,k) = value_column
+ this%harvest_n_to_litr_n_col(i,j,k) = value_column
+ this%m_n_to_litr_fire_col(i,j,k) = value_column
+ end do
- ! gap mortality
- this%gap_mortality_n_to_litr_met_n_col(i,j) = value_column
- this%gap_mortality_n_to_litr_cel_n_col(i,j) = value_column
- this%gap_mortality_n_to_litr_lig_n_col(i,j) = value_column
this%gap_mortality_n_to_cwdn_col(i,j) = value_column
-
- ! fire
this%fire_mortality_n_to_cwdn_col(i,j) = value_column
- this%m_n_to_litr_met_fire_col(i,j) = value_column
- this%m_n_to_litr_cel_fire_col(i,j) = value_column
- this%m_n_to_litr_lig_fire_col(i,j) = value_column
-
- ! harvest
- this%harvest_n_to_litr_met_n_col(i,j) = value_column
- this%harvest_n_to_litr_cel_n_col(i,j) = value_column
- this%harvest_n_to_litr_lig_n_col(i,j) = value_column
this%harvest_n_to_cwdn_col(i,j) = value_column
end do
end do
@@ -1764,7 +1721,7 @@ subroutine ZeroDwt( this, bounds )
type(bounds_type), intent(in) :: bounds
!
! !LOCAL VARIABLES:
- integer :: c, g, j ! indices
+ integer :: c, g, j, i ! indices
!-----------------------------------------------------------------------
do g = bounds%begg, bounds%endg
@@ -1775,9 +1732,9 @@ subroutine ZeroDwt( this, bounds )
do j = 1, nlevdecomp_full
do c = bounds%begc,bounds%endc
- this%dwt_frootn_to_litr_met_n_col(c,j) = 0._r8
- this%dwt_frootn_to_litr_cel_n_col(c,j) = 0._r8
- this%dwt_frootn_to_litr_lig_n_col(c,j) = 0._r8
+ do i = i_litr_min, i_litr_max
+ this%dwt_frootn_to_litr_n_col(c,j,i) = 0._r8
+ end do
this%dwt_livecrootn_to_cwdn_col(c,j) = 0._r8
this%dwt_deadcrootn_to_cwdn_col(c,j) = 0._r8
end do
diff --git a/src/biogeochem/DryDepVelocity.F90 b/src/biogeochem/DryDepVelocity.F90
index 37860e9728..01aa51d52c 100644
--- a/src/biogeochem/DryDepVelocity.F90
+++ b/src/biogeochem/DryDepVelocity.F90
@@ -400,7 +400,7 @@ subroutine depvel_compute( bounds, &
endif
if (index_season<0) then
- if (elai(pi) < (minlai+0.05*(maxlai-minlai))) then
+ if (elai(pi) < (minlai+0.05_r8*(maxlai-minlai))) then
index_season = 3
endif
endif
diff --git a/src/biogeochem/NutrientCompetitionCLM45defaultMod.F90 b/src/biogeochem/NutrientCompetitionCLM45defaultMod.F90
index f81783ad8c..d93f0a168e 100644
--- a/src/biogeochem/NutrientCompetitionCLM45defaultMod.F90
+++ b/src/biogeochem/NutrientCompetitionCLM45defaultMod.F90
@@ -272,7 +272,7 @@ subroutine calc_plant_cn_alloc (this, bounds, num_soilp, filter_soilp, &
! allocation as specified in the pft-physiology file. The value is also used
! as a trigger here: -1.0 means to use the dynamic allocation (trees).
if (stem_leaf(ivt(p)) == -1._r8) then
- f3 = (2.7/(1.0+exp(-0.004*(annsum_npp(p) - 300.0)))) - 0.4
+ f3 = (2.7_r8/(1.0_r8+exp(-0.004_r8*(annsum_npp(p) - 300.0_r8)))) - 0.4_r8
else
f3 = stem_leaf(ivt(p))
end if
@@ -753,7 +753,7 @@ subroutine calc_plant_nitrogen_demand(this, bounds, num_soilp, filter_soilp, &
! as a trigger here: -1.0 means to use the dynamic allocation (trees).
if (stem_leaf(ivt(p)) == -1._r8) then
- f3 = (2.7/(1.0+exp(-0.004*(annsum_npp(p) - 300.0)))) - 0.4
+ f3 = (2.7_r8/(1.0_r8+exp(-0.004_r8*(annsum_npp(p) - 300.0_r8)))) - 0.4_r8
else
f3 = stem_leaf(ivt(p))
end if
diff --git a/src/biogeochem/NutrientCompetitionFlexibleCNMod.F90 b/src/biogeochem/NutrientCompetitionFlexibleCNMod.F90
index b69c666ea4..a642a5dd2d 100644
--- a/src/biogeochem/NutrientCompetitionFlexibleCNMod.F90
+++ b/src/biogeochem/NutrientCompetitionFlexibleCNMod.F90
@@ -421,7 +421,7 @@ subroutine calc_plant_cn_alloc(this, bounds, num_soilp, filter_soilp, &
! allocation as specified in the pft-physiology file. The value is also used
! as a trigger here: -1.0 means to use the dynamic allocation (trees).
if (stem_leaf(ivt(p)) == -1._r8) then
- f3 = (2.7/(1.0+exp(-0.004*(annsum_npp(p) - 300.0)))) - 0.4
+ f3 = (2.7_r8/(1.0_r8+exp(-0.004_r8*(annsum_npp(p) - 300.0_r8)))) - 0.4_r8
else
f3 = stem_leaf(ivt(p))
end if
@@ -1468,7 +1468,7 @@ subroutine calc_plant_nitrogen_demand(this, bounds, num_soilp, filter_soilp, &
! as a trigger here: -1.0 means to use the dynamic allocation (trees).
if (stem_leaf(ivt(p)) == -1._r8) then
- f3 = (2.7/(1.0+exp(-0.004*(annsum_npp(p) - 300.0)))) - 0.4
+ f3 = (2.7_r8/(1.0_r8+exp(-0.004_r8*(annsum_npp(p) - 300.0_r8)))) - 0.4_r8
else
f3 = stem_leaf(ivt(p))
end if
diff --git a/src/biogeochem/SatellitePhenologyMod.F90 b/src/biogeochem/SatellitePhenologyMod.F90
index 1d273a9e64..63a5007da0 100644
--- a/src/biogeochem/SatellitePhenologyMod.F90
+++ b/src/biogeochem/SatellitePhenologyMod.F90
@@ -9,27 +9,14 @@ module SatellitePhenologyMod
! so that DryDeposition code can get estimates of LAI differences between months.
!
! !USES:
- use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create
- use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance
- use shr_kind_mod , only : r8 => shr_kind_r8
- use shr_kind_mod , only : CL => shr_kind_CL
- use shr_kind_mod , only : CXX => shr_kind_CXX
- use shr_log_mod , only : errMsg => shr_log_errMsg
- use decompMod , only : bounds_type
- use abortutils , only : endrun
- use clm_varctl , only : iulog, use_lai_streams, inst_name
- use clm_varcon , only : grlnd
- use controlMod , only : NLFilename
- use decompMod , only : gsmap_lnd_gdc2glo
- use domainMod , only : ldomain
- use fileutils , only : getavu, relavu
- use PatchType , only : patch
- use CanopyStateType , only : canopystate_type
- use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type
- use perf_mod , only : t_startf, t_stopf
- use spmdMod , only : masterproc
- use spmdMod , only : mpicom, comp_id
- use mct_mod
+ use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL, CS => shr_kind_CS
+ use shr_log_mod , only : errMsg => shr_log_errMsg
+ use decompMod , only : bounds_type
+ use abortutils , only : endrun
+ use clm_varctl , only : iulog, use_lai_streams
+ use perf_mod , only : t_startf, t_stopf
+ use spmdMod , only : masterproc, mpicom, iam
+ use laiStreamMod , only : lai_init, lai_advance, lai_interp
use ncdio_pio
!
! !PUBLIC TYPES:
@@ -41,253 +28,25 @@ module SatellitePhenologyMod
public :: SatellitePhenologyInit ! Dynamically allocate memory
public :: interpMonthlyVeg ! interpolate monthly vegetation data
public :: readAnnualVegetation ! Read in annual vegetation (needed for Dry-deposition)
- public :: lai_advance ! Advance the LAI streams (outside of a Open-MP threading loop)
!
! !PRIVATE MEMBER FUNCTIONS:
private :: readMonthlyVegetation ! read monthly vegetation data for two months
- private :: lai_init ! position datasets for LAI
- private :: lai_interp ! interpolates between two years of LAI data (when LAI streams are being used)
-
- ! !PRIVATE MEMBER DATA:
- type(shr_strdata_type) :: sdat_lai ! LAI input data stream
!
- ! !PRIVATE TYPES:
- integer, allocatable :: g_to_ig(:) ! Array matching gridcell index to data index
- integer , private :: InterpMonths1 ! saved month index
- real(r8), private :: timwt(2) ! time weights for month 1 and month 2
- real(r8), private, allocatable :: mlai2t(:,:) ! lai for interpolation (2 months)
- real(r8), private, allocatable :: msai2t(:,:) ! sai for interpolation (2 months)
- real(r8), private, allocatable :: mhvt2t(:,:) ! top vegetation height for interpolation (2 months)
- real(r8), private, allocatable :: mhvb2t(:,:) ! bottom vegetation height for interpolation(2 months)
-
- character(len=*), parameter, private :: sourcefile = &
+ ! !PRIVATE MEMBER DATA:
+ integer :: InterpMonths1 ! saved month index
+ real(r8) :: timwt(2) ! time weights for month 1 and month 2
+ real(r8), allocatable :: mlai2t(:,:) ! lai for interpolation (2 months)
+ real(r8), allocatable :: msai2t(:,:) ! sai for interpolation (2 months)
+ real(r8), allocatable :: mhvt2t(:,:) ! top vegetation height for interpolation (2 months)
+ real(r8), allocatable :: mhvb2t(:,:) ! bottom vegetation height for interpolation(2 months)
+
+ character(len=*), parameter :: sourcefile = &
__FILE__
- !-----------------------------------------------------------------------
+!==============================================================================
contains
+!==============================================================================
- !-----------------------------------------------------------------------
- !
- ! lai_init
- !
- !-----------------------------------------------------------------------
- subroutine lai_init(bounds)
- !
- ! Initialize data stream information for LAI.
- !
- !
- ! !USES:
- use clm_time_manager , only : get_calendar
- use ncdio_pio , only : pio_subsystem
- use shr_pio_mod , only : shr_pio_getiotype
- use clm_nlUtilsMod , only : find_nlgroup_name
- use ndepStreamMod , only : clm_domain_mct
- use histFileMod , only : hist_addfld1d
- use shr_stream_mod , only : shr_stream_file_null
- use shr_string_mod , only : shr_string_listCreateField
- !
- ! !ARGUMENTS:
- implicit none
- type(bounds_type), intent(in) :: bounds ! bounds
- !
- ! !LOCAL VARIABLES:
- integer :: i ! index
- integer :: stream_year_first_lai ! first year in Lai stream to use
- integer :: stream_year_last_lai ! last year in Lai stream to use
- integer :: model_year_align_lai ! align stream_year_first_lai with
- integer :: nu_nml ! unit for namelist file
- integer :: nml_error ! namelist i/o error flag
- type(mct_ggrid) :: dom_clm ! domain information
- character(len=CL) :: stream_fldFileName_lai ! lai stream filename to read
- character(len=CL) :: lai_mapalgo = 'bilinear' ! Mapping alogrithm
- character(len=CL) :: lai_tintalgo = 'linear' ! Time interpolation alogrithm
-
- character(*), parameter :: subName = "('laidyn_init')"
- character(*), parameter :: F00 = "('(laidyn_init) ',4a)"
- character(*), parameter :: laiString = "LAI" ! base string for field string
- integer , parameter :: numLaiFields = 16 ! number of fields to build field string
- character(len=CXX) :: fldList ! field string
- !-----------------------------------------------------------------------
- !
- ! deal with namelist variables here in init
- !
- namelist /lai_streams/ &
- stream_year_first_lai, &
- stream_year_last_lai, &
- model_year_align_lai, &
- lai_mapalgo, &
- stream_fldFileName_lai, &
- lai_tintalgo
-
- ! Default values for namelist
- stream_year_first_lai = 1 ! first year in stream to use
- stream_year_last_lai = 1 ! last year in stream to use
- model_year_align_lai = 1 ! align stream_year_first_lai with this model year
- stream_fldFileName_lai = shr_stream_file_null
-
- ! Read lai_streams namelist
- if (masterproc) then
- nu_nml = getavu()
- open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error )
- call find_nlgroup_name(nu_nml, 'lai_streams', status=nml_error)
- if (nml_error == 0) then
- read(nu_nml, nml=lai_streams,iostat=nml_error)
- if (nml_error /= 0) then
- call endrun(subname // ':: ERROR reading lai_streams namelist')
- end if
- else
- call endrun(subname // ':: ERROR finding lai_streams namelist')
- end if
- close(nu_nml)
- call relavu( nu_nml )
- endif
-
- call shr_mpi_bcast(stream_year_first_lai, mpicom)
- call shr_mpi_bcast(stream_year_last_lai, mpicom)
- call shr_mpi_bcast(model_year_align_lai, mpicom)
- call shr_mpi_bcast(stream_fldFileName_lai, mpicom)
- call shr_mpi_bcast(lai_tintalgo, mpicom)
-
- if (masterproc) then
-
- write(iulog,*) ' '
- write(iulog,*) 'lai_stream settings:'
- write(iulog,*) ' stream_year_first_lai = ',stream_year_first_lai
- write(iulog,*) ' stream_year_last_lai = ',stream_year_last_lai
- write(iulog,*) ' model_year_align_lai = ',model_year_align_lai
- write(iulog,*) ' stream_fldFileName_lai = ',trim(stream_fldFileName_lai)
- write(iulog,*) ' lai_tintalgo = ',trim(lai_tintalgo)
-
- endif
-
- call clm_domain_mct (bounds, dom_clm)
-
- !
- ! create the field list for these lai fields...use in shr_strdata_create
- !
- fldList = shr_string_listCreateField( numLaiFields, laiString )
-
- call shr_strdata_create(sdat_lai,name="laidyn", &
- pio_subsystem=pio_subsystem, &
- pio_iotype=shr_pio_getiotype(inst_name), &
- mpicom=mpicom, compid=comp_id, &
- gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, &
- nxg=ldomain%ni, nyg=ldomain%nj, &
- yearFirst=stream_year_first_lai, &
- yearLast=stream_year_last_lai, &
- yearAlign=model_year_align_lai, &
- offset=0, &
- domFilePath='', &
- domFileName=trim(stream_fldFileName_lai), &
- domTvarName='time', &
- domXvarName='lon' , &
- domYvarName='lat' , &
- domAreaName='area', &
- domMaskName='mask', &
- filePath='', &
- filename=(/stream_fldFileName_lai/), &
- fldListFile=fldList, &
- fldListModel=fldList, &
- fillalgo='none', &
- mapalgo=lai_mapalgo, &
- tintalgo=lai_tintalgo, &
- calendar=get_calendar(), &
- taxmode='cycle' )
-
- if (masterproc) then
- call shr_strdata_print(sdat_lai,'LAI data')
- endif
-
- end subroutine lai_init
-
- !-----------------------------------------------------------------------
- !
- ! lai_advance
- !
- !-----------------------------------------------------------------------
- subroutine lai_advance( bounds )
- !
- ! Advance LAI streams
- !
- ! !USES:
- use clm_time_manager, only : get_curr_date
- !
- ! !ARGUMENTS:
- implicit none
- type(bounds_type) , intent(in) :: bounds
- !
- ! !LOCAL VARIABLES:
- integer :: g, ig ! Indices
- integer :: year ! year (0, ...) for nstep+1
- integer :: mon ! month (1, ..., 12) for nstep+1
- integer :: day ! day of month (1, ..., 31) for nstep+1
- integer :: sec ! seconds into current date for nstep+1
- integer :: mcdate ! Current model date (yyyymmdd)
- !-----------------------------------------------------------------------
-
- call get_curr_date(year, mon, day, sec)
- mcdate = year*10000 + mon*100 + day
-
- call shr_strdata_advance(sdat_lai, mcdate, sec, mpicom, 'laidyn')
- if ( .not. allocated(g_to_ig) )then
- allocate (g_to_ig(bounds%begg:bounds%endg) )
-
- ig = 0
- do g = bounds%begg,bounds%endg
- ig = ig+1
- g_to_ig(g) = ig
- end do
- end if
-
- end subroutine lai_advance
-
-
- !-----------------------------------------------------------------------
- !
- ! lai_interp
- !
- !-----------------------------------------------------------------------
- subroutine lai_interp(bounds, canopystate_inst)
- !
- ! Interpolate data stream information for Lai.
- !
- ! !USES:
- use pftconMod , only : noveg
- !
- ! !ARGUMENTS:
- implicit none
- type(bounds_type) , intent(in) :: bounds
- type(canopystate_type) , intent(inout) :: canopystate_inst
- !
- ! !LOCAL VARIABLES:
- integer :: ivt, p, ip, ig
- character(len=CL) :: stream_var_name
- !-----------------------------------------------------------------------
- SHR_ASSERT_FL( (lbound(g_to_ig,1) <= bounds%begg ), sourcefile, __LINE__)
- SHR_ASSERT_FL( (ubound(g_to_ig,1) >= bounds%endg ), sourcefile, __LINE__)
- SHR_ASSERT_FL( (lbound(sdat_lai%avs(1)%rAttr,2) <= g_to_ig(bounds%begg) ), sourcefile, __LINE__)
- SHR_ASSERT_FL( (ubound(sdat_lai%avs(1)%rAttr,2) >= g_to_ig(bounds%endg) ), sourcefile, __LINE__)
- do p = bounds%begp, bounds%endp
- ivt = patch%itype(p)
- if (ivt /= noveg) then ! vegetated pft
- write(stream_var_name,"(i6)") ivt
- stream_var_name = 'LAI_'//trim(adjustl(stream_var_name))
- ip = mct_aVect_indexRA(sdat_lai%avs(1),trim(stream_var_name))
- endif
- ig = g_to_ig(patch%gridcell(p))
- !
- ! Set lai for each gridcell/patch combination
- !
- if (ivt /= noveg) then ! vegetated pft
- canopystate_inst%tlai_patch(p) = sdat_lai%avs(1)%rAttr(ip,ig)
- else ! non-vegetated pft
- canopystate_inst%tlai_patch(p) = 0._r8
- endif
- end do
-
- end subroutine lai_interp
-
- !-----------------------------------------------------------------------
subroutine SatellitePhenologyInit (bounds)
!
! !DESCRIPTION:
@@ -306,11 +65,11 @@ subroutine SatellitePhenologyInit (bounds)
InterpMonths1 = -999 ! saved month index
ier = 0
- if(.not.allocated(mlai2t)) then
+ if (.not.allocated(mlai2t)) then
allocate (mlai2t(bounds%begp:bounds%endp,2), &
- msai2t(bounds%begp:bounds%endp,2), &
- mhvt2t(bounds%begp:bounds%endp,2), &
- mhvb2t(bounds%begp:bounds%endp,2), stat=ier)
+ msai2t(bounds%begp:bounds%endp,2), &
+ mhvt2t(bounds%begp:bounds%endp,2), &
+ mhvb2t(bounds%begp:bounds%endp,2), stat=ier)
end if
if (ier /= 0) then
write(iulog,*) 'EcosystemDynini allocation error'
@@ -328,7 +87,7 @@ subroutine SatellitePhenologyInit (bounds)
end subroutine SatellitePhenologyInit
- !-----------------------------------------------------------------------
+ !================================================================
subroutine SatellitePhenology(bounds, num_nolakep, filter_nolakep, &
waterdiagnosticbulk_inst, canopystate_inst)
!
@@ -337,24 +96,27 @@ subroutine SatellitePhenology(bounds, num_nolakep, filter_nolakep, &
! Calculates leaf areas (tlai, elai), stem areas (tsai, esai) and height (htop).
!
! !USES:
- use pftconMod, only : noveg, nbrdlf_dcd_brl_shrub
+ use pftconMod , only : noveg, nbrdlf_dcd_brl_shrub
+ use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type
+ use CanopyStateType , only : canopystate_type
+ use PatchType , only : patch
!
! !ARGUMENTS:
- type(bounds_type) , intent(in) :: bounds
- integer , intent(in) :: num_nolakep ! number of column non-lake points in patch filter
- integer , intent(in) :: filter_nolakep(bounds%endp-bounds%begp+1) ! patch filter for non-lake points
- type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst
- type(canopystate_type) , intent(inout) :: canopystate_inst
+ type(bounds_type) , intent(in) :: bounds
+ integer , intent(in) :: num_nolakep ! number of column non-lake points in patch filter
+ integer , intent(in) :: filter_nolakep(bounds%endp-bounds%begp+1) ! patch filter for non-lake points
+ type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst
+ type(canopystate_type) , intent(inout) :: canopystate_inst
!
! !LOCAL VARIABLES:
- integer :: fp,p,c ! indices
- real(r8) :: ol ! thickness of canopy layer covered by snow (m)
- real(r8) :: fb ! fraction of canopy layer covered by snow
+ integer :: fp,p,c ! indices
+ real(r8) :: ol ! thickness of canopy layer covered by snow (m)
+ real(r8) :: fb ! fraction of canopy layer covered by snow
!-----------------------------------------------------------------------
associate( &
- frac_sno => waterdiagnosticbulk_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1)
- snow_depth => waterdiagnosticbulk_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m)
+ frac_sno => waterdiagnosticbulk_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1)
+ snow_depth => waterdiagnosticbulk_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m)
tlai => canopystate_inst%tlai_patch , & ! Output: [real(r8) (:) ] one-sided leaf area index, no burying by snow
tsai => canopystate_inst%tsai_patch , & ! Output: [real(r8) (:) ] one-sided stem area index, no burying by snow
elai => canopystate_inst%elai_patch , & ! Output: [real(r8) (:) ] one-sided leaf area index with burying by snow
@@ -368,7 +130,6 @@ subroutine SatellitePhenology(bounds, num_nolakep, filter_nolakep, &
call lai_interp(bounds, canopystate_inst)
endif
-
do fp = 1, num_nolakep
p = filter_nolakep(fp)
c = patch%column(p)
@@ -434,19 +195,20 @@ subroutine SatellitePhenology(bounds, num_nolakep, filter_nolakep, &
end subroutine SatellitePhenology
- !-----------------------------------------------------------------------
+ !==============================================================================
subroutine interpMonthlyVeg (bounds, canopystate_inst)
!
! !DESCRIPTION:
! Determine if 2 new months of data are to be read.
!
! !USES:
- use clm_varctl , only : fsurdat
- use clm_time_manager, only : get_curr_date, get_step_size_real, get_nstep
+ use clm_varctl , only : fsurdat
+ use clm_time_manager , only : get_curr_date, get_step_size_real, get_nstep
+ use CanopyStateType , only : canopystate_type
!
! !ARGUMENTS:
- type(bounds_type), intent(in) :: bounds
- type(canopystate_type), intent(inout) :: canopystate_inst
+ type(bounds_type) , intent(in) :: bounds
+ type(canopystate_type) , intent(inout) :: canopystate_inst
!
! !LOCAL VARIABLES:
integer :: kyr ! year (0, ...) for nstep+1
@@ -488,18 +250,21 @@ subroutine interpMonthlyVeg (bounds, canopystate_inst)
end subroutine interpMonthlyVeg
- !-----------------------------------------------------------------------
+ !==============================================================================
subroutine readAnnualVegetation (bounds, canopystate_inst)
!
! !DESCRIPTION:
! read 12 months of veg data for dry deposition
!
! !USES:
- use clm_varpar , only : maxveg, maxsoil_patches
- use pftconMod , only : noveg
- use domainMod , only : ldomain
- use fileutils , only : getfil
- use clm_varctl , only : fsurdat
+ use clm_varpar , only : maxveg, maxsoil_patches
+ use pftconMod , only : noveg
+ use fileutils , only : getfil
+ use clm_varctl , only : fsurdat
+ use domainMod , only : ldomain
+ use clm_varcon , only : grlnd
+ use PatchType , only : patch
+ use CanopyStateType , only : canopystate_type
!
! !ARGUMENTS:
type(bounds_type), intent(in) :: bounds
@@ -579,9 +344,8 @@ subroutine readAnnualVegetation (bounds, canopystate_inst)
endsubroutine readAnnualVegetation
- !-----------------------------------------------------------------------
- subroutine readMonthlyVegetation (bounds, &
- fveg, months, canopystate_inst)
+ !==============================================================================
+ subroutine readMonthlyVegetation (bounds, fveg, months, canopystate_inst)
!
! !DESCRIPTION:
! Read monthly vegetation data for two consec. months.
@@ -592,6 +356,9 @@ subroutine readMonthlyVegetation (bounds, &
use fileutils , only : getfil
use spmdMod , only : masterproc, mpicom, MPI_REAL8, MPI_INTEGER
use clm_time_manager , only : get_nstep
+ use CanopyStateType , only : canopystate_type
+ use PatchType , only : patch
+ use clm_varcon , only : grlnd
use netcdf
!
! !ARGUMENTS:
diff --git a/src/biogeochem/VOCEmissionMod.F90 b/src/biogeochem/VOCEmissionMod.F90
index b50fe5ec77..88ae7c08cc 100644
--- a/src/biogeochem/VOCEmissionMod.F90
+++ b/src/biogeochem/VOCEmissionMod.F90
@@ -601,7 +601,7 @@ subroutine VOCEmission (bounds, num_soilp, filter_soilp, &
! Activity factor for CO2 (only for isoprene)
if (trim(meg_cmp%name) == 'isoprene') then
- co2_ppmv = 1.e6*forc_pco2(g)/forc_pbot(c)
+ co2_ppmv = 1.e6_r8*forc_pco2(g)/forc_pbot(c)
gamma_c = get_gamma_C(cisun_z(p,1),cisha_z(p,1),forc_pbot(c),fsun(p), co2_ppmv)
else
gamma_c = 1._r8
diff --git a/src/biogeochem/ch4Mod.F90 b/src/biogeochem/ch4Mod.F90
index fd08a3b94d..0768e702d1 100644
--- a/src/biogeochem/ch4Mod.F90
+++ b/src/biogeochem/ch4Mod.F90
@@ -17,7 +17,7 @@ module ch4Mod
use clm_varcon , only : catomw, s_con, d_con_w, d_con_g, c_h_inv, kh_theta, kh_tbase
use landunit_varcon , only : istsoil, istcrop, istdlak
use clm_time_manager , only : get_step_size_real, get_nstep
- use clm_varctl , only : iulog, use_cn, use_nitrif_denitrif, use_lch4
+ use clm_varctl , only : iulog, use_cn, use_nitrif_denitrif, use_lch4, use_cn, use_fates
use abortutils , only : endrun
use decompMod , only : bounds_type
use atm2lndType , only : atm2lnd_type
@@ -39,6 +39,7 @@ module ch4Mod
use ColumnType , only : col
use PatchType , only : patch
use ch4FInundatedStreamType , only : ch4finundatedstream_type
+ use CLMFatesInterfaceMod , only : hlm_fates_interface_type
!
implicit none
private
@@ -1664,7 +1665,7 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, &
atm2lnd_inst, lakestate_inst, canopystate_inst, soilstate_inst, soilhydrology_inst, &
temperature_inst, energyflux_inst, waterstatebulk_inst, waterdiagnosticbulk_inst, waterfluxbulk_inst, &
soilbiogeochem_carbonflux_inst, &
- soilbiogeochem_nitrogenflux_inst, ch4_inst, lnd2atm_inst, &
+ soilbiogeochem_nitrogenflux_inst, ch4_inst, lnd2atm_inst, clm_fates, &
agnpp, bgnpp, annsum_npp, rr)
!
! !DESCRIPTION:
@@ -1706,11 +1707,13 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, &
real(r8) , intent(in) :: bgnpp( bounds%begp: ) ! belowground NPP (gC/m2/s)
real(r8) , intent(in) :: annsum_npp( bounds%begp: ) ! annual sum NPP (gC/m2/yr)
real(r8) , intent(in) :: rr ( bounds%begp: ) ! root respiration (fine root MR + total root GR) (gC/m2/s)
+ type(hlm_fates_interface_type) , intent(inout) :: clm_fates
+
!
! !LOCAL VARIABLES:
integer :: sat ! 0 = unsatured, 1 = saturated
logical :: lake ! lake or not lake
- integer :: j,fc,c,g,fp,p ! indices
+ integer :: j,fc,c,g,fp,p,pf,s ! indices
real(r8) :: dtime ! land model time step (sec)
real(r8) :: dtime_ch4 ! ch4 model time step (sec)
integer :: nstep
@@ -1735,6 +1738,7 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, &
real(r8) :: qflxlagd ! days to lag qflx_surf_lag in the tropics (days)
real(r8) :: highlatfact ! multiple of qflxlagd for high latitudes
integer :: dummyfilter(1) ! empty filter
+ integer :: nc ! clump index
character(len=32) :: subname='ch4' ! subroutine name
!-----------------------------------------------------------------------
@@ -1947,23 +1951,34 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, &
if (nlevdecomp == 1) then
+ nc = bounds%clump_index
+
! Set rootfraction to spval for non-veg points, unless patch%wtcol > 0.99,
! in which case set it equal to uniform dist.
- do j=1, nlevsoi
- do fp = 1, num_soilp
- p = filter_soilp(fp)
- c = patch%column(p)
-
- if (patch%itype(p) /= noveg) then
- rootfraction(p,j) = rootfr(p,j)
- else if (patch%wtcol(p) < 0.99_r8) then
- rootfraction(p,j) = spval
- else
- rootfraction(p,j) = dz(c,j) / zi(c,nlevsoi) ! Set equal to uniform distribution
- end if
- end do
- end do
+ do fp = 1, num_soilp
+ p = filter_soilp(fp)
+ c = patch%column(p)
+
+ if(.not. col%is_fates(c) ) then
+ do j=1, nlevsoi
+ if (patch%itype(p) /= noveg) then
+ rootfraction(p,j) = rootfr(p,j)
+ else if (patch%wtcol(p) < 0.99_r8) then
+ rootfraction(p,j) = spval
+ else
+ rootfraction(p,j) = dz(c,j) / zi(c,nlevsoi) ! Set equal to uniform distribution
+ end if
+ end do
+ else
+ pf = p-col%patchi(c)
+ s = clm_fates%f2hmap(nc)%hsites(c)
+ do j=1, clm_fates%fates(nc)%bc_in(s)%nlevsoil
+ rootfraction(p,j) = clm_fates%fates(nc)%bc_out(s)%rootfr_pa(pf,j)
+ end do
+ end if
+ end do
+
call p2c (bounds, nlevgrnd, &
rootfraction(bounds%begp:bounds%endp, :), &
rootfr_col(bounds%begc:bounds%endc, :), &
@@ -2042,7 +2057,7 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, &
rr(begp:endp), jwt(begc:endc), sat, lake, &
soilstate_inst, temperature_inst, waterstatebulk_inst, &
soilbiogeochem_carbonflux_inst, soilbiogeochem_nitrogenflux_inst, &
- ch4_inst)
+ ch4_inst, clm_fates)
! calculate CH4 oxidation in each soil layer
call ch4_oxid (bounds, &
@@ -2056,7 +2071,7 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, &
num_soilp, filter_soilp, &
annsum_npp(begp:endp), jwt(begc:endc), sat, lake, &
canopystate_inst, soilstate_inst, temperature_inst, energyflux_inst, &
- waterstatebulk_inst, waterfluxbulk_inst, ch4_inst)
+ waterstatebulk_inst, waterfluxbulk_inst, ch4_inst, clm_fates)
! calculate CH4 ebullition losses in each soil layer
call ch4_ebul (bounds, &
@@ -2091,7 +2106,7 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, &
rr(begp:endp), jwt(begc:endc), sat, lake, &
soilstate_inst, temperature_inst, waterstatebulk_inst, &
soilbiogeochem_carbonflux_inst, soilbiogeochem_nitrogenflux_inst, &
- ch4_inst)
+ ch4_inst, clm_fates)
! calculate CH4 oxidation in each lake layer
call ch4_oxid (bounds, &
@@ -2104,7 +2119,7 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, &
call ch4_aere (bounds, num_lakec, filter_lakec, 0, dummyfilter, &
annsum_npp(begp:endp), jwt(begc:endc), sat, lake, &
canopystate_inst, soilstate_inst, temperature_inst, energyflux_inst, &
- waterstatebulk_inst, waterfluxbulk_inst, ch4_inst)
+ waterstatebulk_inst, waterfluxbulk_inst, ch4_inst, clm_fates)
! calculate CH4 ebullition losses in each lake layer
call ch4_ebul (bounds, num_lakec, filter_lakec, &
@@ -2326,7 +2341,7 @@ subroutine ch4_prod (bounds, num_methc, filter_methc, num_methp, &
filter_methp, rr, jwt, sat, lake, &
soilstate_inst, temperature_inst, waterstatebulk_inst, &
soilbiogeochem_carbonflux_inst, soilbiogeochem_nitrogenflux_inst, &
- ch4_inst)
+ ch4_inst, clm_fates)
!
! !DESCRIPTION:
! Production is done below the water table, based on CN heterotrophic respiration.
@@ -2357,9 +2372,11 @@ subroutine ch4_prod (bounds, num_methc, filter_methc, num_methp, &
type(soilbiogeochem_carbonflux_type) , intent(in) :: soilbiogeochem_carbonflux_inst
type(soilbiogeochem_nitrogenflux_type) , intent(in) :: soilbiogeochem_nitrogenflux_inst
type(ch4_type) , intent(inout) :: ch4_inst
+ type(hlm_fates_interface_type) , intent(inout) :: clm_fates
!
! !LOCAL VARIABLES:
- integer :: p,c,j,g ! indices
+ integer :: p,c,j,g,s ! indices
+ integer :: nc ! clump index
integer :: fc ! column index
integer :: fp ! PATCH index
real(r8) :: dtime
@@ -2470,16 +2487,30 @@ subroutine ch4_prod (bounds, num_methc, filter_methc, num_methp, &
c = filter_methc(fp)
rr_vr(c,:) = 0.0_r8
end do
- do j=1,nlevsoi
- do fp = 1, num_methp
- p = filter_methp(fp)
- c = patch%column(p)
+ do fp = 1, num_methp
+ p = filter_methp(fp)
+ c = patch%column(p)
+ if(.not.col%is_fates(c)) then
if (wtcol(p) > 0._r8 .and. patch%itype(p) /= noveg) then
- rr_vr(c,j) = rr_vr(c,j) + rr(p)*crootfr(p,j)*wtcol(p)
+ do j=1,nlevsoi
+ rr_vr(c,j) = rr_vr(c,j) + rr(p)*crootfr(p,j)*wtcol(p)
+ end do
end if
- end do
+ end if
end do
+
+ if(use_fates) then
+ nc = bounds%clump_index
+ do s = 1,clm_fates%fates(nc)%nsites
+ c = clm_fates%f2hmap(nc)%fcolumn(s)
+ do j=1, clm_fates%fates(nc)%bc_in(s)%nlevsoil
+ rr_vr(c,j) = clm_fates%fates(nc)%bc_out(s)%root_resp(j)
+ end do
+ end do
+ end if
+
+
end if
partition_z = 1._r8
@@ -2492,7 +2523,7 @@ subroutine ch4_prod (bounds, num_methc, filter_methc, num_methp, &
if (.not. lake) then
- if (use_cn) then
+ if (use_cn .or. use_fates) then
! Use soil heterotrophic respiration (based on Wania)
base_decomp = (somhr(c)+lithr(c)) / catomw
! Convert from gC to molC
@@ -2514,7 +2545,7 @@ subroutine ch4_prod (bounds, num_methc, filter_methc, num_methp, &
end if
else
call endrun(msg=' ERROR: No source for decomp rate in CH4Prod.'//&
- ' CH4 model currently requires CN.'//errMsg(sourcefile, __LINE__))
+ ' CH4 model currently requires CN or FATES.'//errMsg(sourcefile, __LINE__))
end if ! use_cn
! For sensitivity studies
@@ -2815,7 +2846,7 @@ end subroutine ch4_oxid
subroutine ch4_aere (bounds, num_methc, filter_methc, num_methp, filter_methp, &
annsum_npp, jwt, sat, lake, &
canopystate_inst, soilstate_inst, temperature_inst, energyflux_inst, &
- waterstatebulk_inst, waterfluxbulk_inst, ch4_inst)
+ waterstatebulk_inst, waterfluxbulk_inst, ch4_inst, clm_fates)
!
! !DESCRIPTION:
! Arctic c3 grass (which is often present in fens) and all vegetation in inundated areas is assumed to have
@@ -2836,7 +2867,7 @@ subroutine ch4_aere (bounds, num_methc, filter_methc, num_methp, filter_methp, &
integer , intent(in) :: filter_methc(:) ! column filter for soil points
integer , intent(in) :: num_methp ! number of soil points in patch filter
integer , intent(in) :: filter_methp(:) ! patch filter for soil points
- real(r8) , intent(in) :: annsum_npp( bounds%begp: ) ! annual sum NPP (gC/m2/yr)
+ real(r8) , intent(in),target :: annsum_npp( bounds%begp: ) ! annual sum NPP (gC/m2/yr)
integer , intent(in) :: jwt( bounds%begc: ) ! index of the soil layer right above the water table (-) [col]
integer , intent(in) :: sat ! 0 = unsaturated; 1 = saturated
logical , intent(in) :: lake ! function called with lake filter
@@ -2847,36 +2878,39 @@ subroutine ch4_aere (bounds, num_methc, filter_methc, num_methp, filter_methp, &
type(waterstatebulk_type) , intent(in) :: waterstatebulk_inst
type(waterfluxbulk_type) , intent(in) :: waterfluxbulk_inst
type(ch4_type) , intent(inout) :: ch4_inst
+ type(hlm_fates_interface_type), intent(inout) :: clm_fates
+
!
! !LOCAL VARIABLES:
- integer :: p,c,g,j ! indices
+ integer :: nc ! clump index
+ integer :: p,c,g,j,s ! indices
integer :: fc,fp ! soil filter column index
integer :: itype ! temporary
- real(r8) :: f_oxid ! fraction of CH4 oxidized in oxic zone around roots
- real(r8) :: diffus_aere ! gas diffusivity through aerenchyma (m^2/s)
- real(r8) :: m_tiller
- real(r8) :: n_tiller
- real(r8) :: poros_tiller
- real(r8) :: rob ! root obliquity, e.g. csc of root angle relative to vertical
- ! (ratio of root total length to depth)
- real(r8) :: area_tiller ! cross-sectional area of tillers (m^2/m^2)
- real(r8) :: tranloss ! loss due to transpiration (mol / m3 /s)
- real(r8) :: aere, aeretran, oxaere ! (mol / m3 /s)
- real(r8) :: k_h_cc, k_h_inv, dtime, oxdiffus, anpp, nppratio, h2osoi_vol_min, conc_ch4_wat
- real(r8) :: aerecond ! aerenchyma conductance (m/s)
! ch4 aerenchyma parameters
+ integer :: pf ! fates patch index
+ integer :: nlevsoil_f ! number of fates soil layers
real(r8) :: aereoxid ! fraction of methane flux entering aerenchyma rhizosphere
- real(r8) :: scale_factor_aere ! scale factor on the aerenchyma area for sensitivity tests
- real(r8) :: nongrassporosratio ! Ratio of root porosity in non-grass to grass, used for aerenchyma transport
- real(r8) :: unsat_aere_ratio ! Ratio to multiply upland vegetation aerenchyma porosity by compared to inundated systems (= 0.05_r8 / 0.3_r8)
- real(r8) :: porosmin ! minimum aerenchyma porosity (unitless)(= 0.05_r8)
-
+ real(r8) :: tranloss(1:nlevsoi) ! loss due to transpiration (mol / m3 /s)
+ real(r8) :: aere(1:nlevsoi)
+ real(r8) :: oxaere(1:nlevsoi) ! (mol / m3 /s)
+ real(r8) :: rootfr_vr(1:nlevsoi) ! Root fraction over depth
+ real(r8) :: aeretran
+ real(r8) :: dtime
+ logical :: is_vegetated
+ real(r8) :: wfrac ! fraction (by crown area) of plants that are woody
+ real(r8) :: poros_tiller
+ ! These pointers help us swap between big-leaf and fates boundary conditions
+ real(r8), pointer :: annavg_agnpp_ptr
+ real(r8), pointer :: annavg_bgnpp_ptr
+ real(r8), pointer :: annsum_npp_ptr
+ real(r8), pointer :: frootc_ptr
+
+ ! These pointers help us swap between saturated and unsaturated boundary conditions
real(r8), parameter :: smallnumber = 1.e-12_r8
real(r8), pointer :: ch4_aere_depth(:,:)
real(r8), pointer :: ch4_tran_depth(:,:)
real(r8), pointer :: o2_aere_depth(:,:)
- real(r8), pointer :: co2_aere_depth(:,:)
real(r8), pointer :: ch4_oxid_depth(:,:)
real(r8), pointer :: ch4_prod_depth(:,:)
real(r8), pointer :: conc_o2(:,:)
@@ -2887,36 +2921,28 @@ subroutine ch4_aere (bounds, num_methc, filter_methc, num_methp, filter_methp, &
SHR_ASSERT_ALL_FL((ubound(annsum_npp) == (/bounds%endp/)), sourcefile, __LINE__)
SHR_ASSERT_ALL_FL((ubound(jwt) == (/bounds%endc/)), sourcefile, __LINE__)
- associate( &
- z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi)
- dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi)
- wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] weight (relative to column)
-
- elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow
-
- t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi)
-
- watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity)
- rootr => soilstate_inst%rootr_patch , & ! Input: [real(r8) (:,:) ] effective fraction of roots in each soil layer (SMS method only) (nlevgrnd)
- rootfr => soilstate_inst%rootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer (nlevsoi)
-
- h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3]
-
- qflx_tran_veg => waterfluxbulk_inst%qflx_tran_veg_patch , & ! Input: [real(r8) (:) ] vegetation transpiration (mm H2O/s) (+ = to atm)
-
- canopy_cond => energyflux_inst%canopy_cond_patch , & ! Input: [real(r8) (:) ] tracer conductance for canopy [m/s]
-
- annavg_agnpp => ch4_inst%annavg_agnpp_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) annual average aboveground NPP
- annavg_bgnpp => ch4_inst%annavg_bgnpp_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) annual average belowground NPP
- grnd_ch4_cond => ch4_inst%grnd_ch4_cond_patch , & ! Input: [real(r8) (:) ] tracer conductance for boundary layer [m/s]
- c_atm => ch4_inst%c_atm_grc & ! Input: [real(r8) (: ,:) ] CH4, O2, CO2 atmospheric conc (mol/m3)
+ associate( &
+ z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi)
+ dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi)
+ wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] weight (relative to column)
+ elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow
+ t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi)
+ watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity)
+ rootr => soilstate_inst%rootr_patch , & ! Input: [real(r8) (:,:) ] effective fraction of roots in each soil layer (SMS method only) (nlevgrnd)
+ rootfr => soilstate_inst%rootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer (nlevsoi)
+ h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3]
+ qflx_tran_veg => waterfluxbulk_inst%qflx_tran_veg_patch , & ! Input: [real(r8) (:) ] vegetation transpiration (mm H2O/s) (+ = to atm)
+ canopy_cond => energyflux_inst%canopy_cond_patch , & ! Input: [real(r8) (:) ] tracer conductance for canopy [m/s]
+ annavg_agnpp => ch4_inst%annavg_agnpp_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) annual average aboveground NPP
+ annavg_bgnpp => ch4_inst%annavg_bgnpp_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) annual average belowground NPP
+ grnd_ch4_cond => ch4_inst%grnd_ch4_cond_patch , & ! Input: [real(r8) (:) ] tracer conductance for boundary layer [m/s]
+ c_atm => ch4_inst%c_atm_grc & ! Input: [real(r8) (: ,:) ] CH4, O2, CO2 atmospheric conc (mol/m3)
)
if (sat == 0) then ! unsaturated
ch4_aere_depth => ch4_inst%ch4_aere_depth_unsat_col ! Output: [real(r8) (:,:)] CH4 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi)
ch4_tran_depth => ch4_inst%ch4_tran_depth_unsat_col ! Output: [real(r8) (:,:)] CH4 loss rate via transpiration in each soil layer (mol/m3/s) (nlevsoi)
o2_aere_depth => ch4_inst%o2_aere_depth_unsat_col ! Output: [real(r8) (:,:)] O2 gain rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi)
- co2_aere_depth => ch4_inst%co2_aere_depth_unsat_col ! Output: [real(r8) (:,:)] CO2 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi)
conc_ch4 => ch4_inst%conc_ch4_unsat_col ! Input: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi)
conc_o2 => ch4_inst%conc_o2_unsat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi)
ch4_oxid_depth => ch4_inst%ch4_oxid_depth_unsat_col ! Input: [real(r8) (:,:)] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi)
@@ -2925,7 +2951,6 @@ subroutine ch4_aere (bounds, num_methc, filter_methc, num_methp, filter_methp, &
ch4_aere_depth => ch4_inst%ch4_aere_depth_sat_col ! Output: [real(r8) (:,:)] CH4 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi)
ch4_tran_depth => ch4_inst%ch4_tran_depth_sat_col ! Output: [real(r8) (:,:)] CH4 loss rate via transpiration in each soil layer (mol/m3/s) (nlevsoi)
o2_aere_depth => ch4_inst%o2_aere_depth_sat_col ! Output: [real(r8) (:,:)] O2 gain rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi)
- co2_aere_depth => ch4_inst%co2_aere_depth_sat_col ! Output: [real(r8) (:,:)] CO2 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi)
conc_ch4 => ch4_inst%conc_ch4_sat_col ! Input: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi)
conc_o2 => ch4_inst%conc_o2_sat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi)
ch4_oxid_depth => ch4_inst%ch4_oxid_depth_sat_col ! Input: [real(r8) (:,:)] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi)
@@ -2934,14 +2959,6 @@ subroutine ch4_aere (bounds, num_methc, filter_methc, num_methp, filter_methp, &
dtime = get_step_size_real()
- ! Set aerenchyma parameters
- aereoxid = params_inst%aereoxid
- scale_factor_aere = params_inst%scale_factor_aere
- nongrassporosratio = params_inst%nongrassporosratio
- unsat_aere_ratio = params_inst%unsat_aere_ratio
- porosmin = params_inst%porosmin
- rob = params_inst%rob
-
! Initialize ch4_aere_depth
do j=1,nlevsoi
do fc = 1, num_methc
@@ -2952,117 +2969,249 @@ subroutine ch4_aere (bounds, num_methc, filter_methc, num_methp, filter_methp, &
end do
end do
- diffus_aere = d_con_g(1,1)*1.e-4_r8 ! for CH4: m^2/s
- ! This parameter is poorly constrained and should be done on a patch-specific basis...
+ nc = bounds%clump_index
! point loop to partition aerenchyma flux into each soil layer
if (.not. lake) then
- do j=1,nlevsoi
- do fp = 1, num_methp
- p = filter_methp (fp)
- c = patch%column(p)
- g = col%gridcell(c)
- ! Calculate transpiration loss
- if (transpirationloss .and. patch%itype(p) /= noveg) then !allow tloss above WT ! .and. j > jwt(c)) then
- ! Calculate water concentration
- h2osoi_vol_min = min(watsat(c,j), h2osoi_vol(c,j))
- k_h_inv = exp(-c_h_inv(1) * (1._r8 / t_soisno(c,j) - 1._r8 / kh_tbase) + log (kh_theta(1)))
- k_h_cc = t_soisno(c,j) / k_h_inv * rgasLatm
- conc_ch4_wat = conc_ch4(c,j) / ( (watsat(c,j)-h2osoi_vol_min)/k_h_cc + h2osoi_vol_min)
-
- tranloss = conc_ch4_wat * rootr(p,j)*qflx_tran_veg(p) / dz(c,j) / 1000._r8
- ! mol/m3/s mol/m3 mm / s m mm/m
- ! Use rootr here for effective per-layer transpiration, which may not be the same as rootfr
- tranloss = max(tranloss, 0._r8) ! in case transpiration is pathological
+ do fp = 1, num_methp
+ p = filter_methp (fp)
+ c = patch%column(p)
+ g = col%gridcell(c)
+
+ if(.not.col%is_fates(c) ) then
+ if(patch%itype(p) /= noveg) then
+ is_vegetated = .true.
else
- tranloss = 0._r8
+ is_vegetated = .false.
end if
- ! Calculate aerenchyma diffusion
- if (j > jwt(c) .and. t_soisno(c,j) > tfrz .and. patch%itype(p) /= noveg) then
- ! Attn EK: This calculation of aerenchyma properties is very uncertain. Let's check in once all
- ! the new components are in; if there is any tuning to be done to get a realistic global flux,
- ! this would probably be the place. We will have to document clearly in the Tech Note
- ! any major changes from the Riley et al. 2011 version. (There are a few other minor ones.)
-
- anpp = annsum_npp(p) ! g C / m^2/yr
- anpp = max(anpp, 0._r8) ! NPP can be negative b/c of consumption of storage pools
-
- if (annavg_agnpp(p) /= spval .and. annavg_bgnpp(p) /= spval .and. &
- annavg_agnpp(p) > 0._r8 .and. annavg_bgnpp(p) > 0._r8) then
- nppratio = annavg_bgnpp(p) / (annavg_agnpp(p) + annavg_bgnpp(p))
- else
- nppratio = 0.5_r8
- end if
-
- ! Estimate area of tillers (see Wania thesis)
- ! m_tiller = anpp * r_leaf_root * lai ! (4.17 Wania)
- ! m_tiller = 600._r8 * 0.5_r8 * 2._r8 ! used to be 300
- ! Note: this calculation is based on Arctic graminoids, and should be refined for woody plants, if not
- ! done on a patch-specific basis.
-
- m_tiller = anpp * nppratio * 4._r8 !replace the elai(p) by constant 4 (by Xiyan Xu, 05/2016)
-
- n_tiller = m_tiller / 0.22_r8
-
- itype = patch%itype(p)
- if (itype == nc3_arctic_grass .or. pftcon%crop(itype) == 1 .or. &
- itype == nc3_nonarctic_grass .or. itype == nc4_grass) then
- poros_tiller = 0.3_r8 ! Colmer 2003
- else
- poros_tiller = 0.3_r8 * nongrassporosratio
- end if
-
- if (sat == 0) then
- poros_tiller = poros_tiller * unsat_aere_ratio
- end if
+ itype = patch%itype(p)
+ if (itype == nc3_arctic_grass .or. pftcon%crop(itype) == 1 .or. &
+ itype == nc3_nonarctic_grass .or. itype == nc4_grass) then
+ poros_tiller = 0.3_r8 ! Colmer 2003
+ else
+ poros_tiller = 0.3_r8 * params_inst%nongrassporosratio
+ end if
- poros_tiller = max(poros_tiller, porosmin)
-
- area_tiller = scale_factor_aere * n_tiller * poros_tiller * rpi * 2.9e-3_r8**2._r8 ! (m2/m2)
-
- k_h_inv = exp(-c_h_inv(1) * (1._r8 / t_soisno(c,j) - 1._r8 / kh_tbase) + log (kh_theta(1))) ! (4.12) Wania (L atm/mol)
- k_h_cc = t_soisno(c,j) / k_h_inv * rgasLatm ! (4.21) Wania [(mol/m3w) / (mol/m3g)]
- aerecond = area_tiller * rootfr(p,j) * diffus_aere / (z(c,j)*rob)
- ! Add in boundary layer resistance
- aerecond = 1._r8 / (1._r8/(aerecond+smallnumber) + 1._r8/(grnd_ch4_cond(p)+smallnumber))
-
- aere = aerecond * (conc_ch4(c,j)/watsat(c,j)/k_h_cc - c_atm(g,1)) / dz(c,j) ![mol/m3-total/s]
- !ZS: Added watsat & Henry's const.
- aere = max(aere, 0._r8) ! prevent backwards diffusion
-
- ! Do oxygen diffusion into layer
- k_h_inv = exp(-c_h_inv(2) * (1._r8 / t_soisno(c,j) - 1._r8 / kh_tbase) + log (kh_theta(2)))
- k_h_cc = t_soisno(c,j) / k_h_inv * rgasLatm ! (4.21) Wania [(mol/m3w) / (mol/m3g)]
- oxdiffus = diffus_aere * d_con_g(2,1) / d_con_g(1,1) ! adjust for O2:CH4 molecular diffusion
- aerecond = area_tiller * rootfr(p,j) * oxdiffus / (z(c,j)*rob)
- aerecond = 1._r8 / (1._r8/(aerecond+smallnumber) + 1._r8/(grnd_ch4_cond(p)+smallnumber))
- oxaere = -aerecond *(conc_o2(c,j)/watsat(c,j)/k_h_cc - c_atm(g,2)) / dz(c,j) ![mol/m3-total/s]
- oxaere = max(oxaere, 0._r8)
- ! Diffusion in is positive; prevent backwards diffusion
- if ( .not. use_aereoxid_prog ) then ! fixed aere oxid proportion; will be done in ch4_tran
- oxaere = 0._r8
- end if
+ annsum_npp_ptr => annsum_npp(p)
+ annavg_agnpp_ptr => ch4_inst%annavg_agnpp_patch(p)
+ annavg_bgnpp_ptr => ch4_inst%annavg_bgnpp_patch(p)
+ rootfr_vr(1:nlevsoi) = rootfr(p,1:nlevsoi)
+
+ else
+
+ pf = p-col%patchi(c)
+ s = clm_fates%f2hmap(nc)%hsites(c)
+
+ wfrac = clm_fates%fates(nc)%bc_out(s)%woody_frac_aere_pa(pf)
+ poros_tiller = wfrac*0.3_r8 + (1._r8-wfrac)*0.3_r8*params_inst%nongrassporosratio
+ if(patch%is_bareground(p)) then
+ is_vegetated = .false.
else
- aere = 0._r8
- oxaere = 0._r8
- end if ! veg type, below water table, & above freezing
+ is_vegetated = .true.
+ end if
+ annsum_npp_ptr => clm_fates%fates(nc)%bc_out(s)%annsum_npp_pa(pf)
+ annavg_agnpp_ptr => clm_fates%fates(nc)%bc_out(s)%annavg_agnpp_pa(pf)
+ annavg_bgnpp_ptr => clm_fates%fates(nc)%bc_out(s)%annavg_bgnpp_pa(pf)
+ nlevsoil_f = clm_fates%fates(nc)%bc_in(s)%nlevsoil
+ rootfr_vr(1:nlevsoi) = 0._r8
+ rootfr_vr(1:nlevsoil_f) = clm_fates%fates(nc)%bc_out(s)%rootfr_pa(pf,1:nlevsoil_f)
+
+ end if
+ call SiteOxAere(is_vegetated, watsat(c,1:nlevsoi), h2osoi_vol(c,1:nlevsoi), t_soisno(c,1:nlevsoi), &
+ conc_ch4(c,1:nlevsoi), rootr(p,1:nlevsoi), qflx_tran_veg(p), jwt(c), &
+ annsum_npp_ptr,annavg_agnpp_ptr, annavg_bgnpp_ptr, &
+ elai(p), poros_tiller, rootfr_vr(1:nlevsoi), &
+ grnd_ch4_cond(p), conc_o2(c,1:nlevsoi), c_atm(g,1:2), &
+ z(c,1:nlevsoi), dz(c,1:nlevsoi), sat, &
+ tranloss(1:nlevsoi), & ! Out
+ aere(1:nlevsoi), & ! Out
+ oxaere(1:nlevsoi)) ! Out
+
+ do j = 1,nlevsoi
! Impose limitation based on available methane during timestep
! By imposing the limitation here, don't allow aerenchyma access to methane from other Patches.
- aeretran = min(aere+tranloss, conc_ch4(c,j)/dtime + ch4_prod_depth(c,j))
+ aeretran = min(aere(j)+tranloss(j), conc_ch4(c,j)/dtime + ch4_prod_depth(c,j))
ch4_aere_depth (c, j) = ch4_aere_depth(c,j) + aeretran*wtcol(p) ! patch weight in col.
- ch4_tran_depth (c, j) = ch4_tran_depth(c,j) + min(tranloss, aeretran)*wtcol(p)
- o2_aere_depth (c, j) = o2_aere_depth (c,j) + oxaere*wtcol(p)
- end do ! p filter
- end do ! over levels
+ ch4_tran_depth (c, j) = ch4_tran_depth(c,j) + min(tranloss(j), aeretran)*wtcol(p)
+ o2_aere_depth (c, j) = o2_aere_depth (c,j) + oxaere(j)*wtcol(p)
+ end do ! over levels
+
+ end do
end if ! not lake
end associate
end subroutine ch4_aere
+ !--------------------------------------------------------------------------------------
+
+ subroutine SiteOxAere(is_vegetated, &
+ watsat, &
+ h2osoi_vol, &
+ t_soisno, &
+ conc_ch4, &
+ rootr, &
+ qflx_tran_veg, &
+ jwt, &
+ annsum_npp, &
+ annavg_agnpp, &
+ annavg_bgnpp, &
+ elai, &
+ poros_tiller, &
+ rootfr, &
+ grnd_ch4_cond, &
+ conc_o2, &
+ c_atm, &
+ z, &
+ dz, &
+ sat, &
+ tranloss, & ! Out
+ aere, & ! Out
+ oxaere) ! Out
+
+
+ use clm_varcon , only : rpi
+ use ch4varcon , only : transpirationloss, use_aereoxid_prog
+
+ !
+ ! !DESCRIPTION:
+ ! Site(column) level fluxes for O2 gain rate via
+ ! aerenchyma and ch4 losss rates from transpiration
+
+ ! Arguments (in)
+
+ logical, intent(in) :: is_vegetated
+ real(r8), intent(in) :: watsat(:) ! volumetric soil water at saturation (porosity)
+ real(r8), intent(in) :: h2osoi_vol(:) ! volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3]
+ real(r8), intent(in) :: t_soisno(:) ! soil temperature (Kelvin)
+ real(r8), intent(in) :: conc_ch4(:) ! CH4 conc in each soil layer (mol/m3)
+ real(r8), intent(in) :: rootr(:) ! effective fraction of roots in each soil layer
+ real(r8), intent(in) :: qflx_tran_veg ! vegetation transpiration (mm H2O/s) (+ = to atm)
+ integer, intent(in) :: jwt ! index of the soil layer right above the water table (-) [col]
+ real(r8), intent(in) :: annsum_npp ! annual sum NPP (gC/m2/yr)
+ real(r8), intent(in) :: annavg_agnpp ! (gC/m2/s) annual average aboveground NPP
+ real(r8), intent(in) :: annavg_bgnpp ! (gC/m2/s) annual average belowground NPP
+ real(r8), intent(in) :: elai ! one-sided leaf area index with burying by snow
+ real(r8) :: poros_tiller
+ real(r8), intent(in) :: rootfr(:) ! fraction of roots in each soil layer
+ real(r8), intent(in) :: grnd_ch4_cond ! tracer conductance for boundary layer [m/s]
+ real(r8), intent(in) :: conc_o2(:) ! O2 conc in each soil layer (mol/m3)
+ real(r8), intent(in) :: c_atm(:) ! CH4 atmospheric conc (mol/m3)
+ real(r8), intent(in) :: z(:) ! Soil layer depth [m]
+ real(r8), intent(in) :: dz(:) ! Soil layer thickness [m]
+ integer, intent(in) :: sat ! 0 == unsaturated; 1 = saturated
+
+ ! Arguments (out)
+ real(r8), intent(out) :: tranloss(:)
+ real(r8), intent(out) :: aere(:)
+ real(r8), intent(out) :: oxaere(:)
+
+ integer :: j,pf
+ real(r8) :: oxdiffus
+ real(r8) :: area_tiller ! cross-sectional area of tillers (m^2/m^2)
+ real(r8) :: diffus_aere ! gas diffusivity through aerenchyma (m^2/s)
+ real(r8) :: m_tiller
+ real(r8) :: n_tiller
+ real(r8) :: h2osoi_vol_min
+ real(r8) :: k_h_cc, k_h_inv
+ real(r8) :: anpp, nppratio
+ real(r8) :: conc_ch4_wat
+ real(r8) :: aerecond ! aerenchyma conductance (m/s)
+ real(r8), parameter :: smallnumber = 1.e-12_r8
+
+ ! This parameter is poorly constrained and should be done on a patch-specific basis...
+ diffus_aere = d_con_g(1,1)*1.e-4_r8 ! for CH4: m^2/s
+
+ do j=1,nlevsoi
+
+ ! Calculate transpiration loss
+ if (transpirationloss .and. is_vegetated) then
+ ! Calculate water concentration
+ h2osoi_vol_min = min(watsat(j), h2osoi_vol(j))
+ k_h_inv = exp(-c_h_inv(1) * (1._r8 / t_soisno(j) - 1._r8 / kh_tbase) + log (kh_theta(1)))
+ k_h_cc = t_soisno(j) / k_h_inv * rgasLatm
+ conc_ch4_wat = conc_ch4(j) / ( (watsat(j)-h2osoi_vol_min)/k_h_cc + h2osoi_vol_min)
+
+ tranloss(j) = conc_ch4_wat * rootr(j)*qflx_tran_veg / dz(j) / 1000._r8
+ ! mol/m3/s mol/m3 mm / s m mm/m
+ ! Use rootr here for effective per-layer transpiration, which may not be the same as rootfr
+ tranloss(j) = max(tranloss(j), 0._r8) ! in case transpiration is pathological
+ else
+ tranloss(j) = 0._r8
+ end if
+
+ ! Calculate aerenchyma diffusion
+ if (j > jwt .and. t_soisno(j) > tfrz .and. is_vegetated) then
+ ! Attn EK: This calculation of aerenchyma properties is very uncertain. Let's check in once all
+ ! the new components are in; if there is any tuning to be done to get a realistic global flux,
+ ! this would probably be the place. We will have to document clearly in the Tech Note
+ ! any major changes from the Riley et al. 2011 version. (There are a few other minor ones.)
+
+ anpp = annsum_npp ! g C / m^2/yr
+ anpp = max(anpp, 0._r8) ! NPP can be negative b/c of consumption of storage pools
+
+ if (annavg_agnpp /= spval .and. annavg_bgnpp /= spval .and. &
+ annavg_agnpp > 0._r8 .and. annavg_bgnpp > 0._r8) then
+ nppratio = annavg_bgnpp / (annavg_agnpp + annavg_bgnpp)
+ else
+ nppratio = 0.5_r8
+ end if
+
+ ! Estimate area of tillers (see Wania thesis)
+ !m_tiller = anpp * r_leaf_root * lai ! (4.17 Wania)
+ !m_tiller = 600._r8 * 0.5_r8 * 2._r8 ! used to be 300
+ ! Note: this calculation is based on Arctic graminoids, and should be refined for woody plants, if not
+ ! done on a PFT-specific basis.
+
+ m_tiller = anpp * nppratio * 4._r8 !replace the elai(p) by constant 4 (by Xiyan Xu, 05/2016)
+
+
+ n_tiller = m_tiller / 0.22_r8
+
+ if (sat == 0) then
+ poros_tiller = poros_tiller * params_inst%unsat_aere_ratio
+ end if
+
+ poros_tiller = max(poros_tiller, params_inst%porosmin)
+
+ area_tiller = params_inst%scale_factor_aere * n_tiller * poros_tiller * rpi * 2.9e-3_r8**2._r8 ! (m2/m2)
+
+ k_h_inv = exp(-c_h_inv(1) * (1._r8 / t_soisno(j) - 1._r8 / kh_tbase) + log (kh_theta(1))) ! (4.12) Wania (L atm/mol)
+ k_h_cc = t_soisno(j) / k_h_inv * rgasLatm ! (4.21) Wania [(mol/m3w) / (mol/m3g)]
+ aerecond = area_tiller * rootfr(j) * diffus_aere / (z(j)*params_inst%rob)
+ ! Add in boundary layer resistance
+ aerecond = 1._r8 / (1._r8/(aerecond+smallnumber) + 1._r8/(grnd_ch4_cond+smallnumber))
+
+ aere(j) = aerecond * (conc_ch4(j)/watsat(j)/k_h_cc - c_atm(1)) / dz(j) ![mol/m3-total/s]
+ !ZS: Added watsat & Henry's const.
+ aere(j) = max(aere(j), 0._r8) ! prevent backwards diffusion
+
+ ! Do oxygen diffusion into layer
+ k_h_inv = exp(-c_h_inv(2) * (1._r8 / t_soisno(j) - 1._r8 / kh_tbase) + log (kh_theta(2)))
+ k_h_cc = t_soisno(j) / k_h_inv * rgasLatm ! (4.21) Wania [(mol/m3w) / (mol/m3g)]
+ oxdiffus = diffus_aere * d_con_g(2,1) / d_con_g(1,1) ! adjust for O2:CH4 molecular diffusion
+ aerecond = area_tiller * rootfr(j) * oxdiffus / (z(j)*params_inst%rob)
+ aerecond = 1._r8 / (1._r8/(aerecond+smallnumber) + 1._r8/(grnd_ch4_cond+smallnumber))
+ oxaere(j) = -aerecond *(conc_o2(j)/watsat(j)/k_h_cc - c_atm(2)) / dz(j) ![mol/m3-total/s]
+ oxaere(j) = max(oxaere(j), 0._r8)
+ ! Diffusion in is positive; prevent backwards diffusion
+ if ( .not. use_aereoxid_prog ) then ! fixed aere oxid proportion; will be done in ch4_tran
+ oxaere(j) = 0._r8
+ end if
+ else
+ aere(j) = 0._r8
+ oxaere(j) = 0._r8
+ end if ! veg type, below water table, & above freezing
+
+ end do
+
+ return
+ end subroutine SiteOxAere
+
+
!-----------------------------------------------------------------------
subroutine ch4_ebul (bounds, &
num_methc, filter_methc, &
@@ -4155,24 +4304,26 @@ subroutine ch4_annualupdate(bounds, num_methc, filter_methc, num_methp, filter_m
tempavg_finrw(c) = tempavg_finrw(c) + dt/secsperyear * finundated(c) * somhr(c)
end if
end do
-
+
do fp = 1,num_methp
p = filter_methp(fp)
c = patch%column(p)
- if (annsum_counter(c) >= secsperyear) then
-
- annavg_agnpp(p) = tempavg_agnpp(p)
- tempavg_agnpp(p) = 0._r8
-
- annavg_bgnpp(p) = tempavg_bgnpp(p)
- tempavg_bgnpp(p) = 0._r8
-
- else
- tempavg_agnpp(p) = tempavg_agnpp(p) + dt/secsperyear * agnpp(p)
- tempavg_bgnpp(p) = tempavg_bgnpp(p) + dt/secsperyear * bgnpp(p)
+ if(.not.col%is_fates(c)) then
+ if (annsum_counter(c) >= secsperyear) then
+
+ annavg_agnpp(p) = tempavg_agnpp(p)
+ tempavg_agnpp(p) = 0._r8
+
+ annavg_bgnpp(p) = tempavg_bgnpp(p)
+ tempavg_bgnpp(p) = 0._r8
+
+ else
+ tempavg_agnpp(p) = tempavg_agnpp(p) + dt/secsperyear * agnpp(p)
+ tempavg_bgnpp(p) = tempavg_bgnpp(p) + dt/secsperyear * bgnpp(p)
+ end if
end if
end do
-
+
! column loop
do fc = 1,num_methc
c = filter_methc(fc)
diff --git a/src/biogeochem/dynConsBiogeochemMod.F90 b/src/biogeochem/dynConsBiogeochemMod.F90
index 32cd2b9577..f8cff29911 100644
--- a/src/biogeochem/dynConsBiogeochemMod.F90
+++ b/src/biogeochem/dynConsBiogeochemMod.F90
@@ -58,7 +58,7 @@ subroutine dyn_cnbal_patch(bounds, &
! !USES:
use shr_const_mod , only : SHR_CONST_PDB
use landunit_varcon , only : istsoil, istcrop
- use clm_varpar , only : nlevdecomp
+ use clm_varpar , only : nlevdecomp, i_litr_min, i_litr_max
use clm_varcon , only : c13ratio, c14ratio, c3_r2, c4_r2
use clm_time_manager , only : get_step_size_real
use dynPriorWeightsMod , only : prior_weights_type
@@ -85,7 +85,7 @@ subroutine dyn_cnbal_patch(bounds, &
type(soilbiogeochem_state_type) , intent(in) :: soilbiogeochem_state_inst
!
! !LOCAL VARIABLES:
- integer :: p,c,l,g,j ! indices
+ integer :: p,c,l,g,j,i ! indices
integer :: begp, endp
integer :: ier ! error code
real(r8) :: dt ! land model time step (sec)
@@ -593,36 +593,20 @@ subroutine dyn_cnbal_patch(bounds, &
c = patch%column(p)
! fine root litter carbon fluxes
- cnveg_carbonflux_inst%dwt_frootc_to_litr_met_c_col(c,j) = &
- cnveg_carbonflux_inst%dwt_frootc_to_litr_met_c_col(c,j) + &
- (dwt_frootc_to_litter(p)*pftcon%fr_flab(patch%itype(p)))/dt &
- * soilbiogeochem_state_inst%froot_prof_patch(p,j)
-
- cnveg_carbonflux_inst%dwt_frootc_to_litr_cel_c_col(c,j) = &
- cnveg_carbonflux_inst%dwt_frootc_to_litr_cel_c_col(c,j) + &
- (dwt_frootc_to_litter(p)*pftcon%fr_fcel(patch%itype(p)))/dt &
- * soilbiogeochem_state_inst%froot_prof_patch(p,j)
-
- cnveg_carbonflux_inst%dwt_frootc_to_litr_lig_c_col(c,j) = &
- cnveg_carbonflux_inst%dwt_frootc_to_litr_lig_c_col(c,j) + &
- (dwt_frootc_to_litter(p)*pftcon%fr_flig(patch%itype(p)))/dt &
- * soilbiogeochem_state_inst%froot_prof_patch(p,j)
-
+ do i = i_litr_min, i_litr_max
+ cnveg_carbonflux_inst%dwt_frootc_to_litr_c_col(c,j,i) = &
+ cnveg_carbonflux_inst%dwt_frootc_to_litr_c_col(c,j,i) + &
+ (dwt_frootc_to_litter(p)*pftcon%fr_f(patch%itype(p),i)) / dt &
+ * soilbiogeochem_state_inst%froot_prof_patch(p,j)
+ end do
! fine root litter nitrogen fluxes
- cnveg_nitrogenflux_inst%dwt_frootn_to_litr_met_n_col(c,j) = &
- cnveg_nitrogenflux_inst%dwt_frootn_to_litr_met_n_col(c,j) + &
- (dwt_frootn_to_litter(p)*pftcon%fr_flab(patch%itype(p)))/dt &
- * soilbiogeochem_state_inst%froot_prof_patch(p,j)
- cnveg_nitrogenflux_inst%dwt_frootn_to_litr_cel_n_col(c,j) = &
- cnveg_nitrogenflux_inst%dwt_frootn_to_litr_cel_n_col(c,j) + &
- (dwt_frootn_to_litter(p)*pftcon%fr_fcel(patch%itype(p)))/dt &
- * soilbiogeochem_state_inst%froot_prof_patch(p,j)
-
- cnveg_nitrogenflux_inst%dwt_frootn_to_litr_lig_n_col(c,j) = &
- cnveg_nitrogenflux_inst%dwt_frootn_to_litr_lig_n_col(c,j) + &
- (dwt_frootn_to_litter(p)*pftcon%fr_flig(patch%itype(p)))/dt &
- * soilbiogeochem_state_inst%froot_prof_patch(p,j)
+ do i = i_litr_min, i_litr_max
+ cnveg_nitrogenflux_inst%dwt_frootn_to_litr_n_col(c,j,i) = &
+ cnveg_nitrogenflux_inst%dwt_frootn_to_litr_n_col(c,j,i) + &
+ (dwt_frootn_to_litter(p) * pftcon%fr_f(patch%itype(p),i)) / dt &
+ * soilbiogeochem_state_inst%froot_prof_patch(p,j)
+ end do
! livecroot fluxes to cwd
cnveg_carbonflux_inst%dwt_livecrootc_to_cwdc_col(c,j) = &
@@ -644,20 +628,12 @@ subroutine dyn_cnbal_patch(bounds, &
if ( use_c13 ) then
! C13 fine root litter fluxes
- c13_cnveg_carbonflux_inst%dwt_frootc_to_litr_met_c_col(c,j) = &
- c13_cnveg_carbonflux_inst%dwt_frootc_to_litr_met_c_col(c,j) + &
- (dwt_frootc13_to_litter(p)*pftcon%fr_flab(patch%itype(p)))/dt &
- * soilbiogeochem_state_inst%froot_prof_patch(p,j)
-
- c13_cnveg_carbonflux_inst%dwt_frootc_to_litr_cel_c_col(c,j) = &
- c13_cnveg_carbonflux_inst%dwt_frootc_to_litr_cel_c_col(c,j) + &
- (dwt_frootc13_to_litter(p)*pftcon%fr_fcel(patch%itype(p)))/dt &
- * soilbiogeochem_state_inst%froot_prof_patch(p,j)
-
- c13_cnveg_carbonflux_inst%dwt_frootc_to_litr_lig_c_col(c,j) = &
- c13_cnveg_carbonflux_inst%dwt_frootc_to_litr_lig_c_col(c,j) + &
- (dwt_frootc13_to_litter(p)*pftcon%fr_flig(patch%itype(p)))/dt &
- * soilbiogeochem_state_inst%froot_prof_patch(p,j)
+ do i = i_litr_min, i_litr_max
+ c13_cnveg_carbonflux_inst%dwt_frootc_to_litr_c_col(c,j,i) = &
+ c13_cnveg_carbonflux_inst%dwt_frootc_to_litr_c_col(c,j,i) + &
+ (dwt_frootc13_to_litter(p)*pftcon%fr_f(patch%itype(p),i)) / dt &
+ * soilbiogeochem_state_inst%froot_prof_patch(p,j)
+ end do
! livecroot fluxes to cwd
c13_cnveg_carbonflux_inst%dwt_livecrootc_to_cwdc_col(c,j) = &
@@ -673,20 +649,12 @@ subroutine dyn_cnbal_patch(bounds, &
if ( use_c14 ) then
! C14 fine root litter fluxes
- c14_cnveg_carbonflux_inst%dwt_frootc_to_litr_met_c_col(c,j) = &
- c14_cnveg_carbonflux_inst%dwt_frootc_to_litr_met_c_col(c,j) + &
- (dwt_frootc14_to_litter(p)*pftcon%fr_flab(patch%itype(p)))/dt &
- * soilbiogeochem_state_inst%froot_prof_patch(p,j)
-
- c14_cnveg_carbonflux_inst%dwt_frootc_to_litr_cel_c_col(c,j) = &
- c14_cnveg_carbonflux_inst%dwt_frootc_to_litr_cel_c_col(c,j) + &
- (dwt_frootc14_to_litter(p)*pftcon%fr_fcel(patch%itype(p)))/dt &
- * soilbiogeochem_state_inst%froot_prof_patch(p,j)
-
- c14_cnveg_carbonflux_inst%dwt_frootc_to_litr_lig_c_col(c,j) = &
- c14_cnveg_carbonflux_inst%dwt_frootc_to_litr_lig_c_col(c,j) + &
- (dwt_frootc14_to_litter(p)*pftcon%fr_flig(patch%itype(p)))/dt &
- * soilbiogeochem_state_inst%froot_prof_patch(p,j)
+ do i = i_litr_min, i_litr_max
+ c14_cnveg_carbonflux_inst%dwt_frootc_to_litr_c_col(c,j,i) = &
+ c14_cnveg_carbonflux_inst%dwt_frootc_to_litr_c_col(c,j,i) + &
+ (dwt_frootc14_to_litter(p)*pftcon%fr_f(patch%itype(p),i)) / dt &
+ * soilbiogeochem_state_inst%froot_prof_patch(p,j)
+ end do
! livecroot fluxes to cwd
c14_cnveg_carbonflux_inst%dwt_livecrootc_to_cwdc_col(c,j) = &
diff --git a/src/biogeophys/ActiveLayerMod.F90 b/src/biogeophys/ActiveLayerMod.F90
index ca980fe15b..72ce965f5e 100644
--- a/src/biogeophys/ActiveLayerMod.F90
+++ b/src/biogeophys/ActiveLayerMod.F90
@@ -116,10 +116,10 @@ subroutine alt_calc(this, num_soilc, filter_soilc, &
do fc = 1,num_soilc
c = filter_soilc(fc)
g = col%gridcell(c)
- if ( grc%lat(g) > 0. ) then
+ if ( grc%lat(g) > 0._r8 ) then
altmax_lastyear(c) = altmax(c)
altmax_lastyear_indx(c) = altmax_indx(c)
- altmax(c) = 0.
+ altmax(c) = 0._r8
altmax_indx(c) = 0
endif
end do
@@ -128,10 +128,10 @@ subroutine alt_calc(this, num_soilc, filter_soilc, &
do fc = 1,num_soilc
c = filter_soilc(fc)
g = col%gridcell(c)
- if ( grc%lat(g) <= 0. ) then
+ if ( grc%lat(g) <= 0._r8 ) then
altmax_lastyear(c) = altmax(c)
altmax_lastyear_indx(c) = altmax_indx(c)
- altmax(c) = 0.
+ altmax(c) = 0._r8
altmax_indx(c) = 0
endif
end do
diff --git a/src/biogeophys/BalanceCheckMod.F90 b/src/biogeophys/BalanceCheckMod.F90
index 7df5b10327..8c6378d731 100644
--- a/src/biogeophys/BalanceCheckMod.F90
+++ b/src/biogeophys/BalanceCheckMod.F90
@@ -604,8 +604,8 @@ subroutine BalanceCheck( bounds, &
l = col%landunit(c)
if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall) then
- forc_rain_col(c) = 0.
- forc_snow_col(c) = 0.
+ forc_rain_col(c) = 0._r8
+ forc_snow_col(c) = 0._r8
else
forc_rain_col(c) = forc_rain(c)
forc_snow_col(c) = forc_snow(c)
diff --git a/src/biogeophys/BandDiagonalMod.F90 b/src/biogeophys/BandDiagonalMod.F90
index 7cd9cf204f..13529a21ef 100644
--- a/src/biogeophys/BandDiagonalMod.F90
+++ b/src/biogeophys/BandDiagonalMod.F90
@@ -176,7 +176,7 @@ subroutine BandDiagonal(bounds, lbj, ubj, jtop, jbot, numf, filter, nband, b, r,
n=jbot(ci)-jtop(ci)+1
allocate(ab(m,n))
- ab=0.0
+ ab=0.0_r8
ab(kl+ku-1,3:n)=b(ci,1,jtop(ci):jbot(ci)-2) ! 2nd superdiagonal
ab(kl+ku+0,2:n)=b(ci,2,jtop(ci):jbot(ci)-1) ! 1st superdiagonal
diff --git a/src/biogeophys/CanopyFluxesMod.F90 b/src/biogeophys/CanopyFluxesMod.F90
index f18bde2e0e..34d05f84a9 100644
--- a/src/biogeophys/CanopyFluxesMod.F90
+++ b/src/biogeophys/CanopyFluxesMod.F90
@@ -712,7 +712,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
! leaf and stem surface area
sa_leaf(p) = elai(p)
! double in spirit of full surface area for sensible heat
- sa_leaf(p) = 2.*sa_leaf(p)
+ sa_leaf(p) = 2._r8*sa_leaf(p)
! Surface area for stem
sa_stem(p) = nstem(patch%itype(p))*(htop(p)*shr_const_pi*dbh(p))
@@ -725,8 +725,8 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
! (set surface area for stem, and fraction absorbed by stem to zero)
if(.not.(is_tree(patch%itype(p)) .or. is_shrub(patch%itype(p))) &
.or. dbh(p) < min_stem_diameter) then
- frac_rad_abs_by_stem(p) = 0.0
- sa_stem(p) = 0.0
+ frac_rad_abs_by_stem(p) = 0.0_r8
+ sa_stem(p) = 0.0_r8
endif
! if using Satellite Phenology mode, calculate leaf and stem biomass
@@ -734,12 +734,12 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
! 2gbiomass/gC * (1/SLA) * 1e-3 = kg dry mass/m2(leaf)
leaf_biomass(p) = (1.e-3_r8*c_to_b/slatop(patch%itype(p))) &
* max(0.01_r8, 0.5_r8*sa_leaf(p)) &
- / (1.-fbw(patch%itype(p)))
+ / (1._r8-fbw(patch%itype(p)))
! cross-sectional area of stems
- carea_stem = shr_const_pi * (dbh(p)*0.5)**2
+ carea_stem = shr_const_pi * (dbh(p)*0.5_r8)**2
stem_biomass(p) = carea_stem * htop(p) * k_cyl_vol &
* nstem(patch%itype(p)) * wood_density(patch%itype(p)) &
- /(1.-fbw(patch%itype(p)))
+ /(1._r8-fbw(patch%itype(p)))
endif
! internal longwave fluxes between leaf and stem
@@ -752,10 +752,10 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
! lma_dry has units of kg dry mass/m2 here
! (Appendix B of Bonan et al., GMD, 2018)
- cp_leaf(p) = leaf_biomass(p) * (c_dry_biomass*(1.-fbw(patch%itype(p))) + (fbw(patch%itype(p)))*c_water)
+ cp_leaf(p) = leaf_biomass(p) * (c_dry_biomass*(1._r8-fbw(patch%itype(p))) + (fbw(patch%itype(p)))*c_water)
! cp-stem will have units J/k/ground_area
- cp_stem(p) = stem_biomass(p) * (c_dry_biomass*(1.-fbw(patch%itype(p))) + (fbw(patch%itype(p)))*c_water)
+ cp_stem(p) = stem_biomass(p) * (c_dry_biomass*(1._r8-fbw(patch%itype(p))) + (fbw(patch%itype(p)))*c_water)
! adjust for departure from cylindrical stem model
cp_stem(p) = k_cyl_vol * cp_stem(p)
@@ -1395,7 +1395,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
dt_stem(p) = (frac_rad_abs_by_stem(p)*(sabv(p) + air(p) + bir(p)*ts_ini(p)**4 &
+ cir(p)*lw_grnd) - eflx_sh_stem(p) &
+ lw_leaf(p)- lw_stem(p))/(cp_stem(p)/dtime &
- - frac_rad_abs_by_stem(p)*bir(p)*4.*ts_ini(p)**3)
+ - frac_rad_abs_by_stem(p)*bir(p)*4._r8*ts_ini(p)**3)
else
dt_stem(p) = 0._r8
endif
diff --git a/src/biogeophys/LakeFluxesMod.F90 b/src/biogeophys/LakeFluxesMod.F90
index 212d0ca7d1..4528d9dfb2 100644
--- a/src/biogeophys/LakeFluxesMod.F90
+++ b/src/biogeophys/LakeFluxesMod.F90
@@ -182,8 +182,8 @@ subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep,
real(r8) :: kva0temp ! (K) temperature for kva0; will be set below
real(r8), parameter :: kva0pres = 1.013e5_r8 ! (Pa) pressure for kva0
real(r8) :: kva ! kinematic viscosity of air at ground temperature and forcing pressure
- real(r8), parameter :: prn = 0.713 ! Prandtl # for air at neutral stability
- real(r8), parameter :: sch = 0.66 ! Schmidt # for water in air at neutral stability
+ real(r8), parameter :: prn = 0.713_r8 ! Prandtl # for air at neutral stability
+ real(r8), parameter :: sch = 0.66_r8 ! Schmidt # for water in air at neutral stability
!-----------------------------------------------------------------------
diff --git a/src/biogeophys/LunaMod.F90 b/src/biogeophys/LunaMod.F90
index bd4fdfb4b0..604b2b5709 100644
--- a/src/biogeophys/LunaMod.F90
+++ b/src/biogeophys/LunaMod.F90
@@ -360,11 +360,11 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, &
!Implemented the nitrogen allocation model
if(tlai(p) > 0.0_r8 .and. lnc(p) > 0._r8)then
RadTop = par240d_z(p,1)/rabsorb
- PARTop = RadTop*4.6 !conversion from w/m2 to umol/m2/s. PAR is still in umol photons, not electrons. Also the par240d_z is only for radiation at visible range. Hence 4.6 not 2.3 multiplier.
+ PARTop = RadTop*4.6_r8 !conversion from w/m2 to umol/m2/s. PAR is still in umol photons, not electrons. Also the par240d_z is only for radiation at visible range. Hence 4.6 not 2.3 multiplier.
!-------------------------------------------------------------
!the nitrogen allocation model, may need to be feed from the parameter file in CLM
if (nint(c3psn(ft)) == 1)then
- if(gpp_day(p)>0.0 )then !only optimize if there is growth and it is C3 plants
+ if(gpp_day(p)>0.0_r8 )then !only optimize if there is growth and it is C3 plants
!-------------------------------------------------------------
do z = 1, nrad(p)
if(tlai_z(p,z)>0.0_r8)then
@@ -434,7 +434,7 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, &
PNlc_z(p, z)= PNlcopt
- if(enzs_z(p,z)<1.0) then
+ if(enzs_z(p,z)<1.0_r8) then
enzs_z(p,z) = enzs_z(p,z)* (1.0_r8 + max_daily_pchg)
endif
!nitrogen allocastion model-end
@@ -581,7 +581,7 @@ subroutine Acc240_Climate_LUNA(bounds, fn, filterp, oair, cair, &
if(t_veg_day(p).ne.spval) then !check whether it is the first day
!---------------------------------------------------------
!calculate the 10 day running mean radiations
- if(ndaysteps(p)>0.0) then
+ if(ndaysteps(p)>0.0_r8) then
par24d_z_i=par24d_z(p,:)/(dtime * ndaysteps(p))
else
par24d_z_i = 0._r8
@@ -595,7 +595,7 @@ subroutine Acc240_Climate_LUNA(bounds, fn, filterp, oair, cair, &
endif
!-------------------------------------------------------
!calculate the 10 day running mean daytime temperature
- if(ndaysteps(p)>0.0)then
+ if(ndaysteps(p)>0.0_r8)then
t_veg_dayi = t_veg_day(p) / ndaysteps(p)
else
t_veg_dayi = t_veg_night(p) / nnightsteps(p)
@@ -898,7 +898,7 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR
Nresp = PNrespold * FNCa !proportion of respirational nitrogen in functional nitrogen
Ncb = PNcbold * FNCa !proportion of carboxylation nitrogen in functional nitrogen
if (Nlc > FNCa * 0.5_r8) Nlc = 0.5_r8 * FNCa
- chg_per_step = 0.02* FNCa
+ chg_per_step = 0.02_r8* FNCa
PNlc = PNlcold
PNlcoldi = PNlcold - 0.001_r8
PARi10c = max(PARLowLim, PARi10)
diff --git a/src/biogeophys/PhotosynthesisMod.F90 b/src/biogeophys/PhotosynthesisMod.F90
index ae82794545..18aabe59b1 100644
--- a/src/biogeophys/PhotosynthesisMod.F90
+++ b/src/biogeophys/PhotosynthesisMod.F90
@@ -2851,7 +2851,7 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, &
r_soil = sqrt(1./(rpi*root_length_density))
! length scale approach
- soil_conductance = min(hksat(c,j),hk_l(c,j))/(1.e3*r_soil)
+ soil_conductance = min(hksat(c,j),hk_l(c,j))/(1.e3_r8*r_soil)
! use vegetation plc function to adjust root conductance
fs(j)= plc(smp(c,j),p,c,root,veg)
@@ -2873,7 +2873,7 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, &
if(rai(j)*rootfr(p,j) > 0._r8 .and. j > 1) then
k_soil_root(p,j) = 1._r8/rs_resis
else
- k_soil_root(p,j) = 0.
+ k_soil_root(p,j) = 0._r8
endif
end do
@@ -4163,8 +4163,8 @@ subroutine ci_func_PHS(x,cisun, cisha, fvalsun, fvalsha, p, iv, c, bsun, bsha, b
bquad = -(2.0 * (medlynintercept(patch%itype(p))*1.e-06_r8 + term) + (medlynslope(patch%itype(p)) * term)**2 / &
(gb_mol*1.e-06_r8 * rh_can))
cquad = medlynintercept(patch%itype(p))*medlynintercept(patch%itype(p))*1.e-12_r8 + &
- (2.0*medlynintercept(patch%itype(p))*1.e-06_r8 + term * &
- (1.0 - medlynslope(patch%itype(p))* medlynslope(patch%itype(p)) / rh_can)) * term
+ (2.0_r8*medlynintercept(patch%itype(p))*1.e-06_r8 + term * &
+ (1.0_r8 - medlynslope(patch%itype(p))* medlynslope(patch%itype(p)) / rh_can)) * term
call quadratic (aquad, bquad, cquad, r1, r2)
gs_mol_sun = max(r1,r2) * 1.e06_r8
@@ -4278,7 +4278,7 @@ subroutine calcstress(p,c,x,bsun,bsha,gb_mol,gs_mol_sun,gs_mol_sha,qsatl,qaf, &
logical :: flag ! signal that matrix was not invertible
logical :: night ! signal to store vegwp within this routine, b/c it is night-time and full suite won't be called
integer, parameter :: itmax=50 ! exit newton's method if iters>itmax
- real(r8), parameter :: tolf=1.e-6,toldx=1.e-9 !tolerances for a satisfactory solution
+ real(r8), parameter :: tolf=1.e-6_r8,toldx=1.e-9_r8 !tolerances for a satisfactory solution
logical :: havegs ! signals direction of calculation gs->qflx or qflx->gs
real(r8) :: soilflux ! total soil column transpiration [mm/s]
real(r8), parameter :: tol_lai=.001_r8 ! minimum lai where transpiration is calc'd
diff --git a/src/biogeophys/RootBiophysMod.F90 b/src/biogeophys/RootBiophysMod.F90
index 6e94ddef4d..c6130c306b 100644
--- a/src/biogeophys/RootBiophysMod.F90
+++ b/src/biogeophys/RootBiophysMod.F90
@@ -269,7 +269,7 @@ function jackson1996_rootfr(bounds, ubj, varindx, water_carbon) result(rootfr)
beta ** (col%zi(c,lev)*m_to_cm) )
end do
else
- rootfr(p,:) = 0.
+ rootfr(p,:) = 0._r8
endif
enddo
diff --git a/src/biogeophys/SnowHydrologyMod.F90 b/src/biogeophys/SnowHydrologyMod.F90
index 7127c899a8..6e5c39f8a6 100644
--- a/src/biogeophys/SnowHydrologyMod.F90
+++ b/src/biogeophys/SnowHydrologyMod.F90
@@ -3279,7 +3279,7 @@ subroutine BulkFlux_SnowCappingFluxes(bounds, num_snowc, filter_snowc, &
! Always keep at least this fraction of the bottom snow layer when doing snow capping
! This needs to be slightly greater than 0 to avoid roundoff problems
- real(r8), parameter :: min_snow_to_keep = 1.e-9 ! fraction of bottom snow layer to keep with capping
+ real(r8), parameter :: min_snow_to_keep = 1.e-9_r8 ! fraction of bottom snow layer to keep with capping
character(len=*), parameter :: subname = 'BulkFlux_SnowCappingFluxes'
!-----------------------------------------------------------------------
diff --git a/src/biogeophys/SnowSnicarMod.F90 b/src/biogeophys/SnowSnicarMod.F90
index 1f8e928474..196d239460 100644
--- a/src/biogeophys/SnowSnicarMod.F90
+++ b/src/biogeophys/SnowSnicarMod.F90
@@ -680,31 +680,31 @@ subroutine SNICAR_RT (flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, &
! Eddington
if (APRX_TYP==1) then
do i=snl_top,snl_btm,1
- gamma1(i) = (7-(omega_star(i)*(4+(3*g_star(i)))))/4
- gamma2(i) = -(1-(omega_star(i)*(4-(3*g_star(i)))))/4
- gamma3(i) = (2-(3*g_star(i)*mu_not))/4
- gamma4(i) = 1-gamma3(i)
- mu_one = 0.5
+ gamma1(i) = (7._r8-(omega_star(i)*(4._r8+(3._r8*g_star(i)))))/4._r8
+ gamma2(i) = -(1._r8-(omega_star(i)*(4._r8-(3._r8*g_star(i)))))/4._r8
+ gamma3(i) = (2._r8-(3._r8*g_star(i)*mu_not))/4._r8
+ gamma4(i) = 1._r8-gamma3(i)
+ mu_one = 0.5_r8
enddo
! Quadrature
elseif (APRX_TYP==2) then
do i=snl_top,snl_btm,1
- gamma1(i) = (3**0.5)*(2-(omega_star(i)*(1+g_star(i))))/2
- gamma2(i) = omega_star(i)*(3**0.5)*(1-g_star(i))/2
- gamma3(i) = (1-((3**0.5)*g_star(i)*mu_not))/2
- gamma4(i) = 1-gamma3(i)
- mu_one = 1/(3**0.5)
+ gamma1(i) = (3._r8**0.5)*(2._r8-(omega_star(i)*(1._r8+g_star(i))))/2._r8
+ gamma2(i) = omega_star(i)*(3._r8**0.5)*(1._r8-g_star(i))/2._r8
+ gamma3(i) = (1._r8-((3._r8**0.5)*g_star(i)*mu_not))/2._r8
+ gamma4(i) = 1._r8-gamma3(i)
+ mu_one = 1._r8/(3._r8**0.5_r8)
enddo
! Hemispheric Mean
elseif (APRX_TYP==3) then
do i=snl_top,snl_btm,1
- gamma1(i) = 2 - (omega_star(i)*(1+g_star(i)))
+ gamma1(i) = 2._r8 - (omega_star(i)*(1._r8+g_star(i)))
gamma2(i) = omega_star(i)*(1-g_star(i))
- gamma3(i) = (1-((3**0.5)*g_star(i)*mu_not))/2
- gamma4(i) = 1-gamma3(i)
- mu_one = 0.5
+ gamma3(i) = (1._r8-((3._r8**0.5_r8)*g_star(i)*mu_not))/2._r8
+ gamma4(i) = 1._r8-gamma3(i)
+ mu_one = 0.5_r8
enddo
endif
@@ -755,7 +755,7 @@ subroutine SNICAR_RT (flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, &
!Boundary values for i=1 and i=2*snl_lcl, specifics for i=odd and i=even
if (i==(2*snl_lcl+1)) then
- A(i) = 0
+ A(i) = 0._r8
B(i) = e1(snl_top)
D(i) = -e2(snl_top)
E(i) = flx_slri_lcl(bnd_idx)-C_mns_top(snl_top)
@@ -763,7 +763,7 @@ subroutine SNICAR_RT (flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, &
elseif(i==0) then
A(i) = e1(snl_btm)-(albsfc_lcl(bnd_idx)*e3(snl_btm))
B(i) = e2(snl_btm)-(albsfc_lcl(bnd_idx)*e4(snl_btm))
- D(i) = 0
+ D(i) = 0._r8
E(i) = F_direct_btm-C_pls_btm(snl_btm)+(albsfc_lcl(bnd_idx)*C_mns_btm(snl_btm))
elseif(mod(i,2)==-1) then ! If odd and i>=3 (n=1 for i=3)
@@ -828,7 +828,7 @@ subroutine SNICAR_RT (flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, &
! ERROR check: negative absorption
- if (flx_abs_lcl(i,bnd_idx) < -0.00001) then
+ if (flx_abs_lcl(i,bnd_idx) < -0.00001_r8) then
trip = 1
endif
enddo
diff --git a/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 b/src/biogeophys/SoilHydrologyInitTimeConstMod.F90
index 61b692ae37..384c843760 100644
--- a/src/biogeophys/SoilHydrologyInitTimeConstMod.F90
+++ b/src/biogeophys/SoilHydrologyInitTimeConstMod.F90
@@ -159,7 +159,7 @@ subroutine SoilHydrologyInitTimeConst(bounds, soilhydrology_inst, soilstate_inst
if ( lev <= nlevsoi )then
claycol(c,lev) = soilstate_inst%cellclay_col(c,lev)
sandcol(c,lev) = soilstate_inst%cellsand_col(c,lev)
- om_fraccol(c,lev) = soilstate_inst%cellorg_col(c,lev) / organic_max
+ om_fraccol(c,lev) = min(soilstate_inst%cellorg_col(c,lev) / organic_max, 1._r8)
else
claycol(c,lev) = soilstate_inst%cellclay_col(c,nlevsoi)
sandcol(c,lev) = soilstate_inst%cellsand_col(c,nlevsoi)
@@ -190,14 +190,14 @@ subroutine SoilHydrologyInitTimeConst(bounds, soilhydrology_inst, soilstate_inst
soilhydrology_inst%h2osfc_thresh_col(c) = 0._r8
if (micro_sigma(c) > 1.e-6_r8 .and. (soilhydrology_inst%h2osfcflag /= 0)) then
- d = 0.0
+ d = 0.0_r8
do p = 1,4
- fd = 0.5*(1.0_r8+shr_spfn_erf(d/(micro_sigma(c)*sqrt(2.0)))) - pc
- dfdd = exp(-d**2/(2.0*micro_sigma(c)**2))/(micro_sigma(c)*sqrt(2.0*shr_const_pi))
+ fd = 0.5_r8*(1.0_r8+shr_spfn_erf(d/(micro_sigma(c)*sqrt(2.0_r8)))) - pc
+ dfdd = exp(-d**2/(2.0_r8*micro_sigma(c)**2))/(micro_sigma(c)*sqrt(2.0_r8*shr_const_pi))
d = d - fd/dfdd
enddo
- soilhydrology_inst%h2osfc_thresh_col(c) = 0.5*d*(1.0_r8+shr_spfn_erf(d/(micro_sigma(c)*sqrt(2.0)))) + &
- micro_sigma(c)/sqrt(2.0*shr_const_pi)*exp(-d**2/(2.0*micro_sigma(c)**2))
+ soilhydrology_inst%h2osfc_thresh_col(c) = 0.5_r8*d*(1.0_r8+shr_spfn_erf(d/(micro_sigma(c)*sqrt(2.0_r8)))) + &
+ micro_sigma(c)/sqrt(2.0_r8*shr_const_pi)*exp(-d**2/(2.0_r8*micro_sigma(c)**2))
soilhydrology_inst%h2osfc_thresh_col(c) = 1.e3_r8 * soilhydrology_inst%h2osfc_thresh_col(c) !convert to mm from meters
else
soilhydrology_inst%h2osfc_thresh_col(c) = 0._r8
@@ -298,7 +298,7 @@ subroutine initSoilParVIC(c, claycol, sandcol, om_fraccol, soilhydrology_inst)
!calculate other parameters based on teh percentages
soilhydrology_inst%porosity_col(c, i) = 0.489_r8 - 0.00126_r8*sandvic(i)
soilhydrology_inst%expt_col(c, i) = 3._r8+ 2._r8*(2.91_r8 + 0.159_r8*clayvic(i))
- xksat = 0.0070556 *( 10.**(-0.884+0.0153*sandvic(i)) )
+ xksat = 0.0070556_r8 *( 10.**(-0.884_r8+0.0153_r8*sandvic(i)) )
!consider organic matter, M.Huang
soilhydrology_inst%expt_col(c, i) = &
diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90
index ad2da3852f..8bacda1c99 100644
--- a/src/biogeophys/SoilStateInitTimeConstMod.F90
+++ b/src/biogeophys/SoilStateInitTimeConstMod.F90
@@ -430,20 +430,20 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)
if (lev .eq. 1) then
clay = clay3d(g,1)
sand = sand3d(g,1)
- om_frac = organic3d(g,1)/organic_max
+ om_frac = min(organic3d(g,1)/organic_max, 1._r8)
else if (lev <= nlevsoi) then
found = 0 ! reset value
if (zsoi(lev) <= zisoifl(1)) then
! Search above the dataset's range of zisoifl depths
clay = clay3d(g,1)
sand = sand3d(g,1)
- om_frac = organic3d(g,1)/organic_max
+ om_frac = min(organic3d(g,1)/organic_max, 1._r8)
found = 1
else if (zsoi(lev) > zisoifl(nlevsoifl)) then
! Search below the dataset's range of zisoifl depths
clay = clay3d(g,nlevsoifl)
sand = sand3d(g,nlevsoifl)
- om_frac = organic3d(g,nlevsoifl)/organic_max
+ om_frac = min(organic3d(g,nlevsoifl)/organic_max, 1._r8)
found = 1
else
! For remaining model soil levels, search within dataset's
@@ -453,7 +453,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)
if (zsoi(lev) > zisoifl(j) .AND. zsoi(lev) <= zisoifl(j+1)) then
clay = clay3d(g,j+1)
sand = sand3d(g,j+1)
- om_frac = organic3d(g,j+1)/organic_max
+ om_frac = min(organic3d(g,j+1)/organic_max, 1._r8)
found = 1
endif
if (found == 1) exit ! no need to stay in the loop
@@ -503,8 +503,9 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)
om_hksat = max(0.28_r8 - 0.2799_r8*(zsoi(lev)/zsapric), xksat)
soilstate_inst%bd_col(c,lev) = (1._r8 - soilstate_inst%watsat_col(c,lev))*params_inst%pd
- soilstate_inst%watsat_col(c,lev) = params_inst%watsat_adjustfactor * ( (1._r8 - om_frac) * &
- soilstate_inst%watsat_col(c,lev) + om_watsat*om_frac )
+ ! do not allow watsat_sf to push watsat above 0.93
+ soilstate_inst%watsat_col(c,lev) = min(params_inst%watsat_adjustfactor * ( (1._r8 - om_frac) * &
+ soilstate_inst%watsat_col(c,lev) + om_watsat*om_frac ), 0.93_r8)
tkm = (1._r8-om_frac) * (params_inst%tkd_sand*sand+params_inst%tkd_clay*clay)/ &
(sand+clay)+params_inst%tkm_om*om_frac ! W/(m K)
soilstate_inst%bsw_col(c,lev) = params_inst%bsw_adjustfactor * ( (1._r8-om_frac) * &
@@ -586,9 +587,9 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)
clay = soilstate_inst%cellclay_col(c,lev)
sand = soilstate_inst%cellsand_col(c,lev)
if ( organic_frac_squared )then
- om_frac = (soilstate_inst%cellorg_col(c,lev)/organic_max)**2._r8
+ om_frac = min( (soilstate_inst%cellorg_col(c,lev)/organic_max)**2._r8, 1._r8)
else
- om_frac = soilstate_inst%cellorg_col(c,lev)/organic_max
+ om_frac = min(soilstate_inst%cellorg_col(c,lev)/organic_max, 1._r8)
end if
else
clay = soilstate_inst%cellclay_col(c,nlevsoi)
@@ -604,8 +605,9 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)
bd = (1._r8-soilstate_inst%watsat_col(c,lev))*params_inst%pd
- soilstate_inst%watsat_col(c,lev) = params_inst%watsat_adjustfactor * ( (1._r8 - om_frac) * &
- soilstate_inst%watsat_col(c,lev) + om_watsat_lake * om_frac )
+ ! do not allow watsat_sf to push watsat above 0.93
+ soilstate_inst%watsat_col(c,lev) = min(params_inst%watsat_adjustfactor * ( (1._r8 - om_frac) * &
+ soilstate_inst%watsat_col(c,lev) + om_watsat_lake * om_frac), 0.93_r8)
tkm = (1._r8-om_frac)*(params_inst%tkd_sand*sand+params_inst%tkd_clay*clay)/(sand+clay) + &
params_inst%tkm_om * om_frac ! W/(m K)
@@ -616,7 +618,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)
soilstate_inst%sucsat_col(c,lev) = params_inst%sucsat_adjustfactor * ( (1._r8-om_frac) * &
soilstate_inst%sucsat_col(c,lev) + om_sucsat_lake * om_frac )
- xksat = 0.0070556 *( 10.**(-0.884+0.0153*sand) ) ! mm/s
+ xksat = 0.0070556_r8 *( 10._r8**(-0.884_r8+0.0153_r8*sand) ) ! mm/s
! perc_frac is zero unless perf_frac greater than percolation threshold
if (om_frac > pc_lake) then
@@ -631,7 +633,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename)
! uncon_hksat is series addition of mineral/organic conductivites
if (om_frac < 1._r8) then
- xksat = 0.0070556 *( 10.**(-0.884+0.0153*sand) ) ! mm/s
+ xksat = 0.0070556_r8 *( 10._r8**(-0.884_r8+0.0153_r8*sand) ) ! mm/s
uncon_hksat = uncon_frac/((1._r8-om_frac)/xksat + ((1._r8-perc_frac)*om_frac)/om_hksat_lake)
else
uncon_hksat = 0._r8
diff --git a/src/biogeophys/SurfaceWaterMod.F90 b/src/biogeophys/SurfaceWaterMod.F90
index 768e9a8445..031313e9e5 100644
--- a/src/biogeophys/SurfaceWaterMod.F90
+++ b/src/biogeophys/SurfaceWaterMod.F90
@@ -211,19 +211,19 @@ subroutine BulkDiag_FracH2oSfc(bounds, num_soilc, filter_soilc, &
if (h2osfc(c) > min_h2osfc) then
! a cutoff is needed for numerical reasons...(nonconvergence after 5 iterations)
- d=0.0
+ d=0.0_r8
sigma=1.0e3 * micro_sigma(c) ! convert to mm
do l=1,10
- fd = 0.5*d*(1.0_r8+erf(d/(sigma*sqrt(2.0)))) &
- +sigma/sqrt(2.0*shr_const_pi)*exp(-d**2/(2.0*sigma**2)) &
+ fd = 0.5_r8*d*(1.0_r8+erf(d/(sigma*sqrt(2.0_r8)))) &
+ +sigma/sqrt(2.0_r8*shr_const_pi)*exp(-d**2/(2.0_r8*sigma**2)) &
-h2osfc(c)
- dfdd = 0.5*(1.0_r8+erf(d/(sigma*sqrt(2.0))))
+ dfdd = 0.5_r8*(1.0_r8+erf(d/(sigma*sqrt(2.0_r8))))
d = d - fd/dfdd
enddo
!-- update the submerged areal fraction using the new d value
- frac_h2osfc(c) = 0.5*(1.0_r8+erf(d/(sigma*sqrt(2.0))))
+ frac_h2osfc(c) = 0.5_r8*(1.0_r8+erf(d/(sigma*sqrt(2.0_r8))))
qflx_too_small_h2osfc_to_soil(c) = 0._r8
@@ -453,7 +453,7 @@ subroutine QflxH2osfcSurf(bounds, num_hydrologyc, filter_hydrologyc, &
! limit runoff to value of storage above S(pc)
if(h2osfc(c) > h2osfc_thresh(c) .and. h2osfcflag/=0) then
! spatially variable k_wet
- k_wet=1.0e-4_r8 * sin((rpi/180.) * topo_slope(c))
+ k_wet=1.0e-4_r8 * sin((rpi/180._r8) * topo_slope(c))
qflx_h2osfc_surf(c) = k_wet * frac_infclust * (h2osfc(c) - h2osfc_thresh(c))
qflx_h2osfc_surf(c)=min(qflx_h2osfc_surf(c),(h2osfc(c) - h2osfc_thresh(c))/dtime)
diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90
index 56a16f1c44..f32ec83ac6 100644
--- a/src/biogeophys/TemperatureType.F90
+++ b/src/biogeophys/TemperatureType.F90
@@ -709,11 +709,11 @@ subroutine InitCold(this, bounds, &
! Set road top layer to initial air temperature and interpolate other
! layers down to 20C in bottom layer
do j = 1, nlevgrnd
- this%t_soisno_col(c,j) = 297.56 - (j-1) * ((297.56-293.16)/(nlevgrnd-1))
+ this%t_soisno_col(c,j) = 297.56_r8 - (j-1) * ((297.56_r8-293.16_r8)/(nlevgrnd-1))
end do
! Set wall and roof layers to initial air temperature
else if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall .or. col%itype(c) == icol_roof) then
- this%t_soisno_col(c,1:nlevurb) = 297.56
+ this%t_soisno_col(c,1:nlevurb) = 297.56_r8
else
this%t_soisno_col(c,1:nlevgrnd) = 283._r8
end if
@@ -722,11 +722,11 @@ subroutine InitCold(this, bounds, &
! Set road top layer to initial air temperature and interpolate other
! layers down to 22C in bottom layer
do j = 1, nlevgrnd
- this%t_soisno_col(c,j) = 289.46 - (j-1) * ((289.46-295.16)/(nlevgrnd-1))
+ this%t_soisno_col(c,j) = 289.46_r8 - (j-1) * ((289.46_r8-295.16_r8)/(nlevgrnd-1))
end do
else if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall .or. col%itype(c) == icol_roof) then
! Set wall and roof layers to initial air temperature
- this%t_soisno_col(c,1:nlevurb) = 289.46
+ this%t_soisno_col(c,1:nlevurb) = 289.46_r8
else
this%t_soisno_col(c,1:nlevgrnd) = 283._r8
end if
@@ -807,27 +807,27 @@ subroutine InitCold(this, bounds, &
this%t_stem_patch(p) = this%t_veg_patch(p)
if (use_vancouver) then
- this%t_ref2m_patch(p) = 297.56
+ this%t_ref2m_patch(p) = 297.56_r8
else if (use_mexicocity) then
- this%t_ref2m_patch(p) = 289.46
+ this%t_ref2m_patch(p) = 289.46_r8
else
this%t_ref2m_patch(p) = 283._r8
end if
if (lun%urbpoi(l)) then
if (use_vancouver) then
- this%t_ref2m_u_patch(p) = 297.56
+ this%t_ref2m_u_patch(p) = 297.56_r8
else if (use_mexicocity) then
- this%t_ref2m_u_patch(p) = 289.46
+ this%t_ref2m_u_patch(p) = 289.46_r8
else
this%t_ref2m_u_patch(p) = 283._r8
end if
else
if (.not. lun%ifspecial(l)) then
if (use_vancouver) then
- this%t_ref2m_r_patch(p) = 297.56
+ this%t_ref2m_r_patch(p) = 297.56_r8
else if (use_mexicocity) then
- this%t_ref2m_r_patch(p) = 289.46
+ this%t_ref2m_r_patch(p) = 289.46_r8
else
this%t_ref2m_r_patch(p) = 283._r8
end if
diff --git a/src/cpl/lilac/lnd_comp_esmf.F90 b/src/cpl/lilac/lnd_comp_esmf.F90
index 7d227a4134..e9b9e7f407 100644
--- a/src/cpl/lilac/lnd_comp_esmf.F90
+++ b/src/cpl/lilac/lnd_comp_esmf.F90
@@ -24,7 +24,7 @@ module lnd_comp_esmf
! ctsm code
use spmdMod , only : masterproc, spmd_init, mpicom
- use decompMod , only : bounds_type, ldecomp, get_proc_bounds
+ use decompMod , only : bounds_type, get_proc_bounds
use domainMod , only : ldomain
use controlMod , only : control_setNL
use clm_varorb , only : eccen, obliqr, lambm0, mvelpp
@@ -39,6 +39,7 @@ module lnd_comp_esmf
use clm_driver , only : clm_drv
use lnd_import_export , only : import_fields, export_fields
use lnd_shr_methods , only : chkerr, state_diagnose
+ use lnd_comp_shr , only : mesh, model_meshfile, model_clock
use lnd_set_decomp_and_domain, only :lnd_set_decomp_and_domain_from_readmesh
implicit none
@@ -127,7 +128,6 @@ subroutine lnd_init(comp, import_state, export_state, clock, rc)
type(ESMF_Field) :: lfield
! mesh generation
- type(ESMF_Mesh) :: lnd_mesh
character(ESMF_MAXSTR) :: lnd_mesh_filename ! full filepath of land mesh file
integer, pointer :: gindex(:) ! global index space for land and ocean points
type(ESMF_DistGrid) :: distgrid
@@ -251,6 +251,9 @@ subroutine lnd_init(comp, import_state, export_state, clock, rc)
end if
call shr_mpi_bcast(lnd_mesh_filename, mpicom)
+ ! Fill in the value for model_meshfile in lnd_comp_shr used by the stream routines in share_esmf/
+ model_meshfile = trim(lnd_mesh_filename)
+
!----------------------
! Obtain caseid and start type from attributes in import state
!----------------------
@@ -320,6 +323,9 @@ subroutine lnd_init(comp, import_state, export_state, clock, rc)
ref_ymd_in=ref_ymd, ref_tod_in=ref_tod, dtime_in=dtime_lilac)
call ESMF_LogWrite(subname//"ctsm time manager initialized....", ESMF_LOGMSG_INFO)
+ ! Set model clock in lnd_comp_shr
+ model_clock = clock
+
!----------------------
! Read namelist, grid and surface data
!----------------------
@@ -336,13 +342,13 @@ subroutine lnd_init(comp, import_state, export_state, clock, rc)
call ESMF_LogWrite(subname//"ctsm initialize1 done...", ESMF_LOGMSG_INFO)
!----------------------
- ! Initialize decomposition (ldecomp) and domain (ldomain) types and generate land mesh
+ ! Initialize decomposition and domain (ldomain) types and generate land mesh
!----------------------
! TODO: generalize this so that a mask mesh is read in like for nuopc/cmeps
! For now set the meshfile_mask equal to the model_meshfile
call lnd_set_decomp_and_domain_from_readmesh(driver='lilac', vm=vm, &
meshfile_lnd=lnd_mesh_filename, meshfile_mask=lnd_mesh_filename, &
- mesh_ctsm=lnd_mesh, ni=ni, nj=nj, rc=rc)
+ mesh_ctsm=mesh, ni=ni, nj=nj, rc=rc)
!--------------------------------
! Finish initializing ctsm
@@ -357,9 +363,9 @@ subroutine lnd_init(comp, import_state, export_state, clock, rc)
c2l_fb_atm = ESMF_FieldBundleCreate (name='c2l_fb_atm', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- ! now add atm import fields on lnd_mesh to this field bundle
+ ! now add atm import fields on mesh to this field bundle
do n = 1, a2l_fields%num_fields()
- lfield = ESMF_FieldCreate(lnd_mesh, ESMF_TYPEKIND_R8 , meshloc=ESMF_MESHLOC_ELEMENT, &
+ lfield = ESMF_FieldCreate(mesh, ESMF_TYPEKIND_R8 , meshloc=ESMF_MESHLOC_ELEMENT, &
name=a2l_fields%get_fieldname(n), rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call ESMF_FieldBundleAdd(c2l_fb_atm, (/lfield/), rc=rc)
@@ -393,9 +399,9 @@ subroutine lnd_init(comp, import_state, export_state, clock, rc)
l2c_fb_atm = ESMF_FieldBundleCreate(name='l2c_fb_atm', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- ! now add atm export fields on lnd_mesh to this field bundle
+ ! now add atm export fields on mesh to this field bundle
do n = 1, l2a_fields%num_fields()
- lfield = ESMF_FieldCreate(lnd_mesh, ESMF_TYPEKIND_R8 , meshloc=ESMF_MESHLOC_ELEMENT, &
+ lfield = ESMF_FieldCreate(mesh, ESMF_TYPEKIND_R8 , meshloc=ESMF_MESHLOC_ELEMENT, &
name=l2a_fields%get_fieldname(n), rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call ESMF_FieldBundleAdd(l2c_fb_atm, (/lfield/), rc=rc)
@@ -410,7 +416,7 @@ subroutine lnd_init(comp, import_state, export_state, clock, rc)
l2c_fb_rof = ESMF_FieldBundleCreate(name='l2c_fb_rof', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- ! now add rof export fields on lnd_mesh to this field bundle
+ ! now add rof export fields on mesh to this field bundle
call fldbundle_add('Flrl_rofsur', l2c_fb_rof, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call fldbundle_add('Flrl_rofgwl', l2c_fb_rof, rc=rc)
@@ -488,7 +494,7 @@ subroutine fldbundle_add(stdname, fieldbundle, rc)
type(ESMF_Field) :: field
!-------------------------------------------------------------------------------
rc = ESMF_SUCCESS
- field = ESMF_FieldCreate(lnd_mesh, ESMF_TYPEKIND_R8 , meshloc=ESMF_MESHLOC_ELEMENT , name=trim(stdname), rc=rc)
+ field = ESMF_FieldCreate(mesh, ESMF_TYPEKIND_R8 , meshloc=ESMF_MESHLOC_ELEMENT , name=trim(stdname), rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call ESMF_FieldBundleAdd(fieldbundle, (/field/), rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
diff --git a/src/cpl/lilac/lnd_comp_shr.F90 b/src/cpl/lilac/lnd_comp_shr.F90
new file mode 100644
index 0000000000..dd619c7648
--- /dev/null
+++ b/src/cpl/lilac/lnd_comp_shr.F90
@@ -0,0 +1,15 @@
+module lnd_comp_shr
+
+ ! Model mesh info is here in order to be leveraged by CDEPS in line calls
+
+ use ESMF
+ use shr_kind_mod, only : r8 => shr_kind_r8, cl=>shr_kind_cl
+
+ implicit none
+ public
+
+ type(ESMF_Clock) :: model_clock ! model clock
+ type(ESMF_Mesh) :: mesh ! model_mesh
+ character(len=cl) :: model_meshfile ! model mesh file
+
+end module lnd_comp_shr
diff --git a/src/main/FireDataBaseType.F90 b/src/cpl/mct/FireDataBaseType.F90
similarity index 80%
rename from src/main/FireDataBaseType.F90
rename to src/cpl/mct/FireDataBaseType.F90
index ac7d28171f..2d95422fd7 100644
--- a/src/main/FireDataBaseType.F90
+++ b/src/cpl/mct/FireDataBaseType.F90
@@ -7,19 +7,19 @@ module FireDataBaseType
! module for handling of fire data
!
! !USES:
- use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL
- use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create, shr_strdata_print
- use shr_strdata_mod , only : shr_strdata_advance
- use shr_log_mod , only : errMsg => shr_log_errMsg
- use clm_varctl , only : iulog, inst_name
- use spmdMod , only : masterproc, mpicom, comp_id
- use fileutils , only : getavu, relavu
- use decompMod , only : gsmap_lnd_gdc2glo
- use domainMod , only : ldomain
- use abortutils , only : endrun
- use decompMod , only : bounds_type
+ use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL
+ use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create, shr_strdata_print
+ use shr_strdata_mod , only : shr_strdata_advance
+ use shr_log_mod , only : errMsg => shr_log_errMsg
+ use clm_varctl , only : iulog, inst_name
+ use spmdMod , only : masterproc, mpicom, comp_id
+ use fileutils , only : getavu, relavu
+ use domainMod , only : ldomain
+ use abortutils , only : endrun
+ use decompMod , only : bounds_type
+ use FireMethodType , only : fire_method_type
+ use lnd_set_decomp_and_domain, only : gsmap_global
use mct_mod
- use FireMethodType , only : fire_method_type
!
implicit none
private
@@ -38,7 +38,6 @@ module FireDataBaseType
type(shr_strdata_type) :: sdat_hdm ! Human population density input data stream
type(shr_strdata_type) :: sdat_lnfm ! Lightning input data stream
-
contains
!
! !PUBLIC MEMBER FUNCTIONS:
@@ -156,7 +155,7 @@ subroutine hdm_init( this, bounds, NLFilename )
!
! !ARGUMENTS:
implicit none
- class(fire_base_type) :: this
+ class(fire_base_type) :: this
type(bounds_type), intent(in) :: bounds
character(len=*), intent(in) :: NLFilename ! Namelist filename
!
@@ -170,6 +169,7 @@ subroutine hdm_init( this, bounds, NLFilename )
character(len=CL) :: stream_fldFileName_popdens ! population density streams filename
character(len=CL) :: popdensmapalgo = 'bilinear' ! mapping alogrithm for population density
character(len=CL) :: popdens_tintalgo = 'nearest'! time interpolation alogrithm for population density
+ character(len=CL) :: stream_meshfile_popdens ! not used
character(*), parameter :: subName = "('hdmdyn_init')"
character(*), parameter :: F00 = "('(hdmdyn_init) ',4a)"
!-----------------------------------------------------------------------
@@ -180,6 +180,7 @@ subroutine hdm_init( this, bounds, NLFilename )
model_year_align_popdens, &
popdensmapalgo, &
stream_fldFileName_popdens, &
+ stream_meshfile_popdens , &
popdens_tintalgo
! Default values for namelist
@@ -222,31 +223,31 @@ subroutine hdm_init( this, bounds, NLFilename )
call clm_domain_mct (bounds, dom_clm)
- call shr_strdata_create(this%sdat_hdm,name="clmhdm", &
- pio_subsystem=pio_subsystem, &
- pio_iotype=shr_pio_getiotype(inst_name), &
- mpicom=mpicom, compid=comp_id, &
- gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, &
- nxg=ldomain%ni, nyg=ldomain%nj, &
- yearFirst=stream_year_first_popdens, &
- yearLast=stream_year_last_popdens, &
- yearAlign=model_year_align_popdens, &
- offset=0, &
- domFilePath='', &
- domFileName=trim(stream_fldFileName_popdens), &
- domTvarName='time', &
- domXvarName='lon' , &
- domYvarName='lat' , &
- domAreaName='area', &
- domMaskName='mask', &
- filePath='', &
+ call shr_strdata_create(this%sdat_hdm,name="clmhdm", &
+ pio_subsystem=pio_subsystem, &
+ pio_iotype=shr_pio_getiotype(inst_name), &
+ mpicom=mpicom, compid=comp_id, &
+ gsmap=gsmap_global, ggrid=dom_clm, &
+ nxg=ldomain%ni, nyg=ldomain%nj, &
+ yearFirst=stream_year_first_popdens, &
+ yearLast=stream_year_last_popdens, &
+ yearAlign=model_year_align_popdens, &
+ offset=0, &
+ domFilePath='', &
+ domFileName=trim(stream_fldFileName_popdens), &
+ domTvarName='time', &
+ domXvarName='lon' , &
+ domYvarName='lat' , &
+ domAreaName='area', &
+ domMaskName='mask', &
+ filePath='', &
filename=(/trim(stream_fldFileName_popdens)/) , &
- fldListFile='hdm', &
- fldListModel='hdm', &
- fillalgo='none', &
- mapalgo=popdensmapalgo, &
- calendar=get_calendar(), &
- tintalgo=popdens_tintalgo, &
+ fldListFile='hdm', &
+ fldListModel='hdm', &
+ fillalgo='none', &
+ mapalgo=popdensmapalgo, &
+ calendar=get_calendar(), &
+ tintalgo=popdens_tintalgo, &
taxmode='extend' )
if (masterproc) then
@@ -378,31 +379,31 @@ subroutine lnfm_init( this, bounds, NLFilename )
call clm_domain_mct (bounds, dom_clm)
- call shr_strdata_create(this%sdat_lnfm,name="clmlnfm", &
- pio_subsystem=pio_subsystem, &
+ call shr_strdata_create(this%sdat_lnfm,name="clmlnfm", &
+ pio_subsystem=pio_subsystem, &
pio_iotype=shr_pio_getiotype(inst_name), &
- mpicom=mpicom, compid=comp_id, &
- gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, &
- nxg=ldomain%ni, nyg=ldomain%nj, &
- yearFirst=stream_year_first_lightng, &
- yearLast=stream_year_last_lightng, &
- yearAlign=model_year_align_lightng, &
- offset=0, &
- domFilePath='', &
- domFileName=trim(stream_fldFileName_lightng), &
- domTvarName='time', &
- domXvarName='lon' , &
- domYvarName='lat' , &
- domAreaName='area', &
- domMaskName='mask', &
- filePath='', &
- filename=(/trim(stream_fldFileName_lightng)/),&
- fldListFile='lnfm', &
- fldListModel='lnfm', &
- fillalgo='none', &
- tintalgo=lightng_tintalgo, &
- mapalgo=lightngmapalgo, &
- calendar=get_calendar(), &
+ mpicom=mpicom, compid=comp_id, &
+ gsmap=gsmap_global, ggrid=dom_clm, &
+ nxg=ldomain%ni, nyg=ldomain%nj, &
+ yearFirst=stream_year_first_lightng, &
+ yearLast=stream_year_last_lightng, &
+ yearAlign=model_year_align_lightng, &
+ offset=0, &
+ domFilePath='', &
+ domFileName=trim(stream_fldFileName_lightng), &
+ domTvarName='time', &
+ domXvarName='lon' , &
+ domYvarName='lat' , &
+ domAreaName='area', &
+ domMaskName='mask', &
+ filePath='', &
+ filename=(/trim(stream_fldFileName_lightng)/), &
+ fldListFile='lnfm', &
+ fldListModel='lnfm', &
+ fillalgo='none', &
+ tintalgo=lightng_tintalgo, &
+ mapalgo=lightngmapalgo, &
+ calendar=get_calendar(), &
taxmode='cycle' )
if (masterproc) then
diff --git a/src/biogeophys/SoilMoistureStreamMod.F90 b/src/cpl/mct/SoilMoistureStreamMod.F90
similarity index 93%
rename from src/biogeophys/SoilMoistureStreamMod.F90
rename to src/cpl/mct/SoilMoistureStreamMod.F90
index eab6d26c02..883daf7f63 100644
--- a/src/biogeophys/SoilMoistureStreamMod.F90
+++ b/src/cpl/mct/SoilMoistureStreamMod.F90
@@ -16,26 +16,24 @@ module SoilMoistureStreamMod
! Read in soil moisture from data stream
!
! !USES:
- use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create
- use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance
- use shr_kind_mod , only : r8 => shr_kind_r8
- use shr_kind_mod , only : CL => shr_kind_CL, CXX => shr_kind_CXX
- use shr_log_mod , only : errMsg => shr_log_errMsg
- use decompMod , only : bounds_type
- use abortutils , only : endrun
- use clm_varctl , only : iulog, use_soil_moisture_streams, inst_name
- use clm_varcon , only : grlnd
- use controlMod , only : NLFilename
- use decompMod , only : gsMap_lnd2Dsoi_gdc2glo
- use domainMod , only : ldomain
- use fileutils , only : getavu, relavu
- use LandunitType , only : lun
- use ColumnType , only : col
- use SoilStateType , only : soilstate_type
- use WaterStateBulkType, only : waterstatebulk_type
- use perf_mod , only : t_startf, t_stopf
- use spmdMod , only : masterproc
- use spmdMod , only : mpicom, comp_id
+ use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create
+ use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance
+ use shr_kind_mod , only : r8 => shr_kind_r8
+ use shr_kind_mod , only : CL => shr_kind_CL, CXX => shr_kind_CXX
+ use shr_log_mod , only : errMsg => shr_log_errMsg
+ use decompMod , only : bounds_type
+ use abortutils , only : endrun
+ use clm_varctl , only : iulog, use_soil_moisture_streams, inst_name
+ use clm_varcon , only : grlnd
+ use controlMod , only : NLFilename
+ use domainMod , only : ldomain
+ use LandunitType , only : lun
+ use ColumnType , only : col
+ use SoilStateType , only : soilstate_type
+ use WaterStateBulkType , only : waterstatebulk_type
+ use perf_mod , only : t_startf, t_stopf
+ use spmdMod , only : masterproc, mpicom, comp_id
+ use lnd_set_decomp_and_domain , only : gsMap_lnd2Dsoi_gdc2glo
use mct_mod
use ncdio_pio
!
@@ -127,8 +125,7 @@ subroutine PrescribedSoilMoistureInit(bounds)
! Read soilm_streams namelist
if (masterproc) then
- nu_nml = getavu()
- open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error )
+ open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error )
call find_nlgroup_name(nu_nml, 'soil_moisture_streams', status=nml_error)
if (nml_error == 0) then
read(nu_nml, nml=soil_moisture_streams,iostat=nml_error)
@@ -139,7 +136,6 @@ subroutine PrescribedSoilMoistureInit(bounds)
call endrun(subname // ':: ERROR finding soilm_streams namelist')
end if
close(nu_nml)
- call relavu( nu_nml )
endif
call shr_mpi_bcast(stream_year_first_soilm, mpicom)
@@ -170,11 +166,8 @@ subroutine PrescribedSoilMoistureInit(bounds)
call clm_domain_mct (bounds, dom_clm, nlevels=nlevsoi)
- !
! create the field list for these fields...use in shr_strdata_create
- !
fldList = trim(soilmString)
-
if (masterproc) write(iulog,*) 'fieldlist: ', trim(fldList)
call shr_strdata_create(sdat_soilm,name="soil_moisture", &
diff --git a/src/biogeophys/UrbanTimeVarType.F90 b/src/cpl/mct/UrbanTimeVarType.F90
similarity index 86%
rename from src/biogeophys/UrbanTimeVarType.F90
rename to src/cpl/mct/UrbanTimeVarType.F90
index 7a907bb9b9..f637bd8461 100644
--- a/src/biogeophys/UrbanTimeVarType.F90
+++ b/src/cpl/mct/UrbanTimeVarType.F90
@@ -100,10 +100,10 @@ subroutine urbantv_init(this, bounds, NLFilename)
use shr_mpi_mod , only : shr_mpi_bcast
use shr_string_mod , only : shr_string_listAppend
use shr_strdata_mod , only : shr_strdata_create, shr_strdata_print
- use decompMod , only : gsmap_lnd_gdc2glo
use domainMod , only : ldomain
use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=)
use landunit_varcon , only : isturb_TBD, isturb_HD, isturb_MD
+ use lnd_set_decomp_and_domain , only : gsmap_global
!
! !ARGUMENTS:
implicit none
@@ -190,31 +190,31 @@ subroutine urbantv_init(this, bounds, NLFilename)
call shr_string_listAppend( fldList, stream_var_name(ifield) )
end do
- call shr_strdata_create(this%sdat_urbantv,name="clmurbantv", &
- pio_subsystem=pio_subsystem, &
- pio_iotype=shr_pio_getiotype(inst_name), &
- mpicom=mpicom, compid=comp_id, &
- gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, &
- nxg=ldomain%ni, nyg=ldomain%nj, &
- yearFirst=stream_year_first_urbantv, &
- yearLast=stream_year_last_urbantv, &
- yearAlign=model_year_align_urbantv, &
- offset=0, &
- domFilePath='', &
- domFileName=trim(stream_fldFileName_urbantv), &
- domTvarName='time', &
- domXvarName='lon' , &
- domYvarName='lat' , &
- domAreaName='area', &
- domMaskName='LANDMASK', &
- filePath='', &
- filename=(/trim(stream_fldFileName_urbantv)/) , &
- fldListFile=fldList, &
- fldListModel=fldList, &
- fillalgo='none', &
- mapalgo=urbantvmapalgo, &
- calendar=get_calendar(), &
- tintalgo=urbantv_tintalgo, &
+ call shr_strdata_create(this%sdat_urbantv,name="clmurbantv", &
+ pio_subsystem=pio_subsystem, &
+ pio_iotype=shr_pio_getiotype(inst_name), &
+ mpicom=mpicom, compid=comp_id, &
+ gsmap=gsmap_global, ggrid=dom_clm, &
+ nxg=ldomain%ni, nyg=ldomain%nj, &
+ yearFirst=stream_year_first_urbantv, &
+ yearLast=stream_year_last_urbantv, &
+ yearAlign=model_year_align_urbantv, &
+ offset=0, &
+ domFilePath='', &
+ domFileName=trim(stream_fldFileName_urbantv), &
+ domTvarName='time', &
+ domXvarName='lon' , &
+ domYvarName='lat' , &
+ domAreaName='area', &
+ domMaskName='LANDMASK', &
+ filePath='', &
+ filename=(/trim(stream_fldFileName_urbantv)/) , &
+ fldListFile=fldList, &
+ fldListModel=fldList, &
+ fillalgo='none', &
+ mapalgo=urbantvmapalgo, &
+ calendar=get_calendar(), &
+ tintalgo=urbantv_tintalgo, &
taxmode='extend' )
if (masterproc) then
diff --git a/src/biogeochem/ch4FInundatedStreamType.F90 b/src/cpl/mct/ch4FInundatedStreamType.F90
similarity index 89%
rename from src/biogeochem/ch4FInundatedStreamType.F90
rename to src/cpl/mct/ch4FInundatedStreamType.F90
index 9d38ab8332..3c26f4d109 100644
--- a/src/biogeochem/ch4FInundatedStreamType.F90
+++ b/src/cpl/mct/ch4FInundatedStreamType.F90
@@ -70,13 +70,14 @@ subroutine Init(this, bounds, NLFilename)
use shr_mpi_mod , only : shr_mpi_bcast
use ndepStreamMod , only : clm_domain_mct
use domainMod , only : ldomain
- use decompMod , only : bounds_type, gsmap_lnd_gdc2glo
+ use decompMod , only : bounds_type
use mct_mod , only : mct_ggrid, mct_avect_indexra
use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create
use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance
use spmdMod , only : comp_id, iam
use ch4varcon , only : finundation_mtd_h2osfc
use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion
+ use lnd_set_decomp_and_domain , only : gsmap_global
!
! arguments
implicit none
@@ -108,30 +109,30 @@ subroutine Init(this, bounds, NLFilename)
if ( this%useStreams() )then
call clm_domain_mct (bounds, dom_clm)
- call shr_strdata_create(sdat,name=stream_name,&
- pio_subsystem=pio_subsystem, &
- pio_iotype=shr_pio_getiotype(inst_name), &
- mpicom=mpicom, compid=comp_id, &
- gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, &
- nxg=ldomain%ni, nyg=ldomain%nj, &
- yearFirst=1996, &
- yearLast=1996, &
- yearAlign=1, &
- offset=0, &
- domFilePath='', &
- domFileName=trim(control%stream_fldFileName_ch4finundated), &
- domTvarName='time', &
- domXvarName='LONGXY' , &
- domYvarName='LATIXY' , &
- domAreaName='AREA', &
- domMaskName='LANDMASK', &
- filePath='', &
- filename=(/trim(control%stream_fldFileName_ch4finundated)/),&
- fldListFile=control%fldList, &
- fldListModel=control%fldList, &
- fillalgo='none', &
- mapalgo=control%ch4finundatedmapalgo, &
- calendar=get_calendar(), &
+ call shr_strdata_create(sdat,name=stream_name, &
+ pio_subsystem=pio_subsystem, &
+ pio_iotype=shr_pio_getiotype(inst_name), &
+ mpicom=mpicom, compid=comp_id, &
+ gsmap=gsmap_global, ggrid=dom_clm, &
+ nxg=ldomain%ni, nyg=ldomain%nj, &
+ yearFirst=1996, &
+ yearLast=1996, &
+ yearAlign=1, &
+ offset=0, &
+ domFilePath='', &
+ domFileName=trim(control%stream_fldFileName_ch4finundated), &
+ domTvarName='time', &
+ domXvarName='LONGXY' , &
+ domYvarName='LATIXY' , &
+ domAreaName='AREA', &
+ domMaskName='LANDMASK', &
+ filePath='', &
+ filename=(/trim(control%stream_fldFileName_ch4finundated)/), &
+ fldListFile=control%fldList, &
+ fldListModel=control%fldList, &
+ fillalgo='none', &
+ mapalgo=control%ch4finundatedmapalgo, &
+ calendar=get_calendar(), &
taxmode='extend' )
if (masterproc) then
@@ -325,7 +326,7 @@ subroutine ReadNML(this, bounds, NLFilename)
!
! arguments
implicit none
- class(streamcontrol_type) :: this
+ class(streamcontrol_type) :: this
type(bounds_type), intent(in) :: bounds
character(len=*), intent(in) :: NLFilename ! Namelist filename
!
@@ -345,7 +346,7 @@ subroutine ReadNML(this, bounds, NLFilename)
! Default values for namelist
- ! Read ch4finundateddyn_nml namelist
+ ! Read ch4finundated namelist
if (masterproc) then
nu_nml = getavu()
open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error )
diff --git a/src/cpl/mct/laiStreamMod.F90 b/src/cpl/mct/laiStreamMod.F90
new file mode 100644
index 0000000000..47d25287b7
--- /dev/null
+++ b/src/cpl/mct/laiStreamMod.F90
@@ -0,0 +1,241 @@
+module laiStreamMod
+
+#include "shr_assert.h"
+
+ !-----------------------------------------------------------------------
+ ! !DESCRIPTION:
+ ! Read LAI from stream
+ !
+ ! !USES:
+ use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create
+ use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance
+ use shr_kind_mod , only : r8=>shr_kind_r8, CL=>shr_kind_CL, CS=>shr_kind_CS, CXX=>shr_kind_CXX
+ use shr_log_mod , only : errMsg => shr_log_errMsg
+ use decompMod , only : bounds_type
+ use abortutils , only : endrun
+ use clm_varctl , only : iulog, inst_name
+ use perf_mod , only : t_startf, t_stopf
+ use spmdMod , only : masterproc, mpicom, comp_id
+ use ncdio_pio
+ use mct_mod
+ !
+ ! !PUBLIC TYPES:
+ implicit none
+ private
+
+ ! !PUBLIC MEMBER FUNCTIONS:
+ public :: lai_init ! position datasets for LAI
+ public :: lai_advance ! Advance the LAI streams (outside of a Open-MP threading loop)
+ public :: lai_interp ! interpolates between two years of LAI data (when LAI streams
+
+ ! !PRIVATE MEMBER DATA:
+ integer, allocatable :: g_to_ig(:) ! Array matching gridcell index to data index
+ type(shr_strdata_type) :: sdat_lai ! LAI input data stream
+
+ character(len=*), parameter :: sourcefile = &
+ __FILE__
+
+!==============================================================================
+contains
+!==============================================================================
+
+ subroutine lai_init(bounds)
+ !
+ ! Initialize data stream information for LAI.
+ !
+ ! !USES:
+ use clm_time_manager , only : get_calendar
+ use ncdio_pio , only : pio_subsystem
+ use shr_pio_mod , only : shr_pio_getiotype
+ use shr_stream_mod , only : shr_stream_file_null
+ use shr_string_mod , only : shr_string_listCreateField
+ use clm_nlUtilsMod , only : find_nlgroup_name
+ use ndepStreamMod , only : clm_domain_mct
+ use histFileMod , only : hist_addfld1d
+ use domainMod , only : ldomain
+ use controlMod , only : NLFilename
+ use lnd_set_decomp_and_domain , only : gsmap_global
+ !
+ ! !ARGUMENTS:
+ implicit none
+ type(bounds_type), intent(in) :: bounds ! bounds
+ !
+ ! !LOCAL VARIABLES:
+ integer :: stream_year_first_lai ! first year in Lai stream to use
+ integer :: stream_year_last_lai ! last year in Lai stream to use
+ integer :: model_year_align_lai ! align stream_year_first_lai with
+ integer :: nu_nml ! unit for namelist file
+ integer :: nml_error ! namelist i/o error flag
+ type(mct_ggrid) :: dom_clm ! domain information
+ character(len=CL) :: stream_fldFileName_lai ! lai stream filename to read
+ character(len=CL) :: lai_mapalgo = 'bilinear' ! Mapping alogrithm
+ character(len=CL) :: lai_tintalgo = 'linear' ! Time interpolation alogrithm
+ character(len=CXX) :: fldList ! field string
+ character(*), parameter :: laiString = "LAI" ! base string for field string
+ integer , parameter :: numLaiFields = 16 ! number of fields to build field string
+ character(*), parameter :: subName = "('laidyn_init')"
+ !-----------------------------------------------------------------------
+ !
+ ! deal with namelist variables here in init
+ !
+ namelist /lai_streams/ &
+ stream_year_first_lai, &
+ stream_year_last_lai, &
+ model_year_align_lai, &
+ lai_mapalgo, &
+ stream_fldFileName_lai, &
+ lai_tintalgo
+
+ ! Default values for namelist
+ stream_year_first_lai = 1 ! first year in stream to use
+ stream_year_last_lai = 1 ! last year in stream to use
+ model_year_align_lai = 1 ! align stream_year_first_lai with this model year
+ stream_fldFileName_lai = shr_stream_file_null
+
+ ! Read lai_streams namelist
+ if (masterproc) then
+ open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error )
+ call find_nlgroup_name(nu_nml, 'lai_streams', status=nml_error)
+ if (nml_error == 0) then
+ read(nu_nml, nml=lai_streams,iostat=nml_error)
+ if (nml_error /= 0) then
+ call endrun(subname // ':: ERROR reading lai_streams namelist')
+ end if
+ else
+ call endrun(subname // ':: ERROR finding lai_streams namelist')
+ end if
+ close(nu_nml)
+ endif
+ call shr_mpi_bcast(stream_year_first_lai , mpicom)
+ call shr_mpi_bcast(stream_year_last_lai , mpicom)
+ call shr_mpi_bcast(model_year_align_lai , mpicom)
+ call shr_mpi_bcast(stream_fldFileName_lai , mpicom)
+ call shr_mpi_bcast(lai_tintalgo , mpicom)
+
+ if (masterproc) then
+ write(iulog,*) ' '
+ write(iulog,*) 'lai_stream settings:'
+ write(iulog,*) ' stream_year_first_lai = ',stream_year_first_lai
+ write(iulog,*) ' stream_year_last_lai = ',stream_year_last_lai
+ write(iulog,*) ' model_year_align_lai = ',model_year_align_lai
+ write(iulog,*) ' stream_fldFileName_lai = ',trim(stream_fldFileName_lai)
+ write(iulog,*) ' lai_tintalgo = ',trim(lai_tintalgo)
+ endif
+
+ call clm_domain_mct (bounds, dom_clm)
+
+ ! create the field list for these lai fields...use in shr_strdata_create
+ fldList = shr_string_listCreateField( numLaiFields, laiString )
+
+ call shr_strdata_create(sdat_lai,name="laidyn", &
+ pio_subsystem=pio_subsystem, &
+ pio_iotype=shr_pio_getiotype(inst_name), &
+ mpicom=mpicom, compid=comp_id, &
+ gsmap=gsmap_global, ggrid=dom_clm, &
+ nxg=ldomain%ni, nyg=ldomain%nj, &
+ yearFirst=stream_year_first_lai, &
+ yearLast=stream_year_last_lai, &
+ yearAlign=model_year_align_lai, &
+ offset=0, &
+ domFilePath='', &
+ domFileName=trim(stream_fldFileName_lai), &
+ domTvarName='time', &
+ domXvarName='lon' , &
+ domYvarName='lat' , &
+ domAreaName='area', &
+ domMaskName='mask', &
+ filePath='', &
+ filename=(/stream_fldFileName_lai/), &
+ fldListFile=fldList, &
+ fldListModel=fldList, &
+ fillalgo='none', &
+ mapalgo=lai_mapalgo, &
+ tintalgo=lai_tintalgo, &
+ calendar=get_calendar(), &
+ taxmode='cycle' )
+
+ if (masterproc) then
+ call shr_strdata_print(sdat_lai,'LAI data')
+ endif
+
+ end subroutine lai_init
+
+ !==============================================================================
+ subroutine lai_advance( bounds )
+ !
+ ! Advance LAI streams
+ !
+ ! !USES:
+ use clm_time_manager, only : get_curr_date
+ !
+ ! !ARGUMENTS:
+ implicit none
+ type(bounds_type) , intent(in) :: bounds
+ !
+ ! !LOCAL VARIABLES:
+ integer :: g, ig ! Indices
+ integer :: year ! year (0, ...) for nstep+1
+ integer :: mon ! month (1, ..., 12) for nstep+1
+ integer :: day ! day of month (1, ..., 31) for nstep+1
+ integer :: sec ! seconds into current date for nstep+1
+ integer :: mcdate ! Current model date (yyyymmdd)
+ !-----------------------------------------------------------------------
+
+ call get_curr_date(year, mon, day, sec)
+ mcdate = year*10000 + mon*100 + day
+
+ call shr_strdata_advance(sdat_lai, mcdate, sec, mpicom, 'laidyn')
+ if ( .not. allocated(g_to_ig) )then
+ allocate (g_to_ig(bounds%begg:bounds%endg) )
+ ig = 0
+ do g = bounds%begg,bounds%endg
+ ig = ig+1
+ g_to_ig(g) = ig
+ end do
+ end if
+
+ end subroutine lai_advance
+
+ !==============================================================================
+ subroutine lai_interp(bounds, canopystate_inst)
+ !
+ ! Interpolate data stream information for Lai.
+ !
+ ! !USES:
+ use pftconMod , only : noveg
+ use CanopyStateType , only : canopystate_type
+ use PatchType , only : patch
+ !
+ ! !ARGUMENTS:
+ implicit none
+ type(bounds_type) , intent(in) :: bounds
+ type(canopystate_type) , intent(inout) :: canopystate_inst
+ !
+ ! !LOCAL VARIABLES:
+ integer :: ivt, p, ip, ig
+ character(len=CL) :: stream_var_name
+ !-----------------------------------------------------------------------
+ SHR_ASSERT_FL( (lbound(g_to_ig,1) <= bounds%begg ), sourcefile, __LINE__)
+ SHR_ASSERT_FL( (ubound(g_to_ig,1) >= bounds%endg ), sourcefile, __LINE__)
+ SHR_ASSERT_FL( (lbound(sdat_lai%avs(1)%rAttr,2) <= g_to_ig(bounds%begg) ), sourcefile, __LINE__)
+ SHR_ASSERT_FL( (ubound(sdat_lai%avs(1)%rAttr,2) >= g_to_ig(bounds%endg) ), sourcefile, __LINE__)
+
+ do p = bounds%begp, bounds%endp
+ ivt = patch%itype(p)
+ ! Set lai for each gridcell/patch combination
+ if (ivt /= noveg) then
+ ! vegetated pft
+ write(stream_var_name,"(i6)") ivt
+ stream_var_name = 'LAI_'//trim(adjustl(stream_var_name))
+ ip = mct_aVect_indexRA(sdat_lai%avs(1),trim(stream_var_name))
+ ig = g_to_ig(patch%gridcell(p))
+ canopystate_inst%tlai_patch(p) = sdat_lai%avs(1)%rAttr(ip,ig)
+ else
+ ! non-vegetated pft
+ canopystate_inst%tlai_patch(p) = 0._r8
+ endif
+ end do
+
+ end subroutine lai_interp
+
+end module LaiStreamMod
diff --git a/src/cpl/mct/lnd_comp_mct.F90 b/src/cpl/mct/lnd_comp_mct.F90
index f94a3544dc..1595611a72 100644
--- a/src/cpl/mct/lnd_comp_mct.F90
+++ b/src/cpl/mct/lnd_comp_mct.F90
@@ -11,12 +11,11 @@ module lnd_comp_mct
use shr_sys_mod , only : shr_sys_flush
use shr_log_mod , only : errMsg => shr_log_errMsg
use mct_mod , only : mct_avect, mct_gsmap, mct_gGrid
- use decompmod , only : bounds_type, ldecomp
+ use decompmod , only : bounds_type
use lnd_import_export, only : lnd_import, lnd_export
!
! !public member functions:
implicit none
- save
private ! by default make data private
!
! !public member functions:
@@ -25,7 +24,6 @@ module lnd_comp_mct
public :: lnd_final_mct ! clm finalization/cleanup
!
! !private member functions:
- private :: lnd_setgsmap_mct ! set the land model mct gs map
private :: lnd_domain_mct ! set the land model domain information
private :: lnd_handle_resume ! handle pause/resume signals from the coupler
@@ -67,8 +65,9 @@ subroutine lnd_init_mct( EClock, cdata_l, x2l_l, l2x_l, NLFilename )
use spmdMod , only : masterproc, spmd_init
use clm_varctl , only : nsrStartup, nsrContinue, nsrBranch
use clm_cpl_indices , only : clm_cpl_indices_set
- use mct_mod , only : mct_aVect_init, mct_aVect_zero, mct_gsMap_lsize
- use lnd_set_decomp_and_domain, only : lnd_set_decomp_and_domain_from_surfrd
+ use mct_mod , only : mct_aVect_init, mct_aVect_zero, mct_gsMap, mct_gsMap_init
+ use decompMod , only : gindex_global
+ use lnd_set_decomp_and_domain, only : lnd_set_decomp_and_domain_from_surfrd, gsmap_global
use ESMF
!
! !ARGUMENTS:
@@ -84,6 +83,7 @@ subroutine lnd_init_mct( EClock, cdata_l, x2l_l, l2x_l, NLFilename )
type(mct_gGrid), pointer :: dom_l ! Land model domain
type(seq_infodata_type), pointer :: infodata ! CESM driver level info data
integer :: lsize ! size of attribute vector
+ integer :: gsize ! global size
integer :: g,i,j ! indices
integer :: dtime_sync ! coupling time-step from the input synchronization clock
logical :: exists ! true if file exists
@@ -208,7 +208,7 @@ subroutine lnd_init_mct( EClock, cdata_l, x2l_l, l2x_l, NLFilename )
! Read namelists
call initialize1(dtime=dtime_sync)
- ! Initialize decomposition (ldecomp) and domain (ldomain) types
+ ! Initialize decomposition and domain (ldomain) type
call lnd_set_decomp_and_domain_from_surfrd(noland, ni, nj)
! If no land then exit out of initialization
@@ -227,8 +227,10 @@ subroutine lnd_init_mct( EClock, cdata_l, x2l_l, l2x_l, NLFilename )
! Initialize clm gsMap, clm domain and clm attribute vectors
call get_proc_bounds( bounds )
- call lnd_SetgsMap_mct( bounds, mpicom_lnd, LNDID, gsMap_lnd )
- lsize = mct_gsMap_lsize(gsMap_lnd, mpicom_lnd)
+ lsize = bounds%endg - bounds%begg + 1
+ gsize = ldomain%ni * ldomain%nj
+ call mct_gsMap_init( gsMap_lnd, gindex_global, mpicom_lnd, LNDID, lsize, gsize )
+ gsmap_global => gsmap_lnd ! module variable in lnd_set_decomp_and_domain
call lnd_domain_mct( bounds, lsize, gsMap_lnd, dom_l )
call mct_aVect_init(x2l_l, rList=seq_flds_x2l_fields, lsize=lsize)
call mct_aVect_zero(x2l_l)
@@ -513,49 +515,6 @@ subroutine lnd_final_mct( EClock, cdata_l, x2l_l, l2x_l)
! fill this in
end subroutine lnd_final_mct
- !====================================================================================
- subroutine lnd_setgsmap_mct( bounds, mpicom_lnd, LNDID, gsMap_lnd )
- !
- ! !DESCRIPTION:
- ! Set the MCT GS map for the land model
- !
- ! !USES:
- use shr_kind_mod , only : r8 => shr_kind_r8
- use domainMod , only : ldomain
- use mct_mod , only : mct_gsMap, mct_gsMap_init
- implicit none
- !
- ! !ARGUMENTS:
- type(bounds_type) , intent(in) :: bounds ! bounds
- integer , intent(in) :: mpicom_lnd ! MPI communicator for the clm land model
- integer , intent(in) :: LNDID ! Land model identifyer number
- type(mct_gsMap) , intent(out) :: gsMap_lnd ! Resulting MCT GS map for the land model
- !
- ! !LOCAL VARIABLES:
- integer,allocatable :: gindex(:) ! Number the local grid points
- integer :: i, j, n, gi ! Indices
- integer :: lsize,gsize ! GS Map size
- integer :: ier ! Error code
- !---------------------------------------------------------------------------
-
- ! Build the land grid numbering for MCT
- ! NOTE: Numbering scheme is: West to East and South to North
- ! starting at south pole. Should be the same as what's used in SCRIP
- allocate(gindex(bounds%begg:bounds%endg),stat=ier)
-
- ! number the local grid
- do n = bounds%begg, bounds%endg
- gindex(n) = ldecomp%gdc2glo(n)
- end do
- lsize = bounds%endg - bounds%begg + 1
- gsize = ldomain%ni * ldomain%nj
-
- call mct_gsMap_init( gsMap_lnd, gindex, mpicom_lnd, LNDID, lsize, gsize )
-
- deallocate(gindex)
-
- end subroutine lnd_SetgsMap_mct
-
!====================================================================================
subroutine lnd_domain_mct( bounds, lsize, gsMap_l, dom_l )
!
diff --git a/src/cpl/mct/lnd_set_decomp_and_domain.F90 b/src/cpl/mct/lnd_set_decomp_and_domain.F90
index 0e1dbb9477..0a37554313 100644
--- a/src/cpl/mct/lnd_set_decomp_and_domain.F90
+++ b/src/cpl/mct/lnd_set_decomp_and_domain.F90
@@ -1,9 +1,9 @@
module lnd_set_decomp_and_domain
- use shr_kind_mod , only : r8 => shr_kind_r8, cl=>shr_kind_cl
+ use shr_kind_mod , only : r8 => shr_kind_r8
use spmdMod , only : masterproc
use clm_varctl , only : iulog
- use perf_mod , only : t_startf, t_stopf, t_barrierf
+ use mct_mod , only : mct_gsMap
implicit none
private ! except
@@ -15,6 +15,13 @@ module lnd_set_decomp_and_domain
private :: surfrd_get_globmask ! Reads global land mask (needed for setting domain decomp)
private :: surfrd_get_grid ! Read grid/ladnfrac data into domain (after domain decomp)
+ ! translation between local and global indices at gridcell level
+ type(mct_gsmap), pointer, public :: gsmap_global
+
+ ! translation between local and global indices at gridcell level for multiple levels
+ ! needed for 3d soil moisture stream
+ type(mct_gsmap), target , public :: gsMap_lnd2Dsoi_gdc2glo
+
character(len=*), parameter, private :: sourcefile = &
__FILE__
@@ -24,13 +31,13 @@ module lnd_set_decomp_and_domain
subroutine lnd_set_decomp_and_domain_from_surfrd(noland, ni, nj)
- ! Initialize ldecomp and ldomain data types
+ ! Initialize ldomain data types
use clm_varpar , only: nlevsoi
use clm_varctl , only: fatmlndfrc, use_soil_moisture_streams
- use decompInitMod , only: decompInit_lnd, decompInit_lnd3D
+ use decompInitMod , only: decompInit_lnd
use decompMod , only: bounds_type, get_proc_bounds
- use domainMod , only: ldomain, domain_init, domain_check
+ use domainMod , only: ldomain, domain_check
! input/output variables
logical, intent(out) :: noland
@@ -61,7 +68,6 @@ subroutine lnd_set_decomp_and_domain_from_surfrd(noland, ni, nj)
noland = .false.
end if
- ! Initialize ldecomp data type
! Determine ctsm gridcell decomposition and processor bounds for gridcells
call decompInit_lnd(ni, nj, amask)
deallocate(amask)
@@ -112,7 +118,6 @@ subroutine surfrd_get_globmask(filename, mask, ni, nj)
integer :: n,i,j ! index
integer :: ier ! error status
type(file_desc_t) :: ncid ! netcdf id
- character(len=256) :: varname ! variable name
character(len=256) :: locfn ! local file name
logical :: readvar ! read variable in or not
integer , allocatable :: idata2d(:,:)
@@ -174,7 +179,7 @@ subroutine surfrd_get_globmask(filename, mask, ni, nj)
end subroutine surfrd_get_globmask
!-----------------------------------------------------------------------
- subroutine surfrd_get_grid(begg, endg, ldomain, filename, glcfilename)
+ subroutine surfrd_get_grid(begg, endg, ldomain, filename)
! Read the surface dataset grid related information:
! This is called after the domain decomposition has been created
@@ -182,28 +187,24 @@ subroutine surfrd_get_grid(begg, endg, ldomain, filename, glcfilename)
! - real longitude of grid cell (degrees)
use clm_varcon , only : spval, re, grlnd
- use domainMod , only : domain_type, domain_init, domain_clean, lon1d, lat1d
+ use domainMod , only : domain_type, lon1d, lat1d, domain_init
use fileutils , only : getfil
use abortutils , only : endrun
use shr_log_mod , only : errMsg => shr_log_errMsg
- use ncdio_pio , only : file_desc_t, var_desc_t, ncd_pio_openfile, ncd_pio_closefile
- use ncdio_pio , only : ncd_io, check_var, ncd_inqfdims, check_dim_size, ncd_inqdid, ncd_inqdlen
+ use ncdio_pio , only : file_desc_t, ncd_pio_openfile, ncd_pio_closefile
+ use ncdio_pio , only : ncd_io, check_var, ncd_inqfdims, check_dim_size
use pio
! input/output variables
integer , intent(in) :: begg, endg
type(domain_type) , intent(inout) :: ldomain ! domain to init
character(len=*) , intent(in) :: filename ! grid filename
- character(len=*) ,optional , intent(in) :: glcfilename ! glc mask filename
! local variables
type(file_desc_t) :: ncid ! netcdf id
integer :: beg ! local beg index
integer :: end ! local end index
integer :: ni,nj,ns ! size of grid on file
- integer :: dimid,varid ! netCDF id's
- integer :: start(1), count(1) ! 1d lat/lon array sections
- integer :: ier,ret ! error status
logical :: readvar ! true => variable is on input file
logical :: isgrid2d ! true => file is 2d lat/lon
logical :: istype_domain ! true => input file is of type domain
@@ -212,7 +213,7 @@ subroutine surfrd_get_grid(begg, endg, ldomain, filename, glcfilename)
character(len=256) :: locfn ! local file name
integer :: n ! indices
character(len=32) :: subname = 'surfrd_get_grid' ! subroutine name
-!-----------------------------------------------------------------------
+ !-----------------------------------------------------------------------
if (masterproc) then
if (filename == ' ') then
@@ -291,4 +292,61 @@ subroutine surfrd_get_grid(begg, endg, ldomain, filename, glcfilename)
end subroutine surfrd_get_grid
+ !------------------------------------------------------------------------------
+ subroutine decompInit_lnd3D(lni,lnj,lnk)
+ !
+ ! !DESCRIPTION:
+ ! Create a 3D decomposition gsmap for the global 2D grid with soil levels
+ ! as the 3rd dimesnion.
+ !
+ ! !USES:
+ use decompMod, only : gindex_global, bounds_type, get_proc_bounds
+ use spmdMod , only : comp_id, mpicom
+ use mct_mod , only : mct_gsmap_init
+ !
+ ! !ARGUMENTS:
+ integer , intent(in) :: lni,lnj,lnk ! domain global size
+ !
+ ! !LOCAL VARIABLES:
+ integer :: m,n,k ! indices
+ integer :: begg,endg,lsize,gsize ! used for gsmap init
+ integer :: begg3d,endg3d
+ integer, pointer :: gindex(:) ! global index for gsmap init
+ type(bounds_type) :: bounds
+ !------------------------------------------------------------------------------
+
+ ! Initialize gsmap_lnd2dsoi_gdc2glo
+ call get_proc_bounds(bounds)
+ begg = bounds%begg; endg=bounds%endg
+
+ begg3d = (begg-1)*lnk + 1
+ endg3d = endg*lnk
+ lsize = (endg3d - begg3d + 1 )
+ allocate(gindex(begg3d:endg3d))
+ do k = 1, lnk
+ do n = begg,endg
+ m = (begg-1)*lnk + (k-1)*(endg-begg+1) + (n-begg+1)
+ gindex(m) = gindex_global(n-begg+1) + (k-1)*(lni*lnj)
+ enddo
+ enddo
+ gsize = lni * lnj * lnk
+ call mct_gsMap_init(gsMap_lnd2Dsoi_gdc2glo, gindex, mpicom, comp_id, lsize, gsize)
+
+ ! Diagnostic output
+
+ if (masterproc) then
+ write(iulog,*)' 3D GSMap'
+ write(iulog,*)' longitude points = ',lni
+ write(iulog,*)' latitude points = ',lnj
+ write(iulog,*)' soil levels = ',lnk
+ write(iulog,*)' gsize = ',gsize
+ write(iulog,*)' lsize = ',lsize
+ write(iulog,*)' bounds(gindex) = ',size(gindex)
+ write(iulog,*)
+ end if
+
+ deallocate(gindex)
+
+ end subroutine decompInit_lnd3D
+
end module lnd_set_decomp_and_domain
diff --git a/src/main/ndepStreamMod.F90 b/src/cpl/mct/ndepStreamMod.F90
similarity index 95%
rename from src/main/ndepStreamMod.F90
rename to src/cpl/mct/ndepStreamMod.F90
index 4741e879ea..af03ca5c35 100644
--- a/src/main/ndepStreamMod.F90
+++ b/src/cpl/mct/ndepStreamMod.F90
@@ -14,14 +14,12 @@ module ndepStreamMod
use spmdMod , only: mpicom, masterproc, comp_id, iam
use clm_varctl , only: iulog, inst_name
use abortutils , only: endrun
- use fileutils , only: getavu, relavu
- use decompMod , only: bounds_type, ldecomp
+ use decompMod , only: bounds_type
use domainMod , only: ldomain
! !PUBLIC TYPES:
implicit none
private
- save
! !PUBLIC MEMBER FUNCTIONS:
public :: ndep_init ! position datasets for dynamic ndep
@@ -30,6 +28,7 @@ module ndepStreamMod
! !PRIVATE MEMBER FUNCTIONS:
private :: check_units ! Check the units and make sure they can be used
+
! ! PRIVATE TYPES
type(shr_strdata_type) :: sdat ! input data stream
integer :: stream_year_first_ndep ! first year in stream to use
@@ -57,7 +56,7 @@ subroutine ndep_init(bounds, NLFilename)
use shr_nl_mod , only : shr_nl_find_group_name
use shr_log_mod , only : errMsg => shr_log_errMsg
use shr_mpi_mod , only : shr_mpi_bcast
- use decompMod , only : gsmap_lnd_gdc2glo
+ use lnd_set_decomp_and_domain , only : gsMap_lnd2Dsoi_gdc2glo, gsmap_global
!
! arguments
implicit none
@@ -95,8 +94,7 @@ subroutine ndep_init(bounds, NLFilename)
! Read ndepdyn_nml namelist
if (masterproc) then
- nu_nml = getavu()
- open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error )
+ open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error )
call shr_nl_find_group_name(nu_nml, 'ndepdyn_nml', status=nml_error)
if (nml_error == 0) then
read(nu_nml, nml=ndepdyn_nml,iostat=nml_error)
@@ -107,7 +105,6 @@ subroutine ndep_init(bounds, NLFilename)
call endrun(msg=' ERROR finding ndepdyn_nml namelist'//errMsg(sourcefile, __LINE__))
end if
close(nu_nml)
- call relavu( nu_nml )
endif
call shr_mpi_bcast(stream_year_first_ndep , mpicom)
@@ -140,7 +137,7 @@ subroutine ndep_init(bounds, NLFilename)
pio_subsystem=pio_subsystem, &
pio_iotype=shr_pio_getiotype(inst_name), &
mpicom=mpicom, compid=comp_id, &
- gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, &
+ gsmap=gsmap_global, ggrid=dom_clm, &
nxg=ldomain%ni, nyg=ldomain%nj, &
yearFirst=stream_year_first_ndep, &
yearLast=stream_year_last_ndep, &
@@ -267,13 +264,12 @@ subroutine clm_domain_mct(bounds, dom_clm, nlevels)
!-------------------------------------------------------------------
! Set domain data type for internal clm grid
- use clm_varcon , only : re
- use domainMod , only : ldomain
- use mct_mod , only : mct_ggrid, mct_gsMap_lsize, mct_gGrid_init
- use mct_mod , only : mct_gsMap_orderedPoints, mct_gGrid_importIAttr
- use mct_mod , only : mct_gGrid_importRAttr
- use mct_mod , only : mct_gsMap
- use decompMod , only : gsmap_lnd_gdc2glo, gsMap_lnd2Dsoi_gdc2glo
+ use clm_varcon , only : re
+ use domainMod , only : ldomain
+ use mct_mod , only : mct_ggrid, mct_gsMap_lsize, mct_gGrid_init
+ use mct_mod , only : mct_gsMap_orderedPoints, mct_gGrid_importIAttr
+ use mct_mod , only : mct_gGrid_importRAttr, mct_gsMap
+ use lnd_set_decomp_and_domain , only : gsMap_lnd2Dsoi_gdc2glo, gsmap_global
implicit none
!
! arguments
@@ -293,7 +289,7 @@ subroutine clm_domain_mct(bounds, dom_clm, nlevels)
nlevs = 1
if ( present(nlevels) ) nlevs = nlevels
if ( nlevs == 1 ) then
- gsmap => gsmap_lnd_gdc2glo
+ gsmap => gsmap_global
else
gsmap => gsMap_lnd2Dsoi_gdc2glo
end if
diff --git a/src/cpl/nuopc/lnd_comp_nuopc.F90 b/src/cpl/nuopc/lnd_comp_nuopc.F90
index 19c7748297..d4bf072402 100644
--- a/src/cpl/nuopc/lnd_comp_nuopc.F90
+++ b/src/cpl/nuopc/lnd_comp_nuopc.F90
@@ -321,7 +321,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
use ESMF , only : ESMF_VM, ESMF_VMGet
use clm_instMod , only : lnd2atm_inst, lnd2glc_inst, water_inst
use domainMod , only : ldomain
- use decompMod , only : ldecomp, bounds_type, get_proc_bounds
+ use decompMod , only : bounds_type, get_proc_bounds
use lnd_set_decomp_and_domain , only : lnd_set_decomp_and_domain_from_readmesh
use lnd_set_decomp_and_domain , only : lnd_set_mesh_for_single_column
use lnd_set_decomp_and_domain , only : lnd_set_decomp_and_domain_for_single_column
diff --git a/src/cpl/share_esmf/FireDataBaseType.F90 b/src/cpl/share_esmf/FireDataBaseType.F90
new file mode 100644
index 0000000000..652295e0c5
--- /dev/null
+++ b/src/cpl/share_esmf/FireDataBaseType.F90
@@ -0,0 +1,468 @@
+module FireDataBaseType
+
+#include "shr_assert.h"
+
+ !-----------------------------------------------------------------------
+ ! !DESCRIPTION:
+ ! module for handling of fire data
+ !
+ ! !USES:
+ use ESMF
+ use dshr_strdata_mod , only : shr_strdata_type
+ use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL
+ use shr_log_mod , only : errMsg => shr_log_errMsg
+ use clm_varctl , only : iulog
+ use spmdMod , only : masterproc, mpicom, iam
+ use abortutils , only : endrun
+ use decompMod , only : bounds_type
+ use FireMethodType , only : fire_method_type
+ !
+ implicit none
+ private
+ !
+ ! !PUBLIC TYPES:
+ public :: fire_base_type
+ !
+ type, abstract, extends(fire_method_type) :: fire_base_type
+ private
+ ! !PRIVATE MEMBER DATA:
+ real(r8), public, pointer :: forc_hdm(:) ! Human population density
+ type(shr_strdata_type) :: sdat_hdm ! Human population density input data stream
+ real(r8), public, pointer :: forc_lnfm(:) ! Lightning frequency
+ type(shr_strdata_type) :: sdat_lnfm ! Lightning frequency input data stream
+ contains
+ !
+ ! !PUBLIC MEMBER FUNCTIONS:
+ procedure, public :: FireInit => BaseFireInit ! Initialization of Fire
+ procedure, public :: BaseFireInit ! Initialization of Fire
+ procedure, public :: FireInterp ! Interpolate fire data
+ procedure(FireReadNML_interface), public, deferred :: &
+ FireReadNML ! Read in namelist for Fire
+ procedure(need_lightning_and_popdens_interface), public, deferred :: &
+ need_lightning_and_popdens ! Returns true if need lightning & popdens
+ !
+ ! !PRIVATE MEMBER FUNCTIONS:
+ procedure, private :: hdm_init ! position datasets for dynamic human population density
+ procedure, private :: hdm_interp ! interpolates between two years of human pop. density file data
+ procedure, private :: lnfm_init ! position datasets for Lightning
+ procedure, private :: lnfm_interp ! interpolates between two years of Lightning file data
+ end type fire_base_type
+
+ abstract interface
+ !-----------------------------------------------------------------------
+ function need_lightning_and_popdens_interface(this) result(need_lightning_and_popdens)
+ !
+ ! !DESCRIPTION:
+ ! Returns true if need lightning and popdens, false otherwise
+ !
+ ! USES
+ import :: fire_base_type
+ !
+ ! !ARGUMENTS:
+ class(fire_base_type), intent(in) :: this
+ logical :: need_lightning_and_popdens ! function result
+ !-----------------------------------------------------------------------
+ end function need_lightning_and_popdens_interface
+ end interface
+
+ character(len=*), parameter, private :: sourcefile = &
+ __FILE__
+
+!==============================================================================
+contains
+!==============================================================================
+
+ subroutine FireReadNML_interface( this, NLFilename )
+ !
+ ! !DESCRIPTION:
+ ! Read the namelist for Fire
+ !
+ ! !USES:
+ !
+ ! !ARGUMENTS:
+ class(fire_base_type) :: this
+ character(len=*), intent(in) :: NLFilename ! Namelist filename
+ end subroutine FireReadNML_interface
+
+ !================================================================
+ subroutine BaseFireInit( this, bounds, NLFilename )
+ !
+ ! !DESCRIPTION:
+ ! Initialize CN Fire module
+ ! !USES:
+ use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=)
+ !
+ ! !ARGUMENTS:
+ class(fire_base_type) :: this
+ type(bounds_type), intent(in) :: bounds
+ character(len=*), intent(in) :: NLFilename
+ !-----------------------------------------------------------------------
+
+ if ( this%need_lightning_and_popdens() ) then
+ ! Allocate lightning forcing data
+ allocate( this%forc_lnfm(bounds%begg:bounds%endg) )
+ this%forc_lnfm(bounds%begg:) = nan
+ ! Allocate pop dens forcing data
+ allocate( this%forc_hdm(bounds%begg:bounds%endg) )
+ this%forc_hdm(bounds%begg:) = nan
+
+ call this%hdm_init(bounds, NLFilename)
+ call this%hdm_interp(bounds)
+ call this%lnfm_init(bounds, NLFilename)
+ call this%lnfm_interp(bounds)
+ end if
+
+ end subroutine BaseFireInit
+
+ !================================================================
+ subroutine FireInterp(this,bounds)
+ !
+ ! !DESCRIPTION:
+ ! Interpolate CN Fire datasets
+ !
+ ! !ARGUMENTS:
+ class(fire_base_type) :: this
+ type(bounds_type), intent(in) :: bounds
+ !-----------------------------------------------------------------------
+
+ if ( this%need_lightning_and_popdens() ) then
+ call this%hdm_interp(bounds)
+ call this%lnfm_interp(bounds)
+ end if
+
+ end subroutine FireInterp
+
+ !================================================================
+ subroutine hdm_init( this, bounds, NLFilename )
+ !
+ ! !DESCRIPTION:
+ ! Initialize data stream information for population density.
+ !
+ ! !USES:
+ use clm_nlUtilsMod , only : find_nlgroup_name
+ use histFileMod , only : hist_addfld1d
+ use lnd_comp_shr , only : mesh, model_clock
+ use dshr_strdata_mod , only : shr_strdata_init_from_inline
+ use shr_mpi_mod , only : shr_mpi_bcast
+ !
+ ! !ARGUMENTS:
+ implicit none
+ class(fire_base_type) :: this
+ type(bounds_type), intent(in) :: bounds
+ character(len=*), intent(in) :: NLFilename ! Namelist filename
+ !
+ ! !LOCAL VARIABLES:
+ integer :: nu_nml ! unit for namelist file
+ integer :: nml_error ! namelist i/o error flag
+ integer :: stream_year_first_popdens ! first year in pop. dens. stream to use
+ integer :: stream_year_last_popdens ! last year in pop. dens. stream to use
+ integer :: model_year_align_popdens ! align stream_year_first_hdm with
+ character(len=CL) :: stream_fldFileName_popdens ! population density streams filename
+ character(len=CL) :: stream_meshfile_popdens ! population density streams filename
+ character(len=CL) :: popdensmapalgo ! mapping alogrithm for population density
+ character(len=CL) :: popdens_tintalgo ! time interpolation alogrithm for population density
+ integer :: rc
+ character(*), parameter :: subName = "('hdmdyn_init')"
+ !-----------------------------------------------------------------------
+
+ namelist /popd_streams/ &
+ stream_year_first_popdens, &
+ stream_year_last_popdens, &
+ model_year_align_popdens, &
+ popdensmapalgo, &
+ stream_fldFileName_popdens, &
+ stream_meshfile_popdens, &
+ popdens_tintalgo
+
+ ! Default values for namelist
+ stream_year_first_popdens = 1 ! first year in stream to use
+ stream_year_last_popdens = 1 ! last year in stream to use
+ model_year_align_popdens = 1 ! align stream_year_first_popdens with this model year
+ stream_fldFileName_popdens = ' '
+ stream_meshfile_popdens = ' '
+ popdens_tintalgo = 'nearest'
+ popdensmapalgo = 'bilinear'
+
+ ! Read popd_streams namelist
+ if (masterproc) then
+ open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error )
+ call find_nlgroup_name(nu_nml, 'popd_streams', status=nml_error)
+ if (nml_error == 0) then
+ read(nu_nml, nml=popd_streams,iostat=nml_error)
+ if (nml_error /= 0) then
+ call endrun(msg='ERROR reading popd_streams namelist'//errMsg(sourcefile, __LINE__))
+ end if
+ end if
+ close(nu_nml)
+ endif
+
+ call shr_mpi_bcast(stream_year_first_popdens , mpicom)
+ call shr_mpi_bcast(stream_year_last_popdens , mpicom)
+ call shr_mpi_bcast(model_year_align_popdens , mpicom)
+ call shr_mpi_bcast(stream_fldFileName_popdens , mpicom)
+ call shr_mpi_bcast(stream_meshfile_popdens , mpicom)
+ call shr_mpi_bcast(popdens_tintalgo , mpicom)
+
+ if (masterproc) then
+ write(iulog,'(a)' ) ' '
+ write(iulog,'(a)' ) 'popdens_streams settings:'
+ write(iulog,'(a,i8)') ' stream_year_first_popdens = ',stream_year_first_popdens
+ write(iulog,'(a,i8)') ' stream_year_last_popdens = ',stream_year_last_popdens
+ write(iulog,'(a,i8)') ' model_year_align_popdens = ',model_year_align_popdens
+ write(iulog,'(a,a)' ) ' stream_fldFileName_popdens = ',trim(stream_fldFileName_popdens)
+ write(iulog,'(a,a)' ) ' stream_meshfile_popdens = ',trim(stream_meshfile_popdens)
+ write(iulog,'(a,a)' ) ' stream_varnames = ','hdm'
+ write(iulog,'(a,a)' ) ' time interp algo = ',trim(popdens_tintalgo)
+ write(iulog,'(a,a)' ) ' mapping interp algo = ',trim(popdensmapalgo)
+ write(iulog,'(a)' ) ' '
+ endif
+
+ ! Initialize the cdeps data type sdat
+ call shr_strdata_init_from_inline(this%sdat_hdm, &
+ my_task = iam, &
+ logunit = iulog, &
+ compname = 'LND', &
+ model_clock = model_clock, &
+ model_mesh = mesh, &
+ stream_meshfile = trim(stream_meshfile_popdens), &
+ stream_lev_dimname = 'null', &
+ stream_mapalgo = trim(popdensmapalgo), &
+ stream_filenames = (/trim(stream_fldfilename_popdens)/), &
+ stream_fldlistFile = (/'hdm'/), &
+ stream_fldListModel = (/'hdm'/), &
+ stream_yearFirst = stream_year_first_popdens, &
+ stream_yearLast = stream_year_last_popdens, &
+ stream_yearAlign = model_year_align_popdens, &
+ stream_offset = 0, &
+ stream_taxmode = 'extend', &
+ stream_dtlimit = 1.0e30_r8, &
+ stream_tintalgo = popdens_tintalgo, &
+ stream_name = 'Population density data', &
+ rc = rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+
+ ! Add history fields
+ call hist_addfld1d (fname='HDM', units='counts/km^2', &
+ avgflag='A', long_name='human population density', &
+ ptr_lnd=this%forc_hdm, default='inactive')
+
+ end subroutine hdm_init
+
+ !================================================================
+ subroutine hdm_interp( this, bounds)
+ !
+ ! !DESCRIPTION:
+ ! Interpolate data stream information for population density.
+ !
+ ! !USES:
+ use clm_time_manager , only : get_curr_date
+ use dshr_methods_mod , only : dshr_fldbun_getfldptr
+ use dshr_strdata_mod , only : shr_strdata_advance
+ !
+ ! !ARGUMENTS:
+ class(fire_base_type) :: this
+ type(bounds_type), intent(in) :: bounds
+ !
+ ! !LOCAL VARIABLES:
+ integer :: g, ig
+ integer :: year ! year (0, ...) for nstep+1
+ integer :: mon ! month (1, ..., 12) for nstep+1
+ integer :: day ! day of month (1, ..., 31) for nstep+1
+ integer :: sec ! seconds into current date for nstep+1
+ integer :: mcdate ! Current model date (yyyymmdd)
+ integer :: rc
+ real(r8), pointer :: dataptr1d(:)
+ !-----------------------------------------------------------------------
+
+ ! Advance sdat stream
+ call get_curr_date(year, mon, day, sec)
+ mcdate = year*10000 + mon*100 + day
+ call shr_strdata_advance(this%sdat_hdm, ymd=mcdate, tod=sec, logunit=iulog, istr='hdmdyn', rc=rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+
+ ! Get pointer for stream data that is time and spatially interpolate to model time and grid
+ call dshr_fldbun_getFldPtr(this%sdat_hdm%pstrm(1)%fldbun_model, 'hdm', fldptr1=dataptr1d, rc=rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+
+ ig = 0
+ do g = bounds%begg,bounds%endg
+ ig = ig+1
+ this%forc_hdm(g) = dataptr1d(ig)
+ end do
+
+ end subroutine hdm_interp
+
+ !================================================================
+ subroutine lnfm_init( this, bounds, NLFilename )
+ !
+ ! !DESCRIPTION:
+ !
+ ! Initialize data stream information for Lightning.
+ !
+ ! !USES:
+ use clm_nlUtilsMod , only : find_nlgroup_name
+ use lnd_comp_shr , only : mesh, model_clock
+ use dshr_strdata_mod , only : shr_strdata_init_from_inline
+ use histFileMod , only : hist_addfld1d
+ use shr_mpi_mod , only : shr_mpi_bcast
+ !
+ ! !ARGUMENTS:
+ implicit none
+ class(fire_base_type) :: this
+ type(bounds_type), intent(in) :: bounds
+ character(len=*), intent(in) :: NLFilename
+ !
+ ! !LOCAL VARIABLES:
+ integer :: nu_nml ! unit for namelist file
+ integer :: nml_error ! namelist i/o error flag
+ integer :: stream_year_first_lightng ! first year in Lightning stream to use
+ integer :: stream_year_last_lightng ! last year in Lightning stream to use
+ integer :: model_year_align_lightng ! align stream_year_first_lnfm with
+ character(len=CL) :: stream_fldFileName_lightng ! lightning stream filename to read
+ character(len=CL) :: stream_meshfile_lightng ! lightning stream filename to read
+ character(len=CL) :: lightng_tintalgo ! stream -> model time interpolation alogrithm
+ character(len=CL) :: lightngmapalgo ! stream-> model mapping alogrithm
+ integer :: rc
+ character(*), parameter :: subName = "('lnfmdyn_init')"
+ !-----------------------------------------------------------------------
+
+ namelist /light_streams/ &
+ stream_year_first_lightng, &
+ stream_year_last_lightng, &
+ model_year_align_lightng, &
+ lightngmapalgo, &
+ stream_fldFileName_lightng, &
+ stream_meshfile_lightng, &
+ lightng_tintalgo
+
+ ! Default values for namelist
+ stream_year_first_lightng = 1 ! first year in stream to use
+ stream_year_last_lightng = 1 ! last year in stream to use
+ model_year_align_lightng = 1 ! align stream_year_first_lnfm with this model year
+ stream_fldFileName_lightng = ' '
+ stream_meshfile_lightng = ' '
+ lightng_tintalgo = 'linear'
+ lightngmapalgo = 'bilinear'
+
+ ! Read light_streams namelist
+ if (masterproc) then
+ open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error )
+ call find_nlgroup_name(nu_nml, 'light_streams', status=nml_error)
+ if (nml_error == 0) then
+ read(nu_nml, nml=light_streams,iostat=nml_error)
+ if (nml_error /= 0) then
+ call endrun(msg='ERROR reading light_streams namelist'//errMsg(sourcefile, __LINE__))
+ end if
+ end if
+ close(nu_nml)
+ endif
+
+ call shr_mpi_bcast(stream_year_first_lightng , mpicom)
+ call shr_mpi_bcast(stream_year_last_lightng , mpicom)
+ call shr_mpi_bcast(model_year_align_lightng , mpicom)
+ call shr_mpi_bcast(stream_fldFileName_lightng , mpicom)
+ call shr_mpi_bcast(stream_meshfile_lightng , mpicom)
+ call shr_mpi_bcast(lightng_tintalgo , mpicom)
+
+ if (masterproc) then
+ write(iulog,'(a)') ' '
+ write(iulog,'(a)' ) 'light_stream settings:'
+ write(iulog,'(a,i8)') ' stream_year_first_lightng = ',stream_year_first_lightng
+ write(iulog,'(a,i8)') ' stream_year_last_lightng = ',stream_year_last_lightng
+ write(iulog,'(a,i8)') ' model_year_align_lightng = ',model_year_align_lightng
+ write(iulog,'(a,a)' ) ' stream_fldFileName_lightng = ',trim(stream_fldFileName_lightng)
+ write(iulog,'(a,a)' ) ' stream_meshfile = ',trim(stream_meshfile_lightng)
+ write(iulog,'(a,a)' ) ' stream_varnames = ','lnfm'
+ write(iulog,'(a,a)' ) ' time interp algo = ',trim(lightng_tintalgo)
+ write(iulog,'(a,a)' ) ' mapping interp algo = ',trim(lightngmapalgo)
+ write(iulog,'(a)') ' '
+ endif
+
+ ! Initialize the cdeps data type sdat
+ call shr_strdata_init_from_inline(this%sdat_lnfm, &
+ my_task = iam, &
+ logunit = iulog, &
+ compname = 'LND', &
+ model_clock = model_clock, &
+ model_mesh = mesh, &
+ stream_meshfile = trim(stream_meshfile_lightng), &
+ stream_lev_dimname = 'null', &
+ stream_mapalgo = trim(lightngmapalgo), &
+ stream_filenames = (/trim(stream_fldfilename_lightng)/), &
+ stream_fldlistFile = (/'lnfm'/), &
+ stream_fldListModel = (/'lnfm'/), &
+ stream_yearFirst = stream_year_first_lightng, &
+ stream_yearLast = stream_year_last_lightng, &
+ stream_yearAlign = model_year_align_lightng, &
+ stream_offset = 0, &
+ stream_taxmode = 'cycle', &
+ stream_dtlimit = 1.5_r8, &
+ stream_tintalgo = lightng_tintalgo, &
+ stream_name = 'Lightning frequency data', &
+ rc = rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+
+ ! Add history fields
+ call hist_addfld1d (fname='LNFM', units='counts/km^2/hr', &
+ avgflag='A', long_name='Lightning frequency', &
+ ptr_lnd=this%forc_lnfm, default='inactive')
+
+ end subroutine lnfm_init
+
+ !================================================================
+ subroutine lnfm_interp(this, bounds )
+ !
+ ! !DESCRIPTION:
+ ! Interpolate data stream information for Lightning.
+ !
+ ! !USES:
+ use clm_time_manager , only : get_curr_date
+ use dshr_methods_mod , only : dshr_fldbun_getfldptr
+ use dshr_strdata_mod , only : shr_strdata_advance
+ !
+ ! !ARGUMENTS:
+ class(fire_base_type) :: this
+ type(bounds_type), intent(in) :: bounds
+ !
+ ! !LOCAL VARIABLES:
+ integer :: g, ig
+ integer :: year ! year (0, ...) for nstep+1
+ integer :: mon ! month (1, ..., 12) for nstep+1
+ integer :: day ! day of month (1, ..., 31) for nstep+1
+ integer :: sec ! seconds into current date for nstep+1
+ integer :: mcdate ! Current model date (yyyymmdd)
+ integer :: rc
+ real(r8), pointer :: dataptr1d(:)
+ !-----------------------------------------------------------------------
+
+ ! Advance sdat stream
+ call get_curr_date(year, mon, day, sec)
+ mcdate = year*10000 + mon*100 + day
+ call shr_strdata_advance(this%sdat_lnfm, ymd=mcdate, tod=sec, logunit=iulog, istr='lnfmdyn', rc=rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+
+ ! Get pointer for stream data that is time and spatially interpolate to model time and grid
+ call dshr_fldbun_getFldPtr(this%sdat_lnfm%pstrm(1)%fldbun_model, 'lnfm', fldptr1=dataptr1d, rc=rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+
+ ig = 0
+ do g = bounds%begg,bounds%endg
+ ig = ig+1
+ this%forc_lnfm(g) = dataptr1d(ig)
+ end do
+
+ end subroutine lnfm_interp
+
+end module FireDataBaseType
diff --git a/src/cpl/nuopc/SoilMoistureStreamMod.F90 b/src/cpl/share_esmf/SoilMoistureStreamMod.F90
similarity index 93%
rename from src/cpl/nuopc/SoilMoistureStreamMod.F90
rename to src/cpl/share_esmf/SoilMoistureStreamMod.F90
index 3c6b23a0aa..7972a85b9e 100644
--- a/src/cpl/nuopc/SoilMoistureStreamMod.F90
+++ b/src/cpl/share_esmf/SoilMoistureStreamMod.F90
@@ -1,15 +1,5 @@
module SoilMoistureStreamMod
- ! **********************************************************************
- ! --------------------------- IMPORTANT NOTE ---------------------------
- !
- ! This file is here temporarily in order to exercise the CDEPS stream code for this 3-d
- ! stream. In cases using the NUOPC driver/mediator, this version is used instead of the
- ! version in src/biogeophys. Changes to the science here should also be made in the
- ! similar file in src/biogeophys. Once we start using CDEPS by default, we can remove
- ! the version in src/biogeophys and move this version into there.
- ! **********************************************************************
-
#include "shr_assert.h"
!-----------------------------------------------------------------------
@@ -64,15 +54,11 @@ module SoilMoistureStreamMod
__FILE__
character(*), parameter :: u_FILE_u = &
__FILE__
- !-----------------------------------------------------------------------
+!==============================================================================
contains
+!==============================================================================
- !-----------------------------------------------------------------------
- !
- ! soil_moisture_init
- !
- !-----------------------------------------------------------------------
subroutine PrescribedSoilMoistureInit(bounds)
!
! Initialize data stream information for soil moisture.
@@ -193,11 +179,7 @@ subroutine PrescribedSoilMoistureInit(bounds)
end subroutine PrescribedSoilMoistureInit
- !-----------------------------------------------------------------------
- !
- ! PrescribedSoilMoistureAdvance
- !
- !-----------------------------------------------------------------------
+ !==============================================================================
subroutine PrescribedSoilMoistureAdvance( bounds )
!
! Advanace the prescribed soil moisture stream
@@ -247,11 +229,7 @@ subroutine PrescribedSoilMoistureAdvance( bounds )
end subroutine PrescribedSoilMoistureAdvance
- !-----------------------------------------------------------------------
- !
- ! PrescribedSoilMoistureInterp
- !
- !-----------------------------------------------------------------------
+ !==============================================================================
subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, waterstatebulk_inst)
!
! Assign data stream information for prescribed soil moisture.
diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90
new file mode 100644
index 0000000000..68ba3655cd
--- /dev/null
+++ b/src/cpl/share_esmf/UrbanTimeVarType.F90
@@ -0,0 +1,298 @@
+module UrbanTimeVarType
+
+ !------------------------------------------------------------------------------
+ ! !DESCRIPTION:
+ ! Urban Time Varying Data
+ !
+ ! !USES:
+ use ESMF
+ use dshr_strdata_mod, only : shr_strdata_type
+ use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL
+ use shr_log_mod , only : errMsg => shr_log_errMsg
+ use abortutils , only : endrun
+ use decompMod , only : bounds_type
+ use clm_varctl , only : iulog
+ use landunit_varcon , only : isturb_MIN, isturb_MAX
+ use clm_varcon , only : spval
+ use LandunitType , only : lun
+ use GridcellType , only : grc
+ !
+ implicit none
+ private
+ !
+ ! !PUBLIC TYPE
+ type, public :: urbantv_type
+ !
+ real(r8), public, pointer :: t_building_max(:) ! lun maximum internal building air temperature (K)
+ type(shr_strdata_type) :: sdat_urbantv ! urban time varying input data stream
+ contains
+ ! !PUBLIC MEMBER FUNCTIONS:
+ procedure, public :: Init ! Allocate and initialize urbantv
+ procedure, public :: urbantv_init ! Initialize urban time varying stream
+ procedure, public :: urbantv_interp ! Interpolate urban time varying stream
+ end type urbantv_type
+
+ character(15), private :: stream_varnames(isturb_MIN:isturb_MAX)
+
+ character(len=*), parameter, private :: sourcefile = &
+ __FILE__
+
+!==============================================================================
+contains
+!==============================================================================
+
+ subroutine Init(this, bounds, NLFilename)
+ !
+ ! Allocate module variables and data structures
+ !
+ ! !USES:
+ use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=)
+ use histFileMod , only : hist_addfld1d
+ !
+ ! !ARGUMENTS:
+ class(urbantv_type) :: this
+ type(bounds_type) , intent(in) :: bounds
+ character(len=*) , intent(in) :: NLFilename ! Namelist filename
+ !
+ ! !LOCAL VARIABLES:
+ integer :: begl, endl
+ !---------------------------------------------------------------------
+
+ begl = bounds%begl; endl = bounds%endl
+
+ ! Allocate urbantv data structure
+
+ allocate(this%t_building_max(begl:endl)); this%t_building_max(:) = nan
+
+ call this%urbantv_init(bounds, NLFilename)
+ call this%urbantv_interp(bounds)
+
+ ! Add history fields
+ call hist_addfld1d (fname='TBUILD_MAX', units='K', &
+ avgflag='A', long_name='prescribed maximum interior building temperature', &
+ ptr_lunit=this%t_building_max, default='inactive', set_nourb=spval, &
+ l2g_scale_type='unity')
+
+ end subroutine Init
+
+ !==============================================================================
+ subroutine urbantv_init(this, bounds, NLFilename)
+ !
+ ! !DESCRIPTION:
+ ! Initialize data stream information for urban time varying data
+ !
+ ! !USES:
+ use clm_nlUtilsMod , only : find_nlgroup_name
+ use spmdMod , only : masterproc, mpicom, iam
+ use shr_mpi_mod , only : shr_mpi_bcast
+ use landunit_varcon , only : isturb_tbd, isturb_hd, isturb_md
+ use dshr_strdata_mod , only : shr_strdata_init_from_inline
+ use lnd_comp_shr , only : mesh, model_clock
+ !
+ ! !ARGUMENTS:
+ implicit none
+ class(urbantv_type) :: this
+ type(bounds_type), intent(in) :: bounds
+ character(len=*), intent(in) :: NLFilename ! Namelist filename
+ !
+ ! !LOCAL VARIABLES:
+ integer :: n
+ integer :: stream_year_first_urbantv ! first year in urban tv stream to use
+ integer :: stream_year_last_urbantv ! last year in urban tv stream to use
+ integer :: model_year_align_urbantv ! align stream_year_first_urbantv with this model year
+ integer :: nu_nml ! unit for namelist file
+ integer :: nml_error ! namelist i/o error flag
+ character(len=CL) :: stream_fldFileName_urbantv ! urban tv streams filename
+ character(len=CL) :: stream_meshfile_urbantv ! urban tv streams filename
+ character(len=CL) :: urbantvmapalgo = 'nn' ! mapping alogrithm for urban ac
+ character(len=CL) :: urbantv_tintalgo = 'linear' ! time interpolation alogrithm
+ integer :: rc ! error code
+ character(*), parameter :: urbantvString = "tbuildmax_" ! base string for field string
+ character(*), parameter :: subName = "('urbantv_init')"
+ !-----------------------------------------------------------------------
+
+ namelist /urbantv_streams/ &
+ stream_year_first_urbantv, &
+ stream_year_last_urbantv, &
+ model_year_align_urbantv, &
+ urbantvmapalgo, &
+ stream_fldFileName_urbantv, &
+ stream_meshfile_urbantv, &
+ urbantv_tintalgo
+
+ ! Default values for namelist
+ stream_year_first_urbantv = 1 ! first year in stream to use
+ stream_year_last_urbantv = 1 ! last year in stream to use
+ model_year_align_urbantv = 1 ! align stream_year_first_urbantv with this model year
+ stream_fldFileName_urbantv = ' '
+ stream_meshfile_urbantv = ' '
+ stream_varnames(isturb_tbd) = urbantvString//"TBD"
+ stream_varnames(isturb_hd) = urbantvString//"HD"
+ stream_varnames(isturb_md) = urbantvString//"MD"
+
+ ! Read urbantv_streams namelist
+ if (masterproc) then
+ open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error )
+ call find_nlgroup_name(nu_nml, 'urbantv_streams', status=nml_error)
+ if (nml_error == 0) then
+ read(nu_nml, nml=urbantv_streams,iostat=nml_error)
+ if (nml_error /= 0) then
+ call endrun(msg='ERROR reading urbantv_streams namelist'//errMsg(sourcefile, __LINE__))
+ end if
+ end if
+ close(nu_nml)
+ endif
+
+ call shr_mpi_bcast(stream_year_first_urbantv , mpicom)
+ call shr_mpi_bcast(stream_year_last_urbantv , mpicom)
+ call shr_mpi_bcast(model_year_align_urbantv , mpicom)
+ call shr_mpi_bcast(stream_fldFileName_urbantv , mpicom)
+ call shr_mpi_bcast(stream_meshfile_urbantv , mpicom)
+ call shr_mpi_bcast(urbantv_tintalgo , mpicom)
+
+ if (masterproc) then
+ write(iulog,*) ' '
+ write(iulog,'(a)') 'urbantv_streams settings:'
+ write(iulog,'(a,i8)') ' stream_year_first_urbantv = ',stream_year_first_urbantv
+ write(iulog,'(a,i8)') ' stream_year_last_urbantv = ',stream_year_last_urbantv
+ write(iulog,'(a,i8)') ' model_year_align_urbantv = ',model_year_align_urbantv
+ write(iulog,'(a,a)' ) ' stream_fldFileName_urbantv = ',stream_fldFileName_urbantv
+ write(iulog,'(a,a)' ) ' stream_meshfile_urbantv = ',stream_meshfile_urbantv
+ write(iulog,'(a,a)' ) ' urbantv_tintalgo = ',urbantv_tintalgo
+ do n = isturb_tbd,isturb_md
+ write(iulog,'(a,a)' ) ' stream_varname = ',trim(stream_varnames(n))
+ end do
+ write(iulog,*) ' '
+ endif
+
+ ! Initialize the cdeps data type this%sdat_urbantv
+ call shr_strdata_init_from_inline(this%sdat_urbantv, &
+ my_task = iam, &
+ logunit = iulog, &
+ compname = 'LND', &
+ model_clock = model_clock, &
+ model_mesh = mesh, &
+ stream_meshfile = trim(stream_meshfile_urbantv), &
+ stream_lev_dimname = 'null', &
+ stream_mapalgo = trim(urbantvmapalgo), &
+ stream_filenames = (/trim(stream_fldfilename_urbantv)/), &
+ stream_fldlistFile = stream_varnames(isturb_tbd:isturb_md),&
+ stream_fldListModel = stream_varnames(isturb_tbd:isturb_md),&
+ stream_yearFirst = stream_year_first_urbantv, &
+ stream_yearLast = stream_year_last_urbantv, &
+ stream_yearAlign = model_year_align_urbantv, &
+ stream_offset = 0, &
+ stream_taxmode = 'extend', &
+ stream_dtlimit = 1.0e30_r8, &
+ stream_tintalgo = urbantv_tintalgo, &
+ stream_name = 'Urban time varying data', &
+ rc = rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+
+ end subroutine urbantv_init
+
+ !==============================================================================
+ subroutine urbantv_interp(this, bounds)
+ !
+ ! !DESCRIPTION:
+ ! Interpolate data stream information for urban time varying data.
+ !
+ ! !USES:
+ use clm_time_manager , only : get_curr_date
+ use clm_instur , only : urban_valid
+ use dshr_methods_mod , only : dshr_fldbun_getfldptr
+ use dshr_strdata_mod , only : shr_strdata_advance
+ !
+ ! !ARGUMENTS:
+ class(urbantv_type) :: this
+ type(bounds_type), intent(in) :: bounds
+ !
+ ! !LOCAL VARIABLES:
+ logical :: found
+ integer :: l, ig, g, ip, n
+ integer :: year ! year (0, ...) for nstep+1
+ integer :: mon ! month (1, ..., 12) for nstep+1
+ integer :: day ! day of month (1, ..., 31) for nstep+1
+ integer :: sec ! seconds into current date for nstep+1
+ integer :: mcdate ! Current model date (yyyymmdd)
+ integer :: lindx ! landunit index
+ integer :: gindx ! gridcell index
+ integer :: lsize
+ integer :: rc
+ real(r8), pointer :: dataptr1d(:)
+ real(r8), pointer :: dataptr2d(:,:)
+ !-----------------------------------------------------------------------
+
+ ! Advance sdat stream
+ call get_curr_date(year, mon, day, sec)
+ mcdate = year*10000 + mon*100 + day
+ call shr_strdata_advance(this%sdat_urbantv, ymd=mcdate, tod=sec, logunit=iulog, istr='hdmdyn', rc=rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+
+ ! Create 2d array for all stream variable data
+ lsize = bounds%endg - bounds%begg + 1
+ allocate(dataptr2d(lsize, isturb_MIN:isturb_MAX))
+ do n = isturb_MIN,isturb_MAX
+ call dshr_fldbun_getFldPtr(this%sdat_urbantv%pstrm(1)%fldbun_model, trim(stream_varnames(n)), &
+ fldptr1=dataptr1d, rc=rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+ ! Note that the size of dataptr1d includes ocean points so it will be around 3x larger than lsize
+ ! So an explicit loop is required here
+ do g = 1,lsize
+ dataptr2d(g,n) = dataptr1d(g)
+ end do
+ end do
+
+ ! Determine this%tbuilding_max for all landunits
+ do l = bounds%begl,bounds%endl
+ if (lun%urbpoi(l)) then
+ ig = 0
+ do g = bounds%begg,bounds%endg
+ ig = ig+1
+ if (g == lun%gridcell(l)) exit
+ end do
+ do n = isturb_MIN,isturb_MAX
+ if (stream_varnames(lun%itype(l)) == stream_varnames(n)) then
+ this%t_building_max(l) = dataptr2d(ig,n)
+ end if
+ end do
+ else
+ this%t_building_max(l) = spval
+ end if
+ end do
+ deallocate(dataptr2d)
+
+ ! Error check
+ found = .false.
+ do l = bounds%begl,bounds%endl
+ if (lun%urbpoi(l)) then
+ ig = 0
+ do g = bounds%begg,bounds%endg
+ ig = ig+1
+ if (g == lun%gridcell(l)) exit
+ end do
+ if ( .not. urban_valid(g) .or. (this%t_building_max(l) <= 0._r8)) then
+ found = .true.
+ gindx = g
+ lindx = l
+ exit
+ end if
+ end if
+ end do
+ if ( found ) then
+ write(iulog,*)'ERROR: no valid urban data for g= ',gindx
+ write(iulog,*)'landunit type: ',lun%itype(l)
+ write(iulog,*)'urban_valid: ',urban_valid(gindx)
+ write(iulog,*)'t_building_max: ',this%t_building_max(lindx)
+ call endrun(msg=errmsg(sourcefile, __LINE__))
+ end if
+
+ end subroutine urbantv_interp
+
+end module UrbanTimeVarType
diff --git a/src/cpl/share_esmf/ch4FInundatedStreamType.F90 b/src/cpl/share_esmf/ch4FInundatedStreamType.F90
new file mode 100644
index 0000000000..0d78bd6469
--- /dev/null
+++ b/src/cpl/share_esmf/ch4FInundatedStreamType.F90
@@ -0,0 +1,385 @@
+module ch4FInundatedStreamType
+
+#include "shr_assert.h"
+
+ !-----------------------------------------------------------------------
+ ! !DESCRIPTION:
+ ! Contains methods for reading in finundated streams file for methane code.
+ !
+ ! !USES
+ use ESMF
+ use dshr_strdata_mod , only : shr_strdata_type
+ use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_cl
+ use shr_log_mod , only : errMsg => shr_log_errMsg
+ use spmdMod , only : mpicom, masterproc
+ use clm_varctl , only : iulog
+ use abortutils , only : endrun
+ use decompMod , only : bounds_type
+ use ch4varcon , only : finundation_mtd
+
+ ! !PUBLIC TYPES:
+ implicit none
+ private
+
+ type, public :: ch4finundatedstream_type
+ real(r8), pointer, private :: zwt0_gdc (:) ! col coefficient for determining finundated (m)
+ real(r8), pointer, private :: f0_gdc (:) ! col maximum inundated fraction for a gridcell (for methane code)
+ real(r8), pointer, private :: p3_gdc (:) ! col coefficient for determining finundated (m)
+ real(r8), pointer, private :: fws_slope_gdc (:) ! col slope in fws = slope * tws + intercept (A coefficient)
+ real(r8), pointer, private :: fws_intercept_gdc (:) ! col slope in fws = slope * tws + intercept (B coefficient)
+ contains
+
+ ! !PUBLIC MEMBER FUNCTIONS:
+ procedure, public :: Init ! Initialize and read data in
+ procedure, public :: CalcFinundated ! Calculate finundated based on input streams
+ procedure, public :: UseStreams ! If streams will be used
+
+ ! !PRIVATE MEMBER FUNCTIONS:
+ procedure, private :: InitAllocate ! Allocate data
+
+ end type ch4finundatedstream_type
+
+ ! ! PRIVATE DATA:
+ type, private :: streamcontrol_type
+ character(len=CL) :: stream_fldFileName_ch4finundated ! data Filename
+ character(len=CL) :: stream_meshfile_ch4finundated ! mesh Filename
+ character(len=CL) :: ch4finundatedmapalgo ! map algo
+ contains
+ procedure, private :: ReadNML ! Read in namelist
+ end type streamcontrol_type
+
+ type(streamcontrol_type), private :: control ! Stream control data
+
+ character(len=*), parameter, private :: sourcefile = &
+ __FILE__
+
+!==============================================================================
+contains
+!==============================================================================
+
+ subroutine Init(this, bounds, NLFilename)
+ !
+ ! Initialize the ch4 finundated stream object
+ !
+ ! Uses:
+ use spmdMod , only : iam
+ use ch4varcon , only : finundation_mtd_h2osfc
+ use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion
+ use lnd_comp_shr , only : mesh, model_clock
+ use dshr_strdata_mod , only : shr_strdata_init_from_inline, shr_strdata_print
+ use dshr_strdata_mod , only : shr_strdata_advance
+ use dshr_methods_mod , only : dshr_fldbun_getfldptr
+ !
+ ! arguments
+ implicit none
+ class(ch4finundatedstream_type) :: this
+ type(bounds_type), intent(in) :: bounds
+ character(len=*), intent(in) :: NLFilename ! Namelist filename
+ !
+ ! local variables
+ integer :: ig, g, n ! Indices
+ integer :: year ! year (0, ...) for nstep+1
+ integer :: mon ! month (1, ..., 12) for nstep+1
+ integer :: day ! day of month (1, ..., 31) for nstep+1
+ integer :: sec ! seconds into current date for nstep+1
+ integer :: mcdate ! Current model date (yyyymmdd)
+ type(shr_strdata_type) :: sdat_ch4 ! input data stream
+ character(len=16), allocatable :: stream_varnames(:) ! array of stream field names
+ integer :: rc ! error code
+ real(r8), pointer :: dataptr1d(:) ! temporary pointer
+ character(len=*), parameter :: stream_name = 'ch4finundated'
+ !-----------------------------------------------------------------------
+
+ if ( finundation_mtd /= finundation_mtd_h2osfc )then
+ call this%InitAllocate( bounds )
+ call control%ReadNML( bounds, NLFileName )
+
+ if ( this%useStreams() )then
+
+ if (finundation_mtd == finundation_mtd_ZWT_inversion )then
+ allocate(stream_varnames(3))
+ stream_varnames = (/"ZWT0","F0 ","P3 "/)
+ else if ( finundation_mtd == finundation_mtd_TWS_inversion )then
+ allocate(stream_varnames(2))
+ stream_varnames = (/"FWS_TWS_A","FWS_TWS_B"/)
+ else
+ call endrun(msg=' ERROR do NOT know what list of variables to read for this finundation_mtd type'// &
+ errMsg(sourcefile, __LINE__))
+ end if
+
+ if (masterproc) then
+ write(iulog,*) ' stream_varnames = ',stream_varnames
+ end if
+
+ ! Initialize the cdeps data type sdat_ndep
+ call shr_strdata_init_from_inline(sdat_ch4, &
+ my_task = iam, &
+ logunit = iulog, &
+ compname = 'LND', &
+ model_clock = model_clock, &
+ model_mesh = mesh, &
+ stream_meshfile = control%stream_meshfile_ch4finundated, &
+ stream_lev_dimname = 'null', &
+ stream_mapalgo = control%ch4finundatedmapalgo, &
+ stream_filenames = (/trim(control%stream_fldFileName_ch4finundated)/), &
+ stream_fldlistFile = stream_varnames, &
+ stream_fldListModel = stream_varnames, &
+ stream_yearFirst = 1996, &
+ stream_yearLast = 1996, &
+ stream_yearAlign = 1, &
+ stream_offset = 0, &
+ stream_taxmode = 'extend', &
+ stream_dtlimit = 1.0e30_r8, &
+ stream_tintalgo = 'linear', &
+ stream_name = 'ch4 finundation ', &
+ rc = rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+
+ ! Explicitly set current date to a hardcoded constant value. Otherwise
+ ! using the real date can cause roundoff differences that are
+ ! detrected as issues with exact restart. EBK M05/20/2017
+ ! call get_curr_date(year, mon, day, sec)
+ year = 1996
+ mon = 12
+ day = 31
+ sec = 0
+ mcdate = year*10000 + mon*100 + day
+
+ call shr_strdata_advance(sdat_ch4, ymd=mcdate, tod=sec, logunit=iulog, istr='ch4', rc=rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+
+ ! Get pointer for stream data that is time and spatially interpolate to model time and grid
+ do n = 1,size(stream_varnames)
+ call dshr_fldbun_getFldPtr(sdat_ch4%pstrm(1)%fldbun_model, stream_varnames(n), fldptr1=dataptr1d, rc=rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+ if (trim(stream_varnames(n)) == 'ZWT0') then
+ ig = 0
+ do g = bounds%begg,bounds%endg
+ ig = ig+1
+ this%zwt0_gdc(g) = dataptr1d(ig)
+ end do
+ else if (trim(stream_varnames(n)) == 'F0') then
+ ig = 0
+ do g = bounds%begg,bounds%endg
+ ig = ig+1
+ this%f0_gdc(g) = dataptr1d(ig)
+ end do
+ else if (trim(stream_varnames(n)) == 'P3') then
+ ig = 0
+ do g = bounds%begg,bounds%endg
+ ig = ig+1
+ this%p3_gdc(g) = dataptr1d(ig)
+ end do
+ else if (trim(stream_varnames(n)) == 'FWS_TWS_A') then
+ ig = 0
+ do g = bounds%begg,bounds%endg
+ ig = ig+1
+ this%fws_slope_gdc(g) = dataptr1d(ig)
+ end do
+ else if (trim(stream_varnames(n)) == 'FWS_TWS_B') then
+ ig = 0
+ do g = bounds%begg,bounds%endg
+ ig = ig+1
+ this%fws_intercept_gdc(g) = dataptr1d(ig)
+ end do
+ end if
+ end do
+ end if
+ end if
+
+ end subroutine Init
+
+ !==============================================================================
+ logical function UseStreams(this)
+ !
+ ! !DESCRIPTION:
+ ! Return true if
+ !
+ ! !USES:
+ !
+ ! !ARGUMENTS:
+ implicit none
+ class(ch4finundatedstream_type) :: this
+ !
+ ! !LOCAL VARIABLES:
+ if ( trim(control%stream_fldFileName_ch4finundated) == '' )then
+ UseStreams = .false.
+ else
+ UseStreams = .true.
+ end if
+ end function UseStreams
+
+ !==============================================================================
+ subroutine InitAllocate(this, bounds)
+ !
+ ! !DESCRIPTION:
+ ! Allocate module variables and data structures
+ !
+ ! !USES:
+ use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=)
+ use ch4varcon , only: finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion
+ !
+ ! !ARGUMENTS:
+ implicit none
+ class(ch4finundatedstream_type) :: this
+ type(bounds_type), intent(in) :: bounds
+ !
+ ! !LOCAL VARIABLES:
+ integer :: begc, endc
+ integer :: begg, endg
+ !---------------------------------------------------------------------
+
+ begc = bounds%begc; endc = bounds%endc
+ begg = bounds%begg; endg = bounds%endg
+
+ if( finundation_mtd == finundation_mtd_ZWT_inversion )then
+ allocate(this%zwt0_gdc (begg:endg)) ; this%zwt0_gdc (:) = nan
+ allocate(this%f0_gdc (begg:endg)) ; this%f0_gdc (:) = nan
+ allocate(this%p3_gdc (begg:endg)) ; this%p3_gdc (:) = nan
+ else if( finundation_mtd == finundation_mtd_TWS_inversion )then
+ allocate(this%fws_slope_gdc (begg:endg)) ; this%fws_slope_gdc (:) = nan
+ allocate(this%fws_intercept_gdc(begg:endg)) ; this%fws_intercept_gdc(:) = nan
+ end if
+
+ end subroutine InitAllocate
+
+ !==============================================================================
+ subroutine CalcFinundated(this, bounds, num_soilc, filter_soilc, soilhydrology_inst, &
+ waterdiagnosticbulk_inst, qflx_surf_lag_col, finundated )
+ !
+ ! !DESCRIPTION:
+ ! Calculate finundated according to the appropriate methodology
+ !
+ ! !USES:
+ use ColumnType , only : col
+ use ch4varcon , only : finundation_mtd_h2osfc, finundation_mtd_ZWT_inversion
+ use ch4varcon , only : finundation_mtd_TWS_inversion
+ use clm_varpar , only : nlevsoi
+ use SoilHydrologyType , only : soilhydrology_type
+ use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type
+ !
+ ! !ARGUMENTS:
+ implicit none
+ class(ch4finundatedstream_type) :: this
+ type(bounds_type) , intent(in) :: bounds
+ integer , intent(in) :: num_soilc ! number of column soil points in column filter
+ integer , intent(in) :: filter_soilc(:) ! column filter for soil points
+ type(soilhydrology_type) , intent(in) :: soilhydrology_inst
+ type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst
+ real(r8) , intent(in) :: qflx_surf_lag_col(bounds%begc:) !time-lagged surface runoff (mm H2O /s)
+ real(r8) , intent(inout) :: finundated(bounds%begc:) ! fractional inundated area in soil column (excluding dedicated wetland columns)
+ !
+ ! !LOCAL VARIABLES:
+ integer :: g, c, fc ! Indices
+ real(r8) :: zwt_actual ! Total water storage (ZWT) to use either perched or total depending on conditions
+ !---------------------------------------------------------------------
+
+ SHR_ASSERT_ALL_FL((ubound(qflx_surf_lag_col) == (/bounds%endc/)), sourcefile, __LINE__)
+ SHR_ASSERT_ALL_FL((ubound(finundated) == (/bounds%endc/)), sourcefile, __LINE__)
+
+ associate( &
+ z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi)
+ zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m)
+ zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m)
+ tws => waterdiagnosticbulk_inst%tws_grc , & ! Input: [real(r8) (:) ] total water storage (kg m-2)
+ frac_h2osfc => waterdiagnosticbulk_inst%frac_h2osfc_col & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1)
+ )
+
+ ! Calculate finundated
+ do fc = 1, num_soilc
+ c = filter_soilc(fc)
+ g = col%gridcell(c)
+ select case( finundation_mtd )
+ case ( finundation_mtd_h2osfc )
+ finundated(c) = frac_h2osfc(c)
+ case ( finundation_mtd_ZWT_inversion )
+ if (this%zwt0_gdc(g) > 0._r8) then
+ if (zwt_perched(c) < z(c,nlevsoi)-1.e-5_r8 .and. zwt_perched(c) < zwt(c)) then
+ zwt_actual = zwt_perched(c)
+ else
+ zwt_actual = zwt(c)
+ end if
+ finundated(c) = this%f0_gdc(g) * exp(-zwt_actual/this%zwt0_gdc(g)) + this%p3_gdc(g)*qflx_surf_lag_col(c)
+ else
+ finundated(c) = this%p3_gdc(g)*qflx_surf_lag_col(c)
+ end if
+ case ( finundation_mtd_TWS_inversion )
+ finundated(c) = this%fws_slope_gdc(g) * tws(g) + this%fws_intercept_gdc(g)
+ end select
+ finundated(c) = min( 1.0_r8, max( 0.0_r8, finundated(c) ) )
+ end do
+ end associate
+
+ end subroutine CalcFinundated
+
+ !==============================================================================
+ subroutine ReadNML(this, bounds, NLFilename)
+ !
+ ! Read the namelist data stream information.
+ !
+ ! Uses:
+ use shr_nl_mod , only : shr_nl_find_group_name
+ use shr_log_mod , only : errMsg => shr_log_errMsg
+ use shr_mpi_mod , only : shr_mpi_bcast
+ use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion
+ !
+ ! arguments
+ implicit none
+ class(streamcontrol_type) :: this
+ type(bounds_type), intent(in) :: bounds
+ character(len=*), intent(in) :: NLFilename ! Namelist filename
+ !
+ ! local variables
+ integer :: nu_nml ! unit for namelist file
+ integer :: nml_error ! namelist i/o error flag
+ character(len=CL) :: stream_fldFileName_ch4finundated = ' '
+ character(len=CL) :: stream_meshfile_ch4finundated = ' '
+ character(len=CL) :: ch4finundatedmapalgo = 'bilinear'
+ character(len=*), parameter :: namelist_name = 'ch4finundated' ! MUST agree with name in namelist and read
+ character(len=*), parameter :: subName = "('ch4finundated::ReadNML')"
+ !-----------------------------------------------------------------------
+
+ namelist /ch4finundated/ & ! MUST agree with namelist_name above
+ ch4finundatedmapalgo, stream_fldFileName_ch4finundated, stream_meshfile_ch4finundated
+
+ ! Default values for namelist
+
+ ! Read ch4finundated namelist
+ if (masterproc) then
+ open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error )
+ call shr_nl_find_group_name(nu_nml, namelist_name, status=nml_error)
+ if (nml_error == 0) then
+ read(nu_nml, nml=ch4finundated,iostat=nml_error) ! MUST agree with namelist_name above
+ if (nml_error /= 0) then
+ call endrun(msg=' ERROR reading '//namelist_name//' namelist'//errMsg(sourcefile, __LINE__))
+ end if
+ else
+ call endrun(msg=' ERROR finding '//namelist_name//' namelist'//errMsg(sourcefile, __LINE__))
+ end if
+ close(nu_nml)
+ endif
+
+ call shr_mpi_bcast(ch4finundatedmapalgo , mpicom)
+ call shr_mpi_bcast(stream_fldFileName_ch4finundated , mpicom)
+ call shr_mpi_bcast(stream_meshfile_ch4finundated , mpicom)
+
+ if (masterproc) then
+ write(iulog,*) ' '
+ write(iulog,*) namelist_name, ' stream settings:'
+ write(iulog,*) ' stream_fldFileName_ch4finundated = ',stream_fldFileName_ch4finundated
+ write(iulog,*) ' stream_meshfile_ch4finundated = ',stream_meshfile_ch4finundated
+ write(iulog,*) ' ch4finundatedmapalgo = ',ch4finundatedmapalgo
+ endif
+ this%stream_fldFileName_ch4finundated = stream_fldFileName_ch4finundated
+ this%stream_meshfile_ch4finundated = stream_meshfile_ch4finundated
+ this%ch4finundatedmapalgo = ch4finundatedmapalgo
+
+ end subroutine ReadNML
+
+end module ch4FInundatedStreamType
diff --git a/src/cpl/share_esmf/laiStreamMod.F90 b/src/cpl/share_esmf/laiStreamMod.F90
new file mode 100644
index 0000000000..a44f0b7198
--- /dev/null
+++ b/src/cpl/share_esmf/laiStreamMod.F90
@@ -0,0 +1,256 @@
+module laiStreamMod
+
+#include "shr_assert.h"
+
+ !-----------------------------------------------------------------------
+ ! !DESCRIPTION:
+ ! Read LAI from stream
+ !
+ ! !USES:
+ use ESMF
+ use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL, CS => shr_kind_CS
+ use dshr_strdata_mod , only : shr_strdata_type
+ use decompMod , only : bounds_type
+ use abortutils , only : endrun
+ use clm_varctl , only : iulog
+ use perf_mod , only : t_startf, t_stopf
+ use spmdMod , only : masterproc, mpicom, iam
+ !
+ ! !PUBLIC TYPES:
+ implicit none
+ private
+
+ ! !PUBLIC MEMBER FUNCTIONS:
+ public :: lai_init ! position datasets for LAI
+ public :: lai_advance ! Advance the LAI streams (outside of a Open-MP threading loop)
+ public :: lai_interp ! interpolates between two years of LAI data (when LAI streams
+
+ ! !PRIVATE MEMBER DATA:
+ integer, allocatable :: g_to_ig(:) ! Array matching gridcell index to data index
+ type(shr_strdata_type) :: sdat_lai ! LAI input data stream
+ character(*), parameter :: laiString = "LAI_" ! base string for field string
+ integer , parameter :: numLaiFields = 16 ! number of fields to build field string
+ character(len=CS) :: stream_varnames(numLaiFields)
+
+ character(len=*), parameter :: sourcefile = &
+ __FILE__
+
+!==============================================================================
+contains
+!==============================================================================
+
+ subroutine lai_init(bounds)
+ !
+ ! Initialize data stream information for LAI.
+ !
+ ! !USES:
+ use shr_mpi_mod , only : shr_mpi_bcast
+ use clm_nlUtilsMod , only : find_nlgroup_name
+ use lnd_comp_shr , only : mesh, model_clock
+ use dshr_strdata_mod , only : shr_strdata_init_from_inline
+ use controlMod , only : NLFilename
+ !
+ ! !ARGUMENTS:
+ type(bounds_type), intent(in) :: bounds ! bounds
+ !
+ ! !LOCAL VARIABLES:
+ integer :: i,n ! index
+ integer :: stream_year_first_lai ! first year in Lai stream to use
+ integer :: stream_year_last_lai ! last year in Lai stream to use
+ integer :: model_year_align_lai ! align stream_year_first_lai with
+ integer :: nu_nml ! unit for namelist file
+ integer :: nml_error ! namelist i/o error flag
+ character(len=CL) :: stream_fldFileName_lai ! lai stream filename to read
+ character(len=CL) :: stream_meshfile_lai ! lai stream meshfile
+ character(len=CL) :: lai_mapalgo = 'bilinear' ! Mapping alogrithm
+ character(len=CL) :: lai_tintalgo = 'linear' ! Time interpolation alogrithm
+ integer :: lai_offset = 0 ! Offset in time for dataset (sec)
+ integer :: rc
+ character(*), parameter :: subName = "('laidyn_init')"
+ !-----------------------------------------------------------------------
+ !
+ ! deal with namelist variables here in init
+ !
+ namelist /lai_streams/ &
+ stream_year_first_lai, &
+ stream_year_last_lai, &
+ model_year_align_lai, &
+ lai_mapalgo, &
+ stream_fldFileName_lai, &
+ stream_meshfile_lai, &
+ lai_tintalgo
+
+ ! Default values for namelist
+ stream_year_first_lai = 1 ! first year in stream to use
+ stream_year_last_lai = 1 ! last year in stream to use
+ model_year_align_lai = 1 ! align stream_year_first_lai with this model year
+ stream_fldFileName_lai = ''
+ stream_meshfile_lai = ''
+ do n = 1,numLaiFields
+ write(stream_varnames(n),'(a,i0)') laiString,n
+ end do
+
+ ! Read lai_streams namelist
+ if (masterproc) then
+ open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error )
+ call find_nlgroup_name(nu_nml, 'lai_streams', status=nml_error)
+ if (nml_error == 0) then
+ read(nu_nml, nml=lai_streams,iostat=nml_error)
+ if (nml_error /= 0) then
+ call endrun(subname // ':: ERROR reading lai_streams namelist')
+ end if
+ else
+ call endrun(subname // ':: ERROR finding lai_streams namelist')
+ end if
+ close(nu_nml)
+ endif
+ call shr_mpi_bcast(stream_year_first_lai , mpicom)
+ call shr_mpi_bcast(stream_year_last_lai , mpicom)
+ call shr_mpi_bcast(model_year_align_lai , mpicom)
+ call shr_mpi_bcast(stream_fldFileName_lai , mpicom)
+ call shr_mpi_bcast(stream_meshfile_lai , mpicom)
+ call shr_mpi_bcast(lai_tintalgo , mpicom)
+
+ if (masterproc) then
+ write(iulog,*)
+ write(iulog,'(a)') 'lai_stream settings:'
+ write(iulog,'(a,i8)') ' stream_year_first_lai = ',stream_year_first_lai
+ write(iulog,'(a,i8)') ' stream_year_last_lai = ',stream_year_last_lai
+ write(iulog,'(a,i8)') ' model_year_align_lai = ',model_year_align_lai
+ write(iulog,'(a,a)' ) ' stream_fldFileName_lai = ',trim(stream_fldFileName_lai)
+ write(iulog,'(a,a)' ) ' stream_meshfile_lai = ',trim(stream_meshfile_lai)
+ write(iulog,'(a,a)' ) ' lai_tintalgo = ',trim(lai_tintalgo)
+ do n = 1,numLaiFields
+ write(iulog,'(a,a)' ) ' stream_varname = ',trim(stream_varnames(n))
+ end do
+ write(iulog,*)
+ endif
+
+ ! Initialize the cdeps data type sdat_lai
+ call shr_strdata_init_from_inline(sdat_lai, &
+ my_task = iam, &
+ logunit = iulog, &
+ compname = 'LND', &
+ model_clock = model_clock, &
+ model_mesh = mesh, &
+ stream_meshfile = trim(stream_meshfile_lai), &
+ stream_lev_dimname = 'null', &
+ stream_mapalgo = trim(lai_mapalgo), &
+ stream_filenames = (/trim(stream_fldfilename_lai)/), &
+ stream_fldlistFile = stream_varnames, &
+ stream_fldListModel = stream_varnames, &
+ stream_yearFirst = stream_year_first_lai, &
+ stream_yearLast = stream_year_last_lai, &
+ stream_yearAlign = model_year_align_lai, &
+ stream_offset = lai_offset, &
+ stream_taxmode = 'cycle', &
+ stream_dtlimit = 1.5_r8, &
+ stream_tintalgo = lai_tintalgo, &
+ stream_name = 'LAI data', &
+ rc = rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+
+ end subroutine lai_init
+
+ !================================================================
+ subroutine lai_advance( bounds )
+ !
+ ! Advance LAI streams
+ !
+ ! !USES:
+ use clm_time_manager , only : get_curr_date
+ use dshr_strdata_mod , only : shr_strdata_advance
+ !
+ ! !ARGUMENTS:
+ type(bounds_type), intent(in) :: bounds
+ !
+ ! !LOCAL VARIABLES:
+ integer :: g, ig ! Indices
+ integer :: year ! year (0, ...) for nstep+1
+ integer :: mon ! month (1, ..., 12) for nstep+1
+ integer :: day ! day of month (1, ..., 31) for nstep+1
+ integer :: sec ! seconds into current date for nstep+1
+ integer :: mcdate ! Current model date (yyyymmdd)
+ integer :: rc
+ !-----------------------------------------------------------------------
+
+ call get_curr_date(year, mon, day, sec)
+ mcdate = year*10000 + mon*100 + day
+ call shr_strdata_advance(sdat_lai, ymd=mcdate, tod=sec, logunit=iulog, istr='laidyn', rc=rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+
+ if ( .not. allocated(g_to_ig) )then
+ allocate (g_to_ig(bounds%begg:bounds%endg) )
+ ig = 0
+ do g = bounds%begg,bounds%endg
+ ig = ig+1
+ g_to_ig(g) = ig
+ end do
+ end if
+
+ end subroutine lai_advance
+
+ !================================================================
+ subroutine lai_interp(bounds, canopystate_inst)
+ !
+ ! Interpolate data stream information for Lai.
+ !
+ ! !USES:
+ use pftconMod , only : noveg
+ use PatchType , only : patch
+ use CanopyStateType , only : canopystate_type
+ use dshr_methods_mod , only : dshr_fldbun_getfldptr
+ !
+ ! !ARGUMENTS:
+ type(bounds_type) , intent(in) :: bounds
+ type(canopystate_type) , intent(inout) :: canopystate_inst
+ !
+ ! !LOCAL VARIABLES:
+ integer :: ivt, p, ip, ig, n, g
+ integer :: lsize
+ integer :: rc
+ real(r8), pointer :: dataptr1d(:)
+ real(r8), pointer :: dataptr2d(:,:)
+ !-----------------------------------------------------------------------
+
+ SHR_ASSERT_FL( (lbound(g_to_ig,1) <= bounds%begg ), sourcefile, __LINE__)
+ SHR_ASSERT_FL( (ubound(g_to_ig,1) >= bounds%endg ), sourcefile, __LINE__)
+
+ ! Get pointer for stream data that is time and spatially interpolate to model time and grid
+ ! Place all lai data from each type into a temporary 2d array
+ lsize = bounds%endg - bounds%begg + 1
+ allocate(dataptr2d(lsize, numLaiFields))
+ do n = 1,numLaiFields
+ call dshr_fldbun_getFldPtr(sdat_lai%pstrm(1)%fldbun_model, trim(stream_varnames(n)), &
+ fldptr1=dataptr1d, rc=rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+ ! Note that the size of dataptr1d includes ocean points so it will be around 3x larger than lsize
+ ! So an explicit loop is required here
+ do g = 1,lsize
+ dataptr2d(g,n) = dataptr1d(g)
+ end do
+ end do
+
+ do p = bounds%begp, bounds%endp
+ ivt = patch%itype(p)
+ ! Set lai for each gridcell/patch combination
+ if (ivt /= noveg) then
+ ! vegetated pft
+ ig = g_to_ig(patch%gridcell(p))
+ canopystate_inst%tlai_patch(p) = dataptr2d(ig,ivt)
+ else
+ ! non-vegetated pft
+ canopystate_inst%tlai_patch(p) = 0._r8
+ endif
+ end do
+ deallocate(dataptr2d)
+
+ end subroutine lai_interp
+
+end module LaiStreamMod
diff --git a/src/cpl/share_esmf/lnd_set_decomp_and_domain.F90 b/src/cpl/share_esmf/lnd_set_decomp_and_domain.F90
index 55ab210e18..c881282132 100644
--- a/src/cpl/share_esmf/lnd_set_decomp_and_domain.F90
+++ b/src/cpl/share_esmf/lnd_set_decomp_and_domain.F90
@@ -35,9 +35,9 @@ module lnd_set_decomp_and_domain
subroutine lnd_set_decomp_and_domain_from_readmesh(driver, vm, meshfile_lnd, meshfile_mask, mesh_ctsm, &
ni, nj, rc)
- use decompInitMod , only : decompInit_ocn, decompInit_lnd, decompInit_lnd3D
+ use decompInitMod , only : decompInit_lnd
use domainMod , only : ldomain, domain_init
- use decompMod , only : ldecomp, bounds_type, get_proc_bounds
+ use decompMod , only : gindex_global, bounds_type, get_proc_bounds
use clm_varpar , only : nlevsoi
use clm_varctl , only : use_soil_moisture_streams
@@ -116,9 +116,6 @@ subroutine lnd_set_decomp_and_domain_from_readmesh(driver, vm, meshfile_lnd, mes
! Determine lnd decomposition that will be used by ctsm from lndmask_glob
call decompInit_lnd(lni=ni, lnj=nj, amask=lndmask_glob)
- if (use_soil_moisture_streams) then
- call decompInit_lnd3D(lni=ni, lnj=nj, lnk=nlevsoi)
- end if
! Determine ocn decomposition that will be used to create the full mesh
! note that the memory for gindex_ocn will be allocated in the following call
@@ -137,7 +134,7 @@ subroutine lnd_set_decomp_and_domain_from_readmesh(driver, vm, meshfile_lnd, mes
allocate(gindex_lnd(nlnd))
do g = begg, endg
n = 1 + (g - begg)
- gindex_lnd(n) = ldecomp%gdc2glo(g)
+ gindex_lnd(n) = gindex_global(g-begg+1)
end do
! Initialize domain data structure
@@ -227,7 +224,7 @@ end subroutine lnd_set_mesh_for_single_column
!===============================================================================
subroutine lnd_set_decomp_and_domain_for_single_column(scol_lon, scol_lat, scol_mask, scol_frac)
- use decompInitMod , only : decompInit_lnd, decompInit_lnd3D
+ use decompInitMod , only : decompInit_lnd
use decompMod , only : bounds_type, get_proc_bounds
use domainMod , only : ldomain, domain_init
use clm_varctl , only : use_soil_moisture_streams
@@ -244,11 +241,8 @@ subroutine lnd_set_decomp_and_domain_for_single_column(scol_lon, scol_lat, scol_
type(bounds_type) :: bounds ! bounds
!-------------------------------------------------------------------------------
- ! Determine ldecomp and ldomain
+ ! Determine decomp and ldomain
call decompInit_lnd(lni=1, lnj=1, amask=(/1/))
- if (use_soil_moisture_streams) then
- call decompInit_lnd3D(lni=1, lnj=1, lnk=nlevsoi)
- end if
! Initialize processor bounds
call get_proc_bounds(bounds)
@@ -807,5 +801,58 @@ subroutine lnd_set_read_write_landmask(write_file, read_file, lndmask_glob, lndf
end subroutine lnd_set_read_write_landmask
+ !===============================================================================
+ subroutine decompInit_ocn(ni, nj, amask, gindex_ocn)
+
+ ! !DESCRIPTION:
+ ! calculate a decomposition of only ocn points (needed for the nuopc interface)
+
+ ! !USES:
+ use spmdMod , only : npes, iam
+
+ ! !ARGUMENTS:
+ integer , intent(in) :: amask(:)
+ integer , intent(in) :: ni,nj ! domain global size
+ integer , pointer, intent(out) :: gindex_ocn(:) ! this variable is allocated here, and is assumed to start unallocated
+
+ ! !LOCAL VARIABLES:
+ integer :: n,i,j,nocn
+ integer :: nlnd_global
+ integer :: nocn_global
+ integer :: nocn_local
+ integer :: my_ocn_start, my_ocn_end
+ !------------------------------------------------------------------------------
+
+ ! count total land and ocean gridcells
+ nlnd_global = 0
+ nocn_global = 0
+ do n = 1,ni*nj
+ if (amask(n) == 1) then
+ nlnd_global = nlnd_global + 1
+ else
+ nocn_global = nocn_global + 1
+ endif
+ enddo
+
+ ! create the a global index array for ocean points
+ nocn_local = nocn_global / npes
+
+ my_ocn_start = nocn_local*iam + min(iam, mod(nocn_global, npes)) + 1
+ if (iam < mod(nocn_global, npes)) then
+ nocn_local = nocn_local + 1
+ end if
+ my_ocn_end = my_ocn_start + nocn_local - 1
+
+ allocate(gindex_ocn(nocn_local))
+ nocn = 0
+ do n = 1,ni*nj
+ if (amask(n) == 0) then
+ nocn = nocn + 1
+ if (nocn >= my_ocn_start .and. nocn <= my_ocn_end) then
+ gindex_ocn(nocn - my_ocn_start + 1) = n
+ end if
+ end if
+ end do
+ end subroutine decompInit_ocn
end module lnd_set_decomp_and_domain
diff --git a/src/cpl/share_esmf/ndepStreamMod.F90 b/src/cpl/share_esmf/ndepStreamMod.F90
new file mode 100644
index 0000000000..45ea586ba1
--- /dev/null
+++ b/src/cpl/share_esmf/ndepStreamMod.F90
@@ -0,0 +1,270 @@
+module ndepStreamMod
+
+ !-----------------------------------------------------------------------
+ ! !DESCRIPTION:
+ ! Contains methods for reading in nitrogen deposition data file
+ ! Also includes functions for dynamic ndep file handling and
+ ! interpolation.
+ !
+ ! !USES
+ use ESMF
+ use dshr_strdata_mod , only : shr_strdata_type
+ use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_cl, CS => shr_kind_cs
+ use spmdMod , only : mpicom, masterproc, iam
+ use decompMod , only : bounds_type
+ use clm_varctl , only : iulog, inst_name
+ use abortutils , only : endrun
+
+ ! !PUBLIC TYPES:
+ implicit none
+ private
+
+ ! !PUBLIC MEMBER FUNCTIONS:
+ public :: ndep_init ! position datasets for dynamic ndep
+ public :: ndep_interp ! interpolates between two years of ndep file data
+
+ ! !PRIVATE MEMBER FUNCTIONS:
+ private :: check_units ! Check the units and make sure they can be used
+
+ ! ! PRIVATE TYPES
+ type(shr_strdata_type) :: sdat_ndep ! input data stream
+ logical :: divide_by_secs_per_yr = .true. ! divide by the number of seconds per year
+ character(len=CS) :: stream_varnames(1)
+
+ character(len=*), parameter, private :: sourcefile = &
+ __FILE__
+
+!==============================================================================
+contains
+!==============================================================================
+
+ subroutine ndep_init(bounds, NLFilename)
+ !
+ ! Initialize data stream information.
+ !
+ ! Uses:
+ use shr_nl_mod , only : shr_nl_find_group_name
+ use shr_string_mod , only : shr_string_listGetName, shr_string_listGetNum
+ use shr_log_mod , only : errMsg => shr_log_errMsg
+ use shr_mpi_mod , only : shr_mpi_bcast
+ use lnd_comp_shr , only : mesh, model_clock
+ use dshr_strdata_mod , only : shr_strdata_init_from_inline
+ !
+ ! arguments
+ type(bounds_type), intent(in) :: bounds
+ character(len=*), intent(in) :: NLFilename ! Namelist filename
+ !
+ ! local variables
+ integer :: nu_nml ! unit for namelist file
+ integer :: nml_error ! namelist i/o error flag
+ integer :: stream_year_first_ndep ! first year in stream to use
+ integer :: stream_year_last_ndep ! last year in stream to use
+ integer :: model_year_align_ndep ! align stream_year_firstndep with
+ real(r8) :: ndep_dtlimit = 1.0e30_r8
+ character(len=CL) :: ndepmapalgo = 'bilinear'
+ character(len=CL) :: ndep_tintalgo = 'linear'
+ character(len=CS) :: ndep_taxmode = 'extend'
+ character(len=CL) :: ndep_varlist = 'NDEP_year'
+ integer :: ndep_offset = 0 ! Offset in time for dataset (sec)
+ character(len=CL) :: stream_fldFileName_ndep
+ character(len=CL) :: stream_meshfile_ndep
+ integer :: stream_nflds
+ integer :: rc
+ character(*), parameter :: subName = "('ndepdyn_init')"
+ !-----------------------------------------------------------------------
+
+ namelist /ndepdyn_nml/ &
+ stream_year_first_ndep, &
+ stream_year_last_ndep, &
+ model_year_align_ndep, &
+ ndepmapalgo, &
+ ndep_taxmode, &
+ ndep_varlist, &
+ ndep_tintalgo, &
+ stream_fldFileName_ndep, &
+ stream_meshfile_ndep
+
+ ! Default values for namelist
+ stream_year_first_ndep = 1 ! first year in stream to use
+ stream_year_last_ndep = 1 ! last year in stream to use
+ model_year_align_ndep = 1 ! align stream_year_first_ndep with this model year
+ stream_fldFileName_ndep = ' '
+ stream_meshfile_ndep = ' '
+
+ ! Read ndepdyn_nml namelist
+ if (masterproc) then
+ open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error )
+ call shr_nl_find_group_name(nu_nml, 'ndepdyn_nml', status=nml_error)
+ if (nml_error == 0) then
+ read(nu_nml, nml=ndepdyn_nml,iostat=nml_error)
+ if (nml_error /= 0) then
+ call endrun(msg=' ERROR reading ndepdyn_nml namelist'//errMsg(sourcefile, __LINE__))
+ end if
+ else
+ call endrun(msg=' ERROR finding ndepdyn_nml namelist'//errMsg(sourcefile, __LINE__))
+ end if
+ close(nu_nml)
+ endif
+
+ call shr_mpi_bcast(stream_year_first_ndep , mpicom)
+ call shr_mpi_bcast(stream_year_last_ndep , mpicom)
+ call shr_mpi_bcast(model_year_align_ndep , mpicom)
+ call shr_mpi_bcast(ndep_varlist , mpicom)
+ call shr_mpi_bcast(ndep_taxmode , mpicom)
+ call shr_mpi_bcast(ndep_tintalgo , mpicom)
+ call shr_mpi_bcast(stream_fldFileName_ndep, mpicom)
+ call shr_mpi_bcast(stream_meshfile_ndep , mpicom)
+
+ stream_nflds = shr_string_listGetNum(ndep_varlist) ! Get number of fields in list, fn
+ if (stream_nflds /= 1) then
+ call endrun(msg=' ERROR stream_nflds is not 1 for '//errMsg(sourcefile, __LINE__))
+ end if
+ call shr_string_listGetName(ndep_varlist, 1, stream_varnames(1))
+
+ if (masterproc) then
+ write(iulog,'(a)' ) ' '
+ write(iulog,'(a,i8)') 'ndepdyn stream settings:'
+ write(iulog,'(a,i8)') ' stream_year_first_ndep = ',stream_year_first_ndep
+ write(iulog,'(a,i8)') ' stream_year_last_ndep = ',stream_year_last_ndep
+ write(iulog,'(a,i8)') ' model_year_align_ndep = ',model_year_align_ndep
+ write(iulog,'(a,a)' ) ' stream_fldFileName_ndep = ',trim(stream_fldFileName_ndep)
+ write(iulog,'(a,a)' ) ' stream_meshfile_ndep = ',trim(stream_meshfile_ndep)
+ write(iulog,'(a,a)' ) ' stream_varnames = ',trim(stream_varnames(1))
+ write(iulog,'(a,a)' ) ' ndep_taxmode = ',trim(ndep_taxmode)
+ write(iulog,'(a,a)' ) ' ndep_tintalgo = ',trim(ndep_tintalgo)
+ write(iulog,'(a)' ) ' '
+ endif
+
+ ! Read in units
+ call check_units( stream_fldFileName_ndep )
+
+ ! Initialize the cdeps data type sdat_ndep
+ call shr_strdata_init_from_inline(sdat_ndep, &
+ my_task = iam, &
+ logunit = iulog, &
+ compname = 'LND', &
+ model_clock = model_clock, &
+ model_mesh = mesh, &
+ stream_meshfile = trim(stream_meshfile_ndep), &
+ stream_lev_dimname = 'null', &
+ stream_mapalgo = trim(ndepmapalgo), &
+ stream_filenames = (/trim(stream_fldfilename_ndep)/), &
+ stream_fldlistFile = stream_varnames, &
+ stream_fldListModel = stream_varnames, &
+ stream_yearFirst = stream_year_first_ndep, &
+ stream_yearLast = stream_year_last_ndep, &
+ stream_yearAlign = model_year_align_ndep, &
+ stream_offset = ndep_offset, &
+ stream_taxmode = ndep_taxmode, &
+ stream_dtlimit = ndep_dtlimit, &
+ stream_tintalgo = ndep_tintalgo, &
+ stream_name = 'Nitrogen deposition data ', &
+ rc = rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+
+ end subroutine ndep_init
+
+ !================================================================
+ subroutine check_units( stream_fldFileName_ndep)
+
+ !-------------------------------------------------------------------
+ ! Check that units are correct on the file and if need any conversion
+
+ use ncdio_pio , only : ncd_pio_openfile, ncd_inqvid, ncd_getatt, ncd_pio_closefile, ncd_nowrite
+ use ncdio_pio , only : file_desc_t, var_desc_t
+ use shr_log_mod , only : errMsg => shr_log_errMsg
+
+ ! Arguments
+ character(len=*), intent(in) :: stream_fldFileName_ndep ! ndep filename
+ !
+ ! Local variables
+ type(file_desc_t) :: ncid ! NetCDF filehandle for ndep file
+ type(var_desc_t) :: vardesc ! variable descriptor
+ integer :: varid ! variable index
+ logical :: readvar ! If variable was read
+ character(len=CS) :: ndepunits! ndep units
+ !-----------------------------------------------------------------------
+
+ call ncd_pio_openfile( ncid, trim(stream_fldFileName_ndep), ncd_nowrite )
+ call ncd_inqvid(ncid, stream_varnames(1), varid, vardesc, readvar=readvar)
+ if ( readvar ) then
+ call ncd_getatt(ncid, varid, "units", ndepunits)
+ else
+ call endrun(msg=' ERROR finding variable: '//trim(stream_varnames(1))//" in file: "// &
+ trim(stream_fldFileName_ndep)//errMsg(sourcefile, __LINE__))
+ end if
+ call ncd_pio_closefile( ncid )
+
+ ! Now check to make sure they are correct
+ if (trim(ndepunits) == "g(N)/m2/s" )then
+ divide_by_secs_per_yr = .false.
+ else if ( trim(ndepunits) == "g(N)/m2/yr" )then
+ divide_by_secs_per_yr = .true.
+ else
+ call endrun(msg=' ERROR in units for nitrogen deposition equal to: '//trim(ndepunits)//" not units expected"// &
+ errMsg(sourcefile, __LINE__))
+ end if
+
+ end subroutine check_units
+
+ !================================================================
+ subroutine ndep_interp(bounds, atm2lnd_inst)
+
+ !-----------------------------------------------------------------------
+ use clm_time_manager , only : get_curr_date, get_days_per_year
+ use clm_varcon , only : secspday
+ use atm2lndType , only : atm2lnd_type
+ use dshr_methods_mod , only : dshr_fldbun_getfldptr
+ use dshr_strdata_mod , only : shr_strdata_advance
+ !
+ ! Arguments
+ type(bounds_type) , intent(in) :: bounds
+ type(atm2lnd_type), intent(inout) :: atm2lnd_inst
+ !
+ ! Local variables
+ integer :: g, ig
+ integer :: year ! year (0, ...) for nstep+1
+ integer :: mon ! month (1, ..., 12) for nstep+1
+ integer :: day ! day of month (1, ..., 31) for nstep+1
+ integer :: sec ! seconds into current date for nstep+1
+ integer :: mcdate ! Current model date (yyyymmdd)
+ integer :: dayspyr ! days per year
+ integer :: rc
+ real(r8), pointer :: dataptr1d(:)
+ !-----------------------------------------------------------------------
+
+ ! Advance sdat stream
+ call get_curr_date(year, mon, day, sec)
+ mcdate = year*10000 + mon*100 + day
+ call shr_strdata_advance(sdat_ndep, ymd=mcdate, tod=sec, logunit=iulog, istr='ndepdyn', rc=rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+
+ ! Get pointer for stream data that is time and spatially interpolate to model time and grid
+ call dshr_fldbun_getFldPtr(sdat_ndep%pstrm(1)%fldbun_model, stream_varnames(1), fldptr1=dataptr1d, rc=rc)
+ if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ end if
+
+ ! Fill in atm2lnd_inst%forc_ndep_grc
+ if ( divide_by_secs_per_yr )then
+ ig = 0
+ dayspyr = get_days_per_year( )
+ do g = bounds%begg,bounds%endg
+ ig = ig+1
+ atm2lnd_inst%forc_ndep_grc(g) = dataptr1d(ig) / (secspday * dayspyr)
+ end do
+ else
+ ig = 0
+ do g = bounds%begg,bounds%endg
+ ig = ig+1
+ atm2lnd_inst%forc_ndep_grc(g) = dataptr1d(ig)
+ end do
+ end if
+
+ end subroutine ndep_interp
+
+end module ndepStreamMod
diff --git a/src/dyn_subgrid/dynHarvestMod.F90 b/src/dyn_subgrid/dynHarvestMod.F90
index db5b0d25e1..c16c15906c 100644
--- a/src/dyn_subgrid/dynHarvestMod.F90
+++ b/src/dyn_subgrid/dynHarvestMod.F90
@@ -467,7 +467,7 @@ subroutine CNHarvestPftToColumn (num_soilc, filter_soilc, &
! to the column level and assign them to the three litter pools
!
! !USES:
- use clm_varpar , only : nlevdecomp, maxsoil_patches
+ use clm_varpar , only : nlevdecomp, maxsoil_patches, i_litr_min, i_litr_max, i_met_lit
!
! !ARGUMENTS:
integer , intent(in) :: num_soilc ! number of soil columns in filter
@@ -477,19 +477,15 @@ subroutine CNHarvestPftToColumn (num_soilc, filter_soilc, &
type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst
!
! !LOCAL VARIABLES:
- integer :: fc,c,pi,p,j ! indices
+ integer :: fc,c,pi,p,j,i ! indices
!-----------------------------------------------------------------------
associate( &
ivt => patch%itype , & ! Input: [integer (:) ] pft vegetation type
wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] pft weight relative to column (0-1)
- lf_flab => pftcon%lf_flab , & ! Input: leaf litter labile fraction
- lf_fcel => pftcon%lf_fcel , & ! Input: leaf litter cellulose fraction
- lf_flig => pftcon%lf_flig , & ! Input: leaf litter lignin fraction
- fr_flab => pftcon%fr_flab , & ! Input: fine root litter labile fraction
- fr_fcel => pftcon%fr_fcel , & ! Input: fine root litter cellulose fraction
- fr_flig => pftcon%fr_flig , & ! Input: fine root litter lignin fraction
+ lf_f => pftcon%lf_f , & ! Input: leaf litter fraction
+ fr_f => pftcon%fr_f , & ! Input: fine root litter fraction
leaf_prof => soilbiogeochem_state_inst%leaf_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of leaves
froot_prof => soilbiogeochem_state_inst%froot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of fine roots
@@ -517,9 +513,7 @@ subroutine CNHarvestPftToColumn (num_soilc, filter_soilc, &
hrv_deadcrootc_xfer_to_litter => cnveg_carbonflux_inst%hrv_deadcrootc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ]
hrv_gresp_xfer_to_litter => cnveg_carbonflux_inst%hrv_gresp_xfer_to_litter_patch , & ! Input: [real(r8) (:) ]
cwood_harvestc => cnveg_carbonflux_inst%wood_harvestc_col , & ! InOut: [real(r8) (:) ]
- harvest_c_to_litr_met_c => cnveg_carbonflux_inst%harvest_c_to_litr_met_c_col , & ! InOut: [real(r8) (:,:) ] C fluxes associated with harvest to litter metabolic pool (gC/m3/s)
- harvest_c_to_litr_cel_c => cnveg_carbonflux_inst%harvest_c_to_litr_cel_c_col , & ! InOut: [real(r8) (:,:) ] C fluxes associated with harvest to litter cellulose pool (gC/m3/s)
- harvest_c_to_litr_lig_c => cnveg_carbonflux_inst%harvest_c_to_litr_lig_c_col , & ! InOut: [real(r8) (:,:) ] C fluxes associated with harvest to litter lignin pool (gC/m3/s)
+ harvest_c_to_litr_c => cnveg_carbonflux_inst%harvest_c_to_litr_c_col , & ! InOut: [real(r8) (:,:,:) ] C fluxes associated with harvest to litter pools (gC/m3/s)
harvest_c_to_cwdc => cnveg_carbonflux_inst%harvest_c_to_cwdc_col , & ! InOut: [real(r8) (:,:) ] C fluxes associated with harvest to CWD pool (gC/m3/s)
hrv_leafn_to_litter => cnveg_nitrogenflux_inst%hrv_leafn_to_litter_patch , & ! Input: [real(r8) (:) ]
@@ -542,9 +536,7 @@ subroutine CNHarvestPftToColumn (num_soilc, filter_soilc, &
hrv_livecrootn_xfer_to_litter => cnveg_nitrogenflux_inst%hrv_livecrootn_xfer_to_litter_patch , & ! Input: [real(r8) (:) ]
hrv_deadcrootn_xfer_to_litter => cnveg_nitrogenflux_inst%hrv_deadcrootn_xfer_to_litter_patch , & ! Input: [real(r8) (:) ]
cwood_harvestn => cnveg_nitrogenflux_inst%wood_harvestn_col , & ! InOut: [real(r8) (:) ]
- harvest_n_to_litr_met_n => cnveg_nitrogenflux_inst%harvest_n_to_litr_met_n_col , & ! InOut: [real(r8) (:,:) ] N fluxes associated with harvest to litter metabolic pool (gN/m3/s)
- harvest_n_to_litr_cel_n => cnveg_nitrogenflux_inst%harvest_n_to_litr_cel_n_col , & ! InOut: [real(r8) (:,:) ] N fluxes associated with harvest to litter cellulose pool (gN/m3/s)
- harvest_n_to_litr_lig_n => cnveg_nitrogenflux_inst%harvest_n_to_litr_lig_n_col , & ! InOut: [real(r8) (:,:) ] N fluxes associated with harvest to litter lignin pool (gN/m3/s)
+ harvest_n_to_litr_n => cnveg_nitrogenflux_inst%harvest_n_to_litr_n_col , & ! InOut: [real(r8) (:,:,:)] N fluxes associated with harvest to litter pools (gN/m3/s)
harvest_n_to_cwdn => cnveg_nitrogenflux_inst%harvest_n_to_cwdn_col & ! InOut: [real(r8) (:,:) ] N fluxes associated with harvest to CWD pool (gN/m3/s)
)
@@ -558,21 +550,17 @@ subroutine CNHarvestPftToColumn (num_soilc, filter_soilc, &
if (patch%active(p)) then
- ! leaf harvest mortality carbon fluxes
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- harvest_c_to_litr_cel_c(c,j) = harvest_c_to_litr_cel_c(c,j) + &
- hrv_leafc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- harvest_c_to_litr_lig_c(c,j) = harvest_c_to_litr_lig_c(c,j) + &
- hrv_leafc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j)
-
- ! fine root harvest mortality carbon fluxes
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_frootc_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) * froot_prof(p,j)
- harvest_c_to_litr_cel_c(c,j) = harvest_c_to_litr_cel_c(c,j) + &
- hrv_frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j)
- harvest_c_to_litr_lig_c(c,j) = harvest_c_to_litr_lig_c(c,j) + &
- hrv_frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j)
+ do i = i_litr_min, i_litr_max
+ ! leaf harvest mortality carbon fluxes
+ harvest_c_to_litr_c(c,j,i) = &
+ harvest_c_to_litr_c(c,j,i) + &
+ hrv_leafc_to_litter(p) * lf_f(ivt(p),i) * wtcol(p) * leaf_prof(p,j)
+
+ ! fine root harvest mortality carbon fluxes
+ harvest_c_to_litr_c(c,j,i) = &
+ harvest_c_to_litr_c(c,j,i) + &
+ hrv_frootc_to_litter(p) * fr_f(ivt(p),i) * wtcol(p) * froot_prof(p,j)
+ end do
! wood harvest mortality carbon fluxes
harvest_c_to_cwdc(c,j) = harvest_c_to_cwdc(c,j) + &
@@ -583,52 +571,36 @@ subroutine CNHarvestPftToColumn (num_soilc, filter_soilc, &
hrv_deadcrootc_to_litter(p) * wtcol(p) * croot_prof(p,j)
! storage harvest mortality carbon fluxes
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_leafc_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_frootc_storage_to_litter(p) * wtcol(p) * froot_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_livestemc_storage_to_litter(p) * wtcol(p) * stem_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_deadstemc_storage_to_litter(p) * wtcol(p) * stem_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_livecrootc_storage_to_litter(p) * wtcol(p) * croot_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_deadcrootc_storage_to_litter(p) * wtcol(p) * croot_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_gresp_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j)
+ ! Metabolic litter is treated differently than other types
+ ! of litter, so it gets this additional line after the
+ ! most recent loop over all litter types
+ harvest_c_to_litr_c(c,j,i_met_lit) = &
+ harvest_c_to_litr_c(c,j,i_met_lit) + &
+ hrv_leafc_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j) + &
+ hrv_frootc_storage_to_litter(p) * wtcol(p) * froot_prof(p,j) + &
+ hrv_livestemc_storage_to_litter(p) * wtcol(p) * stem_prof(p,j) + &
+ hrv_deadstemc_storage_to_litter(p) * wtcol(p) * stem_prof(p,j) + &
+ hrv_livecrootc_storage_to_litter(p) * wtcol(p) * croot_prof(p,j) + &
+ hrv_deadcrootc_storage_to_litter(p) * wtcol(p) * croot_prof(p,j) + &
+ hrv_gresp_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j) + &
! transfer harvest mortality carbon fluxes
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_leafc_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_frootc_xfer_to_litter(p) * wtcol(p) * froot_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_livestemc_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_deadstemc_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_livecrootc_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_deadcrootc_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j)
- harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
- hrv_gresp_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j)
-
- ! leaf harvest mortality nitrogen fluxes
- harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + &
- hrv_leafn_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- harvest_n_to_litr_cel_n(c,j) = harvest_n_to_litr_cel_n(c,j) + &
- hrv_leafn_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j)
- harvest_n_to_litr_lig_n(c,j) = harvest_n_to_litr_lig_n(c,j) + &
- hrv_leafn_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j)
-
- ! fine root litter nitrogen fluxes
- harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + &
- hrv_frootn_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) * froot_prof(p,j)
- harvest_n_to_litr_cel_n(c,j) = harvest_n_to_litr_cel_n(c,j) + &
- hrv_frootn_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j)
- harvest_n_to_litr_lig_n(c,j) = harvest_n_to_litr_lig_n(c,j) + &
- hrv_frootn_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j)
+ hrv_leafc_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j) + &
+ hrv_frootc_xfer_to_litter(p) * wtcol(p) * froot_prof(p,j) + &
+ hrv_livestemc_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j) + &
+ hrv_deadstemc_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j) + &
+ hrv_livecrootc_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j) + &
+ hrv_deadcrootc_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j) + &
+ hrv_gresp_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j)
+
+ do i = i_litr_min, i_litr_max
+ harvest_n_to_litr_n(c,j,i) = &
+ harvest_n_to_litr_n(c,j,i) + &
+ ! leaf harvest mortality nitrogen fluxes
+ hrv_leafn_to_litter(p) * lf_f(ivt(p),i) * wtcol(p) * leaf_prof(p,j) + &
+ ! fine root litter nitrogen fluxes
+ hrv_frootn_to_litter(p) * fr_f(ivt(p),i) * wtcol(p) * froot_prof(p,j)
+ end do
! wood harvest mortality nitrogen fluxes
harvest_n_to_cwdn(c,j) = harvest_n_to_cwdn(c,j) + &
@@ -638,37 +610,27 @@ subroutine CNHarvestPftToColumn (num_soilc, filter_soilc, &
harvest_n_to_cwdn(c,j) = harvest_n_to_cwdn(c,j) + &
hrv_deadcrootn_to_litter(p) * wtcol(p) * croot_prof(p,j)
- ! retranslocated N pool harvest mortality fluxes
- harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + &
- hrv_retransn_to_litter(p) * wtcol(p) * leaf_prof(p,j)
-
- ! storage harvest mortality nitrogen fluxes
- harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + &
- hrv_leafn_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j)
- harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + &
- hrv_frootn_storage_to_litter(p) * wtcol(p) * froot_prof(p,j)
- harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + &
- hrv_livestemn_storage_to_litter(p) * wtcol(p) * stem_prof(p,j)
- harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + &
- hrv_deadstemn_storage_to_litter(p) * wtcol(p) * stem_prof(p,j)
- harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + &
- hrv_livecrootn_storage_to_litter(p) * wtcol(p) * croot_prof(p,j)
- harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + &
- hrv_deadcrootn_storage_to_litter(p) * wtcol(p) * croot_prof(p,j)
-
- ! transfer harvest mortality nitrogen fluxes
- harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + &
- hrv_leafn_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j)
- harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + &
- hrv_frootn_xfer_to_litter(p) * wtcol(p) * froot_prof(p,j)
- harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + &
- hrv_livestemn_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j)
- harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + &
- hrv_deadstemn_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j)
- harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + &
- hrv_livecrootn_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j)
- harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + &
- hrv_deadcrootn_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j)
+ ! Metabolic litter is treated differently than other types
+ ! of litter, so it gets this additional line after the
+ ! most recent loop over all litter types
+ harvest_n_to_litr_n(c,j,i_met_lit) = &
+ harvest_n_to_litr_n(c,j,i_met_lit) + &
+ ! retranslocated N pool harvest mortality fluxes
+ hrv_retransn_to_litter(p) * wtcol(p) * leaf_prof(p,j) + &
+ ! storage harvest mortality nitrogen fluxes
+ hrv_leafn_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j) + &
+ hrv_frootn_storage_to_litter(p) * wtcol(p) * froot_prof(p,j) + &
+ hrv_livestemn_storage_to_litter(p) * wtcol(p) * stem_prof(p,j) + &
+ hrv_deadstemn_storage_to_litter(p) * wtcol(p) * stem_prof(p,j) + &
+ hrv_livecrootn_storage_to_litter(p) * wtcol(p) * croot_prof(p,j) + &
+ hrv_deadcrootn_storage_to_litter(p) * wtcol(p) * croot_prof(p,j) + &
+ ! transfer harvest mortality nitrogen fluxes
+ hrv_leafn_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j) + &
+ hrv_frootn_xfer_to_litter(p) * wtcol(p) * froot_prof(p,j) + &
+ hrv_livestemn_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j) + &
+ hrv_deadstemn_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j) + &
+ hrv_livecrootn_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j) + &
+ hrv_deadcrootn_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j)
end if
end if
diff --git a/src/main/ColumnType.F90 b/src/main/ColumnType.F90
index 12e4a8c205..5f57b3ed23 100644
--- a/src/main/ColumnType.F90
+++ b/src/main/ColumnType.F90
@@ -44,10 +44,14 @@ module ColumnType
! topological mapping functionality
integer , pointer :: itype (:) ! column type (after init, should only be modified via update_itype routine)
- integer , pointer :: lun_itype (:) ! landunit type (col%lun_itype(ci) is the same as lun%itype(col%landunit(ci)), but is often a more convenient way to access this type
+ integer , pointer :: lun_itype (:) ! landunit type (col%lun_itype(ci) is the
+ ! same as lun%itype(col%landunit(ci)), but is often a more convenient way to access this type
logical , pointer :: active (:) ! true=>do computations on this column
logical , pointer :: type_is_dynamic (:) ! true=>itype can change throughout the run
-
+
+ logical , pointer :: is_fates (:) ! .true. -> this is a fates column
+ ! .false. -> this is NOT a fates column
+
! topography
! TODO(wjs, 2016-04-05) Probably move these things into topoMod
real(r8), pointer :: micro_sigma (:) ! microtopography pdf sigma (m)
@@ -115,6 +119,8 @@ subroutine Init(this, begc, endc)
allocate(this%active (begc:endc)) ; this%active (:) = .false.
allocate(this%type_is_dynamic(begc:endc)) ; this%type_is_dynamic(:) = .false.
+ allocate(this%is_fates(begc:endc)) ; this%is_fates(:) = .false.
+
! The following is set in initVerticalMod
allocate(this%snl (begc:endc)) ; this%snl (:) = ispval !* cannot be averaged up
allocate(this%dz (begc:endc,-nlevsno+1:nlevmaxurbgrnd)) ; this%dz (:,:) = nan
@@ -153,6 +159,7 @@ subroutine Clean(this)
deallocate(this%itype )
deallocate(this%lun_itype )
deallocate(this%active )
+ deallocate(this%is_fates )
deallocate(this%type_is_dynamic)
deallocate(this%snl )
deallocate(this%dz )
diff --git a/src/main/FuncPedotransferMod.F90 b/src/main/FuncPedotransferMod.F90
index 41e751344e..f775b688c4 100644
--- a/src/main/FuncPedotransferMod.F90
+++ b/src/main/FuncPedotransferMod.F90
@@ -72,10 +72,10 @@ subroutine pedotransf_cosby1984_table4(sand, clay, watsat, bsw, sucsat, xksat)
real(r8), intent(out):: xksat !mm/s, saturated hydraulic conductivity
!Cosby et al. Table 4
- watsat = 0.505_r8-0.00142_r8*sand-0.00037*clay
- bsw = 3.10+0.157*clay-0.003*sand
- sucsat = 10._r8 * ( 10._r8**(1.54_r8-0.0095_r8*sand+0.0063*(100._r8-sand-clay)))
- xksat = 0.0070556 *(10.**(-0.60+0.0126*sand-0.0064*clay) ) !mm/s now use table 4.
+ watsat = 0.505_r8-0.00142_r8*sand-0.00037_r8*clay
+ bsw = 3.10_r8+0.157_r8*clay-0.003_r8*sand
+ sucsat = 10._r8 * ( 10._r8**(1.54_r8-0.0095_r8*sand+0.0063_r8*(100._r8-sand-clay)))
+ xksat = 0.0070556_r8 *(10._r8**(-0.60_r8+0.0126_r8*sand-0.0064_r8*clay) ) !mm/s now use table 4.
end subroutine pedotransf_cosby1984_table4
@@ -96,9 +96,9 @@ subroutine pedotransf_cosby1984_table5(sand, clay, watsat, bsw, sucsat, xksat)
!Cosby et al. Table 5
watsat = 0.489_r8 - 0.00126_r8*sand
- bsw = 2.91 + 0.159*clay
+ bsw = 2.91_r8 + 0.159_r8*clay
sucsat = 10._r8 * ( 10._r8**(1.88_r8-0.0131_r8*sand) )
- xksat = 0.0070556 *( 10.**(-0.884+0.0153*sand) ) ! mm/s, from table 5
+ xksat = 0.0070556_r8 *( 10._r8**(-0.884_r8+0.0153_r8*sand) ) ! mm/s, from table 5
end subroutine pedotransf_cosby1984_table5
@@ -118,10 +118,10 @@ subroutine pedotransf_noilhan_lacarrere1995(sand, clay, watsat, bsw, sucsat, xks
real(r8), intent(out):: xksat !mm/s, saturated hydraulic conductivity
!Noilhan and Lacarrere, 1995
- watsat = -0.00108*sand+0.494305
- bsw = 0.137*clay + 3.501
- sucsat = 10._r8**(-0.0088*sand+2.85)
- xksat = 10._r8**(-0.0582*clay-0.00091*sand+0.000529*clay**2._r8-0.0001203*sand**2._r8-1.38)
+ watsat = -0.00108_r8*sand+0.494305_r8
+ bsw = 0.137_r8*clay + 3.501_r8
+ sucsat = 10._r8**(-0.0088_r8*sand+2.85_r8)
+ xksat = 10._r8**(-0.0582_r8*clay-0.00091_r8*sand+0.000529_r8*clay**2._r8-0.0001203_r8*sand**2._r8-1.38_r8)
end subroutine pedotransf_noilhan_lacarrere1995
!------------------------------------------------------------------------------------------
function get_ipedof(soil_order)result(ipedof)
diff --git a/src/main/GetGlobalValuesMod.F90 b/src/main/GetGlobalValuesMod.F90
index 9e06672c45..aec1406c0c 100644
--- a/src/main/GetGlobalValuesMod.F90
+++ b/src/main/GetGlobalValuesMod.F90
@@ -27,11 +27,10 @@ integer function GetGlobalIndex(decomp_index, clmlevel)
!
! Uses:
use shr_log_mod, only: errMsg => shr_log_errMsg
- use decompMod , only: bounds_type, get_clmlevel_gsmap, get_proc_bounds
+ use decompMod , only: bounds_type, get_clmlevel_gindex, get_proc_bounds
use spmdMod , only: iam
use clm_varcon , only: nameg, namel, namec, namep
use clm_varctl , only: iulog
- use mct_mod , only: mct_gsMap, mct_gsMap_orderedPoints
use shr_sys_mod, only: shr_sys_abort
!
! Arguments
@@ -39,10 +38,9 @@ integer function GetGlobalIndex(decomp_index, clmlevel)
character(len=*) , intent(in) :: clmlevel
!
! Local Variables:
- type(bounds_type) :: bounds_proc ! processor bounds
- type(mct_gsMap),pointer :: gsmap ! global seg map
- integer, pointer,dimension(:) :: gsmap_ordered ! gsmap ordered points
- integer :: beg_index ! beginning proc index for clmlevel
+ type(bounds_type) :: bounds_proc ! processor bounds
+ integer :: beg_index ! beginning proc index for clmlevel
+ integer, pointer :: gindex(:)
!----------------------------------------------------------------
call get_proc_bounds(bounds_proc)
@@ -60,10 +58,8 @@ integer function GetGlobalIndex(decomp_index, clmlevel)
errmsg(sourcefile, __LINE__))
end if
- call get_clmlevel_gsmap(clmlevel=trim(clmlevel), gsmap=gsmap)
- call mct_gsMap_orderedPoints(gsmap, iam, gsmap_ordered)
- GetGlobalIndex = gsmap_ordered(decomp_index - beg_index + 1)
- deallocate(gsmap_ordered)
+ call get_clmlevel_gindex(clmlevel=trim(clmlevel), gindex=gindex)
+ GetGlobalIndex = gindex(decomp_index - beg_index + 1)
end function GetGlobalIndex
@@ -82,25 +78,24 @@ function GetGlobalIndexArray(decomp_index, bounds1, bounds2, clmlevel)
! Uses:
#include "shr_assert.h"
use shr_log_mod, only: errMsg => shr_log_errMsg
- use decompMod , only: bounds_type, get_clmlevel_gsmap, get_proc_bounds
+ use decompMod , only: bounds_type, get_clmlevel_gindex, get_proc_bounds
use spmdMod , only: iam
use clm_varcon , only: nameg, namel, namec, namep
use clm_varctl , only: iulog
- use mct_mod
+ use shr_sys_mod, only: shr_sys_abort
!
! Arguments
- integer, intent(in) :: bounds1 ! lower bound of the input & returned arrays
- integer, intent(in) :: bounds2 ! upper bound of the input & returned arrays
- integer, intent(in) :: decomp_index(bounds1:)
- character(len=*) , intent(in) :: clmlevel
- integer :: GetGlobalIndexArray(bounds1:bounds2)
+ integer , intent(in) :: bounds1 ! lower bound of the input & returned arrays
+ integer , intent(in) :: bounds2 ! upper bound of the input & returned arrays
+ integer , intent(in) :: decomp_index(bounds1:)
+ character(len=*) , intent(in) :: clmlevel
+ integer :: GetGlobalIndexArray(bounds1:bounds2)
!
! Local Variables:
- type(bounds_type) :: bounds_proc ! processor bounds
- type(mct_gsMap),pointer :: gsmap ! global seg map
- integer, pointer,dimension(:) :: gsmap_ordered ! gsmap ordered points
- integer :: beg_index ! beginning proc index for clmlevel
- integer :: i
+ type(bounds_type) :: bounds_proc ! processor bounds
+ integer :: beg_index ! beginning proc index for clmlevel
+ integer :: i
+ integer , pointer :: gindex(:)
!----------------------------------------------------------------
SHR_ASSERT_ALL_FL((ubound(decomp_index) == (/bounds2/)), sourcefile, __LINE__)
@@ -119,12 +114,10 @@ function GetGlobalIndexArray(decomp_index, bounds1, bounds2, clmlevel)
errmsg(__FILE__, __LINE__))
end if
- call get_clmlevel_gsmap(clmlevel=trim(clmlevel), gsmap=gsmap)
- call mct_gsMap_orderedPoints(gsmap, iam, gsmap_ordered)
+ call get_clmlevel_gindex(clmlevel=trim(clmlevel), gindex=gindex)
do i=bounds1,bounds2
- GetGlobalIndexArray(i) = gsmap_ordered(decomp_index(i) - beg_index + 1)
+ GetGlobalIndexArray(i) = gindex(decomp_index(i) - beg_index + 1)
enddo
- deallocate(gsmap_ordered)
end function GetGlobalIndexArray
@@ -144,6 +137,7 @@ subroutine GetGlobalWrite(decomp_index, clmlevel)
use LandunitType , only : lun
use ColumnType , only : col
use PatchType , only : patch
+ use spmdMod , only : iam
!
! Arguments:
integer , intent(in) :: decomp_index
@@ -153,6 +147,8 @@ subroutine GetGlobalWrite(decomp_index, clmlevel)
integer :: igrc, ilun, icol, ipft
!-----------------------------------------------------------------------
+ write(iulog,*)'proc_id = ',iam
+
if (trim(clmlevel) == nameg) then
igrc = decomp_index
diff --git a/src/main/GridcellType.F90 b/src/main/GridcellType.F90
index 30fe988eff..9d31d41e86 100644
--- a/src/main/GridcellType.F90
+++ b/src/main/GridcellType.F90
@@ -21,7 +21,6 @@ module GridcellType
type, public :: gridcell_type
! topological mapping functionality, local 1d gdc arrays
- integer , pointer :: gindex (:) ! global index
real(r8), pointer :: area (:) ! total land area, gridcell (km^2)
real(r8), pointer :: lat (:) ! latitude (radians)
real(r8), pointer :: lon (:) ! longitude (radians)
@@ -63,7 +62,6 @@ subroutine Init(this, begg, endg)
!------------------------------------------------------------------------
! The following is set in InitGridCells
- allocate(this%gindex (begg:endg)) ; this%gindex (:) = ispval
allocate(this%area (begg:endg)) ; this%area (:) = nan
allocate(this%lat (begg:endg)) ; this%lat (:) = nan
allocate(this%lon (begg:endg)) ; this%lon (:) = nan
@@ -88,7 +86,6 @@ subroutine Clean(this)
class(gridcell_type) :: this
!------------------------------------------------------------------------
- deallocate(this%gindex )
deallocate(this%area )
deallocate(this%lat )
deallocate(this%lon )
diff --git a/src/main/accumulMod.F90 b/src/main/accumulMod.F90
index 3baba13814..55ac2bfa7d 100644
--- a/src/main/accumulMod.F90
+++ b/src/main/accumulMod.F90
@@ -150,9 +150,9 @@ subroutine init_accum_field (name, units, desc, &
! possible that init_value doesn't matter even in this case).
!
! !USES:
- use shr_const_mod, only: SHR_CONST_CDAY
- use clm_time_manager, only : get_step_size
- use decompMod, only : get_proc_bounds
+ use shr_const_mod , only: SHR_CONST_CDAY
+ use clm_time_manager , only : get_step_size
+ use decompMod , only : get_proc_bounds, bounds_type
!
! !ARGUMENTS:
implicit none
@@ -175,6 +175,7 @@ subroutine init_accum_field (name, units, desc, &
integer :: begl, endl ! per-proc beginning and ending landunit indices
integer :: begg, endg ! per-proc gridcell ending gridcell indices
integer :: begCohort, endCohort ! per-proc beg end cohort indices
+ type(bounds_type) :: bounds
character(len=*), parameter :: subname = 'init_accum_field'
!------------------------------------------------------------------------
@@ -188,8 +189,12 @@ subroutine init_accum_field (name, units, desc, &
! Determine necessary indices
- call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp, &
- begCohort, endCohort )
+ call get_proc_bounds(bounds)
+ begg = bounds%begg; endg = bounds%endg
+ begl = bounds%begl; endl = bounds%endl
+ begc = bounds%begc; endc = bounds%endc
+ begp = bounds%begp; endp = bounds%endp
+ begCohort = bounds%begCoHort; endCohort = bounds%endCoHort
! update field index
! Consistency check that number of accumulated does not exceed maximum.
diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90
index e84e9daf90..537ce65552 100644
--- a/src/main/clm_driver.F90
+++ b/src/main/clm_driver.F90
@@ -110,7 +110,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro
! !USES:
use clm_time_manager , only : get_curr_date
use clm_varctl , only : use_lai_streams, fates_spitfire_mode
- use SatellitePhenologyMod, only : lai_advance
+ use laiStreamMod , only : lai_advance
use FATESFireFactoryMod , only : scalar_lightning
!
! !ARGUMENTS:
@@ -1165,6 +1165,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro
water_inst%waterdiagnosticbulk_inst, water_inst%waterfluxbulk_inst, &
soilbiogeochem_carbonflux_inst, &
soilbiogeochem_nitrogenflux_inst, ch4_inst, lnd2atm_inst, &
+ clm_fates, &
agnpp = agnpp_patch(bounds_clump%begp:bounds_clump%endp), &
bgnpp = bgnpp_patch(bounds_clump%begp:bounds_clump%endp), &
annsum_npp = annsum_npp_patch(bounds_clump%begp:bounds_clump%endp), &
diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90
index 47b8b32775..17b52bb49e 100644
--- a/src/main/clm_initializeMod.F90
+++ b/src/main/clm_initializeMod.F90
@@ -181,22 +181,19 @@ subroutine initialize2(ni,nj)
type(bounds_type) :: bounds_clump ! clump bounds
integer :: nclumps ! number of clumps on this processor
integer :: nc ! clump index
- logical :: lexist
logical :: reset_dynbal_baselines_all_columns
logical :: reset_dynbal_baselines_lake_columns
integer :: begg, endg
- integer :: begp, endp
- integer :: begc, endc
- integer :: begl, endl
real(r8), pointer :: data2dptr(:,:) ! temp. pointers for slicing larger arrays
- character(len=32) :: subname = 'initialize2' ! subroutine name
+ character(len=32) :: subname = 'initialize2' ! subroutine name
!-----------------------------------------------------------------------
call t_startf('clm_init2')
- ! Get processor bounds
- call get_proc_bounds(begg, endg)
-
+ ! Get processor bounds for gridcells
+ call get_proc_bounds(bounds_proc)
+ begg = bounds_proc%begg; endg = bounds_proc%endg
+
! Initialize glc behavior
call glc_behavior%Init(begg, endg, NLFilename)
@@ -255,7 +252,13 @@ subroutine initialize2(ni,nj)
! Build hierarchy and topological info for derived types
! This is needed here for the following call to decompInit_glcp
- call initGridCells(glc_behavior)
+ nclumps = get_proc_clumps()
+ !$OMP PARALLEL DO PRIVATE (nc, bounds_clump)
+ do nc = 1, nclumps
+ call get_clump_bounds(nc, bounds_clump)
+ call initGridCells(bounds_clump, glc_behavior)
+ end do
+ !$OMP END PARALLEL DO
! Set global seg maps for gridcells, landlunits, columns and patches
call decompInit_glcp(ni, nj, glc_behavior)
@@ -263,7 +266,6 @@ subroutine initialize2(ni,nj)
! Set filters
call allocFilters()
- nclumps = get_proc_clumps()
!$OMP PARALLEL DO PRIVATE (nc, bounds_clump)
do nc = 1, nclumps
call get_clump_bounds(nc, bounds_clump)
diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90
index 13e360fac7..440d45c76c 100644
--- a/src/main/clm_instMod.F90
+++ b/src/main/clm_instMod.F90
@@ -587,7 +587,8 @@ subroutine clm_instRest(bounds, ncid, flag, writing_finidat_interp_dest_file)
waterdiagnosticbulk_inst=water_inst%waterdiagnosticbulk_inst, &
waterstatebulk_inst=water_inst%waterstatebulk_inst, &
canopystate_inst=canopystate_inst, &
- soilstate_inst=soilstate_inst)
+ soilstate_inst=soilstate_inst, &
+ active_layer_inst=active_layer_inst)
end if
diff --git a/src/main/clm_varcon.F90 b/src/main/clm_varcon.F90
index 9f66d335ad..895c7a4b80 100644
--- a/src/main/clm_varcon.F90
+++ b/src/main/clm_varcon.F90
@@ -44,8 +44,8 @@ module clm_varcon
! Initialize physical constants
!------------------------------------------------------------------
- real(r8), public, parameter :: pc = 0.4 ! threshold probability
- real(r8), public, parameter :: mu = 0.13889 ! connectivity exponent
+ real(r8), public, parameter :: pc = 0.4_r8 ! threshold probability
+ real(r8), public, parameter :: mu = 0.13889_r8 ! connectivity exponent
real(r8), public, parameter :: secsphr = 3600._r8 ! Seconds in an hour
integer, public, parameter :: isecsphr = int(secsphr) ! Integer seconds in an hour
integer, public, parameter :: isecspmin= 60 ! Integer seconds in a minute
@@ -126,9 +126,9 @@ module clm_varcon
real(r8), public, parameter :: c_to_b = 2.0_r8 ! conversion between mass carbon and total biomass (g biomass /g C)
!!! C13
- real(r8), public, parameter :: preind_atm_del13c = -6.0 ! preindustrial value for atmospheric del13C
- real(r8), public, parameter :: preind_atm_ratio = SHR_CONST_PDB + (preind_atm_del13c * SHR_CONST_PDB)/1000.0 ! 13C/12C
- real(r8), public :: c13ratio = preind_atm_ratio/(1.0+preind_atm_ratio) ! 13C/(12+13)C preind atmosphere
+ real(r8), public, parameter :: preind_atm_del13c = -6.0_r8 ! preindustrial value for atmospheric del13C
+ real(r8), public, parameter :: preind_atm_ratio = SHR_CONST_PDB + (preind_atm_del13c * SHR_CONST_PDB)/1000.0_r8 ! 13C/12C
+ real(r8), public :: c13ratio = preind_atm_ratio/(1.0_r8+preind_atm_ratio) ! 13C/(12+13)C preind atmosphere
! typical del13C for C3 photosynthesis (permil, relative to PDB)
real(r8), public, parameter :: c3_del13c = -28._r8
@@ -171,7 +171,7 @@ module clm_varcon
real(r8), public, parameter :: dens_floor = 2.35e3_r8 ! density of floor - concrete (Salmanca et al. 2010, TAC) (kg m-3)
real(r8), public, parameter :: sh_floor = 880._r8 ! specific heat of floor - concrete (Salmanca et al. 2010, TAC) (J kg-1 K-1)
real(r8), public :: cp_floor = dens_floor*sh_floor ! volumetric heat capacity of floor - concrete (Salmanca et al. 2010, TAC) (J m-3 K-1)
- real(r8), public :: vent_ach = 0.3 ! ventilation rate (air exchanges per hour)
+ real(r8), public :: vent_ach = 0.3_r8 ! ventilation rate (air exchanges per hour)
real(r8), public :: wasteheat_limit = 100._r8 ! limit on wasteheat (W/m2)
diff --git a/src/main/clm_varpar.F90 b/src/main/clm_varpar.F90
index 7594a2bf13..cd4d4efac4 100644
--- a/src/main/clm_varpar.F90
+++ b/src/main/clm_varpar.F90
@@ -63,11 +63,17 @@ module clm_varpar
! constants for decomposition cascade
- integer, public, parameter :: i_met_lit = 1
- integer, public, parameter :: i_cel_lit = i_met_lit + 1
- integer, public, parameter :: i_lig_lit = i_cel_lit + 1
- integer, public :: i_cwd
+ integer, public, parameter :: i_litr1 = 1 ! TEMPORARY FOR CascadeCN TO BUILD
+ integer, public :: i_litr2 = -9 ! TEMPORARY FOR CascadeCN TO BUILD
+ integer, public :: i_litr3 = -9 ! TEMPORARY FOR CascadeCN TO BUILD
+ ! The code currently expects i_litr_min = i_met_lit = 1 and
+ ! i_litr_max = 2 or 3
+ integer, public :: i_litr_min = -9 ! min index of litter pools; overwritten in SoilBiogeochemDecompCascade*Mod
+ integer, public :: i_litr_max = -9 ! max index of litter pools; overwritten in SoilBiogeochemDecompCascade*Mod
+ integer, public :: i_met_lit = -9 ! index of metabolic litter pool; overwritten in SoilBiogeochemDecompCascade*Mod
+ integer, public :: i_cwd = -9 ! index of cwd pool; overwritten in SoilBiogeochemDecompCascade*Mod
+ integer, public :: ndecomp_pools_max
integer, public :: ndecomp_pools
integer, public :: ndecomp_cascade_transitions
@@ -227,25 +233,33 @@ subroutine clm_varpar_init(actual_maxsoil_patches, actual_numcft)
write(iulog, *)
end if
+ ! We hardwire these parameters here because we use them
+ ! in InitAllocate (in SoilBiogeochemStateType) which is called earlier than
+ ! init_decompcascade_bgc where they might have otherwise been derived on the
+ ! fly. For reference, if they were determined in init_decompcascade_bgc:
+ ! ndecomp_pools would get the value of i_pas_som or i_cwd and
+ ! ndecomp_cascade_transitions would get the value of i_s3s1 or i_cwdl3
+ ! depending on how use_fates is set.
if ( use_fates ) then
- i_cwd = 0
if (use_century_decomp) then
ndecomp_pools = 6
ndecomp_cascade_transitions = 8
- else
+ else ! TODO slevis: Currently for CN. MIMICS will get its own.
ndecomp_pools = 7
ndecomp_cascade_transitions = 7
end if
else
- i_cwd = 4
if (use_century_decomp) then
ndecomp_pools = 7
ndecomp_cascade_transitions = 10
- else
+ else ! TODO slevis: Currently for CN. MIMICS will get its own.
ndecomp_pools = 8
ndecomp_cascade_transitions = 9
end if
endif
+ ! The next param also appears as a dimension in the params files dated
+ ! c210418.nc and later
+ ndecomp_pools_max = 8 ! largest ndecomp_pools value above
end subroutine clm_varpar_init
diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90
index 4bd7f3118c..e91f853e32 100644
--- a/src/main/controlMod.F90
+++ b/src/main/controlMod.F90
@@ -17,7 +17,7 @@ module controlMod
use abortutils , only: endrun
use spmdMod , only: masterproc, mpicom
use spmdMod , only: MPI_CHARACTER, MPI_INTEGER, MPI_LOGICAL, MPI_REAL8
- use decompMod , only: clump_pproc
+ use decompInitMod , only: clump_pproc
use clm_varcon , only: h2osno_max
use clm_varpar , only: maxpatch_glc, numrad, nlevsno
use fileutils , only: getavu, relavu, get_filename
@@ -119,7 +119,6 @@ subroutine control_init(dtime)
use CNMRespMod , only : CNMRespReadNML
use LunaMod , only : LunaReadNML
use CNNDynamicsMod , only : CNNDynamicsReadNML
- use SoilBiogeochemDecompCascadeBGCMod, only : DecompCascadeBGCreadNML
use CNPhenologyMod , only : CNPhenologyReadNML
use landunit_varcon , only : max_lunit
!
@@ -444,11 +443,6 @@ subroutine control_init(dtime)
errMsg(sourcefile, __LINE__))
end if
- if( use_lch4 ) then
- call endrun(msg=' ERROR: use_lch4 (methane) and use_fates cannot both be set to true.'//&
- errMsg(sourcefile, __LINE__))
- end if
-
if ( n_drydep > 0 .and. drydep_method /= DD_XLND ) then
call endrun(msg=' ERROR: dry deposition via ML Welsey is not compatible with FATES.'//&
errMsg(sourcefile, __LINE__))
@@ -537,9 +531,6 @@ subroutine control_init(dtime)
call CNNDynamicsReadNML ( NLFilename )
call CNPhenologyReadNML ( NLFilename )
end if
- if ( use_century_decomp ) then
- call DecompCascadeBGCreadNML( NLFilename )
- end if
! ----------------------------------------------------------------------
! consistency checks
diff --git a/src/main/decompInitMod.F90 b/src/main/decompInitMod.F90
index 880d362cad..3514979533 100644
--- a/src/main/decompInitMod.F90
+++ b/src/main/decompInitMod.F90
@@ -6,44 +6,42 @@ module decompInitMod
! be mapped back to atmosphere physics chunks.
!
! !USES:
- use shr_kind_mod , only : r8 => shr_kind_r8
- use shr_sys_mod , only : shr_sys_flush
- use shr_log_mod , only : errMsg => shr_log_errMsg
- use spmdMod , only : masterproc, iam, npes, mpicom, comp_id
- use abortutils , only : endrun
- use clm_varctl , only : iulog, use_fates
- use clm_varcon , only : grlnd
- use GridcellType , only : grc
- use LandunitType , only : lun
- use ColumnType , only : col
- use PatchType , only : patch
- use glcBehaviorMod , only : glc_behavior_type
- use decompMod
- use mct_mod , only : mct_gsMap_init, mct_gsMap_ngseg, mct_gsMap_nlseg, mct_gsmap_gsize
- use FatesInterfaceTypesMod, only : fates_maxElementsPerSite
+ use shr_kind_mod , only : r8 => shr_kind_r8
+ use shr_sys_mod , only : shr_sys_flush
+ use shr_log_mod , only : errMsg => shr_log_errMsg
+ use spmdMod , only : masterproc, iam, npes, mpicom
+ use abortutils , only : endrun
+ use clm_varctl , only : iulog
!
- ! !PUBLIC TYPES:
implicit none
+ private
+ !
+ ! !PUBLIC TYPES:
!
! !PUBLIC MEMBER FUNCTIONS:
- public decompInit_lnd ! initializes lnd grid decomposition into clumps and processors
- public decompInit_lnd3D ! initializes lnd grid 3D decomposition
- public decompInit_ocn ! initializes grid ocean points decomposition
- public decompInit_clumps ! initializes atm grid decomposition into clumps
- public decompInit_glcp ! initializes g,l,c,p decomp info
+ public :: decompInit_lnd ! initializes lnd grid decomposition into clumps and processors
+ public :: decompInit_clumps ! initializes atm grid decomposition into clumps
+ public :: decompInit_glcp ! initializes g,l,c,p decomp info
+ !
+ ! !PRIVATE MEMBER FUNCTIONS:
+ !
+ ! PUBLIC TYPES:
+ integer, public :: clump_pproc ! number of clumps per MPI process
!
! !PRIVATE TYPES:
- private
- integer, pointer :: lcid(:) ! temporary for setting ldecomp
-
- character(len=*), parameter, private :: sourcefile = &
+ integer, pointer :: lcid(:) ! temporary for setting decomposition
+ integer :: nglob_x, nglob_y ! global sizes
+ integer, parameter :: dbug=1 ! 0 = min, 1=normal, 2=much, 3=max
+ character(len=*), parameter :: sourcefile = &
__FILE__
+
+#include ! mpi library include file
!------------------------------------------------------------------------------
contains
!------------------------------------------------------------------------------
- subroutine decompInit_lnd(lni,lnj,amask)
+ subroutine decompInit_lnd(lni, lnj, amask)
!
! !DESCRIPTION:
! This subroutine initializes the land surface decomposition into a clump
@@ -51,16 +49,17 @@ subroutine decompInit_lnd(lni,lnj,amask)
! set by clump_pproc
!
! !USES:
- use clm_varctl, only : nsegspc
+ use clm_varctl , only : nsegspc
+ use decompMod , only : gindex_global, nclumps, clumps
+ use decompMod , only : bounds_type, get_proc_bounds, procinfo
!
! !ARGUMENTS:
- implicit none
integer , intent(in) :: amask(:)
integer , intent(in) :: lni,lnj ! domain global size
!
! !LOCAL VARIABLES:
integer :: lns ! global domain size
- integer :: ln,lj ! indices
+ integer :: ln ! indices
integer :: ag,an,ai,aj ! indices
integer :: numg ! number of land gridcells
logical :: seglen1 ! is segment length one
@@ -69,9 +68,10 @@ subroutine decompInit_lnd(lni,lnj,amask)
integer :: cid,pid ! indices
integer :: n,m,ng ! indices
integer :: ier ! error code
- integer :: beg,end,lsize,gsize ! used for gsmap init
- integer, pointer :: gindex(:) ! global index for gsmap init
- integer, pointer :: clumpcnt(:) ! clump index counter
+ integer :: begg, endg ! beg and end gridcells
+ integer, pointer :: clumpcnt(:) ! clump index counter
+ integer, allocatable :: gdc2glo(:)! used to create gindex_global
+ type(bounds_type) :: bounds ! contains subgrid bounds data
!------------------------------------------------------------------------------
lns = lni * lnj
@@ -238,24 +238,23 @@ subroutine decompInit_lnd(lni,lnj,amask)
end if
enddo
- ! Set ldecomp
+ ! Set gindex_global
- allocate(ldecomp%gdc2glo(numg), stat=ier)
+ allocate(gdc2glo(numg), stat=ier)
if (ier /= 0) then
- write(iulog,*) 'decompInit_lnd(): allocation error1 for ldecomp, etc'
+ write(iulog,*) 'decompInit_lnd(): allocation error1 for gdc2glo , etc'
call endrun(msg=errMsg(sourcefile, __LINE__))
end if
+ gdc2glo(:) = 0
allocate(clumpcnt(nclumps),stat=ier)
if (ier /= 0) then
write(iulog,*) 'decompInit_lnd(): allocation error1 for clumpcnt'
call endrun(msg=errMsg(sourcefile, __LINE__))
end if
- ldecomp%gdc2glo(:) = 0
- ag = 0
-
! clumpcnt is the start gdc index of each clump
+ ag = 0
clumpcnt = 0
ag = 1
do pid = 0,npes-1
@@ -276,29 +275,26 @@ subroutine decompInit_lnd(lni,lnj,amask)
cid = lcid(an)
if (cid > 0) then
ag = clumpcnt(cid)
- ldecomp%gdc2glo(ag) = an
+ gdc2glo(ag) = an
clumpcnt(cid) = clumpcnt(cid) + 1
end if
end do
end do
- deallocate(clumpcnt)
-
- ! Set gsMap_lnd_gdc2glo (the global index here includes mask=0 or ocean points)
-
- call get_proc_bounds(beg, end)
-
- allocate(gindex(beg:end))
- do n = beg,end
- gindex(n) = ldecomp%gdc2glo(n)
+ ! Initialize global gindex (non-compressed, includes ocean points)
+ ! Note that gindex_global goes from (1:endg)
+ nglob_x = lni ! decompMod module variables
+ nglob_y = lnj ! decompMod module variables
+ call get_proc_bounds(bounds)
+ allocate(gindex_global(1:bounds%endg))
+ do n = procinfo%begg,procinfo%endg
+ gindex_global(n-procinfo%begg+1) = gdc2glo(n)
enddo
- lsize = end-beg+1
- gsize = lni * lnj
- call mct_gsMap_init(gsMap_lnd_gdc2glo, gindex, mpicom, comp_id, lsize, gsize)
- deallocate(gindex)
- ! Diagnostic output
+ deallocate(clumpcnt)
+ deallocate(gdc2glo)
+ ! Diagnostic output
if (masterproc) then
write(iulog,*)' Surface Grid Characteristics'
write(iulog,*)' longitude points = ',lni
@@ -306,127 +302,12 @@ subroutine decompInit_lnd(lni,lnj,amask)
write(iulog,*)' total number of land gridcells = ',numg
write(iulog,*)' Decomposition Characteristics'
write(iulog,*)' clumps per process = ',clump_pproc
- write(iulog,*)' gsMap Characteristics'
- write(iulog,*) ' lnd gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_lnd_gdc2glo)
write(iulog,*)
end if
-
call shr_sys_flush(iulog)
end subroutine decompInit_lnd
- !------------------------------------------------------------------------------
- subroutine decompInit_lnd3D(lni,lnj,lnk)
- !
- ! !DESCRIPTION:
- !
- ! Create a 3D decomposition gsmap for the global 2D grid with soil levels
- ! as the 3rd dimesnion.
- !
- ! !USES:
- !
- ! !ARGUMENTS:
- implicit none
- integer , intent(in) :: lni,lnj,lnk ! domain global size
- !
- ! !LOCAL VARIABLES:
- integer :: m,n,k ! indices
- integer :: begg,endg,lsize,gsize ! used for gsmap init
- integer :: begg3d,endg3d
- integer, pointer :: gindex(:) ! global index for gsmap init
-
-
- ! Set gsMap_lnd_gdc2glo (the global index here includes mask=0 or ocean points)
- call get_proc_bounds(begg, endg)
- begg3d = (begg-1)*lnk + 1
- endg3d = endg*lnk
- lsize = (endg3d - begg3d + 1 )
- allocate(gindex(begg3d:endg3d))
- do k = 1, lnk
- do n = begg,endg
- m = (begg-1)*lnk + (k-1)*(endg-begg+1) + (n-begg+1)
- gindex(m) = ldecomp%gdc2glo(n) + (k-1)*(lni*lnj)
- enddo
- enddo
- gsize = lni * lnj * lnk
- call mct_gsMap_init(gsMap_lnd2Dsoi_gdc2glo, gindex, mpicom, comp_id, lsize, gsize)
-
- ! Diagnostic output
-
- if (masterproc) then
- write(iulog,*)' 3D GSMap'
- write(iulog,*)' longitude points = ',lni
- write(iulog,*)' latitude points = ',lnj
- write(iulog,*)' soil levels = ',lnk
- write(iulog,*)' gsize = ',gsize
- write(iulog,*)' lsize = ',lsize
- write(iulog,*)' bounds(gindex) = ',size(gindex)
- write(iulog,*)' gsMap Characteristics'
- write(iulog,*) ' lnd gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_lnd2Dsoi_gdc2glo)
- write(iulog,*)
- end if
-
- deallocate(gindex)
-
- call shr_sys_flush(iulog)
-
- end subroutine decompInit_lnd3D
-
- !------------------------------------------------------------------------------
- subroutine decompInit_ocn(ni, nj, amask, gindex_ocn)
-
- ! !DESCRIPTION:
- ! calculate a decomposition of only ocn points (needed for the nuopc interface)
-
- ! !USES:
- use spmdMod , only : npes, iam
-
- ! !ARGUMENTS:
- integer , intent(in) :: amask(:)
- integer , intent(in) :: ni,nj ! domain global size
- integer , pointer, intent(out) :: gindex_ocn(:) ! this variable is allocated here, and is assumed to start unallocated
-
- ! !LOCAL VARIABLES:
- integer :: n,i,j,nocn
- integer :: nlnd_global
- integer :: nocn_global
- integer :: nocn_local
- integer :: my_ocn_start, my_ocn_end
- !------------------------------------------------------------------------------
-
- ! count total land and ocean gridcells
- nlnd_global = 0
- nocn_global = 0
- do n = 1,ni*nj
- if (amask(n) == 1) then
- nlnd_global = nlnd_global + 1
- else
- nocn_global = nocn_global + 1
- endif
- enddo
-
- ! create the a global index array for ocean points
- nocn_local = nocn_global / npes
-
- my_ocn_start = nocn_local*iam + min(iam, mod(nocn_global, npes)) + 1
- if (iam < mod(nocn_global, npes)) then
- nocn_local = nocn_local + 1
- end if
- my_ocn_end = my_ocn_start + nocn_local - 1
-
- allocate(gindex_ocn(nocn_local))
- nocn = 0
- do n = 1,ni*nj
- if (amask(n) == 0) then
- nocn = nocn + 1
- if (nocn >= my_ocn_start .and. nocn <= my_ocn_end) then
- gindex_ocn(nocn - my_ocn_start + 1) = n
- end if
- end if
- end do
-
- end subroutine decompInit_ocn
-
!------------------------------------------------------------------------------
subroutine decompInit_clumps(lni,lnj,glc_behavior)
!
@@ -436,35 +317,41 @@ subroutine decompInit_clumps(lni,lnj,glc_behavior)
! set by clump_pproc
!
! !USES:
- use subgridMod, only : subgrid_get_gcellinfo
- use spmdMod
+ use subgridMod , only : subgrid_get_gcellinfo
+ use decompMod , only : bounds_type, clumps, nclumps, procinfo
+ use decompMod , only : get_proc_global, get_proc_bounds
+ use decompMod , only : numg, numl, numc, nump, numCohort
+ use decompMod , only : gindex_global
+ use glcBehaviorMod , only : glc_behavior_type
!
! !ARGUMENTS:
- implicit none
- integer , intent(in) :: lni,lnj ! land domain global size
- type(glc_behavior_type), intent(in) :: glc_behavior
+ integer , intent(in) :: lni,lnj ! land domain global size
+ type(glc_behavior_type) , intent(in) :: glc_behavior
!
! !LOCAL VARIABLES:
- integer :: ln,an ! indices
- integer :: i,g,l,k ! indices
- integer :: cid,pid ! indices
- integer :: n,m,np ! indices
- integer :: anumg ! lnd num gridcells
- integer :: icells ! temporary
- integer :: begg, endg ! temporary
- integer :: ilunits ! temporary
- integer :: icols ! temporary
- integer :: ipatches ! temporary
- integer :: icohorts ! temporary
- integer :: ier ! error code
- integer, allocatable :: allvecg(:,:) ! temporary vector "global"
+ integer :: ln,an ! indices
+ integer :: i,g,l,k ! indices
+ integer :: cid,pid ! indices
+ integer :: n,m,np ! indices
+ integer :: anumg ! lnd num gridcells
+ integer :: icells ! temporary
+ integer :: begg, endg ! temporary
+ integer :: ilunits ! temporary
+ integer :: icols ! temporary
+ integer :: ipatches ! temporary
+ integer :: icohorts ! temporary
+ integer :: ier ! error code
+ integer :: npmin,npmax,npint ! do loop values for printing
+ integer :: clmin,clmax ! do loop values for printing
+ type(bounds_type) :: bounds ! bounds
+ integer, allocatable :: allvecg(:,:) ! temporary vector "global"
integer, allocatable :: allvecl(:,:) ! temporary vector "local"
- integer :: ntest
character(len=32), parameter :: subname = 'decompInit_clumps'
!------------------------------------------------------------------------------
!--- assign gridcells to clumps (and thus pes) ---
- call get_proc_bounds(begg, endg)
+ call get_proc_bounds(bounds)
+ begg = bounds%begg; endg = bounds%endg
allocate(allvecl(nclumps,5)) ! local clumps [gcells,lunit,cols,patches,coh]
allocate(allvecg(nclumps,5)) ! global clumps [gcells,lunit,cols,patches,coh]
@@ -482,7 +369,7 @@ subroutine decompInit_clumps(lni,lnj,glc_behavior)
allvecg= 0
allvecl= 0
do anumg = begg,endg
- an = ldecomp%gdc2glo(anumg)
+ an = gindex_global(anumg - begg + 1)
cid = lcid(an)
ln = anumg
call subgrid_get_gcellinfo (ln, nlunits=ilunits, ncols=icols, npatches=ipatches, &
@@ -587,97 +474,186 @@ subroutine decompInit_clumps(lni,lnj,glc_behavior)
deallocate(allvecg,allvecl)
deallocate(lcid)
+ ! Diagnostic output
+
+ call get_proc_global(ng=numg, nl=numl, nc=numc, np=nump, nCohorts=numCohort)
+ if (masterproc) then
+ write(iulog,*)' Surface Grid Characteristics'
+ write(iulog,*)' longitude points = ',lni
+ write(iulog,*)' latitude points = ',lnj
+ write(iulog,*)' total number of gridcells = ',numg
+ write(iulog,*)' total number of landunits = ',numl
+ write(iulog,*)' total number of columns = ',numc
+ write(iulog,*)' total number of patches = ',nump
+ write(iulog,*)' total number of cohorts = ',numCohort
+ write(iulog,*)' Decomposition Characteristics'
+ write(iulog,*)' clumps per process = ',clump_pproc
+ write(iulog,*)
+ end if
+
+ ! Write out clump and proc info, one pe at a time,
+ ! barrier to control pes overwriting each other on stdout
+ call shr_sys_flush(iulog)
+ call mpi_barrier(mpicom,ier)
+ npmin = 0
+ npmax = npes-1
+ npint = 1
+ if (dbug == 0) then
+ npmax = 0
+ elseif (dbug == 1) then
+ npmax = min(npes-1,4)
+ elseif (dbug == 2) then
+ npint = npes/8
+ endif
+ do np = npmin,npmax,npint
+ pid = np
+ if (dbug == 1) then
+ if (np == 2) pid=npes/2-1
+ if (np == 3) pid=npes-2
+ if (np == 4) pid=npes-1
+ endif
+ pid = max(pid,0)
+ pid = min(pid,npes-1)
+
+ if (iam == pid) then
+ write(iulog,*)
+ write(iulog,'(4(a,2x,i10))')'proc = ',pid, &
+ ' beg gridcell= ',procinfo%begg,' end gridcell= ',procinfo%endg, &
+ ' gridcells per proc = ',procinfo%ncells
+ write(iulog,'(4(a,2x,i10))')'proc = ',pid, &
+ ' beg landunit= ',procinfo%begl,' end landunit= ',procinfo%endl, &
+ ' landunits per proc = ',procinfo%nlunits
+ write(iulog,'(4(a,2x,i10))')'proc = ',pid, &
+ ' beg column = ',procinfo%begc,' end column = ',procinfo%endc, &
+ ' columns per proc = ',procinfo%ncols
+ write(iulog,'(4(a,2x,i10))')'proc = ',pid, &
+ ' beg patch = ',procinfo%begp,' end patch = ',procinfo%endp, &
+ ' patches per proc = ',procinfo%npatches
+ write(iulog,'(4(a,2x,i10))')'proc = ',pid, &
+ ' beg cohort = ',procinfo%begCohort,' end cohort = ',procinfo%endCohort, &
+ ' coh per proc = ',procinfo%nCohorts
+ write(iulog,'(2(a,2x,i10))')'proc = ',pid,' nclumps = ',procinfo%nclumps
+ if (dbug == 0) then
+ clmax = -1
+ else
+ clmax = procinfo%nclumps
+ endif
+ do n = 1,clmax
+ cid = procinfo%cid(n)
+ write(iulog,'(6(a,2x,i10))')'proc = ',pid,' clump no = ',n, &
+ ' clump id= ',procinfo%cid(n), &
+ ' beg gridcell= ',clumps(cid)%begg,' end gridcell= ',clumps(cid)%endg, &
+ ' gridcells per clump= ',clumps(cid)%ncells
+ write(iulog,'(6(a,2x,i10))')'proc = ',pid,' clump no = ',n, &
+ ' clump id= ',procinfo%cid(n), &
+ ' beg landunit= ',clumps(cid)%begl,' end landunit= ',clumps(cid)%endl, &
+ ' landunits per clump = ',clumps(cid)%nlunits
+ write(iulog,'(6(a,2x,i10))')'proc = ',pid,' clump no = ',n, &
+ ' clump id= ',procinfo%cid(n), &
+ ' beg column = ',clumps(cid)%begc,' end column = ',clumps(cid)%endc, &
+ ' columns per clump = ',clumps(cid)%ncols
+ write(iulog,'(6(a,2x,i10))')'proc = ',pid,' clump no = ',n, &
+ ' clump id= ',procinfo%cid(n), &
+ ' beg patch = ',clumps(cid)%begp,' end patch = ',clumps(cid)%endp, &
+ ' patches per clump = ',clumps(cid)%npatches
+ write(iulog,'(6(a,2x,i10))')'proc = ',pid,' clump no = ',n, &
+ ' clump id= ',procinfo%cid(n), &
+ ' beg cohort = ',clumps(cid)%begCohort,' end cohort = ',clumps(cid)%endCohort, &
+ ' cohorts per clump = ',clumps(cid)%nCohorts
+
+ end do
+ end if
+ call shr_sys_flush(iulog)
+ call mpi_barrier(mpicom,ier)
+ end do
+ write(iulog,*)
+ call shr_sys_flush(iulog)
+
end subroutine decompInit_clumps
!------------------------------------------------------------------------------
subroutine decompInit_glcp(lni,lnj,glc_behavior)
!
! !DESCRIPTION:
- ! Determine gsMaps for landunits, columns, patches and cohorts
+ ! Determine gindex for landunits, columns, patches and cohorts
!
! !USES:
- use spmdMod
- use spmdGathScatMod
- use subgridMod, only : subgrid_get_gcellinfo
+ use clm_varctl , only : use_fates
+ use subgridMod , only : subgrid_get_gcellinfo
+ use decompMod , only : bounds_type, get_proc_global, get_proc_bounds
+ use decompMod , only : gindex_global
+ use decompMod , only : gindex_grc, gindex_lun, gindex_col, gindex_patch, gindex_Cohort
+ use decompMod , only : procinfo, clump_type, clumps, get_proc_global
+ use LandunitType , only : lun
+ use ColumnType , only : col
+ use PatchType , only : patch
+ use FatesInterfaceTypesMod , only : fates_maxElementsPerSite
+ use glcBehaviorMod , only : glc_behavior_type
!
! !ARGUMENTS:
- implicit none
- integer , intent(in) :: lni,lnj ! land domain global size
- type(glc_behavior_type), intent(in) :: glc_behavior
+ integer , intent(in) :: lni,lnj ! land domain global size
+ type(glc_behavior_type) , intent(in) :: glc_behavior
!
! !LOCAL VARIABLES:
- integer :: gi,li,ci,pi,coi ! indices
- integer :: i,g,k,l,n,np ! indices
- integer :: cid,pid ! indices
- integer :: begg,endg ! beg,end gridcells
- integer :: begl,endl ! beg,end landunits
- integer :: begc,endc ! beg,end columns
- integer :: begp,endp ! beg,end patches
- integer :: begCohort,endCohort! beg,end cohorts
- integer :: numg ! total number of gridcells across all processors
- integer :: numl ! total number of landunits across all processors
- integer :: numc ! total number of columns across all processors
- integer :: nump ! total number of patches across all processors
- integer :: numCohort ! fates cohorts
- integer :: icells ! temporary
- integer :: ilunits ! temporary
- integer :: icols ! temporary
- integer :: ipatches ! temporary
- integer :: icohorts ! temporary
- integer :: ier ! error code
- integer :: npmin,npmax,npint ! do loop values for printing
- integer :: clmin,clmax ! do loop values for printing
- integer :: locsize,globsize ! used for gsMap init
- integer :: ng ! number of gridcells in gsMap_lnd_gdc2glo
- integer :: val1, val2 ! temporaries
- integer, pointer :: gindex(:) ! global index for gsMap init
- integer, pointer :: arrayglob(:) ! temporaroy
- integer, pointer :: gstart(:), gcount(:)
- integer, pointer :: lstart(:), lcount(:)
- integer, pointer :: cstart(:), ccount(:)
- integer, pointer :: pstart(:), pcount(:)
- integer, pointer :: coStart(:), coCount(:)
- integer, pointer :: ioff(:)
- integer, parameter :: dbug=1 ! 0 = min, 1=normal, 2=much, 3=max
- character(len=32), parameter :: subname = 'decompInit_glcp'
+ integer :: gi,li,ci,pi,coi ! indices
+ integer :: i,l,n,np ! indices
+ integer :: cid,pid ! indices
+ integer :: numg ! total number of land gridcells across all processors
+ integer :: numl ! total number of landunits across all processors
+ integer :: numc ! total number of columns across all processors
+ integer :: nump ! total number of patches across all processors
+ integer :: numCohort ! fates cohorts
+ integer :: ilunits ! temporary
+ integer :: icols ! temporary
+ integer :: ipatches ! temporary
+ integer :: icohorts ! temporary
+ integer :: ier ! error code
+ integer, pointer :: gcount(:)
+ integer, pointer :: lcount(:)
+ integer, pointer :: ccount(:)
+ integer, pointer :: pcount(:)
+ integer, pointer :: coCount(:)
+ type(bounds_type) :: bounds
+ integer, allocatable :: ioff(:)
+ integer, allocatable :: gridcells_per_pe(:) ! needed for gindex at all levels
+ integer, allocatable :: gridcell_offsets(:) ! needed for gindex at all levels
+ integer, allocatable :: index_gridcells(:) ! needed for gindex at all levels
+ integer, allocatable :: start_global(:)
+ integer, allocatable :: start(:)
+ integer, allocatable :: index_lndgridcells(:)
+ integer :: count
+ integer :: temp
+ integer :: lsize_g, lsize_l, lsize_c, lsize_p, lsize_cohort
+ integer :: gsize
+ Character(len=32), parameter :: subname = 'decompInit_glcp'
!------------------------------------------------------------------------------
- !init
+ ! Get processor bounds
- call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp, &
- begCohort, endCohort)
+ call get_proc_bounds(bounds)
call get_proc_global(ng=numg, nl=numl, nc=numc, np=nump, nCohorts=numCohort)
- ! Determine global seg megs
-
- allocate(gstart(begg:endg))
- gstart(:) = 0
- allocate(gcount(begg:endg))
- gcount(:) = 0
- allocate(lstart(begg:endg))
- lstart(:) = 0
- allocate(lcount(begg:endg))
- lcount(:) = 0
- allocate(cstart(begg:endg))
- cstart(:) = 0
- allocate(ccount(begg:endg))
- ccount(:) = 0
- allocate(pstart(begg:endg))
- pstart(:) = 0
- allocate(pcount(begg:endg))
- pcount(:) = 0
- if ( use_fates ) then
- allocate(coStart(begg:endg))
- coStart(:) = 0
- endif
- allocate(coCount(begg:endg))
- coCount(:) = 0
- allocate(ioff(begg:endg))
- ioff(:) = 0
-
- ! Determine gcount, lcount, ccount and pcount
-
- do gi = begg,endg
+ lsize_g = bounds%endg
+ lsize_l = bounds%endl
+ lsize_c = bounds%endc
+ lsize_p = bounds%endp
+ lsize_cohort = bounds%endCohort
+ gsize = nglob_x * nglob_y
+
+ ! allocate module variables in decompMod.F90
+ allocate(gindex_grc(lsize_g))
+ allocate(gindex_lun(lsize_l))
+ allocate(gindex_col(lsize_c))
+ allocate(gindex_patch(lsize_p))
+ allocate(gindex_cohort(lsize_cohort))
+
+ ! Determine counts
+ allocate(gcount(lsize_g)) ; gcount(:) = 0
+ allocate(lcount(lsize_g)) ; lcount(:) = 0
+ allocate(ccount(lsize_g)) ; ccount(:) = 0
+ allocate(pcount(lsize_g)) ; pcount(:) = 0
+ allocate(coCount(lsize_g)) ; coCount(:) = 0
+ do gi = 1,lsize_g
call subgrid_get_gcellinfo (gi, nlunits=ilunits, ncols=icols, npatches=ipatches, &
ncohorts=icohorts, glc_behavior=glc_behavior)
gcount(gi) = 1 ! number of gridcells for local gridcell index gi
@@ -687,316 +663,195 @@ subroutine decompInit_glcp(lni,lnj,glc_behavior)
coCount(gi) = icohorts ! number of fates cohorts for local gricell index gi
enddo
- ! Determine gstart, lstart, cstart, pstart, coStart for the OUTPUT 1d data structures
-
- ! gather the gdc subgrid counts to masterproc in glo order
- ! compute glo ordered start indices from the counts
- ! scatter the subgrid start indices back out to the gdc gridcells
- ! set the local gindex array for the subgrid from the subgrid start and count arrays
+ ! ---------------------------------------
+ ! Arrays needed to determine gindex_xxx(:)
+ ! ---------------------------------------
- ng = mct_gsmap_gsize(gsmap_lnd_gdc2glo)
- allocate(arrayglob(ng))
+ allocate(ioff(lsize_g))
- arrayglob(:) = 0
- call gather_data_to_master(gcount, arrayglob, grlnd)
if (masterproc) then
- val1 = arrayglob(1)
- arrayglob(1) = 1
- do n = 2,ng
- val2 = arrayglob(n)
- arrayglob(n) = arrayglob(n-1) + val1
- val1 = val2
- enddo
+ allocate (gridcells_per_pe(0:npes-1))
+ else
+ allocate(gridcells_per_pe(0))
endif
- call scatter_data_from_master(gstart, arrayglob, grlnd)
+ call mpi_gather(lsize_g, 1, MPI_INTEGER, gridcells_per_pe, 1, MPI_INTEGER, 0, mpicom, ier)
- ! lstart for gridcell (n) is the total number of the landunits
- ! over gridcells 1->n-1
-
- arrayglob(:) = 0
- call gather_data_to_master(lcount, arrayglob, grlnd)
if (masterproc) then
- val1 = arrayglob(1)
- arrayglob(1) = 1
- do n = 2,ng
- val2 = arrayglob(n)
- arrayglob(n) = arrayglob(n-1) + val1
- val1 = val2
- enddo
- endif
- call scatter_data_from_master(lstart, arrayglob, grlnd)
+ allocate(gridcell_offsets(0:npes-1))
+ gridcell_offsets(0) = 0
+ do n = 1 ,npes-1
+ gridcell_offsets(n) = gridcell_offsets(n-1) + gridcells_per_pe(n-1)
+ end do
+ else
+ allocate(gridcell_offsets(0))
+ end if
- arrayglob(:) = 0
- call gather_data_to_master(ccount, arrayglob, grlnd)
if (masterproc) then
- val1 = arrayglob(1)
- arrayglob(1) = 1
- do n = 2,ng
- val2 = arrayglob(n)
- arrayglob(n) = arrayglob(n-1) + val1
- val1 = val2
- enddo
- endif
- call scatter_data_from_master(cstart, arrayglob, grlnd)
+ allocate(start_global(numg)) ! number of landunits in a gridcell
+ else
+ allocate(start_global(0))
+ end if
- arrayglob(:) = 0
- call gather_data_to_master(pcount, arrayglob, grlnd)
- if (masterproc) then
- val1 = arrayglob(1)
- arrayglob(1) = 1
- do n = 2,ng
- val2 = arrayglob(n)
- arrayglob(n) = arrayglob(n-1) + val1
- val1 = val2
- enddo
- endif
- call scatter_data_from_master(pstart, arrayglob, grlnd)
+ allocate(start(lsize_g))
- if ( use_fates ) then
- arrayglob(:) = 0
- call gather_data_to_master(coCount, arrayglob, grlnd)
- if (masterproc) then
- val1 = arrayglob(1)
- arrayglob(1) = 1
- do n = 2,ng
- val2 = arrayglob(n)
- arrayglob(n) = arrayglob(n-1) + val1
- val1 = val2
- enddo
- endif
- call scatter_data_from_master(coStart, arrayglob, grlnd)
- endif
+ ! ---------------------------------------
+ ! Gridcell gindex (compressed, no ocean points)
+ ! ---------------------------------------
- deallocate(arrayglob)
+ ! gstart_global the global index of all of the land points in task order
+ call mpi_gatherv(gindex_global, lsize_g, MPI_INTEGER, start_global, &
+ gridcells_per_pe, gridcell_offsets, MPI_INTEGER, 0, mpicom, ier)
- ! Gridcell gsmap (compressed, no ocean points)
+ if (masterproc) then
+ ! Create a global size index_gridcells that will have 0 for all ocean points
+ ! Fill the location of each land point with the gatherv location of that land point
+ allocate(index_gridcells(gsize))
+ index_gridcells(:) = 0
+ do n = 1,numg
+ ! if n = 3, start_global(3)=100, index_gridcells(100)=3
+ ! n is the task order location - so for global index 100 - the task order location is 3
+ index_gridcells(start_global(n)) = n
+ end do
+
+ ! Create a land-only global index based on the original global index ordering
+ ! Count is the running global land index
+ allocate(index_lndgridcells(numg))
+ count = 0
+ do n = 1,gsize
+ if (index_gridcells(n) > 0) then
+ count = count + 1
+ ! e.g. n=20, count=4 and index_gridcells(20)=100, then start_global(100)=4
+ start_global(index_gridcells(n)) = count
+ index_lndgridcells(count) = index_gridcells(n)
+ end if
+ end do
+ deallocate(index_gridcells)
+ end if
- allocate(gindex(begg:endg))
- i = begg-1
- do gi = begg,endg
- if (gcount(gi) < 1) then
- write(iulog,*) 'decompInit_glcp warning count g ',k,iam,g,gcount(g)
- endif
- do l = 1,gcount(gi)
- i = i + 1
- if (i < begg .or. i > endg) then
- write(iulog,*) 'decompInit_glcp error i ',i,begg,endg
- call endrun(msg=errMsg(sourcefile, __LINE__))
- endif
- gindex(i) = gstart(gi) + l - 1
- enddo
- enddo
- if (i /= endg) then
- write(iulog,*) 'decompInit_glcp error size ',i,begg,endg
- call endrun(msg=errMsg(sourcefile, __LINE__))
- endif
- locsize = endg-begg+1
- globsize = numg
- call mct_gsMap_init(gsmap_gce_gdc2glo, gindex, mpicom, comp_id, locsize, globsize)
- deallocate(gindex)
+ ! Determine gindex_grc
+ call mpi_scatterv(start_global, gridcells_per_pe, gridcell_offsets, MPI_INTEGER, gindex_grc, &
+ lsize_g, MPI_INTEGER, 0, mpicom, ier)
+ deallocate(gcount)
+
+ ! ---------------------------------------
+ ! Landunit gindex
+ ! ---------------------------------------
- ! Landunit gsmap
+ start(:) = 0
+ call mpi_gatherv(lcount, lsize_g, MPI_INTEGER, start_global, &
+ gridcells_per_pe, gridcell_offsets, MPI_INTEGER, 0, mpicom, ier)
+ if (masterproc) then
+ count = 1
+ do n = 1,numg
+ temp = start_global(index_lndgridcells(n))
+ start_global(index_lndgridcells(n)) = count
+ count = count + temp
+ end do
+ endif
+ call mpi_scatterv(start_global, gridcells_per_pe, gridcell_offsets, MPI_INTEGER, start, &
+ lsize_g, MPI_INTEGER, 0, mpicom, ier)
- allocate(gindex(begl:endl))
ioff(:) = 0
- do li = begl,endl
- gi = lun%gridcell(li) !===this is determined internally from how landunits are spread out in memory
- gindex(li) = lstart(gi) + ioff(gi) !=== the output gindex is ALWAYS the same regardless of how landuntis are spread out in memory
+ do li = 1,lsize_l
+ gi = lun%gridcell(li)
+ gindex_lun(li) = start(gi) + ioff(gi)
ioff(gi) = ioff(gi) + 1
- ! check that this is less than [lstart(gi) + lcount(gi)]
enddo
- locsize = endl-begl+1
- globsize = numl
- call mct_gsMap_init(gsmap_lun_gdc2glo, gindex, mpicom, comp_id, locsize, globsize)
- deallocate(gindex)
+ deallocate(lcount)
- ! Column gsmap
+ ! ---------------------------------------
+ ! Column gindex
+ ! ---------------------------------------
+
+ start(:) = 0
+ call mpi_gatherv(ccount, lsize_g, MPI_INTEGER, start_global, &
+ gridcells_per_pe, gridcell_offsets, MPI_INTEGER, 0, mpicom, ier)
+ if (masterproc) then
+ count = 1
+ do n = 1,numg
+ temp = start_global(index_lndgridcells(n))
+ start_global(index_lndgridcells(n)) = count
+ count = count + temp
+ end do
+ endif
+ call mpi_scatterv(start_global, gridcells_per_pe, gridcell_offsets, MPI_INTEGER, start, &
+ lsize_g, MPI_INTEGER, 0, mpicom, ier)
- allocate(gindex(begc:endc))
ioff(:) = 0
- do ci = begc,endc
+ do ci = 1,lsize_c
gi = col%gridcell(ci)
- gindex(ci) = cstart(gi) + ioff(gi)
+ gindex_col(ci) = start(gi) + ioff(gi)
ioff(gi) = ioff(gi) + 1
- ! check that this is less than [cstart(gi) + ccount(gi)]
enddo
- locsize = endc-begc+1
- globsize = numc
- call mct_gsMap_init(gsmap_col_gdc2glo, gindex, mpicom, comp_id, locsize, globsize)
- deallocate(gindex)
+ deallocate(ccount)
- ! PATCH gsmap
+ ! ---------------------------------------
+ ! PATCH gindex
+ ! ---------------------------------------
+
+ start(:) = 0
+ call mpi_gatherv(pcount, lsize_g, MPI_INTEGER, start_global, &
+ gridcells_per_pe, gridcell_offsets, MPI_INTEGER, 0, mpicom, ier)
+ if (masterproc) then
+ count = 1
+ do n = 1,numg
+ temp = start_global(index_lndgridcells(n))
+ start_global(index_lndgridcells(n)) = count
+ count = count + temp
+ end do
+ endif
+ call mpi_scatterv(start_global, gridcells_per_pe, gridcell_offsets, MPI_INTEGER, start, &
+ lsize_g, MPI_INTEGER, 0, mpicom, ier)
- allocate(gindex(begp:endp))
ioff(:) = 0
- do pi = begp,endp
+ do pi = 1,lsize_p
gi = patch%gridcell(pi)
- gindex(pi) = pstart(gi) + ioff(gi)
+ gindex_patch(pi) = start(gi) + ioff(gi)
ioff(gi) = ioff(gi) + 1
- ! check that this is less than [pstart(gi) + pcount(gi)]
enddo
- locsize = endp-begp+1
- globsize = nump
- call mct_gsMap_init(gsmap_patch_gdc2glo, gindex, mpicom, comp_id, locsize, globsize)
- deallocate(gindex)
+ deallocate(pcount)
- ! FATES gsmap for the cohort/element vector
+ ! ---------------------------------------
+ ! FATES gindex for the cohort/element vector
+ ! ---------------------------------------
if ( use_fates ) then
- allocate(gindex(begCohort:endCohort))
+ start(:) = 0
+ call mpi_gatherv(coCount, lsize_g, MPI_INTEGER, start_global, &
+ gridcells_per_pe, gridcell_offsets, MPI_INTEGER, 0, mpicom, ier)
+ if (masterproc) then
+ count = 1
+ do n = 1,numg
+ temp = start_global(index_lndgridcells(n))
+ start_global(index_lndgridcells(n)) = count
+ count = count + temp
+ end do
+ endif
+ call mpi_scatterv(start_global, gridcells_per_pe, gridcell_offsets, MPI_INTEGER, start, &
+ lsize_g, MPI_INTEGER, 0, mpicom, ier)
+
ioff(:) = 0
- gi = begg
- do coi = begCohort,endCohort
- gindex(coi) = coStart(gi) + ioff(gi)
+ gi = 1
+ do coi = 1, lsize_cohort
+ gindex_cohort(coi) = start(gi) + ioff(gi)
ioff(gi) = ioff(gi) + 1
- if ( mod(coi, fates_maxElementsPerSite ) == 0 ) gi = gi + 1
+ if ( mod(coi, fates_maxElementsPerSite ) == 0 ) then
+ gi = gi + 1
+ end if
enddo
- locsize = endCohort-begCohort+1
- globsize = numCohort
- call mct_gsMap_init(gsMap_cohort_gdc2glo, gindex, mpicom, comp_id, locsize, globsize)
- deallocate(gindex)
- endif
-
- ! Deallocate start/count arrays
- deallocate(gstart, gcount)
- deallocate(lstart, lcount)
- deallocate(cstart, ccount)
- deallocate(pstart, pcount)
- if ( use_fates ) then
- deallocate(coStart,coCount)
+ deallocate(coCount)
endif
- deallocate(ioff)
-
- ! Diagnostic output
-
- if (masterproc) then
- write(iulog,*)' Surface Grid Characteristics'
- write(iulog,*)' longitude points = ',lni
- write(iulog,*)' latitude points = ',lnj
- write(iulog,*)' total number of gridcells = ',numg
- write(iulog,*)' total number of landunits = ',numl
- write(iulog,*)' total number of columns = ',numc
- write(iulog,*)' total number of patches = ',nump
- write(iulog,*)' total number of cohorts = ',numCohort
- write(iulog,*)' Decomposition Characteristics'
- write(iulog,*)' clumps per process = ',clump_pproc
- write(iulog,*)' gsMap Characteristics'
- write(iulog,*) ' lnd gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_lnd_gdc2glo)
- write(iulog,*) ' gce gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_gce_gdc2glo)
- write(iulog,*) ' lun gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_lun_gdc2glo)
- write(iulog,*) ' col gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_col_gdc2glo)
- write(iulog,*) ' patch gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_patch_gdc2glo)
- write(iulog,*) ' coh gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_cohort_gdc2glo)
- write(iulog,*)
- end if
- ! Write out clump and proc info, one pe at a time,
- ! barrier to control pes overwriting each other on stdout
-
- call shr_sys_flush(iulog)
- call mpi_barrier(mpicom,ier)
- npmin = 0
- npmax = npes-1
- npint = 1
- if (dbug == 0) then
- npmax = 0
- elseif (dbug == 1) then
- npmax = min(npes-1,4)
- elseif (dbug == 2) then
- npint = npes/8
- endif
- do np = npmin,npmax,npint
- pid = np
- if (dbug == 1) then
- if (np == 2) pid=npes/2-1
- if (np == 3) pid=npes-2
- if (np == 4) pid=npes-1
- endif
- pid = max(pid,0)
- pid = min(pid,npes-1)
+ ! ---------------------------------------
+ ! Deallocate memory
+ ! ---------------------------------------
- if (iam == pid) then
- write(iulog,*)
- write(iulog,*)'proc= ',pid,&
- ' beg gridcell= ',procinfo%begg, &
- ' end gridcell= ',procinfo%endg, &
- ' total gridcells per proc= ',procinfo%ncells
- write(iulog,*)'proc= ',pid,&
- ' beg landunit= ',procinfo%begl, &
- ' end landunit= ',procinfo%endl, &
- ' total landunits per proc= ',procinfo%nlunits
- write(iulog,*)'proc= ',pid,&
- ' beg column = ',procinfo%begc, &
- ' end column = ',procinfo%endc, &
- ' total columns per proc = ',procinfo%ncols
- write(iulog,*)'proc= ',pid,&
- ' beg patch = ',procinfo%begp, &
- ' end patch = ',procinfo%endp, &
- ' total patches per proc = ',procinfo%npatches
- write(iulog,*)'proc= ',pid,&
- ' beg coh = ',procinfo%begCohort, &
- ' end coh = ',procinfo%endCohort, &
- ' total coh per proc = ',procinfo%nCohorts
- write(iulog,*)'proc= ',pid,&
- ' lnd ngseg = ',mct_gsMap_ngseg(gsMap_lnd_gdc2glo), &
- ' lnd nlseg = ',mct_gsMap_nlseg(gsMap_lnd_gdc2glo,iam)
- write(iulog,*)'proc= ',pid,&
- ' gce ngseg = ',mct_gsMap_ngseg(gsMap_gce_gdc2glo), &
- ' gce nlseg = ',mct_gsMap_nlseg(gsMap_gce_gdc2glo,iam)
- write(iulog,*)'proc= ',pid,&
- ' lun ngseg = ',mct_gsMap_ngseg(gsMap_lun_gdc2glo), &
- ' lun nlseg = ',mct_gsMap_nlseg(gsMap_lun_gdc2glo,iam)
- write(iulog,*)'proc= ',pid,&
- ' col ngseg = ',mct_gsMap_ngseg(gsMap_col_gdc2glo), &
- ' col nlseg = ',mct_gsMap_nlseg(gsMap_col_gdc2glo,iam)
- write(iulog,*)'proc= ',pid,&
- ' patch ngseg = ',mct_gsMap_ngseg(gsMap_patch_gdc2glo), &
- ' patch nlseg = ',mct_gsMap_nlseg(gsMap_patch_gdc2glo,iam)
- write(iulog,*)'proc= ',pid,&
- ' coh ngseg = ',mct_gsMap_ngseg(gsMap_cohort_gdc2glo), &
- ' coh nlseg = ',mct_gsMap_nlseg(gsMap_cohort_gdc2glo,iam)
- write(iulog,*)'proc= ',pid,' nclumps = ',procinfo%nclumps
-
- clmin = 1
- clmax = procinfo%nclumps
- if (dbug == 1) then
- clmax = 1
- elseif (dbug == 0) then
- clmax = -1
- endif
- do n = clmin,clmax
- cid = procinfo%cid(n)
- write(iulog,*)'proc= ',pid,' clump no = ',n, &
- ' clump id= ',procinfo%cid(n), &
- ' beg gridcell= ',clumps(cid)%begg, &
- ' end gridcell= ',clumps(cid)%endg, &
- ' total gridcells per clump= ',clumps(cid)%ncells
- write(iulog,*)'proc= ',pid,' clump no = ',n, &
- ' clump id= ',procinfo%cid(n), &
- ' beg landunit= ',clumps(cid)%begl, &
- ' end landunit= ',clumps(cid)%endl, &
- ' total landunits per clump = ',clumps(cid)%nlunits
- write(iulog,*)'proc= ',pid,' clump no = ',n, &
- ' clump id= ',procinfo%cid(n), &
- ' beg column = ',clumps(cid)%begc, &
- ' end column = ',clumps(cid)%endc, &
- ' total columns per clump = ',clumps(cid)%ncols
- write(iulog,*)'proc= ',pid,' clump no = ',n, &
- ' clump id= ',procinfo%cid(n), &
- ' beg patch = ',clumps(cid)%begp, &
- ' end patch = ',clumps(cid)%endp, &
- ' total patches per clump = ',clumps(cid)%npatches
- write(iulog,*)'proc= ',pid,' clump no = ',n, &
- ' clump id= ',procinfo%cid(n), &
- ' beg cohort = ',clumps(cid)%begCohort, &
- ' end cohort = ',clumps(cid)%endCohort, &
- ' total cohorts per clump = ',clumps(cid)%nCohorts
- end do
- end if
- call shr_sys_flush(iulog)
- call mpi_barrier(mpicom,ier)
- end do
- call shr_sys_flush(iulog)
+ deallocate(ioff)
+ deallocate(gridcells_per_pe)
+ deallocate(gridcell_offsets)
+ deallocate(start)
+ deallocate(start_global)
+ if (allocated(index_lndgridcells)) deallocate(index_lndgridcells)
end subroutine decompInit_glcp
diff --git a/src/main/decompMod.F90 b/src/main/decompMod.F90
index 3f885e090b..0b4142dc9e 100644
--- a/src/main/decompMod.F90
+++ b/src/main/decompMod.F90
@@ -7,15 +7,12 @@ module decompMod
!
! !USES:
use shr_kind_mod, only : r8 => shr_kind_r8
- ! Must use shr_sys_abort rather than endrun here to avoid circular dependency
- use shr_sys_mod , only : shr_sys_abort
+
+ use shr_sys_mod , only : shr_sys_abort ! use shr_sys_abort instead of endrun here to avoid circular dependency
use clm_varctl , only : iulog
- use clm_varcon , only : grlnd, nameg, namel, namec, namep, nameCohort
- use mct_mod , only : mct_gsMap
!
! !PUBLIC TYPES:
implicit none
- integer, public :: clump_pproc ! number of clumps per MPI process
! Define possible bounds subgrid levels
integer, parameter, public :: BOUNDS_SUBGRID_GRIDCELL = 1
@@ -29,25 +26,14 @@ module decompMod
integer, parameter, public :: BOUNDS_LEVEL_CLUMP = 2
!
! !PUBLIC MEMBER FUNCTIONS:
-
public get_beg ! get beg bound for a given subgrid level
public get_end ! get end bound for a given subgrid level
public get_proc_clumps ! number of clumps for this processor
public get_proc_total ! total no. of gridcells, landunits, columns and patchs for any processor
public get_proc_global ! total gridcells, landunits, columns, patchs across all processors
public get_clmlevel_gsize ! get global size associated with clmlevel
- public get_clmlevel_gsmap ! get gsmap associated with clmlevel
-
- interface get_clump_bounds
- module procedure get_clump_bounds_old
- module procedure get_clump_bounds_new
- end interface
+ public get_clmlevel_gindex! get global size associated with clmlevel
public get_clump_bounds ! clump beg and end gridcell,landunit,column,patch
-
- interface get_proc_bounds
- module procedure get_proc_bounds_old
- module procedure get_proc_bounds_new
- end interface
public get_proc_bounds ! this processor beg and end gridcell,landunit,column,patch
! !PRIVATE MEMBER FUNCTIONS:
@@ -55,38 +41,30 @@ module decompMod
! !PRIVATE TYPES:
private ! (now mostly public for decompinitmod)
- integer,public :: nclumps ! total number of clumps across all processors
- integer,public :: numg ! total number of gridcells on all procs
- integer,public :: numl ! total number of landunits on all procs
- integer,public :: numc ! total number of columns on all procs
- integer,public :: nump ! total number of patchs on all procs
- integer,public :: numCohort ! total number of fates cohorts on all procs
-
type bounds_type
- integer :: begg, endg ! beginning and ending gridcell index
- integer :: begl, endl ! beginning and ending landunit index
- integer :: begc, endc ! beginning and ending column index
- integer :: begp, endp ! beginning and ending patch index
+ integer :: begg, endg ! beginning and ending gridcell index
+ integer :: begl, endl ! beginning and ending landunit index
+ integer :: begc, endc ! beginning and ending column index
+ integer :: begp, endp ! beginning and ending patch index
integer :: begCohort, endCohort ! beginning and ending cohort indices
-
- integer :: level ! whether defined on the proc or clump level
- integer :: clump_index ! if defined on the clump level, this gives the clump index
+ integer :: level ! whether defined on the proc or clump level
+ integer :: clump_index ! if defined on the clump level, this gives the clump index
end type bounds_type
- public bounds_type
+ public :: bounds_type
!---global information on each pe
type processor_type
- integer :: nclumps ! number of clumps for processor_type iam
- integer,pointer :: cid(:) ! clump indices
- integer :: ncells ! number of gridcells in proc
- integer :: nlunits ! number of landunits in proc
- integer :: ncols ! number of columns in proc
- integer :: npatches ! number of patchs in proc
- integer :: nCohorts ! number of cohorts in proc
- integer :: begg, endg ! beginning and ending gridcell index
- integer :: begl, endl ! beginning and ending landunit index
- integer :: begc, endc ! beginning and ending column index
- integer :: begp, endp ! beginning and ending patch index
+ integer :: nclumps ! number of clumps for processor_type iam
+ integer,pointer :: cid(:) ! clump indices
+ integer :: ncells ! number of gridcells in proc
+ integer :: nlunits ! number of landunits in proc
+ integer :: ncols ! number of columns in proc
+ integer :: npatches ! number of patchs in proc
+ integer :: nCohorts ! number of cohorts in proc
+ integer :: begg, endg ! beginning and ending gridcell index
+ integer :: begl, endl ! beginning and ending landunit index
+ integer :: begc, endc ! beginning and ending column index
+ integer :: begp, endp ! beginning and ending patch index
integer :: begCohort, endCohort ! beginning and ending cohort indices
end type processor_type
public processor_type
@@ -98,7 +76,7 @@ module decompMod
integer :: ncells ! number of gridcells in clump
integer :: nlunits ! number of landunits in clump
integer :: ncols ! number of columns in clump
- integer :: npatches ! number of patchs in clump
+ integer :: npatches ! number of patchs in clump
integer :: nCohorts ! number of cohorts in proc
integer :: begg, endg ! beginning and ending gridcell index
integer :: begl, endl ! beginning and ending landunit index
@@ -109,23 +87,21 @@ module decompMod
public clump_type
type(clump_type),public, allocatable :: clumps(:)
- !---global information on each pe
- !--- glo = 1d global sn ordered
- !--- gdc = 1d global dc ordered compressed
- type decomp_type
- integer,pointer :: gdc2glo(:) ! 1d gdc to 1d glo
- end type decomp_type
- public decomp_type
- type(decomp_type),public,target :: ldecomp
-
- type(mct_gsMap) ,public,target :: gsMap_lnd_gdc2glo ! GS map for full 2D land grid
- type(mct_gsMap) ,public,target :: gsMap_gce_gdc2glo ! GS map for 1D gridcells
- type(mct_gsMap) ,public,target :: gsMap_lun_gdc2glo ! GS map for 1D landunits
- type(mct_gsMap) ,public,target :: gsMap_col_gdc2glo ! GS map for 1d columns
- type(mct_gsMap) ,public,target :: gsMap_patch_gdc2glo ! GS map for 1D patches
- type(mct_gsMap) ,public,target :: gsMap_cohort_gdc2glo ! GS map for 1D cohorts (only for FATES)
-
- type(mct_gsMap) ,public,target :: gsMap_lnd2Dsoi_gdc2glo ! GS map for full 3D land grid with soil levels as 3rd dim
+ ! ---global sizes
+ integer,public :: nclumps ! total number of clumps across all processors
+ integer,public :: numg ! total number of gridcells on all procs
+ integer,public :: numl ! total number of landunits on all procs
+ integer,public :: numc ! total number of columns on all procs
+ integer,public :: nump ! total number of patchs on all procs
+ integer,public :: numCohort ! total number of fates cohorts on all procs
+
+ ! ---NOTE: the following are allocated with a lower bound of 1!
+ integer, public, pointer :: gindex_global(:) => null() ! includes ocean points
+ integer, public, pointer :: gindex_grc(:) => null() ! does not include ocean points
+ integer, public, pointer :: gindex_lun(:) => null()
+ integer, public, pointer :: gindex_col(:) => null()
+ integer, public, pointer :: gindex_patch(:) => null()
+ integer, public, pointer :: gindex_cohort(:) => null()
!------------------------------------------------------------------------------
contains
@@ -186,12 +162,11 @@ pure function get_end(bounds, subgrid_level) result(end_index)
! !USES:
!
! !ARGUMENTS:
- integer :: end_index ! function result
- type(bounds_type), intent(in) :: bounds
- integer, intent(in) :: subgrid_level
+ integer :: end_index ! function result
+ type(bounds_type) , intent(in) :: bounds
+ integer , intent(in) :: subgrid_level
!
! !LOCAL VARIABLES:
-
character(len=*), parameter :: subname = 'get_end'
!-----------------------------------------------------------------------
@@ -213,7 +188,7 @@ pure function get_end(bounds, subgrid_level) result(end_index)
end function get_end
!------------------------------------------------------------------------------
- subroutine get_clump_bounds_new (n, bounds)
+ subroutine get_clump_bounds (n, bounds)
!
! !DESCRIPTION:
! Determine clump bounds
@@ -236,56 +211,30 @@ subroutine get_clump_bounds_new (n, bounds)
! FIX(SPM, 090314) - for debugging fates and openMP
!write(iulog,*) 'SPM omp debug decompMod 1 ', &
!OMP_GET_NUM_THREADS(),OMP_GET_MAX_THREADS(),OMP_GET_THREAD_NUM()
-
if ( OMP_GET_NUM_THREADS() == 1 .and. OMP_GET_MAX_THREADS() > 1 )then
call shr_sys_abort( trim(subname)//' ERROR: Calling from inside a non-threaded region)')
end if
#endif
cid = procinfo%cid(n)
- bounds%begp = clumps(cid)%begp
- bounds%endp = clumps(cid)%endp
- bounds%begc = clumps(cid)%begc
- bounds%endc = clumps(cid)%endc
- bounds%begl = clumps(cid)%begl
- bounds%endl = clumps(cid)%endl
- bounds%begg = clumps(cid)%begg
- bounds%endg = clumps(cid)%endg
- bounds%begCohort = clumps(cid)%begCohort
- bounds%endCohort = clumps(cid)%endCohort
-
+ bounds%begp = clumps(cid)%begp - procinfo%begp + 1
+ bounds%endp = clumps(cid)%endp - procinfo%begp + 1
+ bounds%begc = clumps(cid)%begc - procinfo%begc + 1
+ bounds%endc = clumps(cid)%endc - procinfo%begc + 1
+ bounds%begl = clumps(cid)%begl - procinfo%begl + 1
+ bounds%endl = clumps(cid)%endl - procinfo%begl + 1
+ bounds%begg = clumps(cid)%begg - procinfo%begg + 1
+ bounds%endg = clumps(cid)%endg - procinfo%begg + 1
+ bounds%begCohort = clumps(cid)%begCohort - procinfo%begCohort + 1
+ bounds%endCohort = clumps(cid)%endCohort - procinfo%begCohort + 1
+
bounds%level = BOUNDS_LEVEL_CLUMP
bounds%clump_index = n
- end subroutine get_clump_bounds_new
-
- !------------------------------------------------------------------------------
- subroutine get_clump_bounds_old (n, begg, endg, begl, endl, begc, endc, begp, endp, &
- begCohort, endCohort)
- integer, intent(in) :: n ! proc clump index
- integer, intent(out) :: begp, endp ! clump beg and end patch indices
- integer, intent(out) :: begc, endc ! clump beg and end column indices
- integer, intent(out) :: begl, endl ! clump beg and end landunit indices
- integer, intent(out) :: begg, endg ! clump beg and end gridcell indices
- integer, intent(out) :: begCohort, endCohort ! cohort beg and end gridcell indices
- integer :: cid ! clump id
- !------------------------------------------------------------------------------
-
- cid = procinfo%cid(n)
- begp = clumps(cid)%begp
- endp = clumps(cid)%endp
- begc = clumps(cid)%begc
- endc = clumps(cid)%endc
- begl = clumps(cid)%begl
- endl = clumps(cid)%endl
- begg = clumps(cid)%begg
- endg = clumps(cid)%endg
- begCohort = clumps(cid)%begCohort
- endCohort = clumps(cid)%endCohort
- end subroutine get_clump_bounds_old
+ end subroutine get_clump_bounds
!------------------------------------------------------------------------------
- subroutine get_proc_bounds_new (bounds)
+ subroutine get_proc_bounds (bounds)
!
! !DESCRIPTION:
! Retrieve processor bounds
@@ -306,50 +255,26 @@ subroutine get_proc_bounds_new (bounds)
! FIX(SPM, 090314) - for debugging fates and openMP
!write(*,*) 'SPM omp debug decompMod 2 ', &
!OMP_GET_NUM_THREADS(),OMP_GET_MAX_THREADS(),OMP_GET_THREAD_NUM()
-
if ( OMP_GET_NUM_THREADS() > 1 )then
call shr_sys_abort( trim(subname)//' ERROR: Calling from inside a threaded region')
end if
#endif
- bounds%begp = procinfo%begp
- bounds%endp = procinfo%endp
- bounds%begc = procinfo%begc
- bounds%endc = procinfo%endc
- bounds%begl = procinfo%begl
- bounds%endl = procinfo%endl
- bounds%begg = procinfo%begg
- bounds%endg = procinfo%endg
- bounds%begCohort = procinfo%begCohort
- bounds%endCohort = procinfo%endCohort
+ bounds%begp = 1
+ bounds%endp = procinfo%endp - procinfo%begp + 1
+ bounds%begc = 1
+ bounds%endc = procinfo%endc - procinfo%begc + 1
+ bounds%begl = 1
+ bounds%endl = procinfo%endl - procinfo%begl + 1
+ bounds%begg = 1
+ bounds%endg = procinfo%endg - procinfo%begg + 1
+ bounds%begCohort = 1
+ bounds%endCohort = procinfo%endCohort - procinfo%begCohort + 1
bounds%level = BOUNDS_LEVEL_PROC
bounds%clump_index = -1 ! irrelevant for proc, so assigned a bogus value
- end subroutine get_proc_bounds_new
-
- !------------------------------------------------------------------------------
- subroutine get_proc_bounds_old (begg, endg, begl, endl, begc, endc, begp, endp, &
- begCohort, endCohort)
-
- integer, optional, intent(out) :: begp, endp ! proc beg and end patch indices
- integer, optional, intent(out) :: begc, endc ! proc beg and end column indices
- integer, optional, intent(out) :: begl, endl ! proc beg and end landunit indices
- integer, optional, intent(out) :: begg, endg ! proc beg and end gridcell indices
- integer, optional, intent(out) :: begCohort, endCohort ! cohort beg and end gridcell indices
- !------------------------------------------------------------------------------
-
- if (present(begp)) begp = procinfo%begp
- if (present(endp)) endp = procinfo%endp
- if (present(begc)) begc = procinfo%begc
- if (present(endc)) endc = procinfo%endc
- if (present(begl)) begl = procinfo%begl
- if (present(endl)) endl = procinfo%endl
- if (present(begg)) begg = procinfo%begg
- if (present(endg)) endg = procinfo%endg
- if (present(begCohort)) begCohort = procinfo%begCohort
- if (present(endCohort)) endCohort = procinfo%endCohort
- end subroutine get_proc_bounds_old
+ end subroutine get_proc_bounds
!------------------------------------------------------------------------------
subroutine get_proc_total(pid, ncells, nlunits, ncols, npatches, nCohorts)
@@ -426,6 +351,7 @@ integer function get_clmlevel_gsize (clmlevel)
!
! !USES:
use domainMod , only : ldomain
+ use clm_varcon, only : grlnd, nameg, namel, namec, namep, nameCohort
!
! !ARGUMENTS:
character(len=*), intent(in) :: clmlevel !type of clm 1d array
@@ -452,34 +378,37 @@ integer function get_clmlevel_gsize (clmlevel)
end function get_clmlevel_gsize
!-----------------------------------------------------------------------
- subroutine get_clmlevel_gsmap (clmlevel, gsmap)
+ subroutine get_clmlevel_gindex (clmlevel, gindex)
!
! !DESCRIPTION:
- ! Compute arguments for gatherv, scatterv for vectors
+ ! Get subgrid global index space
+ !
+ ! !USES
+ use clm_varcon , only : grlnd, nameg, namel, namec, namep, nameCohort
!
! !ARGUMENTS:
character(len=*), intent(in) :: clmlevel ! type of input data
- type(mct_gsmap) , pointer :: gsmap
+ integer , pointer :: gindex(:)
!----------------------------------------------------------------------
select case (clmlevel)
case(grlnd)
- gsmap => gsmap_lnd_gdc2glo
+ gindex => gindex_global
case(nameg)
- gsmap => gsmap_gce_gdc2glo
+ gindex => gindex_grc
case(namel)
- gsmap => gsmap_lun_gdc2glo
+ gindex => gindex_lun
case(namec)
- gsmap => gsmap_col_gdc2glo
+ gindex => gindex_col
case(namep)
- gsmap => gsmap_patch_gdc2glo
+ gindex => gindex_patch
case(nameCohort)
- gsmap => gsMap_cohort_gdc2glo
+ gindex => gindex_cohort
case default
- write(iulog,*) 'get_clmlevel_gsmap: Invalid expansion character: ',trim(clmlevel)
+ write(iulog,*) 'get_clmlevel_gindex: Invalid expansion character: ',trim(clmlevel)
call shr_sys_abort()
end select
- end subroutine get_clmlevel_gsmap
+ end subroutine get_clmlevel_gindex
end module decompMod
diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90
index 9ce24163ff..7bd416d19e 100644
--- a/src/main/histFileMod.F90
+++ b/src/main/histFileMod.F90
@@ -3282,7 +3282,7 @@ subroutine hfields_1dinfo(t, mode)
! Write/define 1d info for history tape.
!
! !USES:
- use decompMod , only : ldecomp
+ use decompMod , only : gindex_global
use domainMod , only : ldomain, ldomain
!
! !ARGUMENTS:
@@ -3294,6 +3294,7 @@ subroutine hfields_1dinfo(t, mode)
integer :: k ! 1d index
integer :: g,c,l,p ! indices
integer :: ier ! errir status
+ integer :: gindex ! global gridcell index
real(r8), pointer :: rgarr(:) ! temporary
real(r8), pointer :: rcarr(:) ! temporary
real(r8), pointer :: rlarr(:) ! temporary
@@ -3302,7 +3303,7 @@ subroutine hfields_1dinfo(t, mode)
integer , pointer :: icarr(:) ! temporary
integer , pointer :: ilarr(:) ! temporary
integer , pointer :: iparr(:) ! temporary
- type(file_desc_t), pointer :: ncid ! netcdf file
+ type(file_desc_t), pointer :: ncid ! netcdf file
type(bounds_type) :: bounds
character(len=*),parameter :: subname = 'hfields_1dinfo'
!-----------------------------------------------------------------------
@@ -3463,11 +3464,13 @@ subroutine hfields_1dinfo(t, mode)
call ncd_io(varname='grid1d_lon', data=grc%londeg, dim1name=nameg, ncid=ncid, flag='write')
call ncd_io(varname='grid1d_lat', data=grc%latdeg, dim1name=nameg, ncid=ncid, flag='write')
do g = bounds%begg,bounds%endg
- igarr(g)= mod(ldecomp%gdc2glo(g)-1,ldomain%ni) + 1
+ gindex = gindex_global(g-bounds%begg+1)
+ igarr(g)= mod(gindex-1,ldomain%ni) + 1
enddo
call ncd_io(varname='grid1d_ixy', data=igarr , dim1name=nameg, ncid=ncid, flag='write')
do g = bounds%begg,bounds%endg
- igarr(g)= (ldecomp%gdc2glo(g) - 1)/ldomain%ni + 1
+ gindex = gindex_global(g-bounds%begg+1)
+ igarr(g)= (gindex-1)/ldomain%ni + 1
enddo
call ncd_io(varname='grid1d_jxy', data=igarr , dim1name=nameg, ncid=ncid, flag='write')
@@ -3482,11 +3485,13 @@ subroutine hfields_1dinfo(t, mode)
enddo
call ncd_io(varname='land1d_lat', data=rlarr, dim1name=namel, ncid=ncid, flag='write')
do l= bounds%begl,bounds%endl
- ilarr(l) = mod(ldecomp%gdc2glo(lun%gridcell(l))-1,ldomain%ni) + 1
+ gindex = gindex_global(lun%gridcell(l)-bounds%begg+1)
+ ilarr(l) = mod(gindex-1,ldomain%ni) + 1
enddo
call ncd_io(varname='land1d_ixy', data=ilarr, dim1name=namel, ncid=ncid, flag='write')
do l = bounds%begl,bounds%endl
- ilarr(l) = (ldecomp%gdc2glo(lun%gridcell(l))-1)/ldomain%ni + 1
+ gindex = gindex_global(lun%gridcell(l)-bounds%begg+1)
+ ilarr(l) = (gindex-1)/ldomain%ni + 1
enddo
call ncd_io(varname='land1d_jxy' , data=ilarr , dim1name=namel, ncid=ncid, flag='write')
ilarr = GetGlobalIndexArray(lun%gridcell(bounds%begl:bounds%endl), bounds%begl, bounds%endl, clmlevel=nameg)
@@ -3506,11 +3511,13 @@ subroutine hfields_1dinfo(t, mode)
enddo
call ncd_io(varname='cols1d_lat', data=rcarr, dim1name=namec, ncid=ncid, flag='write')
do c = bounds%begc,bounds%endc
- icarr(c) = mod(ldecomp%gdc2glo(col%gridcell(c))-1,ldomain%ni) + 1
+ gindex = gindex_global(col%gridcell(c)-bounds%begg+1)
+ icarr(c) = mod(gindex-1,ldomain%ni) + 1
enddo
call ncd_io(varname='cols1d_ixy', data=icarr, dim1name=namec, ncid=ncid, flag='write')
do c = bounds%begc,bounds%endc
- icarr(c) = (ldecomp%gdc2glo(col%gridcell(c))-1)/ldomain%ni + 1
+ gindex = gindex_global(col%gridcell(c)-bounds%begg+1)
+ icarr(c) = (gindex-1)/ldomain%ni + 1
enddo
call ncd_io(varname='cols1d_jxy' , data=icarr ,dim1name=namec, ncid=ncid, flag='write')
icarr = GetGlobalIndexArray(col%gridcell(bounds%begc:bounds%endc), bounds%begc, bounds%endc, clmlevel=nameg)
@@ -3540,11 +3547,13 @@ subroutine hfields_1dinfo(t, mode)
enddo
call ncd_io(varname='pfts1d_lat', data=rparr, dim1name=namep, ncid=ncid, flag='write')
do p = bounds%begp,bounds%endp
- iparr(p) = mod(ldecomp%gdc2glo(patch%gridcell(p))-1,ldomain%ni) + 1
+ gindex = gindex_global(patch%gridcell(p)-bounds%begg+1)
+ iparr(p) = mod(gindex-1,ldomain%ni) + 1
enddo
call ncd_io(varname='pfts1d_ixy', data=iparr, dim1name=namep, ncid=ncid, flag='write')
do p = bounds%begp,bounds%endp
- iparr(p) = (ldecomp%gdc2glo(patch%gridcell(p))-1)/ldomain%ni + 1
+ gindex = gindex_global(patch%gridcell(p)-bounds%begg+1)
+ iparr(p) = (gindex-1)/ldomain%ni + 1
enddo
call ncd_io(varname='pfts1d_jxy' , data=iparr , dim1name=namep, ncid=ncid, flag='write')
diff --git a/src/main/initGridCellsMod.F90 b/src/main/initGridCellsMod.F90
index eb34161f47..7a8a9404c0 100644
--- a/src/main/initGridCellsMod.F90
+++ b/src/main/initGridCellsMod.F90
@@ -18,7 +18,7 @@ module initGridCellsMod
use abortutils , only : endrun
use clm_varctl , only : iulog
use clm_varcon , only : namep, namec, namel, nameg
- use decompMod , only : bounds_type, ldecomp
+ use decompMod , only : bounds_type
use GridcellType , only : grc
use LandunitType , only : lun
use ColumnType , only : col
@@ -48,7 +48,7 @@ module initGridCellsMod
contains
!------------------------------------------------------------------------
- subroutine initGridcells(glc_behavior)
+ subroutine initGridcells(bounds_clump, glc_behavior)
!
! !DESCRIPTION:
! Initialize sub-grid mapping and allocates space for derived type hierarchy.
@@ -56,7 +56,6 @@ subroutine initGridcells(glc_behavior)
!
! !USES
use domainMod , only : ldomain
- use decompMod , only : get_proc_bounds, get_clump_bounds, get_proc_clumps
use subgridWeightsMod , only : compute_higher_order_weights
use landunit_varcon , only : istsoil, istwet, istdlak, istice
use landunit_varcon , only : isturb_tbd, isturb_hd, isturb_md, istcrop
@@ -64,13 +63,11 @@ subroutine initGridcells(glc_behavior)
use shr_const_mod , only : SHR_CONST_PI
!
! !ARGUMENTS:
+ type(bounds_type) , intent(in) :: bounds_clump
type(glc_behavior_type), intent(in) :: glc_behavior
!
! !LOCAL VARIABLES:
integer :: nc,li,ci,pi,gdc ! indices
- integer :: nclumps ! number of clumps on this processor
- type(bounds_type) :: bounds_proc
- type(bounds_type) :: bounds_clump
!------------------------------------------------------------------------
! Notes about how this routine is arranged, and its implications for the arrangement
@@ -117,98 +114,86 @@ subroutine initGridcells(glc_behavior)
! Column: 1 1 2 2 3 3 4 4 5 5 6 6
! Cohort: 1 2 1 2 1 2 1 2 1 2 1 2
- nclumps = get_proc_clumps()
+ ! For each land gridcell on global grid determine landunit, column and patch properties
+
+ li = bounds_clump%begl-1
+ ci = bounds_clump%begc-1
+ pi = bounds_clump%begp-1
- ! FIX(SPM,032414) add private vars for cohort and perhaps patch dimension
- !$OMP PARALLEL DO PRIVATE (nc, bounds_clump, li, ci, pi, gdc)
- do nc = 1, nclumps
-
- call get_clump_bounds(nc, bounds_clump)
-
- ! For each land gridcell on global grid determine landunit, column and patch properties
-
- li = bounds_clump%begl-1
- ci = bounds_clump%begc-1
- pi = bounds_clump%begp-1
-
- ! Determine naturally vegetated landunit
- do gdc = bounds_clump%begg,bounds_clump%endg
- call set_landunit_veg_compete( &
- ltype=istsoil, gi=gdc, li=li, ci=ci, pi=pi)
- end do
-
- ! Determine crop landunit
- do gdc = bounds_clump%begg,bounds_clump%endg
- call set_landunit_crop_noncompete( &
- ltype=istcrop, gi=gdc, li=li, ci=ci, pi=pi)
- end do
+ ! Determine naturally vegetated landunit
+ do gdc = bounds_clump%begg,bounds_clump%endg
+ call set_landunit_veg_compete( &
+ ltype=istsoil, gi=gdc, li=li, ci=ci, pi=pi)
+ end do
- ! Determine urban tall building district landunit
- do gdc = bounds_clump%begg,bounds_clump%endg
- call set_landunit_urban( &
- ltype=isturb_tbd, gi=gdc, li=li, ci=ci, pi=pi)
+ ! Determine crop landunit
+ do gdc = bounds_clump%begg,bounds_clump%endg
+ call set_landunit_crop_noncompete( &
+ ltype=istcrop, gi=gdc, li=li, ci=ci, pi=pi)
+ end do
- end do
+ ! Determine urban tall building district landunit
+ do gdc = bounds_clump%begg,bounds_clump%endg
+ call set_landunit_urban( &
+ ltype=isturb_tbd, gi=gdc, li=li, ci=ci, pi=pi)
- ! Determine urban high density landunit
- do gdc = bounds_clump%begg,bounds_clump%endg
- call set_landunit_urban( &
- ltype=isturb_hd, gi=gdc, li=li, ci=ci, pi=pi)
- end do
+ end do
- ! Determine urban medium density landunit
- do gdc = bounds_clump%begg,bounds_clump%endg
- call set_landunit_urban( &
- ltype=isturb_md, gi=gdc, li=li, ci=ci, pi=pi)
- end do
+ ! Determine urban high density landunit
+ do gdc = bounds_clump%begg,bounds_clump%endg
+ call set_landunit_urban( &
+ ltype=isturb_hd, gi=gdc, li=li, ci=ci, pi=pi)
+ end do
- ! Determine lake, wetland and glacier landunits
- do gdc = bounds_clump%begg,bounds_clump%endg
- call set_landunit_wet_lake( &
- ltype=istdlak, gi=gdc, li=li, ci=ci, pi=pi)
- end do
+ ! Determine urban medium density landunit
+ do gdc = bounds_clump%begg,bounds_clump%endg
+ call set_landunit_urban( &
+ ltype=isturb_md, gi=gdc, li=li, ci=ci, pi=pi)
+ end do
- do gdc = bounds_clump%begg,bounds_clump%endg
- call set_landunit_wet_lake( &
- ltype=istwet, gi=gdc, li=li, ci=ci, pi=pi)
- end do
+ ! Determine lake, wetland and glacier landunits
+ do gdc = bounds_clump%begg,bounds_clump%endg
+ call set_landunit_wet_lake( &
+ ltype=istdlak, gi=gdc, li=li, ci=ci, pi=pi)
+ end do
- do gdc = bounds_clump%begg,bounds_clump%endg
- call set_landunit_ice( &
- glc_behavior = glc_behavior, &
- ltype=istice, gi=gdc, li=li, ci=ci, pi=pi)
- end do
+ do gdc = bounds_clump%begg,bounds_clump%endg
+ call set_landunit_wet_lake( &
+ ltype=istwet, gi=gdc, li=li, ci=ci, pi=pi)
+ end do
- ! Ensure that we have set the expected number of patchs, cols and landunits for this clump
- SHR_ASSERT_FL(li == bounds_clump%endl, sourcefile, __LINE__)
- SHR_ASSERT_FL(ci == bounds_clump%endc, sourcefile, __LINE__)
- SHR_ASSERT_FL(pi == bounds_clump%endp, sourcefile, __LINE__)
+ do gdc = bounds_clump%begg,bounds_clump%endg
+ call set_landunit_ice( &
+ glc_behavior = glc_behavior, &
+ ltype=istice, gi=gdc, li=li, ci=ci, pi=pi)
+ end do
- ! Set some other gridcell-level variables
+ ! Ensure that we have set the expected number of patchs, cols and landunits for this clump
+ SHR_ASSERT_FL(li == bounds_clump%endl, sourcefile, __LINE__)
+ SHR_ASSERT_FL(ci == bounds_clump%endc, sourcefile, __LINE__)
+ SHR_ASSERT_FL(pi == bounds_clump%endp, sourcefile, __LINE__)
- do gdc = bounds_clump%begg,bounds_clump%endg
- grc%gindex(gdc) = ldecomp%gdc2glo(gdc)
- grc%area(gdc) = ldomain%area(gdc)
- grc%latdeg(gdc) = ldomain%latc(gdc)
- grc%londeg(gdc) = ldomain%lonc(gdc)
- grc%lat(gdc) = grc%latdeg(gdc) * SHR_CONST_PI/180._r8
- grc%lon(gdc) = grc%londeg(gdc) * SHR_CONST_PI/180._r8
- enddo
+ ! Set some other gridcell-level variables
- ! Fill in subgrid datatypes
+ do gdc = bounds_clump%begg,bounds_clump%endg
+ grc%area(gdc) = ldomain%area(gdc)
+ grc%latdeg(gdc) = ldomain%latc(gdc)
+ grc%londeg(gdc) = ldomain%lonc(gdc)
+ grc%lat(gdc) = grc%latdeg(gdc) * SHR_CONST_PI/180._r8
+ grc%lon(gdc) = grc%londeg(gdc) * SHR_CONST_PI/180._r8
+ enddo
- call clm_ptrs_compdown(bounds_clump)
+ ! Fill in subgrid datatypes
- ! By putting this check within the loop over clumps, we ensure that (for example)
- ! if a clump is responsible for landunit L, then that same clump is also
- ! responsible for all columns and patchs in L.
- call clm_ptrs_check(bounds_clump)
+ call clm_ptrs_compdown(bounds_clump)
- ! Set patch%wtlunit, patch%wtgcell and col%wtgcell
- call compute_higher_order_weights(bounds_clump)
+ ! By putting this check within the loop over clumps, we ensure that (for example)
+ ! if a clump is responsible for landunit L, then that same clump is also
+ ! responsible for all columns and patchs in L.
+ call clm_ptrs_check(bounds_clump)
- end do
- !$OMP END PARALLEL DO
+ ! Set patch%wtlunit, patch%wtgcell and col%wtgcell
+ call compute_higher_order_weights(bounds_clump)
end subroutine initGridcells
@@ -513,7 +498,6 @@ subroutine set_landunit_urban (ltype, gi, li, ci, pi)
use subgridMod , only : subgrid_get_info_urban_tbd, subgrid_get_info_urban_hd
use subgridMod , only : subgrid_get_info_urban_md
use UrbanParamsType , only : urbinp
- use decompMod , only : ldecomp
use pftconMod , only : noveg
!
! !ARGUMENTS:
diff --git a/src/main/ncdio_pio.F90.in b/src/main/ncdio_pio.F90.in
index b321dc04bc..e9a8e3e2bb 100644
--- a/src/main/ncdio_pio.F90.in
+++ b/src/main/ncdio_pio.F90.in
@@ -20,10 +20,9 @@ module ncdio_pio
use clm_varcon , only : spval,ispval, grlnd, nameg, namel, namec, namep
use clm_varctl , only : single_column, iulog
use shr_sys_mod , only : shr_sys_flush
- use decompMod , only : get_clmlevel_gsize,get_clmlevel_gsmap
+ use decompMod , only : get_clmlevel_gsize, get_clmlevel_gindex
use perf_mod , only : t_startf, t_stopf
use fileutils , only : getavu, relavu
- use mct_mod , only : mct_gsMap, mct_gsMap_lsize, mct_gsMap_gsize, mct_gsMap_orderedPoints
use pio , only : file_desc_t, io_desc_t, iosystem_desc_t
use pio , only : pio_bcast_error, pio_char, pio_clobber, pio_closefile, pio_createfile, pio_def_dim
use pio , only : pio_def_var, pio_double, pio_redef, pio_enddef, pio_get_att, pio_get_var, pio_global, pio_initdecomp
@@ -2576,19 +2575,17 @@ contains
! !LOCAL VARIABLES:
integer :: k,m,n,cnt ! indices
integer :: basetype ! pio basetype
- integer :: gsmap_lsize ! local size of gsmap
- integer :: gsmap_gsize ! global size of gsmap
integer :: fullsize ! size of entire array on cdf
+ integer :: lsize ! local size of clmlevel gindex
integer :: gsize ! global size of clmlevel
integer :: vsize ! other dimensions
integer :: vsize1, vsize2 ! other dimensions
integer :: status ! error status
logical :: found ! true => found created iodescriptor
integer :: ndims_file ! temporary
- character(len=64) dimname_file ! dimension name on file
- character(len=64) dimname_iodesc ! dimension name from io descriptor
- type(mct_gsMap),pointer :: gsmap ! global seg map
- integer, pointer,dimension(:) :: gsmOP ! gsmap ordered points
+ character(len=64) :: dimname_file ! dimension name on file
+ character(len=64) :: dimname_iodesc ! dimension name from io descriptor
+ integer, pointer :: gindex(:) ! global index space
integer(pio_offset_kind), pointer :: compDOF(:)
character(len=32) :: subname = 'ncd_getiodesc'
!------------------------------------------------------------------------
@@ -2662,12 +2659,12 @@ contains
call shr_sys_abort(errMsg(sourcefile,__LINE__))
end if
- call get_clmlevel_gsmap(clmlevel,gsmap)
+ call get_clmlevel_gindex(clmlevel, gindex)
+ if (.not. associated(gindex)) then
+ call shr_sys_abort('gindex for clmlevel '//trim(clmlevel)//' is not associated')
+ end if
gsize = get_clmlevel_gsize(clmlevel)
- gsmap_lsize = mct_gsmap_lsize(gsmap,mpicom)
- gsmap_gsize = mct_gsmap_gsize(gsmap)
-
- call mct_gsMap_orderedPoints(gsmap,iam,gsmOP)
+ lsize = size(gindex)
fullsize = 1
do n = 1,ndims
@@ -2680,15 +2677,15 @@ contains
call shr_sys_abort(errMsg(sourcefile, __LINE__))
endif
- allocate(compDOF(gsmap_lsize*vsize))
+ allocate(compDOF(lsize*vsize))
if (present(switchdim)) then
if (switchdim) then
cnt = 0
- do m = 1,gsmap_lsize
+ do m = 1,lsize
do n = 1,vsize
cnt = cnt + 1
- compDOF(cnt) = (gsmOP(m)-1)*vsize + n
+ compDOF(cnt) = (gindex(m)-1)*vsize + n
enddo
enddo
else
@@ -2706,18 +2703,18 @@ contains
cnt = 0
do k = 1,vsize2
do n = 1,vsize1
- do m = 1,gsmap_lsize
+ do m = 1,lsize
cnt = cnt + 1
- compDOF(cnt) = (k-1)*vsize1*gsmap_gsize + (n-1)*gsmap_gsize + gsmOP(m)
+ compDOF(cnt) = (k-1)*vsize1*gsize + (n-1)*gsize + gindex(m)
enddo
enddo
end do
else
cnt = 0
do n = 1,vsize
- do m = 1,gsmap_lsize
+ do m = 1,lsize
cnt = cnt + 1
- compDOF(cnt) = (n-1)*gsmap_gsize + gsmOP(m)
+ compDOF(cnt) = (n-1)*gsize + gindex(m)
enddo
enddo
end if
@@ -2726,17 +2723,15 @@ contains
if (debug > 1) then
do m = 0,npes-1
if (iam == m) then
- write(iulog,*) trim(subname),' sizes1 = ',iam,gsize,gsmap_gsize,gsmap_lsize
- write(iulog,*) trim(subname),' sizes2 = ',iam,fullsize,npes,vsize
- write(iulog,*) trim(subname),' compDOF = ',iam,size(compDOF),minval(compDOF),maxval(compDOF)
+ write(iulog,'(a,3(i10,2x))') trim(subname)//' sizes1 = ',iam,gsize,lsize
+ write(iulog,'(a,4(i10,2x))') trim(subname)//' sizes2 = ',iam,fullsize,npes,vsize
+ write(iulog,'(a,5(i10,2x))') trim(subname)//' compDOF = ',iam,size(compDOF),minval(compDOF),maxval(compDOF)
call shr_sys_flush(iulog)
endif
call mpi_barrier(mpicom,status)
enddo
endif
- deallocate(gsmOP)
-
call pio_initdecomp(pio_subsystem, xTYPE, dims(1:ndims), compDOF, iodesc_list(iodnum)%iodesc)
deallocate(compDOF)
diff --git a/src/main/pftconMod.F90 b/src/main/pftconMod.F90
index 3645a6f63a..27c6375344 100644
--- a/src/main/pftconMod.F90
+++ b/src/main/pftconMod.F90
@@ -8,7 +8,7 @@ module pftconMod
! !USES:
use shr_kind_mod, only : r8 => shr_kind_r8
use abortutils , only : endrun
- use clm_varpar , only : mxpft, numrad, ivis, inir, cft_lb, cft_ub
+ use clm_varpar , only : mxpft, numrad, ivis, inir, cft_lb, cft_ub, ndecomp_pools
use clm_varctl , only : iulog, use_cndv, use_vertsoilc, use_crop
!
! !PUBLIC TYPES:
@@ -200,6 +200,8 @@ module pftconMod
real(r8), allocatable :: flivewd (:) ! allocation parameter: fraction of new wood that is live (phloem and ray parenchyma) (no units)
real(r8), allocatable :: fcur (:) ! allocation parameter: fraction of allocation that goes to currently displayed growth, remainder to storage
real(r8), allocatable :: fcurdv (:) ! alternate fcur for use with cndv
+ real(r8), allocatable :: lf_f (:,:) ! leaf litter fractions
+ real(r8), allocatable :: fr_f (:,:) ! fine root litter fractions
real(r8), allocatable :: lf_flab (:) ! leaf litter labile fraction
real(r8), allocatable :: lf_fcel (:) ! leaf litter cellulose fraction
real(r8), allocatable :: lf_flig (:) ! leaf litter lignin fraction
@@ -415,6 +417,10 @@ subroutine InitAllocate (this)
allocate( this%flivewd (0:mxpft) )
allocate( this%fcur (0:mxpft) )
allocate( this%fcurdv (0:mxpft) )
+ ! Second dimension not i_litr_max because that parameter may obtain its
+ ! value after we've been through here
+ allocate( this%lf_f (0:mxpft, 1:ndecomp_pools) )
+ allocate( this%fr_f (0:mxpft, 1:ndecomp_pools) )
allocate( this%lf_flab (0:mxpft) )
allocate( this%lf_fcel (0:mxpft) )
allocate( this%lf_flig (0:mxpft) )
@@ -755,6 +761,16 @@ subroutine InitRead(this)
call ncd_io('fr_flig', this%fr_flig, 'read', ncid, readvar=readv, posNOTonfile=.true.)
if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__))
+ ! Three hardwired fr_f* and lf_f* values: We pass them to 2d arrays for use
+ ! in do-loops. While executing the next few lines, we do not yet have access
+ ! to i_litr_min, i_litr_max.
+ this%fr_f(:,1) = this%fr_flab
+ this%fr_f(:,2) = this%fr_fcel
+ this%fr_f(:,3) = this%fr_flig
+ this%lf_f(:,1) = this%lf_flab
+ this%lf_f(:,2) = this%lf_fcel
+ this%lf_f(:,3) = this%lf_flig
+
call ncd_io('leaf_long', this%leaf_long, 'read', ncid, readvar=readv, posNOTonfile=.true.)
if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__))
@@ -1411,9 +1427,11 @@ subroutine Clean(this)
deallocate( this%flivewd)
deallocate( this%fcur)
deallocate( this%fcurdv)
+ deallocate( this%lf_f )
deallocate( this%lf_flab)
deallocate( this%lf_fcel)
deallocate( this%lf_flig)
+ deallocate( this%fr_f )
deallocate( this%fr_flab)
deallocate( this%fr_fcel)
deallocate( this%fr_flig)
diff --git a/src/main/subgridRestMod.F90 b/src/main/subgridRestMod.F90
index 78a00b5492..e789866ee5 100644
--- a/src/main/subgridRestMod.F90
+++ b/src/main/subgridRestMod.F90
@@ -8,7 +8,7 @@ module subgridRestMod
use shr_log_mod , only : errMsg => shr_log_errMsg
use glc_elevclass_mod , only : glc_get_num_elevation_classes, glc_get_elevclass_bounds
use abortutils , only : endrun
- use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC, ldecomp
+ use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC, gindex_global
use domainMod , only : ldomain
use clm_time_manager , only : get_curr_date
use clm_varcon , only : nameg, namel, namec, namep
@@ -115,6 +115,7 @@ subroutine subgridRest_write_only(bounds, ncid, flag)
integer , pointer :: ilarr(:) ! temporary
integer , pointer :: icarr(:) ! temporary
integer , pointer :: iparr(:) ! temporary
+ integer :: gindex ! global index
real(r8), pointer :: elevclass_bounds(:)
@@ -141,7 +142,8 @@ subroutine subgridRest_write_only(bounds, ncid, flag)
interpinic_flag='skip', readvar=readvar, data=grc%latdeg)
do g=bounds%begg,bounds%endg
- igarr(g)= mod(ldecomp%gdc2glo(g)-1,ldomain%ni) + 1
+ gindex = gindex_global(g-bounds%begg+1)
+ igarr(g)= mod(gindex-1,ldomain%ni) + 1
enddo
call restartvar(ncid=ncid, flag=flag, varname='grid1d_ixy', xtype=ncd_int, &
dim1name='gridcell', &
@@ -149,7 +151,8 @@ subroutine subgridRest_write_only(bounds, ncid, flag)
interpinic_flag='skip', readvar=readvar, data=igarr)
do g=bounds%begg,bounds%endg
- igarr(g)= (ldecomp%gdc2glo(g) - 1)/ldomain%ni + 1
+ gindex = gindex_global(g-bounds%begg+1)
+ igarr(g)= (gindex - 1)/ldomain%ni + 1
enddo
call restartvar(ncid=ncid, flag=flag, varname='grid1d_jxy', xtype=ncd_int, &
dim1name='gridcell', &
@@ -182,7 +185,8 @@ subroutine subgridRest_write_only(bounds, ncid, flag)
interpinic_flag='skip', readvar=readvar, data=rlarr)
do l=bounds%begl,bounds%endl
- ilarr(l) = mod(ldecomp%gdc2glo(lun%gridcell(l))-1,ldomain%ni) + 1
+ gindex = gindex_global(lun%gridcell(l)-bounds%begg+1)
+ ilarr(l) = mod(gindex-1,ldomain%ni) + 1
enddo
call restartvar(ncid=ncid, flag=flag, varname='land1d_ixy', xtype=ncd_int, &
dim1name='landunit', &
@@ -190,7 +194,8 @@ subroutine subgridRest_write_only(bounds, ncid, flag)
interpinic_flag='skip', readvar=readvar, data=ilarr)
do l=bounds%begl,bounds%endl
- ilarr(l) = (ldecomp%gdc2glo(lun%gridcell(l))-1)/ldomain%ni + 1
+ gindex = gindex_global(lun%gridcell(l)-bounds%begg+1)
+ ilarr(l) = (gindex-1)/ldomain%ni + 1
end do
call restartvar(ncid=ncid, flag=flag, varname='land1d_jxy', xtype=ncd_int, &
dim1name='landunit', &
@@ -245,7 +250,8 @@ subroutine subgridRest_write_only(bounds, ncid, flag)
interpinic_flag='skip', readvar=readvar, data=rcarr)
do c= bounds%begc, bounds%endc
- icarr(c) = mod(ldecomp%gdc2glo(col%gridcell(c))-1,ldomain%ni) + 1
+ gindex = gindex_global(col%gridcell(c)-bounds%begg+1)
+ icarr(c) = mod(gindex-1,ldomain%ni) + 1
enddo
call restartvar(ncid=ncid, flag=flag, varname='cols1d_ixy', xtype=ncd_int, &
dim1name='column', &
@@ -253,7 +259,8 @@ subroutine subgridRest_write_only(bounds, ncid, flag)
interpinic_flag='skip', readvar=readvar, data=icarr)
do c= bounds%begc, bounds%endc
- icarr(c) = (ldecomp%gdc2glo(col%gridcell(c))-1)/ldomain%ni + 1
+ gindex = gindex_global(col%gridcell(c)-bounds%begg+1)
+ icarr(c) = (gindex-1)/ldomain%ni + 1
enddo
call restartvar(ncid=ncid, flag=flag, varname='cols1d_jxy', xtype=ncd_int, &
dim1name='column', &
@@ -346,7 +353,8 @@ subroutine subgridRest_write_only(bounds, ncid, flag)
interpinic_flag='skip', readvar=readvar, data=rparr)
do p=bounds%begp,bounds%endp
- iparr(p) = mod(ldecomp%gdc2glo(patch%gridcell(p))-1,ldomain%ni) + 1
+ gindex = gindex_global(patch%gridcell(p)-bounds%begg+1)
+ iparr(p) = mod(gindex-1,ldomain%ni) + 1
enddo
call restartvar(ncid=ncid, flag=flag, varname='pfts1d_ixy', xtype=ncd_int, &
dim1name='pft', &
@@ -354,7 +362,8 @@ subroutine subgridRest_write_only(bounds, ncid, flag)
interpinic_flag='skip', readvar=readvar, data=iparr)
do p=bounds%begp,bounds%endp
- iparr(p) = (ldecomp%gdc2glo(patch%gridcell(p))-1)/ldomain%ni + 1
+ gindex = gindex_global(patch%gridcell(p)-bounds%begg+1)
+ iparr(p) = (gindex-1)/ldomain%ni + 1
enddo
call restartvar(ncid=ncid, flag=flag, varname='pfts1d_jxy', xtype=ncd_int, &
dim1name='pft', &
diff --git a/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 b/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90
index f1f2019397..0e4879fb4a 100644
--- a/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90
+++ b/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90
@@ -43,11 +43,13 @@ module SoilBiogeochemCarbonFluxType
real(r8), pointer :: fphr_col (:,:) ! fraction of potential heterotrophic respiration
real(r8), pointer :: hr_col (:) ! (gC/m2/s) total heterotrophic respiration
+ real(r8), pointer :: cwdhr_col (:) ! (gC/m2/s) coarse woody debris heterotrophic respiration
real(r8), pointer :: lithr_col (:) ! (gC/m2/s) litter heterotrophic respiration
real(r8), pointer :: somhr_col (:) ! (gC/m2/s) soil organic matter heterotrophic res
real(r8), pointer :: soilc_change_col (:) ! (gC/m2/s) FUN used soil C
! fluxes to receive carbon inputs from FATES
+ real(r8), pointer :: FATES_c_to_litr_c_col (:,:,:) ! total litter coming from ED. gC/m3/s
real(r8), pointer :: FATES_c_to_litr_lab_c_col (:,:) ! total labile litter coming from ED. gC/m3/s
real(r8), pointer :: FATES_c_to_litr_cel_c_col (:,:) ! total cellulose litter coming from ED. gC/m3/s
real(r8), pointer :: FATES_c_to_litr_lig_c_col (:,:) ! total lignin litter coming from ED. gC/m3/s
@@ -129,6 +131,7 @@ subroutine InitAllocate(this, bounds)
this%decomp_cpools_transport_tendency_col(:,:,:)= nan
allocate(this%hr_col (begc:endc)) ; this%hr_col (:) = nan
+ allocate(this%cwdhr_col (begc:endc)) ; this%cwdhr_col (:) = nan
allocate(this%lithr_col (begc:endc)) ; this%lithr_col (:) = nan
allocate(this%somhr_col (begc:endc)) ; this%somhr_col (:) = nan
allocate(this%soilc_change_col (begc:endc)) ; this%soilc_change_col (:) = nan
@@ -136,6 +139,9 @@ subroutine InitAllocate(this, bounds)
if ( use_fates ) then
! initialize these variables to be zero rather than a bad number since they are not zeroed every timestep (due to a need for them to persist)
+ allocate(this%FATES_c_to_litr_c_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools))
+ this%FATES_c_to_litr_c_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools) = 0._r8
+
allocate(this%FATES_c_to_litr_lab_c_col(begc:endc,1:nlevdecomp_full))
this%FATES_c_to_litr_lab_c_col(begc:endc,1:nlevdecomp_full) = 0._r8
@@ -200,6 +206,11 @@ subroutine InitHistory(this, bounds, carbon_type)
avgflag='A', long_name='total heterotrophic respiration', &
ptr_col=this%hr_col)
+ this%cwdhr_col(begc:endc) = spval
+ call hist_addfld1d (fname='CWDC_HR', units='gC/m^2/s', &
+ avgflag='A', long_name='cwd C heterotrophic respiration', &
+ ptr_col=this%cwdhr_col, default='inactive')
+
this%lithr_col(begc:endc) = spval
call hist_addfld1d (fname='LITTERC_HR', units='gC/m^2/s', &
avgflag='A', long_name='litter C heterotrophic respiration', &
@@ -239,28 +250,26 @@ subroutine InitHistory(this, bounds, carbon_type)
do l = 1, ndecomp_cascade_transitions
! output the vertically integrated fluxes only as default
- !-- HR fluxes (none from CWD)
- if ( .not. decomp_cascade_con%is_cwd(decomp_cascade_con%cascade_donor_pool(l)) ) then
- data1dptr => this%decomp_cascade_hr_col(:,l)
- ! check to see if there are multiple pathways that include respiration, and if so, note that in the history file
- ii = 0
- do jj = 1, ndecomp_cascade_transitions
- if ( decomp_cascade_con%cascade_donor_pool(jj) == decomp_cascade_con%cascade_donor_pool(l) ) ii = ii+1
- end do
- if ( ii == 1 ) then
- fieldname = &
- trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//'_HR'
- else
- fieldname = &
- trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//'_HR_'//&
- trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_receiver_pool(l)))
- endif
- longname = 'Het. Resp. from '//&
- trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l)))
- call hist_addfld1d (fname=fieldname, units='gC/m^2/s', &
- avgflag='A', long_name=longname, &
- ptr_col=data1dptr, default='inactive')
+ !-- HR fluxes
+ data1dptr => this%decomp_cascade_hr_col(:,l)
+ ! check to see if there are multiple pathways that include respiration, and if so, note that in the history file
+ ii = 0
+ do jj = 1, ndecomp_cascade_transitions
+ if ( decomp_cascade_con%cascade_donor_pool(jj) == decomp_cascade_con%cascade_donor_pool(l) ) ii = ii+1
+ end do
+ if ( ii == 1 ) then
+ fieldname = &
+ trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//'_HR'
+ else
+ fieldname = &
+ trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//'_HR_'//&
+ trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_receiver_pool(l)))
endif
+ longname = 'Het. Resp. from '//&
+ trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l)))
+ call hist_addfld1d (fname=fieldname, units='gC/m^2/s', &
+ avgflag='A', long_name=longname, &
+ ptr_col=data1dptr, default='inactive')
!-- transfer fluxes (none from terminal pool, if present)
if ( decomp_cascade_con%cascade_receiver_pool(l) /= 0 ) then
@@ -277,30 +286,28 @@ subroutine InitHistory(this, bounds, carbon_type)
! output the vertically resolved fluxes
if ( nlevdecomp_full > 1 ) then
- !-- HR fluxes (none from CWD)
- if ( .not. decomp_cascade_con%is_cwd(decomp_cascade_con%cascade_donor_pool(l)) ) then
- data2dptr => this%decomp_cascade_hr_vr_col(:,:,l)
- ! check to see if there are multiple pathways that include respiration, and if so, note that in the history file
- ii = 0
- do jj = 1, ndecomp_cascade_transitions
- if ( decomp_cascade_con%cascade_donor_pool(jj) == decomp_cascade_con%cascade_donor_pool(l) ) ii = ii+1
- end do
- if ( ii == 1 ) then
- fieldname = &
- trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))&
- //'_HR'//trim(vr_suffix)
- else
- fieldname = &
- trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//'_HR_'//&
- trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_receiver_pool(l)))&
- //trim(vr_suffix)
- endif
- longname = 'Het. Resp. from '//&
- trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l)))
- call hist_addfld_decomp (fname=fieldname, units='gC/m^3/s', type2d='levdcmp', &
- avgflag='A', long_name=longname, &
- ptr_col=data2dptr, default='inactive')
+ !-- HR fluxes
+ data2dptr => this%decomp_cascade_hr_vr_col(:,:,l)
+ ! check to see if there are multiple pathways that include respiration, and if so, note that in the history file
+ ii = 0
+ do jj = 1, ndecomp_cascade_transitions
+ if ( decomp_cascade_con%cascade_donor_pool(jj) == decomp_cascade_con%cascade_donor_pool(l) ) ii = ii+1
+ end do
+ if ( ii == 1 ) then
+ fieldname = &
+ trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))&
+ //'_HR'//trim(vr_suffix)
+ else
+ fieldname = &
+ trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//'_HR_'//&
+ trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_receiver_pool(l)))&
+ //trim(vr_suffix)
endif
+ longname = 'Het. Resp. from '//&
+ trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l)))
+ call hist_addfld_decomp (fname=fieldname, units='gC/m^3/s', type2d='levdcmp', &
+ avgflag='A', long_name=longname, &
+ ptr_col=data2dptr, default='inactive')
!-- transfer fluxes (none from terminal pool, if present)
if ( decomp_cascade_con%cascade_receiver_pool(l) /= 0 ) then
@@ -345,7 +352,7 @@ subroutine InitHistory(this, bounds, carbon_type)
this%decomp_cpools_leached_col(begc:endc,:) = spval
this%decomp_cpools_transport_tendency_col(begc:endc,:,:) = spval
- do k = 1, ndecomp_pools
+ do k = 1, ndecomp_pools ! none from CWD
if ( .not. decomp_cascade_con%is_cwd(k) ) then
data1dptr => this%decomp_cpools_leached_col(:,k)
fieldname = 'M_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'C_TO_LEACHING'
@@ -383,9 +390,14 @@ subroutine InitHistory(this, bounds, carbon_type)
avgflag='A', long_name='C13 total heterotrophic respiration', &
ptr_col=this%hr_col)
+ this%cwdhr_col(begc:endc) = spval
+ call hist_addfld1d (fname='C13_CWDC_HR', units='gC/m^2/s', &
+ avgflag='A', long_name='C13 cwd C heterotrophic respiration', &
+ ptr_col=this%cwdhr_col, default='inactive')
+
this%lithr_col(begc:endc) = spval
call hist_addfld1d (fname='C13_LITTERC_HR', units='gC13/m^2/s', &
- avgflag='A', long_name='C13 fine root C litterfall to litter 3 C', &
+ avgflag='A', long_name='C13 litter C heterotrophic respiration', &
ptr_col=this%lithr_col, default='inactive')
this%somhr_col(begc:endc) = spval
@@ -399,29 +411,28 @@ subroutine InitHistory(this, bounds, carbon_type)
this%decomp_cascade_ctransfer_col(begc:endc,:) = spval
this%decomp_cascade_ctransfer_vr_col(begc:endc,:,:) = spval
do l = 1, ndecomp_cascade_transitions
- !-- HR fluxes (none from CWD)
- if ( .not. decomp_cascade_con%is_cwd(decomp_cascade_con%cascade_donor_pool(l)) ) then
- data2dptr => this%decomp_cascade_hr_vr_col(:,:,l)
- ! check to see if there are multiple pathways that include respiration, and if so, note that in the history file
- ii = 0
- do jj = 1, ndecomp_cascade_transitions
- if ( decomp_cascade_con%cascade_donor_pool(jj) == decomp_cascade_con%cascade_donor_pool(l) ) ii = ii+1
- end do
- if ( ii == 1 ) then
- fieldname = 'C13_'//trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))&
- //'_HR'//trim(vr_suffix)
- else
- fieldname = 'C13_'//trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))&
- //'_HR_'//&
- trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_receiver_pool(l)))//&
- trim(vr_suffix)
- endif
- longname = 'C13 Het. Resp. from '&
- //trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l)))
- call hist_addfld_decomp (fname=fieldname, units='gC13/m^3', type2d='levdcmp', &
- avgflag='A', long_name=longname, &
- ptr_col=data2dptr, default='inactive')
+ !-- HR fluxes
+ data2dptr => this%decomp_cascade_hr_vr_col(:,:,l)
+ ! check to see if there are multiple pathways that include respiration, and if so, note that in the history file
+ ii = 0
+ do jj = 1, ndecomp_cascade_transitions
+ if ( decomp_cascade_con%cascade_donor_pool(jj) == decomp_cascade_con%cascade_donor_pool(l) ) ii = ii+1
+ end do
+ if ( ii == 1 ) then
+ fieldname = 'C13_'//trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))&
+ //'_HR'//trim(vr_suffix)
+ else
+ fieldname = 'C13_'//trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))&
+ //'_HR_'//&
+ trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_receiver_pool(l)))//&
+ trim(vr_suffix)
endif
+ longname = 'C13 Het. Resp. from '&
+ //trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l)))
+ call hist_addfld_decomp (fname=fieldname, units='gC13/m^3', type2d='levdcmp', &
+ avgflag='A', long_name=longname, &
+ ptr_col=data2dptr, default='inactive')
+
!-- transfer fluxes (none from terminal pool, if present)
if ( decomp_cascade_con%cascade_receiver_pool(l) /= 0 ) then
data2dptr => this%decomp_cascade_ctransfer_vr_col(:,:,l)
@@ -453,6 +464,11 @@ subroutine InitHistory(this, bounds, carbon_type)
avgflag='A', long_name='C14 total heterotrophic respiration', &
ptr_col=this%hr_col)
+ this%cwdhr_col(begc:endc) = spval
+ call hist_addfld1d (fname='C14_CWDC_HR', units='gC/m^2/s', &
+ avgflag='A', long_name='C14 cwd C heterotrophic respiration', &
+ ptr_col=this%cwdhr_col, default='inactive')
+
this%lithr_col(begc:endc) = spval
call hist_addfld1d (fname='C14_LITTERC_HR', units='gC14/m^2/s', &
avgflag='A', long_name='C14 litter carbon heterotrophic respiration', &
@@ -469,31 +485,29 @@ subroutine InitHistory(this, bounds, carbon_type)
this%decomp_cascade_ctransfer_vr_col(begc:endc,:,:) = spval
do l = 1, ndecomp_cascade_transitions
- !-- HR fluxes (none from CWD)
- if ( .not. decomp_cascade_con%is_cwd(decomp_cascade_con%cascade_donor_pool(l)) ) then
- data2dptr => this%decomp_cascade_hr_vr_col(:,:,l)
-
- ! check to see if there are multiple pathways that include respiration, and if so, note that in the history file
- ii = 0
- do jj = 1, ndecomp_cascade_transitions
- if ( decomp_cascade_con%cascade_donor_pool(jj) == decomp_cascade_con%cascade_donor_pool(l) ) ii = ii+1
- end do
- if ( ii == 1 ) then
- fieldname = 'C14_'//trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))&
- //'_HR'//trim(vr_suffix)
- else
- fieldname = 'C14_'//&
- trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))&
- //'_HR_'//&
- trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_receiver_pool(l)))&
- //trim(vr_suffix)
- endif
- longname = 'C14 Het. Resp. from '&
- //trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l)))
- call hist_addfld_decomp (fname=fieldname, units='gC14/m^3', type2d='levdcmp', &
- avgflag='A', long_name=longname, &
- ptr_col=data2dptr, default='inactive')
+ !-- HR fluxes
+ data2dptr => this%decomp_cascade_hr_vr_col(:,:,l)
+
+ ! check to see if there are multiple pathways that include respiration, and if so, note that in the history file
+ ii = 0
+ do jj = 1, ndecomp_cascade_transitions
+ if ( decomp_cascade_con%cascade_donor_pool(jj) == decomp_cascade_con%cascade_donor_pool(l) ) ii = ii+1
+ end do
+ if ( ii == 1 ) then
+ fieldname = 'C14_'//trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))&
+ //'_HR'//trim(vr_suffix)
+ else
+ fieldname = 'C14_'//&
+ trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))&
+ //'_HR_'//&
+ trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_receiver_pool(l)))&
+ //trim(vr_suffix)
endif
+ longname = 'C14 Het. Resp. from '&
+ //trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l)))
+ call hist_addfld_decomp (fname=fieldname, units='gC14/m^3', type2d='levdcmp', &
+ avgflag='A', long_name=longname, &
+ ptr_col=data2dptr, default='inactive')
!-- transfer fluxes (none from terminal pool, if present)
if ( decomp_cascade_con%cascade_receiver_pool(l) /= 0 ) then
@@ -641,6 +655,14 @@ subroutine Restart(this, bounds, ncid, flag)
interpinic_flag='interp', readvar=readvar, data=ptr1d)
end if
+
+ ! Copy last 3 variables to an array of litter pools for use in do loops.
+ ! Repeat copy in src/utils/clmfates_interfaceMod.F90.
+ ! Keep the three originals to avoid backwards compatibility issues with
+ ! restart files.
+ this%FATES_c_to_litr_c_col(:,:,1) = this%FATES_c_to_litr_lab_c_col(:,:)
+ this%FATES_c_to_litr_c_col(:,:,2) = this%FATES_c_to_litr_cel_c_col(:,:)
+ this%FATES_c_to_litr_c_col(:,:,3) = this%FATES_c_to_litr_lig_c_col(:,:)
end if
@@ -704,6 +726,7 @@ subroutine SetValues ( this, num_column, filter_column, value_column)
this%som_c_leached_col(i) = value_column
this%somhr_col(i) = value_column
this%lithr_col(i) = value_column
+ this%cwdhr_col(i) = value_column
this%soilc_change_col(i) = value_column
end do
@@ -811,11 +834,24 @@ subroutine Summary(this, bounds, num_soilc, filter_soilc)
end do
end associate
+ ! coarse woody debris heterotrophic respiration (CWDHR)
+ associate(is_cwd => decomp_cascade_con%is_cwd) ! TRUE => pool is a cwd pool
+ do k = 1, ndecomp_cascade_transitions
+ if ( is_cwd(decomp_cascade_con%cascade_donor_pool(k)) ) then
+ do fc = 1,num_soilc
+ c = filter_soilc(fc)
+ this%cwdhr_col(c) = this%cwdhr_col(c) + this%decomp_cascade_hr_col(c,k)
+ end do
+ end if
+ end do
+ end associate
+
! total heterotrophic respiration (HR)
do fc = 1,num_soilc
c = filter_soilc(fc)
this%hr_col(c) = &
+ this%cwdhr_col(c) + &
this%lithr_col(c) + &
this%somhr_col(c)
diff --git a/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 b/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90
index 56f6748761..f6a2b50bfd 100644
--- a/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90
+++ b/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90
@@ -9,8 +9,8 @@ module SoilBiogeochemDecompCascadeBGCMod
use shr_kind_mod , only : r8 => shr_kind_r8
use shr_const_mod , only : SHR_CONST_TKFRZ
use shr_log_mod , only : errMsg => shr_log_errMsg
- use clm_varpar , only : nlevsoi, nlevgrnd, nlevdecomp, ndecomp_cascade_transitions, ndecomp_pools
- use clm_varpar , only : i_met_lit, i_cel_lit, i_lig_lit, i_cwd
+ use clm_varpar , only : nlevdecomp, ndecomp_pools_max
+ use clm_varpar , only : i_litr_min, i_litr_max, i_met_lit, i_cwd
use clm_varctl , only : iulog, spinup_state, anoxia, use_lch4, use_vertsoilc, use_fates
use clm_varcon , only : zsoi
use decompMod , only : bounds_type
@@ -32,7 +32,6 @@ module SoilBiogeochemDecompCascadeBGCMod
private
!
! !PUBLIC MEMBER FUNCTIONS:
- public :: DecompCascadeBGCreadNML ! Read in namelist
public :: readParams ! Read in parameters from params file
public :: init_decompcascade_bgc ! Initialization
public :: decomp_rate_constants_bgc ! Figure out decomposition rates
@@ -43,14 +42,11 @@ module SoilBiogeochemDecompCascadeBGCMod
real(r8), public :: normalization_tref = 15._r8 ! reference temperature for normalizaion (degrees C)
!
! !PRIVATE DATA MEMBERS
-
- integer, private :: i_soil1 = -9 ! Soil Organic Matter (SOM) first pool
- integer, private :: i_soil2 = -9 ! SOM second pool
- integer, private :: i_soil3 = -9 ! SOM third pool
- integer, private, parameter :: nsompools = 3 ! Number of SOM pools
- integer, private, parameter :: i_litr1 = i_met_lit ! First litter pool, metobolic
- integer, private, parameter :: i_litr2 = i_cel_lit ! Second litter pool, cellulose
- integer, private, parameter :: i_litr3 = i_lig_lit ! Third litter pool, lignin
+ integer, private :: i_pas_som ! index of passive (aka protected) Soil Organic Matter (SOM)
+ integer, private :: i_slo_som ! index of slow (aka recalcitrant) SOM
+ integer, private :: i_act_som ! index of active (aka available) SOM
+ integer, private :: i_cel_lit ! index of cellulose litter pool
+ integer, private :: i_lig_lit ! index of lignin litter pool
type, private :: params_type
real(r8):: cn_s1_bgc !C:N for SOM 1
@@ -76,13 +72,12 @@ module SoilBiogeochemDecompCascadeBGCMod
real(r8):: tau_cwd_bgc ! corrected fragmentation rate constant CWD, century leaves wood decomposition rates open, within range of 0 - 0.5 yr^-1 (1/0.3) (1/yr)
real(r8) :: cwd_fcel_bgc !cellulose fraction for CWD
- real(r8) :: cwd_flig_bgc !
+ real(r8) :: cwd_flig
- real(r8) :: k_frag_bgc !fragmentation rate for CWD
real(r8) :: minpsi_bgc !minimum soil water potential for heterotrophic resp
real(r8) :: maxpsi_bgc !maximum soil water potential for heterotrophic resp
- real(r8) :: initial_Cstocks(nsompools) ! Initial Carbon stocks for a cold-start
+ real(r8), allocatable :: initial_Cstocks(:) ! Initial Carbon stocks for a cold-start
real(r8) :: initial_Cstocks_depth ! Soil depth for initial Carbon stocks for a cold-start
end type params_type
@@ -96,71 +91,6 @@ module SoilBiogeochemDecompCascadeBGCMod
contains
- !-----------------------------------------------------------------------
- subroutine DecompCascadeBGCreadNML( NLFilename )
- !
- ! !DESCRIPTION:
- ! Read the namelist for soil BGC Decomposition Cascade
- !
- ! !USES:
- use fileutils , only : getavu, relavu, opnfil
- use shr_nl_mod , only : shr_nl_find_group_name
- use spmdMod , only : masterproc, mpicom
- use shr_mpi_mod , only : shr_mpi_bcast
- use clm_varctl , only : iulog
- use shr_log_mod , only : errMsg => shr_log_errMsg
- use abortutils , only : endrun
- !
- ! !ARGUMENTS:
- character(len=*), intent(in) :: NLFilename ! Namelist filename
- !
- ! !LOCAL VARIABLES:
- integer :: ierr ! error code
- integer :: unitn ! unit for namelist file
-
- character(len=*), parameter :: subname = 'DecompCascadeBGCreadNML'
- character(len=*), parameter :: nmlname = 'CENTURY_soilBGCDecompCascade'
- !-----------------------------------------------------------------------
- real(r8) :: initial_Cstocks(nsompools), initial_Cstocks_depth
- namelist /CENTURY_soilBGCDecompCascade/ initial_Cstocks, initial_Cstocks_depth
-
- ! Initialize options to default values, in case they are not specified in
- ! the namelist
-
- initial_Cstocks(:) = 200._r8
- initial_Cstocks_depth = 0.3
-
- if (masterproc) then
- unitn = getavu()
- write(iulog,*) 'Read in '//nmlname//' namelist'
- call opnfil (NLFilename, unitn, 'F')
- call shr_nl_find_group_name(unitn, nmlname, status=ierr)
- if (ierr == 0) then
- read(unitn, nml=CENTURY_soilBGCDecompCascade, iostat=ierr)
- if (ierr /= 0) then
- call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(__FILE__, __LINE__))
- end if
- else
- call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(__FILE__, __LINE__))
- end if
- call relavu( unitn )
- end if
-
- call shr_mpi_bcast (initial_Cstocks , mpicom)
- call shr_mpi_bcast (initial_Cstocks_depth, mpicom)
-
- if (masterproc) then
- write(iulog,*) ' '
- write(iulog,*) nmlname//' settings:'
- write(iulog,nml=CENTURY_soilBGCDecompCascade)
- write(iulog,*) ' '
- end if
-
- params_inst%initial_Cstocks(:) = initial_Cstocks(:)
- params_inst%initial_Cstocks_depth = initial_Cstocks_depth
-
- end subroutine DecompCascadeBGCreadNML
-
!-----------------------------------------------------------------------
subroutine readParams ( ncid )
!
@@ -206,7 +136,7 @@ subroutine readParams ( ncid )
if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__))
params_inst%tau_s3_bgc=tempr
- tString='tau_cwd'
+ tString='tau_cwd_bgc'
call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv)
if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__))
params_inst%tau_cwd_bgc=tempr
@@ -271,11 +201,6 @@ subroutine readParams ( ncid )
if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__))
params_inst%cwd_fcel_bgc=tempr
- tString='k_frag'
- call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv)
- if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__))
- params_inst%k_frag_bgc=tempr
-
tString='minpsi_hr'
call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv)
if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__))
@@ -289,8 +214,18 @@ subroutine readParams ( ncid )
tString='cwd_flig'
call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv)
if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__))
- params_inst%cwd_flig_bgc=tempr
+ params_inst%cwd_flig=tempr
+ allocate(params_inst%initial_Cstocks(ndecomp_pools_max))
+ tString='initial_Cstocks_bgc'
+ call ncd_io(trim(tString), params_inst%initial_Cstocks(:), 'read', ncid, readvar=readv)
+ if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__))
+
+ tString='initial_Cstocks_depth_bgc'
+ call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv)
+ if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__))
+ params_inst%initial_Cstocks_depth=tempr
+
end subroutine readParams
!-----------------------------------------------------------------------
@@ -395,7 +330,7 @@ subroutine init_decompcascade_bgc(bounds, soilbiogeochem_state_inst, soilstate_i
! set the cellulose and lignin fractions for coarse woody debris
cwd_fcel = params_inst%cwd_fcel_bgc
- cwd_flig = params_inst%cwd_flig_bgc
+ cwd_flig = params_inst%cwd_flig
! set path fractions
f_s2s1 = 0.42_r8/(0.45_r8)
@@ -414,50 +349,110 @@ subroutine init_decompcascade_bgc(bounds, soilbiogeochem_state_inst, soilstate_i
initial_stock_soildepth = params_inst%initial_Cstocks_depth
!------------------- list of pools and their attributes ------------
- floating_cn_ratio_decomp_pools(i_litr1) = .true.
- decomp_cascade_con%decomp_pool_name_restart(i_litr1) = 'litr1'
- decomp_cascade_con%decomp_pool_name_history(i_litr1) = 'LITR1'
- decomp_cascade_con%decomp_pool_name_long(i_litr1) = 'litter 1'
- decomp_cascade_con%decomp_pool_name_short(i_litr1) = 'L1'
- is_litter(i_litr1) = .true.
- is_soil(i_litr1) = .false.
- is_cwd(i_litr1) = .false.
- initial_cn_ratio(i_litr1) = 90._r8
- initial_stock(i_litr1) = 0._r8
- is_metabolic(i_litr1) = .true.
- is_cellulose(i_litr1) = .false.
- is_lignin(i_litr1) = .false.
-
- floating_cn_ratio_decomp_pools(i_litr2) = .true.
- decomp_cascade_con%decomp_pool_name_restart(i_litr2) = 'litr2'
- decomp_cascade_con%decomp_pool_name_history(i_litr2) = 'LITR2'
- decomp_cascade_con%decomp_pool_name_long(i_litr2) = 'litter 2'
- decomp_cascade_con%decomp_pool_name_short(i_litr2) = 'L2'
- is_litter(i_litr2) = .true.
- is_soil(i_litr2) = .false.
- is_cwd(i_litr2) = .false.
- initial_cn_ratio(i_litr2) = 90._r8
- initial_stock(i_litr2) = 0._r8
- is_metabolic(i_litr2) = .false.
- is_cellulose(i_litr2) = .true.
- is_lignin(i_litr2) = .false.
-
- floating_cn_ratio_decomp_pools(i_litr3) = .true.
- decomp_cascade_con%decomp_pool_name_restart(i_litr3) = 'litr3'
- decomp_cascade_con%decomp_pool_name_history(i_litr3) = 'LITR3'
- decomp_cascade_con%decomp_pool_name_long(i_litr3) = 'litter 3'
- decomp_cascade_con%decomp_pool_name_short(i_litr3) = 'L3'
- is_litter(i_litr3) = .true.
- is_soil(i_litr3) = .false.
- is_cwd(i_litr3) = .false.
- initial_cn_ratio(i_litr3) = 90._r8
- initial_stock(i_litr3) = 0._r8
- is_metabolic(i_litr3) = .false.
- is_cellulose(i_litr3) = .false.
- is_lignin(i_litr3) = .true.
+ i_litr_min = 1
+ i_met_lit = i_litr_min
+ floating_cn_ratio_decomp_pools(i_met_lit) = .true.
+ decomp_cascade_con%decomp_pool_name_restart(i_met_lit) = 'litr1'
+ decomp_cascade_con%decomp_pool_name_history(i_met_lit) = 'MET_LIT'
+ decomp_cascade_con%decomp_pool_name_long(i_met_lit) = 'metabolic litter'
+ decomp_cascade_con%decomp_pool_name_short(i_met_lit) = 'L1'
+ is_litter(i_met_lit) = .true.
+ is_soil(i_met_lit) = .false.
+ is_cwd(i_met_lit) = .false.
+ initial_cn_ratio(i_met_lit) = 90._r8
+ initial_stock(i_met_lit) = params_inst%initial_Cstocks(i_met_lit)
+ is_metabolic(i_met_lit) = .true.
+ is_cellulose(i_met_lit) = .false.
+ is_lignin(i_met_lit) = .false.
+
+ i_cel_lit = i_met_lit + 1
+ floating_cn_ratio_decomp_pools(i_cel_lit) = .true.
+ decomp_cascade_con%decomp_pool_name_restart(i_cel_lit) = 'litr2'
+ decomp_cascade_con%decomp_pool_name_history(i_cel_lit) = 'CEL_LIT'
+ decomp_cascade_con%decomp_pool_name_long(i_cel_lit) = 'cellulosic litter'
+ decomp_cascade_con%decomp_pool_name_short(i_cel_lit) = 'L2'
+ is_litter(i_cel_lit) = .true.
+ is_soil(i_cel_lit) = .false.
+ is_cwd(i_cel_lit) = .false.
+ initial_cn_ratio(i_cel_lit) = 90._r8
+ initial_stock(i_cel_lit) = params_inst%initial_Cstocks(i_cel_lit)
+ is_metabolic(i_cel_lit) = .false.
+ is_cellulose(i_cel_lit) = .true.
+ is_lignin(i_cel_lit) = .false.
+
+ i_lig_lit = i_cel_lit + 1
+ floating_cn_ratio_decomp_pools(i_lig_lit) = .true.
+ decomp_cascade_con%decomp_pool_name_restart(i_lig_lit) = 'litr3'
+ decomp_cascade_con%decomp_pool_name_history(i_lig_lit) = 'LIG_LIT'
+ decomp_cascade_con%decomp_pool_name_long(i_lig_lit) = 'lignin litter'
+ decomp_cascade_con%decomp_pool_name_short(i_lig_lit) = 'L3'
+ is_litter(i_lig_lit) = .true.
+ is_soil(i_lig_lit) = .false.
+ is_cwd(i_lig_lit) = .false.
+ initial_cn_ratio(i_lig_lit) = 90._r8
+ initial_stock(i_lig_lit) = params_inst%initial_Cstocks(i_lig_lit)
+ is_metabolic(i_lig_lit) = .false.
+ is_cellulose(i_lig_lit) = .false.
+ is_lignin(i_lig_lit) = .true.
+
+ i_litr_max = i_lig_lit
+ if (i_litr_min /= 1 .or. i_litr_max < 2 .or. i_litr_max > 3) then
+ write(iulog,*) 'Expecting i_litr_min = 1 and i_litr_max = 2 or 3.'
+ write(iulog,*) 'See pftconMod, SoilBiogeochemCarbonFluxType, and'
+ write(iulog,*) 'clmfates_interfaceMod for ramifications of changing'
+ write(iulog,*) 'this assumption.'
+ call endrun(msg='ERROR: i_litr_min and/or i_litr_max out of range '// &
+ errMsg(sourcefile, __LINE__))
+ end if
+
+ i_act_som = i_lig_lit + 1
+ floating_cn_ratio_decomp_pools(i_act_som) = .false.
+ decomp_cascade_con%decomp_pool_name_restart(i_act_som) = 'soil1'
+ decomp_cascade_con%decomp_pool_name_history(i_act_som) = 'ACT_SOM'
+ decomp_cascade_con%decomp_pool_name_long(i_act_som) = 'active soil organic matter'
+ decomp_cascade_con%decomp_pool_name_short(i_act_som) = 'S1'
+ is_litter(i_act_som) = .false.
+ is_soil(i_act_som) = .true.
+ is_cwd(i_act_som) = .false.
+ initial_cn_ratio(i_act_som) = cn_s1
+ initial_stock(i_act_som) = params_inst%initial_Cstocks(i_act_som)
+ is_metabolic(i_act_som) = .false.
+ is_cellulose(i_act_som) = .false.
+ is_lignin(i_act_som) = .false.
+
+ i_slo_som = i_act_som + 1
+ floating_cn_ratio_decomp_pools(i_slo_som) = .false.
+ decomp_cascade_con%decomp_pool_name_restart(i_slo_som) = 'soil2'
+ decomp_cascade_con%decomp_pool_name_history(i_slo_som) = 'SLO_SOM'
+ decomp_cascade_con%decomp_pool_name_long(i_slo_som) = 'slow soil organic matter'
+ decomp_cascade_con%decomp_pool_name_short(i_slo_som) = 'S2'
+ is_litter(i_slo_som) = .false.
+ is_soil(i_slo_som) = .true.
+ is_cwd(i_slo_som) = .false.
+ initial_cn_ratio(i_slo_som) = cn_s2
+ initial_stock(i_slo_som) = params_inst%initial_Cstocks(i_slo_som)
+ is_metabolic(i_slo_som) = .false.
+ is_cellulose(i_slo_som) = .false.
+ is_lignin(i_slo_som) = .false.
+
+ i_pas_som = i_slo_som + 1
+ floating_cn_ratio_decomp_pools(i_pas_som) = .false.
+ decomp_cascade_con%decomp_pool_name_restart(i_pas_som) = 'soil3'
+ decomp_cascade_con%decomp_pool_name_history(i_pas_som) = 'PAS_SOM'
+ decomp_cascade_con%decomp_pool_name_long(i_pas_som) = 'passive soil organic matter'
+ decomp_cascade_con%decomp_pool_name_short(i_pas_som) = 'S3'
+ is_litter(i_pas_som) = .false.
+ is_soil(i_pas_som) = .true.
+ is_cwd(i_pas_som) = .false.
+ initial_cn_ratio(i_pas_som) = cn_s3
+ initial_stock(i_pas_som) = params_inst%initial_Cstocks(i_pas_som)
+ is_metabolic(i_pas_som) = .false.
+ is_cellulose(i_pas_som) = .false.
+ is_lignin(i_pas_som) = .false.
if (.not. use_fates) then
! CWD
+ i_cwd = i_pas_som + 1
floating_cn_ratio_decomp_pools(i_cwd) = .true.
decomp_cascade_con%decomp_pool_name_restart(i_cwd) = 'cwd'
decomp_cascade_con%decomp_pool_name_history(i_cwd) = 'CWD'
@@ -467,86 +462,28 @@ subroutine init_decompcascade_bgc(bounds, soilbiogeochem_state_inst, soilstate_i
is_soil(i_cwd) = .false.
is_cwd(i_cwd) = .true.
initial_cn_ratio(i_cwd) = 90._r8
- initial_stock(i_cwd) = 0._r8
+ initial_stock(i_cwd) = params_inst%initial_Cstocks(i_cwd)
is_metabolic(i_cwd) = .false.
is_cellulose(i_cwd) = .false.
is_lignin(i_cwd) = .false.
endif
- if (.not. use_fates) then
- i_soil1 = 5
- else
- i_soil1 = 4
- endif
- floating_cn_ratio_decomp_pools(i_soil1) = .false.
- decomp_cascade_con%decomp_pool_name_restart(i_soil1) = 'soil1'
- decomp_cascade_con%decomp_pool_name_history(i_soil1) = 'SOIL1'
- decomp_cascade_con%decomp_pool_name_long(i_soil1) = 'soil 1'
- decomp_cascade_con%decomp_pool_name_short(i_soil1) = 'S1'
- is_litter(i_soil1) = .false.
- is_soil(i_soil1) = .true.
- is_cwd(i_soil1) = .false.
- initial_cn_ratio(i_soil1) = cn_s1
- initial_stock(i_soil1) = params_inst%initial_Cstocks(1)
- is_metabolic(i_soil1) = .false.
- is_cellulose(i_soil1) = .false.
- is_lignin(i_soil1) = .false.
-
- if (.not. use_fates) then
- i_soil2 = 6
- else
- i_soil2 = 5
- endif
- floating_cn_ratio_decomp_pools(i_soil2) = .false.
- decomp_cascade_con%decomp_pool_name_restart(i_soil2) = 'soil2'
- decomp_cascade_con%decomp_pool_name_history(i_soil2) = 'SOIL2'
- decomp_cascade_con%decomp_pool_name_long(i_soil2) = 'soil 2'
- decomp_cascade_con%decomp_pool_name_short(i_soil2) = 'S2'
- is_litter(i_soil2) = .false.
- is_soil(i_soil2) = .true.
- is_cwd(i_soil2) = .false.
- initial_cn_ratio(i_soil2) = cn_s2
- initial_stock(i_soil2) = params_inst%initial_Cstocks(2)
- is_metabolic(i_soil2) = .false.
- is_cellulose(i_soil2) = .false.
- is_lignin(i_soil2) = .false.
-
- if (.not. use_fates) then
- i_soil3 = 7
- else
- i_soil3 = 6
- endif
- floating_cn_ratio_decomp_pools(i_soil3) = .false.
- decomp_cascade_con%decomp_pool_name_restart(i_soil3) = 'soil3'
- decomp_cascade_con%decomp_pool_name_history(i_soil3) = 'SOIL3'
- decomp_cascade_con%decomp_pool_name_long(i_soil3) = 'soil 3'
- decomp_cascade_con%decomp_pool_name_short(i_soil3) = 'S3'
- is_litter(i_soil3) = .false.
- is_soil(i_soil3) = .true.
- is_cwd(i_soil3) = .false.
- initial_cn_ratio(i_soil3) = cn_s3
- initial_stock(i_soil3) = params_inst%initial_Cstocks(3)
- is_metabolic(i_soil3) = .false.
- is_cellulose(i_soil3) = .false.
- is_lignin(i_soil3) = .false.
-
-
speedup_fac = 1._r8
!lit1
- spinup_factor(i_litr1) = 1._r8
+ spinup_factor(i_met_lit) = 1._r8
!lit2,3
- spinup_factor(i_litr2) = 1._r8
- spinup_factor(i_litr3) = 1._r8
+ spinup_factor(i_cel_lit) = 1._r8
+ spinup_factor(i_lig_lit) = 1._r8
!CWD
if (.not. use_fates) then
spinup_factor(i_cwd) = max(1._r8, (speedup_fac * params_inst%tau_cwd_bgc / 2._r8 ))
end if
!som1
- spinup_factor(i_soil1) = 1._r8
+ spinup_factor(i_act_som) = 1._r8
!som2,3
- spinup_factor(i_soil2) = max(1._r8, (speedup_fac * params_inst%tau_s2_bgc))
- spinup_factor(i_soil3) = max(1._r8, (speedup_fac * params_inst%tau_s3_bgc))
+ spinup_factor(i_slo_som) = max(1._r8, (speedup_fac * params_inst%tau_s2_bgc))
+ spinup_factor(i_pas_som) = max(1._r8, (speedup_fac * params_inst%tau_s3_bgc))
if ( masterproc ) then
write(iulog,*) 'Spinup_state ',spinup_state
@@ -557,57 +494,57 @@ subroutine init_decompcascade_bgc(bounds, soilbiogeochem_state_inst, soilstate_i
i_l1s1 = 1
decomp_cascade_con%cascade_step_name(i_l1s1) = 'L1S1'
rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l1s1) = rf_l1s1
- cascade_donor_pool(i_l1s1) = i_litr1
- cascade_receiver_pool(i_l1s1) = i_soil1
+ cascade_donor_pool(i_l1s1) = i_met_lit
+ cascade_receiver_pool(i_l1s1) = i_act_som
pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l1s1) = 1.0_r8
i_l2s1 = 2
decomp_cascade_con%cascade_step_name(i_l2s1) = 'L2S1'
rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l2s1) = rf_l2s1
- cascade_donor_pool(i_l2s1) = i_litr2
- cascade_receiver_pool(i_l2s1) = i_soil1
+ cascade_donor_pool(i_l2s1) = i_cel_lit
+ cascade_receiver_pool(i_l2s1) = i_act_som
pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l2s1)= 1.0_r8
i_l3s2 = 3
decomp_cascade_con%cascade_step_name(i_l3s2) = 'L3S2'
rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l3s2) = rf_l3s2
- cascade_donor_pool(i_l3s2) = i_litr3
- cascade_receiver_pool(i_l3s2) = i_soil2
+ cascade_donor_pool(i_l3s2) = i_lig_lit
+ cascade_receiver_pool(i_l3s2) = i_slo_som
pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l3s2) = 1.0_r8
i_s1s2 = 4
decomp_cascade_con%cascade_step_name(i_s1s2) = 'S1S2'
rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s1s2) = rf_s1s2(bounds%begc:bounds%endc,1:nlevdecomp)
- cascade_donor_pool(i_s1s2) = i_soil1
- cascade_receiver_pool(i_s1s2) = i_soil2
+ cascade_donor_pool(i_s1s2) = i_act_som
+ cascade_receiver_pool(i_s1s2) = i_slo_som
pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s1s2) = f_s1s2(bounds%begc:bounds%endc,1:nlevdecomp)
i_s1s3 = 5
decomp_cascade_con%cascade_step_name(i_s1s3) = 'S1S3'
rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s1s3) = rf_s1s3(bounds%begc:bounds%endc,1:nlevdecomp)
- cascade_donor_pool(i_s1s3) = i_soil1
- cascade_receiver_pool(i_s1s3) = i_soil3
+ cascade_donor_pool(i_s1s3) = i_act_som
+ cascade_receiver_pool(i_s1s3) = i_pas_som
pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s1s3) = f_s1s3(bounds%begc:bounds%endc,1:nlevdecomp)
i_s2s1 = 6
decomp_cascade_con%cascade_step_name(i_s2s1) = 'S2S1'
rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s2s1) = rf_s2s1
- cascade_donor_pool(i_s2s1) = i_soil2
- cascade_receiver_pool(i_s2s1) = i_soil1
+ cascade_donor_pool(i_s2s1) = i_slo_som
+ cascade_receiver_pool(i_s2s1) = i_act_som
pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s2s1) = f_s2s1
i_s2s3 = 7
decomp_cascade_con%cascade_step_name(i_s2s3) = 'S2S3'
rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s2s3) = rf_s2s3
- cascade_donor_pool(i_s2s3) = i_soil2
- cascade_receiver_pool(i_s2s3) = i_soil3
+ cascade_donor_pool(i_s2s3) = i_slo_som
+ cascade_receiver_pool(i_s2s3) = i_pas_som
pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s2s3) = f_s2s3
i_s3s1 = 8
decomp_cascade_con%cascade_step_name(i_s3s1) = 'S3S1'
rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s3s1) = rf_s3s1
- cascade_donor_pool(i_s3s1) = i_soil3
- cascade_receiver_pool(i_s3s1) = i_soil1
+ cascade_donor_pool(i_s3s1) = i_pas_som
+ cascade_receiver_pool(i_s3s1) = i_act_som
pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s3s1) = 1.0_r8
if (.not. use_fates) then
@@ -615,14 +552,14 @@ subroutine init_decompcascade_bgc(bounds, soilbiogeochem_state_inst, soilstate_i
decomp_cascade_con%cascade_step_name(i_cwdl2) = 'CWDL2'
rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_cwdl2) = rf_cwdl2
cascade_donor_pool(i_cwdl2) = i_cwd
- cascade_receiver_pool(i_cwdl2) = i_litr2
+ cascade_receiver_pool(i_cwdl2) = i_cel_lit
pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_cwdl2) = cwd_fcel
i_cwdl3 = 10
decomp_cascade_con%cascade_step_name(i_cwdl3) = 'CWDL3'
rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_cwdl3) = rf_cwdl3
cascade_donor_pool(i_cwdl3) = i_cwd
- cascade_receiver_pool(i_cwdl3) = i_litr3
+ cascade_receiver_pool(i_cwdl3) = i_lig_lit
pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_cwdl3) = cwd_flig
end if
@@ -630,6 +567,7 @@ subroutine init_decompcascade_bgc(bounds, soilbiogeochem_state_inst, soilstate_i
deallocate(rf_s1s3)
deallocate(f_s1s2)
deallocate(f_s1s3)
+ deallocate(params_inst%initial_Cstocks)
end associate
@@ -668,8 +606,6 @@ subroutine decomp_rate_constants_bgc(bounds, num_soilc, filter_soilc, &
real(r8):: k_s2 ! decomposition rate constant SOM 2 (1/sec)
real(r8):: k_s3 ! decomposition rate constant SOM 3 (1/sec)
real(r8):: k_frag ! fragmentation rate constant CWD (1/sec)
- real(r8):: cwdc_loss ! fragmentation rate for CWD carbon (gC/m2/s)
- real(r8):: cwdn_loss ! fragmentation rate for CWD nitrogen (gN/m2/s)
real(r8):: Q10 ! temperature dependence
real(r8):: froz_q10 ! separate q10 for frozen soil respiration rates. default to same as above zero rates
real(r8):: decomp_depth_efolding ! (meters) e-folding depth for reduction in decomposition [
@@ -744,14 +680,14 @@ subroutine decomp_rate_constants_bgc(bounds, num_soilc, filter_soilc, &
do fc = 1,num_soilc
c = filter_soilc(fc)
!
- if ( abs(spinup_factor(i_litr1) - 1._r8) .gt. .000001_r8) then
- spinup_geogterm_l1(c) = spinup_factor(i_litr1) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c)))
+ if ( abs(spinup_factor(i_met_lit) - 1._r8) .gt. .000001_r8) then
+ spinup_geogterm_l1(c) = spinup_factor(i_met_lit) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c)))
else
spinup_geogterm_l1(c) = 1._r8
endif
!
- if ( abs(spinup_factor(i_litr2) - 1._r8) .gt. .000001_r8) then
- spinup_geogterm_l23(c) = spinup_factor(i_litr2) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c)))
+ if ( abs(spinup_factor(i_cel_lit) - 1._r8) .gt. .000001_r8) then
+ spinup_geogterm_l23(c) = spinup_factor(i_cel_lit) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c)))
else
spinup_geogterm_l23(c) = 1._r8
endif
@@ -764,20 +700,20 @@ subroutine decomp_rate_constants_bgc(bounds, num_soilc, filter_soilc, &
endif
endif
!
- if ( abs(spinup_factor(i_soil1) - 1._r8) .gt. .000001_r8) then
- spinup_geogterm_s1(c) = spinup_factor(i_soil1) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c)))
+ if ( abs(spinup_factor(i_act_som) - 1._r8) .gt. .000001_r8) then
+ spinup_geogterm_s1(c) = spinup_factor(i_act_som) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c)))
else
spinup_geogterm_s1(c) = 1._r8
endif
!
- if ( abs(spinup_factor(i_soil2) - 1._r8) .gt. .000001_r8) then
- spinup_geogterm_s2(c) = spinup_factor(i_soil2) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c)))
+ if ( abs(spinup_factor(i_slo_som) - 1._r8) .gt. .000001_r8) then
+ spinup_geogterm_s2(c) = spinup_factor(i_slo_som) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c)))
else
spinup_geogterm_s2(c) = 1._r8
endif
!
- if ( abs(spinup_factor(i_soil3) - 1._r8) .gt. .000001_r8) then
- spinup_geogterm_s3(c) = spinup_factor(i_soil3) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c)))
+ if ( abs(spinup_factor(i_pas_som) - 1._r8) .gt. .000001_r8) then
+ spinup_geogterm_s3(c) = spinup_factor(i_pas_som) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c)))
else
spinup_geogterm_s3(c) = 1._r8
endif
@@ -986,70 +922,43 @@ subroutine decomp_rate_constants_bgc(bounds, num_soilc, filter_soilc, &
end do
endif
- if (use_vertsoilc) then
- ! add a term to reduce decomposition rate at depth
- ! for now used a fixed e-folding depth
- do j = 1, nlevdecomp
- do fc = 1,num_soilc
- c = filter_soilc(fc)
- depth_scalar(c,j) = exp(-zsoi(j)/decomp_depth_efolding)
- end do
+ ! add a term to reduce decomposition rate at depth
+ ! for now used a fixed e-folding depth
+ do j = 1, nlevdecomp
+ do fc = 1, num_soilc
+ c = filter_soilc(fc)
+ if (use_vertsoilc) then
+ depth_scalar(c,j) = exp(-zsoi(j) / decomp_depth_efolding)
+ else
+ depth_scalar(c,j) = 1.0_r8
+ end if
end do
- end if
+ end do
! calculate rate constants for all litter and som pools
- if (use_vertsoilc) then
- do j = 1,nlevdecomp
- do fc = 1,num_soilc
- c = filter_soilc(fc)
- decomp_k(c,j,i_litr1) = k_l1 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) &
- * spinup_geogterm_l1(c)
- decomp_k(c,j,i_litr2) = k_l2_l3 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) &
- * spinup_geogterm_l23(c)
- decomp_k(c,j,i_litr3) = k_l2_l3 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) &
- * spinup_geogterm_l23(c)
- decomp_k(c,j,i_soil1) = k_s1 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) &
- * spinup_geogterm_s1(c)
- decomp_k(c,j,i_soil2) = k_s2 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) &
- * spinup_geogterm_s2(c)
- decomp_k(c,j,i_soil3) = k_s3 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) &
- * spinup_geogterm_s3(c)
- end do
- end do
- else
- do j = 1,nlevdecomp
- do fc = 1,num_soilc
- c = filter_soilc(fc)
- decomp_k(c,j,i_litr1) = k_l1 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_l1(c)
- decomp_k(c,j,i_litr2) = k_l2_l3 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_l23(c)
- decomp_k(c,j,i_litr3) = k_l2_l3 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_l23(c)
- decomp_k(c,j,i_soil1) = k_s1 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_s1(c)
- decomp_k(c,j,i_soil2) = k_s2 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_s2(c)
- decomp_k(c,j,i_soil3) = k_s3 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_s3(c)
- end do
+ do j = 1,nlevdecomp
+ do fc = 1,num_soilc
+ c = filter_soilc(fc)
+ decomp_k(c,j,i_met_lit) = k_l1 * t_scalar(c,j) * w_scalar(c,j) * &
+ depth_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_l1(c)
+ decomp_k(c,j,i_cel_lit) = k_l2_l3 * t_scalar(c,j) * w_scalar(c,j) * &
+ depth_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_l23(c)
+ decomp_k(c,j,i_lig_lit) = k_l2_l3 * t_scalar(c,j) * w_scalar(c,j) * &
+ depth_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_l23(c)
+ decomp_k(c,j,i_act_som) = k_s1 * t_scalar(c,j) * w_scalar(c,j) * &
+ depth_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_s1(c)
+ decomp_k(c,j,i_slo_som) = k_s2 * t_scalar(c,j) * w_scalar(c,j) * &
+ depth_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_s2(c)
+ decomp_k(c,j,i_pas_som) = k_s3 * t_scalar(c,j) * w_scalar(c,j) * &
+ depth_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_s3(c)
+ ! same for cwd but only if fates is not enabled; fates handles CWD
+ ! on its own structure
+ if (.not. use_fates) then
+ decomp_k(c,j,i_cwd) = k_frag * t_scalar(c,j) * w_scalar(c,j) * &
+ depth_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_cwd(c)
+ end if
end do
- end if
-
- ! do the same for cwd, but only if fates is not enabled, because fates handles CWD on its own structure
- if (.not. use_fates) then
- if (use_vertsoilc) then
- do j = 1,nlevdecomp
- do fc = 1,num_soilc
- c = filter_soilc(fc)
- decomp_k(c,j,i_cwd) = k_frag * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * &
- o_scalar(c,j) * spinup_geogterm_cwd(c)
- end do
- end do
- else
- do j = 1,nlevdecomp
- do fc = 1,num_soilc
- c = filter_soilc(fc)
- decomp_k(c,j,i_cwd) = k_frag * t_scalar(c,j) * w_scalar(c,j) * &
- o_scalar(c,j) * spinup_geogterm_cwd(c)
- end do
- end do
- end if
- end if
+ end do
end associate
diff --git a/src/soilbiogeochem/SoilBiogeochemDecompCascadeCNMod.F90 b/src/soilbiogeochem/SoilBiogeochemDecompCascadeCNMod.F90
index 8305fcefe6..5a198483e5 100644
--- a/src/soilbiogeochem/SoilBiogeochemDecompCascadeCNMod.F90
+++ b/src/soilbiogeochem/SoilBiogeochemDecompCascadeCNMod.F90
@@ -10,7 +10,7 @@ module SoilBiogeochemDecompCascadeCNMod
use shr_const_mod , only : SHR_CONST_TKFRZ
use shr_log_mod , only : errMsg => shr_log_errMsg
use clm_varpar , only : nlevsoi, nlevgrnd, nlevdecomp, ndecomp_cascade_transitions, ndecomp_pools
- use clm_varpar , only : i_met_lit, i_cel_lit, i_lig_lit, i_cwd
+ use clm_varpar , only : i_litr1, i_litr2, i_litr3, i_cwd
use clm_varctl , only : iulog, spinup_state, anoxia, use_lch4, use_vertsoilc, use_fates
use clm_varcon , only : zsoi
use decompMod , only : bounds_type
@@ -33,6 +33,12 @@ module SoilBiogeochemDecompCascadeCNMod
public :: init_decompcascade_cn
public :: decomp_rate_constants_cn
+ ! !PRIVATE DATA MEMBERS
+ integer, private :: i_soil1 = -9 ! Soil Organic Matter (SOM) first pool
+ integer, private :: i_soil2 = -9 ! SOM second pool
+ integer, private :: i_soil3 = -9 ! SOM third pool
+ integer, private :: i_soil4 = -9 ! SOM fourth pool
+
type, private :: params_type
real(r8):: cn_s1_cn !C:N for SOM 1
real(r8):: cn_s2_cn !C:N for SOM 2
@@ -194,7 +200,7 @@ subroutine readParams ( ncid )
if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__))
params_inst%k_s4_cn=tempr
- tString='k_frag'
+ tString='k_frag_cn'
call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv)
if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__))
params_inst%k_frag_cn=tempr
@@ -244,13 +250,6 @@ subroutine init_decompcascade_cn(bounds, soilbiogeochem_state_inst)
real(r8) :: cn_s3
real(r8) :: cn_s4
- integer :: i_litr1
- integer :: i_litr2
- integer :: i_litr3
- integer :: i_soil1
- integer :: i_soil2
- integer :: i_soil3
- integer :: i_soil4
integer :: i_l1s1
integer :: i_l2s2
integer :: i_l3s3
@@ -302,7 +301,6 @@ subroutine init_decompcascade_cn(bounds, soilbiogeochem_state_inst)
!------------------- list of pools and their attributes ------------
- i_litr1 = i_met_lit
floating_cn_ratio_decomp_pools(i_litr1) = .true.
decomp_cascade_con%decomp_pool_name_restart(i_litr1) = 'litr1'
decomp_cascade_con%decomp_pool_name_history(i_litr1) = 'LITR1'
@@ -317,7 +315,7 @@ subroutine init_decompcascade_cn(bounds, soilbiogeochem_state_inst)
is_cellulose(i_litr1) = .false.
is_lignin(i_litr1) = .false.
- i_litr2 = i_cel_lit
+ i_litr2 = i_litr1 + 1
floating_cn_ratio_decomp_pools(i_litr2) = .true.
decomp_cascade_con%decomp_pool_name_restart(i_litr2) = 'litr2'
decomp_cascade_con%decomp_pool_name_history(i_litr2) = 'LITR2'
@@ -332,7 +330,7 @@ subroutine init_decompcascade_cn(bounds, soilbiogeochem_state_inst)
is_cellulose(i_litr2) = .true.
is_lignin(i_litr2) = .false.
- i_litr3 = i_lig_lit
+ i_litr3 = i_litr2 + 1
floating_cn_ratio_decomp_pools(i_litr3) = .true.
decomp_cascade_con%decomp_pool_name_restart(i_litr3) = 'litr3'
decomp_cascade_con%decomp_pool_name_history(i_litr3) = 'LITR3'
@@ -347,27 +345,7 @@ subroutine init_decompcascade_cn(bounds, soilbiogeochem_state_inst)
is_cellulose(i_litr3) = .false.
is_lignin(i_litr3) = .true.
- if (.not. use_fates) then
- floating_cn_ratio_decomp_pools(i_cwd) = .true.
- decomp_cascade_con%decomp_pool_name_restart(i_cwd) = 'cwd'
- decomp_cascade_con%decomp_pool_name_history(i_cwd) = 'CWD'
- decomp_cascade_con%decomp_pool_name_long(i_cwd) = 'coarse woody debris'
- decomp_cascade_con%decomp_pool_name_short(i_cwd) = 'CWD'
- is_litter(i_cwd) = .false.
- is_soil(i_cwd) = .false.
- is_cwd(i_cwd) = .true.
- initial_cn_ratio(i_cwd) = 500._r8
- initial_stock(i_cwd) = 0._r8
- is_metabolic(i_cwd) = .false.
- is_cellulose(i_cwd) = .false.
- is_lignin(i_cwd) = .false.
- end if
-
- if ( .not. use_fates ) then
- i_soil1 = 5
- else
- i_soil1 = 4
- endif
+ i_soil1 = i_litr3 + 1
floating_cn_ratio_decomp_pools(i_soil1) = .false.
decomp_cascade_con%decomp_pool_name_restart(i_soil1) = 'soil1'
decomp_cascade_con%decomp_pool_name_history(i_soil1) = 'SOIL1'
@@ -382,11 +360,7 @@ subroutine init_decompcascade_cn(bounds, soilbiogeochem_state_inst)
is_cellulose(i_soil1) = .false.
is_lignin(i_soil1) = .false.
- if ( .not. use_fates ) then
- i_soil2 = 6
- else
- i_soil2 = 5
- endif
+ i_soil2 = i_soil1 + 1
floating_cn_ratio_decomp_pools(i_soil2) = .false.
decomp_cascade_con%decomp_pool_name_restart(i_soil2) = 'soil2'
decomp_cascade_con%decomp_pool_name_history(i_soil2) = 'SOIL2'
@@ -401,11 +375,7 @@ subroutine init_decompcascade_cn(bounds, soilbiogeochem_state_inst)
is_cellulose(i_soil2) = .false.
is_lignin(i_soil2) = .false.
- if ( .not. use_fates ) then
- i_soil3 = 7
- else
- i_soil3 = 6
- endif
+ i_soil3 = i_soil2 + 1
floating_cn_ratio_decomp_pools(i_soil3) = .false.
decomp_cascade_con%decomp_pool_name_restart(i_soil3) = 'soil3'
decomp_cascade_con%decomp_pool_name_history(i_soil3) = 'SOIL3'
@@ -420,11 +390,7 @@ subroutine init_decompcascade_cn(bounds, soilbiogeochem_state_inst)
is_cellulose(i_soil3) = .false.
is_lignin(i_soil3) = .false.
- if ( .not. use_fates ) then
- i_soil4 = 8
- else
- i_soil4 = 7
- endif
+ i_soil4 = i_soil3 + 1
floating_cn_ratio_decomp_pools(i_soil4) = .false.
decomp_cascade_con%decomp_pool_name_restart(i_soil4) = 'soil4'
decomp_cascade_con%decomp_pool_name_history(i_soil4) = 'SOIL4'
@@ -439,6 +405,23 @@ subroutine init_decompcascade_cn(bounds, soilbiogeochem_state_inst)
is_cellulose(i_soil4) = .false.
is_lignin(i_soil4) = .false.
+ if (.not. use_fates) then
+ i_cwd = i_soil4 + 1
+ floating_cn_ratio_decomp_pools(i_cwd) = .true.
+ decomp_cascade_con%decomp_pool_name_restart(i_cwd) = 'cwd'
+ decomp_cascade_con%decomp_pool_name_history(i_cwd) = 'CWD'
+ decomp_cascade_con%decomp_pool_name_long(i_cwd) = 'coarse woody debris'
+ decomp_cascade_con%decomp_pool_name_short(i_cwd) = 'CWD'
+ is_litter(i_cwd) = .false.
+ is_soil(i_cwd) = .false.
+ is_cwd(i_cwd) = .true.
+ initial_cn_ratio(i_cwd) = 500._r8
+ initial_stock(i_cwd) = 0._r8
+ is_metabolic(i_cwd) = .false.
+ is_cellulose(i_cwd) = .false.
+ is_lignin(i_cwd) = .false.
+ end if
+
floating_cn_ratio_decomp_pools(i_atm) = .false.
decomp_cascade_con%decomp_pool_name_restart(i_atm) = 'atmosphere'
decomp_cascade_con%decomp_pool_name_history(i_atm) = 'atmosphere'
@@ -576,23 +559,6 @@ subroutine decomp_rate_constants_cn(bounds, &
real(r8):: k_s3 ! decomposition rate constant SOM 3
real(r8):: k_s4 ! decomposition rate constant SOM 4
real(r8):: k_frag ! fragmentation rate constant CWD
- real(r8):: ck_l1 ! corrected decomposition rate constant litter 1
- real(r8):: ck_l2 ! corrected decomposition rate constant litter 2
- real(r8):: ck_l3 ! corrected decomposition rate constant litter 3
- real(r8):: ck_s1 ! corrected decomposition rate constant SOM 1
- real(r8):: ck_s2 ! corrected decomposition rate constant SOM 2
- real(r8):: ck_s3 ! corrected decomposition rate constant SOM 3
- real(r8):: ck_s4 ! corrected decomposition rate constant SOM 4
- real(r8):: ck_frag ! corrected fragmentation rate constant CWD
- real(r8):: cwdc_loss ! fragmentation rate for CWD carbon (gC/m2/s)
- real(r8):: cwdn_loss ! fragmentation rate for CWD nitrogen (gN/m2/s)
- integer :: i_litr1
- integer :: i_litr2
- integer :: i_litr3
- integer :: i_soil1
- integer :: i_soil2
- integer :: i_soil3
- integer :: i_soil4
integer :: c, fc, j, k, l
real(r8):: Q10 ! temperature dependence
real(r8):: froz_q10 ! separate q10 for frozen soil respiration rates. default to same as above zero rates
@@ -679,21 +645,6 @@ subroutine decomp_rate_constants_cn(bounds, &
k_s4 = k_s4 * params_inst%spinup_vector(4)
endif
- i_litr1 = 1
- i_litr2 = 2
- i_litr3 = 3
- if (use_fates) then
- i_soil1 = 4
- i_soil2 = 5
- i_soil3 = 6
- i_soil4 = 7
- else
- i_soil1 = 5
- i_soil2 = 6
- i_soil3 = 7
- i_soil4 = 8
- endif
-
!--- time dependent coefficients-----!
if ( nlevdecomp .eq. 1 ) then
@@ -857,64 +808,45 @@ subroutine decomp_rate_constants_cn(bounds, &
o_scalar(bounds%begc:bounds%endc,1:nlevdecomp) = 1._r8
end if
- if (use_vertsoilc) then
- ! add a term to reduce decomposition rate at depth
- ! for now used a fixed e-folding depth
- do j = 1, nlevdecomp
- do fc = 1,num_soilc
- c = filter_soilc(fc)
- depth_scalar(c,j) = exp(-zsoi(j)/decomp_depth_efolding)
- end do
- end do
- end if
-
- ! calculate rate constants for all litter and som pools
- if (use_vertsoilc) then
- do j = 1,nlevdecomp
- do fc = 1,num_soilc
- c = filter_soilc(fc)
- decomp_k(c,j,i_litr1) = k_l1 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) / dt
- decomp_k(c,j,i_litr2) = k_l2 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) / dt
- decomp_k(c,j,i_litr3) = k_l3 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) / dt
- decomp_k(c,j,i_soil1) = k_s1 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) / dt
- decomp_k(c,j,i_soil2) = k_s2 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) / dt
- decomp_k(c,j,i_soil3) = k_s3 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) / dt
- decomp_k(c,j,i_soil4) = k_s4 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) / dt
- end do
+ ! add a term to reduce decomposition rate at depth
+ ! for now used a fixed e-folding depth
+ do j = 1, nlevdecomp
+ do fc = 1, num_soilc
+ c = filter_soilc(fc)
+ if (use_vertsoilc) then
+ depth_scalar(c,j) = exp(-zsoi(j) / decomp_depth_efolding)
+ else
+ depth_scalar(c,j) = 1.0_r8
+ end if
end do
- else
- do j = 1,nlevdecomp
- do fc = 1,num_soilc
- c = filter_soilc(fc)
- decomp_k(c,j,i_litr1) = k_l1 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) / dt
- decomp_k(c,j,i_litr2) = k_l2 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) / dt
- decomp_k(c,j,i_litr3) = k_l3 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) / dt
- decomp_k(c,j,i_soil1) = k_s1 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) / dt
- decomp_k(c,j,i_soil2) = k_s2 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) / dt
- decomp_k(c,j,i_soil3) = k_s3 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) / dt
- decomp_k(c,j,i_soil4) = k_s4 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) / dt
- end do
+ end do
+
+ ! calculate rate constants for all litter and som pools
+ do j = 1,nlevdecomp
+ do fc = 1,num_soilc
+ c = filter_soilc(fc)
+ decomp_k(c,j,i_litr1) = k_l1 * t_scalar(c,j) * w_scalar(c,j) * &
+ depth_scalar(c,j) * o_scalar(c,j) / dt
+ decomp_k(c,j,i_litr2) = k_l2 * t_scalar(c,j) * w_scalar(c,j) * &
+ depth_scalar(c,j) * o_scalar(c,j) / dt
+ decomp_k(c,j,i_litr3) = k_l3 * t_scalar(c,j) * w_scalar(c,j) * &
+ depth_scalar(c,j) * o_scalar(c,j) / dt
+ decomp_k(c,j,i_soil1) = k_s1 * t_scalar(c,j) * w_scalar(c,j) * &
+ depth_scalar(c,j) * o_scalar(c,j) / dt
+ decomp_k(c,j,i_soil2) = k_s2 * t_scalar(c,j) * w_scalar(c,j) * &
+ depth_scalar(c,j) * o_scalar(c,j) / dt
+ decomp_k(c,j,i_soil3) = k_s3 * t_scalar(c,j) * w_scalar(c,j) * &
+ depth_scalar(c,j) * o_scalar(c,j) / dt
+ decomp_k(c,j,i_soil4) = k_s4 * t_scalar(c,j) * w_scalar(c,j) * &
+ depth_scalar(c,j) * o_scalar(c,j) / dt
+ ! same for cwd but only if fates is not enabled; fates handles CWD
+ ! on its own structure
+ if (.not. use_fates) then
+ decomp_k(c,j,i_cwd) = k_frag * t_scalar(c,j) * w_scalar(c,j) * &
+ depth_scalar(c,j) * o_scalar(c,j) / dt
+ end if
end do
- end if
-
- ! do the same for cwd, but only if fates is not enabled (because fates handles CWD on its own structure
- if (.not. use_fates) then
- if (use_vertsoilc) then
- do j = 1,nlevdecomp
- do fc = 1,num_soilc
- c = filter_soilc(fc)
- decomp_k(c,j,i_cwd) = k_frag * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) / dt
- end do
- end do
- else
- do j = 1,nlevdecomp
- do fc = 1,num_soilc
- c = filter_soilc(fc)
- decomp_k(c,j,i_cwd) = k_frag * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) / dt
- end do
- end do
- end if
- end if
+ end do
end associate
diff --git a/src/soilbiogeochem/SoilBiogeochemDecompMod.F90 b/src/soilbiogeochem/SoilBiogeochemDecompMod.F90
index a6d960e487..43b817c65b 100644
--- a/src/soilbiogeochem/SoilBiogeochemDecompMod.F90
+++ b/src/soilbiogeochem/SoilBiogeochemDecompMod.F90
@@ -127,7 +127,6 @@ subroutine SoilBiogeochemDecomp (bounds, num_soilc, filter_soilc,
w_scalar => soilbiogeochem_carbonflux_inst%w_scalar_col , & ! Input: [real(r8) (:,:) ] fraction by which decomposition is limited by moisture availability
decomp_cascade_hr_vr => soilbiogeochem_carbonflux_inst%decomp_cascade_hr_vr_col , & ! Output: [real(r8) (:,:,:) ] vertically-resolved het. resp. from decomposing C pools (gC/m3/s)
decomp_cascade_ctransfer_vr => soilbiogeochem_carbonflux_inst%decomp_cascade_ctransfer_vr_col , & ! Output: [real(r8) (:,:,:) ] vertically-resolved het. resp. from decomposing C pools (gC/m3/s)
- decomp_k => soilbiogeochem_carbonflux_inst%decomp_k_col , & ! Output: [real(r8) (:,:,:) ] rate constant for decomposition (1./sec)
phr_vr => soilbiogeochem_carbonflux_inst%phr_vr_col , & ! Input: [real(r8) (:,:) ] potential HR (gC/m3/s)
fphr => soilbiogeochem_carbonflux_inst%fphr_col & ! Output: [real(r8) (:,:) ] fraction of potential SOM + LITTER heterotrophic
)
diff --git a/src/soilbiogeochem/SoilBiogeochemNStateUpdate1Mod.F90 b/src/soilbiogeochem/SoilBiogeochemNStateUpdate1Mod.F90
index c3bc61a315..3d99d93755 100644
--- a/src/soilbiogeochem/SoilBiogeochemNStateUpdate1Mod.F90
+++ b/src/soilbiogeochem/SoilBiogeochemNStateUpdate1Mod.F90
@@ -7,9 +7,9 @@ module SoilBiogeochemNStateUpdate1Mod
! !USES:
use shr_kind_mod , only: r8 => shr_kind_r8
use clm_time_manager , only : get_step_size_real
- use clm_varpar , only : nlevdecomp, ndecomp_pools, ndecomp_cascade_transitions
+ use clm_varpar , only : nlevdecomp, ndecomp_cascade_transitions
use clm_varctl , only : iulog, use_nitrif_denitrif, use_crop
- use clm_varcon , only : nitrif_n2o_loss_frac, dzsoi_decomp
+ use clm_varcon , only : nitrif_n2o_loss_frac
use SoilBiogeochemStateType , only : soilbiogeochem_state_type
use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type
use SoilBiogeochemNitrogenfluxType , only : soilbiogeochem_nitrogenflux_type
@@ -43,7 +43,7 @@ subroutine SoilBiogeochemNStateUpdate1(num_soilc, filter_soilc, &
!
! !LOCAL VARIABLES:
integer :: c,p,j,l,k ! indices
- integer :: fp,fc ! lake filter indices
+ integer :: fc ! lake filter indices
real(r8):: dt ! radiation time step (seconds)
!-----------------------------------------------------------------------
diff --git a/src/soilbiogeochem/SoilBiogeochemNitrifDenitrifMod.F90 b/src/soilbiogeochem/SoilBiogeochemNitrifDenitrifMod.F90
index 784b90719b..0bdbaa2032 100644
--- a/src/soilbiogeochem/SoilBiogeochemNitrifDenitrifMod.F90
+++ b/src/soilbiogeochem/SoilBiogeochemNitrifDenitrifMod.F90
@@ -249,7 +249,7 @@ subroutine SoilBiogeochemNitrifDenitrif(bounds, num_soilc, filter_soilc, &
organic_max = CNParamsShareInst%organic_max
- pH(bounds%begc:bounds%endc) = 6.5 !!! set all soils with the same pH as placeholder here
+ pH(bounds%begc:bounds%endc) = 6.5_r8 !!! set all soils with the same pH as placeholder here
co2diff_con(1) = 0.1325_r8
co2diff_con(2) = 0.0009_r8
@@ -310,7 +310,7 @@ subroutine SoilBiogeochemNitrifDenitrif(bounds, num_soilc, filter_soilc, &
k_nitr_t_vr(c,j) = min(t_scalar(c,j), 1._r8)
! ph function from Parton et al., (2001, 1996)
- k_nitr_ph_vr(c,j) = 0.56 + atan(rpi * 0.45 * (-5.+ pH(c)))/rpi
+ k_nitr_ph_vr(c,j) = 0.56_r8 + atan(rpi * 0.45_r8 * (-5._r8+ pH(c)))/rpi
! moisture function-- assume the same moisture function as limits heterotrophic respiration
! Parton et al. base their nitrification- soil moisture rate constants based on heterotrophic rates-- can we do the same?
@@ -383,7 +383,7 @@ subroutine SoilBiogeochemNitrifDenitrif(bounds, num_soilc, filter_soilc, &
fr_WFPS(c,j) = max(0.1_r8, 0.015_r8 * wfps_vr(c,j) - 0.32_r8)
! final ratio expression
- n2_n2o_ratio_denit_vr(c,j) = max(0.16*ratio_k1(c,j), ratio_k1(c,j)*exp(-0.8 * ratio_no3_co2(c,j))) * fr_WFPS(c,j)
+ n2_n2o_ratio_denit_vr(c,j) = max(0.16_r8*ratio_k1(c,j), ratio_k1(c,j)*exp(-0.8_r8 * ratio_no3_co2(c,j))) * fr_WFPS(c,j)
end do
diff --git a/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 b/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90
index d852c35496..5f92b3cfcb 100644
--- a/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90
+++ b/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90
@@ -340,7 +340,7 @@ subroutine InitHistory(this, bounds)
data1dptr => this%decomp_cascade_sminn_flux_col(:,l)
if ( decomp_cascade_con%cascade_receiver_pool(l) /= 0 ) then
fieldname = 'SMINN_TO_'//&
- trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_receiver_pool(l)))//'N_'//&
+ trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_receiver_pool(l)))//'N_'//&
trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_donor_pool(l)))
longname = 'mineral N flux for decomp. of '&
//trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//&
@@ -377,7 +377,7 @@ subroutine InitHistory(this, bounds)
data2dptr => this%decomp_cascade_sminn_flux_vr_col(:,:,l)
if ( decomp_cascade_con%cascade_receiver_pool(l) /= 0 ) then
fieldname = 'SMINN_TO_'&
- //trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_receiver_pool(l)))//'N_'//&
+ //trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_receiver_pool(l)))//'N_'//&
trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_donor_pool(l)))//trim(vr_suffix)
longname = 'mineral N flux for decomp. of '&
//trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//&
diff --git a/src/soilbiogeochem/SoilBiogeochemPotentialMod.F90 b/src/soilbiogeochem/SoilBiogeochemPotentialMod.F90
index 70d9289e7d..d7d6ed727f 100644
--- a/src/soilbiogeochem/SoilBiogeochemPotentialMod.F90
+++ b/src/soilbiogeochem/SoilBiogeochemPotentialMod.F90
@@ -109,7 +109,6 @@ subroutine SoilBiogeochemPotential (bounds, num_soilc, filter_soilc, &
floating_cn_ratio_decomp_pools => decomp_cascade_con%floating_cn_ratio_decomp_pools , & ! Input: [logical (:) ] TRUE => pool has fixed C:N ratio
initial_cn_ratio => decomp_cascade_con%initial_cn_ratio , & ! Input: [real(r8) (:) ] c:n ratio for initialization of pools
- fpi_vr => soilbiogeochem_state_inst%fpi_vr_col , & ! Input: [real(r8) (:,:) ] fraction of potential immobilization (no units)
rf_decomp_cascade => soilbiogeochem_state_inst%rf_decomp_cascade_col , & ! Input: [real(r8) (:,:,:) ] respired fraction in decomposition step (frac)
pathfrac_decomp_cascade => soilbiogeochem_state_inst%pathfrac_decomp_cascade_col , & ! Input: [real(r8) (:,:,:) ] what fraction of C leaving a given pool passes through a given transition (frac)
@@ -117,21 +116,11 @@ subroutine SoilBiogeochemPotential (bounds, num_soilc, filter_soilc, &
decomp_cpools_vr => soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col , & ! Input: [real(r8) (:,:,:) ] (gC/m3) vertically-resolved decomposing (litter, cwd, soil) c pools
- decomp_cascade_ntransfer_vr => soilbiogeochem_nitrogenflux_inst%decomp_cascade_ntransfer_vr_col , & ! Output: [real(r8) (:,:,:) ] vert-res transfer of N from donor to receiver pool along decomp. cascade (gN/m3/s)
- decomp_cascade_sminn_flux_vr => soilbiogeochem_nitrogenflux_inst%decomp_cascade_sminn_flux_vr_col , & ! Output: [real(r8) (:,:,:) ] vert-res mineral N flux for transition along decomposition cascade (gN/m3/s)
potential_immob_vr => soilbiogeochem_nitrogenflux_inst%potential_immob_vr_col , & ! Output: [real(r8) (:,:) ]
- sminn_to_denit_decomp_cascade_vr => soilbiogeochem_nitrogenflux_inst%sminn_to_denit_decomp_cascade_vr_col , & ! Output: [real(r8) (:,:,:) ]
gross_nmin_vr => soilbiogeochem_nitrogenflux_inst%gross_nmin_vr_col , & ! Output: [real(r8) (:,:) ]
- net_nmin_vr => soilbiogeochem_nitrogenflux_inst%net_nmin_vr_col , & ! Output: [real(r8) (:,:) ]
- gross_nmin => soilbiogeochem_nitrogenflux_inst%gross_nmin_col , & ! Output: [real(r8) (:) ] gross rate of N mineralization (gN/m2/s)
- net_nmin => soilbiogeochem_nitrogenflux_inst%net_nmin_col , & ! Output: [real(r8) (:) ] net rate of N mineralization (gN/m2/s)
- w_scalar => soilbiogeochem_carbonflux_inst%w_scalar_col , & ! Input: [real(r8) (:,:) ] fraction by which decomposition is limited by moisture availability
- decomp_cascade_hr_vr => soilbiogeochem_carbonflux_inst%decomp_cascade_hr_vr_col , & ! Output: [real(r8) (:,:,:) ] vertically-resolved het. resp. from decomposing C pools (gC/m3/s)
- decomp_cascade_ctransfer_vr => soilbiogeochem_carbonflux_inst%decomp_cascade_ctransfer_vr_col , & ! Output: [real(r8) (:,:,:) ] vertically-resolved het. resp. from decomposing C pools (gC/m3/s)
decomp_k => soilbiogeochem_carbonflux_inst%decomp_k_col , & ! Output: [real(r8) (:,:,:) ] rate constant for decomposition (1./sec)
- phr_vr => soilbiogeochem_carbonflux_inst%phr_vr_col , & ! Output: [real(r8) (:,:) ] potential HR (gC/m3/s)
- fphr => soilbiogeochem_carbonflux_inst%fphr_col & ! Output: [real(r8) (:,:) ] fraction of potential SOM + LITTER heterotrophic
+ phr_vr => soilbiogeochem_carbonflux_inst%phr_vr_col & ! Output: [real(r8) (:,:) ] potential HR (gC/m3/s)
)
if ( .not. use_fates ) then
diff --git a/src/unit_test_shr/unittestSubgridMod.F90 b/src/unit_test_shr/unittestSubgridMod.F90
index 2a02815614..3b42976e79 100644
--- a/src/unit_test_shr/unittestSubgridMod.F90
+++ b/src/unit_test_shr/unittestSubgridMod.F90
@@ -83,12 +83,11 @@ module unittestSubgridMod
! Indices of initial grid cell / landunit / column / patch
!
- ! Note that we do NOT start at 1, in order to catch any code that assumes indices start
- ! at 1.
- integer, parameter, public :: begg = 11
- integer, parameter, public :: begl = 21
- integer, parameter, public :: begc = 31
- integer, parameter, public :: begp = 41
+ ! Now we do start at 1.
+ integer, parameter, public :: begg = 1
+ integer, parameter, public :: begl = 1
+ integer, parameter, public :: begc = 1
+ integer, parameter, public :: begp = 1
! Indices of final grid cell / landunit / column / patch
! Note that these are the final indices of the allocated arrays, which may be greater
diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90
index 63e8ff975b..b43d9a33b3 100644
--- a/src/utils/clmfates_interfaceMod.F90
+++ b/src/utils/clmfates_interfaceMod.F90
@@ -60,6 +60,7 @@ module CLMFatesInterfaceMod
use clm_varctl , only : use_fates_fixed_biogeog
use clm_varctl , only : fates_inventory_ctrl_filename
use clm_varctl , only : use_nitrif_denitrif
+ use clm_varctl , only : use_lch4
use clm_varcon , only : tfrz
use clm_varcon , only : spval
use clm_varcon , only : denice
@@ -104,7 +105,7 @@ module CLMFatesInterfaceMod
! use SoilWaterPlantSinkMod, only : Compute_EffecRootFrac_And_VertTranSink_Default
! Used FATES Modules
- use FatesInterfaceTypesMod , only : fates_interface_type
+ use FatesInterfaceMod , only : fates_interface_type
use FatesInterfaceMod, only : FatesInterfaceInit, FatesReportParameters
use FatesInterfaceMod, only : SetFatesGlobalElements
use FatesInterfaceMod , only : allocate_bcin
@@ -116,7 +117,7 @@ module CLMFatesInterfaceMod
use FatesInterfaceMod , only : set_fates_ctrlparms
- use FatesHistoryInterfaceMod, only : fates_history_interface_type
+ use FatesHistoryInterfaceMod, only : fates_hist
use FatesRestartInterfaceMod, only : fates_restart_interface_type
use EDTypesMod , only : ed_patch_type
@@ -177,7 +178,6 @@ module CLMFatesInterfaceMod
! own list of sites, and boundary conditions for those sites
type(fates_interface_type), allocatable :: fates (:)
-
! This memory structure is used to map fates sites
! into the host model. Currently, the FATES site
@@ -185,9 +185,6 @@ module CLMFatesInterfaceMod
type(f2hmap_type), allocatable :: f2hmap(:)
- ! fates_hist is the interface class for the history output
- type(fates_history_interface_type) :: fates_hist
-
! fates_restart is the inteface calss for restarting the model
type(fates_restart_interface_type) :: fates_restart
@@ -257,6 +254,7 @@ subroutine CLMFatesGlobals()
logical :: verbose_output
integer :: pass_masterproc
integer :: pass_vertsoilc
+ integer :: pass_ch4
integer :: pass_spitfire
integer :: pass_ed_st3
integer :: pass_num_lu_harvest_cats
@@ -327,6 +325,13 @@ subroutine CLMFatesGlobals()
pass_is_restart = 0
end if
call set_fates_ctrlparms('is_restart',ival=pass_is_restart)
+
+ if(use_lch4) then
+ pass_ch4 = 1
+ else
+ pass_ch4 = 0
+ end if
+ call set_fates_ctrlparms('use_ch4',ival=pass_ch4)
if(use_vertsoilc) then
pass_vertsoilc = 1
@@ -535,6 +540,7 @@ subroutine init(this, bounds_proc )
s = s + 1
collist(s) = c
this%f2hmap(nc)%hsites(c) = s
+ col%is_fates(c) = .true.
if(debug)then
write(iulog,*) 'clm_fates%init(): thread',nc,': found column',c,'with lu',l
write(iulog,*) 'LU type:', lun%itype(l)
@@ -589,6 +595,8 @@ subroutine init(this, bounds_proc )
do s = 1, this%fates(nc)%nsites
c = this%f2hmap(nc)%fcolumn(s)
+
+ this%fates(nc)%sites(s)%h_gid = c
if (use_vertsoilc) then
ndecomp = col%nbedrock(c)
@@ -809,7 +817,8 @@ subroutine dynamics_driv(this, nc, bounds_clump, &
waterstatebulk_inst%h2osoi_vol_col(c,1:nlevsoil)
this%fates(nc)%bc_in(s)%max_rooting_depth_index_col = &
- min(nlevsoil, active_layer_inst%altmax_lastyear_indx_col(c))
+ min(nlevsoil, active_layer_inst%altmax_lastyear_indx_col(c))
+
do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno
p = ifp+col%patchi(c)
@@ -869,6 +878,13 @@ subroutine dynamics_driv(this, nc, bounds_clump, &
! structures into the cohort structures.
call UnPackNutrientAquisitionBCs(this%fates(nc)%sites, this%fates(nc)%bc_in)
+
+ ! ---------------------------------------------------------------------------------
+ ! Flush arrays to values defined by %flushval (see registry entry in
+ ! subroutine define_history_vars()
+ ! ---------------------------------------------------------------------------------
+ call fates_hist%flush_hvars(nc,upfreq_in=1)
+
! ---------------------------------------------------------------------------------
! Part II: Call the FATES model now that input boundary conditions have been
@@ -910,6 +926,17 @@ subroutine dynamics_driv(this, nc, bounds_clump, &
soilbiogeochem_carbonflux_inst%FATES_c_to_litr_lig_c_col(c,1:nld_si) = &
this%fates(nc)%bc_out(s)%litt_flux_lig_c_si(1:nld_si)
+ ! Copy last 3 variables to an array of litter pools for use in do loops
+ ! and repeat copy in soilbiogeochem/SoilBiogeochemCarbonFluxType.F90.
+ ! Keep the three originals to avoid backwards compatibility issues with
+ ! restart files.
+ soilbiogeochem_carbonflux_inst%FATES_c_to_litr_c_col(c,1:nld_si,1) = &
+ soilbiogeochem_carbonflux_inst%FATES_c_to_litr_lab_c_col(c,1:nld_si)
+ soilbiogeochem_carbonflux_inst%FATES_c_to_litr_c_col(c,1:nld_si,2) = &
+ soilbiogeochem_carbonflux_inst%FATES_c_to_litr_cel_c_col(c,1:nld_si)
+ soilbiogeochem_carbonflux_inst%FATES_c_to_litr_c_col(c,1:nld_si,3) = &
+ soilbiogeochem_carbonflux_inst%FATES_c_to_litr_lig_c_col(c,1:nld_si)
+
end do
@@ -926,9 +953,9 @@ subroutine dynamics_driv(this, nc, bounds_clump, &
! Part IV:
! Update history IO fields that depend on ecosystem dynamics
! ---------------------------------------------------------------------------------
- call this%fates_hist%update_history_dyn( nc, &
- this%fates(nc)%nsites, &
- this%fates(nc)%sites)
+ call fates_hist%update_history_dyn( nc, &
+ this%fates(nc)%nsites, &
+ this%fates(nc)%sites)
if (masterproc) then
write(iulog, *) 'clm: leaving fates model', bounds_clump%begg, &
@@ -1113,7 +1140,8 @@ end subroutine wrap_update_hlmfates_dyn
! ====================================================================================
subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, &
- waterstatebulk_inst, canopystate_inst, soilstate_inst )
+ waterstatebulk_inst, canopystate_inst, soilstate_inst, &
+ active_layer_inst)
! ---------------------------------------------------------------------------------
! The ability to restart the model is handled through three different types of calls
@@ -1149,6 +1177,7 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, &
type(waterstatebulk_type) , intent(inout) :: waterstatebulk_inst
type(canopystate_type) , intent(inout) :: canopystate_inst
type(soilstate_type) , intent(inout) :: soilstate_inst
+ type(active_layer_type) , intent(in) :: active_layer_inst
! Locals
type(bounds_type) :: bounds_clump
@@ -1338,7 +1367,8 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, &
! Convert newly read-in vectors into the FATES namelist state variables
! ------------------------------------------------------------------------
call this%fates_restart%create_patchcohort_structure(nc, &
- this%fates(nc)%nsites, this%fates(nc)%sites, this%fates(nc)%bc_in)
+ this%fates(nc)%nsites, this%fates(nc)%sites, this%fates(nc)%bc_in, &
+ this%fates(nc)%bc_out)
call this%fates_restart%get_restart_vectors(nc, this%fates(nc)%nsites, &
this%fates(nc)%sites )
@@ -1346,17 +1376,22 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, &
! I think ed_update_site and update_hlmfates_dyn are doing some similar
! update type stuff, should consolidate (rgk 11-2016)
do s = 1,this%fates(nc)%nsites
+
+ c = this%f2hmap(nc)%fcolumn(s)
+
+ this%fates(nc)%bc_in(s)%max_rooting_depth_index_col = &
+ min(this%fates(nc)%bc_in(s)%nlevsoil, active_layer_inst%altmax_lastyear_indx_col(c))
+
call ed_update_site( this%fates(nc)%sites(s), &
this%fates(nc)%bc_in(s), &
this%fates(nc)%bc_out(s) )
-
- ! This call sends internal fates variables into the
- ! output boundary condition structures. Note: this is called
- ! internally in fates dynamics as well.
- call FluxIntoLitterPools(this%fates(nc)%sites(s), &
- this%fates(nc)%bc_in(s), &
- this%fates(nc)%bc_out(s))
+ ! This call sends internal fates variables into the
+ ! output boundary condition structures. Note: this is called
+ ! internally in fates dynamics as well.
+ call FluxIntoLitterPools(this%fates(nc)%sites(s), &
+ this%fates(nc)%bc_in(s), &
+ this%fates(nc)%bc_out(s))
end do
@@ -1412,9 +1447,9 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, &
! ------------------------------------------------------------------------
! Update history IO fields that depend on ecosystem dynamics
! ------------------------------------------------------------------------
- call this%fates_hist%update_history_dyn( nc, &
- this%fates(nc)%nsites, &
- this%fates(nc)%sites)
+ call fates_hist%update_history_dyn( nc, &
+ this%fates(nc)%nsites, &
+ this%fates(nc)%sites)
end if
@@ -1440,7 +1475,7 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, &
type(waterdiagnosticbulk_type) , intent(inout) :: waterdiagnosticbulk_inst
type(canopystate_type) , intent(inout) :: canopystate_inst
type(soilstate_type) , intent(inout) :: soilstate_inst
-
+
! locals
integer :: nclumps
integer :: nc
@@ -1468,7 +1503,9 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, &
call get_clump_bounds(nc, bounds_clump)
do s = 1,this%fates(nc)%nsites
- call init_site_vars(this%fates(nc)%sites(s),this%fates(nc)%bc_in(s) )
+ call init_site_vars(this%fates(nc)%sites(s), &
+ this%fates(nc)%bc_in(s), &
+ this%fates(nc)%bc_out(s) )
call zero_site(this%fates(nc)%sites(s))
end do
@@ -1520,6 +1557,15 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, &
this%fates(nc)%bc_in)
do s = 1,this%fates(nc)%nsites
+
+ c = this%f2hmap(nc)%fcolumn(s)
+
+ ! CLM has not calculated the maximum rooting depth
+ ! from last year, it won't until the beginning of the
+ ! time-step loop. Therefore, we just initialize fluxes
+ ! into the litter pool in a trivial way prior to timestepping
+ this%fates(nc)%bc_in(s)%max_rooting_depth_index_col = this%fates(nc)%bc_in(s)%nlevsoil
+
call ed_update_site(this%fates(nc)%sites(s), &
this%fates(nc)%bc_in(s), &
this%fates(nc)%bc_out(s))
@@ -1542,7 +1588,7 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, &
! ------------------------------------------------------------------------
! Update history IO fields that depend on ecosystem dynamics
! ------------------------------------------------------------------------
- call this%fates_hist%update_history_dyn( nc, &
+ call fates_hist%update_history_dyn( nc, &
this%fates(nc)%nsites, &
this%fates(nc)%sites)
@@ -2158,7 +2204,7 @@ subroutine wrap_update_hifrq_hist(this, bounds_clump, &
dtime = get_step_size_real()
! Update history variables that track these variables
- call this%fates_hist%update_history_hifrq(nc, &
+ call fates_hist%update_history_hifrq(nc, &
this%fates(nc)%nsites, &
this%fates(nc)%sites, &
this%fates(nc)%bc_in, &
@@ -2166,7 +2212,7 @@ subroutine wrap_update_hifrq_hist(this, bounds_clump, &
end associate
- call t_stopf('fates_wrap_hifrq_hist')
+ call t_stopf('fates_update_hifrq_hist')
end subroutine wrap_update_hifrq_hist
@@ -2423,7 +2469,7 @@ subroutine init_history_io(this,bounds_proc)
call hlm_bounds_to_fates_bounds(bounds_proc, fates_bounds)
- call this%fates_hist%Init(nclumps, fates_bounds)
+ call fates_hist%Init(nclumps, fates_bounds)
! Define the bounds on the first dimension for each thread
!$OMP PARALLEL DO PRIVATE (nc,bounds_clump,fates_clump)
@@ -2433,76 +2479,57 @@ subroutine init_history_io(this,bounds_proc)
! thread bounds for patch
call hlm_bounds_to_fates_bounds(bounds_clump, fates_clump)
- call this%fates_hist%SetThreadBoundsEach(nc, fates_clump)
+ call fates_hist%SetThreadBoundsEach(nc, fates_clump)
end do
!$OMP END PARALLEL DO
- ! ------------------------------------------------------------------------------------
- ! PART I.5: SET SOME INDEX MAPPINGS SPECIFICALLY FOR SITE<->COLUMN AND PATCH
- ! ------------------------------------------------------------------------------------
-
- !$OMP PARALLEL DO PRIVATE (nc,s,c)
- do nc = 1,nclumps
-
- allocate(this%fates_hist%iovar_map(nc)%site_index(this%fates(nc)%nsites))
- allocate(this%fates_hist%iovar_map(nc)%patch1_index(this%fates(nc)%nsites))
-
- do s=1,this%fates(nc)%nsites
- c = this%f2hmap(nc)%fcolumn(s)
- this%fates_hist%iovar_map(nc)%site_index(s) = c
- this%fates_hist%iovar_map(nc)%patch1_index(s) = col%patchi(c)+1
- end do
-
- end do
- !$OMP END PARALLEL DO
-
! ------------------------------------------------------------------------------------
! PART II: USE THE JUST DEFINED DIMENSIONS TO ASSEMBLE THE VALID IO TYPES
! INTERF-TODO: THESE CAN ALL BE EMBEDDED INTO A SUBROUTINE IN HISTORYIOMOD
! ------------------------------------------------------------------------------------
- call this%fates_hist%assemble_history_output_types()
+ call fates_hist%assemble_history_output_types()
! ------------------------------------------------------------------------------------
! PART III: DEFINE THE LIST OF OUTPUT VARIABLE OBJECTS, AND REGISTER THEM WITH THE
! HLM ACCORDING TO THEIR TYPES
! ------------------------------------------------------------------------------------
- call this%fates_hist%initialize_history_vars()
- nvar = this%fates_hist%num_history_vars()
+ call fates_hist%initialize_history_vars()
+ nvar = fates_hist%num_history_vars()
do ivar = 1, nvar
- associate( vname => this%fates_hist%hvars(ivar)%vname, &
- vunits => this%fates_hist%hvars(ivar)%units, &
- vlong => this%fates_hist%hvars(ivar)%long, &
- vdefault => this%fates_hist%hvars(ivar)%use_default, &
- vavgflag => this%fates_hist%hvars(ivar)%avgflag)
-
- dk_index = this%fates_hist%hvars(ivar)%dim_kinds_index
- ioname = trim(this%fates_hist%dim_kinds(dk_index)%name)
+ associate( vname => fates_hist%hvars(ivar)%vname, &
+ vunits => fates_hist%hvars(ivar)%units, &
+ vlong => fates_hist%hvars(ivar)%long, &
+ vdefault => fates_hist%hvars(ivar)%use_default, &
+ vavgflag => fates_hist%hvars(ivar)%avgflag)
+
+ dk_index = fates_hist%hvars(ivar)%dim_kinds_index
+ ioname = trim(fates_hist%dim_kinds(dk_index)%name)
select case(trim(ioname))
case(patch_r8)
call hist_addfld1d(fname=trim(vname),units=trim(vunits), &
avgflag=trim(vavgflag),long_name=trim(vlong), &
- ptr_patch=this%fates_hist%hvars(ivar)%r81d, &
+ ptr_patch=fates_hist%hvars(ivar)%r81d, &
default=trim(vdefault), &
set_lake=0._r8,set_urb=0._r8)
case(site_r8)
call hist_addfld1d(fname=trim(vname),units=trim(vunits), &
avgflag=trim(vavgflag),long_name=trim(vlong), &
- ptr_col=this%fates_hist%hvars(ivar)%r81d, &
+ ptr_col=fates_hist%hvars(ivar)%r81d, &
default=trim(vdefault), &
set_lake=0._r8,set_urb=0._r8)
case(patch_ground_r8, patch_size_pft_r8)
- d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index
- dim2name = this%fates_hist%dim_bounds(d_index)%name
+ d_index = fates_hist%dim_kinds(dk_index)%dim2_index
+ dim2name = fates_hist%dim_bounds(d_index)%name
call hist_addfld2d(fname=trim(vname),units=trim(vunits), & ! <--- addfld2d
type2d=trim(dim2name), & ! <--- type2d
avgflag=trim(vavgflag),long_name=trim(vlong), &
- ptr_patch=this%fates_hist%hvars(ivar)%r82d, &
+ ptr_patch=fates_hist%hvars(ivar)%r82d, &
default=trim(vdefault))
@@ -2514,12 +2541,12 @@ subroutine init_history_io(this,bounds_proc)
site_elcwd_r8, site_elage_r8, site_agefuel_r8)
- d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index
- dim2name = this%fates_hist%dim_bounds(d_index)%name
+ d_index = fates_hist%dim_kinds(dk_index)%dim2_index
+ dim2name = fates_hist%dim_bounds(d_index)%name
call hist_addfld2d(fname=trim(vname),units=trim(vunits), &
type2d=trim(dim2name), &
avgflag=trim(vavgflag),long_name=trim(vlong), &
- ptr_col=this%fates_hist%hvars(ivar)%r82d, &
+ ptr_col=fates_hist%hvars(ivar)%r82d, &
default=trim(vdefault))
@@ -2785,7 +2812,7 @@ subroutine wrap_hydraulics_drive(this, bounds_clump, nc, &
! Update History Buffers that need to be updated after hydraulics calls
- call this%fates_hist%update_history_hydraulics(nc, &
+ call fates_hist%update_history_hydraulics(nc, &
this%fates(nc)%nsites, &
this%fates(nc)%sites, &
this%fates(nc)%bc_in, &
diff --git a/src/utils/spmdGathScatMod.F90 b/src/utils/spmdGathScatMod.F90
deleted file mode 100644
index b3314d2da6..0000000000
--- a/src/utils/spmdGathScatMod.F90
+++ /dev/null
@@ -1,540 +0,0 @@
-module spmdGathScatMod
-
-!-----------------------------------------------------------------------
-!BOP
-!
-! !MODULE: spmdGathScatMod
-!
-! !DESCRIPTION:
-! Perform SPMD gather and scatter operations.
-!
-! !USES:
- use clm_varcon, only: spval, ispval
- use decompMod, only : get_clmlevel_gsmap
- use shr_kind_mod, only: r8 => shr_kind_r8
- use spmdMod , only : masterproc, mpicom
- use mct_mod , only : mct_aVect, mct_gsMap
- use mct_mod , only : mct_aVect_init, mct_aVect_importIattr, mct_aVect_scatter
- use mct_mod , only : mct_aVect_gather, mct_aVect_exportIattr, mct_aVect_clean
- use mct_mod , only : mct_aVect_exportRattr, mct_aVect_importRattr
- use abortutils, only : endrun
- use clm_varctl, only : iulog
- use perf_mod , only : t_startf, t_stopf
-!
-! !PUBLIC TYPES:
- implicit none
- private
-!
-! !PUBLIC MEMBER FUNCTIONS:
- public scatter_data_from_master, gather_data_to_master
-
- interface scatter_data_from_master
- module procedure scatter_1darray_int
- module procedure scatter_1darray_real
- end interface
-
- interface gather_data_to_master
- module procedure gather_1darray_int
- module procedure gather_1darray_real
- end interface
-!
-! !REVISION HISTORY:
-! Author: Mariana Vertenstein
-!
-!EOP
-!
- integer,private,parameter :: debug = 0
-
-!-----------------------------------------------------------------------
-
-contains
-
-!-----------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: scatter_1darray_int
-!
-! !INTERFACE:
- subroutine scatter_1darray_int (alocal, aglobal, clmlevel)
-!
-! !DESCRIPTION:
-! Wrapper routine to scatter int 1d array
-!
-! !USES:
-!
-! !ARGUMENTS:
- implicit none
- integer , pointer :: alocal(:) ! local data (output)
- integer , pointer :: aglobal(:) ! global data (input)
- character(len=*) ,intent(in) :: clmlevel ! type of input grid
-!
-! !REVISION HISTORY:
-! Author: T Craig
-!
-!
-! !LOCAL VARIABLES:
-!EOP
- integer :: n1,n2,lb1,ub1,lb2,ub2 ! indices
- integer :: lsize ! size of local array
- type(mct_aVect) :: AVi, AVo ! attribute vectors
- integer ,pointer :: adata(:) ! local data array
- character(len=256) :: rstring ! real field list string
- character(len=256) :: istring ! int field list string
- character(len=8) :: fname ! arbitrary field name
- type(mct_gsMap),pointer :: gsmap ! global seg map
- character(len=*),parameter :: subname = 'scatter_1darray_int'
-
-!-----------------------------------------------------------------------
-
- call t_startf(trim(subname)//'_total')
- call get_clmlevel_gsmap(clmlevel,gsmap)
-
- lb1 = lbound(alocal,dim=1)
- ub1 = ubound(alocal,dim=1)
- lb2 = 1
- ub2 = 1
-
- rstring = ""
- istring = ""
-
- do n2 = lb2,ub2
- write(fname,'(a1,i3.3)') 'f',n2-lb2+1
- if (len_trim(istring) == 0) then
- istring = trim(fname)
- else
- istring = trim(istring)//":"//trim(fname)
- endif
- enddo
-
- if (masterproc .and. debug > 2) then
- write(iulog,*) trim(subname),' strings:',trim(rstring),' ',trim(istring)
- endif
-
- if (debug > 1) call t_startf(trim(subname)//'_pack')
-
- if (masterproc) then
- lsize = size(aglobal,dim=1)
- call mct_aVect_init(AVi,rList=trim(rstring),iList=trim(istring),lsize=lsize)
- allocate(adata(lsize))
- do n2 = lb2,ub2
- adata(1:lsize) = aglobal(1:lsize)
- write(fname,'(a1,i3.3)') 'f',n2-lb2+1
- call mct_aVect_importIattr(AVi,trim(fname),adata,lsize)
- enddo
- deallocate(adata)
- endif
-
- if (debug > 1) call t_stopf(trim(subname)//'_pack')
- if (debug > 1) call t_startf(trim(subname)//'_scat')
-
- call mct_aVect_scatter(AVi, AVo, gsmap, 0, mpicom)
-
- if (debug > 1) call t_stopf(trim(subname)//'_scat')
- if (debug > 1) call t_startf(trim(subname)//'_upck')
-
- lsize = size(alocal,dim=1)
- allocate(adata(lsize))
- do n2 = lb2,ub2
- write(fname,'(a1,i3.3)') 'f',n2-lb2+1
- call mct_aVect_exportIattr(AVo,trim(fname),adata,lsize)
- do n1 = lb1,ub1
- alocal(n1) = adata(n1-lb1+1)
- enddo
- enddo
- deallocate(adata)
-
- if (debug > 1) call t_stopf(trim(subname)//'_upck')
-
- if (masterproc) then
- call mct_aVect_clean(AVi)
- endif
- call mct_aVect_clean(AVo)
-
- call t_stopf(trim(subname)//'_total')
-
- end subroutine scatter_1darray_int
-
-!-----------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: gather_1darray_int
-!
-! !INTERFACE:
- subroutine gather_1darray_int (alocal, aglobal, clmlevel, missing)
-!
-! !DESCRIPTION:
-! Wrapper routine to gather int 1d array
-!
-! !USES:
-!
-! !ARGUMENTS:
- implicit none
- integer , pointer :: alocal(:) ! local data (output)
- integer , pointer :: aglobal(:) ! global data (input)
- character(len=*) ,intent(in) :: clmlevel ! type of input grid
- integer ,optional,intent(in) :: missing ! missing value
-!
-! !REVISION HISTORY:
-! Author: T Craig
-!
-!
-! !LOCAL VARIABLES:
-!EOP
- integer :: n1,n2,lb1,ub1,lb2,ub2 ! indices
- integer :: lsize ! size of local array
- type(mct_aVect) :: AVi, AVo ! attribute vectors
- integer ,pointer :: adata(:) ! temporary data array
- integer ,pointer :: mvect(:) ! local array for mask
- character(len=256) :: rstring ! real field list string
- character(len=256) :: istring ! int field list string
- character(len=8) :: fname ! arbitrary field name
- type(mct_gsMap),pointer :: gsmap ! global seg map
- character(len=*),parameter :: subname = 'gather_1darray_int'
-
-!-----------------------------------------------------------------------
-
- call t_startf(trim(subname)//'_total')
- call get_clmlevel_gsmap(clmlevel,gsmap)
-
- lsize = size(alocal,dim=1)
- lb1 = lbound(alocal,dim=1)
- ub1 = ubound(alocal,dim=1)
- lb2 = 1
- ub2 = 1
-
- rstring = ""
- istring = ""
-
- if (present(missing)) then
- istring = "mask"
- endif
-
- do n2 = lb2,ub2
- write(fname,'(a1,i3.3)') 'f',n2-lb2+1
- if (len_trim(istring) == 0) then
- istring = trim(fname)
- else
- istring = trim(istring)//":"//trim(fname)
- endif
- enddo
-
- if (masterproc .and. debug > 2) then
- write(iulog,*) trim(subname),' strings:',trim(rstring),' ',trim(istring)
- endif
-
- call mct_aVect_init(AVi,rList=trim(rstring),iList=trim(istring),lsize=lsize)
-
- if (debug > 1) call t_startf(trim(subname)//'_pack')
- allocate(adata(lsize))
- do n2 = lb2,ub2
- do n1 = lb1,ub1
- adata(n1-lb1+1) = alocal(n1)
- enddo
- write(fname,'(a1,i3.3)') 'f',n2-lb2+1
- call mct_aVect_importIattr(AVi,trim(fname),adata,lsize)
- enddo
- deallocate(adata)
-
- if (present(missing)) then
- allocate(mvect(lsize))
- do n1 = lb1,ub1
- mvect(n1-lb1+1) = 1
- enddo
- call mct_aVect_importIattr(AVi,"mask",mvect,lsize)
- deallocate(mvect)
- endif
-
- if (debug > 1) call t_stopf(trim(subname)//'_pack')
- if (debug > 1) call t_startf(trim(subname)//'_gath')
-
- if (present(missing)) then
-! tcx wait for update in mct, then get rid of "mask"
-! call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom, missing = missing)
- call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom)
- else
- call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom)
- endif
-
- if (debug > 1) call t_stopf(trim(subname)//'_gath')
- if (debug > 1) call t_startf(trim(subname)//'_upck')
-
- if (masterproc) then
- lsize = size(aglobal,dim=1)
- allocate(adata(lsize))
- do n2 = lb2,ub2
- write(fname,'(a1,i3.3)') 'f',n2-lb2+1
- call mct_aVect_exportIattr(AVo,trim(fname),adata,lsize)
- aglobal(1:lsize) = adata(1:lsize)
- enddo
- deallocate(adata)
- if (present(missing)) then
- allocate(mvect(lsize))
- call mct_aVect_exportIattr(AVo,"mask",mvect,lsize)
- do n1 = 1,lsize
- if (mvect(n1) == 0) then
- do n2 = lb2,ub2
- aglobal(n1) = missing
- enddo
- endif
- enddo
- deallocate(mvect)
- endif
- endif
-
- if (debug > 1) call t_stopf(trim(subname)//'_upck')
-
- if (masterproc) then
- call mct_aVect_clean(AVo)
- endif
-
- call mct_aVect_clean(AVi)
-
- call t_stopf(trim(subname)//'_total')
-
- end subroutine gather_1darray_int
-
-!-----------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: scatter_1darray_real
-!
-! !INTERFACE:
- subroutine scatter_1darray_real (alocal, aglobal, clmlevel)
-!
-! !DESCRIPTION:
-! Wrapper routine to scatter real 1d array
-!
-! !USES:
-!
-! !ARGUMENTS:
- implicit none
- real(r8), pointer :: alocal(:) ! local data (output)
- real(r8), pointer :: aglobal(:) ! global data (input)
- character(len=*) ,intent(in) :: clmlevel ! type of input grid
-!
-! !REVISION HISTORY:
-! Author: T Craig
-!
-!
-! !LOCAL VARIABLES:
-!EOP
- integer :: n1,n2,lb1,ub1,lb2,ub2 ! indices
- integer :: lsize ! size of local array
- type(mct_aVect) :: AVi, AVo ! attribute vectors
- real(r8),pointer :: adata(:) ! local data array
- character(len=256) :: rstring ! real field list string
- character(len=256) :: istring ! int field list string
- character(len=8) :: fname ! arbitrary field name
- type(mct_gsMap),pointer :: gsmap ! global seg map
- character(len=*),parameter :: subname = 'scatter_1darray_real'
-
-!-----------------------------------------------------------------------
-
- call t_startf(trim(subname)//'_total')
- call get_clmlevel_gsmap(clmlevel,gsmap)
-
- lb1 = lbound(alocal,dim=1)
- ub1 = ubound(alocal,dim=1)
- lb2 = 1
- ub2 = 1
-
- rstring = ""
- istring = ""
-
- do n2 = lb2,ub2
- write(fname,'(a1,i3.3)') 'f',n2-lb2+1
- if (len_trim(rstring) == 0) then
- rstring = trim(fname)
- else
- rstring = trim(rstring)//":"//trim(fname)
- endif
- enddo
-
- if (masterproc .and. debug > 2) then
- write(iulog,*) trim(subname),' strings:',trim(rstring),' ',trim(istring)
- endif
-
- if (debug > 1) call t_startf(trim(subname)//'_pack')
-
- if (masterproc) then
- lsize = size(aglobal,dim=1)
- call mct_aVect_init(AVi,rList=trim(rstring),iList=trim(istring),lsize=lsize)
- allocate(adata(lsize))
- do n2 = lb2,ub2
- adata(1:lsize) = aglobal(1:lsize)
- write(fname,'(a1,i3.3)') 'f',n2-lb2+1
- call mct_aVect_importRattr(AVi,trim(fname),adata,lsize)
- enddo
- deallocate(adata)
- endif
-
- if (debug > 1) call t_stopf(trim(subname)//'_pack')
- if (debug > 1) call t_startf(trim(subname)//'_scat')
-
- call mct_aVect_scatter(AVi, AVo, gsmap, 0, mpicom)
-
- if (debug > 1) call t_stopf(trim(subname)//'_scat')
- if (debug > 1) call t_startf(trim(subname)//'_upck')
-
- lsize = size(alocal,dim=1)
- allocate(adata(lsize))
- do n2 = lb2,ub2
- write(fname,'(a1,i3.3)') 'f',n2-lb2+1
- call mct_aVect_exportRattr(AVo,trim(fname),adata,lsize)
- do n1 = lb1,ub1
- alocal(n1) = adata(n1-lb1+1)
- enddo
- enddo
- deallocate(adata)
-
- if (debug > 1) call t_stopf(trim(subname)//'_upck')
-
- if (masterproc) then
- call mct_aVect_clean(AVi)
- endif
- call mct_aVect_clean(AVo)
-
- call t_stopf(trim(subname)//'_total')
-
- end subroutine scatter_1darray_real
-
-!-----------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: gather_1darray_real
-!
-! !INTERFACE:
- subroutine gather_1darray_real (alocal, aglobal, clmlevel, missing)
-!
-! !DESCRIPTION:
-! Wrapper routine to gather real 1d array
-!
-! !USES:
-!
-! !ARGUMENTS:
- implicit none
- real(r8), pointer :: alocal(:) ! local data (output)
- real(r8), pointer :: aglobal(:) ! global data (input)
- character(len=*) ,intent(in) :: clmlevel ! type of input grid
- real(r8),optional,intent(in) :: missing ! missing value
-!
-! !REVISION HISTORY:
-! Author: T Craig
-!
-!
-! !LOCAL VARIABLES:
-!EOP
- integer :: n1,n2,lb1,ub1,lb2,ub2 ! indices
- integer :: lsize ! size of local array
- type(mct_aVect) :: AVi, AVo ! attribute vectors
- real(r8),pointer :: adata(:) ! temporary data array
- integer ,pointer :: mvect(:) ! local array for mask
- character(len=256) :: rstring ! real field list string
- character(len=256) :: istring ! int field list string
- character(len=8) :: fname ! arbitrary field name
- type(mct_gsMap),pointer :: gsmap ! global seg map
- character(len=*),parameter :: subname = 'gather_1darray_real'
-
-!-----------------------------------------------------------------------
-
- call t_startf(trim(subname)//'_total')
- call get_clmlevel_gsmap(clmlevel,gsmap)
-
- lsize = size(alocal,dim=1)
- lb1 = lbound(alocal,dim=1)
- ub1 = ubound(alocal,dim=1)
- lb2 = 1
- ub2 = 1
-
- rstring = ""
- istring = ""
-
- if (present(missing)) then
- istring = "mask"
- endif
-
- do n2 = lb2,ub2
- write(fname,'(a1,i3.3)') 'f',n2-lb2+1
- if (len_trim(rstring) == 0) then
- rstring = trim(fname)
- else
- rstring = trim(rstring)//":"//trim(fname)
- endif
- enddo
-
- if (masterproc .and. debug > 2) then
- write(iulog,*) trim(subname),' strings:',trim(rstring),' ',trim(istring)
- endif
-
- call mct_aVect_init(AVi,rList=trim(rstring),iList=trim(istring),lsize=lsize)
-
- if (debug > 1) call t_startf(trim(subname)//'_pack')
- allocate(adata(lsize))
- do n2 = lb2,ub2
- do n1 = lb1,ub1
- adata(n1-lb1+1) = alocal(n1)
- enddo
- write(fname,'(a1,i3.3)') 'f',n2-lb2+1
- call mct_aVect_importRattr(AVi,trim(fname),adata,lsize)
- enddo
- deallocate(adata)
-
- if (present(missing)) then
- allocate(mvect(lsize))
- do n1 = lb1,ub1
- mvect(n1-lb1+1) = 1
- enddo
- call mct_aVect_importIattr(AVi,"mask",mvect,lsize)
- deallocate(mvect)
- endif
-
- if (debug > 1) call t_stopf(trim(subname)//'_pack')
- if (debug > 1) call t_startf(trim(subname)//'_gath')
-
- if (present(missing)) then
-! tcx wait for update in mct, then get rid of "mask"
-! call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom, missing = missing)
- call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom)
- else
- call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom)
- endif
-
- if (debug > 1) call t_stopf(trim(subname)//'_gath')
- if (debug > 1) call t_startf(trim(subname)//'_upck')
-
- if (masterproc) then
- lsize = size(aglobal,dim=1)
- allocate(adata(lsize))
- do n2 = lb2,ub2
- write(fname,'(a1,i3.3)') 'f',n2-lb2+1
- call mct_aVect_exportRattr(AVo,trim(fname),adata,lsize)
- aglobal(1:lsize) = adata(1:lsize)
- enddo
- deallocate(adata)
- if (present(missing)) then
- allocate(mvect(lsize))
- call mct_aVect_exportIattr(AVo,"mask",mvect,lsize)
- do n1 = 1,lsize
- if (mvect(n1) == 0) then
- do n2 = lb2,ub2
- aglobal(n1) = missing
- enddo
- endif
- enddo
- deallocate(mvect)
- endif
- endif
-
- if (debug > 1) call t_stopf(trim(subname)//'_upck')
-
- if (masterproc) then
- call mct_aVect_clean(AVo)
- endif
-
- call mct_aVect_clean(AVi)
-
- call t_stopf(trim(subname)//'_total')
-
- end subroutine gather_1darray_real
-
-end module spmdGathScatMod
diff --git a/tools/contrib/create_scrip_file.ncl b/tools/contrib/create_scrip_file.ncl
new file mode 100644
index 0000000000..c2d911743b
--- /dev/null
+++ b/tools/contrib/create_scrip_file.ncl
@@ -0,0 +1,58 @@
+load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
+load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"
+begin
+
+nums = (/"00","01","02","03","04","05","06","07","08","09", \
+ "10","11","12","13","14","15","16","17","18","19", \
+ "20","21","22","23","24","25","26","27","28","29", \
+ "30","31","32","33","34","35","36","37","38","39"/)
+
+;************************************************
+; get WRF fields
+;************************************************
+
+;change this to point to the relevant geo_em file.
+wrf_file = addfile("geo_em.d01.nc", "r")
+
+
+lat2d = wrf_file->XLAT_M(0,:,:)
+lon2d = wrf_file->XLONG_M(0,:,:)
+lon2d = where(lon2d.lt.0, lon2d+360.0, lon2d)
+landmask = wrf_file->LANDMASK(0,:,:)
+
+ns_corner_lat = wrf_file->XLAT_V(0,:,:)
+ns_corner_lon = wrf_file->XLONG_U(0,:,:)
+ew_corner_lat = wrf_file->XLAT_U(0,:,:)
+ew_corner_lon = wrf_file->XLONG_U(0,:,:)
+
+print(lat2d(0,0))
+print(lon2d(0,0))
+
+print(ns_corner_lat(0:1,0:1))
+print(ns_corner_lon(0:1,0:1))
+print(ew_corner_lat(0:1,0:1))
+print(ew_corner_lon(0:1,0:1))
+
+opt = True
+opt@GridMask = landmask
+opt@ForceOverwrite = True
+
+curvilinear_to_SCRIP("wrf2clm_land.nc",lat2d,lon2d,opt)
+
+opt@GridMask = where(landmask.eq.0,1,0)
+curvilinear_to_SCRIP("wrf2clm_ocean.nc",lat2d,lon2d,opt)
+
+infile = addfile("wrf2clm_land.nc","r")
+
+lat1d = infile->grid_center_lat
+lon1d = infile->grid_center_lon
+
+lat1dc = infile->grid_corner_lat
+lon1dc = infile->grid_corner_lon
+
+print(lat1d(0))
+print(lon1d(0))
+print(lat1dc(0,:))
+print(lon1dc(0,:))
+
+end
diff --git a/tools/contrib/singlept b/tools/contrib/singlept
deleted file mode 100755
index fd82eaf6a2..0000000000
--- a/tools/contrib/singlept
+++ /dev/null
@@ -1,376 +0,0 @@
-#! /usr/bin/env python
-#
-# singlept
-#
-# Script to extract a single grid point from global datasets
-#
-
-# Import libraries
-import sys
-import os
-from getpass import getuser
-import string
-import subprocess
-import numpy as np
-import xarray as xr
-
-def error( desc ):
- "error function"
- mprint( "ERROR:: "+desc )
- os.abort()
-
-def mprint(mstr):
- "Print function whether python-2 or python-3"
- # six.py or import __future__ print_function could be used instead...
- vnum=sys.version_info[0]
- if vnum == 3:
- print(mstr)
- if vnum == 2:
- print mstr
-
-def AddTagToFilename(filename, tag):
- "Add a tag to a filename"
- # Expects file to end with [._]cYYMMDD.nc or [._]YYMMDD.nc
- # Add the tag to just before that ending part
- basename = os.path.basename(filename)
- cend = -10
- if ( basename[cend] == "c" ):
- cend = cend - 1
- if ( (basename[cend] != ".") and (basename[cend] != "_") ):
- error( "Trouble figuring out where to add tag to filename:"+filename )
- return( basename[:cend]+"_"+tag+basename[cend:] )
-
-mprint( "singlept script to extract out a single point from the global CTSM inputdata datasets\n" )
-myname=getuser()
-pwd=os.getcwd()
-mprint("User = "+myname)
-mprint("Current directory = "+pwd+"\n")
-
-'''
-#------------------------------------------------------------------#
-#--------------------- Instructions -----------------------------#
-#------------------------------------------------------------------#
-load the following into your local environment
-module load python/2.7.14
-ncar_pylib
-
-After creating a case using a global compset, run preview_namelist.
-From the resulting lnd_in file in the run directory, find the name
-of the domain file, and the surface data file.
-From the datm streams files (e.g. datm.streams.txt.CLMGSWP3v1.Precip)
-find the name of the datm forcing data domain file and forcing files.
-Use these file names as the sources for the single point files to
-be created (see below).
-
-After running this script, point to the new CLM domain and surface
-dataset using the user_nl_clm file in the case directory. In addition,
-copy the datm.streams files to the case directory, with the prefix
-'user_', e.g. user_datm.streams.txt.CLMGSWP3v1.Precip. Change the
-information in the user_datm.streams* files to point to the single
-point datm data (domain and forcing files) created using this script.
-
-The domain file is not set via user_nl_clm, but requires changing
-LND_DOMAIN and ATM_DOMAIN (and their paths) in env_run.xml.
-
-Using single point forcing data requires specifying the nearest
-neighbor mapping algorithm for the datm streams (usually they are
-the first three in the list) in user_nl_datm: mapalgo = 'nn','nn','nn',
-..., where the '...' can still be 'bilinear', etc, depending on the
-other streams that are being used, e.g. aerosols, anomaly forcing,
-bias correction.
-
-The file env_mach_pes.xml should be modified to specify a single
-processor. The mpi-serial libraries should also be used, and can be
-set in env_build.xml by changing "MPILIB" to "mpi-serial" prior to
-setting up the case.
-
-The case for the single point simulation should have river routing
-and land ice models turned off (i.e. the compset should use stub
-models SROF and SGLC)
-
-to run the script
-./singlept
-deactivate # to remove NPL from environment
-
-'''
-
-# Set control flags
-
-#-- Setup by default to run for Harvard Forest
-
-#-- Specify point to extract
-plon = 287.8
-plat = 42.5
-
-#-- Create regional CLM domain file
-create_domain = True
-#-- Create CLM surface data file
-create_surfdata = True
-#-- Create CLM surface data file
-create_landuse = True
-#-- Create single point DATM atmospheric forcing data
-create_datm = False
-datm_syr=1901
-datm_eyr=2014
-
-#-- Modify landunit structure
-overwrite_single_pft = True
-dominant_pft = 7 #BETr
-zero_nonveg_landunits= True
-uniform_snowpack = True
-no_saturation_excess = True
-
-#-- Specify input and output directories
-dir_output='/glade/scratch/'+myname+'/single_point/'
-if ( not os.path.isdir( dir_output ) ):
- os.mkdir( dir_output )
-dir_inputdata='/glade/p/cesmdata/cseg/inputdata/'
-dir_clm_forcedata='/glade/p/cgd/tss/CTSM_datm_forcing_data/'
-dir_input_datm=dir_clm_forcedata+'/atm_forcing.datm7.GSWP3.0.5d.v1.c170516/'
-dir_output_datm=dir_output + 'datmdata/'
-if ( not os.path.isdir( dir_output_datm ) ):
- os.mkdir( dir_output_datm )
-
-#-- Set input and output filenames
-tag=str(plon)+'_'+str(plat)
-
-#-- Set time stamp
-command='date "+%y%m%d"'
-x2=subprocess.Popen(command,stdout=subprocess.PIPE,shell='True')
-x=x2.communicate()
-timetag = x[0].strip()
-
-#-- Specify land domain file ---------------------------------
-fdomain = dir_inputdata+'share/domains/domain.lnd.fv0.9x1.25_gx1v7.151020.nc'
-fdomain2 = dir_output + AddTagToFilename( fdomain, tag )
-
-#-- Specify surface data file --------------------------------
-fsurf = dir_inputdata+'lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc'
-
-fsurf2 = dir_output + AddTagToFilename( fsurf, tag )
-
-#-- Specify landuse file -------------------------------------
-fluse = dir_inputdata+'lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c190214.nc'
-fluse2 = dir_output + AddTagToFilename( fluse, tag )
-
-#-- Specify datm domain file ---------------------------------
-fdatmdomain = dir_clm_forcedata+'atm_forcing.datm7.GSWP3.0.5d.v1.c170516/domain.lnd.360x720_gswp3.0v1.c170606.nc'
-fdatmdomain2 = dir_output_datm+AddTagToFilename( fdatmdomain, tag )
-
-#-- Create CTSM domain file
-if create_domain:
- mprint( "Open: "+fdomain )
- f1 = xr.open_dataset(fdomain)
- # create 1d coordinate variables to enable sel() method
- lon0=np.asarray(f1['xc'][0,:])
- lat0=np.asarray(f1['yc'][:,0])
- lon=xr.DataArray(lon0,name='lon',dims='ni',coords={'ni':lon0})
- lat=xr.DataArray(lat0,name='lat',dims='nj',coords={'nj':lat0})
- # assign() not working on cheyenne
- #f2=f1.assign({'lon':lon,'lat':lat})
- f2=f1.assign()
- f2['lon'] = lon
- f2['lat'] = lat
- f2.reset_coords(['xc','yc'],inplace=True)
- # extract gridcell closest to plon/plat
- f3 = f2.sel(ni=plon,nj=plat,method='nearest')
- # expand dimensions
- f3 = f3.expand_dims(['nj','ni'])
-
- wfile=fdomain2
- # mode 'w' overwrites file
- f3.to_netcdf(path=wfile, mode='w')
- mprint('created file '+fdomain2)
- f1.close(); f2.close(); f3.close()
-
-#-- Create CTSM surface data file
-if create_surfdata:
- mprint( "Open: "+fsurf )
- f1 = xr.open_dataset(fsurf)
- # create 1d variables
- lon0=np.asarray(f1['LONGXY'][0,:])
- lon=xr.DataArray(lon0,name='lon',dims='lsmlon',coords={'lsmlon':lon0})
- lat0=np.asarray(f1['LATIXY'][:,0])
- lat=xr.DataArray(lat0,name='lat',dims='lsmlat',coords={'lsmlat':lat0})
- #f2=f1.assign({'lon':lon,'lat':lat})
- f2=f1.assign()
- f2['lon'] = lon
- f2['lat'] = lat
- # extract gridcell closest to plon/plat
- f3 = f2.sel(lsmlon=plon,lsmlat=plat,method='nearest')
- # expand dimensions
- f3 = f3.expand_dims(['lsmlat','lsmlon'])
-
- # modify surface data properties
- if overwrite_single_pft:
- f3['PCT_NAT_PFT'][:,:,:] = 0
- f3['PCT_NAT_PFT'][:,:,dominant_pft] = 100
- if zero_nonveg_landunits:
- f3['PCT_NATVEG'][:,:] = 100
- f3['PCT_CROP'][:,:] = 0
- f3['PCT_LAKE'][:,:] = 0.
- f3['PCT_WETLAND'][:,:] = 0.
- f3['PCT_URBAN'][:,:,] = 0.
- f3['PCT_GLACIER'][:,:] = 0.
- if uniform_snowpack:
- f3['STD_ELEV'][:,:] = 20.
- if no_saturation_excess:
- f3['FMAX'][:,:] = 0.
-
- # specify dimension order
- #f3 = f3.transpose(u'time', u'cft', u'natpft', u'lsmlat', u'lsmlon')
- f3 = f3.transpose(u'time', u'cft', u'lsmpft', u'natpft', u'nglcec', u'nglcecp1', u'nlevsoi', u'nlevurb', u'numrad', u'numurbl', 'lsmlat', 'lsmlon')
- # mode 'w' overwrites file
- f3.to_netcdf(path=fsurf2, mode='w')
- mprint('created file '+fsurf2)
- f1.close(); f2.close(); f3.close()
-
- ''' this is buggy; can't re-write a file within the same session
- # modify new surface data file
- if overwrite_single_pft:
- f1 = xr.open_dataset(fsurf2)
- f1['PCT_NAT_PFT'][:,:,:] = 0
- f1['PCT_NAT_PFT'][:,:,dominant_pft] = 100
- f1.to_netcdf(path='~/junk.nc', mode='w')
- #f1.to_netcdf(path=fsurf2, mode='w')
- f1.close()
- if zero_nonveg_landunits:
- #f1 = xr.open_dataset(fsurf2)
- f1 = xr.open_dataset('~/junk.nc')
- f1['PCT_NATVEG'] = 100
- f1['PCT_CROP'] = 0
- f1['PCT_LAKE'] = 0.
- f1['PCT_WETLAND'] = 0.
- f1['PCT_URBAN'] = 0.
- f1['PCT_GLACIER'] = 0.
- #f1.to_netcdf(path=fsurf2, mode='w')
- f1.to_netcdf(path='~/junk2.nc', mode='w')
- f1.close()
- '''
-#-- Create CTSM transient landuse data file
-if create_landuse:
- mprint( "Open: "+fluse )
- f1 = xr.open_dataset(fluse)
- # create 1d variables
- lon0=np.asarray(f1['LONGXY'][0,:])
- lon=xr.DataArray(lon0,name='lon',dims='lsmlon',coords={'lsmlon':lon0})
- lat0=np.asarray(f1['LATIXY'][:,0])
- lat=xr.DataArray(lat0,name='lat',dims='lsmlat',coords={'lsmlat':lat0})
- #f2=f1.assign({'lon':lon,'lat':lat})
- f2=f1.assign()
- f2['lon'] = lon
- f2['lat'] = lat
- # extract gridcell closest to plon/plat
- f3 = f2.sel(lsmlon=plon,lsmlat=plat,method='nearest')
-
- # expand dimensions
- f3 = f3.expand_dims(['lsmlat','lsmlon'])
- # specify dimension order
- #f3 = f3.transpose('time','lat','lon')
- f3 = f3.transpose(u'time', u'cft', u'natpft', u'lsmlat', u'lsmlon')
- #f3['YEAR'] = f3['YEAR'].squeeze()
-
- # revert expand dimensions of YEAR
- year = np.squeeze(np.asarray(f3['YEAR']))
- x = xr.DataArray(year, coords={'time':f3['time']}, dims='time', name='YEAR')
- x.attrs['units']='unitless'
- x.attrs['long_name']='Year of PFT data'
- f3['YEAR'] = x
- #print(x)
- #mprint(f3)
- #stop
- # mode 'w' overwrites file
- f3.to_netcdf(path=fluse2, mode='w')
- mprint('created file '+fluse2)
- f1.close(); f2.close(); f3.close()
-
-#-- Create single point atmospheric forcing data
-if create_datm:
- #-- create datm domain file
- mprint( "Open: "+fdatmdomain )
- f1 = xr.open_dataset(fdatmdomain)
- # create 1d coordinate variables to enable sel() method
- lon0=np.asarray(f1['xc'][0,:])
- lat0=np.asarray(f1['yc'][:,0])
- lon=xr.DataArray(lon0,name='lon',dims='ni',coords={'ni':lon0})
- lat=xr.DataArray(lat0,name='lat',dims='nj',coords={'nj':lat0})
-
- #f2=f1.assign({'lon':lon,'lat':lat})
- f2=f1.assign()
- f2['lon'] = lon
- f2['lat'] = lat
- f2.reset_coords(['xc','yc'],inplace=True)
- # extract gridcell closest to plon/plat
- f3 = f2.sel(ni=plon,nj=plat,method='nearest')
- # expand dimensions
- f3 = f3.expand_dims(['nj','ni'])
-
- wfile=fdatmdomain2
- # mode 'w' overwrites file
- f3.to_netcdf(path=wfile, mode='w')
- mprint('created file '+fdatmdomain2)
- f1.close(); f2.close(); f3.close()
-
- #-- specify subdirectory names and filename prefixes
- solrdir = 'Solar/'
- precdir = 'Precip/'
- tpqwldir = 'TPHWL/'
- prectag = 'clmforc.GSWP3.c2011.0.5x0.5.Prec.'
- solrtag = 'clmforc.GSWP3.c2011.0.5x0.5.Solr.'
- tpqwtag = 'clmforc.GSWP3.c2011.0.5x0.5.TPQWL.'
-
- #-- create data files
- infile=[]
- outfile=[]
- for y in range(datm_syr,datm_eyr+1):
- ystr=str(y)
- for m in range(1,13):
- mstr=str(m)
- if m < 10:
- mstr='0'+mstr
-
- dtag=ystr+'-'+mstr
-
- fsolar=dir_input_datm+solrdir+solrtag+dtag+'.nc'
- fsolar2=dir_output_datm+solrtag+tag+'.'+dtag+'.nc'
- fprecip=dir_input_datm+precdir+prectag+dtag+'.nc'
- fprecip2=dir_output_datm+prectag+tag+'.'+dtag+'.nc'
- ftpqw=dir_input_datm+tpqwldir+tpqwtag+dtag+'.nc'
- ftpqw2=dir_output_datm+tpqwtag+tag+'.'+dtag+'.nc'
-
- infile+=[fsolar,fprecip,ftpqw]
- outfile+=[fsolar2,fprecip2,ftpqw2]
-
- nm=len(infile)
- for n in range(nm):
- mprint(outfile[n]+'\n')
- file_in = infile[n]
- file_out = outfile[n]
-
-
- f1 = xr.open_dataset(file_in)
- # create 1d coordinate variables to enable sel() method
- lon0=np.asarray(f1['LONGXY'][0,:])
- lat0=np.asarray(f1['LATIXY'][:,0])
- lon=xr.DataArray(lon0,name='lon',dims='lon',coords={'lon':lon0})
- lat=xr.DataArray(lat0,name='lat',dims='lat',coords={'lat':lat0})
- #f2=f1.assign({'lon':lon,'lat':lat})
- f2=f1.assign()
- f2['lon'] = lon
- f2['lat'] = lat
- f2.reset_coords(['LONGXY','LATIXY'],inplace=True)
- # extract gridcell closest to plon/plat
- f3 = f2.sel(lon=plon,lat=plat,method='nearest')
- # expand dimensions
- f3 = f3.expand_dims(['lat','lon'])
- # specify dimension order
- f3 = f3.transpose(u'scalar','time','lat','lon')
-
- # mode 'w' overwrites file
- f3.to_netcdf(path=file_out, mode='w')
- f1.close(); f2.close(); f3.close()
-
-
- mprint('datm files written to: '+dir_output_datm)
-
-mprint( "\nSuccessfully ran script\n\n" )
diff --git a/tools/contrib/subset_data.py b/tools/contrib/subset_data.py
new file mode 100755
index 0000000000..770c57bc9b
--- /dev/null
+++ b/tools/contrib/subset_data.py
@@ -0,0 +1,1142 @@
+#! /usr/bin/env python
+"""
+|------------------------------------------------------------------|
+|--------------------- Instructions -----------------------------|
+|------------------------------------------------------------------|
+
+Instructions for running on Cheyenne/Casper:
+
+load the following into your local environment
+ module load python
+ ncar_pylib
+
+-------------------------------------------------------------------
+To see the available options for single point cases:
+ ./subset_data.py point --help
+
+To see the available options for regional cases:
+ ./subset_data.py reg --help
+-------------------------------------------------------------------
+
+This script extracts domain files, surface dataset, and DATM files
+at either a single point or a region using the global dataset.
+
+After creating a case using a global compset, run preview_namelist.
+From the resulting lnd_in file in the run directory, find the name
+of the domain file, and the surface data file.
+From the datm streams files (e.g. datm.streams.txt.CLMGSWP3v1.Precip)
+find the name of the datm forcing data domain file and forcing files.
+Use these file names as the sources for the single point/regional
+files to be created (see below).
+
+After running this script, point to the new CLM domain and surface
+dataset using the user_nl_clm file in the case directory. In addition,
+copy the datm.streams files to the case directory, with the prefix
+'user_', e.g. user_datm.streams.txt.CLMGSWP3v1.Precip. Change the
+information in the user_datm.streams* files to point to the single
+point datm data (domain and forcing files) created using this script.
+
+The domain file is not set via user_nl_clm, but requires changing
+LND_DOMAIN and ATM_DOMAIN (and their paths) in env_run.xml.
+
+Using single point forcing data requires specifying the nearest
+neighbor mapping algorithm for the datm streams (usually they are
+the first three in the list) in user_nl_datm: mapalgo = 'nn','nn','nn',
+..., where the '...' can still be 'bilinear', etc, depending on the
+other streams that are being used, e.g. aerosols, anomaly forcing,
+bias correction.
+
+The file env_mach_pes.xml should be modified to specify a single
+processor. The mpi-serial libraries should also be used, and can be
+set in env_build.xml by changing "MPILIB" to "mpi-serial" prior to
+setting up the case.
+
+The case for the single point simulation should have river routing
+and land ice models turned off (i.e. the compset should use stub
+models SROF and SGLC)
+
+-------------------------------------------------------------------
+To run the script for a single point:
+ ./subset_data.py point
+
+To run the script for a region:
+ ./subset_data.py reg
+
+To remove NPL from your environment on Cheyenne/Casper:
+ deactivate
+-------------------------------------------------------------------
+
+"""
+# TODO
+# Automatic downloading of missing files if they are missing
+# default 78 pft vs 16 pft
+
+# Import libraries
+from __future__ import print_function
+
+import sys
+import os
+import string
+import logging
+import subprocess
+import argparse
+
+import numpy as np
+import xarray as xr
+
+from datetime import date
+from getpass import getuser
+from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
+
+myname = getuser()
+
+def get_parser():
+ """Get parser object for this script."""
+ #parser = ArgumentParser(description=__doc__,
+ # formatter_class=ArgumentDefaultsHelpFormatter)
+ parser = ArgumentParser(description=__doc__,
+ formatter_class=argparse.RawDescriptionHelpFormatter)
+
+ parser.print_usage = parser.print_help
+ subparsers = parser.add_subparsers(
+ help='Two possible ways to run this sript, either:',
+ dest ='run_type')
+ pt_parser = subparsers.add_parser('point',
+ help = 'Run script for a single point.')
+ rg_parser = subparsers.add_parser('reg',
+ help = 'Run script for a region.')
+
+
+ pt_parser.add_argument('--lat',
+ help='Single point latitude. [default: %(default)s]',
+ action="store",
+ dest="plat",
+ required=False,
+ type = plat_type,
+ default=42.5)
+ pt_parser.add_argument('--lon',
+ help='Single point longitude. [default: %(default)s]',
+ action="store",
+ dest="plon",
+ required=False,
+ type = plon_type,
+ default= 287.8 )
+ pt_parser.add_argument('--site',
+ help='Site name or tag. [default: %(default)s]',
+ action="store",
+ dest="site_name",
+ required = False,
+ type = str,
+ default = '')
+ pt_parser.add_argument('--create_domain',
+ help='Flag for creating CLM domain file at single point. [default: %(default)s]',
+ action="store",
+ dest="create_domain",
+ type = str2bool,
+ nargs = '?',
+ const = True,
+ required = False,
+ default = False)
+ pt_parser.add_argument('--create_surface',
+ help='Flag for creating surface data file at single point. [default: %(default)s]',
+ action="store",
+ dest="create_surfdata",
+ type = str2bool,
+ nargs = '?',
+ const = True,
+ required = False,
+ default = True)
+ pt_parser.add_argument('--create_landuse',
+ help='Flag for creating landuse data file at single point. [default: %(default)s]',
+ action="store",
+ dest="create_landuse",
+ type = str2bool,
+ nargs = '?',
+ const = True,
+ required = False,
+ default = False)
+ pt_parser.add_argument('--create_datm',
+ help='Flag for creating DATM forcing data at single point. [default: %(default)s]',
+ action="store",
+ dest="create_datm",
+ type = str2bool,
+ nargs = '?',
+ const = True,
+ required = False,
+ default = False)
+ pt_parser.add_argument('--datm_syr',
+ help='Start year for creating DATM forcing at single point. [default: %(default)s]',
+ action="store",
+ dest="datm_syr",
+ required = False,
+ type = int,
+ default = 1901)
+ pt_parser.add_argument('--datm_eyr',
+ help='End year for creating DATM forcing at single point. [default: %(default)s]',
+ action="store",
+ dest="datm_eyr",
+ required = False,
+ type = int,
+ default = 2014)
+ pt_parser.add_argument('--crop',
+ help='Create datasets using the extensive list of prognostic crop types. [default: %(default)s]',
+ action="store_true",
+ dest="crop_flag",
+ default=False)
+ pt_parser.add_argument('--dompft',
+ help='Dominant PFT type . [default: %(default)s] ',
+ action="store",
+ dest="dom_pft",
+ type =int,
+ default=7)
+ pt_parser.add_argument('--no-unisnow',
+ help='Turn off the flag for create uniform snowpack. [default: %(default)s]',
+ action="store_false",
+ dest="uni_snow",
+ default=True)
+ pt_parser.add_argument('--no-overwrite_single_pft',
+ help='Turn off the flag for making the whole grid 100%% single PFT. [default: %(default)s]',
+ action="store_false",
+ dest="overwrite_single_pft",
+ default=True)
+ pt_parser.add_argument('--zero_nonveg',
+ help='Set all non-vegetation landunits to zero. [default: %(default)s]',
+ action="store",
+ dest="zero_nonveg",
+ type =bool,
+ default=True)
+ pt_parser.add_argument('--no_saturation_excess',
+ help='Turn off the flag for saturation excess. [default: %(default)s]',
+ action="store",
+ dest="no_saturation_excess",
+ type =bool,
+ default=True)
+ pt_parser.add_argument('--outdir',
+ help='Output directory. [default: %(default)s]',
+ action="store",
+ dest="out_dir",
+ type =str,
+ default="/glade/scratch/"+myname+"/single_point/")
+
+ rg_parser.add_argument('--lat1',
+ help='Region start latitude. [default: %(default)s]',
+ action="store",
+ dest="lat1",
+ required=False,
+ type = plat_type,
+ default=-40)
+ rg_parser.add_argument('--lat2',
+ help='Region end latitude. [default: %(default)s]',
+ action="store",
+ dest="lat2",
+ required=False,
+ type = plat_type,
+ default=15)
+ rg_parser.add_argument('--lon1',
+ help='Region start longitude. [default: %(default)s]',
+ action="store",
+ dest="lon1",
+ required=False,
+ type = plon_type,
+ default= 275. )
+ rg_parser.add_argument('--lon2',
+ help='Region end longitude. [default: %(default)s]',
+ action="store",
+ dest="lon2",
+ required=False,
+ type = plon_type,
+ default= 330. )
+ rg_parser.add_argument('--reg',
+ help='Region name or tag. [default: %(default)s]',
+ action="store",
+ dest="reg_name",
+ required = False,
+ type = str,
+ default = '')
+ rg_parser.add_argument('--create_domain',
+ help='Flag for creating CLM domain file for a region. [default: %(default)s]',
+ action="store",
+ dest="create_domain",
+ type = str2bool,
+ nargs = '?',
+ const = True,
+ required = False,
+ default = False)
+ rg_parser.add_argument('--create_surface',
+ help='Flag for creating surface data file for a region. [default: %(default)s]',
+ action="store",
+ dest="create_surfdata",
+ type = str2bool,
+ nargs = '?',
+ const = True,
+ required = False,
+ default = True)
+ rg_parser.add_argument('--create_landuse',
+ help='Flag for creating landuse data file for a region. [default: %(default)s]',
+ action="store",
+ dest="create_landuse",
+ type = str2bool,
+ nargs = '?',
+ const = True,
+ required = False,
+ default = False)
+ rg_parser.add_argument('--create_datm',
+ help='Flag for creating DATM forcing data for a region. [default: %(default)s]',
+ action="store",
+ dest="create_datm",
+ type = str2bool,
+ nargs = '?',
+ const = True,
+ required = False,
+ default = False)
+ rg_parser.add_argument('--datm_syr',
+ help='Start year for creating DATM forcing for a region. [default: %(default)s]',
+ action="store",
+ dest="datm_syr",
+ required = False,
+ type = int,
+ default = 1901)
+ rg_parser.add_argument('--datm_eyr',
+ help='End year for creating DATM forcing for a region. [default: %(default)s]',
+ action="store",
+ dest="datm_eyr",
+ required = False,
+ type = int,
+ default = 2014)
+ rg_parser.add_argument('--crop',
+ help='Create datasets using the extensive list of prognostic crop types. [default: %(default)s]',
+ action="store_true",
+ dest="crop_flag",
+ default=False)
+ rg_parser.add_argument('--dompft',
+ help='Dominant PFT type . [default: %(default)s] ',
+ action="store",
+ dest="dom_pft",
+ type =int,
+ default=7)
+ rg_parser.add_argument('--outdir',
+ help='Output directory. [default: %(default)s]',
+ action="store",
+ dest="out_dir",
+ type =str,
+ default="/glade/scratch/"+myname+"/regional/")
+
+ return parser
+
+def str2bool(v):
+ """
+ Function for converting different forms of
+ command line boolean strings to boolean value.
+
+ Args:
+ v (str): String bool input
+
+ Raises:
+ if the argument is not an acceptable boolean string
+ (such as yes or no ; true or false ; y or n ; t or f ; 0 or 1).
+ argparse.ArgumentTypeError: The string should be one of the mentioned values.
+
+ Returns:
+ bool: Boolean value corresponding to the input.
+ """
+ if isinstance(v, bool):
+ return v
+ if v.lower() in ('yes', 'true', 't', 'y', '1'):
+ return True
+ elif v.lower() in ('no', 'false', 'f', 'n', '0'):
+ return False
+ else:
+ raise argparse.ArgumentTypeError('Boolean value expected. [true or false] or [y or n]')
+
+
+def plat_type(x):
+ """
+ Function to define lat type for the parser
+ and
+ raise error if latitude is not between -90 and 90.
+ """
+ x = float(x)
+ if (x < -90) or (x > 90):
+ raise argparse.ArgumentTypeError("ERROR: Latitude should be between -90 and 90.")
+ return x
+
+
+def plon_type(x):
+ """
+ Function to define lon type for the parser and
+ convert negative longitudes and
+ raise error if lon is not between -180 and 360.
+ """
+ x = float(x)
+ if (-180 < x) and (x < 0):
+ print ("lon is :", lon)
+ x= x%360
+ print ("after modulo lon is :", lon)
+ if (x < 0) or (x > 360):
+ raise argparse.ArgumentTypeError("ERROR: Latitude of single point should be between 0 and 360 or -180 and 180.")
+ return x
+
+def get_git_sha():
+ """
+ Returns Git short SHA for the currect directory.
+ """
+ return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).strip().decode()
+
+class BaseCase :
+ """
+ Parent class to SinglePointCase and RegionalCase
+
+ ...
+
+ Attributes
+ ----------
+ create_domain : bool
+ flag for creating domain file
+ create_surfdata : bool
+ flag for creating surface dataset
+ create_landuse : bool
+ flag for creating landuse file
+ create_datm : bool
+ flag for creating DATM files
+
+ Methods
+ -------
+ create_1d_coord(filename, lon_varname , lat_varname,x_dim , y_dim )
+ create 1d coordinate variables to enable sel() method
+
+ add_tag_to_filename(filename, tag)
+ add a tag and timetag to a filename ending with
+ [._]cYYMMDD.nc or [._]YYMMDD.nc
+ """
+ def __init__(self, create_domain, create_surfdata, create_landuse, create_datm):
+ self.create_domain = create_domain
+ self.create_surfdata = create_surfdata
+ self.create_landuse = create_landuse
+ self.create_datm = create_datm
+
+ def __str__(self):
+ return str(self.__class__) + '\n' + '\n'.join((str(item) + ' = ' + str(self.__dict__[item])
+ for item in sorted(self.__dict__)))
+
+ @staticmethod
+ def create_1d_coord(filename, lon_varname , lat_varname , x_dim , y_dim):
+ """
+ lon_varname : variable name that has 2d lon
+ lat_varname : variable name that has 2d lat
+ x_dim: dimension name in X -- lon
+ y_dim: dimension name in Y -- lat
+ """
+ print( "Open file: "+filename )
+ f1 = xr.open_dataset(filename)
+
+ # create 1d coordinate variables to enable sel() method
+ lon0 = np.asarray(f1[lon_varname][0,:])
+ lat0 = np.asarray(f1[lat_varname][:,0])
+ lon = xr.DataArray(lon0,name='lon',dims=x_dim,coords={x_dim:lon0})
+ lat = xr.DataArray(lat0,name='lat',dims=y_dim,coords={y_dim:lat0})
+
+ f2=f1.assign({'lon':lon,'lat':lat})
+
+ f2.reset_coords([lon_varname,lat_varname])
+ f1.close()
+ return f2
+
+ @staticmethod
+ def add_tag_to_filename(filename, tag):
+ """
+ Add a tag and replace timetag of a filename
+ # Expects file to end with [._]cYYMMDD.nc or [._]YYMMDD.nc
+ # Add the tag to just before that ending part
+ # and change the ending part to the current time tag
+ """
+ basename = os.path.basename(filename)
+ cend = -10
+ if ( basename[cend] == "c" ):
+ cend = cend - 1
+ if ( (basename[cend] != ".") and (basename[cend] != "_") ):
+ print ( "Trouble figuring out where to add tag to filename:"+filename )
+ os.abort()
+ today = date.today()
+ today_string = today.strftime("%y%m%d")
+ return( basename[:cend]+"_"+tag+"_c"+today_string +'.nc')
+
+ @staticmethod
+ def update_metadata(nc):
+ #update attributes
+ today = date.today()
+ today_string = today.strftime("%Y-%m-%d")
+
+ #get git hash
+ sha = get_git_sha()
+
+ nc.attrs['Created_on'] = today_string
+ nc.attrs['Created_by'] = myname
+ nc.attrs['Created_with'] = os.path.abspath(__file__) + " -- "+sha
+
+ #delete unrelated attributes if they exist
+ del_attrs = ['source_code', 'SVN_url', 'hostname', 'history'
+ 'History_Log', 'Logname', 'Host', 'Version',
+ 'Compiler_Optimized']
+ attr_list = nc.attrs
+
+ for attr in del_attrs:
+ if attr in attr_list:
+ #print ("This attr should be deleted:", attr)
+ del(nc.attrs[attr])
+
+
+ #for attr, value in attr_list.items():
+ # print (attr + " = "+str(value))
+
+
+
+class SinglePointCase (BaseCase):
+ """
+ A case to encapsulate single point cases.
+
+ ...
+
+ Attributes
+ ----------
+ plat : float
+ latitude
+ plon : float
+ longitude
+ site_name: str -- default = None
+ Site name
+
+ Methods
+ -------
+ create_tag
+ create a tag for single point which is the site name
+ or the "lon-lat" format if the site name does not exist.
+
+ create_domain_at_point
+ Create domain file at a single point.
+ create_landuse_at_point:
+ Create landuse file at a single point.
+ create_surfdata_at_point:
+ Create surface dataset at a single point.
+ create_datmdomain_at_point:
+ Create DATM domain file at a single point.
+ """
+
+ def __init__(self, plat, plon,site_name,
+ create_domain, create_surfdata, create_landuse, create_datm,
+ overwrite_single_pft, dominant_pft, zero_nonveg_landunits,
+ uniform_snowpack, no_saturation_excess):
+ super().__init__(create_domain, create_surfdata, create_landuse, create_datm)
+ self.plat = plat
+ self.plon = plon
+ self.site_name = site_name
+ self.overwrite_single_pft = overwrite_single_pft
+ self.dominant_pft = dominant_pft
+ self.zero_nonveg_landunits = zero_nonveg_landunits
+ self.uniform_snowpack = uniform_snowpack
+ self.no_saturation_excess = no_saturation_excess
+
+ def create_tag(self):
+ if self.site_name:
+ self.tag = self.site_name
+ else:
+ self.tag=str(self.plon)+'_'+str(self.plat)
+
+ @staticmethod
+ def create_fileout_name( filename,tag):
+
+ basename = os.path.basename(filename)
+ items = basename.split('_')
+ today = date.today()
+ today_string = today.strftime("%y%m%d")
+ new_string = items[0]+"_"+items[2]+"_"+items[3]+"_"+ items[4] \
+ +"_"+items[5]+"_"+items[6]+"_"+tag+"_c"+today_string+".nc"
+ return new_string
+
+ def create_domain_at_point (self):
+ print( "----------------------------------------------------------------------")
+ print ("Creating domain file at ", self.plon, self.plat)
+ # create 1d coordinate variables to enable sel() method
+ f2 = self.create_1d_coord(self.fdomain_in, 'xc','yc','ni','nj')
+ # extract gridcell closest to plon/plat
+ f3 = f2.sel(ni=self.plon,nj=self.plat,method='nearest')
+ # expand dimensions
+ f3 = f3.expand_dims(['nj','ni'])
+
+ #update attributes
+ self.update_metadata(f3)
+ f3.attrs['Created_from'] = self.fdomain_in
+
+ wfile=self.fdomain_out
+ f3.to_netcdf(path=wfile, mode='w')
+ print('Successfully created file (fdomain_out)'+self.fdomain_out)
+ f2.close(); f3.close()
+
+
+ def create_landuse_at_point (self):
+ print( "----------------------------------------------------------------------")
+ print ("Creating landuse file at ", self.plon, self.plat, ".")
+ # create 1d coordinate variables to enable sel() method
+ f2 = self.create_1d_coord(self.fluse_in, 'LONGXY','LATIXY','lsmlon','lsmlat')
+ # extract gridcell closest to plon/plat
+ f3 = f2.sel(lsmlon=self.plon,lsmlat=self.plat,method='nearest')
+
+ # expand dimensions
+ f3 = f3.expand_dims(['lsmlat','lsmlon'])
+ # specify dimension order
+ #f3 = f3.transpose('time','lat','lon')
+ f3 = f3.transpose(u'time', u'cft', u'natpft', u'lsmlat', u'lsmlon')
+ #f3['YEAR'] = f3['YEAR'].squeeze()
+
+ # revert expand dimensions of YEAR
+ year = np.squeeze(np.asarray(f3['YEAR']))
+ x = xr.DataArray(year, coords={'time':f3['time']}, dims='time', name='YEAR')
+ x.attrs['units']='unitless'
+ x.attrs['long_name']='Year of PFT data'
+ f3['YEAR'] = x
+
+ #update attributes
+ self.update_metadata(f3)
+ f3.attrs['Created_from'] = self.fluse_in
+
+ wfile = self.fluse_out
+ # mode 'w' overwrites file
+ f3.to_netcdf(path=wfile, mode='w')
+ print('Successfully created file (luse_out)'+self.fluse_out,".")
+ f2.close(); f3.close()
+
+ def create_surfdata_at_point(self):
+ print( "----------------------------------------------------------------------")
+ print ("Creating surface dataset file at ", self.plon, self.plat, ".")
+ # create 1d coordinate variables to enable sel() method
+ filename = self.fsurf_in
+ f2 = self.create_1d_coord(filename, 'LONGXY','LATIXY','lsmlon','lsmlat')
+ # extract gridcell closest to plon/plat
+ f3 = f2.sel(lsmlon=self.plon,lsmlat=self.plat,method='nearest')
+ # expand dimensions
+ f3 = f3.expand_dims(['lsmlat','lsmlon']).copy(deep=True)
+
+ # modify surface data properties
+ if self.overwrite_single_pft:
+ f3['PCT_NAT_PFT'][:,:,:] = 0
+ f3['PCT_NAT_PFT'][:,:,self.dominant_pft] = 100
+ if self.zero_nonveg_landunits:
+ f3['PCT_NATVEG'][:,:] = 100
+ f3['PCT_CROP'][:,:] = 0
+ f3['PCT_LAKE'][:,:] = 0.
+ f3['PCT_WETLAND'][:,:] = 0.
+ f3['PCT_URBAN'][:,:,] = 0.
+ f3['PCT_GLACIER'][:,:] = 0.
+ if self.uniform_snowpack:
+ f3['STD_ELEV'][:,:] = 20.
+ if self.no_saturation_excess:
+ f3['FMAX'][:,:] = 0.
+
+ # specify dimension order
+ #f3 = f3.transpose(u'time', u'cft', u'natpft', u'lsmlat', u'lsmlon')
+ f3 = f3.transpose(u'time', u'cft', u'lsmpft', u'natpft', u'nglcec', u'nglcecp1', u'nlevsoi', u'nlevurb', u'numrad', u'numurbl', 'lsmlat', 'lsmlon')
+
+ #update attributes
+ self.update_metadata(f3)
+ f3.attrs['Created_from'] = self.fsurf_in
+ del(f3.attrs['History_Log'])
+ # mode 'w' overwrites file
+ f3.to_netcdf(path=self.fsurf_out, mode='w')
+ print('Successfully created file (fsurf_out) :'+self.fsurf_out)
+ f2.close(); f3.close()
+
+ def create_datmdomain_at_point(self):
+ print( "----------------------------------------------------------------------")
+ print("Creating DATM domain file at ", self.plon, self.plat, ".")
+ # create 1d coordinate variables to enable sel() method
+ filename = self.fdatmdomain_in
+ f2 = self.create_1d_coord(filename, 'xc','yc','ni','nj')
+ # extract gridcell closest to plon/plat
+ f3 = f2.sel(ni=self.plon,nj=self.plat,method='nearest')
+ # expand dimensions
+ f3 = f3.expand_dims(['nj','ni'])
+ wfile=self.fdatmdomain_out
+ #update attributes
+ self.update_metadata(f3)
+ f3.attrs['Created_from'] = self.fdatmdomain_in
+ # mode 'w' overwrites file
+ f3.to_netcdf(path=wfile, mode='w')
+ print('Successfully created file (fdatmdomain_out) :'+self.fdatmdomain_out)
+ f2.close(); f3.close()
+
+ def extract_datm_at(self, file_in, file_out):
+ # create 1d coordinate variables to enable sel() method
+ f2 = self.create_1d_coord(file_in, 'LONGXY','LATIXY','lon','lat')
+ # extract gridcell closest to plon/plat
+ f3 = f2.sel(lon=self.plon,lat=self.plat,method='nearest')
+ # expand dimensions
+ f3 = f3.expand_dims(['lat','lon'])
+ # specify dimension order
+ f3 = f3.transpose(u'scalar','time','lat','lon')
+
+ #update attributes
+ self.update_metadata(f3)
+ f3.attrs['Created_from'] = file_in
+ # mode 'w' overwrites file
+ f3.to_netcdf(path=file_out, mode='w')
+ print('Successfully created file :'+ file_out)
+ f2.close(); f3.close()
+
+ def create_datm_at_point(self):
+ print( "----------------------------------------------------------------------")
+ print("Creating DATM files at ", self.plon, self.plat, ".")
+ #-- specify subdirectory names and filename prefixes
+ solrdir = 'Solar/'
+ precdir = 'Precip/'
+ tpqwldir = 'TPHWL/'
+ prectag = 'clmforc.GSWP3.c2011.0.5x0.5.Prec.'
+ solrtag = 'clmforc.GSWP3.c2011.0.5x0.5.Solr.'
+ tpqwtag = 'clmforc.GSWP3.c2011.0.5x0.5.TPQWL.'
+
+ #-- create data files
+ infile=[]
+ outfile=[]
+ for y in range(self.datm_syr,self.datm_eyr+1):
+ ystr=str(y)
+ for m in range(1,13):
+ mstr=str(m)
+ if m < 10:
+ mstr='0'+mstr
+
+ dtag=ystr+'-'+mstr
+
+ fsolar=self.dir_input_datm+solrdir+solrtag+dtag+'.nc'
+ fsolar2=self.dir_output_datm+solrtag+self.tag+'.'+dtag+'.nc'
+ fprecip=self.dir_input_datm+precdir+prectag+dtag+'.nc'
+ fprecip2=self.dir_output_datm+prectag+self.tag+'.'+dtag+'.nc'
+ ftpqw=self.dir_input_datm+tpqwldir+tpqwtag+dtag+'.nc'
+ ftpqw2=self.dir_output_datm+tpqwtag+self.tag+'.'+dtag+'.nc'
+
+ infile+=[fsolar,fprecip,ftpqw]
+ outfile+=[fsolar2,fprecip2,ftpqw2]
+
+ nm=len(infile)
+ for n in range(nm):
+ print(outfile[n])
+ file_in = infile[n]
+ file_out = outfile[n]
+ self.extract_datm_at(file_in, file_out)
+
+
+ print('All DATM files are created in: '+self.dir_output_datm)
+
+class RegionalCase (BaseCase):
+ """
+ A case to encapsulate regional cases.
+ """
+
+ def __init__(self, lat1, lat2, lon1, lon2, reg_name,
+ create_domain, create_surfdata, create_landuse, create_datm):
+ super().__init__(create_domain, create_surfdata, create_landuse, create_datm)
+ self.lat1 = lat1
+ self.lat2 = lat2
+ self.lon1 = lon1
+ self.lon2 = lon2
+ self.reg_name = reg_name
+
+ def create_tag(self):
+ if self.reg_name:
+ self.tag = self.reg_name
+ else:
+ self.tag=str(self.lon1)+'-'+str(self.lon2)+'_'+str(self.lat1)+'-'+str(self.lat2)
+
+ def create_domain_at_reg (self):
+ #print ("Creating domain file at region", self.lon1+"-"+self.lat2,self.lat1+"-"+self.lat2)
+ print ("Creating domain file at region:", self.tag)
+ # create 1d coordinate variables to enable sel() method
+ f2 = self.create_1d_coord(self.fdomain_in, 'xc','yc','ni','nj')
+ lat = f2['lat']
+ lon = f2['lon']
+ # subset longitude and latitude arrays
+ xind=np.where((lon >= self.lon1) & (lon <= self.lon2))[0]
+ yind=np.where((lat >= self.lat1) & (lat <= self.lat2))[0]
+ f3=f2.isel(nj=yind,ni=xind)
+
+ #update attributes
+ self.update_metadata(f3)
+ f3.attrs['Created_from'] = self.fdomain_in
+
+ wfile=self.fdomain_out
+ # mode 'w' overwrites file
+ f3.to_netcdf(path=wfile, mode='w')
+ print('Successfully created file (fdomain_out)'+self.fdomain_out)
+ f2.close(); f3.close()
+
+
+ def create_surfdata_at_reg(self):
+ #print ("Creating surface dataset file at region", self.lon1+"-"+self.lat2,self.lat1+"-"+self.lat2)
+ print ("Creating surface dataset file at region:", self.tag)
+ # create 1d coordinate variables to enable sel() method
+ filename = self.fsurf_in
+ f2 = self.create_1d_coord(filename, 'LONGXY','LATIXY','lsmlon','lsmlat')
+ lat = f2['lat']
+ lon = f2['lon']
+ # subset longitude and latitude arrays
+ xind=np.where((lon >= self.lon1) & (lon <= self.lon2))[0]
+ yind=np.where((lat >= self.lat1) & (lat <= self.lat2))[0]
+ f3=f2.isel(lsmlat=yind,lsmlon=xind)
+
+ #update attributes
+ self.update_metadata(f3)
+ f3.attrs['Created_from'] = self.fsurf_in
+
+ # mode 'w' overwrites file
+ f3.to_netcdf(path=self.fsurf_out, mode='w')
+ print('created file (fsurf_out)'+self.fsurf_out)
+ #f1.close();
+ f2.close(); f3.close()
+
+
+ def create_landuse_at_reg (self):
+ #print ("Creating surface dataset file at region", self.lon1+"-"+self.lat2,self.lat1+"-"+self.lat2)
+ print ("Creating surface dataset file at region:",self.tag)
+ # create 1d coordinate variables to enable sel() method
+ f2 = self.create_1d_coord(self.fluse_in, 'LONGXY','LATIXY','lsmlon','lsmlat')
+ lat = f2['lat']
+ lon = f2['lon']
+ # subset longitude and latitude arrays
+ xind=np.where((lon >= self.lon1) & (lon <= self.lon2))[0]
+ yind=np.where((lat >= self.lat1) & (lat <= self.lat2))[0]
+ f3=f2.isel(lsmlat=yind,lsmlon=xind)
+
+ #update attributes
+ self.update_metadata(f3)
+ f3.attrs['Created_from'] = self.fluse_in
+
+ wfile=self.fluse_out
+ # mode 'w' overwrites file
+ f3.to_netcdf(path=wfile, mode='w')
+ print('Successfully created file (fdomain_out)'+self.fdomain_out)
+ f2.close(); f3.close()
+
+
+def setup_logging(log_file, log_level):
+ """
+ Setup logging to log to console and log file.
+ """
+
+ root_logger = logging.getLogger()
+ root_logger.setLevel(log_level)
+
+ # setup log file
+ one_mb = 1000000
+ handler = logging.handlers.RotatingFileHandler(log_file, maxBytes=one_mb , backupCount=10)
+
+ fmt = logging.Formatter(
+ '%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
+ datefmt='%y-%m-%d %H:%M:%S')
+
+ handler.setFormatter(fmt)
+ root_logger.addHandler(handler)
+
+ # setup logging to console
+ stream_handler = logging.StreamHandler(sys.stdout)
+ stream_handler.setFormatter(fmt)
+ root_logger.addHandler(stream_handler)
+
+ # redirect stdout/err to log file
+ StreamToLogger.setup_stdout()
+ StreamToLogger.setup_stderr()
+
+
+
+class StreamToLogger(object):
+ """
+ Custom class to log all stdout and stderr streams.
+ modified from:
+ https://www.electricmonk.nl/log/2011/08/14/redirect-stdout-and-stderr-to-a-logger-in-python/
+ """
+ def __init__(self, stream, logger, log_level=logging.INFO,
+ also_log_to_stream=False):
+ self.logger = logger
+ self.stream = stream
+ self.log_level = log_level
+ self.linebuf = ''
+ self.also_log_to_stream = also_log_to_stream
+
+ @classmethod
+ def setup_stdout(cls, also_log_to_stream=True):
+ """
+ Setup logger for stdout
+ """
+ stdout_logger = logging.getLogger('STDOUT')
+ sl = StreamToLogger(sys.stdout, stdout_logger, logging.INFO, also_log_to_stream)
+ sys.stdout = sl
+
+ @classmethod
+ def setup_stderr(cls, also_log_to_stream=True):
+ """
+ Setup logger for stdout
+ """
+ stderr_logger = logging.getLogger('STDERR')
+ sl = StreamToLogger(sys.stderr, stderr_logger, logging.ERROR, also_log_to_stream)
+ sys.stderr = sl
+
+ def write(self, buf):
+ temp_linebuf = self.linebuf + buf
+ self.linebuf = ''
+ for line in temp_linebuf.splitlines(True):
+ if line[-1] == '\n':
+ self.logger.log(self.log_level, line.rstrip())
+ else:
+ self.linebuf += line
+
+ def flush(self):
+ if self.linebuf != '':
+ self.logger.log(self.log_level, self.linebuf.rstrip())
+ self.linebuf = ''
+
+
+
+
+def main ():
+
+ args = get_parser().parse_args()
+
+ # --------------------------------- #
+
+ today = date.today()
+ today_string = today.strftime("%Y%m%d")
+
+ pwd = os.getcwd()
+
+ log_file = os.path.join(pwd, today_string+'.log')
+
+ log_level = logging.DEBUG
+ setup_logging(log_file, log_level)
+ log = logging.getLogger(__name__)
+
+ print("User = "+myname)
+ print("Current directory = "+pwd)
+
+ # --------------------------------- #
+
+ if (args.run_type == "point"):
+ print( "----------------------------------------------------------------------------")
+ print( "This script extracts a single point from the global CTSM inputdata datasets." )
+
+ #-- Specify point to extract
+ plon = args.plon
+ plat = args.plat
+
+ #-- Create regional CLM domain file
+ create_domain = args.create_domain
+ #-- Create CLM surface data file
+ create_surfdata = args.create_surfdata
+ #-- Create CLM surface data file
+ create_landuse = args.create_landuse
+ #-- Create single point DATM atmospheric forcing data
+ create_datm = args.create_datm
+ datm_syr = args.datm_syr
+ datm_eyr = args.datm_eyr
+
+ crop_flag = args.crop_flag
+
+ site_name = args.site_name
+
+ #-- Modify landunit structure
+ overwrite_single_pft = args.overwrite_single_pft
+ dominant_pft = args.dom_pft
+ zero_nonveg_landunits= args.zero_nonveg
+ uniform_snowpack = args.uni_snow
+ no_saturation_excess = args.no_saturation_excess
+
+
+ #-- Create SinglePoint Object
+ single_point = SinglePointCase(plat, plon,site_name,
+ create_domain, create_surfdata, create_landuse, create_datm,
+ overwrite_single_pft, dominant_pft, zero_nonveg_landunits, uniform_snowpack,
+ no_saturation_excess)
+ single_point.create_tag()
+
+
+ print (single_point)
+
+ if crop_flag:
+ num_pft = "78"
+ else:
+ num_pft = "16"
+
+ print('crop_flag = '+ crop_flag.__str__()+ ' => num_pft ='+ num_pft)
+
+ #-- Set input and output filenames
+ #-- Specify input and output directories
+ dir_output = args.out_dir
+ if ( not os.path.isdir( dir_output ) ):
+ os.mkdir( dir_output )
+
+ dir_inputdata='/glade/p/cesmdata/cseg/inputdata/'
+ dir_clm_forcedata='/glade/p/cgd/tss/CTSM_datm_forcing_data/'
+ dir_input_datm=os.path.join(dir_clm_forcedata,'atm_forcing.datm7.GSWP3.0.5d.v1.c170516/')
+ dir_output_datm=os.path.join(dir_output , 'datmdata/')
+ if ( not os.path.isdir( dir_output_datm ) ):
+ os.mkdir( dir_output_datm )
+
+ print ("dir_input_datm : ", dir_input_datm) #
+ print ("dir_output_datm : ", dir_output_datm) #
+
+
+ #-- Set time stamp
+ today = date.today()
+ timetag = today.strftime("%y%m%d")
+
+ #-- Specify land domain file ---------------------------------
+ fdomain_in = os.path.join(dir_inputdata,'share/domains/domain.lnd.fv0.9x1.25_gx1v7.151020.nc')
+ fdomain_out = dir_output + single_point.add_tag_to_filename( fdomain_in, single_point.tag )
+ single_point.fdomain_in = fdomain_in
+ single_point.fdomain_out = fdomain_out
+ print ("fdomain_in :",fdomain_in) #
+ print ("fdomain_out :",fdomain_out) #
+
+ #-- Specify surface data file --------------------------------
+ if crop_flag:
+ fsurf_in = os.path.join (dir_inputdata, 'lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.9x1.25_hist_78pfts_CMIP6_simyr2000_c190214.nc')
+ else:
+ fsurf_in = os.path.join (dir_inputdata, 'lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc')
+
+ #fsurf_out = dir_output + single_point.add_tag_to_filename(fsurf_in, single_point.tag) # remove res from filename for singlept
+ fsurf_out = dir_output + single_point.create_fileout_name(fsurf_in, single_point.tag)
+ single_point.fsurf_in = fsurf_in
+ single_point.fsurf_out = fsurf_out
+ print ("fsurf_in :",fsurf_in) #
+ print ("fsurf_out :",fsurf_out) #
+
+ #-- Specify landuse file -------------------------------------
+ if crop_flag:
+ fluse_in = os.path.join (dir_inputdata,'lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c190214.nc')
+ else:
+ fluse_in = os.path.join (dir_inputdata,'lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_hist_78pfts_CMIP6_simyr1850-2015_c190214.nc')
+ #fluse_out = dir_output + single_point.add_tag_to_filename( fluse_in, single_point.tag ) # remove resolution from filename for singlept cases
+ fluse_out = dir_output + single_point.create_fileout_name(fluse_in, single_point.tag)
+ single_point.fluse_in = fluse_in
+ single_point.fluse_out = fluse_out
+ print ("fluse_in :", fluse_in) #
+ print ("fluse_out :", fluse_out) #
+
+ #-- Specify datm domain file ---------------------------------
+ fdatmdomain_in = os.path.join (dir_clm_forcedata,'atm_forcing.datm7.GSWP3.0.5d.v1.c170516/domain.lnd.360x720_gswp3.0v1.c170606.nc')
+ fdatmdomain_out = dir_output_datm+single_point.add_tag_to_filename( fdatmdomain_in, single_point.tag )
+ single_point.fdatmdomain_in = fdatmdomain_in
+ single_point.fdatmdomain_out = fdatmdomain_out
+ print ("fdatmdomain_in : ", fdatmdomain_in) #
+ print ("fdatmdomain out : ", fdatmdomain_out) #
+
+ #-- Create CTSM domain file
+ if create_domain:
+ single_point.create_domain_at_point()
+
+ #-- Create CTSM surface data file
+ if create_surfdata:
+ single_point.create_surfdata_at_point()
+
+ #-- Create CTSM transient landuse data file
+ if create_landuse:
+ single_point.create_landuse_at_point()
+
+ #-- Create single point atmospheric forcing data
+ if create_datm:
+ single_point.create_datmdomain_at_point()
+ single_point.datm_syr =datm_syr
+ single_point.datm_eyr =datm_eyr
+ single_point.dir_input_datm = dir_input_datm
+ single_point.dir_output_datm = dir_output_datm
+ single_point.create_datm_at_point()
+
+ print( "Successfully ran script for single point." )
+ exit()
+
+ elif (args.run_type == "reg"):
+ print ("Running the script for the region")
+ #-- Specify region to extract
+ lat1 = args.lat1
+ lat2 = args.lat2
+
+ lon1 = args.lon1
+ lon2 = args.lon2
+
+ #-- Create regional CLM domain file
+ create_domain = args.create_domain
+ #-- Create CLM surface data file
+ create_surfdata = args.create_surfdata
+ #-- Create CLM surface data file
+ create_landuse = args.create_landuse
+ #-- Create DATM atmospheric forcing data
+ create_datm = args.create_datm
+
+ crop_flag = args.crop_flag
+
+ reg_name = args.reg_name
+
+ region = RegionalCase(lat1, lat2, lon1, lon2, reg_name, create_domain, create_surfdata, create_landuse, create_datm)
+
+ print (region)
+
+ if crop_flag:
+ num_pft = "78"
+ else:
+ num_pft = "16"
+
+
+ print(' crop_flag = '+ crop_flag.__str__()+ ' num_pft ='+ num_pft)
+
+
+ region.create_tag()
+
+ #-- Set input and output filenames
+ #-- Specify input and output directories
+ dir_output='/glade/scratch/'+myname+'/region/'
+ if ( not os.path.isdir( dir_output ) ):
+ os.mkdir( dir_output )
+
+ dir_inputdata='/glade/p/cesmdata/cseg/inputdata/'
+ dir_clm_forcedata='/glade/p/cgd/tss/CTSM_datm_forcing_data/'
+
+ #-- Set time stamp
+ command='date "+%y%m%d"'
+ x2=subprocess.Popen(command,stdout=subprocess.PIPE,shell='True')
+ x=x2.communicate()
+ timetag = x[0].strip()
+ print (timetag)
+
+ #-- Specify land domain file ---------------------------------
+ fdomain_in = dir_inputdata+'share/domains/domain.lnd.fv1.9x2.5_gx1v7.170518.nc'
+ fdomain_out = dir_output + 'domain.lnd.fv1.9x2.5_gx1v7.'+region.tag+'_170518.nc'
+ #SinglePointCase.set_fdomain (fdomain)
+ region.fdomain_in = fdomain_in
+ region.fdomain_out = fdomain_out
+
+ #-- Specify surface data file --------------------------------
+ fsurf_in = dir_inputdata+'lnd/clm2/surfdata_map/surfdata_1.9x2.5_78pfts_CMIP6_simyr1850_c170824.nc'
+ fsurf_out = dir_output + 'surfdata_1.9x2.5_78pfts_CMIP6_simyr1850_'+region.tag+'_c170824.nc'
+ region.fsurf_in = fsurf_in
+ region.fsurf_out = fsurf_out
+
+ #-- Specify landuse file -------------------------------------
+ fluse_in = dir_inputdata+'lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc'
+ fluse_out = dir_output + 'landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_'+region.tag+'.c170824.nc'
+ region.fluse_in = fluse_in
+ region.fluse_out = fluse_out
+
+ #-- Create CTSM domain file
+ if create_domain:
+ region.create_domain_at_reg()
+
+ #-- Create CTSM surface data file
+ if create_surfdata:
+ region.create_surfdata_at_reg()
+
+ #-- Create CTSM transient landuse data file
+ if create_landuse:
+ region.create_landuse_at_reg()
+ print( "Successfully ran script for a regional case." )
+
+ else :
+ # print help when no option is chosen
+ get_parser().print_help()
+
+if __name__ == "__main__":
+ main()
diff --git a/tools/contrib/subset_surfdata b/tools/contrib/subset_surfdata
deleted file mode 100755
index 4dbcbf3468..0000000000
--- a/tools/contrib/subset_surfdata
+++ /dev/null
@@ -1,141 +0,0 @@
-#! /usr/bin/env python
-import sys
-import os
-from getpass import getuser
-import string
-import subprocess
-import numpy as np
-import xarray as xr
-
-def mprint(mstr):
- vnum=sys.version_info[0]
- if vnum == 3:
- print(mstr)
- if vnum == 2:
- print mstr
-
-myname=getuser()
-pwd=os.getcwd()
-mprint(myname)
-mprint(pwd)
-
-#creates regional surface dataset and domain file
-
-#-- Specify input and output directories
-dir_output='/glade/scratch/'+myname+'/regional/'
-
-#-- Create regional CLM domain file
-create_domain = True
-#-- Create CLM surface data file
-create_surfdata = True
-#-- Create CLM surface data file
-create_landuse = False
-
-tagnum=1
-if tagnum == 1:
- tag='S.America'
-
- ln1=275.
- ln2=330.
- lt1=-40.
- lt2=15.
-
-if tagnum == 2:
- tag='Western.US'
-
- ln1=284.
- ln2=296.
- lt1=44.
- lt2=53.
-
-#-- Set time stamp
-command='date "+%y%m%d"'
-x2=subprocess.Popen(command,stdout=subprocess.PIPE,shell='True')
-x=x2.communicate()
-timetag = x[0].strip()
-
-#-- Specify land domain file ---------------------------------
-fdomain = '/glade/p/cesmdata/cseg/inputdata/share/domains/domain.lnd.fv1.9x2.5_gx1v7.170518.nc'
-#fdomain2 = dir_output + 'domain.lnd.fv0.9x1.25_gx1v6.'+tag+'.090309.nc'
-fdomain2 = dir_output + 'domain.lnd.fv1.9x2.5_gx1v7.'+tag+'_170518.nc'
-
-#-- Specify surface data file --------------------------------
-fsurf = '/glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/surfdata_1.9x2.5_78pfts_CMIP6_simyr1850_c170824.nc'
-#fsurf2 = dir_output + 'surfdata_0.9x1.25_16pfts_CMIP6_simyr2000_'+tag+'.c170706.nc'
-fsurf2 = dir_output + 'surfdata_1.9x2.5_78pfts_CMIP6_simyr1850_'+tag+'_c170824.nc'
-
-#-- Specify landuse file -------------------------------------
-fluse = '/glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc'
-fluse2 = dir_output + 'landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_'+tag+'.c170824.nc'
-
-#-- Create CTSM domain file
-if create_domain:
- f1 = xr.open_dataset(fdomain)
- # create 1d coordinate variables to enable sel() method
- lon0=np.asarray(f1['xc'][0,:])
- lat0=np.asarray(f1['yc'][:,0])
- lon=xr.DataArray(lon0,name='lon',dims='ni',coords={'ni':lon0})
- lat=xr.DataArray(lat0,name='lat',dims='nj',coords={'nj':lat0})
- # assign() not working on cheyenne
- #f2=f1.assign({'lon':lon,'lat':lat})
- f2=f1.assign()
- f2['lon'] = lon
- f2['lat'] = lat
- f2.reset_coords(['xc','yc'],inplace=True)
-
- # subset longitude and latitude arrays
- xind=np.where((lon >= ln1) & (lon <= ln2))[0]
- yind=np.where((lat >= lt1) & (lat <= lt2))[0]
- f3=f2.isel(nj=yind,ni=xind)
-
- wfile=fdomain2
- # mode 'w' overwrites file
- f3.to_netcdf(path=wfile, mode='w')
- mprint('created file '+fdomain2)
- f1.close(); f2.close(); f3.close()
-
-#-- Create CTSM surface data file
-if create_surfdata:
- f1 = xr.open_dataset(fsurf)
- # create 1d variables
- lon0=np.asarray(f1['LONGXY'][0,:])
- lon=xr.DataArray(lon0,name='lon',dims='lsmlon',coords={'lsmlon':lon0})
- lat0=np.asarray(f1['LATIXY'][:,0])
- lat=xr.DataArray(lat0,name='lat',dims='lsmlat',coords={'lsmlat':lat0})
- #f2=f1.assign({'lon':lon,'lat':lat})
- f2=f1.assign()
- f2['lon'] = lon
- f2['lat'] = lat
- # subset longitude and latitude arrays
- xind=np.where((lon >= ln1) & (lon <= ln2))[0]
- yind=np.where((lat >= lt1) & (lat <= lt2))[0]
- f3=f2.isel(lsmlat=yind,lsmlon=xind)
-
- # mode 'w' overwrites file
- f3.to_netcdf(path=fsurf2, mode='w')
- mprint('created file '+fsurf2)
- f1.close(); f2.close(); f3.close()
-
-#-- Create CTSM transient landuse data file
-if create_landuse:
- f1 = xr.open_dataset(fluse)
- # create 1d variables
- lon0=np.asarray(f1['LONGXY'][0,:])
- lon=xr.DataArray(lon0,name='lon',dims='lsmlon',coords={'lsmlon':lon0})
- lat0=np.asarray(f1['LATIXY'][:,0])
- lat=xr.DataArray(lat0,name='lat',dims='lsmlat',coords={'lsmlat':lat0})
- #f2=f1.assign({'lon':lon,'lat':lat})
- f2=f1.assign()
- f2['lon'] = lon
- f2['lat'] = lat
- # subset longitude and latitude arrays
- xind=np.where((lon >= ln1) & (lon <= ln2))[0]
- yind=np.where((lat >= lt1) & (lat <= lt2))[0]
- f3=f2.isel(lsmlat=yind,lsmlon=xind)
- # mode 'w' overwrites file
- f3.to_netcdf(path=fluse2, mode='w')
- mprint('created file '+fluse2)
- f1.close(); f2.close(); f3.close()
-
-
-
diff --git a/tools/mkmapdata/README b/tools/mkmapdata/README
index f2a0b793db..00ec339380 100644
--- a/tools/mkmapdata/README
+++ b/tools/mkmapdata/README
@@ -5,6 +5,12 @@ SCRIP grid files to map from one grid to another. These mapping files
are used by either CLM or mksurfdata_map to regrid from one resolution
to another.
+We have generally moved to "nomask" grid and mapping files. These "nomask"
+files typically contain mask and frac equal to 1 everywhere. During remapping
+we now apply the source masks found in the raw datasets and ignore the
+masks found in the mapping files. Exception: we continue to use a masked
+grid file and mapping file to regrid the 1-km topography.
+
The script uses ESMF and requires that ESMF be built and the path
for ESMF binary files (using the program ESMF_RegridWeightGen)
be given as input to the script. You need to build at least
diff --git a/tools/mkmapdata/mkmapdata.sh b/tools/mkmapdata/mkmapdata.sh
index 747676cac7..f1287ab3ef 100755
--- a/tools/mkmapdata/mkmapdata.sh
+++ b/tools/mkmapdata/mkmapdata.sh
@@ -39,9 +39,24 @@ default_res="10x15"
#----------------------------------------------------------------------
# SET SOME DEFAULTS -- if not set via env variables outside
-if [ -z "$CSMDATA" ]; then
- CSMDATA=/glade/p/cesm/cseg/inputdata
-fi
+case $hostname in
+
+ ##cheyenne
+ cheyenne* | r* )
+ if [ -z "$CSMDATA" ]; then
+ CSMDATA=/glade/p/cesm/cseg/inputdata
+ fi
+ ;;
+
+ ##hobart/izumi/thorodin
+ hobart* | izumi* | thorodin* )
+ if [ -z "$CSMDATA" ]; then
+ CSMDATA=/fs/cgd/csm/inputdata
+ fi
+ ;;
+
+esac
+
#----------------------------------------------------------------------
# Usage subroutine
usage() {
@@ -269,22 +284,13 @@ fi
if [ "$phys" = "clm4_5" ]; then
grids=( \
- "0.5x0.5_AVHRR" \
- "0.25x0.25_MODIS" \
- "0.5x0.5_MODIS" \
- "3x3min_LandScan2004" \
- "3x3min_MODIS-wCsp" \
- "3x3min_USGS" \
+ "0.5x0.5_nomask" \
+ "0.25x0.25_nomask" \
+ "0.125x0.125_nomask" \
+ "3x3min_nomask" \
"5x5min_nomask" \
- "5x5min_IGBP-GSDP" \
- "5x5min_ISRIC-WISE" \
- "5x5min_ORNL-Soil" \
"10x10min_nomask" \
- "10x10min_IGBPmergeICESatGIS" \
- "3x3min_GLOBE-Gardner" \
- "3x3min_GLOBE-Gardner-mergeGIS" \
- "0.9x1.25_GRDC" \
- "360x720cru_cruncep" \
+ "0.9x1.25_nomask" \
"1km-merge-10min_HYDRO1K-merge-nomask" \
)
@@ -294,7 +300,13 @@ else
fi
# Set timestamp for names below
-CDATE="c"`date +%y%m%d`
+# The flag `-d "-0 days"` can serve as a time saver as follows:
+# If the script aborted without creating all of the map_ files and
+# the user resubmits to create the remaining files on the next day,
+# the user could change -0 to -1 to prevent the script from
+# duplicating files already generated the day before.
+#
+CDATE="c"`date -d "-0 days" +%y%m%d`
# Set name of each output mapping file
# First determine the name of the input scrip grid file
@@ -351,13 +363,12 @@ case $hostname in
if [ interactive = "YES" ]; then
REGRID_PROC=1
fi
- esmfvers=8.0.0
- intelvers=19.0.5
+ esmfvers=8.2.0.b06
+ intelvers=19.1.1
module purge
module load intel/$intelvers
- module load esmf_libs
- module load esmf_libs/$esmfvers
- module load ncl
+# module load esmf_libs
+# module load esmf_libs/$esmfvers
module load nco
if [[ $REGRID_PROC > 1 ]]; then
@@ -366,7 +377,9 @@ case $hostname in
else
mpi=uni
fi
- module load esmf-${esmfvers}-ncdfio-${mpi}-O
+# module load esmf-${esmfvers}-ncdfio-${mpi}-O
+ module use /glade/p/cesmdata/cseg/PROGS/modulefiles/esmfpkgs/intel/$intelvers
+ module load esmf-${esmfvers}-ncdfio-mpt-g
if [ -z "$ESMFBIN_PATH" ]; then
ESMFBIN_PATH=`grep ESMF_APPSDIR $ESMFMKFILE | awk -F= '{print $2}'`
fi
@@ -393,7 +406,6 @@ case $hostname in
echo "Error doing module load: intel/$intelvers"
exit 1
fi
- module load ncl
module load nco
module load netcdf
module load ncarcompilers
@@ -549,14 +561,6 @@ until ((nfile>${#INGRID[*]})); do
runcmd "ncatted -a history,global,a,c,"$history" ${OUTFILE[nfile]}"
runcmd "ncatted -a hostname,global,a,c,$HOST -h ${OUTFILE[nfile]}"
runcmd "ncatted -a logname,global,a,c,$LOGNAME -h ${OUTFILE[nfile]}"
-
- # check for duplicate mapping weights
- newfile="rmdups_${OUTFILE[nfile]}"
- runcmd "rm -f $newfile"
- runcmd "env MAPFILE=${OUTFILE[nfile]} NEWMAPFILE=$newfile ncl $dir/rmdups.ncl"
- if [ -f "$newfile" ]; then
- runcmd "mv $newfile ${OUTFILE[nfile]}"
- fi
fi
nfile=nfile+1
diff --git a/tools/mkmapdata/regridbatch.sh b/tools/mkmapdata/regridbatch.sh
index 7f266d4b66..8b56f2dc7d 100755
--- a/tools/mkmapdata/regridbatch.sh
+++ b/tools/mkmapdata/regridbatch.sh
@@ -81,22 +81,19 @@ for res in $resols; do
echo "regional"
# For regional and (especially) single-point grids, we can get
# errors when trying to use multiple processors - so just use 1.
- # We also do NOT set batch mode in this case, because some
- # machines (e.g., yellowstone) do not listen to REGRID_PROC, so to
- # get a single processor, we need to run mkmapdata.sh in
- # interactive mode.
regrid_num_proc=1
else
echo "global"
regrid_num_proc=8
- if [ ! -z "$LSFUSER" ]; then
- echo "batch"
- cmdargs="$cmdargs -b"
- fi
- if [ ! -z "$PBS_O_WORKDIR" ]; then
- cd $PBS_O_WORKDIR
- cmdargs="$cmdargs -b"
- fi
+ fi
+
+ if [ ! -z "$LSFUSER" ]; then
+ echo "batch"
+ cmdargs="$cmdargs -b"
+ fi
+ if [ ! -z "$PBS_O_WORKDIR" ]; then
+ cd $PBS_O_WORKDIR
+ cmdargs="$cmdargs -b"
fi
echo "args: $cmdargs"
diff --git a/tools/mksurfdata_map/mksurfdata.pl b/tools/mksurfdata_map/mksurfdata.pl
index 7f4a50efaf..f9961c7f9e 100755
--- a/tools/mksurfdata_map/mksurfdata.pl
+++ b/tools/mksurfdata_map/mksurfdata.pl
@@ -316,7 +316,7 @@ sub write_transient_timeseries_file {
sub write_namelist_file {
my ($namelist_fname, $logfile_fname, $fsurdat_fname, $fdyndat_fname,
- $glc_nec, $griddata, $map, $datfil, $double,
+ $glc_nec, $griddata, $gridtype, $map, $datfil, $double,
$all_urb, $no_inlandwet, $vegtyp, $hrvtyp,
$landuse_timeseries_text_file, $setnumpft) = @_;
@@ -329,6 +329,7 @@ sub write_namelist_file {
&clmexp
nglcec = $glc_nec
mksrf_fgrid = '$griddata'
+ mksrf_gridtype = '$gridtype'
map_fpft = '$map->{'veg'}'
map_fglacier = '$map->{'glc'}'
map_fglacierregion = '$map->{'glcregion'}'
@@ -824,9 +825,18 @@ sub write_namelist_file {
print "resolution: $res ssp_rcp=$ssp_rcp sim_year = $sim_year\n";
print "namelist: $namelist_fname\n";
+ my $gridtype;
+ $gridtype = "global";
+ if (index($res, '1x1_') != -1) {
+ $gridtype = "regional";
+ }
+ if (index($res, '5x5_amazon') != -1) {
+ $gridtype = "regional";
+ }
+
write_namelist_file(
$namelist_fname, $logfile_fname, $fsurdat_fname, $fdyndat_fname,
- $glc_nec, $griddata, \%map, \%datfil, $double,
+ $glc_nec, $griddata, $gridtype, \%map, \%datfil, $double,
$all_urb, $no_inlandwet, $vegtyp, $hrvtyp,
$landuse_timeseries_text_file, $setnumpft);
diff --git a/tools/mksurfdata_map/mksurfdata_map.namelist b/tools/mksurfdata_map/mksurfdata_map.namelist
index 8a3b697758..2c6180f156 100644
--- a/tools/mksurfdata_map/mksurfdata_map.namelist
+++ b/tools/mksurfdata_map/mksurfdata_map.namelist
@@ -1,43 +1,43 @@
&clmexp
nglcec = 10
- mksrf_fgrid = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.25x0.25_MODIS_to_10x15_nomask_aave_da_c170321.nc'
- map_fpft = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.25x0.25_MODIS_to_10x15_nomask_aave_da_c170321.nc'
- map_fglacier = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_3x3min_GLOBE-Gardner_to_10x15_nomask_aave_da_c120923.nc'
- map_fglacierregion = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_10minx10min_topo_to_10x15_aave_da_110307.nc'
- map_fsoicol = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.25x0.25_MODIS_to_10x15_nomask_aave_da_c170321.nc'
- map_furban = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_3x3min_LandScan2004_to_10x15_nomask_aave_da_c120518.nc'
- map_fmax = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_3x3min_USGS_to_10x15_nomask_aave_da_c120926.nc'
- map_forganic = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_5x5min_ISRIC-WISE_to_10x15_nomask_aave_da_c111115.nc'
- map_flai = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.25x0.25_MODIS_to_10x15_nomask_aave_da_c170321.nc'
- map_fharvest = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.25x0.25_MODIS_to_10x15_nomask_aave_da_c170321.nc'
- map_flakwat = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_3x3min_MODIS-wCsp_to_10x15_nomask_aave_da_c160425.nc'
- map_fwetlnd = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_lanwat_to_10x15_aave_da_110307.nc'
- map_fvocef = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_lanwat_to_10x15_aave_da_110307.nc'
- map_fsoitex = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_5minx5min_soitex_to_10x15_aave_da_110307.nc'
- map_furbtopo = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_10minx10min_topo_to_10x15_aave_da_110307.nc'
- map_fgdp = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_lanwat_to_10x15_aave_da_110307.nc'
- map_fpeat = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_lanwat_to_10x15_aave_da_110307.nc'
- map_fsoildepth = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_5x5min_ISRIC-WISE_to_10x15_nomask_aave_da_c111115.nc'
- map_fabm = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_lanwat_to_10x15_aave_da_110307.nc'
+ mksrf_fgrid = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.25x0.25_nomask_to_10x15_nomask_aave_da_c200309.nc'
+ map_fpft = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.25x0.25_nomask_to_10x15_nomask_aave_da_c200309.nc'
+ map_fglacier = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_3x3min_nomask_to_10x15_nomask_aave_da_c200309.nc'
+ map_fglacierregion = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_10x10min_nomask_to_10x15_nomask_aave_da_c200206.nc'
+ map_fsoicol = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.25x0.25_nomask_to_10x15_nomask_aave_da_c200309.nc'
+ map_furban = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_3x3min_nomask_to_10x15_nomask_aave_da_c200309.nc'
+ map_fmax = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.125x0.125_nomask_to_10x15_nomask_aave_da_c200206.nc'
+ map_forganic = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_5x5min_nomask_to_10x15_nomask_aave_da_c200309.nc'
+ map_flai = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.25x0.25_nomask_to_10x15_nomask_aave_da_c200309.nc'
+ map_fharvest = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.25x0.25_nomask_to_10x15_nomask_aave_da_c200309.nc'
+ map_flakwat = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_3x3min_nomask_to_10x15_nomask_aave_da_c200309.nc'
+ map_fwetlnd = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_nomask_to_10x15_nomask_aave_da_c200206.nc'
+ map_fvocef = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_nomask_to_10x15_nomask_aave_da_c200206.nc'
+ map_fsoitex = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_5x5min_nomask_to_10x15_nomask_aave_da_c200309.nc'
+ map_furbtopo = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_10x10min_nomask_to_10x15_nomask_aave_da_c200206.nc'
+ map_fgdp = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_nomask_to_10x15_nomask_aave_da_c200206.nc'
+ map_fpeat = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_nomask_to_10x15_nomask_aave_da_c200206.nc'
+ map_fsoildepth = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_5x5min_nomask_to_10x15_nomask_aave_da_c200309.nc'
+ map_fabm = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_nomask_to_10x15_nomask_aave_da_c200206.nc'
map_ftopostats = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_1km-merge-10min_HYDRO1K-merge-nomask_to_10x15_nomask_aave_da_c130411.nc'
- map_fvic = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.9x1.25_GRDC_to_10x15_nomask_aave_da_c130308.nc'
- map_fch4 = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_360x720_cruncep_to_10x15_nomask_aave_da_c130326.nc'
+ map_fvic = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.9x1.25_nomask_to_10x15_nomask_aave_da_c200206.nc'
+ map_fch4 = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_nomask_to_10x15_nomask_aave_da_c200206.nc'
mksrf_fsoitex = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_soitex.10level.c010119.nc'
mksrf_forganic = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_organic_10level_5x5min_ISRIC-WISE-NCSCD_nlev7_c120830.nc'
mksrf_flakwat = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_LakePnDepth_3x3min_simyr2004_csplk_c151015.nc'
mksrf_fwetlnd = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_lanwat.050425.nc'
- mksrf_fmax = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_fmax_3x3min_USGS_c120911.nc'
+ mksrf_fmax = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_fmax_0.125x0.125_c200220.nc'
mksrf_fglacier = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_glacier_3x3min_simyr2000.c120926.nc'
- mksrf_fglacierregion = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_GlacierRegion_10x10min_nomask_c170616.nc'
+ mksrf_fglacierregion = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_GlacierRegion_10x10min_nomask_c191120.nc'
mksrf_fvocef = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_vocef_0.5x0.5_simyr2000.c110531.nc'
- mksrf_furbtopo = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_topo.10min.c080912.nc'
+ mksrf_furbtopo = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_topo.10min.c191120.nc'
mksrf_fgdp = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_gdp_0.5x0.5_AVHRR_simyr2000.c130228.nc'
mksrf_fpeat = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_peatf_0.5x0.5_AVHRR_simyr2000.c130228.nc'
- mksrf_fsoildepth = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksf_soilthk_5x5min_ORNL_SOILS_simyr1900-2015_c150701.nc'
+ mksrf_fsoildepth = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksf_soilthk_5x5min_ORNL-Soil_simyr1900-2015_c170630.nc'
mksrf_fabm = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_abm_0.5x0.5_AVHRR_simyr2000.c130201.nc'
mksrf_ftopostats = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_topostats_1km-merge-10min_HYDRO1K-merge-nomask_simyr2000.c130402.nc'
mksrf_fvic = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_vic_0.9x1.25_GRDC_simyr2000.c130307.nc'
- mksrf_fch4 = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_ch4inversion_360x720_cruncep_simyr2000.c130322.nc'
+ mksrf_fch4 = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_ch4inversion_0.5x0.5_cruncep_simyr2000.c191112.nc'
outnc_double = .true.
all_urban = .false.
no_inlandwet = .true.
diff --git a/tools/mksurfdata_map/src/mkVICparamsMod.F90 b/tools/mksurfdata_map/src/mkVICparamsMod.F90
index aa73f05ad5..f7cb4946c6 100644
--- a/tools/mksurfdata_map/src/mkVICparamsMod.F90
+++ b/tools/mksurfdata_map/src/mkVICparamsMod.F90
@@ -73,6 +73,8 @@ subroutine mkVICparams(ldomain, mapfname, datfname, ndiag, &
type(gridmap_type) :: tgridmap
type(domain_type) :: tdomain ! local domain
real(r8), allocatable :: data_i(:) ! data on input grid
+ real(r8), allocatable :: frac_dst(:) ! output fractions
+ real(r8), allocatable :: mask_r8(:) ! float of tdomain%mask
integer :: ncid,varid ! input netCDF id's
integer :: ier ! error status
@@ -94,7 +96,16 @@ subroutine mkVICparams(ldomain, mapfname, datfname, ndiag, &
call domain_read(tdomain,datfname)
call gridmap_mapread(tgridmap, mapfname )
- call gridmap_check( tgridmap, subname )
+
+ ! Obtain frac_dst
+ allocate(frac_dst(ldomain%ns), stat=ier)
+ if (ier/=0) call abort()
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
+ allocate(mask_r8(tdomain%ns), stat=ier)
+ if (ier/=0) call abort()
+ mask_r8 = tdomain%mask
+ call gridmap_check( tgridmap, mask_r8, frac_dst, subname )
call domain_checksame( tdomain, ldomain, tgridmap )
@@ -114,14 +125,14 @@ subroutine mkVICparams(ldomain, mapfname, datfname, ndiag, &
call check_ret(nf_inq_varid (ncid, 'binfl', varid), subname)
call check_ret(nf_get_var_double (ncid, varid, data_i), subname)
- call gridmap_areaave(tgridmap, data_i, binfl_o, nodata=0.1_r8)
+ call gridmap_areaave_srcmask(tgridmap, data_i, binfl_o, nodata=0.1_r8, mask_src=tdomain%mask, frac_dst=frac_dst)
! Check validity of output data
if (min_bad(binfl_o, min_valid_binfl, 'binfl')) then
stop
end if
- call output_diagnostics_continuous(data_i, binfl_o, tgridmap, "VIC b parameter", "unitless", ndiag)
+ call output_diagnostics_continuous(data_i, binfl_o, tgridmap, "VIC b parameter", "unitless", ndiag, tdomain%mask, frac_dst)
! -----------------------------------------------------------------
! Regrid Ws
@@ -129,14 +140,14 @@ subroutine mkVICparams(ldomain, mapfname, datfname, ndiag, &
call check_ret(nf_inq_varid (ncid, 'Ws', varid), subname)
call check_ret(nf_get_var_double (ncid, varid, data_i), subname)
- call gridmap_areaave(tgridmap, data_i, ws_o, nodata=0.75_r8)
+ call gridmap_areaave_srcmask(tgridmap, data_i, ws_o, nodata=0.75_r8, mask_src=tdomain%mask, frac_dst=frac_dst)
! Check validity of output data
if (min_bad(ws_o, min_valid_ws, 'Ws')) then
stop
end if
- call output_diagnostics_continuous(data_i, ws_o, tgridmap, "VIC Ws parameter", "unitless", ndiag)
+ call output_diagnostics_continuous(data_i, ws_o, tgridmap, "VIC Ws parameter", "unitless", ndiag, tdomain%mask, frac_dst)
! -----------------------------------------------------------------
! Regrid Dsmax
@@ -144,14 +155,14 @@ subroutine mkVICparams(ldomain, mapfname, datfname, ndiag, &
call check_ret(nf_inq_varid (ncid, 'Dsmax', varid), subname)
call check_ret(nf_get_var_double (ncid, varid, data_i), subname)
- call gridmap_areaave(tgridmap, data_i, dsmax_o, nodata=10._r8)
+ call gridmap_areaave_srcmask(tgridmap, data_i, dsmax_o, nodata=10._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
! Check validity of output data
if (min_bad(dsmax_o, min_valid_dsmax, 'Dsmax')) then
stop
end if
- call output_diagnostics_continuous(data_i, dsmax_o, tgridmap, "VIC Dsmax parameter", "mm/day", ndiag)
+ call output_diagnostics_continuous(data_i, dsmax_o, tgridmap, "VIC Dsmax parameter", "mm/day", ndiag, tdomain%mask, frac_dst)
! -----------------------------------------------------------------
! Regrid Ds
@@ -159,14 +170,14 @@ subroutine mkVICparams(ldomain, mapfname, datfname, ndiag, &
call check_ret(nf_inq_varid (ncid, 'Ds', varid), subname)
call check_ret(nf_get_var_double (ncid, varid, data_i), subname)
- call gridmap_areaave(tgridmap, data_i, ds_o, nodata=0.1_r8)
+ call gridmap_areaave_srcmask(tgridmap, data_i, ds_o, nodata=0.1_r8, mask_src=tdomain%mask, frac_dst=frac_dst)
! Check validity of output data
if (min_bad(ds_o, min_valid_ds, 'Ds')) then
stop
end if
- call output_diagnostics_continuous(data_i, ds_o, tgridmap, "VIC Ds parameter", "unitless", ndiag)
+ call output_diagnostics_continuous(data_i, ds_o, tgridmap, "VIC Ds parameter", "unitless", ndiag, tdomain%mask, frac_dst)
! -----------------------------------------------------------------
! Close files and deallocate dynamic memory
@@ -176,6 +187,8 @@ subroutine mkVICparams(ldomain, mapfname, datfname, ndiag, &
call domain_clean(tdomain)
call gridmap_clean(tgridmap)
deallocate (data_i)
+ deallocate (frac_dst)
+ deallocate (mask_r8)
write (6,*) 'Successfully made VIC parameters'
write (6,*)
diff --git a/tools/mksurfdata_map/src/mkagfirepkmonthMod.F90 b/tools/mksurfdata_map/src/mkagfirepkmonthMod.F90
index cdfc081356..af8001263f 100644
--- a/tools/mksurfdata_map/src/mkagfirepkmonthMod.F90
+++ b/tools/mksurfdata_map/src/mkagfirepkmonthMod.F90
@@ -81,6 +81,8 @@ subroutine mkagfirepkmon(ldomain, mapfname, datfname, ndiag, &
type(domain_type) :: tdomain ! local domain
real(r8), allocatable :: gast_i(:) ! global area, by surface type
real(r8), allocatable :: gast_o(:) ! global area, by surface type
+ real(r8), allocatable :: frac_dst(:) ! output fractions
+ real(r8), allocatable :: mask_r8(:) ! float of tdomain%mask
integer , allocatable :: agfirepkmon_i(:) ! input grid: agricultural fire peak month
integer :: nagfirepkmon ! number of peak months
character(len=35), allocatable :: month(:)! name of each month
@@ -104,12 +106,20 @@ subroutine mkagfirepkmon(ldomain, mapfname, datfname, ndiag, &
call domain_read( tdomain,datfname )
call gridmap_mapread( tgridmap, mapfname )
- call gridmap_check( tgridmap, subname )
- call domain_checksame( tdomain, ldomain, tgridmap )
+ ! Obtain frac_dst
+ ns_o = ldomain%ns
+ allocate(frac_dst(ns_o), stat=ier)
+ if (ier/=0) call abort()
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
ns_i = tdomain%ns
- ns_o = ldomain%ns
+ allocate(mask_r8(ns_i), stat=ier)
+ if (ier/=0) call abort()
+ mask_r8 = tdomain%mask
+ call gridmap_check( tgridmap, mask_r8, frac_dst, subname )
+
+ call domain_checksame( tdomain, ldomain, tgridmap )
! -----------------------------------------------------------------
! Open input file, allocate memory for input data
@@ -130,7 +140,7 @@ subroutine mkagfirepkmon(ldomain, mapfname, datfname, ndiag, &
! Note that any input point that is outside the range [min_valid_value,max_valid_value]
! will be ignored; this ignores input points with value of unsetmon
call get_dominant_indices(tgridmap, agfirepkmon_i, agfirepkmon_o, &
- min_valid_value, max_valid_value, miss)
+ min_valid_value, max_valid_value, miss, mask_src=tdomain%mask)
! Check validity of output data
if (min_bad(agfirepkmon_o, min_valid, 'agfirepkmon') .or. &
@@ -158,13 +168,13 @@ subroutine mkagfirepkmon(ldomain, mapfname, datfname, ndiag, &
gast_i(:) = 0.0_r8
do ni = 1,ns_i
k = agfirepkmon_i(ni)
- gast_i(k) = gast_i(k) + tgridmap%area_src(ni)*tgridmap%frac_src(ni)*re**2
+ gast_i(k) = gast_i(k) + tgridmap%area_src(ni)*tdomain%mask(ni)*re**2
end do
gast_o(:) = 0.0_r8
do no = 1,ns_o
k = agfirepkmon_o(no)
- gast_o(k) = gast_o(k) + tgridmap%area_dst(no)*tgridmap%frac_dst(no)*re**2
+ gast_o(k) = gast_o(k) + tgridmap%area_dst(no)*frac_dst(no)*re**2
end do
! area comparison
@@ -194,7 +204,7 @@ subroutine mkagfirepkmon(ldomain, mapfname, datfname, ndiag, &
call check_ret(nf_close(ncid), subname)
call domain_clean(tdomain)
call gridmap_clean(tgridmap)
- deallocate (agfirepkmon_i,gast_i,gast_o,month)
+ deallocate (agfirepkmon_i,gast_i,gast_o,month, frac_dst, mask_r8)
write (6,*) 'Successfully made Agricultural fire peak month'
write (6,*)
diff --git a/tools/mksurfdata_map/src/mkdiagnosticsMod.F90 b/tools/mksurfdata_map/src/mkdiagnosticsMod.F90
index 97fbae76d6..a53d9ca4d2 100644
--- a/tools/mksurfdata_map/src/mkdiagnosticsMod.F90
+++ b/tools/mksurfdata_map/src/mkdiagnosticsMod.F90
@@ -34,7 +34,7 @@ module mkdiagnosticsMod
! !IROUTINE: output_diagnostics_area
!
! !INTERFACE:
-subroutine output_diagnostics_area(data_i, data_o, gridmap, name, percent, ndiag)
+subroutine output_diagnostics_area(data_i, data_o, gridmap, name, percent, ndiag, mask_src, frac_dst)
!
! !DESCRIPTION:
! Output diagnostics for a field that gives either fraction or percent of grid cell area
@@ -51,6 +51,8 @@ subroutine output_diagnostics_area(data_i, data_o, gridmap, name, percent, ndiag
character(len=*) , intent(in) :: name ! name of field
logical , intent(in) :: percent ! is field specified as percent? (alternative is fraction)
integer , intent(in) :: ndiag ! unit number for diagnostic output
+ integer, intent(in) :: mask_src(:)
+ real(r8), intent(in) :: frac_dst(:)
!
! !REVISION HISTORY:
! Author: Bill Sacks
@@ -81,6 +83,18 @@ subroutine output_diagnostics_area(data_i, data_o, gridmap, name, percent, ndiag
write(6,*) 'ns_o = ', ns_o
stop
end if
+ if (size(frac_dst) /= ns_o) then
+ write(6,*) subname//' ERROR: incorrect size of frac_dst'
+ write(6,*) 'size(frac_dst) = ', size(frac_dst)
+ write(6,*) 'ns_o = ', ns_o
+ call abort()
+ end if
+ if (size(mask_src) /= ns_i) then
+ write(6,*) subname//' ERROR: incorrect size of mask_src'
+ write(6,*) 'size(mask_src) = ', size(mask_src)
+ write(6,*) 'ns_i = ', ns_i
+ call abort()
+ end if
! Sums on input grid
@@ -88,7 +102,7 @@ subroutine output_diagnostics_area(data_i, data_o, gridmap, name, percent, ndiag
garea_i = 0.
do ni = 1,ns_i
garea_i = garea_i + gridmap%area_src(ni)*re**2
- gdata_i = gdata_i + data_i(ni)*gridmap%area_src(ni)*gridmap%frac_src(ni)*re**2
+ gdata_i = gdata_i + data_i(ni) * gridmap%area_src(ni) * mask_src(ni) * re**2
end do
! Sums on output grid
@@ -97,7 +111,7 @@ subroutine output_diagnostics_area(data_i, data_o, gridmap, name, percent, ndiag
garea_o = 0.
do no = 1,ns_o
garea_o = garea_o + gridmap%area_dst(no)*re**2
- gdata_o = gdata_o + data_o(no)*gridmap%area_dst(no)*gridmap%frac_dst(no)*re**2
+ gdata_o = gdata_o + data_o(no) * gridmap%area_dst(no) * frac_dst(no) * re**2
end do
! Correct units
@@ -134,7 +148,7 @@ end subroutine output_diagnostics_area
! !IROUTINE: output_diagnostics_continuous
!
! !INTERFACE:
-subroutine output_diagnostics_continuous(data_i, data_o, gridmap, name, units, ndiag)
+subroutine output_diagnostics_continuous(data_i, data_o, gridmap, name, units, ndiag, mask_src, frac_dst)
!
! !DESCRIPTION:
! Output diagnostics for a continuous field (but not area, for which there is a different routine)
@@ -151,6 +165,8 @@ subroutine output_diagnostics_continuous(data_i, data_o, gridmap, name, units, n
character(len=*) , intent(in) :: name ! name of field
character(len=*) , intent(in) :: units ! units of field
integer , intent(in) :: ndiag ! unit number for diagnostic output
+ integer, intent(in) :: mask_src(:)
+ real(r8), intent(in) :: frac_dst(:)
!
! !REVISION HISTORY:
! Author: Bill Sacks
@@ -181,14 +197,26 @@ subroutine output_diagnostics_continuous(data_i, data_o, gridmap, name, units, n
write(6,*) 'ns_o = ', ns_o
stop
end if
+ if (size(frac_dst) /= ns_o) then
+ write(6,*) subname//' ERROR: incorrect size of frac_dst'
+ write(6,*) 'size(frac_dst) = ', size(frac_dst)
+ write(6,*) 'ns_o = ', ns_o
+ call abort()
+ end if
+ if (size(mask_src) /= ns_i) then
+ write(6,*) subname//' ERROR: incorrect size of mask_src'
+ write(6,*) 'size(mask_src) = ', size(mask_src)
+ write(6,*) 'ns_i = ', ns_i
+ call abort()
+ end if
! Sums on input grid
gdata_i = 0.
gwt_i = 0.
do ni = 1,ns_i
- gdata_i = gdata_i + data_i(ni)*gridmap%area_src(ni)*gridmap%frac_src(ni)
- gwt_i = gwt_i + gridmap%area_src(ni)*gridmap%frac_src(ni)
+ gdata_i = gdata_i + data_i(ni) * gridmap%area_src(ni) * mask_src(ni)
+ gwt_i = gwt_i + gridmap%area_src(ni) * mask_src(ni)
end do
! Sums on output grid
@@ -196,8 +224,8 @@ subroutine output_diagnostics_continuous(data_i, data_o, gridmap, name, units, n
gdata_o = 0.
gwt_o = 0.
do no = 1,ns_o
- gdata_o = gdata_o + data_o(no)*gridmap%area_dst(no)*gridmap%frac_dst(no)
- gwt_o = gwt_o + gridmap%area_dst(no)*gridmap%frac_dst(no)
+ gdata_o = gdata_o + data_o(no) * gridmap%area_dst(no) * frac_dst(no)
+ gwt_o = gwt_o + gridmap%area_dst(no) * frac_dst(no)
end do
! Correct units
@@ -311,7 +339,7 @@ end subroutine output_diagnostics_continuous_outonly
!-----------------------------------------------------------------------
subroutine output_diagnostics_index(data_i, data_o, gridmap, name, &
- minval, maxval, ndiag)
+ minval, maxval, ndiag, mask_src, frac_dst)
!
! !DESCRIPTION:
! Output diagnostics for an index field: area of each index in input and output
@@ -328,6 +356,8 @@ subroutine output_diagnostics_index(data_i, data_o, gridmap, name, &
integer , intent(in) :: minval ! minimum valid value
integer , intent(in) :: maxval ! minimum valid value
integer , intent(in) :: ndiag ! unit number for diagnostic output
+ integer , intent(in) :: mask_src(:)
+ real(r8) , intent(in) :: frac_dst(:)
!
! !LOCAL VARIABLES:
integer :: ns_i, ns_o ! sizes of input & output grids
@@ -352,6 +382,18 @@ subroutine output_diagnostics_index(data_i, data_o, gridmap, name, &
write(6,*) 'ns_o = ', ns_o
stop
end if
+ if (size(frac_dst) /= ns_o) then
+ write(6,*) subname//' ERROR: incorrect size of frac_dst'
+ write(6,*) 'size(frac_dst) = ', size(frac_dst)
+ write(6,*) 'ns_o = ', ns_o
+ call abort()
+ end if
+ if (size(mask_src) /= ns_i) then
+ write(6,*) subname//' ERROR: incorrect size of mask_src'
+ write(6,*) 'size(mask_src) = ', size(mask_src)
+ write(6,*) 'ns_i = ', ns_i
+ call abort()
+ end if
! Sum areas on input grid
@@ -362,7 +404,7 @@ subroutine output_diagnostics_index(data_i, data_o, gridmap, name, &
do ni = 1, ns_i
k = data_i(ni)
if (k >= minval .and. k <= maxval) then
- garea_i(k) = garea_i(k) + gridmap%area_src(ni)*gridmap%frac_src(ni)*re**2
+ garea_i(k) = garea_i(k) + gridmap%area_src(ni) * mask_src(ni) * re**2
end if
end do
@@ -375,7 +417,7 @@ subroutine output_diagnostics_index(data_i, data_o, gridmap, name, &
do no = 1, ns_o
k = data_o(no)
if (k >= minval .and. k <= maxval) then
- garea_o(k) = garea_o(k) + gridmap%area_dst(no)*gridmap%frac_dst(no)*re**2
+ garea_o(k) = garea_o(k) + gridmap%area_dst(no) * frac_dst(no) * re**2
end if
end do
diff --git a/tools/mksurfdata_map/src/mkdomainMod.F90 b/tools/mksurfdata_map/src/mkdomainMod.F90
index 1a66c0f4c5..84865458b0 100644
--- a/tools/mksurfdata_map/src/mkdomainMod.F90
+++ b/tools/mksurfdata_map/src/mkdomainMod.F90
@@ -322,9 +322,6 @@ logical function domain_read_map(domain, fname)
call check_ret(nf_inq_varid (ncid, 'frac_b', varid), subname)
call check_ret(nf_get_var_double (ncid, varid, domain%frac), subname)
- call check_ret(nf_inq_varid (ncid, 'mask_b', varid), subname)
- call check_ret(nf_get_var_int (ncid, varid, domain%mask), subname)
-
call check_ret(nf_inq_varid (ncid, 'area_b', varid), subname)
call check_ret(nf_get_var_double (ncid, varid, domain%area), subname)
domain%area = domain%area * re**2
@@ -818,13 +815,9 @@ subroutine domain_checksame( srcdomain, dstdomain, tgridmap )
integer :: n, ni ! indices
real(r8), pointer :: xc_src(:) ! Source longitude
real(r8), pointer :: yc_src(:) ! Source latitude
- real(r8), pointer :: frac_src(:) ! Source fraction
- integer, pointer :: mask_src(:) ! Source mask
integer, pointer :: src_indx(:) ! Source index
real(r8), pointer :: xc_dst(:) ! Destination longitude
real(r8), pointer :: yc_dst(:) ! Destination latitude
- real(r8), pointer :: frac_dst(:) ! Destination fraction
- integer, pointer :: mask_dst(:) ! Destination mask
integer, pointer :: dst_indx(:) ! Destination index
character(len= 32) :: subname = 'domain_checksame'
@@ -839,7 +832,7 @@ subroutine domain_checksame( srcdomain, dstdomain, tgridmap )
write(6,*) trim(subname)//'ERROR: source domain is unset!'
call abort()
end if
- if (srcdomain%set == unset) then
+ if (dstdomain%set == unset) then
write(6,*) trim(subname)//'ERROR: destination domain is unset!'
call abort()
end if
@@ -847,7 +840,6 @@ subroutine domain_checksame( srcdomain, dstdomain, tgridmap )
call gridmap_setptrs( tgridmap, nsrc=na, ndst=nb, ns=ns, &
xc_src=xc_src, yc_src=yc_src, &
xc_dst=xc_dst, yc_dst=yc_dst, &
- mask_src=mask_src, mask_dst=mask_dst, &
src_indx=src_indx, dst_indx=dst_indx &
)
@@ -867,15 +859,6 @@ subroutine domain_checksame( srcdomain, dstdomain, tgridmap )
end if
do n = 1,ns
ni = src_indx(n)
- if ( srcdomain%maskset )then
- if (srcdomain%mask(ni) /= mask_src(ni)) then
- write(6,*) trim(subname)// &
- ' ERROR: input domain mask and gridmap mask are not the same at ni = ',ni
- write(6,*)' domain mask= ',srcdomain%mask(ni)
- write(6,*)' gridmap mask= ',mask_src(ni)
- call abort()
- end if
- end if
if (abs(srcdomain%lonc(ni) - xc_src(ni)) > eps) then
write(6,*) trim(subname)// &
' ERROR: input domain lon and gridmap lon not the same at ni = ',ni
@@ -893,15 +876,6 @@ subroutine domain_checksame( srcdomain, dstdomain, tgridmap )
end do
do n = 1,ns
ni = dst_indx(n)
- if ( dstdomain%maskset )then
- if (dstdomain%mask(ni) /= mask_dst(ni)) then
- write(6,*) trim(subname)// &
- ' ERROR: output domain mask and gridmap mask are not the same at ni = ',ni
- write(6,*)' domain mask= ',dstdomain%mask(ni)
- write(6,*)' gridmap mask= ',mask_dst(ni)
- call abort()
- end if
- end if
if (abs(dstdomain%lonc(ni) - xc_dst(ni)) > eps) then
write(6,*) trim(subname)// &
' ERROR: output domain lon and gridmap lon not the same at ni = ',ni
diff --git a/tools/mksurfdata_map/src/mkgdpMod.F90 b/tools/mksurfdata_map/src/mkgdpMod.F90
index 62e01d8135..6a560e61b5 100644
--- a/tools/mksurfdata_map/src/mkgdpMod.F90
+++ b/tools/mksurfdata_map/src/mkgdpMod.F90
@@ -69,6 +69,8 @@ subroutine mkgdp(ldomain, mapfname, datfname, ndiag, gdp_o)
type(gridmap_type) :: tgridmap
type(domain_type) :: tdomain ! local domain
real(r8), allocatable :: data_i(:) ! data on input grid
+ real(r8), allocatable :: frac_dst(:) ! output fractions
+ real(r8), allocatable :: mask_r8(:) ! float of tdomain%mask
integer :: ncid,varid ! input netCDF id's
integer :: ier ! error status
@@ -87,7 +89,16 @@ subroutine mkgdp(ldomain, mapfname, datfname, ndiag, gdp_o)
call domain_read(tdomain,datfname)
call gridmap_mapread(tgridmap, mapfname )
- call gridmap_check( tgridmap, subname )
+
+ ! Obtain frac_dst
+ allocate(frac_dst(ldomain%ns), stat=ier)
+ if (ier/=0) call abort()
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
+ allocate(mask_r8(tdomain%ns), stat=ier)
+ if (ier/=0) call abort()
+ mask_r8 = tdomain%mask
+ call gridmap_check( tgridmap, mask_r8, frac_dst, subname )
call domain_checksame( tdomain, ldomain, tgridmap )
@@ -107,14 +118,14 @@ subroutine mkgdp(ldomain, mapfname, datfname, ndiag, gdp_o)
call check_ret(nf_inq_varid (ncid, 'gdp', varid), subname)
call check_ret(nf_get_var_double (ncid, varid, data_i), subname)
- call gridmap_areaave(tgridmap, data_i, gdp_o, nodata=0._r8)
+ call gridmap_areaave_srcmask(tgridmap, data_i, gdp_o, nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
! Check validity of output data
if (min_bad(gdp_o, min_valid, 'gdp')) then
stop
end if
- call output_diagnostics_continuous(data_i, gdp_o, tgridmap, "GDP", "x1000 US$ per capita", ndiag)
+ call output_diagnostics_continuous(data_i, gdp_o, tgridmap, "GDP", "x1000 US$ per capita", ndiag, tdomain%mask, frac_dst)
! -----------------------------------------------------------------
! Close files and deallocate dynamic memory
@@ -124,6 +135,8 @@ subroutine mkgdp(ldomain, mapfname, datfname, ndiag, gdp_o)
call domain_clean(tdomain)
call gridmap_clean(tgridmap)
deallocate (data_i)
+ deallocate (frac_dst)
+ deallocate (mask_r8)
write (6,*) 'Successfully made GDP'
write (6,*)
diff --git a/tools/mksurfdata_map/src/mkglacierregionMod.F90 b/tools/mksurfdata_map/src/mkglacierregionMod.F90
index b9a36d8263..beae6a8d97 100644
--- a/tools/mksurfdata_map/src/mkglacierregionMod.F90
+++ b/tools/mksurfdata_map/src/mkglacierregionMod.F90
@@ -14,6 +14,7 @@ module mkglacierregionMod
!-----------------------------------------------------------------------
!
! !USES:
+ use shr_kind_mod, only : r8 => shr_kind_r8
use shr_sys_mod , only : shr_sys_flush
implicit none
@@ -55,6 +56,8 @@ subroutine mkglacierregion(ldomain, mapfname, datfname, ndiag, &
type(gridmap_type) :: tgridmap
type(domain_type) :: tdomain ! local domain
integer, allocatable :: glacier_region_i(:) ! glacier region on input grid
+ real(r8), allocatable :: frac_dst(:) ! output fractions
+ real(r8), allocatable :: mask_r8(:) ! float of tdomain%mask
integer :: ncid,varid ! input netCDF id's
integer :: ier ! error status
integer :: max_region ! max region ID
@@ -72,7 +75,16 @@ subroutine mkglacierregion(ldomain, mapfname, datfname, ndiag, &
call domain_read(tdomain, datfname)
call gridmap_mapread(tgridmap, mapfname)
- call gridmap_check(tgridmap, subname)
+
+ ! Obtain frac_dst
+ allocate(frac_dst(ldomain%ns), stat=ier)
+ if (ier/=0) call abort()
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
+ allocate(mask_r8(tdomain%ns), stat=ier)
+ if (ier/=0) call abort()
+ mask_r8 = tdomain%mask
+ call gridmap_check(tgridmap, mask_r8, frac_dst, subname)
call domain_checksame(tdomain, ldomain, tgridmap)
@@ -100,11 +112,12 @@ subroutine mkglacierregion(ldomain, mapfname, datfname, ndiag, &
gridmap = tgridmap, &
src_array = glacier_region_i, &
dst_array = glacier_region_o, &
- nodata = 0)
+ nodata = 0, &
+ mask_src = tdomain%mask)
max_region = maxval(glacier_region_i)
call output_diagnostics_index(glacier_region_i, glacier_region_o, tgridmap, &
- 'Glacier Region ID', 0, max_region, ndiag)
+ 'Glacier Region ID', 0, max_region, ndiag, mask_src=tdomain%mask, frac_dst=frac_dst)
! ------------------------------------------------------------------------
! Deallocate dynamic memory & other clean up
@@ -114,6 +127,8 @@ subroutine mkglacierregion(ldomain, mapfname, datfname, ndiag, &
call domain_clean(tdomain)
call gridmap_clean(tgridmap)
deallocate(glacier_region_i)
+ deallocate(frac_dst)
+ deallocate(mask_r8)
write (6,*) 'Successfully made glacier region'
write (6,*)
diff --git a/tools/mksurfdata_map/src/mkglcmecMod.F90 b/tools/mksurfdata_map/src/mkglcmecMod.F90
index 6ff0754950..2ac4d94e4f 100644
--- a/tools/mksurfdata_map/src/mkglcmecMod.F90
+++ b/tools/mksurfdata_map/src/mkglcmecMod.F90
@@ -186,6 +186,7 @@ subroutine mkglcmec(ldomain, mapfname, &
real(r8), allocatable :: pctglc_icesheet_i(:) ! input icesheet percentage for a single level
real(r8), allocatable :: topoglcmec_unnorm_o(:,:) ! same as topoglcmec_o, but unnormalized
real(r8), allocatable :: pctglc_tot_o(:) ! total glacier cover for the grid cell
+ real(r8), allocatable :: frac_dst(:) ! output fractions
real(r8) :: topoice_i ! topographic height of this level
real(r8) :: pctglc_i ! input total pct glacier for a single level & single point
real(r8) :: wt, frac ! weighting factors for remapping
@@ -286,9 +287,16 @@ subroutine mkglcmec(ldomain, mapfname, &
allocate(topoglcmec_unnorm_o(ns_o,nglcec), stat=ier)
if (ier/=0) call abort()
+ allocate(frac_dst(ns_o), stat=ier)
+ if (ier/=0) call abort()
+
topoglcmec_unnorm_o(:,:) = 0.
write(6,'(a,i4,a)',advance='no') 'Level (out of ', nlev, '): '
+
+ ! Obtain frac_dst
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
do lev = 1, nlev
write(6,'(i4)',advance='no') lev
flush(6)
@@ -312,10 +320,10 @@ subroutine mkglcmec(ldomain, mapfname, &
do n = 1,tgridmap%ns
ni = tgridmap%src_indx(n)
no = tgridmap%dst_indx(n)
- wt = tgridmap%wovr(n)
+ wt = tgridmap%wovr(n) * tdomain%mask(ni)
! fraction of this destination cell that is covered by source cells that are within the source landmask
- frac = tgridmap%frac_dst(no)
+ frac = frac_dst(no)
! If frac == 0, then we can't do this, to avoid divide by 0. In this case, the
! outputs remain equal to 0 (their initialized value).
@@ -465,6 +473,7 @@ subroutine mkglcmec(ldomain, mapfname, &
deallocate(pctglc_gic_i, pctglc_icesheet_i)
deallocate(topoglcmec_unnorm_o)
deallocate(pctglc_tot_o)
+ deallocate(frac_dst)
deallocate(starts, counts)
write (6,*) 'Successfully made percent elevation class and mean elevation for glaciers'
@@ -523,13 +532,15 @@ subroutine mkglacier(ldomain, mapfname, datfname, ndiag, zero_out, glac_o)
type(gridmap_type) :: tgridmap
type(domain_type) :: tdomain ! local domain
real(r8), allocatable :: glac_i(:) ! input grid: percent glac
+ real(r8), allocatable :: frac_dst(:) ! output fractions
+ real(r8), allocatable :: mask_r8(:) ! float of tdomain%mask
real(r8) :: sum_fldi ! global sum of dummy input fld
real(r8) :: sum_fldo ! global sum of dummy output fld
real(r8) :: gglac_i ! input grid: global glac
real(r8) :: garea_i ! input grid: global area
real(r8) :: gglac_o ! output grid: global glac
real(r8) :: garea_o ! output grid: global area
- integer :: ni,no,k,n,m,ns ! indices
+ integer :: ni,no,k,n,m,ns, ns_o ! indices
integer :: ncid,dimid,varid ! input netCDF id's
integer :: ier ! error status
real(r8) :: relerr = 0.00001 ! max error: sum overlap wts ne 1
@@ -547,7 +558,10 @@ subroutine mkglacier(ldomain, mapfname, datfname, ndiag, zero_out, glac_o)
call domain_read(tdomain,datfname)
ns = tdomain%ns
- allocate(glac_i(ns), stat=ier)
+ ns_o = ldomain%ns
+ allocate(glac_i(ns), &
+ frac_dst(ns_o), &
+ stat=ier)
if (ier/=0) call abort()
write (6,*) 'Open glacier file: ', trim(datfname)
@@ -562,7 +576,7 @@ subroutine mkglacier(ldomain, mapfname, datfname, ndiag, zero_out, glac_o)
if ( zero_out )then
- do no = 1, ldomain%ns
+ do no = 1, ns_o
glac_o(no) = 0.
enddo
@@ -573,18 +587,21 @@ subroutine mkglacier(ldomain, mapfname, datfname, ndiag, zero_out, glac_o)
! Error checks for domain and map consistencies
call domain_checksame( tdomain, ldomain, tgridmap )
+ ! Obtain frac_dst
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
! Determine glac_o on output grid
- call gridmap_areaave(tgridmap, glac_i, glac_o, nodata=0._r8)
+ call gridmap_areaave_srcmask(tgridmap, glac_i, glac_o, nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
- do no = 1, ldomain%ns
+ do no = 1, ns_o
if (glac_o(no) < 1.) glac_o(no) = 0.
enddo
end if
! Check for conservation
- do no = 1, ldomain%ns
+ do no = 1, ns_o
if ((glac_o(no)) > 100.000001_r8) then
write (6,*) 'MKGLACIER error: glacier = ',glac_o(no), &
' greater than 100.000001 for column, row = ',no
@@ -600,29 +617,10 @@ subroutine mkglacier(ldomain, mapfname, datfname, ndiag, zero_out, glac_o)
! Global sum of output field -- must multiply by fraction of
! output grid that is land as determined by input grid
- sum_fldi = 0.0_r8
- do ni = 1, tdomain%ns
- sum_fldi = sum_fldi + tgridmap%area_src(ni) * tgridmap%frac_src(ni)
- enddo
-
- sum_fldo = 0.
- do no = 1, ldomain%ns
- sum_fldo = sum_fldo + tgridmap%area_dst(no) * tgridmap%frac_dst(no)
- end do
-
- ! -----------------------------------------------------------------
- ! Error check1
- ! Compare global sum fld_o to global sum fld_i.
- ! -----------------------------------------------------------------
-
- if ( trim(mksrf_gridtype) == 'global') then
- if ( abs(sum_fldo/sum_fldi-1.) > relerr ) then
- write (6,*) 'MKGLACIER error: input field not conserved'
- write (6,'(a30,e20.10)') 'global sum output field = ',sum_fldo
- write (6,'(a30,e20.10)') 'global sum input field = ',sum_fldi
- stop
- end if
- end if
+ allocate(mask_r8(ns), stat=ier)
+ if (ier/=0) call abort()
+ mask_r8 = tdomain%mask
+ call gridmap_check( tgridmap, mask_r8, frac_dst, subname )
! -----------------------------------------------------------------
! Error check2
@@ -633,20 +631,20 @@ subroutine mkglacier(ldomain, mapfname, datfname, ndiag, zero_out, glac_o)
gglac_i = 0.
garea_i = 0.
- do ni = 1, tdomain%ns
+ do ni = 1, ns
garea_i = garea_i + tgridmap%area_src(ni)*re**2
gglac_i = gglac_i + glac_i(ni)*(tgridmap%area_src(ni)/100.)*&
- tgridmap%frac_src(ni)*re**2
+ tdomain%mask(ni)*re**2
end do
! Output grid
gglac_o = 0.
garea_o = 0.
- do no = 1, ldomain%ns
+ do no = 1, ns_o
garea_o = garea_o + tgridmap%area_dst(no)*re**2
gglac_o = gglac_o + glac_o(no)*(tgridmap%area_dst(no)/100.)*&
- tgridmap%frac_dst(no)*re**2
+ frac_dst(no)*re**2
end do
! Diagnostic output
@@ -675,7 +673,7 @@ subroutine mkglacier(ldomain, mapfname, datfname, ndiag, zero_out, glac_o)
call domain_clean(tdomain)
if ( .not. zero_out )then
call gridmap_clean(tgridmap)
- deallocate (glac_i)
+ deallocate (glac_i, frac_dst, mask_r8)
end if
write (6,*) 'Successfully made %glacier'
diff --git a/tools/mksurfdata_map/src/mkgridmapMod.F90 b/tools/mksurfdata_map/src/mkgridmapMod.F90
index 38844eb7cd..21ca23f4d6 100644
--- a/tools/mksurfdata_map/src/mkgridmapMod.F90
+++ b/tools/mksurfdata_map/src/mkgridmapMod.F90
@@ -7,6 +7,15 @@ module mkgridmapMod
! !DESCRIPTION:
! Module containing 2-d global surface boundary data information
!
+! !NOTES:
+! Avoid using the frac_src and frac_dst found here, because they
+! are read from mapping files, and we have generally moved to "nomask"
+! mapping files. This means that mapping files now typically contain
+! mask and frac equal to 1 everywhere. So now during remapping we apply the
+! source masks found in the raw datasets and ignore the masks found in the
+! mapping files. Exception: we continue to use a masked mapping file to regrid
+! the 1-km topography.
+!
! !USES:
use shr_kind_mod, only : r8 => shr_kind_r8
@@ -23,8 +32,6 @@ module mkgridmapMod
real(r8), pointer :: yc_dst(:) ! "degrees"
real(r8), pointer :: xc_src(:) ! "degrees"
real(r8), pointer :: xc_dst(:) ! "degrees"
- integer , pointer :: mask_src(:) ! "unitless"
- integer , pointer :: mask_dst(:) ! "unitless"
real(R8), pointer :: area_src(:) ! area of a grid in map (radians)
real(R8), pointer :: area_dst(:) ! area of b grid in map (radians)
real(r8), pointer :: frac_src(:) ! "unitless"
@@ -40,7 +47,9 @@ module mkgridmapMod
public :: for_test_create_gridmap ! Set a gridmap directly, for testing
public :: gridmap_mapread ! Read in gridmap
public :: gridmap_check ! Check validity of a gridmap
- public :: gridmap_areaave ! do area average
+ public :: gridmap_calc_frac_dst ! Obtain frac_dst
+ public :: gridmap_areaave_no_srcmask ! do area average without passing mask
+ public :: gridmap_areaave_srcmask ! do area average with mask passed
public :: gridmap_areaave_scs ! area average, but multiply by ratio of source over destination weight
public :: gridmap_areastddev ! do area-weighted standard deviation
public :: gridmap_clean ! Clean and deallocate a gridmap structure
@@ -49,12 +58,6 @@ module mkgridmapMod
! !REVISION HISTORY:
! Author Mariana Vertenstein
- interface gridmap_areaave
- module procedure gridmap_areaave_default
- module procedure gridmap_areaave_srcmask
- module procedure gridmap_areaave_srcmask2
- end interface
-
! questions - how does the reverse mapping occur
! is mask_dst read in - and what happens if this is very different
! from frac_dst which is calculated by mapping frac_src?
@@ -83,7 +86,7 @@ module mkgridmapMod
!
! !INTERFACE:
subroutine gridmap_setptrs(gridmap, nsrc, ndst, ns, yc_src, yc_dst, &
- xc_src, xc_dst, mask_src, mask_dst, &
+ xc_src, xc_dst, &
frac_src, frac_dst, src_indx, dst_indx )
!
! !DESCRIPTION:
@@ -101,8 +104,6 @@ subroutine gridmap_setptrs(gridmap, nsrc, ndst, ns, yc_src, yc_dst, &
real(r8), optional, pointer :: yc_dst(:) ! "degrees"
real(r8), optional, pointer :: xc_src(:) ! "degrees"
real(r8), optional, pointer :: xc_dst(:) ! "degrees"
- integer , optional, pointer :: mask_src(:) ! "unitless"
- integer , optional, pointer :: mask_dst(:) ! "unitless"
real(r8), optional, pointer :: frac_src(:) ! "unitless"
real(r8), optional, pointer :: frac_dst(:) ! "unitless"
!
@@ -120,11 +121,9 @@ subroutine gridmap_setptrs(gridmap, nsrc, ndst, ns, yc_src, yc_dst, &
if ( present(ns) ) ns = gridmap%ns
if ( present(yc_src) ) yc_src => gridmap%yc_src
if ( present(xc_src) ) xc_src => gridmap%xc_src
- if ( present(mask_src) ) mask_src => gridmap%mask_src
if ( present(frac_src) ) frac_src => gridmap%frac_src
if ( present(yc_dst) ) yc_dst => gridmap%yc_dst
if ( present(xc_dst) ) xc_dst => gridmap%xc_dst
- if ( present(mask_dst) ) mask_dst => gridmap%mask_dst
if ( present(frac_dst) ) frac_dst => gridmap%frac_dst
if ( present(dst_indx) ) dst_indx => gridmap%dst_indx
if ( present(src_indx) ) src_indx => gridmap%src_indx
@@ -213,12 +212,10 @@ subroutine gridmap_mapread(gridmap, fileName)
allocate(gridmap%wovr(ns) , &
gridmap%src_indx(ns), &
gridmap%dst_indx(ns), &
- gridmap%mask_src(na), &
gridmap%area_src(na), &
gridmap%frac_src(na), &
gridmap%area_dst(nb), &
gridmap%frac_dst(nb), &
- gridmap%mask_dst(nb), &
gridmap%xc_dst(nb), &
gridmap%yc_dst(nb), &
gridmap%xc_src(na), &
@@ -266,22 +263,6 @@ subroutine gridmap_mapread(gridmap, fileName)
call abort()
end if
- rcode = nf_inq_varid(fid,'mask_a',vid)
- rcode = nf_get_var_int(fid, vid, gridmap%mask_src)
- if (rcode /= NF_NOERR) write(6,F00) nf_strerror(rcode)
- if ( any(gridmap%mask_src(:) < 0 .or. gridmap%mask_src > 1) )then
- write(6,*) SubName//' ERROR: mask_src out of bounds'
- call abort()
- end if
-
- rcode = nf_inq_varid(fid,'mask_b',vid)
- rcode = nf_get_var_int(fid, vid, gridmap%mask_dst)
- if (rcode /= NF_NOERR) write(6,F00) nf_strerror(rcode)
- if ( any(gridmap%mask_dst(:) < 0 .or. gridmap%mask_dst > 1) )then
- write(6,*) SubName//' ERROR: mask_dst out of bounds'
- call abort()
- end if
-
rcode = nf_inq_varid(fid,'xc_a',vid)
rcode = nf_get_var_double(fid, vid, gridmap%xc_src)
if (rcode /= NF_NOERR) write(6,F00) nf_strerror(rcode)
@@ -313,7 +294,7 @@ end subroutine gridmap_mapread
!-----------------------------------------------------------------------
subroutine for_test_create_gridmap(gridmap, na, nb, ns, &
src_indx, dst_indx, wovr, &
- mask_src, mask_dst, frac_src, frac_dst, area_src, area_dst, &
+ frac_src, frac_dst, area_src, area_dst, &
xc_src, xc_dst, yc_src, yc_dst)
!
! !DESCRIPTION:
@@ -331,8 +312,6 @@ subroutine for_test_create_gridmap(gridmap, na, nb, ns, &
real(r8), intent(in) :: wovr(:)
! If not provided, mask and frac values are set to 1 everywhere
- integer, intent(in), optional :: mask_src(:)
- integer, intent(in), optional :: mask_dst(:)
real(r8), intent(in), optional :: frac_src(:)
real(r8), intent(in), optional :: frac_dst(:)
@@ -359,9 +338,6 @@ subroutine for_test_create_gridmap(gridmap, na, nb, ns, &
call check_input_size('dst_indx', size(dst_indx), ns)
call check_input_size('wovr', size(wovr), ns)
- if (present(mask_src)) then
- call check_input_size('mask_src', size(mask_src), na)
- end if
if (present(frac_src)) then
call check_input_size('frac_src', size(frac_src), na)
end if
@@ -375,9 +351,6 @@ subroutine for_test_create_gridmap(gridmap, na, nb, ns, &
call check_input_size('yc_src', size(yc_src), na)
end if
- if (present(mask_dst)) then
- call check_input_size('mask_dst', size(mask_dst), nb)
- end if
if (present(frac_dst)) then
call check_input_size('frac_dst', size(frac_dst), nb)
end if
@@ -406,10 +379,6 @@ subroutine for_test_create_gridmap(gridmap, na, nb, ns, &
allocate(gridmap%wovr(ns))
gridmap%wovr = wovr
- allocate(gridmap%mask_src(na))
- call set_gridmap_var(gridmap%mask_src, 1, mask_src)
- allocate(gridmap%mask_dst(nb))
- call set_gridmap_var(gridmap%mask_dst, 1, mask_dst)
allocate(gridmap%frac_src(na))
call set_gridmap_var(gridmap%frac_src, 1._r8, frac_src)
allocate(gridmap%frac_dst(nb))
@@ -477,7 +446,7 @@ end subroutine set_gridmap_var_int
! !IROUTINE: gridmap_check
!
! !INTERFACE:
- subroutine gridmap_check(gridmap, caller)
+ subroutine gridmap_check(gridmap, mask_src, frac_dst, caller)
!
! !DESCRIPTION:
! Check validity of a gridmap
@@ -490,6 +459,8 @@ subroutine gridmap_check(gridmap, caller)
! !ARGUMENTS:
implicit none
type(gridmap_type) , intent(in) :: gridmap ! mapping data
+ real(r8), intent(in) :: mask_src(:) ! input mask; could be declared integer but for the argument passed from subr. mktopostats
+ real(r8), intent(in) :: frac_dst(:) ! output fractions
character(len=*) , intent(in) :: caller ! calling subroutine (used for error messages)
!
! !REVISION HISTORY:
@@ -516,12 +487,12 @@ subroutine gridmap_check(gridmap, caller)
sum_area_i = 0.0_r8
do ni = 1,ns_i
- sum_area_i = sum_area_i + gridmap%area_src(ni)*gridmap%frac_src(ni)*re**2
+ sum_area_i = sum_area_i + gridmap%area_src(ni)*mask_src(ni)*re**2
enddo
sum_area_o = 0.
do no = 1,ns_o
- sum_area_o = sum_area_o + gridmap%area_dst(no)*gridmap%frac_dst(no)*re**2
+ sum_area_o = sum_area_o + gridmap%area_dst(no)*frac_dst(no)*re**2
end do
! -----------------------------------------------------------------
@@ -543,70 +514,23 @@ end subroutine gridmap_check
!==========================================================================
-!------------------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: gridmap_areaave_default
-!
-! !INTERFACE:
- subroutine gridmap_areaave_default (gridmap, src_array, dst_array, nodata)
-!
-! !DESCRIPTION:
-! This subroutine does a simple area average
-!
-! !ARGUMENTS:
- implicit none
- type(gridmap_type) , intent(in) :: gridmap ! gridmap data
- real(r8), intent(in) :: src_array(:)
- real(r8), intent(out):: dst_array(:)
- real(r8), intent(in) :: nodata ! value to apply where there are no input data
-!
-! !REVISION HISTORY:
-! Created by Mariana Vertenstein
-!
-! !LOCAL VARIABLES:
- integer :: n,ns,ni,no
- real(r8):: wt,frac
- real(r8), allocatable :: sum_weights(:) ! sum of weights on the output grid
- character(*),parameter :: subName = '(gridmap_areaave_default) '
-!EOP
-!------------------------------------------------------------------------------
- call gridmap_checkifset( gridmap, subname )
- allocate(sum_weights(size(dst_array)))
- sum_weights = 0._r8
- dst_array = 0._r8
-
- do n = 1,gridmap%ns
- ni = gridmap%src_indx(n)
- no = gridmap%dst_indx(n)
- wt = gridmap%wovr(n)
- frac = gridmap%frac_dst(no)
- if (frac > 0.) then
- dst_array(no) = dst_array(no) + wt * src_array(ni)/frac
- sum_weights(no) = sum_weights(no) + wt
- end if
- end do
-
- where (sum_weights == 0._r8)
- dst_array = nodata
- end where
-
- deallocate(sum_weights)
-
- end subroutine gridmap_areaave_default
-
!------------------------------------------------------------------------------
!BOP
!
! !IROUTINE: gridmap_areaave_scs
!
! !INTERFACE:
- subroutine gridmap_areaave_scs (gridmap, src_array, dst_array, nodata, src_wt, dst_wt)
+ subroutine gridmap_areaave_scs (gridmap, src_array, dst_array, nodata, src_wt, dst_wt, frac_dst)
!
! !DESCRIPTION:
! This subroutine does a simple area average, but multiplies by the ratio of the source over
! the destination weight. Sets to zero if destination weight is zero.
!
+! The src_wt must be multiplied by tdomain%mask to maintain consistency with the
+! incoming frac_dst.
+!
+! Called by subroutine mkpft.
+!
! !ARGUMENTS:
implicit none
type(gridmap_type) , intent(in) :: gridmap ! gridmap data
@@ -615,6 +539,7 @@ subroutine gridmap_areaave_scs (gridmap, src_array, dst_array, nodata, src_wt, d
real(r8), intent(in) :: nodata ! value to apply where there are no input data
real(r8), intent(in) :: src_wt(:) ! Source weights
real(r8), intent(in) :: dst_wt(:) ! Destination weights
+ real(r8), intent(in) :: frac_dst(:) ! Output grid weights
!
! !REVISION HISTORY:
@@ -627,6 +552,16 @@ subroutine gridmap_areaave_scs (gridmap, src_array, dst_array, nodata, src_wt, d
character(*),parameter :: subName = '(gridmap_areaave_scs) '
!EOP
!------------------------------------------------------------------------------
+
+ ! Error check inputs and initialize local variables
+
+ if (size(frac_dst) /= size(dst_array)) then
+ write(6,*) subname//' ERROR: incorrect size of frac_dst'
+ write(6,*) 'size(frac_dst) = ', size(frac_dst)
+ write(6,*) 'size(dst_array) = ', size(dst_array)
+ call abort()
+ end if
+
call gridmap_checkifset( gridmap, subname )
allocate(sum_weights(size(dst_array)))
sum_weights = 0._r8
@@ -636,7 +571,7 @@ subroutine gridmap_areaave_scs (gridmap, src_array, dst_array, nodata, src_wt, d
ni = gridmap%src_indx(n)
no = gridmap%dst_indx(n)
wt = gridmap%wovr(n)
- frac = gridmap%frac_dst(no)
+ frac = frac_dst(no)
swt = src_wt(ni)
dwt = dst_wt(no)
wt = wt * swt
@@ -669,18 +604,26 @@ end subroutine gridmap_areaave_scs
! !IROUTINE: gridmap_areaave_srcmask
!
! !INTERFACE:
- subroutine gridmap_areaave_srcmask (gridmap, src_array, dst_array, nodata, mask_src)
+ subroutine gridmap_areaave_srcmask (gridmap, src_array, dst_array, nodata, mask_src, frac_dst)
!
! !DESCRIPTION:
! This subroutine does an area average with the source mask
!
+! !NOTES:
+! We have generally moved to "nomask" mapping files. This means that mapping
+! files now typically contain mask and frac equal to 1 everywhere. So now during
+! remapping we apply the source masks found in the raw datasets and ignore the
+! masks found in the mapping files. Exception: we continue to use a masked
+! mapping file to regrid the 1-km topography.
+!
! !ARGUMENTS:
implicit none
type(gridmap_type) , intent(in) :: gridmap ! gridmap data
real(r8), intent(in) :: src_array(:)
real(r8), intent(out):: dst_array(:)
real(r8), intent(in) :: nodata ! value to apply where there are no input data
- real(r8), intent(in) :: mask_src(:)
+ integer, intent(in) :: mask_src(:)
+ real(r8), intent(in) :: frac_dst(:)
!
! !REVISION HISTORY:
! Created by Mariana Vertenstein
@@ -688,23 +631,26 @@ subroutine gridmap_areaave_srcmask (gridmap, src_array, dst_array, nodata, mask_
! !LOCAL VARIABLES:
integer :: n,ns,ni,no
real(r8):: wt
- real(r8), allocatable :: wtnorm(:)
character(*),parameter :: subName = '(gridmap_areaave_srcmask) '
!EOP
!------------------------------------------------------------------------------
- call gridmap_checkifset( gridmap, subname )
+ ! Error check inputs and initialize local variables
+
ns = size(dst_array)
- allocate(wtnorm(ns))
- wtnorm(:) = 0._r8
+ if (size(frac_dst) /= ns) then
+ write(6,*) subname//' ERROR: incorrect size of frac_dst'
+ write(6,*) 'size(frac_dst) = ', size(frac_dst)
+ write(6,*) 'size(dst_array) = ', ns
+ call abort()
+ end if
+ if (size(mask_src) /= size(src_array)) then
+ write(6,*) subname//' ERROR: incorrect size of mask_src'
+ write(6,*) 'size(mask_src) = ', size(mask_src)
+ write(6,*) 'size(src_array) = ', size(src_array)
+ call abort()
+ end if
- do n = 1,gridmap%ns
- ni = gridmap%src_indx(n)
- no = gridmap%dst_indx(n)
- wt = gridmap%wovr(n)
- if (mask_src(ni) > 0) then
- wtnorm(no) = wtnorm(no) + wt*mask_src(ni)
- end if
- end do
+ call gridmap_checkifset( gridmap, subname )
dst_array = 0._r8
do n = 1,gridmap%ns
@@ -712,90 +658,18 @@ subroutine gridmap_areaave_srcmask (gridmap, src_array, dst_array, nodata, mask_
no = gridmap%dst_indx(n)
wt = gridmap%wovr(n)
if (mask_src(ni) > 0) then
- dst_array(no) = dst_array(no) + wt*mask_src(ni)*src_array(ni)/wtnorm(no)
+ dst_array(no) = dst_array(no) + wt*mask_src(ni)*src_array(ni)/frac_dst(no)
end if
end do
- where (wtnorm == 0._r8)
+ where (frac_dst == 0._r8)
dst_array = nodata
end where
- deallocate(wtnorm)
-
end subroutine gridmap_areaave_srcmask
!==========================================================================
-!------------------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: gridmap_areaave_srcmask2
-!
-! !INTERFACE:
- subroutine gridmap_areaave_srcmask2 (gridmap, src_array, dst_array, nodata, mask_src, &
- mask_dst, mask_dst_min)
-!
-! !DESCRIPTION:
-! This subroutine does an area average with the source mask and making sure the
-! destination mask is valid as well.
-!
-! !ARGUMENTS:
- implicit none
- type(gridmap_type) , intent(in) :: gridmap ! gridmap data
- real(r8), intent(in) :: src_array(:)
- real(r8), intent(out):: dst_array(:)
- real(r8), intent(in) :: nodata ! value to apply where there are no input data
- real(r8), intent(in) :: mask_src(:)
- real(r8), intent(in) :: mask_dst(:)
- real(r8), intent(in) :: mask_dst_min
-!
-! !REVISION HISTORY:
-! Created by Mariana Vertenstein
-!
-! !LOCAL VARIABLES:
- integer :: n,ns,ni,no
- real(r8):: wt
- real(r8), allocatable :: wtnorm(:)
- character(*),parameter :: subName = '(gridmap_areaave_srcmask2) '
-!EOP
-!------------------------------------------------------------------------------
-
- call gridmap_checkifset( gridmap, subname )
- ns = size(dst_array)
- allocate(wtnorm(ns))
- wtnorm(:) = 0._r8
-
- do n = 1,gridmap%ns
- ni = gridmap%src_indx(n)
- no = gridmap%dst_indx(n)
- wt = gridmap%wovr(n)
- if (mask_src(ni) > 0) then
- wtnorm(no) = wtnorm(no) + wt*mask_src(ni)
- end if
- end do
-
- dst_array = 0._r8
- do n = 1,gridmap%ns
- ni = gridmap%src_indx(n)
- no = gridmap%dst_indx(n)
- wt = gridmap%wovr(n)
- if (mask_dst(no) > mask_dst_min) then
- if (mask_src(ni) > 0) then
- dst_array(no) = dst_array(no) + wt*mask_src(ni)*src_array(ni)/wtnorm(no)
- end if
- end if
- end do
-
- where ((wtnorm == 0._r8) .or. (mask_dst <= mask_dst_min))
- dst_array = nodata
- end where
-
- deallocate(wtnorm)
-
- end subroutine gridmap_areaave_srcmask2
-
-!==========================================================================
-
!------------------------------------------------------------------------------
!BOP
!
@@ -840,7 +714,13 @@ subroutine gridmap_areastddev (gridmap, src_array, dst_array, nodata)
ns_o = size(dst_array)
allocate(weighted_means(ns_o))
- call gridmap_areaave(gridmap, src_array, weighted_means, nodata=0._r8)
+
+ ! Subr. gridmap_areaave_no_srcmask should NOT be used in general. We have
+ ! kept it to support the rare raw data files for which we have masking on
+ ! the mapping file and, therefore, we do not explicitly pass the src_mask
+ ! as an argument. In general, users are advised to use subroutine
+ ! gridmap_areaave_srcmask.
+ call gridmap_areaave_no_srcmask(gridmap, src_array, weighted_means, nodata=0._r8)
! WJS (3-5-13): I believe that sum_weights should be the same as gridmap%frac_dst,
! but I'm not positive of this, so we compute it explicitly to be safe
@@ -897,8 +777,6 @@ subroutine gridmap_clean(gridmap)
deallocate(gridmap%wovr , &
gridmap%src_indx, &
gridmap%dst_indx, &
- gridmap%mask_src, &
- gridmap%mask_dst, &
gridmap%area_src, &
gridmap%area_dst, &
gridmap%frac_src, &
@@ -930,6 +808,108 @@ subroutine gridmap_checkifset( gridmap, subname )
end if
end subroutine gridmap_checkifset
+!==========================================================================
+
+!------------------------------------------------------------------------------
+!BOP
+!
+! !IROUTINE: gridmap_calc_frac_dst
+!
+! !INTERFACE:
+ subroutine gridmap_calc_frac_dst(gridmap, mask_src, frac_dst)
+!
+! !DESCRIPTION:
+! This subroutine calculates frac_dst
+!
+! !ARGUMENTS:
+ implicit none
+ type(gridmap_type) , intent(in) :: gridmap ! gridmap data
+ integer, intent(in) :: mask_src(:)
+ real(r8), intent(out) :: frac_dst(:)
+!
+! !REVISION HISTORY:
+! Created by Sam Levis
+!
+! !LOCAL VARIABLES:
+ integer :: n,ns,ni,no
+ real(r8):: wt
+ character(*),parameter :: subName = '(gridmap_calc_frac_dst) '
+!EOP
+!------------------------------------------------------------------------------
+ call gridmap_checkifset( gridmap, subname )
+ frac_dst(:) = 0._r8
+
+ do n = 1,gridmap%ns
+ ni = gridmap%src_indx(n)
+ no = gridmap%dst_indx(n)
+ wt = gridmap%wovr(n)
+ if (mask_src(ni) > 0) then
+ frac_dst(no) = frac_dst(no) + wt*mask_src(ni)
+ end if
+ end do
+
+ end subroutine gridmap_calc_frac_dst
+
+!==========================================================================
+
+!------------------------------------------------------------------------------
+!BOP
+!
+! !IROUTINE: gridmap_areaave_no_srcmask
+!
+! !INTERFACE:
+ subroutine gridmap_areaave_no_srcmask (gridmap, src_array, dst_array, nodata)
+!
+! !DESCRIPTION:
+! This subroutine should NOT be used in general. We have kept it to support the
+! rare raw data files for which we have masking on the mapping file and,
+! therefore, we do not explicitly pass the src_mask as an argument. In general,
+! users are advised to use subroutine gridmap_areaave_srcmask.
+!
+! Perform simple area average without explicitly passing a src mask. The src
+! mask may be implicit in gridmap%wovr.
+!
+! !ARGUMENTS:
+ implicit none
+ type(gridmap_type) , intent(in) :: gridmap ! gridmap data
+ real(r8), intent(in) :: src_array(:)
+ real(r8), intent(out):: dst_array(:)
+ real(r8), intent(in) :: nodata ! value to apply where there are no input data
+!
+! !REVISION HISTORY:
+! Created by Mariana Vertenstein
+!
+! !LOCAL VARIABLES:
+ integer :: n,ns,ni,no
+ real(r8):: wt,frac
+ real(r8), allocatable :: sum_weights(:) ! sum of weights on the output grid
+ character(*),parameter :: subName = '(gridmap_areaave_no_srcmask) '
+!EOP
+!------------------------------------------------------------------------------
+ call gridmap_checkifset( gridmap, subname )
+ allocate(sum_weights(size(dst_array)))
+ sum_weights = 0._r8
+ dst_array = 0._r8
+
+ do n = 1,gridmap%ns
+ ni = gridmap%src_indx(n)
+ no = gridmap%dst_indx(n)
+ wt = gridmap%wovr(n)
+ frac = gridmap%frac_dst(no)
+ if (frac > 0.) then
+ dst_array(no) = dst_array(no) + wt * src_array(ni)/frac
+ sum_weights(no) = sum_weights(no) + wt
+ end if
+ end do
+
+ where (sum_weights == 0._r8)
+ dst_array = nodata
+ end where
+
+ deallocate(sum_weights)
+
+ end subroutine gridmap_areaave_no_srcmask
+
end module mkgridmapMod
diff --git a/tools/mksurfdata_map/src/mkharvestMod.F90 b/tools/mksurfdata_map/src/mkharvestMod.F90
index bf1999d78a..0dc107729b 100644
--- a/tools/mksurfdata_map/src/mkharvestMod.F90
+++ b/tools/mksurfdata_map/src/mkharvestMod.F90
@@ -866,6 +866,7 @@ subroutine mkharvest(ldomain, mapfname, datfname, ndiag, harvdata)
integer :: ier ! error status
integer, allocatable :: ind1D(:) ! Index of 1D harvest fields
integer, allocatable :: ind2D(:) ! Index of 2D harvest fields
+ real(r8), allocatable :: frac_dst(:) ! output fractions
real(r8), pointer :: data1D_i(:) ! 1D input data
real(r8), pointer :: data2D_i(:,:) ! 2D output data
real(r8), pointer :: data1D_o(:) ! 1D output data
@@ -896,6 +897,8 @@ subroutine mkharvest(ldomain, mapfname, datfname, ndiag, harvdata)
call domain_read(tdomain,datfname)
ns_i = tdomain%ns
ns_o = ldomain%ns
+ allocate(frac_dst(ns_o), stat=ier)
+ if (ier /= 0) call abort()
write (6,*) 'Open harvest file: ', trim(datfname)
call check_ret(nf_open(datfname, 0, ncid), subname)
@@ -931,20 +934,23 @@ subroutine mkharvest(ldomain, mapfname, datfname, ndiag, harvdata)
call domain_checksame( tdomain, ldomain, tgridmap )
+ ! Obtain frac_dst
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
! Determine data* on output grid
do k = 1, harvdata%num1Dfields()
ifld = ind1D(k)
data1D_i => harvdata%get1DFieldPtr( ifld )
data1D_o => harvdata%get1DFieldPtr( ifld, output=.true. )
- call gridmap_areaave(tgridmap, data1D_i, data1D_o, nodata=0._r8)
+ call gridmap_areaave_srcmask(tgridmap, data1D_i, data1D_o, nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
end do
do k = 1, harvdata%num2Dfields()
ifld = ind2D(k)
data2D_i => harvdata%get2DFieldPtr( ifld )
data2D_o => harvdata%get2DFieldPtr( ifld, output=.true. )
do m = lbound(data2D_i(:,:),dim=2), ubound(data2D_i(:,:),dim=2)
- call gridmap_areaave(tgridmap, data2D_i(:,m), data2D_o(:,m), nodata=0._r8)
+ call gridmap_areaave_srcmask(tgridmap, data2D_i(:,m), data2D_o(:,m), nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
end do
end do
@@ -961,7 +967,7 @@ subroutine mkharvest(ldomain, mapfname, datfname, ndiag, harvdata)
m = ind1D(k)
data1D_i => harvdata%get1DFieldPtr( m )
gharv_i(m) = gharv_i(m) + data1D_i(ni)*tgridmap%area_src(ni)* &
- tgridmap%frac_src(ni)*re**2
+ tdomain%mask(ni)*re**2
end do
end do
@@ -973,7 +979,7 @@ subroutine mkharvest(ldomain, mapfname, datfname, ndiag, harvdata)
m = ind1D(k)
data1D_o => harvdata%get1DFieldPtr( m, output=.true. )
gharv_o(m) = gharv_o(m) + data1D_o(no)*tgridmap%area_dst(no)* &
- tgridmap%frac_dst(no)*re**2
+ frac_dst(no)*re**2
end do
end do
diff --git a/tools/mksurfdata_map/src/mkindexmapMod.F90 b/tools/mksurfdata_map/src/mkindexmapMod.F90
index 903f231578..5f8e74af2b 100644
--- a/tools/mksurfdata_map/src/mkindexmapMod.F90
+++ b/tools/mksurfdata_map/src/mkindexmapMod.F90
@@ -40,7 +40,6 @@ module mkindexmapMod
! !PUBLIC MEMBER FUNCTIONS:
public :: get_dominant_indices ! make output map based on dominant type in each grid cell
public :: get_max_indices ! make output map based on maximum type in each grid cell
- public :: filter_same ! build a filter of overlaps where src_val == dst_val
public :: lookup_2d ! create map based on a 2-d lookup table
public :: lookup_2d_netcdf ! wrapper to lookup_2d; first read table from netcdf file
public :: which_max ! get index of the maximum value in an array
@@ -59,7 +58,7 @@ module mkindexmapMod
! !IROUTINE: get_dominant_indices
!
! !INTERFACE:
-subroutine get_dominant_indices(gridmap, src_array, dst_array, minval, maxval, nodata, filter)
+subroutine get_dominant_indices(gridmap, src_array, dst_array, minval, maxval, nodata, filter, mask_src)
!
! !DESCRIPTION:
! Fills an output array on the destination grid (dst_array) whose values are equal to the
@@ -85,6 +84,7 @@ subroutine get_dominant_indices(gridmap, src_array, dst_array, minval, maxval, n
integer , intent(in) :: minval ! minimum valid value in src_array
integer , intent(in) :: maxval ! maximum valid value in src_array
integer , intent(in) :: nodata ! value to assign to dst_array where there are no valid source points
+ integer , intent(in) :: mask_src(:)
logical, intent(in), optional :: filter(:) ! only consider overlaps where filter is .true.; length gridmap%ns
!
@@ -118,6 +118,12 @@ subroutine get_dominant_indices(gridmap, src_array, dst_array, minval, maxval, n
write(6,*) 'gridmap%nb = ', gridmap%nb
call abort()
end if
+ if (size(mask_src) /= size(src_array)) then
+ write(6,*) subname//' ERROR: incorrect size of mask_src'
+ write(6,*) 'size(mask_src) = ', size(mask_src)
+ write(6,*) 'size(src_array) = ', size(src_array)
+ call abort()
+ end if
allocate(lfilter(gridmap%ns))
@@ -145,7 +151,7 @@ subroutine get_dominant_indices(gridmap, src_array, dst_array, minval, maxval, n
if (lfilter(n)) then
ni = gridmap%src_indx(n)
no = gridmap%dst_indx(n)
- wt = gridmap%wovr(n)
+ wt = gridmap%wovr(n) * mask_src(ni)
k = src_array(ni)
if (k >= minval .and. k <= maxval) then
! Note: if we were doing something like weighted sums, I think we would
@@ -181,7 +187,7 @@ end subroutine get_dominant_indices
!------------------------------------------------------------------------------
!-----------------------------------------------------------------------
-subroutine get_max_indices(gridmap, src_array, dst_array, nodata)
+subroutine get_max_indices(gridmap, src_array, dst_array, nodata, mask_src)
!
! !DESCRIPTION:
! Fills an output array on the destination grid (dst_array) whose values are equal to
@@ -199,6 +205,7 @@ subroutine get_max_indices(gridmap, src_array, dst_array, nodata)
integer , intent(in) :: src_array(:) ! input values; length gridmap%na
integer , intent(out) :: dst_array(:) ! output values; length gridmap%nb
integer , intent(in) :: nodata ! value to assign to dst_array where there are no valid source points
+ integer , intent(in) :: mask_src(:) ! mask at the source resolution
!
! !LOCAL VARIABLES:
logical, allocatable :: hasdata(:) ! true if an output cell has any valid data;
@@ -220,15 +227,21 @@ subroutine get_max_indices(gridmap, src_array, dst_array, nodata)
write(6,*) 'gridmap%nb = ', gridmap%nb
call abort()
end if
+ if (size(mask_src) /= size(src_array)) then
+ write(6,*) subname//' ERROR: incorrect size of mask_src'
+ write(6,*) 'size(mask_src) = ', size(mask_src)
+ write(6,*) 'size(src_array) = ', size(src_array)
+ call abort()
+ end if
! Initialize local variables
allocate(hasdata(gridmap%nb))
hasdata(:) = .false.
do n = 1, gridmap%ns
- wt = gridmap%wovr(n)
+ ni = gridmap%src_indx(n)
+ wt = gridmap%wovr(n) * mask_src(ni)
if (wt > 0._r8) then
- ni = gridmap%src_indx(n)
no = gridmap%dst_indx(n)
src_val = src_array(ni)
if (.not. hasdata(no)) then
@@ -249,84 +262,6 @@ subroutine get_max_indices(gridmap, src_array, dst_array, nodata)
end subroutine get_max_indices
-!------------------------------------------------------------------------------
-!BOP
-!
-! !IROUTINE: filter_same
-!
-! !INTERFACE:
-subroutine filter_same(gridmap, filter, src_array, dst_array, nodata)
-!
-! !DESCRIPTION:
-! Creates a filter of overlaps where src_array == dst_array.
-!
-! More specifically: given a src_array (of size gridmap%na) and an already-created
-! dst_array (of size gridmap%nb):
-!
-! Creates a logical filter array, of size gridmap%ns (i.e., number of overlaps),
-! according to the following rules:
-! (1) anywhere where filter was already .false., it will remain .false.
-! (2) if nodata is present: for any overlap where the value in dst_array is nodata,
-! filter will be .false.
-! (3) for any overlap where the value in the given src_array differs from the value
-! in the given dst_array, filter will be .false.
-! (4) anywhere else, filter will be .true.
-!
-! !ARGUMENTS:
- implicit none
- type(gridmap_type), intent(in) :: gridmap ! provides mapping from src -> dst
- logical , intent(inout):: filter(:) ! length gridmap%ns
- integer , intent(in) :: src_array(:) ! length gridmap%na
- integer , intent(in) :: dst_array(:) ! length gridmap%nb
-
- integer, intent(in), optional :: nodata ! wherever dst_array == nodata, filter will be false
-!
-! !REVISION HISTORY:
-! Author: Bill Sacks
-!
-!
-! !LOCAL VARIABLES:
-!EOP
- integer :: n, ni, no
-
- character(len=*), parameter :: subname = "make_filter"
-!-----------------------------------------------------------------------
-
- ! Error check inputs
-
- if (size(filter) /= gridmap%ns .or. &
- size(src_array) /= gridmap%na .or. &
- size(dst_array) /= gridmap%nb) then
- write(6,*) subname//' ERROR: incorrect array sizes'
- write(6,*) 'size(src_array) = ', size(src_array)
- write(6,*) 'gridmap%na = ', gridmap%na
- write(6,*) 'size(dst_array) = ', size(dst_array)
- write(6,*) 'gridmap%nb = ', gridmap%nb
- write(6,*) 'size(filter) = ', size(filter)
- write(6,*) 'gridmap%ns = ', gridmap%ns
- call abort()
- end if
-
- ! Create the filter
-
- do n = 1, gridmap%ns
- ni = gridmap%src_indx(n)
- no = gridmap%dst_indx(n)
-
- if (present(nodata)) then
- if (dst_array(no) == nodata) then
- filter(n) = .false.
- end if
- end if
-
- if (dst_array(no) /= src_array(ni)) then
- filter(n) = .false.
- end if
- end do
-
-end subroutine filter_same
-!------------------------------------------------------------------------------
-
!------------------------------------------------------------------------------
!BOP
!
diff --git a/tools/mksurfdata_map/src/mklaiMod.F90 b/tools/mksurfdata_map/src/mklaiMod.F90
index 22a34bff75..aef33f3463 100644
--- a/tools/mksurfdata_map/src/mklaiMod.F90
+++ b/tools/mksurfdata_map/src/mklaiMod.F90
@@ -88,7 +88,7 @@ subroutine mklai(ldomain, mapfname, datfname, ndiag, ncido)
real(r8), allocatable :: msai_i(:,:) ! monthly sai in
real(r8), allocatable :: mhgtt_i(:,:) ! monthly height (top) in
real(r8), allocatable :: mhgtb_i(:,:) ! monthly height (bottom) in
- real(r8), allocatable :: mask_src(:) ! input grid: mask (0, 1)
+ real(r8), allocatable :: frac_dst(:) ! output fractions: same as frac_dst
integer, pointer :: laimask(:,:) ! lai+sai output mask for each plant function type
real(r8) :: garea_i ! input grid: global area
real(r8) :: garea_o ! output grid: global area
@@ -156,7 +156,7 @@ subroutine mklai(ldomain, mapfname, datfname, ndiag, ncido)
msai_i(ns_i,0:numpft_i), &
mhgtt_i(ns_i,0:numpft_i), &
mhgtb_i(ns_i,0:numpft_i), &
- mask_src(ns_i), &
+ frac_dst(ns_o), &
mlai_o(ns_o,0:numpft), &
msai_o(ns_o,0:numpft), &
mhgtt_o(ns_o,0:numpft), &
@@ -243,15 +243,16 @@ subroutine mklai(ldomain, mapfname, datfname, ndiag, ncido)
msai_o(:,:) = 0.
mhgtt_o(:,:) = 0.
mhgtb_o(:,:) = 0.
-
- ! Loop over pft types to do mapping
+ ! Obtain frac_dst
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
+ ! Loop over pft types to do mapping
do l = 0, numpft_i - 1
- mask_src(:) = 1._r8
- call gridmap_areaave(tgridmap, mlai_i(:,l) , mlai_o(:,l) , nodata=0._r8, mask_src=mask_src)
- call gridmap_areaave(tgridmap, msai_i(:,l) , msai_o(:,l) , nodata=0._r8, mask_src=mask_src)
- call gridmap_areaave(tgridmap, mhgtt_i(:,l), mhgtt_o(:,l), nodata=0._r8, mask_src=mask_src)
- call gridmap_areaave(tgridmap, mhgtb_i(:,l), mhgtb_o(:,l), nodata=0._r8, mask_src=mask_src)
+ call gridmap_areaave_srcmask(tgridmap, mlai_i(:,l) , mlai_o(:,l) , nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
+ call gridmap_areaave_srcmask(tgridmap, msai_i(:,l) , msai_o(:,l) , nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
+ call gridmap_areaave_srcmask(tgridmap, mhgtt_i(:,l), mhgtt_o(:,l), nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
+ call gridmap_areaave_srcmask(tgridmap, mhgtb_i(:,l), mhgtb_o(:,l), nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
enddo
! Determine laimask
@@ -311,13 +312,13 @@ subroutine mklai(ldomain, mapfname, datfname, ndiag, ncido)
do l = 0, numpft_i - 1
do ni = 1, ns_i
glai_i(l) = glai_i(l) + mlai_i(ni,l) *tgridmap%area_src(ni)*&
- tgridmap%frac_src(ni)*re**2
+ tdomain%mask(ni)*re**2
gsai_i(l) = gsai_i(l) + msai_i(ni,l) *tgridmap%area_src(ni)*&
- tgridmap%frac_src(ni)*re**2
+ tdomain%mask(ni)*re**2
ghgtt_i(l) = ghgtt_i(l)+ mhgtt_i(ni,l)*tgridmap%area_src(ni)*&
- tgridmap%frac_src(ni)*re**2
+ tdomain%mask(ni)*re**2
ghgtb_i(l) = ghgtb_i(l)+ mhgtb_i(ni,l)*tgridmap%area_src(ni)*&
- tgridmap%frac_src(ni)*re**2
+ tdomain%mask(ni)*re**2
end do
end do
@@ -335,13 +336,13 @@ subroutine mklai(ldomain, mapfname, datfname, ndiag, ncido)
do l = 0, numpft_i - 1
do no = 1,ns_o
glai_o(l) = glai_o(l) + mlai_o(no,l)*tgridmap%area_dst(no)* &
- tgridmap%frac_dst(no)*re**2
+ frac_dst(no)*re**2
gsai_o(l) = gsai_o(l) + msai_o(no,l)*tgridmap%area_dst(no)* &
- tgridmap%frac_dst(no)*re**2
+ frac_dst(no)*re**2
ghgtt_o(l) = ghgtt_o(l)+ mhgtt_o(no,l)*tgridmap%area_dst(no)* &
- tgridmap%frac_dst(no)*re**2
+ frac_dst(no)*re**2
ghgtb_o(l) = ghgtb_o(l)+ mhgtb_o(no,l)*tgridmap%area_dst(no)* &
- tgridmap%frac_dst(no)*re**2
+ frac_dst(no)*re**2
end do
end do
@@ -381,12 +382,12 @@ subroutine mklai(ldomain, mapfname, datfname, ndiag, ncido)
deallocate(msai_i)
deallocate(mhgtt_i)
deallocate(mhgtb_i)
- deallocate(mask_src)
deallocate(mlai_o)
deallocate(msai_o)
deallocate(mhgtt_o)
deallocate(mhgtb_o)
deallocate(laimask)
+ deallocate(frac_dst)
call gridmap_clean(tgridmap)
call domain_clean(tdomain)
diff --git a/tools/mksurfdata_map/src/mklanwatMod.F90 b/tools/mksurfdata_map/src/mklanwatMod.F90
index 220648e497..49a1485fa7 100644
--- a/tools/mksurfdata_map/src/mklanwatMod.F90
+++ b/tools/mksurfdata_map/src/mklanwatMod.F90
@@ -73,6 +73,8 @@ subroutine mklakwat(ldomain, mapfname, datfname, ndiag, zero_out, lake_o)
type(gridmap_type) :: tgridmap
type(domain_type) :: tdomain ! local domain
real(r8), allocatable :: lake_i(:) ! input grid: percent lake
+ real(r8), allocatable :: frac_dst(:) ! output fractions
+ real(r8), allocatable :: mask_r8(:) ! float of tdomain%mask
real(r8) :: sum_fldi ! global sum of dummy input fld
real(r8) :: sum_fldo ! global sum of dummy output fld
real(r8) :: glake_i ! input grid: global lake
@@ -103,6 +105,8 @@ subroutine mklakwat(ldomain, mapfname, datfname, ndiag, zero_out, lake_o)
if ( .not. zero_out )then
allocate(lake_i(ns_i), stat=ier)
if (ier/=0) call abort()
+ allocate(frac_dst(ns_o), stat=ier)
+ if (ier/=0) call abort()
write(6,*)'Open lake file: ', trim(datfname)
call check_ret(nf_open(datfname, 0, ncid), subname)
@@ -120,9 +124,12 @@ subroutine mklakwat(ldomain, mapfname, datfname, ndiag, zero_out, lake_o)
call domain_checksame( tdomain, ldomain, tgridmap )
+ ! Obtain frac_dst
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
! Determine lake_o on output grid
- call gridmap_areaave(tgridmap, lake_i,lake_o, nodata=0._r8)
+ call gridmap_areaave_srcmask(tgridmap, lake_i,lake_o, nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
do no = 1,ns_o
if (lake_o(no) < 1.) lake_o(no) = 0.
@@ -134,29 +141,10 @@ subroutine mklakwat(ldomain, mapfname, datfname, ndiag, zero_out, lake_o)
! output grid that is land as determined by input grid
! -----------------------------------------------------------------
- sum_fldi = 0.0_r8
- do ni = 1,ns_i
- sum_fldi = sum_fldi + tgridmap%area_src(ni)*tgridmap%frac_src(ni)*re**2
- enddo
-
- sum_fldo = 0.
- do no = 1,ns_o
- sum_fldo = sum_fldo + tgridmap%area_dst(no)*tgridmap%frac_dst(no)*re**2
- end do
-
- ! -----------------------------------------------------------------
- ! Error check1
- ! Compare global sum fld_o to global sum fld_i.
- ! -----------------------------------------------------------------
-
- if ( .not. zero_out .and. (trim(mksrf_gridtype) == 'global') ) then
- if ( abs(sum_fldo/sum_fldi-1.) > relerr ) then
- write (6,*) 'MKLANWAT error: input field not conserved'
- write (6,'(a30,e20.10)') 'global sum output field = ',sum_fldo
- write (6,'(a30,e20.10)') 'global sum input field = ',sum_fldi
- stop
- end if
- end if
+ allocate(mask_r8(ns_i), stat=ier)
+ if (ier/=0) call abort()
+ mask_r8 = tdomain%mask
+ call gridmap_check( tgridmap, mask_r8, frac_dst, subname )
! -----------------------------------------------------------------
! Error check2
@@ -211,6 +199,8 @@ subroutine mklakwat(ldomain, mapfname, datfname, ndiag, zero_out, lake_o)
if ( .not. zero_out )then
call gridmap_clean(tgridmap)
deallocate (lake_i)
+ deallocate (frac_dst)
+ deallocate (mask_r8)
end if
write (6,*) 'Successfully made %lake'
@@ -259,6 +249,8 @@ subroutine mkwetlnd(ldomain, mapfname, datfname, ndiag, zero_out, swmp_o)
type(gridmap_type) :: tgridmap
type(domain_type) :: tdomain ! local domain
real(r8), allocatable :: swmp_i(:) ! input grid: percent swamp
+ real(r8), allocatable :: frac_dst(:) ! output fractions
+ real(r8), allocatable :: mask_r8(:) ! float of tdomain%mask
real(r8) :: sum_fldi ! global sum of dummy input fld
real(r8) :: sum_fldo ! global sum of dummy output fld
real(r8) :: gswmp_i ! input grid: global swamp
@@ -289,6 +281,8 @@ subroutine mkwetlnd(ldomain, mapfname, datfname, ndiag, zero_out, swmp_o)
if ( .not. zero_out )then
allocate(swmp_i(ns_i), stat=ier)
if (ier/=0) call abort()
+ allocate(frac_dst(ns_o), stat=ier)
+ if (ier/=0) call abort()
write(6,*)'Open wetland file: ', trim(datfname)
call check_ret(nf_open(datfname, 0, ncid), subname)
@@ -305,9 +299,13 @@ subroutine mkwetlnd(ldomain, mapfname, datfname, ndiag, zero_out, swmp_o)
! Error checks for domain and map consistencies
call domain_checksame( tdomain, ldomain, tgridmap )
+
+ ! Obtain frac_dst
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
! Determine swmp_o on output grid
- call gridmap_areaave(tgridmap, swmp_i,swmp_o, nodata=0._r8)
+ call gridmap_areaave_srcmask(tgridmap, swmp_i, swmp_o, nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
do no = 1,ns_o
if (swmp_o(no) < 1.) swmp_o(no) = 0.
@@ -319,29 +317,10 @@ subroutine mkwetlnd(ldomain, mapfname, datfname, ndiag, zero_out, swmp_o)
! output grid that is land as determined by input grid
! -----------------------------------------------------------------
- sum_fldi = 0.0_r8
- do ni = 1,ns_i
- sum_fldi = sum_fldi + tgridmap%area_src(ni)*tgridmap%frac_src(ni)*re**2
- enddo
-
- sum_fldo = 0.
- do no = 1,ns_o
- sum_fldo = sum_fldo + tgridmap%area_dst(no)*tgridmap%frac_dst(no)*re**2
- end do
-
- ! -----------------------------------------------------------------
- ! Error check1
- ! Compare global sum fld_o to global sum fld_i.
- ! -----------------------------------------------------------------
-
- if ( .not. zero_out .and. (trim(mksrf_gridtype) == 'global') ) then
- if ( abs(sum_fldo/sum_fldi-1.) > relerr ) then
- write (6,*) 'MKLANWAT error: input field not conserved'
- write (6,'(a30,e20.10)') 'global sum output field = ',sum_fldo
- write (6,'(a30,e20.10)') 'global sum input field = ',sum_fldi
- stop
- end if
- end if
+ allocate(mask_r8(ns_i), stat=ier)
+ if (ier/=0) call abort()
+ mask_r8 = tdomain%mask
+ call gridmap_check( tgridmap, mask_r8, frac_dst, subname )
! -----------------------------------------------------------------
! Error check2
@@ -396,6 +375,8 @@ subroutine mkwetlnd(ldomain, mapfname, datfname, ndiag, zero_out, swmp_o)
if ( .not. zero_out )then
call gridmap_clean(tgridmap)
deallocate (swmp_i)
+ deallocate (frac_dst)
+ deallocate (mask_r8)
end if
write (6,*) 'Successfully made %wetland'
@@ -444,6 +425,8 @@ subroutine mklakparams(ldomain, mapfname, datfname, ndiag, &
type(gridmap_type) :: tgridmap
type(domain_type) :: tdomain ! local domain
real(r8), allocatable :: data_i(:) ! data on input grid
+ real(r8), allocatable :: frac_dst(:) ! output fractions
+ real(r8), allocatable :: mask_r8(:) ! float of tdomain%mask
integer :: ncid,varid ! input netCDF id's
integer :: ier ! error status
@@ -462,7 +445,16 @@ subroutine mklakparams(ldomain, mapfname, datfname, ndiag, &
call domain_read(tdomain,datfname)
call gridmap_mapread(tgridmap, mapfname )
- call gridmap_check( tgridmap, subname )
+
+ ! Obtain frac_dst
+ allocate(frac_dst(ldomain%ns), stat=ier)
+ if (ier/=0) call abort()
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
+ allocate(mask_r8(tdomain%ns), stat=ier)
+ if (ier/=0) call abort()
+ mask_r8 = tdomain%mask
+ call gridmap_check( tgridmap, mask_r8, frac_dst, subname )
call domain_checksame( tdomain, ldomain, tgridmap )
@@ -482,14 +474,14 @@ subroutine mklakparams(ldomain, mapfname, datfname, ndiag, &
call check_ret(nf_inq_varid (ncid, 'LAKEDEPTH', varid), subname)
call check_ret(nf_get_var_double (ncid, varid, data_i), subname)
- call gridmap_areaave(tgridmap, data_i, lakedepth_o, nodata=10._r8)
+ call gridmap_areaave_srcmask(tgridmap, data_i, lakedepth_o, nodata=10._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
! Check validity of output data
if (min_bad(lakedepth_o, min_valid_lakedepth, 'lakedepth')) then
stop
end if
- call output_diagnostics_continuous(data_i, lakedepth_o, tgridmap, "Lake Depth", "m", ndiag)
+ call output_diagnostics_continuous(data_i, lakedepth_o, tgridmap, "Lake Depth", "m", ndiag, tdomain%mask, frac_dst)
! -----------------------------------------------------------------
! Close files and deallocate dynamic memory
@@ -499,6 +491,8 @@ subroutine mklakparams(ldomain, mapfname, datfname, ndiag, &
call domain_clean(tdomain)
call gridmap_clean(tgridmap)
deallocate (data_i)
+ deallocate (frac_dst)
+ deallocate (mask_r8)
write (6,*) 'Successfully made lake parameters'
write (6,*)
diff --git a/tools/mksurfdata_map/src/mkpeatMod.F90 b/tools/mksurfdata_map/src/mkpeatMod.F90
index 72ebec7d6d..974566a056 100644
--- a/tools/mksurfdata_map/src/mkpeatMod.F90
+++ b/tools/mksurfdata_map/src/mkpeatMod.F90
@@ -69,6 +69,8 @@ subroutine mkpeat(ldomain, mapfname, datfname, ndiag, peat_o)
type(gridmap_type) :: tgridmap
type(domain_type) :: tdomain ! local domain
real(r8), allocatable :: data_i(:) ! data on input grid
+ real(r8), allocatable :: frac_dst(:) ! output fractions
+ real(r8), allocatable :: mask_r8(:) ! float of tdomain%mask
integer :: ncid,varid ! input netCDF id's
integer :: ier ! error status
@@ -87,7 +89,16 @@ subroutine mkpeat(ldomain, mapfname, datfname, ndiag, peat_o)
call domain_read( tdomain, datfname )
call gridmap_mapread( tgridmap, mapfname )
- call gridmap_check( tgridmap, subname )
+
+ ! Obtain frac_dst
+ allocate(frac_dst(ldomain%ns), stat=ier)
+ if (ier/=0) call abort()
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
+ allocate(mask_r8(tdomain%ns), stat=ier)
+ if (ier/=0) call abort()
+ mask_r8 = tdomain%mask
+ call gridmap_check( tgridmap, mask_r8, frac_dst, subname )
call domain_checksame( tdomain, ldomain, tgridmap )
@@ -107,7 +118,7 @@ subroutine mkpeat(ldomain, mapfname, datfname, ndiag, peat_o)
call check_ret(nf_inq_varid (ncid, 'peatf', varid), subname)
call check_ret(nf_get_var_double (ncid, varid, data_i), subname)
- call gridmap_areaave(tgridmap, data_i, peat_o, nodata=0._r8)
+ call gridmap_areaave_srcmask(tgridmap, data_i, peat_o, nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
! Check validity of output data
if (min_bad(peat_o, min_valid, 'peat') .or. &
@@ -115,7 +126,7 @@ subroutine mkpeat(ldomain, mapfname, datfname, ndiag, peat_o)
stop
end if
- call output_diagnostics_area(data_i, peat_o, tgridmap, "Peat", percent=.false., ndiag=ndiag)
+ call output_diagnostics_area(data_i, peat_o, tgridmap, "Peat", percent=.false., ndiag=ndiag, mask_src=tdomain%mask, frac_dst=frac_dst)
! -----------------------------------------------------------------
! Close files and deallocate dynamic memory
@@ -125,6 +136,8 @@ subroutine mkpeat(ldomain, mapfname, datfname, ndiag, peat_o)
call domain_clean(tdomain)
call gridmap_clean(tgridmap)
deallocate (data_i)
+ deallocate (frac_dst)
+ deallocate (mask_r8)
write (6,*) 'Successfully made peat'
write (6,*)
diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90
index 35928af530..3a12c38cdf 100644
--- a/tools/mksurfdata_map/src/mkpftMod.F90
+++ b/tools/mksurfdata_map/src/mkpftMod.F90
@@ -234,12 +234,11 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, &
use mkvarctl
use mkncdio
use mkpctPftTypeMod, only : pct_pft_type
- use mkpftUtilsMod, only : convert_from_p2g
use mkpftConstantsMod, only : natpft_lb, natpft_ub, num_cft, cft_lb, cft_ub
!
! !ARGUMENTS:
implicit none
- type(domain_type), intent(inout) :: ldomain
+ type(domain_type), intent(in) :: ldomain
character(len=*) , intent(in) :: mapfname ! input mapping file name
character(len=*) , intent(in) :: fpft ! input pft dataset file name
integer , intent(in) :: ndiag ! unit number for diag out
@@ -266,6 +265,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, &
real(r8), allocatable :: pctnatveg_o(:) ! output grid: natural veg percent (% of grid cell)
real(r8), allocatable :: pctcrop_i(:) ! input grid: all crop percent (% of grid cell)
real(r8), allocatable :: pctcrop_o(:) ! output grid: all crop percent (% of grid cell)
+ real(r8), allocatable :: frac_dst(:) ! output fractions
real(r8), allocatable :: pct_cft_i(:,:) ! input grid: CFT (Crop Functional Type) percent (% of landunit cell)
real(r8), allocatable :: temp_i(:,:) ! input grid: temporary 2D variable to read in
real(r8), allocatable :: pct_cft_o(:,:) ! output grid: CFT (Crop Functional Type) percent (% of landunit cell)
@@ -447,6 +447,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, &
pctnatveg_o(ns_o), &
pctcrop_i(ns_i), &
pctcrop_o(ns_o), &
+ frac_dst(ns_o), &
pct_cft_i(ns_i,1:num_cft), &
pct_cft_o(ns_o,1:num_cft), &
pct_nat_pft_i(ns_i,0:num_natpft), &
@@ -541,26 +542,26 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, &
call domain_checksame( tdomain, ldomain, tgridmap )
+ ! Obtain frac_dst
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
! Area-average percent cover on input grid [pctpft_i] to output grid
! [pctpft_o] and correct [pctpft_o] according to land landmask
! Note that percent cover is in terms of total grid area.
-
- do no = 1,ns_o
- pctlnd_o(no) = tgridmap%frac_dst(no) * 100._r8
- ldomain%frac(no) = tgridmap%frac_dst(no)
- end do
+ pctlnd_o(:) = frac_dst(:) * 100._r8
! New format with extra variables on input
- call gridmap_areaave(tgridmap, pctnatveg_i, pctnatveg_o, nodata=0._r8)
- call gridmap_areaave(tgridmap, pctcrop_i, pctcrop_o, nodata=0._r8)
+ call gridmap_areaave_srcmask(tgridmap, pctnatveg_i, pctnatveg_o, nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
+ call gridmap_areaave_srcmask(tgridmap, pctcrop_i, pctcrop_o, nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
!
! If specific PFT/CFT's are NOT prescribed set them from the input file
!
if ( .not. use_input_pft )then
do m = 0, num_natpft
- call gridmap_areaave_scs(tgridmap, pct_nat_pft_i(:,m), pct_nat_pft_o(:,m), &
- nodata=0._r8,src_wt=pctnatveg_i*0.01_r8,dst_wt=pctnatveg_o*0.01_r8)
+ call gridmap_areaave_scs(tgridmap, pct_nat_pft_i(:,m), &
+ pct_nat_pft_o(:,m), nodata=0._r8, &
+ src_wt=pctnatveg_i*0.01_r8*tdomain%mask, &
+ dst_wt=pctnatveg_o*0.01_r8, frac_dst=frac_dst)
do no = 1,ns_o
if (pctlnd_o(no) < 1.0e-6 .or. pctnatveg_o(no) < 1.0e-6) then
if (m == 0) then
@@ -573,7 +574,8 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, &
end do
do m = 1, num_cft
call gridmap_areaave_scs(tgridmap, pct_cft_i(:,m), pct_cft_o(:,m), &
- nodata=0._r8,src_wt=pctcrop_i*0.01_r8,dst_wt=pctcrop_o*0.01_r8)
+ nodata=0._r8, src_wt=pctcrop_i*0.01_r8*tdomain%mask, &
+ dst_wt=pctcrop_o*0.01_r8, frac_dst=frac_dst)
do no = 1,ns_o
if (pctlnd_o(no) < 1.0e-6 .or. pctcrop_o(no) < 1.0e-6) then
if (m == 1) then
@@ -709,7 +711,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, &
garea_i = garea_i + tgridmap%area_src(ni)*re**2
do m = 0, numpft_i - 1
gpft_i(m) = gpft_i(m) + pctpft_i(ni,m)*tgridmap%area_src(ni)*&
- tgridmap%frac_src(ni)*re**2
+ tdomain%mask(ni)*re**2
end do
end do
if ( allocated(pctpft_i) ) deallocate (pctpft_i)
@@ -722,7 +724,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, &
garea_o = garea_o + tgridmap%area_dst(no)*re**2
do m = 0, numpft_i - 1
gpft_o(m) = gpft_o(m) + pctpft_o(no,m)*tgridmap%area_dst(no)*&
- tgridmap%frac_dst(no)*re**2
+ frac_dst(no)*re**2
end do
end do
@@ -746,7 +748,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, &
1002 format (1x,a35,f16.3,f17.3)
call shr_sys_flush(ndiag)
- deallocate(gpft_i, gpft_o)
+ deallocate(gpft_i, gpft_o, frac_dst)
end if
deallocate( pctnatpft_i )
diff --git a/tools/mksurfdata_map/src/mksoilMod.F90 b/tools/mksurfdata_map/src/mksoilMod.F90
index e73c611308..959749ca1a 100644
--- a/tools/mksurfdata_map/src/mksoilMod.F90
+++ b/tools/mksurfdata_map/src/mksoilMod.F90
@@ -181,6 +181,8 @@ subroutine mksoiltex(ldomain, mapfname, datfname, ndiag, sand_o, clay_o)
real(r8), allocatable :: sand_i(:,:) ! input grid: percent sand
real(r8), allocatable :: clay_i(:,:) ! input grid: percent clay
real(r8), allocatable :: mapunit_i(:) ! input grid: igbp soil mapunits
+ real(r8), allocatable :: frac_dst(:) ! output fractions
+ real(r8), allocatable :: mask_r8(:) ! float of tdomain%mask
integer, parameter :: num=2 ! set soil mapunit number
integer :: wsti(num) ! index to 1st and 2nd largest wst
integer, parameter :: nlsm=4 ! number of soil textures
@@ -259,6 +261,11 @@ subroutine mksoiltex(ldomain, mapfname, datfname, ndiag, sand_o, clay_o)
call domain_checksame( tdomain, ldomain, tgridmap )
+ ! Obtain frac_dst
+ allocate(frac_dst(ns_o), stat=ier)
+ if (ier/=0) call abort()
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
! kmap_max are the maximum number of mapunits that will consider on
! any output gridcell - this is set currently above and can be changed
! kmap(:) are the mapunit values on the input grid
@@ -268,9 +275,10 @@ subroutine mksoiltex(ldomain, mapfname, datfname, ndiag, sand_o, clay_o)
novr(:) = 0
do n = 1,tgridmap%ns
ni = tgridmap%src_indx(n)
- no = tgridmap%dst_indx(n)
- wt = tgridmap%wovr(n)
- novr(no) = novr(no) + 1
+ if (tdomain%mask(ni) > 0) then
+ no = tgridmap%dst_indx(n)
+ novr(no) = novr(no) + 1
+ end if
end do
maxovr = maxval(novr(:))
kmap_max = min(maxovr,max(kmap_max_min,km_mx_ns_prod/ns_o))
@@ -294,31 +302,28 @@ subroutine mksoiltex(ldomain, mapfname, datfname, ndiag, sand_o, clay_o)
do n = 1,tgridmap%ns
ni = tgridmap%src_indx(n)
no = tgridmap%dst_indx(n)
- wt = tgridmap%wovr(n)
- if (tgridmap%frac_src(ni) > 0) then
+ wt = tgridmap%wovr(n) * tdomain%mask(ni)
+ if (wt > 0._r8) then
k = mapunit_i(ni)
- else
- k = 0
- end if
- found = .false.
- do l = 0,kmax(no)
- if (k == kmap(l,no)) then
- kwgt(l,no) = kwgt(l,no) + wt
- kmap(l,no) = k
- found = .true.
- exit
- end if
- end do
- if (.not. found) then
- kmax(no) = kmax(no) + 1
- if (kmax(no) > kmap_max) then
- write(6,*)'kmax is > kmap_max= ',kmax(no), 'kmap_max = ', &
- kmap_max,' for no = ',no
- write(6,*)'reset kmap_max in mksoilMod to a greater value'
- stop
+ found = .false.
+ do l = 0,kmax(no)
+ if (k == kmap(l,no)) then
+ kwgt(l,no) = kwgt(l,no) + wt
+ found = .true.
+ exit
+ end if
+ end do
+ if (.not. found) then
+ kmax(no) = kmax(no) + 1
+ if (kmax(no) > kmap_max) then
+ write(6,*)'kmax is > kmap_max= ',kmax(no), 'kmap_max = ', &
+ kmap_max,' for no = ',no
+ write(6,*)'reset kmap_max in mksoilMod to a greater value'
+ stop
+ end if
+ kmap(kmax(no),no) = k
+ kwgt(kmax(no),no) = wt
end if
- kmap(kmax(no),no) = k
- kwgt(kmax(no),no) = wt
end if
enddo
@@ -386,29 +391,10 @@ subroutine mksoiltex(ldomain, mapfname, datfname, ndiag, sand_o, clay_o)
! Global sum of output field
- sum_fldi = 0.0_r8
- do ni = 1,ns_i
- sum_fldi = sum_fldi + tgridmap%area_src(ni)*tgridmap%frac_src(ni)*re**2
- enddo
-
- sum_fldo = 0.
- do no = 1,ns_o
- sum_fldo = sum_fldo + tgridmap%area_dst(no)*tgridmap%frac_dst(no)*re**2
- end do
-
- ! -----------------------------------------------------------------
- ! Error check1
- ! Compare global sum fld_o to global sum fld_i.
- ! -----------------------------------------------------------------
-
- if ( trim(mksrf_gridtype) == 'global') then
- if ( abs(sum_fldo/sum_fldi-1.) > relerr ) then
- write (6,*) 'MKSOILTEX error: input field not conserved'
- write (6,'(a30,e20.10)') 'global sum output field = ',sum_fldo
- write (6,'(a30,e20.10)') 'global sum input field = ',sum_fldi
- stop
- end if
- end if
+ allocate(mask_r8(ns_i), stat=ier)
+ if (ier/=0) call abort()
+ mask_r8 = tdomain%mask
+ call gridmap_check( tgridmap, mask_r8, frac_dst, subname )
! -----------------------------------------------------------------
! Error check2
@@ -444,7 +430,7 @@ subroutine mksoiltex(ldomain, mapfname, datfname, ndiag, sand_o, clay_o)
' not assigned to soil type for input grid lon,lat,layer = ',ni,l
call abort()
101 continue
- gast_i(m) = gast_i(m) + tgridmap%area_src(ni)*tgridmap%frac_src(ni)*re**2
+ gast_i(m) = gast_i(m) + tgridmap%area_src(ni)*tdomain%mask(ni)*re**2
end do
end do
@@ -472,7 +458,7 @@ subroutine mksoiltex(ldomain, mapfname, datfname, ndiag, sand_o, clay_o)
' not assigned to soil type for output grid lon,lat,layer = ',no,l
call abort()
102 continue
- gast_o(m) = gast_o(m) + tgridmap%area_dst(no)*tgridmap%frac_dst(no)*re**2
+ gast_o(m) = gast_o(m) + tgridmap%area_dst(no)*frac_dst(no)*re**2
end do
end do
@@ -510,6 +496,8 @@ subroutine mksoiltex(ldomain, mapfname, datfname, ndiag, sand_o, clay_o)
call gridmap_clean(tgridmap)
deallocate (kmap, kwgt, kmax, wst)
deallocate (sand_i,clay_i,mapunit_i)
+ deallocate (frac_dst)
+ deallocate (mask_r8)
end if
@@ -600,6 +588,8 @@ subroutine mksoilcol(ldomain, mapfname, datfname, ndiag, &
real(r8), allocatable :: gast_i(:) ! global area, by surface type
real(r8), allocatable :: gast_o(:) ! global area, by surface type
integer , allocatable :: soil_color_i(:) ! input grid: BATS soil color
+ real(r8), allocatable :: frac_dst(:) ! output fractions
+ real(r8), allocatable :: mask_r8(:) ! float of tdomain%mask
real(r8) :: sum_fldi ! global sum of dummy input fld
real(r8) :: sum_fldo ! global sum of dummy output fld
character(len=35), allocatable :: col(:) ! name of each color
@@ -625,6 +615,8 @@ subroutine mksoilcol(ldomain, mapfname, datfname, ndiag, &
ns_i = tdomain%ns
allocate(soil_color_i(ns_i), stat=ier)
if (ier/=0) call abort()
+ allocate(frac_dst(ns_o), stat=ier)
+ if (ier/=0) call abort()
write (6,*) 'Open soil color file: ', trim(datfname)
call check_ret(nf_open(datfname, 0, ncid), subname)
@@ -697,6 +689,9 @@ subroutine mksoilcol(ldomain, mapfname, datfname, ndiag, &
call domain_checksame( tdomain, ldomain, tgridmap )
+ ! Obtain frac_dst
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
! Determine dominant soil color for each output cell
call dominant_soil_color( &
@@ -708,29 +703,10 @@ subroutine mksoilcol(ldomain, mapfname, datfname, ndiag, &
! Global sum of output field
- sum_fldi = 0.0_r8
- do ni = 1,ns_i
- sum_fldi = sum_fldi + tgridmap%area_src(ni) * tgridmap%frac_src(ni)
- enddo
-
- sum_fldo = 0.
- do no = 1,ns_o
- sum_fldo = sum_fldo + tgridmap%area_dst(no) * tgridmap%frac_dst(no)
- end do
-
- ! -----------------------------------------------------------------
- ! Error check1
- ! Compare global sum fld_o to global sum fld_i.
- ! -----------------------------------------------------------------
-
- if ( trim(mksrf_gridtype) == 'global') then
- if ( abs(sum_fldo/sum_fldi-1.) > relerr ) then
- write (6,*) 'MKSOILCOL error: input field not conserved'
- write (6,'(a30,e20.10)') 'global sum output field = ',sum_fldo
- write (6,'(a30,e20.10)') 'global sum input field = ',sum_fldi
- stop
- end if
- end if
+ allocate(mask_r8(ns_i), stat=ier)
+ if (ier/=0) call abort()
+ mask_r8 = tdomain%mask
+ call gridmap_check( tgridmap, mask_r8, frac_dst, subname )
! -----------------------------------------------------------------
! Error check2
@@ -740,13 +716,13 @@ subroutine mksoilcol(ldomain, mapfname, datfname, ndiag, &
gast_i(:) = 0.
do ni = 1,ns_i
k = soil_color_i(ni)
- gast_i(k) = gast_i(k) + tgridmap%area_src(ni)*tgridmap%frac_src(ni)*re**2
+ gast_i(k) = gast_i(k) + tgridmap%area_src(ni)*tdomain%mask(ni)*re**2
end do
gast_o(:) = 0.
do no = 1,ns_o
k = soil_color_o(no)
- gast_o(k) = gast_o(k) + tgridmap%area_dst(no)*tgridmap%frac_dst(no)*re**2
+ gast_o(k) = gast_o(k) + tgridmap%area_dst(no)*frac_dst(no)*re**2
end do
! area comparison
@@ -777,7 +753,7 @@ subroutine mksoilcol(ldomain, mapfname, datfname, ndiag, &
if ( soil_color == unsetcol )then
call gridmap_clean(tgridmap)
end if
- deallocate (soil_color_i,gast_i,gast_o,col)
+ deallocate (soil_color_i,gast_i,gast_o,col, frac_dst, mask_r8)
write (6,*) 'Successfully made soil color classes'
write (6,*)
@@ -824,6 +800,7 @@ subroutine mkorganic(ldomain, mapfname, datfname, ndiag, organic_o)
type(gridmap_type) :: tgridmap
type(domain_type) :: tdomain ! local domain
real(r8), allocatable :: organic_i(:,:) ! input grid: total column organic matter
+ real(r8), allocatable :: frac_dst(:) ! output fractions
real(r8) :: sum_fldi ! global sum of dummy input fld
real(r8) :: sum_fldo ! global sum of dummy output fld
real(r8) :: gomlev_i ! input grid: global organic on lev
@@ -859,6 +836,9 @@ subroutine mkorganic(ldomain, mapfname, datfname, ndiag, organic_o)
allocate(organic_i(ns_i,nlay),stat=ier)
if (ier/=0) call abort()
+ allocate(frac_dst(ldomain%ns),stat=ier)
+ if (ier/=0) call abort()
+
if (nlay /= nlevsoi) then
write(6,*)'nlay, nlevsoi= ',nlay,nlevsoi,' do not match'
stop
@@ -877,8 +857,11 @@ subroutine mkorganic(ldomain, mapfname, datfname, ndiag, organic_o)
call domain_checksame( tdomain, ldomain, tgridmap )
+ ! Obtain frac_dst
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
do lev = 1,nlay
- call gridmap_areaave(tgridmap, organic_i(:,lev), organic_o(:,lev), nodata=0._r8)
+ call gridmap_areaave_srcmask(tgridmap, organic_i(:,lev), organic_o(:,lev), nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
end do
do lev = 1,nlevsoi
@@ -922,6 +905,7 @@ subroutine mkorganic(ldomain, mapfname, datfname, ndiag, organic_o)
call domain_clean(tdomain)
call gridmap_clean(tgridmap)
deallocate (organic_i)
+ deallocate (frac_dst)
write (6,*) 'Successfully made organic matter'
call shr_sys_flush(6)
@@ -1004,6 +988,8 @@ subroutine mkfmax(ldomain, mapfname, datfname, ndiag, fmax_o)
type(gridmap_type) :: tgridmap
type(domain_type) :: tdomain ! local domain
real(r8), allocatable :: fmax_i(:) ! input grid: percent fmax
+ real(r8), allocatable :: frac_dst(:) ! output fractions
+ real(r8), allocatable :: mask_r8(:) ! float of tdomain%mask
real(r8) :: sum_fldi ! global sum of dummy input fld
real(r8) :: sum_fldo ! global sum of dummy output fld
real(r8) :: gfmax_i ! input grid: global fmax
@@ -1028,9 +1014,11 @@ subroutine mkfmax(ldomain, mapfname, datfname, ndiag, fmax_o)
call domain_read(tdomain,datfname)
ns_i = tdomain%ns
+ ns_o = ldomain%ns
allocate(fmax_i(ns_i), stat=ier)
if (ier/=0) call abort()
- ns_o = ldomain%ns
+ allocate(frac_dst(ns_o), stat=ier)
+ if (ier/=0) call abort()
write (6,*) 'Open soil fmax file: ', trim(datfname)
call check_ret(nf_open(datfname, 0, ncid), subname)
@@ -1048,12 +1036,15 @@ subroutine mkfmax(ldomain, mapfname, datfname, ndiag, fmax_o)
call domain_checksame( tdomain, ldomain, tgridmap )
+ ! Obtain frac_dst
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
! Determine fmax_o on output grid
! In points with no data, use globalAvg
! (WJS (3-11-13): use real(.365783,r8) rather than .365783_r8 to maintain bfb results
! with old code)
- call gridmap_areaave(tgridmap, fmax_i, fmax_o, nodata=real(.365783,r8))
+ call gridmap_areaave_srcmask(tgridmap, fmax_i, fmax_o, nodata=real(.365783,r8), mask_src=tdomain%mask, frac_dst=frac_dst)
! Check for conservation
@@ -1069,29 +1060,10 @@ subroutine mkfmax(ldomain, mapfname, datfname, ndiag, fmax_o)
! Global sum of output field -- must multiply by fraction of
! output grid that is land as determined by input grid
- sum_fldi = 0.0_r8
- do ni = 1,ns_i
- sum_fldi = sum_fldi + tgridmap%area_src(ni) * tgridmap%frac_src(ni)
- enddo
-
- sum_fldo = 0.
- do no = 1,ns_o
- sum_fldo = sum_fldo + tgridmap%area_dst(no) * tgridmap%frac_dst(no)
- end do
-
- ! -----------------------------------------------------------------
- ! Error check1
- ! Compare global sum fld_o to global sum fld_i.
- ! -----------------------------------------------------------------
-
- if ( trim(mksrf_gridtype) == 'global') then
- if ( abs(sum_fldo/sum_fldi-1.) > relerr ) then
- write (6,*) 'MKFMAX error: input field not conserved'
- write (6,'(a30,e20.10)') 'global sum output field = ',sum_fldo
- write (6,'(a30,e20.10)') 'global sum input field = ',sum_fldi
- stop
- end if
- end if
+ allocate(mask_r8(ns_i), stat=ier)
+ if (ier/=0) call abort()
+ mask_r8 = tdomain%mask
+ call gridmap_check( tgridmap, mask_r8, frac_dst, subname )
! -----------------------------------------------------------------
! Error check2
@@ -1103,7 +1075,7 @@ subroutine mkfmax(ldomain, mapfname, datfname, ndiag, fmax_o)
do ni = 1,ns_i
garea_i = garea_i + tgridmap%area_src(ni)*re**2
gfmax_i = gfmax_i + fmax_i(ni)*(tgridmap%area_src(ni)/100.)* &
- tgridmap%frac_src(ni)*re**2
+ tdomain%mask(ni)*re**2
end do
gfmax_o = 0.
@@ -1111,12 +1083,10 @@ subroutine mkfmax(ldomain, mapfname, datfname, ndiag, fmax_o)
do no = 1,ns_o
garea_o = garea_o + tgridmap%area_dst(no)*re**2
gfmax_o = gfmax_o + fmax_o(no)*(tgridmap%area_dst(no)/100.) * &
- tgridmap%frac_dst(no)*re**2
- if ((tgridmap%mask_dst(no) > 0)) then
- if ((tgridmap%frac_dst(no) < 0.0) .or. (tgridmap%frac_dst(no) > 1.0001)) then
- write(6,*) "ERROR:: frac out of range: ", tgridmap%frac_dst(no),no
- stop
- end if
+ frac_dst(no)*re**2
+ if ((frac_dst(no) < 0.0) .or. (frac_dst(no) > 1.0001)) then
+ write(6,*) "ERROR:: frac_dst out of range: ", frac_dst(no),no
+ stop
end if
end do
@@ -1148,6 +1118,8 @@ subroutine mkfmax(ldomain, mapfname, datfname, ndiag, fmax_o)
call domain_clean(tdomain)
call gridmap_clean(tgridmap)
deallocate (fmax_i)
+ deallocate (frac_dst)
+ deallocate (mask_r8)
end subroutine mkfmax
diff --git a/tools/mksurfdata_map/src/mksoilUtilsMod.F90 b/tools/mksurfdata_map/src/mksoilUtilsMod.F90
index e8c672590d..122cfd45d5 100644
--- a/tools/mksurfdata_map/src/mksoilUtilsMod.F90
+++ b/tools/mksurfdata_map/src/mksoilUtilsMod.F90
@@ -84,7 +84,7 @@ subroutine dominant_soil_color(tgridmap, mask_i, soil_color_i, nsoicol, soil_col
do n = 1,tgridmap%ns
ni = tgridmap%src_indx(n)
no = tgridmap%dst_indx(n)
- wt = tgridmap%wovr(n)
+ wt = tgridmap%wovr(n) * mask_i(ni)
k = soil_color_i(ni) * mask_i(ni)
wst(k,no) = wst(k,no) + wt
enddo
diff --git a/tools/mksurfdata_map/src/mksoildepthMod.F90 b/tools/mksurfdata_map/src/mksoildepthMod.F90
index 19a13ec8ec..521ac2c6f0 100644
--- a/tools/mksurfdata_map/src/mksoildepthMod.F90
+++ b/tools/mksurfdata_map/src/mksoildepthMod.F90
@@ -69,6 +69,8 @@ subroutine mksoildepth(ldomain, mapfname, datfname, ndiag, soildepth_o)
type(gridmap_type) :: tgridmap
type(domain_type) :: tdomain ! local domain
real(r8), allocatable :: data_i(:) ! data on input grid
+ real(r8), allocatable :: frac_dst(:) ! output fractions
+ real(r8), allocatable :: mask_r8(:) ! float of tdomain%mask
integer :: ncid,varid ! input netCDF id's
integer :: ier ! error status
@@ -89,7 +91,16 @@ subroutine mksoildepth(ldomain, mapfname, datfname, ndiag, soildepth_o)
call domain_read( tdomain, datfname )
call gridmap_mapread( tgridmap, mapfname )
- call gridmap_check( tgridmap, subname )
+
+ ! Obtain frac_dst
+ allocate(frac_dst(ldomain%ns), stat=ier)
+ if (ier/=0) call abort()
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
+ allocate(mask_r8(tdomain%ns), stat=ier)
+ if (ier/=0) call abort()
+ mask_r8 = tdomain%mask
+ call gridmap_check( tgridmap, mask_r8, frac_dst, subname )
call domain_checksame( tdomain, ldomain, tgridmap )
@@ -130,7 +141,7 @@ subroutine mksoildepth(ldomain, mapfname, datfname, ndiag, soildepth_o)
! call check_ret(nf_inq_varid (ncid, 'Avg_Depth_Median', varid), subname)
call check_ret(nf_inq_varid (ncid, varname, varid), subname)
call check_ret(nf_get_var_double (ncid, varid, data_i), subname)
- call gridmap_areaave(tgridmap, data_i, soildepth_o, nodata=0._r8)
+ call gridmap_areaave_srcmask(tgridmap, data_i, soildepth_o, nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
! Check validity of output data
if (min_bad(soildepth_o, min_valid, 'soildepth') .or. &
@@ -138,7 +149,7 @@ subroutine mksoildepth(ldomain, mapfname, datfname, ndiag, soildepth_o)
stop
end if
- call output_diagnostics_area(data_i, soildepth_o, tgridmap, "Soildepth", percent=.false., ndiag=ndiag)
+ call output_diagnostics_area(data_i, soildepth_o, tgridmap, "Soildepth", percent=.false., ndiag=ndiag, mask_src=tdomain%mask, frac_dst=frac_dst)
! -----------------------------------------------------------------
! Close files and deallocate dynamic memory
@@ -148,6 +159,8 @@ subroutine mksoildepth(ldomain, mapfname, datfname, ndiag, soildepth_o)
call domain_clean(tdomain)
call gridmap_clean(tgridmap)
deallocate (data_i)
+ deallocate (frac_dst)
+ deallocate (mask_r8)
write (6,*) 'Successfully made soildepth'
write (6,*)
diff --git a/tools/mksurfdata_map/src/mktopostatsMod.F90 b/tools/mksurfdata_map/src/mktopostatsMod.F90
index cc1f541354..2ecd705f4c 100644
--- a/tools/mksurfdata_map/src/mktopostatsMod.F90
+++ b/tools/mksurfdata_map/src/mktopostatsMod.F90
@@ -100,7 +100,8 @@ subroutine mktopostats(ldomain, mapfname, datfname, ndiag, topo_stddev_o, slope_
call domain_read(tdomain,datfname)
call gridmap_mapread(tgridmap, mapfname )
- call gridmap_check( tgridmap, subname )
+
+ call gridmap_check( tgridmap, tgridmap%frac_src, tgridmap%frac_dst, subname )
call domain_checksame( tdomain, ldomain, tgridmap )
@@ -141,9 +142,15 @@ subroutine mktopostats(ldomain, mapfname, datfname, ndiag, topo_stddev_o, slope_
if ( .not. bypass_reading )then
call check_ret(nf_inq_varid (ncid, 'SLOPE', varid), subname)
call check_ret(nf_get_var_double (ncid, varid, data_i), subname)
- call gridmap_areaave(tgridmap, data_i, slope_o, nodata=0._r8)
- call output_diagnostics_continuous(data_i, slope_o, tgridmap, "Slope", "degrees", ndiag)
+ ! Subr. gridmap_areaave_no_srcmask should NOT be used in general. We have
+ ! kept it to support the rare raw data files for which we have masking on
+ ! the mapping file and, therefore, we do not explicitly pass the src_mask
+ ! as an argument. In general, users are advised to use subroutine
+ ! gridmap_areaave_srcmask.
+ call gridmap_areaave_no_srcmask(tgridmap, data_i, slope_o, nodata=0._r8)
+
+ call output_diagnostics_continuous(data_i, slope_o, tgridmap, "Slope", "degrees", ndiag, tdomain%mask, tgridmap%frac_dst)
else
write (6,*) ' Set slope of topography to ', 0.0_r8
slope_o = 0.0_r8
diff --git a/tools/mksurfdata_map/src/mkurbanparCommonMod.F90 b/tools/mksurfdata_map/src/mkurbanparCommonMod.F90
index 907eaf7297..5db84e8351 100644
--- a/tools/mksurfdata_map/src/mkurbanparCommonMod.F90
+++ b/tools/mksurfdata_map/src/mkurbanparCommonMod.F90
@@ -46,7 +46,7 @@ module mkurbanparCommonMod
! !IROUTINE: mkurban_pct
!
! !INTERFACE:
-subroutine mkurban_pct(ldomain, tdomain, tgridmap, urbn_i, urbn_o)
+subroutine mkurban_pct(ldomain, tdomain, tgridmap, urbn_i, urbn_o, frac_dst)
!
! !DESCRIPTION:
! make percent urban on output grid, given percent urban on input grid
@@ -65,6 +65,7 @@ subroutine mkurban_pct(ldomain, tdomain, tgridmap, urbn_i, urbn_o)
type(domain_type) , intent(in) :: tdomain ! local domain
type(gridmap_type), intent(in) :: tgridmap ! local gridmap
real(r8) , intent(in) :: urbn_i(:) ! input grid: percent urban
+ real(r8) , intent(in) :: frac_dst(:) ! output fractions
real(r8) , intent(out):: urbn_o(:) ! output grid: percent urban
!
! !REVISION HISTORY:
@@ -74,6 +75,8 @@ subroutine mkurban_pct(ldomain, tdomain, tgridmap, urbn_i, urbn_o)
!
! !LOCAL VARIABLES:
!EOP
+ integer :: ier ! error status
+ real(r8), allocatable :: mask_r8(:) ! float of tdomain%mask
real(r8) :: sum_fldi ! global sum of dummy input fld
real(r8) :: sum_fldo ! global sum of dummy output fld
integer :: ni,no ! indices
@@ -92,6 +95,12 @@ subroutine mkurban_pct(ldomain, tdomain, tgridmap, urbn_i, urbn_o)
write(6,*) 'ldomain%ns = ', ldomain%ns
stop
end if
+ if (size(frac_dst) /= ldomain%ns) then
+ write(6,*) subname//' ERROR: array size inconsistencies'
+ write(6,*) 'size(frac_dst) = ', size(frac_dst)
+ write(6,*) 'ldomain%ns = ', ldomain%ns
+ stop
+ end if
! Error checks for domain and map consistencies
@@ -102,7 +111,7 @@ subroutine mkurban_pct(ldomain, tdomain, tgridmap, urbn_i, urbn_o)
! and correct according to land landmask
! Note that percent cover is in terms of total grid area.
- call gridmap_areaave(tgridmap, urbn_i, urbn_o, nodata=0._r8)
+ call gridmap_areaave_srcmask(tgridmap, urbn_i, urbn_o, nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
! Check for conservation
@@ -117,32 +126,15 @@ subroutine mkurban_pct(ldomain, tdomain, tgridmap, urbn_i, urbn_o)
! Global sum of output field -- must multiply by fraction of
! output grid that is land as determined by input grid
- sum_fldi = 0.0_r8
- do ni = 1,tdomain%ns
- sum_fldi = sum_fldi + tgridmap%area_src(ni) * tgridmap%frac_src(ni)
- enddo
-
- sum_fldo = 0._r8
- do no = 1, ldomain%ns
- sum_fldo = sum_fldo + tgridmap%area_dst(no) * tgridmap%frac_dst(no)
- end do
-
- ! -----------------------------------------------------------------
- ! Error check1
- ! Compare global sum fld_o to global sum fld_i.
- ! -----------------------------------------------------------------
-
- if (trim(mksrf_gridtype) == 'global') then
- if ( abs(sum_fldo/sum_fldi-1._r8) > relerr ) then
- write (6,*) 'MKURBAN error: input field not conserved'
- write (6,'(a30,e20.10)') 'global sum output field = ',sum_fldo
- write (6,'(a30,e20.10)') 'global sum input field = ',sum_fldi
- stop
- end if
- end if
+ allocate(mask_r8(tdomain%ns), stat=ier)
+ if (ier/=0) call abort()
+ mask_r8 = tdomain%mask
+ call gridmap_check( tgridmap, mask_r8, frac_dst, subname )
! (Error check2 in mkurban_pct_diagnostics, which should be called separately)
+ deallocate (mask_r8)
+
end subroutine mkurban_pct
!-----------------------------------------------------------------------
@@ -152,7 +144,7 @@ end subroutine mkurban_pct
! !IROUTINE: mkurban_pct_diagnostics
!
! !INTERFACE:
-subroutine mkurban_pct_diagnostics(ldomain, tdomain, tgridmap, urbn_i, urbn_o, ndiag, dens_class)
+subroutine mkurban_pct_diagnostics(ldomain, tdomain, tgridmap, urbn_i, urbn_o, ndiag, dens_class, frac_dst)
!
! !DESCRIPTION:
! print diagnostics related to pct urban
@@ -174,6 +166,7 @@ subroutine mkurban_pct_diagnostics(ldomain, tdomain, tgridmap, urbn_i, urbn_o, n
type(gridmap_type), intent(in) :: tgridmap ! local gridmap
real(r8) , intent(in) :: urbn_i(:) ! input grid: percent urban
real(r8) , intent(in) :: urbn_o(:) ! output grid: percent urban
+ real(r8) , intent(in) :: frac_dst(:) ! output fractions
integer , intent(in) :: ndiag ! unit number for diag out
integer , intent(in), optional :: dens_class ! density class
@@ -190,8 +183,17 @@ subroutine mkurban_pct_diagnostics(ldomain, tdomain, tgridmap, urbn_i, urbn_o, n
real(r8) :: gurbn_o ! output grid: global urbn
real(r8) :: garea_o ! output grid: global area
integer :: ni,no,k ! indices
+ character(len=*), parameter :: subname = 'mkurban_pct_diagnostics'
!-----------------------------------------------------------------------
+ ! Error check inputs
+ if (size(frac_dst) /= ldomain%ns) then
+ write(6,*) subname//' ERROR: array size inconsistencies'
+ write(6,*) 'size(frac_dst) = ', size(frac_dst)
+ write(6,*) 'ldomain%ns = ', ldomain%ns
+ stop
+ end if
+
! -----------------------------------------------------------------
! Error check2
! Compare global areas on input and output grids
@@ -205,7 +207,7 @@ subroutine mkurban_pct_diagnostics(ldomain, tdomain, tgridmap, urbn_i, urbn_o, n
do ni = 1, tdomain%ns
garea_i = garea_i + tgridmap%area_src(ni)*re**2
gurbn_i = gurbn_i + urbn_i(ni)*(tgridmap%area_src(ni)/100._r8)*&
- tgridmap%frac_src(ni)*re**2
+ tdomain%mask(ni)*re**2
end do
! Output grid
@@ -216,7 +218,7 @@ subroutine mkurban_pct_diagnostics(ldomain, tdomain, tgridmap, urbn_i, urbn_o, n
do no = 1, ldomain%ns
garea_o = garea_o + tgridmap%area_dst(no)*re**2
gurbn_o = gurbn_o + urbn_o(no)* (tgridmap%area_dst(no)/100._r8)*&
- tgridmap%frac_dst(no)*re**2
+ frac_dst(no)*re**2
end do
! Diagnostic output
@@ -263,6 +265,7 @@ subroutine mkelev(ldomain, mapfname, datfname, varname, ndiag, elev_o)
use mkvarpar
use mkvarctl
use mkncdio
+ use mkdiagnosticsMod, only : output_diagnostics_continuous
!
! !ARGUMENTS:
implicit none
@@ -287,7 +290,7 @@ subroutine mkelev(ldomain, mapfname, datfname, varname, ndiag, elev_o)
type(gridmap_type) :: tgridmap ! local gridmap
real(r8), allocatable :: elev_i(:) ! canyon_height to width ratio in
- real(r8), allocatable :: mask_i(:) ! input grid: mask (0, 1)
+ real(r8), allocatable :: frac_dst(:) ! output fractions
integer :: ns_i,ns_o ! indices
integer :: k,l,n,m,ni ! indices
integer :: ncidi,dimid,varid ! input netCDF id's
@@ -312,6 +315,7 @@ subroutine mkelev(ldomain, mapfname, datfname, varname, ndiag, elev_o)
ns_i = tdomain%ns
allocate(elev_i(ns_i), stat=ier)
+ allocate(frac_dst(ns_o), stat=ier)
if (ier /= 0) then
write(6,*)'mkelev allocation error'; call abort()
end if
@@ -331,17 +335,24 @@ subroutine mkelev(ldomain, mapfname, datfname, varname, ndiag, elev_o)
call domain_checksame( tdomain, ldomain, tgridmap )
+ ! Obtain frac_dst
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
! Determine elev_o on output grid
elev_o(:) = 0.
- call gridmap_areaave(tgridmap, elev_i, elev_o, nodata=0._r8)
+ call gridmap_areaave_srcmask(tgridmap, elev_i, elev_o, nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
+
+ call output_diagnostics_continuous(elev_i, elev_o, tgridmap, "Urban elev variable", "m", ndiag, tdomain%mask, frac_dst)
+
! Deallocate dynamic memory
call domain_clean(tdomain)
call gridmap_clean(tgridmap)
deallocate (elev_i)
+ deallocate (frac_dst)
write (6,*) 'Successfully made elevation'
write (6,*)
diff --git a/tools/mksurfdata_map/src/mkurbanparMod.F90 b/tools/mksurfdata_map/src/mkurbanparMod.F90
index 1733155b50..07319b1f27 100644
--- a/tools/mksurfdata_map/src/mkurbanparMod.F90
+++ b/tools/mksurfdata_map/src/mkurbanparMod.F90
@@ -158,6 +158,7 @@ subroutine mkurban(ldomain, mapfname, datfname, ndiag, zero_out, &
real(r8), allocatable :: urbn_classes_gcell_i(:,:) ! input grid: percent urban in each density class
! (% of total grid cell area)
real(r8), allocatable :: urbn_classes_gcell_o(:,:) ! output grid: percent urban in each density class
+ real(r8), allocatable :: frac_dst(:) ! output fractions
! (% of total grid cell area)
integer , allocatable :: region_i(:) ! input grid: region ID
integer :: ni,no,ns,k ! indices
@@ -180,9 +181,13 @@ subroutine mkurban(ldomain, mapfname, datfname, ndiag, zero_out, &
allocate(urbn_classes_gcell_i(ns, numurbl), &
urbn_classes_gcell_o(ldomain%ns, numurbl), &
+ frac_dst(ldomain%ns), &
stat=ier)
if (ier/=0) call abort()
+ ! Obtain frac_dst
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
write (6,*) 'Open urban file: ', trim(datfname)
call check_ret(nf_open(datfname, 0, ncid), subname)
call check_ret(nf_inq_varid (ncid, 'PCT_URBAN', varid), subname)
@@ -190,7 +195,7 @@ subroutine mkurban(ldomain, mapfname, datfname, ndiag, zero_out, &
! Determine % urban by density class on the output grid
do k = 1, numurbl
- call mkurban_pct(ldomain, tdomain, tgridmap, urbn_classes_gcell_i(:,k), urbn_classes_gcell_o(:,k))
+ call mkurban_pct(ldomain, tdomain, tgridmap, urbn_classes_gcell_i(:,k), urbn_classes_gcell_o(:,k), frac_dst)
end do
! Determine total % urban
@@ -226,7 +231,7 @@ subroutine mkurban(ldomain, mapfname, datfname, ndiag, zero_out, &
do k = 1, numurbl
call mkurban_pct_diagnostics(ldomain, tdomain, tgridmap, &
urbn_classes_gcell_i(:,k), urbn_classes_gcell_o(:,k), &
- ndiag, dens_class=k)
+ ndiag, dens_class=k, frac_dst=frac_dst)
end do
write (6,*) 'Successfully made %urban'
@@ -265,7 +270,7 @@ subroutine mkurban(ldomain, mapfname, datfname, ndiag, zero_out, &
! Determine dominant region for each output cell
- call get_dominant_indices(tgridmap, region_i, region_o, 1, max_region, index_nodata)
+ call get_dominant_indices(tgridmap, region_i, region_o, 1, max_region, index_nodata, mask_src=tdomain%mask)
write (6,*) 'Successfully made urban region'
write (6,*)
@@ -273,14 +278,14 @@ subroutine mkurban(ldomain, mapfname, datfname, ndiag, zero_out, &
! Output diagnostics
call output_diagnostics_index(region_i, region_o, tgridmap, 'Urban Region ID', &
- 1, max_region, ndiag)
+ 1, max_region, ndiag, mask_src=tdomain%mask, frac_dst=frac_dst)
! Deallocate dynamic memory & other clean up
call check_ret(nf_close(ncid), subname)
call domain_clean(tdomain)
call gridmap_clean(tgridmap)
- deallocate (urbn_classes_gcell_i, urbn_classes_gcell_o, region_i)
+ deallocate (urbn_classes_gcell_i, urbn_classes_gcell_o, region_i, frac_dst)
end subroutine mkurban
!-----------------------------------------------------------------------
diff --git a/tools/mksurfdata_map/src/mkvocefMod.F90 b/tools/mksurfdata_map/src/mkvocefMod.F90
index bf4bc33702..03d9dddd3f 100644
--- a/tools/mksurfdata_map/src/mkvocefMod.F90
+++ b/tools/mksurfdata_map/src/mkvocefMod.F90
@@ -76,6 +76,8 @@ subroutine mkvocef(ldomain, mapfname, datfname, ndiag, &
real(r8), allocatable :: ef_shr_i(:) ! input grid: EFs for shrubs
real(r8), allocatable :: ef_grs_i(:) ! input grid: EFs for grasses
real(r8), allocatable :: ef_crp_i(:) ! input grid: EFs for crops
+ real(r8), allocatable :: frac_dst(:) ! output fractions
+ real(r8), allocatable :: mask_r8(:) ! float of tdomain%mask
real(r8) :: sum_fldo ! global sum of dummy input fld
real(r8) :: sum_fldi ! global sum of dummy input fld
integer :: k,n,no,ni,ns_o,ns_i ! indices
@@ -100,7 +102,7 @@ subroutine mkvocef(ldomain, mapfname, datfname, ndiag, &
ns_i = tdomain%ns
allocate(ef_btr_i(ns_i), ef_fet_i(ns_i), ef_fdt_i(ns_i), &
ef_shr_i(ns_i), ef_grs_i(ns_i), ef_crp_i(ns_i), &
- stat=ier)
+ frac_dst(ns_o), stat=ier)
if (ier/=0) call abort()
write (6,*) 'Open VOC file: ', trim(datfname)
@@ -129,14 +131,17 @@ subroutine mkvocef(ldomain, mapfname, datfname, ndiag, &
call domain_checksame( tdomain, ldomain, tgridmap )
+ ! Obtain frac_dst
+ call gridmap_calc_frac_dst(tgridmap, tdomain%mask, frac_dst)
+
! Do mapping from input to output grid
- call gridmap_areaave(tgridmap, ef_btr_i, ef_btr_o, nodata=0._r8)
- call gridmap_areaave(tgridmap, ef_fet_i, ef_fet_o, nodata=0._r8)
- call gridmap_areaave(tgridmap, ef_fdt_i, ef_fdt_o, nodata=0._r8)
- call gridmap_areaave(tgridmap, ef_shr_i, ef_shr_o, nodata=0._r8)
- call gridmap_areaave(tgridmap, ef_grs_i, ef_grs_o, nodata=0._r8)
- call gridmap_areaave(tgridmap, ef_crp_i, ef_crp_o, nodata=0._r8)
+ call gridmap_areaave_srcmask(tgridmap, ef_btr_i, ef_btr_o, nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
+ call gridmap_areaave_srcmask(tgridmap, ef_fet_i, ef_fet_o, nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
+ call gridmap_areaave_srcmask(tgridmap, ef_fdt_i, ef_fdt_o, nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
+ call gridmap_areaave_srcmask(tgridmap, ef_shr_i, ef_shr_o, nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
+ call gridmap_areaave_srcmask(tgridmap, ef_grs_i, ef_grs_o, nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
+ call gridmap_areaave_srcmask(tgridmap, ef_crp_i, ef_crp_o, nodata=0._r8, mask_src=tdomain%mask, frac_dst=frac_dst)
! Check for conservation
@@ -181,24 +186,10 @@ subroutine mkvocef(ldomain, mapfname, datfname, ndiag, &
! Global sum of output field -- must multiply by fraction of
! output grid that is land as determined by input grid
- sum_fldi = 0.0_r8
- do ni = 1,ns_i
- sum_fldi = sum_fldi + tgridmap%area_src(ni) * tgridmap%frac_src(ni)
- enddo
-
- sum_fldo = 0._r8
- do no = 1,ns_o
- sum_fldo = sum_fldo + tgridmap%area_dst(no) * tgridmap%frac_dst(no)
- end do
-
- if ( trim(mksrf_gridtype) == 'global') then
- if ( abs(sum_fldo/sum_fldi-1._r8) > relerr ) then
- write (6,*) 'MKVOCEF error: input field not conserved'
- write (6,'(a30,e20.10)') 'global sum output field = ',sum_fldo
- write (6,'(a30,e20.10)') 'global sum input field = ',sum_fldi
- stop
- end if
- end if
+ allocate(mask_r8(ns_i), stat=ier)
+ if (ier/=0) call abort()
+ mask_r8 = tdomain%mask
+ call gridmap_check( tgridmap, mask_r8, frac_dst, subname )
write (6,*) 'Successfully made VOC Emission Factors'
write (6,*)
@@ -207,7 +198,7 @@ subroutine mkvocef(ldomain, mapfname, datfname, ndiag, &
! Deallocate dynamic memory
deallocate ( ef_btr_i, ef_fet_i, ef_fdt_i, &
- ef_shr_i, ef_grs_i, ef_crp_i )
+ ef_shr_i, ef_grs_i, ef_crp_i, frac_dst, mask_r8 )
call domain_clean(tdomain)
call gridmap_clean(tgridmap)
diff --git a/tools/mksurfdata_map/src/test/mkgridmap_test/test_mkgridmap.pf b/tools/mksurfdata_map/src/test/mkgridmap_test/test_mkgridmap.pf
index 01887cb467..c8eda9d007 100644
--- a/tools/mksurfdata_map/src/test/mkgridmap_test/test_mkgridmap.pf
+++ b/tools/mksurfdata_map/src/test/mkgridmap_test/test_mkgridmap.pf
@@ -48,8 +48,6 @@ contains
@assertEqual([11,11,12,12], this%gridmap%src_indx)
@assertEqual([21,22,22,23], this%gridmap%dst_indx)
@assertEqual([1._r8, 0.5_r8, 0.5_r8, 1._r8], this%gridmap%wovr)
- @assertEqual([1,1], this%gridmap%mask_src)
- @assertEqual([1,1,1], this%gridmap%mask_dst)
@assertEqual([1._r8, 1._r8], this%gridmap%frac_src)
@assertEqual([1._r8, 1._r8, 1._r8], this%gridmap%frac_dst)
@@ -66,8 +64,6 @@ contains
integer, parameter :: src_indx(ns) = [11,11,12,12]
integer, parameter :: dst_indx(ns) = [21,22,22,23]
real(r8), parameter :: wovr(ns) = [1._r8, 0.5_r8, 0.5_r8, 1._r8]
- integer, parameter :: mask_src(na) = [1, 0]
- integer, parameter :: mask_dst(nb) = [0, 1, 1]
real(r8), parameter :: frac_src(na) = [0.1_r8, 0.0_r8]
real(r8), parameter :: frac_dst(nb) = [0.0_r8, 0.1_r8, 0.1_r8]
real(r8), parameter :: area_src(na) = [0.11_r8, 0.12_r8]
@@ -81,8 +77,6 @@ contains
src_indx = src_indx, &
dst_indx = dst_indx, &
wovr = wovr, &
- mask_src = mask_src, &
- mask_dst = mask_dst, &
frac_src = frac_src, &
frac_dst = frac_dst, &
area_src = area_src, &
@@ -98,8 +92,6 @@ contains
@assertEqual(src_indx, this%gridmap%src_indx)
@assertEqual(dst_indx, this%gridmap%dst_indx)
@assertEqual(wovr, this%gridmap%wovr)
- @assertEqual(mask_src, this%gridmap%mask_src)
- @assertEqual(mask_dst, this%gridmap%mask_dst)
@assertEqual(frac_src, this%gridmap%frac_src)
@assertEqual(frac_dst, this%gridmap%frac_dst)
@assertEqual(yc_src, this%gridmap%yc_src)
diff --git a/tools/mksurfdata_map/src/test/mkindexmap_test/test_mkindexmap.pf b/tools/mksurfdata_map/src/test/mkindexmap_test/test_mkindexmap.pf
index 57c0a86e97..98e9590478 100644
--- a/tools/mksurfdata_map/src/test/mkindexmap_test/test_mkindexmap.pf
+++ b/tools/mksurfdata_map/src/test/mkindexmap_test/test_mkindexmap.pf
@@ -126,7 +126,8 @@ contains
gridmap = this%gridmap, &
src_array = [13, 12, 11], &
dst_array = dst_array, &
- nodata = NODATA_VAL)
+ nodata = NODATA_VAL, &
+ mask_src = [1, 1, 1])
@assertEqual([13], dst_array)
end subroutine getMaxIndices_maxFirst
@@ -142,7 +143,8 @@ contains
gridmap = this%gridmap, &
src_array = [12, 13, 11], &
dst_array = dst_array, &
- nodata = NODATA_VAL)
+ nodata = NODATA_VAL, &
+ mask_src = [1, 1, 1])
@assertEqual([13], dst_array)
end subroutine getMaxIndices_maxMiddle
@@ -158,7 +160,8 @@ contains
gridmap = this%gridmap, &
src_array = [11, 12, 13], &
dst_array = dst_array, &
- nodata = NODATA_VAL)
+ nodata = NODATA_VAL, &
+ mask_src = [1, 1, 1])
@assertEqual([13], dst_array)
end subroutine getMaxIndices_maxLast
@@ -179,7 +182,8 @@ contains
gridmap = this%gridmap, &
src_array = [11, 12, 13], &
dst_array = dst_array, &
- nodata = NODATA_VAL)
+ nodata = NODATA_VAL, &
+ mask_src = [1, 1, 1])
@assertEqual([13, NODATA_VAL], dst_array)
end subroutine getMaxIndices_noData
@@ -201,7 +205,8 @@ contains
gridmap = this%gridmap, &
src_array = [11, 12, 13], &
dst_array = dst_array, &
- nodata = NODATA_VAL)
+ nodata = NODATA_VAL, &
+ mask_src = [1, 1, 1])
@assertEqual([13, NODATA_VAL], dst_array)
end subroutine getMaxIndices_noOverlap
@@ -222,7 +227,8 @@ contains
gridmap = this%gridmap, &
src_array = [11, 12, 13], &
dst_array = dst_array, &
- nodata = NODATA_VAL)
+ nodata = NODATA_VAL, &
+ mask_src = [1, 1, 1])
@assertEqual([12], dst_array)
end subroutine getMaxIndices_bigValNoOverlap
@@ -243,7 +249,8 @@ contains
gridmap = this%gridmap, &
src_array = [11,12,22,21], &
dst_array = dst_array, &
- nodata = NODATA_VAL)
+ nodata = NODATA_VAL, &
+ mask_src = [1, 1, 1, 1])
@assertEqual([12,22], dst_array)
end subroutine getMaxIndices_multipleDests