| |
- diag_info_cl
- gcfile_desc_cl
- tracer_info_cl
class diag_info_cl |
|
class for infomation of the tracers
included in the GEOS-Chem simulation
Members:
-----------------------------------------------------
1. name:<list, t:str>: short name of tracers
2. fullname:<list, t:str>: full name of tracer
3. tracer:<list/array, t:integer>: id of the tracer
4. scale:<list, t:float>: scaling factor
5. unit: <unit, t:str>: unit of the tracers
6. c: <list, t:integer>: category id of the tracer.
7. molew:<list,t:float>: mass of tracer
Functions:
----------------------------------------------
1. __init__: initialization
2. read_info: decode lines into different fields.
3. get_offset: get the offset for given category
4. load_diag_info: read diag info from file |
|
Methods defined here:
- __init__(self, flnm)
- initialization
Inputs:
------------------------------------
1. flnm :<str>: name of the diaginfo file
- get_offset(self, category)
- get the offset for given category
Inputs:
-----------------------
1. category:<str>: tracer category
Returns:
1. offset:<integer>: offset of the category
- load_diag_info(self, flnm)
- read diag info from file
Inputs:
-------------------------------
1. flnm:<str>: file name
- read_info(self, lines)
- read information from lines in diaginfo file
Inputs:
-------------------------------
1. lines: <list, t:str>: list of lines
--typical line includes: offset, category and comment
|
class gcfile_desc_cl |
|
Members:
====================================
1. flnm:<str>: file name
2, ftracerinfo:<str>: name for tracerinfo file
3. fdiaginfo:<str>: name for diaginfo file
4. categorys:<list, t:str>: list of categorys to be read
5. tracers:<list,t:int>: list of tracers to be read
6. taus:<list, t:float>: list of taus to be read
7. tranames:<list, t:str>:list of tracer name
8. fio_keywords: <dict>: extra inputs for file IO
9. attr_dict:<dict>: attributes
10. mask_val:<float>: fillings for bad or missing values
11. data_lst:<list>: list of list of model data or profiles read from bpch2 file
12. ref_lst:<list, t:int>:list of the references.
13. flnm_lst:<list, t:str>: list of the file names.
14. tracerinfo_flnm_lst:<list, t:str>: list of the tracerinfo file names.
15. diaginfo_flnm_lst:<list, t:str>: list of the diaginfo file names.
16. cur_flnm: <str>: current filename
17. cur_tracerinfo_flnm: <str>: current tracer info file
18. cur_diaginfo_flnm:<str>: current diag info file
19. cur_ref:<current ref>: current reference number
Functions:
=================================================
1. __init__: initialization
2. append_data: add the data set to lists of the class
3. del_data: Remove data from the list
4. set_file_path: set path for data file
5. set_filename_format: set template for filename
6. set_tracerinfo_file_path: set path for tracerinfo file
7. set_tracerinfo_filename_format: set template for tracerinfo filename
8. set_diaginfo_file_path:set path for diaginfo file
9. set_diaginfo_filename_format:set template for diaginfo filename
10. construct_filename: construction file name using keywords
11. construct_diaginfo_filename: construction name for diag info file using keywords
12. set_attr: assign one attribute
13. get_attr: get one attribute
14. read_file: Read file from GEOS-Chem runs
15. read_file_to_profile_list:Read outputs from GEOS-Chem runs to list of profiles (ctm_profile_cl)
# ensemble runs
16. construct_enr_filename_dict: Form dictionary (extensions) to construct name for ensemble runs
17. read_enr_file: Read file from ensemble runs to a list of fields (gc_field_3d)
18. read_enr_file_to_profile_list:Read outputs from ensemble run to list of profiles (ctm_profile_cl)
19. get_data: find the data meeting criteria on traname, category and tracer id etc
# pressure grid
20. compute_mod_pres: compute from read surface pressure
or directly fetch read model pressure |
|
Methods defined here:
- __init__(self, flnm, ftracerinfo, fdiaginfo, yyyy, mm, dd, is_enr_file=False, categorys=None, tracers=None, taus=None, tranames=None, mask_val=-999.0, fio_keywords={}, **keywords)
- initialization
Inputs:
--------------------------------------------------------------
1. flnm:<str>: file name
2, ftracerinfo:<str>: name for tracerinfo file
3. fdiaginfo:<str>: name for diaginfo file
4. categorys:<list, t:str>: list of categorys to be read
5. tracers:<list,t:int>: list of tracers to be read
6. taus:<list, t:float>: list of taus to be read
7. tranames:<list, t:str>:list of tracer name
8. mask_val:<float>: values for bad or missing data
9. fio_keywors: <dict>: extra inputs for file IO
10. keywords:<dict>: attributes
- append_data(self, flnm, tracerinfo_flnm, diaginfo_flnm, data_lst, ref)
- add the data set to lists of the class
Inputs:
-------------------------------------------
1. flnm: <str>: file name
2. tracerinfo_flnm: <str>: name for tracerinfo file
3. diaginfo_flnm: <str>: name for diaginfo file
4. data: <array>: raw data read from the file
5. ref:<str/numeric>: id (such as time etc) for the data set
- compute_mod_pres(self, traname='PSURF', use_sp=True, geos_ver=5, use_reduced=1, **keywords)
- compute or fetch pressure at model level centres
Inputs:
-------------------------------------
1. traname:<str>: traname for pressure or sp
2. use_sp:<T/F>: True, surface pressure will be used to calculate pressures
3. geos_ver:<int>: GEOS-Chem version
4. use_reduced:<int>: 1 means reduced model vertical grid is used
keywords:
=========================================
---Reserved keys:
---category:<str>: category of the surface pressure or pressure
---tracer:<int>: tracer ID of surface pressure or model pressure
---tau:<float>: time of surface pressure or model pressure
Returns:
----------------------------------
1. mod_res: <array,(nx, [ny], [lx])>: pressure at model level or surface pressure (see Notes 1)
Notes:
-----------------------------------------------------------
1. when use_sp is set to False, the return will be the surface pressure
- construct_diaginfo_filename(self, **keywords)
- construction name for diag info file using keywords
Inputs:
----------------------------
1. keywords:<dict>: dictionary for file format and path
---expected Keynames:
--->1. diaginfo_flnmformat:<str>: file format
--->2. diaginfo_filepath:<str>: file path
--->3. words used to replace dummies in file format.
Returns
---------------------------------------
1. sflnm:<str>: file name
- construct_enr_filename_dict(self, yyyy, dd, mm, enr_yyyy, enr_doy, enr_step, enr_em_st, enr_em_end)
- Form dictionary (extensions) to construct name for ensemble runs
Input:
============================================
1. enr_yyyy:<int>: year for ensemble run start
2. enr_doy:<int>: doy for ensemble run start
3. enr_step:<int>: step for ensemble run
4. enr_em_st:<int>: firt one in the ensemble
5. enr_em_end:<int>: last one in the ensemble
6. yyyy, dd, mm:<int>: output time
Notes:
1. the default extension will be like:
STXENRSTEPX.ENXEMSTX-XEMEND.XYYYYXXMMXXDDX
for example:
ST001.EN0001-EN0048.2009.01.01
stands for
step=1
ensemble member of 0001-0049
yyyyy=2009, mm=1, dd=1
- construct_filename(self, **keywords)
- construction file name using keywords
Inputs:
----------------------------
1. keywords:<dict>: dictionary for file format and path
---expected Keynames:
--->1. flnmformat:<str>: file format
--->2. filepath:<str>: file path
--->3. words used to replace dummies in file format.
Returns
---------------------------------------
1. sflnm:<str>: file name
- construct_tracerinfo_filename(self, **keywords)
- construction name for tracer info file use the keyword
Inputs:
----------------------------
1. keywords:<dict>: dictionary for file format and path
---expected Keynames:
--->1. tracerinfo_flnmformat:<str>: file format
--->2. tracerfo_filepath:<str>: file path
--->3. words used to replace dummies in file format.
Returns
---------------------------------------
1. sflnm:<str>: file name
- del_data(self, idx, by_ref=False)
- Remove data from the list
Inputs:
-----------------------------------------------------
1.idx :<int/obj>: index of the data set to be deleted
2. by_ref:<T/F>: if ture , index will be treated as ref
---values for looking up ref_lst
Returns:
---------------------------------------------------
self.nset:<int>: the length of the current data lst
- get_attr(self, attr_name)
- get one attribute
Inputs:
------------------------------------------------
1. name:<str>: attribute name
Returns:
-----------------------------------------------
1. val: <obj>: attribute value
- get_data(self, traname=None, category=None, tracer=None)
- select the data from data_lst
Inputs:
=======================================
1. traname:<list, t:str>: tracer name
2. category:<list, t:str>: category
3. tracerID:<list, t:int>: tracer ID
Returns:
==========================================
1. traname_lst:<list, t:str>: trace name
2. category_lst:<list, t:str>: category
3. tid_lst:<list, t:int>: tracer ID
4. sid_lst:<list, t:int>: Index of the data in the list
5. found_data_lst:<list, t:class bpdata or profile>:
- read_enr_file(self, yyyy, mm, dd, enr_yst_lst, enr_dst_lst, enr_step_lst, enr_em_st_lst, enr_em_end_lst, **keywords)
- Read outputs from ensemble runs to list of ctm_data_cl
Input:
============================================================
1. yyyy, mm, dd:<int>: year month day
2. enr_yyyy_lst:<int>: year for ensemble run start.
3. enr_doy_lst:<int>: doy for ensemble run start.
4. enr_step_lst:<int>: step for ensemble run.
5. enr_em_st_st:<int>: firt one in the ensemble.
6. enr_em_end_lst:<int>: last one in the ensemble.
7. keywords:<dict>: extra inputs:
Returns:
==========================================================
1. self.nset:<int>: number of data set.
- read_enr_file_profile_list(self, yyyy, mm, dd, olon, olat, enr_yst_lst, enr_dst_lst, enr_step_lst, enr_em_st_lst, enr_em_end_lst, **keywords)
- Read outputs from ensemble runs to list of ctm_profile_cl
Input:
============================================================
1. yyyy, mm, dd:<int>: year month day
2. olon:<array>: longitude
3. olat:<array>:latitude
4. enr_yyyy_lst:<int>: year for ensemble run start.
5. enr_doy_lst:<int>: doy for ensemble run start.
6. enr_step_lst:<int>: step for ensemble run.
7. enr_em_st_st:<int>: firt one in the ensemble.
8. enr_em_end_lst:<int>: last one in the ensemble.
9. keywords:<dict>: extra inputs:
Returns:
==========================================================
1. self.nset:<int>: number of data set.
- read_file(self, yyyy, mm, dd, ext='', **keywords)
- Read outputs from GEOS-Chem runs to a list of 3D fields
Input:
============================================================
1. yyyy, mm, dd:<int>: year month day
2. ent:<str>: string for file extension
3. keywords:<dict>: extra inputs:
Returns:
==========================================================
1. bp_lst:<list, t:gc_field_3d>: list of data sets.
- read_file_to_profile_list(self, yyyy, mm, dd, olon, olat, ext='', **keywords)
- Read outputs from forecast runs to a list of ctm_profile_cl
Input:
============================================================
1. yyyy, mm, dd:<int>: year month day
2. olon:<array>: longitude
3. olat:<array>:latitude
4. ext:<str>: file extension
5. keywords:<dict>: extra inputs:
Returns:
==========================================================
1. bp_lst:<list, t:prof_lst>: list of found profiles.
- set_attr(self, attr_name, value)
- assign one attribute
Inputs:
-------------------------------------------------------
1. attr_name: <str>: attribute name
2. value: <obj>:attribute value
- set_diaginfo_file_path(self, path)
- set path for diaginfo file
Inputs:
-----------------------------------
1. path:<str>: path for tracerinfo file
- set_diaginfo_filename_format(self, flnm_format)
- set template for diaginfo filename
Inputs:
-----------------------------------
1. flnm_format:<str>: format for diaginfo file name
- set_file_path(self, path)
- set path for data file
Inputs:
-----------------------------------
1. path:<str>: path for file
- set_filename_format(self, flnm_format)
- set template for filename
Inputs:
-----------------------------------
1. flnm_format:<str>: format for file name
- set_tracerinfo_file_path(self, path)
- set path for tracerinfo file
Inputs:
-----------------------------------
1. path:<str>: path for tracerinfo file
- set_tracerinfo_filename_format(self, flnm_format)
- set template for tracerinfo filename
Inputs:
-----------------------------------
1. flnm_format:<str>: format for tracerinfo file name
|
class tracer_info_cl |
|
class for infomation of the tracers
included in the GEOS-Chem simulation
Members:
-----------------------------------------------------
1. name:<list, t:str>: short name of tracers
2. fullname:<list, t:str>: full name of tracer
3. tracer:<list/array, t:integer>: id of the tracer
4. scale:<list, t:float>: scaling factor
5. unit: <unit, t:str>: unit of the tracers
6. c: <list, t:integer>: category id of the tracer.
7. molew:<list,t:float>: mass of tracer
Functions:
----------------------------------------------
1. __init__: initialization
2. read_info: decode lines into different fields
3. get_tracer_info:check information of the tracer
4. load_tracer_info(self, flnm): Read tracer infor from file |
|
Methods defined here:
- __init__(self, flnm)
- get_tracer_info(self, tracer_in)
- check information of the tracer
Inputs:
----------------------------------------
1. tracer_in:<integer>: (real) tracer id
Returns:
------------------------------------
1. name:<str>: name of the tracer
2. fullname:<str>: full name of the tracer
3. molew: <float>: molecular mass
4. scale: <float>: scaling factor
5. unit: <str>: unit
Notes:
----------------------------
1. If tracer_in is not found in self.tracer, returns will be filled with "???" or with oob.fill_val
- load_tracer_info(self, flnm)
- Read tracer infor from file
Inputs:
---------------------------------------
1. flnm:<str>: file name for tracer info
- read_info(self, lines)
- decode lines in tracer info file into different fields
Inputs:
----------------------------------------------
1. lines:<list, str>: lines in tracerinfo file
--- a typical line include
name, fullname, molecular mass, scaling factor, tracer_id, unit, category id
| |