@@ -69,10 +69,12 @@ sub getOptions()
6969{
7070 %opts = (
7171 debug => undef ,
72+ # sta_ok => undef,
7273 );
7374
7475 GetOptions(
7576 " debug" => \$opts {' debug' },
77+ # "sta_ok" => \$opts{'sta_ok'},
7678 );
7779}
7880
@@ -93,6 +95,14 @@ sub doPreRunChecks()
9395 $machroot = $config {' CCSM_MACHDIR' };
9496 $mpilib = $config {' MPILIB' };
9597 $scriptsroot = $config {' SCRIPTSROOT' };
98+ if ($config {' DOUT_S' } eq ' TRUE' && ! defined $ENV {' sta_ok' } )
99+ {
100+ print " You are not calling the CESM run script via the CESM submit script. \n " ;
101+ print " As a result, short-term archiving will not be called automatically. \n " ;
102+ print " Please submit your CESM run by running the submit script like so: \n " ;
103+ print " ./$case .submit\n " ;
104+ exit (1);
105+ }
96106
97107 # Change to the case root
98108 chdir ($config {' CASEROOT' });
@@ -108,7 +118,15 @@ sub doPreRunChecks()
108118 scriptsroot => $config {' SCRIPTSROOT' }, caseroot => $config {' CASEROOT' });
109119 $moduleloader -> loadModules();
110120
111- $ENV {' MP_MPILIB' } = $buildenv -> getresolved(' MPILIB' );
121+ my $mpilib = $buildenv -> getresolved(' MPILIB' );
122+ if ($mpilib =~ / mpi-serial/ )
123+ {
124+ delete $ENV {' MP_MPILIB' };
125+ }
126+ else
127+ {
128+ $ENV {' MP_MPILIB' } = $buildenv -> getresolved(' MPILIB' );
129+ }
112130 $config {' MPILIB' } = $buildenv -> getresolved(' MPILIB' );
113131
114132 print " build complete? $config {'BUILD_COMPLETE'}\n " ;
@@ -252,7 +270,7 @@ sub checkInputData()
252270 my $rcbasename = basename($rcfile );
253271 if (! -f " $config {'RUNDIR'}/$rcbasename " )
254272 {
255- symlink ($rcfile , $config {' RUNDIR' }) or warn " could not symlink $rcfile to $config {'RUNDIR'}, $! " ;
273+ symlink ($rcfile , " $config {'RUNDIR'}/ $rcbasename " ) or warn " could not symlink $rcfile to $config {'RUNDIR'}/ $rcbasename , $! " ;
256274 }
257275 }
258276
@@ -416,33 +434,19 @@ sub appendCaseStatus
416434# check to see if we need to do resubmission from this particular job,
417435sub resubmitCheck ()
418436{
419- # if($config{'RESUBMIT'} > 0 && defined $ENV{'islastjob'} && $ENV{'islastjob'} eq 'TRUE')
420- # {
421- # my $batchutils = new Batch::BatchUtils(machine => $config{'MACH'}, machroot => $config{'CCSM_MACHDIR'},
422- # caseroot => $config{'CASEROOT'}, caseconfig => \%config);
423- # $batchutils->doResubmit();
424- # }
425-
426437 my $islastjob = ' FALSE' ;
427438 my $resubmit = $config {' RESUBMIT' };
428439
429440 if (defined $ENV {' islastjob' } && $ENV {' islastjob' } eq ' TRUE' )
430441 {
431442 $islastjob = ' TRUE' ;
432443 }
433- # if($config{'CONTINUE_RUN'} eq 'TRUE' && $config{'RESUBMIT'} > 0 && defined $ENV{'islastjob'} && $ENV{'islastjob'} eq 'TRUE')
434- # {
435- # my $batchutils = Batch::BatchUtilsFactory::getBatchUtils( case => $config{'CASE'}, caseconfig => \%config, caseroot => $config{'CASEROOT'},
436- # ccsmroot => $config{'CIMEROOT'}, compiler => $config{'COMPILER'}, machine => $config{'MACH'},
437- # machroot => $config{'CCSM_MACHDIR'}, mpilib => $config{'MPILIB'},
438- # scriptsroot => $config{'SCRIPTSROOT'} );
439- # $batchutils->doResubmit($ENV{'islastjob'}, $config{'RESUBMIT'}, $scriptname);
440- # }
444+
441445 my $batchutils = Batch::BatchUtilsFactory::getBatchUtils( case => $config {' CASE' }, caseconfig => \%config , caseroot => $config {' CASEROOT' },
442446 ccsmroot => $config {' CIMEROOT' }, compiler => $config {' COMPILER' }, machine => $config {' MACH' },
443447 machroot => $config {' CCSM_MACHDIR' }, mpilib => $config {' MPILIB' },
444448 scriptsroot => $config {' SCRIPTSROOT' } );
445- $batchutils -> doResubmit($ENV {' islastjob' }, $config {' RESUBMIT' }, $scriptname );
449+ $batchutils -> doResubmit($ENV {' islastjob' }, $config {' RESUBMIT' }, $scriptname , " sta_ok " );
446450}
447451sub Debug
448452{
0 commit comments