Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

including grib2 decoder in IVF

tropfen
New Contributor I
2,076 Views
Hello,

does anyone has finished the task to compile the grib2-decoder with IVF?

Any help would be perfekt.

Thanks in advance
Frank
0 Kudos
11 Replies
tropfen
New Contributor I
2,076 Views
Hello,

i have placed this question last year in april. I had no reply. Does anyone has solved the problem by now?

Thanks in advance
Frank
0 Kudos
Steven_L_Intel1
Employee
2,076 Views
The grib2 decoder source that I can find is all C. Needless to say, you can't compile it with a Fortran compiler. Do you have a different version in mind?
0 Kudos
tropfen
New Contributor I
2,076 Views
The grib2 decoder source that I can find is all C. Needless to say, you can't compile it with a Fortran compiler. Do you have a different version in mind?
Hello Steve,

i was thinking about the fortran90 routines from the webpage:
http://www.nco.ncep.noaa.gov/pmb/codes/GRIB2/


Frank

0 Kudos
Steven_L_Intel1
Employee
2,076 Views
Ok. I can compile all the Fortran sources in the first package listed in that page as long as I enable preprocessing (/fpp) and disable interface checking.
0 Kudos
tropfen
New Contributor I
2,076 Views
Ok. I can compile all the Fortran sources in the first package listed in that page as long as I enable preprocessing (/fpp) and disable interface checking.
Hello Steve,

both steps where extremly helpfull. But i am also have problem with the including of an *.c file. In the file w3lib_baciof.f there are calls for bacio (IRET=BACIO(BACIO_OPENRW,IB,JB,1,NB,KA,FD(LU),CFN//CHAR(0),A)). The subroutine for this is included in the file bacio.v1.3.c . For this part i cannot find a solution. May be it is extremly simpel to include *.c file. But i have never done it before.

I have included the project folder.

Thanks in advance
Frank


0 Kudos
Les_Neilson
Valued Contributor II
2,076 Views
Quoting - tropfen
Hello Steve,

both steps where extremly helpfull. But i am also have problem with the including of an *.c file. In the file w3lib_baciof.f there are calls for bacio (IRET=BACIO(BACIO_OPENRW,IB,JB,1,NB,KA,FD(LU),CFN//CHAR(0),A)). The subroutine for this is included in the file bacio.v1.3.c . For this part i cannot find a solution. May be it is extremly simpel to include *.c file. But i have never done it before.

I have included the project folder.

Thanks in advance
Frank



One simple way isto add a second project to your solution - say Gribc which is a C/C++ static lib project.
Remove the c source and header files from the fortran project and add them to the new C project.


actually the w3lib_baciof.h file can stay, it is a Fortran include file
(I personally don't like the .h extension for Fortran include files!)


Make the fortran project dependent on the c project ( ie build the c project first)
Make sure that under Linker->General the "Link Library Dependencies" is set to Yes
and then build your project

When I did this with your supplied project I got a missing file "unistd.h"

HTH
Les
0 Kudos
tropfen
New Contributor I
2,076 Views
Quoting - Les Neilson

One simple way isto add a second project to your solution - say Gribc which is a C/C++ static lib project.
Remove the c source and header files from the fortran project and add them to the new C project.


actually the w3lib_baciof.h file can stay, it is a Fortran include file
(I personally don't like the .h extension for Fortran include files!)


Make the fortran project dependent on the c project ( ie build the c project first)
Make sure that under Linker->General the "Link Library Dependencies" is set to Yes
and then build your project

When I did this with your supplied project I got a missing file "unistd.h"

HTH
Les
Hello Les,

thanks for your help. Step wise i will hopefully learn how to build mixed projects.

But i think i am at a dead end. Each time i include a missing file (like 'unistd.h') i get new missing files. It looks like a very unix/linux spezific c-program (you need a couple of very spezific unix/linux *.h files).

So if any has solved the problem of including grib (fortran) in the windows world, please give a hint how to do it.

Thanks in advance
Frank
0 Kudos
Les_Neilson
Valued Contributor II
2,076 Views
Quoting - tropfen
Hello Les,

thanks for your help. Step wise i will hopefully learn how to build mixed projects.

But i think i am at a dead end. Each time i include a missing file (like 'unistd.h') i get new missing files. It looks like a very unix/linux spezific c-program (you need a couple of very spezific unix/linux *.h files).

So if any has solved the problem of including grib (fortran) in the windows world, please give a hint how to do it.

Thanks in advance
Frank

Did you get the source from the NCEP site?
I notethe code you providedis a mixture of f77 and f90styles, they have some f90 code on their site.

Where did you find the unistd.h file? If you have it locally and there are more .h files there, then the simplestthing would beto add that directory to the "additional include directories" of the project rather than copying them to your source directory.

Anything that is OS specific (linux/unix) will need to be modified for the appropriate Windows equivalent - but I suppose you already knew that. (I haven't looked closely at the code)

Les
0 Kudos
TimP
Honored Contributor III
2,076 Views
Quoting - tropfen

But i think i am at a dead end. Each time i include a missing file (like 'unistd.h') i get new missing files. It looks like a very unix/linux spezific c-program (you need a couple of very spezific unix/linux *.h files).


Did you consider whether cygwin or similar environment might be more suitable for an initial version of such a project, as existing documents on the usage of this application suggest?
http://www.opengrads.org/doc/udxt/grib2/grib2.html#usage_under_microsoft_windows
0 Kudos
jkrob
Beginner
2,076 Views
Quoting - tropfen
Hello,

does anyone has finished the task to compile the grib2-decoder with IVF?

Any help would be perfekt.

Thanks in advance
Frank

Frank,

HEY!! Someone working with GRIB2! I got the NCEP GRIB2 software to compile for me for my WINGRIDDS project- first through CVF 6.6 but I just made the switch to IVF 11.1/MS Studio 2008 & it compiled fine for me there as well. *HOWEVER*, I did not use any of the bacio* libraries to work with the GRIB data, I used to regular FORTRAN OPEN/READ calls to retrieve the data. I had more of an issue trying to get the JPEG2000 jasper routines to work but I got that going too. I have not tried to integrate the libpng or zlib routines. I also went through the GRIB2 processing using thecnvgrib routines as well.

I'll provide details if you like.

Jeff
0 Kudos
tropfen
New Contributor I
2,076 Views
Quoting tropfen
Quoting - tropfen
Hello,

does anyone has finished the task to compile the grib2-decoder with IVF?

Any help would be perfekt.

Thanks in advance
Frank

Frank,

HEY!! Someone working with GRIB2! I got the NCEP GRIB2 software to compile for me for my WINGRIDDS project- first through CVF 6.6 but I just made the switch to IVF 11.1/MS Studio 2008 & it compiled fine for me there as well. *HOWEVER*, I did not use any of the bacio* libraries to work with the GRIB data, I used to regular FORTRAN OPEN/READ calls to retrieve the data. I had more of an issue trying to get the JPEG2000 jasper routines to work but I got that going too. I have not tried to integrate the libpng or zlib routines. I also went through the GRIB2 processing using thecnvgrib routines as well.

I'll provide details if you like.

Jeff

Hello Jeff,

i would be happy if you could give me details on how you have solved the problem. What regular fortran calls can be used to remove bacio.

Thanks in advance

Frank

0 Kudos
Reply