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/ICB – 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/ICB/icbini.F90

    r7646 r7698  
    8585      first_width (:) = SQRT(  rn_initial_mass(:) / ( rn_LoW_ratio * rn_rho_bergs * rn_initial_thickness(:) )  ) 
    8686      first_length(:) = rn_LoW_ratio * first_width(:) 
    87  
    88       berg_grid%calving      (:,:)   = 0._wp 
    89       berg_grid%calving_hflx (:,:)   = 0._wp 
    90       berg_grid%stored_heat  (:,:)   = 0._wp 
    91       berg_grid%floating_melt(:,:)   = 0._wp 
    92       berg_grid%maxclass     (:,:)   = nclasses 
    93       berg_grid%stored_ice   (:,:,:) = 0._wp 
    94       berg_grid%tmp          (:,:)   = 0._wp 
    95       src_calving            (:,:)   = 0._wp 
    96       src_calving_hflx       (:,:)   = 0._wp 
    97  
     87!$OMP PARALLEL 
     88!$OMP DO schedule(static) private(jj, ji) 
     89      DO jj = 1, jpj 
     90         DO ji = 1, jpi 
     91            berg_grid%calving      (ji,jj)   = 0._wp 
     92            berg_grid%calving_hflx (ji,jj)   = 0._wp 
     93            berg_grid%stored_heat  (ji,jj)   = 0._wp 
     94            berg_grid%floating_melt(ji,jj)   = 0._wp 
     95            berg_grid%maxclass     (ji,jj)   = nclasses 
     96            berg_grid%tmp          (ji,jj)   = 0._wp 
     97            src_calving            (ji,jj)   = 0._wp 
     98            src_calving_hflx       (ji,jj)   = 0._wp 
     99         END DO 
     100      END DO 
     101      DO jn = 1, nclasses 
     102!$OMP DO schedule(static) private(jj, ji) 
     103         DO jj = 1, jpj 
     104            DO ji = 1, jpi 
     105               berg_grid%stored_ice   (ji,jj,jn) = 0._wp 
     106            END DO 
     107         END DO 
     108      END DO 
     109!$OMP END PARALLEL 
    98110      !                          ! domain for icebergs 
    99111      IF( lk_mpp .AND. jpni == 1 )   CALL ctl_stop( 'icbinit: having ONE processor in x currently does not work' ) 
     
    108120      nicbfldproc(:) = -1 
    109121 
     122!$OMP PARALLEL DO schedule(static) private(jj, ji) 
    110123      DO jj = 1, jpj 
    111124         DO ji = 1, jpi 
     
    218231         CALL flush(numicb) 
    219232      ENDIF 
    220        
    221       src_calving     (:,:) = 0._wp 
    222       src_calving_hflx(:,:) = 0._wp 
    223  
     233!$OMP PARALLEL DO schedule(static) private(jj, ji) 
     234      DO jj = 1, jpj 
     235         DO ji = 1, jpi 
     236            src_calving     (ji,jj) = 0._wp 
     237            src_calving_hflx(ji,jj) = 0._wp 
     238         END DO 
     239      END DO 
    224240      ! assign each new iceberg with a unique number constructed from the processor number 
    225241      ! and incremented by the total number of processors 
     
    236252         IF( ivar > 0 ) THEN 
    237253            CALL iom_get  ( inum, jpdom_data, 'maxclass', src_calving )   ! read the max distribution array 
    238             berg_grid%maxclass(:,:) = INT( src_calving ) 
    239             src_calving(:,:) = 0._wp 
     254!$OMP PARALLEL 
     255!$OMP DO schedule(static) private(jj, ji) 
     256            DO jj = 1, jpj 
     257               DO ji = 1, jpi 
     258                  berg_grid%maxclass(ji,jj) = INT( src_calving(ji,jj) ) 
     259               END DO 
     260            END DO 
     261!$OMP DO schedule(static) private(jj, ji) 
     262            DO jj = 1, jpj 
     263               DO ji = 1, jpi 
     264                  src_calving(ji,jj) = 0._wp 
     265               END DO 
     266            END DO 
     267!$OMP END PARALLEL 
    240268         ENDIF 
    241269         CALL iom_close( inum )                                     ! close file 
Note: See TracChangeset for help on using the changeset viewer.