Athena++/Atmosphere
Planetary Atmosphere Simulator
cdisort.h
Go to the documentation of this file.
1 /************************************************************************
2  * @f$Id: cdisort.h 2887 2013-03-11 09:19:28Z robert.buras @f$
3  ************************************************************************/
4 
5 /*
6  * Copyright (c) 2011 by Timothy E. Dowling
7  *
8  * This file is part of cdisort.
9  *
10  * cdisort is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * cdisort is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with cdisort. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef __cdisort_h
25 #define __cdisort_h
26 
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <errno.h>
30 #include <math.h>
31 #include <string.h>
32 #include <ctype.h>
33 #include <limits.h>
34 #include <float.h>
35 
36 #if HAVE_BRDF
37 #include "ocean.h"
38 #include "ambralsfor.h"
39 #endif
40 
41 /*------------*
42  * Structures *
43  *------------*/
44 /*
45  * See DISORT.txt for details on inputs and outputs.
46  */
47 typedef struct {
48  /* DISORT CONTROL FLAGS */
49  int
50  usrtau, /* TRUE=> radiant quantities returned at user-specified optical depths */
51  usrang, /* TRUE=> radiant quantities returned at user-specified polar angles */
52  ibcnd, /* SPECIAL_BC => return only albedo and transmis., see Ref S2 */
53  lamber, /* TRUE=> isotropically reflecting bottom boundary, FALSE=>bi-dir. */
54  planck, /* TRUE=>incl. thermal emission */
55  spher, /* TRUE=>pseudo-spherical geometry, otherwise plane-parallel */
56  onlyfl, /* FALSE=>return intensities in addition to other radiant quantities */
57  prnt[5], /* Print flags: 0=input variables (except pmom), 1=fluxes, */
58  /* 2=intensities, 3=transmis. and albedo, 4=pmom */
59  brdf_type, /* type of BRDF, can be Hapke, RPV, Cox&Munk, Ambrals */
60  quiet, /* quiet output */
61  intensity_correction, /* apply intensity correction */
62  old_intensity_correction, /* use original intensity correction routine */
63  general_source, /* Include solution for a general user specified source term. */
64  output_uum; /* TRUE=> uum is returned as a seperate output */
65 } disort_flag;
66 
67 typedef struct {
68  /* DISORT OUTPUT RADIANT QUANTITIES */
69  double
70  rfldir, /* Direct-beam flux (w/o delta-M scaling), */
71  rfldn, /* Diffuse down-flux (tot.-direct-beam; w/o delta-M scaling), */
72  flup, /* Diffuse up-flux */
73  dfdt, /* Flux divergence, d(net flux)/d(optical depth) */
74  uavg, /* Mean intensity, incl. direct beam (not corr. for delta-M scaling) */
75  uavgdn, /* Mean diffuse downward intensity, not incl. direct beam */
76  /* (not corr. for delta-M scaling) */
77  uavgup, /* Mean diffuse downward intensity, not incl. direct beam */
78  /* (not corr. for delta-M scaling) */
79  uavgso; /* Mean diffuse direct solar, that is the direct beam */
80  /* (not corr. for delta-M scaling) */
82 
83 typedef struct {
84  /* DISORT TOP AND BOTTOM BOUNDARY CONDITIONS */
85  double
86  fbeam, /* Intensity of incident parallel beam at top boundary */
87  umu0, /* Polar angle cosine of incident beam (positive) */
88  phi0, /* Azimuth angle of incident beam (0 to 360 deg) */
89  fisot, /* Intensity of top-boundary isotropic illumination */
90  fluor, /* Intensity of bottom-boundary isotropic illumination */
91  ttemp, /* Temperature [K] of top boundary */
92  btemp, /* Temperature [K] of bottom boundary */
93  temis, /* Emissivity of top boundary. Needed if planck = TRUE */
94  albedo; /* Albedo of bottom boundary, needed if lamber = TRUE */
95 } disort_bc;
96 
97 typedef struct {
98  /* RPV BRDF specifications */
99  double
100  rho0, /* BRDF rpv: rho0 */
101  k, /* BRDF rpv: k */
102  theta, /* BRDF rpv: theta */
103  sigma, /* BRDF rpv snow: sigma */
104  t1, /* BRDF rpv snow: t1 */
105  t2, /* BRDF rpv snow: t2 */
106  scale; /* BRDF rpv: scale */
107 } rpv_brdf_spec;
108 
109 typedef struct {
110  /* Ambrals BRDF specifications */
111  double
112  iso, /* BRDF ambrals: iso */
113  vol, /* BRDF ambrals: vol */
114  geo; /* BRDF ambrals: geo */
116 
117 typedef struct {
118  /* Cox and Munk BRDF specifications */
119  double
120  u10, /* BRDF C&M: u10 */
121  pcl, /* BRDF C&M: pcl */
122  xsal; /* BRDF C&M: sal */
123 } cam_brdf_spec;
124 
125 typedef struct {
126  /* brdf types */
128  *rpv; /* specification for rpv BRDF */
129 #if HAVE_BRDF
131  *ambrals; /* specification for ambrals BRDF */
133  *cam; /* specification for Cox&Munk BRDF */
134 #endif
135 } disort_brdf;
136 
137 
138 typedef struct disort_state {
139  char
140  header[1024];
143  disort_bc
144  bc;
147  int
148  nlyr, /* Number of computational layers */
149  nmom, /* Number of phase function moments (not including the zeroth) */
150  nstr, /* Number of streams (computational polar angles). Even and >= 2 */
151  nmom_nstr, /* IMAX(ds.nmom,ds.nstr), used to set size of 1st dimension of PMOM */
152  ntau, /* Number of computational optical depths */
153  numu, /* Number of computational polar angles */
154  nphi, /* Number of azimuthal angles at which to return intensities */
155  nphase; /* number of angles (grid points) */
156  double
157  wvnmlo, /* Wavenumber [cm^-1] lower range, used for Planck function */
158  wvnmhi, /* Wavenumber [cm^-1] upper range, used for Planck function */
159  accur, /* Convergence criteria for azimuthal (Fourier cosine) series */
160  radius; /* Radius of the body of interest. Only used if spher=TRUE. Must be */
161  /* the same units as zd. */
162  double
163  *dtauc, /* Optical depths of computational layers, DTAUC(lc) */
164  *ssalb, /* Single-scatter albedos of computational layers, SSALB(lc) */
165  *pmom, /* Coefficients (moments) of Legendre polynomials, PMOM(k,lc) */
166  *temper, /* Temperatures [K] of levels, TEMPER(lev) */
167  *utau, /* Optical depths, in increasing order, on layer boundaries, UTAU(lu) */
168  *umu, /* Cosines of polar angles, increasing order, UMU(iu) */
169  *phi, /* Azimuthal output angles [deg], used when onlyfl = FALSE */
170  *zd, /* The altitude of levels, used when flag.spher = TRUE */
171  *mu_phase, /* values of scattering angles for which phase function given */
172  *phase, /* phase function as a function of scattering angles */
173  *gensrc, /* User specified general source at computational angles */
174  *gensrcu; /* User specified general source at user angles */
176 
177 typedef struct disort_output {
179  *rad; /* See typedef disort_radiant */
180  double
181  *albmed, /* Albedo of medium, ALBMED(iu) (ds.flag.ibcnd = SPECIAL_BC case only) */
182  *trnmed, /* Transmissivity of medium, TRNMED(iu) (ds.flag.ibcnd = SPECIAL_BC) */
183  *uu, /* Intensity, UU(iu,lu,j) (if ds.flag.onlyfl = FALSE; zero otherwise) */
184  *u0u, /* Az.av.Int. U0U(iu,lu,j) (if ds.flag.onlyfl = FALSE; zero otherwise) */
185  *uum; /* Intensity, UUM(iu,lu,j) (if ds.flag.output_uum = TRUE; not
186  allocated space or used otherwise) */
188 
189 typedef struct {
190  double
193 } disort_pair;
194 
195 typedef struct {
196  double
201 
202 /*
203  * Definitions specific to twostr()
204  */
205 
206 #define TWOSTR_NERR 22
207 
208 typedef struct {
209  double
211  on,
213 } twostr_diag;
214 
215 typedef struct {
216  double
217  xb_0d, /* x-sub-zero-sup-minus in expansion of pseudo-spherical beam source, Eq. KST(22) */
218  xb_0u, /* x-sub-zero-sup-plus " */
219  xb_1d, /* x-sub-one-sup-minus " */
220  xb_1u, /* x-sub-one-sup-plus " */
221  xp_0, /* x-sub-zero in expansion of thermal source func.; Eq. KST(22), has no (mu) dep. */
222  xp_1, /* x-sub-one " */
223  yb_0d, /* y-sub-zero-sup-minus in Eq. KST(23), solution for pseudo-spherical beam source */
224  yb_0u, /* y-sub-zero-sup-plus " */
225  yb_1d, /* y-sub-one-sup-minus " */
226  yb_1u, /* y-sub-one-sup-plus " */
227  yp_0d, /* y-sub-zero-sup-minus in Eq. KST(23), solution for thermal source */
228  yp_0u, /* y-sub-zero-sup-plus " */
229  yp_1d, /* y-sub-one-sup-minus " */
230  yp_1u, /* y-sub-one-sup-plus " */
231  zb_a, /* Alfa coefficient in Eq. KST(22) for pseudo-spherical beam source */
232  zp_a; /* Alfa coefficient in Eq. KST(22) for thermal source */
233 } twostr_xyz;
234 
235 /*
236  * Array shift macros
237  * Using unit-offset shift macros to match Fortran version
238  *
239  * NOTE: ARRAY(iq,jq) is defined locally instead of here, because its size is different
240  * in different subroutines.
241  */
242 #define A(i,j) a[i-1+(j-1)*lda]
243 #define AA(j,k) aa[j-1+(k-1)*ia]
244 #define ABD(i,j) abd[i-1+(j-1)*lda]
245 #define ALBMED(iu) out->albmed[iu-1]
246 #define AMB(iq,jq) ab[iq-1+(jq-1)*(ds->nstr/2)].zero
247 #define APB(iq,jq) ab[iq-1+(jq-1)*(ds->nstr/2)].one
248 
249 #define B(iq) b[iq-1]
250 #define BDR(iq,jq) bdr[iq-1+(jq)*(ds->nstr/2)]
251 #define BEM(iq) bem[iq-1]
252 
253 #define CBAND(irow,ncol) cband[irow-1+(ncol-1)*(9*(ds->nstr/2)-2)]
254 #define CC(iq,jq) cc[iq-1+(jq-1)*ds->nstr]
255 #define CH(lc) ch[lc-1]
256 #define CHTAU(ls) chtau[ls]
257 #define CMU(iq) cmu[iq-1]
258 #define CWT(iq) cwt[iq-1]
259 
260 #define DFDT(lu) out->rad[lu-1].dfdt
261 #define DIAG(i) diag[i-1].on
262 #define DTAUC(lc) ds->dtauc[lc-1]
263 #define DTAU_C(lc) dtau_c[lc-1]
264 #define DTAUCPR(lc) dtaucpr[lc-1]
265 
266 #define EMU(iu) emu[iu-1]
267 #define EVAL(j) eval[j-1]
268 #define EVEC(j,k) evec[j-1+(k-1)*ievec]
269 #define EVECC(iq,jq) evecc[iq-1+(jq-1)*ds->nstr]
270 #define EXPBEA(lc) expbea[lc]
271 
272 #define FLDIR(lu) fl[lu-1].zero
273 #define FLDN(lu) fl[lu-1].one
274 #define FLUP(lu) out->rad[lu-1].flup
275 #define FLYR(lc) flyr[lc-1]
276 
277 #define GC(iq,jq,lc) gc[iq-1+(jq-1+(lc-1)*ds->nstr)*ds->nstr]
278 #define GENSRC(maz,lc,iq) ds->gensrc[iq-1+(lc-1+maz*ds->nlyr)*ds->nstr]
279 #define GENSRCU(maz,lc,iu) ds->gensrcu[iu-1+(lc-1+maz*ds->nlyr)*ds->numu]
280 #define GG(lc) gg[lc-1]
281 #define GGPRIM(lc) ggprim[lc-1]
282 #define GL(k,lc) gl[k+(lc-1)*(ds->nstr+1)]
283 #define GMU(k) gmu[k-1]
284 #define GU(iu,iq,lc) gu[iu-1+(iq-1+(lc-1)*ds->nstr)*ds->numu]
285 #define GWT(k) gwt[k-1]
286 
287 #define IERROR(i) ierror[i-1]
288 #define IPVT(k) ipvt[k-1]
289 
290 #define KK(iq,lc) kk[iq-1+(lc-1)*ds->nstr]
291 
292 #define LAYRU(lu) layru[lu-1]
293 #define LL(iq,lc) ll[iq-1+(lc-1)*ds->nstr]
294 
295 #define MU(i) mu[i-1]
296 
297 #define OMEGA(lyr) omega[lyr-1]
298 #define OPRIM(lc) oprim[lc-1]
299 
300 #define PKAG(lc) pkag[lc]
301 #define PKAGC(lc) pkagc[lc-1]
302 #define PHASA(lc) phasa[lc-1]
303 #define PHASE(lc) phase[lc-1]
304 #define PHASM(lc) phasm[lc-1]
305 #define PHAST(lc) phast[lc-1]
306 #define PHI(j) ds->phi[j-1]
307 #define PHIRAD(jp) phirad[jp-1]
308 #define PMOM(k,lc) ds->pmom[k+(lc-1)*(ds->nmom_nstr+1)]
309 #define PRNTU0(i) prntu0[i-1]
310 #define PSI0(iq) psi[iq-1].zero
311 #define PSI1(iq) psi[iq-1].one
312 
313 #define RFLDIR(lu) out->rad[lu-1].rfldir
314 #define RFLDN(lu) out->rad[lu-1].rfldn
315 #define RMU(iu,iq) rmu[iu-1+(iq)*ds->numu]
316 #define RR(lc) rr[lc-1]
317 
318 #define SSALB(lc) ds->ssalb[lc-1]
319 #define SUBD(i) diag[i-1].sub
320 #define SUPERD(i) diag[i-1].super
321 #define SX(i) sx[i-1]
322 #define SY(i) sy[i-1]
323 
324 #define TAU(lc) tau[lc]
325 #define TAUC(lc) tauc[lc]
326 #define TAUCPR(lc) taucpr[lc]
327 #define TEMPER(lc) ds->temper[lc]
328 #define TRNMED(iu) out->trnmed[iu-1]
329 
330 #define U0C(iq,lu) u0c[iq-1+(lu-1)*ds->nstr]
331 #define U0U(iu,lu) out->u0u[iu-1+(lu-1)*ds->numu]
332 #define UAVG(lu) out->rad[lu-1].uavg
333 #define UAVGDN(lu) out->rad[lu-1].uavgdn
334 #define UAVGUP(lu) out->rad[lu-1].uavgup
335 #define UAVGSO(lu) out->rad[lu-1].uavgso
336 #define UMU(iu) ds->umu[iu-1]
337 #define UTAU(lu) ds->utau[lu-1]
338 #define UTAUPR(lu) utaupr[lu-1]
339 #define UUM(iu,lu) uum[iu-1+(lu-1)*ds->numu]
340 #define UU(iu,lu,j) out->uu[iu-1+(lu-1+(j-1)*ds->ntau)*ds->numu]
341 #define OUT_UUM(iu,lu,j) out->uum[iu-1+(lu-1+(j)*ds->ntau)*ds->numu] /* No -i behind j as mazim starts at 0, aky */
342 
343 #define WK(iq) wk[iq-1]
344 
345 #define XBA(lc) xba[lc]
346 #define XB0(iq,lc) xb[iq-1+(lc-1)*ds->nstr].zero
347 #define XB1(iq,lc) xb[iq-1+(lc-1)*ds->nstr].one
348 #define XB_0D(lc) ts[lc-1].xb_0d
349 #define XB_0U(lc) ts[lc-1].xb_0u
350 #define XB_1D(lc) ts[lc-1].xb_1d
351 #define XB_1U(lc) ts[lc-1].xb_1u
352 #define XP_0(lc) ts[lc-1].xp_0
353 #define XP_1(lc) ts[lc-1].xp_1
354 #define XR0(lc) xr[lc-1].zero
355 #define XR1(lc) xr[lc-1].one
356 
357 #define YB_0D(lc) ts[lc-1].yb_0d
358 #define YB_0U(lc) ts[lc-1].yb_0u
359 #define YB_1D(lc) ts[lc-1].yb_1d
360 #define YB_1U(lc) ts[lc-1].yb_1u
361 #define YLM(l,i) ylm[l+(i-1)*(maxmu+1)]
362 #define YLM0(iq) ylm0[iq]
363 #define YLMC(l,iq) ylmc[l+(iq-1)*(ds->nstr+1)]
364 #define YLMU(l,iu) ylmu[l+(iu-1)*(ds->nstr+1)]
365 #define YP_0D(lc) ts[lc-1].yp_0d
366 #define YP_0U(lc) ts[lc-1].yp_0u
367 #define YP_1D(lc) ts[lc-1].yp_1d
368 #define YP_1U(lc) ts[lc-1].yp_1u
369 
370 #define Z(j) z[j-1]
371 #define Z0(iu) zee[iu-1].zero
372 #define Z1(iq) zee[iq-1].one
373 #define Z0U(iu,lc) zu[iu-1+(lc-1)*ds->numu].zero
374 #define Z1U(iu,lc) zu[iu-1+(lc-1)*ds->numu].one
375 #define ZB0U(iu,lc) zbu[iu-1+(lc-1)*ds->numu].zero
376 #define ZB1U(iu,lc) zbu[iu-1+(lc-1)*ds->numu].one
377 #define ZBAU(iu,lc) zbu[iu-1+(lc-1)*ds->numu].alpha
378 #define ZB_A(lc) ts[lc-1].zb_a
379 #define ZBEAM(iu,lc) zbeam[iu-1+(lc-1)*ds->numu]
380 #define ZBEAMA(lc) zbeama[lc-1]
381 #define ZBEAM0(iq,lc) zbeamsp[iq-1+(lc-1)*ds->nstr].zero
382 #define ZBEAM1(iq,lc) zbeamsp[iq-1+(lc-1)*ds->nstr].one
383 #define ZBS0(iq) zbs[iq-1].zero
384 #define ZBS1(iq) zbs[iq-1].one
385 #define ZD(j) zd[j]
386 #define ZJ(j) zj[j-1]
387 #define ZJG(j) zjg[j-1]
388 #define ZJU(j) zju[j-1]
389 #define ZGU(iu,lc) zgu[iu-1+(lc-1)*ds->numu]
390 #define ZP_A(lc) ts[lc-1].zp_a
391 #define ZPLK0(iq,lc) plk[iq-1+(lc-1)*ds->nstr].zero
392 #define ZPLK1(iq,lc) plk[iq-1+(lc-1)*ds->nstr].one
393 #define ZZ(iq,lc) zz[iq-1+(lc-1)*ds->nstr]
394 #define ZZG(iq,lc) zzg[iq-1+(lc-1)*ds->nstr]
395 
396 /* BDE stuff */
397 #define MUP(it) mu_phase[it-1]
398 #define PHASR(lc) phasr[lc-1]
399 #define PHAS2(it,lc) phas2[it-1+(lc-1)*nphase]
400 #define DSPHASE(it,lc) ds->phase[it-1+(lc-1)*ds->nphase]
401 #define F_PHAS2_ABS(it) f_phas2_abs[it-1]
402 #define MU_EQ(i,lu) mu_eq[i-1+(lu-1)*nf]
403 #define NEG_PHAS(i,lu) neg_phas[i-1+(lu-1)*nf]
404 #define NORM_PHAS(lu) norm_phas[lu-1]
405 
406 /* setout.f, inter.f stuff */
407 #define SDTAUC(i) sdtauc[i-1]
408 #define SUTAU(i) sutau[i-1]
409 #define ZOUT(i) zout[i-1]
410 #define TAUINT(i) tauint[i-1]
411 #define XARR(i) xarr[i-1]
412 #define YARR(i) yarr[i-1]
413 
414 /*
415  * Logical
416  */
417 #define TRUE 1
418 #define FALSE 0
419 
420 #define FIRST_IPHAS 1
421 #define ISOTROPIC 1
422 #define RAYLEIGH 2
423 #define HENYEY_GREENSTEIN 3
424 #define HAZE_GARCIA_SIEWERT 4
425 #define CLOUD_GARCIA_SIEWERT 5
426 #define LAST_IPHAS 5
427 
428 #define GENERAL_BC 0
429 #define SPECIAL_BC 1
430 
431 #define TOP_ILLUM 1
432 #define BOT_ILLUM 2
433 
434 #define DS_WARNING 0
435 #define DS_ERROR 1
436 
437 #define VERBOSE 0
438 #define QUIET 1
439 
440 #define BRDF_NONE 0
441 #define BRDF_RPV 1 /* don't change these numbers as they are */
442 #define BRDF_CAM 2 /* used by Fortran code which of course */
443 #define BRDF_AMB 3 /* has no access to this header file */
444 #define BRDF_HAPKE 4
445 
446 /*defined for new option names brdf_cam for cox_and_munk_sal,pcl,u10,uphi*/
447 #define BRDF_CAM_NN 4
448 #define BRDF_CAM_SAL 0
449 #define BRDF_CAM_PCL 1
450 #define BRDF_CAM_U10 2
451 #define BRDF_CAM_UPHI 3
452 
453 /*
454  * NMUG : Number of angle cosine quadrature points on (-1,1) for integrating bidirectional reflectivity
455  * to get directional emissivity (it is necessary to use a quadrature set distinct from the
456  * computational angles, because the computational angles may not be dense enough---ds->nstr
457  * may be too small---to give an accurate approximation for the integration).
458  */
459 #define NMUG 50
460 
461 /*
462  * Mathematical
463  */
464 #if !defined(M_E)
465 # define M_E 2.7182818284590452354
466 # define M_LOG2E 1.4426950408889634074
467 # define M_LOG10E 0.43429448190325182765
468 # define M_LN2 0.69314718055994530942
469 # define M_LN10 2.30258509299404568402
470 # define M_PI 3.14159265358979323846
471 # define M_PI_2 1.57079632679489661923
472 # define M_PI_4 0.78539816339744830962
473 # define M_1_PI 0.31830988618379067154
474 # define M_2_PI 0.63661977236758134308
475 # define M_2_SQRTPI 1.12837916709551257390
476 # define M_SQRT2 1.41421356237309504880
477 # define M_SQRT1_2 0.70710678118654752440
478 #endif
479 
480 #define DEG (M_PI/180.)
481 
482 #define SQR(x) ({ \
483  const double _x = (double)(x); \
484  _x*_x; })
485 
486 #define MIN(x,y) ({ \
487  const double _x = (double)(x); \
488  const double _y = (double)(y); \
489  _x < _y ? _x : _y; })
490 
491 #define MAX(x,y) ({ \
492  const double _x = (double)(x); \
493  const double _y = (double)(y); \
494  _x > _y ? _x : _y; })
495 
496 #define LIMIT_RANGE(min,x,max) ({ \
497  const double _min = (double)(min); \
498  const double _x = (double)(x); \
499  const double _max = (double)(max); \
500  _x < _min ? _min : ( _x > _max ? _max : _x ); })
501 
502 #define IMIN(i,j) ({ \
503  const int _i = (int)(i); \
504  const int _j = (int)(j); \
505  _i < _j ? _i : _j; })
506 
507 #define IMAX(i,j) ({ \
508  const int _i = (int)(i); \
509  const int _j = (int)(j); \
510  _i > _j ? _i : _j; })
511 
512 #define F77_SIGN(a,b) ((b) >= 0. ? fabs(a) : -fabs(a))
513 
514 /*---------------------*
515  * Function prototypes *
516  *---------------------*/
517 
518 void c_disort(disort_state *ds,
519  disort_output *out);
520 
521 double c_bidir_reflectivity ( double wvnmlo,
522  double wvnmhi,
523  double mu,
524  double mup,
525  double dphi,
526  int brdf_type,
527  disort_brdf *brdf,
528  int callnum );
529 
530 double c_bidir_reflectivity_hapke ( double wvnmlo,
531  double wvnmhi,
532  double mu,
533  double mup,
534  double dphi );
535 
537  double mu1,
538  double mu2,
539  double phi,
540  double badmu );
541 
542 double c_dref(double wvnmlo,
543  double wvnmhi,
544  double mu,
545  int brdf_type,
546  disort_brdf *brdf,
547  int callnum );
548 
549 void c_getmom(int iphas,
550  double gg,
551  int nmom,
552  double *pmom);
553 
554 void c_asymmetric_matrix(double *aa,
555  double *evec,
556  double *eval,
557  int m,
558  int ia,
559  int ievec,
560  int *ier,
561  double *wk);
562 
564  double *gc,
565  double *kk,
566  int *layru,
567  double *ll,
568  int lyrcut,
569  int mazim,
570  int ncut,
571  int nn,
572  double *taucpr,
573  double *utaupr,
574  double *zz,
575  disort_pair *plk,
576  double *uum);
577 
578 void c_fluxes(disort_state *ds,
579  disort_output *out,
580  double *ch,
581  double *cmu,
582  double *cwt,
583  double *gc,
584  double *kk,
585  int *layru,
586  double *ll,
587  int lyrcut,
588  int ncut,
589  int nn,
590  int prntu0,
591  double *taucpr,
592  double *utaupr,
593  disort_pair *xr,
594  disort_pair *zbeamsp,
595  double *zbeama,
596  double *zz,
597  double *zzg,
598  disort_pair *plk,
599  disort_pair *fl,
600  double *u0c);
601 
603  disort_output *out,
604  double dither,
605  double *flyr,
606  int *layru,
607  int lyrcut,
608  int ncut,
609  double *oprim,
610  double *phasa,
611  double *phast,
612  double *phasm,
613  double *phirad,
614  double *tauc,
615  double *taucpr,
616  double *utaupr);
617 
619  disort_output *out,
620  double dither,
621  double *flyr,
622  int *layru,
623  int lyrcut,
624  int ncut,
625  double *oprim,
626  double *phasa,
627  double *phast,
628  double *phasm,
629  double *phirad,
630  double *tauc,
631  double *taucpr,
632  double *utaupr);
633 
634 void prep_double_scat_integr (int nphase,
635  int ntau,
636  int nf,
637  double *mu_phase,
638  double *phas2,
639  double *mu_eq,
640  int *neg_phas,
641  double *norm_phas);
642 
643 double c_secondary_scat(disort_state *ds,
644  int iu,
645  int lu,
646  double ctheta,
647  double *flyr,
648  int layru,
649  double *tauc);
650 
652  int iu,
653  int lu,
654  int it,
655  double ctheta,
656  double *flyr,
657  int layru,
658  double *tauc,
659  int nf,
660  double *phas2,
661  double *mu_eq,
662  int *neg_phas,
663  double norm_phas);
664 
665 double calc_phase_squared (int nphase,
666  int lu,
667  double ctheta,
668  int nf,
669  double *mu_phase,
670  double *phas2,
671  double *mu_eq,
672  int *neg_phas,
673  double norm_phas);
674 
675 void c_disort_set(disort_state *ds,
676  double *ch,
677  double *chtau,
678  double *cmu,
679  double *cwt,
680  int deltam,
681  double *dtaucpr,
682  double *expbea,
683  double *flyr,
684  double *gl,
685  int *layru,
686  int *lyrcut,
687  int *ncut,
688  int *nn,
689  int *corint,
690  double *oprim,
691  double *tauc,
692  double *taucpr,
693  double *utaupr);
694 
695 void c_set_matrix(disort_state *ds,
696  double *bdr,
697  double *cband,
698  double *cmu,
699  double *cwt,
700  double delm0,
701  double *dtaucpr,
702  double *gc,
703  double *kk,
704  int lyrcut,
705  int *ncol,
706  int ncut,
707  double *taucpr,
708  double *wk);
709 
710 double c_single_scat(double dither,
711  int layru,
712  int nlyr,
713  double *phase,
714  double *omega,
715  double *tau,
716  double umu,
717  double umu0,
718  double utau,
719  double fbeam);
720 
721 void c_solve_eigen(disort_state *ds,
722  int lc,
723  disort_pair *ab,
724  double *array,
725  double *cmu,
726  double *cwt,
727  double *gl,
728  int mazim,
729  int nn,
730  double *ylmc,
731  double *cc,
732  double *evecc,
733  double *eval,
734  double *kk,
735  double *gc,
736  double *wk);
737 
738 void c_solve0(disort_state *ds,
739  double *b,
740  double *bdr,
741  double *bem,
742  double bplanck,
743  double *cband,
744  double *cmu,
745  double *cwt,
746  double *expbea,
747  int *ipvt,
748  double *ll,
749  int lyrcut,
750  int mazim,
751  int ncol,
752  int ncut,
753  int nn,
754  double tplanck,
755  double *taucpr,
756  double *z,
757  disort_pair *zbeamsp,
758  double *zbeama,
759  double *zz,
760  double *zzg,
761  disort_pair *plk);
762 
764  double delm0,
765  double *cmu,
766  int mazim,
767  int nn,
768  double *bdr,
769  double *emu,
770  double *bem,
771  double *rmu,
772  int callnum);
773 
775  int lc,
776  double *cwt,
777  double *evecc,
778  double *gl,
779  double *gu,
780  int mazim,
781  int nn,
782  double *wk,
783  double *ylmc,
784  double *ylmu);
785 
787  int lc,
788  double *cwt,
789  double delm0,
790  double *gl,
791  int mazim,
792  double *oprim,
793  double *ylm0,
794  double *ylmc,
795  double *ylmu,
796  disort_pair *psi,
797  disort_pair *xr,
798  disort_pair *zee,
799  double *zj,
800  double *zjg,
801  double *zbeam,
802  disort_triplet *zbu,
803  disort_pair *zbs,
804  double zbsa,
805  double *zgu,
806  disort_pair *zu);
807 
809  double *ch,
810  double *chtau,
811  double *cmu,
812  double delm0,
813  double fbeam,
814  double *gl,
815  int lc,
816  int mazim,
817  int nstr,
818  double *taucpr,
819  double *xba,
820  disort_pair *xb,
821  double *ylm0,
822  double *ylmc,
823  double *zj);
824 
826  double *chtau,
827  double delm0,
828  double fbeam,
829  double *gl,
830  int lc,
831  int mazim,
832  int nstr,
833  int numu,
834  double *taucpr,
835  disort_triplet *zbu,
836  double *xba,
837  double *zj,
838  double *ylm0,
839  double *ylmu);
840 
841 void c_upbeam(disort_state *ds,
842  int lc,
843  double *array,
844  double *cc,
845  double *cmu,
846  double delm0,
847  double *gl,
848  int *ipvt,
849  int mazim,
850  int nn,
851  double *wk,
852  double *ylm0,
853  double *ylmc,
854  double *zj,
855  double *zz);
856 
858  int lc,
859  double *array,
860  double *cc,
861  double *cmu,
862  int *ipvt,
863  int nn,
864  double *wk,
865  disort_pair *xb,
866  double *xba,
867  disort_pair *zbs,
868  double *zbsa,
869  disort_pair *zbeamsp,
870  double *zbeama);
871 
873  int lc,
874  int maz,
875  double *array,
876  double *cc,
877  int *ipvt,
878  int nn,
879  double *wk,
880  double *zjg,
881  double *zzg);
882 
883 void c_upisot(disort_state *ds,
884  int lc,
885  double *array,
886  double *cc,
887  double *cmu,
888  int *ipvt,
889  int nn,
890  double *oprim,
891  double *wk,
892  disort_pair *xr,
893  disort_pair *zee,
894  disort_pair *plk);
895 
897  double bplanck,
898  double *cmu,
899  double *cwt,
900  double delm0,
901  double *dtaucpr,
902  double *emu,
903  double *expbea,
904  double *gc,
905  double *gu,
906  double *kk,
907  int *layru,
908  double *ll,
909  int lyrcut,
910  int mazim,
911  int ncut,
912  int nn,
913  double *rmu,
914  double *taucpr,
915  double tplanck,
916  double *utaupr,
917  double *wk,
918  disort_triplet *zbu,
919  double *zbeam,
920  disort_pair *zbeamsp,
921  double *zbeama,
922  double *zgu,
923  disort_pair *zu,
924  double *zz,
925  double *zzg,
926  disort_pair *plk,
927  double *uum);
928 
929 double c_xi_func(double umu1,
930  double umu2,
931  double tau);
932 
934  int scat_yes,
935  int deltam,
936  int corint,
937  double *tauc,
938  int callnum);
939 
940 void c_legendre_poly(int nmu,
941  int m,
942  int maxmu,
943  int twonm1,
944  double *mu,
945  double *ylm);
946 
948  disort_output *out);
949 
951  double *dtaucpr,
952  int scat_yes,
953  int deltam,
954  int corint,
955  double *flyr,
956  int lyrcut,
957  double *oprim,
958  double *tauc,
959  double *taucpr);
960 
962  disort_output *out);
963 
964 void c_gaussian_quadrature(int m,
965  double *gmu,
966  double *gwt);
967 
968 double c_ratio(double a,
969  double b);
970 
971 int c_fcmp(double x1,
972  double x2);
973 
974 void c_self_test(int compare,
975  int *prntu0,
976  disort_state *ds,
977  disort_output *out);
978 
979 void c_albtrans(disort_state *ds,
980  disort_output *out,
981  disort_pair *ab,
982  double *array,
983  double *b,
984  double *bdr,
985  double *cband,
986  double *cc,
987  double *cmu,
988  double *cwt,
989  double *dtaucpr,
990  double *eval,
991  double *evecc,
992  double *gl,
993  double *gc,
994  double *gu,
995  int *ipvt,
996  double *kk,
997  double *ll,
998  int nn,
999  double *taucpr,
1000  double *ylmc,
1001  double *ylmu,
1002  double *z,
1003  double *wk);
1004 
1006  disort_output *out,
1007  double *gu,
1008  double *kk,
1009  double *ll,
1010  int nn,
1011  double *taucpr,
1012  double *wk);
1013 
1015  disort_output *out);
1016 
1017 void c_solve1(disort_state *ds,
1018  double *cband,
1019  int ihom,
1020  int *ipvt,
1021  int ncol,
1022  int ncut,
1023  int nn,
1024  double *b,
1025  double *ll);
1026 
1028  double *cmu,
1029  double *cwt,
1030  double *gc,
1031  double *kk,
1032  double *ll,
1033  int nn,
1034  double *taucpr,
1035  double *sflup,
1036  double *sfldn);
1037 
1038 void c_errmsg(char const *messag,
1039  int type);
1040 
1041 int c_write_bad_var(int quiet,
1042  char const *varnam);
1043 
1044 int c_write_too_small_dim(int quiet,
1045  char const *dimnam,
1046  int minval);
1047 
1048 void c_sgbco(double *abd,
1049  int lda,
1050  int n,
1051  int ml,
1052  int mu,
1053  int *ipvt,
1054  double *rcond,
1055  double *z);
1056 
1057 void c_sgbfa(double *abd,
1058  int lda,
1059  int n,
1060  int ml,
1061  int mu,
1062  int *ipvt,
1063  int *info);
1064 
1065 void c_sgbsl(double *abd,
1066  int lda,
1067  int n,
1068  int ml,
1069  int mu,
1070  int *ipvt,
1071  double *b,
1072  int job);
1073 
1074 void c_sgeco(double *a,
1075  int lda,
1076  int n,
1077  int *ipvt,
1078  double *rcond,
1079  double *z);
1080 
1081 void c_sgefa(double *a,
1082  int lda,
1083  int n,
1084  int *ipvt,
1085  int *info);
1086 
1087 void c_sgesl(double *a,
1088  int lda,
1089  int n,
1090  int *ipvt,
1091  double *b,
1092  int job);
1093 
1094 double c_sasum(int n,
1095  double *sx);
1096 
1097 void c_saxpy(int n,
1098  double sa,
1099  double *sx,
1100  double *sy);
1101 
1102 double c_sdot(int n,
1103  double *sx,
1104  double *sy);
1105 
1106 void c_sscal(int n,
1107  double sa,
1108  double *sx);
1109 
1110 int c_isamax(int n,
1111  double *sx);
1112 
1113 void c_twostr(disort_state *ds,
1114  disort_output *out,
1115  int deltam,
1116  double *gg,
1117  int *ierror,
1118  double radius);
1119 
1120 double c_chapman(int lc,
1121  double taup,
1122  double *tauc,
1123  int nlyr,
1124  double *zd,
1125  double *dtau_c,
1126  double zenang,
1127  double r);
1128 
1129 double c_chapman_simpler(int lc,
1130  double taup,
1131  int nlyr,
1132  double *zd,
1133  double *dtau_c,
1134  double zenang,
1135  double r);
1136 
1138  double *gg,
1139  int *ierror,
1140  double *tauc);
1141 
1142 void c_twostr_fluxes(disort_state *ds,
1143  twostr_xyz *ts,
1144  double *ch,
1145  double cmu,
1146  double *kk,
1147  int *layru,
1148  double *ll,
1149  int lyrcut,
1150  int ncut,
1151  double *oprim,
1152  double *rr,
1153  double *taucpr,
1154  double *utaupr,
1155  disort_output *out,
1156  double *u0c,
1157  disort_pair *fl);
1158 
1159 void c_twostr_solns(disort_state *ds,
1160  double *ch,
1161  double *chtau,
1162  double cmu,
1163  int ncut,
1164  double *oprim,
1165  double *pkag,
1166  double *pkagc,
1167  double *taucpr,
1168  double *ggprim,
1169  double *kk,
1170  double *rr,
1171  twostr_xyz *ts);
1172 
1174  int deltam,
1175  double *flyr,
1176  double *gg,
1177  int lyrcut,
1178  double *oprim,
1179  double *tauc,
1180  double *taucpr);
1181 
1182 void c_twostr_set(disort_state *ds,
1183  double *bplanck,
1184  double *ch,
1185  double *chtau,
1186  double *cmu,
1187  int deltam,
1188  double *dtaucpr,
1189  double *expbea,
1190  double *flyr,
1191  double *gg,
1192  double *ggprim,
1193  int *layru,
1194  int *lyrcut,
1195  int *ncut,
1196  int *nn,
1197  double *oprim,
1198  double *pkag,
1199  double *pkagc,
1200  double radius,
1201  double *tauc,
1202  double *taucpr,
1203  double *tplanck,
1204  double *utaupr);
1205 
1207  twostr_xyz *ts,
1208  double bplanck,
1209  double *cband,
1210  double cmu,
1211  double *expbea,
1212  int lyrcut,
1213  int nn,
1214  int ncut,
1215  double tplanck,
1216  double *taucpr,
1217  double *kk,
1218  double *rr,
1219  int *ipvt,
1220  double *b,
1221  double *ll,
1222  twostr_diag *diag);
1223 
1224 double c_planck_func1(double wnumlo,
1225  double wnumhi,
1226  double t);
1227 
1228 double c_planck_func2(double wnumlo,
1229  double wnumhi,
1230  double t);
1231 
1233 
1235 
1237  disort_output *out);
1238 
1240  disort_output *out);
1241 
1243 
1245 
1247  disort_output *out);
1248 
1250  disort_output *out);
1251 
1252 double *c_dbl_vector(int nl,
1253  int nh,
1254  char const *name);
1255 int *c_int_vector(int nl,
1256  int nh,
1257  char const *name);
1258 
1259 void print_test(disort_state *ds_calc,
1260  disort_output *calc,
1261  disort_state *ds_good,
1262  disort_output *good);
1263 
1264 void c_free_dbl_vector(double *m,
1265  int nl,
1266  int nh);
1267 
1268 int c_setout( float *sdtauc,
1269  int nlyr,
1270  int ntau,
1271  float *sutau,
1272  float *z,
1273  float *zout );
1274 
1275 double c_inter( int npoints,
1276  int itype,
1277  double arg,
1278  float *xarr,
1279  double *yarr,
1280  double *hh );
1281 
1282 int c_gaussian_quadrature_test(int nstr, float *sza, double umu0);
1283 
1284 void disort_test01(void);
1285 void disort_test02(void);
1286 void disort_test03(void);
1287 void disort_test04(void);
1288 void disort_test05(void);
1289 void disort_test06(void);
1290 void disort_test07(void);
1291 void disort_test08(void);
1292 void disort_test09(void);
1293 void disort_test10(void);
1294 void disort_test11(void);
1295 void disort_test12(void);
1296 void disort_test13(void);
1297 void disort_test14(void);
1298 
1299 /* * * * * * * * * * * * * * * * * * * * * * * end of cdisort.h * * * * * * * * * * * * * * * * * * */
1300 
1301 #endif
void c_albtrans(disort_state *ds, disort_output *out, disort_pair *ab, double *array, double *b, double *bdr, double *cband, double *cc, double *cmu, double *cwt, double *dtaucpr, double *eval, double *evecc, double *gl, double *gc, double *gu, int *ipvt, double *kk, double *ll, int nn, double *taucpr, double *ylmc, double *ylmu, double *z, double *wk)
Definition: cdisort.c:7435
void c_legendre_poly(int nmu, int m, int maxmu, int twonm1, double *mu, double *ylm)
Definition: cdisort.c:6353
void c_errmsg(char const *messag, int type)
Definition: cdisort.c:7949
void disort_test10(void)
Definition: disotest.c:2075
void disort_test01(void)
Definition: disotest.c:157
void disort_test14(void)
Definition: disotest.c:2687
void c_print_albtrans(disort_state *ds, disort_output *out)
Definition: cdisort.c:7752
double c_planck_func1(double wnumlo, double wnumhi, double t)
Definition: cdisort.c:6483
double c_xi_func(double umu1, double umu2, double tau)
Definition: cdisort.c:5995
int * c_int_vector(int nl, int nh, char const *name)
Definition: cdisort.c:11556
void prep_double_scat_integr(int nphase, int ntau, int nf, double *mu_phase, double *phas2, double *mu_eq, int *neg_phas, double *norm_phas)
Definition: cdisort.c:3113
void c_twostr_check_inputs(disort_state *ds, double *gg, int *ierror, double *tauc)
Definition: cdisort.c:9909
void c_fluxes(disort_state *ds, disort_output *out, double *ch, double *cmu, double *cwt, double *gc, double *kk, int *layru, double *ll, int lyrcut, int ncut, int nn, int prntu0, double *taucpr, double *utaupr, disort_pair *xr, disort_pair *zbeamsp, double *zbeama, double *zz, double *zzg, disort_pair *plk, disort_pair *fl, double *u0c)
Definition: cdisort.c:2307
void c_disort_out_free(disort_state *ds, disort_output *out)
Definition: cdisort.c:11395
void c_interp_coefficients_beam_source(disort_state *ds, double *chtau, double delm0, double fbeam, double *gl, int lc, int mazim, int nstr, int numu, double *taucpr, disort_triplet *zbu, double *xba, double *zj, double *ylm0, double *ylmu)
Definition: cdisort.c:4997
void c_solve0(disort_state *ds, double *b, double *bdr, double *bem, double bplanck, double *cband, double *cmu, double *cwt, double *expbea, int *ipvt, double *ll, int lyrcut, int mazim, int ncol, int ncut, int nn, double tplanck, double *taucpr, double *z, disort_pair *zbeamsp, double *zbeama, double *zz, double *zzg, disort_pair *plk)
Definition: cdisort.c:4233
double c_ratio(double a, double b)
Definition: cdisort.c:7098
int c_gaussian_quadrature_test(int nstr, float *sza, double umu0)
Definition: cdisort.c:11780
double * c_dbl_vector(int nl, int nh, char const *name)
Definition: cdisort.c:11516
void c_twostr_state_alloc(disort_state *ds)
Definition: cdisort.c:11417
void disort_test05(void)
Definition: disotest.c:807
void c_twostr_fluxes(disort_state *ds, twostr_xyz *ts, double *ch, double cmu, double *kk, int *layru, double *ll, int lyrcut, int ncut, double *oprim, double *rr, double *taucpr, double *utaupr, disort_output *out, double *u0c, disort_pair *fl)
Definition: cdisort.c:10082
double c_planck_func2(double wnumlo, double wnumhi, double t)
void c_twostr_out_alloc(disort_state *ds, disort_output *out)
Definition: cdisort.c:11480
void c_twostr_set(disort_state *ds, double *bplanck, double *ch, double *chtau, double *cmu, int deltam, double *dtaucpr, double *expbea, double *flyr, double *gg, double *ggprim, int *layru, int *lyrcut, int *ncut, int *nn, double *oprim, double *pkag, double *pkagc, double radius, double *tauc, double *taucpr, double *tplanck, double *utaupr)
Definition: cdisort.c:10603
void c_user_intensities(disort_state *ds, double bplanck, double *cmu, double *cwt, double delm0, double *dtaucpr, double *emu, double *expbea, double *gc, double *gu, double *kk, int *layru, double *ll, int lyrcut, int mazim, int ncut, int nn, double *rmu, double *taucpr, double tplanck, double *utaupr, double *wk, disort_triplet *zbu, double *zbeam, disort_pair *zbeamsp, double *zbeama, double *zgu, disort_pair *zu, double *zz, double *zzg, disort_pair *plk, double *uum)
Definition: cdisort.c:5642
void c_upbeam_pseudo_spherical(disort_state *ds, int lc, double *array, double *cc, double *cmu, int *ipvt, int nn, double *wk, disort_pair *xb, double *xba, disort_pair *zbs, double *zbsa, disort_pair *zbeamsp, double *zbeama)
Definition: cdisort.c:5286
void c_sgesl(double *a, int lda, int n, int *ipvt, double *b, int job)
Definition: cdisort.c:8890
void c_sgbfa(double *abd, int lda, int n, int ml, int mu, int *ipvt, int *info)
Definition: cdisort.c:8361
void c_print_avg_intensities(disort_state *ds, disort_output *out)
Definition: cdisort.c:6635
void disort_test06(void)
Definition: disotest.c:934
void disort_test04(void)
Definition: disotest.c:614
void c_twostr_out_free(disort_state *ds, disort_output *out)
Definition: cdisort.c:11498
void c_new_intensity_correction(disort_state *ds, disort_output *out, double dither, double *flyr, int *layru, int lyrcut, int ncut, double *oprim, double *phasa, double *phast, double *phasm, double *phirad, double *tauc, double *taucpr, double *utaupr)
Definition: cdisort.c:2826
double c_secondary_scat(disort_state *ds, int iu, int lu, double ctheta, double *flyr, int layru, double *tauc)
Definition: cdisort.c:2675
void c_albtrans_intensity(disort_state *ds, disort_output *out, double *gu, double *kk, double *ll, int nn, double *taucpr, double *wk)
Definition: cdisort.c:7660
void c_check_inputs(disort_state *ds, int scat_yes, int deltam, int corint, double *tauc, int callnum)
Definition: cdisort.c:6024
void disort_test02(void)
Definition: disotest.c:340
void c_disort_out_alloc(disort_state *ds, disort_output *out)
Definition: cdisort.c:11353
void c_getmom(int iphas, double gg, int nmom, double *pmom)
Definition: cdisort.c:1435
void c_disort(disort_state *ds, disort_output *out)
Definition: cdisort.c:396
void c_saxpy(int n, double sa, double *sx, double *sy)
Definition: cdisort.c:9021
void disort_test11(void)
Definition: disotest.c:2222
void c_twostr(disort_state *ds, disort_output *out, int deltam, double *gg, int *ierror, double radius)
Definition: cdisort.c:9572
void c_set_coefficients_beam_source(disort_state *ds, double *ch, double *chtau, double *cmu, double delm0, double fbeam, double *gl, int lc, int mazim, int nstr, double *taucpr, double *xba, disort_pair *xb, double *ylm0, double *ylmc, double *zj)
Definition: cdisort.c:5079
int c_write_bad_var(int quiet, char const *varnam)
Definition: cdisort.c:7988
void c_sgbsl(double *abd, int lda, int n, int ml, int mu, int *ipvt, double *b, int job)
Definition: cdisort.c:8494
double c_chapman_simpler(int lc, double taup, int nlyr, double *zd, double *dtau_c, double zenang, double r)
Definition: cdisort.c:9826
int c_write_too_small_dim(int quiet, char const *dimnam, int minval)
Definition: cdisort.c:8020
void c_disort_state_alloc(disort_state *ds)
Definition: cdisort.c:11195
void c_solve_eigen(disort_state *ds, int lc, disort_pair *ab, double *array, double *cmu, double *cwt, double *gl, int mazim, int nn, double *ylmc, double *cc, double *evecc, double *eval, double *kk, double *gc, double *wk)
Definition: cdisort.c:4056
double c_bidir_reflectivity_rpv(rpv_brdf_spec *brdf, double mu1, double mu2, double phi, double badmu)
Definition: cdisort.c:1346
void c_upbeam(disort_state *ds, int lc, double *array, double *cc, double *cmu, double delm0, double *gl, int *ipvt, int mazim, int nn, double *wk, double *ylm0, double *ylmc, double *zj, double *zz)
Definition: cdisort.c:5189
void c_sgefa(double *a, int lda, int n, int *ipvt, int *info)
Definition: cdisort.c:8788
void c_twostr_solve_bc(disort_state *ds, twostr_xyz *ts, double bplanck, double *cband, double cmu, double *expbea, int lyrcut, int nn, int ncut, double tplanck, double *taucpr, double *kk, double *rr, int *ipvt, double *b, double *ll, twostr_diag *diag)
Definition: cdisort.c:10819
void c_twostr_print_inputs(disort_state *ds, int deltam, double *flyr, double *gg, int lyrcut, double *oprim, double *tauc, double *taucpr)
Definition: cdisort.c:10479
void c_free_dbl_vector(double *m, int nl, int nh)
Definition: cdisort.c:11597
double c_inter(int npoints, int itype, double arg, float *xarr, double *yarr, double *hh)
Definition: cdisort.c:11721
void c_self_test(int compare, int *prntu0, disort_state *ds, disort_output *out)
Definition: cdisort.c:7259
void c_intensity_correction(disort_state *ds, disort_output *out, double dither, double *flyr, int *layru, int lyrcut, int ncut, double *oprim, double *phasa, double *phast, double *phasm, double *phirad, double *tauc, double *taucpr, double *utaupr)
Definition: cdisort.c:2532
void c_asymmetric_matrix(double *aa, double *evec, double *eval, int m, int ia, int ievec, int *ier, double *wk)
Definition: cdisort.c:1566
void disort_test07(void)
Definition: disotest.c:1353
void c_upisot(disort_state *ds, int lc, double *array, double *cc, double *cmu, int *ipvt, int nn, double *oprim, double *wk, disort_pair *xr, disort_pair *zee, disort_pair *plk)
Definition: cdisort.c:5505
double c_dref(double wvnmlo, double wvnmhi, double mu, int brdf_type, disort_brdf *brdf, int callnum)
Definition: cdisort.c:6257
void c_twostr_solns(disort_state *ds, double *ch, double *chtau, double cmu, int ncut, double *oprim, double *pkag, double *pkagc, double *taucpr, double *ggprim, double *kk, double *rr, twostr_xyz *ts)
Definition: cdisort.c:10220
void c_disort_state_free(disort_state *ds)
Definition: cdisort.c:11305
int c_setout(float *sdtauc, int nlyr, int ntau, float *sutau, float *z, float *zout)
Definition: cdisort.c:11642
int c_fcmp(double x1, double x2)
Definition: cdisort.c:7185
void c_gaussian_quadrature(int m, double *gmu, double *gwt)
Definition: cdisort.c:6979
double calc_phase_squared(int nphase, int lu, double ctheta, int nf, double *mu_phase, double *phas2, double *mu_eq, int *neg_phas, double norm_phas)
Definition: cdisort.c:3334
void c_set_matrix(disort_state *ds, double *bdr, double *cband, double *cmu, double *cwt, double delm0, double *dtaucpr, double *gc, double *kk, int lyrcut, int *ncol, int ncut, double *taucpr, double *wk)
Definition: cdisort.c:3778
void c_print_intensities(disort_state *ds, disort_output *out)
Definition: cdisort.c:6887
void c_intensity_components(disort_state *ds, double *gc, double *kk, int *layru, double *ll, int lyrcut, int mazim, int ncut, int nn, double *taucpr, double *utaupr, double *zz, disort_pair *plk, double *uum)
Definition: cdisort.c:2209
double c_sdot(int n, double *sx, double *sy)
Definition: cdisort.c:9074
void disort_test12(void)
Definition: disotest.c:2355
double c_new_secondary_scat(disort_state *ds, int iu, int lu, int it, double ctheta, double *flyr, int layru, double *tauc, int nf, double *phas2, double *mu_eq, int *neg_phas, double norm_phas)
Definition: cdisort.c:3235
void c_print_inputs(disort_state *ds, double *dtaucpr, int scat_yes, int deltam, int corint, double *flyr, int lyrcut, double *oprim, double *tauc, double *taucpr)
Definition: cdisort.c:6683
void c_sscal(int n, double sa, double *sx)
Definition: cdisort.c:9128
void c_upbeam_general_source(disort_state *ds, int lc, int maz, double *array, double *cc, int *ipvt, int nn, double *wk, double *zjg, double *zzg)
Definition: cdisort.c:5420
double c_sasum(int n, double *sx)
Definition: cdisort.c:8966
struct disort_state disort_state
struct disort_output disort_output
void c_albtrans_spherical(disort_state *ds, double *cmu, double *cwt, double *gc, double *kk, double *ll, int nn, double *taucpr, double *sflup, double *sfldn)
Definition: cdisort.c:7889
double c_chapman(int lc, double taup, double *tauc, int nlyr, double *zd, double *dtau_c, double zenang, double r)
Definition: cdisort.c:9748
void c_interp_source(disort_state *ds, int lc, double *cwt, double delm0, double *gl, int mazim, double *oprim, double *ylm0, double *ylmc, double *ylmu, disort_pair *psi, disort_pair *xr, disort_pair *zee, double *zj, double *zjg, double *zbeam, disort_triplet *zbu, disort_pair *zbs, double zbsa, double *zgu, disort_pair *zu)
Definition: cdisort.c:4838
void disort_test08(void)
Definition: disotest.c:1693
void c_interp_eigenvec(disort_state *ds, int lc, double *cwt, double *evecc, double *gl, double *gu, int mazim, int nn, double *wk, double *ylmc, double *ylmu)
Definition: cdisort.c:4748
int c_isamax(int n, double *sx)
Definition: cdisort.c:9174
double c_bidir_reflectivity(double wvnmlo, double wvnmhi, double mu, double mup, double dphi, int brdf_type, disort_brdf *brdf, int callnum)
Definition: cdisort.c:1073
double c_single_scat(double dither, int layru, int nlyr, double *phase, double *omega, double *tau, double umu, double umu0, double utau, double fbeam)
Definition: cdisort.c:3940
void c_twostr_state_free(disort_state *ds)
Definition: cdisort.c:11463
double c_bidir_reflectivity_hapke(double wvnmlo, double wvnmhi, double mu, double mup, double dphi)
Definition: cdisort.c:1281
void c_solve1(disort_state *ds, double *cband, int ihom, int *ipvt, int ncol, int ncut, int nn, double *b, double *ll)
Definition: cdisort.c:7808
void disort_test13(void)
Definition: disotest.c:2493
void c_disort_set(disort_state *ds, double *ch, double *chtau, double *cmu, double *cwt, int deltam, double *dtaucpr, double *expbea, double *flyr, double *gl, int *layru, int *lyrcut, int *ncut, int *nn, int *corint, double *oprim, double *tauc, double *taucpr, double *utaupr)
Definition: cdisort.c:3493
void c_sgbco(double *abd, int lda, int n, int ml, int mu, int *ipvt, double *rcond, double *z)
Definition: cdisort.c:8149
void disort_test03(void)
Definition: disotest.c:489
void print_test(disort_state *ds_calc, disort_output *calc, disort_state *ds_good, disort_output *good)
Definition: disotest.c:2873
void c_surface_bidir(disort_state *ds, double delm0, double *cmu, int mazim, int nn, double *bdr, double *emu, double *bem, double *rmu, int callnum)
Definition: cdisort.c:4590
void c_sgeco(double *a, int lda, int n, int *ipvt, double *rcond, double *z)
Definition: cdisort.c:8610
void disort_test09(void)
Definition: disotest.c:1840
Real fl[8]
double pcl
Definition: cdisort.h:121
double u10
Definition: cdisort.h:120
double xsal
Definition: cdisort.h:122
double umu0
Definition: cdisort.h:87
double fisot
Definition: cdisort.h:89
double btemp
Definition: cdisort.h:92
double phi0
Definition: cdisort.h:88
double albedo
Definition: cdisort.h:94
double ttemp
Definition: cdisort.h:91
double fbeam
Definition: cdisort.h:86
double fluor
Definition: cdisort.h:90
double temis
Definition: cdisort.h:93
rpv_brdf_spec * rpv
Definition: cdisort.h:128
int planck
Definition: cdisort.h:54
int quiet
Definition: cdisort.h:60
int old_intensity_correction
Definition: cdisort.h:62
int output_uum
Definition: cdisort.h:64
int ibcnd
Definition: cdisort.h:52
int usrtau
Definition: cdisort.h:50
int onlyfl
Definition: cdisort.h:56
int general_source
Definition: cdisort.h:63
int spher
Definition: cdisort.h:55
int brdf_type
Definition: cdisort.h:59
int intensity_correction
Definition: cdisort.h:61
int usrang
Definition: cdisort.h:51
int lamber
Definition: cdisort.h:53
double * u0u
Definition: cdisort.h:184
double * trnmed
Definition: cdisort.h:182
double * uu
Definition: cdisort.h:183
double * uum
Definition: cdisort.h:185
disort_radiant * rad
Definition: cdisort.h:179
double * albmed
Definition: cdisort.h:181
double zero
Definition: cdisort.h:191
double one
Definition: cdisort.h:192
double uavgdn
Definition: cdisort.h:75
double dfdt
Definition: cdisort.h:73
double rfldir
Definition: cdisort.h:70
double flup
Definition: cdisort.h:72
double rfldn
Definition: cdisort.h:71
double uavg
Definition: cdisort.h:74
double uavgso
Definition: cdisort.h:79
double uavgup
Definition: cdisort.h:77
double * phi
Definition: cdisort.h:169
double * zd
Definition: cdisort.h:170
double * umu
Definition: cdisort.h:168
int nmom_nstr
Definition: cdisort.h:151
disort_bc bc
Definition: cdisort.h:144
int nphase
Definition: cdisort.h:155
disort_brdf brdf
Definition: cdisort.h:146
double * gensrc
Definition: cdisort.h:173
double * ssalb
Definition: cdisort.h:164
double * pmom
Definition: cdisort.h:165
double * temper
Definition: cdisort.h:166
double wvnmlo
Definition: cdisort.h:157
double accur
Definition: cdisort.h:159
double * mu_phase
Definition: cdisort.h:171
double * dtauc
Definition: cdisort.h:163
double * utau
Definition: cdisort.h:167
double * gensrcu
Definition: cdisort.h:174
disort_flag flag
Definition: cdisort.h:142
double wvnmhi
Definition: cdisort.h:158
double radius
Definition: cdisort.h:160
char header[1024]
Definition: cdisort.h:140
double * phase
Definition: cdisort.h:172
double one
Definition: cdisort.h:198
double alpha
Definition: cdisort.h:199
double zero
Definition: cdisort.h:197
double t2
Definition: cdisort.h:105
double rho0
Definition: cdisort.h:100
double k
Definition: cdisort.h:101
double t1
Definition: cdisort.h:104
double scale
Definition: cdisort.h:106
double theta
Definition: cdisort.h:102
double sigma
Definition: cdisort.h:103
double super
Definition: cdisort.h:210
double sub
Definition: cdisort.h:212
double on
Definition: cdisort.h:211
double xb_0u
Definition: cdisort.h:218
double yp_1d
Definition: cdisort.h:229
double xb_1u
Definition: cdisort.h:220
double xp_1
Definition: cdisort.h:222
double yp_1u
Definition: cdisort.h:230
double yb_0u
Definition: cdisort.h:224
double xb_1d
Definition: cdisort.h:219
double yp_0u
Definition: cdisort.h:228
double yb_0d
Definition: cdisort.h:223
double yp_0d
Definition: cdisort.h:227
double xp_0
Definition: cdisort.h:221
double xb_0d
Definition: cdisort.h:217
double yb_1u
Definition: cdisort.h:226
double zb_a
Definition: cdisort.h:231
double yb_1d
Definition: cdisort.h:225
double zp_a
Definition: cdisort.h:232