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 2368 for branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/IOM/iom_nf90.F90 – NEMO

Ignore:
Timestamp:
2010-11-09T16:38:45+01:00 (13 years ago)
Author:
acc
Message:

nemo_v3_3_beta. Changes to code relating to key_netcdf4 option to provide more robust compilation. See #755 and #754

File:
1 edited

Legend:

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

    r2364 r2368  
    4040   END INTERFACE 
    4141 
    42 #if ! defined key_netcdf4 
    43    !!-------------------------------------------------------------------- 
    44    !! NOT 'key_netcdf4' Defines dummy routines for netcdf4 
    45    !!                   calls when compiling without netcdf4 libraries 
    46    !!-------------------------------------------------------------------- 
    47    PUBLIC NF90_DEF_VAR_CHUNKING, NF90_DEF_VAR_DEFLATE ! contained below 
    48    INTEGER :: NF90_HDF5 
    49 #endif 
    5042   !!---------------------------------------------------------------------- 
    5143   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
     
    7769      INTEGER            ::   ichunk           ! temporary storage of nn_chunksz 
    7870      INTEGER            ::   imode            ! creation mode flag: NF90_CLOBBER or NF90_NOCLOBBER or NF90_HDF5 
     71      INTEGER            ::   ihdf5            ! local variable for retrieval of value for NF90_HDF5 
    7972      LOGICAL            ::   llclobber        ! local definition of ln_clobber 
    8073      !--------------------------------------------------------------------- 
     
    116109            IF( snc4set%luse ) THEN 
    117110               IF(lwp) WRITE(numout,*) TRIM(clinfo)//' creating file: '//TRIM(cdname)//' in hdf5 (netcdf4) mode' 
    118                IF( llclobber ) THEN   ;   imode = IOR(NF90_HDF5, NF90_CLOBBER) 
    119                ELSE                   ;   imode = IOR(NF90_HDF5, NF90_NOCLOBBER) 
     111               CALL GET_NF90_SYMBOL("NF90_HDF5", ihdf5) 
     112               IF( llclobber ) THEN   ;   imode = IOR(ihdf5, NF90_CLOBBER) 
     113               ELSE                   ;   imode = IOR(ihdf5, NF90_NOCLOBBER) 
    120114               ENDIF 
    121115               CALL iom_nf90_check(NF90_CREATE( TRIM(cdname), imode, if90id ), clinfo) 
     
    496490            ichunksz(4) = 1                                                            ! Do not allow chunks to span the 
    497491                                                                                       ! unlimited dimension 
    498             CALL iom_nf90_check(NF90_DEF_VAR_CHUNKING(if90id, idvar, ichunkalg, ichunksz), clinfo) 
    499             CALL iom_nf90_check(NF90_DEF_VAR_DEFLATE(if90id, idvar, ishuffle, ideflate, ideflate_level), clinfo) 
     492            CALL iom_nf90_check(SET_NF90_DEF_VAR_CHUNKING(if90id, idvar, ichunkalg, ichunksz), clinfo) 
     493            CALL iom_nf90_check(SET_NF90_DEF_VAR_DEFLATE(if90id, idvar, ishuffle, ideflate, ideflate_level), clinfo) 
    500494            IF(lwp) WRITE(numout,*) TRIM(clinfo)//' chunked ok. Chunks sizes: ', ichunksz 
    501495         ENDIF 
     
    579573   END SUBROUTINE iom_nf90_check 
    580574 
    581 #if ! defined key_netcdf4 
    582  
    583       !!-------------------------------------------------------------------- 
    584       !! NOT 'key_netcdf4' Defines dummy routines for netcdf4 
    585       !!                   calls when compiling without netcdf4 libraries 
    586       !!-------------------------------------------------------------------- 
    587  
    588    INTEGER FUNCTION NF90_DEF_VAR_CHUNKING(idum1, idum2, idum3, iarr1) 
    589       !!-------------------------------------------------------------------- 
    590       !!                   ***  SUBROUTINE NF90_DEF_VAR_CHUNKING  *** 
    591       !! 
    592       !! ** Purpose :   Dummy NetCDF4 routine to enable compiling with NetCDF3 libraries 
    593       !!-------------------------------------------------------------------- 
    594       INTEGER,               INTENT(in) :: idum1, idum2, idum3 
    595       INTEGER, DIMENSION(4), INTENT(in) :: iarr1 
    596       IF(lwp) WRITE(numout,*) 'Warning: Attempt to chunk output variable without NetCDF4 support' 
    597       NF90_DEF_VAR_CHUNKING = -1 
    598    END FUNCTION NF90_DEF_VAR_CHUNKING 
    599  
    600    INTEGER FUNCTION NF90_DEF_VAR_DEFLATE(idum1, idum2, idum3, idum4, idum5) 
    601       !!-------------------------------------------------------------------- 
    602       !!                   ***  SUBROUTINE NF90_DEF_VAR_DEFLATE  *** 
    603       !! 
    604       !! ** Purpose :   Dummy NetCDF4 routine to enable compiling with NetCDF3 libraries 
    605       !!-------------------------------------------------------------------- 
    606       INTEGER,               INTENT(in) :: idum1, idum2, idum3, idum4, idum5 
    607       IF(lwp) WRITE(numout,*) 'Warning: Attempt to compress output variable without NetCDF4 support' 
    608       NF90_DEF_VAR_DEFLATE = -1 
    609    END FUNCTION NF90_DEF_VAR_DEFLATE 
    610 #endif 
    611  
    612575   !!====================================================================== 
    613576END MODULE iom_nf90 
Note: See TracChangeset for help on using the changeset viewer.