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

Revise sampler code in History #2527

Merged
merged 10 commits into from
Jan 19, 2024
Merged

Revise sampler code in History #2527

merged 10 commits into from
Jan 19, 2024

Conversation

metdyn
Copy link
Contributor

@metdyn metdyn commented Jan 12, 2024

Description

Code modifications were introduced to address many issues when running Sampler code using multiple observation platforms and multiple samplers (station, swath, trajectory) for c180 with real initial conditions. The work is coauthored with @bena-nasa and @tclune. (I would rather have the modification exposed than accumulating more changes over time.)

Some details are shown in the Changelog as below:

  • Modify trajectory sampler for a collection with multiple platforms: P3B (air craft) + FIREX
  • Modify swath sampler to handle two Epoch swath grids
  • Handle regrid accumulate for time step (1 sec) during which no obs exists
  • Use IntState%stampoffset(n) to adjust filenames for an epoch time
  • parse "GOCART::CO2" from 'geovals_fields' entry in PLATFORM
  • Add call MAPL_InitializeShmem to ExtDataDriverGridComp.F90
  • Read swath grid data on root, call MAPL_CommsBcast [which sends data to Shmem (when Shmem initialized) or to MAPL_comm otherwise]. This approach avoids race in reading nc files [e.g. 37 files for 3 hr swath data]

Related Issue

How Has This Been Tested?

Use ExtDataDriver on Mac.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Trivial change (affects only documentation or cleanup)

Checklist:

  • I have tested this change with a run of GEOSgcm (if non-trivial)
  • I have added one of the required labels (0 diff, 0 diff trivial, 0 diff structural, non 0-diff)
  • I have updated the CHANGELOG.md accordingly following the style of Keep a Changelog

@metdyn metdyn requested a review from a team as a code owner January 12, 2024 07:14
base/MAPL_Comms.F90 Outdated Show resolved Hide resolved
base/MAPL_ObsUtil.F90 Outdated Show resolved Hide resolved
base/MAPL_ObsUtil.F90 Outdated Show resolved Hide resolved
base/MAPL_ObsUtil.F90 Outdated Show resolved Hide resolved
tclune
tclune previously requested changes Jan 12, 2024
Copy link
Collaborator

@tclune tclune left a comment

Choose a reason for hiding this comment

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

This is a very large amount of changes across many many files. Hopefully the dust settles now and you have time to start making more incremental PRs that can be more carefully reviewed ...

I am curious about the alphabetize procedure that I see here (already existed). Often one can use map instead of vector if ordering matters, but I did not have the time to fully understand the use case.

@metdyn
Copy link
Contributor Author

metdyn commented Jan 12, 2024

A few more tests were made:

  • HISTORY.rc duration: 000000 will lead to single output nc file
  • On discover, a dryrun test with ExtDataDriver on 2 nodes shows the read then bcast to shmem works as expected.
    I will mark the code as zero-diff, then.

…in subroutine read_M_files_4_swath in MAPL_ObsUtil.F90
@metdyn
Copy link
Contributor Author

metdyn commented Jan 12, 2024

Thank you, @tclune for thinking of the %push and pop procedure in map to deal with arrays with variable lengths. There are quite a few places in the sampler code, where I have used hard coded limit. But they are small dimensions like max 100 platforms, etc. I will improve them along the way.

@metdyn
Copy link
Contributor Author

metdyn commented Jan 18, 2024

I have taken a note on this map/vector issue and I will address it in the following PRs when more thorough tests are complete and when the mask sampler is implemented. OTOH, I am still adding functionalities to the obs modules and plain netCDF modules to support the geostationary images. Hence we need this PR merged to start the next PR on geostationary part 2.

@metdyn metdyn closed this Jan 18, 2024
@metdyn metdyn reopened this Jan 18, 2024
@metdyn
Copy link
Contributor Author

metdyn commented Jan 18, 2024

This is a very large amount of changes across many many files. Hopefully the dust settles now and you have time to start making more incremental PRs that can be more carefully reviewed ...

I am curious about the alphabetize procedure that I see here (already existed). Often one can use map instead of vector if ordering matters, but I did not have the time to fully understand the use case.

I got it and will change it in a later PR for a more systematic treatment.

@metdyn metdyn requested a review from tclune January 18, 2024 17:28
@metdyn metdyn dismissed tclune’s stale review January 18, 2024 17:31

We will change in the next PRs.

@tclune tclune self-requested a review January 18, 2024 18:07
Copy link
Collaborator

@tclune tclune left a comment

Choose a reason for hiding this comment

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

I left a few things for you to consider in the in-line suggestions.

This is really still way to big for a single PR. We need to get something stable and then have you submit small PR's to improve.

@metdyn
Copy link
Contributor Author

metdyn commented Jan 18, 2024

Thanks, @tclune, I see your suggestions and I will change them later on in other PRs.

@tclune tclune merged commit b042b6e into develop Jan 19, 2024
29 checks passed
@tclune tclune deleted the feature/ygyu/revise_sampler branch January 19, 2024 15:14
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.

2 participants