Changeset 4405


Ignore:
Timestamp:
2014-02-04T13:11:58+01:00 (7 years ago)
Author:
trackstand2
Message:

Add option to switch trimming of sub-domains in z via NEMO_TRIM_DOMZ env var

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90

    r4400 r4405  
    772772      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released 
    773773      USE wrk_nemo, ONLY:   zmbk => wrk_2d_1 
    774       USE par_oce,  ONLY: jpkf, jpkfm1 
     774      USE par_oce,  ONLY:   jpkf, jpkfm1 
    775775      !! 
    776776      INTEGER ::   ji, jj   ! dummy loop indices 
     777      LOGICAL :: domtrim_z 
     778      CHARACTER(LEN=8) :: lstr            ! Local string for reading env. var. 
     779      INTEGER          :: lztrim, ierr    ! Local int for      "      "    " 
    777780      !!---------------------------------------------------------------------- 
    778781      ! 
     
    799802      zmbk(:,:) = REAL( mbkv(:,:), wp )   ;   CALL lbc_lnk(zmbk,'V',1.)   ;   mbkv  (:,:) = MAX( INT( zmbk(:,:) ), 1 ) 
    800803      ! 
    801       ! Compute and store the deepest bottom level of any grid-type at each grid point 
    802       ! For use in removing data below ocean floor from compute loops 
    803       mbkmax(:,:) = MAX(mbkt(:,:)+1, mbku(:,:), mbkv(:,:)) 
    804       jpkf = MAXVAL( mbkmax(:,:) ) 
     804 
     805      domtrim_z = .TRUE. 
     806      CALL GET_ENVIRONMENT_VARIABLE(NAME='NEMO_TRIM_DOMZ', VALUE=lstr, & 
     807                                    STATUS=ierr) 
     808      IF( ierr == 0)THEN 
     809         READ(lstr,FMT="(I)",IOSTAT=ierr) lztrim 
     810         IF(ierr == 0)THEN 
     811            IF (lztrim == 0) domtrim_z = .FALSE. 
     812         ELSE 
     813            CALL ctl_warn('zgr_bot_level: failed to parse value of NEMO_TRIM_DOMZ environment variable: '//TRIM(lstr)) 
     814         END IF 
     815      END IF 
     816 
     817      ! Compute and store the deepest bottom level of any grid-type at each grid 
     818      ! point. For use in removing data below ocean floor from compute loops 
     819      IF( domtrim_z ) THEN 
     820         mbkmax(:,:) = MAX(mbkt(:,:)+1, mbku(:,:), mbkv(:,:)) 
     821!         jpkf = MIN(jpk, 1 + MAXVAL( mbkmax(:,:) ) ) 
     822         jpkf = MAXVAL( mbkmax(:,:) ) 
     823         WRITE(*,*) narea,': ARPDBG: shallowest pt and jpkf = ', & 
     824                    MINVAL(mbkmax(:,:)), jpkf 
     825      ELSE 
     826         WRITE(*,*) narea,': ARPDBG: NOT trimming domain in z' 
     827         jpkf = jpk 
     828      END IF 
    805829      jpkfm1 = jpkf - 1 
    806       WRITE(*,*) narea,': ARPDBG: shallowest pt and jpkf = ', MINVAL(mbkmax(:,:)), jpkf 
    807830 
    808831      ! 
Note: See TracChangeset for help on using the changeset viewer.