Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Méso-NH code
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RODIER Quentin
Méso-NH code
Commits
218c706d
Commit
218c706d
authored
5 months ago
by
WAUTELET Philippe
Browse files
Options
Downloads
Patches
Plain Diff
Philippe 20/09/2024: IO: set NOFILL by default for netCDF files
parent
5f4fe673
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/LIB/SURCOUCHE/src/mode_io_file_nc4.f90
+13
-2
13 additions, 2 deletions
src/LIB/SURCOUCHE/src/mode_io_file_nc4.f90
src/LIB/SURCOUCHE/src/mode_io_write_nc4.f90
+5
-0
5 additions, 0 deletions
src/LIB/SURCOUCHE/src/mode_io_write_nc4.f90
with
18 additions
and
2 deletions
src/LIB/SURCOUCHE/src/mode_io_file_nc4.f90
+
13
−
2
View file @
218c706d
...
...
@@ -28,8 +28,8 @@ use modd_precision, only: CDFINT
use
mode_io_tools_nc4
,
only
:
IO_Err_handle_nc4
,
IO_Knowndims_set_nc4
,
IO_Iocdf_alloc_nc4
use
mode_msg
use
NETCDF
,
only
:
NF90_CLOBBER
,
NF90_GLOBAL
,
NF90_NETCDF4
,
NF90_NOERR
,
NF90_NOWRITE
,
&
NF90_CLOSE
,
NF90_CREATE
,
NF90_GET_ATT
,
NF90_INQUIRE
,
NF90_INQUIRE_ATTRIBUTE
,
&
use
NETCDF
,
only
:
NF90_GLOBAL
,
NF90_NETCDF4
,
NF90_NOERR
,
NF90_NOWRITE
,
&
NF90_CLOSE
,
NF90_GET_ATT
,
NF90_INQUIRE
,
NF90_INQUIRE_ATTRIBUTE
,
&
NF90_OPEN
,
NF90_PUT_ATT
,
NF90_STRERROR
implicit
none
...
...
@@ -44,10 +44,13 @@ subroutine IO_File_create_nc4(tpfile,hprogram_orig)
use
mode_io_tools
,
only
:
IO_Filename_construct
use
mode_io_tools_mnhversion
,
only
:
IO_Mnhversion_set
use
NETCDF
,
only
:
NF90_CLOBBER
,
NF90_CREATE
,
NF90_NOFILL
,
NF90_SET_FILL
type
(
tfiledata
),
intent
(
inout
)
::
tpfile
character
(
len
=*
),
optional
,
intent
(
in
)
::
hprogram_orig
!to emulate a file coming from this program
character
(
len
=
:),
allocatable
::
yfilem
! name of the file
integer
(
kind
=
CDFINT
)
::
ioldmode
integer
(
kind
=
CDFINT
)
::
istatus
call
print_msg
(
NVERB_DEBUG
,
'IO'
,
'IO_File_create_nc4'
,
'called for '
//
trim
(
tpfile
%
cname
))
...
...
@@ -60,6 +63,14 @@ subroutine IO_File_create_nc4(tpfile,hprogram_orig)
if
(
istatus
/
=
NF90_NOERR
)
then
call
print_msg
(
NVERB_FATAL
,
'IO'
,
'IO_File_create_nc4'
,
'NF90_CREATE for '
//
trim
(
yfilem
)//
'.nc: '
//
NF90_STRERROR
(
istatus
))
end
if
! Set pre-filling to NF90_NOFILL
! In theory, this should give better performance
istatus
=
NF90_SET_FILL
(
tpfile
%
nncid
,
NF90_NOFILL
,
ioldmode
)
if
(
istatus
/
=
NF90_NOERR
)
then
call
print_msg
(
NVERB_FATAL
,
'IO'
,
'IO_File_create_nc4'
,
'NF90_CREATE for '
//
trim
(
yfilem
)//
'.nc: '
//
NF90_STRERROR
(
istatus
))
end
if
call
IO_Not_cleanly_closed_set_nc4
(
tpfile
)
call
IO_Knowndims_set_nc4
(
tpfile
,
hprogram_orig
=
hprogram_orig
)
end
if
...
...
This diff is collapsed.
Click to expand it.
src/LIB/SURCOUCHE/src/mode_io_write_nc4.f90
+
5
−
0
View file @
218c706d
...
...
@@ -553,6 +553,11 @@ if ( istatus /= NF90_NOERR ) then
istatus
=
NF90_DEF_VAR
(
tpfile
%
nncid
,
yvarname
,
itype
,
ivdims
,
ivarid
)
if
(
istatus
/
=
NF90_NOERR
)
call
IO_Err_handle_nc4
(
istatus
,
'IO_Field_create_nc4'
,
'NF90_DEF_VAR'
,
Trim
(
yvarname
)
)
! Set pre-filling to NF90_NOFILL
! Not done here because already set at creation time with NF90_SET_FILL
! istatus = NF90_DEF_VAR_FILL( tpfile%nncid, ivarid, NF90_NOFILL, 0. )
! if ( istatus /= NF90_NOERR ) call IO_Err_handle_nc4( istatus, 'IO_Field_create_nc4', 'NF90_DEF_VAR_FILL', Trim( yvarname ) )
! Add compression if asked for
if
(
tpfile
%
lnccompress
.and.
tpfield
%
ntype
==
TYPEREAL
.and.
tpfield
%
ndims
>=
1
)
then
istatus
=
NF90_DEF_VAR_DEFLATE
(
tpfile
%
nncid
,
ivarid
,
SHUFFLE
,
DEFLATE
,
tpfile
%
nnccompress_level
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment