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 2590 for branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OPA_SRC/TRA/zpshde.F90 – NEMO

Ignore:
Timestamp:
2011-02-18T13:49:27+01:00 (13 years ago)
Author:
trackstand2
Message:

Merge branch 'dynamic_memory' into master-svn-dyn

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OPA_SRC/TRA/zpshde.F90

    r2569 r2590  
    8080      !!              - pgru, pgrv: horizontal gradient of rho (if present) at u- & v-points  
    8181      !!---------------------------------------------------------------------- 
     82      USE wrk_nemo, ONLY: wrk_use, wrk_release 
     83      USE wrk_nemo, ONLY: zri => wrk_2d_1, zrj => wrk_2d_2   ! interpolated value of rd 
     84      USE wrk_nemo, ONLY: zhi => wrk_2d_3, zhj => wrk_2d_4   ! depth of interpolation for eos2d 
     85      USE wrk_nemo, ONLY: wrk_3d_1, wrk_3d_2 
     86      !! 
    8287      INTEGER                              , INTENT(in   )           ::  kt          ! ocean time-step index 
    8388      INTEGER                              , INTENT(in   )           ::  kjpt        ! number of tracers 
     
    8994      INTEGER  ::   ji, jj, jn      ! Dummy loop indices 
    9095      INTEGER  ::   iku, ikv, ikum1, ikvm1   ! partial step level (ocean bottom level) at u- and v-points 
    91       REAL(wp), DIMENSION(jpi,jpj,kjpt) ::   zti, ztj     ! interpolated value of tracer 
    92       REAL(wp), DIMENSION(jpi,jpj)      ::   zri, zrj     ! interpolated value of rd 
    93       REAL(wp), DIMENSION(jpi,jpj)      ::   zhi, zhj     ! depth of interpolation for eos2d 
     96      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zti, ztj    ! interpolated value of tracer 
    9497      REAL(wp) ::  ze3wu, ze3wv, zmaxu, zmaxv  ! temporary scalars 
    9598      !!---------------------------------------------------------------------- 
     99 
     100      IF( (.NOT. wrk_use(2, 1,2,3,4)) .OR. (.NOT. wrk_use(3, 1,2)) )THEN 
     101         CALL ctl_stop('zps_hde: requested workspace arrays unavailable.') 
     102         RETURN 
     103      ELSE IF(kjpt > jpk)THEN 
     104         CALL ctl_stop('zps_hde: no. of tracers > jpk so cannot use 3D workspace arrays from wrk_nemo module.') 
     105         RETURN 
     106      END IF 
     107      ! Set-up pointers to sub-arrays of workspaces 
     108      zti => wrk_3d_1(:,:,1:kjpt) 
     109      ztj => wrk_3d_2(:,:,1:kjpt) 
    96110 
    97111      DO jn = 1, kjpt      !==   Interpolation of tracers at the last ocean level   ==! 
     
    200214      END IF 
    201215      ! 
     216      IF( (.NOT. wrk_release(2, 1,2,3,4)) .OR. (.NOT. wrk_release(3, 1,2)) )THEN 
     217         CALL ctl_stop('zps_hde: failed to release workspace arrays.') 
     218      END IF 
     219      ! 
    202220   END SUBROUTINE zps_hde 
    203221 
Note: See TracChangeset for help on using the changeset viewer.