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/TRP/trcsbc.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/TRP/trcsbc.F90

    r2528 r2715  
    1616   !!   trc_sbc      : update the tracer trend at ocean surface 
    1717   !!---------------------------------------------------------------------- 
    18    !! * Modules used 
    19    USE oce_trc             ! ocean dynamics and active tracers variables 
    20    USE trc                 ! ocean  passive tracers variables 
    21    USE prtctl_trc          ! Print control for debbuging 
     18   USE oce_trc         ! ocean dynamics and active tracers variables 
     19   USE trc             ! ocean  passive tracers variables 
     20   USE prtctl_trc      ! Print control for debbuging 
    2221   USE trdmod_oce 
    2322   USE trdtra 
     
    2625   PRIVATE 
    2726 
    28    !! * Routine accessibility 
    29    PUBLIC trc_sbc              ! routine called by step.F90 
     27   PUBLIC   trc_sbc   ! routine called by step.F90 
    3028 
    3129   !! * Substitutions 
     
    3432   !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
    3533   !! $Id$  
    36    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
     34   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
    3735   !!---------------------------------------------------------------------- 
    38  
    3936CONTAINS 
    4037 
     
    6057      !! 
    6158      !!---------------------------------------------------------------------- 
    62       !! * Arguments 
     59      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released 
     60      USE wrk_nemo, ONLY:   zemps  => wrk_2d_1 
     61      USE wrk_nemo, ONLY:   ztrtrd => wrk_3d_1 
     62      ! 
    6363      INTEGER, INTENT( in ) ::   kt          ! ocean time-step index 
    64  
    65       !! * Local declarations 
     64      ! 
    6665      INTEGER  ::   ji, jj, jn           ! dummy loop indices 
    6766      REAL(wp) ::   zsrau, zse3t   ! temporary scalars 
    68       REAL(wp), DIMENSION(jpi,jpj) ::   zemps  ! surface freshwater flux 
    69       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrtrd 
    7067      CHARACTER (len=22) :: charout 
    7168      !!---------------------------------------------------------------------- 
     69 
     70      IF( wrk_in_use(2, 1) .OR.  wrk_in_use(3, 1) ) THEN 
     71         CALL ctl_stop('trc_sbc: requested workspace array unavailable.')   ;   RETURN 
     72      END IF 
    7273 
    7374      IF( kt == nit000 ) THEN 
     
    7778      ENDIF 
    7879 
    79  
    80       IF( l_trdtrc ) ALLOCATE( ztrtrd(jpi,jpj,jpk) ) 
    8180 
    8281      IF( lk_offline ) THEN          ! emps in dynamical files contains emps - rnf 
     
    113112      END DO                                                     ! tracer loop 
    114113      !                                                          ! =========== 
    115       IF( l_trdtrc ) DEALLOCATE( ztrtrd ) 
    116  
    117114      IF( ln_ctl )   THEN 
    118115         WRITE(charout, FMT="('sbc ')") ;  CALL prt_ctl_trc_info(charout) 
    119116                                           CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
    120117      ENDIF 
     118 
     119      IF( wrk_not_released(2, 1) .OR. wrk_not_released(3, 1) )   & 
     120      &       CALL ctl_stop('trc_sbc: failed to release workspace array.') 
    121121 
    122122   END SUBROUTINE trc_sbc 
Note: See TracChangeset for help on using the changeset viewer.