[Wrf-users] pb compiling WRF with GRIB2 on x86_64 GNU/Linux with gfortran

HEDDE Thierry thierry.hedde at cea.fr
Mon Oct 5 08:49:13 MDT 2009


Dear wrf users,

I've found a simple way to compile WRF 3.1.1 with GRIB2 on x86_64 GNU/Linux with gfortran.

I've just modified the io_grib2.F file the following way:
	- replace the "allocatable" attribute in the "TYPE :: HandleVar" with a "pointer" attribute
	- replace the "allocated" statement with "associated" for the "%Times" variable

You'll find the file io_grib2.F attached to the mail and the differences with the original file as well (diff_io_grib2.F).

I checked:
	1 - It compiles well
	2 - There is no memory leak when cycling deallocation/allocation (with a small test program)

Does somebody could test the validity of the new io_grib2.F file on a real case? I have no reference result to test it.

Thank you all for helping

Thierry HEDDE
Laboratoire de Modélisation des Transferts dans l'Environnement
CEA/CADARACHE
DEN/DTN/SMTM/LMTE
Bât. 307 Pièce 69
13108 ST PAUL LEZ DURANCE CEDEX
FRANCE
 
Tél : 0(0 33)4 42 25 38 41
Secr : 0(0 33)4 42 25 70 10
Fax : 0(0 33)4 42 25 62 72
 
-----Message d'origine-----
De : wrf-users-bounces at ucar.edu [mailto:wrf-users-bounces at ucar.edu] De la part de Steven G Decker
Envoyé : vendredi 2 octobre 2009 16:11
À : wrf-users at ucar.edu
Objet : Re: [Wrf-users] pb compiling WRF with GRIB2 on x86_64 GNU/Linuxwith gfortran

wrf-users-request at ucar.edu wrote:
> 
> Message: 1 Date: Thu, 1 Oct 2009 16:06:39 +0200 From: "HEDDE Thierry"
> <thierry.hedde at cea.fr> Subject: [Wrf-users] pb compiling WRF with
> GRIB2 on x86_64 GNU/Linux with	gfortran To: <wrf-users at ucar.edu> 
> Message-ID: 
> <16FB087F7D7B114D9C3D34AF0ECCB16C01CFCD at TOURVES.intra.cea.fr> 
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Hello dear wrf users,
> 
> 
> 
> I've got an F90 syntax error while compiling WRF 3.1.1 with the grib2
> option on a x86_64 GNU/Linux machine using the gfortran compiler
> 
> 
> 
> It compiles OK with the ifort compiler.
> 
> It is a known error with gfortran : when you try to define an
> allocatable variable inside a TYPE definition.
> 
> I had a look at the io_grib2. file but it looks quite hard to modify
> in a simple way the fortran source to get rid of the error
> 
> 
> 
> Did anybody have the same problem and fixed it?
> 
> - Using another version of gfortran?

This would be the fix.  Your version of gfortran is too old.  It looks 
like gfortran 4.2 or newer should support allocatable derived type 
components.

-- Steve

-- 
Steve Decker, Assistant Professor
Department of Environmental Sciences    Phone: (732) 932-9800 x 6203
Rutgers University                               Fax: (732) 932-8644
14 College Farm Rd                  Email: decker at envsci.rutgers.edu
New Brunswick, NJ  08901-8551
_______________________________________________
Wrf-users mailing list
Wrf-users at ucar.edu
http://mailman.ucar.edu/mailman/listinfo/wrf-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: io_grib2.F
Type: application/octet-stream
Size: 138741 bytes
Desc: io_grib2.F
Url : http://mailman.ucar.edu/pipermail/wrf-users/attachments/20091005/9675ec22/attachment-0002.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff_io_grib2.F
Type: application/octet-stream
Size: 398 bytes
Desc: diff_io_grib2.F
Url : http://mailman.ucar.edu/pipermail/wrf-users/attachments/20091005/9675ec22/attachment-0003.obj 


More information about the Wrf-users mailing list