Unidata / netcdf-fortran

Official GitHub repository for netCDF-Fortran libraries, which depend on the netCDF C library. Install the netCDF C library first.
Other
244 stars 98 forks source link

question about nf90_Inquire_Attribute output #452

Closed everson-ufsm closed 1 month ago

everson-ufsm commented 1 month ago

Hi guys. I have a question about the output of the "nf90_Inquire_Attribute" function. Consider the following piece of code: !============================================================ integer :: xtype,len,attnum status=nf90_Inquire_Attribute(ncid,varid,'scale_factor',xtype,len,attnum) write(,)trim(nf90_strerror(status)) write(,)xtype,len,attnum !============================================================ The output at the terminal was: !==================== No error 6 1 2 !===================== The question is: what does the number “6” mean? Can anyone tell me how to associate the number "6" with the types: NF90_BYTE, NF90_CHAR, NF90_SHORT, NF90_INT, NF90_FLOAT, and NF90_DOUBLE? Sincerely, Everson.

WardF commented 1 month ago

The "6" in this output means the xtype for 'scale_'factor' is of type NF90_DOUBLE.

everson-ufsm commented 1 month ago

Hi WardF, how can i find out all the types? Where can I find information to find out what the type is for the number 1, 2 and so on? Sincerely, Everson.

WardF commented 1 month ago

I am not a fortran expert, but you can find the enumerations in netcdf.inc and netcdf2.inc, I believe :)