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/DIA/diaptr.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/DIA/diaptr.F90

    r7646 r7698  
    6666   !!---------------------------------------------------------------------- 
    6767   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
    68    !! $Id$  
     68   !! $Id$ 
    6969   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
    7070   !!---------------------------------------------------------------------- 
     
    384384      !! ** Purpose :   Initialization, namelist read 
    385385      !!---------------------------------------------------------------------- 
    386       INTEGER ::  jn           ! local integers 
     386      INTEGER ::  jn, jj, ji   ! local integers 
    387387      INTEGER ::  inum, ierr   ! local integers 
    388388      INTEGER ::  ios          ! Local integer output status for namelist read 
     
    434434            CALL iom_get( inum, jpdom_data, 'indmsk', btmsk(:,:,4) )   ! Indian   basin 
    435435            CALL iom_close( inum ) 
    436             btmsk(:,:,5) = MAX ( btmsk(:,:,3), btmsk(:,:,4) )          ! Indo-Pacific basin 
    437             WHERE( gphit(:,:) < -30._wp)   ;   btm30(:,:) = 0._wp      ! mask out Southern Ocean 
    438             ELSE WHERE                     ;   btm30(:,:) = ssmask(:,:) 
    439             END WHERE 
     436!$OMP PARALLEL DO schedule(static) private(jj,ji) 
     437            DO jj = 1, jpj 
     438               DO ji = 1, jpi 
     439                  btmsk(ji,jj,5) = MAX ( btmsk(ji,jj,3), btmsk(ji,jj,4) )          ! Indo-Pacific basin 
     440                  IF( gphit(ji,jj) < -30._wp) THEN   ;   btm30(ji,jj) = 0._wp      ! mask out Southern Ocean 
     441                  ELSE                               ;   btm30(ji,jj) = ssmask(ji,jj) 
     442                  END IF 
     443               END DO 
     444            END DO 
    440445         ENDIF 
    441446    
    442          btmsk(:,:,1) = tmask_i(:,:)                                   ! global ocean 
     447!$OMP PARALLEL 
     448!$OMP DO schedule(static) private(jj,ji) 
     449         DO jj = 1, jpj 
     450           DO ji = 1, jpi 
     451              btmsk(ji,jj,1) = tmask_i(ji,jj)                          ! global ocean 
     452           END DO 
     453         END DO 
    443454       
    444455         DO jn = 1, nptr 
    445             btmsk(:,:,jn) = btmsk(:,:,jn) * tmask_i(:,:)               ! interior domain only 
     456!$OMP DO schedule(static) private(jj,ji) 
     457            DO jj = 1, jpj 
     458               DO ji = 1, jpi 
     459                  btmsk(ji,jj,jn) = btmsk(ji,jj,jn) * tmask_i(ji,jj)               ! interior domain only 
     460               END DO 
     461            END DO 
    446462         END DO 
    447463 
    448464         ! Initialise arrays to zero because diatpr is called before they are first calculated 
    449465         ! Note that this means diagnostics will not be exactly correct when model run is restarted. 
    450          htr_adv(:,:) = 0._wp  ;  str_adv(:,:) =  0._wp  
    451          htr_ldf(:,:) = 0._wp  ;  str_ldf(:,:) =  0._wp  
    452          htr_eiv(:,:) = 0._wp  ;  str_eiv(:,:) =  0._wp  
    453          htr_ove(:,:) = 0._wp  ;   str_ove(:,:) =  0._wp 
    454          htr_btr(:,:) = 0._wp  ;   str_btr(:,:) =  0._wp 
    455          ! 
     466!$OMP DO schedule(static) private(jj,ji) 
     467         DO jj = 1, jpj 
     468            DO ji = 1, jpi 
     469               htr_adv(ji,jj) = 0._wp  ;  str_adv(ji,jj) =  0._wp  
     470               htr_ldf(ji,jj) = 0._wp  ;  str_ldf(ji,jj) =  0._wp  
     471               htr_eiv(ji,jj) = 0._wp  ;  str_eiv(ji,jj) =  0._wp  
     472               htr_ove(ji,jj) = 0._wp  ;   str_ove(ji,jj) =  0._wp 
     473               htr_btr(ji,jj) = 0._wp  ;   str_btr(ji,jj) =  0._wp 
     474             END DO 
     475         END DO 
     476              ! 
     477!$OMP END PARALLEL 
    456478      ENDIF  
    457479      !  
Note: See TracChangeset for help on using the changeset viewer.