Skip to content

Commit d53a6e6

Browse files
committed
small change in intpp to use local area.
1 parent 07ba59a commit d53a6e6

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

bgcval2/functions/TotalIntPP.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,19 @@ def loadDataMask(gridfn):
5353
def TotalIntPP(nc, keys, **kwargs):
5454
"""
5555
This function calculated the total primary production for the MEDUSA model in the eORCA grid.
56+
57+
preferentially use area provided in the netcdf.
5658
"""
57-
areafile = get_kwarg_file(kwargs, 'areafile')
5859

59-
if not loadedArea:
60-
model_area = loadDataMask(areafile)
60+
# area provided
61+
area_key = find_best_var(nc, ['area', 'area_grid_T', 'areacello', 'area_cello'])
62+
if area_key:
63+
model_area = nc.variables[area_key][:]
64+
else:
65+
areafile = get_kwarg_file(kwargs, 'areafile')
66+
67+
if not loadedArea:
68+
model_area = loadDataMask(areafile)
6169

6270
# mmolN/m2/d [mg C /m2/d] [mgC/m2/yr] [gC/m2/yr] Gt/m2/yr # MEDUSA UNITS
6371
factor = 1. * 6.625 * 12.011 * 365. / 1000. / 1E15

bgcval2/functions/circulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ def gulfstream(nc, keys, **kwargs):
849849

850850
if not loadedArea:
851851
loadDataMask(areafile, maskname, grid)
852-
852+
853853
if grid == 'eORCA1':
854854
latslice26Nnm = eORCA1_latslice26Nnm
855855
#data=[-80.5011659 , -79.50119298, -78.50121829, -77.50124181,

key_lists/debug.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ keys:
88
# SouthernTotalIceExtent: True
99
# DrakePassageTransport: True
1010
# hfbasinatlantic: True
11-
# AMOC_26N: True
11+
AMOC_26N: True
1212
# ficeberg: True
1313
# volTemperature: True
1414
# volSalinity: True
@@ -19,7 +19,7 @@ keys:
1919
# DavisStraightMassFlux: True
2020
# NorwegianSeaMassFlux: True
2121

22-
sltbasinatlantic: True
22+
# sltbasinatlantic: True
2323
# pbsi3: True
2424
# agessc: True
2525
# int_pn: True

0 commit comments

Comments
 (0)