Skip to content

Commit

Permalink
Fix file paths in convert_xppm_yppm.sh
Browse files Browse the repository at this point in the history
Path to stencils changed when importing files into this repo. Adapted
that path.
  • Loading branch information
romanc committed Jan 28, 2025
1 parent 811a6d6 commit 10b067d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
30 changes: 16 additions & 14 deletions convert_xppm_yppm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

set -e -x

cp pace/fv3core/stencils/xppm.py pace/fv3core/stencils/yppm.py
cp pace/fv3core/stencils/xtp_u.py pace/fv3core/stencils/ytp_v.py
cp pyFV3/stencils/xppm.py pyFV3/stencils/yppm.py
cp pyFV3/stencils/xtp_u.py pyFV3/stencils/ytp_v.py

for fname in pace/fv3core/stencils/yppm.py pace/fv3core/stencils/ytp_v.py
for fname in pyFV3/stencils/yppm.py pyFV3/stencils/ytp_v.py
do
gsed -i 's/ub/vb/g' $fname
gsed -i 's/dx/dy/g' $fname
Expand Down Expand Up @@ -42,16 +42,18 @@ do
gsed -i 's/\[j_end + 2, :/\[:, j_end + 2/g' $fname
done

gsed -i 's/i_start/j_start/g' pace/fv3core/stencils/yppm.py
gsed -i 's/i_end/j_end/g' pace/fv3core/stencils/yppm.py
gsed -i 's/XPiecewise/YPiecewise/g' pace/fv3core/stencils/yppm.py
gsed -i 's/u\*/v\*/g' pace/fv3core/stencils/yppm.py
gsed -i 's/i_start/j_start/g' pyFV3/stencils/yppm.py
gsed -i 's/i_end/j_end/g' pyFV3/stencils/yppm.py
gsed -i 's/XPiecewise/YPiecewise/g' pyFV3/stencils/yppm.py
gsed -i 's/X Piecewise/Y Piecewise/g' pyFV3/stencils/yppm.py
gsed -i 's/xppm/yppm/g' pyFV3/stencils/yppm.py
gsed -i 's/u\*/v\*/g' pyFV3/stencils/yppm.py

gsed -i 's/j_start - 1 : j_start + 1, j_start/i_start, j_start - 1 : j_start + 1/g' pace/fv3core/stencils/ytp_v.py
gsed -i 's/j_start - 1 : j_start + 1, j_end + 1/i_end + 1, j_start - 1 : j_start + 1/g' pace/fv3core/stencils/ytp_v.py
gsed -i 's/j_end : j_end + 2, j_start/i_start, j_end : j_end + 2/g' pace/fv3core/stencils/ytp_v.py
gsed -i 's/j_end : j_end + 2, j_end + 1/i_end + 1, j_end : j_end + 2/g' pace/fv3core/stencils/ytp_v.py
gsed -i 's/j_end, j_start, jord, j_end, j_start/j_end, j_start, jord, i_end, i_start/g' pace/fv3core/stencils/ytp_v.py
gsed -i 's/xppm/yppm/g' pace/fv3core/stencils/ytp_v.py
gsed -i 's/j_start - 1 : j_start + 1, j_start/i_start, j_start - 1 : j_start + 1/g' pyFV3/stencils/ytp_v.py
gsed -i 's/j_start - 1 : j_start + 1, j_end + 1/i_end + 1, j_start - 1 : j_start + 1/g' pyFV3/stencils/ytp_v.py
gsed -i 's/j_end : j_end + 2, j_start/i_start, j_end : j_end + 2/g' pyFV3/stencils/ytp_v.py
gsed -i 's/j_end : j_end + 2, j_end + 1/i_end + 1, j_end : j_end + 2/g' pyFV3/stencils/ytp_v.py
gsed -i 's/j_end, j_start, jord, j_end, j_start/i_end, i_start, j_end, j_start, jord/g' pyFV3/stencils/ytp_v.py
gsed -i 's/xppm/yppm/g' pyFV3/stencils/ytp_v.py

gsed -i 's/region\[j_start - 1 : j_start + 2, :\], region\[j_end - 1 : j_end + 2, :\]/region\[:, j_start - 1 : j_start + 2\], region\[:, j_end - 1 : j_end + 2\]/g' pace/fv3core/stencils/yppm.py
gsed -i 's/region\[j_start - 1 : j_start + 2, :\], region\[j_end - 1 : j_end + 2, :\]/region\[:, j_start - 1 : j_start + 2\], region\[:, j_end - 1 : j_end + 2\]/g' pyFV3/stencils/yppm.py
2 changes: 1 addition & 1 deletion pyFV3/stencils/yppm.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def __call__(
q_mean_advected_through_y_interface: FloatField,
):
"""
Determine the mean value of q_in to be advected along y-interfaces.
Determine the mean value per area of q_in to be advected along y-interfaces.
This is done by integrating a piecewise-parabolic svbgrid reconstruction
of q_in along the y-direction over the segment of gridcell which
Expand Down
1 change: 1 addition & 0 deletions pyFV3/stencils/ytp_v.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def get_bl_br(v, dy, dya):
compile_assert(jord == 8)

bl, br = yppm.blbr_jord8(v, v_on_cell_corners, dm)

if __INLINED(grid_type < 3):
bl, br = yppm.bl_br_edges(bl, br, v, dya, v_on_cell_corners, dm)

Expand Down

0 comments on commit 10b067d

Please sign in to comment.