mirror of
https://gitlab.com/scemama/EZFIO.git
synced 2024-12-22 04:13:34 +01:00
Char array as 1D
Version:1.6.1
This commit is contained in:
parent
e27ef1c7f4
commit
cfb61939bc
@ -416,7 +416,7 @@ subroutine ezfio_write_array_ch(dir,fil,rank,dims,dim_max,dat)
|
||||
integer :: i
|
||||
character*(1024) :: l_filename(2)
|
||||
integer :: length
|
||||
character(len=:), allocatable :: buffer(:)
|
||||
character(len=:), allocatable :: buffer
|
||||
if (libezfio_read_only) then
|
||||
call ezfio_error(irp_here,'Read-only file.')
|
||||
endif
|
||||
@ -431,13 +431,11 @@ subroutine ezfio_write_array_ch(dir,fil,rank,dims,dim_max,dat)
|
||||
close(unit=libezfio_iunit)
|
||||
|
||||
length = len(dat(1))
|
||||
allocate( character(len=length+1) :: buffer(dim_max) )
|
||||
!$OMP PARALLEL DO PRIVATE(i)
|
||||
allocate( character(len=(length+1)*dim_max) :: buffer )
|
||||
do i=1,dim_max
|
||||
write(buffer(i)(1:length), '(A)') dat(i)
|
||||
buffer(i)(length+1:length+1) = ACHAR(10)
|
||||
write(buffer((i-1)*(length+1)+1:i*(length+1)-1), '(A)') dat(i)
|
||||
buffer(i*(length+1):i*(length+1)) = ACHAR(10)
|
||||
enddo
|
||||
!$OMP END PARALLEL DO
|
||||
call libezfio_reopenz_unformatted(trim(l_filename(1)),'wb',err)
|
||||
write(libezfio_iunit) buffer
|
||||
call libezfio_closez(trim(l_filename(1)),'w')
|
||||
|
Loading…
Reference in New Issue
Block a user