@@ -4071,7 +4071,16 @@ sub setup_logic_fire_emis {
40714071 if ( &value_is_true( $nl_flags -> {' use_fates' } ) ) {
40724072 $log -> warning(" Fire emission option $var can NOT be on when FATES is also on.\n " .
40734073 " DON'T use the '--fire_emis' option when '--bgc fates' is activated" );
4074- }
4074+ } elsif ( ! &value_is_true( $nl_flags -> {' use_cn' } ) ) {
4075+ $log -> fatal_error(" Fire emission option $var can NOT be on when BGC SP (i.e. Satellite Phenology) is also on.\n " .
4076+ " DON'T use the '--fire_emis' option when '--bgc sp' is activated" );
4077+ } elsif ( &value_is_true( $nl_flags -> {' use_cn' }) ) {
4078+ my $fire_method = remove_leading_and_trailing_quotes( $nl -> get_value(' fire_method' ) );
4079+ if ( $fire_method eq " nofire" ) {
4080+ $log -> fatal_error(" Fire emission option $var can NOT be on with BGC and fire_method=='nofire'.\n " .
4081+ " DON'T use the '--fire_emis' option when fire_method is nofire" );
4082+ }
4083+ }
40754084 }
40764085 }
40774086}
@@ -4235,7 +4244,7 @@ sub setup_logic_lai_streams {
42354244 if ( &value_is_true($nl_flags -> {' use_crop' }) && &value_is_true($nl -> get_value(' use_lai_streams' )) ) {
42364245 $log -> fatal_error(" turning use_lai_streams on is incompatable with use_crop set to true." );
42374246 }
4238- if ( $nl_flags -> {' bgc_mode' } eq " sp" || ($nl_flags -> {' bgc_mode' } eq " fates" && &value_is_true($nl -> get_value( ' use_fates_sp' ) ) )) {
4247+ if ( $nl_flags -> {' bgc_mode' } eq " sp" || ($nl_flags -> {' bgc_mode' } eq " fates" && &value_is_true($nl_flags -> { ' use_fates_sp' } ) )) {
42394248 if ( &value_is_true($nl -> get_value(' use_lai_streams' )) ) {
42404249 add_default($opts , $nl_flags -> {' inputdata_rootdir' }, $definition , $defaults , $nl , ' use_lai_streams' );
42414250 add_default($opts , $nl_flags -> {' inputdata_rootdir' }, $definition , $defaults , $nl , ' lai_mapalgo' ,
@@ -4745,29 +4754,26 @@ sub setup_logic_fates {
47454754 # For FATES SP mode make sure no-competetiion, and fixed-biogeography are also set
47464755 # And also check for other settings that can't be trigged on as well
47474756 #
4748- my $var = " use_fates_sp" ;
4749- if ( defined ($nl -> get_value($var )) ) {
4750- if ( &value_is_true($nl -> get_value($var )) ) {
4751- my @list = ( " use_fates_nocomp" , " use_fates_fixed_biogeog" );
4752- foreach my $var ( @list ) {
4753- if ( ! &value_is_true($nl -> get_value($var )) ) {
4754- $log -> fatal_error(" $var is required when FATES SP is on (use_fates_sp)" );
4755- }
4756- }
4757- # spit-fire can't be on with FATES SP mode is active
4758- if ( $nl -> get_value(' fates_spitfire_mode' ) > 0 ) {
4759- $log -> fatal_error(' fates_spitfire_mode can NOT be set to greater than 0 when use_fates_sp is true' );
4760- }
4757+ if ( &value_is_true($nl_flags -> {' use_fates_sp' }) ) {
4758+ my @list = ( " use_fates_nocomp" , " use_fates_fixed_biogeog" );
4759+ foreach my $var ( @list ) {
4760+ if ( ! &value_is_true($nl -> get_value($var )) ) {
4761+ $log -> fatal_error(" $var is required when FATES SP is on (use_fates_sp)" );
4762+ }
4763+ }
4764+ # spit-fire can't be on with FATES SP mode is active
4765+ if ( $nl -> get_value(' fates_spitfire_mode' ) > 0 ) {
4766+ $log -> fatal_error(' fates_spitfire_mode can NOT be set to greater than 0 when use_fates_sp is true' );
4767+ }
47614768
4762- # fates landuse can't be on with FATES SP mode is active
4763- if ( &value_is_true($nl -> get_value(' use_fates_luh' )) ) {
4764- $log -> fatal_error(' use_fates_luh can NOT be true when use_fates_sp is true' );
4765- }
4769+ # fates landuse can't be on with FATES SP mode is active
4770+ if ( &value_is_true($nl -> get_value(' use_fates_luh' )) ) {
4771+ $log -> fatal_error(' use_fates_luh can NOT be true when use_fates_sp is true' );
4772+ }
47664773
4767- # hydro isn't currently supported to work when FATES SP mode is active
4768- if (&value_is_true( $nl -> get_value(' use_fates_planthydro' ) )) {
4769- $log -> fatal_error(' fates sp mode is currently not supported to work with fates hydro' );
4770- }
4774+ # hydro isn't currently supported to work when FATES SP mode is active
4775+ if (&value_is_true( $nl -> get_value(' use_fates_planthydro' ) )) {
4776+ $log -> fatal_error(' fates sp mode is currently not supported to work with fates hydro' );
47714777 }
47724778 }
47734779 my $var = " use_fates_inventory_init" ;
@@ -4792,6 +4798,13 @@ sub setup_logic_fates {
47924798 }
47934799 }
47944800 }
4801+ # Check that both FaTES-SP and FATES ST3 aren't both on
4802+ my $var = " use_fates_ed_st3" ;
4803+ if ( defined ($nl -> get_value($var )) ) {
4804+ if ( &value_is_true($nl -> get_value($var )) && &value_is_true($nl_flags -> {' use_fates_sp' }) ) {
4805+ $log -> fatal_error(" $var can NOT also be true with use_fates_sp true" );
4806+ }
4807+ }
47954808 # check that fates landuse change mode has the necessary luh2 landuse timeseries data
47964809 # and add the default if not defined. Do not add default if use_fates_potentialveg is true.
47974810 # If fixed biogeography is on, make sure that flandusepftdat is avilable.
0 commit comments