Skip to content

Commit 0a7c64f

Browse files
committed
Add Spherepack sources
1 parent e5882db commit 0a7c64f

123 files changed

Lines changed: 62297 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
set(source_dir ${CMAKE_CURRENT_SOURCE_DIR}) ##/../spherepack-e80da29462c5987162a0884baaab7434d0215467/src)
2+
3+
set(sources
4+
${source_dir}/colatitudinal_derivative_gaussian_grid.f90
5+
${source_dir}/colatitudinal_derivative_gaussian_grid_saved.f90
6+
${source_dir}/colatitudinal_derivative_regular_grid.f90
7+
${source_dir}/colatitudinal_derivative_regular_grid_saved.f90
8+
${source_dir}/colatitudinal_derivative_routines.f90
9+
${source_dir}/coordinate_transfer_routines.f90
10+
${source_dir}/divergence_gaussian_grid.f90
11+
${source_dir}/divergence_gaussian_grid_saved.f90
12+
${source_dir}/divergence_regular_grid.f90
13+
${source_dir}/divergence_regular_grid_saved.f90
14+
${source_dir}/divergence_routines.f90
15+
${source_dir}/gaussian_latitudes_and_weights_routines.f90
16+
${source_dir}/gradient_gaussian_grid.f90
17+
${source_dir}/gradient_gaussian_grid_saved.f90
18+
${source_dir}/gradient_regular_grid.f90
19+
${source_dir}/gradient_regular_grid_saved.f90
20+
${source_dir}/gradient_routines.f90
21+
${source_dir}/grid_transfer_routines.f90
22+
${source_dir}/grid_transfer_scalar_shift.f90
23+
${source_dir}/grid_transfer_scalar_transform.f90
24+
${source_dir}/grid_transfer_vector_shift.f90
25+
${source_dir}/grid_transfer_vector_transform.f90
26+
${source_dir}/icosahedral_geodesic_routines.f90
27+
${source_dir}/idvtec.f90
28+
${source_dir}/idvtes.f90
29+
${source_dir}/idvtgc.f90
30+
${source_dir}/idvtgs.f90
31+
${source_dir}/invert_divergence_gaussian_grid.f90
32+
${source_dir}/invert_divergence_gaussian_grid_saved.f90
33+
${source_dir}/invert_divergence_regular_grid.f90
34+
${source_dir}/invert_divergence_regular_grid_saved.f90
35+
${source_dir}/invert_gradient_gaussian_grid.f90
36+
${source_dir}/invert_gradient_gaussian_grid_saved.f90
37+
${source_dir}/invert_gradient_regular_grid.f90
38+
${source_dir}/invert_gradient_regular_grid_saved.f90
39+
${source_dir}/invert_scalar_laplacian_gaussian_grid.f90
40+
${source_dir}/invert_scalar_laplacian_gaussian_grid_saved.f90
41+
${source_dir}/invert_scalar_laplacian_regular_grid.f90
42+
${source_dir}/invert_scalar_laplacian_regular_grid_saved.f90
43+
${source_dir}/invert_vector_laplacian_gaussian_grid.f90
44+
${source_dir}/invert_vector_laplacian_gaussian_grid_saved.f90
45+
${source_dir}/invert_vector_laplacian_regular_grid.f90
46+
${source_dir}/invert_vector_laplacian_regular_grid_saved.f90
47+
${source_dir}/invert_vorticity_gaussian_grid.f90
48+
${source_dir}/invert_vorticity_gaussian_grid_saved.f90
49+
${source_dir}/invert_vorticity_regular_grid.f90
50+
${source_dir}/invert_vorticity_regular_grid_saved.f90
51+
${source_dir}/isfvpec.f90
52+
${source_dir}/isfvpes.f90
53+
${source_dir}/isfvpgc.f90
54+
${source_dir}/isfvpgs.f90
55+
${source_dir}/main.f90
56+
${source_dir}/scalar_analysis_gaussian_grid.f90
57+
${source_dir}/scalar_analysis_gaussian_grid_saved.f90
58+
${source_dir}/scalar_analysis_regular_grid.f90
59+
${source_dir}/scalar_analysis_regular_grid_saved.f90
60+
${source_dir}/scalar_analysis_routines.f90
61+
${source_dir}/scalar_laplacian_gaussian_grid.f90
62+
${source_dir}/scalar_laplacian_gaussian_grid_saved.f90
63+
${source_dir}/scalar_laplacian_regular_grid.f90
64+
${source_dir}/scalar_laplacian_regular_grid_saved.f90
65+
${source_dir}/scalar_laplacian_routines.f90
66+
${source_dir}/scalar_projection_gaussian_grid.f90
67+
${source_dir}/scalar_projection_regular_grid.f90
68+
${source_dir}/scalar_projection_routines.f90
69+
${source_dir}/scalar_synthesis_gaussian_grid.f90
70+
${source_dir}/scalar_synthesis_gaussian_grid_saved.f90
71+
${source_dir}/scalar_synthesis_regular_grid.f90
72+
${source_dir}/scalar_synthesis_regular_grid_saved.f90
73+
${source_dir}/scalar_synthesis_routines.f90
74+
${source_dir}/sfvpec.f90
75+
${source_dir}/sfvpes.f90
76+
${source_dir}/sfvpgc.f90
77+
${source_dir}/sfvpgs.f90
78+
${source_dir}/spherepack.f90
79+
${source_dir}/spherepack_interfaces.f90
80+
${source_dir}/spherepack_precision.f90
81+
${source_dir}/type_AssociatedLegendrePolynomialGenerator.f90
82+
${source_dir}/type_FastFourierTransform.f90
83+
${source_dir}/type_GaussianGrid.f90
84+
${source_dir}/type_GaussianSphere.f90
85+
${source_dir}/type_GaussianWorkspace.f90
86+
${source_dir}/type_RealHarmonicCoefficients.f90
87+
${source_dir}/type_RealPeriodicFastFourierTransform.f90
88+
${source_dir}/type_RegularGrid.f90
89+
${source_dir}/type_RegularSphere.f90
90+
${source_dir}/type_RegularWorkspace.f90
91+
${source_dir}/type_ScalarHarmonic.f90
92+
${source_dir}/type_Sphere.f90
93+
${source_dir}/type_SpherepackUtility.f90
94+
${source_dir}/type_SphericalGrid.f90
95+
${source_dir}/type_SphericalUnitVectors.f90
96+
${source_dir}/type_TrigonometricTable.f90
97+
${source_dir}/type_Vector3D.f90
98+
${source_dir}/type_VectorHarmonic.f90
99+
${source_dir}/type_VectorHarmonicCoefficients.f90
100+
${source_dir}/type_WavetableUtility.f90
101+
${source_dir}/type_Workspace.f90
102+
${source_dir}/vector_analysis_gaussian_grid.f90
103+
${source_dir}/vector_analysis_gaussian_grid_saved.f90
104+
${source_dir}/vector_analysis_regular_grid.f90
105+
${source_dir}/vector_analysis_regular_grid_saved.f90
106+
${source_dir}/vector_analysis_routines.f90
107+
${source_dir}/vector_laplacian_gaussian_grid.f90
108+
${source_dir}/vector_laplacian_gaussian_grid_saved.f90
109+
${source_dir}/vector_laplacian_regular_grid.f90
110+
${source_dir}/vector_laplacian_regular_grid_saved.f90
111+
${source_dir}/vector_laplacian_routines.f90
112+
${source_dir}/vector_synthesis_gaussian_grid.f90
113+
${source_dir}/vector_synthesis_gaussian_grid_saved.f90
114+
${source_dir}/vector_synthesis_regular_grid.f90
115+
${source_dir}/vector_synthesis_regular_grid_saved.f90
116+
${source_dir}/vector_synthesis_routines.f90
117+
${source_dir}/vorticity_gaussian_grid.f90
118+
${source_dir}/vorticity_gaussian_grid_saved.f90
119+
${source_dir}/vorticity_regular_grid.f90
120+
${source_dir}/vorticity_regular_grid_saved.f90
121+
${source_dir}/vorticity_routines.f90
122+
)
123+
124+
add_library(spherepack ${sources})
125+
126+
#set_target_properties(spherepack PROPERTIES FOLDER third_party_open/spherepack)
127+
128+
#target_link_libraries(spherepack PRIVATE no_compiler_warnings)

src/Core/Spherepack/LICENSE.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
PLEASE READ THIS SOFTWARE LICENSE ("LICENSE") CAREFULLY.
2+
3+
Copyright 2004 the University Corporation for Atmospheric
4+
Research ("UCAR"). All rights reserved. Developed by NCAR's
5+
Computational and Information Systems Laboratory, UCAR,
6+
http://www2.cisl.ucar.edu. Redistribution and use of the Software
7+
in source and binary forms, with or without modification, is
8+
permitted provided that the following conditions are met:
9+
10+
* Neither the names of NCAR's Computational and
11+
Information Systems Laboratory, the University Corporation for
12+
Atmospheric Research, nor the names of its sponsors or
13+
contributors may be used to endorse or promote products derived
14+
from this Software without specific prior written permission.
15+
16+
* Redistributions of source code must retain the above
17+
copyright notices, this list of conditions, and the disclaimer
18+
below.
19+
20+
* Redistributions in binary form must reproduce the above
21+
copyright notice, this list of conditions, and the disclaimer
22+
below in the documentation and/or other materials provided with
23+
the distribution.
24+
25+
THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26+
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES
27+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28+
NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT
29+
HOLDERS BE LIABLE FOR ANY CLAIM, INDIRECT, INCIDENTAL, SPECIAL,
30+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES OR OTHER LIABILITY, WHETHER
31+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
32+
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
33+
DEALINGS WITH THE SOFTWARE.
34+
35+
SPHEREPACK is a product of the Computational & Information
36+
Systems Laboratory at the National Center for Atmospheric
37+
Research (NCAR).

src/Core/Spherepack/LICENSE.mit.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
=====================
3+
4+
Copyright (c) 2016 Jon Lo Kim Lin
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

src/Core/Spherepack/README.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# **spherepack - A Fortran library of spherical harmonic transforms**
2+
3+
A modernization of NCAR's SPHEREPACK3.2.
4+
5+
* The original work, written in fixed-from FORTRAN 77, was heavily refactored to incorporate features of free-form modern Fortran (2008+).
6+
* Dynamic memory allocation procedures for analysis and synthesis are now hidden from the end user.
7+
8+
-----------------------------------------------------------------------------
9+
10+
## What is spherepack?
11+
12+
A collection of Fortran programs for computing common spherical differential operators including divergence, vorticity, latitudinal derivatives, gradients, the Laplacian of both scalar and vector functions, and the inverses of these operators.
13+
14+
For example, given divergence and vorticity, the package can be used to compute velocity components, then the Laplacian inverse can be used to solve the scalar and vector Poisson equations. The package also contains routines for computing the associated Legendre functions, Gaussian points and weights, multiple fast Fourier transforms, and for converting scalar and vector fields between geophysical and mathematical spherical coordinates.
15+
16+
Test programs are provided for solving these equations. Each program serves two purposes: as a template to guide you in writing your own codes utilizing the spherepack routines, and as a demonstration on your computer that you can correctly produce spherepack executables.
17+
18+
-----------------------------------------------------------------------------
19+
20+
## Usage
21+
22+
```fortran
23+
24+
use spherepack, only: &
25+
wp, & ! working precision
26+
GaussianSphere
27+
28+
! Explicit typing only
29+
implicit none
30+
31+
type(GaussianSphere) :: foo
32+
real(wp), allocatable :: scalar_function(:,:)
33+
real(wp), allocatable :: laplacian(:,:)
34+
real(wp), allocatable :: solution(:,:)
35+
36+
! Initialize object
37+
foo = GaussianSphere(nlat=19, nlon=36)
38+
39+
!.... generate some data
40+
41+
! Compute complex spectral coefficients
42+
call foo%perform_complex_analysis(scalar_function)
43+
44+
! Compute laplacian on sphere
45+
call foo%get_laplacian(scalar_function, laplacian)
46+
47+
! Invert laplacian on sphere
48+
call foo%invert_laplacian(laplacian, solution)
49+
50+
! Release memory
51+
call foo%destroy()
52+
53+
```
54+
55+
-----------------------------------------------------------------------------
56+
57+
## Requirements
58+
59+
* The GNU Make tool https://www.gnu.org/software/make/
60+
* The GNU gfortran compiler https://gcc.gnu.org/wiki/GFortran
61+
62+
-----------------------------------------------------------------------------
63+
64+
65+
## To build the project
66+
67+
Type the following command line arguments
68+
69+
```bash
70+
71+
git clone https://github.com/jlokimlin/spherepack.git; cd spherepack; make all
72+
```
73+
74+
-----------------------------------------------------------------------------
75+
76+
## Contributing
77+
78+
This project is still a work in progress and anyone is free to contribute under the proviso that they abstain from using the dreaded **go to**.
79+
80+
For bug reports or feature requests please open an issue on github.
81+
82+
-----------------------------------------------------------------------------
83+
84+
85+
## Bibliography
86+
87+
[1] Swarztrauber, Paul N. "On computing the points and weights for Gauss--Legendre quadrature." *SIAM Journal on Scientific Computing* 24.3 (2003): 945-954.
88+
89+
[2] Swarztrauber, Paul N., and William F. Spotz. "Generalized discrete spherical harmonic transforms." *Journal of Computational Physics* 159.2 (2000): 213-230.
90+
91+
[3] Adams, John C., and Paul N. Swarztrauber. "SPHEREPACK 3.0: A model development facility." *Monthly Weather Review* 127.8 (1999): 1872-1878.
92+
93+
[4] Swarztrauber, Paul N. "Spectral transform methods for solving the shallow-water equations on the sphere." *Monthly Weather Review* 124.4 (1996): 730-744.
94+
95+
[5] Williamson, David L., et al. "A standard test set for numerical approximations to the shallow water equations in spherical geometry." *Journal of Computational Physics* 102.1 (1992): 211-224.
96+
97+
98+

src/Core/Spherepack/README.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
From Deltares
2+
Commit e80da29462c5987162a0884baaab7434d0215467 of https://github.com/jlokimlin/spherepack/tree/e80da29462c5987162a0884baaab7434d0215467
3+
4+
Modified to fix compiler errors in intel fortran (e.g., public declared twice).

0 commit comments

Comments
 (0)