Skip to content

Commit

Permalink
Merge branch '/bishtgautam/lnd/fix-fan-setup' into next (PR #6151)
Browse files Browse the repository at this point in the history
If use_fan = .true. in user_nl_elm, add settings for the FAN model in lnd_in.

Fixes #6152
[BFB]
  • Loading branch information
rljacob committed Jan 18, 2024
2 parents 4641ab3 + dc26875 commit f0653e7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions components/elm/bld/ELMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3001,11 +3001,13 @@ sub setup_logic_phosphorus_deposition {

sub setup_logic_fan {
my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;

# Flags to control FAN (Flow of Agricultural Nitrogen) nitrogen deposition (manure and fertilizer)
#
if ( $nl_flags->{'bgc_mode'} =~/cn|bgc/ ) {
if( $nl_flags->{'use_fan'} eq ".true." ) {
my $var = "use_fan";
my $val = $nl->get_value($var);
if( $val 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');
Expand All @@ -3021,7 +3023,9 @@ sub setup_logic_fan {
fatal_error('Cannot use_fan if use_crop is false');
} #

if( $nl_flags->{'use_fan'} eq ".true." ) {
my $var = "use_fan";
my $val = $nl->get_value($var);
if( $val 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'},
Expand Down

0 comments on commit f0653e7

Please sign in to comment.