WRF icon indicating copy to clipboard operation
WRF copied to clipboard

metadata from module_initialize_ideal.F not in wrfinput_d01

Open davegill opened this issue 4 years ago • 1 comments

Describe the bug The error was first reported in the WRF Forum: https://forum.mmm.ucar.edu/phpBB3/viewtopic.php?f=46&t=9777&p=19642#p19642

The metadata vales assigned from inside the module_initialize_ideal.F (lat, lon, etc), are not transferred to the wrfinput_d01 file.

The metadata from dyn_em/module_initialize_ideal.F is set up as assignments in a case statement, depending on which idealized case has been selected:

   CASE (les)

    CALL nl_set_mminlu(1, '    ')
    CALL nl_set_iswater(1,0)
    CALL nl_set_cen_lat(1,40.)
    CALL nl_set_cen_lon(1,-105.)
    CALL nl_set_truelat1(1,0.)
    CALL nl_set_truelat2(1,0.)
    CALL nl_set_moad_cen_lat (1,0.)
    CALL nl_set_stand_lon (1,0.)
    CALL nl_set_pole_lon (1,0.)
    CALL nl_set_pole_lat (1,90.)
    CALL nl_set_map_proj(1,0)

This call updates a data structure, model_config_rec.

To Reproduce Steps to reproduce the behavior:

  1. WRF v4.2.2 with GNU 9.3.0. Standard clean, configure, compile.
  2. Standard em_les namelist options. Just run ideal.exe.
  3. Look at the metadata in the wrfinput_d01 file that was assigned from the init program. It is incorrectly zero.
ncdump -h wrfinput_d01 | grep -iw cen_lat
		:CEN_LAT = 0.f ;

Expected behavior The assigned value in dyn_em/module_initialize_ideal.F should be from this statement:

CALL nl_set_cen_lat(1,40.)

Solution It looks like all that is required is a call to model_to_grid_config_rec in share/output_wrf.F, as one of the first executable statements. For this specific case (LES ideal init), this is a solution.

davegill avatar Dec 23 '20 17:12 davegill

@smileMchen @dudhia @weiwangncar @kkeene44 Ming, I have put in this issue to remind us. I think there is an easy solution (proposed above), but it needs to be broadly tested (nests, restarts, ndown, writing boundary data, fdda output, diagnostics, etc). It is likely that when we went to version 4 (when we introduced this module_intitialize_ideal.F), this metadata has been broken for a select group of ideal cases ever since: hill2d_x, quarter_ss, squall2d_x, squall2d_y, grav2d_x, convrad, b_wave, seabreeze, les.

davegill avatar Dec 23 '20 17:12 davegill