views:

215

answers:

2

Hey guys and gals,

I'm just setting up the new WW3 and have compiled and run the test case 'ctest' and that works fine.

Then when I try and compile and link one of the main programs I get the following error message..


----compiling WAVEWATCH III----

Scratch Directory : /home/ww3/scratch Save source codes : yes Save listings : yes Processing ww3_grid


ad3 : processing w3servmd w3servmd.mod ad3 : processing w3gdatmd

    *** compile error ***

file w3gdatmd.o not found

mv: cannot stat `w3gdatmd.o': No such file or directory make: *** [/home/ww3/obj/w3gdatmod.o] Error 5


* end of compilation *


So it converts w3servmd.ftn correctly to w3servmd.f90 and then succesfully compiles and produces w3servmd.mod and places this in a /mod directory

The next step is to compile w3gdatmd.f90, but in the error script for this file is says..

"can't open w3servmd.mod for reading, no such file or directory"

But w3servmd.mod exists!

So i'm thinking there maybe an error in the 'comp' code with it not directing to the /mod folder for .mod files.

The thing is in the 'comp' file it states..

"make sure the compiler point to the proper directory where the modules are stored ($m_path), see examples below."

But I can't see where this is in the code below this at all.

Any hints??

Cheers, Craig

A: 

Most Fortran >=90 compilers that I am familiar with create their output files in the current directory: object, module and executable. Then additional compilation steps of source files in the directory easily find previously made module files. Is the script that you have moving the module files to the directory /mod? Then this is a question about the script or the specific compiler -- how to tell the compiler that it should also look in /mod for the modules. Is $m_path already set since the script is moving the files there? Maybe they are suggesting that you should use a compiler option to cause the compiler to look into this directory. gfortran provides options -M and -J (equivalent): "This option specifies where to put ‘.mod’ files for compiled modules. It is also added to the list of directories to searched by an USE statement. The default is the current directory." Which compiler are you using?

M. S. B.
A: 

Thanks M.S.B. I figured it out last night before your reply. It was a simple compile command line error. I wasn't telling where the compiler to look for the mod files, as they are in a different directory. Have directed it correctly and it's all good.

Cheers, Craig

craig