Parent Directory | Revision Log | Revision Graph
Implemented new I/O package (mdsio.F). This package does parallel I/O in much the same way as dfile.F used to except it uses "direct access" rather than (f77) unformatted sequential access. Problems with dfile.F package included: o unnecessary memory use (each process had two global sized buffers) o inability to read the files it had written without post-processing o "tiled" files were tiled by process/thread rather than actual tiles o created huge numbers of files with no alternatives Features of the mdsio.F package: o direct-access binary writes o no excessive memory use o ability to read/write from multiple record files o "tiled" files are based on "WRAPPER" tiles so that the number and content of files is independent of the number of threads and/or processes o option to create single "global" files rather than "tiled" files o ability to read both "global" and "tiled" files [Caveat: the tiling of files must match the model tiles] o checkpoints now use a single file per model section ie. one file for the hydrostatic model core, one file for the non-hydrostatic extensions and one file for the C-D extensions o the mid-level I/O routines now is broken into more source files read_write_fld.F supplies basic I/O routines with the same interface as the original I/O package read_write_rec.F supplies I/O routines which allow multiple records write_state.F writes the model state checkpoint.F supplies the read/write checkpoint routines All the example input data has had to be modified to be direct-access. Otherwise only routines that used I/O have been affected and not all of those have been due to the continuity of arguments in the read_write_fld.F routines. What needs to be done? We have to create a suite of conversion utilities for users with old-style data. Also supply the option for using old-style I/O, not just for die-hards but for reading data too extensive to be converted. And more...
1 | adcroft | 1.1 | % This is a matlab script that generates the input data |
2 | |||
3 | % Dimensions of grid | ||
4 | nx=80; | ||
5 | ny=42; | ||
6 | nz=8; | ||
7 | % Nominal depth of model (meters) | ||
8 | H=4500; | ||
9 | % Scale of bump (m) | ||
10 | L=25e3; | ||
11 | % Height of bump (m) | ||
12 | dh=0.90*H; | ||
13 | % Horizontal resolution (m) | ||
14 | dx=5e3; | ||
15 | % Rotation | ||
16 | f=1e-4; | ||
17 | % Stratification | ||
18 | N=1.5 * f*L/H; | ||
19 | |||
20 | % Gravity | ||
21 | g=9.81; | ||
22 | % E.O.S. | ||
23 | alpha=2.e-4; | ||
24 | |||
25 | Tz=N^2/(g*alpha) | ||
26 | |||
27 | dz=H/nz; | ||
28 | sprintf('delZ = %d * %7.6g,',nz,dz) | ||
29 | |||
30 | x=(1:nx)*dx;x=x-mean(x); | ||
31 | y=(1:ny)*dx;y=y-mean(y); | ||
32 | z=-dz/2:-dz:-H; | ||
33 | |||
34 | [Y,X]=meshgrid(y,x); | ||
35 | |||
36 | % Temperature profile | ||
37 | [sprintf('Tref =') sprintf(' %8.6g,',Tz*z-mean(Tz*z))] | ||
38 | |||
39 | adcroft | 1.3 | ieee='b'; |
40 | accuracy='real*8'; | ||
41 | |||
42 | adcroft | 1.1 | % Gaussian bump |
43 | h=-H+dh*exp( -(X.^2+Y.^2)/(2*(L^2)) ); | ||
44 | adcroft | 1.3 | fid=fopen('topog.bump','w',ieee); fwrite(fid,h,accuracy); fclose(fid); |
45 | adcroft | 1.1 | |
46 | % Side walls + bump | ||
47 | h(:,1)=0; | ||
48 | h(:,ny)=0; | ||
49 | adcroft | 1.3 | fid=fopen('topog.bumpchannel','w',ieee); fwrite(fid,h,accuracy); fclose(fid); |
50 | adcroft | 1.1 | |
51 | % Simple channel | ||
52 | h(:,1)=0; | ||
53 | adcroft | 1.2 | h(:,2:ny-1)=-H; |
54 | adcroft | 1.1 | h(:,ny)=0; |
55 | adcroft | 1.3 | fid=fopen('topog.channel','w',ieee); fwrite(fid,h,accuracy); fclose(fid); |
ViewVC Help | |
Powered by ViewVC 1.1.22 |