Changeset 28065
- Timestamp:
- 01/24/24 10:39:30 (14 months ago)
- Location:
- issm/trunk-jpl/src/m/parameterization
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/parameterization/interpISMIP6AntarcticaOcn.m
r28054 r28065 1 function basalforcings = interpISMIP6AntarcticaOcn(md,model_name ,scenario)1 function basalforcings = interpISMIP6AntarcticaOcn(md,model_name) 2 2 %interpISMIP6AntarcticaOcn - interpolate chosen ISMIP6 atmospheric forcing to model 3 3 % 4 4 % Input: 5 5 % - md (model object) 6 % - model_name (string): name of the climate model 7 % Examples: cnrm-esm2-1 ccsm4cesm2 cnrm-cm6-1 csiro-mk3-6-0 8 % hadgem2-es ipsl-cm5a-mr miroc-esm-chem noresm1-m ukesm1-0-ll 6 % - model_name (string): name of the climate model and scenario 7 % - suppported options from /totten_1/ModelData/ISMIP6/Projections/AIS/Ocean_Forcing/ 8 % 2.6 scenario 8.5 scenario 9 % --------------------------------------------- 10 % ccsm4_rcp8.5 11 % cesm2_ssp585 12 % cnrm-cm6-1_ssp126 cnrm-cm6-1_ssp585 13 % cnrm-esm2-1_ssp585 14 % csiro-mk3-6-0_rcp8.5 15 % hadgem2-es_rcp8.5 16 % ipsl-cm5a-mr_rcp2.6 ipsl-cm5a-mr_rcp8.5 17 % miroc-esm-chem_rcp8.5 18 % noresm1-m_rcp2.6 noresm1-m_rcp8.5 19 % ukesm1-0-ll_ssp585 9 20 % 10 % - scenario (string): name of the climate scenario11 % Examples: rcp2.6, rcp8.5, ssp126, ssp58512 21 % Output: 13 % - basalforcings: prepared to be input directly into md.smb 22 % - basalforcings: prepared to be input directly into md.basalforcings 23 % time series from 1995-2100 14 24 % 15 25 % Examples: 16 % md.basalforcings = interpISMIP6AntarcticaOcn(md,'miroc-esm-chem ','rcp8.5');26 % md.basalforcings = interpISMIP6AntarcticaOcn(md,'miroc-esm-chem_rcp8.5'); 17 27 18 28 % Find appropriate directory … … 24 34 end 25 35 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 % search for thermal forcing file in the ISMIP climate model directory 37 rootname=[path model_name '/1995-2100/']; % root directory for the climate model files 38 tffile=dir([rootname '*_thermal_forcing_8km_x_60m.nc']); % thermal forcing file if found 39 40 % throw error if file not found, or if the file search is not unique 41 if length(tffile)~=1 42 error(['this path does not exist or is not unique under ' rootname]); 36 43 end 37 if ~found 38 error(['this path does not exist or the ' model_name ' and ' scenario ' are not available in this combination.']); 39 end 44 45 % save the full path of the found files 46 tfnc=[rootname tffile.name]; 40 47 41 48 %load TF data -
issm/trunk-jpl/src/m/parameterization/interpISMIP6AntarcticaSMB.m
r28054 r28065 1 function smb = interpISMIP6AntarcticaSMB(md,model_name ,scenario)1 function smb = interpISMIP6AntarcticaSMB(md,model_name) 2 2 %interpISMIP6AntarcticaSMB - interpolate chosen ISMIP6 atmospheric forcing to model 3 3 % 4 4 % Input: 5 5 % - md (model object) 6 % - model_name (string): name of the climate model 7 % Examples: CESM2 CNRM_CM6 CNRM_ESM2 CSIRO-Mk3-6-0 HadGEM2-ES IPSL-CM5A-MR 8 % ccsm4 miroc-esm-chem noresm1-m 9 % - scenario (string): name of the climate scenario 10 % Examples: rcp26, rcp85, ssp126, ssp585 6 % - model_name (string): name of the climate model and scenario 7 % - suppported options from /totten_1/ModelData/ISMIP6/Projections/AIS/Atmosphere_Forcing/ 8 % 2.6 scenario 8.5 scenario 9 % --------------------------------------------- 10 % ccsm4_rcp2.6 ccsm4_rcp8.5 11 % CESM2_ssp585 12 % CNRM_CM6_ssp126 CNRM_CM6_ssp585 13 % CNRM_ESM2_ssp585 14 % CSIRO-Mk3-6-0_rcp85 15 % HadGEM2-ES_rcp85 16 % IPSL-CM5A-MR_rcp26 IPSL-CM5A-MR_rcp85 17 % miroc-esm-chem_rcp2.6 miroc-esm-chem_rcp8.5 18 % noresm1-m_rcp2.6 noresm1-m_rcp8.5 19 % 11 20 % Output: 12 21 % - smb: prepared to be input directly into md.smb 22 % time series from 1995-2100 13 23 % 14 24 % Examples: 15 % md.smb = interpISMIP6AntarcticaSMB(md,'miroc-esm-chem ','rcp8.5');25 % md.smb = interpISMIP6AntarcticaSMB(md,'miroc-esm-chem_rcp8.5'); 16 26 17 27 % Find appropriate directory … … 23 33 end 24 34 25 %find which files are available and do a case insensitive test 26 rootname = [path model_name '_' scenario '/']; 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 42 error(['this path does not exist or the ' model_name ' and ' scenario ' are not available in this combination.']); 35 % search for smb files in the ISMIP climate model directory 36 rootname=[path model_name '/Regridded_2km/']; % root directory for the climate model files 37 smbclimfile=dir([rootname '*_2km_clim_1995-2014.nc']); % climatology file if found 38 smbanomfile=dir([rootname '*_2km_anomaly_1995-2100.nc']); % anomaly file if found 39 40 % throw error if files are not found, or if the file search is not unique 41 if length(smbclimfile)~=1 || length(smbanomfile)~=1 42 error(['this path does not exist or is not unique under ' rootname]); 43 43 end 44 44 45 % save the full path of the found files 46 smbclimnc=[rootname smbclimfile.name]; 47 smbanomnc=[rootname smbanomfile.name]; 48 49 % load data from files 45 50 disp(' == loading TS and SMB climatology data'); 46 51 lat = double(ncread(smbclimnc,'lat'));
Note:
See TracChangeset
for help on using the changeset viewer.