| 1 |
#!/bin/csh -f |
| 2 |
|
| 3 |
echo '' |
| 4 |
echo '' |
| 5 |
echo '-- Disclaimer:' |
| 6 |
echo '-- The free software programs may be freely distributed, provided that no ' |
| 7 |
echo '-- charge is levied, and that the disclaimer below is always attached to it. ' |
| 8 |
echo '-- The programs are provided as is without any guarantees or warranty.' |
| 9 |
echo '-- Although the authors have attempted to find and correct any bugs in the ' |
| 10 |
echo '-- free software programs, the authors are not responsible for any damage or ' |
| 11 |
echo '-- losses of any kind caused by the use or misuse of the programs.' |
| 12 |
echo '-- The authors are under no obligation to provide support, service, ' |
| 13 |
echo '-- corrections, or upgrades to the free software programs.' |
| 14 |
echo '' |
| 15 |
echo '' |
| 16 |
|
| 17 |
echo '-- Hello.' |
| 18 |
echo '' |
| 19 |
echo '---- the setup of gcmfaces and MITprof will start' |
| 20 |
echo '---- by downloading the files from the MITgcm cvs server.' |
| 21 |
echo '---- This should take a couple minutes.' |
| 22 |
echo '' |
| 23 |
|
| 24 |
if !( -f ${HOME}/.cvspass ) then |
| 25 |
echo '/1 :pserver:cvsanon@mitgcm.org:2401/u/gcmpack Ah<Zy=0=' > ~/.cvspass |
| 26 |
endif |
| 27 |
|
| 28 |
setenv CVS_RSH ssh |
| 29 |
cvs -Q -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co -P -d gcmfaces MITgcm_contrib/gael/matlab_class |
| 30 |
cvs -Q -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co -P -d MITprof MITgcm_contrib/gael/profilesMatlabProcessing |
| 31 |
cvs -Q -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co -P -d GRID MITgcm_contrib/gael/GRID |
| 32 |
cvs -Q -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co -P -d OCCAetcONv4GRID MITgcm_contrib/gael/OCCAetcONv4GRID |
| 33 |
|
| 34 |
if !( -d gcmfaces) then |
| 35 |
echo '' |
| 36 |
echo '-- ERROR : code was not obtained from the cvs server.' |
| 37 |
echo '' |
| 38 |
echo '-- Most likely you already have a .cvspass file in your home dir, so ' |
| 39 |
echo '-- we tried to use this one and this did not work. In this event' |
| 40 |
echo '-- you may want to try to login to the cvs as explained @ ' |
| 41 |
echo '-- http://mitgcm.org/public/source_code.html' |
| 42 |
echo '-- and execute this script again.' |
| 43 |
echo '' |
| 44 |
exit |
| 45 |
endif |
| 46 |
|
| 47 |
echo '' |
| 48 |
echo '---- To test run the programs, we will download sample inputs.' |
| 49 |
echo '---- This should take a couple minutes.' |
| 50 |
echo '' |
| 51 |
|
| 52 |
mkdir gcmfaces/sample_input |
| 53 |
|
| 54 |
mv OCCAetcONv4GRID gcmfaces/sample_input/. |
| 55 |
|
| 56 |
wget --recursive ftp://mit.ecco-group.org/ecco_for_las/version_4/release1/nctiles_climatology/ETAN |
| 57 |
|
| 58 |
mv mit.ecco-group.org/ecco_for_las/version_4/release1/nctiles_climatology gcmfaces/sample_input/. |
| 59 |
rm -rf mit.ecco-group.org |
| 60 |
|
| 61 |
echo '' |
| 62 |
echo '---- Now a matlab session will start, and test run the programs.' |
| 63 |
echo '---- This should take a couple minutes.' |
| 64 |
echo '' |
| 65 |
sleep 1 |
| 66 |
|
| 67 |
matlab -nojvm -nodisplay << EOF |
| 68 |
fprintf(''); |
| 69 |
|
| 70 |
%test gcmfaces: |
| 71 |
cd gcmfaces; |
| 72 |
gcmfaces_global; |
| 73 |
myenv.verbose=1; |
| 74 |
myenv.lessplot=1; |
| 75 |
myenv.lesstest=1; |
| 76 |
cd ..; |
| 77 |
|
| 78 |
gcmfaces_init; |
| 79 |
|
| 80 |
%test MITprof: |
| 81 |
is_netcdf_avail=~isempty(which('ncexample'))|~isempty(which('netcdf.create')); |
| 82 |
is_netcdf_redundant=~isempty(which('ncexample'))&~isempty(which('netcdf.create')); |
| 83 |
if (is_netcdf_redundant); |
| 84 |
fprintf('\n\n!! You have both the old mex/netcdf and the native matlab/netcdf installed.\n'); |
| 85 |
fprintf('!! Since they are conflicting (name clashes) you will likely run into trouble. \n'); |
| 86 |
fprintf('!! You may want to remove the old mex/netcdf stuff from your matlab path.\n\n'); |
| 87 |
end; |
| 88 |
if ~is_netcdf_avail; |
| 89 |
fprintf('\n !!!! Error: Using MITprof cannot be \n used until you get the netcdf toolbox.\n'); |
| 90 |
else; |
| 91 |
cd MITprof; |
| 92 |
profiles_process_init; |
| 93 |
cd ..; |
| 94 |
end; |
| 95 |
|
| 96 |
exit |
| 97 |
EOF |
| 98 |
echo '' |
| 99 |
|
| 100 |
echo '' |
| 101 |
echo '---- Assuming the test runs have succesfully completed, you should be all set.' |
| 102 |
echo '' |
| 103 |
echo '---- To be able to use the packages in future matlab sessions, you will' |
| 104 |
echo '---- need to add directories to your matlab path -- those are listed' |
| 105 |
echo '---- in gcmfaces/gcmfaces_path.m and MITprof/MITprof_path.m -- executing' |
| 106 |
echo '---- those two scripts is one way of completing your path.' |
| 107 |
echo '' |
| 108 |
echo '-- Bye.' |
| 109 |
|
| 110 |
exit |
| 111 |
|