From 756c0b3941b384f92199bc538e80c1bc328b9365 Mon Sep 17 00:00:00 2001 From: mlubeck <44511940+mlubeck@users.noreply.github.com> Date: Thu, 7 Feb 2019 22:29:46 -0700 Subject: [PATCH 1/6] Update grace2plmt.m --- grace2plmt.m | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/grace2plmt.m b/grace2plmt.m index 267be99..ac0d56b 100644 --- a/grace2plmt.m +++ b/grace2plmt.m @@ -96,6 +96,13 @@ errornames=ls2cell(fullfile(ddir1,'GSM*G---_005a.txt')); % Know a priori what the bandwidth of the coefficients is Ldata=90; + elseif strcmp(Rlevelm,'RL06') + %find the coefficient file names + datanames=ls2cell(fullfile(ddir1,'GSM*G---_006a')); + %Find the error files + errornames=ls2cell(fullfile(ddir1),'GSM*G---_006a.txt')); + %Know a priori what the bandwith of the coefficients is + Ldata=60; end elseif strcmp(Pcenter,'CSR') if strcmp(Rlevel,'RL04') @@ -105,6 +112,8 @@ datanames=ls2cell(fullfile(ddir1,'GSM*0060_0005')); % CSR Release Level 5 has no calibrated error files %errornames=ls2cell(fullfile(ddir1,'GSM*0060_0005.txt')); + elseif strcmp(Rlevel,'RL06') + datanames=ls2cell(fullfile(ddir1,'GSM*0060_0006')); end % Know a priori what the bandwidth of the coefficients is Ldata=60; @@ -115,6 +124,8 @@ %errornames=ls2cell(fullfile(ddir1,'GSM*0060_0004.txt')); else error('JPL RL04 solutions not currently stored'); + elseif strcmp(Rlevel,'RL05'); + datanames=ls2cell(fullfile(ddir1,'GSM*JPLEM*005')); end % Know a priori what the bandwidth of the coefficients is Ldata=90; @@ -137,6 +148,8 @@ slrc20=load(fullfile(getenv('IFILES'),'SLR','C20_RL04_NH.txt')); elseif strcmp(Rlevel,'RL05') slrc20=load(fullfile(getenv('IFILES'),'SLR','C20_RL05_NH.txt')); +elseif strcmp(Rlevel,'RL06') + slrc20=load(fullfile(getenv('IFILES'),'SLR','C20_RL06_NH.txt')); end % The sigma error is column 4 slrc20_error=slrc20(:,4)*1e-10; @@ -154,6 +167,8 @@ deg1=load(fullfile(getenv('IFILES'),'GRACE','deg1_RL04_NH.txt')); elseif Rlevel=='RL05' deg1=load(fullfile(getenv('IFILES'),'GRACE','deg1_RL05_NH.txt')); +elseif Rlevel=='RL06' + deg1=load(fullfile(getenv('IFILES'),'GRACE','deg1_RL06_NH.txt')); end [n,m] = size(deg1); dates_str = num2str(deg1(:,1)); From f942c58eb5e0ae15fbf84e1dc8ad3cdce08cdcc3 Mon Sep 17 00:00:00 2001 From: mlubeck <44511940+mlubeck@users.noreply.github.com> Date: Wed, 27 Feb 2019 14:53:12 -0700 Subject: [PATCH 2/6] Updated glm2plmt function for RL06 Updated glm2plmt function for RL06 which includes the C(2,0) coefficient for RL06. The degree 1 coefficient is not released yet for RL06 and thus the degree 1 coefficient data used is from the latest update of RL05. This update includes a description of the RL06 naming convention for the gzip files. --- grace2plmt.m | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/grace2plmt.m b/grace2plmt.m index ac0d56b..eec703f 100644 --- a/grace2plmt.m +++ b/grace2plmt.m @@ -17,7 +17,7 @@ % Pcenter 'CSR' data center at the Center for Space Research % 'GFZ' data center at the GeoForschungsZentrum Potsdam % Rlevel The release level of the solution you want. -% Either 'RL04' or 'RL05' +% Either 'RL04','RL05', or 'RL06' % units 'POT' or 'SD' for whether you want geopotential or surface % mass density % forcenew Whether or not you want to force new generation of a save file @@ -32,7 +32,11 @@ % thedates time stamps in Matlab time % % NOTE: -% The RL05 solutions from CSR do not have any standard deviations + +% SLR data available from the GRACE Tellus website for RL06: +% ftp://podaac-ftp.jpl.nasa.gov/allData/grace/L2/CSR/RL06 +% +% The RL05 solutions from CSR do not have any standard deviations % given, formal or calibrated. These values will be reported as 0. % % SLR data available from the GRACE Tellus website: @@ -57,7 +61,7 @@ % Determine parameters and set defaults defval('Pcenter','CSR') -defval('Rlevel','RL05') +defval('Rlevel','RL06') defval('units','SD') defval('forcenew',1) @@ -96,13 +100,6 @@ errornames=ls2cell(fullfile(ddir1,'GSM*G---_005a.txt')); % Know a priori what the bandwidth of the coefficients is Ldata=90; - elseif strcmp(Rlevelm,'RL06') - %find the coefficient file names - datanames=ls2cell(fullfile(ddir1,'GSM*G---_006a')); - %Find the error files - errornames=ls2cell(fullfile(ddir1),'GSM*G---_006a.txt')); - %Know a priori what the bandwith of the coefficients is - Ldata=60; end elseif strcmp(Pcenter,'CSR') if strcmp(Rlevel,'RL04') @@ -113,19 +110,32 @@ % CSR Release Level 5 has no calibrated error files %errornames=ls2cell(fullfile(ddir1,'GSM*0060_0005.txt')); elseif strcmp(Rlevel,'RL06') - datanames=ls2cell(fullfile(ddir1,'GSM*0060_0006')); + datanames=ls2cell(fullfile(ddir1,'GSM*BA01_0600')); + %naming convention was changed for RL06 where BA stands + %for degree 60 gravity solution and 01 represents unconstrained + %spherical harmonic solution with a boxcar windowing function + %(the meaning of 01 was derived from the L-2 UserHandbook_v4.0). + %In addition, the BB stands for degree 96 gravity solution with a + %boxcar windowing function. + %The other change was made to the last naming entry, which is now + %in the form rrvv. In this case rr represents the release number + %maximum 2 digits and vv represents the maximum 2 digit version + %number. So for RL06 the nomenclature is 0600 instead of 0006 for + %Rl05 previosly. The PID naming convention stays the same. + end % Know a priori what the bandwidth of the coefficients is Ldata=60; elseif strcmp(Pcenter,'JPL') + %Do we want to continue JPL support? if strcmp(Rlevel,'RL05') datanames=ls2cell(fullfile(ddir1,'GSM*JPLEM*0005')); % JPL Release Level 5 has no calibrated error files %errornames=ls2cell(fullfile(ddir1,'GSM*0060_0004.txt')); - else - error('JPL RL04 solutions not currently stored'); elseif strcmp(Rlevel,'RL05'); datanames=ls2cell(fullfile(ddir1,'GSM*JPLEM*005')); + else + error('JPL RL04 solutions not currently stored'); end % Know a priori what the bandwidth of the coefficients is Ldata=90; @@ -150,6 +160,8 @@ slrc20=load(fullfile(getenv('IFILES'),'SLR','C20_RL05_NH.txt')); elseif strcmp(Rlevel,'RL06') slrc20=load(fullfile(getenv('IFILES'),'SLR','C20_RL06_NH.txt')); + %the RL06 C(2,0) coefficient will be updated once the + %updated data has been released end % The sigma error is column 4 slrc20_error=slrc20(:,4)*1e-10; @@ -305,7 +317,8 @@ %%% % We have no calibrated errors for CSR release 05, so we have to bypass % this section in this case. -if (strcmp(Pcenter,'CSR') || strcmp(Pcenter,'JPL')) && strcmp(Rlevel,'RL05') +if (strcmp(Pcenter,'CSR') || strcmp(Pcenter,'JPL')) && (strcmp(Rlevel,'RL05')... + || strcmp(Rlevel,'RL06')) cal_errors(index,:,:) = [lmcosi_month(:,1:2) zeros(size(lmcosi_month(:,1:2)))]; else fname2=fullfile(ddir1,errornames{index}); From 7ebdab5566256b131922ca250c2a1de78aa36437 Mon Sep 17 00:00:00 2001 From: Harig Date: Mon, 11 Mar 2019 10:17:30 -0700 Subject: [PATCH 3/6] bug fixes --- grace2plmt.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grace2plmt.m b/grace2plmt.m index ac0d56b..ee3ad5d 100644 --- a/grace2plmt.m +++ b/grace2plmt.m @@ -100,7 +100,7 @@ %find the coefficient file names datanames=ls2cell(fullfile(ddir1,'GSM*G---_006a')); %Find the error files - errornames=ls2cell(fullfile(ddir1),'GSM*G---_006a.txt')); + errornames=ls2cell(fullfile(ddir1),'GSM*G---_006a.txt'); %Know a priori what the bandwith of the coefficients is Ldata=60; end @@ -124,8 +124,8 @@ %errornames=ls2cell(fullfile(ddir1,'GSM*0060_0004.txt')); else error('JPL RL04 solutions not currently stored'); - elseif strcmp(Rlevel,'RL05'); - datanames=ls2cell(fullfile(ddir1,'GSM*JPLEM*005')); + %elseif strcmp(Rlevel,'RL05'); + % datanames=ls2cell(fullfile(ddir1,'GSM*JPLEM*005')); end % Know a priori what the bandwidth of the coefficients is Ldata=90; From 1bf124b3de35352269b8c1f64cd6d0cdfc2a4c70 Mon Sep 17 00:00:00 2001 From: Mila Lubeck Date: Fri, 22 Mar 2019 14:39:03 -0700 Subject: [PATCH 4/6] one last time maybe? --- grace2plmt.m | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/grace2plmt.m b/grace2plmt.m index eec703f..942b60d 100644 --- a/grace2plmt.m +++ b/grace2plmt.m @@ -55,8 +55,8 @@ % [potcoffs,cal_errors,thedates]=grace2plmt('CSR','RL05','SD',1); % % -% -% Last modified by charig-at-princeton.edu, 03/16/2016 +% Last modified by mlubeck-at-email.arizona.edu, 03/18/2019 +% Last modified by charig-at-email.arizona.edu, 03/16/2016 % Last modified by fjsimons-at-alum.mit.edu, 05/17/2011 % Determine parameters and set defaults @@ -67,14 +67,17 @@ % Where the original data files are kept defval('ddir1',fullfile(getenv('IFILES'),'GRACE','Originals',Rlevel,Pcenter)); + % Where you would like to save the new .mat file defval('ddir2',fullfile(getenv('IFILES'),'GRACE')); % And the name of that save file if strcmp(units,'SD') fnpl=sprintf('%s/%s_%s_alldata_%s.mat',ddir2,Pcenter,Rlevel,units); -else +elseif strcmp(units,'POT') fnpl=sprintf('%s/%s_%s_alldata.mat',ddir2,Pcenter,Rlevel); +else + error ('The unit input is not valid.') end % If this file already exists, load it. Otherwise, or if we force it, make @@ -83,6 +86,12 @@ load(fnpl) disp(sprintf('%s loaded by GRACE2PLMT',fnpl)) else + if ~exist(ddir1,'dir') + error ('The data you asked for are not currently stored.') + %If you received this error it means the directory datanames does + %not exist which means you have not downloaded the data or the data + %was not downloaded to where the program expects + end % DATA CENTER if strcmp(Pcenter,'GFZ') @@ -121,8 +130,7 @@ %in the form rrvv. In this case rr represents the release number %maximum 2 digits and vv represents the maximum 2 digit version %number. So for RL06 the nomenclature is 0600 instead of 0006 for - %Rl05 previosly. The PID naming convention stays the same. - + %Rl05 previosly. The PID naming convention stays the same. end % Know a priori what the bandwidth of the coefficients is Ldata=60; @@ -160,8 +168,7 @@ slrc20=load(fullfile(getenv('IFILES'),'SLR','C20_RL05_NH.txt')); elseif strcmp(Rlevel,'RL06') slrc20=load(fullfile(getenv('IFILES'),'SLR','C20_RL06_NH.txt')); - %the RL06 C(2,0) coefficient will be updated once the - %updated data has been released + end % The sigma error is column 4 slrc20_error=slrc20(:,4)*1e-10; @@ -180,7 +187,10 @@ elseif Rlevel=='RL05' deg1=load(fullfile(getenv('IFILES'),'GRACE','deg1_RL05_NH.txt')); elseif Rlevel=='RL06' - deg1=load(fullfile(getenv('IFILES'),'GRACE','deg1_RL06_NH.txt')); + deg1=load(fullfile(getenv('IFILES'),'GRACE','deg1_RL05_NH.txt')); + %the RL06 deg 1 will be updated once the updated data has been + %released. For now the file being used is the updated RL05 one + %downloaded from the GRACE Tellus website end [n,m] = size(deg1); dates_str = num2str(deg1(:,1)); @@ -429,4 +439,4 @@ % Collect output varns={potcoffs,cal_errors,thedates}; -varargout=varns(1:nargout); +varargout=varns(1:nargout); \ No newline at end of file From 441b96ae0c3dd10ce88c10a96321c99d75e1d831 Mon Sep 17 00:00:00 2001 From: harig00 Date: Mon, 15 Apr 2019 12:42:26 -0700 Subject: [PATCH 5/6] bug fix --- correct4gia.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/correct4gia.m b/correct4gia.m index 7883937..10e2128 100644 --- a/correct4gia.m +++ b/correct4gia.m @@ -234,7 +234,7 @@ pause end end - + total=0; end % end if exist From 340557744be1af9793f1ec994ce2b4373142c8ad Mon Sep 17 00:00:00 2001 From: harig00 Date: Mon, 15 Apr 2019 12:51:18 -0700 Subject: [PATCH 6/6] who knows --- ellesmereg.m | 4 ++-- plm2pot.m | 21 +++++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ellesmereg.m b/ellesmereg.m index ed0bf48..664d61c 100644 --- a/ellesmereg.m +++ b/ellesmereg.m @@ -81,7 +81,7 @@ else % We make a new buffer disp('Buffering the coastlines... this may take a while'); - XY=ellesmere(10); + XY=ellesmereg(10); if buf > 0 inout='out'; else @@ -91,7 +91,7 @@ %%% % First we make the thing next door (Greenland) %%% - XY1 = ellesmere(10); + XY1 = ellesmereg(10); if buf>0.7 XY1 = ellesmere(10,buf-0.5); LonB=XY1(:,1); LatB=XY1(:,2); diff --git a/plm2pot.m b/plm2pot.m index 65fdf2f..cc4ebcc 100644 --- a/plm2pot.m +++ b/plm2pot.m @@ -71,7 +71,10 @@ % Perhaps worth updating these for a more realistic, but % still radial, mantle viscosity? % Interpolate the elastic Love numbers to the bandwidth you need - [lkli,lkl]=lovenums('Wahr',el); + if wat == 4 || wat == 5 + [lkli,lkl]=lovenums('Wahr',el); + end + switch wat case 0 % Geoid (anomaly) (undulation) @@ -127,7 +130,9 @@ elseif lmcosi(1)==1 && lmcosi(1,2)==0 lmcosi=[0 0 GMr 0 repmat(0,1,size(lmcosi,2)-4); % Degree 0 lmcosi]; % Then the rest - fact = [1 1; fact]; + if ~wat == 0 + fact = [1 1; fact]; + end end switch wit @@ -159,8 +164,8 @@ cb=colorbar('hor'); shrink(cb,1.5,2) movev(cb,-0.05) - axes(cb) - set(get(cb,'xlabel'),'string','Surface density [kg/m^2]'); + %axes(cb) + %set(get(cb,'xlabel'),'string','Surface density [kg/m^2]'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% axes(ah(2)) % Plot in mm @@ -172,8 +177,8 @@ cb=colorbar('hor'); shrink(cb,1.5,2) movev(cb,-0.05) - axes(cb) - set(get(cb,'xlabel'),'string','Geoid height variation [milimeters]'); + %axes(cb) + %set(get(cb,'xlabel'),'string','Geoid height variation [milimeters]'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% axes(ah(3)) [data,ch,ph]=plotplm(lmcosiSD,[],[],4,1); @@ -183,7 +188,7 @@ cb=colorbar('hor'); shrink(cb,1.5,2) movev(cb,-0.05) - axes(cb) - set(get(cb,'xlabel'),'string','Surface density [kg/m^2]'); + %axes(cb) + %set(get(cb,'xlabel'),'string','Surface density [kg/m^2]'); end