26 #undef MPP_READ_DISTRIBUTED_ASCII_1D_
27 #define MPP_READ_DISTRIBUTED_ASCII_1D_ mpp_read_distributed_ascii_r1D
29 #define MPP_TYPE_ real
30 #include <mpp_read_distributed_ascii.fh>
32 #undef MPP_READ_DISTRIBUTED_ASCII_1D_
33 #define MPP_READ_DISTRIBUTED_ASCII_1D_ mpp_read_distributed_ascii_i1D
35 #define MPP_TYPE_ integer
36 #include <mpp_read_distributed_ascii.fh>
38 subroutine mpp_read_distributed_ascii_a1d(unit,fmt,ssize,data,iostat)
39 integer,
intent(in) :: unit
40 character(*),
intent(in) :: fmt
41 integer,
intent(in) :: ssize
42 character(len=*),
dimension(:),
intent(inout) :: data
43 integer,
intent(out) :: iostat
45 integer,
allocatable :: pelist(:)
46 logical :: is_ioroot=.false.
49 if(.not.module_is_initialized)
call mpp_error(fatal,
'mpp_read_distributed_ascii_a1D: module not initialized')
52 call mpp_dist_io_pelist(ssize,pelist)
53 if(.not.
ALLOCATED(pelist)) &
54 call mpp_error(fatal,
'mpp_read_distributed_ascii_a1D: pelist allocation failed')
55 is_ioroot = mpp_is_dist_ioroot(ssize)
57 if(trim(fmt)==
'*')
then
58 read(unit,*,iostat=iostat)
data
60 read(unit,fmt=trim(fmt),iostat=iostat)
data
62 if(iostat /= 0)
return
65 call mpp_broadcast(
data,len(
data(1)),pelist(1),pelist)
67 end subroutine mpp_read_distributed_ascii_a1d