Enabling WRF build with ESMF library#1066
Conversation
…d ESMF library by renaming wrf esmf modules. This will take care of that.
…ESMF_Initalize inside WRF. Plean NOTE that you should use the configure.wrf file here for compiling for now. Later we can make changes so it would be permanant in WRF configuration.
|
@billsacks This is the PR for renaming WRF ESMF internal interfaces to enable building and linking WRF with our ESMF library. |
|
@negin513 |
|
@negin513 |
|
@davegill I just tested the before and after of this PR for 10 timesteps and the results were bit-for-bit identical. |
|
@kkeene44 I have done the regression testing (all is OK), Negin has verified bit-reproducible results before vs after the change, and the COAWST developer that uses WRF and ESMF for coupling has signed-off on this PR also. When you look at the the mods, you will see that the entire set of changes is just to rename each of the WRF versions of the "pretend" ESMF module names with something other than the "real" ESMF names (which causes troubles with name space collision when using the actual ESMF library. |
TYPE: bug fix KEYWORDS: wrfplus, TL/AD code SOURCE: internal DESCRIPTION OF CHANGES: Two recent WRF model code changes break the wrfplus compilation: 1. ESMF name change This modification allowed the CTSM development to use standard ESMF without conflicting with WRF _old_ ESMF library namespace. Commit 8af5385, PR #1066 "Enabling WRF build with ESMF library" 2. module_diffusion_em_ad.F, 3d scale aware TKE (one of these, take your pick) Commit d059afe, PR #972 "Add a scale-adaptive 3DTKE parameterization scheme as a subgrid mixing option Commit 6d95883, PR #1012 "SMS3dTKE: Remove broken packaging for km_opt=5" Commit 94e5ed9, PR #1013 "Add missing "IF km_opt==5" tests for diag computations" Commit dd0c209, PR #1026 "Fixing the problem that km_opt=5 breaks km_opt=2 and cleaning codes" LIST OF MODIFIED FILES: M share/mediation_integrate.F M wrftladj/module_diffusion_em_ad.F TESTS CONDUCTED: wrfplus code compiles now.
|
I applaud this PR because I've been running So I checked out the release-v4.2 branch as I saw that this commit made it in there. However, one issue still lingers for me. I use this program to confirm that I can import ESMF and WRF stuff into the same namespace: program test_use_wrf_with_esmf
use ESMF
use module_wrf_top, only: wrf_init, wrf_run, wrf_finalize, head_grid
end program test_use_wrf_with_esmfWith ESMF 8.0.0, WRF release-v4.2, and gfortran-9.3.0, I get: This error comes up because there is still one remaining conflict, due to the ESMF_FractionMod in external/esmf_time_f90/ESMF_Fraction.F90 still being called that, and not namespaced to The fix is straightforward: Would you like a PR for it? |
Milan, Please clone the wrf-model/WRF fork, and checkout the release-v4.2 branch. Do a "checkout -b" to get to your own, new branch (but based from release-v4.2). Make the modification, and push it up to your fork. Issue a pull request. We are trying to get a release out in a week or so, so please hurry if you can. |
TYPE: bug fix KEYWORDS: ESMF, ESMF_FractionMod, WRF_ESMF_FractionMod SOURCE: Milan Curcic (University of Miami) DESCRIPTION OF CHANGES: Problem and solution documented [here](#1066 (comment)). > Currently, it is not possible to build and link WRF with a chosen ESMF library due to the name conflicts between WRF internal ESMF interfaces with the intended ESMF library. I faced this problem while I was trying to compile WRF with the ESMF library during LILAC project development for coupling WRF with CTSM. This is specifically important for users and groups who would like to couple WRF with other models using ESMF infrastructure. This issue can be resolved by either updating WRF to use the new ESMF time manager interface or renaming all of WRF's internal ESMF interfaces to avoid name collisions when linking with the intended ESMF library. ISSUE: Fixes #1065. LIST OF MODIFIED FILES: M external/esmf_time_f90/ESMF_Fraction.F90 M external/esmf_time_f90/ESMF_Mod.F90 M external/esmf_time_f90/ESMF_TimeInterval.F90 M external/esmf_time_f90/Meat.F90 TESTS CONDUCTED: 1. Compiled in em_real mode. Tested using the program mentioned [here](#1066 (comment)). 2. Jenkins all PASS 3. This PR does not cause any conflicts for building CTSM code with WRF.
TYPE: bug fix KEYWORDS: ESMF, ESMF_FractionMod, WRF_ESMF_FractionMod SOURCE: Milan Curcic (University of Miami) DESCRIPTION OF CHANGES: Problem and solution documented [here](wrf-model/WRF#1066 (comment)). > Currently, it is not possible to build and link WRF with a chosen ESMF library due to the name conflicts between WRF internal ESMF interfaces with the intended ESMF library. I faced this problem while I was trying to compile WRF with the ESMF library during LILAC project development for coupling WRF with CTSM. This is specifically important for users and groups who would like to couple WRF with other models using ESMF infrastructure. This issue can be resolved by either updating WRF to use the new ESMF time manager interface or renaming all of WRF's internal ESMF interfaces to avoid name collisions when linking with the intended ESMF library. ISSUE: Fixes #1065. LIST OF MODIFIED FILES: M external/esmf_time_f90/ESMF_Fraction.F90 M external/esmf_time_f90/ESMF_Mod.F90 M external/esmf_time_f90/ESMF_TimeInterval.F90 M external/esmf_time_f90/Meat.F90 TESTS CONDUCTED: 1. Compiled in em_real mode. Tested using the program mentioned [here](wrf-model/WRF#1066 (comment)). 2. Jenkins all PASS 3. This PR does not cause any conflicts for building CTSM code with WRF.
TYPE: Bug Fix / New Feature
KEYWORDS: ESMF library, WRF-ESMF coupling, Compiling WRF with ESMF library, Linking WRF with ESMF library, WRF ESMF time manager
SOURCE: Negin Sobhani (NCAR) with contributions from William Sacks (NCAR)
DESCRIPTION OF CHANGES:
Previously it was not possible to build WRF with a specific ESMF library due to the name conflicts between WRF internal ESMF interfaces with the intended ESMF library. This PR enables users to compile WRF to build and link against an intended ESMF library, without any collisions with WRF internal ESMF interfaces. In this PR we simply rename all WRF's ESMF interfaces to avoid the names conflicts. This PR is especially important for any user who wants to use WRF with ESMF for coupling.
The purpose of this modification is the eventual use of the new CTSM with WRF. Please see the CTSM github page for more information.
ISSUE: Fixes issue #1065 "Building WRF with ESMF library"
LIST OF MODIFIED FILES:
M external/esmf_time_f90/ESMF_Alarm.F90
M external/esmf_time_f90/ESMF_AlarmClock.F90
M external/esmf_time_f90/ESMF_Base.F90
M external/esmf_time_f90/ESMF_BaseTime.F90
M external/esmf_time_f90/ESMF_Calendar.F90
M external/esmf_time_f90/ESMF_Clock.F90
M external/esmf_time_f90/ESMF_Mod.F90
M external/esmf_time_f90/ESMF_Stubs.F90
M external/esmf_time_f90/ESMF_Time.F90
M external/esmf_time_f90/ESMF_TimeInterval.F90
M external/esmf_time_f90/Meat.F90
TESTS CONDUCTED:
proposed modifications. They do not cause any troubles for their coupled usage of WRF.
RELEASE NOTE: By changing the names of the older ESMF modules in the WRF source code (for example, from ESMF_AlarmMod to WRF_ESMF_AlarmMod), the WRF model may now be built with released ESMF library versions.