From 915af954a034a1e6d4f777623cde90977e614499 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Thu, 8 Aug 2024 10:33:31 -0600 Subject: [PATCH] add spellcheck in bld-nml-tester --- bld/unit_testers/build-namelist_test.pl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index fe6591c16b..d31d8e9294 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1211,6 +1211,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"}; @@ -1288,6 +1295,14 @@ sub cat_and_create_namelistinfile { ); foreach my $key ( keys(%warntest) ) { print( "$key\n" ); + + my $var; + foreach $var ( "phys" , "options", "namelst" ) { + if ( not exists $failtest{$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"}; @@ -1517,6 +1532,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 $failtest{$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);