PISM, A Parallel Ice Sheet Model stable 0.4.1779

src/verif/iceCompModel.hh

Go to the documentation of this file.
00001 // Copyright (C) 2004-2011 Jed Brown, 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 __iceCompModel_hh
00020 #define __iceCompModel_hh
00021 
00022 #include "iceModel.hh"
00023 
00024 class BTU_Verification : public PISMBedThermalUnit
00025 {
00026 public:
00027   BTU_Verification(IceGrid &g, const NCConfigVariable &conf, int test, int bii)
00028     : PISMBedThermalUnit(g, conf) { testname = test; bedrock_is_ice = bii; }
00029   virtual ~BTU_Verification() {}
00030 
00031   virtual PetscErrorCode get_temp(IceModelVec3BTU* &result);
00032 protected:
00033   virtual PetscErrorCode bootstrap();
00034   int testname, bedrock_is_ice;
00035 };
00036 
00037 class IceCompModel : public IceModel {
00038 
00039 public:
00040   IceCompModel(IceGrid &g, NCConfigVariable &config, NCConfigVariable &overrides, int mytest);
00041   virtual ~IceCompModel() {}
00042   
00043   // re-defined steps of init() sequence:
00044   virtual PetscErrorCode set_grid_defaults();     // called by IceModel::grid_setup()
00045   virtual PetscErrorCode setFromOptions();
00046   virtual PetscErrorCode createVecs();
00047   virtual PetscErrorCode allocate_flowlaw();
00048   virtual PetscErrorCode allocate_stressbalance();
00049   virtual PetscErrorCode allocate_bedrock_thermal_unit();
00050   virtual PetscErrorCode allocate_bed_deformation();
00051   virtual PetscErrorCode allocate_enthalpy_converter();
00052   virtual PetscErrorCode set_vars_from_options(); // called by IceModel::model_state_setup()
00053 
00054   PetscErrorCode reportErrors();
00055 
00056 protected:
00057   // related to all (or most) tests
00058   ThermoGlenArrIce *tgaIce;
00059   PetscTruth   exactOnly;
00060   int          testname;
00061   virtual PetscErrorCode additionalAtStartTimestep();
00062   virtual PetscErrorCode additionalAtEndTimestep();
00063   PetscErrorCode computeGeometryErrors(    // all tests except K
00064         PetscScalar &gvolexact, PetscScalar &gareaexact, PetscScalar &gdomeHexact,
00065         PetscScalar &volerr, PetscScalar &areaerr,
00066         PetscScalar &gmaxHerr, PetscScalar &gavHerr, PetscScalar &gmaxetaerr,
00067         PetscScalar &centerHerr);
00068   virtual PetscErrorCode summary(bool tempAndAge);
00069 
00070   // related to tests A B C D E H
00071   PetscErrorCode initTestABCDEH();
00072   PetscErrorCode getCompSourcesTestCDH();  // only for time-dependent compensatory sources
00073   PetscErrorCode fillSolnTestABCDH();  // only used with exactOnly == PETSC_TRUE
00074   
00075   // related to test E
00076   PetscErrorCode fillSolnTestE();  // only used with exactOnly == PETSC_TRUE
00077   PetscErrorCode computeBasalVelocityErrors(    // test E only
00078         PetscScalar &exactmaxspeed,
00079         PetscScalar &gmaxvecerr, PetscScalar &gavvecerr,
00080         PetscScalar &gmaxuberr, PetscScalar &gmaxvberr);
00081 
00082   PetscErrorCode reset_thickness_tests_AE();
00083 
00084   // related to test L
00085   IceModelVec2S   vHexactL;
00086   PetscErrorCode initTestL();
00087   PetscErrorCode fillSolnTestL();  // only used with exactOnly == PETSC_TRUE
00088 
00089   // related to tests F G; see iCMthermo.cc
00090   virtual PetscErrorCode temperatureStep(PetscScalar* vertSacrCount, PetscScalar* bulgeCount);
00091   PetscErrorCode initTestFG();
00092   PetscErrorCode getCompSourcesTestFG();
00093   PetscErrorCode fillSolnTestFG();  // only used with exactOnly == PETSC_TRUE
00094   PetscErrorCode computeTemperatureErrors(      // tests F and G
00095                    PetscScalar &gmaxTerr, PetscScalar &gavTerr);
00096   PetscErrorCode computeBasalTemperatureErrors( // tests F and G
00097                    PetscScalar &gmaxTerr, PetscScalar &gavTerr, PetscScalar &centerTerr);
00098   PetscErrorCode computeSigmaErrors(            // tests F and G
00099                    PetscScalar &gmaxSigmaerr, PetscScalar &gavSigmaerr);
00100   PetscErrorCode computeSurfaceVelocityErrors(  // tests F and G
00101                    PetscScalar &gmaxUerr, PetscScalar &gavUerr,  // 2D vector errors
00102                    PetscScalar &gmaxWerr, PetscScalar &gavWerr); // scalar errors
00103   
00104   IceModelVec3   SigmaComp3;
00105 
00106   // related to tests K and O; see iCMthermo.cc
00107   PetscErrorCode initTestsKO();
00108   PetscErrorCode fillTemperatureSolnTestsKO();  // used in initialzation
00109                                                 //   and with exactOnly == PETSC_TRUE
00110   PetscErrorCode fillBasalMeltRateSolnTestO();  // used only with exactOnly == PETSC_TRUE
00111   PetscErrorCode computeIceBedrockTemperatureErrors( // tests K and O only
00112                    PetscScalar &gmaxTerr, PetscScalar &gavTerr,
00113                    PetscScalar &gmaxTberr, PetscScalar &gavTberr);
00114   PetscErrorCode computeBasalMeltRateErrors( // test O only
00115                    PetscScalar &gmaxbmelterr, PetscScalar &gminbmelterr);
00116 
00117   // using Van der Veen's exact solution to test CFBC and the part-grid code
00118   PetscErrorCode test_V_init();
00119   PetscErrorCode test_V_set_thickness_bc();
00120   IceModelVec2Int bc_mask;
00121   IceModelVec2V bc_vel;
00122 
00123 private:
00124   PetscScalar        f;       // ratio of ice density to bedrock density
00125   PetscTruth         bedrock_is_ice_forK;
00126 
00127   static const PetscScalar ablationRateOutside;
00128 
00129   // see iCMthermo.cc
00130   static const PetscScalar Ggeo;    // J/m^2 s; geothermal heat flux, assumed constant
00131   static const PetscScalar ST;      // K m^-1;  surface temperature gradient: T_s = ST * r + Tmin
00132   static const PetscScalar Tmin;    // K;       minimum temperature (at center)
00133   static const PetscScalar LforFG;  // m;  exact radius of tests F&G ice sheet
00134   static const PetscScalar ApforG;  // m;  magnitude A_p of annular perturbation for test G;
00135   // period t_p is set internally to 2000 years
00136 };
00137 
00138 #endif /* __iceCompModel_hh */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines