Skip to content

da_update_bc: couple boundary u/v with MAPFAC_UY/MAPFAC_VX, as WRF an… - #2435

Open
udistr wants to merge 1 commit into
wrf-model:developfrom
udistr:wrfda-update-bc-latlon-mapfac
Open

udistr wants to merge 1 commit into
wrf-model:developfrom
udistr:wrfda-update-bc-latlon-mapfac

Conversation

@udistr

@udistr udistr commented Nov 1, 2026

Copy link
Copy Markdown

…d real.exe do

TYPE: bug fix

KEYWORDS: WRFDA, da_update_bc, lateral boundary, map factor, lat-lon, map_proj 6

SOURCE: Ehud Strobach

DESCRIPTION OF CHANGES:
Problem:
da_update_bc reads MAPFAC_U and MAPFAC_V to uncouple/recouple the boundary winds (da_couple_uv: u*(c1h*mu+c2h)/msf). WRF couples u with msfuy and v with msfvx (dyn_em/couple_or_uncouple_em.F, "u coupled with y"), and so does real.exe when it writes wrfbdy_d01 (main/real_em.F: couple(..., 'u', grid%msfuy ...), couple(..., 'v', grid%msfvx ...)). On conformal projections all these factors are equal, so nothing changes there. On a lat-lon grid (map_proj = 6) MAPFAC_UY = 1 everywhere while MAPFAC_U = MAPFAC_UX = 1/cos(lat), so the updated first boundary time of U was divided by MAPFAC_U = 1.06-1.37 (on a domain spanning 20-43N), i.e. 6% (south boundary) to 27% (north boundary) too weak in every cycle, and its tendency (U_BTXS) was wrong by up to ~2x. V is unaffected in practice because MAPFAC_V = MAPFAC_VX on lat-lon grids. T and PH are coupled without a map factor in both WRF and da_update_bc.

Solution:
Read MAPFAC_UY and MAPFAC_VX (in da_update_bc and da_update_bc_ad).

LIST OF MODIFIED FILES:
M var/da/da_update_bc/da_update_bc.f90
M var/da/da_update_bc/da_update_bc_ad.f90

TESTS CONDUCTED:

  1. Identity test on a lat-lon domain (640x460, 0.05 deg): da_file = real.exe's own wrfinput, so the update must leave real.exe's wrfbdy unchanged. Before: U_BXS, U_BYE, U_BTXS changed by 13%, 27%, 218% (relative rms). After: the output matches real.exe's wrfbdy to round-off (4e-8). V/T/PH/QVAPOR/MU unchanged before and after. Tested with WRFDA v4.1.2, whose da_update_bc lines are identical to develop.
  2. Jenkins tests: not run by us.

RELEASE NOTE: da_update_bc now couples the lateral-boundary u and v winds with MAPFAC_UY and MAPFAC_VX, as WRF and real.exe do. On lat-lon (map_proj = 6) domains the updated U boundary was previously too weak by the x map factor in the first boundary interval of every cycle.

The first line should be a single-line "purpose" for this change

TYPE: choose one of [bug fix, enhancement, new feature, feature removed, no impact, text only]

KEYWORDS: 5 to 10 words related to commit, separated by commas

SOURCE: Either "developer's name (affiliation)" .XOR. "internal" for a WRF Dev committee member

DESCRIPTION OF CHANGES:
Problem:
Generally or specifically, what was wrong and needed to be addressed?

Solution:
What was down algorithmically and in the source code to address the problem?

ISSUE: For use when this PR closes an issue.
Fixes #123

LIST OF MODIFIED FILES: list of changed files (use git diff --name-status master to get formatted list)

TESTS CONDUCTED:

  1. Do mods fix problem? How can that be demonstrated, and was that test conducted?
  2. Are the Jenkins tests all passing?

RELEASE NOTE: Include a stand-alone message suitable for the inclusion in the minor and annual releases. A publication citation is appropriate.

…d real.exe do

TYPE: bug fix

KEYWORDS: WRFDA, da_update_bc, lateral boundary, map factor, lat-lon, map_proj 6

SOURCE: Ehud Strobach

DESCRIPTION OF CHANGES:
Problem:
da_update_bc reads MAPFAC_U and MAPFAC_V to uncouple/recouple the boundary winds
(da_couple_uv: u*(c1h*mu+c2h)/msf). WRF couples u with msfuy and v with msfvx
(dyn_em/couple_or_uncouple_em.F, "u coupled with y"), and so does real.exe when it writes
wrfbdy_d01 (main/real_em.F: couple(..., 'u', grid%msfuy ...), couple(..., 'v', grid%msfvx ...)).
On conformal projections all these factors are equal, so nothing changes there. On a
lat-lon grid (map_proj = 6) MAPFAC_UY = 1 everywhere while MAPFAC_U = MAPFAC_UX = 1/cos(lat),
so the updated first boundary time of U was divided by MAPFAC_U = 1.06-1.37 (on a domain
spanning 20-43N), i.e. 6% (south boundary) to 27% (north boundary) too weak in every cycle,
and its tendency (U_BTXS) was wrong by up to ~2x. V is unaffected in practice because MAPFAC_V = MAPFAC_VX on lat-lon
grids. T and PH are coupled without a map factor in both WRF and da_update_bc.

Solution:
Read MAPFAC_UY and MAPFAC_VX (in da_update_bc and da_update_bc_ad).

LIST OF MODIFIED FILES:
M var/da/da_update_bc/da_update_bc.f90
M var/da/da_update_bc/da_update_bc_ad.f90

TESTS CONDUCTED:
1. Identity test on a lat-lon domain (640x460, 0.05 deg): da_file = real.exe's own wrfinput,
   so the update must leave real.exe's wrfbdy unchanged. Before: U_BXS, U_BYE, U_BTXS changed
   by 13%, 27%, 218% (relative rms). After: the output matches real.exe's wrfbdy to round-off
   (4e-8). V/T/PH/QVAPOR/MU unchanged before and after. Tested with WRFDA v4.1.2, whose
   da_update_bc lines are identical to develop.
2. Jenkins tests: not run by us.

RELEASE NOTE: da_update_bc now couples the lateral-boundary u and v winds with MAPFAC_UY and
MAPFAC_VX, as WRF and real.exe do. On lat-lon (map_proj = 6) domains the updated U boundary was
previously too weak by the x map factor in the first boundary interval of every cycle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@udistr
udistr requested a review from a team as a code owner November 1, 2026 12:48
@dudhia

dudhia commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Currently targeted for develop. DA people should see if it is a bug-fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants