Skip to content

A new version of the FAST (33 bins) Spectral-Bin Microphysics (FSBM)#848

Closed
JS-WRF-SBM wants to merge 15 commits intowrf-model:developfrom
JS-WRF-SBM:newFSBM
Closed

A new version of the FAST (33 bins) Spectral-Bin Microphysics (FSBM)#848
JS-WRF-SBM wants to merge 15 commits intowrf-model:developfrom
JS-WRF-SBM:newFSBM

Conversation

@JS-WRF-SBM
Copy link
Contributor

@JS-WRF-SBM JS-WRF-SBM commented Apr 1, 2019

A new version of the FAST (33 bins) Spectral-Bin Microphysics (FSBM)

TYPE: enhancement / new features

KEYWORDS: cloud microphysics, polarimetric-forward-operator

SOURCE: Jacob Shpund, Alexander Khain and Barry Lynn (The Hebrew University of Jerusalem)

DESCRIPTION OF CHANGES: A new updated FSBM cloud microphysical scheme.
There are updates across all the FSBM microphysical scheme including: switch to use either graupel or hail, condensation/evaporation, nucleation (cloud base nucleation, 3 log-normal user-defined aerosol distribution), adaptive cond./evap. time-step, updated collision-coalescence, spontaneous rain breakup, spontaneous snow breakup.
A forward polarimetric operator is coupled to the FSBM scheme, where the user can see the total reflectivity field, as well as the per hydrometeor total reflectivity (rain, snow, graupel/hail). Please see mandatory input tables info in the RELEASE NOTE.

ISSUE:

LIST OF MODIFIED FILES:
M Registry/registry.em_shared_collection
A Registry/registry.polrad
M Registry/registry.sbm
M dyn_em/solve_em.F
M phys/Makefile
M phys/module_diag_misc.F
M phys/module_diagnostics_driver.F
M phys/module_microphysics_driver.F
A phys/module_mp_SBM_polar_radar.F
M phys/module_mp_fast_sbm.F
M phys/module_physics_init.F

TESTS CONDUCTED: The WTF has not been used yet for the updated FSBM code.
However, the code has been compiled and used successfully for 10h of deep convection of the 20th May 2011 MC3E campaign test case (a manuscript consist of scheme details has been submitted for publication):

  • Compiled using Intel compiler 2019 (ifort version 19.0.3.199)
  • Configured using options 15 INTEL (ifort/icc, dmpar) and nest option 1.
  • BC/IC used the NCEP FNL (Final) Operational Global Analysis data are on 1-degree by 1-degree grids
  • Domain setup and time step (5s per 1.3 km):

&domains
time_step = 15,
time_step_fract_num = 0,
time_step_fract_den = 1,
max_dom = 2,
dx = 4000, 1333.33,
dy = 4000, 1333.33,
grid_id = 1, 2,
parent_id = 0, 1,
parent_grid_ratio = 1, 3,
parent_time_step_ratio = 1, 3,
...

  • In order to use the bin-wise polarimetric forward operator, a new flag must exist in the <namelist.input> file:

&physics
sbm_diagnostics = 1, 1,

RELEASE NOTE:
Fast (33bins) Spectral-bin Microphysics (FSBM): in order to run the new FSBM scheme, users needs to download an external directory named "SBM_input_33" consist of mandatory input tables and place it in the 'run' directory.
In case the coupled polarimetric forward operator is to be used (e.g., 'sbm_diagnostics = 1'), a second directory consist of scattering amplitudes named "SBM_scatter_amplit.tgz" needs to be placed in the 'run' directory.
Both directories are compressed and can be downloaded at the following link:
https://drive.google.com/drive/folders/1qxYyQwKI1wKQYasDUkQvVgHs11prLiqA?usp=sharing

@davegill
Copy link
Contributor

davegill commented Apr 1, 2019

@JS-WRF-SBM
Kobby,
There will be several iterations of comments.
First, would you make the base branch the develop branch.

Screen Shot 2019-04-01 at 7 43 07 AM

On the github page for this PR, where you see the EDIT box to the right of your title, click on the box that has "wrf-model:release-v4.0.3". Change this to "wrf-model:develop". That is why it says you are changing 535 files, when you want to change about 12.

@davegill
Copy link
Contributor

davegill commented Apr 1, 2019

@JS-WRF-SBM
Kobby,
Edit the title. You have a good one in the PR comments: "A new version of the FAST (33 bins) Spectral-Bin Microphysics (FSBM)".

@davegill
Copy link
Contributor

davegill commented Apr 1, 2019

@JS-WRF-SBM
Kobby,
For the release notes, word this so that this is a stand-alone item. We want to be able to grab this and use it with no editting in a large list of release notes. Typically, put your scheme name at the very beginning.

@davegill
Copy link
Contributor

davegill commented Apr 1, 2019

@JS-WRF-SBM
Kobby,
The part about the forward operator seems to have been cut off:

A forward polarimetric operator is coupled to the FSBM scheme, where the user can see the total reflectivity field, as well as the per hydrometeor total reflectivity (rain, snow, graupel/hail). See

@JS-WRF-SBM JS-WRF-SBM changed the title New FSBM A new version of the FAST (33 bins) Spectral-Bin Microphysics (FSBM) Apr 1, 2019
@JS-WRF-SBM
Copy link
Contributor Author

Dave,

I'm trying to EDIT and than choose from the box the "develop" option, by I'm getting a red note:

There are no new commits between base branch 'develop' and head branch 'newFSBM'

@JS-WRF-SBM
Copy link
Contributor Author

@JS-WRF-SBM
Kobby,
For the release notes, word this so that this is a stand-alone item. We want to be able to grab this and use it with no editting in a large list of release notes. Typically, put your scheme name at the very beginning.

Dave, I have no additional info. to add to the RELEASE NOTES (apart from the tables begin external), so feel free to edit the text to a form that you are comfortable with ... Thanks !

@davegill
Copy link
Contributor

davegill commented Apr 1, 2019

@JS-WRF-SBM
Kobby,
Once you click the EDIT button, you will be able to change the base branch.
Screen Shot 2019-04-01 at 9 14 41 AM

Select "develop" instead of "release-v4.0.3", then click "SAVE".

@davegill
Copy link
Contributor

davegill commented Apr 1, 2019

@JS-WRF-SBM
Kobby,
For the release notes

  1. add the meaning of FSBM
  2. what are the two directories to be added to run, are they both in the downloaded hyperlinked file?

@JS-WRF-SBM
Copy link
Contributor Author

@JS-WRF-SBM
Kobby,
Once you click the EDIT button, you will be able to change the base branch.
Screen Shot 2019-04-01 at 9 14 41 AM

Select "develop" instead of "release-v4.0.3", then click "SAVE".

I'm following exactly your guidance, but after switching to "develop", I get the above mentioned red note at the top of the screen. The 'SAVE' button disappears (only the EDIT remains)
Should I submit a new PR ?

@JS-WRF-SBM
Copy link
Contributor Author

@JS-WRF-SBM
Kobby,
Once you click the EDIT button, you will be able to change the base branch.
Screen Shot 2019-04-01 at 9 14 41 AM
Select "develop" instead of "release-v4.0.3", then click "SAVE".

I'm following exactly your guidance, but after switching to "develop", I get the above mentioned red note at the top of the screen. The 'SAVE' button disappears (only the EDIT remains)
Should I submit a new PR ?

Dave,
Do you have an account privilege to change the base branch to "develop" ?
It seems that GitHub needs a 'commit' in order to switch between the two branches "v4.03" and "develop".
Should I perform a dummy commit and push it again, or should we go for a new PR (or these are the same thing ...) ?

@davegill
Copy link
Contributor

davegill commented Apr 2, 2019

@JS-WRF-SBM
Kobby,
I get the same message as you do. I'll ask some other people today. I have not seen this before.

@JS-WRF-SBM
Copy link
Contributor Author

JS-WRF-SBM commented Apr 3, 2019

Hi Dave,

I've performed small changes to a single file (reading the initialization look-up tables) and made another 'push' to the newFSBM branch.
How can I verify the files in the PR are up to date ?
In my remote (GitHub) directory under the newFSBM branch I can only see the old FSBM ...

@dudhia
Copy link
Collaborator

dudhia commented Apr 3, 2019

When I try to change to develop it looks like it will allow it but there is a message about changing the base, so I didn't try it.

@JS-WRF-SBM
Copy link
Contributor Author

When I try to change to develop it looks like it will allow it but there is a message about changing the base, so I didn't try it.

Jimy,

If you press the button, you will encounter the message that Dave and myself got without any change in the base.

@dudhia
Copy link
Collaborator

dudhia commented Apr 3, 2019 via email

@JS-WRF-SBM JS-WRF-SBM closed this Apr 3, 2019
@JS-WRF-SBM JS-WRF-SBM reopened this Apr 3, 2019
@JS-WRF-SBM JS-WRF-SBM changed the base branch from release-v4.0.3 to develop April 4, 2019 11:57
@JS-WRF-SBM
Copy link
Contributor Author

Kobby, I and Dave looked at your fork again and we see no changes from your develop to your newFSBM branch, so it may be that you have not done a git add and git commit on your changes or have not pushed the new branch to your fork. Jimy

On Wed, Apr 3, 2019 at 10:48 AM JS-WRF-SBM @.***> wrote: When I try to change to develop it looks like it will allow it but there is a message about changing the base, so I didn't try it. Jimy, If you press the button, you will encounter the message that Dave and myself got without any change in the base. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#848 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/ARGf_CIzuSb8r7WONl_jEUr9kiyHW6o9ks5vdNtwgaJpZM4cVrX1 .

Jimy / Dave,

Thanks for pointing this out -- now I can see my new code in the 'newFSBM' branch and the base branch is "develop". Please let me know if anything else needs a change.

@dudhia
Copy link
Collaborator

dudhia commented Apr 4, 2019

Thanks the changes are visible now.
What I notice is a lot of blank space diffs in the diagnostics driver and microphysics driver for example. Can those changes be minimized. The Files Changed viewer on github works well at identifying these.

@dudhia
Copy link
Collaborator

dudhia commented Apr 4, 2019 via email

@smileMchen
Copy link
Collaborator

@JS-WRF-SBM
Kobby,
I am running regression test and found that all the compiling failed. Error messages are as follows:

module_mp_SBM_polar_radar.f90:177:24:

   if((ispecies==1) .AND. usetables(ispecies)) then
                        1
Error: Operands of logical operator '.and.' at (1) are LOGICAL(4)/INTEGER(4)
module_mp_SBM_polar_radar.f90:207:26:

   elseif(ispecies==2 .AND. usetables(ispecies)) then
                          1
Error: Operands of logical operator '.and.' at (1) are LOGICAL(4)/INTEGER(4)
module_mp_SBM_polar_radar.f90:239:26:

   elseif(ispecies==3 .AND. usetables(ispecies)) then
                          1
Error: Operands of logical operator '.and.' at (1) are LOGICAL(4)/INTEGER(4)
module_mp_SBM_polar_radar.f90:324:26:
....

In the code module_mp_SBM_polar_radar.F, "usetables" is a integer variable, and it is later used as a logical variable. Below is the piece of code related to the issue:

DO ispecies=1,size(usetables)
  if((ispecies==1) .AND. usetables(ispecies)) then ! rain
              usetables(1)=0
  elseif(ispecies==2 .AND. usetables(ispecies)) then ! fd
              usetables(2)=0
  elseif(ispecies==3 .AND. usetables(ispecies)) then ! ice crystals (plates, dendrites, columns)
              usetables(3)=0
              usetables(3)=0
              usetables(3)=0
  elseif(ispecies==4 .AND. usetables(ispecies)) then ! snow (aggregates)
              usetables(4)=0
  elseif(ispecies==5 .AND. usetables(ispecies)) then ! graupel
              usetables(5)=0
  elseif(ispecies==6 .AND. usetables(ispecies)) then ! hail
              usetables(6)=0

We need to specify "usetables(ispecies) = 0 or 1"

Please take a look. Thanks.

@JS-WRF-SBM
Copy link
Contributor Author

JS-WRF-SBM commented Jan 27, 2020 via email

@smileMchen
Copy link
Collaborator

@JS-WRF-SBM @davegill
Kobby,
I fixed the issue related to "usetables" in the code "module_mp_SBM_polar_radar.F". This code can be compiled successfully. However, the compiling failed again with errors related to the condition block below in module_mp_fast_sbm.F

#if defined(DM_PARALLEL)
....
....
#endif 

Note that this code can be successfully compiled using intel. However, it failed using GNU.
I will continue to look into this issue. Meanwhile, can you also take a look, not only this one, but also the conflicts shown in website. We do need to resolve these conflicts before we can merge the code into the develop.

@smileMchen
Copy link
Collaborator

smileMchen commented Jan 28, 2020

Also, regression failed for all compiling options (serial, openmp and mpi).

@dudhia
Copy link
Collaborator

dudhia commented Jan 31, 2020

Kobby, yes, smileMchen is here at NCAR working with us.

@davegill
Copy link
Contributor

davegill commented Feb 5, 2020

@JS-WRF-SBM @dudhia @weiwangncar @smileMchen
Kobby,
The concern about conflicts is due to the large number of whitespace changes that you have introduced:

Screen Shot 2020-02-04 at 6 25 41 PM

You have far too many changes that are not necessary in solve_em, the MP driver, and diags driver.

@JS-WRF
Copy link

JS-WRF commented Feb 5, 2020

@JS-WRF-SBM @dudhia @weiwangncar @smileMchen
Kobby,
The concern about conflicts is due to the large number of whitespace changes that you have introduced:

Screen Shot 2020-02-04 at 6 25 41 PM

You have far too many changes that are not necessary in solve_em, the MP driver, and diags driver.

@davegill @dudhia @weiwangncar @smileMchen
Dave / all,

Thanks for pointing this out.
Jimy suggested that we will merge this PR first and then I'll send a bug fix along with an updated version of the main MP physics code <module_mp_fast_sbm.F>.
Please advise what is your preferred way of resolving these issues.

@smileMchen
Copy link
Collaborator

I don’t think we should merge the code if it cannot be compiled.

@JS-WRF
Copy link

JS-WRF commented Feb 5, 2020

@smileMchen

Indeed, I meant after resolving the GNU compiler (gfortran) issues.
I hardly can assist with this as I do not work with gfortran.

@dudhia
Copy link
Collaborator

dudhia commented Feb 5, 2020 via email

@smileMchen
Copy link
Collaborator

@JS-WRF-SBM @davegill
I just modify the code related to "DM_PARALLEL" in the code phys/module_mp_fast_sbm.F. It can be compiled successfully now. This code is pushed back to the newFSBM branch. Please review and let me know if you have any concerns.

@davegill
Copy link
Contributor

davegill commented Feb 6, 2020

@JS-WRF-SBM
Kobby,

Here is the only line to change in solve_em.F:

Screen Shot 2020-02-06 at 11 18 46 AM

You are changing HUNDREDS of lines with whitespace in several files.

  1. Use the github "Files changed" page to look at each file that is modified. You can use the gear-looking icon to ignore white space changes.

Screen Shot 2020-02-06 at 11 21 24 AM

  1. Pull down the latest version of your code that Ming just committed. Use the previous versions of the the files that you are going to adjust for white space and re-insert the single line of changes. Your diffs compared to the version of the develop branch at the time you cut over the mods should show only the purposeful mods that you intend - not white space changes.

@dudhia
Copy link
Collaborator

dudhia commented Feb 6, 2020 via email

@smileMchen
Copy link
Collaborator

smileMchen commented Feb 6, 2020

Jenkin's test yielded multiple failures related to both ideal (em_quarter_ss) and real (double precision) cases. These failures are related to failed compilation.
I compiled quarter_ss separately in my local machine and the error message is :

    use rrlw_vsn_k, only : hvrini, hnamini

internal compiler error: in gfc_trans_use_stmts, at fortran/trans-decl.c:5122
0x73dfa4 gfc_trans_use_stmts
        ../../gcc/fortran/trans-decl.c:5121
0x73e5fa gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6689
0x71a041 gfc_generate_module_code(gfc_namespace*)
        ../../gcc/fortran/trans.c:2227
0x6ca987 translate_all_program_units
        ../../gcc/fortran/parse.c:6112
0x6ca987 gfc_parse_file()
        ../../gcc/fortran/parse.c:6328
0x713996 gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:204
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
0.34user 0.05system 0:00.69elapsed 58%CPU (0avgtext+0avgdata 60604maxresident)k
0inputs+0outputs (0major+18779minor)pagefaults 0swaps
../configure.wrf:345: recipe for target 'module_ra_rrtmg_lwk.o' failed
make[3]: [module_ra_rrtmg_lwk.o] Error 1 (ignored)

@davegill
Copy link
Contributor

davegill commented Feb 6, 2020

@smileMchen
Ming,
This is a GNU problem, not a problem with the code. Try to build this version of WRF on cheyenne with Intel.

@smileMchen
Copy link
Collaborator

newFSBM cannot be compiled for ideal case em_quarter_ss using gnu (as shown in Jenkins test and a separate compiling I did in cheyenne). However, there is no problem when compiled with intel.

@smileMchen
Copy link
Collaborator

The newSFBM codes can be successfully compiled using GNU-v9.1.0.

Note that older version of GNU compiler doesn't work due to some internal compiler errors.

@smileMchen
Copy link
Collaborator

@JS-WRF-SBM
Kobby,
We have fixed problems found in the codes, removed all the white spaces, and solve the conflicts. Please look at the modified codes at #1087

Unfortunately we just come up with a new problem: regression test failed because the code "module_mp_SBM_polar_radar.F" cannot be compiled with double precision. We need you to fix this issue by the end of this week (Feb. 14), when is the deadline for us to freeze the codes for release.

It is fine if you cannot make it by Feb. 14. We can incorporate the newFSBM in the future when it ready.

Let us know what you think.

@JS-WRF
Copy link

JS-WRF commented Feb 11, 2020

@smileMchen @davegill @dudhia

Folks, thanks for your efforts so far in merging the updated FSBM scheme, and apologies for the relatively slow reply as I'm moving to the US on the 14th February for my new position.
@smileMchen , can you please clarify what is needed from me more clearer? should I change the "double precision" declarations with "real" declarations? What is the code behavior you see while performing your test?

There is a very little chance that I will be able to do it by the 14th Feb.
Maybe it is better for me to withdraw the PR and send a new PR, including the redefinition of the "module_mp_SBM_polar_radar.F". For this to happen I need to understand better which changes are needed from the polarimetric radar simulator, as it can open the door for zillions of other changes.

What is the timescale for resubmit the new PR? Should I wait for the next major release?

@davegill
Copy link
Contributor

@JS-WRF-SBM @smileMchen @dudhia
Kobby,

  1. No need to withdraw anything, we'll just keep the PR for the develop branch.
  2. You should look at the PR that Ming put together as a replacement (getting rid of the extra white space).
  3. To replicate the error, just add make the configure step ./configure -r8

@dudhia
Copy link
Collaborator

dudhia commented Feb 11, 2020 via email

davegill added a commit that referenced this pull request Feb 27, 2020
…1097)

TYPE: enhancement / new features

KEYWORDS: cloud microphysics, polarimetric-forward-operator 

SOURCE: Jacob Shpund, Alexander Khain, and Barry Lynn (The Hebrew University of Jerusalem)

DESCRIPTION OF CHANGES: 
A new updated Fast Spectral Bin Microphysics (FSBM) cloud microphysical scheme.

There are updates across all the FSBM microphysical scheme including: 
1. switch to use either graupel or hail, condensation/evaporation, nucleation (cloud base 
nucleation, 3 log-normal user-defined aerosol distribution), 
2. adaptive cond./evap. time-step, 
3. updated collision-coalescence, 
4. spontaneous rain breakup, 
5. spontaneous snow breakup.

A forward polarimetric operator is coupled to the FSBM scheme. The user can see the total 
reflectivity field, as well as the per hydrometeor total reflectivity (rain, snow, graupel/hail). 
Please see mandatory input tables info in the RELEASE NOTE.    

Modified PR from the original #848 and then the additionally modified PR #1085 
A new version of the FAST (33 bins) Spectral-Bin Microphysics (FSBM). 
From #848 -> #1085 
1. Inadvertent white space removed
2. Build with NMM
3. Remove -r8 option

From #1085 to #1097 
1. Fix conflict introduced with #1095 "Separating new_diagnostics from the rest in 
diag_misc module"

LIST OF MODIFIED FILES: 
M       Makefile
M       Registry/registry.em_shared_collection
A       Registry/registry.polrad
M       Registry/registry.sbm
M       arch/postamble
M       configure
M       dyn_em/solve_em.F
M       phys/Makefile
M       phys/module_diag_nwp.F
M       phys/module_diagnostics_driver.F
M       phys/module_microphysics_driver.F
A       phys/module_mp_SBM_polar_radar.F
M       phys/module_mp_fast_sbm.F
M       phys/module_physics_init.F
M       share/module_check_a_mundo.F

TESTS CONDUCTED: 
1. Automated jenkins regression test is all PASS.
2. The code has been compiled and used successfully for 10h of deep convection of the 20th May 2011 MC3E campaign test case (a manuscript consist of scheme details has been submitted for publication).
    * Compiled using Intel compiler 2019 (ifort version 19.0.3.199)
    * Configured using options 15 INTEL (ifort/icc,  dmpar) and nest option 1.
    * BC/IC used the NCEP FNL (Final) Operational Global Analysis data are on 1x1 degree grids  

- Domain setup and time step (5s per 1.3 km):
```
&domains
 time_step                           = 15,
 time_step_fract_num         = 0,
 time_step_fract_den           = 1,
 max_dom                             = 2,
 dx                                   = 4000, 1333.33,
 dy                                   = 4000, 1333.33,
 grid_id                            = 1,     2,   
 parent_id                        = 0,     1,  
 parent_grid_ratio             = 1,     3, 
 parent_time_step_ratio   = 1,     3, 
```

- In order to use the bin-wise polarimetric forward operator, a new flag must exist in the  <namelist.input> file:
```
&physics
sbm_diagnostics                     = 1,     1, 
```

- The FAST SBM code is not currently configure to work with default 8-byte reals. 

RELEASE NOTE:
Fast (33 bins) Spectral-bin Microphysics (FSBM):  in order to run the new FSBM scheme, users needs to download an external directory named "SBM_input_33" consist of mandatory input tables and place it in the 'run' directory. In case the coupled polarimetric forward operator is to be used (e.g., 'sbm_diagnostics = 1'), a second directory consist of scattering amplitudes named "SBM_scatter_amplit.tgz" needs to be placed in the 'run' directory. Both directories are compressed and can be downloaded at the following link: 
https://drive.google.com/drive/folders/1qxYyQwKI1wKQYasDUkQvVgHs11prLiqA?usp=sharing
(on a Linux machine, you may need to escape the `?` character with `\?`).
The FAST SBM code is not currently configure to work with default 8-byte reals.
@davegill
Copy link
Contributor

Replaced with #1097

@davegill davegill closed this Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants