Skip to content

Change the CISM license from LGPL to Apache 2.0 with LLVM exceptions - #119

Draft
whlipscomb wants to merge 11 commits into
lipscomb/shared_cleanupfrom
lipscomb/apache_license
Draft

whlipscomb wants to merge 11 commits into
lipscomb/shared_cleanupfrom
lipscomb/apache_license

Conversation

@whlipscomb

Copy link
Copy Markdown
Contributor

Branch: lipscomb/apache_license (11 commits, 7f64df5..1cee499)
Base: lipscomb/shared_cleanup (#118). Stacked; the base will be changed to main after the earlier PRs are merged.
CISM-wrapper: no change needed.

Do not merge yet. This PR is to be merged only after the CISM authors have agreed to the change of license. The AUTHORS file is preliminary and may change after conversations with some of the authors.

Summary

CISM has been distributed under the Lesser GNU General Public License (LGPL), version 3 or later. This PR changes it to the Apache License, Version 2.0, with LLVM exceptions (SPDX identifier Apache-2.0 WITH LLVM-exception), the license CVMix adopted in its PR #103. The LLVM exceptions waive the attribution conditions for portions embedded in compiled code, and allow the parts of the license that conflict with GPLv2 to be waived when CISM is combined with GPLv2 code.

  1. License and file headers (7f64df5..9ae478d): new LICENSE; the license header of every CISM source file replaced or added, with an SPDX line.
  2. Third-party code (cac6222..c5e3b44): code from other projects either keeps its own license, stated in the file, or, where it was under the GPL or LGPL, is removed or rewritten from scratch.
  3. AUTHORS, FUNDING, README (8108569..1cee499): updated author list (preliminary), current funding, and an updated README; NEWS removed.

There are no answer changes in the standard tests. Answers can change only in runs with flux routing of basal water, which is still in development and not used in any test (see below).

Changes

LICENSE and README (7f64df5). LICENSE holds the Apache 2.0 text (the official text from apache.org) followed by the LLVM exceptions. COPYING (GPL v3) and COPYING.LESSER (LGPL v3) are removed. The licensing section of README states the new license and lists the third-party code that keeps its own terms.

File headers (adb52b9, a8c1d4f, 9ae478d). Every CISM source file now has this header (with ! or # comments):

!   Copyright (C) 2005-2026
!   CISM contributors - see AUTHORS file for list of contributors
!
!   This file is part of CISM.
!   SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
!
!   Licensed under the Apache License, Version 2.0, with LLVM exceptions
!   (the "License"); you may not use this file except in compliance with
!   the License. A copy of the License is in the file LICENSE in the main
!   CISM directory; the Apache License is also available at
!
!       http://www.apache.org/licenses/LICENSE-2.0
!
!   Unless required by applicable law or agreed to in writing, software
!   distributed under the License is distributed on an "AS IS" BASIS,
!   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
!   See the License for the specific language governing permissions and
!   limitations under the License.
  • adb52b9: the LGPL block, identical in all 119 Fortran files with a header, is replaced by script; a script checked that each file changes only in this block.
  • a8c1d4f: generate_ncvars.py and f90_dependencies.py had an old Glimmer-CISM header under the GPL (version 2 or later); they get the new header.
  • 9ae478d: 17 CISM files that had no license header get one: the seven *_vars.def files, glide_mask.inc and glide_nan.inc, both CMakeLists.txt files, the build scripts in utils/build and config.inc.cmake.in, and the scripts in utils/config_reorg.

Files in tests/, builds/ and doc/ get no header; they are covered by the LICENSE file.

Third-party code. A review of the source for code from other projects found the following:

Code Origin and license Change
glimmer_solve/SLAP SLAP library, public domain none (listed in README)
glimmer_solve/blas reference BLAS from netlib; not compiled none (listed in README)
utils/libgptl GPTL timing library, own COPYING; optional, not built by default none (listed in README)
cism_reprosum_mod adapted from shr_reprosum_mod in E3SM (3-Clause BSD) cac6222: origin note and E3SM's BSD notice added to the file, with SPDX-License-Identifier: BSD-3-Clause
coicsr, coocsr in glimmer_sparse_type SPARSKIT (Y. Saad), LGPL; never called 94d28b7: removed
indexx, q_sort_index in glide_bwater, glint_routing, glissade_basal_hydro conversion of a quicksort issued under the GPL 05bada8: replaced by a new index_sort in glimmer_utils
quicksort, glacier_quicksort in glissade_glacier closely follows a public Fortran quicksort under the GPL (v3) c5e3b44: removed; the glacier cells are sorted with index_sort

(testsfg.F90, code from PISM under the GPL, was removed in #118.)

index_sort (05bada8, c5e3b44). The new routine, written from scratch, is a bottom-up (non-recursive) merge sort that returns the indices of the values from lowest to highest and keeps equal values in their original order. Being non-recursive, it also removes the stack overflow noted in sort_heights. Tested against the old routine on 4000 random arrays of up to 3000 values: for distinct values the two give identical indices; with ties, both give the same sorted values, but equal values may come in a different order. Answers may therefore change in runs with flux routing (bwat_method = flux_routing, and the Glide and Glint equivalents) where cells have equal heights, as in filled depressions; flux routing is still in development, and no test uses it. In glissade_glacier, the code after the sort uses only the ID of each cell, so the glacier initialization is unchanged (checked with the Alps test).

AUTHORS (8108569, preliminary). Two lists: contributors to the current code (the "CISM contributors" named in the headers, including intellectual contributions) and past contributors, whose code has since been removed. Affiliations are those at which each person contributed, with an asterisk for an affiliation the person has since left. A closing note credits code from other projects (the CICE remapping scheme, and the reproducible sums from E3SM). The lists were checked against the git history; they may change after conversations with some of the authors.

FUNDING (ec0046f). Starts with the current acknowledgement of NSF NCAR support (Cooperative Agreement No. 1852977, and CISL computing resources including Derecho), followed by the earlier funding agencies; the name of the U.K. agency is corrected (Natural Environment Research Council).

README and NEWS (1cee499). README describes CISM as the dynamic ice sheet component of CESM, links to the repository, notes that documentation for CISM 3.0 is in preparation for the CESM 3.0 release, points to https://github.com/ESCOMP/CISM/issues for reporting issues, and names the CESM Land Ice Working Group liaisons for help. NEWS, which described the CISM 2.0 release (2014), is removed.

Testing

Commits

7f64df56 Change the license to Apache 2.0 with LLVM exceptions: LICENSE and README
adb52b92 Replace the LGPL header with the Apache 2.0 header in 119 Fortran files
a8c1d4fc Relicense two Python scripts from GPL to Apache 2.0
9ae478d5 Add the Apache 2.0 header to CISM files that had no license header
cac62224 cism_reprosum_mod: state its origin and its 3-Clause BSD license
94d28b7c glimmer_sparse_type: remove the unused SPARSKIT routines coicsr and coocsr
05bada85 Replace the GPL-derived index sort with a new index_sort in glimmer_utils
c5e3b44c glissade_glacier: sort the glacier cells with index_sort; remove the quicksorts
8108569e AUTHORS: list contributors to the current code and past contributors (preliminary)
ec0046fe FUNDING: state the current NSF NCAR support; list earlier funding
1cee4994 README: update the description, links and contacts; remove NEWS

🤖 Generated with Claude Code

whlipscomb and others added 11 commits November 29, 2026 14:08
…ADME

LICENSE now holds the Apache License, Version 2.0, with the LLVM
exceptions (SPDX identifier Apache-2.0 WITH LLVM-exception), as used by
CVMix since its PR #103. The Apache text is the official text from
apache.org. The exceptions waive the attribution conditions for portions
embedded in compiled code, and allow the parts of the license that
conflict with GPLv2 to be waived when CISM is combined with GPLv2 code.

COPYING (GPL v3) and COPYING.LESSER (LGPL v3), the texts of the previous
license, are removed.

The licensing section of README states the new license and lists the
third-party code that keeps its own terms: SLAP (public domain), the
reference BLAS in glimmer_solve/blas, cism_reprosum_mod (3-Clause BSD,
from E3SM) and the optional GPTL library in utils/libgptl. BLAS and
cism_reprosum_mod were not mentioned before.

The file headers are changed in the following commits. This PR is to be
merged only after the CISM authors have agreed to the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All 119 Fortran files with a license header (in cism_shared, glissade,
glint, glide, glad, cism_driver and glimmer_solve) had the same LGPL
block. It is replaced, by script, with:
- Copyright (C) 2005-2026 (was 2005-2018, or 2005-2017 in
  glissade_inversion), CISM contributors (see AUTHORS);
- an SPDX line, SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception;
- the Apache 2.0 notice, naming the LLVM exceptions and pointing to the
  LICENSE file.
The file name line above the block and the module descriptions below it
are unchanged.

A script checked that each file differs from the previous version only
in this block.

Comments only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
utils/build/generate_ncvars.py (which generates the I/O code from the
*_vars.def files) and utils/f90_dependency_tool/f90_dependencies.py had
an old Glimmer-CISM header under the GNU General Public License,
version 2 or later, with a pointer to the BerliOS hosting site, which
closed in 2014. Like the rest of CISM, they were written by CISM
contributors; their headers now match the Fortran files (Apache 2.0
with LLVM exceptions, SPDX line), with '#' comments.

Comments only. (f90_dependencies.py is Python 2 code and is not used by
the CMake build; it is unchanged otherwise.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
These CISM files had no license header; they now have the same header
as the Fortran files (Apache 2.0 with LLVM exceptions, SPDX line):
- the seven *_vars.def files (glad, glide, glint, glissade), which
  generate_ncvars.py reads to write the I/O code ('#' comments, which
  the config parser skips);
- glide_mask.inc and glide_nan.inc ('!' comments);
- CMakeLists.txt and cism_driver/CMakeLists.txt (CRLF line endings
  kept);
- the build scripts in utils/build (autocopy-to-build-dir,
  autogenerate-in-build-dir, autogen-for-glint-and-glad-in-build-dir)
  and config.inc.cmake.in;
- the scripts in utils/config_reorg.
In scripts, the header follows the #! line.

Files in tests/, builds/ and doc/ are covered by the LICENSE file and get
no header. Third-party code keeps its own terms (see README).

No answer changes: the generated I/O code is identical (apart from the
generation time stamp), and the code builds with intel and gnu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cism_reprosum_mod.F90 is adapted from shr_reprosum_mod in E3SM
(share/util), starting from Pat Worley's 2023 revisions (E3SM PRs
#5534, #5549, #5560), as its notes say. E3SM is distributed under the
3-Clause BSD license, which requires that redistributed source keep the
copyright notice, conditions and disclaimer; the file had no license
text. It now starts with a header that names its origin and reproduces
E3SM's BSD notice (from E3SM's LICENSE file), with
SPDX-License-Identifier: BSD-3-Clause. This file keeps the BSD terms;
the rest of CISM is Apache 2.0 with LLVM exceptions (see README).

Comments only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oocsr

coicsr and coocsr convert a sparse matrix from coordinate to compressed
sparse row format. They came from Yousef Saad's SPARSKIT2, which is
released under the LGPL, and were converted to Fortran 90 by Jesse
Johnson in 2009. Nothing in CISM calls them: the SLAP interface uses
CISM's own format conversions and sorts in this module. They are
removed, so that no LGPL code remains in CISM when its license changes.

No answer changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tils

glide_bwater, glint_routing and glissade_basal_hydro each had a copy of
indexx and q_sort_index, an index sort used to order cells by height
for flux routing of basal water (Glide, Glissade) and of runoff (Glint).
The comments said the routines were Ian Rutt's Fortran conversion of a
quicksort by Michael Lamont, written in C and issued under the GNU
General Public License, so they could not be relicensed with the rest
of CISM.

The three copies are replaced by index_sort in glimmer_utils, written
from scratch: a bottom-up (non-recursive) merge sort, which returns the
indices of the values from lowest to highest and keeps entries with
equal values in their original order. Being non-recursive, it also
removes the stack overflow noted in sort_heights ("the code can fail
here because of too much recursion").

Tested against the old routine on 4000 random arrays of up to 3000
values: for distinct values the two give identical indices; with ties,
both give the same sorted values, but equal values may come in a
different order (the new sort is stable, the old one was not).

Answer changes: possible in runs that use flux routing (Glissade
bwat_method = flux_routing, the Glide and Glint equivalents) where
cells have exactly equal heights, which happens in depressions filled by
fill_depressions. Flux routing is still in development, and no test
uses it. Other runs are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…quicksorts

glissade_glacier had two recursive quicksorts: quicksort (for integer
arrays, never called) and glacier_quicksort (the same code for the
glacier_info type), which sorts the glacier cells by RGI ID at
initialization. The code closely follows a public Fortran quicksort
that is distributed under the GPL (version 3), so it is replaced
before CISM's license changes.

The new subroutine sort_glacier_list sorts the cells by calling
index_sort from glimmer_utils and reordering the list; the i and j
indices of each cell move with its ID, as before. The unused quicksort
and the commented-out code that tested it are removed.

The sorted IDs are the same as before; only the order of cells with
the same ID can differ (index_sort is stable). The code that follows
uses only the ID of each cell (to count the glaciers and fill
cism_glacier_id), so answers do not change. Checked with the Alps test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(preliminary)

The license headers name the "CISM contributors - see AUTHORS file".
AUTHORS now has two lists:
- contributors to the current code: people who contributed to code
  that is part of the current version of CISM (including intellectual
  contributions, such as the ideas behind the accelerated Picard solver
  and the slab test);
- past contributors: people who contributed to earlier versions, in
  code that has since been removed.
Affiliations are those at which each person contributed, with an
asterisk for an affiliation the person has since left. A closing note
credits code from other projects (the CICE remapping scheme, and the
reproducible sums from E3SM).

Compared with the old list, people whose code is no longer in CISM
(e.g. the Trilinos and Albany-FELIX interfaces, the PB&J and JFNK
solvers, PHAML) move to the past contributors, and people whose
contributions are in the current code but who were not listed are
added. The lists were checked against the git history.

This is a preliminary version: it may change, after conversations with
some of the authors, before this PR is merged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FUNDING now starts with the current acknowledgement: CISM is developed
primarily at the NSF National Center for Atmospheric Research,
sponsored by the National Science Foundation under Cooperative
Agreement No. 1852977, with computing and data storage resources,
including the Derecho supercomputer, provided by CISL at NSF NCAR.
The existing table of agencies and programs follows as the earlier
support, with the name of the U.K. agency corrected (Natural
Environment Research Council).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README (edits by Bill, with typo fixes):
- the introduction describes CISM as the dynamic ice sheet component of
  CESM, links to the CISM repository on GitHub, and notes that the
  documentation for CISM 2.1 is the latest, with documentation for
  CISM 3.0 in preparation for the CESM 3.0 release;
- the old link to the documentation source repository and the section
  pointing to the CISM 2.1 build instructions are removed;
- issues are reported at https://github.com/ESCOMP/CISM/issues (the old
  link pointed to the former cism/cism repository);
- help with building and running CISM comes from the liaisons of the
  CESM Land Ice Working Group;
- wording, typos, the numbering of the mailing lists and the heading
  underlines are fixed.

NEWS described the CISM 2.0 release (2014) and linked to an old
documentation repository; it is removed. A new NEWS file may be written
for the CESM 3.0 release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants