Changeset 836 for LMDZ4/trunk


Ignore:
Timestamp:
Aug 30, 2007, 10:55:25 AM (17 years ago)
Author:
lsce
Message:

AC + ACo + JG : correction d'un bug suite a la parallelisation de la routine

gath2cpl qui entrainait un mauvais masque pour un decoupage
de l'atmosphere sur plus de deux processeurs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ4/trunk/libf/phylmd/cpl_mod.F90

    r793 r836  
    1717! Use statements
    1818!*************************************************************************************
    19   USE dimphy, ONLY : klon, zmasq
     19  USE dimphy, ONLY : klon
    2020  USE mod_phys_lmdz_para
    2121  USE ioipsl
     
    7171  REAL, ALLOCATABLE, DIMENSION(:,:), SAVE   :: pctsrf_sav   
    7272  !$OMP THREADPRIVATE(pctsrf_sav)
    73   REAL, ALLOCATABLE, DIMENSION(:,:), SAVE   :: zmasq2D
    74   !$OMP THREADPRIVATE(zmasq2D)
    7573  INTEGER, ALLOCATABLE, DIMENSION(:), SAVE  :: unity
    7674  !$OMP THREADPRIVATE(unity)
     
    181179    ALLOCATE(read_alb_sic(iim, jj_nb), stat = error)
    182180    sum_error = sum_error + error
    183     ALLOCATE(zmasq2D(iim, jj_nb), stat = error)
    184     sum_error = sum_error + error   
    185    
    186181
    187182    IF (sum_error /= 0) THEN
     
    202197    cpl_taux = 0.   ; cpl_tauy = 0.  ; cpl_rriv2D = 0. ; cpl_rcoa2D = 0.
    203198    cpl_rlic2D = 0. ; cpl_windsp = 0.
    204 
    205 !*************************************************************************************
    206 ! Transform the land-ocean mask into 2D grid.
    207 ! Colorize zmasq2D with 99 so that after gath2cpl points not valid can be recognized.
    208 !
    209 !*************************************************************************************
    210     zmasq2D(:,:) = 99.
    211     CALL gath2cpl(zmasq, zmasq2D, klon, unity)
    212199
    213200!*************************************************************************************
     
    936923    INTEGER, DIMENSION(iim*(jjm+1))                      :: ndexct
    937924    REAL                                                 :: Up, Down
    938     REAL, DIMENSION(iim, jj_nb)                       :: tmp_lon, tmp_lat
    939     REAL, DIMENSION(iim, jj_nb, 4)                    :: pctsrf2D
    940     REAL, DIMENSION(iim, jj_nb)                       :: deno
     925    REAL, DIMENSION(iim, jj_nb)                          :: tmp_lon, tmp_lat
     926    REAL, DIMENSION(iim, jj_nb, 4)                       :: pctsrf2D
     927    REAL, DIMENSION(iim, jj_nb)                          :: deno
    941928    CHARACTER(len = 20)                                  :: modname = 'cpl_send_all'
    942929    CHARACTER(len = 80)                                  :: abort_message
    943930   
    944931! Variables with fields to coupler
    945     REAL, DIMENSION(iim, jj_nb)                       :: tmp_taux
    946     REAL, DIMENSION(iim, jj_nb)                       :: tmp_tauy
    947     REAL, DIMENSION(iim, jj_nb)                       :: tmp_calv
     932    REAL, DIMENSION(iim, jj_nb)                          :: tmp_taux
     933    REAL, DIMENSION(iim, jj_nb)                          :: tmp_tauy
     934    REAL, DIMENSION(iim, jj_nb)                          :: tmp_calv
    948935! Table with all fields to send to coupler
    949     REAL, DIMENSION(iim, jj_nb, jpflda2o1+jpflda2o2)  :: tab_flds
     936    REAL, DIMENSION(iim, jj_nb, jpflda2o1+jpflda2o2)     :: tab_flds
    950937#ifdef CPP_PARA
    951938    INCLUDE 'mpif.h'
     
    10361023    tmp_tauy(:,:)    = 0.0
    10371024   
    1038     ! For all valid grid cells not entier land
    1039     WHERE (zmasq2D /= 1. .AND. zmasq2D /=99. )
    1040        deno =  pctsrf2D(:,:,is_oce) + pctsrf2D(:,:,is_sic) ! fraction oce+seaice
     1025
     1026    ! fraction oce+seaice
     1027    deno =  pctsrf2D(:,:,is_oce) + pctsrf2D(:,:,is_sic)
     1028    ! For all valid grid cells containing some fraction of ocean or sea-ice
     1029    WHERE ( deno(:,:) /= 0 )
     1030       tab_flds(:,:,15) = cpl_rain2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) +    &
     1031            cpl_rain2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:)
     1032       tab_flds(:,:,16) = cpl_snow2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) +    &
     1033            cpl_snow2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:)
    10411034       
    1042        tab_flds(:,:,15) = cpl_rain2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno +    &
    1043             cpl_rain2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno
    1044        tab_flds(:,:,16) = cpl_snow2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno +    &
    1045             cpl_snow2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno
    1046        
    1047        tmp_taux = cpl_taux2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno +    &
    1048             cpl_taux2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno
    1049        tmp_tauy = cpl_tauy2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno +    &
    1050             cpl_tauy2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno
     1035       tmp_taux = cpl_taux2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) +    &
     1036            cpl_taux2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:)
     1037       tmp_tauy = cpl_tauy2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) +    &
     1038            cpl_tauy2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:)
    10511039    ENDWHERE
    10521040
Note: See TracChangeset for help on using the changeset viewer.