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/USR/usrdef_zgr.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/USR/usrdef_zgr.F90

    r7200 r7698  
    199199      ! 
    200200      REAL(wp), DIMENSION(jpi,jpj) ::   z2d   ! 2D local workspace 
     201 
     202      INTEGER  ::   ji, jj 
    201203      !!---------------------------------------------------------------------- 
    202204      ! 
     
    206208      IF(lwp) WRITE(numout,*) '       GYRE case : closed flat box ocean without ocean cavities' 
    207209      ! 
    208       z2d(:,:) = REAL( jpkm1 , wp )          ! flat bottom 
     210!$OMP PARALLEL DO schedule(static) private(jj, ji) 
     211      DO jj = 1, jpj 
     212         DO ji = 1, jpi 
     213            z2d(ji,jj) = REAL( jpkm1 , wp )          ! flat bottom 
     214         END DO 
     215      END DO 
    209216      ! 
    210217      CALL lbc_lnk( z2d, 'T', 1. )           ! set surrounding land to zero (here jperio=0 ==>> closed) 
    211218      ! 
    212       k_bot(:,:) = INT( z2d(:,:) )           ! =jpkm1 over the ocean point, =0 elsewhere 
    213       ! 
    214       k_top(:,:) = MIN( 1 , k_bot(:,:) )     ! = 1    over the ocean point, =0 elsewhere 
     219!$OMP PARALLEL DO schedule(static) private(jj, ji) 
     220      DO jj = 1, jpj 
     221         DO ji = 1, jpi 
     222            k_bot(ji,jj) = INT( z2d(ji,jj) )           ! =jpkm1 over the ocean point, =0 elsewhere 
     223            ! 
     224            k_top(ji,jj) = MIN( 1 , k_bot(ji,jj) )     ! = 1    over the ocean point, =0 elsewhere 
     225         END DO 
     226      END DO 
    215227      ! 
    216228   END SUBROUTINE zgr_msk_top_bot 
     
    234246      REAL(wp), DIMENSION(:,:,:), INTENT(  out) ::   pe3w , pe3uw, pe3vw         !    -       -      - 
    235247      ! 
    236       INTEGER  ::   jk 
     248      INTEGER  ::   ji, jj, jk 
    237249      !!---------------------------------------------------------------------- 
    238250      ! 
    239251      IF( nn_timing == 1 )  CALL timing_start('zgr_zco') 
    240252      ! 
     253!$OMP PARALLEL DO schedule(static) private(jk, jj, ji) 
    241254      DO jk = 1, jpk 
    242          pdept(:,:,jk) = pdept_1d(jk) 
    243          pdepw(:,:,jk) = pdepw_1d(jk) 
    244          pe3t (:,:,jk) = pe3t_1d (jk) 
    245          pe3u (:,:,jk) = pe3t_1d (jk) 
    246          pe3v (:,:,jk) = pe3t_1d (jk) 
    247          pe3f (:,:,jk) = pe3t_1d (jk) 
    248          pe3w (:,:,jk) = pe3w_1d (jk) 
    249          pe3uw(:,:,jk) = pe3w_1d (jk) 
    250          pe3vw(:,:,jk) = pe3w_1d (jk) 
     255         DO jj = 1, jpj 
     256            DO ji = 1, jpi 
     257               pdept(ji,jj,jk) = pdept_1d(jk) 
     258               pdepw(ji,jj,jk) = pdepw_1d(jk) 
     259               pe3t (ji,jj,jk) = pe3t_1d (jk) 
     260               pe3u (ji,jj,jk) = pe3t_1d (jk) 
     261               pe3v (ji,jj,jk) = pe3t_1d (jk) 
     262               pe3f (ji,jj,jk) = pe3t_1d (jk) 
     263               pe3w (ji,jj,jk) = pe3w_1d (jk) 
     264               pe3uw(ji,jj,jk) = pe3w_1d (jk) 
     265               pe3vw(ji,jj,jk) = pe3w_1d (jk) 
     266            END DO 
     267         END DO 
    251268      END DO 
    252269      ! 
Note: See TracChangeset for help on using the changeset viewer.