Skip to content

Commit 27d810f

Browse files
committed
ADD: interp ITS_LIVE Antarctica
1 parent 9955e05 commit 27d810f

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/m/contrib/chenggong/modeldata/interpFromITSLIVE.m

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,20 @@
1717
% get the version of ITS_LIVE, v02 is the latest version (by 2024-07)
1818
% however, this version is in h5 format, can only be read by `h5read`, NOT `ncread`
1919
data_version = getfieldvalue(options,'version', 2);
20+
21+
% Greenland (default) or Antarctica
22+
hem = getfieldvalue(options,'hemisphere', 'n');
23+
24+
if strcmp(hem,'n')
25+
icesheet = 'Greenland';
26+
else
27+
icesheet = 'Antarctica';
28+
end
29+
2030
if data_version == 1
21-
foldername = '/totten_1/ModelData/Greenland/ITS_LIVE/v01/';
31+
foldername = ['/totten_1/ModelData/', icesheet, '/ITS_LIVE/v01/'];
2232
elseif data_version == 2
23-
foldername = '/totten_1/ModelData/Greenland/ITS_LIVE/';
33+
foldername = ['/totten_1/ModelData/', icesheet, '/ITS_LIVE/'];
2434
else
2535
error(['ITS_LIVE version ', data_version, ' is not supported!'])
2636
end
@@ -43,9 +53,9 @@
4353
% find all the data files with Tstart<=t<=Tend
4454
dataInd = (dataTime>=Tstart) & (dataTime<=Tend);
4555
if ((Tstart ==0) & (Tend==0))
46-
disp(' Use ITS_LIVE composite 120 m velocity map ');
56+
disp([' Use ITS_LIVE composite 120 m velocity map for ', icesheet]);
4757
else
48-
disp([' For the selected period: ', datestr(decyear2date((Tstart)),'yyyy-mm-dd'), ' to ', datestr(decyear2date((Tend)),'yyyy-mm-dd'), ', there are ', num2str(sum(dataInd)), ' records' ]);
58+
disp([' For the selected period: ', datestr(decyear2date((Tstart)),'yyyy-mm-dd'), ' to ', datestr(decyear2date((Tend)),'yyyy-mm-dd'), ', there are ', num2str(sum(dataInd)), ' records for ', icesheet ]);
4959
end
5060

5161
dataToLoad = {templist(dataInd).name};

0 commit comments

Comments
 (0)