Skip to content

Commit

Permalink
Ignore max_allowed_nz if ≤ 0 (#642)
Browse files Browse the repository at this point in the history
* ignore max_allowed_nz if <= 0

* added documentation in controls.defauls

* [ci skip] update to controls

---------

Co-authored-by: Meridith Joyce <meridith.joyce@gmail.com>
  • Loading branch information
warrickball and mjoyceGR committed Apr 18, 2024
1 parent 220560c commit f6b400f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Backwards-incompatible changes
New Features
------------

``max_allowed_nz`` is now ignored if the value is less than or equal to zero.


.. _Bug Fixes main:

Expand Down
1 change: 1 addition & 0 deletions star/defaults/controls.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -5597,6 +5597,7 @@
! ~~~~~~~~~~~~~~

! Maximum number of grid points allowed.
! Array allowed to grow arbitrarily large if max_allowed_nz <= 0

! ::

Expand Down
4 changes: 2 additions & 2 deletions star/private/mesh_plan.f90
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ subroutine split1(k, ierr)
if (ierr /= 0) return
end if
nz_new = nz_new + 1
if (nz_new > max_allowed_nz) then
if (max_allowed_nz > 0 .and. nz_new > max_allowed_nz) then
write(*,*) 'tried to increase number of mesh points beyond max allowed nz', max_allowed_nz
ierr = -1
return
Expand Down Expand Up @@ -868,7 +868,7 @@ subroutine pick_new_points(s, ierr)
dq_sum = sum(dq_new(1:k_new))

k_new = k_new + 1
if (k_new > max_allowed_nz) then
if (max_allowed_nz > 0 .and. k_new > max_allowed_nz) then
write(*,*) 'tried to increase number of mesh points beyond max allowed nz', max_allowed_nz
ierr = -1
return
Expand Down

0 comments on commit f6b400f

Please sign in to comment.