@@ -164,9 +164,6 @@ OPTIONS
164164 -fire_emis Produce a fire_emis_nl namelist that will go into the
165165 "drv_flds_in" file for the driver to pass fire emissions to the atm.
166166 (Note: buildnml copies the file for use by the driver)
167- -glc_present Set to true if the glc model is present (not sglc).
168- This is used for error-checking, to make sure other options are
169- set appropriately.
170167 -glc_nec <name> Glacier number of elevation classes [0 | 3 | 5 | 10 | 36]
171168 (default is 0) (standard option with land-ice model is 10)
172169 -help [or -h] Print usage to STDOUT.
@@ -256,7 +253,6 @@ sub process_commandline {
256253 clm_demand => " null" ,
257254 help => 0,
258255 glc_nec => " default" ,
259- glc_present => 0,
260256 light_res => " default" ,
261257 l_ncpl => undef ,
262258 lnd_tuning_mode => " default" ,
@@ -300,7 +296,6 @@ sub process_commandline {
300296 " note!" => \$opts {' note' },
301297 " megan!" => \$opts {' megan' },
302298 " glc_nec=i" => \$opts {' glc_nec' },
303- " glc_present!" => \$opts {' glc_present' },
304299 " light_res=s" => \$opts {' light_res' },
305300 " irrig=s" => \$opts {' irrig' },
306301 " d:s" => \$opts {' dir' },
@@ -1978,57 +1973,42 @@ sub setup_logic_glacier {
19781973 if ( $val != $nl_flags -> {' glc_nec' } ) {
19791974 $log -> fatal_error(" $var set to $val does NOT agree with -glc_nec argument of $nl_flags ->{'glc_nec'} (set with GLC_NEC env variable)" );
19801975 }
1981- if ( $nl_flags -> {' glc_nec' } > 0 ) {
1982- if (! $opts -> {' glc_present' }) {
1983- $log -> fatal_error(" glc_nec is non-zero, but glc_present is not set (probably due to trying to use a stub glc model)" );
1984- }
19851976
1986- if ( $physv -> as_long() < $physv -> as_long(" clm4_5" )) {
1987- add_default( $opts , $nl_flags -> {' inputdata_rootdir ' }, $definition , $defaults , $nl , ' flndtopo ' , ' hgrid ' => $nl_flags -> { ' res ' }, ' mask ' => $nl_flags -> { ' mask ' } );
1988- add_default( $opts , $nl_flags -> { ' inputdata_rootdir ' }, $definition , $defaults , $nl , ' fglcmask ' , ' hgrid ' => $nl_flags -> { ' res ' } );
1989- }
1977+ if ( $physv -> as_long >= $physv -> as_long(" clm4_5" ) ) {
1978+ if ( $nl_flags -> {' glc_nec ' } < 1 ) {
1979+ $log -> fatal_error( " For clm4_5 and later, GLC_NEC must be at least 1. " );
1980+ }
19901981
1991- if ( $physv -> as_long() >= $physv -> as_long(" clm4_5" ) ) {
1992- add_default($opts , $nl_flags -> {' inputdata_rootdir' }, $definition , $defaults , $nl , ' glc_snow_persistence_max_days' );
1993- }
1982+ add_default($opts , $nl_flags -> {' inputdata_rootdir' }, $definition , $defaults , $nl , ' glc_snow_persistence_max_days' );
19941983
19951984 } else {
1996- if ($opts -> {' glc_present' }) {
1997- $log -> fatal_error(" glc_present is set (e.g., due to use of CISM), but glc_nec is zero" );
1998- }
1999-
2000- # Error checking for glacier multiple elevation class options when glc_mec off
2001- # Make sure various glc_mec-specific logicals are not true, and fglcmask is not set
2002- my $create_glcmec = $nl -> get_value(' create_glacier_mec_landunit' );
2003- if ( defined ($create_glcmec ) ) {
2004- if ( &value_is_true($create_glcmec ) ) {
2005- $log -> fatal_error(" create_glacer_mec_landunit is true, but glc_nec is equal to zero" );
2006- }
2007- }
2008- my $glc_dyntopo = $nl -> get_value(' glc_dyntopo' );
2009- if ( defined ($glc_dyntopo ) ) {
2010- if ( &value_is_true($glc_dyntopo ) ) {
2011- $log -> fatal_error(" glc_dyntopo is true, but glc_nec is equal to zero" );
2012- }
2013- }
2014- my $glc_do_dynglacier = $nl -> get_value(' glc_do_dynglacier' );
2015- if ( defined ($glc_do_dynglacier ) ) {
2016- if ( &value_is_true($glc_do_dynglacier ) ) {
2017- $log -> fatal_error(" glc_do_dynglacier (set from GLC_TWO_WAY_COUPLING env variable) is true, but glc_nec is equal to zero" );
2018- }
2019- }
2020- my $fglcmask = $nl -> get_value(' fglcmask' );
2021- if ( defined ($fglcmask ) ) {
2022- $log -> fatal_error(" fglcmask is set, but glc_nec is equal to zero" );
2023- }
1985+ # clm4_0
1986+ if ( $nl_flags -> {' glc_nec' } > 0 ) {
1987+ add_default($opts , $nl_flags -> {' inputdata_rootdir' }, $definition , $defaults , $nl , ' flndtopo' , ' hgrid' => $nl_flags -> {' res' }, ' mask' => $nl_flags -> {' mask' } );
1988+ add_default($opts , $nl_flags -> {' inputdata_rootdir' }, $definition , $defaults , $nl , ' fglcmask' , ' hgrid' => $nl_flags -> {' res' });
1989+
1990+ } else {
1991+ # glc_nec == 0
1992+
1993+ # Error checking for glacier multiple elevation class options when glc_mec off
1994+ # Make sure various glc_mec-specific logicals are not true, and fglcmask is not set
1995+ my $glc_dyntopo = $nl -> get_value(' glc_dyntopo' );
1996+ if ( defined ($glc_dyntopo ) ) {
1997+ if ( &value_is_true($glc_dyntopo ) ) {
1998+ $log -> fatal_error(" glc_dyntopo is true, but glc_nec is equal to zero" );
1999+ }
2000+ }
2001+ my $fglcmask = $nl -> get_value(' fglcmask' );
2002+ if ( defined ($fglcmask ) ) {
2003+ $log -> fatal_error(" fglcmask is set, but glc_nec is equal to zero" );
2004+ }
2005+ }
20242006 }
20252007
20262008 # Dependence of albice on glc_nec has gone away starting in CLM4_5. Thus, we
20272009 # can remove glc_nec from the following call once we ditch CLM4_0.
20282010 add_default($opts , $nl_flags -> {' inputdata_rootdir' }, $definition , $defaults , $nl , ' albice' , ' glc_nec' => $nl_flags -> {' glc_nec' });
20292011 if ( $physv -> as_long() >= $physv -> as_long(" clm4_5" ) ) {
2030- # These controls over glacier region behavior are needed even when running without glc_mec in order to satisfy some error checks in the code
2031- # (And since we'll eventually move to always having glc_mec, it's not worth adding some complex logic to determine when they're really needed.)
20322012 add_default($opts , $nl_flags -> {' inputdata_rootdir' }, $definition , $defaults , $nl , ' glacier_region_behavior' );
20332013 add_default($opts , $nl_flags -> {' inputdata_rootdir' }, $definition , $defaults , $nl , ' glacier_region_melt_behavior' );
20342014 add_default($opts , $nl_flags -> {' inputdata_rootdir' }, $definition , $defaults , $nl , ' glacier_region_ice_runoff_behavior' );
@@ -2410,7 +2390,7 @@ sub setup_logic_initial_conditions {
24102390 if ( &value_is_true($nl -> get_value($useinitvar ) ) ) {
24112391
24122392 add_default($opts , $nl_flags -> {' inputdata_rootdir' }, $definition , $defaults , $nl , " init_interp_attributes" ,
2413- ' sim_year' => $settings {' sim_year' }, ' use_cndv' => $nl_flags -> {' use_cndv' }, ' glc_nec ' => $nl_flags -> { ' glc_nec ' },
2393+ ' sim_year' => $settings {' sim_year' }, ' use_cndv' => $nl_flags -> {' use_cndv' },
24142394 ' use_cn' => $nl_flags -> {' use_cn' }, ' nofail' => 1 );
24152395 my $attributes_string = remove_leading_and_trailing_quotes($nl -> get_value(" init_interp_attributes" ));
24162396 foreach my $pair ( split ( / \s / , $attributes_string ) ) {
0 commit comments