Ignore:
Timestamp:
May 6, 2015, 12:14:12 PM (10 years ago)
Author:
ymipsl
Message:

Reorganize geometry and grid modules. Prepare physics for unstructutured grid support. Simplify initialization of physics from dynamic.
Compiled only with dynd3dmem, but not tested for moment.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/mod_phys_lmdz_mpi_data.F90

    r3817 r3825  
    1 !
    2 !$Header$
    3 !
    41MODULE mod_phys_lmdz_mpi_data
    52 
     
    4643CONTAINS
    4744 
    48   SUBROUTINE Init_phys_lmdz_mpi_data(iim,jjp1,nb_proc,distrib,communicator)
     45  SUBROUTINE init_phys_lmdz_mpi_data(nbp, nbp_lon, nbp_lat, communicator)
    4946  IMPLICIT NONE
    5047#ifdef CPP_MPI
    5148    INCLUDE 'mpif.h'
    5249#endif
    53     INTEGER,INTENT(in) :: iim
    54     INTEGER,INTENT(in) :: jjp1
    55     INTEGER,INTENT(in) :: nb_proc
    56     INTEGER,INTENT(in) :: distrib(0:nb_proc-1)
    57     INTEGER,INTENT(in) :: communicator
    58    
     50    INTEGER,INTENT(IN) :: nbp
     51    INTEGER,INTENT(IN) :: nbp_lon
     52    INTEGER,INTENT(IN) :: nbp_lat
     53    INTEGER,INTENT(IN) :: communicator
     54   
     55    INTEGER,ALLOCATABLE :: distrib(:)
    5956    INTEGER :: ierr
    6057    INTEGER :: klon_glo
     
    6764#endif
    6865   
    69     if (iim.eq.1) then
     66    if (nbp_lon.eq.1) then
    7067       klon_glo=1
    7168    else
    72        klon_glo=iim*(jjp1-2)+2
     69       klon_glo=nbp_lon*(nbp_lat-2)+2
    7370    endif
    7471   
     
    8582      mpi_rank=0
    8683    ENDIF
    87    
     84
     85    ALLOCATE(distrib(0:mpi_size-1))
     86
     87    IF (is_using_mpi) THEN   
     88#ifdef CPP_MPI
     89    CALL MPI_ALLGATHER(nbp,1,MPI_REAL8,distrib,1,MPI_REAL_LMDZ,COMM_LMDZ_PHY)
     90#endif
     91    ELSE
     92     distrib(:)=nbp
     93    ENDIF
     94   
     95       
    8896    IF (mpi_rank == 0) THEN
    8997      mpi_master = 0
     
    119127 
    120128     
    121     klon_mpi_para_nb(0:mpi_size-1)=distrib(0:nb_proc-1)
     129    klon_mpi_para_nb(0:mpi_size-1)=distrib(0:mpi_size-1)
    122130
    123131    DO i=0,mpi_size-1
     
    136144        ij_para_begin(i) = 1
    137145      ELSE
    138         ij_para_begin(i) = klon_mpi_para_begin(i)+iim-1
     146        ij_para_begin(i) = klon_mpi_para_begin(i)+nbp_lon-1
    139147      ENDIF
    140148
    141       jj_para_begin(i) = (ij_para_begin(i)-1)/iim + 1
    142       ii_para_begin(i) = MOD(ij_para_begin(i)-1,iim) + 1
     149      jj_para_begin(i) = (ij_para_begin(i)-1)/nbp_lon + 1
     150      ii_para_begin(i) = MOD(ij_para_begin(i)-1,nbp_lon) + 1
    143151
    144152     
    145       ij_para_end(i) = klon_mpi_para_end(i)+iim-1
    146       jj_para_end(i) = (ij_para_end(i)-1)/iim + 1
    147       ii_para_end(i) = MOD(ij_para_end(i)-1,iim) + 1
     153      ij_para_end(i) = klon_mpi_para_end(i)+nbp_lon-1
     154      jj_para_end(i) = (ij_para_end(i)-1)/nbp_lon + 1
     155      ii_para_end(i) = MOD(ij_para_end(i)-1,nbp_lon) + 1
    148156
    149157
Note: See TracChangeset for help on using the changeset viewer.