Go to the documentation of this file.
16 int t_type,
float *
q,
int q_type,
float *rh)
47 double es, es_wet, es_ice;
48 double p_lcl, t_lcl, q_lcl, rh_lcl, t_es;
52 for (ival = 0; ival < nval; ival++) {
57 p_lcl = *(pres + ival);
58 t_lcl = *(temp + ival);
71 t_es = (t_lcl < -50.) ? -50. : t_lcl;
72 es_wet = es_coef_wet[0] + t_es * (es_coef_wet[1] + t_es *
73 (es_coef_wet[2] + t_es *
74 (es_coef_wet[3] + t_es * (es_coef_wet[4] + t_es *
75 (es_coef_wet[5] + t_es * es_coef_wet[6])))));
76 es_ice = es_coef_ice[0] + t_es * (es_coef_ice[1] + t_es *
77 (es_coef_ice[2] + t_es *
78 (es_coef_ice[3] + t_es * (es_coef_ice[4] + t_es *
79 (es_coef_ice[5] + t_es * es_coef_ice[6])))));
80 es = (es_wet < es_ice) ? es_wet : es_ice;
84 rh_lcl = 100. * x_h20 * p_lcl / es;
88 rh_lcl = (rh_lcl < 0) ? 0 : rh_lcl;
89 rh_lcl = (rh_lcl > 100.) ? 100. : rh_lcl;
91 *(rh + ival) = rh_lcl;
100 int t_type,
float *rh,
float *
q,
int q_type)
131 double es, es_wet, es_ice;
132 double p_lcl, t_lcl, q_lcl, rh_lcl, t_es, ph2o;
136 for (ival = 0; ival < nval; ival++) {
141 p_lcl = *(pres + ival);
142 t_lcl = *(temp + ival);
143 rh_lcl = *(rh + ival);
149 rh_lcl = ( rh_lcl > 100. ) ? 100. : rh_lcl;
150 rh_lcl = ( rh_lcl < 0. ) ? 0. : rh_lcl;
156 t_es = (t_lcl < -50.) ? -50. : t_lcl;
157 es_wet = es_coef_wet[0] + t_es * (es_coef_wet[1] + t_es *
158 (es_coef_wet[2] + t_es *
159 (es_coef_wet[3] + t_es * (es_coef_wet[4] + t_es *
160 (es_coef_wet[5] + t_es * es_coef_wet[6])))));
161 es_ice = es_coef_ice[0] + t_es * (es_coef_ice[1] + t_es *
162 (es_coef_ice[2] + t_es *
163 (es_coef_ice[3] + t_es * (es_coef_ice[4] + t_es *
164 (es_coef_ice[5] + t_es * es_coef_ice[6])))));
165 es = (es_wet < es_ice) ? es_wet : es_ice;
167 ph2o = es * rh_lcl / 100.;
169 x_h20 = ph2o / p_lcl;
183 int dwp_type,
float *rh)
216 double td_lcl, t_lcl;
217 for (ival = 0; ival < nval; ival++) {
218 t_lcl = (
double) *(temp + ival);
219 td_lcl = (
double) *(dwp_temp + ival);
228 rh_lcl = (rh_lcl < 0) ? 0 : rh_lcl;
229 rh_lcl = (rh_lcl > 100.) ? 100. : rh_lcl;
231 *(rh + ival) = rh_lcl;
261 if (in_type == out_type)
306 if (in_type == out_type)
336 if (in_type == out_type)
double met_cvt_t_cvt(double val, int in_type, int out_type)
double met_cvt_q_cvt(double val, int in_type, int out_type)
integer, parameter double
int met_cvt_q_to_rh(int nval, float *pres, int p_type, float *temp, int t_type, float *q, int q_type, float *rh)
int met_cvt_ttd_to_rh(int nval, float *temp, int t_type, float *dwp_temp, int dwp_type, float *rh)
double met_cvt_p_cvt(double val, int in_type, int out_type)
int met_cvt_rh_to_q(int nval, float *pres, int p_type, float *temp, int t_type, float *rh, float *q, int q_type)
#define MET_UNITS__Q_KG_KG