Skip to content

Commit 07ba59a

Browse files
committed
Adding new key files, and additional bug fixes.
1 parent 6178d90 commit 07ba59a

14 files changed

Lines changed: 571 additions & 9 deletions

File tree

bgcval2/functions/circulation.py

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,22 @@ def drakePassage(nc, keys, **kwargs):
344344

345345
if nc.variables['nav_lat'].shape == (332, 362):
346346
print('Classic grid')
347+
elif nc.variables['nav_lat'].shape == (331, 360):
348+
# No border here, so
349+
# (331, 360)
350+
# nc.variables[e3u_keys[0]][0, :, LAT0:LAT1, LON]
351+
# Lat is the same as there's no soouthern border, but longitude is one less, as there;s not border.
352+
LAT0 = 79
353+
LAT1 = 109
354+
LON = 219-1
347355
else:
348356
assert 0
349357

350358
elif grid == 'eORCA025':
351-
LON = eORCA025_drake_LON
352359
LAT0 = eORCA025_drake_LAT0
353360
LAT1 = eORCA025_drake_LAT1
361+
LON = eORCA025_drake_LON
362+
354363
latslice26Nnm = eORCA025_latslice26Nnm
355364
else:
356365
assert 0
@@ -400,6 +409,8 @@ def davisstraightflux(nc, keys, straight='Davis', **kwargs):
400409

401410
if nc.variables['nav_lat'].shape == (332, 362):
402411
print('Classic grid')
412+
elif nc.variables['nav_lat'].shape == (331, 360):
413+
LON = LON - 1
403414
else:
404415
assert 0
405416

@@ -740,14 +751,16 @@ def gulfstream_depth(nc, keys, **kwargs):
740751
loadDataMask(areafile, maskname, grid)
741752

742753
if grid == 'eORCA1':
743-
latslice26Nnm = eORCA1_latslice26Nnm
744754
#data=[-80.5011659 , -79.50119298, -78.50121829, -77.50124181,
745755
# -76.50126349, -75.50128329, -74.50130118, -73.50131712,
746756
# -72.50133107, -71.50134301, -70.50135293, -69.50136079,
747757
# -68.50136658],
748758
if nc.variables[keys[0]].shape == (332, 362):
749759
print('Classic grid')
750760
lonslice_70W = slice(211, 217)
761+
latslice26Nnm = eORCA1_latslice26Nnm
762+
elif nc.variables['nav_lat'].shape == (331, 360):
763+
lonslice_70W = slice(210, 216)
751764
else:
752765
assert 0
753766
# elif nc.variables[keys[0]].shape == (332, 362):
@@ -843,14 +856,20 @@ def gulfstream(nc, keys, **kwargs):
843856
# -76.50126349, -75.50128329, -74.50130118, -73.50131712,
844857
# -72.50133107, -71.50134301, -70.50135293, -69.50136079,
845858
# -68.50136658],
846-
lonslice_70W = slice(207, 220)
847859

848860
altmaskfile = get_kwarg_file(kwargs, 'altmaskfile', default = 'bgcval2/data/basinlandmask_eORCA1.nc')
849861
if not loadedAltMask:
850862
loadAtlanticMask(altmaskfile, maskname='tmaskatl', grid=grid)
851863

852864
if nc.variables[keys[0]].shape == (332, 362):
865+
lonslice_70W = slice(207, 220)
866+
gs_e1v = e1v_AMOC26N
853867
print('Classic grid')
868+
elif nc.variables['nav_lat'].shape == (331, 360):
869+
870+
lonslice_70W = slice(206, 219)
871+
gs_e1v = e1v_AMOC26N
872+
854873
else:
855874
assert 0
856875
elif grid == 'eORCA025':
@@ -878,15 +897,15 @@ def gulfstream(nc, keys, **kwargs):
878897
thickness = nc.variables['thkcellvo'][0,:,latslice26Nnm, lonslice_70W]
879898

880899
depth = np.abs(np.cumsum(thickness, axis=0))# depth array
881-
#print(vo.shape, thickness.shape, e1v_AMOC26N.shape)
900+
#print(vo.shape, thickness.shape, gs_e1v.shape)
882901
gs = 0.
883902
for (z, la, lo), v in np.ndenumerate(vo):
884903
if depth[z, la,lo] > maxdepth:
885904
continue
886905
if v <= 0:
887906
continue
888-
#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])
889-
gs += v * thickness[z, la, lo] * e1v_AMOC26N[la, lo] / 1.E06
907+
#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:', gs_e1v[la, lo])
908+
gs += v * thickness[z, la, lo] * gs_e1v[la, lo] / 1.E06
890909

891910
print('Gulf Stream:', gs) # expecting a value of 32Sv ish.
892911
# https://www.sciencedirect.com/science/article/pii/S0079661114001694

key_files/evs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ modelFile_p2p : $BASEDIR_MODEL/$JOBID/nemo*$JOBIDo_1y_*$YEAR????_grid-T.nc
1010
gridFile : $PATHS_GRIDFILE
1111

1212
# Model coordinates/dimension names
13-
model_vars : evs
13+
model_vars : evs soemp_oce # note that soemp_oce is evap minus precip!
1414
model_convert : choose_best_var
1515

1616
layers : layerless

key_files/ficeberg.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
#/home/users/ldemora/tmp_grid_T.txt: float ficeberg(time_counter, y, x) ;
3+
#/home/users/ldemora/tmp_grid_T.txt: ficeberg:standard_name = "water_flux_into_sea_water_from_icebergs" ;
4+
#/home/users/ldemora/tmp_grid_T.txt: ficeberg:long_name = "icb melt rate 2 of icebergs" ;
5+
#/home/users/ldemora/tmp_grid_T.txt: ficeberg:units = "kg/m2/s" ;
6+
#/home/users/ldemora/tmp_grid_T.txt: ficeberg:online_operation = "average" ;
7+
#/home/users/ldemora/tmp_grid_T.txt: ficeberg:interval_operation = "2700 s" ;
8+
#/home/users/ldemora/tmp_grid_T.txt: ficeberg:interval_write = "1 month" ;
9+
#/home/users/ldemora/tmp_grid_T.txt: ficeberg:cell_methods = "time: mean (interval: 2700 s)" ;
10+
#/home/users/ldemora/tmp_grid_T.txt: ficeberg:cell_measures = "area: area" ;
11+
#/home/users/ldemora/tmp_grid_T.txt: ficeberg:_FillValue = 1.e+20f ;
12+
#/home/users/ldemora/tmp_grid_T.txt: ficeberg:missing_value = 1.e+20f ;
13+
#/home/users/ldemora/tmp_grid_T.txt: ficeberg:coordinates = "time_centered nav_lat nav_lon" ;
14+
name : ficeberg
15+
units : kg/m2/s
16+
dimensions : 2
17+
model : NEMO
18+
datasource : WOA
19+
# The filenames
20+
modelFiles : $BASEDIR_MODEL/$JOBID/nemo_$JOBIDo_1y_*_grid-T.nc
21+
modelFile_p2p : $BASEDIR_MODEL/$JOBID/nemo*$JOBIDo_1y_*$YEAR????_grid-T.nc
22+
gridFile : $PATHS_GRIDFILE
23+
24+
# Model coordinates/dimension names
25+
model_vars : ficeberg berg_total_melt
26+
model_convert : choose_best_var
27+
28+
layers : layerless
29+
regions : Global SouthernOcean ArcticOcean NorthAtlanticOcean SouthAtlanticOcean SPNA STNA GINseas LabradorSea NorthEastAtlantic IrmingerSea LIGINseas LIseas
30+
smoothings : DataOnly 5and30
31+
32+
33+
34+

key_files/friver2.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
# float friver(time_counter, y, x) ;
3+
# friver:standard_name = "water_flux_into_sea_water_from_rivers" ;
4+
# friver:long_name = "Water Flux into Sea Water From Rivers" ;
5+
# friver:units = "kg/m2/s" ;
6+
# friver:online_operation = "average" ;
7+
# friver:interval_operation = "2700 s" ;
8+
# friver:interval_write = "1 month" ;
9+
# friver:cell_methods = "time: mean (interval: 2700 s)" ;
10+
# friver:cell_measures = "area: area" ;
11+
# friver:_FillValue = 1.e+20f ;
12+
# friver:missing_value = 1.e+20f ;
13+
# friver:coordinates = "time_centered nav_lat nav_lon" ;
14+
15+
name : Rivers2
16+
units : "kg/s"
17+
dimensions : 2
18+
model : NEMO
19+
datasource : WOA
20+
# The filenames
21+
modelFiles : $BASEDIR_MODEL/$JOBID/nemo_$JOBIDo_1y_*_grid-T.nc
22+
modelFile_p2p : $BASEDIR_MODEL/$JOBID/nemo*$JOBIDo_1y_*$YEAR????_grid-T.nc
23+
gridFile : $PATHS_GRIDFILE
24+
25+
# Model coordinates/dimension names
26+
model_vars : friver
27+
model_convert : choose_best_var
28+
29+
layers : layerless
30+
regions : Global SouthernOcean ArcticOcean NorthAtlanticOcean LIGINseas LabradorSea IrmingerSea GINseas
31+
smoothings : DataOnly 5and30
32+
33+
34+
35+

key_files/mld.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ modelFile_p2p : $BASEDIR_MODEL/$JOBID/nemo*_$JOBIDo_1y_*$YEAR????_grid-T.nc
1111
dataFile : $BASEDIR_OBS/IFREMER-MLD/mld_DT02_c1m_reg2.0-annual.nc
1212

1313
# Model coordinates/dimension names
14-
model_vars : mlotst
15-
model_convert : NoChange
14+
model_vars : mlotst somxzint1
15+
model_convert : choose_best_var
1616
layers : layerless
1717

1818
#model_vars : somxl010 somxzint1

key_files/rhosw.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name : OCN_RHOSW
3+
units : degrees C
4+
dimensions : 2
5+
model : MEDUSA
6+
datasource : WOA
7+
# The filenames
8+
modelFiles : $BASEDIR_MODEL/$JOBID/medusa_$JOBIDo_1y_*_diad-T.nc
9+
gridFile : $PATHS_GRIDFILE
10+
11+
# Model coordinates/dimension names
12+
model_vars : OCN_RHOSW
13+
model_convert : choose_best_var
14+
15+
16+
# Data coordinates names
17+
layers : layerless
18+
regions : Global ignoreInlandSeas SouthernOcean ArcticOcean Equator10 NorthPacificOcean SouthPacificOcean NorthAtlanticOcean SouthAtlanticOcean SPNA STNA GINseas LabradorSea NorthEastAtlantic IrmingerSea LIGINseas LIseas EquatorialAtlanticOcean subpolar BritishIsles # NorthHemisphere SouthHemisphere
19+
20+
21+
22+
23+

key_files/sltbasinatlantic.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
3+
# float sltbasin_atlantic(time_counter, y, x) ;
4+
# sltbasin_atlantic:long_name = "Advective Salt Transport" ;
5+
# sltbasin_atlantic:units = "Giga g/s" ;
6+
# sltbasin_atlantic:online_operation = "average" ;
7+
# sltbasin_atlantic:interval_operation = "2700 s" ;
8+
# sltbasin_atlantic:interval_write = "1 month" ;
9+
# sltbasin_atlantic:cell_methods = "time: mean (interval: 2700 s)" ;
10+
# sltbasin_atlantic:_FillValue = 1.e+20f ;
11+
# sltbasin_atlantic:missing_value = 1.e+20f ;
12+
# sltbasin_atlantic:coordinates = "time_centered nav_lat nav_lon" ;
13+
14+
15+
name : sltbasinatlantic
16+
units : Giga g/s
17+
dimensions : 1
18+
model : NEMO
19+
datasource : WOA
20+
# The filenames
21+
modelFiles : $BASEDIR_MODEL/$JOBID/nemo_$JOBIDo_1y_*_diaptr.nc
22+
#modelFile_p2p : $BASEDIR_MODEL/$JOBID/nemo*$JOBIDo_1y_*$YEAR????_grid-T.nc
23+
gridFile : $PATHS_GRIDFILE
24+
25+
# Model coordinates/dimension names
26+
model_vars : sltbasin_atlantic
27+
model_convert : choose_best_var
28+
29+
layers : layerless
30+
regions : 26N Global NorthAtlanticOcean SouthAtlanticOcean 30S 40N 55N
31+
smoothings : DataOnly 5and30
32+
33+
34+
35+

key_files/somxzint1.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name : somxzint1
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 : somxzint1
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 NorthAtlanticOcean SouthAtlanticOcean NorthPacificOcean SouthPacificOcean SPNA STNA GINseas LabradorSea NorthEastAtlantic EquatorialAtlanticOcean IrmingerSea LIGINseas LIseas BritishIsles

key_files/tnpeo.yml

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

key_files/volsalinity.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name : VolSalinity
3+
units : PSU
4+
dimensions : 3
5+
model : NEMO
6+
datasource : WOA
7+
# The filenames
8+
modelFiles : $BASEDIR_MODEL/$JOBID/nemo_$JOBIDo_1y_*_grid-T.nc
9+
modelFile_p2p : $BASEDIR_MODEL/$JOBID/nemo*$JOBIDo_1y_*$YEAR????_grid-T.nc
10+
dataFile : $BASEDIR_OBS/WOA/annual/woa13_decav_s00_01v2.nc
11+
gridFile : $PATHS_GRIDFILE
12+
13+
# Model coordinates/dimension names
14+
model_vars : so_abs so
15+
model_convert : choose_best_var
16+
17+
# Data coordinates names
18+
data_vars : s_an
19+
data_convert : NoChange
20+
data_tdict : ZeroToZero
21+
22+
layers : 'Surfaceto1200m'
23+
regions : LabradorSea LIGINseas

0 commit comments

Comments
 (0)