DART icon indicating copy to clipboard operation
DART copied to clipboard

THM is mandatory WRF temp variable

Open braczka opened this issue 1 year ago • 8 comments

Description:

Adding documentation in WRF and WRF-DART tutorial to make THM mandatory.

Fixes issue

#728

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)
  • [X] Documentation update

Documentation changes needed?

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

Checklist for merging

  • [ ] Updated changelog entry
  • [X] Documentation updated
  • [ ] Update conf.py

Checklist for release

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

braczka avatar Sep 09 '24 20:09 braczka

Besides documentation, perhaps I could have also forced the code to throw an error if temperature variable T is used as the TYPE_T in wrf_state_variables?

braczka avatar Sep 09 '24 21:09 braczka

see #733 (review)

Yup, I am on it

braczka avatar Sep 13 '24 14:09 braczka

Now errors out if using T WRF variable with type_t. Should both prevent boundscheck error, and also an end-user unexpectedly using a diagnostic temperature variable instead of prognostic temperature variable (THM), which will deprecate forecast skill.

braczka avatar Oct 03 '24 22:10 braczka

Hi Brett, can you share a wrf restart file to test this code with? Thanks, Helen

hkershaw-brown avatar Oct 04 '24 13:10 hkershaw-brown

Hi Brett, can you share a wrf restart file to test this code with? Thanks, Helen

Yes -- this wrf file has both T and THM to test out functionality:

/glade/work/bmraczka/DART/models/wrf/Akeem_bug/wrfinput_d01.original

braczka avatar Oct 07 '24 15:10 braczka

934d82e Removes check of 'type_t' for error call. Only need to check for WRF variable 'T'

braczka avatar Oct 09 '24 14:10 braczka

The code is not enforcing "mandatory THM". If you run model_mod_check with THM not in the state, you get a boundCheck error:

***************** RUNNING    TEST 4    ***********************
 -- Testing model_interpolate with a single location
**************************************************************
--------------------------------------------------------------
Interpolating QTY_10M_U_WIND_COMPONENT
 --  at "loc_of_interest" location
--------------------------------------------------------------

-------------------------------------------------------------
interpolating at  Lon/Lat(deg): 286.00000000  17.00000000  Vert:    0.0100000 km
interpolating for "QTY_10M_U_WIND_COMPONENT"
-------------------------------------------------------------

forrtl: severe (408): fort: (3): Subscript #2 of the array VAR_SIZE has value -1 which is less than the lower bound of 1

Image              PC                Routine            Line        Source             
model_mod_check    00000000006E75BE  model_mod_mp_boun        6710  model_mod.f90
model_mod_check    000000000055C992  model_mod_mp_mode        1612  model_mod.f90
model_mod_check    00000000007AC643  model_check_utili          86  model_check_utilities_mod.f90
model_mod_check    00000000008E7050  test_interpolate_         339  test_interpolate_threed_sphere.f90
model_mod_check    0000000000800BEA  MAIN__                    257  model_mod_check.f90
model_mod_check    000000000040EE3D  Unknown               Unknown  Unknown
libc-2.31.so       00007F073B6B029D  __libc_start_main     Unknown  Unknown
model_mod_check    000000000040ED6A  Unknown               Unknown  Unknown
hkershaw@derecho4:/glade/derecho/scratch/hkershaw/DART/Bugs/wrf_type_t/runs$ 

hkershaw-brown avatar Oct 10 '24 15:10 hkershaw-brown

The code is not enforcing "mandatory THM". If you run model_mod_check with THM not in the state, you get a boundCheck error:

***************** RUNNING    TEST 4    ***********************
 -- Testing model_interpolate with a single location
**************************************************************
--------------------------------------------------------------
Interpolating QTY_10M_U_WIND_COMPONENT
 --  at "loc_of_interest" location
--------------------------------------------------------------

-------------------------------------------------------------
interpolating at  Lon/Lat(deg): 286.00000000  17.00000000  Vert:    0.0100000 km
interpolating for "QTY_10M_U_WIND_COMPONENT"
-------------------------------------------------------------

forrtl: severe (408): fort: (3): Subscript #2 of the array VAR_SIZE has value -1 which is less than the lower bound of 1

Image              PC                Routine            Line        Source             
model_mod_check    00000000006E75BE  model_mod_mp_boun        6710  model_mod.f90
model_mod_check    000000000055C992  model_mod_mp_mode        1612  model_mod.f90
model_mod_check    00000000007AC643  model_check_utili          86  model_check_utilities_mod.f90
model_mod_check    00000000008E7050  test_interpolate_         339  test_interpolate_threed_sphere.f90
model_mod_check    0000000000800BEA  MAIN__                    257  model_mod_check.f90
model_mod_check    000000000040EE3D  Unknown               Unknown  Unknown
libc-2.31.so       00007F073B6B029D  __libc_start_main     Unknown  Unknown
model_mod_check    000000000040ED6A  Unknown               Unknown  Unknown
hkershaw@derecho4:/glade/derecho/scratch/hkershaw/DART/Bugs/wrf_type_t/runs$ 

Yep -- trying again with 2d99f18

braczka avatar Oct 10 '24 21:10 braczka

Yes -- let me update the docs to remove the boundscheck comments. This new check avoids the boundscheck issue, so we don't want to lead the user in the wrong direction if they actually get a boundscheck error for other reasons.

braczka avatar Oct 22 '24 16:10 braczka

This is good on my end.

braczka avatar Oct 22 '24 17:10 braczka