Canoe
Comprehensive Atmosphere N' Ocean Engine
rt_solver_disort_flags.cpp
Go to the documentation of this file.
1 // external
2 #include <yaml-cpp/yaml.h>
3 
4 // canoe
5 #include <configure.hpp>
6 
7 // harp
8 #include "rt_solvers.hpp"
9 
10 #ifdef RT_DISORT
11 
12 void RadiationBand::RTSolverDisort::setFlagsFromNode(YAML::Node const& my) {
13  if (my["ibcnd"]) {
14  ds_.flag.ibcnd = my["ibcnd"].as<bool>();
15  } else {
16  ds_.flag.ibcnd = 0;
17  }
18 
19  if (my["usrtau"]) {
20  ds_.flag.usrtau = my["usrtau"].as<bool>();
21  } else {
22  ds_.flag.usrtau = 1;
23  }
24 
25  if (my["usrang"]) {
26  ds_.flag.usrang = my["usrang"].as<bool>();
27  } else {
28  ds_.flag.usrang = 1;
29  }
30 
31  if (my["lamber"]) {
32  ds_.flag.lamber = my["lamber"].as<bool>();
33  } else {
34  ds_.flag.lamber = 0;
35  }
36 
37  if (my["planck"]) {
38  ds_.flag.planck = my["planck"].as<bool>();
39  } else {
40  ds_.flag.planck = 0;
41  }
42 
43  if (my["spher"]) {
44  ds_.flag.spher = my["spher"].as<bool>();
45  } else {
46  ds_.flag.spher = 0;
47  }
48 
49  if (my["onlyfl"]) {
50  ds_.flag.onlyfl = my["onlyfl"].as<bool>();
51  } else {
52  ds_.flag.onlyfl = 0;
53  }
54 
55  if (my["quiet"]) {
56  ds_.flag.quiet = my["quiet"].as<bool>();
57  } else {
58  ds_.flag.quiet = 0;
59  }
60 
61  if (my["brdf_type"]) {
62  ds_.flag.brdf_type = my["brdf_type"].as<int>();
63  } else {
64  ds_.flag.brdf_type = 0;
65  }
66 
67  if (my["intensity_correction"]) {
68  ds_.flag.intensity_correction = my["intensity_correction"].as<bool>();
69  } else {
70  ds_.flag.intensity_correction = 0;
71  }
72 
73  if (my["old_intensity_correction"]) {
74  ds_.flag.old_intensity_correction =
75  my["old_intensity_correction"].as<bool>();
76  } else {
77  ds_.flag.old_intensity_correction = 0;
78  }
79 
80  if (my["general_source"]) {
81  ds_.flag.general_source = my["general_source"].as<bool>();
82  } else {
83  ds_.flag.general_source = 0;
84  }
85 
86  if (my["output_uum"]) {
87  ds_.flag.output_uum = my["output_uum"].as<bool>();
88  } else {
89  ds_.flag.output_uum = 0;
90  }
91 
92  if (my["prnt"]) {
93  std::vector<int> prnt = my["prnt"].as<std::vector<int>>();
94  for (int i = 0; i < 5; ++i) {
95  ds_.flag.prnt[i] = prnt[i];
96  }
97  } else {
98  for (int i = 0; i < 5; ++i) {
99  ds_.flag.prnt[i] = 0;
100  }
101  }
102 }
103 
104 #endif // RT_DISORT