but works fine on cpu

OS X 10.12, cuda 8.0, OpenMM 7.0.1, CHARMM c41b1

the relevant parts of the script are:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
OMM on precision mixed platform cuda

!...

OPEN READ UNIT 10 CARD NAME equil.rst

OPEN WRIT UNIT 11 CARD NAME dyn2ps.rst
OPEN WRIT UNIT 12 FILE NAME dyn2ps.dcd
OPEN WRIT UNIT 13 CARD NAME dyn2ps.ene

dynamics leap restart timestp 0.002 nstep 1000 -
inbfrq -1 ihbfrq 0 -
ihtfrq 0 ieqfrq 0 -
iprfrq 100 -
iunrea 10 iunwri 11 kunit 13 iuncrd 12 -
nsavc 500 nsavv 0 nprint 500 -
firstt @temp finalt @temp teminc 0.0 -
ichecw 0 twindl -10.0 twindh 10.0 -
iasors 1 iasvel 1 -
tconst tcoupling @tcpl treference @temp

OPEN WRITE UNIT 14 CARD NAME dyn2ps.crd
WRITE COORDINATES CARD UNIT 14

open write formatted unit 15 name dyn2ps.psf
write psf card unit 15

OPEN UNIT 16 CARD WRITe NAME dyn2ps.pdb
WRITe COOR PDB UNIT 16

close unit 10
close unit 11
close unit 12
close unit 13
close unit 14
close unit 15
close unit 16
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

The .Ene file is created but has lenght 0 in both cuda and opencl mode

without OpenMM it works as expected (.ENE is correctly written)

these are the parts of the output (when using openmm) where unit 13 is referenced:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
CHARMM> OPEN WRIT UNIT 13 CARD NAME dyn2ps.ene
VOPEN> Attempting to open::DYN2PS.ENE::
OPNLGU> Unit 13 opened for WRITE access to DYN2PS.ENE

...

CHARMM> dynamics leap restart timestp 0.002 nstep 1000 -
CHARMM> inbfrq -1 ihbfrq 0 -
CHARMM> ihtfrq 0 ieqfrq 0 -
CHARMM> iprfrq 100 -
CHARMM> iunrea 10 iunwri 11 kunit 13 iuncrd 12 -
CHARMM> nsavc 500 nsavv 0 nprint 500 -
CHARMM> firstt @temp finalt @temp teminc 0.0 -
CHARMM> ichecw 0 twindl -10.0 twindh 10.0 -
CHARMM> iasors 1 iasvel 1 -
CHARMM> tconst tcoupling @tcpl treference @temp
Parameter: TEMP -> "300"
Parameter: TEMP -> "300"
Parameter: TCPL -> "5.0"
Parameter: TEMP -> "300"
IUNREA = 10 IUNWRI = 11 IUNOS = -1
IUNCRD = 12 IUNVEL = -1 KUNIT = 13
TITLE> * TEST
TITLE> * DATE: 3/13/17 10:10:38 CREATED BY USER: uliano
TITLE> *

...

CHARMM> close unit 13
VCLOSE: Closing unit 13 with status "KEEP"
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

best regards,

uli


Laboratory of Computational Biochemistry and Biophysics
University of Milan