Skip to content
Snippets Groups Projects
Commit 6472a212 authored by WAUTELET Philippe's avatar WAUTELET Philippe
Browse files

Philippe 02/10/2024: Philippe 02/10/2024: add netCDF attributes for subfiles

parent 4bc78815
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,7 @@
! P. Wautelet 14/12/2023: add lossy compression for output files
! P. Wautelet 15/02/2024: IO_Coordvar_write_nc4: add time dimension for Lagrangian trajectories
! P. Wautelet 20/03/2024: add boxes for output files
! P. Wautelet 02/10/2024: add netCDF attributes for subfiles
!-----------------------------------------------------------------
#ifdef MNH_IOCDF4
module mode_io_write_nc4
......@@ -2871,6 +2872,24 @@ IF (TPFILE%LMASTER) THEN
END IF
IF ( ISTATUS /= NF90_NOERR ) CALL IO_Err_handle_nc4( istatus, 'IO_FILE_WRITE_HEADER', 'NF90_PUT_ATT', 'MNH_COMPRESS_LOSSY' )
! Number of subfiles (0 if no subfiles or if is a subfile)
ISTATUS = NF90_PUT_ATT( TPFILE%NNCID, NF90_GLOBAL, 'MNH_NSUBFILES', TPFILE%NSUBFILES_IOZ )
IF ( ISTATUS /= NF90_NOERR ) CALL IO_Err_handle_nc4( istatus, 'IO_FILE_WRITE_HEADER', 'NF90_PUT_ATT', 'MNH_NSUBFILES' )
! Is this file a subfile
IF ( ASSOCIATED( TPFILE%TMAINFILE ) ) THEN
ISTATUS = NF90_PUT_ATT( TPFILE%NNCID, NF90_GLOBAL, 'MNH_IS_ROOTFILE', '0' )
ELSE
ISTATUS = NF90_PUT_ATT( TPFILE%NNCID, NF90_GLOBAL, 'MNH_IS_ROOTFILE', '1' )
END IF
IF ( ISTATUS /= NF90_NOERR ) CALL IO_Err_handle_nc4( istatus, 'IO_FILE_WRITE_HEADER', 'NF90_PUT_ATT', 'MNH_IS_SUBFILE' )
! For the moment, there is only this type: Zsplit
IF ( TPFILE%NSUBFILES_IOZ > 0 .OR. ASSOCIATED( TPFILE%TMAINFILE ) ) THEN
ISTATUS = NF90_PUT_ATT( TPFILE%NNCID, NF90_GLOBAL, 'MNH_SUBFILE_TYPE', 'Zsplit' )
IF ( ISTATUS /= NF90_NOERR ) CALL IO_Err_handle_nc4( istatus, 'IO_FILE_WRITE_HEADER', 'NF90_PUT_ATT', 'MNH_SUBFILE_TYPE' )
END IF
!title
!history
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment