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

Question regarding modification of a variable in PBL scheme in specific time

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.

yujinjo

New member
Hi.

Can I modify a variable, which is in module_bl_ysu.F script, in specific time steps?

To get this, I modified the script-"module_bl_ysu.F" by using XTIME as follows:

<< original >>
zfac(i,k) = min(max((1.-(zq(i,k+1)-zl1(i))/(hpbl(i)-zl1(i))),zfmin),1.)

<< modified >>
IF (XTIME .GE. 1440 .and. XTIME .LE. 2100) then
zfac(i,k) = min(max((1.-(zq(i,k+1)-zl1(i))/ (10.0*(hpbl(i)-zl1(i))) ),zfmin),1.)
ELSE
zfac(i,k) = min(max((1.-(zq(i,k+1)-zl1(i))/(hpbl(i)-zl1(i))),zfmin),1.)
ENDIF

(I added XTIME to "module_bl_ysu.F" script)

and recompiled.

But, It didn't work as I expected.
What I expected was a change in the value of "zfac" in specific time steps (such as 'XTIME .GE. 1440 .and. XTIME .LE. 2100') but the results showed a change throughout the all time steps.



I'd really appreciate it if you could give me a hint or advice on this.

Thanks in advance.
 
It is to enough to simply add 'xtime' to the code module_bl_ysu.F. You need to modify the following codes:
(1) in dyn_em/module_first_rk_step_part1.F, add xtime=grid%xtime to call of pbl_driver
(2) add the corresponding dummy argument (i.e., xtime) to the code phys/module_pbl_driver.F
(3) pass the variable xtime to module_bl_ysu.F, then use it as describe din your message.

An alternative option is to use the variable 'itimestep', which has already been passed into the PBL driver, which can then be passed into the bl_ysu code and used directly. Note that the conversion between xtime and itimestep is:
xtime = itimestep*dt/60
 
Top