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 – 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.

Location:
branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/IOM
Files:
2 edited

Legend:

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

    r2287 r2351  
    4444#endif 
    4545   PUBLIC iom_init, iom_swap, iom_open, iom_close, iom_setkt, iom_varid, iom_get, iom_gettime, iom_rstput, iom_put 
     46   PUBLIC iom_getatt 
    4647 
    4748   PRIVATE iom_rp0d, iom_rp1d, iom_rp2d, iom_rp3d 
     
    5455   INTERFACE iom_get 
    5556      MODULE PROCEDURE iom_g0d, iom_g1d, iom_g2d, iom_g3d 
     57   END INTERFACE 
     58   INTERFACE iom_getatt 
     59      MODULE PROCEDURE iom_g0d_intatt 
    5660   END INTERFACE 
    5761   INTERFACE iom_rstput 
     
    824828      ! 
    825829   END SUBROUTINE iom_gettime 
     830 
     831 
     832   !!---------------------------------------------------------------------- 
     833   !!                   INTERFACE iom_getatt 
     834   !!---------------------------------------------------------------------- 
     835   SUBROUTINE iom_g0d_intatt( kiomid, cdatt, pvar ) 
     836      INTEGER         , INTENT(in   )                 ::   kiomid    ! Identifier of the file 
     837      CHARACTER(len=*), INTENT(in   )                 ::   cdatt     ! Name of the attribute 
     838      INTEGER         , INTENT(  out)                 ::   pvar      ! read field 
     839      ! 
     840      IF( kiomid > 0 ) THEN 
     841         IF( iom_file(kiomid)%nfid > 0 ) THEN 
     842            SELECT CASE (iom_file(kiomid)%iolib) 
     843            CASE (jpioipsl )   ;   CALL ctl_stop('iom_getatt: only nf90 available') 
     844            CASE (jpnf90   )   ;   CALL iom_nf90_getatt( kiomid, cdatt, pvar ) 
     845            CASE (jprstdimg)   ;   CALL ctl_stop('iom_getatt: only nf90 available') 
     846            CASE DEFAULT     
     847               CALL ctl_stop( 'iom_g0d_att: accepted IO library are only jpioipsl, jpnf90 and jprstdimg' ) 
     848            END SELECT 
     849         ENDIF 
     850      ENDIF 
     851   END SUBROUTINE iom_g0d_intatt 
    826852 
    827853 
  • 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.