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 2636 for branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/TRP/trdmld_trc.F90 – NEMO

Ignore:
Timestamp:
2011-03-01T20:04:06+01:00 (13 years ago)
Author:
gm
Message:

dynamic mem: #785 ; move ctl_stop & warn in lib_mpp to avoid a circular dependency + ctl_stop improvment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/TOP_SRC/TRP/trdmld_trc.F90

    r2633 r2636  
    2323   USE zdfddm  , ONLY : avs  !: salinity vertical diffusivity coeff. at w-point 
    2424# endif 
    25    USE trcnam_trp      ! passive tracers transport namelist variables 
     25   USE trcnam_trp        ! passive tracers transport namelist variables 
    2626   USE trdmod_trc_oce    ! definition of main arrays used for trends computations 
    2727   USE in_out_manager    ! I/O manager 
     
    3030   USE ioipsl            ! NetCDF library 
    3131   USE lbclnk            ! ocean lateral boundary conditions (or mpp link) 
     32   USE lib_mpp           ! MPP library 
    3233   USE trdmld_trc_rst    ! restart for diagnosing the ML trends 
    3334   USE prtctl            ! print control 
     
    4748   CHARACTER (LEN=40) ::  clhstnam                                ! name of the trends NetCDF file 
    4849   INTEGER ::   nmoymltrd 
    49    INTEGER ::   ndextrd1(jpi*jpj) 
     50   INTEGER, ALLOCATABLE, SAVE, DIMENSION(:) ::   ndextrd1 
    5051   INTEGER, DIMENSION(jptra) ::   nidtrd, nh_t 
    5152   INTEGER ::   ndimtrd1                         
     
    8788               ztmltrdbio2(jpi,jpj,jpdiabio)     , & 
    8889#endif 
    89                Stat=trd_mld_trc_alloc) 
    90  
    91       IF(trd_mld_trc_alloc/=0)THEN 
    92          CALL ctl_warn('trd_mld_trc_alloc : failed to allocate arrays.') 
    93       END IF 
    94  
     90         &     ndextrd1(jpi*jpj)                 ,  STAT=trd_mld_trc_alloc) 
     91         ! 
     92      IF( lk_mpp                )   CALL mpp_sum ( trd_mld_trc_alloc ) 
     93      IF( trd_mld_trc_alloc /=0 )   CALL ctl_warn('trd_mld_trc_alloc : failed to allocate arrays.') 
    9594   END FUNCTION trd_mld_trc_alloc 
    9695 
     
    125124      !!---------------------------------------------------------------------- 
    126125 
    127       IF(wrk_in_use(2, 1))THEN 
    128          CALL ctl_stop('trd_mld_trc_zint : requested workspace array unavailable.') 
    129          RETURN 
     126      IF( wrk_in_use(2, 1) ) THEN 
     127         CALL ctl_stop('trd_mld_trc_zint : requested workspace array unavailable')   ;   RETURN 
    130128      END IF 
    131129 
     
    213211      END SELECT 
    214212 
    215       IF(wrk_not_released(2, 1))THEN 
    216          CALL ctl_stop('trd_mld_trc_zint : failed to release workspace array.') 
    217       END IF 
    218  
     213      IF( wrk_not_released(2, 1) )   CALL ctl_stop('trd_mld_trc_zint : failed to release workspace array.') 
     214      ! 
    219215    END SUBROUTINE trd_mld_trc_zint 
    220      
     216 
     217 
    221218    SUBROUTINE trd_mld_bio_zint( ptrc_trdmld, ktrd ) 
    222219      !!---------------------------------------------------------------------- 
     
    387384      !!       - See NEMO documentation (in preparation) 
    388385      !!---------------------------------------------------------------------- 
    389       USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released 
    390       USE wrk_nemo, wrk_3d_1, wrk_3d_2, wrk_3d_3, wrk_3d_4, & 
    391                     wrk_3d_5, wrk_3d_6, wrk_3d_7, wrk_3d_8, & 
    392                     wrk_3d_9 
     386      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released 
     387      USE wrk_nemo, ONLY:   wrk_3d_1, wrk_3d_2, wrk_3d_3, wrk_3d_4 
     388      USE wrk_nemo, ONLY:   wrk_3d_5, wrk_3d_6, wrk_3d_7, wrk_3d_8, wrk_3d_9 
     389      ! 
    393390      INTEGER, INTENT( in ) ::   kt                               ! ocean time-step index 
    394391      INTEGER ::   ji, jj, jk, jl, ik, it, itmod, jn 
     
    414411      !!---------------------------------------------------------------------- 
    415412 
    416       IF(wrk_in_use(3, 1,2,3,4,5,6,7,8,9))THEN 
    417          CALL ctl_stop('trd_mld_trc : requested workspace arrays unavailable.') 
    418          RETURN 
    419       END IF 
     413      IF( wrk_in_use(3, 1,2,3,4,5,6,7,8,9) ) THEN 
     414         CALL ctl_stop('trd_mld_trc : requested workspace arrays unavailable')   ;   RETURN 
     415      ENDIF 
    420416      ! Set-up pointers into sub-arrays of workspaces 
    421417      ztmltot   => wrk_3d_1(:,:,1:jptra) 
Note: See TracChangeset for help on using the changeset viewer.