34 int* ilam1,
int* ilam2,
int* isd1,
int* isd2,
int* ifunc,
int* jnorm,
35 int* jrgm,
int* mfunc,
int* irh,
int* iset,
char* xtitle,
36 double* xww,
double* xn1,
double* xn2,
double* xrg,
double* xsig,
37 double* xnpar,
double* xdx,
double* epar);
38 void af_phs_process_(
char* phsdir,
int* ilam,
int* isd,
int* isd1,
int* isd2,
39 int* ifunc,
int* jnorm,
int* jrgm,
int* mfunc,
int* irh,
int* iset,
40 char* xtitle,
double* xww,
double* refr,
double* refi,
double* xrg,
41 double* xsig,
double* xnpar,
double* xdx,
double* epar,
42 double* rmin,
double* rmax,
double* deltar,
double* deltax,
43 double* r11,
double* r22,
double* r33,
double* r44,
double* reff,
44 double* veff,
double* ccnsml,
double* bsr,
double* salb,
45 double* asf,
double* qscat,
double* qext,
double*
angl,
46 double* phfu,
double* pol,
double* thd,
double*
t,
double* rbar,
47 double* dnzp,
double* dnp,
double* dvp,
double* sumnp,
double* wt);
49 int* nsza,
int* nthe,
int* nphi,
int* nsig,
int* ibgn,
int* iend,
50 double* dlth,
double* dlph,
double* xr,
double* xi,
double*
v,
51 double* thcel,
double* phcel,
double* wav,
double* tha,
double* sig_hg,
54 int* isig,
int* isolz,
int* nsza,
int* ntha,
int* nphi,
double* dlth,
55 double* dlph,
double* xr,
double* xi,
double*
v,
double* thcel,
56 double* phcel,
double* wav,
double* tha,
double* sig_hg,
double*
solz,
int* iprob,
57 double* thp,
double* phcnd,
double* thcnd,
double* txx,
58 double* pti,
double* xinlpi,
double* xi_hgpi,
double* xin2pi,
61 char* atm_lut,
char* coeff_lut,
int* nsd,
int* iair,
62 int* iprin,
int* ipsudo,
int* ioptn,
int* idust,
int* iaprof,
63 int* iblyr,
int* icld,
int* nch,
int* nt55,
int* nrh,
int* kset,
64 int* ilam1,
int* ilam2,
int* isd1,
int* isd2,
int* itau1,
int* itau2,
65 int* kznum,
int* krhum,
double* deltau,
double* psrfc,
66 double* ht_dust,
double* sigma_dust,
double* pcldtop,
double* pcldbtm,
67 double* taum55,
double* xlamb,
double* c0,
double* c1,
double* c2,
68 double*
beta,
double* rho,
double* ppo,
double* x101,
double* temp101,
69 double* htdd,
double* ppodd,
double* dxdd,
double* znpdd,
70 int* nortau,
int* ioznab,
int* nrmww,
71 double* qst,
double* qtt,
double* qst5,
double* qtt5);
72 void af_rt1_process_(
char* rt1dir,
int* ailam,
int* aisd,
int* airh,
int* aitau,
73 int* aiair,
int* aiprin,
int* aipsudo,
int* aioptn,
int* aidust,
74 int* aiaprof,
int* aiblyr,
int* aicld,
int* anch,
int* ant55,
int* ansd,
75 int* anrh,
int* akset,
int* akznum,
int* akrhum,
double* adeltau,
76 double* apsrfc,
double* aht_dust,
double* asigma_dust,
double* apcldtop,
77 double* apcldbtm,
double* ataum55,
double* axlamb,
double* ac0,
78 double* ac1,
double* ac2,
double* abeta,
double* arho,
double* appo,
79 double* ax101,
double* atemp101,
double* ahtdd,
double* appodd,
80 double* adxdd,
double* aznpdd,
int* anortau,
int* aioznab,
int* anrmww,
81 double* aqst,
double* aqtt,
double* aqst5,
double* aqtt5,
double* htlvl,
82 double* pplvl,
double* fr,
double* fn,
double* fa,
double* ftot,
83 double* dtrr,
double* dtmm,
double* dtaa,
double* dtot,
double* trp,
84 double*
tmp,
double* tap,
double* salb,
double* turbhl,
double* dx,
85 double*
x,
double* tozn101,
double* htdv,
double* pdv,
double* taur,
86 double* taum,
double* taua,
double* tau,
double* wvlth,
double* psrfc,
87 double* rho,
double* xozn,
double* tautot,
double* dtau1,
int* nolyr,
88 double* tcar,
double* twat,
double* tozn,
int* ifc,
int* nmodl);
90 int* irh1,
int* irh2,
int* ilm1,
int* ilm2,
int* isd1,
int* isd2,
91 int* itau1,
int* itau2,
int* ithe01,
int* ithe02,
int* iwnd1,
92 int* iwnd2,
int* nx,
int* nthe0,
int* nwl,
int* nrh,
int* iww,
93 int* krhum,
int* iprin,
int* ipol,
int* npass1,
int* npass2,
94 int* icrft,
int* iactflx,
int* isurf,
int* iglint,
int* iocn,
95 int* ifoam,
int* iwatr,
int* iconc,
double* dtheta,
96 double* dphi,
double* hcrft,
double* rx,
double* the0in,
97 double* wwl,
double* albwat);
98 void af_rt2_read_(
char* adir1,
char* adir2,
char* adir3,
char* adir4,
99 char* adir5,
int* ailm,
int* aisd,
int* airh,
int* aiwind,
100 int* aitau,
int* aiset,
int* airef,
int* aipol,
101 int* aiww,
int* akrhum,
double* awwl,
double* aalbwat,
102 int* ifunc,
int* mfunc,
double* refr,
double* refi,
double* rmin,
103 double* rmax,
double* deltar,
double* deltax,
double*
rg,
104 double* sig,
double* npar,
double* r11,
double* r22,
double* r33,
105 double* r44,
double* reff,
double* veff,
double*
ccn,
double* bsr,
106 double* salb,
double* asf,
double* qscat,
double* qext,
107 double*
t,
double* thd,
double* xr,
double* xi,
double*
v,
108 double* thcel,
double* phcel,
double* txx,
double* pti,
109 double* wvlth,
double* psrfc,
double* rho,
110 double* xozn,
double* tautot,
double* deltau,
double* trp,
111 double*
tmp,
double* tap,
double* tcar,
double* twat,
112 double* tozn,
double* htlvl,
double* pplvl,
113 double* dtrr,
double* dtmm,
double* dtaa,
double* dtot,
114 double* htdv,
double* pdv,
double* taur,
115 double* taum,
double* taua,
116 int* ifc,
int* nmodl,
int* nolyr,
float* bfr);
117 void af_rt2_process_(
char* odir,
int* ailm,
int* aisd,
int* airh,
int* aitau,
118 int* aiwnd,
int* airef,
int* aitrans,
int* aiset,
119 int* airh1,
int* airh2,
int* ailm1,
int* ailm2,
int* aisd1,
int* aisd2,
120 int* aitau1,
int* aitau2,
int* aithe01,
int* aithe02,
int* aiwnd1,
121 int* aiwnd2,
int* anx,
int* anthe0,
int* anwl,
int* anrh,
int* ansd,
int* aiww,
122 int* akrhum,
int* aiprin,
int* aipol,
int* anpass1,
int* anpass2,
123 int* aicrft,
int* aiactflx,
int* aisurf,
int* aiglint,
int* aiocn,
124 int* aifoam,
int* aiwatr,
int* aiconc,
double* adtheta,
125 double* adphi,
double* ahcrft,
double* arx,
double* athe0in,
126 double* awwl,
double* aalbwat,
int* ifunc,
int* mfunc,
127 double* arefr,
double* arefi,
double* armin,
128 double* armax,
double* adeltar,
double* adeltax,
double* arg,
129 double* asig,
double* anpar,
double* ar11,
130 double* ar22,
double* ar33,
double* ar44,
double* areff,
double* aveff,
131 double* accn,
double* absr,
double* asalb,
double* aasf,
132 double* aqscat,
double* aqext,
double* at,
double* athd,
133 double* xr,
double* xi,
double*
v,
double* thcel,
double* phcel,
134 double* atxx,
double* apti,
double* awvlth,
double* apsrfc,
135 double* arho,
double* axozn,
double* atautot,
double* adeltau,
136 double* atrp,
double* atmp,
double* atap,
double* atcar,
137 double* atwat,
double* atozn,
double* ahtlvl,
double* applvl,
138 double* adtrr,
double* adtmm,
double* adtaa,
double* adtot,
139 double* ahtdv,
double* apdv,
double* ataur,
140 double* ataum,
double* ataua,
141 int* aifc,
int* anmodl,
int* anolyr,
int* apsudo,
float* abfr,
142 double* tma,
double* tmb,
double* tmc,
double* tmfd,
143 double* tmfu,
double* tms,
double* tmg,
double* tmh,
144 double*
tmp,
double* tmq,
double* tmt,
double* tmpp,
double* tmqq,
145 double* tmrr,
double* tmss,
double* transm,
double* tmcfd,
146 double* tmcfu,
double* tmf1,
double* tmf2,
147 double* xzeroz,
double* xzerod,
double* tupz,
double* tdwnz);
151 {365.9298, 375.594, 385.2625, 394.9355, 404.6129, 414.2946, 423.9808, 433.6713,
152 443.3662, 453.0655, 462.7692, 472.4773, 482.1898, 491.9066, 501.6279, 511.3535,
153 521.0836, 530.818, 540.5568, 550.3, 560.0477, 569.7996, 579.556, 589.3168,
154 599.0819, 608.8515, 618.6254, 628.4037, 638.1865, 647.9736, 657.7651, 665.5994,
155 675.4012, 685.1979, 694.9894, 704.7756, 714.5566, 724.3325, 734.1031, 743.8685,
156 753.6287, 763.3837, 773.1335, 782.8781, 792.6174, 802.3516, 812.0805, 821.8043,
157 831.5228, 841.2361, 850.9442, 860.6471, 870.3448, 880.0372, 889.7245, 936.646,
158 1238.75, 1383.0, 1641.53, 2126.795, 2246.658
207 if (in_ !=
nullptr)
delete in_;
208 if (out_ !=
nullptr)
delete out_;
213 if (in_ !=
nullptr)
delete in_;
214 if (out_ !=
nullptr)
delete out_;
219 if (in_ !=
nullptr)
delete in_;
220 if (out_ !=
nullptr)
delete out_;
225 if (in_ !=
nullptr)
delete in_;
226 if (out_ !=
nullptr)
delete out_;
231 if (phs_ !=
nullptr)
delete phs_;
232 if (ocn_ !=
nullptr)
delete ocn_;
233 if (rt1_ !=
nullptr)
delete rt1_;
269 if (phs_filepath.empty()) {
270 cerr <<
"\nAfrtProcessPhs:: Failure locating input file path.\n" << endl;
274 size_t dlam = l2 - l1 + 1;
275 size_t dsd = s2 - s1 + 1;
277 out_->ifunc.resize(boost::extents[dsd]);
278 out_->mfunc.resize(boost::extents[dsd]);
279 out_->refr.resize(boost::extents[dlam][dsd][nmd]);
280 out_->refi.resize(boost::extents[dlam][dsd][nmd]);
281 out_->rg.resize(boost::extents[dlam][dsd][nmd]);
282 out_->sig.resize(boost::extents[dlam][dsd][nmd]);
283 out_->npar.resize(boost::extents[dlam][dsd][nmd]);
284 out_->dx.resize(boost::extents[dlam][dsd][nmd]);
285 out_->epar.resize(boost::extents[dlam][dsd][nmd]);
286 out_->rmin.resize(boost::extents[dlam][dsd][nmd]);
287 out_->rmax.resize(boost::extents[dlam][dsd][nmd]);
288 out_->deltar.resize(boost::extents[dlam][dsd][nmd]);
289 out_->deltax.resize(boost::extents[dlam][dsd][nmd]);
290 out_->r11.resize(boost::extents[dlam][dsd]);
291 out_->r22.resize(boost::extents[dlam][dsd]);
292 out_->r33.resize(boost::extents[dlam][dsd]);
293 out_->r44.resize(boost::extents[dlam][dsd]);
294 out_->reff.resize(boost::extents[dlam][dsd]);
295 out_->veff.resize(boost::extents[dlam][dsd]);
296 out_->ccnsml.resize(boost::extents[dlam][dsd]);
297 out_->bsr.resize(boost::extents[dlam][dsd]);
298 out_->salb.resize(boost::extents[dlam][dsd]);
299 out_->asf.resize(boost::extents[dlam][dsd]);
300 out_->qscat.resize(boost::extents[dlam][dsd]);
301 out_->qext.resize(boost::extents[dlam][dsd]);
302 out_->angl.resize(boost::extents[ntf]);
303 out_->phfu.resize(boost::extents[dlam][dsd][ntf]);
304 out_->pol.resize(boost::extents[dlam][dsd][ntf]);
305 out_->wt.resize(boost::extents[dlam][dsd][ntf]);
306 out_->sumnp.resize(boost::extents[dlam][dsd][ntf]);
307 out_->thd.resize(boost::extents[dlam][dsd][ntf]);
308 out_->rbar.resize(boost::extents[dlam][dsd][ntf]);
309 out_->dnzp.resize(boost::extents[dlam][dsd][ntf]);
310 out_->dnp.resize(boost::extents[dlam][dsd][ntf]);
311 out_->dvp.resize(boost::extents[dlam][dsd][ntf]);
312 out_->t.resize(boost::extents[dlam][dsd][nstk][ntf]);
314 size_t rn = phs_filepath.find(
".nc");
319 read_nc4(phs_filepath, l1, l2, s1, s2);
339 if (ftemp !=
nullptr) {
342 in_->wav[
i] = ftemp[
i];
346 if (ftemp !=
nullptr) {
349 in_->sig_hg[
i] = ftemp[
i]/100.0;
353 if (ftemp !=
nullptr) {
355 in_->insza =
count-1;
356 in_->dlth = ftemp[2] - ftemp[1];
358 in_->tha[
i] = ftemp[
i];
359 in_->solz[
i] = ftemp[
i];
365 in_->inphi = 180.0/
value + 2.0 + 0.01;
403 in_->ozone_lut.append(
" ");
405 in_->atm_lut.append(
" ");
407 in_->coeff_lut.append(
" ");
409 in_->phsdir.append(
" ");
411 in_->rt1dir.append(
" ");
416 if (ftemp !=
nullptr) {
420 if (ftemp !=
nullptr) {
423 in_->taum55[
i] = ftemp[
i];
428 if (itemp !=
nullptr) {
430 in_->iair[
i] = itemp[
i];
457 cerr <<
"AfrtProcessRt1::initialize() Invalid path for ozone LUT file." << endl;
462 std::cout <<
"AfrtProcessRt1::initialize() Error opening ozone LUT file." << endl;
465 for (
int iL=0; iL<koznp; iL++) {
467 stringstream ss(
line);
470 ss >> in_->temp101[iL];
476 cerr <<
"AfrtProcessRt1::initialize() Invalid path for coefficient LUT file." << endl;
481 std::cout <<
"AfrtProcessRt1::initialize() Error opening coefficient LUT file." << endl;
485 for (
int iL=0; iL<in_->inch; iL++) {
487 stringstream ss(
line);
489 ss >> in_->xlamb[iL];
500 cerr <<
"AfrtProcessRt1::initialize() Invalid path for atmosphere LUT file." << endl;
505 std::cout <<
"AfrtProcessRt1::initialize() Error opening atmosphere LUT file." << endl;
508 for (
int iL=0; iL<knm; iL++) {
510 stringstream ss(
line);
512 ss >> in_->ppodd[iL];
514 ss >> in_->znpdd[iL];
531 in_->rt1dir.append(
" ");
533 in_->phsdir.append(
" ");
535 in_->rt2dir.append(
" ");
537 in_->ocndir.append(
" ");
539 in_->outdir.append(
" ");
562 if (ftemp !=
nullptr) {
565 in_->wwl[
i] = ftemp[
i];
569 if (ftemp !=
nullptr) {
572 in_->krhum[
i] = ftemp[
i];
576 if (ftemp !=
nullptr) {
578 in_->iww[
i] = ftemp[
i];
582 if (ftemp !=
nullptr) {
584 in_->inthe0 =
count-1;
585 in_->dtheta = ftemp[2] - ftemp[1];
587 in_->rx[
i] = ftemp[
i];
589 in_->the0in[
i] = (ftemp[
i+1] + ftemp[
i])/2.0;
594 in_->ithe02 = in_->inthe0;
598 int nph = (360.0/in_->dphi)/2.0 +1;
599 for (
int i=0;
i<nph;
i++) {
600 in_->phi[
i] =
i*in_->dphi;
613 MPI_Comm_rank(MPI_COMM_WORLD, &mpi_id);
614 MPI_Comm_size(MPI_COMM_WORLD, &n_mpi_nodes);
615 cout <<
"mpi_id: " << mpi_id << endl;
630 if (intArray != 0
L) {
635 if (intArray != 0
L) {
640 if (intArray != 0
L) {
645 if (intArray != 0
L) {
649 if (l1<1 || l2<l1 || s1<1 || s2<s1 || t1<1 || t2<t1 || w1<1 || w2<w1) {
650 std::cerr <<
"Bad command line options!!!" << std::endl;
655 status = phs_->initialize(l1, l2, s1, s2);
659 status = ocn_->initialize();
663 status = rt1_->initialize();
670 out_->outdir.append(
" ");
672 if (l1>0 && l2>=l1) {
676 if (s1>0 && s2>=s1) {
680 if (t1>0 && t2>=t1) {
684 if (w1>0 && w2>=w1) {
699 ocn_->out_->thp.resize(boost::extents[dnsza]);
700 ocn_->out_->phcnd.resize(boost::extents[dnphi]);
701 ocn_->out_->thcnd.resize(boost::extents[dnthe]);
702 ocn_->out_->txx.resize(boost::extents[1][1][dnsza][dnthe][dnphi][ntrx]);
703 ocn_->out_->pti.resize(boost::extents[1][1][dnsza][dnthe][dnphi][npti]);
704 ocn_->out_->xinlpi.resize(boost::extents[1][1][dnsza][dnthe][dnphi]);
705 ocn_->out_->xi_hgpi.resize(boost::extents[1][1][dnsza][dnthe][dnphi]);
706 ocn_->out_->xin2pi.resize(boost::extents[1][1][dnsza][dnthe][dnphi]);
707 ocn_->out_->xin2top.resize(boost::extents[1][1][dnsza][dnthe][dnphi]);
709 rt1_->out_->htlvl.resize(boost::extents[1][1][1][nlyr]);
710 rt1_->out_->pplvl.resize(boost::extents[1][1][1][nlyr]);
711 rt1_->out_->fr.resize(boost::extents[1][1][1][nlyr]);
712 rt1_->out_->fn.resize(boost::extents[1][1][1][nlyr]);
713 rt1_->out_->fa.resize(boost::extents[1][1][1][nlyr]);
714 rt1_->out_->ftot.resize(boost::extents[1][1][1][nlyr]);
715 rt1_->out_->dtrr.resize(boost::extents[1][1][1][nlyr]);
716 rt1_->out_->dtmm.resize(boost::extents[1][1][1][nlyr]);
717 rt1_->out_->dtaa.resize(boost::extents[1][1][1][nlyr]);
718 rt1_->out_->dtot.resize(boost::extents[1][1][1][nlyr]);
719 rt1_->out_->salb.resize(boost::extents[1][1][1][nlyr]);
720 rt1_->out_->turbhl.resize(boost::extents[1][1][1][nlyr]);
721 rt1_->out_->trp.resize(boost::extents[1][1][1]);
722 rt1_->out_->tmp.resize(boost::extents[1][1][1]);
723 rt1_->out_->tap.resize(boost::extents[1][1][1]);
724 rt1_->out_->tautot.resize(boost::extents[1][1][1]);
725 rt1_->out_->ppo.resize(boost::extents[1][1][1][nozn]);
726 rt1_->out_->dx.resize(boost::extents[1][1][1][nozn]);
727 rt1_->out_->x.resize(boost::extents[1][1][1][nozn]);
728 rt1_->out_->tozn101.resize(boost::extents[1][1][1][nozn]);
729 rt1_->out_->htdv.resize(boost::extents[1][1][1][nlyr+1]);
730 rt1_->out_->pdv.resize(boost::extents[1][1][1][nlyr+1]);
731 rt1_->out_->taur.resize(boost::extents[1][1][1][nlyr]);
732 rt1_->out_->taum.resize(boost::extents[1][1][1][nlyr]);
733 rt1_->out_->taua.resize(boost::extents[1][1][1][nlyr]);
734 rt1_->out_->tau.resize(boost::extents[1][1][1][nlyr]);
735 rt1_->out_->wvlth.resize(boost::extents[1][1][1]);
736 rt1_->out_->psrfc.resize(boost::extents[1][1][1]);
737 rt1_->out_->rho.resize(boost::extents[1][1][1]);
738 rt1_->out_->xozn.resize(boost::extents[1][1][1]);
739 rt1_->out_->dtau1.resize(boost::extents[1][1][1]);
740 rt1_->out_->tcar.resize(boost::extents[1][1][1]);
741 rt1_->out_->twat.resize(boost::extents[1][1][1]);
742 rt1_->out_->tozn.resize(boost::extents[1][1][1]);
743 rt1_->out_->ifc.resize(boost::extents[1][1][1]);
744 rt1_->out_->nolyr.resize(boost::extents[1][1][1]);
745 rt1_->out_->nmodl.resize(boost::extents[1][1][1]);
747 out_->tma.resize(boost::extents[1][1][1][1][dnsza]);
748 out_->tmb.resize(boost::extents[1][1][1][1][dnsza]);
749 out_->tmc.resize(boost::extents[1][1][1][1][dnsza]);
750 out_->tmfd.resize(boost::extents[1][1][1][1][dnsza]);
751 out_->tmfu.resize(boost::extents[1][1][1][1][dnsza]);
752 out_->tms.resize(boost::extents[1][1][1][1][dnsza]);
753 out_->tmg.resize(boost::extents[1][1][1][1][dnsza]);
754 out_->tmh.resize(boost::extents[1][1][1][1][dnsza]);
755 out_->tmp.resize(boost::extents[1][1][1][1][dnsza]);
756 out_->tmq.resize(boost::extents[1][1][1][1][dnsza]);
757 out_->tmt.resize(boost::extents[1][1][1][1][dnsza]);
758 out_->tmpp.resize(boost::extents[1][1][1][1][dnsza]);
759 out_->tmqq.resize(boost::extents[1][1][1][1][dnsza]);
760 out_->tmrr.resize(boost::extents[1][1][1][1][dnsza]);
761 out_->tmss.resize(boost::extents[1][1][1][1][dnsza]);
762 out_->transm.resize(boost::extents[1][1][1][1][dnsza]);
763 out_->tmcfd.resize(boost::extents[1][1][1][1][dnsza]);
764 out_->tmcfu.resize(boost::extents[1][1][1][1][dnsza]);
765 out_->tmf1.resize(boost::extents[1][1][1][1][dnlyr][dnsza]);
766 out_->tmf2.resize(boost::extents[1][1][1][1][dnlyr]);
767 out_->xzeroz.resize(boost::extents[1][1][1][1][dnsza][dnthe][dnphi][nstk]);
768 out_->xzerod.resize(boost::extents[1][1][1][1][dnsza][dnthe][dnphi][nstk]);
769 out_->tupz.resize(boost::extents[1][1][1][1][dnsza][dnthe][dnphi][nstk]);
770 out_->tdwnz.resize(boost::extents[1][1][1][1][dnsza][dnthe][dnphi][nstk]);
784 if (!ofilepath.empty()) {
785 ofilepath_ = ofilepath;
788 sprintf( buf,
"MD%d-%d_WL%d-%d_TA%d-%d_WD%d-%d",
789 s1,s2,l1,l2,t1,t2,w1,w2 );
790 ofilepath_ = odir +
"/RT00_" +
string(buf) +
".nc";
793 status = initialize_nc4(ofilepath_);
817 in_->infile.append(
" ");
840 &in_->epar[0][0][0]);
852 in_->infile.append(
" ");
887 in_->infile.append(
" ");
889 in_->ozone_lut.append(
" ");
891 in_->atm_lut.append(
" ");
893 in_->coeff_lut.append(
" ");
895 in_->phsdir.append(
" ");
897 in_->rt1dir.append(
" ");
900 (
char*)in_->phsdir.c_str(),
901 (
char*)in_->rt1dir.c_str(),
902 (
char*)in_->ozone_lut.c_str(),
903 (
char*)in_->atm_lut.c_str(),
904 (
char*)in_->coeff_lut.c_str(),
952 &in_->qtt5[0][0][0] );
963 in_->infile.append(
" ");
965 in_->rt1dir.append(
" ");
967 in_->phsdir.append(
" ");
969 in_->rt2dir.append(
" ");
971 in_->ocndir.append(
" ");
973 in_->outdir.append(
" ");
1040 out_->outdir.append(
" ");
1042 size_t dlam = in_->ilam2 - in_->ilam1 + 1;
1043 size_t dsd = in_->isd2 - in_->isd1 + 1;
1045 out_->ifunc.resize(boost::extents[dsd]);
1046 out_->mfunc.resize(boost::extents[dsd]);
1047 out_->angl.resize(boost::extents[ntf]);
1048 out_->ww.resize(boost::extents[dlam]);
1049 out_->refr.resize(boost::extents[dlam][dsd][nmd]);
1050 out_->refi.resize(boost::extents[dlam][dsd][nmd]);
1051 out_->rg.resize(boost::extents[dlam][dsd][nmd]);
1052 out_->sig.resize(boost::extents[dlam][dsd][nmd]);
1053 out_->npar.resize(boost::extents[dlam][dsd][nmd]);
1054 out_->dx.resize(boost::extents[dlam][dsd][nmd]);
1055 out_->epar.resize(boost::extents[dlam][dsd][nmd]);
1057 for (
int iLm=in_->ilam1; iLm<=in_->ilam2; iLm++) {
1058 int oLm = iLm - in_->ilam1;
1059 out_->ww[oLm] = in_->ww[iLm][0];
1060 for (
int iSd=in_->isd1; iSd<=in_->isd2; iSd++) {
1061 int oSd = iSd - in_->isd1;
1062 out_->ifunc[oSd] = in_->ifunc[iSd];
1063 out_->mfunc[oSd] = in_->mfunc[iSd];
1064 for (
int iMd=0; iMd<nmd; iMd++) {
1065 out_->refr[oLm][oSd][iMd] = in_->refr[oLm][oSd][iMd];
1066 out_->refi[oLm][oSd][iMd] = in_->refi[oLm][oSd][iMd];
1067 out_->rg[oLm][oSd][iMd] = in_->rg[oLm][oSd][iMd];
1068 out_->sig[oLm][oSd][iMd] = in_->sig[oLm][oSd][iMd];
1069 out_->npar[oLm][oSd][iMd] = in_->npar[oLm][oSd][iMd];
1070 out_->dx[oLm][oSd][iMd] = in_->dx[oLm][oSd][iMd];
1071 out_->epar[oLm][oSd][iMd] = in_->epar[oLm][oSd][iMd];
1076 out_->rmin.resize(boost::extents[dlam][dsd][nmd]);
1077 out_->rmax.resize(boost::extents[dlam][dsd][nmd]);
1078 out_->deltar.resize(boost::extents[dlam][dsd][nmd]);
1079 out_->deltax.resize(boost::extents[dlam][dsd][nmd]);
1080 out_->r11.resize(boost::extents[dlam][dsd]);
1081 out_->r11.resize(boost::extents[dlam][dsd]);
1082 out_->r11.resize(boost::extents[dlam][dsd]);
1083 out_->r11.resize(boost::extents[dlam][dsd]);
1084 out_->r22.resize(boost::extents[dlam][dsd]);
1085 out_->r33.resize(boost::extents[dlam][dsd]);
1086 out_->r44.resize(boost::extents[dlam][dsd]);
1087 out_->reff.resize(boost::extents[dlam][dsd]);
1088 out_->veff.resize(boost::extents[dlam][dsd]);
1089 out_->ccnsml.resize(boost::extents[dlam][dsd]);
1090 out_->bsr.resize(boost::extents[dlam][dsd]);
1091 out_->salb.resize(boost::extents[dlam][dsd]);
1092 out_->asf.resize(boost::extents[dlam][dsd]);
1093 out_->qscat.resize(boost::extents[dlam][dsd]);
1094 out_->qext.resize(boost::extents[dlam][dsd]);
1095 out_->phfu.resize(boost::extents[dlam][dsd][ntf]);
1096 out_->pol.resize(boost::extents[dlam][dsd][ntf]);
1097 out_->wt.resize(boost::extents[dlam][dsd][ntf]);
1098 out_->rbar.resize(boost::extents[dlam][dsd][ntf]);
1099 out_->dnzp.resize(boost::extents[dlam][dsd][ntf]);
1100 out_->dnp.resize(boost::extents[dlam][dsd][ntf]);
1101 out_->dvp.resize(boost::extents[dlam][dsd][ntf]);
1102 out_->sumnp.resize(boost::extents[dlam][dsd][ntf]);
1103 out_->t.resize(boost::extents[dlam][dsd][nstk][ntf]);
1104 out_->thd.resize(boost::extents[dlam][dsd][ntf]);
1107 for (
int iLm=in_->ilam1; iLm<=in_->ilam2; iLm++) {
1108 for (
int iSd=in_->isd1; iSd<=in_->isd2; iSd++) {
1110 int oLm = iLm - in_->ilam1;
1111 int oSd = iSd - in_->isd1;
1125 &in_->refr[0][0][0],
1126 &in_->refi[0][0][0],
1129 &in_->npar[0][0][0],
1131 &in_->epar[0][0][0],
1133 &out_->rmin[oLm][oSd][0],
1134 &out_->rmax[oLm][oSd][0],
1135 &out_->deltar[oLm][oSd][0],
1136 &out_->deltax[oLm][oSd][0],
1137 &out_->r11[oLm][oSd],
1138 &out_->r22[oLm][oSd],
1139 &out_->r33[oLm][oSd],
1140 &out_->r44[oLm][oSd],
1141 &out_->reff[oLm][oSd],
1142 &out_->veff[oLm][oSd],
1143 &out_->ccnsml[oLm][oSd],
1144 &out_->bsr[oLm][oSd],
1145 &out_->salb[oLm][oSd],
1146 &out_->asf[oLm][oSd],
1147 &out_->qscat[oLm][oSd],
1148 &out_->qext[oLm][oSd],
1150 &out_->phfu[oLm][oSd][0],
1151 &out_->pol[oLm][oSd][0],
1152 &out_->t[oLm][oSd][0][0],
1153 &out_->thd[oLm][oSd][0],
1154 &out_->rbar[oLm][oSd][0],
1155 &out_->dnzp[oLm][oSd][0],
1156 &out_->dnp[oLm][oSd][0],
1157 &out_->dvp[oLm][oSd][0],
1158 &out_->sumnp[oLm][oSd][0],
1159 &out_->wt[oLm][oSd][0] );
1163 long int ms =
tp.tv_sec * 1000 +
tp.tv_usec / 1000;
1164 long int tdiff = ms - tsv;
1166 cout <<
"Wavelength index: "<<iLm<<
" Model index: "<<iSd<<
" : Elapsed time (ms): "<<tdiff<<endl;
1178 long int tsv =
tp.tv_sec * 1000 +
tp.tv_usec / 1000;
1180 for (
int iLm=in_->ilm1; iLm<=in_->ilm2; iLm++) {
1181 size_t oLm = iLm - in_->ilm1;
1183 for (
int iSd=in_->isd1; iSd<=in_->isd2; iSd++) {
1185 in_->iset = phs_->in_->iset[iSd-1];
1187 size_t oSd = iSd - in_->isd1;
1188 int pLm = phs_->in_->ilam1 + iLm -1;
1194 &phs_->in_->ifunc[0],
1195 &phs_->in_->jnorm[0],
1196 &phs_->in_->jrgm[0],
1197 &phs_->in_->mfunc[0],
1199 &phs_->in_->iset[0],
1200 &phs_->in_->xtitle[0][0],
1201 &phs_->in_->ww[0][0],
1202 &phs_->in_->refr[0][0][0],
1203 &phs_->in_->refi[0][0][0],
1204 &phs_->in_->rg[0][0][0],
1205 &phs_->in_->sig[0][0][0],
1206 &phs_->in_->npar[0][0][0],
1207 &phs_->in_->dx[0][0][0],
1208 &phs_->in_->epar[0][0][0],
1210 &phs_->out_->rmin[oLm][oSd][0],
1211 &phs_->out_->rmax[oLm][oSd][0],
1212 &phs_->out_->deltar[oLm][oSd][0],
1213 &phs_->out_->deltax[oLm][oSd][0],
1214 &phs_->out_->r11[oLm][oSd],
1215 &phs_->out_->r22[oLm][oSd],
1216 &phs_->out_->r33[oLm][oSd],
1217 &phs_->out_->r44[oLm][oSd],
1218 &phs_->out_->reff[oLm][oSd],
1219 &phs_->out_->veff[oLm][oSd],
1220 &phs_->out_->ccnsml[oLm][oSd],
1221 &phs_->out_->bsr[oLm][oSd],
1222 &phs_->out_->salb[oLm][oSd],
1223 &phs_->out_->asf[oLm][oSd],
1224 &phs_->out_->qscat[oLm][oSd],
1225 &phs_->out_->qext[oLm][oSd],
1226 &phs_->out_->angl[0],
1227 &phs_->out_->phfu[oLm][oSd][0],
1228 &phs_->out_->pol[oLm][oSd][0],
1229 &phs_->out_->t[oLm][oSd][0][0],
1230 &phs_->out_->thd[oLm][oSd][0],
1231 &phs_->out_->rbar[oLm][oSd][0],
1232 &phs_->out_->dnzp[oLm][oSd][0],
1233 &phs_->out_->dnp[oLm][oSd][0],
1234 &phs_->out_->dvp[oLm][oSd][0],
1235 &phs_->out_->sumnp[oLm][oSd][0],
1236 &phs_->out_->wt[oLm][oSd][0] );
1239 for (
int iTau=in_->itau1; iTau<=in_->itau2; iTau++) {
1240 size_t oTau = iTau - in_->itau1;
1243 &iLm, &iSd, &
tmp, &iTau,
1244 &rt1_->in_->iair[0],
1256 &phs_->in_->iset[iSd-1],
1261 &rt1_->in_->ht_dust,
1262 &rt1_->in_->sigma_dust,
1263 &rt1_->in_->pcldtop,
1264 &rt1_->in_->pcldbtm,
1265 &rt1_->in_->taum55[0],
1266 &rt1_->in_->xlamb[0],
1270 &rt1_->in_->beta[0],
1273 &rt1_->in_->x101[0],
1274 &rt1_->in_->temp101[0],
1275 &rt1_->in_->htdd[0],
1276 &rt1_->in_->ppodd[0],
1277 &rt1_->in_->dxdd[0],
1278 &rt1_->in_->znpdd[0],
1282 &phs_->out_->qscat[oLm][oSd],
1283 &phs_->out_->qext[oLm][oSd],
1284 &rt1_->in_->qst5[iLm-1][iSd-1][iTau-1],
1285 &rt1_->in_->qtt5[iLm-1][iSd-1][iTau-1],
1287 &rt1_->out_->htlvl[0][0][0][1],
1288 &rt1_->out_->pplvl[0][0][0][1],
1289 &rt1_->out_->fr[0][0][0][0],
1290 &rt1_->out_->fn[0][0][0][0],
1291 &rt1_->out_->fa[0][0][0][0],
1292 &rt1_->out_->ftot[0][0][0][0],
1293 &rt1_->out_->dtrr[0][0][0][0],
1294 &rt1_->out_->dtmm[0][0][0][0],
1295 &rt1_->out_->dtaa[0][0][0][0],
1296 &rt1_->out_->dtot[0][0][0][0],
1297 &rt1_->out_->trp[0][0][0],
1298 &rt1_->out_->tmp[0][0][0],
1299 &rt1_->out_->tap[0][0][0],
1300 &rt1_->out_->salb[0][0][0][0],
1301 &rt1_->out_->turbhl[0][0][0][0],
1302 &rt1_->out_->dx[0][0][0][0],
1303 &rt1_->out_->x[0][0][0][0],
1304 &rt1_->out_->tozn101[0][0][0][0],
1305 &rt1_->out_->htdv[0][0][0][0],
1306 &rt1_->out_->pdv[0][0][0][0],
1307 &rt1_->out_->taur[0][0][0][0],
1308 &rt1_->out_->taum[0][0][0][0],
1309 &rt1_->out_->taua[0][0][0][0],
1310 &rt1_->out_->tau[0][0][0][0],
1311 &rt1_->out_->wvlth[0][0][0],
1312 &rt1_->out_->psrfc[0][0][0],
1313 &rt1_->out_->rho[0][0][0],
1314 &rt1_->out_->xozn[0][0][0],
1315 &rt1_->out_->tautot[0][0][0],
1316 &rt1_->out_->dtau1[0][0][0],
1317 &rt1_->out_->nolyr[0][0][0],
1318 &rt1_->out_->tcar[0][0][0],
1319 &rt1_->out_->twat[0][0][0],
1320 &rt1_->out_->tozn[0][0][0],
1321 &rt1_->out_->ifc[0][0][0],
1322 &rt1_->out_->nmodl[0][0][0]);
1331 rt1_->out_->htlvl[0][0][0][0] = 84.0;
1332 rt1_->out_->pplvl[0][0][0][0] = 5.3040e-6;
1333 for (
int iWnd=in_->iwnd1; iWnd<=in_->iwnd2; iWnd++) {
1334 int oWnd = iWnd - in_->iwnd1;
1336 int tmp_iref = in_->iref;
1338 if(ocn_->in_->sig_hg[iWnd-1] == 0.0) {
1359 &ocn_->in_->sig_hg[0],
1360 &ocn_->in_->solz[0],
1363 &ocn_->out_->thp[0],
1364 &ocn_->out_->phcnd[0],
1365 &ocn_->out_->thcnd[0],
1366 &ocn_->out_->txx[0][0][0][0][0][0],
1367 &ocn_->out_->pti[0][0][0][0][0][0],
1368 &ocn_->out_->xinlpi[0][0][0][0][0],
1369 &ocn_->out_->xi_hgpi[0][0][0][0][0],
1370 &ocn_->out_->xin2pi[0][0][0][0][0],
1371 &ocn_->out_->xin2top[0][0][0][0][0] );
1375 &iLm, &iSd, &
tmp, &iTau, &iWnd,
1378 &phs_->in_->iset[iSd-1],
1418 &phs_->in_->ifunc[iSd-1],
1419 &phs_->in_->mfunc[iSd-1],
1420 &phs_->in_->refr[pLm-1][iSd-1][0],
1421 &phs_->in_->refi[pLm-1][iSd-1][0],
1422 &phs_->out_->rmin[oLm][oSd][0],
1423 &phs_->out_->rmax[oLm][oSd][0],
1424 &phs_->out_->deltar[oLm][oSd][0],
1425 &phs_->out_->deltax[oLm][oSd][0],
1426 &phs_->in_->rg[pLm-1][iSd-1][0],
1427 &phs_->in_->sig[pLm-1][iSd-1][0],
1428 &phs_->in_->npar[pLm-1][iSd-1][0],
1429 &phs_->out_->r11[oLm][oSd],
1430 &phs_->out_->r22[oLm][oSd],
1431 &phs_->out_->r33[oLm][oSd],
1432 &phs_->out_->r44[oLm][oSd],
1433 &phs_->out_->reff[oLm][oSd],
1434 &phs_->out_->veff[oLm][oSd],
1435 &phs_->out_->ccnsml[oLm][oSd],
1436 &phs_->out_->bsr[oLm][oSd],
1437 &phs_->out_->salb[oLm][oSd],
1438 &phs_->out_->asf[oLm][oSd],
1439 &phs_->out_->qscat[oLm][oSd],
1440 &phs_->out_->qext[oLm][oSd],
1441 &phs_->out_->t[oLm][oSd][0][0],
1442 &phs_->out_->thd[oLm][oSd][0],
1449 &ocn_->out_->txx[0][0][0][0][0][0],
1450 &ocn_->out_->pti[0][0][0][0][0][0],
1452 &rt1_->out_->wvlth[0][0][0],
1453 &rt1_->out_->psrfc[0][0][0],
1454 &rt1_->out_->rho[0][0][0],
1455 &rt1_->out_->xozn[0][0][0],
1456 &rt1_->out_->tautot[0][0][0],
1457 &rt1_->out_->dtau1[0][0][0],
1458 &rt1_->out_->trp[0][0][0],
1459 &rt1_->out_->tmp[0][0][0],
1460 &rt1_->out_->tap[0][0][0],
1461 &rt1_->out_->tcar[0][0][0],
1462 &rt1_->out_->twat[0][0][0],
1463 &rt1_->out_->tozn[0][0][0],
1464 &rt1_->out_->htlvl[0][0][0][0],
1465 &rt1_->out_->pplvl[0][0][0][0],
1466 &rt1_->out_->dtrr[0][0][0][0],
1467 &rt1_->out_->dtmm[0][0][0][0],
1468 &rt1_->out_->dtaa[0][0][0][0],
1469 &rt1_->out_->dtot[0][0][0][0],
1470 &rt1_->out_->htdv[0][0][0][0],
1471 &rt1_->out_->pdv[0][0][0][0],
1472 &rt1_->out_->taur[0][0][0][0],
1473 &rt1_->out_->taum[0][0][0][0],
1474 &rt1_->out_->taua[0][0][0][0],
1475 &rt1_->out_->ifc[0][0][0],
1476 &rt1_->out_->nmodl[0][0][0],
1477 &rt1_->out_->nolyr[0][0][0],
1480 &in_->bfr[iLm-1][iSd-1][iTau-1][iWnd-1][0],
1481 &out_->tma[0][0][0][0][0],
1482 &out_->tmb[0][0][0][0][0],
1483 &out_->tmc[0][0][0][0][0],
1484 &out_->tmfd[0][0][0][0][0],
1485 &out_->tmfu[0][0][0][0][0],
1486 &out_->tms[0][0][0][0][0],
1487 &out_->tmg[0][0][0][0][0],
1488 &out_->tmh[0][0][0][0][0],
1489 &out_->tmp[0][0][0][0][0],
1490 &out_->tmq[0][0][0][0][0],
1491 &out_->tmt[0][0][0][0][0],
1492 &out_->tmpp[0][0][0][0][0],
1493 &out_->tmqq[0][0][0][0][0],
1494 &out_->tmrr[0][0][0][0][0],
1495 &out_->tmss[0][0][0][0][0],
1496 &out_->transm[0][0][0][0][0],
1497 &out_->tmcfd[0][0][0][0][0],
1498 &out_->tmcfu[0][0][0][0][0],
1499 &out_->tmf1[0][0][0][0][0][0],
1500 &out_->tmf2[0][0][0][0][0],
1501 &out_->xzeroz[0][0][0][0][0][0][0][0],
1502 &out_->xzerod[0][0][0][0][0][0][0][0],
1503 &out_->tupz[0][0][0][0][0][0][0][0],
1504 &out_->tdwnz[0][0][0][0][0][0][0][0]);
1513 long int ms =
tp.tv_sec * 1000 +
tp.tv_usec / 1000;
1514 long int tdiff = ms - tsv;
1516 cout <<iLm<<
" : "<<iSd<<
" : "<< iTau<<
": "<< iWnd<<
" Elapsed ms: "<<tdiff<<endl;
1517 cout <<
"qscat : "<<phs_->out_->qscat[oLm][oSd]<<
" qext : "<< phs_->out_->qext[oLm][oSd]<<endl;
1518 out_->wl = in_->wwl[iLm-1];
1519 out_->wnd = roundf(ocn_->in_->v*100.0)/100.0;
1520 out_->tau = rt1_->in_->taum55[iTau-1];
1521 write_nc4(oLm, oSd, oTau, oWnd);
1540 long int tsv =
tp.tv_sec * 1000 +
tp.tv_usec / 1000;
1542 MPI_Status mpi_status;
1544 int ntasks, nLm, nSd, nTau, nWnd;
1546 int iLm, iSd, iTau, iWnd;
1547 size_t oLm, oSd, oTau, oWnd;
1549 nLm = in_->ilm2 - in_->ilm1 + 1;
1550 nSd = iSd=in_->isd2 - in_->isd1 + 1;
1551 nTau = iTau=in_->itau2 - in_->itau1 + 1;
1552 nWnd = iWnd=in_->iwnd2 - in_->iwnd1 + 1;
1554 ntasks = nLm * nSd * nTau * nWnd;
1563 size_t dlam = in_->ilm2 - in_->ilm1 + 1;
1564 size_t dsd = in_->isd2 - in_->isd1 + 1;
1565 size_t dtau = in_->itau2 - in_->itau1 + 1;
1566 size_t dwnd = in_->iwnd2 - in_->iwnd1 + 1;
1567 size_t dnsza = in_->inthe0;
1568 size_t dnthe = in_->inthe0;
1569 size_t dnphi = (360.0/in_->dphi)/2.0 +1;
1571 double *xzeroz =
new double[dnsza*dnthe*dnphi*nstk];
1572 double *xzerod =
new double[dnsza*dnthe*dnphi*nstk];
1581 int itask, iproc, icomplete;
1583 int *task_status, *busy;
1584 int **task_vec =
new int *[ntasks];
1585 task_status =
new int [ntasks];
1586 busy =
new int [n_mpi_nodes-1];
1589 task_vec[0] =
new int[4*ntasks];
1590 for (
size_t i=1;
i<ntasks;
i++) task_vec[
i] = task_vec[
i-1] + 4;
1593 for (
int iLm=in_->ilm1; iLm<=in_->ilm2; iLm++) {
1594 for (
int iSd=in_->isd1; iSd<=in_->isd2; iSd++) {
1595 for (
int iTau=in_->itau1; iTau<=in_->itau2; iTau++) {
1596 for (
int iWnd=in_->iwnd1; iWnd<=in_->iwnd2; iWnd++) {
1597 task_vec[
k][0] = iLm;
1598 task_vec[
k][1] = iSd;
1599 task_vec[
k][2] = iTau;
1600 task_vec[
k][3] = iWnd;
1607 for (
size_t i=0 ;
i<ntasks;
i++) task_status[
i] = 0;
1608 for (
size_t i=0 ;
i<=n_mpi_nodes-1;
i++) busy[
i] = 0;
1612 while (n_complete < ntasks) {
1614 for (iproc=1; iproc<n_mpi_nodes; iproc++) {
1615 if (busy[iproc-1] == 0 && ((iproc-1) % 1 == mpi_id) && n_complete < ntasks) {
1616 for (itask=1; itask<=ntasks; itask++) {
1617 if (task_status[itask-1] == 0) {
1618 printf(
"%s %d %d %s %d %s %d %d %d %d\n",
1619 "MASTER| Sending to process: ", mpi_id,
1620 iproc,
" task: ", itask,
" iLm, iSd, iTau, iWnd: ",
1621 task_vec[itask-1][0], task_vec[itask-1][1],
1622 task_vec[itask-1][2], task_vec[itask-1][3]);
1623 MPI_Send(&itask, 1, MPI_INTEGER, iproc, 0, MPI_COMM_WORLD);
1624 MPI_Send(task_vec[itask-1], 4, MPI_INTEGER, iproc, 0,
1626 task_status[itask-1] = 1;
1634 int ret_task_vec[4];
1636 MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &mpi_status);
1639 MPI_Recv(&icomplete, 1, MPI_INTEGER, mpi_status.MPI_SOURCE,
1640 MPI_ANY_TAG, MPI_COMM_WORLD, &mpi_status);
1642 MPI_Recv(ret_task_vec, 4, MPI_INTEGER, mpi_status.MPI_SOURCE,
1643 MPI_ANY_TAG, MPI_COMM_WORLD, &mpi_status);
1645 MPI_Recv(&out_->wl, 1, MPI_DOUBLE, mpi_status.MPI_SOURCE, MPI_ANY_TAG,
1646 MPI_COMM_WORLD, &mpi_status);
1648 MPI_Recv(&out_->tau, 1, MPI_DOUBLE, mpi_status.MPI_SOURCE, MPI_ANY_TAG,
1649 MPI_COMM_WORLD, &mpi_status);
1651 MPI_Recv(&out_->wnd, 1, MPI_DOUBLE, mpi_status.MPI_SOURCE, MPI_ANY_TAG,
1652 MPI_COMM_WORLD, &mpi_status);
1654 MPI_Recv(&rt1_->out_->tautot[0][0][0], 1, MPI_DOUBLE,
1655 mpi_status.MPI_SOURCE, MPI_ANY_TAG,
1656 MPI_COMM_WORLD, &mpi_status);
1658 MPI_Recv(&rt1_->out_->trp[0][0][0], 1, MPI_DOUBLE,
1659 mpi_status.MPI_SOURCE, MPI_ANY_TAG,
1660 MPI_COMM_WORLD, &mpi_status);
1662 MPI_Recv(&rt1_->out_->tmp[0][0][0], 1, MPI_DOUBLE,
1663 mpi_status.MPI_SOURCE, MPI_ANY_TAG,
1664 MPI_COMM_WORLD, &mpi_status);
1666 MPI_Recv(&rt1_->out_->tap[0][0][0], 1, MPI_DOUBLE,
1667 mpi_status.MPI_SOURCE, MPI_ANY_TAG,
1668 MPI_COMM_WORLD, &mpi_status);
1670 MPI_Recv(&rt1_->out_->twat[0][0][0], 1, MPI_DOUBLE,
1671 mpi_status.MPI_SOURCE, MPI_ANY_TAG,
1672 MPI_COMM_WORLD, &mpi_status);
1674 MPI_Recv(&out_->tmb[0][0][0][0][0], dnsza, MPI_DOUBLE,
1675 mpi_status.MPI_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
1678 MPI_Recv(&out_->tmc[0][0][0][0][0], dnsza, MPI_DOUBLE,
1679 mpi_status.MPI_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
1682 MPI_Recv(&out_->tmfd[0][0][0][0][0], dnsza, MPI_DOUBLE,
1683 mpi_status.MPI_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
1686 MPI_Recv(&out_->tmfu[0][0][0][0][0], dnsza, MPI_DOUBLE,
1687 mpi_status.MPI_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
1690 MPI_Recv(&out_->tms[0][0][0][0][0], dnsza, MPI_DOUBLE,
1691 mpi_status.MPI_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
1694 MPI_Recv(&out_->transm[0][0][0][0][0], dnsza, MPI_DOUBLE,
1695 mpi_status.MPI_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
1699 MPI_Recv(&out_->tmq[0][0][0][0][0], dnsza, MPI_DOUBLE,
1700 mpi_status.MPI_SOURCE, MPI_ANY_TAG,
1701 MPI_COMM_WORLD, &mpi_status);
1703 MPI_Recv(&out_->tmpp[0][0][0][0][0], dnsza, MPI_DOUBLE,
1704 mpi_status.MPI_SOURCE, MPI_ANY_TAG,
1705 MPI_COMM_WORLD, &mpi_status);
1707 MPI_Recv(&out_->tmqq[0][0][0][0][0], dnsza, MPI_DOUBLE,
1708 mpi_status.MPI_SOURCE, MPI_ANY_TAG,
1709 MPI_COMM_WORLD, &mpi_status);
1711 MPI_Recv(&out_->tmrr[0][0][0][0][0], dnsza, MPI_DOUBLE,
1712 mpi_status.MPI_SOURCE, MPI_ANY_TAG,
1713 MPI_COMM_WORLD, &mpi_status);
1715 MPI_Recv(&out_->tmss[0][0][0][0][0], dnsza, MPI_DOUBLE,
1716 mpi_status.MPI_SOURCE, MPI_ANY_TAG,
1717 MPI_COMM_WORLD, &mpi_status);
1719 MPI_Recv(&out_->tmg[0][0][0][0][0], dnsza, MPI_DOUBLE,
1720 mpi_status.MPI_SOURCE, MPI_ANY_TAG,
1721 MPI_COMM_WORLD, &mpi_status);
1723 MPI_Recv(&out_->tmh[0][0][0][0][0], dnsza, MPI_DOUBLE,
1724 mpi_status.MPI_SOURCE, MPI_ANY_TAG,
1725 MPI_COMM_WORLD, &mpi_status);
1729 MPI_Recv(xzeroz, dnsza*dnthe*dnphi*nstk, MPI_DOUBLE,
1730 mpi_status.MPI_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
1735 for (
size_t i=0;
i<dnsza;
i++) {
1736 for (
size_t j=0;
j<dnthe;
j++) {
1737 for (
size_t k=0;
k<dnphi;
k++) {
1738 for (
size_t s=0;
s<nstk;
s++) {
1739 out_->xzeroz[0][0][0][0][
i][
j][
k][
s] = xzeroz[cnt++];
1745 MPI_Recv(xzerod, dnsza*dnthe*dnphi*nstk, MPI_DOUBLE,
1746 mpi_status.MPI_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
1750 for (
size_t i=0;
i<dnsza;
i++) {
1751 for (
size_t j=0;
j<dnthe;
j++) {
1752 for (
size_t k=0;
k<dnphi;
k++) {
1753 for (
size_t s=0;
s<nstk;
s++) {
1754 out_->xzerod[0][0][0][0][
i][
j][
k][
s] = xzerod[cnt++];
1760 task_status[icomplete-1] = 2;
1762 busy[mpi_status.MPI_SOURCE-1] = 0;
1763 printf(
"%s%d%s%d %s %d ",
"MASTER| Received message from process: ",
1764 mpi_status.MPI_SOURCE,
" number complete: ", n_complete,
1765 " task: ", icomplete);
1768 oLm = ret_task_vec[0];
1769 oSd = ret_task_vec[1];
1770 oTau = ret_task_vec[2];
1771 oWnd = ret_task_vec[3];
1773 printf(
"write_nc4: %d %d %d %d\n", oLm+1, oSd+1, oTau+1, oWnd+1);
1774 write_nc4(oLm, oSd, oTau, oWnd);
1777 printf(
"%s\n",
"Sending all complete message");
1779 for (iproc=1; iproc<n_mpi_nodes; iproc++) {
1780 MPI_Send(&zero, 1, MPI_INTEGER, iproc, 0, MPI_COMM_WORLD);
1783 delete[] task_status;
1785 delete[] task_vec[0];
1795 MPI_Status mpi_status;
1798 MPI_Probe(0, MPI_ANY_TAG, MPI_COMM_WORLD, &mpi_status);
1799 MPI_Recv(&itask, 1, MPI_INTEGER, 0, MPI_ANY_TAG, MPI_COMM_WORLD,
1801 if (itask == 0)
break;
1802 MPI_Recv(task_vec, 4, MPI_INTEGER, 0, MPI_ANY_TAG, MPI_COMM_WORLD,
1810 printf(
"%s %d iLm: %d iSd: %d iTau: %d iWnd: %d\n",
"WORKER|",
1811 mpi_id, iLm, iSd, iTau, iWnd);
1813 size_t oLm = iLm - in_->ilm1;
1814 size_t oSd = iSd - in_->isd1;
1815 int pLm = phs_->in_->ilam1 + iLm -1;
1816 if (!phs_->bNC4_ && (iLm != prev_iLm || iSd != prev_iSd)) {
1822 &phs_->in_->ifunc[0],
1823 &phs_->in_->jnorm[0],
1824 &phs_->in_->jrgm[0],
1825 &phs_->in_->mfunc[0],
1827 &phs_->in_->iset[0],
1828 &phs_->in_->xtitle[0][0],
1829 &phs_->in_->ww[0][0],
1830 &phs_->in_->refr[0][0][0],
1831 &phs_->in_->refi[0][0][0],
1832 &phs_->in_->rg[0][0][0],
1833 &phs_->in_->sig[0][0][0],
1834 &phs_->in_->npar[0][0][0],
1835 &phs_->in_->dx[0][0][0],
1836 &phs_->in_->epar[0][0][0],
1838 &phs_->out_->rmin[oLm][oSd][0],
1839 &phs_->out_->rmax[oLm][oSd][0],
1840 &phs_->out_->deltar[oLm][oSd][0],
1841 &phs_->out_->deltax[oLm][oSd][0],
1842 &phs_->out_->r11[oLm][oSd],
1843 &phs_->out_->r22[oLm][oSd],
1844 &phs_->out_->r33[oLm][oSd],
1845 &phs_->out_->r44[oLm][oSd],
1846 &phs_->out_->reff[oLm][oSd],
1847 &phs_->out_->veff[oLm][oSd],
1848 &phs_->out_->ccnsml[oLm][oSd],
1849 &phs_->out_->bsr[oLm][oSd],
1850 &phs_->out_->salb[oLm][oSd],
1851 &phs_->out_->asf[oLm][oSd],
1852 &phs_->out_->qscat[oLm][oSd],
1853 &phs_->out_->qext[oLm][oSd],
1854 &phs_->out_->angl[0],
1855 &phs_->out_->phfu[oLm][oSd][0],
1856 &phs_->out_->pol[oLm][oSd][0],
1857 &phs_->out_->t[oLm][oSd][0][0],
1858 &phs_->out_->thd[oLm][oSd][0],
1859 &phs_->out_->rbar[oLm][oSd][0],
1860 &phs_->out_->dnzp[oLm][oSd][0],
1861 &phs_->out_->dnp[oLm][oSd][0],
1862 &phs_->out_->dvp[oLm][oSd][0],
1863 &phs_->out_->sumnp[oLm][oSd][0],
1864 &phs_->out_->wt[oLm][oSd][0] );
1868 size_t oTau = iTau - in_->itau1;
1871 if (iLm != prev_iLm || iSd != prev_iSd || iTau != prev_iTau) {
1874 &iLm, &iSd, &
tmp, &iTau,
1875 &rt1_->in_->iair[0],
1887 &phs_->in_->iset[iSd-1],
1892 &rt1_->in_->ht_dust,
1893 &rt1_->in_->sigma_dust,
1894 &rt1_->in_->pcldtop,
1895 &rt1_->in_->pcldbtm,
1896 &rt1_->in_->taum55[0],
1897 &rt1_->in_->xlamb[0],
1901 &rt1_->in_->beta[0],
1904 &rt1_->in_->x101[0],
1905 &rt1_->in_->temp101[0],
1906 &rt1_->in_->htdd[0],
1907 &rt1_->in_->ppodd[0],
1908 &rt1_->in_->dxdd[0],
1909 &rt1_->in_->znpdd[0],
1913 &phs_->out_->qscat[oLm][oSd],
1914 &phs_->out_->qext[oLm][oSd],
1915 &rt1_->in_->qst5[iLm-1][iSd-1][iTau-1],
1916 &rt1_->in_->qtt5[iLm-1][iSd-1][iTau-1],
1918 &rt1_->out_->htlvl[0][0][0][1],
1919 &rt1_->out_->pplvl[0][0][0][1],
1920 &rt1_->out_->fr[0][0][0][0],
1921 &rt1_->out_->fn[0][0][0][0],
1922 &rt1_->out_->fa[0][0][0][0],
1923 &rt1_->out_->ftot[0][0][0][0],
1924 &rt1_->out_->dtrr[0][0][0][0],
1925 &rt1_->out_->dtmm[0][0][0][0],
1926 &rt1_->out_->dtaa[0][0][0][0],
1927 &rt1_->out_->dtot[0][0][0][0],
1928 &rt1_->out_->trp[0][0][0],
1929 &rt1_->out_->tmp[0][0][0],
1930 &rt1_->out_->tap[0][0][0],
1931 &rt1_->out_->salb[0][0][0][0],
1932 &rt1_->out_->turbhl[0][0][0][0],
1933 &rt1_->out_->dx[0][0][0][0],
1934 &rt1_->out_->x[0][0][0][0],
1935 &rt1_->out_->tozn101[0][0][0][0],
1936 &rt1_->out_->htdv[0][0][0][0],
1937 &rt1_->out_->pdv[0][0][0][0],
1938 &rt1_->out_->taur[0][0][0][0],
1939 &rt1_->out_->taum[0][0][0][0],
1940 &rt1_->out_->taua[0][0][0][0],
1941 &rt1_->out_->tau[0][0][0][0],
1942 &rt1_->out_->wvlth[0][0][0],
1943 &rt1_->out_->psrfc[0][0][0],
1944 &rt1_->out_->rho[0][0][0],
1945 &rt1_->out_->xozn[0][0][0],
1946 &rt1_->out_->tautot[0][0][0],
1947 &rt1_->out_->dtau1[0][0][0],
1948 &rt1_->out_->nolyr[0][0][0],
1949 &rt1_->out_->tcar[0][0][0],
1950 &rt1_->out_->twat[0][0][0],
1951 &rt1_->out_->tozn[0][0][0],
1952 &rt1_->out_->ifc[0][0][0],
1953 &rt1_->out_->nmodl[0][0][0]);
1963 rt1_->out_->htlvl[0][0][0][0] = 84.0;
1964 rt1_->out_->pplvl[0][0][0][0] = 5.3040e-6;
1966 int oWnd = iWnd - in_->iwnd1;
1970 int tmp_iref = in_->iref;
1972 if(ocn_->in_->sig_hg[iWnd-1] == 0.0) {
1993 &ocn_->in_->sig_hg[0],
1994 &ocn_->in_->solz[0],
1997 &ocn_->out_->thp[0],
1998 &ocn_->out_->phcnd[0],
1999 &ocn_->out_->thcnd[0],
2000 &ocn_->out_->txx[0][0][0][0][0][0],
2001 &ocn_->out_->pti[0][0][0][0][0][0],
2002 &ocn_->out_->xinlpi[0][0][0][0][0],
2003 &ocn_->out_->xi_hgpi[0][0][0][0][0],
2004 &ocn_->out_->xin2pi[0][0][0][0][0],
2005 &ocn_->out_->xin2top[0][0][0][0][0] );
2008 in_->iset = phs_->in_->iset[iSd-1];
2011 &iLm, &iSd, &
tmp, &iTau, &iWnd,
2014 &phs_->in_->iset[iSd-1],
2054 &phs_->in_->ifunc[iSd-1],
2055 &phs_->in_->mfunc[iSd-1],
2056 &phs_->in_->refr[pLm-1][iSd-1][0],
2057 &phs_->in_->refi[pLm-1][iSd-1][0],
2058 &phs_->out_->rmin[oLm][oSd][0],
2059 &phs_->out_->rmax[oLm][oSd][0],
2060 &phs_->out_->deltar[oLm][oSd][0],
2061 &phs_->out_->deltax[oLm][oSd][0],
2062 &phs_->in_->rg[pLm-1][iSd-1][0],
2063 &phs_->in_->sig[pLm-1][iSd-1][0],
2064 &phs_->in_->npar[pLm-1][iSd-1][0],
2065 &phs_->out_->r11[oLm][oSd],
2066 &phs_->out_->r22[oLm][oSd],
2067 &phs_->out_->r33[oLm][oSd],
2068 &phs_->out_->r44[oLm][oSd],
2069 &phs_->out_->reff[oLm][oSd],
2070 &phs_->out_->veff[oLm][oSd],
2071 &phs_->out_->ccnsml[oLm][oSd],
2072 &phs_->out_->bsr[oLm][oSd],
2073 &phs_->out_->salb[oLm][oSd],
2074 &phs_->out_->asf[oLm][oSd],
2075 &phs_->out_->qscat[oLm][oSd],
2076 &phs_->out_->qext[oLm][oSd],
2077 &phs_->out_->t[oLm][oSd][0][0],
2078 &phs_->out_->thd[oLm][oSd][0],
2085 &ocn_->out_->txx[0][0][0][0][0][0],
2086 &ocn_->out_->pti[0][0][0][0][0][0],
2088 &rt1_->out_->wvlth[0][0][0],
2089 &rt1_->out_->psrfc[0][0][0],
2090 &rt1_->out_->rho[0][0][0],
2091 &rt1_->out_->xozn[0][0][0],
2092 &rt1_->out_->tautot[0][0][0],
2093 &rt1_->out_->dtau1[0][0][0],
2094 &rt1_->out_->trp[0][0][0],
2095 &rt1_->out_->tmp[0][0][0],
2096 &rt1_->out_->tap[0][0][0],
2097 &rt1_->out_->tcar[0][0][0],
2098 &rt1_->out_->twat[0][0][0],
2099 &rt1_->out_->tozn[0][0][0],
2100 &rt1_->out_->htlvl[0][0][0][0],
2101 &rt1_->out_->pplvl[0][0][0][0],
2102 &rt1_->out_->dtrr[0][0][0][0],
2103 &rt1_->out_->dtmm[0][0][0][0],
2104 &rt1_->out_->dtaa[0][0][0][0],
2105 &rt1_->out_->dtot[0][0][0][0],
2106 &rt1_->out_->htdv[0][0][0][0],
2107 &rt1_->out_->pdv[0][0][0][0],
2108 &rt1_->out_->taur[0][0][0][0],
2109 &rt1_->out_->taum[0][0][0][0],
2110 &rt1_->out_->taua[0][0][0][0],
2111 &rt1_->out_->ifc[0][0][0],
2112 &rt1_->out_->nmodl[0][0][0],
2113 &rt1_->out_->nolyr[0][0][0],
2116 &in_->bfr[iLm-1][iSd-1][iTau-1][iWnd-1][0],
2117 &out_->tma[0][0][0][0][0],
2118 &out_->tmb[0][0][0][0][0],
2119 &out_->tmc[0][0][0][0][0],
2120 &out_->tmfd[0][0][0][0][0],
2121 &out_->tmfu[0][0][0][0][0],
2122 &out_->tms[0][0][0][0][0],
2123 &out_->tmg[0][0][0][0][0],
2124 &out_->tmh[0][0][0][0][0],
2125 &out_->tmp[0][0][0][0][0],
2126 &out_->tmq[0][0][0][0][0],
2127 &out_->tmt[0][0][0][0][0],
2128 &out_->tmpp[0][0][0][0][0],
2129 &out_->tmqq[0][0][0][0][0],
2130 &out_->tmrr[0][0][0][0][0],
2131 &out_->tmss[0][0][0][0][0],
2132 &out_->transm[0][0][0][0][0],
2133 &out_->tmcfd[0][0][0][0][0],
2134 &out_->tmcfu[0][0][0][0][0],
2135 &out_->tmf1[0][0][0][0][0][0],
2136 &out_->tmf2[0][0][0][0][0],
2137 &out_->xzeroz[0][0][0][0][0][0][0][0],
2138 &out_->xzerod[0][0][0][0][0][0][0][0],
2139 &out_->tupz[0][0][0][0][0][0][0][0],
2140 &out_->tdwnz[0][0][0][0][0][0][0][0]);
2147 MPI_Send(&itask, 1, MPI_INTEGER, 0, 0, MPI_COMM_WORLD);
2148 MPI_Send(task_vec, 4, MPI_INTEGER, 0, 0, MPI_COMM_WORLD);
2150 out_->wl = in_->wwl[iLm-1];
2151 out_->wnd = roundf(ocn_->in_->v*100.0)/100.0;
2153 out_->tau = rt1_->in_->taum55[iTau-1];
2155 MPI_Send(&out_->wl, 1, MPI_DOUBLE, 0, 0, MPI_COMM_WORLD);
2156 MPI_Send(&out_->tau, 1, MPI_DOUBLE, 0, 0, MPI_COMM_WORLD);
2157 MPI_Send(&out_->wnd, 1, MPI_DOUBLE, 0, 0, MPI_COMM_WORLD);
2159 MPI_Send(&rt1_->out_->tautot[0][0][0], 1, MPI_DOUBLE, 0, 0,
2162 MPI_Send(&rt1_->out_->trp[0][0][0], 1, MPI_DOUBLE, 0, 0,
2165 MPI_Send(&rt1_->out_->tmp[0][0][0], 1, MPI_DOUBLE, 0, 0,
2168 MPI_Send(&rt1_->out_->tap[0][0][0], 1, MPI_DOUBLE, 0, 0,
2171 MPI_Send(&rt1_->out_->twat[0][0][0], 1, MPI_DOUBLE, 0, 0,
2175 MPI_Send(&out_->tmb[0][0][0][0][0], dnsza, MPI_DOUBLE, 0, 0,
2178 MPI_Send(&out_->tmc[0][0][0][0][0], dnsza, MPI_DOUBLE, 0, 0,
2181 MPI_Send(&out_->tmfd[0][0][0][0][0], dnsza, MPI_DOUBLE, 0, 0,
2184 MPI_Send(&out_->tmfu[0][0][0][0][0], dnsza, MPI_DOUBLE, 0, 0,
2187 MPI_Send(&out_->tms[0][0][0][0][0], dnsza, MPI_DOUBLE, 0, 0,
2190 MPI_Send(&out_->transm[0][0][0][0][0], dnsza, MPI_DOUBLE, 0, 0,
2194 MPI_Send(&out_->tmq[0][0][0][0][0], dnsza, MPI_DOUBLE, 0, 0,
2197 MPI_Send(&out_->tmpp[0][0][0][0][0], dnsza, MPI_DOUBLE, 0, 0,
2200 MPI_Send(&out_->tmqq[0][0][0][0][0], dnsza, MPI_DOUBLE, 0, 0,
2203 MPI_Send(&out_->tmrr[0][0][0][0][0], dnsza, MPI_DOUBLE, 0, 0,
2206 MPI_Send(&out_->tmss[0][0][0][0][0], dnsza, MPI_DOUBLE, 0, 0,
2209 MPI_Send(&out_->tmg[0][0][0][0][0], dnsza, MPI_DOUBLE, 0, 0,
2212 MPI_Send(&out_->tmh[0][0][0][0][0], dnsza, MPI_DOUBLE, 0, 0,
2217 for (
size_t i=0;
i<dnsza;
i++) {
2218 for (
size_t j=0;
j<dnthe;
j++) {
2219 for (
size_t k=0;
k<dnphi;
k++) {
2220 for (
size_t s=0;
s<nstk;
s++) {
2221 xzeroz[cnt++] = out_->xzeroz[0][0][0][0][
i][
j][
k][
s];
2227 MPI_Send(xzeroz, dnsza*dnthe*dnphi*nstk, MPI_DOUBLE, 0, 0,
2231 for (
size_t i=0;
i<dnsza;
i++) {
2232 for (
size_t j=0;
j<dnthe;
j++) {
2233 for (
size_t k=0;
k<dnphi;
k++) {
2234 for (
size_t s=0;
s<nstk;
s++) {
2235 xzerod[cnt++] = out_->xzerod[0][0][0][0][
i][
j][
k][
s];
2241 MPI_Send(xzerod, dnsza*dnthe*dnphi*nstk, MPI_DOUBLE, 0, 0,
2250 MPI_Barrier(MPI_COMM_WORLD);
2268 if (output_filepath.empty()) {
2269 cerr <<
"\nAfrtProcess:: Failure locating output file path.\n" << endl;
2272 size_t pos = output_filepath.rfind(
"/");
2273 prod_name_ = output_filepath.substr(
pos+1);
2277 ncout =
new NcFile( output_filepath, NcFile::newFile );
2279 catch( NcException& e) {
2281 cerr <<
"AfrtProcess:: Output file exists: "
2282 << output_filepath << endl;
2283 ncout = (NcFile*) 0
L;
2287 ncout =
new NcFile( output_filepath, NcFile::replace );
2289 catch( NcException& e) {
2291 cerr <<
"AfrtProcess:: Failure opening output file: "
2292 << output_filepath << endl;
2296 write_global_attributes( ncout );
2318 size_t dlam = in_->ilam2 - in_->ilam1 + 1;
2319 size_t dsd = in_->isd2 - in_->isd1 + 1;
2321 NcDim wave_dim = ncout->addDim(
"dim_wavelengths", dlam );
2322 NcDim sd_dim = ncout->addDim(
"dim_sd", dsd );
2323 NcDim angle_dim = ncout->addDim(
"dim_angle", ntf );
2324 NcDim stokes_dim = ncout->addDim(
"dim_stokes", nstk );
2325 NcDim mode_dim = ncout->addDim(
"dim_mode", nmd );
2329 F.resize(boost::extents[dsd][dlam][ntf][nstk][nstk]);
2331 for (
size_t iL=0; iL<dlam; iL++) {
2332 for (
size_t iSd=0; iSd<dsd; iSd++) {
2333 for (
size_t iA=0; iA<ntf; iA++) {
2334 double F11 = out_->t[iL][iSd][0][iA] + out_->t[iL][iSd][1][iA];
2335 double F12 = out_->t[iL][iSd][0][iA] - out_->t[iL][iSd][1][iA];
2336 F[iSd][iL][iA][0][0] = F11/2.0;
2337 F[iSd][iL][iA][0][1] = F12/2.0;
2338 F[iSd][iL][iA][0][2] = 0;
2339 F[iSd][iL][iA][0][3] = 0;
2340 F[iSd][iL][iA][1][0] = F12/2.0;
2341 F[iSd][iL][iA][1][1] = F11/2.0;
2342 F[iSd][iL][iA][1][2] = 0;
2343 F[iSd][iL][iA][1][3] = 0;
2344 F[iSd][iL][iA][2][0] = 0;
2345 F[iSd][iL][iA][2][1] = 0;
2346 F[iSd][iL][iA][2][2] = out_->t[iL][iSd][2][iA];
2347 F[iSd][iL][iA][2][3] = -out_->t[iL][iSd][3][iA];
2348 F[iSd][iL][iA][3][0] = 0;
2349 F[iSd][iL][iA][3][1] = 0;
2350 F[iSd][iL][iA][3][2] = out_->t[iL][iSd][3][iA];
2351 F[iSd][iL][iA][3][3] = out_->t[iL][iSd][2][iA];
2356 vector<NcDim> scat_dims;
2357 scat_dims.push_back(sd_dim);
2358 scat_dims.push_back(wave_dim);
2359 vector<NcDim> mode_dims;
2360 mode_dims.push_back(sd_dim);
2361 mode_dims.push_back(wave_dim);
2362 mode_dims.push_back(mode_dim);
2363 vector<NcDim> pol_dims;
2364 pol_dims.push_back(sd_dim);
2365 pol_dims.push_back(wave_dim);
2366 pol_dims.push_back(angle_dim);
2367 vector<NcDim> fmat_dims;
2368 fmat_dims.push_back(sd_dim);
2369 fmat_dims.push_back(wave_dim);
2370 fmat_dims.push_back(angle_dim);
2371 fmat_dims.push_back(stokes_dim);
2372 fmat_dims.push_back(stokes_dim);
2374 NcVar var = ncout->addVar(
"IFUNC", ncInt, sd_dim);
2376 var.putVar( &in_->ifunc[0] );
2378 var = ncout->addVar(
"MFUNC", ncInt, sd_dim);
2380 var.putVar( &in_->mfunc[0] );
2382 var = ncout->addVar(
"WAVELENGTHS", ncDouble, wave_dim);
2385 var = ncout->addVar(
"REF_INDEX_REAL", ncDouble, mode_dims);
2387 var.putVar( &out_->refr[0][0][0] );
2389 var = ncout->addVar(
"REF_INDEX_IMAG", ncDouble, mode_dims);
2391 var.putVar( &out_->refi[0][0][0] );
2393 var = ncout->addVar(
"RADIUS_MEAN", ncDouble, mode_dims);
2395 var.putVar( &out_->rg[0][0][0] );
2397 var = ncout->addVar(
"RADIUS_SDEV", ncDouble, mode_dims);
2399 var.putVar( &out_->sig[0][0][0] );
2401 var = ncout->addVar(
"NUMBER_PARTICLES", ncDouble, mode_dims);
2403 var.putVar( &out_->npar[0][0][0] );
2405 var = ncout->addVar(
"DELX", ncDouble, mode_dims);
2407 var.putVar( &out_->dx[0][0][0] );
2409 var = ncout->addVar(
"EPAR", ncDouble, mode_dims);
2411 var.putVar( &out_->epar[0][0][0] );
2413 var = ncout->addVar(
"RMIN", ncDouble, mode_dims);
2415 var.putVar( &out_->rmin[0][0][0] );
2417 var = ncout->addVar(
"RMAX", ncDouble, mode_dims);
2419 var.putVar( &out_->rmax[0][0][0] );
2421 var = ncout->addVar(
"DELTAR", ncDouble, mode_dims);
2423 var.putVar( &out_->deltar[0][0][0] );
2425 var = ncout->addVar(
"DELTAX", ncDouble, mode_dims);
2427 var.putVar( &out_->deltax[0][0][0] );
2429 var = ncout->addVar(
"R11", ncDouble, scat_dims);
2431 var.putVar( &out_->r11[0][0] );
2433 var = ncout->addVar(
"R22", ncDouble, scat_dims);
2435 var.putVar( &out_->r22[0][0] );
2437 var = ncout->addVar(
"R33", ncDouble, scat_dims);
2439 var.putVar( &out_->r33[0][0] );
2441 var = ncout->addVar(
"R44", ncDouble, scat_dims);
2443 var.putVar( &out_->r44[0][0] );
2445 var = ncout->addVar(
"REFF", ncDouble, scat_dims);
2447 var.putVar( &out_->reff[0][0] );
2449 var = ncout->addVar(
"VEFF", ncDouble, scat_dims);
2451 var.putVar( &out_->veff[0][0] );
2453 var = ncout->addVar(
"CCNSML", ncDouble, scat_dims);
2455 var.putVar( &out_->ccnsml[0][0] );
2457 var = ncout->addVar(
"BSR", ncDouble, scat_dims);
2459 var.putVar( &out_->bsr[0][0] );
2461 var = ncout->addVar(
"SALB", ncDouble, scat_dims);
2463 var.putVar( &out_->salb[0][0] );
2465 var = ncout->addVar(
"ASF", ncDouble, scat_dims);
2467 var.putVar( &out_->asf[0][0] );
2469 var = ncout->addVar(
"QSCAT", ncDouble, scat_dims);
2471 var.putVar( &out_->qscat[0][0] );
2473 var = ncout->addVar(
"QEXT", ncDouble, scat_dims);
2475 var.putVar( &out_->qext[0][0] );
2477 var = ncout->addVar(
"ANGLE", ncDouble, angle_dim);
2479 var.putVar( &out_->angl[0] );
2481 var = ncout->addVar(
"PHASE_FUNCTION", ncDouble, pol_dims);
2483 var.putVar( &out_->phfu[0][0][0]);
2485 var = ncout->addVar(
"POLARIZATION", ncDouble, pol_dims);
2487 var.putVar( &out_->pol[0][0][0]);
2489 var = ncout->addVar(
"WT", ncDouble, pol_dims);
2491 var.putVar( &out_->wt[0][0][0]);
2493 var = ncout->addVar(
"RBAR", ncDouble, pol_dims);
2495 var.putVar( &out_->rbar[0][0][0]);
2497 var = ncout->addVar(
"DN_DLOGR", ncDouble, pol_dims);
2499 var.putVar( &out_->dnzp[0][0][0]);
2501 var = ncout->addVar(
"DN_DR", ncDouble, pol_dims);
2503 var.putVar( &out_->dnp[0][0][0]);
2505 var = ncout->addVar(
"DV_DLOGR", ncDouble, pol_dims);
2507 var.putVar( &out_->dvp[0][0][0]);
2509 var = ncout->addVar(
"TOTAL_PARTICLES", ncDouble, pol_dims);
2511 var.putVar( &out_->sumnp[0][0][0]);
2513 var = ncout->addVar(
"F-MATRIX", ncDouble, fmat_dims);
2515 var.putVar( &
F[0][0][0][0][0]);
2524 if (
ofile.empty()) {
2525 cerr <<
"\nAfrtProcess:: Invalid output file path.\n" << endl;
2533 ncout =
new NcFile(
ofile, NcFile::newFile );
2535 catch( NcException& e) {
2537 cerr <<
"AfrtProcess:: Output file exists: "
2539 ncout = (NcFile*) 0
L;
2543 ncout =
new NcFile(
ofile, NcFile::replace );
2545 catch( NcException& e) {
2547 cerr <<
"AfrtProcess:: Failure opening output file: "
2552 write_global_attributes( ncout );
2554 size_t dlam = in_->ilm2 - in_->ilm1 + 1;
2555 size_t dsd = in_->isd2 - in_->isd1 + 1;
2556 size_t dtau = in_->itau2 - in_->itau1 + 1;
2557 size_t dwnd = in_->iwnd2 - in_->iwnd1 + 1;
2558 size_t dnsza = in_->inthe0;
2559 size_t dnthe = in_->inthe0;
2560 size_t dnphi = (360.0/in_->dphi)/2.0 +1;
2562 NcDim index_dim = ncout->addDim(
"dim_index", 2 );
2563 NcDim wave_dim = ncout->addDim(
"dim_wave", dlam );
2564 NcDim sd_dim = ncout->addDim(
"dim_size", dsd );
2565 NcDim tau_dim = ncout->addDim(
"dim_tau", dtau );
2566 NcDim wnd_dim = ncout->addDim(
"dim_wind", dwnd );
2567 NcDim sza_dim = ncout->addDim(
"dim_sza", dnsza );
2568 NcDim the_dim = ncout->addDim(
"dim_the", dnthe );
2569 NcDim phi_dim = ncout->addDim(
"dim_phi", dnphi );
2570 NcDim stokes_dim = ncout->addDim(
"dim_stokes", nstk );
2572 vector<NcDim> scalar_dims;
2573 scalar_dims.push_back(sd_dim);
2574 scalar_dims.push_back(wave_dim);
2575 scalar_dims.push_back(tau_dim);
2576 vector<NcDim> sza_dims;
2577 sza_dims.push_back(sd_dim);
2578 sza_dims.push_back(wave_dim);
2579 sza_dims.push_back(tau_dim);
2580 sza_dims.push_back(wnd_dim);
2581 sza_dims.push_back(sza_dim);
2582 vector<NcDim> phi_dims;
2583 phi_dims.push_back(sd_dim);
2584 phi_dims.push_back(wave_dim);
2585 phi_dims.push_back(tau_dim);
2586 phi_dims.push_back(wnd_dim);
2587 phi_dims.push_back(sza_dim);
2588 phi_dims.push_back(the_dim);
2589 phi_dims.push_back(phi_dim);
2590 phi_dims.push_back(stokes_dim);
2595 NcVar var = ncout->addVar(
"wavelength_index", ncInt, index_dim);
2601 var = ncout->addVar(
"model_index", ncInt, index_dim);
2607 var = ncout->addVar(
"tau_index", ncInt, index_dim);
2613 var = ncout->addVar(
"wind_index", ncInt, index_dim);
2617 var = ncout->addVar(
"WAVELENGTH", ncDouble, wave_dim);
2620 var = ncout->addVar(
"TAU_RAYLEIGH", ncDouble, scalar_dims);
2623 var = ncout->addVar(
"TAU_AEROSOL", ncDouble, scalar_dims);
2629 var = ncout->addVar(
"TAU_TOTAL", ncDouble, scalar_dims);
2632 var = ncout->addVar(
"WIND_SPEED", ncDouble, wnd_dim);
2635 var = ncout->addVar(
"AOT", ncDouble, tau_dim);
2638 var = ncout->addVar(
"SZA", ncDouble, sza_dim);
2641 var = ncout->addVar(
"THETA", ncDouble, the_dim);
2644 var = ncout->addVar(
"PHI", ncDouble, phi_dim);
2647 var = ncout->addVar(
"BOA_DIRECT", ncDouble, sza_dims);
2653 var = ncout->addVar(
"BOA_DIFFUSE", ncDouble, sza_dims);
2656 var = ncout->addVar(
"TOA_DIFFUSE", ncDouble, sza_dims);
2659 var = ncout->addVar(
"HEM_REFLECTANCE", ncDouble, sza_dims);
2682 var = ncout->addVar(
"HEM_REFL_REF", ncDouble, sza_dims);
2684 var.putVar( &out_->tmqq[0][0][0][0][0] );
2697 var = ncout->addVar(
"TOA_RADIANCE", ncDouble, phi_dims);
2700 var = ncout->addVar(
"BOA_RADIANCE", ncDouble, phi_dims);
2712 if (ofilepath_.empty()) {
2713 cerr <<
"\nAfrtProcess:: Failure locating output file path.\n" << endl;
2719 ncout =
new NcFile( ofilepath_, NcFile::write );
2721 catch( NcException& e) {
2723 cerr <<
"AfrtProcess:: Can't open output file: "
2724 << ofilepath_ << endl;
2725 ncout = (NcFile*) 0
L;
2730 size_t dnsza = in_->inthe0;
2731 size_t dnthe = in_->inthe0;
2732 size_t dnphi = (360.0/in_->dphi)/2.0 +1;
2739 sza.resize(boost::extents[dnsza]);
2740 the.resize(boost::extents[dnthe]);
2741 phi.resize(boost::extents[dnphi]);
2742 xzeroz.resize(boost::extents[1][1][1][1][dnsza][dnthe][dnphi][nstk]);
2743 xzerod.resize(boost::extents[1][1][1][1][dnsza][dnthe][dnphi][nstk]);
2744 for (
size_t i=0;
i<dnsza;
i++) {
2745 double z = in_->the0in[
i];
2747 for (
size_t j=0;
j<dnthe;
j++) {
2748 double t = (in_->rx[
j] + in_->rx[
j+1])/2.0;
2750 for (
size_t k=0;
k<dnphi;
k++) {
2751 double p = in_->phi[
k];
2753 for (
size_t s=0;
s<nstk;
s++) {
2754 double x = out_->xzeroz[0][0][0][0][
i][
j][
k][
s];
2755 xzeroz[0][0][0][0][
i][
j][
k][
s] =
x;
2756 x = out_->xzerod[0][0][0][0][
i][
j][
k][
s];
2757 xzerod[0][0][0][0][
i][
j][
k][
s] =
x;
2763 vector<size_t> startw,countw;
2764 startw.push_back((
size_t)l1);
2765 countw.push_back((
size_t)1);
2767 NcVar var = ncout->getVar(
"WAVELENGTH");
2768 var.putVar( startw, countw, &out_->wl );
2771 var = ncout->getVar(
"AOT");
2772 var.putVar( startw, countw, &out_->tau );
2775 var = ncout->getVar(
"WIND_SPEED");
2776 var.putVar( startw, countw, &out_->wnd );
2778 var = ncout->getVar(
"SZA");
2779 var.putVar( &
sza[0] );
2781 var = ncout->getVar(
"THETA");
2782 var.putVar( &the[0] );
2784 var = ncout->getVar(
"PHI");
2785 var.putVar( &phi[0] );
2787 vector<size_t> startp,countp;
2788 startp.push_back((
size_t)s1);
2789 startp.push_back((
size_t)l1);
2790 startp.push_back((
size_t)t1);
2791 startp.push_back((
size_t)w1);
2792 countp.push_back((
size_t)1);
2793 countp.push_back((
size_t)1);
2794 countp.push_back((
size_t)1);
2795 countp.push_back((
size_t)1);
2797 var = ncout->getVar(
"TAU_TOTAL");
2798 var.putVar( startp, countp, &rt1_->out_->tautot[0][0][0] );
2800 var = ncout->getVar(
"TAU_RAYLEIGH");
2801 var.putVar( startp, countp, &rt1_->out_->trp[0][0][0] );
2803 var = ncout->getVar(
"TAU_AEROSOL");
2804 var.putVar( startp, countp, &rt1_->out_->tmp[0][0][0] );
2809 startp.push_back(0);
2810 countp.push_back(dnsza);
2812 var = ncout->getVar(
"BOA_DIRECT");
2813 var.putVar( startp, countp, &out_->tmb[0][0][0][0][0] );
2818 var = ncout->getVar(
"BOA_DIFFUSE");
2819 var.putVar( startp, countp, &out_->tmfd[0][0][0][0][0] );
2821 var = ncout->getVar(
"TOA_DIFFUSE");
2822 var.putVar( startp, countp, &out_->tmfu[0][0][0][0][0] );
2824 var = ncout->getVar(
"HEM_REFLECTANCE");
2825 var.putVar( startp, countp, &out_->tms[0][0][0][0][0] );
2842 var = ncout->getVar(
"HEM_REFL_REF");
2843 var.putVar( startp, countp, &out_->tmqq[0][0][0][0][0] );
2855 startp.push_back(0);
2856 startp.push_back(0);
2857 startp.push_back(0);
2858 countp.push_back(dnthe);
2859 countp.push_back(dnphi);
2860 countp.push_back(nstk);
2862 var = ncout->getVar(
"TOA_RADIANCE");
2863 var.putVar( startp, countp, &xzeroz[0][0][0][0][0][0][0][0] );
2865 var = ncout->getVar(
"BOA_RADIANCE");
2866 var.putVar( startp, countp, &xzerod[0][0][0][0][0][0][0][0] );
2879 nc_input =
new NcFile(
filepath, NcFile::read );
2881 catch( NcException& e) {
2883 cerr <<
"AfrtProcessPhs:: Failure opening netcdf LUT file: "
2887 NcGroup grp = nc_input->getGroup(
"PHS" );
2888 NcVar var = grp.getVar (
"F-MATRIX" );
2890 NcDim dim_lam = var.getDim(0);
2891 long dl = dim_lam.getSize();
2892 NcDim dim_sd = var.getDim(1);
2893 long ds = dim_sd.getSize();
2895 if (l2 > dl || s2 > ds)
return RT_FAIL;
2900 size_t l_start = l1 - 1;
2901 size_t s_start = s1 - 1;
2902 size_t l_count = l2 - l1 + 1;
2903 size_t s_count = s2 - s1 + 1;
2905 vector<size_t> startp,countp;
2906 startp.push_back(s_start);
2907 countp.push_back(s_count);
2909 var = grp.getVar(
"IFUNC");
2910 var.getVar(startp,countp, &in_->ifunc[0] );
2912 var = grp.getVar(
"MFUNC");
2913 var.getVar(startp,countp, &in_->mfunc[0] );
2917 startp.push_back(s_start);
2918 startp.push_back(l_start);
2919 startp.push_back(0);
2920 countp.push_back(s_count);
2921 countp.push_back(l_count);
2922 countp.push_back(nmd);
2924 var = grp.getVar(
"REF_INDEX_REAL");
2925 var.getVar( startp,countp, &out_->refr[0][0][0] );
2927 var = grp.getVar(
"REF_INDEX_IMAG");
2928 var.getVar( startp,countp, &out_->refi[0][0][0] );
2930 var = grp.getVar(
"RADIUS_MEAN");
2931 var.getVar( startp,countp, &out_->rg[0][0][0] );
2933 var = grp.getVar(
"RADIUS_SDEV");
2934 var.getVar( startp,countp, &out_->sig[0][0][0] );
2936 var = grp.getVar(
"NUMBER_PARTICLES");
2937 var.getVar( startp,countp, &out_->npar[0][0][0] );
2939 var = grp.getVar(
"DELX");
2940 var.getVar( startp,countp, &out_->dx[0][0][0] );
2942 var = grp.getVar(
"EPAR");
2943 var.getVar( startp,countp, &out_->epar[0][0][0] );
2945 var = grp.getVar(
"RMIN");
2946 var.getVar( startp,countp, &out_->rmin[0][0][0] );
2948 var = grp.getVar(
"RMAX");
2949 var.getVar( startp,countp, &out_->rmax[0][0][0] );
2951 var = grp.getVar(
"DELTAR");
2952 var.getVar( startp,countp, &out_->deltar[0][0][0] );
2954 var = grp.getVar(
"DELTAX");
2955 var.getVar( startp,countp, &out_->deltax[0][0][0] );
2959 startp.push_back(s_start);
2960 startp.push_back(l_start);
2961 countp.push_back(s_count);
2962 countp.push_back(l_count);
2964 var = grp.getVar(
"R11");
2965 var.getVar(startp,countp, &out_->r11[0][0] );
2967 var = grp.getVar(
"R22");
2968 var.getVar(startp,countp, &out_->r22[0][0] );
2970 var = grp.getVar(
"R33");
2971 var.getVar(startp,countp, &out_->r33[0][0] );
2973 var = grp.getVar(
"R44");
2974 var.getVar(startp,countp, &out_->r44[0][0] );
2976 var = grp.getVar(
"REFF");
2977 var.getVar(startp,countp, &out_->reff[0][0] );
2979 var = grp.getVar(
"VEFF");
2980 var.getVar(startp,countp, &out_->veff[0][0] );
2982 var = grp.getVar(
"CCNSML");
2983 var.getVar(startp,countp, &out_->ccnsml[0][0] );
2985 var = grp.getVar(
"BSR");
2986 var.getVar(startp,countp, &out_->bsr[0][0] );
2988 var = grp.getVar(
"SALB");
2989 var.getVar(startp,countp, &out_->salb[0][0] );
2991 var = grp.getVar(
"ASF");
2992 var.getVar(startp,countp, &out_->asf[0][0] );
2994 var = grp.getVar(
"QSCAT");
2995 var.getVar(startp,countp, &out_->qscat[0][0] );
2997 var = grp.getVar(
"QEXT");
2998 var.getVar(startp,countp, &out_->qext[0][0] );
3002 startp.push_back(s_start);
3003 startp.push_back(l_start);
3004 startp.push_back(0);
3005 countp.push_back(s_count);
3006 countp.push_back(l_count);
3007 countp.push_back(ntf);
3009 var = grp.getVar(
"PHFU");
3010 var.getVar(startp,countp, &out_->phfu[0][0][0]);
3012 var = grp.getVar(
"POLARIZATION");
3013 var.getVar(startp,countp, &out_->pol[0][0][0]);
3015 var = grp.getVar(
"WT");
3016 var.getVar(startp,countp, &out_->wt[0][0][0]);
3018 var = grp.getVar(
"RBAR");
3019 var.getVar(startp,countp, &out_->rbar[0][0][0]);
3021 var = grp.getVar(
"DN_DLOGR");
3022 var.getVar(startp,countp, &out_->dnzp[0][0][0]);
3024 var = grp.getVar(
"DN_DR");
3025 var.getVar(startp,countp, &out_->dnp[0][0][0]);
3027 var = grp.getVar(
"DV_DLOGR");
3028 var.getVar(startp,countp, &out_->dvp[0][0][0]);
3030 var = grp.getVar(
"TOTAL_PARTICLES");
3031 var.getVar(startp,countp, &out_->sumnp[0][0][0]);
3035 startp.push_back(s_start);
3036 startp.push_back(l_start);
3037 startp.push_back(0);
3038 startp.push_back(0);
3039 countp.push_back(s_count);
3040 countp.push_back(l_count);
3041 countp.push_back(nstk);
3042 countp.push_back(nstk);
3045 F.resize(boost::extents[s_count][l_count][ntf][nstk][nstk]);
3046 var = grp.getVar(
"F-MATRIX");
3047 var.getVar(startp,countp, &
F[0][0][0][0][0]);
3049 for (
size_t iL=0; iL<l_count; iL++) {
3050 for (
size_t iSd=0; iSd<s_count; iSd++) {
3051 for (
int iA=0; iA<ntf; iA++) {
3052 double T1 =
F[iSd][iL][iA][0][0] +
F[iSd][iL][iA][0][1];
3053 double T2 =
F[iSd][iL][iA][0][0] -
F[iSd][iL][iA][0][1];
3054 out_->t[iSd][iL][0][iA] = T1/2.0;
3055 out_->t[iSd][iL][1][iA] = T2/2.0;
3056 out_->t[iSd][iL][2][iA] =
F[iSd][iL][iA][2][2];
3057 out_->t[iSd][iL][3][iA] =
F[iSd][iL][iA][3][2];
3061 F.resize(boost::extents[0][0][0][0][0]);
3079 conventions_ =
"CF-1.6";
3080 institution_ =
"NASA Goddard Space Flight Center, VIIRS L1 Processing Group";
3081 license_ =
"https://science.nasa.gov/earth-science/earth-science-data/data-information-policy/";
3082 naming_authority_ =
"gov.nasa.gsfc.sci.oceandata";
3083 keywords_vocabulary_ =
"NASA Global Change Master Directory (GCMD) Science Keywords";
3084 stdname_vocabulary_ =
"NetCDF Climate and Forecast (CF) Metadata Convention";
3085 creator_name_ =
"NASA Ocean Biology Processing Group";
3086 creator_email_ =
"modis-ops@lists.nasa.gov";
3087 creator_url_ =
"https://oceandata.sci.gsfc.nasa.gov";
3088 project_ =
"NASA Ocean Biology Processing Project";
3089 publisher_name_ =
"OBPG";
3090 publisher_url_ =
"https://oceandata.sci.gsfc.nasa.gov";
3091 publisher_email_ =
"data@oceancolor.gsfc.nasa.gov";
3092 processing_level_ =
"L1B";
3093 cdm_data_type_ =
"swath";
3096 struct tm * timeinfo;
3099 timeinfo = localtime(&rawtime);
3100 strftime(buffer, 80,
"%Y-%m-%dT%I:%M:%SZ", timeinfo);
3102 ncout->putAtt(
"processing_version", processing_version_);
3104 ncout->putAtt(
"Conventions", conventions_);
3105 ncout->putAtt(
"institution", institution_);
3106 ncout->putAtt(
"license", license_);
3107 ncout->putAtt(
"naming_authority", naming_authority_);
3108 ncout->putAtt(
"date_created", date_created_);
3109 ncout->putAtt(
"ProductionTime", date_created_);
3110 ncout->putAtt(
"keywords_vocabulary", keywords_vocabulary_);
3111 ncout->putAtt(
"stdname_vocabulary", stdname_vocabulary_);
3112 ncout->putAtt(
"creator_name", creator_name_);
3113 ncout->putAtt(
"creator_email", creator_email_);
3114 ncout->putAtt(
"creator_url", creator_url_);
3115 ncout->putAtt(
"project", project_);
3116 ncout->putAtt(
"publisher_name", publisher_name_);
3117 ncout->putAtt(
"publisher_url", publisher_url_);
3118 ncout->putAtt(
"publisher_email", publisher_email_);
3119 ncout->putAtt(
"processing_level", processing_level_);
3120 ncout->putAtt(
"cdm_data_type", cdm_data_type_);
3121 ncout->putAtt(
"history", history_);
3122 ncout->putAtt(
"source", source_files_);
3123 ncout->putAtt(
"time_coverage_start", time_coverage_start_);
3124 ncout->putAtt(
"time_coverage_end", time_coverage_end_);
3125 ncout->putAtt(
"PGE_StartTime", pge_start_time_);
3126 ncout->putAtt(
"PGE_EndTime", pge_end_time_);
3127 ncout->putAtt(
"StartTime", pge_start_time_);
3128 ncout->putAtt(
"EndTime", pge_end_time_);
3130 if (!pge_name_.empty()) {
3131 ncout->putAtt(
"PGE_Name",pge_name_);
3134 if (!versionid_.empty()) {
3135 ncout->putAtt(
"VersionId",versionid_);
3138 ncout->putAtt(
"title", title_ );
3139 ncout->putAtt(
"platform", platform_);
3140 ncout->putAtt(
"instrument", sensor_ );
3141 ncout->putAtt(
"product_name", prod_name_ );
3142 ncout->putAtt(
"LocalGranuleID", prod_name_);