Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding netcdf sync #201

Merged
merged 2 commits into from
Aug 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions route/build/src/pio_utils.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module pio_utils
public::end_def
public::openFile
public::closeFile
public::sync_file
public::write_netcdf ! write non-distributed data
public::write_pnetcdf ! write distributed data without record dimension
public::write_pnetcdf_recdim ! write distributed data at a specified index of record dimension
Expand Down Expand Up @@ -333,6 +334,24 @@ subroutine closeFile(pioFileDesc)

end subroutine closeFile

!-----------------------------------------------------------------------
subroutine sync_file(pioFileDesc, ierr, message)
! !DESCRIPTION:
! end definition of netcdf file
!
implicit none
! input
type(file_desc_t), intent(inout) :: pioFileDesc ! netcdf file id
! output
integer(i4b), intent(out) :: ierr ! error status
character(*), intent(out) :: message ! error message

ierr=0; message='sync_file/'

call PIO_syncfile(pioFileDesc)

end subroutine sync_file

!-----------------------------------------------------------------------
subroutine end_def(pioFileDesc, ierr, message)
! !DESCRIPTION:
Expand Down
3 changes: 3 additions & 0 deletions route/build/src/write_simoutput_pio.f90
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ SUBROUTINE output(ierr, message)
if(ierr/=0)then; message=trim(message)//trim(cmessage); return; endif
endif

call sync_file(pioFileDesc, ierr, cmessage)
if(ierr/=0)then; message=trim(message)//trim(cmessage); return; endif

END SUBROUTINE output


Expand Down