BISICLES AMR ice sheet model  0.9
DomainDiagnosticData.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3 * _______ __
4 * / ___/ / ___ __ _ / / ___
5 * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6 * \___/_//_/\___/_/_/_/_.__/\___/
7 * Please refer to Copyright.txt, in Chombo's root directory.
8 */
9 #endif
10 
11 #ifndef DOMAIN_DIAGNOSTIC_DATA_H
12 #define DOMAIN_DIAGNOSTIC_DATA_H
13 
14 #include "CH_HDF5.H"
15 #include "Vector.H"
16 #include "LevelSigmaCS.H"
17 #include "ParmParse.H"
18 
19 #include "NamespaceHeader.H"
20 
22 
44 class AmrIce;
45 
46 #define HDF5_SUBGROUP_NAME "bisicles_domain_diagnostic_data"
47 #define CFIO_DIAGNOSTIC_TIME_NAME "time"
48 
49 #define CFIO_DIAGNOSTIC_ICE_VOLUME_SHORT_NAME "lim"
50 #define CFIO_DIAGNOSTIC_ICE_VAF_SHORT_NAME "limnsw"
51 #define CFIO_DIAGNOSTIC_GROUNDED_ICE_AREA_SHORT_NAME "iareagr"
52 #define CFIO_DIAGNOSTIC_FLOATING_ICE_AREA_SHORT_NAME "iareafl"
53 #define CFIO_DIAGNOSTIC_UPPER_SURFACE_FLUX_SHORT_NAME "tendacabf"
54 #define CFIO_DIAGNOSTIC_LOWER_SURFACE_FLUX_SHORT_NAME "tendlibmassbf"
55 #define CFIO_DIAGNOSTIC_LOWER_SURFACE_FLOATING_ICE_FLUX_SHORT_NAME "tendlibmassbffl"
56 #define CFIO_DIAGNOSTIC_CALVING_FLUX_SHORT_NAME "tendlicalvf"
57 #define CFIO_DIAGNOSTIC_ICE_FRONT_CALVING_AND_MELTING_SHORT_NAME "tendlifmassbf"
58 
59 #define CFIO_DIAGNOSTIC_ICE_VOLUME_CF_NAME "land_ice_mass"
60 #define CFIO_DIAGNOSTIC_ICE_VAF_CF_NAME "land_ice_mass_not_displacing_sea_water"
61 #define CFIO_DIAGNOSTIC_GROUNDED_ICE_AREA_CF_NAME "grounded_ice_sheet_area"
62 #define CFIO_DIAGNOSTIC_FLOATING_ICE_AREA_CF_NAME "floating_ice_sheet_area"
63 #define CFIO_DIAGNOSTIC_UPPER_SURFACE_FLUX_CF_NAME "tendency_of_land_ice_mass_due_to_surface_mass_balance"
64 #define CFIO_DIAGNOSTIC_LOWER_SURFACE_FLUX_CF_NAME "tendency_of_land_ice_mass_due_to_basal_mass_balance"
65 #define CFIO_DIAGNOSTIC_LOWER_SURFACE_FLOATING_ICE_FLUX_CF_NAME "tendency_of_land_ice_mass_due_to_basal_mass_balance"
66 #define CFIO_DIAGNOSTIC_CALVING_FLUX_CF_NAME "tendency_of_land_ice_mass_due_to_calving"
67 #define CFIO_DIAGNOSTIC_ICE_FRONT_CALVING_AND_MELTING_CF_NAME "tendency_of_land_ice_mass_due_to_calving_and_ice_front_melting"
68 
69 #define CFIO_DIAGNOSTIC_ICE_VOLUME_LONG_NAME "Ice mass"
70 #define CFIO_DIAGNOSTIC_ICE_VAF_LONG_NAME "Ice mass not displaced by seawater"
71 #define CFIO_DIAGNOSTIC_GROUNDED_ICE_AREA_LONG_NAME "Area covered by grounded ice"
72 #define CFIO_DIAGNOSTIC_FLOATING_ICE_AREA_LONG_NAME "Area covered by floating ice"
73 #define CFIO_DIAGNOSTIC_UPPER_SURFACE_FLUX_LONG_NAME "Total SMB flux"
74 #define CFIO_DIAGNOSTIC_LOWER_SURFACE_FLUX_LONG_NAME "Total BMB flux"
75 #define CFIO_DIAGNOSTIC_LOWER_SURFACE_FLOATING_ICE_FLUX_LONG_NAME "Total BMB flux beneath floating ice"
76 #define CFIO_DIAGNOSTIC_CALVING_FLUX_LONG_NAME "Total calving flux"
77 #define CFIO_DIAGNOSTIC_ICE_FRONT_CALVING_AND_MELTING_LONG_NAME "Total calving and ice front melting flux"
78 
80 {
81  std::string short_name;
82  std::string long_name;
83  std::string cf_name;
84  std::string units;
85  Vector<Real>* data;
86 };
87 
89 {
90  Vector<Real> m_time; // time
91  Vector<Real> m_ice_vaf; // total volume above flotation
92  Vector<Real> m_ice_volume; // total ice volume
93  Vector<Real> m_ice_grounded_area; // grounded ice area
94  Vector<Real> m_ice_floating_area; // floating ice area
95  Vector<Real> m_ice_total_smb; // total SMB over ice covered regions
96  Vector<Real> m_ice_total_bmb; // total BMB over ice covered regions
97  Vector<Real> m_ice_floating_total_bmb; // total BMB over floating ice
98  Vector<Real> m_ice_total_calving_flux; // total calving flux
99  Vector<Real> m_ice_total_calving_and_ice_front_melting_flux; // total calving and ice front melting flux
100 
101  Real m_previous_time, m_previous_volume; // used for computing the calving rate
102 
103  void setCFdata();
104 
105 public:
108 
109 private:
113  DomainDiagnosticData& operator=(const DomainDiagnosticData&);
114 public:
115 
117  Real computeTotalIce
118  (const Vector<RefCountedPtr<LevelSigmaCS > >& a_coordSys,
119  const Vector<int>& a_refRatio, Real a_crseDx,
120  int a_finestLevel) const;
121 
122  Real computeVolumeAboveFlotation
123  (const Vector<RefCountedPtr<LevelSigmaCS > >& a_coordSys,
124  const Vector<int>& a_refRatio, Real a_crseDx,
125  int a_finestLevel) const;
126 
127  Real computeTotalGroundedIce
128  (const Vector<DisjointBoxLayout>& a_grids,
129  const Vector<RefCountedPtr<LevelSigmaCS > >& a_coordSys,
130  const Vector<int>& a_refRatio, Real a_crseDx,
131  int a_finestLevel) const;
132 
133  void computeAreaFraction(LevelData<FArrayBox>& a_area,
134  const Vector<RefCountedPtr<LevelSigmaCS > >& a_coordSys,
135  int a_maskVal,
136  int a_level,
137  int a_finestLevel) const;
138 
139  Real computeArea
140  (int a_maskVal,
141  const Vector<RefCountedPtr<LevelSigmaCS > >& a_coordSys,
142  const Vector<DisjointBoxLayout>& a_grids,
143  const Vector<int>& a_refRatio, Real a_crseDx,
144  int a_finestLevel) const;
145 
146  Real computeGroundedArea
147  (const Vector<RefCountedPtr<LevelSigmaCS > >& a_coordSys,
148  const Vector<DisjointBoxLayout>& a_grids,
149  const Vector<int>& a_refRatio, Real a_crseDx,
150  int a_finestLevel) const;
151 
152  Real computeFloatingArea
153  (const Vector<RefCountedPtr<LevelSigmaCS > >& a_coordSys,
154  const Vector<DisjointBoxLayout>& a_grids,
155  const Vector<int>& a_refRatio, Real a_crseDx,
156  int a_finestLevel) const;
157 
158  Real computeFluxOverIce
159  (const Vector<LevelData<FArrayBox>* > a_flux,
160  const Vector<RefCountedPtr<LevelSigmaCS > >& a_coordSys,
161  const Vector<DisjointBoxLayout>& a_grids,
162  const Vector<int>& a_refRatio, Real a_crseDx,
163  int a_finestLevel) const;
164 
165  Real computeFluxOverMaskedIce
166  (int a_maskVal,
167  const Vector<LevelData<FArrayBox>* > a_flux,
168  const Vector<RefCountedPtr<LevelSigmaCS > >& a_coordSys,
169  const Vector<DisjointBoxLayout>& a_grids,
170  const Vector<int>& a_refRatio, Real a_crseDx,
171  int a_finestLevel) const;
172 
173  Real computeDeltaVolumeOverIce
174  (const Vector<LevelData<FArrayBox>* >& a_old_thickness,
175  const Vector<RefCountedPtr<LevelSigmaCS > >& a_coordSys,
176  const Vector<DisjointBoxLayout>& a_grids,
177  const Vector<int>& a_refRatio, Real a_crseDx,
178  int a_finestLevel) const;
179 
180  Real computeTotalFlux
181  (const Vector<LevelData<FArrayBox>* > a_flux,
182  const Vector<int>& a_refRatio, Real a_crseDx) const;
183 
184  void initDiagnostics(AmrIce& a_amrIce,
185  const Vector<RefCountedPtr<LevelSigmaCS > >& a_coordSys,
186  const Vector<DisjointBoxLayout>& a_grids,
187  const Vector<int>& a_refRatio, Real a_crseDx,
188  Real a_time, int a_finestLevel);
189 
190  void computeDischarge
191  (const Vector<RefCountedPtr<LevelSigmaCS > >& a_coordSys,
192  const Vector<LevelData<FluxBox>* >& a_vectFluxes,
193  const Vector<DisjointBoxLayout>& a_grids,
194  const Vector<Real>& a_dx,
195  const Vector<int>& a_refRatio,
196  Real a_time, Real a_offsetTime,
197  int a_cur_step, int a_finestLevel, int a_verbosity);
198 
199  void endTimestepDiagnostics
200  (const Vector<RefCountedPtr<LevelSigmaCS > >& a_coordSys,
201  const Vector<LevelData<FArrayBox>* > a_old_thickness,
202  const Vector<LevelData<FArrayBox>* > a_divThicknessFlux,
203  const Vector<LevelData<FArrayBox>* > a_basalThicknessSource,
204  const Vector<LevelData<FArrayBox>* > a_surfaceThicknessSource,
205  const Vector<LevelData<FArrayBox>* > a_volumeThicknessSource,
206  const Vector<LevelData<FArrayBox>* > a_calvedIceThickness,
207  const Vector<LevelData<FArrayBox>* > a_addedIceThickness,
208  const Vector<LevelData<FArrayBox>* > a_removedIceThickness,
209  const Vector<DisjointBoxLayout>& a_grids,
210  const Vector<int>& a_refRatio, Real a_crseDx,
211  Real a_time, Real a_offsetTime, Real a_dt,
212  int a_cur_step, int a_finestLevel, int a_verbosity);
213 
215  void record(AmrIce& a_amrIce);
217  void reset();
218 
219 #ifdef CH_USE_HDF5
220  void write(HDF5Handle& a_handle);
223  void read(HDF5Handle& a_handle);
224 #endif
225 
227 
234  Real m_diagnostic_values[10]={0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
235  //cfDiagnostic m_cf_stuff[10];
236  vector<cfDiagnostic> m_cf_stuff;
237 
240 
243 
246 
249 
252 
255 
258 
261 
264 
267 
270 
271 };
272 
273 
274 #include "NamespaceFooter.H"
275 
276 #endif
277 
278 
bool m_report_total_flux
if true, report sum(basal flux) and sum(surface flux)
Definition: DomainDiagnosticData.H:245
std::string long_name
Definition: DomainDiagnosticData.H:82
Real m_lastSumCalvedIce
diagnostic quantity – sum(calved ice) at last timestep
Definition: DomainDiagnosticData.H:257
Real m_lastVolumeAboveFlotation
diagnostic quantity – sum(ice over flotation) at last timestepa
Definition: DomainDiagnosticData.H:269
Real m_lastSumIce
diagnostic quantity – sum(ice) at last timestepa
Definition: DomainDiagnosticData.H:254
bool m_report_calving
if true, report sum(melt from calving model) and sum(calved ice)
Definition: DomainDiagnosticData.H:248
Vector< Real > * data
Definition: DomainDiagnosticData.H:85
class to manage non-subcycled AMR ice-sheet model
Definition: AmrIce.H:40
Real m_initialVolumeAboveFlotation
diagnostic quantity – sum(ice over flotation) at initial time
Definition: DomainDiagnosticData.H:266
std::string short_name
Definition: DomainDiagnosticData.H:81
std::string cf_name
Definition: DomainDiagnosticData.H:83
Definition: DomainDiagnosticData.H:79
vector< cfDiagnostic > m_cf_stuff
Definition: DomainDiagnosticData.H:236
Definition: DomainDiagnosticData.H:88
Real m_initialSumIce
diagnostic quantity – sum(ice) at initial time
Definition: DomainDiagnosticData.H:251
std::string units
Definition: DomainDiagnosticData.H:84
bool m_report_area
if true, report area of grounded ice and area of floating ice
Definition: DomainDiagnosticData.H:242
Real m_initialSumGroundedIce
diagnostic quantity – sum(grounded ice) at initial time
Definition: DomainDiagnosticData.H:260
bool m_report_grounded_ice
if true, report sum(grounded ice) as well as sum(total ice)
Definition: DomainDiagnosticData.H:239
void computeDischarge(Vector< LevelData< FArrayBox > * > &topography, Vector< LevelData< FArrayBox > * > &thickness, Vector< Real > &dx, Vector< int > &ratio, Vector< std::string > &name, Vector< LevelData< FArrayBox > * > &data, Vector< LevelData< FArrayBox > * > &sectorMask, Real a_iceDensity, Real a_waterDensity, Real a_gravity, Real mcrseDx, int maskNo)
Definition: discharge.cpp:106
Real m_lastSumGroundedIce
diagnostic quantity – sum(grounded ice) at last timestep
Definition: DomainDiagnosticData.H:263