#include <iMtests.hh>

Public Member Functions | |
| IceUnitModel (IceGrid &g, NCConfigVariable &config, NCConfigVariable &overrides) | |
| PetscErrorCode | set_grid_defaults () |
| Set grid defaults for a particular unit test. | |
| PetscErrorCode | set_vars_from_options () |
| Initialize variables for a particular unit test. | |
| PetscErrorCode | run () |
| Run an unit test. | |
| PetscErrorCode | writeFiles (const char *filename) |
| Write output files. | |
| PetscErrorCode | createVecs () |
| Allocate all IceModelVecs defined in IceModel. | |
| PetscErrorCode | model_state_setup () |
| Sets the starting values of model state variables. | |
| PetscErrorCode | test_IceModelVec3 () |
| PetscErrorCode | test_IceModelVec3Bedrock () |
| PetscErrorCode | test_IceModelVec2T () |
| PetscErrorCode | test_IceModelVec2V () |
| PetscErrorCode | test_dof1comm () |
| PetscErrorCode | test_dof2comm () |
Definition at line 25 of file iMtests.hh.
| IceUnitModel | ( | IceGrid & | g, | |
| NCConfigVariable & | config, | |||
| NCConfigVariable & | overrides | |||
| ) |
Definition at line 27 of file iMtests.hh.
| PetscErrorCode createVecs | ( | ) | [virtual] |
Allocate all IceModelVecs defined in IceModel.
This procedure allocates the memory used to store model state, diagnostic and work vectors and sets metadata.
Default values should not be set here; please use set_vars_from_options().
All the memory allocated here is freed by IceModelVecs' destructors.
Reimplemented from IceModel.
Definition at line 53 of file iMtests.cc.
References PISMVars.add(), IceModelVec2S.create(), IceModel.grid, PISMOptionsIsSet(), IceModelVec.set_attr(), IceModelVec.set_attrs(), IceModel.variables, and IceModel.vH.
| PetscErrorCode model_state_setup | ( | ) | [virtual] |
Sets the starting values of model state variables.
There are two cases:
1) Initializing from a PISM output file.
2) Setting the values using command-line options only (verification and simplified geometry runs, for example) or from a bootstrapping file, using heuristics to fill in missing and 3D fields.
Calls IceModel.regrid().
This function is called after all the memory allocation is done and all the physical parameters are set.
Calling this method should be all one needs to set model state variables. Please avoid modifying them in other parts of the initialization sequence.
Also, please avoid operations that would make it unsafe to call this more than once (memory allocation is one example).
Reimplemented from IceModel.
Definition at line 38 of file iMtests.cc.
References PISMOptionsIsSet().
| PetscErrorCode run | ( | ) | [virtual] |
Run an unit test.
Reimplemented from IceModel.
Definition at line 75 of file iMtests.cc.
References PISMOptionsIsSet(), test_dof1comm(), test_dof2comm(), test_IceModelVec2T(), test_IceModelVec2V(), test_IceModelVec3(), and test_IceModelVec3Bedrock().
Referenced by main().
| PetscErrorCode set_grid_defaults | ( | ) | [virtual] |
Set grid defaults for a particular unit test.
Reimplemented from IceModel.
Definition at line 26 of file iMtests.cc.
References IceModel.grid, IceGrid.Lbz, IceGrid.Mbz, IceGrid.Mx, and IceGrid.My.
| PetscErrorCode set_vars_from_options | ( | ) | [virtual] |
Initialize variables for a particular unit test.
Reimplemented from IceModel.
Definition at line 34 of file iMtests.cc.
| PetscErrorCode test_dof1comm | ( | ) |
Definition at line 449 of file iMtests.cc.
References IceModelVec.beginGhostComm(), BlastCache(), IceModelVec2S.create(), IceModelVec.end_access(), IceModelVec.endGhostComm(), IceModelVec2S.get_array(), IceModel.grid, IceModelVec.set(), IceGrid.xm, IceGrid.xs, IceGrid.ym, and IceGrid.ys.
Referenced by run().
| PetscErrorCode test_dof2comm | ( | ) |
Definition at line 490 of file iMtests.cc.
References IceModelVec.begin_access(), IceModelVec.beginGhostComm(), BlastCache(), IceModelVec2V.create(), IceModelVec.end_access(), IceModelVec.endGhostComm(), IceModel.grid, IceModelVec.v, IceGrid.xm, IceGrid.xs, IceGrid.ym, and IceGrid.ys.
Referenced by run().
| PetscErrorCode test_IceModelVec2T | ( | ) |
Definition at line 247 of file iMtests.cc.
References NCTool.append_time(), IceModelVec2T.average(), IceModelVec2T.begin_access(), NCTool.close(), IceGrid.com, IceModel.config, IceModelVec2T.create(), IceModel.dt, IceModelVec2T.end_access(), pism_config_editor.filename, NCConfigVariable.get(), IceModel.global_attributes, IceModel.grid, IceModelVec2T.init(), IceModelVec2T.interp(), IceModel.mapping, IceModelVec2T.max_timestep(), vfnow.N, vnreport.nc, PISMIO.open_for_writing(), IceModelVec.set(), IceModelVec.set_attrs(), IceModelVec2T.set_n_records(), check_stationarity.t, IceModelVec2T.update(), IceModel.vH, IceModelVec.write(), NCGlobalAttributes.write(), NCConfigVariable.write(), IceGrid.xs, and IceGrid.ys.
Referenced by run().
| PetscErrorCode test_IceModelVec2V | ( | ) |
Definition at line 347 of file iMtests.cc.
References NCTool.append_time(), IceModelVec.begin_access(), NCTool.close(), IceModelVec2V.create(), IceModelVec.end_access(), pism_config_editor.filename, IceModelVec2V.get_component(), IceModel.global_attributes, IceModel.grid, IceModelVec2V.magnitude(), IceModel.mapping, vnreport.nc, PISMIO.open_for_writing(), IceModelVec2V.read(), secpera, IceModelVec.set(), IceModelVec.set_attrs(), IceModelVec.set_glaciological_units(), IceModelVec.set_name(), IceModelVec.v, IceModelVec2.view(), IceModel.vWork2d, IceModelVec.write(), IceModelVec2V.write(), NCGlobalAttributes.write(), NCConfigVariable.write(), IceModelVec.write_in_glaciological_units, IceGrid.xm, IceGrid.xs, IceGrid.ym, and IceGrid.ys.
Referenced by run().
| PetscErrorCode test_IceModelVec3 | ( | ) |
Definition at line 125 of file iMtests.cc.
References IceModelVec.begin_access(), IceModelVec.beginGhostComm(), IceGrid.com, IceModelVec.end_access(), IceModelVec.endGhostComm(), IceModelVec3.getValColumnPL(), IceModelVec3.getValColumnQUAD(), IceModelVec3.getValZ(), IceModel.grid, IceGrid.Mz_fine, IceModelVec.set(), IceModelVec3.setValColumnPL(), IceModel.T3, verbPrintf(), IceGrid.xs, IceGrid.ys, and IceGrid.zlevels_fine.
Referenced by run().
| PetscErrorCode test_IceModelVec3Bedrock | ( | ) |
Definition at line 189 of file iMtests.cc.
References IceModelVec.begin_access(), IceGrid.com, IceModelVec.end_access(), IceModelVec3Bedrock.getInternalColumn(), IceModelVec3Bedrock.getValColumnPL(), IceModel.grid, IceGrid.Mbz, IceGrid.Mbz_fine, IceModelVec3Bedrock.setColumn(), IceModelVec3Bedrock.setValColumnPL(), IceModel.Tb3, verbPrintf(), IceGrid.xs, IceGrid.ys, IceGrid.zblevels, and IceGrid.zblevels_fine.
Referenced by run().
| PetscErrorCode writeFiles | ( | const char * | filename | ) | [virtual] |
Write output files.
Reimplemented from IceModel.
Definition at line 114 of file iMtests.cc.
Referenced by main().
1.6.2-20100124