Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Difference between wrfinput and wrfout

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.


New member
Hello wrfhelp,

Recently, I found an interesting thing that there is a distinct difference in the value of the same variable between wrfinput and wrfout at initial forecast time. Intuitively, the values of meteorological variables don’t have to go through integral operations, so they should be the same as that in wrfinput file, but they don’t. I’m very curious that what processes and why cause this difference?


There are differences between the initial conditions (the data from the wrfinput* file) and the 0th hour of the model output (the data from the wrfout* file).

Some of the differences are due to initialization. For example, the output from either digital filtering or from data assimilation both produce output in the same format as the "original" wrfinput file, but a number of the fields would be different in the 0th hour wrfout file when compare to the original wrfinput file.

Some of the differences can be attributed to multi-domain runs. In nested scenarios, the feedback operation will impact every field that is a function of the topography or the base state (reference pressure and reference geopotential, for example).

Some of the differences are due to physics corrections applied to zeroed-out or empty fields. For example, the physics init routine computes initial values for the amount of frozen soil moisture. This computation is not handled in the real program.

For most WRF runs, the physics settings can be modified without re-running the real program. In such cases, assumptions about the physical locations of fields can be changed, such as the soil temperature. The values of fields can be altered as the meaning the field could be changed (for example, fractional sea ice).

I just looked at a small, single-domain run. The values of moist theta, vapor, u, v, ph, mu, and land use are all identical.

If there is a concern about fields that are different, and that difference appears to be an error (for example, not explainable by some of the ideas above), please provide us with some additional information so that we can replicate the situation.

Hello Dave,

Thanks for your reply. Actually, I never change the physics setting after "real" program and tested with a single-domain run. The values of variables as you mentioned above are identical, but the values of perturbation pressure and derived sea-level pressure with NCL WRF function (i.e., wrf_user_getvar) are different. I don't know what happened for these two variables.

In the real program, we compute p' by integrating down the column:

               DO im = PARAM_FIRST_SCALAR, num_3d_m
                 qtot = qtot + moist(i,kk,j,im)
               qvf2 = 1./(1.+qtot)
               qvf1 = qtot*qvf2

               grid%p(i,kk,j) = - 0.5*((grid%c1f(k)*grid%Mu_2(i,j))+qvf1*(grid%c1f(k)*grid%Mub(i,j)+grid%c2f(k)))/grid%rdnw(kk)/qvf2

               !  Now, integrate down the column to compute the pressure perturbation, and diagnose the two
               !  inverse density fields (total and perturbation).

               DO kk=kte-2,1,-1
                  k = kk + 1
                  DO im = PARAM_FIRST_SCALAR, num_3d_m
                    qtot = qtot + 0.5*(moist(i,kk,j,im)+moist(i,kk+1,j,im))
                  qvf2 = 1./(1.+qtot)
                  qvf1 = qtot*qvf2
                  grid%p(i,kk,j) = grid%p(i,kk+1,j) - ((grid%c1f(k)*grid%Mu_2(i,j)) + qvf1*(grid%c1f(k)*grid%Mub(i,j)+grid%c2f(k)))/qvf2/grid%rdn(kk+1)
               END DO
We use the p' value to compute the inverse density.

In the WRF model, we use the inverse density to compute the p' field.

    DO j=jts,min(jte,jde-1)
    DO k=kts,kte-1
    DO i=its,min(ite,ide-1)
       IF ( config_flags%use_theta_m == 0 ) THEN
          qvf = 1.+rvovrd*moist(i,k,j,P_QV)
          qvf = 1
       END IF
       grid%p(i,k,j)=p1000mb*( (r_d*(t0+grid%t_1(i,k,j))*qvf)/                     &
                  (p1000mb*(grid%al(i,k,j)+grid%alb(i,k,j))) )**cpovcv  &

I am seeing maximum p' differences of about 0.03 Pa. Are you seeing differences larger than this?


  • Screen Shot 2019-08-27 at 11.12.04 AM.png
    Screen Shot 2019-08-27 at 11.12.04 AM.png
    240.3 KB · Views: 932
  • Screen Shot 2019-08-27 at 11.13.35 AM.png
    Screen Shot 2019-08-27 at 11.13.35 AM.png
    39.9 KB · Views: 932