Skip to content

Commit

Permalink
Allow NCL unit conversion kg s-1 -> GtC y-1 (#3300)
Browse files Browse the repository at this point in the history
  • Loading branch information
schlunma authored Jul 31, 2023
1 parent dcb2f04 commit f3ad0a0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
9 changes: 9 additions & 0 deletions esmvaltool/diag_scripts/shared/scaling.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,15 @@ begin
end if
end if

if (units_from.eq."kg.s-1") then
if (any(units_to.eq.(/"PgC y-1", "GtC y-1"/))) then
out = out * 3600. * 24. * 365 / 1.e12
out@units = units_to
leave_msg(scriptname, funcname)
return(out)
end if
end if

if (units_from.eq."kg m-2 s-1") then
if (any(units_to.eq.(/"PgC y-1", "GtC y-1"/))) then
out = out * 3600. * 24. * 365 / 1.e12
Expand Down
16 changes: 8 additions & 8 deletions esmvaltool/recipes/recipe_wenzel14jgr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ preprocessors:
area_type: land
exclude: [
'GCP2018',
]
]

sea_fraction_weighting:
weighting_landsea_fraction:
area_type: sea
exclude: [
'GCP2018', 'HadGEM2-ES', 'CanESM2', 'IPSL-CM5A-LR', 'GFDL-ESM2M', 'MPI-ESM-LR', 'CESM1-BGC', 'NorESM1-ME',
]
]
regrid:
target_grid: CanESM2
scheme: area_weighted
Expand All @@ -43,30 +43,30 @@ preprocessors:
area_type: land
exclude: [
'GCP2018', 'HadGEM2-ES', 'CanESM2', 'IPSL-CM5A-LR', 'GFDL-ESM2M', 'MPI-ESM-LR', 'CESM1-BGC', 'NorESM1-ME',
]
]
area_statistics:
operator: sum
operator: sum

tropical_land:
weighting_landsea_fraction:
area_type: land
exclude: [
'GCP2018', 'HadGEM2-ES', 'CanESM2', 'IPSL-CM5A-LR', 'GFDL-ESM2M', 'MPI-ESM-LR', 'CESM1-BGC', 'NorESM1-ME',
]
]
extract_region:
start_longitude: 0.
end_longitude: 360.
start_latitude: -30.
end_latitude: 30.
area_statistics:
operator: sum
operator: sum

global_ocean:
weighting_landsea_fraction:
area_type: sea
exclude: [
'GCP2018', 'HadGEM2-ES', 'CanESM2', 'IPSL-CM5A-LR', 'GFDL-ESM2M', 'MPI-ESM-LR', 'CESM1-BGC', 'NorESM1-ME',
]
]
area_statistics:
operator: sum

Expand All @@ -77,7 +77,7 @@ preprocessors:
start_latitude: -30.
end_latitude: 30.
area_statistics:
operator: mean
operator: mean


diagnostics:
Expand Down

0 comments on commit f3ad0a0

Please sign in to comment.