#!/usr/bin/python3
#
# MDWeb Titration wrapper
import CMIP
import argparse

def main(): 
    
    titwat=titip=titim=10
    #[titwat, titip, titim]=params
    
    gr=CMIP.Grid()
    gr.setreadGrid(2)
    gr.perfill=0.7
    gr.int = [0.8,0.8,0.8]
    
    inpP = CMIP.InputParams("Titration", gr)
    inpP.addKeyword(
        {
            'tipcalc': 1,
            'titration':1,
            'readgrid':2,
            'inifoc':2,
            'cutfoc': -0.5,
            'focus':1,
            'ninter':10,
            'dields':2,
            'clhost':1,
            'calcgrid':1,
            'irest':0,
            'orest':0,
            'coorfmt':2,
            'titwat':titwat,
            'titip':titip,
            'titim':titim,
            'titcut':20.
        }
        )
    run = CMIP.Run(inpP)
    run.exefile = '/data/soft/CMIP/src/titration'
    run.addFile({'hs': "1kim_h.pdb", 'outpdb':'1kim_l.wat'})
    result = run.execute()
    print (result.asString())


if __name__ == "__main__":
    main()

