[netcdfgroup] Compound type and Fortran90

Dear all,

I am using netCDF 4.1.3 in a Fortran90 code which is compiled with gfortran 
4.4.5. I want to use the compound types. I have no problem to define a compound 
type, but I am currently encountering a problem when I try to put values into a 
well-defined compound type. The problem occurs at the compilation, when using 
nf90_put_var. The compilation fails with the error "Error: There is no specific 
function for the generic 'nf90_put_var' at (1)"

In my code, I have defined a compound type using nf90_def_compound and 
nf90_insert_compound. This type contains variables of int/double/string type or 
another user defined type.
The definition works well, the .nc file created is correct. Unfortunately, the 
call of nf90_put_var leads to this compilation error. The third argument of the 
routine is "values", which is the derived type (or Fortran90 structure) in my 
case, containing variables of different types. The documentation of 
nf90_put_var (see 
http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-f90/NF90_005fPUT_005fVAR.html#NF90_005fPUT_005fVAR)
 says that "the data may be of any type, and may be a scalar or an array of any 
rank". I just call nf90_put_var with 3 arguments, like this "nf90_put_var(ncid, 
varid, values)".

I would like to know how put a value of a derived type variable into a compound 
type variable with netCDF, in a Fortran90 code. Can someone help me please ?
Thank you for your help !


[Description : Description : Description : 
cid:image001.png@01CD94BC.12226960]<http://www.noveltis.com/>
153, rue du Lac
F-31670 LABEGE
Tel : +33 (0)5.62.88.11.28
Fax : +33 (0)5.62.88.11.12
www.noveltis.com<http://www.noveltis.com/>


Merci de considérer toutes les informations contenues dans cet email comme 
confidentielles. Vous ne devez pas les transmettre sans autorisation. Si ce 
mail ne vous est pas destiné, merci de le signaler à l'expéditeur et de 
l'effacer de votre système.
Please, consider email information as confidential. Do not transfer without 
prior authorization. If this email is not intended for you, thank you to notify 
the sender and to delete this message from your computer.

Agissons au quotidien pour préserver notre environnement. N'imprimez ce 
courrier et les documents joints que si nécessaire.

PNG image

  • 2013 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: