Re: [netcdfgroup] add_offset and scale_factor

Dear Pooran,

the scale_factor and add_offset attributes are optional. They are used for packing data (search for "netcdf packing data" for details) and for similar purposes. If they do not exist, you can consider scale_factor to be 1.0 and add_offset 0.0 (or you just ignore them and use the data as they are).

Cheers,
Daniel



On 15.04.19 07:02, Pooran khedri wrote:
Hi everybody,
I have a piece of a code to read meteorological forcing  from ECMWF database  in a NetCDF format, Here is some of my piece code to read this file |!reading atmospheric pressure CALL cf90_get_att(iunit, atmpID, "scale_factor", scale_factor) CALL cf90_get_att(iunit, atmpID, "add_offset", offset) CALL cf90_get_var(iunit, atmpID, atmpindat(:,:), filepars%timerec) atmpindat = atmpindat*scale_factor + offset| but I have downloaded the new meteorological file from another database in a NetCDF format , this new file is different from ECMWF file and it does not have add_offset and scale_factor  in its attribute and my code does not read it and I have got many errors. I think I have to add the add_offset and scale_factor to  the  new NetCDF file  or I have to modify the FORTRAN code  that scaling is not used for this variable, but I do not know how to do them☺ ,I am new to using the NetCDF files and FORTRAN .
I would be grateful if you could explain to me How to solve my problem.

Pooran

--
/Ph.D. student//, //Department of Physical Oceanography./
/Khorramshahr Marine Science and Technology University,
Khorramshahr, P.O. Box: 669,
Khuzestan Province, Iran./

_______________________________________________
NOTE: All exchanges posted to Unidata maintained email lists are
recorded in the Unidata inquiry tracking system and made publicly
available through the web.  Users who post to any of the lists we
maintain are reminded to remove any personal information that they
do not want to be made public.


netcdfgroup mailing list
netcdfgroup@xxxxxxxxxxxxxxxx
For list information or to unsubscribe,  visit: 
http://www.unidata.ucar.edu/mailing_lists/

--
Daniel Neumann

Leibniz Institute for Baltic Sea Research Warnemuende
Physical Oceanography and Instrumentation
Seestrasse 15
18119 Rostock
Germany

phone:  +49-381-5197-287
fax:    +49-381-5197-114 or 440
e-mail: daniel.neumann@xxxxxxxxxxxxxxxxx

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

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