Skip to content

Unified wrf/wrf-chem model_mod - #741

Open
hkershaw-brown wants to merge 80 commits into
mainfrom
wrf-unified
Open

hkershaw-brown wants to merge 80 commits into
mainfrom
wrf-unified

Conversation

@hkershaw-brown

@hkershaw-brown hkershaw-brown commented Sep 26, 2024 •

Copy link
Copy Markdown
Collaborator

Description:

Refactored WRF model mod for WRF & WRF CHEM.
Namelist selectable QTYS, see #404 for details.

Created a wrf_unified model directory. This is to allow concurrent development on wrf and wrf_unified.
wrf_unified/model_mod is ~4500 less than the wrf/model_mod and this is a bit of a headache for keeping up-to-date with main (easy to miss changes in such differing code).

See pull #683 for original pull request
wrf-wrf-chem branch available at https://github.com/hkershaw-brown/DART/tree/wrf-wrf-chem

Fixes issue

Fixes #404
Partial #359 (WRF)
Partial #624 (WRF)

To do:
Follow fixes for

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Documentation changes needed?

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.

Tests

Please describe any tests you ran to verify your changes.
Bitwise tests during refactoring: https://github.com/hkershaw-brown/wrf-tests.git

Checklist for merging

  • Updated changelog entry
  • Documentation updated
  • Update conf.py

Checklist for release

  • Merge into main
  • Create release from the main branch with appropriate tag
  • Delete feature-branch

Testing Datasets

  • Dataset needed for testing available upon request
  • Dataset download instructions included
  • No dataset needed

kershaw-ucar and others added 4 commits September 26, 2024 13:35
New model_mod directory so development can happen concurrently on
wrf and wrf_unified.
Original pull request #683
@hkershaw-brown

Copy link
Copy Markdown
Collaborator Author

For un reviewed atmos-chem forward operators see #743

@hkershaw-brown hkershaw-brown added the wrf Weather Research & Forecasting Model label Dec 11, 2024
@hkershaw-brown
hkershaw-brown requested a review from Copilot June 9, 2025 16:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request refactors the WRF model_mod for both WRF and WRF CHEM by introducing a unified model_mod and updating corresponding documentation and configuration files. Key changes include:

  • Addition of a build script (quickbuild.sh) in the wrf_unified directory.
  • Extensive documentation updates in readme.rst describing the unified model and its configuration.
  • A new model_mod.nml file with updated configuration and minor comment updates to observation modules.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
models/wrf_unified/work/quickbuild.sh Introduces a build script for the new unified model
models/wrf_unified/readme.rst Provides documentation updates for the unified WRF model interface
models/wrf_unified/model_mod.nml Defines new namelist settings for the unified model_mod
assimilation_code/modules/observations/default_quantities_mod.f90 Updates observation quantities comments with a new potential temperature entry
assimilation_code/modules/observations/atmosphere_quantities_mod.f90 Updates observation quantities comments with a new potential temperature entry
Comments suppressed due to low confidence (2)

assimilation_code/modules/observations/default_quantities_mod.f90:14

  • [nitpick] Consider adding a brief comment that explains the rationale behind adding QTY_2M_POTENTIAL_TEMPERATURE to the observation quantities documentation.
!   QTY_2M_POTENTIAL_TEMPERATURE

assimilation_code/modules/observations/atmosphere_quantities_mod.f90:107

  • [nitpick] Consider adding documentation for the inclusion of QTY_2M_POTENTIAL_TEMPERATURE to clarify its intended use and context in the module.
!   QTY_2M_POTENTIAL_TEMPERATURE

Comment thread models/wrf_unified/readme.rst Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

🟡 Changes recommended

Changes are blocked because review findings identify a projection increment bug in setup_map_projection that would break coordinate conversions and a critical broken adv_ens_command path in input.nml that would cause perfect_model_obs to fail unless corrected.

2 open issues

Review effort: Balanced

Comment on lines +27 to +29
async = 0
adv_ens_command = "../shell_scripts/advance_model.csh"

Comment thread models/wrf_unified/model_mod.f90 Resolved
select case (which_vert)
case(VERTISLEVEL)
zloc(:) = lon_lat_vert(3)
level_below(:) = nint(zloc(:))

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nearest level rather than level below. Can you have obs on fractional levels?

Comment thread models/wrf_unified/model_mod.f90 Resolved
call toGrid(xloc,i,dx,dxm)
call toGrid(yloc,j,dy,dym)

if ( .not. within_bounds_horizontal(i, j, grid_id, qty) ) then

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q. where is your vertical bounds check?

Comment thread models/wrf_unified/model_mod.f90 Resolved


!------------------------------------------------------------------
function bounds_check_vertical(ind, grid_id, state_id, var_id)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not being called, see earlier comment about where is your vertical check.

Comment thread models/wrf_unified/model_mod.f90 Resolved
Comment thread models/wrf_unified/model_mod.f90 Resolved
Comment thread models/wrf_unified/model_mod.f90 Resolved
Comment thread models/wrf_unified/model_mod.f90 Resolved
Comment thread models/wrf_unified/model_mod.f90 Resolved
QTY_GEOPOTENTIAL_HEIGHT is in the meterological domain
This was some experiments for bitwise differences with main.
See #404 (comment)
for notes on order of vertical and horizontal interpolation.
This is more for someone reading the code.
The vortex qtys are not 'able_to_interpolate'
This is following wrf model_mod.
I am not sure how strict to be with this in static_init_model_mod
vs failing in column builds. There may be simplified runs where
you do not care what is in the wrf state.

This branch has not been deployed

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

Labels

atmos-chem wrf Weather Research & Forecasting Model wrf-chem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat req: Refactor wrf model_mod and models/wrf directory, unify WRF/WRF-CHEM

3 participants