# Use a larger epsilon for these intermediate waves
    # Iterate the DJL solution
    if ii == 0:
        djl = DJL(A, L, H, NX, NZ, rho, rhoz, epsilon = 1e-3, Ubg=Ubg, Ubgz = Ubgz, Ubgzz=Ubgzz)
    else:
        djl = DJL(A, L, H, NX, NZ, rho, rhoz, epsilon = 1e-3, Ubg=Ubg, Ubgz = Ubgz, Ubgzz=Ubgzz, initial_guess=djl)


# Increase resolution, restore default epsilon, iterate to convergence
NX, NZ =64, 64
 # clear epsilon
djl = DJL(A, L, H, NX, NZ, rho, rhoz, Ubg=Ubg, Ubgz = Ubgz, Ubgzz=Ubgzz, initial_guess = djl)

# Increase resolution, iterate to convergence
NX, NZ =128, 128
djl = DJL(A, L, H, NX, NZ, rho, rhoz, Ubg=Ubg, Ubgz = Ubgz, Ubgzz=Ubgzz, initial_guess = djl)

# Increase to the final resolution, iterate to convergence
NX, NZ = 512,256
djl = DJL(A, L, H, NX, NZ, rho, rhoz, Ubg=Ubg, Ubgz = Ubgz, Ubgzz=Ubgzz, initial_guess = djl)

end_time = time.time()
print('Total wall clock time: %f seconds\n'% (end_time - start_time))

# Compute and plot the diagnostics
diag = Diagnostic(djl)
plot(djl, diag, 2)

input("Press Enter to continue...")

Exemple #2
0
djl = DJL(A,
          L,
          H,
          NX,
          NZ,
          rho,
          rhoz,
          rho0=rho0,
          epsilon=1e-7,
          initial_guess=djl)

end_time = time.time()
print('Total wall clock time: %f seconds\n' % (end_time - start_time))

# Compute diagnostics, plot wave
diag = Diagnostic(djl)
plot(djl, diag, 2)
diag.pressure(djl)

# Construct Pineda et al. (2015) Figure 11
plt.figure(11, figsize=(8, 11))
#plt.clf()
plt.subplot(2, 1, 1)
plt.contour(djl.XC - djl.L / 2,
            djl.ZC,
            diag.density,
            numpy.arange(1022.3, 1024.7, 0.3),
            colors='black')
plt.xlim(-300, 300)
plt.ylim(-djl.H, 0)
plt.title('Density contours')