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

Quick WRF compilation after modifying some parameters in the land surface model

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.

LarryTian

New member
Hi guys,

Recently, I want to test some modification in the Noah-MP model (module_sf_noahlsm.F).
After I modify some code in the Noah-MP, I need to compile WRF, again and again, every time.
This compilation cost 30 minutes each time, which is not efficient.

Could anyone tell me how to compile WRF quickly after making some little modification in the Noah-MP model (module_sf_noahlsm.F)?

Thank you so much.
 
Hi,
1) When you are recompiling, are you just compiling, or are you issuing a 'clean -a', and then reconfiguring, and then recompiling? For modifications to physics routines, it's not necessary to clean/configure. You can just compile, and typically it's quicker than the original full compile. You're likely doing this correctly, but I just wanted to make sure because that would certainly save you a lot of time.

2) What compiler are you using? If you happen to be using Intel, it takes quite a while to compile, even for a recompile. GNU (gfortran) compiles much faster (and it's a free compiler). Even if you are eventually hoping to run with Intel, for the purpose of modifying the code and compiling to test for accuracy, it may be worth it to switch to GNU so that you can have quick compiles until you're satisfied with all the modifications.

3) If you're not already doing so, you can use multiple processors to compile. We've found that up to 4 processors is a good number to use (any more and it somewhat levels out). Before compiling you can set:
Code:
setenv J "-j 4"
(csh e.g.), or
Code:
export J="-j 4"
(bash e.g.)
 
Hi kwerner,

I am so appreciated for your prompt reply.

For your question 1:

I just modified a physics routine, but I issued “clean -a”, reconfigured, and recompiled the WRF. This recompilation roughly costs 30 minutes.
I will follow your advice, and just recompile it after the modification was made.

For your question 2:

The compiler I used is GUN (gfortran).

For your question 3:
My shell is bash.
I will use your setting to test the multiple processors.

Overall, thank you again.
I will post my feedback after I test your tips.
 
Top