From cfd410a9390f319ecfac4c0ef82353e48af4d102 Mon Sep 17 00:00:00 2001 From: Gautam Bisht Date: Fri, 5 Jan 2024 20:23:26 -0800 Subject: [PATCH] Fixes an ELM setup error related to FAN model Changes the check to determine if the FAN model is active. Fixes #6141 [BFB] --- components/elm/bld/ELMBuildNamelist.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/elm/bld/ELMBuildNamelist.pm b/components/elm/bld/ELMBuildNamelist.pm index 3cb00d89116d..fe7e6eba17b3 100755 --- a/components/elm/bld/ELMBuildNamelist.pm +++ b/components/elm/bld/ELMBuildNamelist.pm @@ -3005,7 +3005,7 @@ sub setup_logic_fan { # Flags to control FAN (Flow of Agricultural Nitrogen) nitrogen deposition (manure and fertilizer) # if ( $nl_flags->{'bgc_mode'} =~/cn|bgc/ ) { - if( $opts->{'fan'} ) { + if( $nl_flags->{'use_fan'} eq ".true." ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fan', 'use_cn'=>$nl_flags->{'use_cn'} ); $nl_flags->{'use_fan'} = $nl->get_value('use_fan'); @@ -3021,7 +3021,7 @@ sub setup_logic_fan { fatal_error('Cannot use_fan if use_crop is false'); } # - if( $opts->{'fan'} ) { + if( $nl_flags->{'use_fan'} eq ".true." ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, "fanmapalgo", 'phys'=>$nl_flags->{'phys'}, 'use_cn'=>$nl_flags->{'use_cn'}, 'hgrid'=>$nl_flags->{'res'} ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, "stream_year_first_fan", 'phys'=>$nl_flags->{'phys'},