MPAS-Dev / MPAS-Tools

MPAS Tools Repository
Other
36 stars 63 forks source link

Add plotting script for thermal forcing and surface mass balance #566

Open trhille opened 2 months ago

trhille commented 2 months ago

This merge adds a script that plots thermal forcing and surface mass balance time series. Currently the thermal forcing-related fields are hard-coded to ISMIP6 variable names, but that could be changed in the future. The user must specify files from which to plot thermal forcing and SMB; a mesh file containing coordinates, ice geometry, etc; and optionally a regions file that contains the regionCellMasks field. There are many (maybe too many) user-defined options for plotting:

  1. The option to plot at (i) a specified depth (or average over a depth range) using the -d argument, (ii) to interpolate the thermal forcing field to the seafloor (--seafloor), ice-shelf base (--shelf_base), or (iii) average over the full ice-shelf depth range (--shelf_range).
  2. The option to specify a csv file containing x and y coordinates for thermal forcing using the -c flag, or to specify coordinates in the command using -x and -y as comma-separated lists.
  3. The option to set start and end time indices using --start_time and --end_time.
  4. The option to take a random sample of point from the thermal forcing coordinates using --n_samples. This is just for prototyping, and the random samples are not currently reproducible.
  5. The option to average thermal forcing over all cells using the --average flag. If this flag is not set, a separate time series will be plotted for every cell, which will get messy when plotting more than a few cells. Note that averaging is not currently weighted by cell area.
  6. The option to save .png and .pdf files using the --save flag.
  7. The option to plot SMB for a specified region using the -n flag, which corresponds to the region number in regionCellMasks.
trhille commented 2 months ago

Example plot, created using the following command:

python plot_forcing_time_series.py -t /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/forcing/ais_mesh_4to20km_res/tier1_experiments/expAE02/AIS_4to20km_r01_20220907_TF_CCSM4_RCP85_2300.nc,/global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/forcing/ais_mesh_4to20km_res/tier1_experiments/expAE03/AIS_4to20km_r01_20220907_TF_HadGEM2-ES_RCP85_2300.nc,/global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/forcing/ais_mesh_4to20km_res/tier1_experiments/expAE04/AIS_4to20km_r01_20220907_TF_CESM2-WACCM_SSP585_2300.nc,/global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/forcing/ais_mesh_4to20km_res/tier1_experiments/expAE05/AIS_4to20km_r01_20220907_TF_UKESM1-0-LL_SSP585_2300.nc,/global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/forcing/ais_mesh_4to20km_res/tier2_experiments/expAE10/AIS_4to20km_TF_UKESM1-0-LL_SSP126_2300.nc \
-s /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/forcing/ais_mesh_4to20km_res/tier1_experiments/expAE02/AIS_4to20km_r01_20220907_SMB_CCSM4_RCP85_2300.nc,/global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/forcing/ais_mesh_4to20km_res/tier1_experiments/expAE03/AIS_4to20km_r01_20220907_SMB_HadGEM2-ES_RCP85_2300.nc,/global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/forcing/ais_mesh_4to20km_res/tier1_experiments/expAE04/AIS_4to20km_r01_20220907_SMB_CESM2-WACCM_SSP585_2300.nc,/global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/forcing/ais_mesh_4to20km_res/tier1_experiments/expAE05/AIS_4to20km_r01_20220907_smb_UKESM1-0-LL_SSP585_2300.nc,/global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/forcing/ais_mesh_4to20km_res/tier2_experiments/expAE10/AIS_4to20km_SMB_UKESM1-0-LL_SSP126_2300.nc -m /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/initial_conditions/AIS_4to20km_20230105/relaxation_0TGmelt_10yr/relaxed_10yrs_4km.nc \
-r /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/initial_conditions/AIS_4to20km_20230105/AIS_4to20km_r01_20220907.regionMask_ismip6.nc\
-c /global/cfs/cdirs/fanssie/MALI_projects/Amery_UQ/amery.csv -n 2 --shelf_base \
--average --start_time 5 --end_time -1 --save /pscratch/sd/t/trhille/Amery_TF_SMB

Amery_TF_SMB