VR-Vantage 3.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
modrad_common.h
Go to the documentation of this file.
1 
2 /* © 1998 JRM Technologies, Inc.*/
3 
4 #ifndef _MR_COMMON_H_
5 #define _MR_COMMON_H_
6 
7 
8 #include <stdio.h>
9 #include <string.h>
10 #include <stdlib.h>
11 #include <math.h>
12 #include <time.h>
13 
14 #include "platform.h"
15 #include "JRMDefines.h"
16 #include "JRMlibrary.h"
17 #include "Ellipsoid.h"
18 #include "atm_common.h"
19 #include "rad.h"
20 #include "ModRadDLLstub.h"
21 #include "SSModRadStruct.h"
22 
23 
24 
25 #ifdef __cplusplus
26 extern "C"
27 {
28 #endif
29 
30 
31 #define CO2ppmv 0.0 // Use 355 ppmv as default
32 #define H2Oscale 1.0 // Default=1
33 #define O2scale 1.0 // Default=1
34 #define H2Omax 0.9 // H2O % relative humidity at sea level
35 #define gamH2O 1.0E-5 // [m-1] exponential dropoff for H2O density
36 #define CO2max 0.0 // CO2 partial pressure [mb] at sea level
37 #define gamCO2 1.0E-5 // [m-1] exponential dropoff for CO2 density
38 #define DEFAULT_LOG (-38.0*log(10.0))
39 #define LOXMIT 0.00001
40 #define HIDEPTH -1.0*log(0.00001)
41 #define LODEPTH 0.02 // See LOP 0465 in Mod37.for
42 #define HIXMIT exp(-0.02)
43 #define BMODEL_LIMIT 0.4409 // [um] lowest wavelength for which Modtran has band model params.
44 
45 
46 
47  /* -------- ERROR ENUMERANTS ---------- */
49  {
59  };
60 
61  MODRAD_API const char *getModRadVersion();
62  MODRAD_API double ModtranEarthRadiusKM(int atm_model);
64  MODRAD_API int GetTOAIrradiance(int day, float moonphasedeg, long nlambda, double* lambda, double* solarTOA, double* lunarTOA);
65 
66  //#define DYNAMICMR 1 // undefine if you desire SigSimModtran and SigSimRadtran libraries to be static, regardless of operating system.
67 
68 #if defined WIN32 && DYNAMICMR
69 #define MODRADENTRY __stdcall
70 #endif // WIN32 && DYNAMICMR
71 
72  /* ------------------ MODTRAN API --------------------------- */
73 
74 #if defined WIN32 && DYNAMICMR
75 
76  typedef int (MODRADENTRY * SCENV) (char* IDIR, char* ODIR, int* ilen, int *olen);
77  typedef int (MODRADENTRY * SC1) (char *code, int* model, int* type, int* mode, int* mult,
78  int* m1, int* m2, int* m3, int* m4, int* m5, int* m6,
79  int* mdef, int* im, int* noprnt, float* tbound, float* salb);
80  typedef int (MODRADENTRY * SC1A) (int* DIS, int* NSTR, int* LSUN, int* ISUN, float* CO2MX,
81  float* SOLCON, char* H2OSTR, char* O3STR, char* SUNFL2);
82  typedef int (MODRADENTRY * SC1A1) (char* SUNFL2);
83  typedef int (MODRADENTRY * SC1A2) (char* c1a2Bmname);
84  typedef int (MODRADENTRY * SC1A3) (char* c1a3Fltnam);
85  typedef int (MODRADENTRY * SC2) (char* APLUS,int* IHAZE,char* CNOVAM, int* ISEASN, char* ARUSS,
86  int* IVULCN, int* ICSTL, int* ICLD,int* IVSA, float* VIS,
87  float* WSS, float* WHH, float* RAINRT, float* GNDALT);
88  typedef int (MODRADENTRY * SC2A) (float* CTHIK, float* CALT, float* CEXT, int* ISEED,
89  int* NCRALT, int* NCRSPC, float* CWAVLN, float* CCOLWD,
90  float* CCOLIP, float* CHUMID, float* ASYMWD, float* ASYMIP);
91  typedef int (MODRADENTRY * SC2AP) (float* ZAER11, float* ZAER12, float* SCALE1, float* ZAER21,
92  float* ZAER22, float* SCALE2, float* ZAER31, float* ZAER32,
93  float* SCALE3, float* ZAER41, float* ZAER42, float* SCALE4);
94  typedef int (MODRADENTRY * SC2B) (float* ZCVSA, float* ZTVSA, float* ZINVSA);
95  typedef int (MODRADENTRY * SC2C) (int* ML, int* IRD1, int* IRD2, char* HMODEL);
96  typedef int (MODRADENTRY * SC2C1) (float* C2C1ZM, float* C2C1P, float* C2C1T,
97  float* C2C1WMOL1, float* C2C1WMOL2, float* C2C1WMOL3, char* C2C1JCHAR);
98  typedef int (MODRADENTRY * SC2C2) (float* WMOL4, float* WMOL5, float* WMOL6, float* WMOL7,
99  float* WMOL8, float* WMOL9, float* WMOL10,float* WMOL11,float* WMOL12);
100  typedef int (MODRADENTRY * SC2C2X) (float* WMOLX1,float* WMOLX2,float* WMOLX3,float* WMOLX4,float* WMOLX5,
101  float* WMOLX6,float* WMOLX7,float* WMOLX8,float* WMOLX9,float* WMOLX10,
102  float* WMOLX11, float* WMOLX12, float* WMOLX13);
103  typedef int (MODRADENTRY * SC2C3) ( int* IHA1, int* ICLD1, int* IVUL1, int* ISEA1, int* ICHR,
104  float* AHAZE1, float* AHAZE2, float* AHAZE3, float*AHAZE4, float* EQLWCZ, float* RRATZ);
105  typedef int (MODRADENTRY * SC2D) (int* C2DIREG);
106  typedef int (MODRADENTRY * SC2D1) (float* C2D1AWCCON, char* C2D1TITLE);
107  typedef int (MODRADENTRY * SC2D2) (float* C2D2VARSPC, float* C2D2EXTC, float* C2D2ABSC, float* C2D2ASYM);
108  typedef int (MODRADENTRY * SC2E1) (float* ZCLD, float* CLD, float* CLDICE, float* RR);
109  typedef int (MODRADENTRY * SC2E2) (float* C2E2WAVLEN, float* C2E2EXTC6, float* C2E2ABSC6, float* C2E2ASYM6, float* C2E2EXTC7, float* C2E2ABSC7, float* C2E2ASYM7);
110  typedef int (MODRADENTRY * SC3) (float* H1, float* H2, float* ANGLE, float* RANGE, float* BETA,
111  float* RO, int* LENN, float* PHI, int* IDAY, int* ISOURCE,
112  float* ANGLEM);
113  typedef int (MODRADENTRY * SC3A1) (int* IPARM, int* IPH, int* IDAY, int* ISOURC);
114  typedef int (MODRADENTRY * SC3A2) (float* PARM1, float* PARM2, float* PARM3, float* PARM4,
115  float* TIME, float* PSIPO, float* ANGLEM, float* G);
116  typedef int (MODRADENTRY * SC3B1) (int* C3B1NANGLS, int* C3B1NWLF);
117  typedef int (MODRADENTRY * SC3B2) (float* C3B2ANGF, float* C3B2F1, float* C3B2F2, float* C3B2F3, float* C3B2F4);
118  typedef int (MODRADENTRY * SC3C) (float* C3C1ANGF, float* C3C2WLF, float* C3C36F);
119  typedef int (MODRADENTRY * SC4) (float* V1, float* V2, float* DV, float* FWHM,
120  char* YFLAG, char* XFLAG, char* DLIMIT, char* FLAGS);
121  typedef int (MODRADENTRY * SC5) (int* IRPT);
122  typedef int (MODRADENTRY * SCIRRADANGLES) (int *cIon_off, float* cIsolar_angle, float* cIlunar_angle);
123  typedef int (MODRADENTRY * FILLPROFILE) ();
124  typedef int (MODRADENTRY * DRIVER) ();
125  typedef int (MODRADENTRY * GXMIT) (float* AVXMIT);
126  typedef int (MODRADENTRY * GPTRAD) (float* RADSUM);
127  typedef int (MODRADENTRY * PLTDAT) (int* nPts, float* x, float* y, float*y2, float* ysum, float* y2sum);
128  typedef int (MODRADENTRY * PUTATM) (int *nx, float *x, int* nalt, float* alt);
129  typedef int (MODRADENTRY * GETATM) (int *num, float* prd,float* ext,float* psc, float* agd, float* ssa, float* lth);
130  typedef int (MODRADENTRY * TOAIRRADIANCE) (int* IDAY, float* ANGLE, int* NLAMBDA, float* LAMBDA, float* SOLAR, float* LUNAR);
131  typedef int (MODRADENTRY * GETPROFILE) (int* nlayers, int* nspecs, float* altkm, float* presmb, float *tempk, float* rfindex, float* dense, int* ncld, float* zcld, float* wat, float* ice, float* rr);
132 
133  HMODULE ModLib;
134 
135  SCENV scenv;
136  SC1 sc1;
137  SC1A sc1a;
138  SC1A1 sc1a1;
139  SC1A2 sc1a2;
140  SC1A3 sc1a3;
141  SC2 sc2;
142  SC2A sc2a;
143  SC2AP sc2ap;
144  SC2B sc2b;
145  SC2C sc2c;
146  SC2C1 sc2c1;
147  SC2C2 sc2c2;
148  SC2C2X sc2c2x;
149  SC2C3 sc2c3;
150  SC2D sc2d;
151  SC2D1 sc2d1;
152  SC2D2 sc2d2;
153  SC2E1 sc2e1;
154  SC2E2 sc2e2;
155  SC3 sc3;
156  SC3A1 sc3a1;
157  SC3A2 sc3a2;
158  SC3B1 sc3b1;
159  SC3B2 sc3b2;
160  SC3C sc3c;
161  SC4 sc4;
162  SC5 sc5;
163  SCIRRADANGLES scirradangles;
164  FILLPROFILE fillprofile;
165  DRIVER driver;
166  GXMIT gxmit;
167  GPTRAD gptrad;
168  PLTDAT pltdat;
169  PUTATM putatm;
170  GETATM getatm;
171  TOAIRRADIANCE toairradiance;
172  GETPROFILE getprofile;
173 
174  MODRAD_API int LoadDynamicModtran();
175  MODRAD_API void UnloadDynamicModtran();
176 
177 #else // not WIN32 or not DYNAMICMR
178 
179 #ifdef WIN32
180  int __cdecl scenv(char* IDIR, char* ODIR, int* ilen, int *olen);
181  int __cdecl sc1(char *code, int* model, int* type, int* mode, int* mult,
182  int* m1, int* m2, int* m3, int* m4, int* m5, int* m6,
183  int* mdef, int* im, int* noprnt, float* tbound, float* salb);
184  int __cdecl sc1a(int* DIS, int* NSTR, int* LSUN, int* ISUN, float* CO2MX,
185  float* SOLCON, char* H2OSTR, char* O3STR, char* SUNFL2);
186  int __cdecl sc1a1(char* SUNFL2);
187  int __cdecl sc1a2(char* c1a2Bmname);
188  int __cdecl sc1a3(char* c1a3Fltnam);
189  int __cdecl sc2(char* APLUS,int* IHAZE,char* CNOVAM, int* ISEASN, char* ARUSS,
190  int* IVULCN, int* ICSTL, int* ICLD,int* IVSA, float* VIS,
191  float* WSS, float* WHH, float* RAINRT, float* GNDALT);
192  int __cdecl sc2a(float* CTHIK, float* CALT, float* CEXT, int* ISEED,
193  int* NCRALT, int* NCRSPC, float* CWAVLN, float* CCOLWD,
194  float* CCOLIP, float* CHUMID, float* ASYMWD, float* ASYMIP);
195  int __cdecl sc2ap(float* ZAER11, float* ZAER12, float* SCALE1, float* ZAER21,
196  float* ZAER22, float* SCALE2, float* ZAER31, float* ZAER32,
197  float* SCALE3, float* ZAER41, float* ZAER42, float* SCALE4);
198  int __cdecl sc2b(float* ZCVSA, float* ZTVSA, float* ZINVSA);
199  int __cdecl sc2c(int* ML, int* IRD1, int* IRD2, char* HMODEL);
200  int __cdecl sc2c1( float* C2C1ZM, float* C2C1P, float* C2C1T,
201  float* C2C1WMOL1, float* C2C1WMOL2, float* C2C1WMOL3, char* C2C1JCHAR);
202  int __cdecl sc2c2( float* WMOL4, float* WMOL5, float* WMOL6, float* WMOL7,
203  float* WMOL8, float* WMOL9, float* WMOL10,float* WMOL11,float* WMOL12);
204  int __cdecl sc2c2x(float* WMOLX1,float* WMOLX2,float* WMOLX3,float* WMOLX4,float* WMOLX5,
205  float* WMOLX6,float* WMOLX7,float* WMOLX8,float* WMOLX9,float* WMOLX10,
206  float* WMOLX11, float* WMOLX12, float* WMOLX13);
207  int __cdecl sc2c3( int* IHA1, int* ICLD1, int* IVUL1, int* ISEA1, int* ICHR,
208  float* AHAZE1, float* AHAZE2, float* AHAZE3, float*AHAZE4, float* EQLWCZ, float* RRATZ);
209  int __cdecl sc2d(int* C2DIREG);
210  int __cdecl sc2d1(float* C2D1AWCCON, char C2D1TITLE[4][72]);
211  int __cdecl sc2d2(float C2D2VARSPC[4][47], float C2D2EXTC[4][47], float C2D2ABSC[4][47], float C2D2ASYM[4][47]);
212  int __cdecl sc2e1(float* ZCLD, float* CLD, float* CLDICE, float* RR);
213  int __cdecl sc2e2(float* C2E2WAVLEN, float* C2E2EXTC6, float* C2E2ABSC6, float* C2E2ASYM6, float* C2E2EXTC7, float* C2E2ABSC7, float* C2E2ASYM7);
214  int __cdecl sc3(float* H1, float* H2, float* ANGLE, float* RANGE, float* BETA,
215  float* RO, int* LENN, float* PHI, int* IDAY, int* ISOURCE,
216  float* ANGLEM);
217  int __cdecl sc3a1(int* IPARM, int* IPH, int* IDAY, int* ISOURC);
218  int __cdecl sc3a2(float* PARM1, float* PARM2, float* PARM3, float* PARM4,
219  float* TIME, float* PSIPO, float* ANGLEM, float* G);
220  int __cdecl sc3b1(int* C3B1NANGLS, int* C3B1NWLF);
221  int __cdecl sc3b2(float* C3B2ANGF, float* C3B2F1, float* C3B2F2, float* C3B2F3, float* C3B2F4);
222  int __cdecl sc3c(float* C3C1ANGF, float* C3C2WLF, float* C3C36F);
223  int __cdecl sc4(float* V1, float* V2, float* DV, float* FWHM,
224  char* YFLAG, char* XFLAG, char* DLIMIT, char* FLAGS);
225  int __cdecl sc5(int* IRPT);
226  int __cdecl scirradangles(int *cIon_off, float* cIsolar_angle, float* cIlunar_angle);
227  int __cdecl fillprofile();
228  int __cdecl driver();
229  int __cdecl atmprops();
230  int __cdecl gxmit(float* AVXMIT);
231  int __cdecl gptrad(float* RADSUM);
232  int __cdecl pltdat(int* nPts, float* x, float* y, float*y2, float* ysum, float* y2sum);
233  int __cdecl putatm(int *nx, float *x, int* nalt, float* alt);
234  int __cdecl newputatm(int *nx, float *x, int* nalt, float* alt);
235  int __cdecl getatm(int *num, float* prd,float* ext,float* psc, float* agd, float* ssa, float* lth);
236  int __cdecl newgetatm(float *ext, float* sct, float* prd, float* ap, float* bp, float* cp, float* am, float* bm, float* cm);
237  int __cdecl toairradiance(int* IDAY, float* ANGLE, int* NLAMBDA, float* LAMBDA, float* SOLAR, float* LUNAR);
238  int __cdecl getprofile(int* nlayers, int* nspecs, float* altkm, float* presmb, float *tempk, float* rfindex, float* dense, int* ncld, float* zcld, float* wat, float* ice, float* rr);
239 #else
240  int _stdcall scenv(char* IDIR, char* ODIR, int* ilen, int *olen);
241  int _stdcall sc1(char *code, int* model, int* type, int* mode, int* mult,
242  int* m1, int* m2, int* m3, int* m4, int* m5, int* m6,
243  int* mdef, int* im, int* noprnt, float* tbound, float* salb);
244  int _stdcall sc1a(int* DIS, int* NSTR, int* LSUN, int* ISUN, float* CO2MX,
245  float* SOLCON, char* H2OSTR, char* O3STR, char* SUNFL2);
246  int _stdcall sc1a1(char* SUNFL2);
247  int _stdcall sc1a2(char* c1a2Bmname);
248  int _stdcall sc1a3(char* c1a3Fltnam);
249  int _stdcall sc2(char* APLUS,int* IHAZE,char* CNOVAM, int* ISEASN, char* ARUSS,
250  int* IVULCN, int* ICSTL, int* ICLD,int* IVSA, float* VIS,
251  float* WSS, float* WHH, float* RAINRT, float* GNDALT);
252  int _stdcall sc2a(float* CTHIK, float* CALT, float* CEXT, int* ISEED,
253  int* NCRALT, int* NCRSPC, float* CWAVLN, float* CCOLWD,
254  float* CCOLIP, float* CHUMID, float* ASYMWD, float* ASYMIP);
255  int _stdcall sc2ap(float* ZAER11, float* ZAER12, float* SCALE1, float* ZAER21,
256  float* ZAER22, float* SCALE2, float* ZAER31, float* ZAER32,
257  float* SCALE3, float* ZAER41, float* ZAER42, float* SCALE4);
258  int _stdcall sc2b(float* ZCVSA, float* ZTVSA, float* ZINVSA);
259  int _stdcall sc2c(int* ML, int* IRD1, int* IRD2, char* HMODEL);
260  int _stdcall sc2c1( float* C2C1ZM, float* C2C1P, float* C2C1T,
261  float* C2C1WMOL1, float* C2C1WMOL2, float* C2C1WMOL3, char* C2C1JCHAR);
262  int _stdcall sc2c2( float* WMOL4, float* WMOL5, float* WMOL6, float* WMOL7,
263  float* WMOL8, float* WMOL9, float* WMOL10,float* WMOL11,float* WMOL12);
264  int _stdcall sc2c2x(float* WMOLX1,float* WMOLX2,float* WMOLX3,float* WMOLX4,float* WMOLX5,
265  float* WMOLX6,float* WMOLX7,float* WMOLX8,float* WMOLX9,float* WMOLX10,
266  float* WMOLX11, float* WMOLX12, float* WMOLX13);
267  int _stdcall sc2c3( int* IHA1, int* ICLD1, int* IVUL1, int* ISEA1, int* ICHR,
268  float* AHAZE1, float* AHAZE2, float* AHAZE3, float*AHAZE4, float* EQLWCZ, float* RRATZ);
269  int _stdcall sc2d(int* C2DIREG);
270  int _stdcall sc2d1(float* C2D1AWCCON, char C2D1TITLE[4][72]);
271  int _stdcall sc2d2(float C2D2VARSPC[4][47], float C2D2EXTC[4][47], float C2D2ABSC[4][47], float C2D2ASYM[4][47]);
272  int _stdcall sc2e1(float* ZCLD, float* CLD, float* CLDICE, float* RR);
273  int _stdcall sc2e2(float* C2E2WAVLEN, float* C2E2EXTC6, float* C2E2ABSC6, float* C2E2ASYM6, float* C2E2EXTC7, float* C2E2ABSC7, float* C2E2ASYM7);
274  int _stdcall sc3(float* H1, float* H2, float* ANGLE, float* RANGE, float* BETA,
275  float* RO, int* LENN, float* PHI, int* IDAY, int* ISOURCE,
276  float* ANGLEM);
277  int _stdcall sc3a1(int* IPARM, int* IPH, int* IDAY, int* ISOURC);
278  int _stdcall sc3a2(float* PARM1, float* PARM2, float* PARM3, float* PARM4,
279  float* TIME, float* PSIPO, float* ANGLEM, float* G);
280  int _stdcall sc3b1(int* C3B1NANGLS, int* C3B1NWLF);
281  int _stdcall sc3b2(float* C3B2ANGF, float* C3B2F1, float* C3B2F2, float* C3B2F3, float* C3B2F4);
282  int _stdcall sc3c(float* C3C1ANGF, float* C3C2WLF, float* C3C36F);
283  int _stdcall sc4(float* V1, float* V2, float* DV, float* FWHM,
284  char* YFLAG, char* XFLAG, char* DLIMIT, char* FLAGS);
285  int _stdcall sc5(int* IRPT);
286  int _stdcall scirradangles(int *cIon_off, float* cIsolar_angle, float* cIlunar_angle);
287  int _stdcall fillprofile();
288  int _stdcall driver();
289  int _stdcall atmprops();
290  int _stdcall gxmit(float* AVXMIT);
291  int _stdcall gptrad(float* RADSUM);
292  int _stdcall pltdat(int* nPts, float* x, float* y, float*y2, float* ysum, float* y2sum);
293  int _stdcall putatm(int *nx, float *x, int* nalt, float* alt);
294  int _stdcall newputatm(int *nx, float *x, int* nalt, float* alt);
295  int _stdcall getatm(int *num, float* prd,float* ext,float* psc, float* agd, float* ssa, float* lth);
296  int _stdcall newgetatm(float *ext, float* sct, float* prd, float* ap, float* bp, float* cp, float* am, float* bm, float* cm);
297  int _stdcall toairradiance(int* IDAY, float* ANGLE, int* NLAMBDA, float* LAMBDA, float* SOLAR, float* LUNAR);
298  int _stdcall getprofile(int* nlayers, int* nspecs, float* altkm, float* presmb, float *tempk, float* rfindex, float* dense, int* ncld, float* zcld, float* wat, float* ice, float* rr);
299 #endif
300 
301 
302 #endif // WIN32 && DYNAMICMR or not
303 
304 
305  int SetRequiredMOD2ATMFields(char *sigsim_atm_dir, double altlo, EPHEMERIS fm, BAND band, MODCARD *mc);
306  // ModSetDefaultSTD() optionally sets default standard atmosphere in METIN MODCARD for Modtran runs.
307  MODRAD_API void ModSetDefaultSTD(char *sigsim_atm_dir, MODCARD *mc, EPHEMERIS fm, ATM_DEFAULT atm_default);
308  MODRAD_API void ModSetPlumeShell(char *sigsim_atm_dir, MODCARD *mc, EPHEMERIS fm, ATM_VOL_PROPS atm, double dalt_km);
309 
310  int TransferData(MODCARD mc);
311  int AddRadCloudRainLevel(RADCARD *rc, float altkm, float cloud_gm3, float rain_mmhr, float RH_ratio);
312  MODRAD_API float ModCloudBaseAltkm(int CloudType);
313  MODRAD_API float ModCloudThicknesskm(int CloudType);
314  MODRAD_API float ModCloudDensitykmgm3(int CloudType);
315  int SetConstantMCGrid(ATM_DEFAULT atm_default, MODCARD *mc); // For testing correspondence between Modtran & SigSim
316  MODRAD_API int UpdateMODCARD(char *sigsim_atm_dir, MODCARD *mc, ATM_DEFAULT *atm_default, EPHEMERIS fm, jrmbool Use_Default);
317  MODRAD_API int WriteModcard(char *filename, MODCARD *mc);
318  MODRAD_API int ReadModcard(char *filename, MODCARD *mc);
319  MODRAD_API int WriteM37Tape5(char *filename, MODCARD *mc);
321  MODRAD_API int ReadM37Tape5(char *filename, MODCARD *mc);
322 
323  /* --------------- END OF MODTRAN API ----------------------- */
324 
325  /* ------------ RADTRAN API ----------------------------- */
326 
327 
328 #if defined WIN32 && DYNAMICMR
329 
330  typedef int (MODRADENTRY * RCENV) (char* IDIR, char* ODIR, int* ilen, int *olen);
331  typedef int (MODRADENTRY * RC1) (char* TITLE);
332  typedef int (MODRADENTRY * RC2) (int* IRDTRN,int* IATM,int* ISRFC,int* IMS,int* IPLOT,int* NANGLE,int* MODE,
333  int* ITABLE,int* IATTEN,int* IATINC,int* IWF,int* IWFINC,int* IRDH2O,int* NOPR,float* TGRND);
334  typedef int (MODRADENTRY * RC3) (float* DIST,float* PHASE,float* FREQ,int* RNRATE,int* TEMP);
335  typedef int (MODRADENTRY * RC411) (int* ICNTRL,int* MLEV,char* ATITLE);
336  typedef int (MODRADENTRY * RC412) (char* FMT);
337  typedef int (MODRADENTRY * RC413) (float* H,float* P,float* T,float* RH,float* CLOUD,float* RAIN);
338  typedef int (MODRADENTRY * RC42) (int* MOD,int* MHUMID,int* MCLOUD,int* MRAIN);
339  typedef int (MODRADENTRY * RC511) (int* IGRND,int* IEMTAB,float* TEMP1,float* TEMP2);
340  typedef int (MODRADENTRY * RC512) (float* A,float* FRAC,float* EB,float* E2DRY,float*DEPDRY);
341  typedef int (MODRADENTRY * RC513) (float* A1,float* FS1,float* A2,float* FS2,float* E2WET,float* DEPWET);
342  typedef int (MODRADENTRY * RC514) (float* LP,float* LZ,float* MV,float* E2RAN,float* DEPRAN,float* HH,float* DMV);
343  typedef int (MODRADENTRY * RC515) (float* VV,float* VB,float* VBW,float* BULK);
344  typedef int (MODRADENTRY * RC516) (float* WT,float* GA,float* PO,float* ROCK);
345  typedef int (MODRADENTRY * RC517) (float* EM,float* DEL);
346  typedef int (MODRADENTRY * RC52) (float* EMISH);
347  typedef int (MODRADENTRY * RC53) (float* EMISV);
348  typedef int (MODRADENTRY * RC61) (float* EMHMS);
349  typedef int (MODRADENTRY * RC62) (float* EMVMS);
350  typedef int (MODRADENTRY * RC7) (char* NAME);
351  typedef int (MODRADENTRY * RC8) (float* ANGLE);
352  typedef int (MODRADENTRY * RC91) (float* VV1,float* VV2,float* DV);
353  typedef int (MODRADENTRY * RC92) (int* NFREQ, float* V1,float* V2,float* V3,float* E2R, float* E2I,float* DELF);
354  typedef int (MODRADENTRY * RC10) (int* IRPT,int* DOFLAG);
355  typedef int (MODRADENTRY * RADTRAN) ();
356  typedef int (MODRADENTRY * RTEXTCOEF) (int* NALT,int* NFREQ,float* ALT,float* FREQ,float* EXTCOEF ,float* BT );
357  typedef int (MODRADENTRY * RTBRIGHT) (int* NFREQ,int* NANGLE,float* FREQ,float* ANGLE,
358  float* GAM,float* DSUM,float* UPAT,float* SRFH,
359  float* SRFV,float* USMH,float* USMV,float* MISH,float* MISV);
360  typedef int (MODRADENTRY * SCATTER) (float* F_GHZ, float* RR_mmphr, float* T_K, int* PHASE12, int* DIST12, float* SC, int* SCATERR);
361 
362  HMODULE RadLib;
363 
364  RCENV rcenv;
365  RC1 rc1;
366  RC2 rc2;
367  RC3 rc3;
368  RC411 rc411;
369  RC412 rc412;
370  RC413 rc413;
371  RC42 rc42;
372  RC511 rc511;
373  RC512 rc512;
374  RC513 rc513;
375  RC514 rc514;
376  RC515 rc515;
377  RC516 rc516;
378  RC517 rc517;
379  RC52 rc52;
380  RC53 rc53;
381  RC61 rc61;
382  RC62 rc62;
383  RC7 rc7;
384  RC8 rc8;
385  RC91 rc91;
386  RC92 rc92;
387  RC10 rc10;
390  RTBRIGHT rtbright;
392 
393  MODRAD_API int LoadDynamicRadtran();
394  MODRAD_API void UnloadDynamicRadtran();
395 
396 #else // not WIN32 or not DYNAMICMR
397 
398 #ifdef WIN32
399  int __cdecl rcenv(char* IDIR, char* ODIR, int* ilen, int *olen);
400  int __cdecl rc1(char* TITLE);
401  int __cdecl rc2(int* IRDTRN,int* IATM,int* ISRFC,int* IMS,int* IPLOT,int* NANGLE,int* MODE,
402  int* ITABLE,int* IATTEN,int* IATINC,int* IWF,int* IWFINC,int* IRDH2O,int* NOPR,float* TGRND);
403  int __cdecl rc3(float* DIST,float* PHASE,float* FREQ,int* RNRATE,int* TEMP);
404  int __cdecl rc411(int* ICNTRL,int* MLEV,char* ATITLE);
405  int __cdecl rc412(char* FMT);
406  int __cdecl rc413(float* H,float* P,float* T,float* RH,float* CLOUD,float* RAIN);
407  int __cdecl rc42(int* MOD,int* MHUMID,int* MCLOUD,int* MRAIN);
408  int __cdecl rc511(int* IGRND,int* IEMTAB,float* TEMP1,float* TEMP2);
409  int __cdecl rc512(float* A,float* FRAC,float* EB,float* E2DRY,float*DEPDRY);
410  int __cdecl rc513(float* A1,float* FS1,float* A2,float* FS2,float* E2WET,float* DEPWET);
411  int __cdecl rc514(float* LP,float* LZ,float* MV,float* E2RAN,float* DEPRAN,float* HH,float* DMV);
412  int __cdecl rc515(float* VV,float* VB,float* VBW,float* BULK);
413  int __cdecl rc516(float* WT,float* GA,float* PO,float* ROCK);
414  int __cdecl rc517(float* EM,float* DEL);
415  int __cdecl rc52(float* EMISH);
416  int __cdecl rc53(float* EMISV);
417  int __cdecl rc61(float* EMHMS);
418  int __cdecl rc62(float* EMVMS);
419  int __cdecl rc7(char* NAME);
420  int __cdecl rc8(float* ANGLE);
421  int __cdecl rc91(float* VV1,float* VV2,float* DV);
422  int __cdecl rc92(int* NFREQ, float* V1,float* V2,float* V3,float* E2R, float* E2I,float* DELF);
423  int __cdecl rc10(int* IRPT,int* DOFLAG);
424  int __cdecl radtran();
425  int __cdecl rtextcoef(int* NALT,int* NFREQ,float* ALT,float* FREQ,float* EXTCOEF ,float* BT );
426  int __cdecl rtbright(int* NFREQ,int* NANGLE,float* FREQ,float* ANGLE,
427  float* GAM,float* DSUM,float* UPAT,float* SRFH,
428  float* SRFV,float* USMH,float* USMV,float* MISH,float* MISV);
429  int __cdecl scatter(float* F_GHZ, float* RR_mmphr, float* T_K, int* PHASE12, int* DIST12, float* SC, int* SCATERR);
430 #else
431  int _stdcall rcenv(char* IDIR, char* ODIR, int* ilen, int *olen);
432  int _stdcall rc1(char* TITLE);
433  int _stdcall rc2(int* IRDTRN,int* IATM,int* ISRFC,int* IMS,int* IPLOT,int* NANGLE,int* MODE,
434  int* ITABLE,int* IATTEN,int* IATINC,int* IWF,int* IWFINC,int* IRDH2O,int* NOPR,float* TGRND);
435  int _stdcall rc3(float* DIST,float* PHASE,float* FREQ,int* RNRATE,int* TEMP);
436  int _stdcall rc411(int* ICNTRL,int* MLEV,char* ATITLE);
437  int _stdcall rc412(char* FMT);
438  int _stdcall rc413(float* H,float* P,float* T,float* RH,float* CLOUD,float* RAIN);
439  int _stdcall rc42(int* MOD,int* MHUMID,int* MCLOUD,int* MRAIN);
440  int _stdcall rc511(int* IGRND,int* IEMTAB,float* TEMP1,float* TEMP2);
441  int _stdcall rc512(float* A,float* FRAC,float* EB,float* E2DRY,float*DEPDRY);
442  int _stdcall rc513(float* A1,float* FS1,float* A2,float* FS2,float* E2WET,float* DEPWET);
443  int _stdcall rc514(float* LP,float* LZ,float* MV,float* E2RAN,float* DEPRAN,float* HH,float* DMV);
444  int _stdcall rc515(float* VV,float* VB,float* VBW,float* BULK);
445  int _stdcall rc516(float* WT,float* GA,float* PO,float* ROCK);
446  int _stdcall rc517(float* EM,float* DEL);
447  int _stdcall rc52(float* EMISH);
448  int _stdcall rc53(float* EMISV);
449  int _stdcall rc61(float* EMHMS);
450  int _stdcall rc62(float* EMVMS);
451  int _stdcall rc7(char* NAME);
452  int _stdcall rc8(float* ANGLE);
453  int _stdcall rc91(float* VV1,float* VV2,float* DV);
454  int _stdcall rc92(int* NFREQ, float* V1,float* V2,float* V3,float* E2R, float* E2I,float* DELF);
455  int _stdcall rc10(int* IRPT,int* DOFLAG);
456  int _stdcall radtran();
457  int _stdcall rtextcoef(int* NALT,int* NFREQ,float* ALT,float* FREQ,float* EXTCOEF ,float* BT );
458  int _stdcall rtbright(int* NFREQ,int* NANGLE,float* FREQ,float* ANGLE,
459  float* GAM,float* DSUM,float* UPAT,float* SRFH,
460  float* SRFV,float* USMH,float* USMV,float* MISH,float* MISV);
461  int _stdcall scatter(float* F_GHZ, float* RR_mmphr, float* T_K, int* PHASE12, int* DIST12, float* SC, int* SCATERR);
462 #endif
463 #endif // WIN32 && DYNAMICMR or not
464 
465 
466  int AllocateRadCoef(RADCOEF **rte, RADINFO inf);
467  int FillRADCOEF(RADINFO* inf, RADCOEF* rte);
468 
469  MODRAD_API void RadSetDefaultSTD(char *sigsim_atm_dir, RADCARD *rc, ATM_DEFAULT atm_default);
470  int RadTransferData(RADCARD rc);
471  MODRAD_API int WriteR89Skypar(char *filename, RADCARD *rc);
472  MODRAD_API int ReadR89Skypar(char *filename, RADCARD *rc);
473 
474  /* --------------- END OF RADTRAN API -------------------- */
475 
476 
477 
478 #ifdef __cplusplus
479 }
480 #endif
481 
482 #endif // _MR_COMMON_H_
483 


Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)