Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
NOCSurfaceProcesses
AirSeaFluxCode
Commits
a7d3bbf1
Commit
a7d3bbf1
authored
3 years ago
by
Richard Cornes
Browse files
Options
Download
Email Patches
Plain Diff
Fixed bug with main program parameters not carrying through to class
parent
2fce6a78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
Code/AirSeaFluxCode.py
Code/AirSeaFluxCode.py
+12
-11
No files found.
Code/AirSeaFluxCode.py
View file @
a7d3bbf1
...
...
@@ -114,9 +114,19 @@ class S80:
def
iterate
(
self
,
n
=
10
,
tol
=
None
):
n
=
5
if
n
<
5
else
n
# Decide which variables to use in tolerances based on tolerance specification
tol
=
[
'all'
,
0.01
,
0.01
,
1e-05
,
1e-3
,
0.1
,
0.1
]
if
tol
is
None
else
tol
assert
tol
[
0
]
in
[
'flux'
,
'ref'
,
'all'
],
"unknown tolerance input"
old_vars
=
{
"flux"
:[
"tau"
,
"sensible"
,
"latent"
],
"ref"
:[
"u10n"
,
"t10n"
,
"q10n"
]}
old_vars
[
"all"
]
=
old_vars
[
"ref"
]
+
old_vars
[
"flux"
]
old_vars
=
old_vars
[
tol
[
0
]]
new_vars
=
{
"flux"
:[
"tau"
,
"sensible"
,
"latent"
],
"ref"
:[
"utmp"
,
"t10n"
,
"q10n"
]}
new_vars
[
"all"
]
=
new_vars
[
"ref"
]
+
new_vars
[
"flux"
]
new_vars
=
new_vars
[
tol
[
0
]]
ind
=
np
.
where
(
self
.
spd
>
0
)
it
=
0
...
...
@@ -133,15 +143,6 @@ class S80:
# Generate the first guess values
self
.
_first_guess
()
# Decide which variables to use in tolerances based on tolerance specification
old_vars
=
{
"flux"
:[
"tau"
,
"sensible"
,
"latent"
],
"ref"
:[
"u10n"
,
"t10n"
,
"q10n"
]}
old_vars
[
"all"
]
=
old_vars
[
"ref"
]
+
old_vars
[
"flux"
]
old_vars
=
old_vars
[
tol
[
0
]]
new_vars
=
{
"flux"
:[
"tau"
,
"sensible"
,
"latent"
],
"ref"
:[
"utmp"
,
"t10n"
,
"q10n"
]}
new_vars
[
"all"
]
=
new_vars
[
"ref"
]
+
new_vars
[
"flux"
]
new_vars
=
new_vars
[
tol
[
0
]]
# iteration loop
ii
=
True
while
ii
:
...
...
@@ -661,12 +662,12 @@ def AirSeaFluxCode(spd, T, SST, lat=None, hum=None, P=None, hin=18, hout=10,
logging
.
captureWarnings
(
True
)
iclass
=
globals
()[
meth
]()
iclass
.
add_gust
(
0
)
iclass
.
add_gust
(
gust
=
gust
)
iclass
.
add_variables
(
spd
,
T
,
SST
,
lat
=
lat
,
hum
=
hum
,
P
=
P
,
L
=
L
)
iclass
.
get_heights
(
hin
,
hout
)
iclass
.
get_specHumidity
(
qmeth
=
qmeth
)
iclass
.
set_coolskin_warmlayer
(
wl
=
wl
,
cskin
=
cskin
,
skin
=
skin
,
Rl
=
Rl
,
Rs
=
Rs
)
iclass
.
iterate
(
tol
=
tol
)
resAll
=
iclass
.
get_output
()
resAll
=
iclass
.
get_output
(
out
=
out
)
return
resAll
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment