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 2642 – NEMO

Changeset 2642


Ignore:
Timestamp:
2011-03-02T19:32:23+01:00 (12 years ago)
Author:
cetlod
Message:

Modify the routine zpshde.F90 to be able to run a biogeo model with no. of tracers > jpk

File:
1 edited

Legend:

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

    r2636 r2642  
    8484      USE wrk_nemo, ONLY: zri => wrk_2d_1, zrj => wrk_2d_2   ! interpolated value of rd 
    8585      USE wrk_nemo, ONLY: zhi => wrk_2d_3, zhj => wrk_2d_4   ! depth of interpolation for eos2d 
    86       USE wrk_nemo, ONLY: wrk_3d_1, wrk_3d_2 
    8786      !! 
    8887      INTEGER                              , INTENT(in   )           ::  kt          ! ocean time-step index 
     
    9594      INTEGER  ::   ji, jj, jn      ! Dummy loop indices 
    9695      INTEGER  ::   iku, ikv, ikum1, ikvm1   ! partial step level (ocean bottom level) at u- and v-points 
    97       REAL(wp), POINTER, DIMENSION(:,:,:) ::   zti, ztj    ! interpolated value of tracer 
     96      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   zti, ztj    ! interpolated value of tracer 
    9897      REAL(wp) ::  ze3wu, ze3wv, zmaxu, zmaxv  ! temporary scalars 
    9998      !!---------------------------------------------------------------------- 
    10099 
    101       IF( wrk_in_use(2, 1,2,3,4) .OR. wrk_in_use(3, 1,2) )THEN 
    102          CALL ctl_stop('zps_hde: requested workspace arrays unavailable.') 
    103          RETURN 
    104       ELSE IF(kjpt > jpk)THEN 
    105          CALL ctl_stop('zps_hde: no. of tracers > jpk so cannot use 3D workspace arrays from wrk_nemo module.') 
    106          RETURN 
     100      IF( wrk_in_use(2, 1,2,3,4) ) THEN 
     101         CALL ctl_stop('zps_hde: requested workspace arrays unavailable.')  ;  RETURN 
    107102      END IF 
    108       ! Set-up pointers to sub-arrays of workspaces 
    109       zti => wrk_3d_1(:,:,1:kjpt) 
    110       ztj => wrk_3d_2(:,:,1:kjpt) 
     103 
     104      ! Allocate workspaces whose dimension is > jpk 
     105      ALLOCATE( zti(jpi,jpj,kjpt) ) 
     106      ALLOCATE( ztj(jpi,jpj,kjpt) ) 
    111107 
    112108      DO jn = 1, kjpt      !==   Interpolation of tracers at the last ocean level   ==! 
     
    215211      END IF 
    216212      ! 
    217       IF( wrk_not_released(2, 1,2,3,4) .OR. wrk_not_released(3, 1,2) )THEN 
    218          CALL ctl_stop('zps_hde: failed to release workspace arrays.') 
    219       END IF 
     213      IF( wrk_not_released(2, 1,2,3,4) ) CALL ctl_stop('zps_hde: failed to release workspace arrays.') 
     214 
     215      DEALLOCATE( zti ) 
     216      DEALLOCATE( ztj ) 
    220217      ! 
    221218   END SUBROUTINE zps_hde 
Note: See TracChangeset for help on using the changeset viewer.