"optking dynamic_level" causes Syntax error when used with PCM

I have been trying to run the example below but get a “Syntax Error”.
When I comment out the line “optking dynamic_level 1” everything works fine.

Is this expected?


optMethod = 'b3lyp-d3'
optBasis  = '6-31g*'

molecule nh3_pcm {
0 1
N    -0.014400    0.010500   -0.039000
H    1.002900    -0.005000   0.017000
H    -0.325700    0.660100   0.681700
H    -0.326400    -0.912100   0.260400
symmetry c1

memory 2 Gb
set {
   basis $optBasis
   opt_coordinates cartesian
   # commenting out the following line prevents SyntaxError
   optking dynamic_level 1
   scf_type pk
   pcm true
   pcm_scf_type total

pcm = {
   Units = Angstrom
   Medium {
   SolverType = IEFPCM
   Solvent = Water

   Cavity {
   RadiiSet = UFF
   Type = GePol
   Scaling = False
   Area = 0.3
   Mode = Implicit

optE, optWfn = optimize(optMethod, return_wfn=True)

Yes, this is expected. If you look at the example files here, you see that the accepted way to set a module-specific keyword are to either omit the name of the module or to create a set block that is given the name of the module. Like set optking.

If you change dynamic_level 1 to dynamic_level, the code should work.

Note that, though I don’t think that’s causing your problem, the analytic gradient with PCM has not been implemented. Each step in your optimization will include PCM, but the next geometry will be proposed solely based on the vacuum SCF gradient.