PISM, A Parallel Ice Sheet Model stable 0.4.1779

src/base/energy/bedrockThermalUnit.hh

Go to the documentation of this file.
00001 // Copyright (C) 2011 Ed Bueler and Constantine Khroulev
00002 //
00003 // This file is part of PISM.
00004 //
00005 // PISM is free software; you can redistribute it and/or modify it under the
00006 // terms of the GNU General Public License as published by the Free Software
00007 // Foundation; either version 2 of the License, or (at your option) any later
00008 // version.
00009 //
00010 // PISM is distributed in the hope that it will be useful, but WITHOUT ANY
00011 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00012 // FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00013 // details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with PISM; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018 
00019 #ifndef _PISMBEDTHERMALUNIT_H_
00020 #define _PISMBEDTHERMALUNIT_H_
00021 
00022 #include "PISMComponent.hh"
00023 #include "iceModelVec.hh"
00024 #include "PISMVars.hh"
00025 #include "basal_resistance.hh"
00026 
00028 class IceModelVec3BTU : public IceModelVec3D {
00029 public:
00030   IceModelVec3BTU() { Lbz = -1.0; }
00031   virtual ~IceModelVec3BTU() {}
00032 
00033   virtual PetscErrorCode create(IceGrid &mygrid, const char my_short_name[], bool local,
00034                                 int myMbz, PetscReal myLbz, int stencil_width = 1);
00035                                 
00036   virtual PetscErrorCode get_layer_depth(PetscReal &depth); 
00037   virtual PetscErrorCode get_spacing(PetscReal &dzb);
00038 private:
00039   PetscReal Lbz;
00040   bool good_init();
00041 };
00042 
00043 
00045 
00101 class PISMBedThermalUnit : public PISMComponent_TS {
00102 
00103 public:
00104   PISMBedThermalUnit(IceGrid &g, const NCConfigVariable &conf);
00105 
00106   virtual ~PISMBedThermalUnit() { }
00107 
00108   virtual PetscErrorCode init(PISMVars &vars);
00109 
00110   virtual void add_vars_to_output(string keyword, set<string> &result);
00111   virtual PetscErrorCode define_variables(set<string> vars, const NCTool &nc, nc_type nctype);  
00112   virtual PetscErrorCode write_variables(set<string> vars, string filename);
00113 
00114   virtual PetscErrorCode max_timestep(PetscReal /*t_years*/, PetscReal &dt_years);
00115 
00116   virtual PetscErrorCode update(PetscReal t_years, PetscReal dt_years);
00117 
00118   virtual PetscErrorCode get_upward_geothermal_flux(IceModelVec2S &result);
00119 protected:
00120   virtual PetscErrorCode allocate(int Mbz, double Lbz);
00121 
00122   virtual PetscErrorCode bootstrap();
00123   virtual PetscErrorCode regrid();
00124 
00125   IceModelVec3BTU  temp;     
00126 
00127 
00128 
00129   // parameters of the heat equation:  T_t = D T_xx  where D = k / (rho c)
00130   PetscScalar    bed_rho, bed_c, bed_k, bed_D;
00131   
00132   PetscInt Mbz;
00133   PetscReal Lbz;
00134 
00135   IceModelVec2S *bedtoptemp, 
00136                 *ghf; 
00137 };
00138 
00139 #endif /* _PISMBEDTHERMALUNIT_H_ */
00140 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines