[MITgcm-support] How to join two nc files?

Baylor Fox-Kemper baylor at MIT.EDU
Tue Jun 6 09:44:07 EDT 2006


One can also use ferret to open multiple tiles using ferret.  Here is  
an example.

In ferret, one types

yes? use state.0000000000.t001.nc
*** NOTE: Units on axis "T" are not recognized: s
*** NOTE: They will not be convertible:
yes? use state.0000000000.t002.nc
*** NOTE: Units on axis "T" are not recognized: s
*** NOTE: They will not be convertible:
yes? use state.0000000000.t003.nc
*** NOTE: Units on axis "T" are not recognized: s
*** NOTE: They will not be convertible:

Then the files will be available:

yes? sho dat
      currently SET data sets:
     1> ./state.0000000000.t001.nc
name     title                             I         J          
K         L
ITER      
iteration_count                  ...       ...       ...       1:86
U                                         1:151     1:30       
1:60      1:86
V                                         1:150     1:31       
1:60      1:86
TEMP     potential_temperature            1:150     1:30       
1:60      1:86
S        salinity                         1:150     1:30       
1:60      1:86
ETA      free-surface_r-anomaly           1:150      
1:30      ...       1:86
W                                         1:150     1:30       
1:60      1:86
     2> ./state.0000000000.t002.nc
name     title                             I         J          
K         L
ITER      
iteration_count                  ...       ...       ...       1:86
U                                         1:151     1:30       
1:60      1:86
V                                         1:150     1:31       
1:60      1:86
TEMP     potential_temperature            1:150     1:30       
1:60      1:86
S        salinity                         1:150     1:30       
1:60      1:86
ETA      free-surface_r-anomaly           1:150      
1:30      ...       1:86
W                                         1:150     1:30       
1:60      1:86
     3> ./state.0000000000.t003.nc  (default)
name     title                             I         J          
K         L
ITER      
iteration_count                  ...       ...       ...       1:86
U                                         1:151     1:30       
1:60      1:86
V                                         1:150     1:31       
1:60      1:86
TEMP     potential_temperature            1:150     1:30       
1:60      1:86
S        salinity                         1:150     1:30       
1:60      1:86
ETA      free-surface_r-anomaly           1:150      
1:30      ...       1:86
W                                         1:150     1:30       
1:60      1:86


You can then plot them all.  First notice that the data tiles lie  
next to each other in y, but share the same grid in T and X.  For  
these tiles, Y ranges from 50 to 8950 over the three tiles.

yes? sho grid temp[d=3]
     GRID GIS4
name       axis              # pts   start                end
X         X                  150 r   50                   14950
Y2        Y                   30 r   6050                 8950
Z         Z                   60 r   -297.5               -2.5
T         T (s)               86 r   0                    1224000
yes? sho grid temp[d=1]
     GRID GHS4
name       axis              # pts   start                end
X         X                  150 r   50                   14950
Y         Y                   30 r   50                   2950
Z         Z                   60 r   -297.5               -2.5
T         T (s)               86 r   0                    1224000
yes? sho grid temp[d=2]
     GRID GJN4
name       axis              # pts   start                end
X         X                  150 r   50                   14950
Y1        Y                   30 r   3050                 5950
Z         Z                   60 r   -297.5               -2.5
T         T (s)               86 r   0                    1224000

So, you can plot them all like this::

yes? contour/hlim=0:15000/vlim=0:9000 TEMP[d=1,l=86,k=1]
yes? contour/hlim=0:15000/vlim=0:9000/OV TEMP[d=2,l=86,k=1]
yes? contour/hlim=0:15000/vlim=0:9000/OV TEMP[d=3,l=86,k=1]

Notice that the vlim is *bigger* than any individual tile, so when  
you overlay, they tiles line up next to each other.

You may have to specify the contour levels so that they will be the  
same over the different tiles:

yes? contour/hlim=0:15000/vlim=0:9000/lev=(14.25,14.3,.0005) TEMP 
[d=1,l=86,k=1]
yes? contour/hlim=0:15000/vlim=0:9000/lev=(14.25,14.3,.0005)/ov TEMP 
[d=2,l=86,k=1]
yes? contour/hlim=0:15000/vlim=0:9000/lev=(14.25,14.3,.0005)/ov TEMP 
[d=3,l=86,k=1]


Cheers,
    -Baylor










On Jun 6, 2006, at 3:34 AM, Brainf wrote:

>
> Hi mitgcm,
>    One time have two nc files, like state.0000000000.t001.nc and  
> state.0000000000.t002.nc,
> useing ferret can see only one file, it is  difficult to use.
> How to join this two nc file to one file?
>
> I found a util 'joinds' in MITgcm\utils\scripts,
> Maybe it can do this work,
> so I type:
> $ ./joinds ./t1/state.0000000000.t001.nc ./t1/state.0000000000.t002.nc
>
> but it doesn't work and said " No dataset found.   "......
>
> How can I do?
>
> Best regards.
>
> Brainf
> brainf at 163.com
> 2006-06-06
>
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20060606/05853134/attachment.htm>


More information about the MITgcm-support mailing list