| |
- add_enr_desc_data(fdesc, ref, **keywords)
- add table for ensemble configurations to data_lst in fdesc
Inputs:
=====================================
1. fdesc:<grdfile_io_cl>: class for file access
2. ref:<str/numeric>: reference for data sets read from file
3. keywords:<dict>: extra parameters
Returns:
=====================================
1. idx:<int>: index of the data set with reference =ref.
- close_enr_desc_file(fdesc)
- Close fdesc file
Inputs:
--------------------------------------------------
1. fdesc:<file_desc_cl>: class for file access
Returns:
---------------------------------------------
1. None
- close_new_enr_desc_file(fl)
- close file
Inputs;
---------------------------------
1. fl:<file>: file handle
- get_enr_desc_file_ref(yyyy, mm, dd, **keywords)
- check file reference
for enremble configuration. By default
the reference number is year
Inputs:
----------------------------------------------------
1. yyyy:<array, (ntime,)>: year
2. mm: <array, (ntime,)>: month
3. dd:<array, (ntime,)>: dd
4. keywords:<dict>: extra information
Returns:
------------------------------------------------------
1. ref:<int>: reference number
--- by default, the reference number is year
- get_enr_desc_table(fdesc, oyyyy, omm, odd, **keywords)
- read run description data table at a given point (such year)
Inputs:
---------------------------------------
1. fdesc:<grdfile_io_cl>: file access
2. oyyyy:<int>: year
3. omm: <int>: month
4. odd:<int>: day (for future use)
6. keywords:<dict>: extra inputs
---Reserved Entries
Returns:
================================================
1. fdesc.data_lst:<list, t:recarray>:class for runs covering given date
- open_enr_desc_file(flnm, datapath, yyyy, mm, dd, **fio_keywords)
- construct fdesc to read ensemble run configurations data
Inputs:
==============================================
1. flnm:<str>: format for filename
2. datapath:<str>: file path
3. yyyy:<array, (ntime,)>: year
4. mm: <array, (ntime,)>: month
5. dd:<array, (ntime,)>: dd
6. fio_keywords:<dict>: extra inputs
---Reserved keywords:
--->fl_colnm_lst: <list>: list of all column names in the file
--->sel_colnm_lst: <list>: list of the names for column to be read
--->colnm_dict:<dict>: dictionary for translating column names
--->delim: <str>: separator.
--->data_start:<int>: starting line number of the data section
--->header_start:<int>: line number of header section
Returns:
=============================================
1. fdesc:<file_desc_cl>: class for file access
- open_enr_desc_file_write(flnm)
- open a new file
Inputs:
-----------------------------------------------
1. flnm:<str>: file name
Returns:
-----------------------------------------------
1. fl:<file>: file handle
- open_enr_desc_write(flnm, datapath, yyyy, mm, dd, **fio_keywords)
- read_enr_desc_file(fdesc, **fio_keywords)
- Read ensemble configurations as table into fdesc.data_lst
Inputs:
--------------------------------------------------
1. fdesc:<file_desc_cl>: class for file access
2. fio_keywords:<dict>: extra inputs for file read write
---Reserved words:
--->fl_colnm_lst: list of all column names in the file
--->sel_colnm_lst: list of the names for column to be read
--->colnm_dict:<dict>: dictionary for translating column names
Returns:
-------------------------------------
1. ndata:<int>: length of fdesc.dtable
Notes:
-------------------------------------
1. data will be stored as recarray by fdesc.dtable
- write_enr_desc_colum_heads(fl, colnm_lst=['step', 'mem_st', 'mem_end', 'year_st', 'year_end', 'doy_st', 'doy_end', 'flnm', 'output_name', 'index_method'], max_nmlen=20)
- write out the column names
Inputs:
-----------------------------------------------------------
1. fl:<file>: handle to file
2. colnm_lst:<list, t:str>: list of column names
3. max_nmlen:<int>: maximum length of column name
Returns:
----------------------------------
1. fl:<file>: file object
- write_enr_desc_colum_val(fl, col_vals, coltype_lst=['i4', 'i4', 'i4', 'i4', 'i4', 'i4', 'i4', 'S40', 'S40', 'i4'])
- write out the column values
Inputs:
--------------------------------------------------------
1. fl:<file>: handle to run description file
2. col_vals:<list/array>: value of each column
Returns:
-----------------------------------------------------------
1. fl:<file>: file handle
|