@sculxb
2017-12-29T03:19:10.000000Z
字数 2362
阅读 1561
Octopus Na 脚本
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18dorm -rf $imkdir $icd $i/cat <<EOF > inpCalculationMode = gsUnitsOutput = eV_angstromFromScratch = yesRadius = 8*angstromSpacing = 0.5*angstrom%Coordinates"Na" | 0 | 0 | 0 | no%TDDeltaStrength = 0.05/angstrom%TDPolarization1 | 0 | 00 | 1 | 00 | 0 | 1%TDPolarizationDirection = 1TDPropagator = aetrsTDTimeStep = 0.005/eVTDMaxSteps = 10000AbsorbingBoundaries = not_absorbingEOFfor ((j=1;j<i;j++))dop=$(echo "scale=4;$j*3.72"|bc)sed -i "9a \ \"Na\" | \\$p | 0 | 0 | no" ./inpdonecat <<EOF >run.oct.sh#PBS -N log#PBS -l nodes=1:ppn=12#PBS -l walltime=10:00:00:00#PBS -q batch#PBS -V#PBS -S /bin/bash### Set intel environment###source /opt/intel/composer_xe_2015/bin/compilervars.sh intel64source /opt/intel/mkl/bin/intel64/mklvars_intel64.shsource /opt/intel/impi/5.0.2.044/bin64/mpivars.shcd \$PBS_O_WORKDIR#EXEC=/opt/software/octopus/octopus-7.1/bin/oct-propagation_spectrumEXEC=/opt/software/octopus/octopus-7.1/bin/octopus#EXEC=/opt/software/octopus/octopus-4.1/bin/octopus_mpiNP=\`cat \$PBS_NODEFILE | wc -l\`NN=\`cat \$PBS_NODEFILE | sort | uniq | tee /tmp/nodes.\$$ | wc -l\`cat \$PBS_NODEFILE > /tmp/nodefile.\$$mpirun -genv I_MPI_DEVICE rdssm -machinefile /tmp/nodefile.\$$ -n \$NP \$EXEC >& oct.outrm -rf /tmp/nodefile.\$$rm -rf /tmp/nodes.\$$EOFqsub run.oct.shcd ..done
用来计算电荷密度的
PROGRAM Densityreal*8 :: tmpx(1:3), &gsrho, &frho(1:16) ! (1:Nw)integer :: i, Nw, NPreal :: a=0.529177d0real :: c=27.2d0*(0.529177d0**3)!------------------------startopen(41,file='NP_fre')read(41,*) NPread(41,*) Nwclose(41)frho(:) = 0.d0open(42, file='gsrho', form='unformatted')open(43, file='frho', form='unformatted')open(40, file='dens.dat')do i =1, NP , 1read(42) tmpx(1:3),gsrhoread(43) frho(1:Nw)tmpx(:) = tmpx(:)*agsrho = gsrho/a**3frho(1:Nw) = frho(1:Nw)/cwrite (40, "(E20.8\)") tmpx(1:3), gsrho, frho(1:Nw)write (40,*)enddoclose(42)close(43)close(40)end
用来处理电荷密度震荡的
#include <iostream>#include <cstdio>#include <cstring>#include <cmath>#include <fstream>using namespace std;/******************************* main **************************/int main(void) {double x, y, z, gsrho;long i, j, nP, nW;double *frho;ifstream rhof, frequ;ofstream densf;rhof.open("dens.dat",ios::in);frequ.open("NP_fre",ios::in);frequ >> nP >> nW ;frequ.close();frho = new double [nW];densf.open("z_0.dat",ios::out);for (i=0; i<nP; i++){rhof >> x >> y >> z >> gsrho;for (j=0; j<nW ; j++ ) rhof >> frho[j];if (abs(z)<0.01) {densf << x << "\t" << y << "\t" << gsrho ;for (j=0; j<nW ; j++ ) densf << "\t" << frho[j];densf << endl;}}rhof.close();densf.close();delete[] frho;return 0;}