MPAS-JEDI
modelsp_utils Namespace Reference

Functions

def getGridFile (date=initDate, gfsAnaDir=GFSANA_DIR, nCells=40962)
 
def readGrid (date=initDate, gridFile=None, returnR=False)
 
def hasVar (varName, ncFile)
 
def varDims (varName, ncFile)
 
def varAttrs (varName, ncFile)
 
def varDatatype (varName, ncFile)
 
def getPressure (ncData)
 
def getTemperature (ncFile)
 
def varRead (varName, ncFile)
 
def varWrite (varName, varVals, ncFile, varAttrs, dims, datatype)
 
def createHeaderOnlyFile (infile, outfile, date)
 
def varDiff (varName, ncFile1, ncFile2)
 
def main ()
 

Variables

string ncWriteFormat = 'NETCDF3_64BIT_OFFSET'
 
 fcHours = os.getenv('fcHours', '0')
 
 intervalHours = os.getenv('intervalHours', '6')
 
 fcNums = os.getenv('fcNums', '1')
 
 initDate = os.getenv('start_init', '2018041500')
 
 endDate = os.getenv('end_init', '2018051400')
 
 diff2exp = os.getenv('diff2exp', 'False')
 
 expDirectory = os.getenv('TOP_DIR','/glade/scratch/$user/pandac/')
 
 GFSANA_DIR = os.getenv('GFSANA_DIR', 'Please link GFSANA_DIR')
 
 expLongNames = os.getenv('expLongNames', 'please set expLongNames')
 
 expNames = os.getenv('expNames','please set expNames')
 
 EXP_DIR1 = os.getenv('FCDIAG_WORK_DIR1','FC1DIAG DIR OR FC2DIAG DIR FOR CONTROL')
 
 EXP_DIR2 = os.getenv('FCDIAG_WORK_DIR2','FC1DIAG DIR OR FC2DIAG DIR FOR CURRENT/target exp')
 
 exp1Name = os.getenv('exp1Name','name for control expt')
 
 exp2Name = os.getenv('exp2Name','name for current/target expt')
 
list aggregatableFileStats = ['RMS','Mean']
 
list allFileStats = aggregatableFileStats
 
string expStats = 'expmgfs'
 
list varNames2d = ['t2m','surface_pressure','q2','u10','v10']
 
list varNames3d = ['theta','temperature','rho','pressure','uReconstructZonal','uReconstructMeridional','qv','w']
 
list varNames = varNames2d + varNames3d
 
list latBands = ['NXTro','Tro','SXTro']
 
list latBandsBounds = [90.0, 30.0, -30.0, -90.0]
 
list inflationVariables
 
dictionary variableTraits
 
dictionary templateVariables
 
int nlevelSurface = 1
 
int nlevels = 55
 
int nlevelsP1 = 56
 
int ncells = 40962
 
int fcRange = int(fcHours)/24.
 
int interval = int(intervalHours)/24
 
 SDATE = datetime.strptime(initDate,'%Y%m%d%H')
 
 EDATE = datetime.strptime(endDate,'%Y%m%d%H')
 
 DATEINC = dt.timedelta(days=interval)
 
 nExp = len(expNames)
 

Function Documentation

◆ createHeaderOnlyFile()

def modelsp_utils.createHeaderOnlyFile (   infile,
  outfile,
  date 
)

Definition at line 279 of file modelsp_utils.py.

◆ getGridFile()

def modelsp_utils.getGridFile (   date = initDate,
  gfsAnaDir = GFSANA_DIR,
  nCells = 40962 
)

Definition at line 162 of file modelsp_utils.py.

Here is the caller graph for this function:

◆ getPressure()

def modelsp_utils.getPressure (   ncData)

Definition at line 206 of file modelsp_utils.py.

Here is the caller graph for this function:

◆ getTemperature()

def modelsp_utils.getTemperature (   ncFile)

Definition at line 212 of file modelsp_utils.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasVar()

def modelsp_utils.hasVar (   varName,
  ncFile 
)

Definition at line 183 of file modelsp_utils.py.

Here is the caller graph for this function:

◆ main()

def modelsp_utils.main ( )

Definition at line 329 of file modelsp_utils.py.

◆ readGrid()

def modelsp_utils.readGrid (   date = initDate,
  gridFile = None,
  returnR = False 
)

Definition at line 170 of file modelsp_utils.py.

Here is the call graph for this function:

◆ varAttrs()

def modelsp_utils.varAttrs (   varName,
  ncFile 
)

Definition at line 194 of file modelsp_utils.py.

◆ varDatatype()

def modelsp_utils.varDatatype (   varName,
  ncFile 
)

Definition at line 200 of file modelsp_utils.py.

◆ varDiff()

def modelsp_utils.varDiff (   varName,
  ncFile1,
  ncFile2 
)

Definition at line 324 of file modelsp_utils.py.

Here is the call graph for this function:

◆ varDims()

def modelsp_utils.varDims (   varName,
  ncFile 
)

Definition at line 188 of file modelsp_utils.py.

◆ varRead()

def modelsp_utils.varRead (   varName,
  ncFile 
)

Definition at line 225 of file modelsp_utils.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ varWrite()

def modelsp_utils.varWrite (   varName,
  varVals,
  ncFile,
  varAttrs,
  dims,
  datatype 
)

Definition at line 244 of file modelsp_utils.py.

Here is the call graph for this function:

Variable Documentation

◆ aggregatableFileStats

list modelsp_utils.aggregatableFileStats = ['RMS','Mean']

Definition at line 29 of file modelsp_utils.py.

◆ allFileStats

list modelsp_utils.allFileStats = aggregatableFileStats

Definition at line 30 of file modelsp_utils.py.

◆ DATEINC

modelsp_utils.DATEINC = dt.timedelta(days=interval)

Definition at line 157 of file modelsp_utils.py.

◆ diff2exp

modelsp_utils.diff2exp = os.getenv('diff2exp', 'False')

Definition at line 17 of file modelsp_utils.py.

◆ EDATE

modelsp_utils.EDATE = datetime.strptime(endDate,'%Y%m%d%H')

Definition at line 155 of file modelsp_utils.py.

◆ endDate

modelsp_utils.endDate = os.getenv('end_init', '2018051400')

Definition at line 16 of file modelsp_utils.py.

◆ exp1Name

modelsp_utils.exp1Name = os.getenv('exp1Name','name for control expt')

Definition at line 26 of file modelsp_utils.py.

◆ exp2Name

modelsp_utils.exp2Name = os.getenv('exp2Name','name for current/target expt')

Definition at line 27 of file modelsp_utils.py.

◆ EXP_DIR1

modelsp_utils.EXP_DIR1 = os.getenv('FCDIAG_WORK_DIR1','FC1DIAG DIR OR FC2DIAG DIR FOR CONTROL')

Definition at line 24 of file modelsp_utils.py.

◆ EXP_DIR2

modelsp_utils.EXP_DIR2 = os.getenv('FCDIAG_WORK_DIR2','FC1DIAG DIR OR FC2DIAG DIR FOR CURRENT/target exp')

Definition at line 25 of file modelsp_utils.py.

◆ expDirectory

modelsp_utils.expDirectory = os.getenv('TOP_DIR','/glade/scratch/$user/pandac/')

Definition at line 18 of file modelsp_utils.py.

◆ expLongNames

modelsp_utils.expLongNames = os.getenv('expLongNames', 'please set expLongNames')

Definition at line 21 of file modelsp_utils.py.

◆ expNames

modelsp_utils.expNames = os.getenv('expNames','please set expNames')

Definition at line 22 of file modelsp_utils.py.

◆ expStats

string modelsp_utils.expStats = 'expmgfs'

Definition at line 31 of file modelsp_utils.py.

◆ fcHours

modelsp_utils.fcHours = os.getenv('fcHours', '0')

Definition at line 12 of file modelsp_utils.py.

◆ fcNums

modelsp_utils.fcNums = os.getenv('fcNums', '1')

Definition at line 14 of file modelsp_utils.py.

◆ fcRange

int modelsp_utils.fcRange = int(fcHours)/24.

Definition at line 152 of file modelsp_utils.py.

◆ GFSANA_DIR

modelsp_utils.GFSANA_DIR = os.getenv('GFSANA_DIR', 'Please link GFSANA_DIR')

Definition at line 20 of file modelsp_utils.py.

◆ inflationVariables

list modelsp_utils.inflationVariables
Initial value:
1 = [
2  'temperature',
3  'uReconstructZonal',
4  'uReconstructMeridional',
5  'spechum',
6  'surface_pressure',
7  'qc',
8  'qi',
9  'qr',
10  'qs',
11  'qg',
12 #non-increment-variables in output stream
13  'qv',
14 ]

Definition at line 38 of file modelsp_utils.py.

◆ initDate

modelsp_utils.initDate = os.getenv('start_init', '2018041500')

Definition at line 15 of file modelsp_utils.py.

◆ interval

int modelsp_utils.interval = int(intervalHours)/24

Definition at line 153 of file modelsp_utils.py.

◆ intervalHours

modelsp_utils.intervalHours = os.getenv('intervalHours', '6')

Definition at line 13 of file modelsp_utils.py.

◆ latBands

list modelsp_utils.latBands = ['NXTro','Tro','SXTro']

Definition at line 35 of file modelsp_utils.py.

◆ latBandsBounds

list modelsp_utils.latBandsBounds = [90.0, 30.0, -30.0, -90.0]

Definition at line 36 of file modelsp_utils.py.

◆ ncells

int modelsp_utils.ncells = 40962

Definition at line 149 of file modelsp_utils.py.

◆ ncWriteFormat

string modelsp_utils.ncWriteFormat = 'NETCDF3_64BIT_OFFSET'

Definition at line 10 of file modelsp_utils.py.

◆ nExp

modelsp_utils.nExp = len(expNames)

Definition at line 160 of file modelsp_utils.py.

◆ nlevels

int modelsp_utils.nlevels = 55

Definition at line 147 of file modelsp_utils.py.

◆ nlevelsP1

int modelsp_utils.nlevelsP1 = 56

Definition at line 148 of file modelsp_utils.py.

◆ nlevelSurface

int modelsp_utils.nlevelSurface = 1

Definition at line 146 of file modelsp_utils.py.

◆ SDATE

modelsp_utils.SDATE = datetime.strptime(initDate,'%Y%m%d%H')

Definition at line 154 of file modelsp_utils.py.

◆ templateVariables

dictionary modelsp_utils.templateVariables
Initial value:
1 = {
2  '1D-c': 'surface_pressure',
3  '2D-c-c': 'theta',
4 # '2D-c-w': 'w',
5 # '2D-e-c': 'u',
6 # '2D-c-s': 'smois',
7 }

Definition at line 137 of file modelsp_utils.py.

◆ variableTraits

dictionary modelsp_utils.variableTraits

Definition at line 54 of file modelsp_utils.py.

◆ varNames

list modelsp_utils.varNames = varNames2d + varNames3d

Definition at line 34 of file modelsp_utils.py.

◆ varNames2d

list modelsp_utils.varNames2d = ['t2m','surface_pressure','q2','u10','v10']

Definition at line 32 of file modelsp_utils.py.

◆ varNames3d

list modelsp_utils.varNames3d = ['theta','temperature','rho','pressure','uReconstructZonal','uReconstructMeridional','qv','w']

Definition at line 33 of file modelsp_utils.py.