81#include <gsl/gsl_multifit.h>
82#include <gsl/gsl_poly.h>
83#include <gsl/gsl_spline.h>
116#define RA (1e3 * RI / MA)
129#define LAPSE(p1, t1, p2, t2) \
130 (1e3 * G0 / RA * ((t2) - (t1)) / ((t2) + (t1)) \
131 * ((p2) + (p1)) / ((p2) - (p1)))
135 int nc_result=(cmd); \
136 if(nc_result!=NC_NOERR) \
137 ERRMSG("%s", nc_strerror(nc_result)); \
142 (P0 * exp(-(z) / H0))
243 const char *longname,
void read_met_extrapolate(met_t *met)
Extrapolate meteorological data at lower boundary.
void intpol_met_space(met_t *met, double p, double lon, double lat, double *t)
Spatial interpolation of meteorological data.
void write_gps(char *filename, gps_t *gps)
Write GPS-RO data file.
void read_met_periodic(met_t *met)
Create meteorological data with periodic boundary conditions.
#define EY
Maximum number of latitudes for meteorological data.
void gauss(gps_t *gps, double dx, double dy)
Calculate horizontal Gaussian mean to extract perturbations.
void read_met(char *filename, met_t *met)
Read meteorological data file.
void intpol_met_time(met_t *met0, met_t *met1, double ts, double p, double lon, double lat, double *t)
Temporal interpolation of meteorological data.
void spline(const double *x, const double *y, const int n, const double *x2, double *y2, const int n2, const int method)
Performs spline interpolation or linear interpolation.
void poly(gps_t *gps, int dim, double zmin, double zmax)
Remove polynomial fit from perturbation profile.
#define NZ
Maximum number of altitudes per GPS-RO profile.
void grid_gps(gps_t *gps, double zmin, double zmax, int nz)
Interpolate GPS data to regular altitude grid.
#define EX
Maximum number of longitudes for meteorological data.
void intpol_met_3d(float array[EX][EY][EP], int ip, int ix, int iy, double wp, double wx, double wy, double *var)
Linear interpolation of 3-D meteorological data.
#define NDS
Maximum number of GPS-RO profiles.
void add_var(int ncid, const char *varname, const char *unit, const char *longname, int type, int dimid[], int *varid, int ndims)
Add variable to netCDF file.
void get_met(char *metbase, double dt_met, double t, met_t *met0, met_t *met1)
Get meteorological data for given timestep.
void read_gps(char *filename, gps_t *gps)
Read GPS-RO data file.
void hamming_low_pass(gps_t *gps, double dz)
Apply vertical Hamming filter to extract perturbations.
void detrend_met(gps_t *gps, char *metbase, double dt_met)
Detrending by means of meteo data.
void read_gps_prof(char *filename, gps_t *gps)
Read GPS-RO profile.
void get_met_help(double t, int direct, char *metbase, double dt_met, char *filename)
Get meteorological data for timestep.
void hamming_high_pass(gps_t *gps, double dz)
Apply vertical Hamming filter to reduce noise.
void tropopause_spline(gps_t *gps, int met_tropo)
Find tropopause height using cubic spline interpolation.
void poly_help(double *xx, double *yy, int n, int dim, double xmin, double xmax)
Auxiliary function for polynomial interpolation.
void read_met_help(int ncid, char *varname, char *varname2, met_t *met, float dest[EX][EY][EP], float scl)
Read and convert variable from meteorological data file.
void tropopause(gps_t *gps)
Find tropopause height.
#define EP
Maximum number of pressure levels for meteorological data.
int nds
Number of profiles.
int nx
Number of longitudes.
int ny
Number of latitudes.
int np
Number of pressure levels.