From c8bfca7eff03d7bee9cd7182e02f37081326f006 Mon Sep 17 00:00:00 2001 From: rgknox Date: Wed, 17 Feb 2016 15:06:16 -0800 Subject: [PATCH 01/19] inserted no-megan clause to ED compset configurations --- cime/scripts/Tools/config_compsets.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime/scripts/Tools/config_compsets.xml b/cime/scripts/Tools/config_compsets.xml index 9c91719e67..3ee679ecdc 100644 --- a/cime/scripts/Tools/config_compsets.xml +++ b/cime/scripts/Tools/config_compsets.xml @@ -845,7 +845,7 @@ CAM[45]%L60 => CAM with 60 layers and full gravity wave spectrum: -bgc bgc -dynamic_vegetation -bgc cn -dynamic_vegetation -crop -bgc bgc -dynamic_vegetation -crop --ed_mode +-ed_mode -no-megan -bgc sp -bgc bgc From c61aaef0dab1669fcd16310337da5cf19d59d197 Mon Sep 17 00:00:00 2001 From: rgknox Date: Wed, 17 Feb 2016 15:11:44 -0800 Subject: [PATCH 02/19] added use_century_decomp and use_vertsoilc to the ed_mode in components/clm/bld/CLMBuildNamelist.pm --- components/clm/bld/CLMBuildNamelist.pm | 38 +++++++++++++++++++++----- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/components/clm/bld/CLMBuildNamelist.pm b/components/clm/bld/CLMBuildNamelist.pm index d70e50c1b4..723aa468e4 100755 --- a/components/clm/bld/CLMBuildNamelist.pm +++ b/components/clm/bld/CLMBuildNamelist.pm @@ -159,7 +159,8 @@ OPTIONS (can ONLY be turned on when BGC type is 'cn' or 'bgc') This turns on the namelist variable: use_cndv -ed_mode Turn ED (Ecosystem Demography) : [on | off] (default is off) - Sets the namelist variable use_ed and use_spit_fire. + Sets the namelist variable use_ed, use_spit_fire, + use_vertsoilc, use_century_decomp -glc_present Set to true if the glc model is present (not sglc). This is used for error-checking, to make sure other options are set appropriately. @@ -745,13 +746,36 @@ sub setup_cmdl_ed_mode { fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values\n"); } - $var = "use_ed_spit_fire"; - $nl->set_variable_value($group, $var, $val); - if ( ! $definition->is_valid_value($var, $val) ) { - my @valid_values = $definition->get_valid_values( $var ); - fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values\n"); - } + # If the variable has already been set use it, if not set to the value defined by the ed_mode + my @list = ( "use_ed_spit_fire", "use_vertsoilc", "use_century_decomp" ); + my $ndiff = 0; + foreach my $var ( @list ) { + if ( ! defined($nl->get_value($var)) ) { + $nl_flags->{$var} = $setting; + } else { + if ( $nl->get_value($var) ne $setting ) { + $ndiff += 1; + } + $nl_flags->{$var} = $nl->get_value($var); + } + $val = $nl_flags->{$var}; + my $group = $definition->get_group_name($var); + $nl->set_variable_value($group, $var, $val); + if ( ! $definition->is_valid_value( $var, $val ) ) { + my @valid_values = $definition->get_valid_values( $var ); + fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values\n"); + } + } + +# $var = "use_ed_spit_fire"; +# $nl->set_variable_value($group, $var, $val); +# if ( ! $definition->is_valid_value($var, $val) ) { +# my @valid_values = $definition->get_valid_values( $var ); +# fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values\n"); +# } + } else { + # we only dis-allow ed_spit_fire with non-ed runs $var = "use_ed_spit_fire"; if ( defined($nl->get_value($var)) ) { fatal_error("$var is being set, but can ONLY be set when -ed_mode option is used.\n"); From c6185f2736873e85181962701fe2ecdcdde52fd3 Mon Sep 17 00:00:00 2001 From: rgknox Date: Wed, 17 Feb 2016 15:38:55 -0800 Subject: [PATCH 03/19] updated the intel compiler for lr2/lr3 --- cime/machines/env_mach_specific.lawrencium-lr2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime/machines/env_mach_specific.lawrencium-lr2 b/cime/machines/env_mach_specific.lawrencium-lr2 index 3de47efa2d..b13016ef30 100755 --- a/cime/machines/env_mach_specific.lawrencium-lr2 +++ b/cime/machines/env_mach_specific.lawrencium-lr2 @@ -23,9 +23,9 @@ module load cmake module load perl xml-libxml switch if ( $COMPILER == "intel" ) then - module load intel/2015.0.090 + module load intel/2015.6.233 module load openmpi - module load netcdf/4.3.2-intel-p + module load netcdf/4.4.0-intel-p module load mkl endif From 89809d84d73de6d5d410b6e6ac3739237c5bfa64 Mon Sep 17 00:00:00 2001 From: rgknox Date: Wed, 17 Feb 2016 20:03:28 -0800 Subject: [PATCH 04/19] Added env_mach_specific.lawrencium-lr3 --- .../machines/env_mach_specific.lawrencium-lr3 | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 cime/machines/env_mach_specific.lawrencium-lr3 diff --git a/cime/machines/env_mach_specific.lawrencium-lr3 b/cime/machines/env_mach_specific.lawrencium-lr3 new file mode 100755 index 0000000000..b13016ef30 --- /dev/null +++ b/cime/machines/env_mach_specific.lawrencium-lr3 @@ -0,0 +1,37 @@ +#! /bin/csh -f + +set CESM_REPO = `./xmlquery CCSM_REPOTAG -value` +if($status == 0) then + set COMPILER = `./xmlquery COMPILER -value` + set MPILIB = `./xmlquery MPILIB -value` + set DEBUG = `./xmlquery DEBUG -value` + set OS = `./xmlquery OS -value` + set PROFILE_PAPI_ENABLE = `./xmlquery PROFILE_PAPI_ENABLE -value` + set PROJECT = `./xmlquery PROJECT -value` +else + echo $0 using settings from environment: +endif +echo "COMPILER=$COMPILER" +echo "MPILIB=$MPILIB" +echo "DEBUG=$DEBUG" +echo "OS=$OS" +echo "PROJECT=$PROJECT" + +source /etc/profile.d/modules.csh +module purge +module load cmake +module load perl xml-libxml switch + +if ( $COMPILER == "intel" ) then + module load intel/2015.6.233 + module load openmpi + module load netcdf/4.4.0-intel-p + module load mkl +endif + +setenv NETCDF_PATH $NETCDF_DIR +#------------------------------------------------------------------------------- + +limit coredumpsize 1000000 +limit stacksize unlimited + From a7ff225f552a40620df4775184207f0e73cee219 Mon Sep 17 00:00:00 2001 From: rgknox Date: Wed, 17 Feb 2016 20:14:03 -0800 Subject: [PATCH 05/19] corrections to CLMBuildNamelist.pm, removed the setting variable and counter --- components/clm/bld/CLMBuildNamelist.pm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/components/clm/bld/CLMBuildNamelist.pm b/components/clm/bld/CLMBuildNamelist.pm index 723aa468e4..a86b36a09e 100755 --- a/components/clm/bld/CLMBuildNamelist.pm +++ b/components/clm/bld/CLMBuildNamelist.pm @@ -751,11 +751,8 @@ sub setup_cmdl_ed_mode { my $ndiff = 0; foreach my $var ( @list ) { if ( ! defined($nl->get_value($var)) ) { - $nl_flags->{$var} = $setting; + $nl_flags->{$var} = ".true."; } else { - if ( $nl->get_value($var) ne $setting ) { - $ndiff += 1; - } $nl_flags->{$var} = $nl->get_value($var); } $val = $nl_flags->{$var}; From b4deebab25fb23c4b404310ffc03a19807bfd913 Mon Sep 17 00:00:00 2001 From: rgknox Date: Thu, 18 Feb 2016 16:20:11 -0800 Subject: [PATCH 06/19] Initial tinkering with namelist unit tests of ed_mode --- .../bld/test_build_namelist/t/test_ed_mode.pm | 82 +++++++++++++++++++ .../test_build_namelist/t/test_vichydro.pm | 1 + 2 files changed, 83 insertions(+) create mode 100644 components/clm/bld/test_build_namelist/t/test_ed_mode.pm diff --git a/components/clm/bld/test_build_namelist/t/test_ed_mode.pm b/components/clm/bld/test_build_namelist/t/test_ed_mode.pm new file mode 100644 index 0000000000..a1bc25ab8f --- /dev/null +++ b/components/clm/bld/test_build_namelist/t/test_ed_mode.pm @@ -0,0 +1,82 @@ +package test_ed_mode; + +# Unit tests for function: ed_mode + +use Data::Dumper; +use Test::More; +use Test::Exception; + +use parent qw(Test::Class); + +#------------------------------------------------------------------------------- +# +# Common test fixture for all tests: +# +#------------------------------------------------------------------------------- +sub startup : Test(startup => 4) { + my $self = shift; + # provide common fixture for all tests, only created once at the + # start of the tests. + + $self->{cfg} = Build::Config->new("t/input/config_cache_clm4_5_test.xml"); + isnt($self->{cfg}, undef, (caller(0))[3] . " : config object created."); + + $self->{definition} = Build::NamelistDefinition->new("t/input/namelist_definition_clm4_5_test.xml"); + isnt($self->{definition}, undef, (caller(0))[3] . " : namelist_definition object created."); + + $self->{defaults} = Build::NamelistDefaults->new("t/input/namelist_defaults_clm4_5_test.xml"); + isnt($self->{defaults}, undef, (caller(0))[3] . " : namelist_defaults object created."); + + $self->{physv} = config_files::clm_phys_vers->new( $self->{cfg}->get('phys') ); + isnt($self->{physv}, undef, (caller(0))[3] . " : phys_vers object created."); + +} + +sub shutdown : Test(shutdown) { + # cleanup the single instance test fixtures +} + +sub setup : Test(setup => 1) { + my $self = shift; + # provide common fixture for all tests, create fresh for each test + + $self->{nl} = Build::Namelist->new(); + isnt($self->{nl}, undef, (caller(0))[3] . " : empty namelist object created."); +} + +sub teardown : Test(teardown) { + # clean up after test +} + +#------------------------------------------------------------------------------- +# +# tests +# +# 1: test that use_century_decom is the default with ed_mode +# 7: test that clm4.0 fails with ed_mode +# +#------------------------------------------------------------------------------- + +# Test 1: use_century_decomp is default with ed_mode +sub test_ed_mode__use_century_decomp : Tests { + my $self = shift; + + my $msg = "Test that the ed_mode set with use_century_decomp results success.\n"; + + use CLMBuildNamelist qw(setup_cmdl_ed_mode); + + my $opts = { ed_mode => 1, }; + my $nl_flags = { crop => 1, }; # eq "on" + +# my $nl_flags = { phys => "clm4_5", }; +# my $physv = config_files::clm_phys_vers->new( "clm4_5" ); + + CLMBuildNamelist::setup_cmdl_ed_mode($opts, $nl_flags, $self->{definition}, $self->{defaults}, $self->{nl}, $self->{physv}); + my $group = $self->{definition}->get_group_name("use_century_decomp"); + my $result = $self->{nl}->get_variable_value($group, "use_century_decomp"); + is($result, '.true.' ) || diag($msg); + #isnt +} + + +1; diff --git a/components/clm/bld/test_build_namelist/t/test_vichydro.pm b/components/clm/bld/test_build_namelist/t/test_vichydro.pm index b49889b16c..16a3ebc59a 100644 --- a/components/clm/bld/test_build_namelist/t/test_vichydro.pm +++ b/components/clm/bld/test_build_namelist/t/test_vichydro.pm @@ -20,6 +20,7 @@ sub startup : Test(startup => 4) { $self->{cfg} = Build::Config->new("t/input/config_cache_clm4_5_test.xml"); isnt($self->{cfg}, undef, (caller(0))[3] . " : config object created."); + $self->{definition} = Build::NamelistDefinition->new("t/input/namelist_definition_clm4_5_test.xml"); isnt($self->{definition}, undef, (caller(0))[3] . " : namelist_definition object created."); From 73ba5c80004a8fee9164cfadc02cfed0a73ee8e4 Mon Sep 17 00:00:00 2001 From: rgknox Date: Thu, 18 Feb 2016 22:35:49 -0800 Subject: [PATCH 07/19] completed a working prototype of ed_mode namelist unittests, 9 tests total --- components/clm/bld/CLMBuildNamelist.pm | 3 +- .../bld/test_build_namelist/t/test_ed_mode.pm | 154 +++++++++++++++++- 2 files changed, 148 insertions(+), 9 deletions(-) diff --git a/components/clm/bld/CLMBuildNamelist.pm b/components/clm/bld/CLMBuildNamelist.pm index a86b36a09e..495904958e 100755 --- a/components/clm/bld/CLMBuildNamelist.pm +++ b/components/clm/bld/CLMBuildNamelist.pm @@ -731,7 +731,6 @@ sub setup_cmdl_ed_mode { $var = "use_ed"; $nl_flags->{$var} = ".false."; if ($nl_flags->{'ed_mode'} eq 1) { - message("Using ED (Ecosystem Demography)."); $val = ".true."; $nl_flags->{$var} = $val; } @@ -746,7 +745,7 @@ sub setup_cmdl_ed_mode { fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values\n"); } - # If the variable has already been set use it, if not set to the value defined by the ed_mode + # If these variablse not being set by user, default to true my @list = ( "use_ed_spit_fire", "use_vertsoilc", "use_century_decomp" ); my $ndiff = 0; foreach my $var ( @list ) { diff --git a/components/clm/bld/test_build_namelist/t/test_ed_mode.pm b/components/clm/bld/test_build_namelist/t/test_ed_mode.pm index a1bc25ab8f..c2043986e5 100644 --- a/components/clm/bld/test_build_namelist/t/test_ed_mode.pm +++ b/components/clm/bld/test_build_namelist/t/test_ed_mode.pm @@ -53,7 +53,14 @@ sub teardown : Test(teardown) { # tests # # 1: test that use_century_decom is the default with ed_mode -# 7: test that clm4.0 fails with ed_mode +# 2: test that use_vertsoilc is the default with ed_mode +# 3: test that use_ed_spit_fire is the default with ed_mode +# 4: test that use_ed = .false. will fail for ed_mode +# 5: test that crop = "on" will fail for ed_mode +# 6: test that clm4_0 will fail for ed_mode (NOT AVAILABLE) +# 7: test that use_ed_spit_fire = false generates a false +# 8: test that use_versoilc = false generates a false +# 9: test that use_century_decomp = false generates a false # #------------------------------------------------------------------------------- @@ -61,22 +68,155 @@ sub teardown : Test(teardown) { sub test_ed_mode__use_century_decomp : Tests { my $self = shift; - my $msg = "Test that the ed_mode set with use_century_decomp results success.\n"; + my $msg = "Test that use_century_decomp is the default on ed_mode.\n"; use CLMBuildNamelist qw(setup_cmdl_ed_mode); my $opts = { ed_mode => 1, }; - my $nl_flags = { crop => 1, }; # eq "on" - -# my $nl_flags = { phys => "clm4_5", }; -# my $physv = config_files::clm_phys_vers->new( "clm4_5" ); + my $nl_flags = { crop => "off", }; # the setup_cmdl_ed_mode code requires this logic CLMBuildNamelist::setup_cmdl_ed_mode($opts, $nl_flags, $self->{definition}, $self->{defaults}, $self->{nl}, $self->{physv}); my $group = $self->{definition}->get_group_name("use_century_decomp"); my $result = $self->{nl}->get_variable_value($group, "use_century_decomp"); is($result, '.true.' ) || diag($msg); - #isnt } +# Test 2: use_vertsoilc is default with ed_mode +sub test_ed_mode__use_vertsoilc : Tests { + my $self = shift; + + my $msg = "Tests that use_vertsoilc is default on ed_mode.\n"; + + use CLMBuildNamelist qw(setup_cmdl_ed_mode); + + my $opts = { ed_mode => 1, }; + my $nl_flags = { crop => "off", }; + + CLMBuildNamelist::setup_cmdl_ed_mode($opts, $nl_flags, $self->{definition}, $self->{defaults}, $self->{nl}, $self->{physv}); + my $group = $self->{definition}->get_group_name("use_vertsoilc"); + my $result = $self->{nl}->get_variable_value($group, "use_vertsoilc"); + is($result, '.true.' ) || diag($msg); +} + +# Test 3: use_ed_spit_fire is default with ed_mode +sub test_ed_mode__use_ed_spit_fire : Tests { + my $self = shift; + + my $msg = "Tests that use_ed_spit_fire is default on ed_mode.\n"; + + use CLMBuildNamelist qw(setup_cmdl_ed_mode); + + my $opts = { ed_mode => 1, }; + my $nl_flags = { crop => "off", }; + + CLMBuildNamelist::setup_cmdl_ed_mode($opts, $nl_flags, $self->{definition}, $self->{defaults}, $self->{nl}, $self->{physv}); + my $group = $self->{definition}->get_group_name("use_ed_spit_fire"); + my $result = $self->{nl}->get_variable_value($group, "use_ed_spit_fire"); + is($result, '.true.' ) || diag($msg); +} + +# Test 4: use_ed=false will crash on ed_mode +sub test_ed_mode__use_ed_nl_contradicts_cmdl : Tests { + my $self = shift; + + my $msg = "Tests that use_ed=false will fail on ed_mode.\n"; + + use CLMBuildNamelist qw(setup_cmdl_ed_mode); + + my $opts = { ed_mode => 1, }; + my $nl_flags = { crop => "off", use_ed => ".false."}; + + my $group = $self->{definition}->get_group_name("use_ed"); + $self->{nl}->set_variable_value($group, "use_ed", '.false.' ); + + dies_ok(sub { CLMBuildNamelist::setup_cmdl_ed_mode($opts, $nl_flags, $self->{definition}, $self->{defaults}, $self->{nl}, + $self->{physv}) }) || diag($msg); +} + +# Test 5: crop=on will crash on ed_mode +sub test_ed_mode__crop_on_nl_contradicts_cmdl : Tests { + my $self = shift; + + my $msg = "Tests that crop=on will fail on ed_mode.\n"; + + use CLMBuildNamelist qw(setup_cmdl_ed_mode); + + my $opts = { ed_mode => 1, }; + my $nl_flags = { crop => "on", }; + + my $group = $self->{definition}->get_group_name("crop"); + $self->{nl}->set_variable_value($group, "crop", 'on' ); + + dies_ok(sub { CLMBuildNamelist::setup_cmdl_ed_mode($opts, $nl_flags, $self->{definition}, $self->{defaults}, $self->{nl}, + $self->{physv}) }) || diag($msg); +} + +# 7: test that use_ed_spit_fire = false generates a false +sub test_ed_mode__use_ed_spit_fire_false : Tests { + my $self = shift; + + my $msg = "Tests that use_ed_spit_fire can be turned to false.\n"; + + use CLMBuildNamelist qw(setup_cmdl_ed_mode); + + my $opts = { ed_mode => 1, }; + my $nl_flags = { crop => "off", }; + + my $group = $self->{definition}->get_group_name("use_ed_spit_fire"); + $self->{nl}->set_variable_value($group, "use_ed_spit_fire", '.false.' ); + + CLMBuildNamelist::setup_cmdl_ed_mode($opts, $nl_flags, $self->{definition}, $self->{defaults}, $self->{nl}, + $self->{physv}); + + my $result = $self->{nl}->get_variable_value($group, "use_ed_spit_fire"); + is($result, '.false.' ) || diag($msg); + +} + +# 8: test that use_ed_spit_fire = false generates a false +sub test_ed_mode__use_vertsoilc_false : Tests { + my $self = shift; + + my $msg = "Tests that use_vertsoilc can be turned to false.\n"; + + use CLMBuildNamelist qw(setup_cmdl_ed_mode); + + my $opts = { ed_mode => 1, }; + my $nl_flags = { crop => "off", }; + + my $group = $self->{definition}->get_group_name("use_vertsoilc"); + $self->{nl}->set_variable_value($group, "use_vertsoilc", '.false.' ); + + CLMBuildNamelist::setup_cmdl_ed_mode($opts, $nl_flags, $self->{definition}, $self->{defaults}, $self->{nl}, + $self->{physv}); + + my $result = $self->{nl}->get_variable_value($group, "use_vertsoilc"); + is($result, '.false.' ) || diag($msg); + +} + +# 9: test that use_ed_spit_fire = false generates a false +sub test_ed_mode__use_century_decomp_false : Tests { + my $self = shift; + + my $msg = "Tests that use_century_decomp can be turned to false.\n"; + + use CLMBuildNamelist qw(setup_cmdl_ed_mode); + + my $opts = { ed_mode => 1, }; + my $nl_flags = { crop => "off", }; + + my $group = $self->{definition}->get_group_name("use_century_decomp"); + $self->{nl}->set_variable_value($group, "use_century_decomp", '.false.' ); + + CLMBuildNamelist::setup_cmdl_ed_mode($opts, $nl_flags, $self->{definition}, $self->{defaults}, $self->{nl}, + $self->{physv}); + + my $result = $self->{nl}->get_variable_value($group, "use_century_decomp"); + is($result, '.false.' ) || diag($msg); + +} + + 1; From 109b32bbb5c54cabf2a073e3fd9de3e1d507d322 Mon Sep 17 00:00:00 2001 From: rgknox Date: Mon, 22 Feb 2016 18:03:40 -0800 Subject: [PATCH 08/19] trying to integrate usage of namelist default files and calls to add_default --- components/clm/bld/CLMBuildNamelist.pm | 119 +++++++++++------- .../namelist_defaults_clm4_5.xml | 11 ++ .../namelist_definition_clm4_5.xml | 4 +- .../t/input/namelist_defaults_clm4_5_test.xml | 7 ++ .../bld/test_build_namelist/t/test_ed_mode.pm | 16 ++- .../clm/edNoFire/include_user_mods | 1 + .../testmods_dirs/clm/edNoFire/shell_commands | 1 + .../testmods_dirs/clm/edNoFire/user_nl_clm | 11 ++ 8 files changed, 120 insertions(+), 50 deletions(-) create mode 100644 components/clm/cimetest/testmods_dirs/clm/edNoFire/include_user_mods create mode 100755 components/clm/cimetest/testmods_dirs/clm/edNoFire/shell_commands create mode 100644 components/clm/cimetest/testmods_dirs/clm/edNoFire/user_nl_clm diff --git a/components/clm/bld/CLMBuildNamelist.pm b/components/clm/bld/CLMBuildNamelist.pm index 495904958e..ab955debfe 100755 --- a/components/clm/bld/CLMBuildNamelist.pm +++ b/components/clm/bld/CLMBuildNamelist.pm @@ -159,8 +159,9 @@ OPTIONS (can ONLY be turned on when BGC type is 'cn' or 'bgc') This turns on the namelist variable: use_cndv -ed_mode Turn ED (Ecosystem Demography) : [on | off] (default is off) - Sets the namelist variable use_ed, use_spit_fire, - use_vertsoilc, use_century_decomp + Sets the namelist variable use_ed, checks for use_spit_fire, + use_vertsoilc, use_century_decomp and use_lch4 + Also specifies defaults for these -glc_present Set to true if the glc model is present (not sglc). This is used for error-checking, to make sure other options are set appropriately. @@ -745,31 +746,37 @@ sub setup_cmdl_ed_mode { fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values\n"); } - # If these variablse not being set by user, default to true - my @list = ( "use_ed_spit_fire", "use_vertsoilc", "use_century_decomp" ); - my $ndiff = 0; + # This section is a place-holder to test for modules that are not allowed with ED + # the defaults which are set in the logic section of the namelist builder will + # automatically set these correctly (well that is the assumption), but here we + # want to set a catch to fail and warn users if they explicitly set incompatible user namelist + # options + +# my $var = "use_somevar"; +# $val = $nl_flags->{$var}; +# if ( defined($nl->get_value($var)) ) { +# if ( $nl->get_value($var) == ".true." ) { +# fatal_error("$var was set to .true., which is incompatible when -ed_mode option is used.\n"); +# } +# } + + + # The following variables may be set by the user and are compatible with use_ed + # no need to set defaults, covered in a different routine + my @list = ( "use_ed_spit_fire", "use_vertsoilc", "use_century_decomp", "use_lch4" ); foreach my $var ( @list ) { - if ( ! defined($nl->get_value($var)) ) { - $nl_flags->{$var} = ".true."; - } else { + if ( defined($nl->get_value($var)) ) { $nl_flags->{$var} = $nl->get_value($var); - } - $val = $nl_flags->{$var}; - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val); - if ( ! $definition->is_valid_value( $var, $val ) ) { - my @valid_values = $definition->get_valid_values( $var ); - fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values\n"); + $val = $nl_flags->{$var}; + my $group = $definition->get_group_name($var); + $nl->set_variable_value($group, $var, $val); + if ( ! $definition->is_valid_value( $var, $val ) ) { + my @valid_values = $definition->get_valid_values( $var ); + fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values\n"); + } } } -# $var = "use_ed_spit_fire"; -# $nl->set_variable_value($group, $var, $val); -# if ( ! $definition->is_valid_value($var, $val) ) { -# my @valid_values = $definition->get_valid_values( $var ); -# fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values\n"); -# } - } else { # we only dis-allow ed_spit_fire with non-ed runs $var = "use_ed_spit_fire"; @@ -791,6 +798,7 @@ sub setup_cmdl_bgc { $val = $opts->{$var}; $nl_flags->{'bgc_mode'} = $val; + if ( $physv->as_long() == $physv->as_long("clm4_0") ) { if ( $nl_flags->{'bgc_mode'} ne "default" ) { fatal_error("-bgc option used with clm4_0 physics. -bgc can ONLY be used with clm4_5/clm5_0 physics"); @@ -822,29 +830,32 @@ sub setup_cmdl_bgc { if ( defined($nl->get_value("use_cn")) && ($nl_flags->{'use_cn'} ne $nl->get_value("use_cn")) ) { fatal_error("The namelist variable use_cn is inconsistent with the -bgc option"); } - # If the variable has already been set use it, if not set to the value defined by the bgc_mode - my @list = ( "use_lch4", "use_nitrif_denitrif", "use_vertsoilc", "use_century_decomp" ); - my $ndiff = 0; - foreach my $var ( @list ) { - if ( ! defined($nl->get_value($var)) ) { - $nl_flags->{$var} = $setting; - } else { - if ( $nl->get_value($var) ne $setting ) { - $ndiff += 1; - } - $nl_flags->{$var} = $nl->get_value($var); - } - $val = $nl_flags->{$var}; - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val); - if ( ! $definition->is_valid_value( $var, $val ) ) { - my @valid_values = $definition->get_valid_values( $var ); - fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values\n"); - } - } - # If all the variables are different report it as an error - if ( $ndiff == ($#list + 1) ) { - fatal_error("You are contradicting the -bgc setting with the namelist variables: @list" ); + + if ( $opts->{"ed_mode"} != 1) { + # If the variable has already been set use it, if not set to the value defined by the bgc_mode + my @list = ( "use_lch4", "use_nitrif_denitrif", "use_vertsoilc", "use_century_decomp" ); + my $ndiff = 0; + foreach my $var ( @list ) { + if ( ! defined($nl->get_value($var)) ) { + $nl_flags->{$var} = $setting; + } else { + if ( $nl->get_value($var) ne $setting ) { + $ndiff += 1; + } + $nl_flags->{$var} = $nl->get_value($var); + } + $val = $nl_flags->{$var}; + my $group = $definition->get_group_name($var); + $nl->set_variable_value($group, $var, $val); + if ( ! $definition->is_valid_value( $var, $val ) ) { + my @valid_values = $definition->get_valid_values( $var ); + fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values\n"); + } + } + # If all the variables are different report it as an error + if ( $ndiff == ($#list + 1) ) { + fatal_error("You are contradicting the -bgc setting with the namelist variables: @list" ); + } } # Now set use_cn @@ -1447,6 +1458,7 @@ sub process_namelist_inline_logic { setup_logic_supplemental_nitrogen($opts->{'test'}, $nl_flags, $definition, $defaults, $nl, $physv); setup_logic_snowpack($opts->{'test'}, $nl_flags, $definition, $defaults, $nl, $physv); setup_logic_atm_forcing($opts->{'test'}, $nl_flags, $definition, $defaults, $nl, $physv); + setup_logic_ed($opts->{'test'}, $nl_flags, $definition, $defaults, $nl, $physv); ######################################### # namelist group: clm_humanindex_inparm # @@ -2756,6 +2768,23 @@ sub setup_logic_atm_forcing { #------------------------------------------------------------------------------- +sub setup_logic_ed { + # + # Set some default options related to Ecosystem Demography + # + my ($test_files, $nl_flags, $definition, $defaults, $nl, $physv) = @_; + + if ($physv->as_long() >= $physv->as_long("clm4_5")) { + add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_vertsoilc', 'use_ed'=>$nl_flags->{'use_ed'} ); + add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_century_decomp', 'use_ed'=>$nl_flags->{'use_ed'} ); + add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_ed_spit_fire', 'use_ed'=>$nl_flags->{'use_ed'} ); + add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_lch4', 'use_ed'=>$nl_flags->{'use_ed'} ); + add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_nitrif_denitrif', 'use_ed'=>$nl_flags->{'use_ed'} ); + } +} + +#------------------------------------------------------------------------------- + sub write_output_files { my ($opts, $nl_flags, $defaults, $nl, $physv) = @_; diff --git a/components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml b/components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml index 5937bcd3ba..6c56a214ce 100644 --- a/components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -1612,4 +1612,15 @@ lnd/clm2/surfdata_map/surfdata_ne30np4_simyr1850_c141219.nc .true. + + + + + .true. + .true. + .true. + .false. + .false. + + diff --git a/components/clm/bld/namelist_files/namelist_definition_clm4_5.xml b/components/clm/bld/namelist_files/namelist_definition_clm4_5.xml index d89038523c..9992e1e97f 100644 --- a/components/clm/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/components/clm/bld/namelist_files/namelist_definition_clm4_5.xml @@ -427,13 +427,13 @@ Requires the CN model to work (either CN or CNDV). Turn on vertical soil carbon. -Requires the CN model to work (either CN or CNDV). +Requires the CN or ED model to work (either CN or CNDV). Use parameters for decomposition from the CENTURY Carbon model -Requires the CN model to work (either CN or CNDV). +Requires the CN or ED model to work (either CN or CNDV). .true. + .true. + .true. + .true. + .false. + .false. + + diff --git a/components/clm/bld/test_build_namelist/t/test_ed_mode.pm b/components/clm/bld/test_build_namelist/t/test_ed_mode.pm index c2043986e5..cc4ae7a8ec 100644 --- a/components/clm/bld/test_build_namelist/t/test_ed_mode.pm +++ b/components/clm/bld/test_build_namelist/t/test_ed_mode.pm @@ -8,6 +8,8 @@ use Test::Exception; use parent qw(Test::Class); +use CLMBuildNamelist qw(setup_logic_lnd_frac); + #------------------------------------------------------------------------------- # # Common test fixture for all tests: @@ -30,6 +32,8 @@ sub startup : Test(startup => 4) { $self->{physv} = config_files::clm_phys_vers->new( $self->{cfg}->get('phys') ); isnt($self->{physv}, undef, (caller(0))[3] . " : phys_vers object created."); + $self->{test_files} = 0; + } sub shutdown : Test(shutdown) { @@ -71,14 +75,20 @@ sub test_ed_mode__use_century_decomp : Tests { my $msg = "Test that use_century_decomp is the default on ed_mode.\n"; use CLMBuildNamelist qw(setup_cmdl_ed_mode); + use CLMBuildNamelist qw(setup_logic_ed); - my $opts = { ed_mode => 1, }; + my $opts = { ed_mode => 1, bgc => "default" }; my $nl_flags = { crop => "off", }; # the setup_cmdl_ed_mode code requires this logic + # include bgc because they have mutually exclusive functionality that needs to be tested + CLMBuildNamelist::setup_cmdl_bgc($opts, $nl_flags, $self->{definition}, $self->{defaults}, $self->{nl}, $self->{cfg},$self->{physv}); CLMBuildNamelist::setup_cmdl_ed_mode($opts, $nl_flags, $self->{definition}, $self->{defaults}, $self->{nl}, $self->{physv}); - my $group = $self->{definition}->get_group_name("use_century_decomp"); + $nl_flags->{"use_ed"} = $self->{nl}->get_value("use_ed"); + + CLMBuildNamelist::setup_logic_ed($self->{test_files}, $nl_flags, $self->{definition}, $self->{defaults}, $self->{nl}, $self->{physv}); my $result = $self->{nl}->get_variable_value($group, "use_century_decomp"); is($result, '.true.' ) || diag($msg); + } # Test 2: use_vertsoilc is default with ed_mode @@ -173,7 +183,7 @@ sub test_ed_mode__use_ed_spit_fire_false : Tests { } -# 8: test that use_ed_spit_fire = false generates a false +# 8: test that use_versoilc = false generates a false sub test_ed_mode__use_vertsoilc_false : Tests { my $self = shift; diff --git a/components/clm/cimetest/testmods_dirs/clm/edNoFire/include_user_mods b/components/clm/cimetest/testmods_dirs/clm/edNoFire/include_user_mods new file mode 100644 index 0000000000..fe0e18cf88 --- /dev/null +++ b/components/clm/cimetest/testmods_dirs/clm/edNoFire/include_user_mods @@ -0,0 +1 @@ +../default diff --git a/components/clm/cimetest/testmods_dirs/clm/edNoFire/shell_commands b/components/clm/cimetest/testmods_dirs/clm/edNoFire/shell_commands new file mode 100755 index 0000000000..d81ed7dbc5 --- /dev/null +++ b/components/clm/cimetest/testmods_dirs/clm/edNoFire/shell_commands @@ -0,0 +1 @@ +./xmlchange CLM_BLDNML_OPTS="-no-megan" --append diff --git a/components/clm/cimetest/testmods_dirs/clm/edNoFire/user_nl_clm b/components/clm/cimetest/testmods_dirs/clm/edNoFire/user_nl_clm new file mode 100644 index 0000000000..ca8ec28614 --- /dev/null +++ b/components/clm/cimetest/testmods_dirs/clm/edNoFire/user_nl_clm @@ -0,0 +1,11 @@ +use_cn = .false. +use_ed_spit_fire = .false. +finidat = '' +hist_mfilt = 365 +hist_nhtfrq = -24 +hist_empty_htapes = .true. +hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT', + 'STORVEGC','FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', + 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', + 'PFTleafbiomass','FIRE_ROS','WIND','TFC_ROS','DISPVEGC','AREA_TREES','AREA_PLANT' + From 69e3efbfc039fd7f5574da2a08732db66011994a Mon Sep 17 00:00:00 2001 From: rgknox Date: Tue, 23 Feb 2016 16:45:29 -0800 Subject: [PATCH 09/19] unit tests now working correctly and calling add_defaults via defaults xml --- components/clm/bld/CLMBuildNamelist.pm | 7 +- .../t/input/namelist_defaults_clm4_5_test.xml | 18 ++- .../t/template_test_XXX.pm | 8 +- .../bld/test_build_namelist/t/test_ed_mode.pm | 148 ++++++++++++------ 4 files changed, 127 insertions(+), 54 deletions(-) diff --git a/components/clm/bld/CLMBuildNamelist.pm b/components/clm/bld/CLMBuildNamelist.pm index ab955debfe..91394b1f0c 100755 --- a/components/clm/bld/CLMBuildNamelist.pm +++ b/components/clm/bld/CLMBuildNamelist.pm @@ -777,6 +777,9 @@ sub setup_cmdl_ed_mode { } } +# add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_vertsoilc', 'use_ed'=>$nl_flags->{'use_ed'} ); + + } else { # we only dis-allow ed_spit_fire with non-ed runs $var = "use_ed_spit_fire"; @@ -2777,7 +2780,7 @@ sub setup_logic_ed { if ($physv->as_long() >= $physv->as_long("clm4_5")) { add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_vertsoilc', 'use_ed'=>$nl_flags->{'use_ed'} ); add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_century_decomp', 'use_ed'=>$nl_flags->{'use_ed'} ); - add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_ed_spit_fire', 'use_ed'=>$nl_flags->{'use_ed'} ); + add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_ed_spit_fire', 'use_ed'=>$nl_flags->{'use_ed'} ); add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_lch4', 'use_ed'=>$nl_flags->{'use_ed'} ); add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_nitrif_denitrif', 'use_ed'=>$nl_flags->{'use_ed'} ); } @@ -2889,6 +2892,7 @@ sub add_default { $var = $1; } # Query the definition to find which group the variable belongs to. Exit if not found. + my $group = $definition->get_group_name($var); unless ($group) { my $fname = $definition->get_file_name(); @@ -2909,6 +2913,7 @@ sub add_default { # in %settings to the get_value method to be used as attributes that are matched # when looking for default values. else { + $val = $defaults->get_value($var, \%settings); # Truncate model_version appropriately diff --git a/components/clm/bld/test_build_namelist/t/input/namelist_defaults_clm4_5_test.xml b/components/clm/bld/test_build_namelist/t/input/namelist_defaults_clm4_5_test.xml index 1b41e79f1e..25e3d47e65 100644 --- a/components/clm/bld/test_build_namelist/t/input/namelist_defaults_clm4_5_test.xml +++ b/components/clm/bld/test_build_namelist/t/input/namelist_defaults_clm4_5_test.xml @@ -75,6 +75,18 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/paramdata/clm_params.c130821.nc + + + + + +.true. +.true. +.true. +.false. +.false. + + - .true. - .true. - .true. - .false. - .false. +.true. +.true. +.true. +.false. +.false. diff --git a/components/clm/cimetest/testmods_dirs/clm/edNoFire/user_nl_clm b/components/clm/cimetest/testmods_dirs/clm/edNoFire/user_nl_clm index ca8ec28614..ac4a70b39e 100644 --- a/components/clm/cimetest/testmods_dirs/clm/edNoFire/user_nl_clm +++ b/components/clm/cimetest/testmods_dirs/clm/edNoFire/user_nl_clm @@ -7,5 +7,5 @@ hist_empty_htapes = .true. hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT', 'STORVEGC','FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', - 'PFTleafbiomass','FIRE_ROS','WIND','TFC_ROS','DISPVEGC','AREA_TREES','AREA_PLANT' + 'PFTleafbiomass','FIRE_ROS','WIND','TFC_ROS','DISPVEGC','AREA_TREES','AREA_PLANT' diff --git a/components/clm/cimetest/testmods_dirs/clm/edTest/user_nl_clm b/components/clm/cimetest/testmods_dirs/clm/edTest/user_nl_clm index 2c11d3b5ad..ab9cea3aeb 100644 --- a/components/clm/cimetest/testmods_dirs/clm/edTest/user_nl_clm +++ b/components/clm/cimetest/testmods_dirs/clm/edTest/user_nl_clm @@ -6,5 +6,5 @@ hist_empty_htapes = .true. hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT', 'STORVEGC','FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', - 'PFTleafbiomass','FIRE_ROS','WIND','TFC_ROS','DISPVEGC','AREA_TREES','AREA_PLANT' + 'PFTleafbiomass','FIRE_ROS','WIND','TFC_ROS','DISPVEGC','AREA_TREES','AREA_PLANT' From 6bd1285f3bf39337f20f06fccb43b536cc93f53c Mon Sep 17 00:00:00 2001 From: rgknox Date: Tue, 23 Feb 2016 18:53:25 -0800 Subject: [PATCH 11/19] Added test ERS_D_Ld5.f10_f10.ICLM45ED.ed_ed.clm-edNoFire This adds a regression test ofor ED without spitfire Followed directions here: https://github.com/bandre-ucar/cime-testing-tools#adding-a-new-test --- components/clm/cimetest/testlist_clm.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/components/clm/cimetest/testlist_clm.xml b/components/clm/cimetest/testlist_clm.xml index 2b753cea9d..4cdb759184 100644 --- a/components/clm/cimetest/testlist_clm.xml +++ b/components/clm/cimetest/testlist_clm.xml @@ -725,6 +725,7 @@ ed + ed ed From d9d1bda77b0eaf49e67a36e10e2787e7d991519c Mon Sep 17 00:00:00 2001 From: rgknox Date: Wed, 24 Feb 2016 00:43:18 -0800 Subject: [PATCH 12/19] added conditional to the add_default namelist building for ed logic, modified test user_nl_clm to match baselines --- components/clm/bld/CLMBuildNamelist.pm | 2 +- components/clm/cimetest/testmods_dirs/clm/edTest/user_nl_clm | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/clm/bld/CLMBuildNamelist.pm b/components/clm/bld/CLMBuildNamelist.pm index 91394b1f0c..2a9bc7d606 100755 --- a/components/clm/bld/CLMBuildNamelist.pm +++ b/components/clm/bld/CLMBuildNamelist.pm @@ -2777,7 +2777,7 @@ sub setup_logic_ed { # my ($test_files, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - if ($physv->as_long() >= $physv->as_long("clm4_5")) { + if ($physv->as_long() >= $physv->as_long("clm4_5") && value_is_true( $nl_flags->{'use_ed'}) ) { add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_vertsoilc', 'use_ed'=>$nl_flags->{'use_ed'} ); add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_century_decomp', 'use_ed'=>$nl_flags->{'use_ed'} ); add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_ed_spit_fire', 'use_ed'=>$nl_flags->{'use_ed'} ); diff --git a/components/clm/cimetest/testmods_dirs/clm/edTest/user_nl_clm b/components/clm/cimetest/testmods_dirs/clm/edTest/user_nl_clm index ab9cea3aeb..7f7867def7 100644 --- a/components/clm/cimetest/testmods_dirs/clm/edTest/user_nl_clm +++ b/components/clm/cimetest/testmods_dirs/clm/edTest/user_nl_clm @@ -1,4 +1,6 @@ use_cn = .false. +use_century_decomp = .false. +use_vertsoilc = .false. finidat = '' hist_mfilt = 365 hist_nhtfrq = -24 From 04f948155d7e7e1f2a63f853e6868c5e4ec991a0 Mon Sep 17 00:00:00 2001 From: rgknox Date: Wed, 24 Feb 2016 13:43:09 -0800 Subject: [PATCH 13/19] modified the edNoFire regression tests to use pre-existing use_century_decomp and use_vertsoilc settings --- components/clm/cimetest/testmods_dirs/clm/edNoFire/user_nl_clm | 2 ++ components/clm/cimetest/testmods_dirs/clm/edTest/user_nl_clm | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/clm/cimetest/testmods_dirs/clm/edNoFire/user_nl_clm b/components/clm/cimetest/testmods_dirs/clm/edNoFire/user_nl_clm index ac4a70b39e..5c15d95828 100644 --- a/components/clm/cimetest/testmods_dirs/clm/edNoFire/user_nl_clm +++ b/components/clm/cimetest/testmods_dirs/clm/edNoFire/user_nl_clm @@ -1,5 +1,7 @@ use_cn = .false. use_ed_spit_fire = .false. +use_vertsoilc = .false. +use_century_decomp = .false. finidat = '' hist_mfilt = 365 hist_nhtfrq = -24 diff --git a/components/clm/cimetest/testmods_dirs/clm/edTest/user_nl_clm b/components/clm/cimetest/testmods_dirs/clm/edTest/user_nl_clm index 7f7867def7..12415896e2 100644 --- a/components/clm/cimetest/testmods_dirs/clm/edTest/user_nl_clm +++ b/components/clm/cimetest/testmods_dirs/clm/edTest/user_nl_clm @@ -8,5 +8,4 @@ hist_empty_htapes = .true. hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT', 'STORVEGC','FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', - 'PFTleafbiomass','FIRE_ROS','WIND','TFC_ROS','DISPVEGC','AREA_TREES','AREA_PLANT' - + 'PFTleafbiomass','FIRE_ROS','WIND','TFC_ROS','DISPVEGC','AREA_TREES','AREA_PLANT' \ No newline at end of file From 63a2773480f827ba621314825a74ce8d6456d6c0 Mon Sep 17 00:00:00 2001 From: rgknox Date: Wed, 24 Feb 2016 15:58:50 -0800 Subject: [PATCH 14/19] removed inherited default namelist variables in the edNoFire test cases --- .../clm/cimetest/testmods_dirs/clm/edNoFire/include_user_mods | 1 - 1 file changed, 1 deletion(-) delete mode 100644 components/clm/cimetest/testmods_dirs/clm/edNoFire/include_user_mods diff --git a/components/clm/cimetest/testmods_dirs/clm/edNoFire/include_user_mods b/components/clm/cimetest/testmods_dirs/clm/edNoFire/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/components/clm/cimetest/testmods_dirs/clm/edNoFire/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default From 48631c51ec7350b4b820ca32842d8c7158ce80e3 Mon Sep 17 00:00:00 2001 From: rgknox Date: Wed, 24 Feb 2016 16:56:30 -0800 Subject: [PATCH 15/19] edNoFire updated to get inherited namelist from edTest --- .../cimetest/testmods_dirs/clm/edNoFire/user_nl_clm | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/components/clm/cimetest/testmods_dirs/clm/edNoFire/user_nl_clm b/components/clm/cimetest/testmods_dirs/clm/edNoFire/user_nl_clm index 5c15d95828..05070adc21 100644 --- a/components/clm/cimetest/testmods_dirs/clm/edNoFire/user_nl_clm +++ b/components/clm/cimetest/testmods_dirs/clm/edNoFire/user_nl_clm @@ -1,13 +1,2 @@ -use_cn = .false. use_ed_spit_fire = .false. -use_vertsoilc = .false. -use_century_decomp = .false. -finidat = '' -hist_mfilt = 365 -hist_nhtfrq = -24 -hist_empty_htapes = .true. -hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT', - 'STORVEGC','FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', - 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', - 'PFTleafbiomass','FIRE_ROS','WIND','TFC_ROS','DISPVEGC','AREA_TREES','AREA_PLANT' From a0661656dd7426477ef7b9e1a6b8435ec9bb8fde Mon Sep 17 00:00:00 2001 From: rgknox Date: Wed, 24 Feb 2016 16:57:51 -0800 Subject: [PATCH 16/19] git added include_user_mods --- .../clm/cimetest/testmods_dirs/clm/edNoFire/include_user_mods | 1 + 1 file changed, 1 insertion(+) create mode 100644 components/clm/cimetest/testmods_dirs/clm/edNoFire/include_user_mods diff --git a/components/clm/cimetest/testmods_dirs/clm/edNoFire/include_user_mods b/components/clm/cimetest/testmods_dirs/clm/edNoFire/include_user_mods new file mode 100644 index 0000000000..53cabb16d0 --- /dev/null +++ b/components/clm/cimetest/testmods_dirs/clm/edNoFire/include_user_mods @@ -0,0 +1 @@ +../edTest From 1703aa1cc84fc4d15b8be12ee7ed84ece25ff5d6 Mon Sep 17 00:00:00 2001 From: rgknox Date: Thu, 25 Feb 2016 11:41:34 -0800 Subject: [PATCH 17/19] fixed error on the spit_fire=false namelist unit test --- components/clm/bld/test_build_namelist/t/test_ed_mode.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/clm/bld/test_build_namelist/t/test_ed_mode.pm b/components/clm/bld/test_build_namelist/t/test_ed_mode.pm index 07cd3c8813..4c5ebb1359 100644 --- a/components/clm/bld/test_build_namelist/t/test_ed_mode.pm +++ b/components/clm/bld/test_build_namelist/t/test_ed_mode.pm @@ -202,7 +202,7 @@ sub test_ed_mode__use_ed_spit_fire_false : Tests { my $msg = "Tests that use_ed_spit_fire can be turned to false.\n"; - my $opts = { ed_mode => 1, }; + my $opts = { ed_mode => 1, bgc => "default"}; my $nl_flags = { crop => "off", }; my $group = $self->{definition}->get_group_name("use_ed_spit_fire"); From 72680279a0f6d5bd3156cc82e590c1520fc758d3 Mon Sep 17 00:00:00 2001 From: rgknox Date: Thu, 25 Feb 2016 13:36:39 -0800 Subject: [PATCH 18/19] uncommented the initialization of the physics namelist variable in the unit test template --- components/clm/bld/test_build_namelist/t/template_test_XXX.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/clm/bld/test_build_namelist/t/template_test_XXX.pm b/components/clm/bld/test_build_namelist/t/template_test_XXX.pm index cf43818044..d212e1ea2a 100644 --- a/components/clm/bld/test_build_namelist/t/template_test_XXX.pm +++ b/components/clm/bld/test_build_namelist/t/template_test_XXX.pm @@ -27,8 +27,8 @@ sub startup : Test(startup => 3) { isnt($self->{defaults}, undef, (caller(0))[3] . " : namelist_defaults object created."); # The next line may be usefull (set startup => 4) in arg call above: -# $self->{physv} = config_files::clm_phys_vers->new( $self->{cfg}->get('phys') ); -# isnt($self->{physv}, undef, (caller(0))[3] . " : phys_vers object created."); + $self->{physv} = config_files::clm_phys_vers->new( $self->{cfg}->get('phys') ); + isnt($self->{physv}, undef, (caller(0))[3] . " : phys_vers object created."); } From 3d6f43d137b7f8571b8b7525e9cb0a42a4aab8bb Mon Sep 17 00:00:00 2001 From: Ben Andre Date: Thu, 25 Feb 2016 16:10:07 -0700 Subject: [PATCH 19/19] Update the clm build-namelist unit test to remove warning. Update the number of tests in template_test_XXX : startup to remove a warning from the test system. Fixes: Part of #19 User interface changes?: no Code review: self Test suite: test_build_namelist.pl - pass Test baseline: n/a Test namelist changes: n/a Test answer changes: n/a Test summary: n/a --- components/clm/bld/test_build_namelist/t/template_test_XXX.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/clm/bld/test_build_namelist/t/template_test_XXX.pm b/components/clm/bld/test_build_namelist/t/template_test_XXX.pm index d212e1ea2a..faef3d9cb7 100644 --- a/components/clm/bld/test_build_namelist/t/template_test_XXX.pm +++ b/components/clm/bld/test_build_namelist/t/template_test_XXX.pm @@ -13,7 +13,7 @@ use parent qw(Test::Class); # Common test fixture for all tests: # #------------------------------------------------------------------------------- -sub startup : Test(startup => 3) { +sub startup : Test(startup => 4) { my $self = shift; # provide common fixture for all tests, only created once at the # start of the tests.