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

Feature/gfs config dirpath fixedfiles #1474

Closed
wants to merge 7 commits into from
Closed

Feature/gfs config dirpath fixedfiles #1474

wants to merge 7 commits into from

Conversation

HenryRWinterbottom
Copy link
Contributor

Description

This PR addresses issue #1473 .

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

The directory tree and expected fixed files are defined/copied.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes need updates to the documentation. I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • New and existing tests pass with my changes
  • Any dependent changes have been merged and published

WalterKolczynski-NOAA and others added 2 commits April 17, 2023 13:37
It can be difficult to debug MPMD jobs because their logs are all written concurrently to a single file. While the use of tags to designate which task via the preamble and PS4 can help identify which line is from which task, it is still difficult to follow a single task through the log, particularly for larger MPMD jobs with dozens of tasks.

Individual stdout files are now created by using the `srun` `--output` option. These files are written to the working directory (in `$DATA`).

Fixes: #1468
Copy link
Contributor

@aerorahul aerorahul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is way too much in this PR that
a. we did not discuss in the plan
b. irrelevant to the topic
c. changes that were made that are counter to the ones in the previous PR.


# HRW: `atmos_run` will need to be defined dynamically once
# additional GFS applications are added.
config_attr_dict = {'aero_run': 'DO_AERO',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we prefer do_aero etc. The less renaming we do, the better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That comes from this in the configuration/environment: DO_AERO False.

'ice_cpl': 'cplice',
'ice_res': 'ICERES',
'ice_run': 'DO_ICE',
'ocn_cpl': 'cpl',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if chm_cpl is cplchm for e.g., then why is ocn_cpl just cpl?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comes from DO_COUPLED False or cpl False. Which do you want to use?

self.ufs_config.FIX_orog = os.path.join(self._config.FIXgfs, 'orog')
self.ufs_config.FIX_ugwd = os.path.join(self._config.FIXgfs, 'ugwd')

self.ufs_config.HOMEgfs = self._config.HOMEgfs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets think about this:
If we use gfs in the name of an object that is "ufs", would that cause issues?
Does ufs_config need to know where HOMEgfs is? It needs FIX and parm, but they could be independent of "HOMEgfs"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not in the UFS class but we could add it in the GFS class.

copy:
# Atmosphere mosaic file linked as the grid_spec file (atm only)
- [$(FIX_orog)/$(atm_res)/$(atm_res)_mosaic.nc, $(DATA)/INPUT/grid_spec.nc]
dirtree:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this dirtree section.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the FileHandler know how to build the directory tree prior to copying the respective files?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. it does not, but that is not the point of these fix files.
They are containing information about what files are needed, where is the source and what is the destination. And what is the action (copy).
Anything else is not within scope of this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am really confused about this. How does the directory tree get built such that the files can be copied? Last time we discussed this piece of the workflow this was needed. Why is it no longer needed?

- [$(FIX_orog)/$(atm_res)/$(atm_res)_grid.tile4.nc, $(DATA)/INPUT/]
- [$(FIX_orog)/$(atm_res)/$(atm_res)_grid.tile5.nc, $(DATA)/INPUT/]
- [$(FIX_orog)/$(atm_res)/$(atm_res)_grid.tile6.nc, $(DATA)/INPUT/]
fixedfiles:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep these as they were before.

Comment on lines +33 to +40
Parameters
----------

config: AttrDict

A Python dictionary containing the run-time configuration
attributes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no parameters to a class. They are to the constructor __init__.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a reference to the documentation?

Comment on lines +71 to +72
fixedfile_list = [item for item in self.ufs_config.fixedfile_list if (
"atmos" in item.lower() or "land" in item.lower())]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where a configuration yaml is necessary to elevate this from code to yaml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I tried to keep this simple for the time-being until we are at that point.

self.config_fcstapp()

@logit(logger)
def build_dirtree(self: UFS) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hold this for another PR.


with open(output_file, 'w') as fho:
fho.write(file_out)

@staticmethod
def __get_fixedfile_list(fixedfile_path) -> List:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why we care about getting a list of all files in a directory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this was what we discussed. In that path are only fixed-file YAMLs. They are relevant depending on the application of the GFS.

@HenryRWinterbottom
Copy link
Contributor Author

there is way too much in this PR that a. we did not discuss in the plan b. irrelevant to the topic c. changes that were made that are counter to the ones in the previous PR.

I am not sure how I am supposed to test the the pieces that were put in place without the remainder of the other bits. My understanding was the following:

@HenryRWinterbottom HenryRWinterbottom deleted the feature/gfs_config_dirpath_fixedfiles branch April 26, 2023 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants