1 subroutine getnemsandscatter(me,nfile,im,jm,jsta,jsta_2l &
2 ,jend_2u,MPI_COMM_COMP,icnt,idsp,spval,VarName,VcoordName &
3 ,l,impf,jmpf,nframe,buf)
5 use nemsio_module,
only: nemsio_gfile, nemsio_readrecvw34
7 type(nemsio_gfile),
intent(inout) :: nfile
10 character(len=20),
intent(in) :: VarName,VcoordName
11 real,
intent(in) :: spval
12 integer,
intent(in) :: me,im,jm,jsta_2l,jend_2u,jsta, &
13 mpi_comm_comp,l,impf,jmpf,nframe
14 integer,
intent(in) :: ICNT(0:1023), IDSP(0:1023)
15 real,
intent(out) :: buf(im,jsta_2l:jend_2u)
16 integer :: iret,i,j,idiff,jj
19 real,
allocatable:: dum1d(:)
23 allocate(dum1d((impf)*(jmpf)))
25 call nemsio_readrecvw34(nfile,trim(varname) &
26 ,trim(vcoordname),l,data=dum1d,nframe=nframe,iret=iret)
30 print*,varname,vcoordname,l,
" not found in NEMS file-Assigned missing values"
40 jj= (j-1)*impf + idiff
42 dummy(i,j) = dum1d(jj+i)
43 if(dummy(i,j) >= 9.9e20) dummy(i,j) = spval
55 call mpi_scatterv(dummy(1,1),icnt,idsp,mpi_real &
56 ,buf(1,jsta),icnt(me),mpi_real,0,mpi_comm_comp,iret)