Commit 5de9b807 authored by James Harle's avatar James Harle
Browse files

remove py2 has_key(), various blank space errors and update

namelist_local
parent d55e84e1
......@@ -40,7 +40,7 @@
!------------------------------------------------------------------------------
! I/O
!------------------------------------------------------------------------------
sn_src_dir = '/Users/jdha/Projects/GitHub/PyNEMO/inputs/src_data.ncml' ! src_files/'
sn_src_dir = '/Users/jdha/Projects/GitHub/PyNEMO3/inputs/src_data_local.ncml' ! src_files/'
sn_dst_dir = './outputs'
sn_fn = 'NNA_R12' ! prefix for output files
nn_fv = -1e20 ! set fill value for output files
......
......@@ -204,11 +204,11 @@ def _get_val(vars_dictionary, bool_vars_dictionary, line):
if name_prefix == 'ln':
if value.find('true') is not -1:
if vars_dictionary.has_key(name) != True:
if (name in vars_dictionary) != True:
vars_dictionary[name] = True
bool_vars_dictionary[name] = True
elif value.find('false') is not -1:
if vars_dictionary.has_key(name) != True:
if (name in vars_dictionary) != True:
vars_dictionary[name] = False
bool_vars_dictionary[name] = False
else:
......
......@@ -52,6 +52,7 @@ class Depth:
# Check inputs
# FIX ME? Errors for wrong obj arg len. probably better to work around
print(settings)
if settings['sco']:
# hc = ... FIX ME??
# Depth of water column at t-point
......
......@@ -18,21 +18,21 @@ class TpxoExtract(object):
"""initialises the Extract of tide information from the netcdf
Tidal files"""
# Set tide model
tide_model = 'TPXO'
tide_model = 'TPXO'
if tide_model == 'TPXO': # Define stuff to generalise Tide model
hRe_name = 'hRe'
hIm_name = 'hIm'
lon_z_name = 'lon_z'
lat_z_name = 'lat_z'
if tide_model == 'TPXO': # Define stuff to generalise Tide model
hRe_name = 'hRe'
hIm_name = 'hIm'
lon_z_name = 'lon_z'
lat_z_name = 'lat_z'
URe_name = 'URe'
UIm_name = 'UIm'
lon_u_name = 'lon_u'
lat_u_name = 'lat_u'
UIm_name = 'UIm'
lon_u_name = 'lon_u'
lat_u_name = 'lat_u'
VRe_name = 'VRe'
VIm_name = 'VIm'
lon_v_name = 'lon_v'
lat_v_name = 'lat_v'
VIm_name = 'VIm'
lon_v_name = 'lon_v'
lat_v_name = 'lat_v'
mz_name = 'mz'
mu_name = 'mu'
mv_name = 'mv'
......@@ -52,18 +52,11 @@ class TpxoExtract(object):
self.cons = []
for ncon in range(self.height_dataset.variables['con'].shape[0]):
self.cons.append(self.height_dataset.variables['con'][ncon, :].tostring().strip())
elif tide_model == 'FES':
constituents = ['2N2','EPS2','J1','K1','K2','L2','LA2','M2','M3','M4','M6','M8','MF','MKS2','MM','MN4','MS4','MSF','MSQM','MTM','MU2','N2','N4','NU2','O1','P1','Q1','R2','S1','S2','S4','SA','SSA','T2']
elif tide_model == 'FES':
constituents = ['2N2','EPS2','J1','K1','K2','L2','LA2','M2','M3','M4','M6','M8','MF','MKS2','MM','MN4','MS4','MSF','MSQM','MTM','MU2','N2','N4','NU2','O1','P1','Q1','R2','S1','S2','S4','SA','SSA','T2']
print('did not actually code stuff for FES in this routine. Though that would be ideal. Instead put it in fes_extract_HC.py')
else:
print('Don''t know that tide model')
else:
print('Don''t know that tide model')
# Wrap coordinates in longitude if the domain is global
glob = 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment