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 7698 for trunk/NEMOGCM/NEMO/OPA_SRC/DOM/depth_e3.F90 – NEMO

Ignore:
Timestamp:
2017-02-18T10:02:03+01:00 (7 years ago)
Author:
mocavero
Message:

update trunk with OpenMP parallelization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/DOM/depth_e3.F90

    r7646 r7698  
    150150      REAL(wp), DIMENSION(:,:,:), INTENT(  out) ::   pdept_3d, pdepw_3d   ! depth = SUM( e3 )     [m] 
    151151      ! 
    152       INTEGER  ::   jk           ! dummy loop indices 
     152      INTEGER  ::   jk, jj, ji           ! dummy loop indices 
    153153      !!----------------------------------------------------------------------       
    154154      ! 
    155       pdepw_3d(:,:,1) = 0.0_wp 
    156       pdept_3d(:,:,1) = 0.5_wp * pe3w_3d(:,:,1) 
     155!$OMP PARALLEL 
     156!$OMP DO schedule(static) private(jj,ji) 
     157      DO jj = 1, jpj 
     158         DO ji = 1, jpi 
     159            pdepw_3d(ji,jj,1) = 0.0_wp 
     160            pdept_3d(ji,jj,1) = 0.5_wp * pe3w_3d(ji,jj,1) 
     161         END DO 
     162      END DO 
    157163      DO jk = 2, jpk 
    158          pdepw_3d(:,:,jk) = pdepw_3d(:,:,jk-1) + pe3t_3d(:,:,jk-1)  
    159          pdept_3d(:,:,jk) = pdept_3d(:,:,jk-1) + pe3w_3d(:,:,jk  )  
     164!$OMP DO schedule(static) private(jj,ji) 
     165         DO jj = 1, jpj 
     166            DO ji = 1, jpi 
     167               pdepw_3d(ji,jj,jk) = pdepw_3d(ji,jj,jk-1) + pe3t_3d(ji,jj,jk-1)  
     168               pdept_3d(ji,jj,jk) = pdept_3d(ji,jj,jk-1) + pe3w_3d(ji,jj,jk  )  
     169            END DO 
     170         END DO 
    160171      END DO 
     172!$OMP END PARALLEL 
    161173      ! 
    162174   END SUBROUTINE e3_to_depth_3d 
Note: See TracChangeset for help on using the changeset viewer.