Difference between revisions of "Porting WRF-SFIRE fuel moisture model to WRF4"

From openwfm
Jump to navigation Jump to search
(Created page with "* start from release v3.3 * copy over fire model files as submitted to v3.3 and commit * the revert commit is the change from submitted to release * apply fuel moisture model...")
 
 
(46 intermediate revisions by 2 users not shown)
Line 1: Line 1:
* start from release v3.3
+
[[Category:WRF-Fire merge]]
* copy over fire model files as submitted to v3.3 and commit
+
==Preparing pull request==
* the revert commit is the change from submitted to release
+
* http://www2.mmm.ucar.edu/wrf/users/testing.html  Testing requirements
* apply fuel moisture model commits to submitted
+
* http://www2.mmm.ucar.edu/wrf/users/contrib_info.php Information for WRF contributors (outdated but still relevant)
* test with v3.3 input files
+
* https://github.com/wrf-model/WRF/wiki/Making-a-good-pull-request-message
* change from submitted to release
+
* [https://blog.jaraco.com/how-to-write-perfect-pull-request/ How to write the perfect pull request]
* test with v3.3 input files
+
 
* upgrade by merge with V4.0
+
==Initial progress==
* upgrade by merge with develop
+
* I started {{wrf-fire-merge-branch|fuel-moisture-model}} from {{wrf-branch|develop}} as requested in [https://github.com/wrf-model/WRF/wiki/Workflow-for-WRF-Code-Modification WRF instructions]. Note that the current WRF is at {{wrf-fire-merge-tag|v4.0.3}} which is a few commits behind {{wrf-branch|develop}}.
 +
* Cherry pick {{wrf-fire-commit|f8193dad36|2011-09-25  adding moisture variables}} and {{wrf-fire-commit|5a6c4b8c06|2011-09-26 21:55:09 using variable fuel moisture in fmc_g}}. Making minimal changes against original. I had to check and understand any changes not just resolve the conflicts. Hard to automate. So that took a bit of time.
 +
* I created {{wrf-fire-merge-branch|added-fmc_g}} at {{wrf-fire-merge-commit|132444f0db6754417|}}. It should give the same numbers  as current {{wrf-fire-merge-branch|develop}} (at commit {{wrf-fire-merge-commit|0f296f9c0f674f941a7|}}) when <tt>fire_fmc_read=1</tt> in namelist.input or not present, and take <tt>fmc_g</tt> from <tt>wrfinput</tt> when <tt>fire_fmc_read=0</tt>.
 +
* This is how it is in this stage of the code for testing, but the use of <tt>fire_fmc_read</tt> has changed in further commits after 2011-09-26 so the inputs will be different after the port is completed.
 +
 
 +
==Testing of <tt>fmc_g</tt> added==
 +
Get the test code:
 +
<pre>
 +
git clone https://github.com/openwfm/WRF-Fire-merge.git
 +
cd WRF-Fire-merge
 +
git checkout added-fmc_g
 +
git log
 +
</pre>
 +
to make sure you are at commit {{wrf-fire-merge-commit|132444f0db67544179c7998f5653c488dd41e836|}}.
 +
Build on kingspeak following [[How_to_build_WRF4#University_of_Utah_CHPC]] and run the basic hill test case:
 +
<pre>
 +
cd test/em_fire
 +
./ideal.exe
 +
./wrf.exe >& wrf.log &
 +
</pre>
 +
This will use fuel moisture from <tt>namelist.fire</tt>. To read fmc_g from wrfinput, set
 +
<pre>
 +
fire_fmc_read=0
 +
</pre>
 +
in namelist input. This will change as more of wrf-fire is merged in. In any case, fmc_g in wrfinput has to be set by other means, such as using [https://github.com/openwfm/wrf-fire/blob/master/other/Matlab/netcdf/ncreplace.m ncreplace] in Matlab.
 +
 
 +
To run real problem, build WPS for this WRF. Variable fmc_g should be in wrfinput but not set, you have to set it by other means.
 +
 
 +
==Testing to be done==
 +
* Compare builds and execution paths:
 +
** Build from {{wrf-fire-merge-branch|develop}} vs. {{wrf-fire-merge-branch|added-fmc_g}}, both with fire_fmc_read not present in namelist.input. The numbers should be exactly the same.
 +
** Change fuelmc_g in namelist.fire to see if it is having the expected effect
 +
** Test the build from {{wrf-fire-merge-branch|added-fmc_g}} with <tt>fire_fmc_read=0</tt> in <tt>namelist.input</tt> and with <tt>fmc_g</tt> manually inserted into wrfinput, to see if it is working as expected
 +
 
 +
*From the testing I have already done it seems that the code is slow. I do not know why. I do not know if that is already the case for WRF4 (currently at 4.0.3). Compare speed with wrf-fire on the hill problem.
 +
* So just in case, I created {{wrf-fire-merge-branch|v4.0.3-added-fmc_g}} which is the same as {{wrf-fire-merge-branch|added-fmc_g}} except it is based on current {{wrf-fire-merge-branch|master}} instead of {{wrf-fire-merge-branch|develop}} and I am testing the hill problem there and in {{wrf-fire-merge-branch|master}}.  But are no differences in the fire model files.
 +
* Real problems need to be tested, with data processed by WPS4
 +
 
 +
==Continued progress==
 +
The WRF4 code with the fuel moisture model from wrf-fire is being created in {{wrf-fire-merge-branch|fuel-moisture-model}} and testing is in progress. Note that the merge is started from {{wrf-branch|develop}} as requested in [https://github.com/wrf-model/WRF/wiki/Workflow-for-WRF-Code-Modification WRF instructions]. The current WRF is at {{wrf-fire-merge-tag|v4.0.3}} which is few commits behind {{wrf-branch|develop}}.
 +
 
 +
 
 +
==Fortran==
 +
===Standard===
 +
* https://gcc.gnu.org/wiki/GFortranStandards
 +
* [https://wg5-fortran.org/N001-N1100/N692.pdf Fortran 90]
 +
 
 +
===Namelist===
 +
https://stackoverflow.com/questions/10566010/formatting-2d-arrays-in-a-fortran-namelist-input-file
 +
 
 +
==See also==
 +
* [[WRF-Fire merge testing]]
 +
* [[WRF-SFIRE fuel moisture model commits]]
 +
* [[Tracking WRF Fire/SFIRE changes]]
 +
* [[How to track WRF Fire/SFIRE changes]]
 +
* [[Fire code in WRF release]]
 +
* [[WRF-Fire development notes]]

Latest revision as of 21:32, 24 November 2019

Preparing pull request

Initial progress

Testing of fmc_g added

Get the test code:

git clone https://github.com/openwfm/WRF-Fire-merge.git
cd WRF-Fire-merge
git checkout added-fmc_g
git log

to make sure you are at commit 132444f0db67544179c7998f5653c488dd41e836 . Build on kingspeak following How_to_build_WRF4#University_of_Utah_CHPC and run the basic hill test case:

cd test/em_fire
./ideal.exe
./wrf.exe >& wrf.log &

This will use fuel moisture from namelist.fire. To read fmc_g from wrfinput, set

fire_fmc_read=0

in namelist input. This will change as more of wrf-fire is merged in. In any case, fmc_g in wrfinput has to be set by other means, such as using ncreplace in Matlab.

To run real problem, build WPS for this WRF. Variable fmc_g should be in wrfinput but not set, you have to set it by other means.

Testing to be done

  • Compare builds and execution paths:
    • Build from branch develop vs. branch added-fmc_g, both with fire_fmc_read not present in namelist.input. The numbers should be exactly the same.
    • Change fuelmc_g in namelist.fire to see if it is having the expected effect
    • Test the build from branch added-fmc_g with fire_fmc_read=0 in namelist.input and with fmc_g manually inserted into wrfinput, to see if it is working as expected
  • From the testing I have already done it seems that the code is slow. I do not know why. I do not know if that is already the case for WRF4 (currently at 4.0.3). Compare speed with wrf-fire on the hill problem.
  • So just in case, I created branch v4.0.3-added-fmc_g which is the same as branch added-fmc_g except it is based on current branch master instead of branch develop and I am testing the hill problem there and in branch master. But are no differences in the fire model files.
  • Real problems need to be tested, with data processed by WPS4

Continued progress

The WRF4 code with the fuel moisture model from wrf-fire is being created in branch fuel-moisture-model and testing is in progress. Note that the merge is started from branch develop as requested in WRF instructions. The current WRF is at tag v4.0.3 which is few commits behind branch develop.


Fortran

Standard

Namelist

https://stackoverflow.com/questions/10566010/formatting-2d-arrays-in-a-fortran-namelist-input-file

See also