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 7037 for branches/2016/dev_r6519_HPC_4/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_fct.F90 – NEMO

Ignore:
Timestamp:
2016-10-18T15:32:04+02:00 (8 years ago)
Author:
mocavero
Message:

ORCA2_LIM_PISCES hybrid version update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_r6519_HPC_4/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_fct.F90

    r6748 r7037  
    9696      IF( ( cdtype == 'TRA' .AND. l_trdtra ) .OR. ( cdtype == 'TRC' .AND. l_trdtrc ) )   l_trd = .TRUE. 
    9797      ! 
    98       IF( l_trd )  THEN 
    99          CALL wrk_alloc( jpi, jpj, jpk, ztrdx, ztrdy, ztrdz ) 
    100 !$OMP PARALLEL WORKSHARE 
    101          ztrdx(:,:,:) = 0._wp   ;    ztrdy(:,:,:) = 0._wp   ;   ztrdz(:,:,:) = 0._wp 
    102 !$OMP END PARALLEL WORKSHARE 
    103       ENDIF 
    104       ! 
    10598      !                          ! surface & bottom value : flux set to zero one for all 
    10699!$OMP PARALLEL WORKSHARE 
    107100      zwz(:,:, 1 ) = 0._wp             
    108       zwx(:,:,jpk) = 0._wp   ;   zwy(:,:,jpk) = 0._wp    ;    zwz(:,:,jpk) = 0._wp 
    109       ! 
     101      zwx(:,:,jpk) = 0._wp 
     102      zwy(:,:,jpk) = 0._wp     
     103      zwz(:,:,jpk) = 0._wp 
    110104      zwi(:,:,:) = 0._wp         
    111105!$OMP END PARALLEL WORKSHARE 
     
    115109         !        !==  upstream advection with initial mass fluxes & intermediate update  ==! 
    116110         !                    !* upstream tracer flux in the i and j direction  
    117 !$OMP PARALLEL DO schedule(static) private(jk, jj, ji, zfp_vj, zfm_vj, zfp_ui,zfm_ui) 
     111!$OMP PARALLEL 
     112!$OMP DO schedule(static) private(jk, jj, ji, zfp_vj, zfm_vj, zfp_ui,zfm_ui) 
    118113         DO jk = 1, jpkm1 
    119114            DO jj = 1, jpjm1 
     
    129124            END DO 
    130125         END DO 
     126!$OMP END DO NOWAIT 
    131127         !                    !* upstream tracer flux in the k direction *! 
    132 !$OMP PARALLEL DO schedule(static) private(jk, jj, ji, zfp_wk, zfm_wk) 
     128!$OMP DO schedule(static) private(jk, jj, ji, zfp_wk, zfm_wk) 
    133129         DO jk = 2, jpkm1        ! Interior value ( multiplied by wmask) 
    134130            DO jj = 1, jpj 
     
    140136            END DO 
    141137         END DO 
     138!$OMP END DO NOWAIT 
     139!$OMP END PARALLEL 
    142140         IF( ln_linssh ) THEN    ! top ocean value (only in linear free surface as zwz has been w-masked) 
    143141            IF( ln_isfcav ) THEN             ! top of the ice-shelf cavities and at the ocean surface 
     142!$OMP PARALLEL DO schedule(static) private(jj, ji) 
    144143               DO jj = 1, jpj 
    145144                  DO ji = 1, jpi 
     
    148147               END DO    
    149148            ELSE                             ! no cavities: only at the ocean surface 
     149!$OMP PARALLEL WORKSHARE 
    150150               zwz(:,:,1) = pwn(:,:,1) * ptb(:,:,1,jn) 
     151!$OMP END PARALLEL WORKSHARE 
    151152            ENDIF 
    152153         ENDIF 
     
    170171         !                 
    171172         IF( l_trd )  THEN             ! trend diagnostics (contribution of upstream fluxes) 
    172 !$OMP PARALLEL WORKSHARE 
    173             ztrdx(:,:,:) = zwx(:,:,:)   ;    ztrdy(:,:,:) = zwy(:,:,:)  ;   ztrdz(:,:,:) = zwz(:,:,:) 
    174 !$OMP END PARALLEL WORKSHARE 
     173         CALL wrk_alloc( jpi, jpj, jpk, ztrdx, ztrdy, ztrdz ) 
     174!$OMP PARALLEL 
     175!$OMP WORKSHARE 
     176         ztrdx(:,:,:) = 0._wp 
     177         ztrdy(:,:,:) = 0._wp 
     178         ztrdz(:,:,:) = 0._wp 
     179!$OMP END WORKSHARE 
     180!$OMP WORKSHARE 
     181            ztrdx(:,:,:) = zwx(:,:,:)    
     182            ztrdy(:,:,:) = zwy(:,:,:) 
     183            ztrdz(:,:,:) = zwz(:,:,:) 
     184!$OMP END WORKSHARE 
     185!$OMP END PARALLEL 
    175186         END IF 
    176187         !                             ! "Poleward" heat and salt transports (contribution of upstream fluxes) 
     
    196207            ! 
    197208         CASE(  4  )                   !- 4th order centered 
    198 !$OMP PARALLEL WORKSHARE 
     209!$OMP PARALLEL  
     210!$OMP WORKSHARE 
    199211            zltu(:,:,jpk) = 0._wp            ! Bottom value : flux set to zero 
    200212            zltv(:,:,jpk) = 0._wp 
    201 !$OMP END PARALLEL WORKSHARE 
    202 !$OMP PARALLEL DO schedule(static) private(jk, jj, ji) 
     213!$OMP END WORKSHARE 
     214!$OMP DO schedule(static) private(jk, jj, ji) 
    203215            DO jk = 1, jpkm1                 ! Laplacian 
    204216               DO jj = 1, jpjm1                    ! 1st derivative (gradient) 
     
    215227               END DO 
    216228            END DO 
     229!$OMP END DO NOWAIT 
     230!$OMP END PARALLEL 
    217231            CALL lbc_lnk( zltu, 'T', 1. )   ;    CALL lbc_lnk( zltv, 'T', 1. )   ! Lateral boundary cond. (unchanged sgn) 
    218232            ! 
     
    231245            ! 
    232246         CASE(  41 )                   !- 4th order centered       ==>>   !!gm coding attempt   need to be tested 
    233 !$OMP PARALLEL WORKSHARE 
     247!$OMP PARALLEL 
     248!$OMP WORKSHARE 
    234249            ztu(:,:,jpk) = 0._wp             ! Bottom value : flux set to zero 
    235250            ztv(:,:,jpk) = 0._wp 
    236 !$OMP END PARALLEL WORKSHARE 
    237 !$OMP PARALLEL DO schedule(static) private(jk, jj, ji) 
     251!$OMP END WORKSHARE 
     252!$OMP DO schedule(static) private(jk, jj, ji) 
    238253            DO jk = 1, jpkm1                 ! 1st derivative (gradient) 
    239254               DO jj = 1, jpjm1 
     
    244259               END DO 
    245260            END DO 
     261!$OMP END DO NOWAIT 
     262!$OMP END PARALLEL 
    246263            CALL lbc_lnk( ztu, 'U', -1. )   ;    CALL lbc_lnk( ztv, 'V', -1. )   ! Lateral boundary cond. (unchanged sgn) 
    247264            ! 
     
    290307         END SELECT 
    291308         IF( ln_linssh ) THEN    ! top ocean value: high order = upstream  ==>>  zwz=0 
     309!$OMP PARALLEL WORKSHARE 
    292310            zwz(:,:,1) = 0._wp   ! only ocean surface as interior zwz values have been w-masked 
     311!$OMP END PARALLEL WORKSHARE 
    293312         ENDIF 
    294313         ! 
     
    649668      zbig  = 1.e+40_wp 
    650669      zrtrn = 1.e-15_wp 
    651 !$OMP PARALLEL WORKSHARE 
    652       zbetup(:,:,:) = 0._wp   ;   zbetdo(:,:,:) = 0._wp 
    653 !$OMP END PARALLEL WORKSHARE 
    654670 
    655671      ! Search local extrema 
     
    661677         &        paft * tmask + zbig * ( 1._wp - tmask )  ) 
    662678 
    663 !$OMP PARALLEL DO schedule(static) private(jk, jj, ji, ikm1, zup, zdo, zpos, zneg, zbt) 
     679!$OMP PARALLEL 
     680!$OMP WORKSHARE 
     681      zbetup(:,:,:) = 0._wp    
     682      zbetdo(:,:,:) = 0._wp 
     683!$OMP END WORKSHARE 
     684!$OMP DO schedule(static) private(jk, jj, ji, ikm1, zup, zdo, zpos, zneg, zbt) 
    664685      DO jk = 1, jpkm1 
    665686         ikm1 = MAX(jk-1,1) 
     
    696717         END DO 
    697718      END DO 
     719!$OMP END PARALLEL 
    698720      CALL lbc_lnk( zbetup, 'T', 1. )   ;   CALL lbc_lnk( zbetdo, 'T', 1. )   ! lateral boundary cond. (unchanged sign) 
    699721 
Note: See TracChangeset for help on using the changeset viewer.