!
! Compute the binding energy for Ligand+receptor
! You should have ligand , and receptor pdb files
!
!

read mol 1 file "Na.pdb" pdb end 
set charge radii file "uhbd_amberoldpart.dat" param AMBER end

print apar mol 1 end

!
! Regular Runs:
!               compute the potential on a coarse grid for
!               molecule 1
!

elec calc mol 1
 pdie   1.00                          ! internal dielectric=2
 sdie  80.00                          ! solvent  dielectric=78
 temp 298.00                          ! temperature in K
 ions    .00                          ! ionic strength
 bcfl   2                             ! boundary condition - each atom
                                      ! is a Debye-Huckel sphere
 efld    .00                          ! external electric field
 grid    .25                          ! grid spacing
 dime   80 80 80                   ! grid dimension
 center                                ! center the grid on the molecule
 maxit 400                            ! maximum # of iteration for FDPBE
end

print elec phizero mol1 end           ! zero out the phisite accumulator
print elec phisave mol1 end           ! compute and store phi at atoms on grid
print elec phinrg mol1 end
print elec energy mol1 end            !testing
assign e1 = $phinrg  end             !
assign e2 = $energy  end            !

!  
!               compute the potential on a fine grid
!               molecule 1 using the coarse grid to set the
!               boundary potentials for this grid.
!

elec calc mol 1
 pdie   1.00                          ! internal dielectric=1
 sdie   1.00                          ! solvent  dielectric=78
 temp 298.00                          ! temperature in K
 ions    .00                          ! ionic strength
 bcfl   2                             ! no focusing

 efld    .00                          ! external electric field
 grid   0.25                          ! spacing for focused grid
 dime   80 80 80                   ! grid dimension
 center 
 maxit 400                            ! maximum # of iteration for FDPBE
end

print elec phizero mol1 end           ! zero out the phisite accumulator
print elec phisave mol1 end
print elec phinrg mol1 end            ! compute and save to a user variable the

                                      ! phi energy
assign eref = $phinrg end               ! assign the phi energy to a local var 

print elec energy mol1 end            !testing

assign esolv1 = $e1 $eref - end       ! get esolv1


stop
