Skip to content

Commit

Permalink
3.3.1 (#301)
Browse files Browse the repository at this point in the history
* update to 3.2.9 in cmor.h

* update tables to 01.00.17

* use CdUnif

* fix Table memory

* fix Table version 6.0 to 6.2

* Fix licences and conventions; Fix memory issue

* insure that cdms2 is not loaded

* update tables

* fix cronjob message for CMIP6_CV push

* update to version 3.3.0

* use 1024 character, fix regex

* Make sure buffer does not overflow due to license

* Add multiprocessing to PrePARE

* pep8 code

* create parallelization for PrePARE

* fix typo

* Fix basin integer missing value; add test; move code around in PrePARE.py

* update test tables

* fix conda recipe

* pinning anaconda-client to 1.6.5 due to network issue

* check in source section is defined in CV souce_id

* fix external variable issue

* add test for branch_time...

* fix climatology issue

* change geo_region to sector

* update upload scripts

* add then to script

* fix travis; branch_time.. message; license(OSX)

* use gcc_linux-64

* try miniconda 4.3.21

* change docker to centos 6.8

* change branch_time message

* fix time_bnds issue and missing_value for Ofx test

* Release 3.3.1

* use GCC instead of gcc_linux-64

* add gfortran to .travis

* use gfortran_linux-64

* revert to miniconda 4.3.21
  • Loading branch information
dnadeau4 authored Feb 15, 2018
1 parent 4fa26a1 commit 18328b7
Show file tree
Hide file tree
Showing 80 changed files with 2,152 additions and 1,591 deletions.
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ services:
sudo: false

before_install:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh
-O miniconda.sh; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then wget --no-check https://repo.continuum.io/miniconda/Miniconda2-4.3.21-Linux-x86_64.sh -O miniconda.sh ; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then wget https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh
-O miniconda.sh; fi
- export PATH="$HOME/miniconda/bin:$PATH"
Expand All @@ -23,8 +22,10 @@ before_install:
- conda install openssl=1.0.2d
- conda install cdms2 -c uvcdat/label/nightly -c conda-forge -c uvcdat
- conda install udunits2 -c uvcdat/label/nightly -c conda-forge -c uvcdat
- conda install gcc

- if [ "$TRAVIS_OS_NAME" = "linux" ]; then conda install gcc; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then conda install gcc; fi
- source deactivate root
- source activate root
install:
- git clone https://github.com/PCMDI/cmip6-cmor-tables
- ln -s cmip6-cmor-tables/Tables Tables
Expand All @@ -50,4 +51,4 @@ env:

after_success:
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then bash scripts/conda_upload.sh ${TRAVIS_BRANCH} ; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then docker run -v `pwd`:/travis_home -e CONDA_UPLOAD_TOKEN=${CONDA_UPLOAD_TOKEN} -a STDOUT -a STDERR cdat/conda:conda-forge-cdms2 /travis_home/scripts/conda_upload.sh ${TRAVIS_BRANCH} ; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then docker run -v `pwd`:/travis_home -e CONDA_UPLOAD_TOKEN=${CONDA_UPLOAD_TOKEN} -a STDOUT -a STDERR centos:6.8 /travis_home/scripts/conda_upload.sh ${TRAVIS_BRANCH} ; fi
4 changes: 2 additions & 2 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
INSTALLATION INSTRUCTIONS
-------------------------
Climate Model Output Rewriter (CMOR) version 3.3.0 installation instructions.
Climate Model Output Rewriter (CMOR) version 3.3.1 installation instructions.


DOWNLOAD
Expand All @@ -13,7 +13,7 @@ cd CMOR

INSTALLATION
------------
CMOR 3.3.0 requires external packages that need to be installed first.
CMOR 3.3.1 requires external packages that need to be installed first.
It can be compiled/linked against either NetCDF3 or NetCDF4. If you
decide to go with NetCDF4 be sure to build NetCDF4 with the
--enable-netcdf-4 option!
Expand Down
3 changes: 2 additions & 1 deletion Lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
close, grid, set_grid_mapping, time_varying_grid_coordinate, dataset_json,
set_cur_dataset_attribute, get_cur_dataset_attribute,
has_cur_dataset_attribute, set_variable_attribute, get_variable_attribute,
has_variable_attribute, get_final_filename, set_deflate, set_furtherinfourl)
has_variable_attribute, get_final_filename, set_deflate, set_furtherinfourl,
set_climatology, get_climatology)

try:
from check_CMOR_compliant import checkCMOR
Expand Down
20 changes: 18 additions & 2 deletions Lib/pywrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import _cmor
from _cmor import CMORError

global climatology
climatology = False

try:
import cdtime
has_cdtime = True
Expand Down Expand Up @@ -297,6 +300,16 @@ def set_grid_mapping(grid_id, mapping_name, parameter_names,
pvals = numpy.ascontiguousarray(pvals).astype('d')
return _cmor.set_grid_mapping(grid_id, mapping_name, pnms, pvals, punit)

def set_climatology(entry):
global climatology
if( entry == True ):
climatology = True
else:
climatology = False

def get_climatology():
global climatology
return climatology

def axis(table_entry, units=None, length=None,
coord_vals=None, cell_bounds=None, interval=None):
Expand All @@ -321,6 +334,9 @@ def axis(table_entry, units=None, length=None,
raise Exception(
"You need to pass a table_entry to match in the cmor table")

if(table_entry in ['time2', 'time3']):
set_climatology(True)

if coord_vals is None:
if cell_bounds is not None:
raise Exception("you passed cell_bounds but no coords")
Expand Down Expand Up @@ -740,7 +756,7 @@ def write(var_id, data, ntimes_passed=None, file_suffix="",

data = numpy.ascontiguousarray(numpy.ravel(data))

if time_bnds is not None:
if time_bnds is not None:
if numpy.ma.isMA(time_bnds):
time_bnds = numpy.ascontiguousarray(time_bnds.filled())
elif has_oldma and numpy.oldnumeric.ma.isMA(time_bnds):
Expand All @@ -762,7 +778,7 @@ def write(var_id, data, ntimes_passed=None, file_suffix="",
raise Exception(
"error time_bnds' 2nd dimension must be of length 2")
bnds = []
if time_bnds.shape[0] > 1:
if time_bnds.shape[0] > 1 and get_climatology() is False:
_check_time_bounds_contiguous(time_bnds)
bnds = _flatten_time_bounds(time_bnds)
else:
Expand Down
Loading

0 comments on commit 18328b7

Please sign in to comment.