Changeset 2470 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Apr 24, 2019, 7:33:31 PM (6 years ago)
Author:
lfita
Message:

Adding:

  • `CFfile_fixTime': Operation to fix a netCDF file with a time axis folowing CF-conventions, but with a wrong set-up following a set of available operations
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var.py

    r2404 r2470  
    7575## e.g. # nc_var.py -o compress_data -S 'XLAND:Time|0:single,1:X|west_east|XLONG,Y|south_north|XLAT' -f wrfout_d01_1995-01-01_00:00:00 -v T2,LU_INDEX,Times
    7676## e.g. # nc_var.py -o CFfile_creation -S 'lon|360,lat|180,time|None@20:global' -v 'tas#time;lat;lon#f#None,time#time#f8#units|seconds!since!1949-12-01!00:00:00|S' -f newCF.nc
     77## e.g. # nc_var.py -o CFfile_fixTime -f tasmin_Amon_BNU-ESM_historical_r1i1p1_185001-200512_lonlatbox.nc -S 'setCalendar;setRefDate,19491201000000' -v time
    7778
    7879from optparse import OptionParser
     
    9293# CDO_toCF: Function to pass a CDO output file to CF-conventions
    9394# CFfile_creation: Operation to create a file folowing CF-conventions
     95# CFfile_fixTime: Operation to fix a netCDF file with a time axis folowing CF-conventions, but
     96#   with a wrong set-up following a set of available operations
    9497# CFmorzization: Function to provide a CF-compilation version of a variable within a file
    9598# chdimname: Changing the name of the dimension
     
    231234
    232235operations=['addDim', 'addVar', 'addvals', 'area_weighted', 'CDO_toCF',              \
    233   'CFfile_creation', 'CFmorzization', 'chdimname', 'changevartype',                  \
    234   'checkallvars', 'checkAllValues', 'checkNaNs',                                     \
     236  'CFfile_creation', 'CFfile_fixTime', 'CFmorzization', 'chdimname',                 \
     237  'changevartype', 'checkallvars', 'checkAllValues', 'checkNaNs',                    \
    235238  'chgtimestep', 'chvarname', 'cleaning_varsfile', 'compress_data',                  \
    236239  'compute_deaccum', 'compute_opersvarsfiles',                                       \
     
    356359elif oper == 'CFfile_creation':
    357360    ncvar.CFfile_creation(opts.values, opts.ncfile, opts.varname)
     361elif oper == 'CFfile_fixTime':
     362    ncvar.CFfile_fixTime(opts.values, opts.ncfile, opts.varname)
    358363elif oper == 'CFmorzization':
    359364    ncvar.CFmorzization(opts.values, opts.ncfile, opts.varname)
Note: See TracChangeset for help on using the changeset viewer.