pism

[fork] customized build of PISM, the parallel ice sheet model (tillflux branch)
git clone git://src.adamsgaard.dk/pism # fast
git clone https://src.adamsgaard.dk/pism.git # slow
Log | Files | Refs | README | LICENSE Back to index

OceanModel.hh (2932B)


      1 // Copyright (C) 2008-2011, 2013, 2014, 2015, 2016, 2017, 2018 Ed Bueler, Constantine Khroulev, Ricarda Winkelmann,
      2 // Gudfinna Adalgeirsdottir and Andy Aschwanden
      3 //
      4 // This file is part of PISM.
      5 //
      6 // PISM is free software; you can redistribute it and/or modify it under the
      7 // terms of the GNU General Public License as published by the Free Software
      8 // Foundation; either version 3 of the License, or (at your option) any later
      9 // version.
     10 //
     11 // PISM is distributed in the hope that it will be useful, but WITHOUT ANY
     12 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     13 // FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
     14 // details.
     15 //
     16 // You should have received a copy of the GNU General Public License
     17 // along with PISM; if not, write to the Free Software
     18 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     19 
     20 #ifndef __PISMOceanModel_hh
     21 #define __PISMOceanModel_hh
     22 
     23 #include <memory>
     24 
     25 #include "pism/util/Component.hh"
     26 
     27 namespace pism {
     28 
     29 class IceModelVec2S;
     30 class Geometry;
     31 
     32 //! @brief Ocean models and modifiers: provide sea level elevation,
     33 //! melange back pressure, shelf base mass flux and shelf base
     34 //! temperature.
     35 namespace ocean {
     36 //! A very rudimentary PISM ocean model.
     37 class OceanModel : public Component {
     38 public:
     39   // "modifier" constructor
     40   OceanModel(IceGrid::ConstPtr g, std::shared_ptr<OceanModel> input);
     41   // "model" constructor
     42   OceanModel(IceGrid::ConstPtr g);
     43 
     44   virtual ~OceanModel();
     45 
     46   void init(const Geometry &geometry);
     47 
     48   void update(const Geometry &geometry, double t, double dt);
     49 
     50   const IceModelVec2S& shelf_base_temperature() const;
     51   const IceModelVec2S& shelf_base_mass_flux() const;
     52   const IceModelVec2S& melange_back_pressure_fraction() const;
     53 
     54 protected:
     55   virtual void init_impl(const Geometry &geometry);
     56   // provides default (pass-through) implementations for "modifiers"
     57   virtual void update_impl(const Geometry &geometry, double t, double dt);
     58   virtual MaxTimestep max_timestep_impl(double t) const;
     59   virtual void define_model_state_impl(const File &output) const;
     60   virtual void write_model_state_impl(const File &output) const;
     61 
     62   virtual DiagnosticList diagnostics_impl() const;
     63   virtual TSDiagnosticList ts_diagnostics_impl() const;
     64 
     65   virtual const IceModelVec2S& shelf_base_temperature_impl() const;
     66   virtual const IceModelVec2S& shelf_base_mass_flux_impl() const;
     67   virtual const IceModelVec2S& melange_back_pressure_fraction_impl() const;
     68 
     69 protected:
     70   std::shared_ptr<OceanModel> m_input_model;
     71   IceModelVec2S::Ptr m_melange_back_pressure_fraction;
     72 
     73   static IceModelVec2S::Ptr allocate_shelf_base_temperature(IceGrid::ConstPtr g);
     74   static IceModelVec2S::Ptr allocate_shelf_base_mass_flux(IceGrid::ConstPtr g);
     75   static IceModelVec2S::Ptr allocate_melange_back_pressure(IceGrid::ConstPtr g);
     76 };
     77 
     78 } // end of namespace ocean
     79 } // end of namespace pism
     80 
     81 #endif  // __PISMOceanModel_hh