/[MITgcm]/MITgcm_contrib/gael/setup_gcmfaces_and_mitprof.csh
ViewVC logotype

Annotation of /MITgcm_contrib/gael/setup_gcmfaces_and_mitprof.csh

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


Revision 1.4 - (hide annotations) (download) (as text)
Fri Nov 5 22:09:07 2010 UTC (14 years, 8 months ago) by gforget
Branch: MAIN
Changes since 1.3: +8 -3 lines
File MIME type: application/x-csh
- check whether matlab has the legacy mexnc stuff (as before)
  or the modern matlab native netcdf implementation. Having
  both is bad (warning), having none is bad (stop).

1 gforget 1.1 #!/bin/csh -f
2    
3     echo ''
4     echo ''
5 gforget 1.3 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 gforget 1.1
17 gforget 1.3 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 gforget 1.2 echo '/1 :pserver:cvsanon@mitgcm.org:2401/u/gcmpack Ah<Zy=0=' > ~/.cvspass
26     endif
27    
28     setenv CVS_RSH ssh
29 gforget 1.3 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 MITprof MITgcm_contrib/gael/profilesMatlabProcessing
31 gforget 1.2
32     if !( -d gcmfaces) then
33 gforget 1.3 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 gforget 1.2 exit
43     endif
44 gforget 1.1
45 gforget 1.2 echo ''
46 gforget 1.3 echo '---- To test run the programs, we will download sample inputs.'
47     echo '---- This should take a couple minutes.'
48 gforget 1.2 echo ''
49 gforget 1.1
50 gforget 1.3 wget -q http://mitgcm.org/~gforget/sample_input.tar.gz
51 gforget 1.1 gunzip sample_input.tar.gz
52 gforget 1.3 tar xf sample_input.tar
53 gforget 1.1 mv sample_input gcmfaces/.
54     rm -f sample_input.tar
55    
56     echo ''
57 gforget 1.3 echo '---- Now a matlab session will start, and test run the programs.'
58     echo '---- This should take a couple minutes.'
59 gforget 1.1 echo ''
60 gforget 1.3 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 gforget 1.4 is_netcdf_avail=~isempty(which('ncexample'))|~isempty(which('netcdf.create'));
74     is_netcdf_redundant=~isempty(which('ncexample'))&~isempty(which('netcdf.create'));
75     if (is_netcdf_redundant);
76     fprintf('\n\n!! You have both the old mex/netcdf and the native matlab/netcdf installed.\n');
77     fprintf('!! Since they are conflicting (name clashes) you will likely run into trouble. \n');
78     fprintf('!! You may want to remove the old mex/netcdf stuff from your matlab path.\n\n');
79     end;
80 gforget 1.3 if ~is_netcdf_avail;
81 gforget 1.4 fprintf('\n !!!! Error: Using MITprof cannot be \n used until you get the netcdf toolbox.\n');
82 gforget 1.3 else;
83     cd MITprof;
84     global MITprof_verbose; MITprof_verbose=0;
85     profiles_process_init;
86     cd ..;
87     end;
88    
89     exit
90     EOF
91     echo ''
92    
93 gforget 1.1 echo ''
94 gforget 1.3 echo '---- Assuming the test runs have succesfully completed, you should be all set.'
95 gforget 1.1 echo ''
96     echo '---- To be able to use the packages in future matlab sessions, you will'
97 gforget 1.3 echo '---- need to add directories to your matlab path -- those are listed'
98     echo '---- in gcmfaces/gcmfaces_path.m and MITprof/MITprof_path.m -- executing'
99     echo '---- those two scripts is one way of completing your path.'
100 gforget 1.1 echo ''
101 gforget 1.3 echo '-- Bye.'
102 gforget 1.1
103 gforget 1.3 exit
104 gforget 1.1

  ViewVC Help
Powered by ViewVC 1.1.22