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/traldf_iso.F90

    r7544 r7771  
    3232   USE phycst          ! physical constants 
    3333   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    34    USE wrk_nemo        ! Memory Allocation 
    3534   USE timing          ! Timing 
    3635 
     
    110109      REAL(wp) ::  zmskv, zabe2, zcof2, zcoef4       !   -      - 
    111110      REAL(wp) ::  zcoef0, zbtr                      !   -      - 
    112       REAL(wp), POINTER, DIMENSION(:,:  ) ::  z2d 
    113       REAL(wp), POINTER, DIMENSION(:,:,:) ::  zdkt, zdk1t, zdit, zdjt, ztfw  
     111      REAL(wp), ALLOCATABLE, DIMENSION(:,:  ) ::  z2d 
     112      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::  zdkt, zdk1t, zdit, zdjt, ztfw  
    114113      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), TARGET ::  ztrax, ztray, ztraz  
    115114      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), TARGET ::  ztrax_T, ztray_T, ztraz_T 
     
    118117      IF( nn_timing == 1 )  CALL timing_start('tra_ldf_iso') 
    119118      ! 
    120       CALL wrk_alloc( jpi, jpj,      z2d )  
    121       CALL wrk_alloc( jpi, jpj, jpk, zdit, zdjt, ztfw, zdkt, zdk1t)  
    122       ALLOCATE( ztrax(jpi,jpj,jpk), ztray(jpi,jpj,jpk), ztraz(jpi,jpj,jpk) )  
    123       IF( l_trdtra .and. cdtype == 'TRA' ) ALLOCATE( ztrax_T(jpi,jpj,jpk), ztray_T(jpi,jpj,jpk), ztraz_T(jpi,jpj,jpk) )  
     119      ALLOCATE( z2d(1:jpi, 1:jpj))  
     120      ALLOCATE( zdit(1:jpi, 1:jpj, 1:jpk)) 
     121      ALLOCATE( zdjt(1:jpi, 1:jpj, 1:jpk))  
     122      ALLOCATE( ztfw(1:jpi, 1:jpj, 1:jpk))  
     123      ALLOCATE( zdkt(1:jpi, 1:jpj, 1:jpk))  
     124      ALLOCATE( zdk1t(1:jpi, 1:jpj, 1:jpk))  
     125      ALLOCATE( ztrax(1:jpi,1:jpj,1:jpk))  
     126      ALLOCATE( ztray(1:jpi,1:jpj,1:jpk)) 
     127      ALLOCATE( ztraz(1:jpi,1:jpj,1:jpk) )  
     128      IF( l_trdtra .and. cdtype == 'TRA' ) THEN 
     129         ALLOCATE( ztrax_T(1:jpi,1:jpj,1:jpk))  
     130         ALLOCATE( ztray_T(1:jpi,1:jpj,1:jpk))  
     131         ALLOCATE( ztraz_T(1:jpi,1:jpj,1:jpk))  
     132      ENDIF 
    124133      ! 
    125134 
     
    347356      ENDIF 
    348357      ! 
    349       CALL wrk_dealloc( jpi, jpj, z2d )  
    350       CALL wrk_dealloc( jpi, jpj, jpk, zdit, zdjt, ztfw, zdkt, zdk1t )  
     358      DEALLOCATE( z2d )  
     359      DEALLOCATE( zdit)  
     360      DEALLOCATE( zdjt) 
     361      DEALLOCATE( ztfw)  
     362      DEALLOCATE( zdkt ) 
     363      DEALLOCATE( zdk1t )  
    351364      DEALLOCATE( ztrax, ztray, ztraz )  
    352365      IF( l_trdtra  .and. cdtype == 'TRA' ) DEALLOCATE( ztrax_T, ztray_T, ztraz_T )  
Note: See TracChangeset for help on using the changeset viewer.