[netcdfgroup] add_offset and scale_factor

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.*
  • 2019 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: