Skip to content

basic_operations

copy(q_in, q_out)

Copy q_in to q_out.

Parameters:

Name Type Description Default
q_in FloatField

input field

required
q_out FloatField

output field

required

adjustmentfactor_stencil(adjustment, q_out)

Multiplies every element of q_out by every element of the adjustment field over the interval, replacing the elements of q_out by the result of the multiplication.

Parameters:

Name Type Description Default
adjustment FloatFieldIJ

adjustment field

required
q_out FloatField

output field

required

set_value(q_out, value)

Sets every element of q_out to the value specified by value argument.

Parameters:

Name Type Description Default
q_out FloatField

output field

required
value Float

NDSL Float type

required

set_value_2D(buffer, value)

Sets every element of buffer to the value specified by value argument.

Parameters:

Name Type Description Default
buffer FloatFieldIJ

output field

required
value Float

value of Float type

required

set_IJ_mask_value(mask_out, value)

Sets every element of buffer to the value specified by value argument.

Parameters:

Name Type Description Default
mask_out BoolFieldIJ

output field

required
value Bool

value of Bool type

required

adjust_divide_stencil(adjustment, q_out)

Divides every element of q_out by every element of the adjustment field over the interval, replacing the elements of q_out by the result of the division.

Parameters:

Name Type Description Default
adjustment FloatField

adjustment field

required
q_out FloatField

output field

required

select_k(in_field, out_field, k_mask, k_select)

Saves a specific k-index of a 3D field to a new 2D array. The k-value can be different for each i,j point.

Parameters:

Name Type Description Default
in_field FloatField

A 3D array to select from

required
out_field FloatFieldIJ

A 2D field to save values in

required
k_mask IntField

a field that lists each k-index

required
k_select IntFieldIJ

the k-value to extract from in_field

required

average_in(q_out, adjustment)

Averages every element of q_out with every element of the adjustment field, overwriting q_out.

Parameters:

Name Type Description Default
adjustment FloatField

adjustment field

required
q_out FloatField

output field

required

sign(a, b)

Defines a_sign_b as the absolute value of a, and checks if b is positive or negative, assigning the analogous sign value to a_sign_b. a_sign_b is returned.

Parameters:

Name Type Description Default
a

A number

required
b

A number

required

dim(a, b)

Calculates a - b, camped to 0, i.e. max(a - b, 0).