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

Philippe 19/09/2019: temporary workaround for netCDF bug if MNH_INT=8 (if netCDF fortran < 4.4.5)

parent 6b13a631
Branches
Tags
No related merge requests found
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
! P. Wautelet 11/01/2019: NVERB_INFO->NVERB_WARNING for zero size fields ! P. Wautelet 11/01/2019: NVERB_INFO->NVERB_WARNING for zero size fields
! P. Wautelet 01/02/2019: IO_WRITE_COORDVAR_NC4: bug: use of non-associated pointers (PIOCDF%DIM_Nx_y) ! P. Wautelet 01/02/2019: IO_WRITE_COORDVAR_NC4: bug: use of non-associated pointers (PIOCDF%DIM_Nx_y)
! P. Wautelet 18/09/2019: correct support of 64bit integers (MNH_INT=8) ! P. Wautelet 18/09/2019: correct support of 64bit integers (MNH_INT=8)
! P. Wautelet 19/09/2019: temporary workaround for netCDF bug if MNH_INT=8 (if netCDF fortran < 4.4.5)
!----------------------------------------------------------------- !-----------------------------------------------------------------
#if defined(MNH_IOCDF4) #if defined(MNH_IOCDF4)
module mode_io_write_nc4 module mode_io_write_nc4
...@@ -289,10 +290,15 @@ IF(TPFIELD%NTYPE==TYPEINT .AND. TPFIELD%NDIMS>0) THEN ...@@ -289,10 +290,15 @@ IF(TPFIELD%NTYPE==TYPEINT .AND. TPFIELD%NDIMS>0) THEN
! Remarks: * the attribute '_FillValue' is also recognized by the netCDF library ! Remarks: * the attribute '_FillValue' is also recognized by the netCDF library
! and is used when pre-filling a variable ! and is used when pre-filling a variable
! * it cannot be modified if some data has already been written (->check OEXISTED) ! * it cannot be modified if some data has already been written (->check OEXISTED)
#if ( MNH_INT == 4 )
!BUG: NF90_PUT_ATT does not work for NF90_INT64 and _FillValue attribute if netCDF-fortran version < 4.4.5 (bug in netCDF)
! (see https://github.com/Unidata/netcdf-fortran/issues/62)
IF(.NOT.OEXISTED) THEN IF(.NOT.OEXISTED) THEN
print *,'PW: IO_WRITE_FIELD_ATTR_NC4: put att fillvalue=',TPFIELD%NFILLVALUE
STATUS = NF90_PUT_ATT(INCID, KVARID,'_FillValue', TPFIELD%NFILLVALUE) STATUS = NF90_PUT_ATT(INCID, KVARID,'_FillValue', TPFIELD%NFILLVALUE)
IF (STATUS /= NF90_NOERR) CALL IO_HANDLE_ERR_NC4(status,'IO_WRITE_FIELD_ATTR_NC4','NF90_PUT_ATT','_FillValue') IF (STATUS /= NF90_NOERR) CALL IO_HANDLE_ERR_NC4(status,'IO_WRITE_FIELD_ATTR_NC4','NF90_PUT_ATT','_FillValue')
END IF END IF
#endif
! !
! Valid_min/max (CF/COMODO convention) ! Valid_min/max (CF/COMODO convention)
STATUS = NF90_PUT_ATT(INCID, KVARID,'valid_min', TPFIELD%NVALIDMIN) STATUS = NF90_PUT_ATT(INCID, KVARID,'valid_min', TPFIELD%NVALIDMIN)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment