OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
atrem_cor.h
Go to the documentation of this file.
1 /*
2  * atrem.h
3  *
4  * Created on: Feb 11, 2015
5  * Author: rhealy
6  */
7 
8 #ifndef SRC_ATREM_ATREM_H_
9 #define SRC_ATREM_ATREM_H_
10 #include <stdint.h>
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <timeutils.h>
14 
15 #define NBANDS 1024 /* maximum number of bands */
16 #define TBLMAX 60
17 #define TBLMAXM1 (TBLMAX-1)
18 #define FINSTMAX 100
19 typedef float t_array[NBANDS];
20 
21 typedef struct param_table {
22  /*Number of narrow channels to form broader window and absorption channels. */
23  int32_t nb1, nb2, nb3, nb4;
24  /*number of points used in channel ratios for both the .94- and 1.14-um regions */
25  int32_t nbp94, nb1p14;
26 
27  int32_t nh2o; /* number of water vapor values */
28  int32_t nobs; /* number of spectral observations - this should be nbands? number of channels? */
29  /* 3-channel ratioing
30  * parameters for bands up to the 0.94-um water vapor band [index=0,1]
31  * parameters for bands up to the 1.14-um water vapor band [index=2,3]
32  * */
33  int32_t start_ndx[4]; //ist1,ist2,ist3,ist4
34  int32_t end_ndx[4]; //ied1,ied2,ied3,ied4
35  /* 3-channel ratioing parameters for the 0.94-um water vapor band */
36  int32_t start_p94;
37  int32_t end_p94;
38  /* 3-channel ratioing parameters for the 1.14-um water vapor band */
39  int32_t start_1p14;
40  int32_t end_1p14;
41  /* Parameters for smoothing output reflectance spectra. */
42  int32_t start2;
43  int32_t end2;
44  int32_t ncv2;
45  /* number of channels of the four AVIRIS spectrometers. */
46  int32_t natot, nbtot, nctot, ndtot;
47  /* Relative weights for the four window *
48  * channels used in channel-ratioing calculations */
49  double wt1, wt2, wt3, wt4;
50  /*
51  * delta, delta2 - resolution, in units of nm, of input
52  * spectra and resolution of output surface reflectance
53  * spectra. If DLT2>DLT, output spectra are smoothed
54  * using a gaussian function.
55  */
56  double delta, delta2;
57  /* The "equivalent" geometrical *
58  * factor corresponding to the total slant vapor amount *
59  * VAP_SLANT_MDL and the column vapor amount CLMVAP. */
60  double g_vap_equiv; // This depends on zenith angle and lat/lon of measurement
61  float *r0p94; //ratio for the 0.94 um H2O absorption band
62  float *r1p14; //ratio for the 1.14 um H2O absorption band
63  float *finst2; // some kind of smoothing factor calculated in INIT_SPECCAL only used for AVIRIS?
64  /* TOTAL SUN-SURFACE-SENSOR PATH WATER VAPOR IN UNITS OF CM */
65  float *vaptot;
66  /* total transmittances of all gases that match the *
67  * resolutions of imaging spectrometers */
69 } paramstr;
70 
71 int get_atrem(double *yy, paramstr P, double *, double *, double *, double *, double *, double *, double *, double *, int32_t *, int32_t *);
72 int32_t hunt(float *xx, int32_t n, double x, int32_t jlo);
73 //DIMENSION VAPTOT(60), R0P94(60), R1P14(60), TRNTBL(1024,60)
74 //DIMENSION FINST2(100)
75 //COMMON /GETINPUT5/ NOBS,HSURF,DLT,DLT2
76 //COMMON /GETINPUT7/ NB1,NB2,NBP94,NB3,NB4,NB1P14
77 //COMMON /INIT_SPECCAL3/ NH2O
78 //COMMON /INIT_SPECCAL6/ IST1,IED1,IST2,IED2,ISTP94,IEDP94
79 //COMMON /INIT_SPECCAL7/ IST3,IED3,IST4,IED4,IST1P14,IED1P14
80 //COMMON /INIT_SPECCAL8/ WT1,WT2,WT3,WT4,JA
81 //COMMON /INIT_SPECCAL10/ NCV2,NCVHF2,NCVTT2,ISTRT2,IEND2,FINST2
82 //COMMON /INIT_SPECCAL11/ NATOT,NBTOT,NCTOT,NDTOT
83 //COMMON /TRAN_TABLE1/ SH2O,VAPTOT,R0P94,R1P14,TRNTBL
84 //COMMON /GEOMETRY3/ G_VAP, G_OTHER, G_VAP_EQUIV, VAP_SLANT_MDL
85 extern void get_input_();
86 extern void model_adj_();
87 extern void geometry_();
88 extern void init_speccal();
89 extern void solar_irr_pc();
90 extern void tran_table();
91 
92 extern struct {
93  int32_t nobs;
94  float hsurf, dlt, dlt2;
95 } getinput5_;
96 
97 extern struct {
98  int32_t nb1, nb2, nbp94, nb3, nb4, nb1p14;
99 } getinput7_;
100 
101 extern struct {
102  int32_t nh2o;
104 
105 extern struct {
106  int32_t ist1, ied1, ist2, ied2, istp94, iedp94;
108 
109 extern struct {
112 
113 extern struct {
114  float wt1, wt2, wt3, wt4, ja;
116 
117 extern struct {
118  float ncv2, ncvhf2, ncvtt2;
119  int32_t istrt2, iend2;
120  float finst2[FINSTMAX];
122 
123 extern struct {
124  int32_t natot, nbtot, nctot, ndtot;
126 
127 extern struct {
129 } tran_table1_;
130 
131 extern struct {
133 } geometry3_;
134 #endif /* SRC_ATREM_ATREM_H_ */
int32_t end_p94
Definition: atrem.h:35
int32_t ndtot
Definition: atrem.h:44
float r1p14[TBLMAX]
Definition: atrem_cor.h:128
int32_t ist4
Definition: atrem_cor.h:110
#define NBANDS
Definition: atrem_cor.h:15
double wt3
Definition: atrem.h:47
float t_array[NBANDS]
Definition: atrem_cor.h:19
int32_t ied4
Definition: atrem_cor.h:110
float g_vap_equiv
Definition: atrem_cor.h:132
int32_t nb2
Definition: atrem.h:21
int32_t nctot
Definition: atrem.h:44
int32_t ncv2
Definition: atrem.h:42
int32_t nh2o
Definition: atrem_cor.h:102
int32_t end_1p14
Definition: atrem.h:38
int32_t nbtot
Definition: atrem.h:44
float ncv2
Definition: atrem_cor.h:118
struct @9 tran_table1_
int32_t nbp94
Definition: atrem.h:23
int32_t natot
Definition: atrem.h:44
void geometry_()
float wt4
Definition: atrem_cor.h:114
int32_t nb4
Definition: atrem_cor.h:98
int32_t iedp94
Definition: atrem_cor.h:106
float vaptot[TBLMAX]
Definition: atrem_cor.h:128
double wt4
Definition: atrem.h:47
int32_t nbp94
Definition: atrem_cor.h:98
#define TBLMAX
Definition: atrem_cor.h:16
double g_vap_equiv
Definition: atrem.h:58
float * r1p14
Definition: atrem_cor.h:62
struct @4 init_speccal6_
float * finst2
Definition: atrem_cor.h:63
int32_t nobs
Definition: atrem_cor.h:93
float r0p94[TBLMAX]
Definition: atrem_cor.h:128
int32_t ndtot
Definition: atrem_cor.h:124
int32_t iend2
Definition: atrem_cor.h:119
int32_t nbtot
Definition: atrem_cor.h:124
int32_t nb4
Definition: atrem.h:21
int32_t start_ndx[4]
Definition: atrem.h:31
int get_atrem(double *yy, paramstr P, double *, double *, double *, double *, double *, double *, double *, double *, int32_t *, int32_t *)
float dlt2
Definition: atrem_cor.h:94
struct @6 init_speccal8_
double wt1
Definition: atrem.h:47
int32_t start_1p14
Definition: atrem.h:37
float * vaptot
Definition: atrem_cor.h:65
int32_t nb1
Definition: atrem_cor.h:98
double wt2
Definition: atrem.h:47
struct @7 init_speccal10_
int32_t nb2
Definition: atrem_cor.h:98
struct @1 getinput5_
int32_t ied1p14
Definition: atrem_cor.h:110
int32_t natot
Definition: atrem_cor.h:124
int32_t nh2o
Definition: atrem.h:25
int32_t istp94
Definition: atrem_cor.h:106
void tran_table()
float ja
Definition: atrem_cor.h:114
int32_t nobs
Definition: atrem.h:26
int32_t end_ndx[4]
Definition: atrem.h:32
float ncvhf2
Definition: atrem_cor.h:118
int32_t ist1
Definition: atrem_cor.h:106
float wt2
Definition: atrem_cor.h:114
void get_input_()
float * r0p94
Definition: atrem_cor.h:61
float finst2[FINSTMAX]
Definition: atrem_cor.h:120
int32_t end2
Definition: atrem.h:41
void solar_irr_pc()
Definition: solar_irr_PC.f:36
double delta
Definition: atrem.h:54
void model_adj_()
int32_t hunt(float *xx, int32_t n, double x, int32_t jlo)
t_array * trntbl
Definition: atrem_cor.h:68
#define FINSTMAX
Definition: atrem_cor.h:18
int32_t ist2
Definition: atrem_cor.h:106
int32_t istrt2
Definition: atrem_cor.h:119
float wt3
Definition: atrem_cor.h:114
float hsurf
Definition: atrem_cor.h:94
int32_t ied1
Definition: atrem_cor.h:106
int32_t nb1
Definition: atrem.h:21
int32_t nb1p14
Definition: atrem.h:23
struct @10 geometry3_
float vap_slant_mdl
Definition: atrem_cor.h:132
float dlt
Definition: atrem_cor.h:94
int32_t start2
Definition: atrem.h:40
struct @3 init_speccal3_
int32_t ied3
Definition: atrem_cor.h:110
float g_vap
Definition: atrem_cor.h:132
void init_speccal()
float sh2o
Definition: atrem_cor.h:128
struct @8 init_speccal11_
float trntbl[TBLMAX][NBANDS]
Definition: atrem_cor.h:128
float ncvtt2
Definition: atrem_cor.h:118
float wt1
Definition: atrem_cor.h:114
int32_t nb1p14
Definition: atrem_cor.h:98
int32_t ied2
Definition: atrem_cor.h:106
struct @5 init_speccal7_
int32_t nctot
Definition: atrem_cor.h:124
int32_t ist1p14
Definition: atrem_cor.h:110
int32_t nb3
Definition: atrem.h:21
int32_t nb3
Definition: atrem_cor.h:98
struct @2 getinput7_
int32_t ist3
Definition: atrem_cor.h:110
int32_t start_p94
Definition: atrem.h:34
float g_other
Definition: atrem_cor.h:132
double delta2
Definition: atrem.h:54