- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
main.f
====================================
PROGRAM MAIN
USE MODDULECOM
USE MODDULEPARA
CALL LOAD_PARA
ALLOCATE(
+ NAMEP(NPM)
+ ,NPHASE(NBM),INDPH(NBM),IFLASH(NBM)
+ )
STOP
C
END
======================================
load_para.f
======================================
SUBROUTINE LOAD_PARA
USE MODULEPARA
NXM = 200
NYM = 200
NZM = 5
NPM = 4
NBM = NXM * NYM * NZM
END
====================================
modulecom.f
====================================
MODULE MODULECOM
CHARACTER*14,ALLOCATABLE ::
+ NAMEP(:)
CHARACTER*14
+ VERSION
INTEGER, ALLOCATABLE ::
+ NPHASE(:), INDPH(:), IFLASH(:)
+ ,NBLK(:,:), NBLKUP(:,:,:)
END MODULE MODULECOM
================================
modulepara.f
================================
MODULE MODULEPARA
INTEGER
+ NXM, NYM, NZM, NPM, NCM, NWM, NBWM, NS1M
+ ,NPRM, NPFM, NCTM, NHSM, NBM, NBM3, NBPM
+ ,NBPCM, NBNS1M, NCM2, NCMP1, NCPM2, NCMT
+ ,NBPCMT, NCWMT, NBCMT , NWBCM, NREG, NTAB
+ ,NZPM,NUMAUX,IC2,INQUA,INCON,INVEL,NOSWTM
+ ,NUMPRE,NUMOUT,NCVECT,NUMPVT,NHES,NPWM,NCWM
+ ,NCP1W,NST,NCCM, NBCM,IFLIP
END MODULE MODULEPARA
=========================================
makefile
=========================================
FFLAGS = -r8 -O3 -Bstatic
LFLAGS = -r8 -O3 -Bstatic
FMOD = modulecom.f modulepara.f
FSRCS = load_para.f main.f
FOBJM = $(FMOD:.f=.o)
FOBJS = $(FSRCS:.f=.o)
PROG = main.exe
FC = ifort
$(PROG): $(FOBJM) $(FOBJS)
$(FC) $(LFLAGS) -o $(PROG) $(FOBJM) $(FOBJS)
clean :
rm -f *.o main.exe
=========================================
compilation errors
=========================================
ifort -r8 -O3 -Bstatic -c -o modulecom.o modulecom.f
ifort -r8 -O3 -Bstatic -c -o modulepara.o modulepara.f
ifort -r8 -O3 -Bstatic -c -o load_para.o load_para.f
ifort -r8 -O3 -Bstatic -c -o main.o main.f
fortcom: Error: main.f, line 3: Error in opening the Library module file. [MODDULECOM]
USE MODDULECOM
----------^
fortcom: Error: main.f, line 4: Error in opening the Library module file. [MODDULEPARA]
USE MODDULEPARA
----------^
fortcom: Error: main.f, line 9: An allocate/deallocate object must have the ALLOCATABLE or POINTER attribute. [NAMEP]
+ NAMEP(NPM)
---------^
fortcom: Error: main.f, line 9: The rank of the allocate-shape-spec-list differs from the rank of the allocate-object. [NAMEP]
+ NAMEP(NPM)
---------^
fortcom: Error: main.f, line 10: An allocate/deallocate object must have the ALLOCATABLE or POINTER attribute. [NPHASE]
+ ,NPHASE(NBM),INDPH(NBM),IFLASH(NBM)
---------^
fortcom: Error: main.f, line 10: The rank of the allocate-shape-spec-list differs from the rank of the allocate-object. [NPHASE]
+ ,NPHASE(NBM),INDPH(NBM),IFLASH(NBM)
---------^
fortcom: Error: main.f, line 10: An allocate/deallocate object must have the ALLOCATABLE or POINTER attribute. [INDPH]
+ ,NPHASE(NBM),INDPH(NBM),IFLASH(NBM)
---------------------^
fortcom: Error: main.f, line 10: The rank of the allocate-shape-spec-list differs from the rank of the allocate-object. [INDPH]
+ ,NPHASE(NBM),INDPH(NBM),IFLASH(NBM)
---------------------^
fortcom: Error: main.f, line 10: An allocate/deallocate object must have the ALLOCATABLE or POINTER attribute. [IFLASH]
+ ,NPHASE(NBM),INDPH(NBM),IFLASH(NBM)
--------------------------------^
fortcom: Error: main.f, line 10: The rank of the allocate-shape-spec-list differs from the rank of the allocate-object. [IFLASH]
+ ,NPHASE(NBM),INDPH(NBM),IFLASH(NBM)
--------------------------------^
compilation aborted for main.f (code 1)
make: *** [main.o] Error 1
Please help me, thanks in advance.
James_UTA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
http://www.fesb.hr/~psarajce/Makefiles.html
You need at least a rule for making the .mod files and to show them in the dependencies list.
There are Makefiles in the ifort installation for building .mod files, e.g. for lapack95.
MODDULECOM -- MODULECOM etc.
I think if you fix this your code should compile.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
http://www.fesb.hr/~psarajce/Makefiles.html
You need at least a rule for making the .mod files and to show them in the dependencies list.
There are Makefiles in the ifort installation for building .mod files, e.g. for lapack95.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
http://www.fesb.hr/~psarajce/Makefiles.html
You need at least a rule for making the .mod files and to show them in the dependencies list.
There are Makefiles in the ifort installation for building .mod files, e.g. for lapack95.
MODDULECOM -- MODULECOM etc.
I think if you fix this your code should compile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MODDULECOM -- MODULECOM etc.
I think if you fix this your code should compile.
It works now with the correction of theerror, appreciate your great help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
http://www.fesb.hr/~psarajce/Makefiles.html
You need at least a rule for making the .mod files and to show them in the dependencies list.
There are Makefiles in the ifort installation for building .mod files, e.g. for lapack95.
Thanks Tim18 for your suggestion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MODDULECOM -- MODULECOM etc.
I think if you fix this your code should compile.
Home Forums Intel Fortran Compiler for Linux and Mac OS* X Help on mixed programming Fortran and C with intel fortran
I still can not figure it out, thanks in advance.
James

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page