Skip to content

Commit

Permalink
changed modparam tool to use float64
Browse files Browse the repository at this point in the history
  • Loading branch information
rgknox authored and glemieux committed Oct 2, 2024
1 parent 068c7a1 commit a43a72c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/modify_fates_paramfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ def main():
else:

try:
outputval = float(args.val)
outputval = np.float64(args.val)
if args.changeshape:
raise Exception
except:
try:
#print('output variable not interpretable as real. trying array')
outputval = np.fromstring(args.val, sep=',', dtype=np.float32)
print('output variable not interpretable as real. trying array')
outputval = np.fromstring(args.val, sep=',', dtype=np.float64)
if len(outputval) == 0:
raise RuntimeError('output variable needs to have size greater than zero')
except:
Expand Down Expand Up @@ -240,7 +240,7 @@ def main():
' New length is shorter than old, so its been truncated.')
x[0:length_specified,:] = variable[0:length_specified,:]
else:
x.assignValue(float(variable.data))
x.assignValue(np.float64(variable.data))
#
var = ncfile.variables[args.varname]
else:
Expand Down

0 comments on commit a43a72c

Please sign in to comment.