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 7753 for trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90 – NEMO

Ignore:
Timestamp:
2017-03-03T12:46:59+01:00 (7 years ago)
Author:
mocavero
Message:

Reverting trunk to remove OpenMP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90

    r7698 r7753  
    8888      CALL wrk_alloc( jpi,jpj,   z2d0, z2d1 ) 
    8989      ! 
    90 !$OMP PARALLEL DO schedule(static) private(jk,jj,ji) 
    91       DO jk = 1, jpk 
    92          DO jj = 1, jpj 
    93             DO ji = 1, jpi 
    94                tsn(ji,jj,jk,1) = tsn(ji,jj,jk,1) * tmask(ji,jj,jk) ; tsb(ji,jj,jk,1) = tsb(ji,jj,jk,1) * tmask(ji,jj,jk)  
    95                tsn(ji,jj,jk,2) = tsn(ji,jj,jk,2) * tmask(ji,jj,jk) ; tsb(ji,jj,jk,2) = tsb(ji,jj,jk,2) * tmask(ji,jj,jk) 
    96             END DO 
    97          END DO 
    98       END DO 
     90      tsn(:,:,:,1) = tsn(:,:,:,1) * tmask(:,:,:) ; tsb(:,:,:,1) = tsb(:,:,:,1) * tmask(:,:,:) ; 
     91      tsn(:,:,:,2) = tsn(:,:,:,2) * tmask(:,:,:) ; tsb(:,:,:,2) = tsb(:,:,:,2) * tmask(:,:,:) ; 
    9992      ! ------------------------- ! 
    10093      ! 1 - Trends due to forcing ! 
     
    115108      IF( ln_linssh ) THEN 
    116109         IF( ln_isfcav ) THEN 
    117 !$OMP PARALLEL DO schedule(static) private(jj,ji) 
    118110            DO ji=1,jpi 
    119111               DO jj=1,jpj 
     
    123115            END DO 
    124116         ELSE 
    125 !$OMP PARALLEL DO schedule(static) private(jj,ji) 
    126             DO ji=1,jpi 
    127                DO jj=1,jpj 
    128                   z2d0(ji,jj) = surf(ji,jj) * wn(ji,jj,1) * tsb(ji,jj,1,jp_tem) 
    129                   z2d1(ji,jj) = surf(ji,jj) * wn(ji,jj,1) * tsb(ji,jj,1,jp_sal) 
    130                END DO 
    131             END DO 
     117            z2d0(:,:) = surf(:,:) * wn(:,:,1) * tsb(:,:,1,jp_tem) 
     118            z2d1(:,:) = surf(:,:) * wn(:,:,1) * tsb(:,:,1,jp_sal) 
    132119         END IF 
    133120         z_wn_trd_t = - glob_sum( z2d0 )  
     
    158145      IF( ln_linssh ) THEN 
    159146         IF( ln_isfcav ) THEN 
    160 !$OMP PARALLEL DO schedule(static) private(jj,ji) 
    161147            DO ji = 1, jpi 
    162148               DO jj = 1, jpj 
     
    166152            END DO 
    167153         ELSE 
    168 !$OMP PARALLEL DO schedule(static) private(jj,ji) 
    169             DO jj = 1, jpj 
    170                DO ji = 1, jpi 
    171                   z2d0(ji,jj) = surf(ji,jj) * ( tsn(ji,jj,1,jp_tem) * sshn(ji,jj) - ssh_hc_loc_ini(ji,jj) )  
    172                   z2d1(ji,jj) = surf(ji,jj) * ( tsn(ji,jj,1,jp_sal) * sshn(ji,jj) - ssh_sc_loc_ini(ji,jj) )  
    173                END DO 
    174             END DO 
     154            z2d0(:,:) = surf(:,:) * ( tsn(:,:,1,jp_tem) * sshn(:,:) - ssh_hc_loc_ini(:,:) )  
     155            z2d1(:,:) = surf(:,:) * ( tsn(:,:,1,jp_sal) * sshn(:,:) - ssh_sc_loc_ini(:,:) )  
    175156         END IF 
    176157         z_ssh_hc = glob_sum_full( z2d0 )  
     
    294275          IF(lwp) WRITE(numout,*) ' dia_hsb at initial state ' 
    295276          IF(lwp) WRITE(numout,*) '~~~~~~~' 
    296 !$OMP PARALLEL 
    297 !$OMP DO schedule(static) private(jj,ji) 
    298           DO jj = 1, jpj 
    299              DO ji = 1, jpi 
    300                 surf_ini(ji,jj) = e1e2t(ji,jj) * tmask_i(ji,jj)         ! initial ocean surface 
    301                 ssh_ini(ji,jj) = sshn(ji,jj)                          ! initial ssh 
    302              END DO 
     277          surf_ini(:,:) = e1e2t(:,:) * tmask_i(:,:)         ! initial ocean surface 
     278          ssh_ini(:,:) = sshn(:,:)                          ! initial ssh 
     279          DO jk = 1, jpk 
     280             ! if ice sheet/oceqn coupling, need to mask ini variables here (mask could change at the next NEMO instance). 
     281             e3t_ini   (:,:,jk) = e3t_n(:,:,jk)                      * tmask(:,:,jk)  ! initial vertical scale factors 
     282             hc_loc_ini(:,:,jk) = tsn(:,:,jk,jp_tem) * e3t_n(:,:,jk) * tmask(:,:,jk)  ! initial heat content 
     283             sc_loc_ini(:,:,jk) = tsn(:,:,jk,jp_sal) * e3t_n(:,:,jk) * tmask(:,:,jk)  ! initial salt content 
    303284          END DO 
    304 !$OMP DO schedule(static) private(jk,jj,ji) 
    305           DO jk = 1, jpk 
    306              DO jj = 1, jpj 
    307                 DO ji = 1, jpi 
    308                    ! if ice sheet/oceqn coupling, need to mask ini variables here (mask could change at the next NEMO instance). 
    309                    e3t_ini   (ji,jj,jk) = e3t_n(ji,jj,jk)                      * tmask(ji,jj,jk)  ! initial vertical scale factors 
    310                    hc_loc_ini(ji,jj,jk) = tsn(ji,jj,jk,jp_tem) * e3t_n(ji,jj,jk) * tmask(ji,jj,jk)  ! initial heat content 
    311                    sc_loc_ini(ji,jj,jk) = tsn(ji,jj,jk,jp_sal) * e3t_n(ji,jj,jk) * tmask(ji,jj,jk)  ! initial salt content 
    312                 END DO 
    313              END DO 
    314           END DO 
    315 !$OMP END PARALLEL 
    316285          frc_v = 0._wp                                           ! volume       trend due to forcing 
    317286          frc_t = 0._wp                                           ! heat content   -    -   -    -    
     
    319288          IF( ln_linssh ) THEN 
    320289             IF ( ln_isfcav ) THEN 
    321 !$OMP PARALLEL DO schedule(static) private(jj,ji) 
    322290                DO ji=1,jpi 
    323291                   DO jj=1,jpj 
     
    327295                ENDDO 
    328296             ELSE 
    329 !$OMP PARALLEL DO schedule(static) private(jj,ji) 
    330                 DO jj = 1, jpj 
    331                    DO ji = 1, jpi 
    332                       ssh_hc_loc_ini(ji,jj) = tsn(ji,jj,1,jp_tem) * sshn(ji,jj)   ! initial heat content in ssh 
    333                       ssh_sc_loc_ini(ji,jj) = tsn(ji,jj,1,jp_sal) * sshn(ji,jj)   ! initial salt content in ssh 
    334                    ENDDO 
    335                 ENDDO 
     297                ssh_hc_loc_ini(:,:) = tsn(:,:,1,jp_tem) * sshn(:,:)   ! initial heat content in ssh 
     298                ssh_sc_loc_ini(:,:) = tsn(:,:,1,jp_sal) * sshn(:,:)   ! initial salt content in ssh 
    336299             END IF 
    337300             frc_wn_t = 0._wp                                       ! initial heat content misfit due to free surface 
     
    382345      INTEGER ::   ierror   ! local integer 
    383346      INTEGER ::   ios 
    384       INTEGER ::   ji, jj, jk   ! dummy loop indices 
    385347      !! 
    386348      NAMELIST/namhsb/ ln_diahsb 
     
    422384      ! 2 - Time independant variables and file opening ! 
    423385      ! ----------------------------------------------- ! 
    424 !$OMP PARALLEL DO schedule(static) private(jj,ji) 
    425       DO jj = 1, jpj 
    426          DO ji = 1, jpi 
    427             surf(ji,jj) = e1t(ji,jj) * e2t(ji,jj) * tmask_i(ji,jj)      ! masked surface grid cell area 
    428          END DO 
    429       END DO 
     386      surf(:,:) = e1t(:,:) * e2t(:,:) * tmask_i(:,:)      ! masked surface grid cell area 
    430387      surf_tot  = glob_sum( surf(:,:) )                   ! total ocean surface area 
    431388 
Note: See TracChangeset for help on using the changeset viewer.