Skip to content

Commit

Permalink
Issue #119: Updates so that runjob script can check for consistency b…
Browse files Browse the repository at this point in the history
…etween input file and fvsetup.
  • Loading branch information
gmao-jstassi committed Nov 30, 2021
1 parent b55a9fe commit 1f3f933
Show file tree
Hide file tree
Showing 16 changed files with 127 additions and 190 deletions.
15 changes: 8 additions & 7 deletions src/Applications/GEOSdas_App/testsuites/C180RPY.input
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# C180RPY.input
#------------

description: C180RPY__GEOSadas-5_29_3__agrid_C360__ogrid_C
tag: GEOSadas-5_29_3
codeID: b3a880f
description: C180RPY__GEOSadas-5_29_3__agrid_C180__ogrid_C
fvsetupID: f7d8d041c9

---ENDHEADERS---

Expand All @@ -28,7 +29,7 @@ EXPID? [u000_C180]
Check for previous use of expid (y/n)? [y]
> n

EXPDSC? [C180RPY__GEOSadas-5_29_3__agrid_C360__ogrid_C]
EXPDSC? [C180RPY__GEOSadas-5_29_3__agrid_C180__ogrid_C]
>

Land Boundary Conditions? [Icarus_Updated]
Expand Down Expand Up @@ -85,7 +86,7 @@ Run model-adjoint-related applications (0=no,1=yes)? [0]
Run analysis-sensitivity applications (0=no,1=yes)? [0]
>

Ending year-month-day? [20191121]
Ending year-month-day? [20201201]
> 20210206

Length of FORECAST run segments (in hours)? [123]
Expand All @@ -97,7 +98,7 @@ Number of one-day DAS segments per PBS job? [1]
Number of PEs in the zonal direction (NX)? [8]
> 20

Number of PEs in the meridional direction (NY)? [48]
Number of PEs in the meridional direction (NY)? [30]
> 60

Job nickname? [g5das]
Expand All @@ -124,10 +125,10 @@ GEOS grid resolution instead? [d]
Ensemble Hybrid (<0;3=3dHyb;4=Hyb4d)? [-1]
> 4

Number of procs in the zonal direction (NX)? [12]
Number of procs in the zonal direction (NX)? [6]
> 16

Number of procs in the meridional direction (NY)? [20]
Number of procs in the meridional direction (NY)? [32]
> 42

Which main class of ObsSys (1: NRT; 2: MERRA; 3: MERRA-2)? [1]
Expand Down
15 changes: 8 additions & 7 deletions src/Applications/GEOSdas_App/testsuites/C180T14RPY.input
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# C180T14RPY.input
#------------

description: C180T14RPY__GEOSadas-5_29_3__agrid_C360__ogrid_C
tag: GEOSadas-5_29_3
codeID: b3a880f
description: C180T14RPY__GEOSadas-5_29_3__agrid_C180__ogrid_T14
fvsetupID: f7d8d041c9

---ENDHEADERS---

Expand All @@ -28,7 +29,7 @@ EXPID? [u000_C180]
Check for previous use of expid (y/n)? [y]
> n

EXPDSC? [C180T14RPY__GEOSadas-5_29_3__agrid_C360__ogrid_C]
EXPDSC? [C180T14RPY__GEOSadas-5_29_3__agrid_C180__ogrid_T14]
>

Land Boundary Conditions? [Icarus_Updated]
Expand Down Expand Up @@ -85,7 +86,7 @@ Run model-adjoint-related applications (0=no,1=yes)? [0]
Run analysis-sensitivity applications (0=no,1=yes)? [0]
>

Ending year-month-day? [20191121]
Ending year-month-day? [20201201]
> 20210206

Length of FORECAST run segments (in hours)? [123]
Expand All @@ -97,7 +98,7 @@ Number of one-day DAS segments per PBS job? [1]
Number of PEs in the zonal direction (NX)? [8]
> 20

Number of PEs in the meridional direction (NY)? [48]
Number of PEs in the meridional direction (NY)? [30]
> 60

Job nickname? [g5das]
Expand All @@ -124,10 +125,10 @@ GEOS grid resolution instead? [d]
Ensemble Hybrid (<0;3=3dHyb;4=Hyb4d)? [-1]
> 4

Number of procs in the zonal direction (NX)? [12]
Number of procs in the zonal direction (NX)? [6]
> 16

Number of procs in the meridional direction (NY)? [20]
Number of procs in the meridional direction (NY)? [32]
> 42

Which main class of ObsSys (1: NRT; 2: MERRA; 3: MERRA-2)? [1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# C360L181_replay.input
#------------

codeID: b3a880f
description: C360L181_replay__GEOSadas-5_29_3__agrid_C360__ogrid_C
tag: GEOSadas-5_29_3
fvsetupID: f7d8d041c9

---ENDHEADERS---

Expand Down
3 changes: 2 additions & 1 deletion src/Applications/GEOSdas_App/testsuites/C360L91_replay.input
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# C360L91_replay.input
#------------

codeID: b3a880f
description: C360L91_replay__GEOSadas-5_29_3__agrid_C360__ogrid_C
tag: GEOSadas-5_29_3
fvsetupID: f7d8d041c9

---ENDHEADERS---

Expand Down
3 changes: 2 additions & 1 deletion src/Applications/GEOSdas_App/testsuites/C48f.input
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# C48f.input
#-----------

codeID: b3a880f
description: C48f__GEOSadas-5_29_3__agrid_C48__ogrid_f34
tag: GEOSadas-5_29_3
fvsetupID: f7d8d041c9
fvsetupflags: -sensdeg 1

---ENDHEADERS---
Expand Down
3 changes: 2 additions & 1 deletion src/Applications/GEOSdas_App/testsuites/C90C.input
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# C90C.input
#-----------

codeID: b3a880f
description: C90C__GEOSadas-5_29_3__agrid_C90__ogrid_CS
tag: GEOSadas-5_29_3
fvsetupID: f7d8d041c9

---ENDHEADERS---

Expand Down
3 changes: 2 additions & 1 deletion src/Applications/GEOSdas_App/testsuites/C90C_ens.input
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# C90C_ens.input
#---------------

codeID: b3a880f
description: C90C_ens__GEOSadas-5_29_3__agrid_C90__ogrid_C
tag: GEOSadas-5_29_3
fvsetupID: f7d8d041c9

---ENDHEADERS---

Expand Down
3 changes: 2 additions & 1 deletion src/Applications/GEOSdas_App/testsuites/C90C_replay.input
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# C90C_replay.input
#---------------

codeID: b3a880f
description: C90C_replay__86f27c6__agrid_C90__ogrid_C
tag: 86f27c6
fvsetupID: f7d8d041c9

---ENDHEADERS---

Expand Down
21 changes: 18 additions & 3 deletions src/Applications/GEOSdas_App/testsuites/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,30 @@ if(GIT_FOUND)
message(FATAL_ERROR "This should not be reached")
endif ()
endif ()

message("Setting fvID to fvsetup SHA1 (1st 10 digits)")
execute_process(
COMMAND ${GIT_EXECUTABLE} hash-object src/Applications/GEOSdas_App/fvsetup
COMMAND cut -c1-10
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE fvID
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message("fvID=${fvID}")
endif()

configure_file(CVSTAG.in CVSTAG @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/CVSTAG DESTINATION etc)
install (
FILES ${CMAKE_CURRENT_BINARY_DIR}/CVSTAG
DESTINATION etc
)

set (ESMABIN ${CMAKE_INSTALL_PREFIX}/bin)
set (ESMATST ${CMAKE_INSTALL_PREFIX}/etc/testsuites)
foreach (perl_script checkinput runjob)
configure_file ( ${perl_script}.pl ${perl_script} @ONLY)
install (PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${perl_script} DESTINATION bin)
install (
PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${perl_script}
DESTINATION bin
)
endforeach ()

75 changes: 17 additions & 58 deletions src/Applications/GEOSdas_App/testsuites/checkinput.pl
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@

# global variables
#-----------------
my ($auto, $inputDir, $full, $ignoreOSdiff, $debug, $stage, $rmlabel);
my ($verbose, $VERBOSE, $replaceALL);
my ($inFile, $inFileChk, @goodFiles, @badFiles, @errFiles);
my (@inputFiles, %head, $expid, %def0, %def1, @rawVALUE);
my ($fvsetupScript, $fvroot, $newinput);
my ($noloop, $sel, $sel_dflt);
my ($CVSTAG, $ESMATST, $siteID);
my ($auto, $codeID, $debug, $ESMATST, $expid, $full, $fvroot);
my ($fvsetupID, $fvsetupScript, $ignoreOSdiff);
my ($inFile, $inFileChk, $inputDir, $newinput, $noloop, $replaceALL);
my ($sel, $sel_dflt, $siteID, $stage, $VERBOSE, $verbose);
my (@badFiles, @errFiles, @goodFiles, @inputFiles, @rawVALUE);
my (%def0, %def1, %head);

# main program
#-------------
Expand Down Expand Up @@ -62,30 +61,29 @@ sub init {

# these values are set during build
#----------------------------------
$CVSTAG = "@GIT_TAG_OR_REV@";
$codeID = "@GIT_TAG_OR_REV@";
$fvsetupID = "@fvID@";
$ESMABIN = "@ESMABIN@";
$ESMATST = "@ESMATST@";
die ">> Error << $ESMABIN is not a directory;" unless -d $ESMABIN;

# get runtime options
#--------------------
Getopt::Long::Configure("no_ignore_case");
GetOptions( "auto" => \$auto,
GetOptions( "a|auto" => \$auto,
"d=s" => \$inputDir,
"full" => \$full,
"l|local" => \$localdir,
"OSx" => \$ignoreOSdiff,
"db|debug" => \$debug,
"h|help" => \$help,
"RL!" => \$rmlabel,
"stage" => \$stage,
"v" => \$verbose,
"V" => \$VERBOSE );
usage() if $help;
$verbose = 0 unless $verbose;
$VERBOSE = 0 unless $VERBOSE;
$verbose = 1 if $VERBOSE;
$rmlabel = 1 unless defined($rmlabel);

@inputFiles = @ARGV;
if ($localdir) { $inputDir = cwd() unless $inputDir }
Expand All @@ -95,7 +93,6 @@ sub init {
$fvroot = dirname($ESMABIN);
$fvsetupScript = "$ESMABIN/fvsetup";
die ">> Error << cannot find $fvsetupScript;\n" unless -e $fvsetupScript;

}

#=======================================================================
Expand All @@ -109,8 +106,8 @@ sub intro {
print "\n====================\n"
. "\nCheck Fvsetup Inputs\n"
. "\n====================\n";
print "\nCVSTAG: $CVSTAG\n";
print "fvsetup: " . dirname($fvsetupScript) ."\n";
print "fvsetupID: $fvsetupID\n";
print "fvsetup: " . dirname($fvsetupScript) ."\n";
}

#=======================================================================
Expand Down Expand Up @@ -191,10 +188,6 @@ sub getInputDir {
}
}

# chdir to $inputDir, just to be safe
#------------------------------------
chdir $inputDir;

# stage inputs from testsuites directory, if requested
#-----------------------------------------------------
stageInputs() if $stage;
Expand Down Expand Up @@ -268,7 +261,7 @@ sub getInputFiles {

# get list of setup input files, if not specified by user
#--------------------------------------------------------
@inputFiles = (<$inputDir/*input>) unless @inputFiles;
@inputFiles = (<*.input>) unless @inputFiles;
}

#=======================================================================
Expand Down Expand Up @@ -644,40 +637,6 @@ sub runSetup {
foreach $line (<NEW>) {
chomp $line;

# remove UNSTABLE, OPS, rejected, and retired labels from CVSTAG
#---------------------------------------------------------------
if ($rmlabel) {
if ($line =~ /$CVSTAG/ and $line =~ /_UNSTABLE/) {
($modline = $line) =~ s/_UNSTABLE//g;
print " mod: [$line] => [$modline]\n";
$line = $modline;
}

if ($line =~ /$CVSTAG/ and $line =~ /_INTERIM/) {
($modline = $line) =~ s/_INTERIM//g;
print " mod: [$line] => [$modline]\n";
$line = $modline;
}

if ($line =~ /$CVSTAG/ and $line =~ /_OPS/) {
($modline = $line) =~ s/_OPS//g;
print " mod: [$line] => [$modline]\n";
$line = $modline;
}

if ($line =~ /$CVSTAG/ and $line =~ /_rejected/) {
($modline = $line) =~ s/_rejected//g;
print " mod: [$line] => [$modline]\n";
$line = $modline;
}

if ($line =~ /$CVSTAG/ and $line =~ /_retired/) {
($modline = $line) =~ s/_retired//g;
print " mod: [$line] => [$modline]\n";
$line = $modline;
}
}

# transfer previous description if one existed
#---------------------------------------------
if ($line =~ /^description:\s*$/ and $head{"description"}) {
Expand Down Expand Up @@ -1276,13 +1235,13 @@ sub usage {
usage: $script [options]
options
-auto use defaults rather than prompting for responses
-auto/-a use defaults rather than prompting for responses
-d inputDir directory location of saved *.input files
-full write full responses in *.input files
-l use local directory to look for saved *.input files
-local/-l use local directory to look for saved *.input files
-OSx proceed even if OS difference found
-debug (or -db) do not remove .rawInFile and error logfile
-help (or -h) print usage information
-debug/-db do not remove .rawInFile and error logfile
-help/-h print usage information
-noRL do not remove the following labels from tag name:
"_UNSTABLE" "_INTERIM", "_OPS", "_rejected", "_retired"
by default these labels are removed
Expand All @@ -1295,7 +1254,7 @@ sub usage {
2. However, input files may be specified by name only in the command line,
without including the ".input" extension.
3. If no file is specified as an input parameter, then the script will look
in the input directory for input files which match the CVSTAG of this script
at all input files in the local directory.
4. The precedence for determining the input directory (location of *.input files)
is as follows:
i) location specified with the -d flag
Expand Down
3 changes: 2 additions & 1 deletion src/Applications/GEOSdas_App/testsuites/fpp.input
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# fpp.input
#------------

codeID: b3a880f
description: fpp__GEOSadas-5_29_3__agrid_C720__ogrid_C
tag: GEOSadas-5_29_3
fvsetupID: f7d8d041c9

---ENDHEADERS---

Expand Down
3 changes: 2 additions & 1 deletion src/Applications/GEOSdas_App/testsuites/geos_it.input
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# geos_it.input
#--------------

codeID: b3a880f
description: geos_it__GEOSadas-5_29_3__agrid_C360__ogrid_C
tag: GEOSadas-5_29_3
fvsetupID: f7d8d041c9

---ENDHEADERS---

Expand Down
3 changes: 2 additions & 1 deletion src/Applications/GEOSdas_App/testsuites/prePP.input
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# prePP.input
#------------

codeID: b3a880f
description: prePP__GEOSadas-5_29_3__agrid_C720__ogrid_C
tag: GEOSadas-5_29_3
fvsetupID: f7d8d041c9

---ENDHEADERS---

Expand Down
Loading

0 comments on commit 1f3f933

Please sign in to comment.