Skip to content

Commit 15df3d4

Browse files
authored
Merge pull request #143 from valeriupredoi/dev_new_jasmin_disk
Changes needed to migrate to jasmin's new disk
2 parents eedd88f + 7811a9f commit 15df3d4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+503
-121
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ The `analysis_compare` tool creates a script in the `mass_scripts` directory.
430430
This script is copied to a shared directory in the shared ukesm/terrafirma diskspace:
431431

432432
```
433-
/gws/nopw/j04/esmeval/bgcval2/shared_mass_scripts
433+
/gws/ssde/j25a/esmeval/bgcval2/shared_mass_scripts
434434
```
435435

436436
A crontab job is set up to execute these scripts overnight on mass-cli1,
@@ -440,14 +440,14 @@ Very old scripts are automatically deleted.
440440
The crontab script is:
441441

442442
```
443-
/gws/nopw/j04/esmeval/bgcval2/shared_mass_cron.sh
443+
/gws/ssde/j25a/esmeval/bgcval2/shared_mass_cron.sh
444444
```
445445

446446
Note that cron executes this script with the `ldemora` username, so permissions may need to be changed
447447
in some cases. The output log for this script is sent to the file:
448448

449449
```
450-
/gws/nopw/j04/esmeval/bgcval2/shared_mass_cron.out
450+
/gws/ssde/j25a/esmeval/bgcval2/shared_mass_cron.out
451451
```
452452

453453
In the case that data is needed immediately, it's posiible to download manually as well.
@@ -642,7 +642,7 @@ input yamls. If you want to "clear the cache", these images need to be deleted.
642642
The key place to clear is set by default on jasmin to be:
643643

644644
```
645-
/gws/nopw/j04/ukesm/BGC_data/$USER/bgcval2/images/TimeseriesCompare/$NAME
645+
/gws/ssde/j25a/ukesm/BGC_data/$USER/bgcval2/images/TimeseriesCompare/$NAME
646646
```
647647

648648
where `$USER` is your jasmin user name and `$NAME` is the name given to this analysis
@@ -660,7 +660,7 @@ This is where the report is generated.
660660
The third place that these plots are kept is on the public facing jasmin directory:
661661

662662
```
663-
/gws/nopw/j04/esmeval/public/CompareReports/bgcval2/$USER/$NAME
663+
/gws/ssde/j25a/esmeval/public/CompareReports/bgcval2/$USER/$NAME
664664
```
665665

666666
This is where the report is hosted.

bgcval2/RemoteScripts/downloadOnMassCli.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ python /home/users/ldemora/workspace/ukesm-validation/RemoteScripts/hello.py $jo
2424

2525
ssh -X -A mass-cli.jasmin.ac.uk "python /home/users/ldemora/workspace/ukesm-validation/download_from_mass.py $jobid"
2626
#ssh -X -A mass-cli.jasmin.ac.uk "mkdir -p gws/nopw/j04/ukesm/BGC_data/u/group_workspaces/jasmin2/ukesm/BGC_data/$jobid/1y; ln -s /group_workspaces/jasmin2/ukesm/BGC_data/$jobid/*1y*grid_[UVWT]*.nc /group_workspaces/jasmin2/ukesm/BGC_data/$jobid/1y/.; ls -lhrt /group_workspaces/jasmin2/ukesm/BGC_data/$jobid"
27-
ssh -X -A mass-cli.jasmin.ac.uk "mkdir -p /gws/nopw/j04/ukesm/BGC_data/$jobid/1y; ln -s /gws/nopw/j04/ukesm/BGC_data/$jobid/*1y*grid_[UVWT]*.nc /gws/nopw/j04/ukesm/BGC_data/$jobid/1y/.; ls -lhrt /gws/nopw/j04/ukesm/BGC_data/$jobid"
27+
ssh -X -A mass-cli.jasmin.ac.uk "mkdir -p /gws/ssde/j25a/ukesm/BGC_data/$jobid/1y; ln -s /gws/ssde/j25a/ukesm/BGC_data/$jobid/*1y*grid_[UVWT]*.nc /gws/ssde/j25a/ukesm/BGC_data/$jobid/1y/.; ls -lhrt /gws/ssde/j25a/ukesm/BGC_data/$jobid"
2828

2929
#####
3030
# MLD:

bgcval2/bgcvaltools/generic_map_legend.py

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -274,35 +274,36 @@ def main():
274274

275275

276276
regions = [
277-
'LIseas',
278-
'LIGINseas',
279-
'GLINseas',
280-
'Ascension',
277+
# 'LIseas',
278+
# 'LIGINseas',
279+
# 'GLINseas',
280+
# 'Ascension',
281281
# 'ITCZ',
282282
# 'TristandaCunha',
283283
# 'Pitcairn',
284-
'Cornwall',
285-
'SubtropicNorthAtlantic',
286-
'SPNA',
287-
'STNA',
288-
'SouthernOcean',
289-
'subpolar',
290-
'NorthEastAtlantic',
291-
'ArcticOcean',
292-
'Equator10',
293-
'NorthPacificOcean',
294-
'SouthAtlanticOcean',
295-
'NorthernSubpolarPacific',
296-
'NorthernSubpolarAtlantic',
297-
'SouthPacificOcean',
298-
'NorthAtlanticOcean',
299-
'SouthAtlanticOcean',
300-
'GINseas',
301-
'LabradorSea',
302-
'IrmingerSea',
303-
'EquatorialAtlanticOcean',
304-
'Global',
305-
'ignoreInlandSeas',
284+
# 'Cornwall',
285+
'BritishIsles',
286+
# 'SubtropicNorthAtlantic',
287+
# 'SPNA',
288+
# 'STNA',
289+
# 'SouthernOcean',
290+
# 'subpolar',
291+
# 'NorthEastAtlantic',
292+
# 'ArcticOcean',
293+
# 'Equator10',
294+
# 'NorthPacificOcean',
295+
# 'SouthAtlanticOcean',
296+
# 'NorthernSubpolarPacific',
297+
# 'NorthernSubpolarAtlantic',
298+
# 'SouthPacificOcean',
299+
# 'NorthAtlanticOcean',
300+
# 'SouthAtlanticOcean',
301+
# 'GINseas',
302+
# 'LabradorSea',
303+
# 'IrmingerSea',
304+
# 'EquatorialAtlanticOcean',
305+
# 'Global',
306+
# 'ignoreInlandSeas',
306307
]
307308
for region in regions[:]:
308309
calc_area(region, orcaGridfn=orcaGridfn)

bgcval2/bgcvaltools/makeMask.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,10 @@ def makeMask(name, newSlice, xt, xz, xy, xx, xd, debug=False):
354354
return mx
355355
#65-75:20W-15E
356356

357-
357+
if newSlice == 'BritishIsles':
358+
mx = np.ma.masked_outside(xx, -11., 2.).mask
359+
mx += np.ma.masked_outside(xy, 48., 61.).mask
360+
return mx
358361

359362
if newSlice == 'Cornwall':
360363
mx = np.ma.masked_outside(xx, -8., -4.).mask

bgcval2/bgcvaltools/pftnames.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ def makeLongNameDict():
211211
lnd['INT_PN'] = 'Int. Non-Diatoms'
212212

213213
lnd['PRN'] = 'Non-Diatom Production'
214+
lnd['PPRN'] = 'Non-Diatom Production'
214215
lnd['PRD'] = 'Diatom Production'
215216
lnd['ZI_GROW'] = 'Microzooplankton Growth'
216217
lnd['ZE_GROW'] = 'Mesozooplankton Growth'
@@ -224,6 +225,7 @@ def makeLongNameDict():
224225
lnd['PD_NLIM'] = 'Diatom N limitation'
225226
lnd['PD_JLIM'] = 'Diatom Light Limitation'
226227
lnd['PD_SILIM'] = 'Diatom Si limitation'
228+
lnd['PBSI3'] = 'Biogenic Silica Production'
227229

228230
lnd['epN100'] = "Downward Flux of Particulate Nitrogen"
229231
lnd['O2min'] = 'Oxygen Minimum Concentration'
@@ -285,6 +287,10 @@ def makeLongNameDict():
285287
lnd['SubtropicNorthAtlantic'] = 'Subtropic North Atlantic'
286288
lnd['GINSalinity'] = 'GIN Salinity 0-800m'
287289

290+
lnd['volSalinity'] = 'Salinity 0-1200m'
291+
lnd['volTemperature'] = 'Temperature 0-1200m'
292+
293+
288294
lnd['Surfaceto100m'] = 'Surface-to-100m'
289295
lnd['Surfaceto200m'] = 'Surface-to-200m'
290296
lnd['Surfaceto300m'] = 'Surface-to-300m'
@@ -293,6 +299,8 @@ def makeLongNameDict():
293299
lnd['Surfaceto600m'] = 'Surface-to-600m'
294300
lnd['Surfaceto700m'] = 'Surface-to-700m'
295301
lnd['Surfaceto800m'] = 'Surface-to-800m'
302+
lnd['Surfaceto1200m'] = 'Surface-to-1200m'
303+
296304
lnd['Surfaceto2000m'] = 'Surface-to-2000m'
297305

298306
lnd['TotalHeatFlux'] = "Global Total Heat Flux"
@@ -312,11 +320,13 @@ def makeLongNameDict():
312320
lnd['sofmflup'] = "Water flux due to freezing/melting"
313321
lnd['sosfldow'] = "Downward salt flux"
314322
lnd['soicecov'] = "Ice Fraction"
323+
lnd['agessc'] = 'Water age'
315324
lnd['sossheig'] = "Sea Surface Height"
316325
lnd['FreshwaterFlux'] = "Freshwater Flux"
317326
lnd['hfbasinatlantic'] = 'Northward Atlantic heat transport'
318327
lnd['exportRatio'] = "Export Ratio"
319328
lnd['LocalExportRatio'] = "Export Ratio"
329+
lnd['OCN_RHOSW'] = 'Density'
320330

321331
lnd['PCO2_SW'] = 'pCO2'
322332
lnd['pCO2'] = 'pCO2'
@@ -349,6 +359,13 @@ def makeLongNameDict():
349359
lnd['DrakePassageTransport'] = 'Drake Passage Transport'
350360
lnd['DPT'] = 'Drake Passage Transport'
351361

362+
lnd['DavisStraightSaltFlux'] = 'Davis Straight Salt Flux'
363+
lnd['DavisStraightMassFlux'] = 'Davis Straight Mass Flux'
364+
lnd['DavisStraightHeatFlux'] = 'Davis Straight Heat Flux'
365+
lnd['NorwegianSeaSaltFlux'] = 'Norwegian Sea Salt Flux'
366+
lnd['NorwegianSeaMassFlux'] = 'Norwegian Sea Mass Flux'
367+
lnd['NorwegianSeaHeatFlux'] = 'Norwegian Sea Heat Flux'
368+
352369
lnd['t_mn'] = 'Mean Temperature'
353370
lnd['t_an'] = 'Temperature'
354371
lnd['s_mn'] = 'Mean Salinity'
@@ -467,6 +484,7 @@ def makeLongNameDict():
467484
lnd['NorthEastAtlantic'] = "North East Atlantic"
468485
lnd['NorwegianSea'] = "Norwegian Sea"
469486
lnd['Cornwall'] = "Cornwall"
487+
lnd['BritishIsles'] = 'British Isles'
470488
lnd['Ascension'] = "Ascension Island"
471489
lnd['TristandaCunha'] = "Tristan da Cunha"
472490
lnd['Pitcairn'] = "Pitcairn"

bgcval2/default-bgcval2-config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ standard-paths:
77
jasmin:
88
general:
99
machinelocation: "JASMIN"
10-
root_dir: "/gws/nopw/j04/ukesm"
10+
root_dir: "/gws/ssde/j25a/ukesm"
1111
shelvedir: "bgcval2/shelves"
1212
p2p_ppDir: "bgcval2/ukesm_postProcessed"
1313
imagedir: "bgcval2/images"

bgcval2/functions/circulation.py

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@
4444
eORCA1_drake_LAT0=79
4545
eORCA1_drake_LAT1=109
4646

47+
48+
eORCA1_davis_LON=289
49+
eORCA1_davis_LAT0=232
50+
eORCA1_davis_LAT1=244
51+
52+
# From Greenland to Norway via Iceland
53+
eORCA1_norway_LON = 281
54+
eORCA1_norway_LAT0 = 245
55+
eORCA1_norway_LAT1 = 294
56+
57+
58+
4759
eORCA025_drake_LON=875
4860
eORCA025_drake_LAT0=317
4961
eORCA025_drake_LAT1=436
@@ -86,6 +98,9 @@
8698
e1v_AMOC26N = 0
8799
e1v_AMOC40N = 0
88100
e1v_AMOC55N = 0
101+
e1v_davis = 0
102+
e1v_norway = 0
103+
89104
tmask_AMOC26N = 0
90105
tmask_AMOC40N = 0
91106
tmask_AMOC55N = 0
@@ -136,6 +151,8 @@ def loadDataMask(gridfn, maskname, grid):
136151
global e3v_AMOC26N
137152
global e3v_AMOC40N
138153
global e3v_AMOC55N
154+
global e1v_davis
155+
global e1v_norway
139156
global e1v_AMOC26N
140157
global e1v_AMOC40N
141158
global e1v_AMOC55N
@@ -183,6 +200,11 @@ def loadDataMask(gridfn, maskname, grid):
183200
e1v_AMOC55N = nc.variables['e1v'][..., latslice55Nnm, lonslice55N] #
184201
tmask_AMOC55N = nc.variables['tmask'][..., latslice55Nnm, lonslice55N]
185202

203+
e1v_davis = nc.variables['e1v'][eORCA1_davis_LON, eORCA1_davis_LAT0:eORCA1_davis_LAT1]
204+
e1v_norway = nc.variables['e1v'][eORCA1_norway_LON, eORCA1_norway_LAT0:eORCA1_norway_LAT1]
205+
206+
207+
186208
else:
187209
e3v_AMOC26N = nc.variables['e3v'][..., latslice26Nnm, :] # z level height 3D
188210
e1v_AMOC26N = nc.variables['e1v'][..., latslice26Nnm, :] #
@@ -196,6 +218,9 @@ def loadDataMask(gridfn, maskname, grid):
196218
e1v_AMOC55N = nc.variables['e1v'][..., latslice55N, :] #
197219
tmask_AMOC55N = nc.variables['tmask'][..., latslice55N, :]
198220

221+
e1v_davis = nc.variables['e1v'][eORCA1_davis_LON, eORCA1_davis_LAT0:eORCA1_davis_LAT1]
222+
e1v_norway = nc.variables['e1v'][eORCA1_norway_LON, eORCA1_norway_LAT0:eORCA1_norway_LAT1]
223+
199224
#print('e3v_AMOC26N: loaded')#e3v_AMOC26N, latslice26Nnm, e3v_AMOC26N.shape)
200225
nc.close()
201226
loadedArea = True
@@ -313,6 +338,110 @@ def drakePassage(nc, keys, **kwargs):
313338
return drake
314339

315340

341+
def davisstraightflux(nc, keys, straight='Davis', **kwargs):
342+
"""
343+
This function calculates the salt flux through the davis straight in eORCA1.
344+
345+
nc: a netcdf openned as a dataset.
346+
keys: a list of keys to use in this function.
347+
348+
"""
349+
areafile = get_kwarg_file(kwargs, 'areafile')
350+
maskname = kwargs.get('maskname', 'tmask')
351+
grid = kwargs.get('grid', 'eORCA1')
352+
353+
if not loadedArea:
354+
loadDataMask(areafile, maskname, grid)
355+
356+
if grid == 'eORCA1' and straight=='Davis':
357+
LON = eORCA1_davis_LON
358+
LAT0 = eORCA1_davis_LAT0
359+
LAT1 = eORCA1_davis_LAT1
360+
e1v = e1v_davis
361+
elif grid == 'eORCA1' and straight=='Norway':
362+
LON = eORCA1_norway_LON
363+
LAT0 = eORCA1_norway_LAT0
364+
LAT1 = eORCA1_norway_LAT1
365+
e1v = e1v_norway
366+
367+
else:
368+
assert 0
369+
370+
if keys[0] in ['vo', 'uo']:
371+
print('These needs to be multiplied by the thkcello.')
372+
assert 0
373+
374+
thkcello = nc.variables['thkcello'][0, :, LAT0:LAT1, LON]
375+
376+
print('Davis straight:', grid, 'LON', LON, 'LAT0',LAT0, 'LAT1', LAT1)
377+
378+
ndim = nc.variables[keys[0]].ndim
379+
if ndim == 4: # vso, vmo
380+
flux = nc.variables[keys[0]][0, :, LAT0:LAT1, LON]
381+
e1v_4d = np.broadcast_to(e1v[np.newaxis, :], thkcello.shape[:])
382+
383+
if ndim == 3: #hfy
384+
flux = nc.variables[keys[0]][0, LAT0:LAT1, LON]
385+
e1v_4d = e1v
386+
thkcello = thkcello.sum(0)
387+
388+
flux = np.ma.masked_where(flux==0., flux)
389+
if keys[0] in ['vo', 'uo']:
390+
flux = np.ma.sum(flux * e1v_4d * thkcello)
391+
else:
392+
# sum already calculated.
393+
flux = np.ma.sum(flux)
394+
395+
return flux
396+
397+
398+
def norwegianpassage(nc, keys, **kwargs):
399+
"""
400+
This function calculates the salt flux through the Norwegian Sea in eORCA1.
401+
402+
nc: a netcdf openned as a dataset.
403+
keys: a list of keys to use in this function.
404+
405+
"""
406+
return davisstraightflux(nc, keys, straight='Norway', **kwargs)
407+
408+
# areafile = get_kwarg_file(kwargs, 'areafile')
409+
# maskname = kwargs.get('maskname', 'tmask')
410+
# grid = kwargs.get('grid', 'eORCA1')
411+
412+
# if not loadedArea:
413+
# loadDataMask(areafile, maskname, grid)
414+
415+
# if grid == 'eORCA1':
416+
# LON = eORCA1_norway_LON
417+
# LAT0 = eORCA1_norway_LAT0
418+
# LAT1 = eORCA1_norway_LAT1
419+
# else:
420+
# assert 0
421+
422+
# if keys[0] in ['vo', 'uo']:
423+
# print('These needs to be multiplied by the thkcello.')
424+
# assert 0
425+
# print('Norwegian flux:', grid, 'LON', LON, 'LAT0',LAT0, 'LAT1', LAT1)
426+
427+
428+
# ndim = nc.variables[keys[0]].ndim
429+
430+
431+
# if ndim == 4: # vso, vmo
432+
# flux = nc.variables[keys[0]][0, :, LAT0:LAT1, LON]
433+
434+
# if ndim == 3: #hfy
435+
# flux = nc.variables[keys[0]][0, LAT0:LAT1, LON]
436+
437+
# flux = np.ma.masked_where(flux==0., flux)
438+
439+
# print('Norway:', flux.shape, thkcello.shape, e1v_4d.shape)
440+
# Norway = np.ma.sum(flux)
441+
442+
# return Norway
443+
444+
316445
def TwentySixNorth(nc, keys, lat='26N', return_max_depth=False, **kwargs):
317446
"""
318447
This function loads the AMOC/ADRC array that is used for eORCA

0 commit comments

Comments
 (0)