Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[submodule "fv3/atmos_cubed_sphere"]
path = fv3/atmos_cubed_sphere
url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere
branch = dev/emc
branch = production/GFS.v17
[submodule "ccpp/framework"]
path = ccpp/framework
url = https://github.com/NCAR/ccpp-framework
Expand Down
4 changes: 2 additions & 2 deletions io/module_fv3_io_def.F90
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ module module_fv3_io_def

!> Deflate level to use, 0 means no deflate.
integer,dimension(:),allocatable :: ideflate

integer,dimension(:),allocatable :: ideflate_rst
!> Number of significant digits for lossy compression.
integer,dimension(:),allocatable :: quantize_nsd

!> Zstandard compression level, 0 means no zstandard compression.
integer,dimension(:),allocatable :: zstandard_level

integer,dimension(:),allocatable :: zstandard_level_rst
!> Quantize mode to use for lossy compression.
character(len=esmf_maxstr),dimension(:),allocatable :: quantize_mode

Expand Down
6 changes: 3 additions & 3 deletions io/module_write_restart_netcdf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module module_write_restart_netcdf
use mpi_f08
use esmf
use netcdf
use module_fv3_io_def,only : zstandard_level
use module_fv3_io_def,only : zstandard_level_rst

implicit none
private
Expand Down Expand Up @@ -417,8 +417,8 @@ subroutine write_restart_netcdf(wrtfb, filename, &

ncerr = nf90_def_var_chunking(ncid, varids(i), NF90_CHUNKED, chunksizes) ; NC_ERR_STOP(ncerr)

if (zstandard_level(1) > 0) then
ncerr = nf90_def_var_zstandard(ncid, varids(i), zstandard_level(1))
if (zstandard_level_rst(1) > 0) then
ncerr = nf90_def_var_zstandard(ncid, varids(i), zstandard_level_rst(1))
if (ncerr /= nf90_noerr) then
if (ncerr == nf90_enofilter) then
if (mype == 0) write(0,*) 'Zstandard filter not found.'
Expand Down
7 changes: 7 additions & 0 deletions io/module_wrt_grid_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ module module_wrt_grid_comp
cen_lon, cen_lat, &
lon1, lat1, lon2, lat2, dlon, dlat, &
stdlat1, stdlat2, dx, dy, iau_offset, &
ideflate_rst, zstandard_level_rst, &
ideflate, zstandard_level, lflname_fulltime
use module_write_netcdf, only : write_netcdf
use module_write_restart_netcdf, only : write_restart_netcdf
Expand Down Expand Up @@ -378,9 +379,11 @@ subroutine wrt_initialize_p1(wrt_comp, imp_state_write, exp_state_write, clock,
allocate(jchunk3d(ngrids))
allocate(kchunk3d(ngrids))
allocate(ideflate(ngrids))
allocate(ideflate_rst(ngrids))
allocate(quantize_mode(ngrids))
allocate(quantize_nsd(ngrids))
allocate(zstandard_level(ngrids))
allocate(zstandard_level_rst(ngrids))

allocate(wrt_int_state%out_grid_info(ngrids))

Expand Down Expand Up @@ -494,11 +497,15 @@ subroutine wrt_initialize_p1(wrt_comp, imp_state_write, exp_state_write, clock,

! zstandard compression flag
call ESMF_ConfigGetAttribute(config=CF,value=zstandard_level(n),default=0,label ='zstandard_level:',rc=rc)
call ESMF_ConfigGetAttribute(config=CF,value=zstandard_level_rst(n),default=0,label ='zstandard_level_rst:',rc=rc)
if (zstandard_level(n) < 0) zstandard_level(n)=0
if (zstandard_level_rst(n) < 0) zstandard_level_rst(n)=0

! zlib compression flag
call ESMF_ConfigGetAttribute(config=CF,value=ideflate(n),default=0,label ='ideflate:',rc=rc)
call ESMF_ConfigGetAttribute(config=CF,value=ideflate_rst(n),default=0,label ='ideflate_rst:',rc=rc)
if (ideflate(n) < 0) ideflate(n)=0
if (ideflate_rst(n) < 0) ideflate_rst(n)=0

if (ideflate(n) > 0 .and. zstandard_level(n) > 0) then
write(0,*)"wrt_initialize_p1: zlib and zstd compression cannot be both enabled at the same time"
Expand Down