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 2715 for trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_imp.F90 – NEMO

Ignore:
Timestamp:
2011-03-30T17:58:35+02:00 (13 years ago)
Author:
rblod
Message:

First attempt to put dynamic allocation on the trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_imp.F90

    r2528 r2715  
    11MODULE dynzdf_imp 
    2    !!============================================================================== 
     2   !!====================================================================== 
    33   !!                    ***  MODULE  dynzdf_imp  *** 
    44   !! Ocean dynamics:  vertical component(s) of the momentum mixing trend 
    5    !!============================================================================== 
     5   !!====================================================================== 
    66   !! History :  OPA  !  1990-10  (B. Blanke)  Original code 
    77   !!            8.0  !  1997-05  (G. Madec)  vertical component of isopycnal 
    8    !!   NEMO     1.0  !  2002-08  (G. Madec)  F90: Free form and module 
     8   !!   NEMO     0.5  !  2002-08  (G. Madec)  F90: Free form and module 
    99   !!            3.3  !  2010-04  (M. Leclair, G. Madec)  Forcing averaged over 2 time steps 
    1010   !!---------------------------------------------------------------------- 
    1111 
    1212   !!---------------------------------------------------------------------- 
    13    !!   dyn_zdf_imp  : update the momentum trend with the vertical diffu- 
    14    !!                  sion using a implicit time-stepping. 
     13   !!   dyn_zdf_imp  : update the momentum trend with the vertical diffusion using a implicit time-stepping 
    1514   !!---------------------------------------------------------------------- 
    1615   USE oce             ! ocean dynamics and tracers 
     
    2019   USE phycst          ! physical constants 
    2120   USE in_out_manager  ! I/O manager 
     21   USE lib_mpp         ! MPP library 
    2222 
    2323   IMPLICIT NONE 
     
    5454      !! ** Action : - Update (ua,va) arrays with the after vertical diffusive mixing trend. 
    5555      !!--------------------------------------------------------------------- 
    56       USE oce, ONLY :  zwd   => ta      ! use ta as workspace 
    57       USE oce, ONLY :  zws   => sa      ! use sa as workspace 
    58       !! 
    59       INTEGER , INTENT( in ) ::   kt    ! ocean time-step index 
    60       REAL(wp), INTENT( in ) ::  p2dt   ! vertical profile of tracer time-step 
    61       !! 
    62       INTEGER  ::   ji, jj, jk             ! dummy loop indices 
    63       REAL(wp) ::   z1_p2dt, zcoef         ! temporary scalars 
    64       REAL(wp) ::   zzwi, zzws, zrhs       ! temporary scalars 
    65       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwi        ! 3D workspace 
     56      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released 
     57      USE oce     , ONLY:  zwd  => ta       , zws   => sa   ! (ta,sa) used as 3D workspace 
     58      USE wrk_nemo, ONLY:   zwi => wrk_3d_3                 ! 3D workspace 
     59      !! 
     60      INTEGER , INTENT(in) ::   kt    ! ocean time-step index 
     61      REAL(wp), INTENT(in) ::  p2dt   ! vertical profile of tracer time-step 
     62      !! 
     63      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
     64      REAL(wp) ::   z1_p2dt, zcoef, zzwi, zzws, zrhs   ! local scalars 
    6665      !!---------------------------------------------------------------------- 
     66 
     67      IF( wrk_in_use(3, 3) ) THEN 
     68         CALL ctl_stop('dyn_zdf_imp: requested workspace array unavailable')   ;   RETURN 
     69      END IF 
    6770 
    6871      IF( kt == nit000 ) THEN 
     
    253256      END DO 
    254257      ! 
     258      IF( wrk_not_released(3, 3) )   CALL ctl_stop('dyn_zdf_imp: failed to release workspace array') 
     259      ! 
    255260   END SUBROUTINE dyn_zdf_imp 
    256261 
Note: See TracChangeset for help on using the changeset viewer.