Changeset 28054


Ignore:
Timestamp:
01/19/24 05:54:32 (14 months ago)
Author:
bgetraer
Message:

CHG: fixing case issues with ISMIP6 forcings

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  
    2424end
    2525
    26 rootname = [path model_name '_' scenario '/'];
    27 if ~exist(rootname,'dir')
     26%Find forcing file
     27rootname = [path model_name '_' scenario '/1995-2100'];
     28list = dir(rootname);
     29found = false;
     30for 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
     36end
     37if ~found
    2838   error(['this path does not exist or the ' model_name ' and ' scenario ' are not available in this combination.']);
    2939end
    3040
    3141%load TF data
    32 tfnc    = [rootname '/1995-2100/' upper(model_name) '_thermal_forcing_8km_x_60m.nc'];
     42disp('   == loading TF');
    3343x_n     = double(ncread(tfnc,'x'));
    3444y_n     = double(ncread(tfnc,'y'));
     
    3747
    3848%Build tf cell array
    39 t = 1:size(tf_data,4);
     49time = 1995:2100;
    4050tf = cell(1,1,size(tf_data,3));
    4151for i=1:size(tf_data,3)  %Iterate over depths
     
    4858                temp_matrix = [temp_matrix temp_tfdata];
    4959        end
    50         tf{:,:,i} = [temp_matrix ; t];
     60        tf{:,:,i} = [temp_matrix ; time];
    5161end
    5262
     
    8292basalforcings.gamma_0    = gamma0_median;
    8393basalforcings.tf         = tf;
     94
     95disp('Info: forcings cover 1995 to 2100');
  • TabularUnified issm/trunk-jpl/src/m/parameterization/interpISMIP6AntarcticaSMB.m

    r28040 r28054  
    1313%
    1414%   Examples:
    15 %      md.smb = interpISMIP6AntarcticaSMB(md,'miroc-esm-chem','rcp85');
     15%      md.smb = interpISMIP6AntarcticaSMB(md,'miroc-esm-chem','rcp8.5');
    1616
    1717% Find appropriate directory
     
    2323end
    2424
     25%find which files are available and do a case insensitive test
    2526rootname = [path model_name '_' scenario '/'];
    26 if ~exist(rootname,'dir')
     27list = dir([rootname '/Regridded_2km/']);
     28found1 = false; found2 = false;
     29for 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
     40end
     41if ~found1 || ~found2
    2742   error(['this path does not exist or the ' model_name ' and ' scenario ' are not available in this combination.']);
    2843end
    2944
    3045disp('   == loading TS and SMB climatology data');
    31 smbclimnc           = [rootname '/Regridded_2km/' upper(model_name) '_2km_clim_1995-2014.nc'];
    3246lat                 = double(ncread(smbclimnc,'lat'));
    3347lon                 = double(ncread(smbclimnc,'lon'));
     
    3650
    3751disp('   == loading TS and SMB anomoly data');
    38 smbanomnc           = [rootname '/Regridded_2km/' upper(model_name) '_2km_anomaly_1995-2100.nc'];
    3952smb_anomaly_data    = double(ncread(smbanomnc,'smb_anomaly'));
    4053ts_anomaly_data     = double(ncread(smbanomnc,'ts_anomaly'));
     
    4255%Create SMB and TS matrix
    4356disp('   == Interpolating on model');
    44 t=[1:size(smb_anomaly_data,3)];
     57time = [1995:2100];
    4558[x_n y_n]=ll2xy(lat(:,1),lon(:,1),-1);
    4659y_n = x_n;
     
    6679%Save Data (1995-2100)
    6780smb = SMBforcing();
    68 smb.mass_balance = [temp_matrix_smb ; t];
     81smb.mass_balance = [temp_matrix_smb ; time];
    6982
    7083%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];
     85disp('Info: forcings cover 1995 to 2100');
    7286end
Note: See TracChangeset for help on using the changeset viewer.