Skip to content

Commit

Permalink
add new formula (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
chengzhuzhang authored Sep 12, 2023
1 parent ad51b8b commit 4b610c6
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
34 changes: 34 additions & 0 deletions e3sm_to_cmip/cmor_handlers/_formulas.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,40 @@ def rsuscs(data: Dict[str, np.ndarray], index: int) -> np.ndarray:
return outdata


def rsut(data: Dict[str, np.ndarray], index: int) -> np.ndarray:
"""
rsut = SOLIN - FSNTOA
pre v3 version:
rsut = FSUTOA
"""
try:
outdata = (
data["SOLIN"][index, :] - data["FSNTOA"][index, :]
)
except KeyError:
outdata = data["FSUTOA"][index, :]

return outdata


def rsutcs(data: Dict[str, np.ndarray], index: int) -> np.ndarray:
"""
rsutcs = SOLIN - FSNTOAC
pre v3 version:
rsutcs = FSUTOAC
"""
try:
outdata = (
data["SOLIN"][index, :] - data["FSNTOAC"][index, :]
)
except KeyError:
outdata = data["FSUTOAC"][index, :]

return outdata


def rtmt(data: Dict[str, np.ndarray], index: int) -> np.ndarray:
"""
rtmt = FSNT - FLNT
Expand Down
16 changes: 16 additions & 0 deletions e3sm_to_cmip/cmor_handlers/handlers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,14 @@
formula: FSDSC - FSNSC
positive: up
levels: null
- name: rsut
units: W m-2
raw_variables: [SOLIN, FSNTOA]
table: CMIP6_Amon.json
unit_conversion: null
formula: SOLIN - FSNTOA
positive: up
levels: null
- name: rsut
units: W m-2
raw_variables: [FSUTOA]
Expand All @@ -585,6 +593,14 @@
formula: null
positive: up
levels: null
- name: rsutcs
units: W m-2
raw_variables: [SOLIN, FSNTOAC]
table: CMIP6_Amon.json
unit_conversion: null
formula: SOLIN - FSNTOAC
positive: up
levels: null
- name: rsutcs
units: W m-2
raw_variables: [FSUTOAC]
Expand Down

0 comments on commit 4b610c6

Please sign in to comment.