Hello,
I am trying to compile a main program (replica2.f90) with 5 INCLUDE files. Here are the commands I tried:
ifort -cpp mc_st.f90 molecules.f90 orientation.f90 forward_n1n1p1_rep.f90 reverse_n1n1p1_rep.f90
ifort replica2.f90
mc_st.f90 is my global variables file. The others are parts of separated subroutines called by the main program. I have successfully run this on my laptop with Microsoft Visual Studio, but it took forever to complete. I am trying to use a supercomputer to compile my code instead, but apparently it didn't work. Here are the error messages:
----------------------------------------------------------------
mc_st.f90, molecules.f90, orientation.f90, forward_n1n1p1_rep.f90, reverse_n1n1p1_rep.f90: error #5082: Syntax error, found END-OF-FILE when expecting one of: <LABEL> <END-OF-STATEMENT> ; BLOCK BLOCKDATA PROGRAM MODULE TYPE BYTE CHARACTER ...
molecules.f90(32): error #6410: This name has not been declared as an array or a function. [NB]
Nb(i,1) = num_mol(i)*l_side*l_side ! number of molecules of H
orientation.f90(11): error #6353: A RETURN statement is invalid in the main program.
RETURN
orientation.f90(13): warning #6043: This Hollerith or character constant is too long and cannot be used in the current numeric context. ['Silica']
ELSE IF (Molecule_type(new_type).EQ.'Silica') THEN
orientation.f90(1056): error #6353: A RETURN statement is invalid in the main program.
IF (t.LT.50.0) RETURN
orientation.f90(2): error #6591: An automatic object is invalid in a main program. [E_NEW]
DIMENSION :: e_new(3,natoms),q_new(3,ncgs),orient1(3,natoms),orient2(3,ncgs),di_ang_new(2),random(3)
orientation.f90(2): error #6219: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association [NATOMS]
DIMENSION :: e_new(3,natoms),q_new(3,ncgs),orient1(3,natoms),orient2(3,ncgs),di_ang_new(2),random(3)
........[Many other similar errors].......
----------------------------------------------------------------
It appears that:
1. The structures of all the INCLUDE files are wrong (I know for module, it starts with MODULE <name> and ends with END MODULE <name>, but I don't know the format for INCLUDE file).
2. My main program couldn't include the global variables file
3. I don't even know what "error #6591: An automatic object is invalid in a main program." means.
Could someone please help me with a correct (and preferably optimized) ifort command for my codes? I am really new to this.
Thank you!