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 7771 for branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90 – NEMO

Ignore:
Timestamp:
2017-03-09T11:38:31+01:00 (7 years ago)
Author:
frrh
Message:

Apply optimisations to various areas of code replacing the use of
allocated pointers with straightforward direct ALLOCATE and DEALLOCATE
operations.

These optimisations largely have an impact in models featuring MEDUSA,
i.e. those with significant numbers of tracers, although they are
expected to have a small impact in all configurations.

Code developed and tested in NEMO branch branches/UKMO/dev_r5518_optim_GO6_alloc
Tested in stand-alone GO6-GSI8, GO6-GSI8-MEDUSA and UKESM coupled models.
NEMO ticket #1821 documents this change further.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90

    r6486 r7771  
    107107      INTEGER, INTENT( in ) ::   kt   ! ocean time-step 
    108108      ! 
    109       REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdt, ztrds 
     109      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::  ztrdt, ztrds 
    110110      !!---------------------------------------------------------------------- 
    111111      ! 
     
    113113      ! 
    114114      IF( l_trdtra )   THEN                         !* Save ta and sa trends 
    115          CALL wrk_alloc( jpi, jpj, jpk, ztrdt, ztrds ) 
     115         ALLOCATE( ztrdt (1:jpi, 1:jpj, 1:jpk)) 
     116         ALLOCATE( ztrds (1:jpi, 1:jpj, 1:jpk)) 
    116117         ztrdt(:,:,:) = tsa(:,:,:,jp_tem) 
    117118         ztrds(:,:,:) = tsa(:,:,:,jp_sal) 
     
    151152         CALL trd_tra( kt, 'TRA', jp_tem, jptra_bbl, ztrdt ) 
    152153         CALL trd_tra( kt, 'TRA', jp_sal, jptra_bbl, ztrds ) 
    153          CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds ) 
     154         DEALLOCATE( ztrdt, ztrds ) 
    154155      ENDIF 
    155156      ! 
     
    187188      INTEGER  ::   ik           ! local integers 
    188189      REAL(wp) ::   zbtr         ! local scalars 
    189       REAL(wp), POINTER, DIMENSION(:,:) :: zptb 
     190      REAL(wp), ALLOCATABLE , DIMENSION(:,:) :: zptb 
    190191      !!---------------------------------------------------------------------- 
    191192      ! 
    192193      IF( nn_timing == 1 )  CALL timing_start('tra_bbl_dif') 
    193194      ! 
    194       CALL wrk_alloc( jpi, jpj, zptb ) 
     195      ALLOCATE(zptb(1:jpi, 1:jpj)) 
    195196      ! 
    196197      DO jn = 1, kjpt                                     ! tracer loop 
     
    217218      END DO                                                ! end tracer 
    218219      !                                                     ! =========== 
    219       CALL wrk_dealloc( jpi, jpj, zptb ) 
     220      DEALLOCATE( zptb ) 
    220221      ! 
    221222      IF( nn_timing == 1 )  CALL timing_stop('tra_bbl_dif') 
Note: See TracChangeset for help on using the changeset viewer.