Open caiomattos opened 6 years ago
I think NF90_INT in NetCDF-Fortran corresponds to integers in Fortran90, -999.9 will be converted to -999 during nf90_put_att and it works. I have checked NF90_SHORT and found that it corresponds to short type in Fortran90 but I cannot find further information about short type in Fortran. I guess nf90_put_att cannot convert -999.9 to short type. I will be back after obtaining more investigation.
NetCDF requires the type of fill value matches the type of defined variable. The value -999.9 used in your call to nf90_put_att will be "treated" as a real (because of F90 function overloading), which conflicts the above NetCDF requirement. The solution is to typecast -999.9 to integer*2, e.g. int2(-999.9) in GNU Fortran, (which corresponds to short in C), i.e.
CALL check(nf90_put_att(ncid, PP_ID, "_FillValue", INT2(-999.9)))
Also, you probably meant to use PP_ID, instead of MIN_PP_ID.
Hello!
I seem unable to add the attribute _FillValue to a NF90_SHORT variable, although it works if I declare it as N90_INT. Why is this?