- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I keep getting this error, and I have no idea why. The program is in a very standard structure:
PROGRAM SIMILAR
include 'mkl.fi'
include 'mkl_lapack.fi'
include 'mkl_blas.fi'
use inoutch_module
use filePathModule
use globalDataModule
use solution_control
use glb_mesh
use subdomains
use NumericalIntgTableModule
c
implicit none
.....rest of code
END PROGRAM SIMILAR
and here's an example of the module:
module inoutch_module
save
c integer ichinp,ichout,ichmtx,ichstr,ichsta,ichwrl,ichplt,ichbdf
integer :: ich
integer, parameter :: iin=5
integer, parameter :: iout=6
integer, parameter :: ichinp=7
integer, parameter :: ichout=8
integer, parameter :: ichmtx=12
c integer, parameter :: ichstr=16
integer, parameter :: ichplt=18
integer, parameter :: ichsta=20
c integer, parameter :: ichwrl=22
integer, parameter :: ichbdf=26
integer, parameter :: ichtfd=27
integer, parameter :: ichmatlab=28
end module inoutch_module
So what's going on?? the error i get is this:
fortcom: Error: Main.f, line 20: This USE statement is not positioned correctly within the scoping unit.
use inoutch_module
------^
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"USE YourModule" must preceed local variable declarations. Your include file (at least one of your include files) is declaring at least one variable.
Place your USE to preceed the include statements.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
USE also must precede any IMPLICIT statements. Best is to have them come directly after the SUBROUTINE or FUNCTION statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks!

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