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

Annotation of /MITgcm/utils/scripts/xplodemnc

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


Revision 1.1 - (hide annotations) (download)
Fri Jun 9 16:36:49 2006 UTC (17 years, 11 months ago) by baylor
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint58n_post, checkpoint58q_post, checkpoint58j_post, checkpoint58i_post, checkpoint58o_post, checkpoint58k_post, checkpoint58p_post, checkpoint58m_post
Here are two scripts *USING ONLY NCO OPERATORS and NCDUMP* that allow combination of multi-tile output into global files.  Please test and improve them!

1 baylor 1.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     inone=$1
8     inone=${1:?"You must input an mnc filename to be xploded"}
9    
10     for somefile in $@
11     do
12     echo Extracting from file $somefile...
13     if [ ! -s $somefile ]; then
14     echo "Error: $somefile is missing or empty"
15     exit 1
16     fi
17    
18     varls=$(ncdump -h $somefile | grep double | grep ,)
19     IFS=';'
20     vars=
21     for somevar in ${varls}
22     do
23     somevar1=${somevar%(*}
24     somevar1=${somevar1#*double }
25     vars=${vars}$somevar1' '
26     done
27     echo Variables to extract: $vars
28     IFS=' '
29     for somevar in $vars
30     do
31     ncks -v $somevar $somefile $somevar.$somefile
32     done
33     done

  ViewVC Help
Powered by ViewVC 1.1.22