Skip to content

Commit

Permalink
Merge branch 'master' into scm801
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman authored Jan 4, 2025
2 parents 0ce74a1 + 7764c3a commit 0a1ce56
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion doc/rst/source/devdocs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ using the following steps:
- Run ``dvc diff`` to check that modified files are in the correct directory.
- Add the modified images to dvc using ``dvc add test/baseline/<module>/<newplot.ps>``, ``dvc add doc/scripts/images/<newplot.ps>``,
or ``dvc add doc/examples/images/<newplot.ps>``
depending on the type of test modified. RUn one dvc add command per updated PostScript plot.
depending on the type of test modified. Run one dvc add command per updated PostScript plot.
- Check that the .dvc file was updated by running ``git status``.
- Stage the modified .dvc files in git using ``git add test/baseline/<module>/<newplot.ps>.dvc``, ``git add doc/scripts/images/<newplot.ps>.dvc``,
or ``git add doc/examples/images/<newplot.ps>.dvc``, again per updated file.
Expand Down
5 changes: 3 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ message (STATUS "Searching dependent libraries. This may take a few minutes...")
find_package (NETCDF REQUIRED)
include_directories (${NETCDF_INCLUDE_DIR})

# libcurl is required since 5.4
find_package (CURL REQUIRED)
# libcurl is required since GMT 5.4
# At least version 7.55.0 is needed for src/gmt_remote.c
find_package (CURL 7.55.0 REQUIRED)
include_directories (${CURL_INCLUDE_DIRS})
list (APPEND GMT_OPTIONAL_LIBRARIES ${CURL_LIBRARIES})
set (CURL_LIBRARY ${CURL_LIBRARIES} CACHE INTERNAL "")
Expand Down
4 changes: 2 additions & 2 deletions src/gmt_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1168,9 +1168,9 @@ GMT_LOCAL void gmtinit_translate_to_short_options(struct GMTAPI_CTRL *API, struc
and also note that at this point we will always be at GMT_MSG_WARNING or whatever
default verbosity level the program is initialized with -- fix this later (or not)! */
#endif /* 0 */
if (modified) {
if (modified && gmt_M_is_verbose (API->GMT, GMT_MSG_INFORMATION)) { /* Echo the converted options */
char *cmd = GMT_Create_Cmd (API, *options);
GMT_Report (API, GMT_MSG_WARNING, "Reformatted options: %s\n", cmd);
GMT_Report (API, GMT_MSG_INFORMATION, "Reformatted options: %s\n", cmd);
GMT_Destroy_Cmd (API, &cmd); /* Free string */
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/gmt_remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ GMT_LOCAL size_t gmtremote_skip_large_files (struct GMT_CTRL *GMT, char * URL, s
/* Get the remote file's size and if too large we refuse to download */
CURL *curl = NULL;
CURLcode res;
double filesize = 0.0;
curl_off_t filesize = 0;
size_t action = 0;
char curl_useragent[GMT_LEN64];

Expand Down Expand Up @@ -677,10 +677,10 @@ GMT_LOCAL size_t gmtremote_skip_large_files (struct GMT_CTRL *GMT, char * URL, s
res = curl_easy_perform (curl);

if ((res = curl_easy_perform (curl)) == CURLE_OK) {
res = curl_easy_getinfo (curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &filesize);
res = curl_easy_getinfo (curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &filesize);
if ((res == CURLE_OK) && (filesize > 0.0)) { /* Got the size */
GMT_Report (GMT->parent, GMT_MSG_INFORMATION, "Remote file %s: Size is %0.0f bytes\n", URL, filesize);
action = (filesize < (double)limit) ? 0 : (size_t)filesize;
action = ((size_t)filesize < limit) ? 0 : (size_t)filesize;
}
}
else /* We failed */
Expand Down
2 changes: 1 addition & 1 deletion src/grdedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ EXTERN_MSC int GMT_grdedit (void *V_API, int mode, void *args) {
if (Ctrl->A.active) {
G->header->inc[GMT_X] = gmt_M_get_inc (GMT, G->header->wesn[XLO], G->header->wesn[XHI], G->header->n_columns, G->header->registration);
G->header->inc[GMT_Y] = gmt_M_get_inc (GMT, G->header->wesn[YLO], G->header->wesn[YHI], G->header->n_rows, G->header->registration);
GMT_Report (API, GMT_MSG_INFORMATION, "Reset grid-spacing in file %s to %g/%g\n",
GMT_Report (API, GMT_MSG_INFORMATION, "Reset grid-spacing in file %s to %.14g/%.14g\n",
out_file, G->header->inc[GMT_X], G->header->inc[GMT_Y]);
}
if (gmt_M_is_geographic (GMT, GMT_IN) && gmt_M_is_cartesian (GMT, GMT_OUT)) { /* Force a switch from geographic to Cartesian */
Expand Down
13 changes: 5 additions & 8 deletions src/seis/gmtisf.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,7 @@ static int parse(struct GMT_CTRL *GMT, struct READISF_CTRL *Ctrl, struct GMT_OPT
* returned when registering these sources/destinations with the API.
*/

unsigned int n_errors = 0, n_files = 0, pos = 0;
int i, j, k;
size_t n_alloc = 0, len;
char txt_a[GMT_LEN256] = {""}, txt_b[GMT_LEN256] = {""}, p[GMT_BUFSIZ] = {""};
unsigned int n_errors = 0, n_files = 0;
char *pch = NULL;
double t;
struct GMT_OPTION *opt = NULL;
Expand Down Expand Up @@ -175,8 +172,7 @@ EXTERN_MSC int GMT_gmtisf(void *V_API, int mode, void *args) { /* High-level fun
char f_type[6], f_plane[6];
bool got_event = false, event_end, tensor_end, got_region = false;
int error = GMT_NOERROR;
int i, in, mag_c = 0, event_c, idx_min_rms, np, ns, n_out_cols;
int export_aki = false, export_cmt = false, export_tensor = false;
int i, mag_c = 0, event_c, idx_min_rms, np, ns, n_out_cols;
int yyyy,mm,dd,hh,mi,ss,msec,strike,ndef,nsta,gap;
int *years, *months, *days, *hours, *minutes;
float stime,sdobs,lat,lon,depth,smaj,smin,sdepth,mindist,maxdist;
Expand Down Expand Up @@ -317,8 +313,9 @@ EXTERN_MSC int GMT_gmtisf(void *V_API, int mode, void *args) { /* High-level fun
else if (!read_axes_head(line)) {
if (fgets(line, ISF_LINE_LEN, fp) != NULL)
if (!read_axes(line, &scale_factor, &t_val, &t_azim, &t_pl, &b_val, &b_azim,
&b_pl, &p_val, &p_azim, &p_pl,author));
tensor_end = true;
&b_pl, &p_val, &p_azim, &p_pl,author))
;
tensor_end = true;
}
else if (tensor_end && !read_netmag_head(line)) {
mag_c = read_mags(fp,line,magtype,&magind,&mag,&magerr,&nsta,author,origid,mag_t,mags);
Expand Down
2 changes: 1 addition & 1 deletion src/seis/read_isf.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ int read_event_data(FILE *fp, char *line, int *yyyy, int *mm, int *dd, int *hh,
int *months, int *days, int *hours, int *minutes, int *idx_min_rms) {

int done = false, event_c = 0;
float rms_min = 1e9, gap_min = 360;
float gap_min = 360;
*idx_min_rms = 0; /* I'm currently using GAP instead of RMS */

while (!done && (fgets (line, ISF_LINE_LEN, fp) != NULL)) {
Expand Down

0 comments on commit 0a1ce56

Please sign in to comment.