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 8708 for branches/2017/dev_rev8689_LIM3_RST/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90 – NEMO

Ignore:
Timestamp:
2017-11-15T12:39:36+01:00 (6 years ago)
Author:
andmirek
Message:

#1976 improvements in LIM3 restart. Working version

File:
1 edited

Legend:

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

    r8573 r8708  
    239239 
    240240 
    241    SUBROUTINE iom_open( cdname, kiomid, ldwrt, kdom, kiolib, ldstop, ldiof ) 
     241   SUBROUTINE iom_open( cdname, kiomid, ldwrt, kdom, kiolib, ldstop, ldiof, ndlev ) 
    242242      !!--------------------------------------------------------------------- 
    243243      !!                   ***  SUBROUTINE  iom_open  *** 
     
    252252      LOGICAL         , INTENT(in   ), OPTIONAL ::   ldstop   ! stop if open to read a non-existing file (default = .TRUE.) 
    253253      LOGICAL         , INTENT(in   ), OPTIONAL ::   ldiof    ! Interp On the Fly, needed for AGRIF (default = .FALSE.) 
     254      INTEGER         , INTENT(in   ), OPTIONAL ::   ndlev     ! number of vertical levels 
    254255 
    255256      CHARACTER(LEN=256)    ::   clname    ! the name of the file based on cdname [[+clcpu]+clcpu] 
     
    405406      IF( istop == nstop ) THEN   ! no error within this routine 
    406407         SELECT CASE (iolib) 
    407          CASE (jpnf90   )   ;   CALL iom_nf90_open(    clname, kiomid, llwrt, llok, idompar ) 
     408         CASE (jpnf90   )   ;   CALL iom_nf90_open(    clname, kiomid, llwrt, llok, idompar, ndlev = ndlev ) 
    408409         CASE DEFAULT 
    409410            CALL ctl_stop( TRIM(clinfo)//' accepted IO library is only jpnf90 (jpioipsl option has been removed) ' ) 
     
    672673      CHARACTER(LEN=1)               ::   clrankpv, cldmspc      !  
    673674      LOGICAL                        ::   ll_depth_spec ! T => if kstart, kcount present then *only* use values for 3rd spatial dimension. 
     675      INTEGER                        ::   inlev        ! number of levels for 3D data 
    674676      !--------------------------------------------------------------------- 
    675677      ! 
     678      inlev = -1 
     679      IF(PRESENT(pv_r3d)) inlev = SIZE(pv_r3d, 3) 
    676680      clname = iom_file(kiomid)%name   !   esier to read 
    677681      clinfo = '          iom_get_123d, file: '//trim(clname)//', var: '//trim(cdvar) 
     
    801805                  ENDIF 
    802806                  IF( PRESENT(pv_r3d) ) THEN 
    803                      IF( idom == jpdom_data ) THEN                                  ; icnt(3) = jpkglo 
     807                     IF( idom == jpdom_data ) THEN                                  ; icnt(3) = inlev 
    804808                     ELSE IF( ll_depth_spec .AND. PRESENT(kstart) ) THEN            ; istart(3) = kstart(3); icnt(3) = kcount(3) 
    805                      ELSE                                                           ; icnt(3) = jpk 
     809                     ELSE                                                           ; icnt(3) = inlev 
    806810                     ENDIF 
    807811                  ENDIF 
     
    886890            ELSEIF( PRESENT(pv_r3d) .AND. idom /= jpdom_unknown ) THEN 
    887891               ! this if could be simplified with the new lbc_lnk that works with any size of the 3rd dimension 
    888                IF( icnt(3) == jpk ) THEN 
     892               IF( icnt(3) == inlev ) THEN 
    889893                  CALL lbc_lnk( pv_r3d,'Z',-999.,'no0' ) 
    890894               ELSE   ! put some arbitrary value (a call to lbc_lnk will be done later...) 
Note: See TracChangeset for help on using the changeset viewer.