-
Notifications
You must be signed in to change notification settings - Fork 16
Enable EAMxx CMORization, E3SM Diags and add ts-level vertical regrid #827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 15 commits
8bb3d21
4f4d0ba
f6e1be7
649ed57
03c21ba
db6ea55
fdb843a
e3b7774
bd75af9
f61b71a
06658d7
285c8f7
eeb2f0f
ab6a1de
08cb58e
e6e18ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,190 @@ | ||
| # Example: EAMxx → CMIP and e3sm_diags, initially contributed by Shixuan Zhang. | ||
| # Reproduces the cfg from issue #820 plus e3sm_diags-related tasks. | ||
| # (https://github.com/E3SM-Project/zppy/issues/820) | ||
| # | ||
| # Demonstrates: | ||
| # - EAMxx CMORization end-to-end (issue #817) | ||
| # - The fix to the fragile component-detection gate (now uses prc_typ), | ||
| # so input_component="eamxx" with input_files="AVERAGE.nmonths_x1" works | ||
| # - EAMxx-specific ncremap flags (--ps_nm=${file}/ps, --vrt_in=vert_L128.nc) | ||
| # auto-emitted when prc_typ == 'eamxx' | ||
| # - climo, ts, e3sm_to_cmip, and e3sm_diags wiring for an EAMxx run | ||
| # | ||
| # Run with: zppy -c examples/post.v3.eamxx.cfg | ||
| [default] | ||
| input = /pscratch/sd/z/zhan391/e3smv4_project/ne256pg2_ne256pg2.F20TR-SCREAMv1.July-1.spanc800.2xauto.acc150.n0032.test2.1 | ||
| output = /pscratch/sd/c/chengzhu/tests/ne256pg2_ne256pg2.F20TR-SCREAMv1.July-1.spanc800.2xauto.acc150.n0032.test2.1_05182026 | ||
| case = ne256pg2_ne256pg2.F20TR-SCREAMv1.July-1.spanc800.2xauto.acc150.n0032.test2.1 | ||
| www = /global/cfs/cdirs/e3sm/www/chengzhu/tests/zppy_for_eamxx_05182026 | ||
| partition = "debug" | ||
| account = "e3sm" | ||
| campaign = "water_cycle" | ||
| debug = False | ||
| #environment_commands = "source /global/common/software/e3sm/anaconda_envs/test_e3sm_unified_1.13.0rc10_pm-cpu.sh" | ||
|
|
||
| [climo] | ||
| active = True | ||
| walltime = "2:00:00" | ||
| years = "1995:2004:10", | ||
|
|
||
| [[ atm_monthly_180x360_aave ]] | ||
| # The following e3sm_diags sets require it: | ||
| # "lat_lon", "zonal_mean_xy", "zonal_mean_2d", "polar", "cosp_histogram", | ||
| # "meridional_mean_2d", "annual_cycle_zonal_mean", "zonal_mean_2d_stratosphere", | ||
| # "aerosol_aeronet", "aerosol_budget" | ||
| input_component = "eamxx" | ||
| case = "1ma_ne30pg2" | ||
| input_files = "AVERAGE.nmonths_x1" | ||
| frequency = "monthly" | ||
| input_subdir = "run/" | ||
| mapping_file = map_ne30pg2_to_cmip6_180x360_aave.20200201.nc | ||
|
|
||
| [[ atm_monthly_diurnal_8xdaily_180x360_aave ]] | ||
| # The following e3sm_diags sets require it: | ||
| # "diurnal_cycle" | ||
| input_component = "eamxx" | ||
| case = "3ha_ne30pg2" | ||
| input_files = "AVERAGE.nhours_x3" | ||
| input_subdir = "run/" | ||
| frequency = "diurnal_8xdaily" | ||
| mapping_file = map_ne30pg2_to_cmip6_180x360_aave.20200201.nc | ||
| vars = "precip_liq_surf_mass_flux,precip_ice_surf_mass_flux" | ||
| # Bump walltime for a potential performance issue in ncclimo for processing eamxx high freq data. | ||
| walltime = "4:00:00" | ||
|
|
||
| [[ land_monthly_climo ]] | ||
| active = True | ||
| # This subtask is a dependency for the e3sm_diags task's lnd_monthly_mvm_lnd subtask. | ||
| # The following e3sm_diags sets require it: | ||
| # "lat_lon_land" | ||
| input_component = "elm" | ||
| frequency = "monthly" | ||
| input_files = "elm.h0" | ||
| input_subdir = "run/" | ||
| vars = "" # Setting this as "" will tell zppy to use ALL variables | ||
|
|
||
| [[ land_monthly_180x360_traave ]] | ||
| active = True | ||
| input_component = "elm" | ||
| frequency = "monthly" | ||
| input_files = "elm.h0" | ||
| input_subdir = "run/" | ||
| mapping_file = "map_ne256pg2_to_cmip6_180x360_traave.20250301.nc" | ||
| vars = "" | ||
|
|
||
| [ts] | ||
| active = True | ||
| walltime = "00:30:00" | ||
| years = "1995:2004:5" | ||
| ts_num_years=5 | ||
| #qos = "debug" | ||
|
|
||
| [[atm_monthly_180x360_aave]] | ||
| # Merged 2D+3D atm timeseries: vert_remap_vars selectively vert-remaps the | ||
| # 3D vars into a sibling ts_vert_remap/ directory, so downstream e3sm_to_cmip | ||
| # sees a single clean ts subsection. | ||
| input_component = "eamxx" | ||
| input_subdir = "run/" | ||
| case = "1ma_ne30pg2" | ||
| input_files = "AVERAGE.nmonths_x1" | ||
| frequency = "monthly" | ||
| mapping_file = map_ne30pg2_to_cmip6_180x360_aave.20200201.nc | ||
| vars="ps,surf_radiative_T,SeaLevelPressure,IceWaterPath,qv_2m,precip_liq_surf_mass_flux,precip_ice_surf_mass_flux,omega_at_500hPa,omega_at_700hPa,omega_at_850hPa,T_mid_at_700hPa,T_2m,surface_upward_latent_heat_flux,surf_sens_flux,z_mid_at_700hPa,wind_speed_10m,surf_evap,U_at_10m_above_surface,V_at_10m_above_surface,LW_clrsky_flux_dn_at_model_bot,LW_clrsky_flux_up_at_model_top,LW_flux_dn_at_model_bot,LW_flux_up_at_model_bot,LW_flux_up_at_model_top,SW_clrsky_flux_dn_at_model_bot,SW_clrsky_flux_dn_at_model_top,SW_clrsky_flux_up_at_model_bot,SW_clrsky_flux_up_at_model_top,SW_flux_dn_at_model_bot,SW_flux_dn_at_model_top,SW_flux_up_at_model_bot,SW_flux_up_at_model_top,ShortwaveCloudForcing,LongwaveCloudForcing,isccp_cldtot,U,V,T_mid,z_mid,omega,RelativeHumidity,p_mid,qv" | ||
| # NOTE: ncclimo --prc_typ=eamxx does NOT auto-extract ps/hyai/hyam/hybi/hybm | ||
| # for 3D vars the way --prc_typ=cam/eam does due to a meta data issue, so we must list them explicitly | ||
| # in extra_vars. ps is load-bearing for the vert_remap step (ts.bash:138 | ||
| # passes --ps_nm=${file}/ps to ncremap). | ||
| # If ncclimo and eamxx is fixed upstream to mirror cam/eam behavior, drop | ||
| # ps + hybrid coeffs here. | ||
| extra_vars= "ps,hyai,hyam,hybi,hybm,area,landfrac,ocnfrac" | ||
| vert_remap_vars = "U,V,T_mid,z_mid,omega,RelativeHumidity,p_mid,qv" | ||
|
|
||
| [[ atm_daily_180x360_aave ]] | ||
| active = True | ||
| # This subtask is a dependency for the e3sm_diags task's atm_monthly_180x360 subtask. | ||
| # The following e3sm_diags sets require it: | ||
| # "tropical_subseasonal", "precip_pdf" | ||
| input_component = "eamxx" | ||
| case = "1da_ne30pg2" | ||
| input_files = "AVERAGE.ndays_x1" | ||
| frequency = "daily" | ||
| input_subdir = "run/" | ||
| mapping_file = map_ne30pg2_to_cmip6_180x360_aave.20200201.nc | ||
| # Needed for Wheeler Kiladis | ||
| vars = "LW_flux_up_at_model_top,precip_liq_surf_mass_flux,precip_ice_surf_mass_flux,U_at_850hPa" | ||
| # For this simulation's "1da_ne30pg2.AVERAGE.ndays_x1" stream, each file | ||
| # holds one daily average (1 day, 1 timestep). Override the zppy defaults | ||
| # (dpf=30, tpd=1) which assume E3SM EAM monthly h0 files; otherwise ncclimo | ||
| # treats each daily file as 30 days and silently produces ts files whose | ||
| # contents (~2 months) don't match their filenames. | ||
| dpf = 1 | ||
| tpd = 1 | ||
|
|
||
| [[ atm_monthly_glb ]] | ||
| active = True | ||
| # This subtask is a dependency for the global_time_series task. | ||
| input_component = "eam" | ||
| input_subdir = "run/" | ||
| case = "1ma_ne30pg2" | ||
| input_files = "AVERAGE.nmonths_x1" | ||
| frequency = "monthly" | ||
| mapping_file = "glb" | ||
| vars="ps,surf_radiative_T,SeaLevelPressure,IceWaterPath,qv_2m,precip_liq_surf_mass_flux,precip_ice_surf_mass_flux" | ||
|
|
||
|
|
||
| [[ rof_monthly ]] | ||
| active = True | ||
| # The following e3sm_diags sets require it: | ||
| # "streamflow" | ||
| input_component = "mosart" | ||
| frequency = "monthly" | ||
| input_files = "mosart.h0" | ||
| input_subdir = "run/" | ||
| mapping_file = "" | ||
| vars = "RIVER_DISCHARGE_OVER_LAND_LIQ" | ||
| extra_vars = 'areatotal2' | ||
|
|
||
| [e3sm_to_cmip] | ||
| active = True | ||
| frequency = "monthly" | ||
| ts_grid = "180x360_aave" | ||
| ts_num_years=5 | ||
| walltime = "00:10:00" | ||
| years = "1995:2004:5" | ||
| qos = "debug" | ||
|
|
||
| [[atm_monthly_180x360_aave]] | ||
| # Merged subsection matching the [ts] atm_monthly_180x360_aave output. | ||
| # Without cmip_vars, e3sm_to_cmip uses its built-in default list (~41 vars). | ||
| # Uncomment to override the default ~41-var list. | ||
| #cmip_vars = "pr, cltisccp, evspsbl, hfls, hfss, huss, ps, psl, rlds, rldscs, rlus, rlut, rlutcs, rsds, rsdscs, rsdt, rsus, rsuscs, rtmt, uas, vas, sfcWind, tas, ts, ta, ua, va, zg" | ||
| input_component = "eamxx" | ||
| case = "1ma_ne30pg2" | ||
| input_files = "AVERAGE.nmonths_x1" | ||
|
|
||
|
|
||
| [e3sm_diags] | ||
| active = True | ||
| multiprocessing = True | ||
| num_workers = 8 | ||
| ref_start_yr = 1995 | ||
| ref_final_yr = 2004 | ||
| ts_num_years = 5 | ||
| walltime = "2:00:00" | ||
| years = "1995:2004:10", | ||
|
|
||
| # case inherits the top-level [default] case; climo output naming includes | ||
| # the stream id automatically via fml_nm, so this subsection can consume | ||
| # both monthly and diurnal climo without per-frequency overrides. | ||
|
|
||
| [[ atm_monthly_180x360_aave ]] | ||
| # `e3sm_diags` is largely driven by which e3sm_diags sets are requested: | ||
| sets="lat_lon","zonal_mean_xy","zonal_mean_2d","polar","cosp_histogram","meridional_mean_2d","annual_cycle_zonal_mean","enso_diags","qbo","zonal_mean_2d_stratosphere","aerosol_aeronet","mp_partition","tropical_subseasonal","precip_pdf","streamflow","diurnal_cycle", | ||
| # sets = #"tc_analysis," # not yet supported for eamxx! | ||
| climo_diurnal_frequency = "diurnal_8xdaily" | ||
| climo_diurnal_subsection = "atm_monthly_diurnal_8xdaily_180x360_aave" | ||
| ts_daily_subsection = "atm_daily_180x360_aave" | ||
| # ts_subsection defaults to "atm_monthly_180x360_aave" — matches the merged | ||
| # [ts] subsection above, so no explicit override needed. | ||
| grid = '180x360_aave' | ||
| short_name = 'e3sm.amip.EAMXX.test2_1' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,6 +46,18 @@ def e3sm_to_cmip(config: ConfigObj, script_dir: str, existing_bundles, job_ids_f | |
| default_cmip_plevdata, | ||
| ParameterInferenceType.PATH_INFERENCE, | ||
| ) | ||
| # EAMxx needs an explicit source vertical grid file (L128); | ||
| # EAM/CAM have vertical coord info embedded in the file already. | ||
| if c["prc_typ"] == "eamxx": | ||
| default_vrt_in_file = ( | ||
| f"{c['diagnostics_base_path']}/e3sm_to_cmip_data/grids/vert_L128.nc" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see the code already had a reference to Claude says the following, emphasis my own:
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@forsyth2 Prefixing with diagnostics_base_path should already imply the data are pre-installed. I think the current approach is fine, but feel free to update if you think it improves clarity.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes I suppose looking at it again, that makes sense. It was just a little confusing when I was trying to figure out which tasks had |
||
| ) | ||
| set_value_of_parameter_if_undefined( | ||
| c, | ||
| "vrt_in_file", | ||
| default_vrt_in_file, | ||
| ParameterInferenceType.PATH_INFERENCE, | ||
| ) | ||
| year_sets: List[Tuple[int, int]] = get_years(c["years"]) | ||
| # Loop over year sets | ||
| for s in year_sets: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little inconsistent to use
vrtfor 2 of the parameters andvertfor another. But I don't know if it's worth changing (and risking breaking something else) at this point.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Let me try to rename vert_remap_vars → vrt_remap_vars — aligns everything with NCO's vrt_ prefix to be consistent. Since these are newly added parameters, it would be good to fix before releasing to the users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhangshixuan1987 just a quick note on this: you may need to rename vert_remap_vars to vrt_remap_vars. This change was made to reduce variation in parameter names.