Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Flexpart
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
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
Benjamin Püschel
Flexpart
Commits
efd26ca6
Commit
efd26ca6
authored
7 years ago
by
Don Morton
Browse files
Options
Downloads
Patches
Plain Diff
Changed double precision NC write to single precision.
Ticket #384 comment:17
parent
857dfd06
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
flexpart_code/grib2nc4/fp2nc4io_mod.F90
+33
-16
33 additions, 16 deletions
flexpart_code/grib2nc4/fp2nc4io_mod.F90
with
33 additions
and
16 deletions
flexpart_code/grib2nc4/fp2nc4io_mod.F90
+
33
−
16
View file @
efd26ca6
...
...
@@ -9,6 +9,13 @@ MODULE fp2nc4io_mod
! *
! May 2016 *
! *
! 2017-12-03 DJM - *
! *
! - Changed NF90_DOUBLE to NF90 FLOAT (6 places) *
! - Cleaned up long lines from addition of NC descriptions *
! *
! *
! *
!****************************************************************
USE
par_mod
...
...
@@ -154,10 +161,11 @@ CONTAINS
ENDDO
! Write the height field - variable 'height' is defined in com_mod
ncfunc_retval
=
nf90_def_var
(
ncid
,
'height'
,
NF90_
DOUBLE
,
&
ncfunc_retval
=
nf90_def_var
(
ncid
,
'height'
,
NF90_
FLOAT
,
&
&
z_dimid
,
varid
)
! attributes
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,
"height of the FLEXPART model levels"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,&
&
"height of the FLEXPART model levels"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"units"
,
"m a.g.l"
)
ncfunc_retval
=
nf90_def_var_deflate
(
ncid
,
varid
,
&
...
...
@@ -169,31 +177,35 @@ CONTAINS
! Write some of the scalar metadata variables
! dx, dy, xlon0, xlat0 are all defined in com_mod
ncfunc_retval
=
nf90_def_var
(
ncid
,
'dx'
,
NF90_
DOUBLE
,
varid
)
ncfunc_retval
=
nf90_def_var
(
ncid
,
'dx'
,
NF90_
FLOAT
,
varid
)
ncfunc_retval
=
nf90_put_var
(
ncid
,
varid
,
dx
)
! attributes
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,
"grid distance in x direction"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,&
&
"grid distance in x direction"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"units"
,
"degrees"
)
ncfunc_retval
=
nf90_def_var
(
ncid
,
'dy'
,
NF90_
DOUBLE
,
varid
)
ncfunc_retval
=
nf90_def_var
(
ncid
,
'dy'
,
NF90_
FLOAT
,
varid
)
ncfunc_retval
=
nf90_put_var
(
ncid
,
varid
,
dy
)
! attributes
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,
"grid distance in y direction"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,&
&
"grid distance in y direction"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"units"
,
"degrees"
)
ncfunc_retval
=
nf90_def_var
(
ncid
,
'xlon0'
,
NF90_
DOUBLE
,
varid
)
ncfunc_retval
=
nf90_def_var
(
ncid
,
'xlon0'
,
NF90_
FLOAT
,
varid
)
ncfunc_retval
=
nf90_put_var
(
ncid
,
varid
,
xlon0
)
! attributes
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,
"longitude of the lowest left corner"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,&
&
"longitude of the lowest left corner"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"units"
,
"degrees"
)
ncfunc_retval
=
nf90_def_var
(
ncid
,
'ylat0'
,
NF90_
DOUBLE
,
varid
)
ncfunc_retval
=
nf90_def_var
(
ncid
,
'ylat0'
,
NF90_
FLOAT
,
varid
)
ncfunc_retval
=
nf90_put_var
(
ncid
,
varid
,
ylat0
)
! attributes
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,
"latitude of the lowest left corner"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,&
&
"latitude of the lowest left corner"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"units"
,
"degrees"
)
...
...
@@ -297,7 +309,7 @@ CONTAINS
nc_varname
=
to_upper
(
varname
)
! Create the variable in the NetCDF file
ncfunc_retval
=
nf90_def_var
(
ncid
,
nc_varname
,
NF90_
DOUBLE
,
&
ncfunc_retval
=
nf90_def_var
(
ncid
,
nc_varname
,
NF90_
FLOAT
,
&
&
dimids
,
varid
)
ncfunc_retval
=
nf90_def_var_deflate
(
ncid
,
varid
,
&
...
...
@@ -315,7 +327,8 @@ CONTAINS
ncfunc_retval
=
nf90_put_var
(
ncid
,
varid
,
&
&
uu
(
0
:
nx
-1
,
0
:
ny
-1
,
1
:
nz
,
1
))
! attributes
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,
"U component of wind in the X[horizontal] direction"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,&
&
"U component of wind in the X[horizontal] direction"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"units"
,
"m s**-1"
)
...
...
@@ -323,7 +336,8 @@ CONTAINS
ncfunc_retval
=
nf90_put_var
(
ncid
,
varid
,
&
&
vv
(
0
:
nx
-1
,
0
:
ny
-1
,
1
:
nz
,
1
))
! attributes
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,
"V component of wind in the Y[horizontal] direction"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,&
&
"V component of wind in the Y[horizontal] direction"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"units"
,
"m s**-1"
)
...
...
@@ -331,14 +345,16 @@ CONTAINS
ncfunc_retval
=
nf90_put_var
(
ncid
,
varid
,
&
&
tt
(
0
:
nx
-1
,
0
:
ny
-1
,
1
:
nz
,
1
))
! attributes
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,
"temperature"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,&
&
"temperature"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"units"
,
"k"
)
ELSEIF
(
nc_varname
==
'W'
)
THEN
ncfunc_retval
=
nf90_put_var
(
ncid
,
varid
,
&
&
ww
(
0
:
nx
-1
,
0
:
ny
-1
,
1
:
nz
,
1
))
! attributes
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,
"wind component in the Z[vertical] direction"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,&
&
"wind component in the Z[vertical] direction"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"units"
,
"m s**-1"
)
...
...
@@ -346,7 +362,8 @@ CONTAINS
ncfunc_retval
=
nf90_put_var
(
ncid
,
varid
,
&
&
qv
(
0
:
nx
-1
,
0
:
ny
-1
,
1
:
nz
,
1
))
! attributes
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,
"specific humidity"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"description"
,&
&
"specific humidity"
)
ncfunc_retval
=
nf90_put_att
(
ncid
,
varid
,
"units"
,
" "
)
...
...
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