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

Contents of /MITgcm/utils/scripts/xplodemnc

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


Revision 1.3 - (show annotations) (download)
Wed Nov 8 18:50:08 2006 UTC (17 years, 7 months ago) by baylor
Branch: MAIN
CVS Tags: checkpoint58u_post, checkpoint58w_post, checkpoint60, checkpoint61, checkpoint58r_post, checkpoint58x_post, checkpoint58t_post, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint59, checkpoint58y_post, checkpoint58v_post, checkpoint58s_post, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61t, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q
Changes since 1.2: +4 -3 lines
This fixes the float precision recognition problem.

1 #!/bin/bash
2 # This is a shell script to separate an MITgcm mnc output file into
3 # one file per multi-dimensional variable.
4 # The file should be in one directory, where this script is run.
5 # The resulting files will be in the same directory.
6
7 DEBUG="--dbg_lvl=0"
8
9 inone=$1
10 inone=${1:?"You must input an mnc filename to be xploded"}
11
12 for somefile in $@
13 do
14 echo Extracting from file $somefile...
15 if [ ! -s $somefile ]; then
16 echo "Error: $somefile is missing or empty"
17 exit 1
18 fi
19
20 # Finding all the multidimensional variables
21 varls=$(ncdump -h $somefile | grep "double\|float" | grep , )
22 IFS=';'
23 vars=
24 for somevar in ${varls}
25 do
26 somevar1=${somevar%(*}
27 somevar1=${somevar1#*double }
28 somevar1=${somevar1#*float }
29 # echo $somevar1
30 vars=${vars}$somevar1' '
31 done
32 echo Variables to extract: $vars iter
33 IFS=' '
34 for somevar in $vars
35 do
36 ncks $DEBUG -v $somevar $somefile $somevar.$somefile
37 done
38 ncks $DEBUG -v iter $somefile iter.$somefile
39 done

  ViewVC Help
Powered by ViewVC 1.1.22