[cig-commits] [commit] master: Minor changes to update README and adjust for most recent GMT4 versions. (0838662)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Mon Jun 23 04:46:36 PDT 2014


Repository : https://github.com/geodynamics/hc

On branch  : master
Link       : https://github.com/geodynamics/hc/compare/fe95ac7a8f5486bd2282c982596733498717b01f...083866227646cf04c246bf7328fe06479ae956fb

>---------------------------------------------------------------

commit 083866227646cf04c246bf7328fe06479ae956fb
Author: thwbecker <thorstinski at gmail.com>
Date:   Mon Jun 23 13:43:14 2014 +0200

    Minor changes to update README and adjust for most recent GMT4 versions.


>---------------------------------------------------------------

083866227646cf04c246bf7328fe06479ae956fb
 Makefile             |   4 +-
 Makefile.include     |   4 +-
 README.TXT           |  37 ++++++----
 ggrd_grdtrack_util.c |   2 +-
 hc_auto_proto.h      | 186 +++++++++++++++++++++++++--------------------------
 rick_sh_c.c          |   9 ++-
 6 files changed, 125 insertions(+), 117 deletions(-)

diff --git a/Makefile b/Makefile
index bc2fe30..cc8c20d 100644
--- a/Makefile
+++ b/Makefile
@@ -6,9 +6,7 @@
 #
 # see source files for comments and reference to original authors
 # 
-# 
-#
-#
+
 #
 # EDIT HERE FOR GMT VERSION 
 #
diff --git a/Makefile.include b/Makefile.include
index deb7dd2..cb3625e 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -6,10 +6,10 @@
 #
 #
 # quad precision
-#ADD_FLAGS = -DHC_PRECISION=32 -O2 
+ADD_FLAGS = -DHC_PRECISION=32 -O2 
 #
 # double precision
-ADD_FLAGS = -O2 
+#ADD_FLAGS = -O2 
 
 GGRD_INC_FLAGS = -I$(GMTHOME)/include -I$(NETCDFHOME)/include 
 GGRD_LIBS_LINKLINE = -lggrd -lgmt -lpsl -lnetcdf 
diff --git a/README.TXT b/README.TXT
index 9444e19..1994876 100644
--- a/README.TXT
+++ b/README.TXT
@@ -1,12 +1,10 @@
 README FOR HC
 
-Version 1.0.1
+Version 1.0.2
 
 Thorsten Becker - twb at usc.edu
 
 
-
-
 HC is a global mantle circulation solver following Hager & O'Connell
 (1981) which can compute velocities, tractions, and geoid for simple
 density distributions and plate velocities.
@@ -18,11 +16,11 @@ Based on code by Brad Hager, Richard O'Connell, and Bernhard
 Steinberger, this version is by Thorsten Becker and Craig O'Neill.
 
 Note also that the Solid Earth Teaching and Research Environment
-(SEATREE)
-
-     http://geosys.usc.edu/projects/seatree/
-
-provides a convenient user interface for HC.
+(SEATREE, http://geosys.usc.edu/projects/seatree/), as preinstalled
+with software as a VirtualBox available from the USC Geodynamics Earth
+Science Computing Environment (UGESCE,
+http://geodynamics.usc.edu/~becker/ugesce.html) provides a convenient
+user interface for HC.
 
 
 INSTALLATION
@@ -100,8 +98,6 @@ below.
 Example input data is provided in subdirectory example_data/
 
 >>>
-
-becker at walter:~/progs/src/hc-svn                                                                                                                        > hc -help
 hc - perform Hager & O'Connell flow computation
 
 This code can compute velocities, tractions, and geoid for simple density distributions
@@ -122,6 +118,7 @@ and provide lots of output. Default setting is quiet operation.
 
 See README.TXT in the installation directory for example for how to plot output, and
 http://geosys.usc.edu/projects/seatree/ for a graphical user interface.
+http://geodynamics.usc.edu/~becker/ugesce.html for a VirtualBox install.
 
 density anomaly options:
 -dens	name	use name as a SH density anomaly model (dens.sh.dat)
@@ -137,8 +134,6 @@ Earth model options:
 -prem	name	set Earth model to name (prem/prem.dat)
 -vf	name	viscosity structure filename (visc.dat), use pvisc.py to edit
 		This file is in non_dim_radius viscosity[Pas] format
-		if name is "visc_scan", will loop through a four layer viscosity scan
-
 boundary condition options:
 -fs		perform free slip computation (ON)
 -ns		perform no slip computation (OFF)
@@ -150,6 +145,7 @@ boundary condition options:
 -vtime	time	use this particular time step of the plate velocities (-1)
 
 solution procedure and I/O options:
+-cbckl	val	will modify CMB boundary condition for all l > val with solver kludge (2147483647)
 -ng		do not compute and print the geoid (1)
 -ag		compute geoid at all layer depths, as opposed to the surface only
 -rg	name	compute correlation of surface geoid with that in file "name",
@@ -162,9 +158,16 @@ solution procedure and I/O options:
 
 
 
-
 <<<
 
+KNOWN LIMITATIONS
+
+The propagator matrix approach can be unstable for moderately high
+maximum degrees. This behavior can be addressed partially by compiling
+HC in quadruple precision, and kinematic boundary can be addressed
+with a kludge, see -cbckl. 
+
+
 SPHERICAL HARMONICS FORMAT
 
 
@@ -333,6 +336,14 @@ computations and plotting.
 
 https://geosys.usc.edu/projects/seatree/wiki/ 
      
+UGESCE
+
+The USC Geodynamics Earth Science Computing Environment (UGESCE,
+http://geodynamics.usc.edu/~becker/ugesce.html) provides a VirtualBox
+Linux install that includes SEATREE, HC, and a range of other Earth
+Science data and software, all in one (big) package, ready to go.
+
+
 
 
 				   
diff --git a/ggrd_grdtrack_util.c b/ggrd_grdtrack_util.c
index 7124a10..e2d4dd8 100644
--- a/ggrd_grdtrack_util.c
+++ b/ggrd_grdtrack_util.c
@@ -246,7 +246,7 @@ ggrd_boolean ggrd_grdtrack_interpolate_rtp(double r,double t,double p,
 
 this is almost redundant, use lon lat in degrees and z in [km] depth
 
- */
+*/
 ggrd_boolean ggrd_grdtrack_interpolate_lonlatz(double lon,double lat,double z,
 					       struct ggrd_gt *g,
 					       double *value,
diff --git a/hc_auto_proto.h b/hc_auto_proto.h
index 40bbd3e..b5cbdb5 100644
--- a/hc_auto_proto.h
+++ b/hc_auto_proto.h
@@ -42,88 +42,88 @@ void hc_init_parameters(struct hc_parameters *);
 void hc_struc_init(struct hcs **);
 void hc_init_polsol_struct(struct hc_ps *);
 void hc_init_main(struct hcs *, int, struct hc_parameters *);
-void hc_init_constants(struct hcs *, double, char *, unsigned short);
+void hc_init_constants(struct hcs *, long double, char *, unsigned short);
 void hc_handle_command_line(int, char **, int, struct hc_parameters *);
-void hc_assign_viscosity(struct hcs *, int, double [4], struct hc_parameters *);
-void hc_assign_density(struct hcs *, unsigned short, int, char *, int, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short, int, double *, double *, unsigned short);
-double hc_find_dens_scale(double, double, unsigned short, double *, double *, int);
+void hc_assign_viscosity(struct hcs *, int, long double [4], struct hc_parameters *);
+void hc_assign_density(struct hcs *, unsigned short, int, char *, int, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short, int, long double *, long double *, unsigned short);
+long double hc_find_dens_scale(long double, long double, unsigned short, long double *, long double *, int);
 void hc_init_phase_boundaries(struct hcs *, int, unsigned short);
 void hc_assign_plate_velocities(struct hcs *, int, char *, unsigned short, int, unsigned short, unsigned short, unsigned short);
 void hc_init_single_plate_exp(char *, struct hcs *, unsigned short, struct sh_lms *, unsigned short, unsigned short, unsigned short);
 void hc_init_l_factors(struct hcs *, int);
 void hc_get_blank_expansions(struct sh_lms **, int, int, char *);
 void hc_struc_free(struct hcs **);
-void hc_assign_dd_scaling(int, double [4], struct hc_parameters *, double);
+void hc_assign_dd_scaling(int, long double [4], struct hc_parameters *, long double);
 void hc_read_scalar_shexp(char *, struct sh_lms **, char *, struct hc_parameters *);
-void hc_select_pvel(double, struct pvels *, struct sh_lms *, unsigned short);
+void hc_select_pvel(long double, struct pvels *, struct sh_lms *, unsigned short);
 /* hc_input.c */
 int hc_read_sh_solution(struct hcs *, struct sh_lms **, FILE *, unsigned short, unsigned short);
 /* hc_invert_dtopo.c */
 /* hc_matrix.c */
-void hc_ludcmp_3x3(double [3][3], int, int *);
-void hc_lubksb_3x3(double [3][3], int, int *, double *);
+void hc_ludcmp_3x3(long double [3][3], int, int *);
+void hc_lubksb_3x3(long double [3][3], int, int *, long double *);
 /* hc_misc.c */
-void hc_hvecalloc(double **, int, char *);
+void hc_hvecalloc(long double **, int, char *);
 void hc_dvecalloc(double **, int, char *);
 void hc_svecalloc(float **, int, char *);
 void hc_ivecalloc(int **, int, char *);
-void hc_vecalloc(double **, int, char *);
+void hc_vecalloc(long double **, int, char *);
 void hc_scmplx_vecalloc(struct hc_scmplx **, int, char *);
 void hc_svecrealloc(float **, int, char *);
-void hc_dvecrealloc(double **, int, char *);
-void hc_vecrealloc(double **, int, char *);
-float hc_vec_rms_diff(double *, double *, int);
-float hc_vec_rms(double *, int);
+void hc_dvecrealloc(long double **, int, char *);
+void hc_vecrealloc(long double **, int, char *);
+float hc_vec_rms_diff(long double *, long double *, int);
+float hc_vec_rms(long double *, int);
 void hc_a_equals_b_svector(float *, float *, int);
-void hc_a_equals_b_vector(double *, double *, int);
+void hc_a_equals_b_vector(long double *, long double *, int);
 float hc_mean_svec(float *, int);
-double hc_mean_vec(double *, int);
-void hc_zero_dvector(double *, int);
+long double hc_mean_vec(long double *, int);
+void hc_zero_dvector(long double *, int);
 void hc_zero_lvector(unsigned short *, int);
 void hc_get_flt_frmt_string(char *, int, unsigned short);
 char *hc_name_boolean(unsigned short);
 unsigned short hc_toggle_boolean(unsigned short *);
 void hc_advance_argument(int *, int, char **);
-void hc_compute_correlation(struct sh_lms *, struct sh_lms *, double *, int, unsigned short);
-void lonlatpv2cv(double, float, double *, double *);
-void lonlatpv2cv_with_base(double *, double *, double *);
-void calc_polar_base_at_theta_phi(double, double, double *);
-void hc_linear_interpolate(double *, int, double, int *, int *, double *, double *);
+void hc_compute_correlation(struct sh_lms *, struct sh_lms *, long double *, int, unsigned short);
+void lonlatpv2cv(long double, float, long double *, long double *);
+void lonlatpv2cv_with_base(long double *, long double *, long double *);
+void calc_polar_base_at_theta_phi(long double, long double, long double *);
+void hc_linear_interpolate(long double *, int, long double, int *, int *, long double *, long double *);
 /* hc_output.c */
 void hc_print_spectral_solution(struct hcs *, struct sh_lms *, FILE *, int, unsigned short, unsigned short);
 void hc_print_sh_scalar_field(struct sh_lms *, FILE *, unsigned short, unsigned short, unsigned short);
-void hc_print_spatial_solution(struct hcs *, struct sh_lms *, double *, char *, char *, int, unsigned short, unsigned short);
+void hc_print_spatial_solution(struct hcs *, struct sh_lms *, long double *, char *, char *, int, unsigned short, unsigned short);
 void hc_print_depth_layers(struct hcs *, FILE *, unsigned short);
-void hc_print_3x3(double [3][3], FILE *);
-void hc_print_sm(double [6][4], FILE *);
-void hc_print_vector(double *, int, FILE *);
-void hc_print_vector_label(double *, int, FILE *, char *);
-void hc_print_matrix_label(double *, int, int, FILE *, char *);
-void hc_print_vector_row(double *, int, FILE *);
-void hc_compute_solution_scaling_factors(struct hcs *, int, double, double, double *);
+void hc_print_3x3(long double [3][3], FILE *);
+void hc_print_sm(long double [6][4], FILE *);
+void hc_print_vector(long double *, int, FILE *);
+void hc_print_vector_label(long double *, int, FILE *, char *);
+void hc_print_matrix_label(long double *, int, int, FILE *, char *);
+void hc_print_vector_row(long double *, int, FILE *);
+void hc_compute_solution_scaling_factors(struct hcs *, int, long double, long double, long double *);
 void hc_print_poloidal_solution(struct sh_lms *, struct hcs *, int, char *, unsigned short, unsigned short);
-void hc_print_toroidal_solution(double *, int, struct hcs *, int, char *, unsigned short);
-void hc_print_vtk(FILE *, double *, double *, int, int, unsigned short, int, double *, int, int);
-int hc_print_be_float(double *, int, FILE *, unsigned short);
-int hc_print_float(double *, int, FILE *);
-int hc_read_float(double *, int, FILE *);
+void hc_print_toroidal_solution(long double *, int, struct hcs *, int, char *, unsigned short);
+void hc_print_vtk(FILE *, long double *, long double *, int, int, unsigned short, int, long double *, int, int);
+int hc_print_be_float(long double *, int, FILE *, unsigned short);
+int hc_print_float(long double *, int, FILE *);
+int hc_read_float(long double *, int, FILE *);
 void hc_print_be_int(int *, int, FILE *, unsigned short);
 unsigned short hc_is_little_endian(void);
 void hc_flip_byte_order(void *, size_t);
 void hc_flipit(void *, void *, size_t);
 void hc_print_dens_anom(struct hcs *, FILE *, unsigned short, unsigned short);
 /* hc_polsol.c */
-void hc_polsol(struct hcs *, int, double *, int, double *, unsigned short, struct sh_lms *, unsigned short, int, double *, double *, unsigned short, struct sh_lms *, struct sh_lms *, unsigned short, struct sh_lms *, unsigned short, unsigned short, unsigned short);
+void hc_polsol(struct hcs *, int, long double *, int, long double *, unsigned short, struct sh_lms *, unsigned short, int, long double *, long double *, unsigned short, struct sh_lms *, struct sh_lms *, unsigned short, struct sh_lms *, unsigned short, unsigned short, unsigned short);
 /* hc_propagator.c */
-void hc_evalpa(int, double, double, double, double *);
-void hc_evppot(int, double, double *);
+void hc_evalpa(int, long double, long double, long double, long double *);
+void hc_evppot(int, long double, long double *);
 /* hc_solve.c */
 void hc_solve(struct hcs *, unsigned short, int, struct sh_lms *, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short, struct sh_lms *, struct sh_lms *, struct sh_lms *, unsigned short);
 void hc_sum(struct hcs *, int, struct sh_lms *, struct sh_lms *, int, unsigned short, struct sh_lms *, unsigned short);
-void hc_compute_sol_spatial(struct hcs *, struct sh_lms *, double **, unsigned short);
+void hc_compute_sol_spatial(struct hcs *, struct sh_lms *, long double **, unsigned short);
 void hc_compute_dynamic_topography(struct hcs *, struct sh_lms *, struct sh_lms **, unsigned short, unsigned short);
 /* hc_torsol.c */
-void hc_torsol(struct hcs *, int, int, int, double *, double **, double **, struct sh_lms *, struct sh_lms *, double *, unsigned short);
+void hc_torsol(struct hcs *, int, int, int, long double *, long double **, long double **, struct sh_lms *, struct sh_lms *, long double *, unsigned short);
 /* hc_visc_scan.c */
 /* prem2dsm.c */
 /* prem_util.c */
@@ -139,89 +139,89 @@ int prem_read_model(char *, struct prem_model *, unsigned short);
 int prem_read_para_set(double *, int, int, FILE *);
 /* print_gauss_lat.c */
 /* rick_fft_c.c */
-void rick_cs2ab(double *, int);
-void rick_ab2cs(double *, int);
-void rick_realft_nr(double *, int, int);
-void rick_four1_nr(double *, int, int);
+void rick_cs2ab(long double *, int);
+void rick_ab2cs(long double *, int);
+void rick_realft_nr(long double *, int, int);
+void rick_four1_nr(long double *, int, int);
 /* rick_sh_c.c */
-void rick_compute_allplm(int, int, double *, double *, struct rick_module *);
-void rick_compute_allplm_reg(int, int, double *, double *, struct rick_module *, double *, int);
-void rick_pix2ang(int, int, double *, double *, struct rick_module *);
-void rick_shc2d(double *, double *, int, int, double *, double *, struct rick_module *);
-void rick_shc2d_reg(double *, double *, int, int, double *, double *, struct rick_module *, double *, int, double *, int, unsigned short);
-void rick_shc2d_pre(double *, double *, int, double *, double *, int, double *, double *, struct rick_module *);
-void rick_shc2d_pre_reg(double *, double *, int, double *, double *, int, double *, double *, struct rick_module *, double *, int, double *, int, unsigned short);
-void rick_shc2d_irreg(double *, double *, int, int, double *, double *, struct rick_module *, double *, double *, int);
-void rick_shd2c(double *, double *, int, int, double *, double *, struct rick_module *);
-void rick_shd2c_pre(double *, double *, int, double *, double *, int, double *, double *, struct rick_module *);
+void rick_compute_allplm(int, int, long double *, long double *, struct rick_module *);
+void rick_compute_allplm_reg(int, int, long double *, long double *, struct rick_module *, long double *, int);
+void rick_pix2ang(int, int, long double *, long double *, struct rick_module *);
+void rick_shc2d(long double *, long double *, int, int, long double *, long double *, struct rick_module *);
+void rick_shc2d_reg(long double *, long double *, int, int, long double *, long double *, struct rick_module *, long double *, int, long double *, int, unsigned short);
+void rick_shc2d_pre(long double *, long double *, int, long double *, long double *, int, long double *, long double *, struct rick_module *);
+void rick_shc2d_pre_reg(long double *, long double *, int, long double *, long double *, int, long double *, long double *, struct rick_module *, long double *, int, long double *, int, unsigned short);
+void rick_shc2d_irreg(long double *, long double *, int, int, long double *, long double *, struct rick_module *, long double *, long double *, int);
+void rick_shd2c(long double *, long double *, int, int, long double *, long double *, struct rick_module *);
+void rick_shd2c_pre(long double *, long double *, int, long double *, long double *, int, long double *, long double *, struct rick_module *);
 void rick_init(int, int, int *, int *, int *, struct rick_module *, unsigned short);
 void rick_free_module(struct rick_module *, int);
-void rick_plmbar1(double *, double *, int, int, double, struct rick_module *);
-void rick_gauleg(double, double, double *, double *, int);
+void rick_plmbar1(long double *, long double *, int, int, long double, struct rick_module *);
+void rick_gauleg(long double, long double, long double *, long double *, int);
 /* rotvec2vel.c */
 FILE *rv_myopen(const char *, const char *);
 /* sh_ana.c */
 /* shana_sh.c */
 void shana_compute_allplm(int, int, double *, double *, struct shana_module *);
 void shana_pix2ang(int, int, double *, double *, struct shana_module *);
-void shana_shc2d(double *, double *, int, int, double *, double *, struct shana_module *);
-void shana_shc2d_pre(double *, double *, int, double *, double *, int, float *, float *, struct shana_module *);
-void shana_shd2c(double *, double *, int, int, double *, double *, struct shana_module *);
-void shana_shd2c_pre(double *, double *, int, double *, double *, int, double *, double *, struct shana_module *);
+void shana_shc2d(long double *, long double *, int, int, long double *, long double *, struct shana_module *);
+void shana_shc2d_pre(long double *, long double *, int, double *, double *, int, float *, float *, struct shana_module *);
+void shana_shd2c(long double *, long double *, int, int, long double *, long double *, struct shana_module *);
+void shana_shd2c_pre(long double *, long double *, int, double *, double *, int, long double *, long double *, struct shana_module *);
 void shana_init(int, int, int *, int *, int *, struct shana_module *);
 void shana_free_module(struct shana_module *, int);
-void shana_plmbar1(double *, double *, int, int, double, struct shana_module *);
+void shana_plmbar1(double *, double *, int, int, long double, struct shana_module *);
 /* sh_corr.c */
 /* sh_exp.c */
 void sh_allocate_and_init(struct sh_lms **, int, int, int, int, unsigned short, unsigned short);
 void sh_init_expansion(struct sh_lms *, int, int, int, unsigned short, unsigned short);
 void sh_free_expansion(struct sh_lms *, int);
 void sh_clear_alm(struct sh_lms *);
-double sh_total_power(struct sh_lms *);
-void sh_compute_power_per_degree(struct sh_lms *, double *);
-double sh_correlation(struct sh_lms *, struct sh_lms *, int);
-double sh_correlation_per_degree(struct sh_lms *, struct sh_lms *, int, int);
+long double sh_total_power(struct sh_lms *);
+void sh_compute_power_per_degree(struct sh_lms *, long double *);
+long double sh_correlation(struct sh_lms *, struct sh_lms *, int);
+long double sh_correlation_per_degree(struct sh_lms *, struct sh_lms *, int, int);
 void sh_single_par_and_exp_to_file(struct sh_lms *, char *, unsigned short, unsigned short);
 void sh_single_par_and_exp_to_stream(struct sh_lms *, FILE *, unsigned short, unsigned short);
-void sh_print_parameters_to_stream(struct sh_lms *, int, int, int, double, FILE *, unsigned short, unsigned short, unsigned short);
-unsigned short sh_read_parameters_from_stream(int *, int *, int *, int *, int *, double *, int *, FILE *, unsigned short, unsigned short, unsigned short);
-void sh_print_coefficients_to_stream(struct sh_lms *, int, FILE *, double *, unsigned short, unsigned short);
-void sh_read_coefficients_from_stream(struct sh_lms *, int, int, FILE *, unsigned short, double *, unsigned short);
+void sh_print_parameters_to_stream(struct sh_lms *, int, int, int, long double, FILE *, unsigned short, unsigned short, unsigned short);
+unsigned short sh_read_parameters_from_stream(int *, int *, int *, int *, int *, long double *, int *, FILE *, unsigned short, unsigned short, unsigned short);
+void sh_print_coefficients_to_stream(struct sh_lms *, int, FILE *, long double *, unsigned short, unsigned short);
+void sh_read_coefficients_from_stream(struct sh_lms *, int, int, FILE *, unsigned short, long double *, unsigned short);
 void sh_print_nonzero_coeff(struct sh_lms *, FILE *);
-void sh_read_spatial_data_from_stream(struct sh_lms *, FILE *, unsigned short, int, double *, double *);
-void sh_read_spatial_data_from_grd(struct sh_lms *, struct ggrd_gt *, unsigned short, int, double *, double *);
-void sh_read_spatial_data(struct sh_lms *, FILE *, struct ggrd_gt *, unsigned short, unsigned short, int, double *, double *);
-void sh_compute_spatial_basis(struct sh_lms *, FILE *, unsigned short, double, double **, int, unsigned short);
-void sh_compute_spectral(double *, int, unsigned short, double **, struct sh_lms *, unsigned short);
-void sh_compute_spatial(struct sh_lms *, int, unsigned short, double **, double *, unsigned short);
-void sh_compute_spatial_reg(struct sh_lms *, int, unsigned short, double **, double *, int, double *, int, double *, unsigned short, unsigned short);
-void sh_compute_spatial_irreg(struct sh_lms *, int, double *, double *, int, double *, unsigned short);
+void sh_read_spatial_data_from_stream(struct sh_lms *, FILE *, unsigned short, int, long double *, long double *);
+void sh_read_spatial_data_from_grd(struct sh_lms *, struct ggrd_gt *, unsigned short, int, long double *, long double *);
+void sh_read_spatial_data(struct sh_lms *, FILE *, struct ggrd_gt *, unsigned short, unsigned short, int, long double *, long double *);
+void sh_compute_spatial_basis(struct sh_lms *, FILE *, unsigned short, long double, long double **, int, unsigned short);
+void sh_compute_spectral(long double *, int, unsigned short, long double **, struct sh_lms *, unsigned short);
+void sh_compute_spatial(struct sh_lms *, int, unsigned short, long double **, long double *, unsigned short);
+void sh_compute_spatial_reg(struct sh_lms *, int, unsigned short, long double **, long double *, int, long double *, int, long double *, unsigned short, unsigned short);
+void sh_compute_spatial_irreg(struct sh_lms *, int, long double *, long double *, int, long double *, unsigned short);
 void sh_exp_type_error(char *, struct sh_lms *);
-void sh_print_plm(double *, int, int, int, FILE *);
-void sh_print_spatial_data_to_stream(struct sh_lms *, int, double *, unsigned short, double, FILE *);
-void sh_get_coordinates(struct sh_lms *, int, double *, double *);
-void sh_print_reg_spatial_data_to_stream(struct sh_lms *, int, double *, unsigned short, double, double *, int, double *, int, FILE *);
-void sh_print_irreg_spatial_data_to_stream(struct sh_lms *, int, double *, unsigned short, double, double *, double *, int, FILE *);
-void sh_compute_plm(struct sh_lms *, int, double **, unsigned short);
-void sh_compute_plm_reg(struct sh_lms *, int, double **, unsigned short, double *, int);
-void sh_get_coeff(struct sh_lms *, int, int, int, unsigned short, double *);
-void sh_write_coeff(struct sh_lms *, int, int, int, unsigned short, double *);
-void sh_add_coeff(struct sh_lms *, int, int, int, unsigned short, double *);
+void sh_print_plm(long double *, int, int, int, FILE *);
+void sh_print_spatial_data_to_stream(struct sh_lms *, int, long double *, unsigned short, long double, FILE *);
+void sh_get_coordinates(struct sh_lms *, int, long double *, long double *);
+void sh_print_reg_spatial_data_to_stream(struct sh_lms *, int, long double *, unsigned short, long double, long double *, int, long double *, int, FILE *);
+void sh_print_irreg_spatial_data_to_stream(struct sh_lms *, int, long double *, unsigned short, long double, long double *, long double *, int, FILE *);
+void sh_compute_plm(struct sh_lms *, int, long double **, unsigned short);
+void sh_compute_plm_reg(struct sh_lms *, int, long double **, unsigned short, long double *, int);
+void sh_get_coeff(struct sh_lms *, int, int, int, unsigned short, long double *);
+void sh_write_coeff(struct sh_lms *, int, int, int, unsigned short, long double *);
+void sh_add_coeff(struct sh_lms *, int, int, int, unsigned short, long double *);
 void sh_copy_lms(struct sh_lms *, struct sh_lms *);
 void sh_aexp_equals_bexp_coeff(struct sh_lms *, struct sh_lms *);
 void sh_c_is_a_plus_b_coeff(struct sh_lms *, struct sh_lms *, struct sh_lms *);
-void sh_scale_expansion_l_factor(struct sh_lms *, double *);
-void sh_scale_expansion(struct sh_lms *, double);
+void sh_scale_expansion_l_factor(struct sh_lms *, long double *);
+void sh_scale_expansion(struct sh_lms *, long double);
 /* sh_extract_layer.c */
 /* sh_model.c */
 void sh_init_model(struct sh_lms_model *, int, int, int, int, int, int, unsigned short);
 void sh_free_model(struct sh_lms_model *);
 void sh_print_model_coefficients(struct sh_lms_model *, FILE *, unsigned short, unsigned short);
 void sh_print_model_spatial_basis(struct sh_lms_model *, FILE *, unsigned short);
-void sh_read_model_spatial_data(struct sh_lms_model *, double **, FILE *, unsigned short);
-void sh_compute_model_spectral(struct sh_lms_model *, double *, unsigned short);
-void sh_compute_model_spatial(struct sh_lms_model *, double **, unsigned short);
-void sh_print_model_spatial_data(struct sh_lms_model *, double *, FILE *, unsigned short);
+void sh_read_model_spatial_data(struct sh_lms_model *, long double **, FILE *, unsigned short);
+void sh_compute_model_spectral(struct sh_lms_model *, long double *, unsigned short);
+void sh_compute_model_spatial(struct sh_lms_model *, long double **, unsigned short);
+void sh_print_model_spatial_data(struct sh_lms_model *, long double *, FILE *, unsigned short);
 /* sh_power.c */
 /* sh_syn.c */
 /* sh_test.c */
diff --git a/rick_sh_c.c b/rick_sh_c.c
index 540be22..894fadb 100644
--- a/rick_sh_c.c
+++ b/rick_sh_c.c
@@ -364,7 +364,7 @@ void rick_shc2d_pre_reg(SH_RICK_PREC *cslm,SH_RICK_PREC *dslm,
   if(ivec == 0){
     /* 
 
-    scalar
+       scalar
 
     */
     rick_vecrealloc(&loc_plma,ntheta*rick->lmsize,"rick_shc2d_pre_reg 3");
@@ -426,9 +426,9 @@ void rick_shc2d_pre_reg(SH_RICK_PREC *cslm,SH_RICK_PREC *dslm,
 	  
 	  /* 
 	     
-	  add up contributions from all l,m 
+	     add up contributions from all l,m 
 	  
-	  u_theta
+	     u_theta
 	  
 	  */
 	  rdatax[idata] +=   /* cos term */
@@ -465,12 +465,11 @@ void rick_shc2d_irreg(SH_RICK_PREC *cslm,SH_RICK_PREC *dslm,
   // */
   SH_RICK_HIGH_PREC  dpdt,dpdp,mphi,sin_theta,sfac,cfac;
   SH_RICK_PREC *plm=NULL,*dplm=NULL;
-  int  i,k,k2,m,l,lmaxp1,lm1;
+  int  i,k,k2,m,l,lm1;
   if(!rick->initialized){
     fprintf(stderr,"rick_shc2d_pre_reg: error: initialize modules first\n");
     exit(-1);
   }
-  lmaxp1 = lmax + 1;               
   if((lmax+1)*(lmax+2)/2 > rick->lmsize){
     fprintf(stderr,"rick_shc2d_pre_reg: error: lmax %i out of bounds\n",lmax);
       exit(-1);



More information about the CIG-COMMITS mailing list