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/TOP_SRC/PISCES/trcsms_pisces.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/TOP_SRC/PISCES/trcsms_pisces.F90

    r2528 r2715  
    1616   USE trc 
    1717   USE sms_pisces 
    18    USE lbclnk 
    19    USE lib_mpp 
    2018    
    2119   USE p4zint          !  
     
    6563      !!              - ... 
    6664      !!--------------------------------------------------------------------- 
     65      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released 
     66      USE wrk_nemo, ONLY: ztrpis => wrk_3d_1   ! used for pisces sms trends 
     67      ! 
    6768      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index       
    6869      !! 
    6970      INTEGER ::   jnt, jn 
    70       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ztrpis   ! used for pisces sms trends 
    7171      CHARACTER (len=25) :: charout 
    7272      !!--------------------------------------------------------------------- 
    7373 
    7474      IF( kt == nit000 )   CALL trc_sms_pisces_init    ! Initialization (first time-step only) 
     75 
     76      IF( wrk_in_use(3,1) )  THEN 
     77        CALL ctl_stop('trc_sms_pisces : requested workspace array unavailable.')  ;  RETURN 
     78      ENDIF 
    7579 
    7680      IF( ndayflxtr /= nday_year ) THEN      ! New days 
     
    111115            CALL trd_mod_trc( ztrpis, jn, jptra_trd_sms, kt )   ! save trends 
    112116          END DO 
     117          DEALLOCATE( ztrpis ) 
    113118      END IF 
    114119 
     
    122127         ! 
    123128      ENDIF 
     129 
     130      IF( wrk_not_released(3,1) ) CALL ctl_stop('trc_sms_pisces : failed to release workspace array.')  
    124131 
    125132   END SUBROUTINE trc_sms_pisces 
Note: See TracChangeset for help on using the changeset viewer.