-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSAPT
executable file
·1401 lines (1259 loc) · 42.2 KB
/
SAPT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
#
# $Id: SAPT 808 2012-12-04 08:49:31Z cencek $
#
###############################################################################
###############################################################################
## ##
## Symmetry Adapted Perturbation Theory Unix Exec file ##
## =================================================== ##
## sequential versions of Gamess and SAPT
## ##
###############################################################################
###############################################################################
# Typical submit line:
# do scf CP calcs --v
# nohup time nice -20 SAPT name scfcp >output_file 2>&1 &
# ^-- job name
# In particular:
# SAPT (no parameters)
# echos info about parameters. Only the first parameter is required.
#
# Input files for Atmol MC+BS runs:
# nameMA.intinp -- input for monomer A integral calcs (compute 2-el) in MC+BS
# B B MC+BS
# name.intinp -- intput for dimer DC+BS
# nameA.intinp -- monomer A (BYPASS TWO) DC+BS
# if dimer calc. performed --^
# nameB.intinp -- B (BYPASS TWO) DC+BS
# nameMA.scfinp -- input for scf of monomer A, BS size is that of MC+BS for A
# B B B
# name.scfinp -- dimer in DC+BS
# nameA.scfinp -- mono A
# B B
# nameP.data -- input for tran/cc/sapt.x
# Input files for GAMESS DCBS runs:
# name.inp -- intput for dimer scf
# nameA.inp -- monomer A
# nameB.inp -- B
# nameP.data -- input for tran/cc/sapt.x
# Input files for Dalton
# name[A,MA,B,MB].dal - main input files
# name[A,MA,B,MB].mol - molecule description and basis set information
###############################################################################
############## Functions used in script #########################
runscf ()
{
case "$SCFPROG"
in
atmol)
if [ -f ED3 ]
then
rm ED3
fi ;
if [ -f ED7 ]
then
rm ED7
fi ;
if [ ! -f $I1'.intinp' ]
then
echo ' '
echo ----- Input file $I1'.intinp' not found ----
echo ... exiting ...
exit
fi ;
if [ ! -f $I1'.scfinp' ]
then
echo ' '
echo ----- Input file $I1'.scfinp' not found ----
echo ... exiting ...
exit
fi ;
time $ATMOLDIR/integw < $I1'.intinp' ;
time $ATMOLDIR/scf < $I1'.scfinp' ;
if [ $RUNINTERF = 'YES' ]
then
time $INTERDIR/atmolintf < interface.input
fi ;
if [ $RMINTFILE = 'YES' ]
then
rm MT3
fi ;;
atmol1024)
if [ -f ED3 ]
then
rm ED3
fi ;
if [ -f ED7 ]
then
rm ED7
fi ;
if [ ! -f $I1'.intinp' ]
then
echo ' '
echo ----- Input file $I1'.intinp' not found ----
echo ... exiting ...
exit
fi ;
if [ ! -f $I1'.scfinp' ]
then
echo ' '
echo ----- Input file $I1'.scfinp' not found ----
echo ... exiting ...
exit
fi ;
time $ATMNEWDIR/integw < $I1'.intinp' ;
time $ATMNEWDIR/scf < $I1'.scfinp' ;
if [ $RUNINTERF = 'YES' ]
then
time $INTERDIR/atm1024intf < interface.input
fi ;
if [ $RMINTFILE = 'YES' ]
then
rm MT3
fi ;;
g94)
if [ ! -f $I1'.data' ]
then
echo ' '
echo ----- Input file $I1'.data' not found ----
echo ... exiting ...
exit
fi ;
time g94 < $I1'.data' ;
if [ $RUNINTERF = 'YES' ]
then
time $SAPTDIR/g94intf < interface.input
fi ;
rm rwf.rwf ;
if [ $RMINTFILE = 'YES' ]
then
rm inta.data
else
mv int.int inta.data
fi ;;
g03)
if [ ! -f $I1'.data' ]
then
echo ' '
echo ----- Input file $I1'.data' not found ----
echo ... exiting ...
exit
fi ;
time $GAUEXE < $I1'.data' ;
if [ $RUNINTERF = 'YES' ]
then
time $SAPTDIR/$GAUINTF < interface.input
fi ;
rm rwf.rwf ;
if [ $RMINTFILE = 'YES' ]
then
rm inta.data
else
mv int.int inta.data
fi ;;
orca)
if [ ! -f $I1'.data' ]
then
echo ' '
echo ----- Input file $I1'.data' not found ----
echo ... exiting ...
exit
fi ;
time $SAPTDIR/orcameta < $I1'.data'
time $SAPTDIR/gamel1.gaussian < fort.7
mv fort.7 basis.data
mv fort.8 $I1'.inp'
mv fort.9 orcavect.data
echo
time $ORCADIR/orca $I1'.inp' | tee $I1'.out'
echo
echo "Orca->Molden interface"
time $ORCADIR/orca_2mkl $I1 -emolden
time $SAPTDIR/orcavect < $I1'.molden.input'
awk '/FINAL SINGLE POINT ENERGY/ {print $5}' $I1'.out' >> scfener.data ;;
aces2)
mkdir aces.$$ ;
cd aces.$$ ;
cp $GENBASDIR/GENBAS . ;
cp ../$I1'.zmat' ZMAT ;
$ACES2DIR/xaces2 ;
if [ $RUNINTERF = 'YES' ]
then
time $INTERDIR/aces2intf < interface.input
fi ;
mv info.data .. ;
mv vect.data .. ;
mv onel.data .. ;
mv invsqr.smat ..;
mv IIII ../inta.data ;
mv Debug.output .. ;
cd ..
rm -rf aces.$$ ;
if [ $RMINTFILE = 'YES' ]
then
rm inta.data
fi ;;
gamess)
# The parameters used for the runGAMESS script:
# $1 - job name (JOB)
# $2 - version number of GAMESS executable.
# $3 - number of NODES on which GAMESS is to be run.
# Set to 1 for seq. version
# $4 - scratch directory for Gamess
# $5 - arc (or PUNCH) directory for Gamess
# may but does not have to be different from $4)
# $6 - path to GAMESS executable (set in SAPT script)
#
echo Starting to run runGAMESS now...
$GAMSDIR/runGAMESS\
$I1 $VERNO $NNODES $GMSCRDIR $GMARCDIR $GMSPATH > ooo 2>&1
cat ooo ;
if [ $RUNINTERF = 'YES' ]
then
grep -i 'E(RHF)' $GMARCDIR/$I1.dat > scfen.aux
DICTNRY=$GMSCRDIR/$I1.DAF
export DICTNRY
awk -f $INTERDIR/gms_awk1 ooo > interface.input
awk -f $INTERDIR/gms_awk2 ooo >> interface.input
echo This is the interface.input file
cat interface.input
echo Starting to run gamsintf now...
echo $INTERDIR/gamsintf
time $INTERDIR/gamsintf < interface.input > $I1.ino 2>&1
echo Finished interface
rm scfen.aux
fi;
echo Testing the NNODES value.
if [ $NNODES -ge 2 ]
then
mv $GMSCRDIR/inttw.data fort.1
$INTERDIR/gmerge
mv fort.2 inta.data
rm fort.1
else
mv $GMSCRDIR/inttw.data inta.data
fi ;
if [ $RMINTFILE = 'YES' ]
then
echo Removing the GAMESS integral file
rm inta.data
else
echo Keeping the GAMESS integral file
fi ;;
# cadpac)
# echo "\nStarting $name calculation at `date`"
# echo "Working directory $work"
# cd $work ;
# # Starting from scratch. Make sure that this
# # calculation hasn't been
# # done already and isn't in progress
# if ( -e finished ) then
# echo Calculation in $cwd has been finished.
# echo Remove file "finished" if calculation is to be repeated.
# exit
# else if ( -e active ) then
# echo Calculation in $cwd is in progress.
# exit
# fi ;
# touch active ;
# $saptdir/runcadpac $cflags -here $I1 ;;
molpro)
if (! grep -i nosym $I1'.molpro' > /dev/null )
then
echo '"nosym" flag not present in input file! '
exit
fi
if (! grep -i NelecA $I1'.molpro' > /dev/null )
then
echo '"NelecA" flag not set in input file! '
exit
fi
if (! grep -i NelecB $I1'.molpro' > /dev/null )
then
echo '"NelecB" flag not set in input file! '
exit
fi
if (! grep -i Nspin. $I1'.molpro' > /dev/null )
then
echo ' spin flag not set in input file! '
exit
fi
if (! grep -i user $I1'.molpro' > /dev/null )
then
echo ' "user" command not present in input file! '
exit
fi
cp $I1'.molpro' molpro.molpro
$MOLPROEXE -I $TMPDIR -W $TMPDIR molpro.molpro ;
cat molpro.out
mv $MOLPROPATH/vecta.data . ;
mv $MOLPROPATH/vectb.data . ;
mv $MOLPROPATH/infoa.data . ;
mv $MOLPROPATH/infob.data . ;
mv $MOLPROPATH/onela.data . ;
mv $MOLPROPATH/onelb.data . ;
# cluster amplitudes
# mv $MOLPROPATH/ampa.data . ;
# mv $MOLPROPATH/ampb.data . ;
mv $MOLPROPATH/scfener.data . ;
mv $MOLPROPATH/int2e.data inta.data ;;
dalton)
DALTIN='yes'
if [ ! -f $I1'.mol' ]
then
echo ' '
echo ----- Input file $I1'.mol' not found ----
echo ... exiting ...
exit
fi ;
if [ ! -f $I1'.dal' ]
then
echo ' '
echo ----- Input file $I1'.dal' not found ----
echo ... exiting ...
exit
fi ;
mkdir $DALTSCR/$I1/
if [ -f auxil.data ]; then
cp auxil.data $DALTSCR/$I1/
fi
time $DALTEXE -D -t $DALTSCR $I1 $I1
cat $I1.out
rm $I1.out
rm -f $I1.tar.gz
mv $DALTSCR/$I1/AOONEINT .
if [ ! -e inta.data ]; then
mv $DALTSCR/$I1/AOTWOINT inta.data
fi
mv $DALTSCR/$I1/SIRIUS.RST .
mv $DALTSCR/$I1/SIRIFC .
mv $DALTSCR/$I1/DALTON.BAS .
if [ -f $DALTSCR/$I1/h1.data ]; then
mv $DALTSCR/$I1/h1.data .
fi
if [ -f $DALTSCR/$I1/ksi.data ]; then
mv $DALTSCR/$I1/ksi.data .
fi
if [ -f $DALTSCR/$I1/vxc.data ]; then
mv $DALTSCR/$I1/vxc.data .
fi
# the work directory is not needed now
rm -r $DALTSCR/$I1/
if [ $RUNINTERF = 'YES' ]
then
time $INTERDIR/daltintf < interface.input
if [ $WRITEGEOMETRY = 'YES' ]; then
grep -v "^#" DALTON.BAS |awk ' /^[A-Za-z]/ { if (NR>3 && NF==4) {
i++
for (j=1;j<=nclust;j++)
{
if (chrg>1.0e-15){
nucleus++
charge[nucleus]=chrg
pos[nucleus]=i
x[nucleus]=$2;y[nucleus]=$3;z[nucleus]=$4
}
if (j<nclust) getline
}
}}
{ chrg=$1; nclust=$2;if (NR==4 && $1=="c") atoms=$2; if (NR==4 && $1!="c") atoms=$1 }
END{
print nucleus
for(i=1;i<=nucleus;i++)
print pos[i],charge[i],x[i],y[i],z[i]
}' >>info.data
fi
cat scfener.data.dalton |awk '{print tolower($0)}' | sed 's/nan/0.0/g'>>scfener.data
rm scfener.data.dalton
fi ;
# if [ $RMINTFILE = 'YES' ]
# then
# rm
# fi
;;
esac ;
}
runintonly ()
{
case "$SCFPROG"
in
atmol)
if [ ! -f $I1'.intinp' ]
then
echo ' '
echo ----- Input file $I1'.intinp' not found ----
echo ... exiting ...
exit
fi ;
time $ATMOLDIR/integw < $I1'.intinp' ;
echo ' &input iprtvc=f, runsize=f &end ' > interface.input
if [ $RUNINTERF = 'YES' ]
then
time $INTERDIR/atmolintf < interface.input
fi ;
ls -la ED? MT? ;
rm ED3 ED7 ;;
atmol1024)
if [ ! -f $I1'.intinp' ]
then
echo ' '
echo ----- Input file $I1'.intinp' not found ----
echo ... exiting ...
exit
fi ;
time $ATMNEWDIR/integw < $I1'.intinp' ;
echo ' &input iprtvc=f, runsize=f &end ' > interface.input
if [ $RUNINTERF = 'YES' ]
then
time $INTERDIR/atm1024intf < interface.input
fi ;
ls -la ED? MT? ;
rm ED3 ED7 ;;
g94)
if [ ! -f $I1'.data' ]
then
echo ' '
echo ----- Input file $I1'.data' not found ----
echo ... exiting ...
exit
fi ;
time g94 < $I1'.data' ;
if [ $RUNINTERF = 'YES' ]
then
time $SAPTDIR/g94intf < interface.input
fi ;
rm rwf.rwf ;
mv int.int inta.data ;;
g03)
if [ ! -f $I1'.data' ]
then
echo ' '
echo ----- Input file $I1'.data' not found ----
echo ... exiting ...
exit
fi ;
time $GAUEXE < $I1'.data' ;
if [ $RUNINTERF = 'YES' ]
then
time $SAPTDIR/$GAUINTF < interface.input
fi ;
rm rwf.rwf ;
mv int.int inta.data ;;
orca)
if [ ! -f $I1'.data' ]
then
echo ' '
echo ----- Input file $I1'.data' not found ----
echo ... exiting ...
exit
fi ;
if [ $RUNINTERF = 'YES' ]
then
time $SAPTDIR/orcameta < $I1'.data'
time $SAPTDIR/gamel1.gaussian < fort.7
mv fort.7 basis.data
rm fort.8 fort.9
fi ;;
aces2)
mkdir aces.$$ ;
cd aces.$$ ;
cp $GENBASDIR/GENBAS . ;
cp ../$I1'.zmat' ZMAT ;
$ACES2DIR/xaces2 ;
if [ $RUNINTERF = 'YES' ]
then
time $INTERDIR/aces2intf < interface.input
fi ;
mv info.data .. ;
mv vect.data .. ;
mv onel.data .. ;
mv invsqr.smat ..;
mv IIII ../inta.data ;
mv Debug.output .. ;
cd ..
rm -rf aces.$$ ;
if [ $RMINTFILE = 'YES' ]
then
rm inta.data
fi ;;
gamess)
$GAMSDIR/runGAMESS\
$I1 $VERNO $NNODES $GMSCRDIR $GMARCDIR $GMSPATH\
> ooo 2>&1
cat ooo
if [ $RUNINTERF = 'YES' ]
then
grep -i 'E(RHF)' $GMARCDIR/$I1.dat > scfen.aux
DICTNRY=$GMSCRDIR/$I1.DAF
export DICTNRY
awk -f $INTERDIR/gms_awk1 ooo > interface.input
awk -f $INTERDIR/gms_awk2 ooo >> interface.input
echo This is the interface.input file
cat interface.input
echo "Starting to run gamsintf now..."
$INTERDIR/gamsintf < interface.input > $I1.ino 2>&1
echo Finished interface
rm scfen.aux
fi ;
echo Testing the NNODES value.
if [ $NNODES -ge 2 ]
then
mv $GMSCRDIR/inttw.data fort.1
$INTERDIR/gmerge
mv fort.2 inta.data
rm fort.1
else
mv $GMSCRDIR/inttw.data inta.data
fi ;
if [ $RMINTFILE = 'YES' ]
then
echo Removing the GAMESS integral file
rm inta.data
else
echo Keeping the GAMESS integral file
fi ;;
dalton)
if [ ! -f $I1'.mol' ]
then
echo ' '
echo ----- Input file $I1'.mol' not found ----
echo ... exiting ...
exit
fi ;
if [ ! -f $I1'.dal' ]
then
echo ' '
echo ----- Input file $I1'.dal' not found ----
echo ... exiting ...
exit
fi ;
time $DALTEXE -D -t $DALTSCR $I1 $I1
cat $I1.out
rm $I1.out
rm -f $I1.tar.gz
mv $DALTSCR/$I1/AOONEINT .
mv $DALTSCR/$I1/AOTWOINT inta.data
mv $DALTSCR/$I1/SIRIUS.RST .
mv $DALTSCR/$I1/SIRIFC .
mv $DALTSCR/$I1/DALTON.BAS .
rm -r $DALTSCR/$I1/
echo ' &input iprtvc=f, runsize=f &end ' > interface.input
if [ $RUNINTERF = 'YES' ]
then
time $INTERDIR/daltintf < interface.input
fi ;
;;
esac
}
getscf ()
{
if grep $1'=t' holdq4P.data > /dev/null
then
SCFPROG=$2
fi
if grep $1='.true.' holdq4P.data > /dev/null
then
SCFPROG=$2
fi
}
###################### INPUT Section #############################
NUMARGS="$#"
if [ $NUMARGS -eq 0 ]
then
echo ' SAPT script input ... '
echo ' SAPT [jobname] [[scfcp], [WRKDIR] '
echo ' -- jobname -- '
echo ' This keyword identifies the files to be used for input,'
echo ' for example, entering "job1" here will result in the '
echo ' file "job1P.data" being used for the perturbation program'
echo ' input. This varible is case sensitive.'
echo ' -- scfcp --'
echo ' Optional argument. This will request a supermolecular'
echo ' SCF calculation using full dimer-centered basis for the'
echo ' dimer and monomers.'
echo ' If the run fails in the transformation program, it may'
echo ' be restarted by putting the option "gototran" in this'
echo ' slot and restarting.'
echo ' -- WRKDIR --'
echo ' This is the work directory for GAMESS and DALTON runs.'
echo ' Must be set if SAPT is to be used with GAMESS as the scf prog'
echo ' Optional for DALTON (current directory is assumed)'
echo ' -- doccsd (option deleted) --'
echo ' This argument has been removed. E1_exch(CCSD) is now run'
echo ' as part of regular SAPT. Namelist input parameter convamp'
echo ' reguests this calculation if set to T. Perturbative'
echo ' calculation of E^(1i)_exch can be made at the same time'
echo ' by setting parms controlling these corrections to T.'
echo ' '
exit
else
EXITAFTERTRAN="NO"
if [ $NUMARGS -ge 1 ]
then
JOBNAME=$1
else
JOBNAME='NOTGIVEN'
fi
if [ $NUMARGS -ge 2 ]
then
SCFCP=$2
else
SCFCP='NO'
fi
# Input the scratch dir for Gamess or exit after tran run
if [ $NUMARGS -ge 3 ]
then
if [ $3 = "exitaftertran" ]; then
EXITAFTERTRAN="YES"
else
WRKDIR=$3
echo WRKDIR == $WRKDIR
fi
fi
fi
SCFCP=`echo $SCFCP | tr [A-Z] [a-z]`
if [ $JOBNAME = 'NOTGIVEN' ]
then
echo No jobname entered --- exiting ...
exit
fi
if [ $JOBNAME = 'scfcp' ]
then
echo SCFCP found at jobname position. Invalid name --- exiting ...
exit
fi
# If PAR_MONO is set to 'T', the two monomer calculations will be done in separate, parallel subshells
PAR_MONO=F
###############################################################################
VARSDIR=`echo $0 | sed 's#/[^/]*$#/#g'`
#read the directories from vars.cfg
. $VARSDIR/vars.cfg
CLEANDIR=$MAIN_SAPT_DIR
INTERDIR=$MAIN_SAPT_DIR
TRANDIR=$MAIN_SAPT_DIR
CCSDDIR=$MAIN_SAPT_DIR
SAPTDIR=$MAIN_SAPT_DIR
MOLPROPATH=$TMPDIR
GAMSDIR=$MAIN_SAPT_DIR # location of runGAMESS script
GMSCRDIR=$WRKDIR # scratch directory for GAMESS
#echo GMSCRDIR == $GMSCRDIR
GMARCDIR=$WRKDIR # archiving directory for GAMESS
NNODES=1 # number of nodes on which to run GAMESS
# WORKDIR FOR DALTON
# if WRKDIR is not set, set WRKDIR to current directory
[ -z "$WRKDIR" ] && WRKDIR="."
DALTSCR=$WRKDIR # scratch directory for DALTON
DALTIN='no'
if [ -x /usr/bin/banner ]; then
BANNER="/usr/bin/banner"
else
BANNER="echo"
fi
$BANNER 'XXXXXXXXXX'
$BANNER ' S.A.P.T. '
$BANNER 'XXXXXXXXXX'
$BANNER ' '
$BANNER '.'$JOBNAME'.'
# ---- echo some useful system information for reference ---
echo ' '
echo ---------- System and job control information ---------
echo ' '
echo " date: `date`"
echo " hostname: `hostname`"
echo " system: `uname -a`"
echo " user: `whoami`"
echo ' '
echo " jobname: $JOBNAME"
PTFILE=$JOBNAME'P.data'
if [ ! -f $PTFILE ]
then
echo *** Cannot find perturbation file ***
echo looking for: $PTFILE
exit
fi
echo " SAPT file: $PTFILE"
if [ $SCFCP = 'gototran' ]
then
echo " "
echo " Restarting from tran ... "
else
# --- Make a copy of the PTFILE with no spaces and all lower case.
cat $PTFILE \
| tr '[A-Z]' '[a-z]' | tr -d " " | tr -d '\12' \
> holdq4P.data
# --- Find out which SCFprogram we are using from the PTFILE.
#
# P.data SCF
# variable prog
#
SCFPROG='NOTSET'
getscf isitatm atmol
getscf isitanew atmol1024
getscf isitg94 g94
getscf isitg03 g03
getscf isitorca orca
getscf isitaces aces2
getscf isitgams gamess
getscf isitcadp cadpac
getscf isitdalt dalton
getscf isitmolp molpro
# grep also for obsolete SCF keywords and issue appropriate error messages
getscf isitalch alchemy
getscf isitg88 g88
getscf isitg90 g90
getscf isitmicr micromol
getscf isithndo hondo
getscf isitg98 g98
if [ $SCFPROG = 'alchemy' ] || [ $SCFPROG = 'g88' ] \
|| [ $SCFPROG = 'micromol' ] || [ $SCFPROG = 'hondo' ]
then
echo " "
echo " The SCF program $SCFPROG is no longer supported."
echo " Exiting... "
exit
fi
if [ $SCFPROG = 'g90' ]
then
echo " "
echo " The keyword ISITG90=T is obsolete."
echo " Use ISITG94=T for G94 and ISITG03=T for G03 or G98."
echo " Exiting... "
exit
fi
if [ $SCFPROG = 'g98' ]
then
echo " "
echo " The keyword ISITG98=T is obsolete."
echo " ISITG03=T works for both G03 and G98."
echo " Exiting... "
exit
fi
if [ $SCFPROG = 'NOTSET' ]
then
echo " "
echo " " --- Cannot tell which SCF program to use ---
echo " " --- Is it set correctly in the PT file? ---
exit
fi
echo " SCF program: $SCFPROG"
if [ $SCFPROG = 'aces2' ]
then
PATH=$PATH:$ACES2DIR
fi
if [ $SCFCP = 'scfcp' ]
then
echo " SCF CP: requested"
else
echo " SCF CP: *not* requested"
fi
# ---- find transformation type --- must be monomer or dimer (default)
TRANTYPE='dimer'
if grep dimer=f holdq4P.data > /dev/null
then
TRANTYPE='mono'
fi
if grep dimer=.false. holdq4P.data > /dev/null
then
TRANTYPE='mono'
fi
echo " tran type: $TRANTYPE"
echo " "
echo " "
if [ $TRANTYPE = 'mono' ] &&\
([ $SCFPROG = 'molpro' ] || [ $SCFPROG = 'g03' ])
then
if (! grep blkmb=f holdq4P.data > /dev/null ) \
&& (! grep blkmb=.false. holdq4P.data > /dev/null )
then
echo ' You must set BLKMB=.FALSE. and specify basis tags '
echo ' for a MC+BS run with MOLPRO or GAUSSIAN! '
exit
fi
fi
DODISP='no'
if grep dconvamp=t holdq4P.data > /dev/null
then
DODISP='yes'
fi
if grep dconvamp=.true. holdq4P.data > /dev/null
then
DODISP='yes'
fi
if [ $DODISP = 'yes' ]; then
echo "E(2)disp(CCD+ST(CCD)) calculation requested"
echo "Other SAPT corrections will be skipped"
# a few consistency checks
if (! grep ccd=t holdq4P.data > /dev/null ) \
&& (! grep ccd=.true. holdq4P.data > /dev/null )
then
DODISP='error'
fi
if (! grep ccsd=f holdq4P.data > /dev/null ) \
&& (! grep ccsd=.false. holdq4P.data > /dev/null )
then
DODISP='error'
fi
if (! grep wrteach=t holdq4P.data > /dev/null ) \
&& (! grep wrteach=.true. holdq4P.data > /dev/null )
then
DODISP='error'
fi
if [ $DODISP = 'error' ]; then
echo "For an E(2)disp(CCD+ST(CCD)) run, the CCINP namelist must"
echo "contain CCD=.TRUE., CCSD=.FALSE., AND WRTEACH=.TRUE."
echo "Exiting... "
exit
fi
if ( grep frozen=t holdq4P.data > /dev/null ) \
|| ( grep frozen=.true. holdq4P.data > /dev/null )
then
DODISP='error'
fi
if [ $DODISP = 'error' ]; then
echo "Error: frozen core not implemented in E(2)disp(CCD+ST(CCD))"
echo "Exiting... "
exit
fi
fi
# check if E(30)disp or E(30)exch-disp have been requested
# if not, we may delete the AO integral file after CC
THIRDO='no'
if grep e300d=t holdq4P.data > /dev/null
then
THIRDO='yes'
fi
if grep e300d=.true. holdq4P.data > /dev/null
then
THIRDO='yes'
fi
if grep e30xd=t holdq4P.data > /dev/null
then
THIRDO='yes'
fi
if grep e30xd=.true. holdq4P.data > /dev/null
then
THIRDO='yes'
fi
if grep e30xdsdq=t holdq4P.data > /dev/null
then
THIRDO='yes'
fi
if grep e30xdsdq=.true. holdq4P.data > /dev/null
then
THIRDO='yes'
fi
if grep directe3=f holdq4P.data > /dev/null
then
THIRDO='no'
fi
if grep directe3=.false. holdq4P.data > /dev/null
then
THIRDO='no'
fi
REGUL='no'
if grep rind=t holdq4P.data > /dev/null
then
REGUL='yes'
fi
if grep rind=.true. holdq4P.data > /dev/null
then
REGUL='yes'
fi
if grep rind0=t holdq4P.data > /dev/null
then
REGUL='yes'
fi
if grep rind0=.true. holdq4P.data > /dev/null
then
REGUL='yes'
fi
if grep rind0r=t holdq4P.data > /dev/null
then
REGUL='yes'
fi
if grep rind0r=.true. holdq4P.data > /dev/null
then
REGUL='yes'
fi
if grep re3=t holdq4P.data > /dev/null
then
REGUL='yes'
fi
if grep re3=.true. holdq4P.data > /dev/null
then
REGUL='yes'
fi
if [ $REGUL = 'yes' ]; then
echo "Regularized SAPT corrections have been requested."
echo "Run the regSAPT script instead."
echo "Email [email protected] for more information."
echo "Exiting... "
exit
fi
SAPTDFT='no'
if grep "&saptdft" holdq4P.data > /dev/null
then
SAPTDFT='yes'
fi
rm holdq4P.data
# --- If using atmol, monoplus method, and not doing an scfcp
# calculation, make sure that the A.intinp file does *not*
# have a BYPASS TWO statement.
#
if [ $SCFPROG = 'atmol' ] || [ $SCFPROG = 'atmol1024' ]
then
if [ $SCFCP != 'scfcp' ]
then
if grep -i 'bypass two' $JOBNAME'A.intinp' > /dev/null
then
echo BYPASS TWO directive must be removed from the
echo $JOBNAME'A.intinp file. exiting ...'
exit
fi
if grep -i 'bypass 2' $JOBNAME'A.intinp' > /dev/null
then
echo BYPASS TWO directive must be removed from the
echo $JOBNAME'A.intinp file. exiting ...'
exit
fi
fi
fi
# ## rm some files ##
echo Cleaning directory now.
$CLEANDIR/Clean
# ###################
# ## UNIX needs space ###
# # Get -data and -memory #
# # storage space. #
# ##########################
# ulimit -d 228860
# ulimit -m unlimited
# ulimit -s unlimited