Skip to content

Commit

Permalink
Some detection for when oncvpsp.x is not the OCEAN-modified version f…
Browse files Browse the repository at this point in the history
…or issue times-software#329
  • Loading branch information
jtv3 committed Jul 2, 2024
1 parent 0823c1a commit abada72
Showing 1 changed file with 38 additions and 11 deletions.
49 changes: 38 additions & 11 deletions OPF/opf.pl
Original file line number Diff line number Diff line change
Expand Up @@ -757,26 +757,37 @@

print OUT "$spdf[0] $spdf[1] $spdf[2] $spdf[3]\n";
print OUT "$spdf[0] $spdf[1] $spdf[2] $spdf[3]\n";
close OUT;


my $log = $psplist{"$znucl"} . ".log";
system("$ENV{'OCEAN_BIN'}/oncvpsp.x < $oncvpspInputFile > $log") == 0 or die;
move( "ocean.mod", "ppot" ) or die;
system("$ENV{'OCEAN_BIN'}/oncvpsp.x < $oncvpspInputFile > $log") == 0
or die "Failed to run oncvpsp.x. Check logfile OPF/$log\n\$!";
unless( move( "ocean.mod", "ppot" ) )
{
open IN, "<", $log or die "It appears oncvpsp.x has not run correctly\n";
my $correctONCVPSP = 0;
while( my $line = <IN> )
{
if( $line =~ m/OCEAN/ )
{
$correctONCVPSP = 1;
last;
}
}
close IN;
die "oncvpsp.x did not finish correctly. Check the logfile OPF/$log\n" if( $correctONCVPSP );
die "Incorrect version of oncvpsp.x installed. Make sure you have the OCEAN-modified version\n";
}
# move( "ocean.mod", "ppot" ) or die;

open HFIN, ">hfin1" or die;
print HFIN "initgrid\n";
print HFIN "$znucl $grid\n";
# print HFIN "fakel\n0 $lmax\n";
print HFIN "ppload\n";
print HFIN "mkcorcon\nscreencore\nmkcorcon\ncalcso\nquit\n";
close HFIN;

# open HFIN, ">hfin2" or die;
# print HFIN "initgrid\n";
# print HFIN "$znucl $grid\n";
# print HFIN "ppload\nmkcorcon\ncalcso\nquit\n";
# close HFIN;

print "Running hfk.x\n";


Expand Down Expand Up @@ -1140,11 +1151,27 @@ sub runONCV

print OUT "$spdf[0] $spdf[1] $spdf[2] $spdf[3]\n";
print OUT "$spdf[0] $spdf[1] $spdf[2] $spdf[3]\n";

close OUT;

my $log = $pspFile . ".log";
system("$ENV{'OCEAN_BIN'}/oncvpsp.x < $oncvpspInputFile > $log") == 0 or die;
move( "ocean.mod", "ppot" ) or die;
unless( move( "ocean.mod", "ppot" ) )
{
open IN, "<", $log or die "It appears oncvpsp.x has not run correctly\n";
my $correctONCVPSP = 0;
while( my $line = <IN> )
{
if( $line =~ m/OCEAN/ )
{
$correctONCVPSP = 1;
last;
}
}
close IN;
die "oncvpsp.x did not finish correctly. Check the logfile OPF/$log\n" if( $correctONCVPSP );
die "Incorrect version of oncvpsp.x installed. Make sure you have the OCEAN-modified version\n";
}
# move( "ocean.mod", "ppot" ) or die;

open HFIN, ">hfin1" or die;
print HFIN "initgrid\n";
Expand Down

0 comments on commit abada72

Please sign in to comment.