-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test squash merge * leave ncforce for next release * add compute_lwa_only * add docstring for nonconvergent_uref * Attempt to fix sphinx build * retry with sphinx build on readthedoc * add jinja<3.1 into .readthedocs.yaml * specify jinja2 version in doc/requirements.txt * convert back to python3.9 for sphinx build * update sphinx version * Update requirements.txt * fix documentation format * try specifying explicit package version * change pip3 back to pip * change sequence of installation to test again * update build status badge * add test coverage for QGField.compute_lwa_only * test for qgfield.nonconvergent_uref * add docstring * remove test branch from pr * Fix misformed link in docs * Remove duplicate _DataArrayCollectors --------- Co-authored-by: Christopher Polster <[email protected]>
- Loading branch information
Showing
41 changed files
with
9,753 additions
and
1,383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
jupyter nbconvert --execute --to notebook --inplace ../notebooks/nh2018_science/demo_script_for_nh2018.ipynb | ||
jupyter nbconvert --execute --to notebook --inplace ../notebooks/nh2018_science/demo_script_for_nh2018_with_xarray.ipynb | ||
jupyter nbconvert --execute --to notebook --inplace ../notebooks/nh2018_science/nhn22_reference_states.ipynb | ||
jupyter nbconvert --execute --to notebook --inplace ../notebooks/sandy/sandy_lwa_plots.ipynb | ||
jupyter nbconvert --execute --to notebook --inplace ../notebooks/simple/BarotropicField_example.ipynb | ||
jupyter nbconvert --execute --to notebook --inplace ../notebooks/simple/Example_barotropic.ipynb | ||
jupyter nbconvert --execute --to notebook --inplace ../notebooks/simple/Example_qgpv.ipynb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
|
||
|
||
Plot Utilities | ||
=============== | ||
|
||
.. warning:: | ||
This module uses `matplotlib`, which is not included in the dependencies of this package. | ||
This module uses `matplotlib` and `cartopy`, which are not included in the dependencies of this package. | ||
|
||
.. automodule:: plot_utils | ||
:members: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
|
||
Preprocessing | ||
============== | ||
|
||
Since `QGField` requires all grid points of the input fields to have finite values, to process model output with grid points below topography masked as `NaN`, users have to fill in reasonable values for those grid points. | ||
|
||
A pragmatic implementation was published in `Lubis et al (2018) <https://journals.ametsoc.org/view/journals/clim/31/10/jcli-d-17-0382.1.xml>`_, in which the grids are filled level-by-level by solving Poisson equation, such that no extremum values are filled in. (In contrast, extrapolation over vertical direction would introduce unrealistic extreme values.) Such gridfill procedure is implemented by the python package `gridfill <https://github.com/ajdawson/gridfill>`_ published by Andrew Dawson. After computing the finite-amplitude wave diagnostics, regions with gridfilled values are masked out. | ||
|
||
.. automodule:: preprocessing | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
|
||
Statistics Utilities | ||
==================== | ||
|
||
.. automodule:: stat_utils | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
|
||
netCDF Utilities | ||
================= | ||
|
||
.. automodule:: netcdf_utils | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
SUBROUTINE compute_lwa_only_nhn22(pv,uu,qref, & | ||
imax, JMAX, kmax, nd, jb, is_nhem, & | ||
a, om, dz, h, rr, cp, prefac, & | ||
astarbaro, ubaro, astar1, astar2) | ||
! This was from compute_flux_dirinv.f90 | ||
|
||
REAL, INTENT(IN) :: pv(imax,jmax,kmax),uu(imax,jmax,kmax),qref(nd,kmax) | ||
INTEGER, INTENT(IN) :: imax, JMAX, kmax, nd, jb | ||
LOGICAL, INTENT(IN) :: is_nhem | ||
REAL, INTENT(IN) :: a, om, dz, h, rr, cp, prefac | ||
REAL, INTENT(OUT) :: astarbaro(imax, nd), ubaro(imax, nd), astar1(imax,nd,kmax), astar2(imax,nd,kmax) | ||
|
||
REAL :: qe(imax,nd) | ||
REAL :: z(kmax) | ||
REAL :: aa, ab | ||
INTEGER :: jstart, jend | ||
|
||
pi = acos(-1.) | ||
dp = pi/float(jmax-1) | ||
rkappa = rr/cp | ||
|
||
! *** Default values for boundary *** | ||
!jb = 5 | ||
!jd = 86 ! nd - lower bounding latitude | ||
|
||
do k = 1,kmax | ||
z(k) = dz*float(k-1) | ||
enddo | ||
|
||
|
||
! **** wave activity and nonlinear zonal flux F2 **** | ||
|
||
astarbaro(:,:) = 0. | ||
ubaro(:,:) = 0. | ||
dc = dz/prefac | ||
|
||
! Bounds of y-indices in N/SHem | ||
if (is_nhem) then ! 5N and higher latitude | ||
jstart = jb+1 ! 6 | ||
jend = nd-1 | ||
else | ||
jstart = 2 | ||
jend = nd-jb ! nd - 5 | ||
endif | ||
|
||
do k = 2,kmax-1 | ||
zk = dz*float(k-1) | ||
do i = 1,imax | ||
do j = jstart, jend | ||
astar1(i,j,k) = 0. ! LWA*cos(phi) | ||
astar2(i,j,k) = 0. ! LWA*cos(phi) | ||
if (is_nhem) then !latitude | ||
phi0 = dp*float(j-1) | ||
else | ||
phi0 = dp*float(j-1)-0.5*pi | ||
endif | ||
cor = 2.*om*sin(phi0) !Coriolis parameter | ||
ab = a*dp !constant length element | ||
do jj = 1,nd | ||
if (is_nhem) then ! Northern Hemisphere | ||
phi1 = dp*float(jj-1) | ||
qe(i,jj) = pv(i,jj+nd-1,k)-qref(j,k) !qe; Q = qref | ||
else ! Southern Hemisphere | ||
phi1 = dp*float(jj-1)-0.5*pi | ||
qe(i,jj) = pv(i,jj,k)-qref(j,k) !qe; Q = qref | ||
endif | ||
aa = a*dp*cos(phi1) !cosine factor in the meridional integral | ||
if((qe(i,jj).le.0.).and.(jj.ge.j)) then !LWA*cos and F2 | ||
if (is_nhem) then ! Northern Hemisphere | ||
astar2(i,j,k)=astar2(i,j,k)-qe(i,jj)*aa !anticyclonic | ||
else ! Southern Hemisphere | ||
astar1(i,j,k)=astar1(i,j,k)-qe(i,jj)*aa !cyclonic | ||
endif | ||
endif | ||
if((qe(i,jj).gt.0.).and.(jj.lt.j)) then | ||
if (is_nhem) then ! Northern Hemisphere | ||
astar1(i,j,k)=astar1(i,j,k)+qe(i,jj)*aa !cyclonic | ||
else ! Southern Hemisphere | ||
astar2(i,j,k)=astar2(i,j,k)+qe(i,jj)*aa !anticyclonic | ||
endif | ||
endif | ||
enddo | ||
|
||
enddo | ||
phip = dp*jb | ||
phi0 = dp*(jb-1) | ||
cosp = cos(phip) ! cosine for one grid north | ||
cos0 = cos(phi0) ! cosine for latitude grid | ||
enddo | ||
|
||
! ******** Column average: (25) of SI-HN17 ******** | ||
|
||
astarbaro(:,:) = astarbaro(:,:)+(astar1(:,:,k) & | ||
+ astar2(:,:,k))*exp(-zk/h)*dc | ||
|
||
if (is_nhem) then | ||
do j = jstart,jend | ||
ubaro(:,j) = ubaro(:,j)+uu(:,nd-1+j,k)*exp(-zk/h)*dc | ||
enddo | ||
else | ||
do j = jstart,jend | ||
ubaro(:,j) = ubaro(:,j)+uu(:,j,k)*exp(-zk/h)*dc | ||
enddo | ||
endif | ||
enddo | ||
|
||
END SUBROUTINE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.