zerothi / ncdf

NetCDF API with F95 capabilities by using handles and an intrinsic MPI layer
GNU Lesser General Public License v3.0
2 stars 1 forks source link

sp definitions #2

Closed zerothi closed 2 years ago

zerothi commented 2 years ago
! if ( present(fill_val) ) then
     !fill_val = cmplx(lfill_valr,lfill_valc, sp)
     fill_val = cmplx(0,0, sp)
     fill_val = cmplx(0.0_sp,0.0_sp, sp)
! end if
end subroutine inq_var_c0
subroutine put_var_c1_name(this,name,var,start,count)
jme52 commented 2 years ago

I think that any of the following two options (for line 163 of ncdf/src/netcdf_ncdf_var_inc.inc) should "work" (I think that in https://gitlab.com/siesta-project/siesta/-/merge_requests/73#note_735404846 we agreed that the existing code is already correct):

fill_val = cmplx(0.0_COMPLEX_DTYPE, 0.0_COMPLEX_DTYPE, COMPLEX_DTYPE)
fill_val = (0.0_COMPLEX_DTYPE, 0.0_COMPLEX_DTYPE)

If you are looking into this issue, you may also want to check line 175, since the assignment in fill_vall = 0. may be real(sp), real(dp), integer(ih) or integer(is), which might be a bit too much of a hack.

zerothi commented 2 years ago

This is now fixed in 2d0cc77ff5a5015f124440f2c2330f99c6b94464