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 9176 for branches/UKMO/dev_r5518_GO6_package_OMP/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90 – NEMO

Ignore:
Timestamp:
2018-01-04T13:30:03+01:00 (6 years ago)
Author:
andmirek
Message:

#2001: OMP directives

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_GO6_package_OMP/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90

    r6486 r9176  
    108108      REAL(wp) ::  zmskv, zabe2, zcof2, zcoef4   !   -      - 
    109109      REAL(wp) ::  zcoef0, zbtr, ztra            !   -      - 
    110       REAL(wp), POINTER, DIMENSION(:,:  ) ::  z2d 
     110      REAL(wp), DIMENSION(jpi,jpj  ) ::  z2d 
    111111      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zdkt, zdk1t, zdit, zdjt, ztfw  
    112112      !!---------------------------------------------------------------------- 
     
    114114      IF( nn_timing == 1 )  CALL timing_start('tra_ldf_iso') 
    115115      ! 
    116       CALL wrk_alloc( jpi, jpj,      z2d )  
     116!     CALL wrk_alloc( jpi, jpj,      z2d )  
    117117      CALL wrk_alloc( jpi, jpj, jpk, zdit, zdjt, ztfw, zdkt, zdk1t )  
    118118      ! 
     
    137137 
    138138         ! Horizontal tracer gradient  
     139!$OMP PARALLEL DO 
    139140         DO jk = 1, jpkm1 
    140141            DO jj = 1, jpjm1 
     
    145146            END DO 
    146147         END DO 
     148!$OMP END PARALLEL DO 
    147149 
    148150         ! partial cell correction 
    149151         IF( ln_zps ) THEN      ! partial steps correction at the last ocean level  
     152!$OMP PARALLEL DO 
    150153            DO jj = 1, jpjm1 
    151154               DO ji = 1, fs_jpim1   ! vector opt. 
     
    157160         ENDIF 
    158161         IF( ln_zps .AND. ln_isfcav ) THEN      ! partial steps correction at the first wet level beneath a cavity 
     162!$OMP PARALLEL DO 
    159163            DO jj = 1, jpjm1 
    160164               DO ji = 1, fs_jpim1   ! vector opt. 
     
    173177         !  
    174178         ! interior value  
     179!$OMP PARALLEL DO 
    175180         DO jk = 2, jpkm1                
    176181            DO jj = 1, jpj 
     
    182187            END DO 
    183188         END DO 
     189!$OMP END PARALLEL DO 
    184190         ! surface boundary condition: zdkt(jk=1)=zdkt(jk=2) 
    185191         zdk1t(:,:,1) = ( ptb(:,:,1,jn  ) - ptb(:,:,2,jn) ) * wmask(:,:,2) 
    186192         zdkt (:,:,1) = zdk1t(:,:,1) 
    187193         IF ( ln_isfcav ) THEN 
     194!$OMP PARALLEL DO PRIVATE(ikt) 
    188195            DO jj = 1, jpj 
    189196               DO ji = 1, jpi   ! vector opt. 
     
    193200               END DO 
    194201            END DO 
     202!$OMP END PARALLEL DO 
    195203         END IF 
    196204 
    197205         ! 2. Horizontal fluxes 
    198206         ! --------------------    
     207!$OMP PARALLEL DO PRIVATE(zabe1, zabe2, zmsku, zmskv, zcof1, zcof2, zbtr, ztra) 
    199208         DO jk = 1, jpkm1 
    200209            DO jj = 1 , jpjm1 
     
    233242         END DO                                        !   End of slab   
    234243         !                                             ! =============== 
     244!$OMP END PARALLEL DO 
    235245         ! 
    236246         ! "Poleward" diffusive heat or salt transports (T-S case only) 
     
    245255           IF( cdtype == 'TRA' .AND. jn == jp_tem  ) THEN 
    246256               z2d(:,:) = 0._wp  
     257!$OMP PARALLEL DO REDUCTION(+:z2d) 
    247258               DO jk = 1, jpkm1 
    248259                  DO jj = 2, jpjm1 
     
    252263                  END DO 
    253264               END DO 
     265 
    254266               z2d(:,:) = - rau0_rcp * z2d(:,:)     ! note sign is reversed to give down-gradient diffusive transports (#1043) 
     267 
    255268               CALL lbc_lnk( z2d, 'U', -1. ) 
    256269               CALL iom_put( "udiff_heattr", z2d )                  ! heat transport in i-direction 
    257270               ! 
    258271               z2d(:,:) = 0._wp  
     272!$OMP PARALLEL DO REDUCTION(+:z2d) 
    259273               DO jk = 1, jpkm1 
    260274                  DO jj = 2, jpjm1 
     
    264278                  END DO 
    265279               END DO 
     280 
    266281               z2d(:,:) = - rau0_rcp * z2d(:,:)     ! note sign is reversed to give down-gradient diffusive transports (#1043) 
    267282               CALL lbc_lnk( z2d, 'V', -1. ) 
     
    286301          
    287302         ! interior (2=<jk=<jpk-1) 
     303!$OMP PARALLEL DO PRIVATE(zcoef0, zmsku, zmskv, zcoef3, zcoef4 ) 
    288304         DO jk = 2, jpkm1 
    289305            DO jj = 2, jpjm1 
     
    306322            END DO 
    307323         END DO 
    308           
     324!$OMP END PARALLEL DO          
    309325          
    310326         ! I.5 Divergence of vertical fluxes added to the general tracer trend 
    311327         ! ------------------------------------------------------------------- 
     328!$OMP PARALLEL DO PRIVATE(zbtr, ztra) 
    312329         DO jk = 1, jpkm1 
    313330            DO jj = 2, jpjm1 
     
    319336            END DO 
    320337         END DO 
     338!$OMP END PARALLEL DO 
    321339         ! 
    322340      END DO 
    323341      ! 
    324       CALL wrk_dealloc( jpi, jpj, z2d )  
     342!     CALL wrk_dealloc( jpi, jpj, z2d )  
    325343      CALL wrk_dealloc( jpi, jpj, jpk, zdit, zdjt, ztfw, zdkt, zdk1t )  
    326344      ! 
Note: See TracChangeset for help on using the changeset viewer.