Skip to content

Commit

Permalink
Merge pull request #2678 from mvdebolskiy/fix-namelist-tester
Browse files Browse the repository at this point in the history
Add check in build-namelist_test.pl
  • Loading branch information
ekluzek authored Oct 1, 2024
2 parents ca4caa7 + 3295adb commit 98e42fb
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions bld/unit_testers/build-namelist_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,13 @@ sub cat_and_create_namelistinfile {
);
foreach my $key ( keys(%failtest) ) {
print( "$key\n" );
my $var;
foreach $var ( "phys" , "options", "namelst" ) {
if ( not exists $failtest{$key}{$var} ) {
die "ERROR: Subkey $var does not exist for failtest $key\nERROR:Check if you spelled $var correctly\n"
}
}

&make_config_cache($failtest{$key}{"phys"});
my $options = $failtest{$key}{"options"};
my $namelist = $failtest{$key}{"namelst"};
Expand Down Expand Up @@ -1366,6 +1373,14 @@ sub cat_and_create_namelistinfile {
);
foreach my $key ( keys(%warntest) ) {
print( "$key\n" );

my $var;
foreach $var ( "phys" , "options", "namelst" ) {
if ( not exists $warntest{$key}{$var} ) {
die "ERROR: Subkey $var does not exist for warntest $key\nERROR:Check if you spelled $var correctly\n"
}
}

&make_config_cache($warntest{$key}{"phys"});
my $options = $warntest{$key}{"options"};
my $namelist = $warntest{$key}{"namelst"};
Expand Down Expand Up @@ -1595,6 +1610,14 @@ sub cat_and_create_namelistinfile {

foreach my $key ( keys(%finidat_files) ) {
print( "$key\n" );

my $var;
foreach $var ( "phys" , "atm_forc", "res", "bgc", "crop", "use_case", "start_ymd", "namelist" ) {
if ( not exists $finidat_files{$key}{$var} ) {
die "ERROR: Subkey $var does not exist for finidat_file $key\nERROR:Check if you spelled $var correctly\n"
}
}

my $phys = $finidat_files{$key}{'phys'};
print "physics = $phys\n";
&make_config_cache($phys);
Expand Down

0 comments on commit 98e42fb

Please sign in to comment.