I came across the following error when compiling the fortran API OpenMM examples:
The ordering of the arguments in the API (/usr/local/openmm/include/OpenMMFortranModule.f90) and in the example are shuffled.call OpenMM_Context_getState(context, infoMask, state, 0)
1
Error: Type mismatch in argument 'enforceperiodicbox' at (1); passed TYPE(openmm_state) to INTEGER(4)
To fix, either place arguments as per API or specify the argument names as you pass.
Shuffle Fix:
HelloArgonInFortran.f90
70c70
Code: Select all
< call OpenMM_Context_getState(context, OpenMM_State_Positions, state, 0)
---
> call OpenMM_Context_getState(context, OpenMM_State_Positions, 0, state)
282c282
Code: Select all
< call OpenMM_Context_getState(context, infoMask, state, 0)
---
> call OpenMM_Context_getState(context, infoMask, 0, state)
Argument Name Specification fix:
HelloArgonInFortran.f90
70c70,72
Code: Select all
< call OpenMM_Context_getState(context, OpenMM_State_Positions, state, 0)
---
> call OpenMM_Context_getState(target=context, &
> types=OpenMM_State_Positions, result=state, &
> enforcePeriodicBox=0)
282c282,283
Code: Select all
< call OpenMM_Context_getState(context, infoMask, state, 0)
---
> call OpenMM_Context_getState(target=context, types=infoMask, &
> result=state, enforcePeriodicBox=0)