New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 2351 for branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/IOM/iom_nf90.F90 – NEMO

Ignore:
Timestamp:
2010-11-02T08:09:00+01:00 (14 years ago)
Author:
sga
Message:

NEMO branch nemo_v3_3_beta
modify interpolation on the fly scheme within fldread.F90.
Instead of attempting to decide on cyclicity of input non-model grid by inspecting a longitude variable,
fld_read now expects to find an attribute in the input weights file to tell it how many columns overlap
at the east-west edges of the grid.
iom and iom_nf90.F90 have new routines to expose netcdf attributes to the model.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/IOM/iom_nf90.F90

    r2287 r2351  
    2828 
    2929   PUBLIC iom_nf90_open, iom_nf90_close, iom_nf90_varid, iom_nf90_get, iom_nf90_gettime, iom_nf90_rstput 
     30   PUBLIC iom_nf90_getatt 
    3031 
    3132   INTERFACE iom_nf90_get 
    3233      MODULE PROCEDURE iom_nf90_g0d, iom_nf90_g123d 
     34   END INTERFACE 
     35   INTERFACE iom_nf90_getatt 
     36      MODULE PROCEDURE iom_nf90_intatt 
    3337   END INTERFACE 
    3438   INTERFACE iom_nf90_rstput 
     
    288292 
    289293 
     294   SUBROUTINE iom_nf90_intatt( kiomid, cdatt, pvar ) 
     295      !!----------------------------------------------------------------------- 
     296      !!                  ***  ROUTINE  iom_nf90_intatt  *** 
     297      !! 
     298      !! ** Purpose : read an integer attribute with NF90 
     299      !!----------------------------------------------------------------------- 
     300      INTEGER         , INTENT(in   ) ::   kiomid   ! Identifier of the file 
     301      CHARACTER(len=*), INTENT(in   ) ::   cdatt    ! attribute name 
     302      INTEGER         , INTENT(  out) ::   pvar     ! read field 
     303      ! 
     304      INTEGER                         ::   if90id   ! temporary integer 
     305      LOGICAL                         ::   llok     ! temporary logical 
     306      CHARACTER(LEN=100)              ::   clinfo   ! info character 
     307      !--------------------------------------------------------------------- 
     308      !  
     309      if90id = iom_file(kiomid)%nfid 
     310      llok = NF90_Inquire_attribute(if90id, NF90_GLOBAL, cdatt) == nf90_noerr 
     311      IF( llok) THEN 
     312         clinfo = 'iom_nf90_getatt, file: '//TRIM(iom_file(kiomid)%name)//', att: '//TRIM(cdatt) 
     313         CALL iom_nf90_check(NF90_GET_ATT(if90id, NF90_GLOBAL, cdatt, values=pvar), clinfo) 
     314      ELSE 
     315         CALL ctl_warn('iom_nf90_getatt: no attribute '//cdatt//' found') 
     316         pvar = -999 
     317      ENDIF 
     318      !  
     319   END SUBROUTINE iom_nf90_intatt 
     320 
     321 
    290322   SUBROUTINE iom_nf90_gettime( kiomid, kvid, ptime, cdunits, cdcalendar ) 
    291323      !!-------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.