Smallest supported mesh size not below the requested number of points
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | npoint |
Requested number of mesh points |
Supported number of mesh points
pure function valid_mesh_size(npoint) result(nmesh) !> Requested number of mesh points integer, intent(in) :: npoint !> Supported number of mesh points integer :: nmesh integer :: pow3, candidate nmesh = 1 do while (nmesh < npoint) nmesh = 2 * nmesh end do pow3 = 3 do while (pow3 < nmesh) candidate = pow3 do while (candidate < npoint) candidate = 2 * candidate end do nmesh = min(nmesh, candidate) pow3 = 3 * pow3 end do end function valid_mesh_size