/[MITgcm]/MITgcm_contrib/gael/profilesMatlabProcessing/profiles_IO_v2/MITprof_write.m
ViewVC logotype

Annotation of /MITgcm_contrib/gael/profilesMatlabProcessing/profiles_IO_v2/MITprof_write.m

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


Revision 1.1 - (hide annotations) (download)
Wed Nov 3 18:31:35 2010 UTC (14 years, 8 months ago) by gforget
Branch: MAIN
- introducing MITprof_create.m MITprof_read.m MITprof_write.m that are bound
  to become the basic matlab I/O routines associated with MITgcm/pkg/profiles
- profiles_prep_main.m : isolate parts associated with atlases as a second step, use
  MITprof_read to re-load the step1 data set from nc file in the vectorized step 2.
- profiles_prep_locate.m profiles_prep_tests.m profiles_prep_weights.m: vectorized step2

1 gforget 1.1 %function: MITprof_write
2     %object: read netcdf data files in the "MIT format"
3     %author: Gael Forget (gforget@mit.edu)
4     %date: june 21th, 2006
5     %
6     %usage: []=MITprof_write(dirIn,fileIn,MITprof);
7     % ---> writes MITprof to the [dirIn fileIn] file
8     % that has previously been created using MITprof_create
9     %
10     %inputs: dirIn data file directory
11     % fileIn data file name
12     % (list_vars optional variable list)
13     %
14     %outputs: MITprof structure containing the various fields/vectors
15    
16     function []=MITprof_write(dirIn,fileIn,MITprof);
17    
18     tmp1=dir([dirIn fileIn]);
19     if isempty(tmp1); tmp1=dir([dirIn fileIn '.nc']); end;
20     if isempty(tmp1); error([fileIn ' file not found']); end;
21     nc=netcdf([dirIn tmp1.name],'write');
22    
23     list_vars=fieldnames(MITprof);
24     for ii=1:length(list_vars);
25     eval(['tmp1=MITprof.' list_vars{ii} ';']);
26     nc{list_vars{ii}}(:)=tmp1;
27     end;
28    
29     close(nc);
30    

  ViewVC Help
Powered by ViewVC 1.1.22