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/LIM_SRC_2/limdyn_2.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/LIM_SRC_2/limdyn_2.F90

    r2528 r2715  
    5858      !!              - treatment of the case if no ice dynamic 
    5959      !!--------------------------------------------------------------------- 
     60      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released 
     61      USE wrk_nemo, ONLY:   wrk_1d_1, wrk_1d_2 
     62      USE wrk_nemo, ONLY:   zu_io => wrk_2d_1, zv_io => wrk_2d_2  ! ice-ocean velocity 
     63      ! 
    6064      INTEGER, INTENT(in) ::   kt     ! number of iteration 
    6165      !! 
     
    6367      INTEGER  ::   i_j1, i_jpj        ! Starting/ending j-indices for rheology 
    6468      REAL(wp) ::   zcoef              ! temporary scalar 
    65       REAL(wp), DIMENSION(jpj)     ::   zind           ! i-averaged indicator of sea-ice 
    66       REAL(wp), DIMENSION(jpj)     ::   zmsk           ! i-averaged of tmask 
    67       REAL(wp), DIMENSION(jpi,jpj) ::   zu_io, zv_io   ! ice-ocean velocity 
     69      REAL(wp), POINTER, DIMENSION(:) ::   zind     ! i-averaged indicator of sea-ice 
     70      REAL(wp), POINTER, DIMENSION(:) ::   zmsk     ! i-averaged of tmask 
    6871      !!--------------------------------------------------------------------- 
     72 
     73      IF(  wrk_in_use(1, 1,2)  .OR.  wrk_in_use(2, 1,2)  ) THEN 
     74         CALL ctl_stop( 'lim_dyn_2 : requested workspace arrays unavailable' )   ;   RETURN 
     75      ENDIF 
     76      zind => wrk_1d_1(1:jpj)      ! Set-up pointers to sub-arrays of workspaces 
     77      zmsk => wrk_1d_2(1:jpj) 
    6978 
    7079      IF( kt == nit000 )   CALL lim_dyn_init_2   ! Initialization (first time-step only) 
     
    93102            ! 
    94103            DO jj = 1, jpj 
    95                zind(jj) = SUM( frld (:,jj  ) )   ! = FLOAT(jpj) if ocean everywhere on a j-line 
    96                zmsk(jj) = SUM( tmask(:,jj,1) )   ! = 0          if land  everywhere on a j-line 
     104               zind(jj) = SUM( frld (:,jj  ) )   ! = REAL(jpj) if ocean everywhere on a j-line 
     105               zmsk(jj) = SUM( tmask(:,jj,1) )   ! = 0         if land  everywhere on a j-line 
    97106            END DO 
    98107            ! 
     
    200209      ! 
    201210      IF(ln_ctl)   CALL prt_ctl(tab2d_1=ust2s , clinfo1=' lim_dyn  : ust2s :') 
     211      ! 
     212      IF( wrk_not_released(1, 1,2)     .OR.   & 
     213          wrk_not_released(2, 1,2) )   CALL ctl_stop('lim_dyn_2 : failed to release workspace arrays') 
    202214      ! 
    203215   END SUBROUTINE lim_dyn_2 
Note: See TracChangeset for help on using the changeset viewer.