--- MITgcm_contrib/gael/profilesMatlabProcessing/MITprof_global.m 2016/01/17 19:28:27 1.7 +++ MITgcm_contrib/gael/profilesMatlabProcessing/MITprof_global.m 2017/02/23 18:26:14 1.9 @@ -1,10 +1,8 @@ function []=MITprof_global(varargin); -%object: take care of path and global variables (mygrid and mitprofenv), -% and sends global variables to caller routine workspace -%notes: - in any call, if this has not yet been done, -% this routine also adds MITprof subdirectories -% to the matlab path, and it defines mitprofenv. -% - this routine replaces MITprof_path +% +% MITPROF_GLOBAL calls gcmfaces_global, adds MITprof paths, adds +% defines MITprof_climdir and MITprof_griddir in myenv, and +% adds myenv (global variable) to caller routine workspace %get/define global variables: gcmfaces_global; @@ -38,7 +36,14 @@ if isdir('GRID/'); gridDir='GRID/'; end; if isdir('nctiles_grid/'); gridDir='nctiles_grid/'; end; - if isempty(gridDir); error('could not find grid'); end; + if isempty(gridDir); + fprintf('\n please indicate the ECCO v4 grid directory (e.g., ''nctiles_grid/'') \n\n'); + fprintf(' It can be obtained as follows: \n'); + fprintf(' wget --recursive ftp://mit.ecco-group.org/ecco_for_las/version_4/release2/nctiles_grid/ .\n'); + fprintf(' mv mit.ecco-group.org/ecco_for_las/version_4/release2/nctiles_grid/ . \n\n'); + gridDir=input(''); + end; + addpath(gridDir); fil=which('GRID.0001.nc'); if isempty(fil); fil=which('XC.meta'); end; @@ -60,7 +65,7 @@ if isempty(fil); fprintf('\n please indicate the climatologies directory (e.g., ''gcmfaces_climatologies/'') \n\n'); fprintf(' It can be obtained as follows: \n'); - fprintf(' wget --recursive ftp://mit.ecco-group.org/gforget/OCCAetcONv4GRID .\n\n'); + fprintf(' wget --recursive ftp://mit.ecco-group.org/gforget/OCCAetcONv4GRID .\n'); fprintf(' mv mit.ecco-group.org/gforget/OCCAetcONv4GRID gcmfaces_climatologies \n\n'); climDir=input(''); end; @@ -73,5 +78,5 @@ end; %send to workspace: -evalin('caller','global mygrid mitprofenv'); +evalin('caller','global mygrid myenv');