/[MITgcm]/MITgcm/utils/scripts/xplodemnc
ViewVC logotype

Diff of /MITgcm/utils/scripts/xplodemnc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1 by baylor, Fri Jun 9 16:36:49 2006 UTC revision 1.2 by baylor, Tue Oct 24 15:44:04 2006 UTC
# Line 4  Line 4 
4  # The file should be in one directory, where this script is run.  # The file should be in one directory, where this script is run.
5  # The resulting files will be in the same directory.  # The resulting files will be in the same directory.
6    
7    DEBUG="-D 0"
8    
9  inone=$1  inone=$1
10  inone=${1:?"You must input an mnc filename to be xploded"}  inone=${1:?"You must input an mnc filename to be xploded"}
11    
# Line 15  do Line 17  do
17      exit 1      exit 1
18    fi    fi
19    
20    varls=$(ncdump -h $somefile | grep double | grep ,)  # Finding all the multidimensional variables
21      varls=$(ncdump -h $somefile | grep "double\|float" | grep , )
22    IFS=';'    IFS=';'
23    vars=    vars=
24    for somevar in ${varls}    for somevar in ${varls}
25    do    do
26     somevar1=${somevar%(*}     somevar1=${somevar%(*}
27     somevar1=${somevar1#*double }     somevar1=${somevar1#*double }
28       somevar1=${somevar1#*float }
29       echo $somevar1
30     vars=${vars}$somevar1' '     vars=${vars}$somevar1' '
31    done    done
32    echo Variables to extract: $vars    echo Variables to extract: $vars
33    IFS=' '    IFS=' '
34    for somevar in $vars    for somevar in $vars
35    do    do
36      ncks -v $somevar $somefile $somevar.$somefile      ncks $DEBUG -v $somevar $somefile $somevar.$somefile
37    done    done
38  done  done

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.22