-- GAMESS/RESP solution contributed by;

Hans De Winter
Laboratory of Medicinal Chemistry     
Rega Institute of Medical Research
Katholieke Universiteit Leuven        Ph:     +32 16 337 379
Minderbroedersstraat 10,              Fax:    +32 16 337 340
B-3000 Leuven, Belgium                E-mail: hans@s151h14.rega.kuleuven.ac.be
--

This is the way I do it:

1) Generate an appropiate GAMESS *.dat file which includes both the esp points
and the atomic coordinates. An example of a GAMESS input file which does this
is shown here:

 $CONTRL SCFTYP=RHF EXETYP=RUN RUNTYP=OPTIMIZE COORD=UNIQUE $END
 $CONTRL MOLPLT=.TRUE. $END
 $STATPT NSTEP=100 $END
 $BASIS  GBASIS=N31 NGAUSS=6 NDFUNC=1 $END
 $ELPOT  IEPOT=1 WHERE=PDC OUTPUT=PUNCH $END
 $PDC    PTSEL=CONNOLLY $END
 $GUESS  GUESS=HUCKEL $END
 $DATA
eg180.pdb
C1
 C01         6.0  -0.6388649947   0.4052483921   0.0000000000
...
...
 H10         1.0   2.5277794177   0.0322897353   0.0000000000
 $END


2) Then I use a shell script [Run.resp, below] to extract 
all necessary information from the *.dat file to generate 
the required RESP files. 


---Run.resp

#!/bin/csh -f

# THIS SCRIPT EXTRACTS ALL THE NECESSARY INFORMATION FROM A GAMESS *.DAT FILE,
# AND GENERATES THE NECESSARY INPUT FILES NEEDED TO RUN RESP
#
# WRITTEN BY HANS DE WINTER
#            LABORATORY OF MEDICINAL CHEMISTRY,
#            REGA-INSTITUTE FOR MEDICAL RESEARCH,
#            K.U.LEUVEN,
#            MINDERBROEDERSSTRAAT 10,
#            B-3000 LEUVEN
#            BELGIUM
#            E-MAIL: HANS@S151H14.REGA.KULEUVEN.AC.BE
#


# ########################################### #
# USAGE:  Run.resp dat_filename total_charge  #
# ########################################### #

if ($#argv < 2) then
	echo "ERROR:- not enough arguments given."
	echo "USAGE:- Run.resp dat_filename total_charge"
	exit(1)
endif
set title = TITLE
set gamess_datfile = $argv[1]
set charge = $argv[2]


# ######################################################### #
# EXTRACT COORDINATES, ESP AND NATOMS FROM GAMESS DATA FILE #
# ######################################################### #
cat << eof > nawk.in
{
l[NR] = \$0
if (\$1 == "ELECTRIC") {s_pot = NR+1}
if (\$2 == "START")    {f_pot = NR-1; startline = NR}
if (\$1 == "NATOMS=")  {natoms = \$2; print natoms}
if (\$3 == "NKINDS=")  {nkinds = \$4}
if (startline > 0) {
   first = startline; first += 3; first += nkinds
   last  = first; last += natoms; last -= 1
   if ((NR >= first) && (NR <= last)) print \$0
                   }
}
END {npot = f_pot - s_pot + 1; print npot
     for (i=s_pot; i<=f_pot; i++) print l[i]}
eof
nawk -f nawk.in $shome > gamess_temp


# ############### #
# RESP INPUT FILE #
# ############### #
cat << eof > resp.in
$title
 &cntrl nmol=1, ihfree=1
 &end
1.0
$title
eof

cat << eof > nawk.in
{
if (NR <= 1) {printf "%5d%5d\n", $charge, \$1}
}
eof
nawk -f nawk.in gamess_temp >> resp.in

cat << eof > nawk.in
{
if (\$1 == "H") {printf "%5d%5d\n",1,0}
if (\$1 == "C") {printf "%5d%5d\n",6,0}
if (\$1 == "N") {printf "%5d%5d\n",7,0}
if (\$1 == "O") {printf "%5d%5d\n",8,0}
if (\$1 == "F") {printf "%5d%5d\n",9,0}
if (\$1 == "P") {printf "%5d%5d\n",15,0}
if (\$1 == "S") {printf "%5d%5d\n",16,0}
}
END {printf "\n\n\n\n"}
eof
nawk -f nawk.in gamess_temp >> resp.in


# ############## #
# ESP INPUT FILE #
# ############## #
cat << eof > nawk.in
{
if (NR <= 1) natoms = \$1
if (NR == natoms+2) nesp = \$1
}
END {printf "%5d%5d%5d\n", natoms, nesp,0}
eof
nawk -f nawk.in gamess_temp > esp.in

cat << eof > nawk.in
{
if (NR <= 1) natoms = \$1
if ((NR > 1) && (NR <= natoms+1)) {
   \$2 *= 1.88972666
   \$3 *= 1.88972666
   \$4 *= 1.88972666
    printf "                %16.7E%16.7E%16.7E\n",\$2,\$3,\$4}
}
eof
nawk -f nawk.in gamess_temp >> esp.in

cat << eof > nawk.in
{
if (NR <= 1) natoms = \$1
if (NR == natoms+2) nesp = \$1
if (NR > natoms+2) printf "%16.7E%16.7E%16.7E%16.7E\n", \$5,\$2,\$3,\$4
}
eof
nawk -f nawk.in gamess_temp >> esp.in


# ######## #
# RUN RESP #
# ######## #
/usr/amber41/exe/resp -O \
                      -i resp.in \
                      -o resp.out \
                      -p resp.dat \
                      -e esp.in



