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

Philippe 08/01/2018: IO: move NF90_CLOSE outside of CLEANIOCDF

parent 245d3a3c
No related branches found
No related tags found
No related merge requests found
......@@ -609,7 +609,16 @@ IF (TPFILE%LMASTER) THEN
CALL LFIFER(IRESP8,TPFILE%NLFIFLU,YSTATU)
IRESP = IRESP8
END IF
IF (ASSOCIATED(TPFILE%TNCDIMS)) CALL CLEANIOCDF(TPFILE%TNCDIMS)
#if defined(MNH_IOCDF4)
IF (TPFILE%NNCID/=-1) THEN
! Close Netcdf File
IRESP = NF90_CLOSE(TPFILE%NNCID)
IF (IRESP /= NF90_NOERR) THEN
CALL PRINT_MSG(NVERB_WARNING,'IO','FMCLOS_ll','NF90_CLOSE error: '//TRIM(NF90_STRERROR(IRESP)))
END IF
IF (ASSOCIATED(TPFILE%TNCDIMS)) CALL CLEANIOCDF(TPFILE%TNCDIMS)
END IF
#endif
IF (IRESP == 0) THEN
!! Write in pipe
#if defined(MNH_LINUX) || defined(MNH_SP4)
......
......@@ -786,7 +786,16 @@ CONTAINS
CALL IOFREEFLU(INT(TPFILE%NLFIFLU))
IRESP2 = IRESP8
END IF
IF (ASSOCIATED(TZFILE%TNCDIMS)) CALL CLEANIOCDF(TZFILE%TNCDIMS)
#if defined(MNH_IOCDF4)
IF (TZFILE%NNCID/=-1) THEN
! Close Netcdf File
IRESP = NF90_CLOSE(TZFILE%NNCID)
IF (IRESP /= NF90_NOERR) THEN
CALL PRINT_MSG(NVERB_WARNING,'IO','CLOSE_ll','NF90_CLOSE error: '//TRIM(NF90_STRERROR(IRESP)))
END IF
IF (ASSOCIATED(TZFILE%TNCDIMS)) CALL CLEANIOCDF(TZFILE%TNCDIMS)
END IF
#endif
END IF
END DO
!
......
......@@ -47,7 +47,7 @@ INTERFACE IO_READ_FIELD_NC4
END INTERFACE IO_READ_FIELD_NC4
! Public from module netcdf
PUBLIC NF90_OPEN,NF90_CREATE,NF90_NOWRITE,NF90_CLOBBER,NF90_NETCDF4,NF90_NOERR,NF90_STRERROR
PUBLIC NF90_CLOSE,NF90_OPEN,NF90_CREATE,NF90_NOWRITE,NF90_CLOBBER,NF90_NETCDF4,NF90_NOERR,NF90_STRERROR
! Public from this module :
PUBLIC NEWIOCDF,CLEANIOCDF,IO_WRITE_FIELD_NC4,IO_READ_FIELD_NC4,IO_WRITE_HEADER_NC4
......@@ -92,12 +92,6 @@ INTEGER(KIND=IDCDF_KIND) :: IRESP
CALL PRINT_MSG(NVERB_DEBUG,'IO','CLEANIOCDF','called')
! Close Netcdf File
IRESP = NF90_CLOSE(PIOCDF%NCID)
IF (IRESP /= NF90_NOERR) THEN
CALL PRINT_MSG(NVERB_WARNING,'IO','CLEANIOCDF','NF90_CLOSE error: '//TRIM(NF90_STRERROR(IRESP)))
END IF
! Clean DIMLIST and DIMSTR
CALL CLEANLIST(PIOCDF%DIMLIST)
CALL CLEANLIST(PIOCDF%DIMSTR)
......
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