Hello,
I am using reverse monte carlo code written in Fortran for a simulation and would like to use lammps to calculate energy. I would like to do this by calling lammps inside my fortran code. To test I wrote a very small fortran code that is supposed to start lammps. Unfortunately, whenever I try to compile it i get errors. Any assistance would be appreciated.
The code I am trying to compile is:
Program adder
IMPLICIT NONE
!void lammps_open_no_mpi(int argc, char **argv, void **ptr)
!int sally[2][3] = {{2,3,4},{5,6,7}};
!char start_ups[][] = [[’-l’], [‘log’ ]] ;
!character(1) , dimension (2) :: argv
INTERFACE
SUBROUTINE lammps_open_no_mpi(argc, argv, ptr) BIND©
USE, INTRINSIC :: ISO_C_BINDING, only : C_char, C_ptr, C_int
INTEGER (C_INT) :: argc
CHARACTER (C_CHAR ) :: argv
POINTER (C_ptr) :: ptr
END SUBROUTINE lammps_open_no_mpi
END INTERFACE
integer a,b
a = 1
b = 2
call lammps_open_no_mpi(1 ,‘lmp -log log.simple’ , &void)
PRINT *, ‘Hello World’
end Program
The error message I am getting is
adder.f90(13): error #5082: Syntax error, found ‘)’ when expecting one of: ,
POINTER (C_ptr) :: ptr
------------------------------^
adder.f90(20): error #5082: Syntax error, found IDENTIFIER ‘VOID’ when expecting one of: <POUND_VAL> <INTEGER_KIND_CON> <POUND_BASE> <INTEGER_CONSTANT>
call lammps_open_no_mpi(1 ,‘lmp -log log.simple’ , &void)
I am using mpif90 adder.f90 to compile it.