Ignore:
Timestamp:
Oct 21, 2009, 6:04:08 PM (15 years ago)
Author:
yann meurdesoif
Message:

Corrections de Bug divers - portage vers Titane (CCRT) -
YM

Location:
LMDZ4/branches/LMDZ4-dev/libf/phylmd
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/aeropt_2bands.F90

    r1246 r1249  
    6161  INTEGER, PARAMETER :: naero_insoluble=3  ! 1- Dust; 2- BC insoluble; 3- POM insoluble
    6262  LOGICAL, SAVE :: firstcall=.TRUE.
     63!$OMP THREADPRIVATE(firstcall)
    6364
    6465! Coefficient optiques sur 19 niveaux
    65   REAL, DIMENSION(nb_level) :: presnivs_19  ! Pression milieux couche pour 19 niveaux (nb_level)
    66   REAL, DIMENSION(nb_level) :: A1_ASSSM_b1_19, A2_ASSSM_b1_19, A3_ASSSM_b1_19,&
     66  REAL, SAVE, DIMENSION(nb_level) :: presnivs_19  ! Pression milieux couche pour 19 niveaux (nb_level)
     67!$OMP THREADPRIVATE(presnivs_19)
     68
     69  REAL, SAVE, DIMENSION(nb_level) :: A1_ASSSM_b1_19, A2_ASSSM_b1_19, A3_ASSSM_b1_19,&
    6770          B1_ASSSM_b1_19, B2_ASSSM_b1_19, C1_ASSSM_b1_19, C2_ASSSM_b1_19,&
    6871          A1_CSSSM_b1_19, A2_CSSSM_b1_19, A3_CSSSM_b1_19,&
     
    7679          A1_SSSSM_b2_19, A2_SSSSM_b2_19, A3_SSSSM_b2_19,&
    7780          B1_SSSSM_b2_19, B2_SSSSM_b2_19, C1_SSSSM_b2_19, C2_SSSSM_b2_19
     81!$OMP THREADPRIVATE(A1_ASSSM_b1_19, A2_ASSSM_b1_19, A3_ASSSM_b1_19)
     82!$OMP THREADPRIVATE(B1_ASSSM_b1_19, B2_ASSSM_b1_19, C1_ASSSM_b1_19, C2_ASSSM_b1_19)
     83!$OMP THREADPRIVATE(A1_CSSSM_b1_19, A2_CSSSM_b1_19, A3_CSSSM_b1_19)
     84!$OMP THREADPRIVATE(B1_CSSSM_b1_19, B2_CSSSM_b1_19, C1_CSSSM_b1_19, C2_CSSSM_b1_19)
     85!$OMP THREADPRIVATE(A1_SSSSM_b1_19, A2_SSSSM_b1_19, A3_SSSSM_b1_19)
     86!$OMP THREADPRIVATE(B1_SSSSM_b1_19, B2_SSSSM_b1_19, C1_SSSSM_b1_19, C2_SSSSM_b1_19)
     87!$OMP THREADPRIVATE(A1_ASSSM_b2_19, A2_ASSSM_b2_19, A3_ASSSM_b2_19)
     88!$OMP THREADPRIVATE(B1_ASSSM_b2_19, B2_ASSSM_b2_19, C1_ASSSM_b2_19, C2_ASSSM_b2_19)
     89!$OMP THREADPRIVATE(A1_CSSSM_b2_19, A2_CSSSM_b2_19, A3_CSSSM_b2_19)
     90!$OMP THREADPRIVATE(B1_CSSSM_b2_19, B2_CSSSM_b2_19, C1_CSSSM_b2_19, C2_CSSSM_b2_19)
     91!$OMP THREADPRIVATE(A1_SSSSM_b2_19, A2_SSSSM_b2_19, A3_SSSSM_b2_19)
     92!$OMP THREADPRIVATE(B1_SSSSM_b2_19, B2_SSSSM_b2_19, C1_SSSSM_b2_19, C2_SSSSM_b2_19)
     93
    7894
    7995! Coefficient optiques interpole sur le nombre de niveau du modele
     
    91107          A1_SSSSM_b2, A2_SSSSM_b2, A3_SSSSM_b2,&
    92108          B1_SSSSM_b2, B2_SSSSM_b2, C1_SSSSM_b2, C2_SSSSM_b2
    93 
    94   REAL:: RH_tab(nbre_RH)
     109!$OMP THREADPRIVATE(A1_ASSSM_b1, A2_ASSSM_b1, A3_ASSSM_b1)
     110!$OMP THREADPRIVATE(B1_ASSSM_b1, B2_ASSSM_b1, C1_ASSSM_b1, C2_ASSSM_b1)
     111!$OMP THREADPRIVATE(A1_CSSSM_b1, A2_CSSSM_b1, A3_CSSSM_b1)
     112!$OMP THREADPRIVATE(B1_CSSSM_b1, B2_CSSSM_b1, C1_CSSSM_b1, C2_CSSSM_b1)
     113!$OMP THREADPRIVATE(A1_SSSSM_b1, A2_SSSSM_b1, A3_SSSSM_b1)
     114!$OMP THREADPRIVATE(B1_SSSSM_b1, B2_SSSSM_b1, C1_SSSSM_b1, C2_SSSSM_b1)
     115!$OMP THREADPRIVATE(A1_ASSSM_b2, A2_ASSSM_b2, A3_ASSSM_b2)
     116!$OMP THREADPRIVATE(B1_ASSSM_b2, B2_ASSSM_b2, C1_ASSSM_b2, C2_ASSSM_b2)
     117!$OMP THREADPRIVATE(A1_CSSSM_b2, A2_CSSSM_b2, A3_CSSSM_b2)
     118!$OMP THREADPRIVATE(B1_CSSSM_b2, B2_CSSSM_b2, C1_CSSSM_b2, C2_CSSSM_b2)
     119!$OMP THREADPRIVATE(A1_SSSSM_b2, A2_SSSSM_b2, A3_SSSSM_b2)
     120!$OMP THREADPRIVATE(B1_SSSSM_b2, B2_SSSSM_b2, C1_SSSSM_b2, C2_SSSSM_b2)
     121 
     122  REAL,PARAMETER :: RH_tab(nbre_RH)=(/0.,10.,20.,30.,40.,50.,60.,70.,80.,85.,90.,95./)
    95123  REAL, PARAMETER :: RH_MAX=95.
    96124  REAL:: DELTA, rh, H
     
    98126  REAL:: piz_ae2b_int(KLON,KLEV,nbands)   ! Intermediate computation of Single scattering albedo
    99127  REAL:: cg_ae2b_int(KLON,KLEV,nbands)    ! Intermediate computation of Assymetry parameter
    100   DATA RH_tab/0.,10.,20.,30.,40.,50.,60.,70.,80.,85.,90.,95./
    101128  REAL :: zrho
    102129  REAL :: fac
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/aeropt_5wv.F90

    r1246 r1249  
    8888  INTEGER, PARAMETER :: nb_level = 19     ! number of vertical levels
    8989  LOGICAL, SAVE :: firstcall=.TRUE.
     90!$OMP THREADPRIVATE(firstcall)
    9091
    9192  REAL :: zrho
    9293
    9394  ! Coefficient optiques sur 19 niveaux
    94   REAL, DIMENSION(nb_level) :: presnivs_19  ! Pression milieux couche pour 19 niveaux (nb_level)
    95   REAL, DIMENSION(nb_level) :: A1_ASSSM_19, A2_ASSSM_19, A3_ASSSM_19,&
     95  REAL, SAVE, DIMENSION(nb_level) :: presnivs_19  ! Pression milieux couche pour 19 niveaux (nb_level)
     96!$OMP THREADPRIVATE(presnivs_19)
     97
     98  REAL, SAVE, DIMENSION(nb_level) :: A1_ASSSM_19, A2_ASSSM_19, A3_ASSSM_19,&
    9699          B1_ASSSM_19, B2_ASSSM_19, C1_ASSSM_19, C2_ASSSM_19,&
    97100          A1_CSSSM_19, A2_CSSSM_19, A3_CSSSM_19,&
     
    99102          A1_SSSSM_19, A2_SSSSM_19, A3_SSSSM_19,&
    100103          B1_SSSSM_19, B2_SSSSM_19, C1_SSSSM_19, C2_SSSSM_19
     104!$OMP THREADPRIVATE(A1_ASSSM_19, A2_ASSSM_19, A3_ASSSM_19)
     105!$OMP THREADPRIVATE(B1_ASSSM_19, B2_ASSSM_19, C1_ASSSM_19, C2_ASSSM_19)
     106!$OMP THREADPRIVATE(A1_CSSSM_19, A2_CSSSM_19, A3_CSSSM_19)
     107!$OMP THREADPRIVATE(B1_CSSSM_19, B2_CSSSM_19, C1_CSSSM_19, C2_CSSSM_19)
     108!$OMP THREADPRIVATE(A1_SSSSM_19, A2_SSSSM_19, A3_SSSSM_19)
     109!$OMP THREADPRIVATE(B1_SSSSM_19, B2_SSSSM_19, C1_SSSSM_19, C2_SSSSM_19)
    101110
    102111  ! Coefficient optiques interpole sur le nombre de niveau du modele
     
    108117          A1_SSSSM, A2_SSSSM, A3_SSSSM,&
    109118          B1_SSSSM, B2_SSSSM, C1_SSSSM, C2_SSSSM
    110 
    111   REAL :: RH_tab(nbre_RH)
     119!$OMP THREADPRIVATE(A1_ASSSM, A2_ASSSM, A3_ASSSM)
     120!$OMP THREADPRIVATE(B1_ASSSM, B2_ASSSM, C1_ASSSM, C2_ASSSM)
     121!$OMP THREADPRIVATE(A1_CSSSM, A2_CSSSM, A3_CSSSM)
     122!$OMP THREADPRIVATE(B1_CSSSM, B2_CSSSM, C1_CSSSM, C2_CSSSM)
     123!$OMP THREADPRIVATE(A1_SSSSM, A2_SSSSM, A3_SSSSM)
     124!$OMP THREADPRIVATE(B1_SSSSM, B2_SSSSM, C1_SSSSM, C2_SSSSM)
     125
     126
     127  REAL,PARAMETER :: RH_tab(nbre_RH)=(/0.,10.,20.,30.,40.,50.,60.,70.,80.,85.,90.,95./)
    112128  REAL :: DELTA, rh, H
    113129  REAL :: tau_ae5wv_int(KLON,KLEV,las) ! Intermediate computation of epaisseur optique aerosol
     
    115131  REAL :: cg_ae5wv_int(KLON,KLEV,las)  ! Intermediate asymmetry parameter aerosol
    116132  REAL, PARAMETER :: RH_MAX=95.
    117   DATA RH_tab/0.,10.,20.,30.,40.,50.,60.,70.,80.,85.,90.,95./
    118133  REAL :: taue670(KLON)       ! epaisseur optique aerosol absorption 550 nm
    119134  REAL :: taue865(KLON)       ! epaisseur optique aerosol extinction 865 nm
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/carbon_cycle_mod.F90

    r1227 r1249  
    99
    1010! Variables read from parmeter file physiq.def
    11   LOGICAL, PUBLIC :: carbon_cycle_tr        ! 3D transport of CO2 in the atmosphere, parameter read in conf_phys
    12   LOGICAL, PUBLIC :: carbon_cycle_cpl       ! Coupling of CO2 fluxes between LMDZ/ORCHIDEE and LMDZ/OCEAN(PISCES)
     11  LOGICAL, SAVE, PUBLIC :: carbon_cycle_tr        ! 3D transport of CO2 in the atmosphere, parameter read in conf_phys
     12!$OMP THREADPRIVATE(carbon_cycle_tr)
     13  LOGICAL, SAVE,PUBLIC :: carbon_cycle_cpl       ! Coupling of CO2 fluxes between LMDZ/ORCHIDEE and LMDZ/OCEAN(PISCES)
     14!$OMP THREADPRIVATE(carbon_cycle_cpl)
    1315  LOGICAL :: carbon_cycle_emis_comp=.FALSE. ! Calculation of emission compatible
    1416
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/conf_phys.F90

    r1244 r1249  
    147147  LOGICAL,SAVE :: ok_strato_omp
    148148  LOGICAL,SAVE :: ok_hines_omp
    149   LOGICAL      :: carbon_cycle_tr_omp
    150   LOGICAL      :: carbon_cycle_cpl_omp
     149  LOGICAL,SAVE      :: carbon_cycle_tr_omp
     150  LOGICAL,SAVE      :: carbon_cycle_cpl_omp
    151151
    152152  logical, intent(out):: read_climoz ! read ozone climatology, OpenMP shared
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/mod_phys_lmdz_omp_transfert.F90

    r1001 r1249  
    1010 
    1111  CHARACTER(LEN=size_min),SAVE            :: buffer_c
    12   INTEGER,SAVE                            :: size_c
     12!  INTEGER,SAVE                            :: size_c=0
    1313  INTEGER,SAVE,ALLOCATABLE,DIMENSION(:)   :: buffer_i
    14   INTEGER,SAVE                            :: size_i
     14  INTEGER,SAVE                            :: size_i=0
    1515  REAL,SAVE,ALLOCATABLE,DIMENSION(:)      :: buffer_r
    16   INTEGER,SAVE                            :: size_r
     16  INTEGER,SAVE                            :: size_r=0
    1717  LOGICAL,SAVE,ALLOCATABLE,DIMENSION(:)   :: buffer_l
    18   INTEGER,SAVE                            :: size_l
     18  INTEGER,SAVE                            :: size_l=0
    1919
    2020
     
    5656  INTEGER :: buff_size
    5757
    58     IF (buff_size>size_i) THEN
    5958!$OMP BARRIER
    6059!$OMP MASTER
     60    IF (buff_size>size_i) THEN
    6161      IF (ALLOCATED(buffer_i)) DEALLOCATE(buffer_i)
    6262      size_i=MAX(size_min,INT(grow_factor*buff_size))
    6363      ALLOCATE(buffer_i(size_i))
     64    ENDIF
    6465!$OMP END MASTER
    6566!$OMP BARRIER
    66     ENDIF
    6767 
    6868  END SUBROUTINE check_buffer_i
     
    7272  INTEGER :: buff_size
    7373
    74     IF (buff_size>size_r) THEN
    7574!$OMP BARRIER
    7675!$OMP MASTER
     76    IF (buff_size>size_r) THEN
    7777      IF (ALLOCATED(buffer_r)) DEALLOCATE(buffer_r)
    7878      size_r=MAX(size_min,INT(grow_factor*buff_size))
    7979      ALLOCATE(buffer_r(size_r))
     80    ENDIF
    8081!$OMP END MASTER
    8182!$OMP BARRIER
    82     ENDIF
    8383 
    8484  END SUBROUTINE check_buffer_r
     
    8888  INTEGER :: buff_size
    8989
    90     IF (buff_size>size_l) THEN
    9190!$OMP BARRIER
    9291!$OMP MASTER
     92    IF (buff_size>size_l) THEN
    9393      IF (ALLOCATED(buffer_l)) DEALLOCATE(buffer_l)
    9494      size_l=MAX(size_min,INT(grow_factor*buff_size))
    9595      ALLOCATE(buffer_l(size_l))
     96    ENDIF
    9697!$OMP END MASTER
    9798!$OMP BARRIER
    98     ENDIF
    9999 
    100100  END SUBROUTINE check_buffer_l
     
    521521    REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
    522522    REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
    523    
     523
     524    CALL Check_buffer_r(size(VarOut))       
    524525    CALL gather_omp_rgen(VarIn,Varout,Size(VarIn,2)*Size(VarIn,3)*Size(VarIn,4),buffer_r)
    525526   
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/moy_undefSTD.F

    r1234 r1249  
    5353       DO k=1, nlevSTD
    5454        DO i=1, klon
    55          IF(tnondef(i,k,1).NE.(ecrit_day/dtime)) THEN
     55         IF (NINT(tnondef(i,k,1)).NE.NINT(ecrit_day/dtime)) THEN
    5656          tsumSTD(i,k,1)=tsumSTD(i,k,1)/
    5757     $    (ecrit_day/dtime-tnondef(i,k,1))
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/oasis.F90

    r1227 r1249  
    6868  END TYPE FLD_CPL
    6969
    70   TYPE(FLD_CPL), DIMENSION(maxsend), PUBLIC :: infosend   ! Information for sending coupling fields
    71   TYPE(FLD_CPL), DIMENSION(maxrecv), PUBLIC :: inforecv   ! Information for receiving coupling fields
    72  
    73   LOGICAL :: cpl_current
     70  TYPE(FLD_CPL), DIMENSION(maxsend), SAVE, PUBLIC :: infosend   ! Information for sending coupling fields
     71  TYPE(FLD_CPL), DIMENSION(maxrecv), SAVE, PUBLIC :: inforecv   ! Information for receiving coupling fields
     72 
     73  LOGICAL,SAVE :: cpl_current
     74!$OMP THREADPRIVATE(cpl_current)
    7475
    7576#ifdef CPP_COUPLE
     
    140141! Atmospheric variables to send
    141142
     143!$OMP MASTER
    142144    infosend(:)%action = .FALSE.
    143145
     
    288290       WRITE(lunout,*) 'inicma : endef psmile ok '
    289291    ENDIF
     292
     293!$OMP END MASTER
    290294   
    291295  END SUBROUTINE inicma
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/physiq.F

    r1246 r1249  
    10991099!     ascending order
    11001100
    1101       integer:: co3i = 0 ! time index in NetCDF file of current ozone field
     1101      integer,save:: co3i = 0 ! time index in NetCDF file of current ozone field
    11021102c$OMP THREADPRIVATE(co3i)
    11031103
     
    32323232        d_t_ec(i,k)=0.5/ZRCPD
    32333233     $      *(u(i,k)**2+v(i,k)**2-u_seri(i,k)**2-v_seri(i,k)**2)
     3234      ENDDO
     3235      ENDDO
     3236
     3237      DO k = 1, klev
     3238      DO i = 1, klon
    32343239        t_seri(i,k)=t_seri(i,k)+d_t_ec(i,k)
    32353240        d_t_ec(i,k) = d_t_ec(i,k)/dtime
     
    34823487!         write(97) u_seri,v_seri,t_seri,q_seri
    34833488!         close(97)
    3484 C$OMP single
     3489C$OMP MASTER
    34853490         if (read_climoz) then
    34863491            if (is_mpi_root) then
     
    34893494            deallocate(press_climoz) ! pointer
    34903495         end if
    3491 C$OMP end single nowait
     3496C$OMP END MASTER
    34923497      ENDIF
    34933498     
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/readaerosol.F90

    r1223 r1249  
    228228    IF (ASSOCIATED(pt_b))  DEALLOCATE(pt_b)
    229229
    230 !$OMP MASTER
    231     IF (is_mpi_root) THEN
     230    IF (is_mpi_root .AND. is_omp_root) THEN
    232231
    233232! 1) Open file
     
    508507       CALL grid2Dto1D_glo(psurf_glo2D,psurf_glo1D)
    509508       CALL grid2Dto1D_glo(load_glo2D,load_glo1D)
    510        
    511     END IF ! is_mpi_root
    512 !$OMP END MASTER
     509
     510    ELSE
     511      ALLOCATE(varyear_glo1D(0,0,0))       
     512    END IF ! is_mpi_root .AND. is_omp_root
     513
    513514!$OMP BARRIER
    514515 
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/readaerosol_interp.F90

    r1246 r1249  
    9393! Calculation to find if it is a new day
    9494
    95   IF(mpi_rank == 0)then
     95  IF(mpi_rank == 0 .AND. debug )then
    9696     PRINT*,'CONTROL PANEL REGARDING TIME STEPING'
    9797  ENDIF
     
    110110  IF(MOD(itap-1,NINT(86400./pdtphys)) == 0)THEN
    111111     lnewday=.TRUE.
     112  ELSE
     113     lnewday=.FALSE.
    112114  ENDIF
    113115
    114   IF(mpi_rank == 0)then
     116  IF(mpi_rank == 0 .AND. debug)then
    115117     ! 0.02 is about 0.5/24, namly less than half an hour
    116118     OLDNEWDAY = (r_day-FLOAT(iday) < 0.02)
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/surf_land_orchidee_noopenmp_mod.F90

    r1227 r1249  
    663663          displs(i)=displs(i-1)+knon_nb(i-1)
    664664       ENDDO
    665     ENDIF
     665   ELSE
     666       ALLOCATE(neighbours_g(1,8))
     667   ENDIF
    666668   
    667669    ktindex_p(1:knon)=ktindex(1:knon)+klon_mpi_begin-1+iim-1
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/sw_aeroAR4.F90

    r1246 r1249  
    183183! 3: feedback according to natural aerosol direct effect used for climate, diagnostics according to ok_ade_ok_aie
    184184
    185   INTEGER :: AEROSOLFEEDBACK_ACTIVE = 0
     185  INTEGER,SAVE :: AEROSOLFEEDBACK_ACTIVE = 0
     186!$OMP THREADPRIVATE(AEROSOLFEEDBACK_ACTIVE) 
    186187
    187188  IF ((.not. ok_ade) .and. (AEROSOLFEEDBACK_ACTIVE .ge. 2)) THEN
Note: See TracChangeset for help on using the changeset viewer.