Canoe
Comprehensive Atmosphere N' Ocean Engine
simple_cloud.cpp
Go to the documentation of this file.
1 // C/C++ headers
2 #include <algorithm>
3 #include <cassert> // assert
4 #include <cstring>
5 #include <iostream>
6 #include <stdexcept>
7 
8 // canoe
9 #include <air_parcel.hpp>
10 
11 // harp
12 #include <harp/radiation.hpp>
13 
14 // opacity
15 #include "water_cloud.hpp"
16 
17 // For grey cloud
18 Real SimpleCloud::getAttenuation1(Real wave, AirParcel const& var) const {
19  Real csize = 1.E0 * 1.e-6; // one micron size particle
20  Real crho = 1.E3;
21  Real qext = GetPar<Real>("qext");
22  // std::cout<<"var.c[imol_] "<<imol_<< " " <<var.c[imol_]<<std::endl;
23  // return var.c[imol_]*qext/(4./3.*csize*crho); // -> 1/m
24  // put clouds 0 and precipitation 1 together
25  Real totpar = var.c[GetCloudIndex(0)] + var.c[GetCloudIndex(1)];
26  return totpar * qext / (4. / 3. * csize * crho); // -> 1/m
27 }
28 
30  AirParcel const& var) const {
31  return GetPar<Real>("ww");
32  /* // ssalb
33  Real totpar = var.c[imol_]+var.c[imol_+1];
34 
35  if (totpar < 1.e-20) {
36  return 0.0;
37  } else {
38  std::cout<<"var.c[imol_] "<<ww<< " " <<var.c[imol_]<<std::endl;
39  std::cout<<"var.c[imol_+1] "<<ww<< " " <<var.c[imol_+1]<<std::endl;
40  return ww;
41  }
42  */
43 }
44 
45 void SimpleCloud::getPhaseMomentum1(Real* pp, Real wave, AirParcel const& var,
46  int np) const {
47  // 0 for HENYEY_GREENSTEIN
48  RadiationHelper::get_phase_momentum(pp, 0, GetPar<Real>("gg"), np);
49  /*
50  Real totpar = var.c[imol_]+var.c[imol_+1];
51 
52  if (totpar < 1.e-20) {
53  getPhaseHenyeyGreenstein(pp, 0, 0.0, np); // 0 for HENYEY_GREENSTEIN
54  } else {
55  getPhaseHenyeyGreenstein(pp, 0, gg, np); // 0 for HENYEY_GREENSTEIN
56  }
57  */
58 }
Real *const c
cloud data
Definition: air_parcel.hpp:39
void getPhaseMomentum1(Real *pp, Real wave, AirParcel const &var, int np) const
Real getAttenuation1(Real wave, AirParcel const &var) const
Real getSingleScatteringAlbedo1(Real wave, AirParcel const &var) const
int GetCloudIndex(int n) const
void get_phase_momentum(Real *pmom, int iphas, Real gg, int npmom)
Definition: radiation.cpp:256