Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cannot find definition for module netcdf

358 views
Skip to first unread message

shalu....@gmail.com

unread,
Jul 5, 2017, 4:57:27 AM7/5/17
to
I am using Plato IDE, Silverfrost to run Fortran 95 on Windows, I have to run a code which uses NetCF library. How should I do that? When I tried running a code it gave me error 404. saying "cannot find definition for module netcdf". How can I resolve this issue?

Arjen Markus

unread,
Jul 5, 2017, 5:38:18 AM7/5/17
to
On Wednesday, July 5, 2017 at 10:57:27 AM UTC+2, shalu....@gmail.com wrote:
> I am using Plato IDE, Silverfrost to run Fortran 95 on Windows, I have to run a code which uses NetCF library. How should I do that? When I tried running a code it gave me error 404. saying "cannot find definition for module netcdf". How can I resolve this issue?

You mean: if you build the program from the code you have, the compiler gives a message that it cannot find the definition [file] for the module netcdf?

You will have to check:
- Is the netcdf library installed on your system and is that compatible with the Silverfrost compiler?
- If so, you need to inform the compiler and linker about where to find the module definition file in question (as a guess: netcdf.mod) and the accompanying libraries.

As I do not know the Plato IDE, I do not know where you would specify such options, but that is the general receipe.

Regards,

Arjen

shalu....@gmail.com

unread,
Jul 5, 2017, 5:53:24 AM7/5/17
to
netcdf.mod is not present in the directory n compiler

Tim Prince

unread,
Jul 5, 2017, 6:43:21 AM7/5/17
to
You would need to build netcdf with your compiler, and install and set
environment variable in accordance with netcdf instructions.

shalu....@gmail.com

unread,
Jul 5, 2017, 6:55:22 AM7/5/17
to
i do not have the netcdf module. i am new in fortran n unable to build the netcdf with my silverfrost compiler. if there is a specified document available then please share with me

mecej4

unread,
Jul 5, 2017, 7:22:17 AM7/5/17
to
On 7/5/2017 5:55 AM, shalu....@gmail.com wrote:
> On Wednesday, 5 July 2017 16:13:21 UTC+5:30, Tim Prince wrote:
>> On 7/5/2017 5:53 AM, shalu....@gmail.com wrote:

<--CUT-->>>>

>>> netcdf.mod is not present in the directory n compiler
>>>
>> You would need to build netcdf with your compiler, and install and set
>> environment variable in accordance with netcdf instructions.
>
> i do not have the netcdf module. i am new in fortran n unable to build the netcdf with my silverfrost compiler. if there is a specified document available then please share with me
>

It is going to be very difficult, if not impossible, to build NetCDF
using Silverfrost Fortran 95. Your best option is to find a NetCDF DLL
that someone has built and arrange to use it with FTN95. Chances of
success are low unless you learn about C/Fortran linkage conventions,
have the necessary tools, and modify your code to satisfy those conventions.

-- mecej4
mec...@noclothes.com
Don Gmail to reply.

shalu....@gmail.com

unread,
Jul 5, 2017, 7:27:24 AM7/5/17
to
okay what other options if i can try ?

Arjen Markus

unread,
Jul 5, 2017, 7:35:55 AM7/5/17
to
On Wednesday, July 5, 2017 at 1:27:24 PM UTC+2, shalu wrote:
> On Wednesday, 5 July 2017 16:52:17 UTC+5:30, mecej4 wrote:
> > On 7/5/2017 5:55 AM, shalu wrote:
> > > On Wednesday, 5 July 2017 16:13:21 UTC+5:30, Tim Prince wrote:
> > >> On 7/5/2017 5:53 AM, shalu wrote:
> >
> > <--CUT-->>>>
> >
> > >>> netcdf.mod is not present in the directory n compiler
> > >>>
> > >> You would need to build netcdf with your compiler, and install and set
> > >> environment variable in accordance with netcdf instructions.
> > >
> > > i do not have the netcdf module. i am new in fortran n unable to build the netcdf with my silverfrost compiler. if there is a specified document available then please share with me
> > >
> >
> > It is going to be very difficult, if not impossible, to build NetCDF
> > using Silverfrost Fortran 95. Your best option is to find a NetCDF DLL
> > that someone has built and arrange to use it with FTN95. Chances of
> > success are low unless you learn about C/Fortran linkage conventions,
> > have the necessary tools, and modify your code to satisfy those conventions.
> >
> > -- mecej4
> >
> > Don Gmail to reply.
>
> okay what other options if i can try ?

You can certainly build NetCDF using the gfortran compiler - it is easier to retrieve a prebuilt one though. If you choose that compiler, your whole program has to be compiled with it, but I think mecej4 is right with his remark about the combination Silverfrost and NetCDF.

Regards,

Arjen

shalu....@gmail.com

unread,
Jul 5, 2017, 7:43:41 AM7/5/17
to
where I can download gfortran compiler for windows?

Arjen Markus

unread,
Jul 5, 2017, 7:46:28 AM7/5/17
to
Any search engine is your friend - and you can also look at some of the recent postings

Regards,

Arjen

shalu....@gmail.com

unread,
Jul 5, 2017, 7:47:30 AM7/5/17
to
Thanks Arjen

Tim Prince

unread,
Jul 5, 2017, 7:48:42 AM7/5/17
to
You may want one of the MingW versions of gfortran (32-bit, if that
matches your compiler). However, the .mod file formats will be
incompatible.

shalu....@gmail.com

unread,
Jul 5, 2017, 7:59:08 AM7/5/17
to
tried but not working. i can't blv fortran is unable to open netcdf file?
there is module netcdf but i am not finding the netcdf mnodule that i can compiled with silverfrost. or is there any other fortran compiler which i can use netcdf module ?

Arjen Markus

unread,
Jul 5, 2017, 8:17:11 AM7/5/17
to
On Wednesday, July 5, 2017 at 1:59:08 PM UTC+2, shalu....@gmail.com wrote:

>
> tried but not working. i can't blv fortran is unable to open netcdf file?
> there is module netcdf but i am not finding the netcdf mnodule that i can compiled with silverfrost. or is there any other fortran compiler which i can use netcdf module ?

I think you misunderstand something here:
- libraries (such as NetCDF) and the accompanying module definition files (they often have the extension .mod, but not necessarily) can only be used in combination with the compiler that was used to build them
- so if you use the Silverfrost Fortran compiler, you must have libraries and module definition files that created using that compiler.
- the same holds for the gfortran compiler.

So:
- Can you use the gfortran compiler?
- If so, have you found prebuilt NetCDF libraries for that compiler?
- Use the gfortran compiler to try and build the sample program

Regards,

Arjen

Richard Weed

unread,
Jul 5, 2017, 10:09:57 AM7/5/17
to
On Wednesday, July 5, 2017 at 3:57:27 AM UTC-5, shalu....@gmail.com wrote:
> I am using Plato IDE, Silverfrost to run Fortran 95 on Windows, I have to run a code which uses NetCF library. How should I do that? When I tried running a code it gave me error 404. saying "cannot find definition for module netcdf". How can I resolve this issue?

As others have suggested the first thing you should do is go to
the netCDF web site and find a pre-built version. However, this
will most likely be for CYGWIN or MINW not pure native Windows.

As to using the Silverfrost compiler. I doubt it supports the Fortran 2003 C-Interop facility.
In that case, the netCDF build scripts should default to using the old cfortran.h macros
to create C based interfaces to the underlying netCDF-C code. The latest versions of
netCDF Fortran will use my F2003 interop interfaces if it detects a F2003 compliant (
at least supports C-interop) compiler. All of the netCDF Fortran routines are in a sense
just wrappers and interfaces to calls to the netCDF-C code. You issue with the module
files looks to me like your IDE does not have the correct paths to were the
files are stored. Again, as far as I know, the only successful builds of netCDF-Fortran on
Windows have been under CYGWIN or MINW.

Finally, I encourage you to submit a problem report to the netCDF support site
http://support...@unidata.ucar.edu. They may be able to help but I doubt that the Silverfrost
compiler is one they have access to so I think they will as others have suggest
you try gfortran.

RW

Arjen Markus

unread,
Jul 5, 2017, 10:22:24 AM7/5/17
to
I have been able to compile it for Windows using MSVC and Intel Fortran. It was not easy as there is a bug in the CMake-generated files (not sure if it is a bug in CMake itself or a bug in the configuration files) but I did find a workaround and reported that to UCAR.

Regards,

Arjen

mecej4

unread,
Jul 5, 2017, 11:42:02 AM7/5/17
to
We don't know what you tried and what "not working" is supposed to mean.

Gfortran under Cygwin worked fine for me, as I noted in your other
thread. If you are new to Fortran, why do you use Fortran in the first
place? Fortran, the language, is orthogonal to CDF, the file format. Can
<fill-in-your-favorite-language> open garage doors? Be reasonable.

NetCDF is designed to work best when called from C (and by other
languages with a C interface, such as Python, etc.). Use one of those
languages, if that makes things easier for you.

-- mecej4

mecej...@nospam.invalid
(Replace four by 4, nospam by gmail, invalid by com,
and remove all underscores)

shalu....@gmail.com

unread,
Jul 6, 2017, 12:14:44 AM7/6/17
to
Thanks Arjen and Richards
0 new messages