Skip to content

Netcdf parallel output extensions and bug fixes #1446

Closed
kestonsmith-noaa wants to merge 3 commits into
NOAA-EMC:dev/ufs-weather-modelfrom
kestonsmith-noaa:NcPIOwFreqDim
Closed

Netcdf parallel output extensions and bug fixes #1446
kestonsmith-noaa wants to merge 3 commits into
NOAA-EMC:dev/ufs-weather-modelfrom
kestonsmith-noaa:NcPIOwFreqDim

Conversation

@kestonsmith-noaa
Copy link
Copy Markdown
Collaborator

Pull Request Summary

Repair bugs in netcdf parallel output and extend netcdf output capacity beyond original implementation.

Description

Changes only affect coupled runs within ufs-weather-model at present. In coupled ufs-weather-model runs changes are expected to PDIR, UST, THS, PSI, CGE and DTDYN variables.

Issue(s) addressed

Addresses:
#1366

Also has relevance to:
#1401

Commit Message

Fix bugs in netcdf parallel output and adds support for wave number and frequency dimensions in history output.

Check list

Testing

  • How were these changes tested?
  • Changes were tested by comparing netcdf parallel output with binary output converted to netcdf with ww3_ounf.
  • Are the changes covered by regression tests? (If not, why? Do new tests need to be added?)
  • No, regression tests which work with netcdf parallel output are needed to test the changes.
  • Have the matrix regression tests been run (if yes, please note HPC and compiler)?
  • Please indicate the expected changes in the regression test output, (Note the list of known non-identical tests.)
  • Please provide the summary output of matrix.comp (matrix.Diff.txt, matrixCompFull.txt and matrixCompSummary.txt):

@kestonsmith-noaa kestonsmith-noaa requested review from JesseMeng-NOAA and JessicaMeixner-NOAA and removed request for JesseMeng-NOAA June 2, 2025 15:51
Copy link
Copy Markdown
Collaborator

@JessicaMeixner-NOAA JessicaMeixner-NOAA left a comment

Choose a reason for hiding this comment

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

@kestonsmith-noaa - This will need a UFS weather-model corresponding PR for this to be merged. In the meantime, I have two questions one is in the code and the other is if you can please point to the issue or place where you have documented the remaining issues that were not addressed in this PR and link it to this PR as well.

! Group 5
if (vname .eq. 'USTX') call write_var2d(vname, ust (1:nseal_cpl)*asf(1:nseal_cpl), dir=cos(ustdir(1:nseal_cpl)), usemask='true')
if (vname .eq. 'USTY') call write_var2d(vname, ust (1:nseal_cpl)*asf(1:nseal_cpl), dir=sin(ustdir(1:nseal_cpl)), usemask='true')
if (vname .eq. 'USTX') call write_var2d(vname, ust (1:nsea)*asf(1:nsea), dir=cos(ustdir(1:nsea)), init0='false', global='true')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@kestonsmith-noaa - Looking at patterns here and everything else seems to be for (1:nseal_cpl) should this also be that way?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I knew I had seen some issue w/ ust before, and it was this one #942. So ust/ustdir/asf are dimensioned like global variables. At the time of this issue, I was testing w/ the "old" netcdf interface, which bootstrapped on top of the existing w3iogomd---meaning it was writing serial netcdf from the same root task as the binary out put was using. It does look like in this case the fields, for whatever reason, are global like group 1.

@JessicaMeixner-NOAA
Copy link
Copy Markdown
Collaborator

@DeniseWorthen - I'm adding you as a reviewer on this PR. We have some time because the queue in UFS weather-model is backed up at the moment. @kestonsmith-noaa will also be creating a ufs-waether-model PR and enabling netcdf history output in at least one additional test. We are not going to fully move to netcdf for all output because for operations we still do not have a netcdf-> grib capability, so we'll be sticking to binary for now, however do hope to move to netcdf when we have the netcdf -> grib capability. Not every single variable what checked due to some needing additional physics or other parameters turned on to fully check that are not as commonly used. Our strategy for this will be to document those and move forward with these updates. Thank you so much for creating this capability and apologies it's taken us so long to do this careful check between binary and netcdf and lastly - thanks to @kestonsmith-noaa for doing this careful check!!.

@DeniseWorthen
Copy link
Copy Markdown
Contributor

@JessicaMeixner-NOAA Thanks. I also was doing some minor fix-up of the wav_history to fix the stride=0 issue (ie, when using history_n/_option like CESM does) given the additional variables that have been added in the meantime. That branch is https://github.com/DeniseWorthen/WW3/tree/feature/fixstride0.

I did glance at this PR briefly when it had been opened against the develop branch. I think we need to be careful in the understanding of writing global arrays and decomposed arrays. For the netcdf option, only decomposed arrays are written. Arrays which are global (ie, the forcing fields) are first 'decomposed' and then written in the write_varXd routines.

I will make an effort to review this soon; I definitely have questions about the 'transpose' decomposition as well as the one you point out where the entire (nsea) array is being sent.

@kestonsmith-noaa
Copy link
Copy Markdown
Collaborator Author

kestonsmith-noaa commented Jun 6, 2025 via email

@DeniseWorthen
Copy link
Copy Markdown
Contributor

@kestonsmith-noaa I think they behave differently because there are no "extended" arrays for the ust/ustdir/asf variables. For example, charn (another gr 5 variable), has an associated "extended" pointer (xcharn), which gets pointed to when you call w3xeta (so that the single proc can write it out in w3iogo). At least, that is how I understand how the binary output works.

@kestonsmith-noaa
Copy link
Copy Markdown
Collaborator Author

kestonsmith-noaa commented Jun 6, 2025 via email

@kestonsmith-noaa
Copy link
Copy Markdown
Collaborator Author

kestonsmith-noaa commented Jun 6, 2025 via email

@JessicaMeixner-NOAA
Copy link
Copy Markdown
Collaborator

Just making a note here that the contents of this PR has moved to:#1476

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants