Changeset 2526 for LMDZ5/trunk


Ignore:
Timestamp:
May 27, 2016, 12:13:40 AM (9 years ago)
Author:
oboucher
Message:

Adding OpenMP parallelization to both reaerosolstrato routines

Location:
LMDZ5/trunk/libf/phylmd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/phylmd/readaerosolstrato.F90

    r2346 r2526  
    99                                 grid2dto1d_glo
    1010    USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
     11    USE mod_phys_lmdz_omp_data, ONLY :  is_omp_root
    1112    USE mod_phys_lmdz_para
    1213    USE phys_state_var_mod
     
    6465    IF (debut.OR.mth_cur.NE.mth_pre) THEN
    6566
    66     IF (is_mpi_root) THEN
     67!--only root reads
     68    IF (is_mpi_root.AND.is_omp_root) THEN
    6769
    6870    IF (nbands.NE.2) THEN
     
    128130    CALL grid2dTo1d_glo(tauaerstrat_mois,tauaerstrat_mois_glo)
    129131
    130     ENDIF !--is_mpi_root
     132    ENDIF !--is_mpi_root and is_omp_root
     133
     134!$OMP BARRIER
    131135
    132136!--scatter on all proc
     
    136140    mth_pre=mth_cur
    137141!
    138     IF (is_mpi_root) THEN
     142    IF (is_mpi_root.AND.is_omp_root) THEN
    139143!
    140144    DEALLOCATE(tauaerstrat)
     
    142146    DEALLOCATE(tauaerstrat_mois_glo)
    143147!
    144     ENDIF !-is_mpi_root
     148    ENDIF !-is_mpi_root and is_omp_root
     149
     150!$OMP BARRIER
    145151
    146152    ENDIF !--debut ou nouveau mois
  • LMDZ5/trunk/libf/phylmd/rrtm/readaerosolstrato_rrtm.F90

    r2345 r2526  
    1111    USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, grid2dTo1d_glo
    1212    USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
     13    USE mod_phys_lmdz_omp_data, ONLY :  is_omp_root
    1314    USE mod_phys_lmdz_para
    1415    USE phys_state_var_mod
     
    7980    IF (.not.ALLOCATED(sum_tau_aer_strat)) ALLOCATE(sum_tau_aer_strat(klon))
    8081
     82!--we only read monthly strat aerosol data
    8183    IF (debut.OR.mth_cur.NE.mth_pre) THEN
    8284
    83     IF (is_mpi_root) THEN
     85!--only root reads the data
     86    IF (is_mpi_root.AND.is_omp_root) THEN
    8487
    8588    IF (nbands_sw_rrtm.NE.6) THEN
     
    145148    CALL grid2dTo1d_glo(tauaerstrat_mois,tauaerstrat_mois_glo)
    146149
    147     ENDIF !--is_mpi_root
     150    ENDIF !--is_mpi_root and is_omp_root
     151
     152!$OMP BARRIER
    148153
    149154!--keep memory of previous month
     
    153158    CALL scatter(tauaerstrat_mois_glo,tau_aer_strat)
    154159
    155     IF (is_mpi_root) THEN
     160    IF (is_mpi_root.AND.is_omp_root) THEN
    156161!
    157162    DEALLOCATE(tauaerstrat)
     
    159164    DEALLOCATE(tauaerstrat_mois_glo)
    160165!
    161     ENDIF !--is_mpi_root
     166    ENDIF !--is_mpi_root and is_omp_root
     167
     168!$OMP BARRIER
    162169
    163170    ENDIF !--debut ou nouveau mois
Note: See TracChangeset for help on using the changeset viewer.