Skip to content

Commit

Permalink
Added new TF aMOC fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ledm committed Oct 23, 2024
1 parent 1a801a3 commit dd0460b
Show file tree
Hide file tree
Showing 10 changed files with 174 additions and 25 deletions.
51 changes: 30 additions & 21 deletions bgcval2/bgcvaltools/generic_map_legend.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,26 +132,33 @@ def add_region(fig, ax, lons, lats, data):
ax.add_feature(cfeature.LAND, zorder=10, edgecolor='black')
return fig, ax, im

ncfn = 'mesh_mask_eORCA1_wrk.nc'
nc = Dataset(ncfn, 'r')
dat = nc.variables['mbathy'][:].squeeze()
lats = nc.variables['nav_lat'][:].squeeze()
lons = nc.variables['nav_lon'][:].squeeze()
lons = bvt.makeLonSafeArr(lons)
nc.close()


def make_figure(region):
fig_fn = bvt.folder('images/regions')+region+'.png'
#if os.path.exists(fig_fn): return

fig = pyplot.figure()

paths_dict, config_user = get_run_configuration("defaults")
# paths_dict, config_user = get_run_configuration("defaults")
# filter paths dict into an object that's usable below
paths = paths_setter(paths_dict)
# paths = paths_setter(paths_dict)
#ncfn = paths.orcaGridfn
ncfn = 'mesh_mask_eORCA1_wrk.nc'

nc = Dataset(ncfn, 'r')
print(ncfn)
# ncfn = 'mesh_mask_eORCA1_wrk.nc'

dat = nc.variables['mbathy'][:].squeeze()
lats = nc.variables['nav_lat'][:].squeeze()
lons = nc.variables['nav_lon'][:].squeeze()
lons = bvt.makeLonSafeArr(lons)
# nc = Dataset(ncfn, 'r')
# #print(ncfn)
# dat = nc.variables['mbathy'][:].squeeze()
# lats = nc.variables['nav_lat'][:].squeeze()
# lons = nc.variables['nav_lon'][:].squeeze()
# lons = bvt.makeLonSafeArr(lons)

old_mask = np.ma.masked_where(dat.mask + dat ==0, dat).mask

Expand Down Expand Up @@ -186,7 +193,7 @@ def make_figure(region):
hspace=0.30,
wspace=0.30,)

print('lats:', new_lat.mean(), 'lon:', new_lon.mean(), 'data:', new_dat.min(), new_dat.max())
print('\''+region+'\': {\'lats\'', new_lat.mean(), 'lon:', new_lon.mean()) #data:', new_dat.min(), new_dat.max())

ortho_pro=ccrs.Orthographic(new_lon.mean(), new_lat.mean(),)
ax_globe = fig.add_subplot(spec2[0, 0], projection=ortho_pro)
Expand Down Expand Up @@ -218,34 +225,36 @@ def make_figure(region):


def main():
# paths_dict, config_user = get_run_configuration("defaults")

regions = [
'LIseas',
# 'LIGINseas',
# 'GLINseas',
'LIGINseas',
'GLINseas',
# 'Ascension',
# 'ITCZ',
# 'TristandaCunha',
# 'Pitcairn',
# 'Cornwall',
# 'SubtropicNorthAtlantic',
# 'SPNA',
# 'STNA',
'SubtropicNorthAtlantic',
'SPNA',
'STNA',
# 'SouthernOcean',
# 'ArcticOcean',
# 'Equator10',
# 'NorthPacificOcean',
# 'SouthPacificOcean',
# 'NorthAtlanticOcean',
'NorthAtlanticOcean',
# 'SouthAtlanticOcean',
# 'GINseas',
# 'LabradorSea',
# 'IrmingerSea',
'GINseas',
'LabradorSea',
'IrmingerSea',
# 'EquatorialAtlanticOcean',
# 'Global',
# 'ignoreInlandSeas',
]
for region in regions[:]:
make_figure(region)
make_figure(region)

if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions bgcval2/bgcvaltools/pftnames.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ def makeLongNameDict():

lnd['thkcello'] = 'Cell thickness'
lnd['sowaflup'] = "Net Upward Water Flux"
lnd['hfds'] = 'Downwards Heat Flux'
lnd['sohefldo'] = "Net Downward Heat Flux"
lnd['fsitherm'] = "Water flux due to freezing/melting"
lnd['sosafldo'] = "Downward salt flux"
Expand Down
35 changes: 35 additions & 0 deletions key_files/friver.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
# float friver(time_counter, y, x) ;
# friver:standard_name = "water_flux_into_sea_water_from_rivers" ;
# friver:long_name = "Water Flux into Sea Water From Rivers" ;
# friver:units = "kg/m2/s" ;
# friver:online_operation = "average" ;
# friver:interval_operation = "2700 s" ;
# friver:interval_write = "1 month" ;
# friver:cell_methods = "time: mean (interval: 2700 s)" ;
# friver:cell_measures = "area: area" ;
# friver:_FillValue = 1.e+20f ;
# friver:missing_value = 1.e+20f ;
# friver:coordinates = "time_centered nav_lat nav_lon" ;

name : Rivers
units : "kg/m2/s"
dimensions : 2
model : NEMO
datasource : WOA
# The filenames
modelFiles : $BASEDIR_MODEL/$JOBID/nemo_$JOBIDo_1y_*_grid-T.nc
modelFile_p2p : $BASEDIR_MODEL/$JOBID/nemo*$JOBIDo_1y_*$YEAR????_grid-T.nc
gridFile : $PATHS_GRIDFILE

# Model coordinates/dimension names
model_vars : friver
model_convert : choose_best_var

layers : layerless
regions : Global ignoreInlandSeas SouthernOcean ArcticOcean Equator10 NorthPacificOcean SouthPacificOcean NorthAtlanticOcean SouthAtlanticOcean SPNA LIGINseas STNA LIseas LabradorSea IrmingerSea GINseas
smoothings : DataOnly 5and30




34 changes: 34 additions & 0 deletions key_files/hfds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
# float hfds(time_counter, y, x) ;
# hfds:standard_name = "surface_downward_heat_flux_in_sea_water" ;
# hfds:long_name = "Net Downward Heat Flux" ;
# hfds:units = "W/m2" ;
# hfds:online_operation = "average" ;
# hfds:interval_operation = "2700 s" ;
# hfds:interval_write = "1 month" ;
# hfds:cell_methods = "time: mean (interval: 2700 s)" ;
# hfds:cell_measures = "area: area" ;
# hfds:_FillValue = 1.e+20f ;
# hfds:missing_value = 1.e+20f ;
# hfds:coordinates = "time_centered nav_lat nav_lon" ;
name : hfds
units : W/m2
dimensions : 3
model : NEMO
datasource : WOA
# The filenames
modelFiles : $BASEDIR_MODEL/$JOBID/nemo_$JOBIDo_1y_*_grid-T.nc
modelFile_p2p : $BASEDIR_MODEL/$JOBID/nemo*$JOBIDo_1y_*$YEAR????_grid-T.nc
gridFile : $PATHS_GRIDFILE

# Model coordinates/dimension names
model_vars : hfds
model_convert : choose_best_var

layers : layerless
regions : Global SouthernOcean ArcticOcean NorthAtlanticOcean SouthAtlanticOcean SPNA STNA GINseas LabradorSea IrmingerSea LIGINseas LIseas
smoothings : DataOnly 5and30




21 changes: 21 additions & 0 deletions key_files/soicecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name : IceCover
units : m2
dimensions : 2
model : CICE
# The filenames
modelFiles : $BASEDIR_MODEL/$JOBID/nemo_$JOBIDo_1y_*_grid-T.nc
#modelFile_p2p : $BASEDIR_MODEL/$JOBID/nemo*$JOBIDo_1y_*$YEAR????_grid-T.nc
gridFile : $PATHS_GRIDFILE

# Model coordinates/dimension names
model_vars : soicecov
model_convert : choose_best_var

layers : layerless
regions : Global SouthernOcean ArcticOcean NorthAtlanticOcean SouthAtlanticOcean GINseas LabradorSea IrmingerSea LIGINseas LIseas
smoothings : DataOnly 5and30




2 changes: 1 addition & 1 deletion key_files/sowflisf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ model_vars : sowflisf
model_convert : choose_best_var

layers : layerless
regions : Global ignoreInlandSeas SouthernOcean ArcticOcean Equator10 NorthPacificOcean SouthPacificOcean NorthAtlanticOcean SouthAtlanticOcean SPNA LIGINseas LabradorSeas GINseas LIseas
regions : Global ignoreInlandSeas SouthernOcean ArcticOcean Equator10 NorthPacificOcean SouthPacificOcean NorthAtlanticOcean SouthAtlanticOcean SPNA LIGINseas LabradorSea IrmingerSea GINseas LIseas
smoothings : DataOnly 5and30


Expand Down
2 changes: 1 addition & 1 deletion key_files/sowindsp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ model_vars : sowindsp
model_convert : choose_best_var

layers : layerless
regions : Global ignoreInlandSeas SouthernOcean ArcticOcean Equator10 NorthPacificOcean SouthPacificOcean NorthAtlanticOcean SouthAtlanticOcean SPNA LIGINseas STNA LIseas
regions : Global ignoreInlandSeas SouthernOcean ArcticOcean Equator10 NorthPacificOcean SouthPacificOcean NorthAtlanticOcean SouthAtlanticOcean SPNA LIGINseas STNA LIseas LabradorSea IrmingerSea GINseas
smoothings : DataOnly 5and30


Expand Down
42 changes: 42 additions & 0 deletions key_files/thkcello.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
# float thkcello(time_counter, deptht, y, x) ;
# thkcello:standard_name = "cell_thickness" ;
# thkcello:long_name = "Ocean Model cell Thickness" ;
# thkcello:units = "m" ;
# thkcello:online_operation = "average" ;
# thkcello:interval_operation = "2700 s" ;
# thkcello:interval_write = "1 month" ;
# thkcello:cell_methods = "time: mean (interval: 2700 s)" ;
# thkcello:cell_measures = "area: area" ;
# thkcello:_FillValue = 1.e+20f ;
# thkcello:missing_value = 1.e+20f ;
# thkcello:coordinates = "time_centered deptht nav_lat nav_lon" ;

name : thkcello
units : m
dimensions : 3
model : NEMO
datasource : WOA
# The filenames
modelFiles : $BASEDIR_MODEL/$JOBID/nemo_$JOBIDo_1y_*_grid-T.nc
modelFile_p2p : $BASEDIR_MODEL/$JOBID/nemo*$JOBIDo_1y_*$YEAR????_grid-T.nc
#dataFile : $BASEDIR_OBS/WOA/annual/woa13_decav_t00_01v2.nc
gridFile : $PATHS_GRIDFILE

# Model coordinates/dimension names
model_vars : thkcello
model_convert : choose_best_var


# Data coordinates names
#data_vars : t_an
#data_convert : NoChange
#data_tdict : ZeroToZero

layers : Surface
regions : Global SouthernOcean ArcticOcean Equator10 NorthPacificOcean SouthPacificOcean NorthAtlanticOcean SPNA STNA GINseas LabradorSea IrmingerSea LIGINseas LIseas EquatorialAtlanticOcean # NorthHemisphere SouthHemisphere





5 changes: 4 additions & 1 deletion key_lists/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ keys:
# AMOC_26N: True
# hfbasinatlantic: True
# fsitherm: True
sowaflup: True
# thkcello: True
# sowaflup: True
# soicecov: True
hfds: True
# sosafldo: True

#GulfStream: True
Expand Down
6 changes: 5 additions & 1 deletion key_lists/tfamoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ keys:
GlobalMeanSalinity: True
fsitherm: True
sowaflup: True
hfds: True
sosafldo: True
hfbasinatlantic: True

sowindsp: True
friver: True
soicecov: True
# thkcello: True

0 comments on commit dd0460b

Please sign in to comment.