-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1996 from GEOS-ESM/develop
GitFlow: Merge Develop into main for 2.35 release
- Loading branch information
Showing
51 changed files
with
2,116 additions
and
1,876 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
subroutine Shave32 ( a_shaved, a, n, xbits, has_undef, undef, chunksize, rc ) | ||
|
||
! | ||
! Simple cover for f2py. | ||
! | ||
use iso_fortran_env, only: REAL32 | ||
implicit NONE | ||
integer, intent(in) :: n ! array size | ||
real(kind=REAL32), intent(in) :: a(n) ! array to be shaved, usually 2D | ||
integer, intent(in) :: xbits ! number of mantissa bits to zero (out of 24) | ||
integer, intent(in) :: has_undef ! set to 1 if undef is present, 0 otherwise | ||
real(kind=REAL32), intent(in) :: undef ! undef value | ||
integer, intent(in) :: chunksize ! find mid-range over chunksizes | ||
|
||
real(kind=REAL32), intent(out) :: a_shaved(n) ! shaved array | ||
integer, intent(out) :: rc ! error code | ||
|
||
! --- | ||
|
||
integer, external :: ShaveMantissa32 | ||
|
||
rc = ShaveMantissa32(a_shaved,a,n,xbits,has_undef,undef,chunksize) | ||
|
||
end subroutine Shave32 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
""" | ||
SImple python interface to the ShaveMantissa function | ||
""" | ||
|
||
MISSING = 1.0E15 | ||
|
||
from ShaveMantissa_ import shave32 | ||
|
||
def shave(a,xbits=12,has_undef=0,undef=MISSING,chunksize=-1): | ||
""" | ||
Shaves bits from mantissa of float point array for better netCDF4 compression | ||
using gzip. | ||
a_shaved = shave(a,...) | ||
xbits --- number of bits to shave | ||
has_undef --- set to 1 if undefs are present | ||
undef --- undef value | ||
chunksize --- for scaling of array to be shaved: find mid-range value | ||
over chunksizes. If negative, set to len(a) | ||
Typically this function is used for a single vertical slice at time. | ||
""" | ||
|
||
n = len(a) | ||
if chunksize<0: chunksize = n | ||
|
||
a_shaved, rc = shave32(a,xbits,has_undef,undef,chunksize) | ||
|
||
if rc: | ||
raise ValueError, 'shave: error on return from ShaveMantissa_.shave32: %d'%rc | ||
|
||
return a_shaved | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.