Skip to content

Commit 2f9c912

Browse files
authored
Merge pull request #119 from valeriupredoi/dev_tfmpas
A few handy jobs for looking aat a few UK MPA regions.
2 parents 95c5e01 + a2f7877 commit 2f9c912

18 files changed

+481
-14
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ _sidebar.rst.inc
2020
local_test/BGC_data/valeriu
2121
mass_scripts
2222
CompareReports2
23+
.idea/workspace.xml

bgcval2/bgcvaltools/makeMask.py

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ def makeMask(name, newSlice, xt, xz, xy, xx, xd, debug=False):
4545
:param xy: A one-dimensional array of the dataset latitudes.
4646
:param xx: A one-dimensional array of the dataset longitudes.
4747
:param xd: A one-dimensional array of the data.
48-
48+
4949
This function produces a mask to hides all points that are not in the requested region.
50-
51-
Note that xt,xz,xy,xx,xd should all be the same shape and size.
52-
50+
51+
Note that xt,xz,xy,xx,xd should all be the same shape and size.
52+
5353
This functional can call itself, if two regional masks are needed.
54-
54+
5555
Please add your own regions, at the bottom of the list, if needed.
5656
"""
5757
if debug:
@@ -270,6 +270,26 @@ def makeMask(name, newSlice, xt, xz, xy, xx, xd, debug=False):
270270
mx += np.ma.masked_outside(xy, 49., 52.).mask
271271
return mx
272272

273+
if newSlice == 'Ascension':
274+
mx = np.ma.masked_outside(xx, -17.246, -11.487).mask # longitude
275+
mx += np.ma.masked_outside(xy, -10.813, -5.053).mask # Lattitue
276+
return mx
277+
278+
if newSlice == 'TristandaCunha': # MPA covers two islands. This is very approximate
279+
# Edinburgh of 7 seas: -37.10646514207477 South,, -12.297874143783694 West
280+
# Gough island: -40.322968275628654 South, -9.935193569988446 West
281+
mx = np.ma.masked_outside(xx, -12.3 - 3., -9.9 + 3.).mask # longitude # West
282+
mx += np.ma.masked_outside(xy, -40.3 -3, -37.1 + 3.).mask # Lattitue # South
283+
return mx
284+
285+
if newSlice == 'Pitcairn': # MPA covers several islands. This is very approximate
286+
# Ducie Island: 24.66 S 124.75 W (Eastern most)
287+
# Oeno island: 23.9 S 130.74 W (western most) (Western boundary is not the full EEZ)
288+
mx = np.ma.masked_outside(xx, -130.74 - 1.5, 124.75 + 3.).mask # longitude # West
289+
mx += np.ma.masked_outside(xy, -24.66 -3, -23.9 + 3.).mask # Lattitue # South
290+
return mx
291+
292+
273293
if newSlice == 'WeddelSea':
274294
mx = np.ma.masked_outside(xx, -60., -20.).mask
275295
mx += np.ma.masked_outside(xy, -80., -64.).mask
@@ -487,13 +507,13 @@ def makeMask(name, newSlice, xt, xz, xy, xx, xd, debug=False):
487507
print("Corner case:", la, lo, bathy[la, lo])
488508
nmask[i] = 1
489509
if newSlice == "maskBelowBathy":
490-
if (bathy[la, lo] - 10.) > abs(z):
510+
if (bathy[la, lo] - 10.) > abs(z):
491511
nmask[i] = 1
492512
elif newSlice in ["OnShelf", 'AMM_Shelf']:
493-
if bathy[la, lo] >= shelfDepth:
513+
if bathy[la, lo] >= shelfDepth:
494514
nmask[i] = 1
495515
elif newSlice in ["OffShelf", 'AMM_OffShelf']:
496-
if bathy[la, lo] < shelfDepth:
516+
if bathy[la, lo] < shelfDepth:
497517
nmask[i] = 1
498518
if i > 0:
499519
try:

bgcval2/bgcvaltools/pftnames.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def makeLongNameDict():
209209
lnd['Chlorophylla'] = 'Chlorophyll'
210210
lnd['Chlorophyll_cci'] = "Chlorophyll (CCI)"
211211
lnd['Chlorophyll_pig'] = "Chlorophyll (Pigments)"
212-
lnd['TotalChlorophyll'] = 'Total Chlorophyll'
212+
lnd['TotalChlorophyll'] = 'Total Chlorophyll'
213213
lnd['CHD'] = "Diatom Chlorophyll"
214214
lnd['CHN'] = "Non-Diatom Chlorophyll"
215215
lnd['DiatomChlorophyll'] = "Diatom Chlorophyll"
@@ -247,7 +247,7 @@ def makeLongNameDict():
247247

248248
lnd['VolumeMeanTemperature'] = "Volume-weighted Mean Temperature"
249249
lnd['GlobalMeanSalinity'] = "Global Volume-weighted Mean Salinity"
250-
250+
251251

252252
lnd['TotalHeatFlux'] = "Global Total Heat Flux"
253253
lnd['HeatFlux'] = "Heat Flux"
@@ -326,7 +326,7 @@ def makeLongNameDict():
326326
lnd['SSS'] = 'Sea Surface Salinty'
327327

328328
lnd['MA_DraKE'] = 'Drake Passage Current'
329-
lnd['MA_AMOC_26N'] = 'AMOC at 26.5N'
329+
lnd['MA_AMOC_26N'] = 'AMOC at 26.5N'
330330
lnd['MA_ZOS'] = 'Sea Surface Height'
331331
lnd['MA_MLD'] = 'Mixed Layer Depth'
332332
lnd['MA_MLD_Sigma'] = 'Mixed Layer Depth (Sigma)'
@@ -400,6 +400,10 @@ def makeLongNameDict():
400400
lnd['LabradorSea'] = "Labrador Sea"
401401
lnd['NorwegianSea'] = "Norwegian Sea"
402402
lnd['Cornwall'] = "Cornwall"
403+
lnd['Ascension'] = "Ascension Island"
404+
lnd['TristandaCunha'] = "Tristan da Cunha"
405+
lnd['Pitcairn'] = "Pitcairn"
406+
403407

404408
lnd['100m'] = "100m deep"
405409
lnd['200m'] = "200m deep"
@@ -732,7 +736,7 @@ def getLongName(text, debug=False):
732736

733737

734738
def fancyUnits(units, debug=False):
735-
"""
739+
"""
736740
Converts ascii units string into latex style formatting.
737741
"""
738742
units = units.replace('[', '').replace(']', '')
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
---
2+
# GC5 N96 ORCA1 spinup analysis
3+
name: TerraFIRMA_overshoot_MPAs
4+
5+
# Run the single job analysis
6+
do_analysis_timeseries: True
7+
8+
# Download from mass:
9+
do_mass_download: False
10+
11+
# master analysis suite
12+
master_suites: kmf mpas # physics bgc #alkalinity physics kmf1
13+
14+
# Run without strick check (if True, breaks if job has no years.)
15+
strict_file_check: False
16+
17+
clean: True
18+
19+
jobs:
20+
u-cs495:
21+
description: 'PI-Control'
22+
label: 'Pi-Control'
23+
colour: 'blue'
24+
thickness: 1.2
25+
linestyle: '-'
26+
shifttime: -100.
27+
timerange: [1850, 2200]
28+
suite: kmf mpas #physics bgc #alkalinity physics
29+
30+
31+
u-cx209:
32+
description: 'E-mode free ice RAMP UP 8GtC/yr #1'
33+
label: 'Ramp-up'
34+
colour: 'black'
35+
thickness: 1.2
36+
linestyle: '-'
37+
shifttime: 0.
38+
#timerange: [1800, 2050]
39+
suite: kmf mpas #physics bgc #alkalinity physics
40+
41+
# 1.5k Stabilisation
42+
u-cy837:
43+
description: '1.5K Stabilisation from u-cx209 (#1)'
44+
label: '1.5K Stable'
45+
colour: 'lawngreen'
46+
thickness: 1.2
47+
linestyle: '-'
48+
shifttime: 0.
49+
#timerange: [1800, 2050]
50+
suite: kmf mpas # physics bgc #alkalinity physics
51+
52+
53+
# 2k Stabilisation
54+
u-cy838:
55+
description: '2.0K Stabilisation from u-cx209 (#1)'
56+
label: '2K Stable'
57+
colour: 'goldenrod'
58+
thickness: 1.2
59+
linestyle: '-'
60+
shifttime: 0.
61+
#timerange: [1800, 2050]
62+
suite: kmf mpas # physics bgc #alkalinity physics
63+
64+
65+
# other Stabilisations
66+
u-cz375:
67+
description: '3.0K Stabilisation from u-cx209 (#1)'
68+
label: '3K Stable'
69+
colour: 'red' #
70+
thickness: 1.2
71+
linestyle: '-'
72+
shifttime: 0.
73+
#timerange: [1800, 2050]
74+
suite: kmf mpas # physics bgc #alkalinity physics
75+
u-cz376:
76+
description: '4.0K Stabilisation from u-cx209 (#1)'
77+
label: '4K Stable'
78+
colour: 'sienna'
79+
thickness: 1.2
80+
linestyle: '-'
81+
shifttime: 0.
82+
#timerange: [1800, 2050]
83+
suite: kmf mpas # physics bgc #alkalinity physics
84+
u-cz377:
85+
description: '5.0K Stabilisation from u-cx209 (#1)'
86+
label: '5K Stable'
87+
colour: 'maroon'
88+
thickness: 1.2
89+
linestyle: '-'
90+
shifttime: 0.
91+
#timerange: [1800, 2050]
92+
suite: kmf mpas # physics bgc #alkalinity physics
93+
94+
# Ramp downs
95+
u-da697:
96+
description: '1.5K Rampdown from u-cx209 (#1)'
97+
label: '1.5K Rampdown'
98+
colour: 'lawngreen'
99+
thickness: 1.2
100+
linestyle: ':'
101+
shifttime: 0.
102+
#timerange: [1800, 2050]
103+
suite: kmf mpas # physics bgc #alkalinity physics
104+
105+
u-cz944:
106+
description: 'Ramp down from cy838 (- 2.0K Stabilisation from u-cx209) (#1)'
107+
label: '2K Rampdown'
108+
colour: 'goldenrod'
109+
thickness: 1.2
110+
linestyle: 'dashed'
111+
shifttime: 0.
112+
#timerange: [1800, 2050]
113+
suite: kmf mpas #physics bgc #alkalinity physics
114+
115+
116+
117+
118+
119+
120+

key_files/mpa_airseafluxco2.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name : AirSeaFluxCO2
3+
units : mmolC/m2/d
4+
model : MEDUSA
5+
modelgrid : eORCA1
6+
dimensions : 2
7+
modelFiles : $BASEDIR_MODEL/$JOBID/medusa*$JOBIDo_1y_*_diad-T.nc
8+
model_vars : CO2FLUX
9+
model_convert : NoChange
10+
layers : layerless
11+
regions : Global Ascension TristandaCunha Pitcairn Cornwall
12+
13+

key_files/mpa_alkalinity.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name : Alkalinity
3+
units : meq/m^3
4+
model : MEDUSA
5+
modelgrid : eORCA1
6+
dimensions : 3
7+
8+
# The filenames
9+
modelFiles : $BASEDIR_MODEL/$JOBID/medusa*$JOBID*_1y_*_ptrc-T.nc
10+
modelFile_p2p : $BASEDIR_MODEL/$JOBID/medusa*$JOBID*_1y_*$YEAR????_ptrc-T.nc
11+
#dataFile : $BASEDIR_OBS/Alk.nc
12+
13+
# # Model coordinates/dimension names
14+
model_vars : ALK
15+
model_convert : NoChange
16+
17+
#data_vars : Alk
18+
#data_convert:
19+
# function: convertmeqm3TOumolkg
20+
21+
layers : Surface #50m #;100m 200m 500m 1000m 2000m
22+
regions : Global Ascension TristandaCunha Pitcairn Cornwall
23+

key_files/mpa_chlorophyll.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name : Chlorophyll
3+
units : mg C/m^3
4+
model : MEDUSA
5+
modelgrid : eORCA1
6+
dimensions : 3
7+
8+
# The filenames
9+
modelFiles : $BASEDIR_MODEL/$JOBID/medusa*_1y_*_ptrc-T.nc
10+
gridFile : $BASEDIR_MODEL/mesh_mask_eORCA1_wrk.nc
11+
12+
# Model coordinates/dimension names
13+
model_vars : CHD CHN
14+
model_convert : sum
15+
16+
layers : Surface
17+
regions : Global Ascension TristandaCunha Pitcairn Cornwall
18+
19+
20+

key_files/mpa_dic.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name : DIC
3+
units : mmol C/m^3
4+
model : MEDUSA
5+
modelgrid : eORCA1
6+
dimensions : 3
7+
8+
# The filenames
9+
modelFiles : $BASEDIR_MODEL/$JOBID/medusa*$JOBIDo_1y_*_ptrc-T.nc
10+
modelFile_p2p : $BASEDIR_MODEL/$JOBID/medusa*$JOBIDo_1y_*$YEAR????_ptrc-T.nc
11+
12+
# # Model coordinates/dimension names
13+
model_vars : DIC
14+
model_convert : NoChange
15+
16+
17+
layers : Surface #50m #;100m 200m 500m 1000m 2000m
18+
regions : Global Ascension TristandaCunha Pitcairn Cornwall
19+

key_files/mpa_iron.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name : Iron
3+
units : mmol Fe/m^3
4+
datasource : Initial Conditions
5+
model : MEDUSA
6+
modelgrid : eORCA1
7+
dimensions : 3
8+
9+
# The filenames
10+
modelFiles : $BASEDIR_MODEL/$JOBID/medusa*$JOBIDo_1y_*_ptrc-T.nc
11+
modelFile_p2p : $BASEDIR_MODEL/$JOBID/medusa*$JOBDo_1y_*$YEAR????_ptrc-T.nc
12+
#dataFile : /data/euryale7/backup/ledm/UKESM/InitialConditions/UKESM_fields_1860_eORCA1_small.nc
13+
gridFile : $BASEDIR_MODEL/mesh_mask_eORCA1_wrk.nc
14+
15+
# Model coordinates/dimension names
16+
model_vars : FER
17+
model_convert :
18+
function: multiplyBy
19+
factor : 1000
20+
21+
# Data coordinates names
22+
#data_vars : FER
23+
#data_tdict : ZeroToZero
24+
#data_convert : multiplyBy
25+
#data_convert_factor : 1000
26+
27+
layers : Surface #Transect ;CanRusTransect PTransect SOTransect Equator ArcTransect AntTransect ArcTransect AntTransect
28+
regions : Global Ascension TristandaCunha Pitcairn Cornwall
29+
30+
31+
32+

key_files/mpa_mld.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name : MLD
3+
units : m
4+
dimensions : 2
5+
model : NEMO
6+
datasource : IFERMER
7+
8+
# The filenames
9+
modelFiles : $BASEDIR_MODEL/$JOBID/nemo*_$JOBIDo_1y_*_grid-T.nc
10+
modelFile_p2p : $BASEDIR_MODEL/$JOBID/nemo*_$JOBIDo_1y_*$YEAR????_grid-T.nc
11+
dataFile : $BASEDIR_OBS/IFREMER-MLD/mld_DT02_c1m_reg2.0-annual.nc
12+
13+
# Model coordinates/dimension names
14+
model_vars : mlotst
15+
model_convert : NoChange
16+
layers : layerless
17+
18+
#model_vars : somxl010 somxzint1
19+
#model_convert:
20+
# path: bgcval2/functions/applyLandMask.py
21+
# function: applyLandMask
22+
# areafile: $PATHS_GRIDFILE
23+
# maskname : tmask
24+
25+
data_vars : mld
26+
data_tdict : ZeroToZero
27+
data_convert:
28+
path: bgcval2/functions/applyLandMask.py
29+
function: applyLandMask
30+
maskname : mask
31+
areafile: $BASEDIR_OBS/IFREMER-MLD/mld_DT02_c1m_reg2.0-annual.nc
32+
#layers : Surface
33+
#regions : Global ignoreInlandSeas SouthernOcean ArcticOcean Equator10 NorthPacificOcean SouthPacificOcean NorthAtlanticOcean SouthAtlanticOcean
34+
regions : Global Ascension TristandaCunha Pitcairn Cornwall
35+

0 commit comments

Comments
 (0)