This class is for running the DSSAT model.
Args:
rnmode (str): running mode fileb (str): batchfile filectl (str): control file filex (str): experiment file fileio (str): I/O trnarg (str): treatment argument Returns: Output file Summary.OUT
This function is used to run the DSSAT model by calling the Wrapped fortran code
Returns: Output file Summary.OUT
This class is for input files writing and preparing for model running. It contains experiment file and batch file writing.
Args:
crop (str): crop type soil (str): soil type weather (str): weather station name st_yr (int): start year of simulation ed_yr (int): end year of simulation plant_month (int): month of the planting date plant_date (int): date of the planting date mode (str): running mode
This function is used to write the batch file.
Returns: Input batch file. e.g., run.v45
This function is used to write the experiment file.
Returns: Input experiment file. e.g., DTCM1951.GSX
This class is for post-process DSSAT output.
Note
You should first import this class before calling any functions.
This function is used to convert the text file to NetCDF.
Args:
dims (dic): header information for netcdf file inFileName (str): File name for the text file outFileName (str): File name for the NetCDF file
Note
You should define the header information for the NetCDF file in your driver program like this:
>>> dims = {}
>>> dims['nlat'] = 1
>>> dims['nlon'] = 1
>>> dims['res'] = 1
>>> dims['minlat'] = 10
>>> dims['minlon'] = 10
>>> dims['tStep'] = 1
This function is used to draw the time series.
Args:
fileName (str): The simulaton file to use varName (str): Variable to plot
>>> drawTimeSeries('Summary.OUT','HWAM')
This function is used to get variable’s label and description from the .CDE file.
Returns:
sumOutCDEDic (dictionary): Variables in DSSAT summary output
>>> sumOutDic = getVarDes()
This function is used to extract the data for each variables.
Args:
filename (str): The simulaton file to use
Returns:
dataDic (dic): Dictionary associated with each variable sYear (int): start year eYear (int): end year
BTW, you can MODIFY the return value based on your own purpose. To use this function, just do like this:
>>> [out,sYear,eYear] = getVarValues('Summary.OUT')