source: branches/jerome/src_flexwrf_v3.1/senddrydep_mpi.f90 @ 16

Last change on this file since 16 was 16, checked in by jebri, 10 years ago

sources for flexwrf v3.1

File size: 3.2 KB
Line 
1!***********************************************************************
2!* Copyright 2012,2013                                                *
3!* Jerome Brioude, Delia Arnold, Andreas Stohl, Wayne Angevine,       *
4!* John Burkhart, Massimo Cassiani, Adam Dingwell, Richard C Easter, Sabine Eckhardt,*
5!* Stephanie Evan, Jerome D Fast, Don Morton, Ignacio Pisso,          *
6!* Petra Seibert, Gerard Wotawa, Caroline Forster, Harald Sodemann,   *
7!*                                                                     *
8!* This file is part of FLEXPART WRF                                   *
9!*                                                                     *
10!* FLEXPART is free software: you can redistribute it and/or modify    *
11!* it under the terms of the GNU General Public License as published by*
12!* the Free Software Foundation, either version 3 of the License, or   *
13!* (at your option) any later version.                                 *
14!*                                                                     *
15!* FLEXPART is distributed in the hope that it will be useful,         *
16!* but WITHOUT ANY WARRANTY; without even the implied warranty of      *
17!* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *
18!* GNU General Public License for more details.                        *
19!*                                                                     *
20!* You should have received a copy of the GNU General Public License   *
21!* along with FLEXPART.  If not, see <http://www.gnu.org/licenses/>.   *
22!***********************************************************************
23
24  !   routine used to send real array of dry deposition by MPI
25  !    Author: J. Brioude                                                      *
26  !    January 2013                                                           *
27        subroutine senddrydep_mpi(chunksize)
28
29      use mpi_mod
30      use com_mod
31      use unc_mod, only: drygridunc2
32      use par_mod, only: nclassunc
33          implicit none
34      include 'mpif.h'
35!      character :: varname*20
36       integer :: chunksize,numpart2,ks
37!      real :: dummyr(numpart2,nspec2),
38       real :: dummyr(chunksize)
39       integer :: myid,ierr,ntasks,ii,jdeb,jfin,jj,tag,direc
40!      integer :: MPI_COMM_WORLD
41
42       integer :: tag2,nspec2,ix,jy,l,nage,kp
43       integer :: jj2,from       
44  integer, dimension(MPI_STATUS_SIZE) :: status
45
46      call MPI_COMM_RANK ( MPI_COMM_WORLD, myid, ierr )
47      call MPI_COMM_SIZE ( MPI_COMM_WORLD, ntasks, ierr )
48
49!    chunksize=numxgrid*numygrid
50  do ks=1,nspec
51   do kp=1,maxpointspec_act
52    do nage=1,nageclass
53     do l=1,nclassunc
54      tag=ks*1000000+kp*10000+nage*100+l
55
56   if (myid.gt.0) then !slaves send
57
58    call MPI_SEND(drygridunc2(0,0,ks,kp,l,nage), chunksize, MPI_REAL,0,tag, MPI_COMM_WORLD, ierr)
59
60   else ! the master gets
61     do from =1,ntasks-1
62    call MPI_RECV(dummyr, chunksize, MPI_REAL, from,tag, MPI_COMM_WORLD,status,ierr)
63       do jy=0,numygrid-1
64        do ix=0,numxgrid-1
65         drygridunc2(ix,jy,ks,kp,l,nage)=drygridunc2(ix,jy,ks,kp,l,nage)+ &
66           dummyr(ix+1+jy*numxgrid)
67        enddo
68       enddo
69     enddo
70
71   endif
72
73    enddo
74    enddo
75    enddo
76    enddo
77       end subroutine senddrydep_mpi
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG