| 3 |  |  | 
| 4 | Instructions for using pkg/ptracers to compute tracer | Instructions for using pkg/ptracers to compute tracer | 
| 5 | Green's functions for Gruber's ocean inversion project | Green's functions for Gruber's ocean inversion project | 
| 6 | (http://quercus.igpp.ucla.edu/OceanInversion/). | (see quercus.igpp.ucla.edu/OceanInversion/ for details). | 
| 7 |  |  | 
| 8 |  | Preprocessed OceanInversion input files are available | 
| 9 |  | under directories region_mask, takahashi, and | 
| 10 |  | atm_co2 in this package.  All netcdf input files | 
| 11 |  | have been converted to binary format in order to avoid | 
| 12 |  | having to link netcdf library with MITgcm code.  See | 
| 13 |  | respective README files in each directory for details. | 
| 14 |  |  | 
| 15 |  |  | 
| 16 | =============================================== | =============================================== | 
| 29 | cd MITgcm | cd MITgcm | 
| 30 | cvs co -d ocean_inversion_project MITgcm_contrib/ocean_inversion_project | cvs co -d ocean_inversion_project MITgcm_contrib/ocean_inversion_project | 
| 31 |  |  | 
| 32 | 3 ===> compile | 3 ===> compile and link | 
| 33 |  |  | 
| 34 | cd bin | cd bin | 
| 35 | cp ../verification/global_with_exf/code/* . | cp ../verification/global_with_exf/code/* . | 
| 36 | cp ../ocean_inversion_project/code/.genmakerc . | cp ../ocean_inversion_project/code/.genmakerc . | 
| 37 | cp ../ocean_inversion_project/code/* . | cp ../ocean_inversion_project/code/* . | 
| 38 | cp ../ocean_inversion_project/code/ptracers_forcing.F.test ptracers_forcing.F | cp ptracers_forcing.F.test ptracers_forcing.F | 
| 39 | cp ../ocean_inversion_project/code/ptracers_init.F.test ptracers_init.F | rm ptracers_init.F ptracers_forcing.F | 
|  | cp ../ocean_inversion_project/code/ptracers_read_mask.F.test ptracers_read_mask.F |  | 
| 40 | ../tools/genmake | ../tools/genmake | 
| 41 | make depend | make depend | 
| 42 | make | make | 
| 44 | 4 ===> execute | 4 ===> execute | 
| 45 |  |  | 
| 46 | cd ../exe | cd ../exe | 
| 47 | cp ../verification/global_with_exf/input/* . | cp ../verification/global_with_exf/input/eedata . | 
| 48 |  | cp ../verification/global_with_exf/input/data.* . | 
| 49 |  | cp ../verification/global_with_exf/input/POLY3.COEFFS . | 
| 50 |  | ln -sf ../verification/global_with_exf/input/*.bin . | 
| 51 | cp ../ocean_inversion_project/input/* . | cp ../ocean_inversion_project/input/* . | 
| 52 | cp ../ocean_inversion_project/input/data.ptracers.test data.ptracers | cp data.test data | 
| 53 |  | cp data.ptracers.test data.ptracers | 
| 54 | mitgcmuv > output .txt | mitgcmuv > output .txt | 
| 55 |  |  | 
| 56 | 5 ===> check that PTRACER output for tracer 1 and tracer 30 | 5 ===> check that PTRACER output for tracer 1 and tracer 30 | 
| 60 | diff PTRACER30.0000000020.001.001.data S.0000000020.001.001.data | diff PTRACER30.0000000020.001.001.data S.0000000020.001.001.data | 
| 61 |  |  | 
| 62 |  |  | 
| 63 | ====================================================== | ========================================================== | 
| 64 | Second generate binary input files.  netcdf files are not OK | Instructions for carrying out a 3000-year quasi-stationary | 
| 65 |  | integration using the global_ocean.90x40x15 configuration. | 
| 66 | ====================================================== | ========================================================== | 
| 67 | ====================================================== |  | 
| 68 | ====================================================== | 1 ===> compile, link, and execute | 
| 69 | ====================================================== |  | 
| 70 |  | cd MITgcm/exe | 
| 71 | cd MITgcm/bin | rm * | 
| 72 |  | cd ../bin | 
| 73 |  | rm * | 
| 74 | cp ../verification/global_with_exf/code/* . | cp ../verification/global_with_exf/code/* . | 
| 75 | cp ../code/.genmakerc . | cp ../ocean_inversion_project/code/.genmakerc . | 
| 76 | cp ../code/* . | cp ../ocean_inversion_project/code/* . | 
|  | cp ../code/ptracers_forcing.F.test ptracers_forcing.F |  | 
|  | cp ../code/ptracers_init.F.test ptracers_init.F |  | 
|  | cp ../code/ptracers_read_mask.F.test ptracers_read_mask.F |  | 
| 77 | ../tools/genmake | ../tools/genmake | 
| 78 | make depend | make depend | 
| 79 | make | make | 
| 80 | cd ../exe | cd ../exe | 
| 81 | cp ../verification/global_with_exf/input/* . | cp ../verification/global_with_exf/input/eedata . | 
| 82 | cp ../input/* . | cp ../verification/global_with_exf/input/data.* . | 
| 83 | cp ../input/data.ptracers.test data.ptracers | cp ../verification/global_with_exf/input/POLY3.COEFFS . | 
| 84 | mitgcmuv > output .txt | ln -sf ../verification/global_with_exf/input/*.bin . | 
| 85 |  | cp ../ocean_inversion_project/input/* . | 
| 86 | ===> examine interpolation output for 30-region mask | ln -sf ../ocean_inversion_project/region_mask/30reg_regionmask.bin . | 
| 87 |  | ln -sf ../ocean_inversion_project/takahashi/taka02_montlhy.bin . | 
| 88 | matlab | mitgcmuv > output .txt & | 
|  | mask=zeros(94,44,30); |  | 
|  | load fort.10 |  | 
|  | for i=1:length(fort) |  | 
|  | mask(fort(i,2)+2,fort(i,3)+2,fort(i,1))=fort(i,4); |  | 
|  | end |  | 
|  | for i=1:30 |  | 
|  | mypcolor(mask(3:92,3:42,i)'); |  | 
|  | colorbar,title(i),pause |  | 
|  | end |  | 
|  | mypcolor(sum(mask,3)'); colorbar |  | 
|  |  |  | 
|  | ===================================== |  | 
|  |  |  | 
|  |  |  | 
|  | Global ocean experiment with ptracers |  | 
|  | ===================================== |  | 
| 89 |  |  | 
|  | ===> set up and integrate 30-tracer computation |  | 
| 90 |  |  | 
| 91 | cd MITgcm/bin | ====================================================== | 
|  | cp ../verification/global_with_exf/code/* . |  | 
|  | cp ../code/.genmakerc . |  | 
|  | cp ../code/* . |  | 
|  | ../tools/genmake |  | 
|  | make depend |  | 
|  | make |  | 
|  | cd ../exe |  | 
|  | cp ../verification/global_with_exf/input/* . |  | 
|  | cp ../input/* . |  | 
|  | mitgcmuv > output .txt |  | 
|  |  |  | 
|  | ===> look at output |  | 
| 92 |  |  | 
| 93 | matlab | % some matlab code for looking at fort.10 debug files | 
| 94 | for i=1:30 | load fort.10 | 
| 95 | tr=readbin(['PTRACER' myint2str(i) ... | tak=zeros(90,40,12); | 
| 96 | '.0000000020.001.001.data'],[90 40 15],1); | for n=1:length(fort) | 
| 97 | mypcolor(tr(:,:,2)'), colorbar, pause(1) | m=fort(n,1); i=fort(n,2); j=fort(n,3); | 
| 98 |  | if i>0&i<91&j>0&j<41, tak(i,j,m)=fort(n,4); end | 
| 99 |  | end | 
| 100 |  | lon=2:4:360; lat=-78:4:78; | 
| 101 |  | clf, contourf(lon,lat,mean(tak(:,:,1),3)',-10:10) | 
| 102 |  | caxis([-6 6]), colorbar, plotland | 
| 103 |  |  | 
| 104 |  | % some matlab code for looking at PTRACER output files | 
| 105 |  | tracer=zeros(90,40,15,30); | 
| 106 |  | for i=1:30 | 
| 107 |  | fn=['PTRACER' myint2str(i) '.0000000020.001.001.data']; | 
| 108 |  | tracer(:,:,:,i)=readbin(fn,[90 40 15],1); | 
| 109 |  | clf, mypcolor(tracer(:,:,1,i)'); pause(1) | 
| 110 |  | end | 
| 111 |  | tmp=sum(tracer,4); clf, mypcolor(tmp(:,:,1)') | 
| 112 |  |  | 
| 113 |  | % some matlab code for checking that one year's worth of | 
| 114 |  | % tracer uptake is approximately 1e18 mols. | 
| 115 |  | lon=2:4:360; lat=-78:4:78; | 
| 116 |  | thk=[50 70 100 140 190 240 290 340 390 440 490 540 590 640 690]; | 
| 117 |  | tracer=zeros(90,40,15,30); sumtracer1=zeros(30,1); | 
| 118 |  | for i=1:30, mydisp(i) | 
| 119 |  | fn=['PTRACER' myint2str(i) '.0000000180.001.001.data']; | 
| 120 |  | tracer(:,:,:,i)=readbin(fn,[90 40 15],1); | 
| 121 |  | for x=1:length(lon) | 
| 122 |  | for y=1:length(lat) | 
| 123 |  | for z=1:length(thk) | 
| 124 |  | sumtracer1(i) = sumtracer1(i) + tracer(x,y,z,i) * ... | 
| 125 |  | thk(z) * (4*1.113195e+05)^2 * cos(pi*lat(y)/180); | 
| 126 |  | end | 
| 127 |  | end | 
| 128 | end | end | 
| 129 |  | end | 
| 130 |  |  | 
| 131 |  | % some matlab code for checking that one year's worth of | 
| 132 |  | % tracer uptake is approximately 1e18 mols. | 
| 133 |  | lon=2:4:360; lat=-78:4:78; | 
| 134 |  | thk=[50 70 100 140 190 240 290 340 390 440 490 540 590 640 690]; | 
| 135 |  | tracer=zeros(90,40,15,30); sumtracer=zeros(30,1); | 
| 136 |  | for i=1:30, mydisp(i) | 
| 137 |  | fn=['PTRACER' myint2str(i) '.0000000180.001.001.data']; | 
| 138 |  | tracer(:,:,:,i)=readbin(fn,[90 40 15],1); | 
| 139 |  | for j=1:length(lat) | 
| 140 |  | for k=1:length(thk) | 
| 141 |  | sumtracer(i) = sumtracer(i) + sum(tracer(:,j,k,i)) * ... | 
| 142 |  | thk(k) * (4*1.113195e+05)^2 * cos(pi*lat(j)/180); | 
| 143 |  | end | 
| 144 |  | end | 
| 145 |  | end |