PISM, A Parallel Ice Sheet Model stable 0.4.1779

src/base/stressbalance/ShallowStressBalance.cc

Go to the documentation of this file.
00001 // Copyright (C) 2010 Constantine Khroulev and Ed Bueler
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 #include "ShallowStressBalance.hh"
00020 
00022 PetscErrorCode ShallowStressBalance::allocate() {
00023   PetscErrorCode ierr;
00024 
00025   ierr = velocity.create(grid, "bar", true); CHKERRQ(ierr); // components ubar, vbar
00026   ierr = velocity.set_attrs("model_state",
00027                             "thickness-advective ice velocity (x-component)", 
00028                             "m s-1", "", 0); CHKERRQ(ierr);
00029   ierr = velocity.set_attrs("model_state",
00030                             "thickness-advective ice velocity (y-component)",
00031                             "m s-1", "", 1); CHKERRQ(ierr);
00032   ierr = velocity.set_glaciological_units("m year-1"); CHKERRQ(ierr);
00033   velocity.write_in_glaciological_units = true;
00034 
00035   ierr = basal_frictional_heating.create(grid, "bfrict", false); CHKERRQ(ierr);
00036   ierr = basal_frictional_heating.set_attrs("diagnostic",
00037                                             "basal frictional heating",
00038                                             "W m-2", ""); CHKERRQ(ierr);
00039   ierr = basal_frictional_heating.set_glaciological_units("mW m-2"); CHKERRQ(ierr);
00040   basal_frictional_heating.write_in_glaciological_units = true;
00041 
00042   ierr = D2.create(grid, "D2", true); CHKERRQ(ierr);
00043   ierr = D2.set_attrs("internal",
00044                       "(partial) square of the Frobenius norm of D_{ij}, the combined strain rates",
00045                       "", ""); CHKERRQ(ierr);
00046 
00047   return 0;
00048 }
00049 
00051 PetscErrorCode SSB_Trivial::update(bool fast) {
00052   PetscErrorCode ierr;
00053   if (fast) return 0;
00054 
00055   ierr = velocity.set(0.0); CHKERRQ(ierr);
00056 
00057   max_u = max_v = 0.0;
00058 
00059   ierr = basal_frictional_heating.set(0.0); CHKERRQ(ierr);
00060 
00061   ierr = D2.set(0.0); CHKERRQ(ierr);
00062   
00063   return 0;
00064 }
00065 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines