Ignore:
Timestamp:
2017-03-09T11:38:31+01:00 (4 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/traadv.F90

    r7061 r7771  
    8080      ! 
    8181      INTEGER ::   jk   ! dummy loop index 
    82       REAL(wp), POINTER, DIMENSION(:,:,:) :: zun, zvn, zwn 
    83       REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdt, ztrds   ! 3D workspace 
     82      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: zun, zvn, zwn 
     83      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ztrdt, ztrds   ! 3D workspace 
    8484      !!---------------------------------------------------------------------- 
    8585      ! 
    8686      IF( nn_timing == 1 )  CALL timing_start('tra_adv') 
    8787      ! 
    88       CALL wrk_alloc( jpi, jpj, jpk, zun, zvn, zwn ) 
     88      ALLOCATE(zun(1:jpi, 1:jpj, 1:jpk)) 
     89      ALLOCATE(zvn(1:jpi, 1:jpj, 1:jpk)) 
     90      ALLOCATE(zwn(1:jpi, 1:jpj, 1:jpk)) 
    8991      !                                          ! set time step 
    9092      IF( neuler == 0 .AND. kt == nit000 ) THEN     ! at nit000 
     
    124126      ! 
    125127      IF( l_trdtra )   THEN                    !* Save ta and sa trends 
    126          CALL wrk_alloc( jpi, jpj, jpk, ztrdt, ztrds ) 
     128         ALLOCATE(ztrdt( 1:jpi, 1:jpj, 1:jpk) ) 
     129         ALLOCATE(ztrds( 1:jpi, 1:jpj, 1:jpk) ) 
    127130         ztrdt(:,:,:) = tsa(:,:,:,jp_tem) 
    128131         ztrds(:,:,:) = tsa(:,:,:,jp_sal) 
     
    166169         CALL trd_tra( kt, 'TRA', jp_tem, jptra_totad, ztrdt ) 
    167170         CALL trd_tra( kt, 'TRA', jp_sal, jptra_totad, ztrds ) 
    168          CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds ) 
     171         DEALLOCATE (ztrdt) 
     172         DEALLOCATE (ztrds) 
    169173      ENDIF 
    170174      !                                              ! print mean trends (used for debugging) 
     
    174178      IF( nn_timing == 1 )  CALL timing_stop( 'tra_adv' ) 
    175179      ! 
    176       CALL wrk_dealloc( jpi, jpj, jpk, zun, zvn, zwn ) 
     180      DEALLOCATE(zun) 
     181      DEALLOCATE(zvn) 
     182      DEALLOCATE(zwn) 
    177183      !                                           
    178184   END SUBROUTINE tra_adv 
Note: See TracChangeset for help on using the changeset viewer.