Skip to content

Commit

Permalink
1) M3C.analysis now shows only one-way reactions to simplify the reac…
Browse files Browse the repository at this point in the history
…tions network

2) M3C.viewXYZ new uses by default converted to generate the .eps files. It is neccesary to check if the convert's bug is already fixed in all ubuntu platforms
3) molecule.ZPE now returns the ZPE value even for transition states by ignoring negative frequencies
  • Loading branch information
nfaguirrec committed Mar 8, 2020
1 parent 57d6e3f commit 6c82970
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 14 deletions.
34 changes: 30 additions & 4 deletions src/M3C.analysis
Original file line number Diff line number Diff line change
Expand Up @@ -1686,6 +1686,8 @@ function averReactionsDiagram()
local eDistfile=`getValueFromIFIle ${iFile%.*}.m3c FIT_BRANCHING_RATIOS:eDistfile`

echo "strict digraph G {" > .dataReac-$$.dot
# echo "overlap=scalexy; //false, compress, ..." >> .dataReac-$$.dot
# echo "sep=\"+1\"; // 0.1, +1" >> .dataReac-$$.dot
echo " rankdir=LR" >> .dataReac-$$.dot
echo " node [shape=box,style=filled,fillcolor=yellow,color=black]" >> .dataReac-$$.dot

Expand All @@ -1695,7 +1697,7 @@ function averReactionsDiagram()
weight=`n1df.evaluate $eDistfile $E`

grep ".*(.*\-\->" $f \
| awk '{$1=$1*$weight; print $0}' \
| awk '{$1=$1*'"$weight"'; print $0}' \
| sed -E 's/\([[:alnum:]]+\)//g' \
| awk '{r=$2;split($2,arr,"-->"); if( arr[1]!=arr[2] ) print $0}'
done ) | \
Expand All @@ -1707,7 +1709,29 @@ function averReactionsDiagram()
for(k in map)
if( map[k]/sum > '$maxP' )
printf "%10.5f %s\n", map[k]/sum, k
}' | sed 's/-->/"->"/g' \
}' \
| gawk '
{
r=$2
split($2,arr,"-->")
line[arr[1]"-->"arr[2]]=$1
if( arr[2]"-->"arr[1] in line ){
if( $1 > line[arr[2]"-->"arr[1]] ){
delete line[arr[2]"-->"arr[1]]
}else{
delete line[arr[1]"-->"arr[2]]
}
}
}
END{
for( k in line ){
print line[k], k
print line[k], k > "/dev/stderr"
}
}
' \
| sed 's/-->/"->"/g' \
| gawk '
{
print "\""$2"\"", "[label="$1",fontcolor=blue]"
Expand Down Expand Up @@ -2062,8 +2086,8 @@ EOF
smoothStrength=4e3
# smoothThr="1e-9"
smoothThr="1e-4"
errFact=0.1 # << SSeq
# errFact=1.0 # << Srand
# errFact=0.1 # << SSeq
errFact=1.0 # << Srand

# if [ "`echo "${keys[$(($i-1))]}" | sed 's/\// /g' | wc -w`" -eq 3 ]
# then
Expand Down Expand Up @@ -2590,6 +2614,7 @@ function channelBRDiagram()
'"`cat $M3C_HOME/utils/M3CUtils.gawk`"' # Debería ser la anterior linea, pero solo está disponible para gawk >= 2011
($1!~/^#/){
print reduceM3CLabel($1), $2, $3, $4
# print reduceM3CLabel($1), $2, 0.0, 0.0
}' tmp-$$ > $BRFile
rm tmp-$$

Expand All @@ -2600,6 +2625,7 @@ function channelBRDiagram()
sed -i -r '{s/([[:alpha:]]+)p/\1^{+}/g}' $BRFile # Escribir bien los superindices, caso Cp(??)
sed -i -r '{s/([[:alpha:]]+)([[:digit:]]+)/\1_{\2}/g}' $BRFile # Escribir bien los superindices, caso C_2(??)

cat $BRFile
yMax=`gawk '($0!~/#/){printf "%s\n%s\n",$2,$3}' $BRFile | sort -k 1 -n | tail -n1`
yErrorMax=`gawk '($0!~/#/){printf "%s\n",$4}' $BRFile | sort -k 1 -n | tail -n1`
yMax=`echo "$yMax+$yErrorMax" | bc -l`
Expand Down
12 changes: 6 additions & 6 deletions src/M3C.viewXYZ
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ function convertImage()
local iFile=$1
local oFile=$2

if [ "$CONVERTER" = "convert" ]
then
# if [ "$CONVERTER" = "convert" ]
# then
convert $iFile $oFile > /dev/null 2>&1
elif [ "$CONVERTER" = "inkscape" ]
then
inkscape -z -f $iFile -E $oFile > /dev/null 2>&1
fi
# elif [ "$CONVERTER" = "inkscape" ]
# then
# inkscape -z -f $iFile -E $oFile > /dev/null 2>&1
# fi
}

##
Expand Down
11 changes: 8 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FCFLAGS = -static -static-intel -static-libgcc -traceback -w -I. -g -fpp -mkl -I
LDFLAGS = -L${HOME}/Develop/scift/src -lscift
TLIB =

all: AzizSlamanPotential.o Fragment.o FragmentsDB.o FragmentsListBase.o FragmentsList.o GOptionsM3C.o MarkovChain.o ModelPotential.o NNLS.o Reactor.o $(TLIB) M3CBR M3C M3CfitBR
all: AzizSlamanPotential.o Fragment.o FragmentsDB.o FragmentsListBase.o FragmentsList.o GOptionsM3C.o MarkovChain.o ModelPotential.o NNLS.o Reactor.o $(TLIB) M3CBR M3C M3CfitBR molecule.ZPE

AzizSlamanPotential.o azizslamanpotential_.mod: AzizSlamanPotential.f90
fmake
Expand Down Expand Up @@ -61,6 +61,11 @@ ModelPotential.o modelpotential_.mod: ModelPotential.f90 goptionsm3c_.mod azizsl
echo -n 'Building ModelPotential.f90 '
time -f "(%E)" $(FC) $(FCFLAGS) -c ModelPotential.f90

molecule.ZPE: molecule.ZPE.f90 Fragment.o GOptionsM3C.o fragment_.mod goptionsm3c_.mod
fmake
echo -n 'Building molecule.ZPE.f90 '
time -f "(%E)" $(FC) $(FCFLAGS) molecule.ZPE.f90 Fragment.o GOptionsM3C.o -o molecule.ZPE $(LDFLAGS)

NNLS.o nnls_.mod: NNLS.f90
fmake
echo -n 'Building NNLS.f90 '
Expand All @@ -72,10 +77,10 @@ Reactor.o reactor_.mod: Reactor.f90 fragment_.mod azizslamanpotential_.mod gopti
time -f "(%E)" $(FC) $(FCFLAGS) -c Reactor.f90

clean:
rm -f *.o *.mod *~ .deps M3CBR M3C M3CfitBR 2> /dev/null
rm -f *.o *.mod *~ .deps M3CBR M3C M3CfitBR molecule.ZPE 2> /dev/null

distclean:
rm -f *.o *.mod *~ .deps Makefile M3CBR M3C M3CfitBR 2> /dev/null
rm -f *.o *.mod *~ .deps Makefile M3CBR M3C M3CfitBR molecule.ZPE 2> /dev/null

Makefile: .deps
fmake
Expand Down
9 changes: 8 additions & 1 deletion src/molecule.ZPE.f90
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ program main
character(1000) :: sBuffer
type(String) :: iFileName
type(Fragment) :: mol
real(8) :: ZPE

if( command_argument_count() < 1 ) then
write(*,*) "## ERROR ## Number of Parameter == 1"
Expand All @@ -62,5 +63,11 @@ program main
call mol.init()
call mol.loadRXYZ( iFileName.fstr )

write(*,"(F20.5,A)") mol.ZPE/eV, " eV"
ZPE = 0.0_8
if( mol.nAtoms() > 1 ) then
ZPE = sum( merge(mol.vibFrequencies, 0.0_8,mol.vibFrequencies>0.0_8) )/2.0_8
end if

! write(*,"(F20.5,A)") mol.ZPE/eV, " eV"
write(*,"(F20.5,A)") ZPE/eV, " eV"
end program main

0 comments on commit 6c82970

Please sign in to comment.