| 1 | #!/bin/csh -f | #!/bin/csh -f | 
| 2 |  |  | 
|  | echo '----- hello.' |  | 
| 3 | echo '' | echo '' | 
|  | echo '---- the setup of gcmfaces and profilesMatlabProcessing will start' |  | 
|  | echo '---- by downloading the files from the MITgcm cvs server (in 5 sec)' |  | 
| 4 | echo '' | echo '' | 
| 5 | sleep 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 | if ( -f ${HOME}/.cvspass ) then | echo '-- Hello.' | 
| 18 | echo '(you already have a .cvspass file in your home. So we will try to use this one.)' | echo '' | 
| 19 | echo '(If you see this message and nothing after it likely means that you will need)' | echo '---- the setup of gcmfaces and MITprof will start' | 
| 20 | echo '(to rename your .cvspass so that the present script can create a new one.)' | echo '---- by downloading the files from the MITgcm cvs server.' | 
| 21 | else | 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 | echo '/1 :pserver:cvsanon@mitgcm.org:2401/u/gcmpack Ah<Zy=0=' > ~/.cvspass | 
| 26 | endif | endif | 
| 27 |  |  | 
| 28 | setenv CVS_RSH ssh | setenv CVS_RSH ssh | 
| 29 | cvs -q -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co -d gcmfaces MITgcm_contrib/gael/matlab_class | cvs -Q -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co -d gcmfaces MITgcm_contrib/gael/matlab_class | 
| 30 | cvs -q -d :pserver:cvsanon@mitgcm.org:/u/gcmpack  co -d profilesMatlabProcessing MITgcm_contrib/gael/profilesMatlabProcessing | cvs -Q -d :pserver:cvsanon@mitgcm.org:/u/gcmpack  co -d MITprof MITgcm_contrib/gael/profilesMatlabProcessing | 
| 31 |  |  | 
| 32 | if !( -d gcmfaces) then | if !( -d gcmfaces) then | 
| 33 |  | echo '' | 
| 34 |  | echo '-- ERROR : code was not obtained from the cvs server.' | 
| 35 |  | echo '' | 
| 36 |  | echo '-- Most likely you already have a .cvspass file in your home dir, so ' | 
| 37 |  | echo '-- we tried to use this one and this did not work. In this event' | 
| 38 |  | echo '-- you may want to try to login to the cvs as explained @ ' | 
| 39 |  | echo '-- http://mitgcm.org/public/source_code.html' | 
| 40 |  | echo '-- and execute this script again.' | 
| 41 |  | echo '' | 
| 42 | exit | exit | 
| 43 | endif | endif | 
| 44 |  |  | 
| 45 | echo '' | echo '' | 
| 46 |  | echo '---- To test run the programs, we will download sample inputs.' | 
| 47 |  | echo '---- This should take a couple minutes.' | 
| 48 | echo '' | echo '' | 
|  | echo '' |  | 
|  | echo '---- then we will download sample inputs to test run the codes (in 5 sec)' |  | 
|  | sleep 5 |  | 
| 49 |  |  | 
| 50 | wget http://mitgcm.org/~gforget/sample_input.tar.gz | wget -q http://mitgcm.org/~gforget/sample_input.tar.gz | 
| 51 | gunzip sample_input.tar.gz | gunzip sample_input.tar.gz | 
| 52 | tar xvf sample_input.tar | tar xf sample_input.tar | 
| 53 | mv sample_input gcmfaces/. | mv sample_input gcmfaces/. | 
| 54 | rm -f sample_input.tar | rm -f sample_input.tar | 
| 55 |  |  | 
| 56 | echo '' | echo '' | 
| 57 | echo '---- Your turn.' | echo '---- Now a matlab session will start, and test run the programs.' | 
| 58 | echo '' | echo '---- This should take a couple minutes.' | 
|  | echo '---- To finish the initialization process:' |  | 
|  | echo '---- (0) start matlab' |  | 
|  | echo '---- (1) type "cd gcmfaces" and "gcmfaces_init"' |  | 
|  | echo '---- This makes a few demo plots, that you will close afterwards.' |  | 
|  | echo '---- (2) type "cd ../profilesMatlabProcessing" and "profiles_process_init"' |  | 
|  | echo '---- This processes sample in-situ data files to the MITprof format.' |  | 
| 59 | echo '' | echo '' | 
| 60 | echo '---- Once those two programs have run succesfully, you should be all set.' | sleep 1 | 
| 61 |  |  | 
| 62 |  | matlab -nojvm -nodisplay << EOF | 
| 63 |  | fprintf(''); | 
| 64 |  |  | 
| 65 |  | %test gcmfaces: | 
| 66 |  | cd gcmfaces; | 
| 67 |  | global gcmfaces_skipplottest; gcmfaces_skipplottest=1; | 
| 68 |  | global gcmfaces_verbose; gcmfaces_verbose=0; | 
| 69 |  | gcmfaces_init; | 
| 70 |  | cd ..; | 
| 71 |  |  | 
| 72 |  | %test MITprof: | 
| 73 |  | is_netcdf_avail=~isempty(which('ncload')); | 
| 74 |  | %is_netcdf_avail=0; | 
| 75 |  | if ~is_netcdf_avail; | 
| 76 |  | fprintf('\n Warning: Using MITprof cannot be \n used until you get the netcdf toolbox.\n'); | 
| 77 |  | else; | 
| 78 |  | cd MITprof; | 
| 79 |  | global MITprof_verbose; MITprof_verbose=0; | 
| 80 |  | profiles_process_init; | 
| 81 |  | cd ..; | 
| 82 |  | end; | 
| 83 |  |  | 
| 84 |  | exit | 
| 85 |  | EOF | 
| 86 | echo '' | echo '' | 
|  | echo '---- To be able to use the packages in future matlab sessions, you will' |  | 
|  | echo '---- need the lines that were added to your path during this one.' |  | 
|  | echo '---- For example, you may want to copy those lines to your startup.m file.' |  | 
| 87 |  |  | 
| 88 | echo '' | echo '' | 
| 89 |  | echo '---- Assuming the test runs have succesfully completed, you should be all set.' | 
| 90 |  | echo '' | 
| 91 |  | echo '---- To be able to use the packages in future matlab sessions, you will' | 
| 92 |  | echo '---- need to add directories to your matlab path -- those are listed' | 
| 93 |  | echo '---- in gcmfaces/gcmfaces_path.m and MITprof/MITprof_path.m -- executing' | 
| 94 |  | echo '---- those two scripts is one way of completing your path.' | 
| 95 | echo '' | echo '' | 
| 96 | echo '---- bye.' | echo '-- Bye.' | 
| 97 |  |  | 
| 98 |  | exit | 
| 99 |  |  |