NASA Logo
Ocean Color Science Software

ocssw V2022
anc_acq.c File Reference
#include "l12_proto.h"
#include "met_cvt.h"
#include "anc_acq.h"
#include <gsl/gsl_errno.h>
#include <gsl/gsl_interp2d.h>
#include <gsl/gsl_spline2d.h>
Include dependency graph for anc_acq.c:

Go to the source code of this file.

Classes

struct  met_sto_str
 

Macros

#define ANC_STAT_1T   1 /* one time used */
 
#define ANC_STAT_2T_END
 
#define ANC_STAT_2T_START
 
#define ANC_STAT_3T   3 /* all 3 files with different times */
 
#define ANC_STAT_CLIM   0 /* a climatology in use */
 
#define NPRM   7
 
#define ANCBAD   -999.
 
#define OZ_KG_M2_TO_DU   1. / 2.1415e-5
 
#define USE_PMSL
 
#define ANC_SRC_TYP_ECMWF   0 /* types of anc file data */
 
#define ANC_SRC_TYP_STD_HDF   1 /* old HDF from NCEP (met) TOMS (oz) */
 
#define ANC_SRC_TYP_OLCI   2 /* OLCI tie point at data points */
 
#define ANC_SRC_TYP_GMAO   3 /* GMAP FP-IT or FP forecast */
 
#define ANC_SRC_TYP_BAD   -1 /* a bad or undefined type */
 
#define FILE_CHECK(file_name)
 

Enumerations

enum  out_nam {
  ZW, MW, PR, WV,
  RH, SFCP, SFCRH, SFCT,
  ICEFR_WTR, ICEFR_LND
}
 
enum  out_prof {
  TPROF, RHPROF, HPROF, QPROF,
  O3PROF
}
 
enum  out_cldrad { TAUCLD, CFCLD }
 
enum  out_aerosol {
  BCEXTTAU, BCSCATAU, DUEXTTAU, DUSCATAU,
  SSEXTTAU, SSSCATAU, SUEXTTAU, SUSCATAU,
  OCEXTTAU, OCSCATAU, TOTEXTTAU, TOTSCATAU,
  TOTANGSTR
}
 

Functions

int anc_acq_init (instr *input, l1str *l1rec, int32_t *anc_id)
 
int32_t anc_acq_ck (char *file, char *file_olci)
 
int32_t anc_acq_f_stat (char **files, char prioritize_files, int32_t n_anc)
 
int32_t anc_acq_lin_met (l1str *l1rec)
 
int32_t anc_acq_lin_aerosol (l1str *l1rec)
 
int32_t anc_acq_lin_prof (l1str *l1rec)
 
int32_t anc_acq_lin_rad (l1str *l1rec)
 
int32_t init_anc_aerosol (l1str *l1rec)
 
int32_t init_anc_cld_rad (l1str *l1rec, size_t times_dim, const float *time_range)
 
int init_anc_add (l1str *l1rec)
 
int32_t anc_acq_lin_oz (l1str *l1rec)
 
int32_t anc_acq_gmao_rad_prep (char *file, gen_int_str *rad_int, int32_t ifile, int32_t nrad, int32_t ntime_step)
 
int32_t anc_acq_gmao_met_prep (char *file, gen_int_str *met_int)
 
int32_t anc_acq_gmao_prof_prep (char *file, gen_int_str *prof_int, int32_t nlvl_expect)
 
int32_t anc_acq_gmao_oz_prep (char *file, gen_int_str *oz_int)
 
int32_t anc_acq_gmao_aer_prep (char *file, gen_int_str *aer_int)
 
int32_t anc_rad_eval_pt (gen_int_str *rad_int, int32_t iprm, int32_t itim, int32_t nrad, float lat, float lon, float *val)
 
int32_t anc_acq_eval_pt (gen_int_str *met_int, int32_t iprm, int32_t ilvl, float lat, float lon, int32_t t_interp, int32_t *data_ix, float wt_t1, int32_t ntim_int, int32_t nlvl, int32_t nprm, float *final_val, float *unc)
 
int32_t anc_acq_fnd_t_interp (double s_time, double *anc_time, int32_t anc_f_stat, int32_t *t_interp, int32_t *data_ix, float *wt)
 
int32_t anc_acq_read_gmao_rad (char *file, const char *var_name, float **data, unsigned char **qa, double *start_time, int32_t *ntime, int32_t *nlon, int32_t *nlat, int **time, double **lon_coord, double **lat_coord)
 
int32_t anc_acq_read_gmao (char *file, char *ds_name, float **data, unsigned char **qa, double *time, int32_t *nlon, int32_t *nlat, int32_t *nlvl, double **lon_coord, double **lat_coord)
 
int32_t anc_acq_ecmwf_init (char **files, char **prm_nm, int n_prm, int32_t sto_ix)
 
int anc_acq_lin (int32_t anc_class, l1str *l1rec)
 
int anc_acq_lin_olci (int anc_class, char *file, l1str *l1rec)
 
float anc_miss_fill (int32_t prod_ix)
 
float bilin_interp (float *data, int xbox_st, int nx, int ybox_st, float xfrac, float yfrac)
 
int64_t jd4713bc_get_jd (int32_t year, int32_t month, int32_t day)
 
int jd4713bc_get_date (int64_t jd, int32_t *year, int32_t *month, int32_t *day)
 

Macro Definition Documentation

◆ ANC_SRC_TYP_BAD

#define ANC_SRC_TYP_BAD   -1 /* a bad or undefined type */

Definition at line 34 of file anc_acq.c.

◆ ANC_SRC_TYP_ECMWF

#define ANC_SRC_TYP_ECMWF   0 /* types of anc file data */

Definition at line 30 of file anc_acq.c.

◆ ANC_SRC_TYP_GMAO

#define ANC_SRC_TYP_GMAO   3 /* GMAP FP-IT or FP forecast */

Definition at line 33 of file anc_acq.c.

◆ ANC_SRC_TYP_OLCI

#define ANC_SRC_TYP_OLCI   2 /* OLCI tie point at data points */

Definition at line 32 of file anc_acq.c.

◆ ANC_SRC_TYP_STD_HDF

#define ANC_SRC_TYP_STD_HDF   1 /* old HDF from NCEP (met) TOMS (oz) */

Definition at line 31 of file anc_acq.c.

◆ ANC_STAT_1T

#define ANC_STAT_1T   1 /* one time used */

Definition at line 18 of file anc_acq.c.

◆ ANC_STAT_2T_END

#define ANC_STAT_2T_END
Value:
4 /* 2 different anc times in end of list \
= files[0] = [1] != [2] */

Definition at line 19 of file anc_acq.c.

◆ ANC_STAT_2T_START

#define ANC_STAT_2T_START
Value:
2 /*2 different anc times in start of list \
= files[0] ! [1] = [2] */

Definition at line 21 of file anc_acq.c.

◆ ANC_STAT_3T

#define ANC_STAT_3T   3 /* all 3 files with different times */

Definition at line 23 of file anc_acq.c.

◆ ANC_STAT_CLIM

#define ANC_STAT_CLIM   0 /* a climatology in use */

Definition at line 24 of file anc_acq.c.

◆ ANCBAD

#define ANCBAD   -999.

Definition at line 26 of file anc_acq.c.

◆ FILE_CHECK

#define FILE_CHECK (   file_name)
Value:
if (access(file_name, F_OK) || access(file_name, R_OK)) { \
printf("--Error-- : Input file '%s' does not exist or cannot open.\n.See line %d in %s\n", \
file_name, __LINE__, __FILE__); \
exit(FATAL_ERROR); \
}

Definition at line 35 of file anc_acq.c.

◆ NPRM

#define NPRM   7

Definition at line 25 of file anc_acq.c.

◆ OZ_KG_M2_TO_DU

#define OZ_KG_M2_TO_DU   1. / 2.1415e-5

Definition at line 27 of file anc_acq.c.

◆ USE_PMSL

#define USE_PMSL
Value:
1 /* choice to use surface pressure (0) or use the MSL \
(mean sea level) pressure (1) with appropriate \
adjustment for land height */

Definition at line 28 of file anc_acq.c.

Enumeration Type Documentation

◆ out_aerosol

Enumerator
BCEXTTAU 
BCSCATAU 
DUEXTTAU 
DUSCATAU 
SSEXTTAU 
SSSCATAU 
SUEXTTAU 
SUSCATAU 
OCEXTTAU 
OCSCATAU 
TOTEXTTAU 
TOTSCATAU 
TOTANGSTR 

Definition at line 48 of file anc_acq.c.

◆ out_cldrad

enum out_cldrad
Enumerator
TAUCLD 
CFCLD 

Definition at line 46 of file anc_acq.c.

◆ out_nam

enum out_nam
Enumerator
ZW 
MW 
PR 
WV 
RH 
SFCP 
SFCRH 
SFCT 
ICEFR_WTR 
ICEFR_LND 

Definition at line 42 of file anc_acq.c.

◆ out_prof

enum out_prof
Enumerator
TPROF 
RHPROF 
HPROF 
QPROF 
O3PROF 

Definition at line 44 of file anc_acq.c.

Function Documentation

◆ anc_acq_ck()

int32_t anc_acq_ck ( char *  file,
char *  file_olci 
)

Definition at line 182 of file anc_acq.c.

◆ anc_acq_ecmwf_init()

int32_t anc_acq_ecmwf_init ( char **  files,
char **  prm_nm,
int  n_prm,
int32_t  sto_ix 
)

Definition at line 2370 of file anc_acq.c.

◆ anc_acq_eval_pt()

int32_t anc_acq_eval_pt ( gen_int_str *  met_int,
int32_t  iprm,
int32_t  ilvl,
float  lat,
float  lon,
int32_t  t_interp,
int32_t *  data_ix,
float  wt_t1,
int32_t  ntim_int,
int32_t  nlvl,
int32_t  nprm,
float *  final_val,
float *  unc 
)

Definition at line 1868 of file anc_acq.c.

◆ anc_acq_f_stat()

int32_t anc_acq_f_stat ( char **  files,
char  prioritize_files,
int32_t  n_anc 
)

Definition at line 297 of file anc_acq.c.

◆ anc_acq_fnd_t_interp()

int32_t anc_acq_fnd_t_interp ( double  s_time,
double *  anc_time,
int32_t  anc_f_stat,
int32_t *  t_interp,
int32_t *  data_ix,
float *  wt 
)

Definition at line 1964 of file anc_acq.c.

◆ anc_acq_gmao_aer_prep()

int32_t anc_acq_gmao_aer_prep ( char *  file,
gen_int_str *  aer_int 
)

Definition at line 1789 of file anc_acq.c.

◆ anc_acq_gmao_met_prep()

int32_t anc_acq_gmao_met_prep ( char *  file,
gen_int_str *  met_int 
)

Definition at line 1388 of file anc_acq.c.

◆ anc_acq_gmao_oz_prep()

int32_t anc_acq_gmao_oz_prep ( char *  file,
gen_int_str *  oz_int 
)

Definition at line 1718 of file anc_acq.c.

◆ anc_acq_gmao_prof_prep()

int32_t anc_acq_gmao_prof_prep ( char *  file,
gen_int_str *  prof_int,
int32_t  nlvl_expect 
)

Definition at line 1600 of file anc_acq.c.

◆ anc_acq_gmao_rad_prep()

int32_t anc_acq_gmao_rad_prep ( char *  file,
gen_int_str *  rad_int,
int32_t  ifile,
int32_t  nrad,
int32_t  ntime_step 
)
Parameters
file- nc RAD filename
rad_int- interpolation data structure for RAD
ifile- file index
nrad- number of RAD variables (2 for now)
ntime_step- number of hours in a RAD file
Returns
int32_t

Definition at line 1328 of file anc_acq.c.

◆ anc_acq_init()

int anc_acq_init ( instr *  input,
l1str *  l1rec,
int32_t *  anc_id 
)

Definition at line 84 of file anc_acq.c.

◆ anc_acq_lin()

int anc_acq_lin ( int32_t  anc_class,
l1str *  l1rec 
)

Definition at line 2645 of file anc_acq.c.

◆ anc_acq_lin_aerosol()

int32_t anc_acq_lin_aerosol ( l1str *  l1rec)

Definition at line 618 of file anc_acq.c.

◆ anc_acq_lin_met()

int32_t anc_acq_lin_met ( l1str *  l1rec)

Definition at line 386 of file anc_acq.c.

◆ anc_acq_lin_olci()

int anc_acq_lin_olci ( int  anc_class,
char *  file,
l1str *  l1rec 
)

Definition at line 2916 of file anc_acq.c.

◆ anc_acq_lin_oz()

int32_t anc_acq_lin_oz ( l1str *  l1rec)

Definition at line 1174 of file anc_acq.c.

◆ anc_acq_lin_prof()

int32_t anc_acq_lin_prof ( l1str *  l1rec)

Definition at line 765 of file anc_acq.c.

◆ anc_acq_lin_rad()

int32_t anc_acq_lin_rad ( l1str *  l1rec)

Interpolates RAD layers.

Parameters
l1rec
Returns
int32_t

Definition at line 924 of file anc_acq.c.

◆ anc_acq_read_gmao()

int32_t anc_acq_read_gmao ( char *  file,
char *  ds_name,
float **  data,
unsigned char **  qa,
double *  time,
int32_t *  nlon,
int32_t *  nlat,
int32_t *  nlvl,
double **  lon_coord,
double **  lat_coord 
)

Definition at line 2193 of file anc_acq.c.

◆ anc_acq_read_gmao_rad()

int32_t anc_acq_read_gmao_rad ( char *  file,
const char *  var_name,
float **  data,
unsigned char **  qa,
double *  start_time,
int32_t *  ntime,
int32_t *  nlon,
int32_t *  nlat,
int **  time,
double **  lon_coord,
double **  lat_coord 
)

READ data from a RAD file.

Parameters
file- file name
var_name- variable name
data- data to save
qa- quality flags
start_time-start time
ntime- number of hours in RAD file
nlon- size of lon
nlat- size of lat
time- time array (size of ntime)
lon_coord- lon coordinates
lat_coord- lat coordinates
Returns
int32_t

Definition at line 2093 of file anc_acq.c.

◆ anc_miss_fill()

float anc_miss_fill ( int32_t  prod_ix)

Definition at line 3231 of file anc_acq.c.

◆ anc_rad_eval_pt()

int32_t anc_rad_eval_pt ( gen_int_str *  rad_int,
int32_t  iprm,
int32_t  itim,
int32_t  nrad,
float  lat,
float  lon,
float *  val 
)

Definition at line 1845 of file anc_acq.c.

◆ bilin_interp()

float bilin_interp ( float *  data,
int  xbox_st,
int  nx,
int  ybox_st,
float  xfrac,
float  yfrac 
)

Definition at line 3275 of file anc_acq.c.

◆ init_anc_add()

int init_anc_add ( l1str *  l1rec)

Definition at line 1131 of file anc_acq.c.

◆ init_anc_aerosol()

int32_t init_anc_aerosol ( l1str *  l1rec)

Definition at line 1077 of file anc_acq.c.

◆ init_anc_cld_rad()

int32_t init_anc_cld_rad ( l1str *  l1rec,
size_t  times_dim,
const float *  time_range 
)

Definition at line 1104 of file anc_acq.c.

◆ jd4713bc_get_date()

int jd4713bc_get_date ( int64_t  jd,
int32_t *  year,
int32_t *  month,
int32_t *  day 
)

Definition at line 3359 of file anc_acq.c.

◆ jd4713bc_get_jd()

int64_t jd4713bc_get_jd ( int32_t  year,
int32_t  month,
int32_t  day 
)

Definition at line 3320 of file anc_acq.c.

#define FATAL_ERROR
Definition: swl0_parms.h:5