Skip to content
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

Allow cfg files to be more machine-independent #425

Closed
forsyth2 opened this issue May 12, 2023 · 10 comments · Fixed by #426
Closed

Allow cfg files to be more machine-independent #425

forsyth2 opened this issue May 12, 2023 · 10 comments · Fixed by #426
Assignees
Labels
semver: small improvement Small improvement (will increment patch version)

Comments

@forsyth2
Copy link
Collaborator

https://github.com/E3SM-Project/zppy/blob/main/tests/integration/utils.py#L125 -- can we reduce the number of parameters that are machine-specific?

For example, the diags paths could be consolidated into a single parameter.

@forsyth2 forsyth2 self-assigned this May 12, 2023
@forsyth2 forsyth2 moved this from Todo to In Progress in forsyth2 current tasks May 12, 2023
@xylar
Copy link
Contributor

xylar commented May 12, 2023

Shouldn't the diags_path come from mache anyway, at least for supported machines?

@forsyth2
Copy link
Collaborator Author

yes, but there are a variety of derived paths. E.g.,

        "diags_obs_climo": f"{diags_base_path}/observations/Atm/climatology/",
        "diags_obs_tc": f"{diags_base_path}/observations/Atm/tc-analysis/",
        "diags_obs_ts": f"{diags_base_path}/observations/Atm/time-series/",

@xylar
Copy link
Contributor

xylar commented May 12, 2023

I see. I think those should just be hard-coded at this point, and the diags_base_path should come from mache when possible but be a config option for machines that mache doesn't support (unless zppy only supports machines that mache also supports).

@forsyth2
Copy link
Collaborator Author

I think those should just be hard-coded at this point

I think some users may want to use completely different dataset paths though.

unless zppy only supports machines that mache also supports

I think we're officially supporting the same machines -- the ones on Unified.

@xylar
Copy link
Contributor

xylar commented May 12, 2023

I see, in that case carry on. It doesn't sound like you need any input from me, but ping me if so.

@golaz
Copy link
Collaborator

golaz commented May 16, 2023

@forsyth2 : in most cases (99%+), a user will want to use the standard observational datasets for diags_obs_climo, diags_obs_tc, diags_obs_ts and should not have to know or worry about where these datasets reside.

The paths should be set transparently, either in zppy or E3SM Diags with the diags_base_path coming from mache.

@golaz
Copy link
Collaborator

golaz commented May 16, 2023

@forsyth2 : here is an example of an e3sm_diags section from a zppy configuration file on chrysalis:

[e3sm_diags]
active = True
years = "1985:2014:30",
ts_num_years = 5
ref_start_yr = 1979
ref_final_yr = 2016

  [[ atm_monthly_180x360_aave ]]
  short_name = 'v2_1.LR.historical_0101'
  grid = '180x360_aave'
  sets = 'lat_lon','zonal_mean_xy','zonal_mean_2d','polar','cosp_histogram','meridional_mean_2d','enso_diags','qbo','diurnal_cycle','annual_cycle_zonal_mean','streamflow','zonal_mean_2d_stratosphere'
  reference_data_path = '/lcrc/soft/climate/e3sm_diags_data/obs_for_e3sm_diags/climatology'
  obs_ts = '/lcrc/soft/climate/e3sm_diags_data/obs_for_e3sm_diags/time-series'
  dc_obs_climo = '/lcrc/group/e3sm/public_html/e3sm_diags_test_data/unit_test_complete_run/obs/climatology'
  climo_diurnal_subsection = "atm_monthly_diurnal_8xdaily_180x360_aave"
  climo_diurnal_frequency = "diurnal_8xdaily"
  output_format_subplot = "pdf",

We want this to work properly without having to specify reference_data_path, obs_ts, dc_obs_climo. Those are the parameters that make the file difficult to port.

For other tasks, the main offending parameter is

  mapping_file = /home/ac.zender/data/maps/map_ne30pg2_to_cmip6_180x360_aave.20200201.nc

which should support specifying directly a filename

  mapping_file = map_ne30pg2_to_cmip6_180x360_aave.20200201.nc

with zppy relying on mache to find the absolute path where these files reside. The user should still have the option of specifying and absolute path in they choose to bypass the official mapping files.

@golaz
Copy link
Collaborator

golaz commented May 16, 2023

Another parameter would be

environment_commands = "source /lcrc/soft/climate/e3sm-unified/load_latest_e3sm_unified_chrysalis.sh"

which a user should have the option of omitting completely with zppy relying on mache to determine the proper way to load the latest E3SM Unified environment.

There are other machine dependent parameters such as input, output, www, partition which a user will still have to modify manually when going from one machine to another.

@forsyth2
Copy link
Collaborator Author

forsyth2 commented May 17, 2023

Re: diags observations paths -- I'm working on automating those parameters.

Re: mapping files -- this was completed in #381.

Re: environment_commands -- this was completed in #330:

    # Determine environment_commands                                                                                                                                                                                      
    if config["default"]["environment_commands"] == "":
        machine = config["default"]["machine"]
        config["default"][
            "environment_commands"
        ] = f"source {unified_base}/load_latest_e3sm_unified_{machine}.sh"

@forsyth2 forsyth2 added the semver: small improvement Small improvement (will increment patch version) label May 17, 2023
@forsyth2
Copy link
Collaborator Author

Re: diags observations paths -- I'm working on automating those parameters.

Observation paths are automated in #426.

@github-project-automation github-project-automation bot moved this from In Progress to Done in forsyth2 current tasks May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: small improvement Small improvement (will increment patch version)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants