BISICLES AMR ice sheet model  0.9
ISMIP6OceanForcing.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 // concrete class encapsulating surface fluxes determined
12 // by copying, coarsening, or interpolating a LevelData<FArrayBox>
13 // covering an entire domain. Objects can be defined either
14 // by specifying a RefCountedPtr<LevelData<FArrayBox> > , or by specifying
15 // a std::map<Real,string> mapping time ti to an hdf5 file f. In the
16 // latter case, the flux at time t is found by linear interploation
17 // between time max(ti <= t) and min(ti > t)
18 
19 // \todo replace the std::map<Real,string> mechanism with
20 // a suitable abstraction
21 
22 #ifndef _ISMIP6OCEANFORCING_H_
23 #define _ISMIP6OCEANFORCING_H_
24 
25 #include "SurfaceFlux.H"
26 #include "ParmParse.H"
27 #include <map>
28 #include "NamespaceHeader.H"
29 
31 {
32 public:
33 
34 
35  ISMIP6OceanForcing(ParmParse& a_pp);
36 
38  virtual ~ISMIP6OceanForcing() {};
39 
41 
43  virtual SurfaceFlux* new_surfaceFlux();
44 
46 
49  virtual void surfaceThicknessFlux(LevelData<FArrayBox>& a_flux,
50  const AmrIceBase& a_amrIce,
51  int a_level, Real a_dt);
52 
53 
54 protected:
55 
56  std::map<int,std::string> m_year_file;
58  std::string m_name;
64 
65 
66  //- 1.0 * melt rate on a uniform mesh
67  RefCountedPtr<LevelData<FArrayBox> > m_uniform_source;
68  // mesh spacing of m_uniform_source
69  RealVect m_dx;
70  // timestamp for
72 
73  // layer spacing of m_TF (between components)
74  Real m_dz;
75  int m_n_layer;
76 
77  // basin masks: mask(x,y,n) = basin_number(x,y) == n ? 1 : 0
78  RefCountedPtr<LevelData<FArrayBox> > m_basin_mask;
79  int m_n_basin; // number of basins
80 
81  // deltaT(x,y)
82  RefCountedPtr<LevelData<FArrayBox> > m_deltaT; // no-need to keep reading this
83 
85  void computeSource(LevelData<FArrayBox>& a_source,
86  LevelData<FArrayBox>& a_TFb,
87  LevelData<FArrayBox>& a_TFb_basin_mean,
88  LevelData<FArrayBox>& a_deltaT,
89  Real a_gamma0);
90 
92  void computeTFb(LevelData<FArrayBox>& a_TFb,
93  const LevelData<FArrayBox>& a_TF,
94  const AmrIceBase& a_amrIce);
95 
96 
98  void computeBasinMeans(LevelData<FArrayBox>&a_TFb_basin_mean,
99  LevelData<FArrayBox>&a_TFb,
100  LevelData<FArrayBox>&a_basin_mask,
101  const AmrIceBase& a_amrIce);
102 
104  void updateUniformSource(Real a_time, const AmrIceBase& a_amrIce);
105 
107  void readUniformSource ( RefCountedPtr<LevelData<FArrayBox> >& a_source,
108  RealVect& a_dx,
109  int a_year,
110  const AmrIceBase& a_amrIce);
111 
112 
113 };
114 
115 
116 #include "NamespaceFooter.H"
117 
118 #endif
Definition: ISMIP6OceanForcing.H:30
std::string m_deltaT_var_name
Definition: ISMIP6OceanForcing.H:60
RefCountedPtr< LevelData< FArrayBox > > m_uniform_source
Definition: ISMIP6OceanForcing.H:67
std::string m_basin_file
Definition: ISMIP6OceanForcing.H:59
virtual void surfaceThicknessFlux(LevelData< FArrayBox > &a_flux, const AmrIceBase &a_amrIce, int a_level, Real a_dt)
define source term for thickness evolution and place it in flux
Definition: ISMIP6OceanForcing.cpp:392
void computeBasinMeans(LevelData< FArrayBox > &a_TFb_basin_mean, LevelData< FArrayBox > &a_TFb, LevelData< FArrayBox > &a_basin_mask, const AmrIceBase &a_amrIce)
compute the basin means of TFb, store in TFb_mean
Definition: ISMIP6OceanForcing.cpp:286
int m_n_layer
Definition: ISMIP6OceanForcing.H:75
virtual SurfaceFlux * new_surfaceFlux()
factory method
Definition: ISMIP6OceanForcing.cpp:23
bool m_anomaly
Definition: ISMIP6OceanForcing.H:61
std::string m_deltaT_file
Definition: ISMIP6OceanForcing.H:60
RefCountedPtr< LevelData< FArrayBox > > m_basin_mask
Definition: ISMIP6OceanForcing.H:78
int m_end_year
Definition: ISMIP6OceanForcing.H:57
RealVect m_dx
Definition: ISMIP6OceanForcing.H:69
virtual ~ISMIP6OceanForcing()
destructor
Definition: ISMIP6OceanForcing.H:38
void computeTFb(LevelData< FArrayBox > &a_TFb, const LevelData< FArrayBox > &a_TF, const AmrIceBase &a_amrIce)
compute thermal forcing TFb at the ice shelf base from the 3D &#39;layered&#39; field TF
Definition: ISMIP6OceanForcing.cpp:135
std::string m_name
Definition: ISMIP6OceanForcing.H:58
std::map< int, std::string > m_year_file
Definition: ISMIP6OceanForcing.H:56
std::string m_basin_var_name
Definition: ISMIP6OceanForcing.H:59
abstract class defining the surface flux interface
Definition: SurfaceFlux.H:39
bool m_tf_is_source
Definition: ISMIP6OceanForcing.H:63
Real m_basin_mean_min_thickness
Definition: ISMIP6OceanForcing.H:62
Real m_factor
Definition: ISMIP6OceanForcing.H:62
void readUniformSource(RefCountedPtr< LevelData< FArrayBox > > &a_source, RealVect &a_dx, int a_year, const AmrIceBase &a_amrIce)
Read a field TF(x,y,z) and compute source(x,y)
Definition: ISMIP6OceanForcing.cpp:218
RefCountedPtr< LevelData< FArrayBox > > m_deltaT
Definition: ISMIP6OceanForcing.H:82
abstract base class for amr ice sheet models (AmrIce, AMRIceControl)
Definition: AmrIceBase.H:21
void computeSource(LevelData< FArrayBox > &a_source, LevelData< FArrayBox > &a_TFb, LevelData< FArrayBox > &a_TFb_basin_mean, LevelData< FArrayBox > &a_deltaT, Real a_gamma0)
compute source from thermal forcing
Definition: ISMIP6OceanForcing.cpp:112
ISMIP6OceanForcing(ParmParse &a_pp)
Definition: ISMIP6OceanForcing.cpp:31
void updateUniformSource(Real a_time, const AmrIceBase &a_amrIce)
update the uniform source
Definition: ISMIP6OceanForcing.cpp:361
int m_uniform_source_year
Definition: ISMIP6OceanForcing.H:71
bool m_local
Definition: ISMIP6OceanForcing.H:61
Real m_dz
Definition: ISMIP6OceanForcing.H:74
int m_n_basin
Definition: ISMIP6OceanForcing.H:79
int m_start_year
Definition: ISMIP6OceanForcing.H:57