Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using 'lat-lon' map projection in WRF, assigns Cassini projection in DART #811

Open
braczka opened this issue Jan 27, 2025 · 6 comments
Open
Assignees
Labels
wrf Weather Research & Forecasting Model

Comments

@braczka
Copy link
Contributor

braczka commented Jan 27, 2025

### Describe the bug

When using WRF-DART while applying WRF 'lat-lon' map projection for land/atmosphere -- DART misinterprets 'lat-lon' map projection as cassini.

Expectation:
When using WRF 'lat-lon', that DART uses the map_latlon and PROJ_LATLON options in model_mod to perform interpolation

What happens instead:
DART uses map_cassini and PROJ_CASSINI instead. This occurs because WRF assign an integer value of '6' for the 'MAP_PROJ' attribute using map_latlon, whereas DART assigns an integer value of '0' for PROJ_latlon. DART incorrectly calls subroutine llij_cassini instead of llij_latlon, which is the incorrect forward operator.

### Which model(s) are you working with?
Tested with WRF version 3.9 thru 4.5

### Version of DART
Latest tag

### Have you modified the DART code?
No -- but quick fix would be to reassign the integers within DART such that PROJ_LATLON = 6 and map_latlon = 6. Then assign cassini a different integer, such as PROJ_CASSINI = 106 or map_cassini = 106. See misc_definitions_module and
model_mod.f90 for more details.

All other WRF supported map projections are aligned properly with DART -- including lambert, mercator and polar. No changes required. The WRF-DART tutorial using the lambert map projection.

I thought this integer change for the latlon MAP_PROJ occured between WRF version 3 and more recent versions of WRFv4+, and this change was missed during the WRF-DART version 4 tutorial updates, however, both WRFv3 and v4 versions have this integer mismatch with DART.

Bug, first reported by Rui Sun (UCSD).

### Compiling information
Derecho using gfortan

@braczka braczka added the wrf Weather Research & Forecasting Model label Jan 27, 2025
@braczka braczka self-assigned this Jan 27, 2025
@braczka
Copy link
Contributor Author

braczka commented Jan 27, 2025

Forgot to mention that DART uses the MAP_PROJ integer attribute from the WRF land/atm files to assign the integer in DART. This is read within read_wrf_file_attributes

@nancycollins
Copy link
Collaborator

nancycollins commented Jan 27, 2025

what would happen with WRF files that did have 0 as the projection type integer? would those still work?

@braczka
Copy link
Contributor Author

braczka commented Jan 27, 2025

I don't know if WRF generates MAP_PROJ = 0 anymore. I guess at some point it did, perhaps the 'lat-lon' projection at one point was at '0', but testing version 3.9 for the latest versions 4.5 does not produce MAP_PROJ = 0 for any supported map projection that I can tell.

Currently, if MAP_PROJ = 0, DART interprets as 'lat-lon' which is incorrect. If I implemented suggested changes, a MAP_PROJ = 0 should cause DART to error out.

@nancycollins
Copy link
Collaborator

just for reference, i looked up some older wrfinput_d01 files from CONUS runs and they use map projection 1. so maybe this change wouldn't break anything.

@braczka
Copy link
Contributor Author

braczka commented Jan 28, 2025

just for reference, i looked up some older wrfinput_d01 files from CONUS runs and they use map projection 1. so maybe this change wouldn't break anything.

What was the WRF version of the wrfinput_d01? As far as I know map projection 1 has always referred to the lambert projection
Projection 1 --> lambert
Projection 2 --> polar
Projection 3 --> mercator
Projection 6 --> lat-lon, although at some point was '0' according to DART.

I would need to dig into the WRF code (WPS ) to find all possibilities when I find time

@nancycollins
Copy link
Collaborator

yes - the conus runs i usually saw were using a lambert projection, not straight lat/lon. plotted on a lat/lon grid, the area was a section of a wedge, not a square. that was one of the reasons we used the wrf utils to map from lat/lon to i/j index in the wrf arrays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wrf Weather Research & Forecasting Model
Projects
None yet
Development

No branches or pull requests

2 participants