diff --git a/src/Applications/GEOSdas_App/GEOSdas.csm b/src/Applications/GEOSdas_App/GEOSdas.csm index 145e9373..363bf613 100755 --- a/src/Applications/GEOSdas_App/GEOSdas.csm +++ b/src/Applications/GEOSdas_App/GEOSdas.csm @@ -4413,7 +4413,7 @@ endif # run at command line #-------------------- chmod 744 $jobf - $jobf $aod_parallel_flag >&! $gaasLOG & + $jobf $aod_parallel_flag >&! $gaasLOG else diff --git a/src/Applications/GEOSdas_App/fvsetup b/src/Applications/GEOSdas_App/fvsetup index 47458286..3777b1bf 100755 --- a/src/Applications/GEOSdas_App/fvsetup +++ b/src/Applications/GEOSdas_App/fvsetup @@ -2535,7 +2535,7 @@ sub get_expid { my (%already_asked); $expid = "u000_"."$res"; - if ( $g5gcm ) { $expdsc = "${expid}__${cvstag}__agrid_${res}__ogrid_${ores}" } + if ( $g5gcm ) { $expdsc = "${expid}__agrid_${res}__ogrid_${ores}" } else { $expdsc = "FVGCM-based_run" } print <<"EOF"; @@ -2593,7 +2593,7 @@ EOF } } } - $expdsc = "${expid}__${cvstag}__agrid_${res}__ogrid_${ores}" if $g5gcm; + $expdsc = "${expid}__agrid_${res}__ogrid_${ores}" if $g5gcm; $expdsc = query(" EXPDSC?", $expdsc); return 0; } @@ -2736,10 +2736,10 @@ EOF last if -d $fvbcs; if ($loop++ < 3) { - warn ">> ERROR << cannot find directory $fvbcs"; + warn ">> WARNING << Cannot find directory $fvbcs; Try again;"; redo; } else { - die ">> ERROR << cannot find directory $fvbcs"; + die ">> ERROR << Cannot find directory $fvbcs;"; } } @@ -2756,10 +2756,10 @@ EOF last if -d $fvrtbcs; if ($loop++ < 3) { - warn ">> ERROR << cannot find directory $fvrtbcs"; + warn ">> WARNING << Cannot find directory $fvrtbcs; Try again;"; redo; } else { - die ">> ERROR << cannot find directory $fvrtbcs"; + die ">> ERROR << Cannot find directory $fvrtbcs;"; } } @@ -2790,10 +2790,10 @@ sub get_extdata { unless (-d $extdata{$set}) { if ($loop++ < 3) { - warn ">> ERROR << cannot find directory: $extdata{$set}"; + warn ">> WARNING << Cannot find directory: $extdata{$set}; Try again;"; redo; } else { - die ">> ERROR << cannot find directory: $extdata{$set}"; + die ">> ERROR << Cannot find directory: $extdata{$set};"; } } $loop = 0; @@ -3179,10 +3179,10 @@ EOF $nymde = query(" Ending year-month-day?", $nymde); unless ($nymde =~ /^\s*\d{8}\s*$/) { if ($loop++ < 3) { - warn ">> ERROR << Date must be in yyyymmdd format. Try again.\n\n"; + warn ">> WARNING << Date must be in yyyymmdd format; Try again;"; redo; } else { - die "Date must be in yyyymmdd format. Try again.\n\n"; + die ">> ERROR << Date must be in yyyymmdd format;"; } } } @@ -3199,11 +3199,11 @@ EOF { $fhours21 = query(" Length of FORECAST run segments (in hours)?", $fhours21); if ($fhours21 % 3 != 0) { - if ($loop < 3) { - warn ">> Error << Number of hours should be a multiple of 3. Try again.\n"; + if ($loop++ < 3) { + warn ">> WARNING << Number of hours should be a multiple of 3; Try again;"; redo; } else { - die " Number of hours should be a multiple of 3. Try again.\n"; + die ">> ERROR << Number of hours should be a multiple of 3;"; } } } @@ -7618,7 +7618,7 @@ print SCRIPT <<"EOF"; setenv NCPUS_GPERT $ncpus_gpert # Number of CPUs to run gcmPERT setenv NCPUS_AOD $ncpus_aod # Number of CPUs to run PSAS-AOD setenv O_SERVERS $o_servers # Number of IO servers - setenv GAAS_RUN_SLURM 1 # launch AOD analysis as separate batch job + #setenv GAAS_RUN_SLURM 1 # launch AOD analysis as separate batch job setenv AODBLOCKJOB 1 EOF if ($ncpus_per_node) { @@ -10801,8 +10801,9 @@ sub merge_txt { } #======================================================================= sub write_saved_inputs { - my ($save_file, $dashes, $len, $prompt, $ans); - my (%varDef, @fvANS, $var, %alreadyWarned); + my ($save_file); + my ($ans, $dashes, $fvID, $len, $prompt, $var); + my (%alreadyWarned, %varDef, @fvANS); $save_file = shift @_; @@ -10815,12 +10816,15 @@ sub write_saved_inputs { $len = length("$expid.input")+1; $dashes = "-"x$len; + chomp($fvID = `git hash-object $0 | cut -c1-10`); + print SAVE "#$dashes\n"; print SAVE "# $expid.input\n"; print SAVE "#$dashes\n\n"; + print SAVE "codeID: $cvstag\n"; print SAVE "description: $expdsc\n"; - print SAVE "tag: $cvstag\n"; + print SAVE "fvsetupID: $fvID\n"; print SAVE "fvsetupflags:".$fvsetupflags."\n" if $fvsetupflags; %varDef = (); diff --git a/src/Applications/GEOSdas_App/testsuites/C180RPY.input b/src/Applications/GEOSdas_App/testsuites/C180RPY.input index f23b3938..42b8db59 100644 --- a/src/Applications/GEOSdas_App/testsuites/C180RPY.input +++ b/src/Applications/GEOSdas_App/testsuites/C180RPY.input @@ -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--- @@ -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] @@ -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] @@ -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] @@ -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] diff --git a/src/Applications/GEOSdas_App/testsuites/C180T14RPY.input b/src/Applications/GEOSdas_App/testsuites/C180T14RPY.input index 3d137dfd..aa49b8d3 100644 --- a/src/Applications/GEOSdas_App/testsuites/C180T14RPY.input +++ b/src/Applications/GEOSdas_App/testsuites/C180T14RPY.input @@ -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--- @@ -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] @@ -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] @@ -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] @@ -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] diff --git a/src/Applications/GEOSdas_App/testsuites/C360L181_replay.input b/src/Applications/GEOSdas_App/testsuites/C360L181_replay.input index 7544d0df..2b4fb443 100644 --- a/src/Applications/GEOSdas_App/testsuites/C360L181_replay.input +++ b/src/Applications/GEOSdas_App/testsuites/C360L181_replay.input @@ -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--- diff --git a/src/Applications/GEOSdas_App/testsuites/C360L91_replay.input b/src/Applications/GEOSdas_App/testsuites/C360L91_replay.input index 00f14ef4..4761a88e 100644 --- a/src/Applications/GEOSdas_App/testsuites/C360L91_replay.input +++ b/src/Applications/GEOSdas_App/testsuites/C360L91_replay.input @@ -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--- diff --git a/src/Applications/GEOSdas_App/testsuites/C48f.input b/src/Applications/GEOSdas_App/testsuites/C48f.input index 7babc6cd..ceca39af 100644 --- a/src/Applications/GEOSdas_App/testsuites/C48f.input +++ b/src/Applications/GEOSdas_App/testsuites/C48f.input @@ -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--- diff --git a/src/Applications/GEOSdas_App/testsuites/C90C.input b/src/Applications/GEOSdas_App/testsuites/C90C.input index 4e67007e..32b7e293 100644 --- a/src/Applications/GEOSdas_App/testsuites/C90C.input +++ b/src/Applications/GEOSdas_App/testsuites/C90C.input @@ -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--- diff --git a/src/Applications/GEOSdas_App/testsuites/C90C_ens.input b/src/Applications/GEOSdas_App/testsuites/C90C_ens.input index 57cf8247..9031a002 100644 --- a/src/Applications/GEOSdas_App/testsuites/C90C_ens.input +++ b/src/Applications/GEOSdas_App/testsuites/C90C_ens.input @@ -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--- diff --git a/src/Applications/GEOSdas_App/testsuites/C90C_replay.input b/src/Applications/GEOSdas_App/testsuites/C90C_replay.input index 7f24c573..03774975 100644 --- a/src/Applications/GEOSdas_App/testsuites/C90C_replay.input +++ b/src/Applications/GEOSdas_App/testsuites/C90C_replay.input @@ -2,8 +2,9 @@ # C90C_replay.input #--------------- +codeID: b3a880f description: C90C_replay__86f27c6__agrid_C90__ogrid_C -tag: 86f27c6 +fvsetupID: f7d8d041c9 ---ENDHEADERS--- diff --git a/src/Applications/GEOSdas_App/testsuites/CMakeLists.txt b/src/Applications/GEOSdas_App/testsuites/CMakeLists.txt index 7cbe79d1..b2194e3a 100644 --- a/src/Applications/GEOSdas_App/testsuites/CMakeLists.txt +++ b/src/Applications/GEOSdas_App/testsuites/CMakeLists.txt @@ -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 () - diff --git a/src/Applications/GEOSdas_App/testsuites/checkinput.pl b/src/Applications/GEOSdas_App/testsuites/checkinput.pl index 142e6324..f2ec38c9 100644 --- a/src/Applications/GEOSdas_App/testsuites/checkinput.pl +++ b/src/Applications/GEOSdas_App/testsuites/checkinput.pl @@ -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 #------------- @@ -62,7 +61,8 @@ 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; @@ -70,14 +70,13 @@ sub init { # 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 ); @@ -85,7 +84,6 @@ sub init { $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 } @@ -95,7 +93,6 @@ sub init { $fvroot = dirname($ESMABIN); $fvsetupScript = "$ESMABIN/fvsetup"; die ">> Error << cannot find $fvsetupScript;\n" unless -e $fvsetupScript; - } #======================================================================= @@ -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"; } #======================================================================= @@ -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; @@ -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; } #======================================================================= @@ -644,40 +637,6 @@ sub runSetup { foreach $line () { 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"}) { @@ -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 @@ -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 diff --git a/src/Applications/GEOSdas_App/testsuites/fpp.input b/src/Applications/GEOSdas_App/testsuites/fpp.input index 5ffad57a..4cb36102 100644 --- a/src/Applications/GEOSdas_App/testsuites/fpp.input +++ b/src/Applications/GEOSdas_App/testsuites/fpp.input @@ -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--- diff --git a/src/Applications/GEOSdas_App/testsuites/geos_it.input b/src/Applications/GEOSdas_App/testsuites/geos_it.input index 98238143..70e5fe24 100644 --- a/src/Applications/GEOSdas_App/testsuites/geos_it.input +++ b/src/Applications/GEOSdas_App/testsuites/geos_it.input @@ -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--- diff --git a/src/Applications/GEOSdas_App/testsuites/prePP.input b/src/Applications/GEOSdas_App/testsuites/prePP.input index 642b1679..3819faab 100644 --- a/src/Applications/GEOSdas_App/testsuites/prePP.input +++ b/src/Applications/GEOSdas_App/testsuites/prePP.input @@ -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--- diff --git a/src/Applications/GEOSdas_App/testsuites/runjob.pl b/src/Applications/GEOSdas_App/testsuites/runjob.pl index 9c699c4f..d0c1198c 100644 --- a/src/Applications/GEOSdas_App/testsuites/runjob.pl +++ b/src/Applications/GEOSdas_App/testsuites/runjob.pl @@ -19,7 +19,7 @@ # # Input file header information # => description: [experiment description] -# => tag: [DAS tag ID] +# => fvid: [fvsetup ID] # => def: [variable];nas = [value at NAS] # => def: [variable];nccs = [value at NCCS] # => fvsetupflags: [fvsetup option] @@ -37,12 +37,14 @@ # global variables #----------------- -my ($auto, $autox, $nocheck, $nofilter, @inputFiles, $specified, $noloop); -my ($inputDir, $ignoreOSdiff, $debug, $dbqueue, $stage, $verbose, $sel); -my (%inFile, %rawInFile, %fvhome, $siteID, $CVSTAG, $ESMATST, $TRYAGAIN); -my (%descript, %edits, %expid, %flags, %fvics, %tag, %rem_acct); -my ($ESMABIN, $fvsetupScript, $fvroot, $jobn, @default, @nondefault); - +my ($ESMABIN, $ESMATST, $TRYAGAIN); +my ($auto, $autox, $codeID, $dbqueue, $debug); +my ($fvroot, $fvsetupID, $fvsetupScript); +my ($ignoreOSdiff, $inputDir, $jobn, $nocheck, $nofilter, $noloop); +my ($sel, $siteID, $specified, $stage, $verbose); +my (%descript, %edits, %expid, %flags, %fvhome, %fvics, %fvid); +my (%inFile, %rawInFile, %rem_acct); +my (@default, @inputFiles, @nondefault); # main program #------------- @@ -62,8 +64,8 @@ # Notes on where to find fvsetup - # 1. The variable, $ESMABIN, contains the directory location for the # fvsetup script. This value is hard-coded during the build. -# 2. This script is tag-dependent; it may not work properly for different -# versions of fvsetup which have a different collection and order of prompts. +# 2. This script is fvsetupID-dependent; it may not work properly for different +# versions of fvsetup which have differences in the prompts. # 3. $ESMABIN can be overwritten by using the -D flag to supply an alternate # location for fvsetup. This should be done with great care. #======================================================================= @@ -78,10 +80,12 @@ sub init { $TRYAGAIN = 9999; $siteID = get_siteID(); + #--$fvsetupID = `git hash-object $fvsetupScript | cut -c1-10`; # these values are set with sed substitution 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; @@ -89,10 +93,10 @@ sub init { # get runtime options #-------------------- Getopt::Long::Configure("no_ignore_case"); - GetOptions( "auto" => \$auto, - "autox" => \$autox, - "nocheck" => \$nocheck, - "nofilter" => \$nofilter, + GetOptions( "a|auto" => \$auto, + "ax|autox" => \$autox, + "nc|nocheck" => \$nocheck, + "nf|nofilter" => \$nofilter, "d=s" => \$inputDir, "l|local" => \$localdir, "OSx" => \$ignoreOSdiff, @@ -271,9 +275,8 @@ sub queryInputDir { # purpose - get list of *.input files in $inputDir #======================================================================= sub getInputs { - my ($key, $label, $index, $input, $tag, $expid, $ext); + my ($key, $label, $index, $input, $fvID, $expid, $ext); my ($file, $file1, $size); - my ($tag1, $tag2); # check that user-specified input files exist #-------------------------------------------- @@ -303,40 +306,21 @@ sub getInputs { elsif ($nofilter) { $label .= "\n" } else { - $label .= " for tag, $CVSTAG\n" } + $label .= " for fvsetupID: $fvsetupID\n" } underline($label); $key = 0; foreach $index (0..$#inputFiles) { $input = $inputFiles[$index]; - $tag = extract($input, "tag", 1); + $fvID = extract($input, "fvsetupID", 1); ($expid, $ext) = split/[\.]/, basename $input; - - # ignore the following label differences: - # "_UNSTABLE", "_OPS", "INTERIM", "_rejected", "_retired" - #-------------------------------------------------------- - ($tag1 = $CVSTAG) =~ s/_UNSTABLE$//; - ($tag2 = $tag) =~ s/_UNSTABLE$//; - - $tag1 =~ s/_OPS$//; - $tag2 =~ s/_OPS$//; - - $tag1 =~ s/_INTERIM$//; - $tag2 =~ s/_INTERIM$//; - - $tag1 =~ s/_rejected$//; - $tag2 =~ s/_rejected$//; - - $tag1 =~ s/_retired$//; - $tag2 =~ s/_retired$//; - - next unless $nofilter or ($tag1 eq $tag2); + next unless $nofilter or ($fvsetupID eq $fvID); # continue with input file #------------------------- $inFile{++$key} = $input; - $tag{$key} = $tag; + $fvid{$key} = $fvID; $expid{$key} = $expid; getRawInputs($key); extractAdditionalInfo($key); @@ -561,7 +545,7 @@ sub runjobs { my ($key, @keyArr); unless (%inFile) { - print "\nNo infiles were found for tag, $CVSTAG\n\n"; + print "\nNo infiles were found for fvsetupID: $fvsetupID\n\n"; return; } @@ -610,7 +594,7 @@ sub choose_job { $max1 = maxlen(values %expid); $max2 = maxlen(values %inFile); - $max3 = maxlen(values %tag); + $max3 = maxlen(values %fvid); $fmt0 = "%3s. %s\n"; $fmt1 = " %-${max1}s %-${max2}s %-${max3}s %s\n"; $fmt2 = "%3s. %-${max1}s %-${max2}s %-${max3}s : %s\n"; @@ -622,12 +606,12 @@ sub choose_job { print "\n--------------\n" . "Available Jobs\n" . "--------------\n"; - print "CVSTAG: $CVSTAG\n" unless $nofilter; + print "fvsetupID: $fvsetupID\n" unless $nofilter; print "directory: $inputDir\n\n"; if (%expid) { if ($nofilter) { - printf $fmt1, "expid", "file", "tag", "description"; - printf $fmt1, "-----", "----", "---", "-----------"; + printf $fmt1, "expid", "file", "fvID", "description"; + printf $fmt1, "-----", "----", "----", "-----------"; } else { printf $fmt3, "expid", "file", "description"; @@ -638,7 +622,7 @@ sub choose_job { foreach (sort numeric keys %inFile) { if ($nofilter) { printf $fmt2, $_, $expid{$_}, basename($inFile{$_}), - $tag{$_}, $descript{$_}; + $fvid{$_}, $descript{$_}; } else { printf $fmt4, $_, $expid{$_}, basename($inFile{$_}), @@ -749,9 +733,8 @@ sub run_fvsetup { use File::Path; my $key; my ($rawinput, $fvsuLOG, $fvsuLOG1, $fvsuERR, $fvsuERR1, $output, $logdir); - my ($fvsetup, $expid_arc, $clean, $label, $verify, $ans); + my ($fvsetup, $expid_arc, $clean, $verify, $ans); my ($FVHOME, $dflt, $cmd, @bootstrap, $status, $continueflag); - my ($tag1, $tag2, $tag3, $tag4, $tag5, $tag6, $tag7, $tag8); # input parameter #---------------- @@ -774,69 +757,36 @@ sub run_fvsetup { print " expid: $expid{$key}\n"; print " description: $descript{$key}\n"; print " input file: $inFile{$key}\n"; - print " CVS tag $tag{$key}\n" if $tag{$key};; + print " fvsetup ID: $fvid{$key}\n" if $fvid{$key};; print " fvsetup flags: $flags{$key}\n" if $flags{$key}; print " other edits: $edits{$key}\n" if $edits{$key}; print " FVHOME: $fvhome{$key}\n"; print " fvsetup: $fvsetupScript\n"; - # check CVS tag consistency - #-------------------------- + # check fvsetupid consistency + #---------------------------- $verify = 0; - if ( $tag{$key} ) { - if ( $CVSTAG ne $tag{$key} ) { + if ( $fvid{$key} ) { + if ( $fvsetupID ne $fvid{$key} ) { $verify = 1; - - # is the difference from a known associated label? - #------------------------------------------------- - ($tag1 = $CVSTAG) =~ s/_UNSTABLE$//; - ($tag2 = $tag{$key}) =~ s/_UNSTABLE$//; - if ($tag1 eq $tag2) { $verify = 0; $label = "Unstable tag found" } - - ($tag1 = $CVSTAG) =~ s/_INTERIM$//; - ($tag2 = $tag{$key}) =~ s/_INTERIM$//; - if ($tag1 eq $tag2) { $verify = 0; $label = "Interim tag found" } - - ($tag1 = $CVSTAG) =~ s/_rejected$//; - ($tag2 = $tag{$key}) =~ s/_rejected$//; - if ($tag1 eq $tag2) { $verify = 0; $label = "Rejected tag found" } - - ($tag1 = $CVSTAG) =~ s/_retired$//; - ($tag2 = $tag{$key}) =~ s/_retired$//; - if ($tag1 eq $tag2) { $verify = 0; $label = "Retired tag found" } - - ($tag1 = $CVSTAG) =~ s/_OPS$//; - ($tag2 = $tag{$key}) =~ s/_OPS$//; - if ($tag1 eq $tag2) { $verify = 0; $label = "OPS tag found" } - - # or is it a more serious difference? - #------------------------------------ - if ($verify) { - print "\n !!!---------!!!\n" - . " !!! WARNING !!!\n" - . " !!!---------!!!\n" - . " CVS tag inconsistency found.\n" - . " input file: $inFile{$key}\n\n" - . " CVS Tag (input file): $tag{$key}\n" - . " CVS Tag (runjob script): $CVSTAG\n"; - } - else { - print "\n $label"; - print "\n "."-"x length($label) ."\n" - . " CVS Tag (runjob script): $CVSTAG\n" - . " CVS Tag (input file): $tag{$key}\n"; - } + print "\n !!!---------!!!\n" + . " !!! WARNING !!!\n" + . " !!!---------!!!\n" + . " fvsetupID inconsistency found.\n" + . " input file: $inFile{$key}\n\n" + . " fvsetupID (input file): $fvid{$key}\n" + . " fvsetupID (runjob script): $fvsetupID\n"; } } else { + $verify = 1; print "\n !!!!!!!!!!!!!!!\n" . " !!! WARNING !!!\n" . " !!!!!!!!!!!!!!!\n" - . " No tag information available in input file.\n" + . " fvsetupID not found in input file.\n" . " input file: $inFile{$key}\n\n" - . " CVS Tag (input file): not found\n" - . " CVS Tag (runjob script): $CVSTAG\n"; - $verify = 1; + . " fvsetupID (input file): not found\n" + . " fvsetupID (runjob script): $fvsetupID\n"; } if ($verify) { print "\nUnless you are sure the input file is okay, you should quit" @@ -1405,15 +1355,15 @@ sub usage { usage: $script [options] [file1 [file2 [..]]] options - -auto use dflt responses for queries; automatically submit job(s) - -autox use dflt responses for queries; do not submit job(s) - -nocheck do not check for previous use of expid - -nofilter do not exclude *.input files if CVSTAG does not match + -auto/-a use dflt responses for queries; automatically submit job(s) + -autox/-ax use dflt responses for queries; do not submit job(s) + -nocheck/-nc do not check for previous use of expid + -nofilter/-nf do not exclude *.input files if fvsetupID does not match -d inputDir directory location of saved *.input files - -debug (or -db) runjob debug mode; do not remove .rawInFile and ERR files - -dbqueue (or -dbq) send job to debug queue for faster processing + -debug/-db runjob debug mode; do not remove .rawInFile and ERR files + -dbqueue/-dbq send job to debug queue for faster processing -f fvsetup fvsetup script to use; defaults to \$ESMABIN version - -help (or -h) print usage information + -help/-h print usage information -l get *.input files from local directory -OSx proceed even if OS difference found -stage copy testsuites *.input files to input directory @@ -1426,7 +1376,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 + in the input directory for input files which match the fvsetupID of this script (if -nofilter flag is set, then all inputs will be available). 4. The precedence for determining the input directory (location of *.input files) is as follows: diff --git a/src/Applications/GEOSdas_App/testsuites/x0046a.input b/src/Applications/GEOSdas_App/testsuites/x0046a.input index 1a227b31..bfed5c62 100644 --- a/src/Applications/GEOSdas_App/testsuites/x0046a.input +++ b/src/Applications/GEOSdas_App/testsuites/x0046a.input @@ -2,8 +2,9 @@ # x0046a.input #------------ +codeID: b3a880f description: x0046a__GEOSadas-5_29_3__agrid_C360__ogrid_C -tag: GEOSadas-5_29_3 +fvsetupID: f7d8d041c9 ---ENDHEADERS--- diff --git a/src/Applications/GEOSdas_App/testsuites/x0046aRPY.input b/src/Applications/GEOSdas_App/testsuites/x0046aRPY.input index c5b9a4c2..9b6ac926 100644 --- a/src/Applications/GEOSdas_App/testsuites/x0046aRPY.input +++ b/src/Applications/GEOSdas_App/testsuites/x0046aRPY.input @@ -2,8 +2,9 @@ # x0046aRPY.input #------------ +codeID: b3a880f description: x0046aRPY__GEOSadas-5_29_3__agrid_C360__ogrid_C -tag: GEOSadas-5_29_3 +fvsetupID: f7d8d041c9 ---ENDHEADERS--- diff --git a/src/Applications/NCEP_Etc/NCEP_enkf/scripts/gmao/get_atmens_rst.pl b/src/Applications/NCEP_Etc/NCEP_enkf/scripts/gmao/get_atmens_rst.pl index 0d52486a..4d9a9398 100755 --- a/src/Applications/NCEP_Etc/NCEP_enkf/scripts/gmao/get_atmens_rst.pl +++ b/src/Applications/NCEP_Etc/NCEP_enkf/scripts/gmao/get_atmens_rst.pl @@ -24,14 +24,11 @@ # main program #------------- { - my ($pwd); - my ($three_hr_sec, $ymd3, $hms3, $yyyy3, $mm3, $hh3); - my ($atmens_date_dir, $atmens_date3_dir); - my ($rdnperts_dates3_txt); - my ($atmens_stat_dir, $atmens_ebkg_dir, $atmens_erst_dir, $atmens_ecbkg_dir); - my ($tarfile, $tarpath, $label, $pid); - my ($ens, $mem, $mfile, $mfile_new); - my (@tarList); + my ($atmens_date3_dir, $atmens_date_dir, $atmens_ebkg_dir); + my ($atmens_ecbkg_dir, $atmens_erst_dir, $atmens_stat_dir); + my ($dmlist, $ens, $hh3, $hms3, $label, $mem, $mfile, $mfile_new, $mm3); + my ($pid, $pwd, $rdnperts_dates3_txt, $tarfile, $tarpath); + my ($three_hr_sec, $ymd3, $yyyy3, @tarList, @tarListA); my $fvbin = $FindBin::Bin; $fvroot = dirname($fvbin); @@ -56,13 +53,18 @@ foreach $label ("stat", "ebkg", "ecbkg", "erst") { $tarfile = "$expid.atmens_$label.${yyyymmdd}_${hh}z.tar"; $tarpath = "$atmens_date_dir/$tarfile"; + + $dmlist = `dmls -l $tarpath`; + push @tarListA, $tarpath if $dmlist =~ m/(OFL)/; push @tarList, $tarpath; } - defined($pid = fork) or die "Error while attempting to fork;"; - unless ($pid) { - system "dmget @tarList"; - exit; + if (@tarListA) { + defined($pid = fork) or die "Error while attempting to fork;"; + unless ($pid) { + system_("dmget @tarListA"); + exit; + } } foreach $tarpath (@tarList) { system_("$fvroot/bin/parallel-untar.py $tarpath 16") }