ticeCompModel.hh - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch)
 (HTM) git clone git://src.adamsgaard.dk/pism
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
       ticeCompModel.hh (3869B)
       ---
            1 // Copyright (C) 2004-2017 Jed Brown, Ed Bueler and Constantine Khroulev
            2 //
            3 // This file is part of PISM.
            4 //
            5 // PISM is free software; you can redistribute it and/or modify it under the
            6 // terms of the GNU General Public License as published by the Free Software
            7 // Foundation; either version 3 of the License, or (at your option) any later
            8 // version.
            9 //
           10 // PISM is distributed in the hope that it will be useful, but WITHOUT ANY
           11 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
           12 // FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
           13 // details.
           14 //
           15 // You should have received a copy of the GNU General Public License
           16 // along with PISM; if not, write to the Free Software
           17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
           18 
           19 #ifndef __iceCompModel_hh
           20 #define __iceCompModel_hh
           21 
           22 #include "pism/icemodel/IceModel.hh"
           23 #include "pism/energy/BedThermalUnit.hh"
           24 
           25 namespace pism {
           26 
           27 class IceCompModel : public IceModel {
           28 
           29 public:
           30   IceCompModel(IceGrid::Ptr g, Context::Ptr ctx, int mytest);
           31   virtual ~IceCompModel() {}
           32   
           33   // re-defined steps of init() sequence:
           34   virtual void allocate_storage();
           35   virtual void allocate_bedrock_thermal_unit();
           36   virtual void allocate_bed_deformation();
           37   virtual void allocate_couplers();
           38   virtual void allocate_energy_model();
           39 
           40   // NB! not virtual
           41   void bootstrap_2d(const File &input_file) __attribute__((noreturn));
           42 
           43   virtual void initialize_2d();
           44 
           45   void reportErrors();
           46 
           47 protected:
           48   // related to all (or most) tests
           49   int m_testname;
           50 
           51   virtual void post_step_hook();
           52   // all tests except K
           53   void computeGeometryErrors(double &gvolexact, double &gareaexact, double &gdomeHexact,
           54                                        double &volerr, double &areaerr,
           55                                        double &gmaxHerr, double &gavHerr, double &gmaxetaerr,
           56                                        double &centerHerr);
           57   virtual void print_summary(bool tempAndAge);
           58 
           59   // related to tests A B C D H
           60   void initTestABCDH();
           61 
           62   void reset_thickness_test_A();
           63 
           64   // related to test L
           65   IceModelVec2S m_HexactL;
           66   void initTestL();
           67 
           68   // related to tests F G; see iCMthermo.cc
           69   virtual void energy_step();
           70   void initTestFG();
           71   void getCompSourcesTestFG();
           72 
           73   // tests F and G
           74   void computeTemperatureErrors(double &gmaxTerr, double &gavTerr);
           75   // tests F and G
           76   void computeBasalTemperatureErrors(double &gmaxTerr, double &gavTerr, double &centerTerr);
           77   // tests F and G
           78   void compute_strain_heating_errors(double &gmax_strain_heating_err, double &gav_strain_heating_err);
           79 
           80   // tests F and G
           81   void computeSurfaceVelocityErrors(double &gmaxUerr, double &gavUerr,  // 2D vector errors
           82                                               double &gmaxWerr, double &gavWerr); // scalar errors
           83   
           84   IceModelVec3 m_strain_heating3_comp;
           85 
           86   // related to tests K and O; see iCMthermo.cc
           87   void initTestsKO();
           88 
           89  // tests K and O only
           90   void computeIceBedrockTemperatureErrors(double &gmaxTerr, double &gavTerr,
           91                                                     double &gmaxTberr, double &gavTberr);
           92   // test O only
           93   void computeBasalMeltRateErrors(double &gmaxbmelterr, double &gminbmelterr);
           94 
           95   // using Van der Veen's exact solution to test CFBC and the part-grid code
           96   void test_V_init();
           97 
           98 private:
           99   double m_f;       // ratio of ice density to bedrock density
          100   bool m_bedrock_is_ice_forK;
          101 
          102   // see iCMthermo.cc
          103   static const double m_ST;      // K m^-1;  surface temperature gradient: T_s = ST * r + Tmin
          104   static const double m_Tmin;    // K;       minimum temperature (at center)
          105   static const double m_LforFG;  // m;  exact radius of tests F&G ice sheet
          106   static const double m_ApforG;  // m;  magnitude A_p of annular perturbation for test G;
          107   // period t_p is set internally to 2000 years
          108 };
          109 
          110 } // end of namespace pism
          111 
          112 #endif /* __iceCompModel_hh */