Changing Terrain Height, LU_INDEX and LANDMASK

This post was from a previous version of the WRF&MPAS-A Support Forum. Please do not add new replies here and if you would like the thread moved out of the Historical / Archive section then contact us, making sure to include the link of the thread to be moved.

n1o1o3n

New member
Hi,

I am trying to run the WRF idealized case (em_les), using real topo data.

In modification of the code, I successfully input my own terrain height and landuse data, judging from the wrfout.
However I could not find how to change the LANDMASK (I guess it is grid%landx?).

I modified the code to change grid%landx into 1 or 2 depending on the real landmask, but LANDMASK in the wrfout doesn't reflect my change.


Does anyone know the solution?

Thank you in advance.
 

kwerner

Administrator
Staff member
Hi,

Can you attach the namelist.input file you're using, along with the code you have modified. Please also let me know which version of the code you modified.

Thanks!
 

n1o1o3n

New member
Dear kwerner,

Thank you for your response.
I am using WRFv4.1.2 and please refer to the attached namelist and modified codes below.

module_initialize_ideal.F
Code:
   CASE (les)

open (567,file="LAND.txt")
    do
       read(567,*,end=556) i,j,grid%ht(i,j),grid%lu_index(i,j),grid%xland(i,j)
    end do
556  close (567)

    mminlu2 = ' '
    mminlu2(1:4) = 'USGS'
    CALL nl_set_mminlu(1, mminlu2)
!    CALL nl_set_mminlu(1, '    ')
    CALL nl_set_iswater(1,16)


Code:
  CASE (les)
!  DO j=jts,jte
!  DO i=its,ite
!    grid%ht(i,j) = 0.
!  ENDDO
!  ENDDO

  xs=ide/2 -3
  xs=ids   -3
  xe=xs + 6
  ys=jde/2 -3
  ye=ys + 6
  mtn_ht = 500
#ifdef MTN
!  DO j=max(ys,jds),min(ye,jde-1)
!  DO i=max(xs,ids),min(xe,ide-1)
!     grid%ht(i,j) = mtn_ht * 0.25 * &
!               ( 1. + COS ( 2*pi/(xe-xs) * ( i-xs ) + pi ) ) * &
!               ( 1. + COS ( 2*pi/(ye-ys) * ( j-ys ) + pi ) )
!  ENDDO
!  ENDDO
!#endif
!#ifdef EW_RIDGE
!  DO j=max(ys,jds),min(ye,jde-1)
!  DO i=ids,ide
!     grid%ht(i,j) = mtn_ht * 0.50 * &
!               ( 1. + COS ( 2*pi/(ye-ys) * ( j-ys ) + pi ) )
!  ENDDO
!  ENDDO
#endif
#ifdef NS_RIDGE
!  DO j=jds,jde
!  DO i=max(xs,ids),min(xe,ide-1)
!     grid%ht(i,j) = mtn_ht * 0.50 * &
!               ( 1. + COS ( 2*pi/(xe-xs) * ( i-xs ) + pi ) )
!  ENDDO
!  ENDDO
#endif
  DO j=jts,jte
  DO i=its,ite
    grid%phb(i,1,j) = g * grid%ht(i,j)
    grid%ph0(i,1,j) = g * grid%ht(i,j)
  ENDDO
  ENDDO

  END SELECT ideal_terrain


Thanks!
 

Attachments

  • namelist.input.txt
    5.1 KB · Views: 89

kwerner

Administrator
Staff member
Hi,
Thanks for sending those! I would like to simply compare the original module_initialize_real.F file to the modified code. Can you attach the full modified file? That would make it a bit more easy for me.

Thanks!
 

kwerner

Administrator
Staff member
Thanks! The idealized seabreeze case actually has land data included. I would recommend looking through the module_initialize_ideal.F file at how the code is configured for the seabreeze case, and try to copy that same strategy for les. And yes, it does look like you will need xland. I don't think you have anything soil-related turned on, so you may not need to bother with anything having to do with soil.
 

n1o1o3n

New member
Dear kwerner,

Thank you for your comment!
If my understanding is correct, LANDMASK, SEAMASK, or xland is related to Z0 calculation based on Charnock's equation. So, I would like to input real landmask information into the idealized les simulation. Do you mean that my configuration doesn't calculate Z0 based on landmask information or doesn't take landmask into account for the simulation?
If so, can you please indicate the way to include real land information for, at least, momentum flux calculation?
 

kwerner

Administrator
Staff member
Hi,
n1o1o3n said:
Do you mean that my configuration doesn't calculate Z0 based on landmask information or doesn't take landmask into account for the simulation?
I'm confused by your question. Perhaps I caused confusion with my previous response. I *think* your question may have stemmed from my comment "And yes, it does look like you will need xland." That was simply a reply to a previous comment you made (back on Sept 28):
"I could not find how to change the LANDMASK (I guess it is grid%landx?)"

So I was saying that yes, it does look like that's probably the variable you need to play around with. Unfortunately we don't have the exact code to do what you're interested in, nor am I aware of anyone who has done it before for the LES case. The closest thing available is the code for the seabreeze case, which does use real land input, in the module_initialize_ideal.F file. The code has several different parts, which then break down into the individual cases. To include LANDMASK, you essentially want to do what was done for the seabreeze case in each of these parts - but you'll put that code into the LES case parts of the code. If you have very specific landmask data you'd like to use, you will need to play around with the code a bit more.
 

n1o1o3n

New member
Hi kwerner,

Apologies for the confusion.

I asked the following question;
"Do you mean that my configuration doesn't calculate Z0 based on landmask information or doesn't take landmask into account for the simulation?"
because I was really interested in your comment;
"I don't think you have anything soil-related turned on"

The reason why I was trying to input xland data was that I wanted to see wind speed offshore, which is affected by Z0 calculated in Charnock equation.
So I thought I needed to input xland data indicating if the grid point is onshore or offshore.


And as for the solution, I cound not find any difference in my wrfout when I used codes for the seabreeze case, although I don't know how to check even if WRF correctly imported xland data by my code.


Best regards
 

kwerner

Administrator
Staff member
Hi,
I would recommend trying to put some print statements into your code to determine whether the model is using the new part of the code. You can ask it to print out values for particular variables at particular points.
 

n1o1o3n

New member
Hi!

I will try it shortly.
To clarify, is the xland value used for the sfclay scheme, if I successfully import the variable from real terrain into the model?
 
Top