Skip to content

Commit 4486319

Browse files
committed
Added Gulf Stream
1 parent 5fe6a94 commit 4486319

File tree

5 files changed

+75
-2
lines changed

5 files changed

+75
-2
lines changed

bgcval2/bgcval2_make_report.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,6 +1480,7 @@ def newImageLocation(fn):
14801480
physicsKM = [
14811481
'AMOC_26N',
14821482
'ADRC_26N',
1483+
'GulfStream',
14831484
'AtmosCO2',
14841485
'DrakePassage',
14851486
'GlobalMeanTemperature',

bgcval2/bgcvaltools/pftnames.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ def makeLongNameDict():
235235
lnd['AMOC_26N_nomexico'] = "AMOC 26N (excluding Gulf of Mexico)"
236236
lnd['AMOC_32S'] = "AMOC 32S"
237237
lnd['ADRC_26N'] = "Atlantic Deep Return Current at 26N"
238+
lnd['GulfStream'] = "Gulf Stream at 26N"
239+
238240

239241
lnd['ZonalCurrent'] = "Zonal Current"
240242
lnd['MeridionalCurrent'] = "Meridional Current"

bgcval2/functions/circulation.py

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262

6363
#eORCA1_latslice26N = slice(227,228)
6464
eORCA1_latslice26Nnm = slice(228,229)
65+
eORCA1_lonslice_GS = slice(228,229)
66+
67+
6568
eORCA1_latslice32S = slice(137,138)
6669

6770
eORCA025_latslice26Nnm = slice(794,795)
@@ -312,6 +315,72 @@ def TwentySixNorth(nc,keys,**kwargs):
312315
return atlmoc
313316

314317

318+
def gulfstream(nc, keys, **kwargs):
319+
"""
320+
This function calculates the Gulf Stream at 26N.
321+
This is the sum of Northbound current between
322+
323+
nc: a netcdf openned as a dataset.
324+
keys: a list of keys to use in this function.
325+
326+
"""
327+
areafile = get_kwarg_file(kwargs, 'areafile')
328+
maskname = kwargs.get('maskname', 'tmask')
329+
grid = kwargs.get('grid', 'eORCA1')
330+
maxdepth = np.abs(kwargs.get('maxdepth', 2000. ))
331+
332+
333+
if not loadedArea:
334+
loadDataMask(areafile, maskname, grid)
335+
336+
if grid == 'eORCA1':
337+
latslice26Nnm = eORCA1_latslice26Nnm
338+
339+
#data=[-80.5011659 , -79.50119298, -78.50121829, -77.50124181,
340+
# -76.50126349, -75.50128329, -74.50130118, -73.50131712,
341+
# -72.50133107, -71.50134301, -70.50135293, -69.50136079,
342+
# -68.50136658],
343+
lonslice_70W = slice(207, 220)
344+
345+
altmaskfile = get_kwarg_file(kwargs, 'altmaskfile', default = 'bgcval2/data/basinlandmask_eORCA1.nc')
346+
if not loadedAltMask:
347+
loadAtlanticMask(altmaskfile, maskname='tmaskatl', grid=grid)
348+
elif grid == 'eORCA025':
349+
latslice26Nnm = eORCA025_latslice26Nnm
350+
351+
else:
352+
# grid not recognised.
353+
raise ValueError('TwentySixNorth: grid not recognised: %s', grid)
354+
355+
if not loadedAltMask:
356+
# Atlantic Mask not loaded
357+
raise ValueError('TwentySixNorth: Mask not loaded: ed: %s', grid)
358+
assert 0
359+
360+
lats = nc.variables['nav_lat'][latslice26Nnm, lonslice_70W]
361+
lons = nc.variables['nav_lon'][latslice26Nnm, lonslice_70W]
362+
vo = np.ma.array(nc.variables[keys[0]][0, :, latslice26Nnm, lonslice_70W]) # m/s
363+
vo = np.ma.masked_where(vo.mask + (vo <= 0.), vo)
364+
365+
thickness = nc.variables['thkcello'][0,:,latslice26Nnm, lonslice_70W]
366+
depth = np.abs(np.cumsum(thickness, axis=0))# depth array
367+
#print(vo.shape, thickness.shape, e1v_AMOC26N.shape)
368+
gs = 0.
369+
for (z, la, lo), v in np.ndenumerate(vo):
370+
if depth[z, la,lo] > maxdepth:
371+
continue
372+
if v <= 0:
373+
continue
374+
#print((z, la, lo),'depth:', depth[z, la,lo], (lats[la, lo],'N', lons[la, lo], 'E'), 'v:', v, 'thickness:', thickness[z, la, lo], 'width:', e1v_AMOC26N[la, lo])
375+
gs += v * thickness[z, la, lo] * e1v_AMOC26N[la, lo] / 1.E06
376+
377+
print('Gulf Stream:', gs) # expecting a value of 32Sv ish.
378+
# https://www.sciencedirect.com/science/article/pii/S0079661114001694
379+
380+
return gs
381+
382+
383+
315384
def twentysixnorth025(nc,keys,**kwargs):
316385
"""
317386
This function loads the AMOC array that is used for eORCA025

bgcval2/timeseries/timeseriesAnalysis.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,11 @@ def loadModel(self):
139139
# load and calculate the model info
140140
if len(glob.glob(self.shelvefn+'*')): # shelve files have .bak .dat .dir files now
141141
with shOpen(self.shelvefn) as sh:
142-
print('Shelf opens fine:', self.shelvefn)
142+
print('Opening Shelf file:', self.shelvefn)
143143
print (sh.keys())
144144
readFiles = sh['readFiles']
145145
modeldataD = sh['modeldata']
146+
146147
else:
147148
print('Does not exist', self.shelvefn)
148149
readFiles = []

key_lists/physics.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ keys:
5151
# ZonalCurrent: True # Zonal Veloctity
5252
# MeridionalCurrent: True # Meridional Veloctity
5353
# VerticalCurrent: True # Vertical Veloctity
54-
54+
GulfStream: True
5555

5656
somesatr: True # salt flow # Work in progress in debug
5757

0 commit comments

Comments
 (0)