UPP (develop)
Loading...
Searching...
No Matches
GETGBANDSCATTER.f
1 subroutine getgbandscatter(me,iunit,im,jm,im_jm,jsta,jsta_2l &
2 ,jend_2u,MPI_COMM_COMP,icnt,idsp,spval,VarName,jpds,jgds,kpds,buf)
3!
4 implicit none
5 include "mpif.h"
6!
7 character(len=20),intent(in) :: VarName
8 real,intent(in) :: spval
9 integer,intent(in) :: me,iunit,im,jm,im_jm,jsta_2l,jend_2u,jsta, &
10 mpi_comm_comp
11 integer,intent(in) :: ICNT(0:1023), IDSP(0:1023)
12 integer,intent(in) :: JPDS(200),JGDS(200)
13 integer,intent(inout) :: KPDS(200)
14 real,intent(out) :: buf(im,jsta_2l:jend_2u)
15 integer :: kf,k,iret,i,j
16 integer KGDS(200)
17 LOGICAL*1 LB(IM,JM)
18 real dummy(im,jm)
19
20 if(me == 0) then
21 call getgb(iunit,0,im_jm,0,jpds,jgds,kf &
22 ,k,kpds,kgds,lb,dummy,iret)
23 if (iret /= 0) then
24 print*,varname," not found in file-Assigned missing values"
25!$omp parallel do private(i,j)
26 do j=1,jm
27 do i=1,im
28 dummy(i,j) = spval
29 end do
30 end do
31 else
32!$omp parallel do private(i,j)
33 do j=1,jm
34 do i=1,im
35 if(.not.lb(i,j)) dummy(i,j) = spval
36 end do
37 end do
38 end if
39 end if
40
41 call mpi_scatterv(dummy(1,1),icnt,idsp,mpi_real &
42 ,buf(1,jsta),icnt(me),mpi_real,0,mpi_comm_comp,iret)
43
44 RETURN
45 END