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 4144 for branches/2013/dev_r3987_UKMO6_C1D/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90 – NEMO

Ignore:
Timestamp:
2013-10-28T14:50:08+01:00 (10 years ago)
Author:
rfurner
Message:

Commit for 2013 changes; see #1085

File:
1 edited

Legend:

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

    r3983 r4144  
    463463   !!                   INTERFACE iom_get 
    464464   !!---------------------------------------------------------------------- 
    465    SUBROUTINE iom_g0d( kiomid, cdvar, pvar ) 
     465   SUBROUTINE iom_g0d( kiomid, cdvar, pvar, ktime ) 
    466466      INTEGER         , INTENT(in   )                 ::   kiomid    ! Identifier of the file 
    467467      CHARACTER(len=*), INTENT(in   )                 ::   cdvar     ! Name of the variable 
    468468      REAL(wp)        , INTENT(  out)                 ::   pvar      ! read field 
    469       ! 
    470       INTEGER               :: idvar   ! variable id 
     469      INTEGER         , INTENT(in   ),     OPTIONAL   ::   ktime     ! record number 
     470      ! 
     471      INTEGER                                         ::   idvar     ! variable id 
     472      INTEGER                                         ::   idmspc    ! number of spatial dimensions 
     473      INTEGER         , DIMENSION(1)                  ::   itime     ! record number 
     474      CHARACTER(LEN=100)                              ::   clinfo    ! info character 
     475      CHARACTER(LEN=100)                              ::   clname    ! file name 
     476      CHARACTER(LEN=1)                                ::   cldmspc   ! 
     477      ! 
     478      itime = 1 
     479      IF( PRESENT(ktime) ) itime = ktime 
     480      ! 
     481      clname = iom_file(kiomid)%name 
     482      clinfo = '          iom_g0d, file: '//trim(clname)//', var: '//trim(cdvar) 
    471483      ! 
    472484      IF( kiomid > 0 ) THEN 
    473485         idvar = iom_varid( kiomid, cdvar ) 
    474486         IF( iom_file(kiomid)%nfid > 0 .AND. idvar > 0 ) THEN 
     487            idmspc = iom_file ( kiomid )%ndims( idvar ) 
     488            IF( iom_file(kiomid)%luld(idvar) )  idmspc = idmspc - 1 
     489            WRITE(cldmspc , fmt='(i1)') idmspc 
     490            IF( idmspc > 0 )  CALL ctl_stop( TRIM(clinfo), 'When reading to a 0D array, we do not accept data', & 
     491                                 &                         'with 1 or more spatial dimensions: '//cldmspc//' were found.' , & 
     492                                 &                         'Use ncwa -a to suppress the unnecessary dimensions' ) 
    475493            SELECT CASE (iom_file(kiomid)%iolib) 
    476             CASE (jpioipsl )   ;   CALL iom_ioipsl_get(  kiomid, idvar, pvar ) 
    477             CASE (jpnf90   )   ;   CALL iom_nf90_get(    kiomid, idvar, pvar ) 
     494            CASE (jpioipsl )   ;   CALL iom_ioipsl_get(  kiomid, idvar, pvar, itime ) 
     495            CASE (jpnf90   )   ;   CALL iom_nf90_get(    kiomid, idvar, pvar, itime ) 
    478496            CASE (jprstdimg)   ;   CALL iom_rstdimg_get( kiomid, idvar, pvar ) 
    479497            CASE DEFAULT     
     
    640658               ELSE 
    641659                  CALL ctl_stop( TRIM(clinfo), 'To keep iom lisibility, when reading a '//clrankpv//'D array,'         ,   & 
    642                      &                         'we do not accept data with more than '//cldmspc//' spatial dimension',   & 
     660                     &                         'we do not accept data with '//cldmspc//' spatial dimensions',   & 
    643661                     &                         'Use ncwa -a to suppress the unnecessary dimensions' ) 
    644662               ENDIF 
     
    752770 
    753771         IF( istop == nstop ) THEN   ! no additional errors until this point... 
    754             IF(lwp) WRITE(numout,"(10x,' read ',a,' (rec: ',i4,') in ',a,' ok')") TRIM(cdvar), itime, TRIM(iom_file(kiomid)%name) 
     772            IF(lwp) WRITE(numout,"(10x,' read ',a,' (rec: ',i6,') in ',a,' ok')") TRIM(cdvar), itime, TRIM(iom_file(kiomid)%name) 
    755773           
    756774            !--- overlap areas and extra hallows (mpp) 
Note: See TracChangeset for help on using the changeset viewer.