Skip to content

Commit

Permalink
Merge branch 'master' into arm_diags_v4
Browse files Browse the repository at this point in the history
  • Loading branch information
chengzhuzhang authored Sep 30, 2024
2 parents f0ca23e + f6c0475 commit d60f026
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 14 deletions.
36 changes: 26 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,27 @@ Important Links
===============

- Official source code repository: https://github.com/ARM-DOE/arm-gcm-diagnostics
- ARM webpage: http://www.arm.gov/data/eval/123 (Click Data Directory for data)
- ARM webpage: https://www.arm.gov/data/data-sources/adcme-123 (Click Data Directory for data)


References
======
Zhang, C., S. Xie, C. Tao, S. Tang, T. Emmenegger, J. D. Neelin, K. A. Schiro, W. Lin, and Z. Shaheen. "The ARM Data-oriented Metrics and Diagnostics Package for Climate Models-A New Tool for Evaluating Climate Models with Field Data." Bulletin of the American Meteorological Society (2020).
Overview of the ARM-Diags:

Zhang, C., S. Xie, S. A. Klein, H.-Y. Ma, S. Tang, K. V. Weverberg, C. Morcrette, and J. Petch (2018), CAUSES: Diagnosis of the summertime warm bias in CMIP5 climate models at the ARM Southern Great Plains site, Journal of Geophysical Research: Atmospheres, 123(6), doi:10.1002/2017JD027200.
- Zhang, C., S. Xie, C. Tao, S. Tang, T. Emmenegger, J. D. Neelin, K. A. Schiro, W. Lin, and Z. Shaheen. "The ARM Data-oriented Metrics and Diagnostics Package for Climate Models-A New Tool for Evaluating Climate Models with Field Data." Bulletin of the American Meteorological Society (2020).

- Technical report, 2024: "ARM Data-Oriented Metrics and DiagnosticsPackage (ARM-Diags) for Climate Model Evaluation" https://portal.nersc.gov/project/capt/ARMVAP/ARM_DIAG_v4.pdf

- Presentation at ARM/ASR meeting 2020: "ARM Data-Oriented Diagnostics to Evaluate the Climate Model Simulation" https://asr.science.energy.gov/meetings/stm/presentations/2020/976.pdf

- Presentation at ARM/ASR meeting 2023: "Overview of ARM diagnostic package (ARM-Diags) and its applications to climate model evaluation" https://asr.science.energy.gov/meetings/stm/presentations/2023/1576.pdf

Applications of the ARM-Diags:

- Zhang, C., S. Xie, S. A. Klein, H.-Y. Ma, S. Tang, K. V. Weverberg, C. Morcrette, and J. Petch (2018), CAUSES: Diagnosis of the summertime warm bias in CMIP5 climate models at the ARM Southern Great Plains site, Journal of Geophysical Research: Atmospheres, 123(6), doi:10.1002/2017JD027200.
- Emmenegger, T., Y. Kuo, S. Xie, C. Zhang, C. Tao, and J. D. Neelin, 2022: Evaluating Tropical Precipitation Relations in CMIP6 Models with ARM Data. J. Climate, 35, 6343–6360, https://doi.org/10.1175/JCLI-D-21-0386.1.
- Zheng, X., C. Tao, C. Zhang, S. Xie, Y. Zhang, B. Xi, and X. Dong, 2023: Assessment of CMIP5 and CMIP6 AMIP Simulated Clouds and Surface Shortwave Radiation Using ARM Observations over Different Climate Regions. J. Climate, 36, 8475–8495, https://doi.org/10.1175/JCLI-D-23-0247.1.
- Emmenegger, T., F. Ahmed, Y. Kuo, S. Xie, C. Zhang, C. Tao, and J. D. Neelin, 2024: The Physics behind Precipitation Onset Bias in CMIP6 Models: The Pseudo-Entrainment Diagnostic and Trade-Offs between Lapse Rate and Humidity. J. Climate, 37, 2013–2033, https://doi.org/10.1175/JCLI-D-23-0227.1.

Install
=======
Expand All @@ -27,7 +40,7 @@ The data files including observation and CMIP5 model data are available through

For downloading data:

- Click https://www.arm.gov/data/eval/123
- Click https://www.arm.gov/data/data-sources/adcme-123
- Following the Data Directory link on that page, it will lead to the area that the data files are placed. A short registration is required if you do not already have an ARM account.
- DOI for the citation of the data is 10.5439/1646838

Expand Down Expand Up @@ -75,16 +88,19 @@ For Linux::

Examples
=============
In this release, the package provides 6 sets of diagnostics including:
In this release, the following sets of diagnostics are included:

- Tables summarizing DJF, MAM, JJA, SON and Annual Mean climatology using monthly output
- Line plots and Taylor diagrams diagnosing annual cycle using monthly output
- Contour and vertical profiles of annual cycle for quantities with vertical distribution (i.e., cloud fraction)
- Line plots of diurnal cycle for quantities without vertical distribution (i.e., precipitation)
- Contour plots of diurnal cycle for quantities with vertical distribution
- Line plots of Probability Density Functions using daily output

For now, the diagnostics focus over SGP site. And in a later release we will include data and diagnostics for more ARM site.
- Line and harmonic dial plots of the diurnal cycle of precipitation
- Line plots of Probability Density Functions (PDF) using daily output
- Line plots of the diurnal cycle for quantities relevant to the land-atmosphere coupling (e.g.,sensible and latent heat flux, PBL)
- Convection onset metrics showing the statistical relationship between precipitation rate and column water vapor
- Aerosol-CCN activation metrics describing the percentage distribution of how many aerosols can be activated as CCN under different supersaturation levels
- Two-legged metrics evaluating the strength of L-A coupling by partitioning the impact of the land states on surface fluxes (the land leg) and from the impact of surface fluxes on the atmospheric states (the atmospheric leg)

Clike `here <https://portal.nersc.gov/project/capt/ARMVAP/arm_diag_v4_example.html>`_ for an example of the ARM-Diags v4. Please refer to the `technical report <https://github.com/UV-CDAT/uvcdat/wiki/install>`_ for more details.

Set-up new case
=================
Expand Down
1 change: 1 addition & 0 deletions arm_diags/basicparameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
test_data_set = 'testmodel'
#specify the data starting/ending years in the testmodel file
#default is 1979 - 2006 as in the CMIP file

#NCAR: 2013, 2014
#GFDL: 1980, 2000
test_start_year = 1979
Expand Down
2 changes: 2 additions & 0 deletions arm_diags/src/annual_cycle_zt.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,10 @@ def annual_cycle_zt_plot(parameter):
if test_findex == 1:
ct_up=np.nanmax([cl_ob,cl_p])
tmpct=cl_p[:,::-1]-cl_ob[:,::-1]

ct_lo_diff=int(np.nanmin(tmpct)-1)
ct_up_diff=int(np.nanmax(tmpct)+1)

rlevel=np.arange(ct_lo,ct_up+1,0.5) #original
drlevel=np.arange(ct_lo_diff,ct_up_diff,0.5) #difference
#----------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions arm_diags/src/create_htmls.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,10 @@ def annual_cycle_aci_html(parameter):
htmlfile.write('<TR><TH ALIGN=LEFT>'+var_longname[j])
two_figs='annual_cycle_'+variable+'_2plots_{}.html'.format(title_name)
htmlfile1 = open(output_path+'/html/'+two_figs,"w")

fig1='../figures/{}/'.format(title_name)+'aerosol_annual_cycle_'+variable+'_{}.png'.format(title_name)
fig2='../figures/{}/'.format(title_name)+'aerosol_annual_cycle_'+variable+'_taylor_diagram_{}.png'.format(title_name)

htmlfile1.write('<div class="container"><div style="float:left"><img src='+fig1+' alt="Line" width="600" height="450"></div><div style="float:left"><img src='+fig2+' alt="Line" width="500" height="450"></div>')
htmlfile.write('<TH ALIGN=LEFT><A HREF='+two_figs+'>Line plot and Taylor Diagram.</a>')
htmlfile.write('<tr><td><br/></td></tr>')
Expand Down Expand Up @@ -279,13 +281,15 @@ def annual_cycle_zt_html(parameter):
fig_obs='../figures/{}/'.format(title_name)+variable+'_annual_cycle_clim_obs_{}.png'.format(title_name)
fig_mod='../figures/{}/'.format(title_name)+variable+'_annual_cycle_clim_mod_{}.png'.format(title_name)
fig_diff='../figures/{}/'.format(title_name)+variable+'_annual_cycle_clim_the_diff_{}.png'.format(title_name)

htmlfile.write('<TH ALIGN=LEFT><A HREF='+fig_mod+'> Model </a>')
htmlfile.write('<A HREF='+fig_obs+'> Obs.</a>')
htmlfile.write('<A HREF='+fig_diff+'> Model-Obs.</a>')
#htmlfile.write('<TH><BR>')

for si in range(len(seasons)):
fig='../figures/{}/'.format(title_name)+variable+'_zdiff_'+seasons[si]+'_{}.png'.format(title_name)

if seasons[si]=='ANN':
htmlfile.write('<TH ALIGN=LEFT><A HREF='+fig+'> '+seasons[si]+'</a>')
else:
Expand Down Expand Up @@ -367,6 +371,7 @@ def diurnal_cycle_zt_html(parameter):
fig_mod='../figures/{}/'.format(title_name)+variable+'_diurnal_clim_mod_{}.png'.format(title_name)
fig_obs_mon='../figures/{}/'.format(title_name)+variable+'_mon_diurnal_clim_obs_{}.png'.format(title_name)
fig_mod_mon='../figures/{}/'.format(title_name)+variable+'_mon_diurnal_clim_mod_{}.png'.format(title_name)

htmlfile.write('<TH ALIGN=LEFT><A HREF='+fig_mod_mon+'> Model </a>')
htmlfile.write('<A HREF='+fig_obs_mon+'> Obs.</a>')
htmlfile.write('<TH ALIGN=LEFT><A HREF='+fig_mod+'> Model </a>')
Expand Down Expand Up @@ -474,6 +479,7 @@ def aerosol_activation_html(parameter):
fig1='../figures/{}/'.format(title_name)+'aerosol_activation_bulk_cpc_ccn05_obs_{}.png'.format(title_name)
fig2='../figures/{}/'.format(title_name)+'aerosol_activation_bulk_cpc_ccn05_testmodel_{}.png'.format(title_name)
htmlfile_05.write('<div class="container"><div style="float:left"><img src='+fig1+' alt="Line" width="720" height="600"></div><div style="float:left"><img src='+fig2+' alt="No inputs for models" width="720" height="600"></div>')

#
htmlfile.write('<TD><A HREF='+two_figs_02+'>'+'At 0.2% SS'+'</a></TD>')
htmlfile.write('<TD><A HREF='+two_figs_05+'>'+'At 0.5% SS'+'</a></TD>')
Expand Down
8 changes: 4 additions & 4 deletions arm_diags/src/diurnal_cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def diurnal_cycle_data(parameter):
test_model = ''.join(e for e in test_model if e.isalnum()).lower()
print(test_path,test_model,sites[0][:3]+test_model+'*hr' + sites[0][3:5].upper())
test_file = glob.glob(os.path.join(test_path,sites[0][:3]+test_model+'*hr' + sites[0][3:5].upper()+'*.nc' ))
print('test_file: ',test_file)


if len(test_file) == 0:
print('No diurnal data for test model were found: '+sites[0])
Expand All @@ -123,7 +123,7 @@ def diurnal_cycle_data(parameter):

#initialize the indicator for temporal res of testmodel
test_tres = test_file[0].split(test_model)[-1][:3] #e.g., '3hr', '1hr'
print('test_tres: ',test_tres)


fin = cdms2.open(test_file[0])
if test_tres == '1hr': test_tidlen=24
Expand All @@ -144,7 +144,7 @@ def diurnal_cycle_data(parameter):
print((variable+" "+season+" not processed for " + test_model))
print('!!please check the start and end year in basicparameter.py')
test_findex = 0

# Calculate for observational data
obs_var_season=np.empty([len(variables),24,len(seasons)])*np.nan
#obs_file = glob.glob(os.path.join(obs_path,'*ARMdiag_domain_diurnal*.nc')) #read in diurnal test data
Expand Down Expand Up @@ -228,7 +228,7 @@ def diurnal_cycle_data(parameter):
os.makedirs(os.path.join(output_path,'metrics',sites[0]))
for j, variable in enumerate(variables):
for k, season in enumerate(seasons):
print('===Check: ',test_findex)

if test_findex == 1: np.savetxt(output_path+'/metrics/'+sites[0]+'/'+variable+'_'+season+'_test_diurnal_cycle_'+test_tres+'_'+sites[0]+'.csv',test_var_season[j,:,k])
np.savetxt(output_path+'/metrics/'+sites[0]+'/'+variable+'_'+season+'_mmm_diurnal_cycle_'+sites[0]+'.csv',mmm_var_season[j,:,k])
np.savetxt(output_path+'/metrics/'+sites[0]+'/'+variable+'_'+season+'_cmip_diurnal_cycle_'+sites[0]+'.csv',cmip_var_season[:,j,:,k])
Expand Down

0 comments on commit d60f026

Please sign in to comment.