Changeset 28054
- Timestamp:
- 01/19/24 05:54:32 (14 months ago)
- Location:
- issm/trunk-jpl/src/m/parameterization
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/m/parameterization/interpISMIP6AntarcticaOcn.m ¶
r28040 r28054 24 24 end 25 25 26 rootname = [path model_name '_' scenario '/']; 27 if ~exist(rootname,'dir') 26 %Find forcing file 27 rootname = [path model_name '_' scenario '/1995-2100']; 28 list = dir(rootname); 29 found = false; 30 for i=1:numel(list) 31 if strcmpi(list(i).name, [model_name '_thermal_forcing_8km_x_60m.nc']) 32 disp(['Found tf file: ' list(i).name]); 33 tfnc = [rootname '/' list(i).name]; 34 found = true; 35 end 36 end 37 if ~found 28 38 error(['this path does not exist or the ' model_name ' and ' scenario ' are not available in this combination.']); 29 39 end 30 40 31 41 %load TF data 32 tfnc = [rootname '/1995-2100/' upper(model_name) '_thermal_forcing_8km_x_60m.nc'];42 disp(' == loading TF'); 33 43 x_n = double(ncread(tfnc,'x')); 34 44 y_n = double(ncread(tfnc,'y')); … … 37 47 38 48 %Build tf cell array 39 t = 1:size(tf_data,4);49 time = 1995:2100; 40 50 tf = cell(1,1,size(tf_data,3)); 41 51 for i=1:size(tf_data,3) %Iterate over depths … … 48 58 temp_matrix = [temp_matrix temp_tfdata]; 49 59 end 50 tf{:,:,i} = [temp_matrix ; t ];60 tf{:,:,i} = [temp_matrix ; time]; 51 61 end 52 62 … … 82 92 basalforcings.gamma_0 = gamma0_median; 83 93 basalforcings.tf = tf; 94 95 disp('Info: forcings cover 1995 to 2100'); -
TabularUnified issm/trunk-jpl/src/m/parameterization/interpISMIP6AntarcticaSMB.m ¶
r28040 r28054 13 13 % 14 14 % Examples: 15 % md.smb = interpISMIP6AntarcticaSMB(md,'miroc-esm-chem','rcp8 5');15 % md.smb = interpISMIP6AntarcticaSMB(md,'miroc-esm-chem','rcp8.5'); 16 16 17 17 % Find appropriate directory … … 23 23 end 24 24 25 %find which files are available and do a case insensitive test 25 26 rootname = [path model_name '_' scenario '/']; 26 if ~exist(rootname,'dir') 27 list = dir([rootname '/Regridded_2km/']); 28 found1 = false; found2 = false; 29 for i=1:numel(list) 30 if strcmpi(list(i).name, [model_name '_2km_clim_1995-2014.nc']) 31 disp(['Found clim file: ' list(i).name]); 32 smbclimnc = [rootname '/Regridded_2km/' list(i).name]; 33 found1 = true; 34 end 35 if strcmpi(list(i).name, [model_name '_2km_anomaly_1995-2100.nc']) 36 disp(['Found anom file: ' list(i).name]); 37 smbanomnc = [rootname '/Regridded_2km/' list(i).name]; 38 found2 = true; 39 end 40 end 41 if ~found1 || ~found2 27 42 error(['this path does not exist or the ' model_name ' and ' scenario ' are not available in this combination.']); 28 43 end 29 44 30 45 disp(' == loading TS and SMB climatology data'); 31 smbclimnc = [rootname '/Regridded_2km/' upper(model_name) '_2km_clim_1995-2014.nc'];32 46 lat = double(ncread(smbclimnc,'lat')); 33 47 lon = double(ncread(smbclimnc,'lon')); … … 36 50 37 51 disp(' == loading TS and SMB anomoly data'); 38 smbanomnc = [rootname '/Regridded_2km/' upper(model_name) '_2km_anomaly_1995-2100.nc'];39 52 smb_anomaly_data = double(ncread(smbanomnc,'smb_anomaly')); 40 53 ts_anomaly_data = double(ncread(smbanomnc,'ts_anomaly')); … … 42 55 %Create SMB and TS matrix 43 56 disp(' == Interpolating on model'); 44 t =[1:size(smb_anomaly_data,3)];57 time = [1995:2100]; 45 58 [x_n y_n]=ll2xy(lat(:,1),lon(:,1),-1); 46 59 y_n = x_n; … … 66 79 %Save Data (1995-2100) 67 80 smb = SMBforcing(); 68 smb.mass_balance = [temp_matrix_smb ; t ];81 smb.mass_balance = [temp_matrix_smb ; time]; 69 82 70 83 %What do we do with surface temp? 71 %md.miscellaneous.dummy.ts = [temp_matrix_ts ; t]; 84 %md.miscellaneous.dummy.ts = [temp_matrix_ts ; time]; 85 disp('Info: forcings cover 1995 to 2100'); 72 86 end
Note:
See TracChangeset
for help on using the changeset viewer.