From 017445f83c7ff6c55ff92a9926af88625bd8b94f Mon Sep 17 00:00:00 2001 From: Lee de Mora Date: Wed, 22 Nov 2023 15:38:08 +0000 Subject: [PATCH] Added new regions and keys to focus in on cornwall and several UKOT MPAs --- bgcval2/bgcvaltools/makeMask.py | 22 +++++++++++++-------- bgcval2/bgcvaltools/pftnames.py | 12 +++++++---- key_files/mpa_airseafluxco2.yml | 13 ++++++++++++ key_files/mpa_alkalinity.yml | 23 ++++++++++++++++++++++ key_files/mpa_chlorophyll.yml | 20 +++++++++++++++++++ key_files/mpa_dic.yml | 19 ++++++++++++++++++ key_files/mpa_iron.yml | 32 ++++++++++++++++++++++++++++++ key_files/mpa_mld.yml | 35 +++++++++++++++++++++++++++++++++ key_files/mpa_nitrate.yml | 27 +++++++++++++++++++++++++ key_files/mpa_oxygen.yml | 25 +++++++++++++++++++++++ key_files/mpa_ph.yml | 17 ++++++++++++++++ key_files/mpa_salinity.yml | 23 ++++++++++++++++++++++ key_files/mpa_silicate.yml | 25 +++++++++++++++++++++++ key_files/mpa_temperature.yml | 28 ++++++++++++++++++++++++++ key_lists/ukmpas.yml | 35 +++++++++++++++++++++++++++++++++ 15 files changed, 344 insertions(+), 12 deletions(-) create mode 100644 key_files/mpa_airseafluxco2.yml create mode 100644 key_files/mpa_alkalinity.yml create mode 100644 key_files/mpa_chlorophyll.yml create mode 100644 key_files/mpa_dic.yml create mode 100644 key_files/mpa_iron.yml create mode 100644 key_files/mpa_mld.yml create mode 100644 key_files/mpa_nitrate.yml create mode 100644 key_files/mpa_oxygen.yml create mode 100644 key_files/mpa_ph.yml create mode 100644 key_files/mpa_salinity.yml create mode 100644 key_files/mpa_silicate.yml create mode 100644 key_files/mpa_temperature.yml create mode 100644 key_lists/ukmpas.yml diff --git a/bgcval2/bgcvaltools/makeMask.py b/bgcval2/bgcvaltools/makeMask.py index 6604b627..afdf354d 100644 --- a/bgcval2/bgcvaltools/makeMask.py +++ b/bgcval2/bgcvaltools/makeMask.py @@ -45,13 +45,13 @@ def makeMask(name, newSlice, xt, xz, xy, xx, xd, debug=False): :param xy: A one-dimensional array of the dataset latitudes. :param xx: A one-dimensional array of the dataset longitudes. :param xd: A one-dimensional array of the data. - + This function produces a mask to hides all points that are not in the requested region. - - Note that xt,xz,xy,xx,xd should all be the same shape and size. - + + Note that xt,xz,xy,xx,xd should all be the same shape and size. + This functional can call itself, if two regional masks are needed. - + Please add your own regions, at the bottom of the list, if needed. """ if debug: @@ -270,6 +270,12 @@ def makeMask(name, newSlice, xt, xz, xy, xx, xd, debug=False): mx += np.ma.masked_outside(xy, 49., 52.).mask return mx + if newSlice == 'Ascension': + mx = np.ma.masked_outside(xx, -17.246, -11.487).mask # longitude + mx += np.ma.masked_outside(xy, -10.813, -5.053).mask # Lattitue + return mx + + if newSlice == 'WeddelSea': mx = np.ma.masked_outside(xx, -60., -20.).mask mx += np.ma.masked_outside(xy, -80., -64.).mask @@ -487,13 +493,13 @@ def makeMask(name, newSlice, xt, xz, xy, xx, xd, debug=False): print("Corner case:", la, lo, bathy[la, lo]) nmask[i] = 1 if newSlice == "maskBelowBathy": - if (bathy[la, lo] - 10.) > abs(z): + if (bathy[la, lo] - 10.) > abs(z): nmask[i] = 1 elif newSlice in ["OnShelf", 'AMM_Shelf']: - if bathy[la, lo] >= shelfDepth: + if bathy[la, lo] >= shelfDepth: nmask[i] = 1 elif newSlice in ["OffShelf", 'AMM_OffShelf']: - if bathy[la, lo] < shelfDepth: + if bathy[la, lo] < shelfDepth: nmask[i] = 1 if i > 0: try: diff --git a/bgcval2/bgcvaltools/pftnames.py b/bgcval2/bgcvaltools/pftnames.py index 994d1297..c98d93e1 100644 --- a/bgcval2/bgcvaltools/pftnames.py +++ b/bgcval2/bgcvaltools/pftnames.py @@ -209,7 +209,7 @@ def makeLongNameDict(): lnd['Chlorophylla'] = 'Chlorophyll' lnd['Chlorophyll_cci'] = "Chlorophyll (CCI)" lnd['Chlorophyll_pig'] = "Chlorophyll (Pigments)" - lnd['TotalChlorophyll'] = 'Total Chlorophyll' + lnd['TotalChlorophyll'] = 'Total Chlorophyll' lnd['CHD'] = "Diatom Chlorophyll" lnd['CHN'] = "Non-Diatom Chlorophyll" lnd['DiatomChlorophyll'] = "Diatom Chlorophyll" @@ -247,7 +247,7 @@ def makeLongNameDict(): lnd['VolumeMeanTemperature'] = "Volume-weighted Mean Temperature" lnd['GlobalMeanSalinity'] = "Global Volume-weighted Mean Salinity" - + lnd['TotalHeatFlux'] = "Global Total Heat Flux" lnd['HeatFlux'] = "Heat Flux" @@ -326,7 +326,7 @@ def makeLongNameDict(): lnd['SSS'] = 'Sea Surface Salinty' lnd['MA_DraKE'] = 'Drake Passage Current' - lnd['MA_AMOC_26N'] = 'AMOC at 26.5N' + lnd['MA_AMOC_26N'] = 'AMOC at 26.5N' lnd['MA_ZOS'] = 'Sea Surface Height' lnd['MA_MLD'] = 'Mixed Layer Depth' lnd['MA_MLD_Sigma'] = 'Mixed Layer Depth (Sigma)' @@ -400,6 +400,10 @@ def makeLongNameDict(): lnd['LabradorSea'] = "Labrador Sea" lnd['NorwegianSea'] = "Norwegian Sea" lnd['Cornwall'] = "Cornwall" + lnd['Ascension'] = "Ascension Island" + lnd['TristandaCunha'] = "Tristan da Cunha" + lnd['Pitcairn'] = "Pitcairn" + lnd['100m'] = "100m deep" lnd['200m'] = "200m deep" @@ -732,7 +736,7 @@ def getLongName(text, debug=False): def fancyUnits(units, debug=False): - """ + """ Converts ascii units string into latex style formatting. """ units = units.replace('[', '').replace(']', '') diff --git a/key_files/mpa_airseafluxco2.yml b/key_files/mpa_airseafluxco2.yml new file mode 100644 index 00000000..556b2701 --- /dev/null +++ b/key_files/mpa_airseafluxco2.yml @@ -0,0 +1,13 @@ +--- +name : AirSeaFluxCO2 +units : mmolC/m2/d +model : MEDUSA +modelgrid : eORCA1 +dimensions : 2 +modelFiles : $BASEDIR_MODEL/$JOBID/medusa*$JOBIDo_1y_*_diad-T.nc +model_vars : CO2FLUX +model_convert : NoChange +layers : layerless +regions : Global Ascension TristandaCunha Pitcairn Cornwall + + diff --git a/key_files/mpa_alkalinity.yml b/key_files/mpa_alkalinity.yml new file mode 100644 index 00000000..285044b0 --- /dev/null +++ b/key_files/mpa_alkalinity.yml @@ -0,0 +1,23 @@ +--- +name : Alkalinity +units : meq/m^3 +model : MEDUSA +modelgrid : eORCA1 +dimensions : 3 + +# The filenames +modelFiles : $BASEDIR_MODEL/$JOBID/medusa*$JOBID*_1y_*_ptrc-T.nc +modelFile_p2p : $BASEDIR_MODEL/$JOBID/medusa*$JOBID*_1y_*$YEAR????_ptrc-T.nc +#dataFile : $BASEDIR_OBS/Alk.nc + +# # Model coordinates/dimension names +model_vars : ALK +model_convert : NoChange + +#data_vars : Alk +#data_convert: +# function: convertmeqm3TOumolkg + +layers : Surface #50m #;100m 200m 500m 1000m 2000m +regions : Global Ascension TristandaCunha Pitcairn Cornwall + diff --git a/key_files/mpa_chlorophyll.yml b/key_files/mpa_chlorophyll.yml new file mode 100644 index 00000000..f52c10fb --- /dev/null +++ b/key_files/mpa_chlorophyll.yml @@ -0,0 +1,20 @@ +--- +name : Chlorophyll +units : mg C/m^3 +model : MEDUSA +modelgrid : eORCA1 +dimensions : 3 + +# The filenames +modelFiles : $BASEDIR_MODEL/$JOBID/medusa*_1y_*_ptrc-T.nc +gridFile : $BASEDIR_MODEL/mesh_mask_eORCA1_wrk.nc + +# Model coordinates/dimension names +model_vars : CHD CHN +model_convert : sum + +layers : Surface +regions : Global Ascension TristandaCunha Pitcairn Cornwall + + + diff --git a/key_files/mpa_dic.yml b/key_files/mpa_dic.yml new file mode 100644 index 00000000..5c9732d0 --- /dev/null +++ b/key_files/mpa_dic.yml @@ -0,0 +1,19 @@ +--- +name : DIC +units : mmol C/m^3 +model : MEDUSA +modelgrid : eORCA1 +dimensions : 3 + +# The filenames +modelFiles : $BASEDIR_MODEL/$JOBID/medusa*$JOBIDo_1y_*_ptrc-T.nc +modelFile_p2p : $BASEDIR_MODEL/$JOBID/medusa*$JOBIDo_1y_*$YEAR????_ptrc-T.nc + +# # Model coordinates/dimension names +model_vars : DIC +model_convert : NoChange + + +layers : Surface #50m #;100m 200m 500m 1000m 2000m +regions : Global Ascension TristandaCunha Pitcairn Cornwall + diff --git a/key_files/mpa_iron.yml b/key_files/mpa_iron.yml new file mode 100644 index 00000000..96a2793c --- /dev/null +++ b/key_files/mpa_iron.yml @@ -0,0 +1,32 @@ +--- +name : Iron +units : mmol Fe/m^3 +datasource : Initial Conditions +model : MEDUSA +modelgrid : eORCA1 +dimensions : 3 + +# The filenames +modelFiles : $BASEDIR_MODEL/$JOBID/medusa*$JOBIDo_1y_*_ptrc-T.nc +modelFile_p2p : $BASEDIR_MODEL/$JOBID/medusa*$JOBDo_1y_*$YEAR????_ptrc-T.nc +#dataFile : /data/euryale7/backup/ledm/UKESM/InitialConditions/UKESM_fields_1860_eORCA1_small.nc +gridFile : $BASEDIR_MODEL/mesh_mask_eORCA1_wrk.nc + +# Model coordinates/dimension names +model_vars : FER +model_convert : + function: multiplyBy + factor : 1000 + +# Data coordinates names +#data_vars : FER +#data_tdict : ZeroToZero +#data_convert : multiplyBy +#data_convert_factor : 1000 + +layers : Surface #Transect ;CanRusTransect PTransect SOTransect Equator ArcTransect AntTransect ArcTransect AntTransect +regions : Global Ascension TristandaCunha Pitcairn Cornwall + + + + diff --git a/key_files/mpa_mld.yml b/key_files/mpa_mld.yml new file mode 100644 index 00000000..3d37268e --- /dev/null +++ b/key_files/mpa_mld.yml @@ -0,0 +1,35 @@ +--- +name : MLD +units : m +dimensions : 2 +model : NEMO +datasource : IFERMER + +# The filenames +modelFiles : $BASEDIR_MODEL/$JOBID/nemo*_$JOBIDo_1y_*_grid-T.nc +modelFile_p2p : $BASEDIR_MODEL/$JOBID/nemo*_$JOBIDo_1y_*$YEAR????_grid-T.nc +dataFile : $BASEDIR_OBS/IFREMER-MLD/mld_DT02_c1m_reg2.0-annual.nc + +# Model coordinates/dimension names +model_vars : mlotst +model_convert : NoChange +layers : layerless + +#model_vars : somxl010 somxzint1 +#model_convert: +# path: bgcval2/functions/applyLandMask.py +# function: applyLandMask +# areafile: $PATHS_GRIDFILE +# maskname : tmask + +data_vars : mld +data_tdict : ZeroToZero +data_convert: + path: bgcval2/functions/applyLandMask.py + function: applyLandMask + maskname : mask + areafile: $BASEDIR_OBS/IFREMER-MLD/mld_DT02_c1m_reg2.0-annual.nc +#layers : Surface +#regions : Global ignoreInlandSeas SouthernOcean ArcticOcean Equator10 NorthPacificOcean SouthPacificOcean NorthAtlanticOcean SouthAtlanticOcean +regions : Global Ascension TristandaCunha Pitcairn Cornwall + diff --git a/key_files/mpa_nitrate.yml b/key_files/mpa_nitrate.yml new file mode 100644 index 00000000..de9e2ec7 --- /dev/null +++ b/key_files/mpa_nitrate.yml @@ -0,0 +1,27 @@ +--- +name : Nitrate +units : mmol N/m^3 +datasource : WOA +model : MEDUSA +modelgrid : eORCA1 +dimensions : 3 + +# The filenames +modelFiles : $BASEDIR_MODEL/$JOBID/medusa*$JOBID*_1y_*_ptrc-T.nc +modelFile_p2p : $BASEDIR_MODEL/$JOBID/medusa*$JOBID*_1y_*$YEAR????_ptrc-T.nc +dataFile : $BASEDIR_OBS/WOA/annual/woa13_all_n00_01.nc + +# Model coordinates/dimension names +model_vars : DIN +model_convert : NoChange + +# Data coordinates names +data_vars : n_an +data_convert : NoChange +data_tdict : ZeroToZero + +layers : Surface 50m #;100m 200m 500m 1000m 2000m +regions : Global Ascension TristandaCunha Pitcairn Cornwall + + + diff --git a/key_files/mpa_oxygen.yml b/key_files/mpa_oxygen.yml new file mode 100644 index 00000000..c264fc7b --- /dev/null +++ b/key_files/mpa_oxygen.yml @@ -0,0 +1,25 @@ +--- +name : Oxygen +units : mmol O2/m^3 +datasource : WOA +dimensions : 3 + +# The filenames +modelFiles : $BASEDIR_MODEL/$JOBID/medusa*_1y_*_ptrc-T.nc +modelFile_p2p : $BASEDIR_MODEL/$JOBID/medusa*_1y_*$YEAR????_ptrc-T.nc +dataFile : $BASEDIR_OBS/WOA/annual/woa13_all_o00_01.nc + +# Model coordinates/dimension names +model_vars : OXY +model_convert : NoChange + +# Data coordinates names +data_vars : o_an +data_tdict : ZeroToZero +data_convert: + function: multiplyBy + factor : 44.661 + +layers : Surface 100m 500m +regions : Global Ascension TristandaCunha Pitcairn Cornwall + diff --git a/key_files/mpa_ph.yml b/key_files/mpa_ph.yml new file mode 100644 index 00000000..68915a93 --- /dev/null +++ b/key_files/mpa_ph.yml @@ -0,0 +1,17 @@ +--- +name : pH +units : '' +model : MEDUSA +modelgrid : eORCA1 +dimensions : 3 + +# The filenames +modelFiles : $BASEDIR_MODEL/$JOBID/medusa*$JOBID*_1y_*_diad-T.nc +#modelFile_p2p : $BASEDIR_MODEL/$JOBID/medusa*$JOBID*_1y_*$YEAR????_ptrc-T.nc +# dataFile : $BASEDIR_OBS/WOA/annual/woa13_all_n00_01.nc +# # Model coordinates/dimension names +model_vars : PH3 +model_convert : NoChange + +layers : Surface #50m #;100m 200m 500m 1000m 2000m +regions : Global Ascension TristandaCunha Pitcairn Cornwall diff --git a/key_files/mpa_salinity.yml b/key_files/mpa_salinity.yml new file mode 100644 index 00000000..716f62e5 --- /dev/null +++ b/key_files/mpa_salinity.yml @@ -0,0 +1,23 @@ +--- +name : Salinity +units : PSU +dimensions : 3 +model : NEMO +datasource : WOA +# The filenames +modelFiles : $BASEDIR_MODEL/$JOBID/nemo_$JOBIDo_1y_*_grid-T.nc +modelFile_p2p : $BASEDIR_MODEL/$JOBID/nemo*$JOBIDo_1y_*$YEAR????_grid-T.nc +dataFile : $BASEDIR_OBS/WOA/annual/woa13_decav_s00_01v2.nc +gridFile : $PATHS_GRIDFILE + +# Model coordinates/dimension names +model_vars : so_abs so +model_convert : choose_best_var + +# Data coordinates names +data_vars : s_an +data_convert : NoChange +data_tdict : ZeroToZero + +layers : Surface +regions : Global Ascension TristandaCunha Pitcairn Cornwall diff --git a/key_files/mpa_silicate.yml b/key_files/mpa_silicate.yml new file mode 100644 index 00000000..46d74dee --- /dev/null +++ b/key_files/mpa_silicate.yml @@ -0,0 +1,25 @@ +--- +name : Silicate +units : mmol Si/m^3 +datasource : WOA +dimensions : 3 + +# The filenames +modelFiles : $BASEDIR_MODEL/$JOBID/medusa*_1y_*_ptrc-T.nc +modelFile_p2p : $BASEDIR_MODEL/$JOBID/medusa*_1y_*$YEAR????_ptrc-T.nc +dataFile : $BASEDIR_OBS/WOA/annual/woa13_all_i00_01.nc + +# Model coordinates/dimension names +model_vars : SIL +model_convert : NoChange + +# Data coordinates names +data_vars : i_an +data_convert : NoChange +data_tdict : ZeroToZero + +layers : Surface +regions : Global Ascension TristandaCunha Pitcairn Cornwall + + + diff --git a/key_files/mpa_temperature.yml b/key_files/mpa_temperature.yml new file mode 100644 index 00000000..d7ce291e --- /dev/null +++ b/key_files/mpa_temperature.yml @@ -0,0 +1,28 @@ +--- +name : Temperature +units : degrees C +dimensions : 3 +model : NEMO +datasource : WOA +# The filenames +modelFiles : $BASEDIR_MODEL/$JOBID/nemo_$JOBIDo_1y_*_grid-T.nc +modelFile_p2p : $BASEDIR_MODEL/$JOBID/nemo*$JOBIDo_1y_*$YEAR????_grid-T.nc +dataFile : $BASEDIR_OBS/WOA/annual/woa13_decav_t00_01v2.nc +gridFile : $PATHS_GRIDFILE + +# Model coordinates/dimension names +model_vars : thetao_con thetao +model_convert : choose_best_var + + +# Data coordinates names +data_vars : t_an +data_convert : NoChange +data_tdict : ZeroToZero + +layers : Surface +regions : Global Ascension TristandaCunha Pitcairn Cornwall + + + + diff --git a/key_lists/ukmpas.yml b/key_lists/ukmpas.yml new file mode 100644 index 00000000..bd277f3b --- /dev/null +++ b/key_lists/ukmpas.yml @@ -0,0 +1,35 @@ +--- +# UK MPAS +# A short list of key metrics to study MPAs. +keys: + # Useful metrics for everything + GlobalMeanTemperature: True + DrakePassageTransport: True + AMOC_26N: True + TotalAirSeaFluxCO2: True + TotalIceExtent: True + + # Nutrients + MPA_Nitrate: True # WOA Nitrate + MPA_Silicate: True # WOA Siliate + MPA_Iron: True # Iron + + # Chlorophyll, Production, Export and DMS + MPA_Chlorophyll: True # Total Chlorophyll + MPA_IntPP: True # Global Total Integrated Primary Production + + # Carbonate system: + MPA_Alkalinity: True # Glodap Alkalinity + MPA_pH: True + MPA_DIC: True # Globap dissolved inorganic carbon + MPA_AirSeaFluxCO2: True # Air Sea Flux of CO2 + # Oxygen: + MPA_Oxygen: True # WOA Oxygen + + MPA_Temperature: True # WOA Temperature + MPA_Salinity: True # WOA Salinity + MPA_MLD: True # iFERMER Mixed Layer Depth + + + +