Skip to content

Commit

Permalink
Add ch4 surface custom cmor table entry (#2168)
Browse files Browse the repository at this point in the history
Co-authored-by: Rémi Kazeroni <[email protected]>
  • Loading branch information
hb326 and Rémi Kazeroni authored Aug 10, 2023
1 parent ca5e001 commit 437a972
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
22 changes: 22 additions & 0 deletions esmvalcore/cmor/tables/custom/CMOR_ch4s.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
SOURCE: CMIP5
!============
variable_entry: ch4s
!============
modeling_realm: atmos
!----------------------------------
! Variable attributes:
!----------------------------------
standard_name: mole_fraction_of_methane_in_air
units: 1e-09
cell_methods: area: time: mean
cell_measures: area: areacella
long_name: Atmosphere CH4 surface
comment: As ch4, but only at the surface
!----------------------------------
! Additional variable information:
!----------------------------------
dimensions: longitude latitude time
out_name: ch4s
type: real
!----------------------------------
!
9 changes: 9 additions & 0 deletions tests/integration/cmor/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,3 +476,12 @@ def test_get_variable_tasaga(self):
self.assertEqual(var.long_name,
'Global-mean Near-Surface Air Temperature Anomaly')
self.assertEqual(var.units, 'K')

def test_get_variable_ch4s(self):
"""Get tas variable."""
CustomInfo()
var = self.variables_info.get_variable('Amon', 'ch4s')
self.assertEqual(var.short_name, 'ch4s')
self.assertEqual(var.long_name,
'Atmosphere CH4 surface')
self.assertEqual(var.units, '1e-09')

0 comments on commit 437a972

Please sign in to comment.