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

Issues outputting microphysics variables to wrfout...

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.

nluchett

New member
Hi all, I am trying to output snow and graupel melt, as well as rain evaporation from the Thompson Microphysics scheme and write it to the wrfout files.. I have been unsuccessful so I was wondering if anyone can look at my source code mods and perhaps help me de -bug? I've attached several screenshots of my mods as well as an error.txt containing the compile.log errors.

Based on my limited experience working within the Thompson mp scheme source code, I found the prs_sml (snow melt), prr_gml (graupe melt), and prv_rev (rain evaporation) to be the variables I needed to write out to wrfoutput (not entirely confident in the rain evaporation term... the other two I think are for sure correct). I first created new entires in the Registry.EM_COMMON (NTL_Registry_EM_edits.png). I think I did this correctly, however I wasn't confident in the IO field. Should this be "h" for history?

Next, I edited the Solve_em.F (NTL_Solve_em_edits.png) which I think is correct... I then made edits to the Thompson scheme itself by first editing the mp_gt_driver routine to include the variables from the Registry I created (NTL_Thompson_mp_gt_driver_edits.png), defined the variables (NTL_thompson_define_variables_out_of_subroutine.png), initialized the 3d variables (NTL_thompson_intitalize_3D_mp_variables_edits.png), called the 1D variables in the call mp_thompson routine (NTL_thompson_call_mp_thompson_edits.png) and finally converted some units in the source/sink terms (NTL_thompson_convert_sink_units.png).

Lastly, I edited the module_microphysics_driver.F to add the new 3D variables (NTL_microphysics_driver_add_3d_var.png), define the variables (NTL_microphysics_driver_define_var - Not too sure if this one is necessary or not....), and finally to modify the call mp_gt_driver (NTL_microphysics_driver_call_mp_gt_driver.png).

I've attached an error.txt which shows the compile.log errors I'm receiving. It appears the errors are coming from the microphysics_driver.F module... "../phys/module_microphysics_driver.f90(747): error #6631: A non-optional actual argument must be present when invoking a procedure with an explicit interface. [SNOWML]"

I'm really not sure how to interpret this error as this is all really new to me. Does anyone have any suggestions?

Thanks again for the help!

Take care,

Nick Luchetti
 

Attachments

  • error.txt
    19 KB · Views: 72
  • NTL_microphysics_driver_define_var.png
    NTL_microphysics_driver_define_var.png
    56.9 KB · Views: 5,884
  • NTL_microphysics_driver_add_3d_var.png
    NTL_microphysics_driver_add_3d_var.png
    154.2 KB · Views: 5,882
  • NTL_Solve_em_edits.png
    NTL_Solve_em_edits.png
    111.1 KB · Views: 5,883
  • NTL_Registry_EM_edits.png
    NTL_Registry_EM_edits.png
    108 KB · Views: 5,884
Bumping to add more screen shots due to 5 attachment limit....
 

Attachments

  • NTL_thompson_call mp_thompson_edits.png
    NTL_thompson_call mp_thompson_edits.png
    259.9 KB · Views: 5,883
  • NTL_thompson_convert_sink_units.png
    NTL_thompson_convert_sink_units.png
    243.9 KB · Views: 5,884
  • NTL_thompson_intitialize_3d_mp_variables_edits.png
    NTL_thompson_intitialize_3d_mp_variables_edits.png
    103.8 KB · Views: 5,882
  • NTL_thompson_mp_gt_driver_edits.png
    NTL_thompson_mp_gt_driver_edits.png
    146.7 KB · Views: 5,882
  • NTL_thompson_define_variables_out_of_subroutine_edits.png
    NTL_thompson_define_variables_out_of_subroutine_edits.png
    118.5 KB · Views: 5,883
Bump again to add a 1 more screen shots of mods..
 

Attachments

  • NTL_microphysics_driver_call_mp_gt_driver.png
    NTL_microphysics_driver_call_mp_gt_driver.png
    165.9 KB · Views: 5,884
Hi Nick,
Instead of screen shots of parts of the files, can you simply attach the code files that you modified (e.g., attach module_microphysics_driver.F), along with the full compile log? Please also let me know which version of the model you are making your modifications from so that I can compare to the default.

Thanks!
 
Hi Kwerner,
Absolutely. See attached for each of the files I modified (Solve_em.F, module_microphsyics_driver.F, thompson_mp, and Registry.EM_Common), as well as the entire compile.log. I'm modifying WRF version 4.0.3.
 

Attachments

  • Registry.EM_COMMON
    369.8 KB · Views: 92
  • module_mp_thompson.F
    208.3 KB · Views: 95
  • module_microphysics_driver.F
    134.2 KB · Views: 90
  • module_microphysics_driver.f90
    100.8 KB · Views: 82
  • solve_em.F
    246.2 KB · Views: 99
Here is compile.log file since I can only attach 5 per post. You can search "nick luchetti" in each of these files to find where I made my edits.

Thank you in advance!

Nick
 

Attachments

  • compile.log
    628.8 KB · Views: 83
Thanks for sending those. That was helpful. There are 3 things that need to be fixed in your files:

module_microphysics_driver.F
line 488:
Code:
REAL, DIMENSION(ims:ie, kms:kme, jms:jme), INTENT(OUT):: snowml, graupml, rain_evp
There is an 'm' missing in the dimension - it should be
Code:
ims:ime

You need to add your 3 new variables in the both calls to "mp_gt_driver", so you they should also be added around line 30:
Code:
snowml=snowml,                      &
                     graupml=graupml,                    &
                     rain_evp=rain_evp,                  &

solve_em.F
There is a mis-spelling for "rain_evp"
line 3731:
Code:
  &        , rain_evp=grid%rain_evap                                   &
You will need to remove the 'a' from the right side.

After making those changes, you SHOULD be able to build.
 
Hi Nick,
Have you solved the problem?
There was a problem when compiling.
Please check out compile.log in the attachment.

Thanks!
 

Attachments

  • compile.log
    965.6 KB · Views: 52
Top