mitgcm
Analysis of MITgcm output using python
Public Member Functions | Public Attributes | List of all members
mitgcm.core.MITgcm_Simulation Class Reference

The simulation class is the main class of this package, and an instance of this class is a model object. More...

Inheritance diagram for mitgcm.core.MITgcm_Simulation:
Inheritance graph
[legend]

Public Member Functions

def __init__
 Instantiate an MITgcm model instance. More...
 
def load_field
 Load a model field from NetCDF output. More...
 
def load_from_file (self, model_instance, file_list, variable, time_level, grid_loc, single_file)
 Internal function to pull the data from the file(s). More...
 
def __add__ (self, other)
 A method that allows model objects to be added together. More...
 
def __div__ (self, other)
 A method that allows model objects to be divided by floating point numbers. More...
 
def __mul__ (self, other)
 A method that allows model objects to be multiplied by floating point numbers. More...
 
def __rmul__ (self, other)
 A method that allows model objects to be multiplied by floating point numbers. More...
 

Public Attributes

 grid
 

Detailed Description

The simulation class is the main class of this package, and an instance of this class is a model object.

All fields are associated with the model object - either directly (it is a dict), or indirectly through one of its subobjects (which are also dicts).

Definition at line 20 of file core.py.

Constructor & Destructor Documentation

def mitgcm.core.MITgcm_Simulation.__init__ (   self,
  output_dir,
  grid_netcdf_filename,
  EOS_type = 'linear',
  g = 9.81,
  ntiles_x = 1,
  ntiles_y = 1,
  grid_type = 'cartesian' 
)

Instantiate an MITgcm model instance.


Parameters

  • output_dir - the location in which the grid netcdf file is, and the rest of the data can be found
  • grid_netcdf_filename - name of the grid file
  • EOS_type - the equation of state used. 'linear' is the only supported equation of state at the moment
  • g - gravity
  • ntiles_x - number of tiles in the x direction (nPx in MITgcm speak)
  • ntiles_y - number of tiles in the y direction (nPy in MITgcm speak)
  • grid_type - cartesian or polar. Fancy grids like cubed sphere aren't supported at the moment.

Definition at line 25 of file core.py.

Member Function Documentation

def mitgcm.core.MITgcm_Simulation.__add__ (   self,
  other 
)

A method that allows model objects to be added together.

It does element wise addition for each of the fields.

Definition at line 170 of file core.py.

def mitgcm.core.MITgcm_Simulation.__div__ (   self,
  other 
)

A method that allows model objects to be divided by floating point numbers.

Each field is divided by a floating point number.

Definition at line 179 of file core.py.

def mitgcm.core.MITgcm_Simulation.__mul__ (   self,
  other 
)

A method that allows model objects to be multiplied by floating point numbers.

Each field is multiplied by a floating point number.

Definition at line 186 of file core.py.

def mitgcm.core.MITgcm_Simulation.__rmul__ (   self,
  other 
)

A method that allows model objects to be multiplied by floating point numbers.

Each field is multiplied by a floating point number.

Definition at line 193 of file core.py.

def mitgcm.core.MITgcm_Simulation.load_field (   self,
  model_instance,
  netcdf_filename,
  variable,
  time_level = -1,
  field_name = None,
  grid_loc = 'T',
  single_file = False 
)

Load a model field from NetCDF output.

This function associates the field with the object it is called on.

time_level can be an integer or an array of integers. If it's an array, then multiple time levels will be returned as a higher dimensional array.

netcdf_filename can be a string with shell wildcards - they'll be expanded and all of the files loaded. BUT, this is intended as a way to take a quick look at the model. I would strongly recommend using something like "gluemncbig" to join the multiple tiles into one file before doing proper analysis.

Definition at line 56 of file core.py.

def mitgcm.core.MITgcm_Simulation.load_from_file (   self,
  model_instance,
  file_list,
  variable,
  time_level,
  grid_loc,
  single_file 
)

Internal function to pull the data from the file(s).

It is called by "load_field", and probably shouldn't be used independently.

Definition at line 71 of file core.py.

Member Data Documentation

mitgcm.core.MITgcm_Simulation.grid

Definition at line 43 of file core.py.


The documentation for this class was generated from the following file: