Skip to content

Commit

Permalink
fix restart issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Jul 21, 2020
1 parent fa40ee4 commit 05569c9
Showing 1 changed file with 29 additions and 28 deletions.
57 changes: 29 additions & 28 deletions streams/dshr_stream_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1457,15 +1457,15 @@ subroutine shr_stream_restIO(pioid, streams, mode)
rcode = pio_get_var(pioid, varid, tmp)
do k=1,size(streams)
if (streams(k)%nFiles /= tmp(k)) then
call shr_sys_abort('somethin is wrong')
call shr_sys_abort('something is wrong')
endif
enddo

rcode = pio_inq_varid(pioid, 'offset', varid)
rcode = pio_get_var(pioid, varid, tmp)
do k=1,size(streams)
if (streams(k)%offset /= tmp(k)) then
call shr_sys_abort('somethin is wrong')
call shr_sys_abort('something is wrong')
endif
enddo

Expand All @@ -1474,7 +1474,7 @@ subroutine shr_stream_restIO(pioid, streams, mode)
do k=1,size(streams)
streams(k)%k_lvd = tmp(k)
if (streams(k)%k_lvd /= tmp(k)) then
call shr_sys_abort('somethin is wrong')
call shr_sys_abort('something is wrong')
endif
enddo

Expand All @@ -1483,7 +1483,7 @@ subroutine shr_stream_restIO(pioid, streams, mode)
do k=1,size(streams)
streams(k)%n_lvd = tmp(k)
if (streams(k)%n_lvd /= tmp(k)) then
call shr_sys_abort('somethin is wrong')
call shr_sys_abort('something is wrong')
endif
enddo

Expand All @@ -1492,7 +1492,7 @@ subroutine shr_stream_restIO(pioid, streams, mode)
do k=1,size(streams)
streams(k)%k_gvd = tmp(k)
if (streams(k)%k_gvd /= tmp(k)) then
call shr_sys_abort('somethin is wrong')
call shr_sys_abort('something is wrong')
endif
enddo

Expand All @@ -1501,7 +1501,7 @@ subroutine shr_stream_restIO(pioid, streams, mode)
do k=1,size(streams)
streams(k)%n_gvd = tmp(k)
if (streams(k)%n_gvd /= tmp(k)) then
call shr_sys_abort('somethin is wrong')
call shr_sys_abort('something is wrong')
endif
enddo
deallocate(tmp)
Expand All @@ -1515,36 +1515,37 @@ subroutine shr_stream_restIO(pioid, streams, mode)
do n=1,streams(k)%nfiles
rcode = pio_get_var(pioid, varid, (/1,n,k/), fname)
if(fname .ne. streams(k)%file(n)%name) Then
call shr_sys_abort('somethin is wrong')
call shr_sys_abort('something is wrong')
endif
allocate(tmp(1))
rcode = pio_get_var(pioid, ntvarid, (/n,k/), tmp(1))
streams(k)%file(n)%nt = tmp(1)
if(tmp(1) /= streams(k)%file(n)%nt) then
call shr_sys_abort('somethin is wrong')
call shr_sys_abort('something is wrong')
endif
deallocate(tmp)
allocate(tmp(streams(k)%file(n)%nt))
rcode = pio_get_var(pioid, dvarid, (/1,n,k/), (/streams(k)%file(n)%nt,1,1/),tmp)
streams(k)%file(n)%date = tmp
if (.not. allocated(streams(k)%file(n)%date) .or. &
any(tmp .ne. streams(k)%file(n)%date) ) then
call shr_sys_abort('somethin is wrong')
endif
rcode = pio_get_var(pioid, tvarid, (/1,n,k/), (/streams(k)%file(n)%nt,1,1/),tmp)
streams(k)%file(n)%secs = tmp
if (.not. allocated(streams(k)%file(n)%secs) .or. &
any(tmp .ne. streams(k)%file(n)%secs) ) then
call shr_sys_abort('somethin is wrong')
endif
rcode = pio_get_var(pioid, hdvarid, (/n,k/), tmp(1))
if(tmp(1)==1) then
streams(k)%file(n)%havedata = .true.
else
streams(k)%file(n)%havedata = .false.
if (streams(k)%file(n)%nt > 0) then
allocate(tmp(streams(k)%file(n)%nt))
rcode = pio_get_var(pioid, dvarid, (/1,n,k/), (/streams(k)%file(n)%nt,1,1/),tmp)
streams(k)%file(n)%date = tmp
if (.not. allocated(streams(k)%file(n)%date) .or. &
any(tmp .ne. streams(k)%file(n)%date) ) then
call shr_sys_abort('something is wrong')
endif
rcode = pio_get_var(pioid, tvarid, (/1,n,k/), (/streams(k)%file(n)%nt,1,1/),tmp)
streams(k)%file(n)%secs = tmp
if (.not. allocated(streams(k)%file(n)%secs) .or. &
any(tmp .ne. streams(k)%file(n)%secs) ) then
call shr_sys_abort('something is wrong')
endif
rcode = pio_get_var(pioid, hdvarid, (/n,k/), tmp(1))
if(tmp(1)==1) then
streams(k)%file(n)%havedata = .true.
else
streams(k)%file(n)%havedata = .false.
endif
deallocate(tmp)
endif

deallocate(tmp)
enddo
enddo
endif
Expand Down

0 comments on commit 05569c9

Please sign in to comment.