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 for user-configured naming conventions of restart files #674

Open
JessicaMeixner-NOAA opened this issue Apr 20, 2022 · 11 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@JessicaMeixner-NOAA
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
CESM and other systems have requirements for specific naming conventions of restart files.

Describe the solution you'd like
Configure the name of restart files via optional namelist/input options.

Additional context
Need to know what CESM (@alperaltuntas) and other systems requirements are.

Related to #219

@JessicaMeixner-NOAA JessicaMeixner-NOAA added the enhancement New feature or request label Apr 20, 2022
@JessicaMeixner-NOAA JessicaMeixner-NOAA mentioned this issue Apr 20, 2022
4 tasks
@alperaltuntas
Copy link
Collaborator

alperaltuntas commented Apr 21, 2022

Thanks @JessicaMeixner-NOAA for posting this! CESM naming convention of restart file names is as follows:

$CASE.$scomp.r.$date[$ending]

where,
$CASE is the experiment name,
$scomp is the component name, e.g., cam, mom, ww3, etc.
$date is the model date string which is based on a yyyy-mm-dd-sssss convention
$ending is the file extension, which is ideally .nc


An example ww3 restart file name from a CESM case that I recently ran:

g.e23.GMOM_JRA.TL319_t061_wt061.control.001.ww3.r.0060-01-01-00000

where $CASE is g.e23.GMOM_JRA.TL319_t061_wt061.control.001,
$scomp is ww3,
$date is 0060-01-01-00000
and $ending is empty since ww3 files are binary files as opposed to netcdf file (which is another feature we would love to have.)

CESM has a unique naming convention for case names as well. As in the above example, we tend to have quite long $CASE names: g.e23.GMOM_JRA.TL319_t061_wt061.control.001. The full description of CESM naming convention is described here: https://www.cesm.ucar.edu/models/cesm2/naming_conventions.html

Within other CESM components, we achieve this naming convention in the respective model drivers (caps) where we can easily obtain the case name and date strings from the CESM driver at runtime. For instance, in MOM6 nuopc cap, we set the restart filename as follows:

 write(restartname,'(A,".mom6.r.",I4.4,"-",I2.2,"-",I2.2,"-",I5.5)') &
             trim(casename), year, month, day, seconds

where casename, year, month, day, and seconds are obtained via NUOPC_CompAttributeGet and ESMF_TimeGet calls.


One final note: In addition to the actual restart files, we also write out a text file called rpointer file for each component that contains the name of the restart file to be read in when a case gets restarted. Currently, ww3 is the only CESM component that doesn't write out this file. So, if possible, we would love to add this as an optional feature in WW3. (Perhaps via the nuopc cap).

I am mentioning @mvertens in case I missed out anything.

@JessicaMeixner-NOAA
Copy link
Collaborator Author

@alperaltuntas thank you so much for your response!

This issue will not change the format of the file for now, it seems likely we can figure out something that will add the additional flexibility for the naming of the files via input options.

@JessicaMeixner-NOAA
Copy link
Collaborator Author

@alperaltuntas I know for now you are not using multiple WW3 grids for now, but if you did how would you account for that in your naming convention? Right now it's essentially in the extension .ww3 or .{grid_name} is how we handle the different multiple grids, but if/when we move to netcdf file does that become .ww3.nc or .{grid_name}.nc ? Would that be an issue for you if it's .ww3.nc as the "ending"?

Also a note: We need to consider what the name of the restart file that is used for starting up. Is that also going to have flexibility?

@alperaltuntas
Copy link
Collaborator

@JessicaMeixner-NOAA we actually use multiple WW3 grids depending on which ocean model we couple with (POP2 or MOM6) and depending on whether CICE coupling is on. In the restart filenames, we include the case name, which includes the grid alias. Below is an example restart file name:

g.e23.GMOM_JRA.TL319_t061_wt061.control.001.ww3.r.0060-01-01-00000

In the above file name, TL319_t061_wt061 is the grid alias which tells us what ww3 grid we use, that is wt061.

So when we move to netcdf, the above file name would simply be:

g.e23.GMOM_JRA.TL319_t061_wt061.control.001.ww3.r.0060-01-01-00000.nc

We need to consider what the name of the restart file that is used for starting up. Is that also going to have flexibility?

To specify the name of the restart file that is used for starting up, CESM components read in a text file called rpointer that contains the restart file name(s) that a component should read in, which is particularly useful when we have multiple restart files (with different timestamps) in the run directory. At the end of each run segment, rpointer files are automatically written by each component to point to the latest restart file but the users can manually change it to point to an earlier restart file.

@JessicaMeixner-NOAA
Copy link
Collaborator Author

@alperaltuntas do you use multiple girds in one simulation?

@alperaltuntas
Copy link
Collaborator

Oh, right, we don't use multiple grids in one simulation.

@DeniseWorthen
Copy link
Contributor

DeniseWorthen commented May 4, 2022

I have a feature branch (https://github.com/DeniseWorthen/WW3/tree/feature/useropts) which attempts to implement this feature. I've tested this is ufs and it seems to be working there but it will need more complete testing to uncover any issues on the CESM side.

What I've done is added two logical flags (user_restname, user_histname) to indicate that user-specific names are requested. The string to use to construct the filenames are then in user_restfname, user_histfname. I've also defined a user_timestring, which allows for a custom timestamp style. The filenames should revert to the default style if a custom user name is not requested.

@JessicaMeixner-NOAA
Copy link
Collaborator Author

@DeniseWorthen I'll be testing your branch and extending it so that a user can set this option via the inp/nml files. I probably wont get to this tomorrow, so it'll likely be when I get back from leave on the 25th.

@arunchawla-NOAA
Copy link
Contributor

Is this still happening? I am wondering if this is close enough to completion that it can be quickly knocked out

@JessicaMeixner-NOAA
Copy link
Collaborator Author

@arunchawla-NOAA the remaining task here is to put this in a config file that's a WW3 specific input in addition to the UFS configuration files. At this point it's on me to finish this and bring this to develop. I will work on this after I finish HAFS things and we get any scotch issues I need to help with.

@arunchawla-NOAA
Copy link
Contributor

ok thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

5 participants