@@ -125,7 +125,7 @@ use Plucknames;
125125#
126126#
127127# Update: September, 21, 2021
128- # V3.9
128+ # V3.9
129129# - Move CHECK_POWER_COMMANDS and WINDOW_CHECK to before
130130# run_models call
131131#
@@ -142,6 +142,10 @@ use Plucknames;
142142# - added --nomodels switch to run LR without running the thermal models
143143# - Added comments and fixed typos
144144#
145+ # Update: February 10, 2022
146+ # V4.1
147+ # - Activated hooks for VOB and VOR switches
148+ #
145149# ##########################################################
146150# usage: lr [present load] [previous week] #
147151# example: lr AUG2701A AUG2001 #
@@ -191,9 +195,12 @@ if ($VO_choice ne "")
191195 # But since they did supply one, check to see if the supplied argument
192196 # is in the list. We want to check this and, if the input is invalid, exit.
193197 if ( not ( grep ( / ^$VO_choice $ / , @VO_types )))
194- {
195- die (" FATAL ERROR - $VO_choice is an invalid value for the VO switch.\n Valid values are: VOC, VOR, VOB\n " );
196- }
198+ {
199+ die (" FATAL ERROR - $VO_choice is an invalid value for the VO switch.\n Valid values are: VOC, VOR, VOB\n " );
200+ }
201+ else
202+ { print " \n The VO value is: $VO_choice " ;}
203+
197204 }
198205
199206
@@ -298,7 +305,7 @@ print("\nLength of the input string is: $len_prevload");
298305# Get the last token in the preview load name
299306$last_token = substr ($prev_load , -1);
300307
301- print ( " \n Before the IF: " );
308+
302309print (" \n The Previous load variable contains: $prev_load " );
303310
304311
@@ -422,7 +429,7 @@ if( (! $test_dir) &&
422429# ------------------------------------------------------
423430
424431# CD to the newly-created ofls<x> directory.
425- # CD to /data/acis/LoadReviews/<YEAR>/LOAD/ofls<a,b,c etc> ------- IN OFLS DIR
432+ # CD to /data/acis/LoadReviews/<YEAR>/LOAD/ofls<a,b,c etc> ------------------------- ------- IN OFLS DIR
426433chdir (" ${ofls_dir} " ) || die " Cannot change directories to $ofls_dir \n " ;
427434
428435if ($skiplucky )
@@ -483,7 +490,8 @@ print "unzipping: $zip ...\n";
483490# Get tar file
484491$file = (Plucknames-> findNames(" ." , " backstop.tar" ))[0];
485492
486- # backstop extraction and acis script
493+ # Extract both the CR*.backstop file and the .../vehicle/VR*.backstop file
494+ # backstop extraction and acis script
487495@tarTOC = Archive::Tar-> list_archive($file , 0);
488496@bck = Plucknames-> tarNames(\@tarTOC , " backstop" );
489497
@@ -652,19 +660,56 @@ open(CONTFILE, ">$ofls_dir/ACIS-Continuity.txt");
652660# directory path to the ACIS-Continuity.txt file
653661print CONTFILE $prev_load_dir .$ofls_val , " \n " ;
654662
655- # Now, if the user specified "VOC" for the VO command line argument,
656- # Then append "VO_" to the load type. This will inform the models
663+ # Now, if the user specified either "VOC" or "VOB" for the VO command line argument,
664+ # then append "VO_" to the load type. This will inform the models
657665# that when the continuity load is read, the Vehicle Only version
658666# should be used. Otherwise load_type should be just the present
659667# value
660- if ($VO_choice eq " VOC" )
668+ #
669+ # VOB stands for (V)ehicle (O)nly (B)oth, meaning that the VR*.backstop vehicle only file
670+ # should be read for both the Review and the Continuity load. But this piece of code
671+ # handles what gets written to the ACIS-Continuity.txt file. So in both cases (VOC and VOB)
672+ # You want ACIS-Continuity.txt to indicate vehicle-only for the Continuity load.
673+ # Reading the VR*.backstop file for the review load is handled by the call to run-models.pl.
674+ if ( ($VO_choice eq " VOC" ) || ($VO_choice eq " VOB" ) )
661675 {
662676 # User selected VOC for the VO switch. Tell the model to read
663677 # the vehicle only load for the Continuity. Append "VO_"
664678 # to the recognized load type
665679 $load_type = " VO_" .$load_type ;
666680 }
667681
682+ # Now if $VO_choice is either VOB or VOR, then the REVIEW Load is to be run Vehicle Only.
683+ # In this case copy the CR*.backstop file to ORIG_CR*.backstop, and the .../vehicle/VR*.backstop
684+ # is to be copied to CR*_V.backstop.
685+ #
686+ if ( ($VO_choice eq " VOR" ) || ($VO_choice eq " VOB" ) )
687+ {
688+
689+ # Save the full backstop file as ORIG_CR*.backstop
690+ print " \n Received the $VO_choice switch. Copying $backfile to ORIG_${backfile} " ;
691+ system (" mv $backfile ORIG_${backfile} " );
692+
693+ # Formulate the modified name for the CR backstop file to include "_V" in the name
694+ # Index of the beginning of the extension: ".backstop"
695+ $ext_index = index ($backfile , " .backstop" );
696+
697+ # Extract the file name without the extension
698+ $old_CR_file_name = substr ($backfile , 0, $ext_index );
699+
700+ # Compose a new name by concatenating the "_V" to the name and include the extension
701+ $new_CR_file_name = " ${old_CR_file_name} _V.backstop" ;
702+
703+ # Perform the copy of the Vehicle-Only file to tne CR file with the new name.
704+ print " \n ...and now copying $vfile to $new_CR_file_name " ;
705+ system ( " cp $vfile $new_CR_file_name " );
706+
707+
708+ # Lastly, change the variable $backfile so that it points to the new CR*_V.backstop file
709+ # Other applications need to access this file and they need to know the new name
710+ $backfile = $new_CR_file_name ;
711+ }
712+
668713
669714# Write out the type of load: Normal, TOO, SCS107
670715if ($break == 1)
@@ -761,7 +806,7 @@ print "\nACIS-backstop completed.\n";
761806# ------------------------------
762807# Set up soft links
763808# ------------------------------
764- chdir (" $cur_load_dir " ) || die " cannot change to ${cur_load_dir} \n " ;
809+ chdir (" $cur_load_dir " ) || die " cannot change to ${cur_load_dir} \n " ; # -------------------------------- CHDIR IN .../YYYY/MMMDDYY DIR
765810
766811if (-e " ./ofls" )
767812 {
@@ -772,7 +817,7 @@ if(-e "./ofls")
772817symlink ( " ${ofls_dir} " , " ./ofls" );
773818
774819# CD to the OFLS dir
775- chdir (" ${ofls_dir} " ) || die " Cannot change to {$ofls_dir }" ;
820+ chdir (" ${ofls_dir} " ) || die " Cannot change to {$ofls_dir }" ; # -------------------------------- CHDIR IN OFLS DIR
776821
777822
778823# determine and display version of ACIS tables used:
@@ -859,8 +904,10 @@ else
859904#
860905# Run Check_Power_Cmds.py
861906print " \n EXECUTING THE CHECK POWER COMMAND PROGRAM" ;
907+ # PRODUCTION
862908system (" /usr/local/bin/python3 /data/acis/LoadReviews/script/CHECK_POWER_COMMANDS/Check_Power_Cmds.py" );
863909
910+
864911# Now execute the Window Check program
865912print " \n EXECUTING THE WINDOW CHECK PROGRAM." ;
866913system (' /usr/local/bin/python3 /data/acis/LoadReviews/script/WINDOW_CHECK/Window_Check.py' );
@@ -940,7 +987,7 @@ print "Done with thermal codes...\n\n";
940987print " \n ACIS TABLES USED IN THIS LOAD:\n $cfg_file \n $dat_file \n " ;
941988
942989# CD to /data/acis<-bak>/LoadReviews.
943- chdir (" $lr_dir " );
990+ chdir (" $lr_dir " ); # -------------------------------- CHDIR IN /DATA/ACIS/LoadReviews DIR
944991
945992# Do NOT use this directory for ACE if there is test directory
946993unless ($test_dir ){
0 commit comments