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

Add netCDF PIO capability for restarts and run-time history for dev/ufs-weather-model #1303

Draft
wants to merge 23 commits into
base: dev/ufs-weather-model
Choose a base branch
from

Conversation

DeniseWorthen
Copy link
Contributor

@DeniseWorthen DeniseWorthen commented Sep 24, 2024

Pull Request Summary

Enable netCDF restarts and run-time netCDF history using PIO.

Description

  1. PIO configuration

PIO is configured via configuration settings in WAV attributes for UFS and via share code for CESM. Defaults are provided for the stride, number of io tasks and rearranger settings. The PIO subsystem is managed and initialized in wav_pio_mod.F90

  1. netCDF restarts

PIO/netCDF restarts are enabled by using use_restartnc=true in the configuration attributes, otherwise native WW3 binary restarts will be written. If netCDF restarts are enabled, an additional option exists to restart from an existing binary restart (restart_from_binary=true). In this case, the binary restart filename needs the same form as the netCDF restarts (minus the .nc at the end).

With netCDF restarts enabled, restarts will be written at the rstwr frequency defined in the cap, which will allow both the flexible (ie, non-interval) restarts and end-of-run restarts to be enabled in the same way as for other coupled components in UFS. These two features are not implemented in this work.

The netCDF restarts are read and written in a new routine wav_restart_mod.F90. Only two fields (va and mapsta) are written to the restart file by default. As noted in the comment in #1298, when waves are in the slow-coupling loop, the ice field is also written. The addition of extra restart fields is generalized via the already-existing restart%extra namelist.

  1. netCDF history

Runtime netCDF history is enabled by using use_historync=true in the configuration attributes, otherwise native WW3 binary history files will be written. The PIO/netCDF capability builds on the existing serial netCDF capability in the mesh cap. The two existing routines used for this (w3iogoncdmd.F90, wav_grdout.F90) have been reduced to a new single netCDF history module wav_history_mod.F90 containing the same functionality.

History files can be custom named (if user_histname = true), otherwise they will be named in the native WW3 file naming. History files will be written at the histwr frequency. This frequency will be set using the normal history_n,history_option settings, if present. Otherwise, the field%stride frequency will be used to determine the histwr frequency. (This requires that the stride be set in units of seconds, which is less flexible than enabling the history_n,history_option settings.)

  1. Removal of mesh-cap specific modifications to w3wavemd, w3iorsmd and w3iogomd..

Modifications to the three listed routines were required for the mesh cap to allow for additional flexibility of restart and history writing. The changes in w3iogomd were resolved w/ the PR to dev/ufs-weather-model for the Langmuir turbulence calculations (#1034). With the new restartnc and historync options via PIO, the changes to the other two routines (wavemd and iorsmd) are no longer required, meaning these two routines are now much more aligned with the same code in the develop branch. Since the dev/ufs-weather-model branch has not been updated for nearly a year, the modifications are best seen by comparing these two routines in this PR branch against the develop branch at 4d8c315

Issue(s) addressed

Commit Message

Check list

Testing

  • How were these changes tested?

Using UFS-WM, a baseline was created and verified to pass for all tests which include a WAV component. Full testing as well as scalability results will be documented in the associated UFS-WM PR.

DeniseWorthen and others added 22 commits August 28, 2024 08:06
* remove wav_grdout routine, now moved into wav_history_mod
* remove more cap stuff from w3iorsmd. only ww3 native filenaming
is possible w/ binary restarts
* remove ifdef w3_ascii from w3wavemd, since the ascii commit is not
yet present in mesh cap branch
* clean up config variable logic for filenaming
* nrqrs can be non-zero if also using the restart from binary
option
* flpart needs to be set for either historync or not
* move restart and history nc blocks outside of ww3 time testing
block.
* add log print messages for reading and writing restarts
* get logging working correctly for ufs
* fix noclobber variable and file name in wav_history
* clarify some comments
* make binary history files match when restartnc=true
* rework wav_restart_mod, which originally was designed to be able
to read and write restarts for testing purposes from inside wav_comp_nuopc.
* verboselog is true by default, but can be set false by config
* the header text for ww3 logging as it steps through time is now
turned off in w3init and placed into the mesh cap. this allows the
mesh cap to order the logging correctly
* move block where addrstflds was set to before call to w3init
since restarts are read in w3init
* ensure that if nml file lacks a specification of extra fields,
the default value of "unset" will not be returned as a field name
* only ice is added for now
* tab cleanup in w3grid
* need to send explicit array bounds for ice array since
it is 0:nsea
* all baselines b4b against f9531d0
@DeniseWorthen DeniseWorthen changed the title Add netCDF PIO capability for restarts and run-time history Add netCDF PIO capability for restarts and run-time history for dev/ufs-weather-model Sep 24, 2024
* intialize floutg and floutg2 which are can be unintialized when
waves are in slow loop and historync is true
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.

1 participant