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

using fms chunksize and compression options in dycore #217

Closed
junwang-noaa opened this issue Sep 22, 2022 · 10 comments · Fixed by NOAA-EMC/fv3atm#595 or ufs-community/ufs-weather-model#1467
Labels
enhancement New feature or request

Comments

@junwang-noaa
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
In the fms issue NOAA-GFDL/FMS#1035, the feature of using chunksize and compression options in writing netcdf files were request. The fms team made code updates and a PR (NOAA-GFDL/FMS#1043). With the new FMS features in fms2_io, the dycore needs to be updated to writing out restart files using the new feature, which is critical to speed up the RRFS model which NCEP plans to implement v1 version next year (some initial test with hard code chunksize showed the cycled hourly RRFS run time reduced 50%. May I ask if there is any plan to update the dycore code to use the new feature? Thank you!

Describe the solution you'd like
Update the fms2 io interface code to allow using chunksize and compression options.

Describe alternatives you've considered
Currently we don't have alternative way to use chunksize or compression options when writing out restart files.

Additional context
Add any other context or screenshots about the feature request here.

@junwang-noaa junwang-noaa added the enhancement New feature or request label Sep 22, 2022
@bensonr
Copy link
Contributor

bensonr commented Sep 22, 2022

@junwang-noaa - thank you for entering this request for enhancement. As this is a feature currently desired solely by the UFS and we (GFDL) are updating the FMS I/O infrastructure with support for these advanced options for netcdf4 format files, we request the UFS community take responsibility for implementing them within the FV3 dycore. We here at GFDL are available to provide guidance during the implementation.

@junwang-noaa
Copy link
Collaborator Author

@DusanJovic-NOAA was trying to add the dycore changes in his dev/emc branch. But the ufs-weather-model control test failed, Here are the comments from Dusan: Code fails in get_variable_id function because 'sgs_tke' variable does not exist in the input file. There is an optional parameter 'allow_failure' which, when present and is true, does not crash the code. But in this case it is not present. The get_variable_id is called from get_variable_num_dimension. I have no idea how this works in the current version of FMS, but it doesn't in the latest.

@DusanJovic-NOAA would you please provide your branch so that we can see the code changes you made? We will need GFDL's help to see if we missed any code changes in order to use these advanced options. Thanks

@DusanJovic-NOAA
Copy link
Contributor

I do not have a branch. I was just using current ufswm develop branch compiled with the FMS from https://github.com/mcallic2/FMS/tree/dataCompression branch. But I did this about a week ago. I see there are new commits to this branch.

@junwang-noaa
Copy link
Collaborator Author

So Dusan's test does not have changes to use the advanced options. @bensonr Do you have any clue what are changes in the latest fms that require dycore updates?

@DusanJovic-NOAA
Copy link
Contributor

I do not have a branch. I was just using current ufswm develop branch compiled with the FMS from https://github.com/mcallic2/FMS/tree/dataCompression branch. But I did this about a week ago. I see there are new commits to this branch.

I tried to run the 'control' regression test using the top of the dev/emc branch, which has changes from 'dataCompression' branch already merged in, and it didn't fail as before when I was using 'dataCompression' branch directly a week or so ago. But the results are not bit-for-bit identical compared to the current baseline. Not sure why.

@laurenchilutti
Copy link
Contributor

@DusanJovic-NOAA The data compression changes are included in the latest testing tag 2022.04-beta2 of FMS. This morning I used the develop branch of ufs-weather-model, and the 2022.04-beta2 tag of FMS to run the regression tests via rt.sh and ran into no issues. Could you please use the FMS 2022.04-beta2 testing tag to build FMS, and also please note that you will need to build with the CMAKE compile flag -DCONSTANTS=GFS. The constants flag is required in FMS release 2022.02 and beyond.

@laurenchilutti
Copy link
Contributor

@DusanJovic-NOAA
Copy link
Contributor

@laurenchilutti Thanks. I recompiled the FMS 2022.04-beta2 tag with -DCONSTANTS=GFS (which I was missing in my build script), and reran the control test, which now reproduces b4b current baselines.

@DusanJovic-NOAA
Copy link
Contributor

Please take a look at the changes I made in this branch:

https://github.com/DusanJovic-NOAA/GFDL_atmos_cubed_sphere/tree/restart_chunksizes

I changed the format of restart files to netcdf4, and set the chunk sizes explicitly for each variable. Chunk sizes are currently set to be equal to dimension sizes, resulting in one chunk per variable.

@bensonr
Copy link
Contributor

bensonr commented Sep 29, 2023

I believe this has been addressed - closing

@bensonr bensonr closed this as completed Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
4 participants