Changeset 1826 for LMDZ5


Ignore:
Timestamp:
Aug 6, 2013, 12:10:41 PM (11 years ago)
Author:
Laurent Fairhead
Message:

Correction de bug pour multiproc

  1. Boucher

Bug correction for multiproc running

  1. Boucher
File:
1 edited

Legend:

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

    r1771 r1826  
    3333    integer i, k, band, wave
    3434    integer, save :: mth_pre
     35!$OMP THREADPRIVATE(mth_pre)
    3536
    3637    real, allocatable, dimension(:,:), save :: tau_aer_strat
     
    4142    real, allocatable:: tauaerstrat_mois(:, :, :)
    4243    real, allocatable:: tauaerstrat_mois_glo(:, :)
    43     real, allocatable:: tauaerstrat_mois_glo_bands(:,:,:)
    4444
    4545! For NetCDF:
     
    6161    IF (.not.ALLOCATED(tau_aer_strat)) ALLOCATE(tau_aer_strat(klon,klev))
    6262
     63!--only read file if beginning of run or start of new month
     64    IF (debut.OR.mth_cur.NE.mth_pre) THEN
     65
    6366    IF (is_mpi_root) THEN
    64 
    65     IF (debut.OR.mth_cur.NE.mth_pre) THEN
    6667
    6768    IF (nbands.NE.2) THEN
     
    107108    ENDIF
    108109
    109     ALLOCATE(tauaerstrat(n_lon, n_lat, n_lev, n_month))
    110     ALLOCATE(tauaerstrat_mois(n_lon, n_lat, n_lev))
    111     ALLOCATE(tauaerstrat_mois_glo(klon_glo, n_lev))
    112     ALLOCATE(tauaerstrat_mois_glo_bands(klon_glo, n_lev,nbands))
     110    IF (.not.ALLOCATED(tauaerstrat))          ALLOCATE(tauaerstrat(n_lon, n_lat, n_lev, n_month))
     111    IF (.not.ALLOCATED(tauaerstrat_mois))     ALLOCATE(tauaerstrat_mois(n_lon, n_lat, n_lev))
     112    IF (.not.ALLOCATED(tauaerstrat_mois_glo)) ALLOCATE(tauaerstrat_mois_glo(klon_glo, n_lev))
    113113
    114114!--reading stratospheric AOD at 550 nm
     
    128128    CALL grid2dTo1d_glo(tauaerstrat_mois,tauaerstrat_mois_glo)
    129129
     130!    DEALLOCATE(tauaerstrat)
     131!    DEALLOCATE(tauaerstrat_mois)
     132!    DEALLOCATE(tauaerstrat_mois_glo)
     133 
     134    ENDIF !--is_mpi_root
     135
    130136!--scatter on all proc
    131137    CALL scatter(tauaerstrat_mois_glo,tau_aer_strat)
    132138
    133     DEALLOCATE(tauaerstrat)
    134     DEALLOCATE(tauaerstrat_mois)
    135     DEALLOCATE(tauaerstrat_mois_glo)
    136  
     139!--keep memory of previous month
    137140    mth_pre=mth_cur
    138141
    139142    ENDIF !--debut ou nouveau mois
    140143
    141     ENDIF !--is_mpi_root
    142 
    143144!--total vertical aod at the 5 wavelengths
    144145    DO wave=1, nwave
    145146    DO k=1, klev
    146     tausum_aero(:,wave,id_strat)=tausum_aero(:,wave,id_strat)+tau_aer_strat(:,k)*alpha_strat_wave(wave)/alpha_strat_wave(2)
     147    tausum_aero(:,wave,id_STRAT)=tausum_aero(:,wave,id_STRAT)+tau_aer_strat(:,k)*alpha_strat_wave(wave)/alpha_strat_wave(2)
     148!    tausum_aero(:,wave,id_ASBCM)=tausum_aero(:,wave,id_ASBCM)+tau_aer_strat(:,k)*alpha_strat_wave(wave)/alpha_strat_wave(2)
    147149    ENDDO
    148150    ENDDO
Note: See TracChangeset for help on using the changeset viewer.