Commit efd26ca6 authored by Don Morton's avatar Don Morton

Changed double precision NC write to single precision.

Ticket #384 comment:17
parent 857dfd06
......@@ -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"," ")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment