Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revised two files (input_tools.c in share_all and CalcBlowingSnow.c in vic_run) to avoid warnings. #848

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions vic/drivers/shared_all/src/input_tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ str_to_bool(char str[])
else {
log_err("%s is neither TRUE nor FALSE", str);
}
return false; // To avoid warnings.
}

/******************************************************************************
Expand Down Expand Up @@ -132,6 +133,7 @@ str_to_agg_type(char aggstr[])
log_err("Unknown aggregation type found: %s", aggstr);
}
}
return 0; // To avoid warnings.
}

/******************************************************************************
Expand Down Expand Up @@ -166,6 +168,7 @@ str_to_out_type(char typestr[])
log_err("Unknown out type found: %s", typestr);
}
}
return 0; // To avoid warnings.
}

/******************************************************************************
Expand All @@ -180,6 +183,7 @@ str_to_out_mult(char multstr[])
else {
return (double) atof(multstr);
}
return 0.; // To avoid warnings.
}

/******************************************************************************
Expand Down Expand Up @@ -221,6 +225,7 @@ str_to_freq_flag(char freq[])
else {
log_err("Unknown frequency flag found: %s", freq);
}
return 0; // To avoid warnings.
}

/******************************************************************************
Expand Down Expand Up @@ -273,6 +278,7 @@ str_to_calendar(char *cal_chars)
else {
log_err("Unknown calendar specified: %s", cal_chars);
}
return 0; // To avoid warnings.
}

/******************************************************************************
Expand All @@ -297,6 +303,7 @@ str_to_timeunits(char units_chars[])
else {
log_err("Unknown time units specified: %s", units_chars);
}
return 0; // To avoid warnings.
}

/******************************************************************************
Expand Down Expand Up @@ -399,4 +406,5 @@ cell_method_from_agg_type(unsigned short int aggtype,
else {
return false;
}
return false; // To avoid warnings.
}
53 changes: 28 additions & 25 deletions vic/vic_run/src/CalcBlowingSnow.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,18 +271,18 @@ CalcBlowingSnow(double Dt,
*****************************************************************************/
double
qromb(double (*funcd)(),
double es,
double Wind,
double AirDens,
double ZO,
double EactAir,
double F,
double hsalt,
double phi_r,
double ushear,
double Zrh,
double a,
double b)
double es,
double Wind,
double AirDens,
double ZO,
double EactAir,
double F,
double hsalt,
double phi_r,
double ushear,
double Zrh,
double a,
double b)
{
extern parameters_struct param;

Expand All @@ -305,6 +305,7 @@ qromb(double (*funcd)(),
h[j + 1] = 0.25 * h[j];
}
log_err("Too many steps");
return 0.; // To avoid warnings.
}

/******************************************************************************
Expand Down Expand Up @@ -363,19 +364,19 @@ polint(double xa[],
*****************************************************************************/
double
trapzd(double (*funcd)(),
double es,
double Wind,
double AirDens,
double ZO,
double EactAir,
double F,
double hsalt,
double phi_r,
double ushear,
double Zrh,
double a,
double b,
int n)
double es,
double Wind,
double AirDens,
double ZO,
double EactAir,
double F,
double hsalt,
double phi_r,
double ushear,
double Zrh,
double a,
double b,
int n)
{
double x, tnm, sum, del;
int it, j;
Expand Down Expand Up @@ -409,6 +410,7 @@ trapzd(double (*funcd)(),
s = 0.5 * (s + (b - a) * sum / tnm);
return s;
}
return 0.; // To avoid warnings.
}

/******************************************************************************
Expand Down Expand Up @@ -484,6 +486,7 @@ rtnewt(double x1,
}
}
log_err("Maximum number of iterations exceeded");
return 0.; // To avoid warnings.
}

/******************************************************************************
Expand Down