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

Optimize netcdf write component #18

Closed
jswhit2 opened this issue Dec 5, 2019 · 6 comments
Closed

Optimize netcdf write component #18

jswhit2 opened this issue Dec 5, 2019 · 6 comments

Comments

@jswhit2
Copy link
Collaborator

jswhit2 commented Dec 5, 2019

Some modifications to the netcdf write component to improve IO speed and compression.

IO speed for uncompressed files has been improved by

  1. making sure all attributes are written before nf90_enddef is called (rather than switching in and out of define model with nf90_enddef/nf90_redef).
  2. creating the dataset with NF90_SHARE

C384 tests on hera show that these modifications improve the write speed by 4-5x (with compression turned off by setting ideflate=0 in model_configure). Write speeds with uncompressed netcdf are now very close to nemsio.

Unfortunately, this has no effect when compression is enabled. To improve write performance with compression I have tried tuning the chunksizes and chunk cache. The write speed seems very insensitive to these parameters, however the files compress better with a larger chunk size. Changing the chunk size to be the size of the full 3d state results in about a 25% reduction in the 3d file size with ideflate=1, nbits=14.

These changes are in PR #19

@jswhit2
Copy link
Collaborator Author

jswhit2 commented Dec 5, 2019

I may have overstated the compression improvements gained by increasing the chunksize - it appears that in many cases the improvements are not all that significant. However, it does speed up reading 2d horizontal slices of data quite significantly - which is a fairly common access pattern. Read speeds for 3d slices do not appear to be affected.

@jswhit2
Copy link
Collaborator Author

jswhit2 commented Dec 6, 2019

I have disabled writing of the _FillValue attribute, since the type of fill_value doesn't match the type of the variables in all cases this results in a 'fill value data type mismatch' error when you try to read the file. The default _FillValue is now used.

@junwang-noaa
Copy link
Collaborator

Jeff,

Are the code changes ready for commit for you are still working on it? Thanks.

@jswhit
Copy link
Contributor

jswhit commented Dec 24, 2019

It's ready

@junwang-noaa
Copy link
Collaborator

Thanks, I put it in the fv3atm commit queue, it will be committed early Jan after CCPP code changes.

junwang-noaa added a commit to junwang-noaa/fv3atm that referenced this issue Jan 8, 2020
DusanJovic-NOAA added a commit that referenced this issue Jan 24, 2020
* fv3atm issue #37: fix the real(8) lat/lon in netcdf file
* fv3atm #35: Reducing background vertical diffusivities in the inversion layers
* fv3atm #24: bug in gfsphysics/physics/moninedmf_hafs.f
* fv3atm #18: Optimize netcdf write component and bugfix for post and samfdeepcnv.f
* set (0-1) bounds for ficein_cpl
* remove cache_size due to lower netcdf verion 4.5.1 on mars
* Change ice falling to 0.9 in gfsphysics/physics/gfdl_cloud_microphys.F90
@junwang-noaa
Copy link
Collaborator

The code changes are committed, close issue.

climbfuji pushed a commit to climbfuji/fv3atm that referenced this issue Apr 24, 2020
…to_tbdhpbl

Correction: Diag%hpbl => Tbd%hpbl
junwang-noaa pushed a commit to junwang-noaa/fv3atm that referenced this issue Sep 30, 2021
LarissaReames-NOAA pushed a commit to LarissaReames-NOAA/fv3atm that referenced this issue Nov 17, 2023
* commit of new version of dycore from Weather and Climate Dynamics Group at GFDL

* updated versions of GFDL-specific files from dev/gfdl

* updated README.md with current release information

* cleaned up a few lines in fv_dynamics

* new file RELEASE.md with release notes documenting differences between this and the last release

* updated RELEASE.md message

* hand merge of diagnostic updates

* remove trailing spaces from sources

* updates to merge some GFDL specific updates into this public release

* updated README.md

* updated GFDL_tools/fv_cmip_diag to be consistent with dev/gfdl branch
LarissaReames-NOAA pushed a commit to LarissaReames-NOAA/fv3atm that referenced this issue Nov 17, 2023
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

No branches or pull requests

3 participants