Skip to content

Commit

Permalink
Convert H2OLNZ units to ppm by volume (#874)
Browse files Browse the repository at this point in the history
* convert units

* adjust contour levels

* update for model for model
  • Loading branch information
chengzhuzhang authored Oct 25, 2024
1 parent 7b05425 commit 4cda0a8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,21 @@ seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "1
contour_levels = [0.5,1,2,5,10,15,20,25,30,40,50,70]
diff_levels = [-15,-10,-5,-2,-1,-0.5, 0.5, 1,2,5,10,15]

[#]
sets = ["zonal_mean_2d_stratosphere"]
case_id = "model_vs_model"
variables = ["H2OLNZ"]
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
contour_levels = [0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,7,8]
diff_levels = [-4, -3, -2, -1, -0.5,-0.1, 0.1,0.5, 1,2,3,4]

[#]
sets = ["zonal_mean_2d_stratosphere"]
case_id = "model_vs_model"
variables = ["Q"]
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
contour_levels = [0.6,0.8, 1, 1.2, 1.6, 2, 2.5, 3, 3.5, 4]
diff_levels = [-3, -2,-1.5,-1,-0.5,-0.1,0.1,0.5,1,1.5,2,3]
contour_levels = [0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,7,8]
diff_levels = [-4, -3, -2, -1, -0.5,-0.1, 0.1,0.5, 1,2,3,4]

[#]
sets = ["zonal_mean_2d_stratosphere"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ variables = ["Q"]
ref_name = "MERRA2"
reference_name = "MERRA2 Reanalysis"
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
contour_levels = [0.6,0.8, 1, 1.2, 1.6, 2, 2.5, 3, 3.5, 4]
diff_levels = [-3, -2,-1.5,-1,-0.5,-0.1,0.1,0.5,1,1.5,2,3]
contour_levels = [0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,7,8]
diff_levels = [-4, -3, -2, -1, -0.5,-0.1, 0.1,0.5, 1,2,3,4]

[#]
sets = ["zonal_mean_2d_stratosphere"]
Expand All @@ -47,8 +47,8 @@ variables = ["H2OLNZ"]
ref_name = "MERRA2"
reference_name = "MERRA2 Reanalysis"
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
contour_levels = [0.001, 0.0015, 0.002,0.0025,0.003,0.0035,0.004,0.0045,0.005]
diff_levels = [-0.001, -0.00075, -0.00050, -0.00025, -0.00005,0.00005,0.00025, 0.0005,0.00075,0.001]
contour_levels = [0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,7,8]
diff_levels = [-4, -3, -2, -1, -0.5,-0.1, 0.1,0.5, 1,2,3,4]

[#]
sets = ["zonal_mean_2d_stratosphere"]
Expand All @@ -59,7 +59,7 @@ reference_name = "MERRA2 Reanalysis"
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
diff_type = "relative"
diff_title = "(Model - Obs.)/Obs. * 100"
contour_levels = [0.6,0.8, 1, 1.2, 1.6, 2, 2.5, 3, 3.5, 4]
contour_levels = [0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,7,8]
diff_levels = [-100, -75, -50, -30, -15, -5, 5, 15, 30, 50, 75, 100]

[#]
Expand All @@ -71,7 +71,7 @@ reference_name = "MERRA2 Reanalysis"
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
diff_type = "relative"
diff_title = "(Model - Obs.)/Obs. * 100"
contour_levels = [0.001, 0.0015, 0.002,0.0025,0.003,0.0035,0.004,0.0045,0.005]
contour_levels = [0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,7,8]
diff_levels = [-100, -75, -50, -30, -15, -5, 5, 15, 30, 50, 75, 100]

[#]
Expand Down Expand Up @@ -137,8 +137,8 @@ variables = ["Q"]
ref_name = "ERA5"
reference_name = "ERA5 Reanalysis"
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
contour_levels = [0.6,0.8, 1, 1.2, 1.6, 2, 2.5, 3, 3.5, 4]
diff_levels = [-3, -2,-1.5,-1,-0.5,-0.1,0.1,0.5,1,1.5,2,3]
contour_levels = [0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,7,8]
diff_levels = [-4, -3, -2, -1, -0.5,-0.1, 0.1,0.5, 1,2,3,4]

[#]
sets = ["zonal_mean_2d_stratosphere"]
Expand All @@ -147,8 +147,8 @@ variables = ["H2OLNZ"]
ref_name = "ERA5"
reference_name = "ERA5 Reanalysis"
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
contour_levels = [0.001, 0.0015, 0.002,0.0025,0.003,0.0035,0.004,0.0045,0.005]
diff_levels = [-0.001, -0.00075, -0.00050, -0.00025, -0.00005,0.00005,0.00025, 0.0005,0.00075,0.001]
contour_levels = [0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,7,8]
diff_levels = [-4, -3, -2, -1, -0.5,-0.1, 0.1,0.5, 1,2,3,4]

[#]
sets = ["zonal_mean_2d_stratosphere"]
Expand All @@ -159,7 +159,7 @@ reference_name = "ERA5 Reanalysis"
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
diff_type = "relative"
diff_title = "(Model - Obs.)/Obs. * 100"
contour_levels = [0.6,0.8, 1, 1.2, 1.6, 2, 2.5, 3, 3.5, 4]
contour_levels = [0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,7,8]
diff_levels = [-100, -75, -50, -30, -15, -5, 5, 15, 30, 50, 75, 100]

[#]
Expand All @@ -171,5 +171,5 @@ reference_name = "ERA5 Reanalysis"
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
diff_type = "relative"
diff_title = "(Model - Obs.)/Obs. * 100"
contour_levels = [0.001, 0.0015, 0.002,0.0025,0.003,0.0035,0.004,0.0045,0.005]
contour_levels = [0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,7,8]
diff_levels = [-100, -75, -50, -30, -15, -5, 5, 15, 30, 50, 75, 100]
18 changes: 8 additions & 10 deletions e3sm_diags/driver/zonal_mean_2d_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,14 @@ def run_diag(

# Note this is a special case to handle small values of stratosphere specific humidity.
# The general derived variable process converts specific humidity to units [g/kg]
# Following converts from g/kg to ppm

if (
parameter.current_set == "zonal_mean_2d_stratosphere"
and parameter.var_id == "Q"
):
mv1_p = mv1_p * 1000.0
mv1_p.units = "ppm"
mv2_p = mv2_p * 1000.0
mv2_p.units = "ppm"
# Following converts from g/kg to ppm by volume.

if parameter.current_set == "zonal_mean_2d_stratosphere":
if parameter.var_id == "Q" or parameter.var_id == "H2OLNZ":
mv1_p = mv1_p * 28.97 / 18.0 * 1000.0
mv1_p.units = "ppmv"
mv2_p = mv2_p * 28.97 / 18.0 * 1000.0
mv2_p.units = "ppmv"
# Regrid towards the lower resolution of the two
# variables for calculating the difference.
mv1_p_reg, mv2_p_reg = utils.general.regrid_to_lower_res(
Expand Down

0 comments on commit 4cda0a8

Please sign in to comment.