New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Users/SetupNewConfiguration/Data-utilities-with-netcdf (diff) – NEMO

Changes between Version 1 and Version 2 of Users/SetupNewConfiguration/Data-utilities-with-netcdf


Ignore:
Timestamp:
2017-03-30T01:27:58+02:00 (7 years ago)
Author:
nicolasmartin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Users/SetupNewConfiguration/Data-utilities-with-netcdf

    v1 v2  
    1 '''Data utilities with netcdf''' 
     1= Data utilities with netcdf 
    22 
    33You can find here an example of bash script to manipulate netcdf files (in this example forcing core2 files). 
     
    77This is necessary because "npdq" command change all variables, but in this case we don't want to have glamt, gphit, time "short" type. 
    88 
    9  
    10 {{{ 
     9{{{#!sh 
    1110# remove useless variable from file 
    1211ncks -O -x -v V_10.15JUNE2009_orca2.nc v_10.15JUNE2009_orca2.nc  
    1312 
    14 }}} 
    15  
    16 {{{ 
    17  
    1813# exctracting coordinates variables from file, put in output file (grid_orca2.nc) 
    1914ncks -v glamt,gphit,time v_10.15JUNE2009_orca2.nc grid_orca2.nc 
    20 }}} 
    2115 
    22  
    23  
    24 {{{ 
    2516# exctracting variables from file 
    2617ncks -O -C -v V_10_MOD v_10.15JUNE2009_orca2.nc v_10.15JUNE2009_orca2.nc 
    27 }}} 
    2818 
    29  
    30  
    31 {{{ 
    3219# compress all variables of v_10.15JUNE2009_orca2.nc file, 
    3320# now variables of v_10.15JUNE2009_orca2.nc are "short" type 
    3421# (add offset and scale factor) 
    3522ncpdq -O -C -P all_xst v_10.15JUNE2009_orca2.nc v_10.15JUNE2009_orca2.nc  
    36 }}} 
    37   
    3823 
    39  
    40 {{{ 
    4124# append grid_orca2.nc file to v_10.15JUNE2009_orca2.nc file to have initial file 
    4225# with variable V_10_MOD "short" type and coordinates variables unchanged