igmk / pamtra

Passive and Active Microwave TRAnsfer model
GNU General Public License v3.0
19 stars 16 forks source link

input moment q_h and r_eff must be greater than 0! #47

Closed ephraims28 closed 1 year ago

ephraims28 commented 1 year ago

Hi, I am working on getting brightness temperatures using a WRF model run as input. I was able to successfully make a plot of brightness temperatures at nadir at 169.31GHz with cloud water and cloud ice. I used the descriptor file from one of the examples and inputted hydro_q and hydro_n. That plot is attached for reference.

Screen Shot 2023-06-29 at 4 42 55 PM

However, I get an error when I change to using a 23 moment_in and input hydro_q and hydro_reff. This is a problem since I'll have to end up using a 23 moment_in for snow since I have only hydro_reff and hydro_q to use as input from the WRF run for that hydrometeor.

I'm a little confused on why this is an error in the first place, since in clear sky conditions wouldn't both q_h and r_eff be zero? Or is make_dist_parameters.f90 only run when certain conditions are met?

Do you know what is happening?

descriptorFile = np.array([

['hydro_name' 'as_ratio' 'liq_ice' 'rho_ms' 'a_ms' 'b_ms' 'alpha_as' 'beta_as' 'moment_in' 'nbin' 'dist_name' 'p_1' 'p_2' 'p_3' 'p_4' 'd_1' 'd_2' 'scat_name' 'vel_size_mod' 'canting']

    ('cwc_q', 1.0,  1, -99.0,   -99.0, -99.0,  -99.0, -99.0, 13, 100, 'mgamma', -99.0, -99.0,   2.0,    1.0,   2.0e-6,   8.0e-5, 'mie-sphere', 'corPowerLaw_24388657.6_2.0', -99.0),
    ('iwc_q', 1.0, -1, -99.0, 1.58783,  2.56,  0.684,   2.0, 13, 100, 'mgamma', -99.0, -99.0, 1.564, 0.8547, 1.744e-5, 9.369e-3, 'ssrg-rt3',   'corPowerLaw_30.606_0.5533',  -99.0)],
    dtype=[('hydro_name', 'S15'), ('as_ratio', '<f8'), ('liq_ice', '<i8'), ('rho_ms', '<f8'), ('a_ms', '<f8'), ('b_ms', '<f8'), ('alpha_as', '<f8'), ('beta_as', '<f8'), ('moment_in', '<i8'), ('nbin', '<i8'), ('dist_name', 'S15'), ('p_1', '<f8'), ('p_2', '<f8'), ('p_3', '<f8'), ('p_4', '<f8'), ('d_1', '<f8'), ('d_2', '<f8'), ('scat_name', 'S20'), ('vel_size_mod', 'S30'), ('canting', '<f8')] 
    )

submitting job 0 0 1 0 1 0 1 submitted job: 1 submitting job 1 1 2 0 1 0 1 submitted job: 2 submitting job 2 2 3 0 1 0 1 submitted job: 3 submitting job 3 3 4 0 1 0 1 submitted job: 4 submitting job 4 4 5 0 1 0 1 submitted job: 5 submitting job 5 5 6 0 1 0 1 submitted job: 6 submitting job 6 6 7 0 1 0 1 submitted job: 7 submitting job 7 7 8 0 1 0 1 submitted job: 8 submitting job 8 8 9 0 1 0 1 submitted job: 9 waiting for all jobs to finish 2023/06/29 14:04:58 fatal in module make_dist_params if moment_in eq 23 then input moment q_h and r_eff must be greater than 0! 2023/06/29 14:04:58 fatal in module run_dropsize Error in make_dist_params 2023/06/29 14:04:58 fatal in module make_dist_params 2023/06/29 14:04:58 fatal in module hydrometeor_extinction Error in run_drop_size_dist if moment_in eq 23 then input moment q_h and r_eff must be greater than 0! 2023/06/29 14:04:58 fatal in module run_dropsize Error in make_dist_params 2023/06/29 14:04:58 fatal in module run_rt error in run_drop_size_dist! 1 1 2023/06/29 14:04:58 fatal in module hydrometeor_extinction Error in run_drop_size_dist 2023/06/29 14:04:58 fatal in module run_pamtra Error in run_rt! 2023/06/29 14:04:58 fatal in module run_rt error in run_drop_size_dist! 1 1 2023/06/29 14:04:58 fatal in module run_pamtra Error in run_rt! 2023/06/29 14:04:58 fatal in module make_dist_params if moment_in eq 23 then input moment q_h and r_eff must be greater than 0! 2023/06/29 14:04:58 fatal in module run_dropsize Error in make_dist_params 2023/06/29 14:04:58 fatal in module hydrometeor_extinction Error in run_drop_size_dist 2023/06/29 14:04:58 fatal in module run_rt error in run_drop_size_dist! 1 1 2023/06/29 14:04:58 fatal in module run_pamtra Error in run_rt! 2023/06/29 14:04:58 fatal in module make_dist_params if moment_in eq 23 then input moment q_h and r_eff must be greater than 0! 2023/06/29 14:04:58 fatal in module run_dropsize Error in make_dist_params 2023/06/29 14:04:58 fatal in module hydrometeor_extinction Error in run_drop_size_dist 2023/06/29 14:04:58 fatal in module run_rt error in run_drop_size_dist! 1 1 2023/06/29 14:04:58 fatal in module run_pamtra Error in run_rt! 2023/06/29 14:04:58 fatal in module make_dist_params if moment_in eq 23 then input moment q_h and r_eff must be greater than 0! 2023/06/29 14:04:58 fatal in module run_dropsize Error in make_dist_params 2023/06/29 14:04:58 fatal in module hydrometeor_extinction Error in run_drop_size_dist 2023/06/29 14:04:58 fatal in module run_rt error in run_drop_size_dist! 1 1 2023/06/29 14:04:58 fatal in module run_pamtra Error in run_rt! 2023/06/29 14:04:58 fatal in module make_dist_params if moment_in eq 23 then input moment q_h and r_eff must be greater than 0! 2023/06/29 14:04:58 fatal in module run_dropsize Error in make_dist_params 2023/06/29 14:04:58 fatal in module hydrometeor_extinction Error in run_drop_size_dist 2023/06/29 14:04:58 fatal in module run_rt error in run_drop_size_dist! 1 1 2023/06/29 14:04:58 fatal in module run_pamtra Error in run_rt! 2023/06/29 14:04:58 fatal in module make_dist_params if moment_in eq 23 then input moment q_h and r_eff must be greater than 0! 2023/06/29 14:04:58 fatal in module run_dropsize Error in make_dist_params 2023/06/29 14:04:58 fatal in module hydrometeor_extinction Error in run_drop_size_dist 2023/06/29 14:04:58 fatal in module run_rt error in run_drop_size_dist! 1 1 2023/06/29 14:04:58 fatal in module run_pamtra Error in run_rt! 2023/06/29 14:04:58 fatal in module make_dist_params if moment_in eq 23 then input moment q_h and r_eff must be greater than 0! 2023/06/29 14:04:58 fatal in module run_dropsize Error in make_dist_params 2023/06/29 14:04:58 fatal in module hydrometeor_extinction Error in run_drop_size_dist 2023/06/29 14:04:58 fatal in module run_rt error in run_drop_size_dist! 1 1 2023/06/29 14:04:58 fatal in module run_pamtra Error in run_rt! 2023/06/29 14:04:58 fatal in module make_dist_params if moment_in eq 23 then input moment q_h and r_eff must be greater than 0! 2023/06/29 14:04:58 fatal in module run_dropsize Error in make_dist_params 2023/06/29 14:04:58 fatal in module hydrometeor_extinction Error in run_drop_size_dist 2023/06/29 14:04:58 fatal in module run_rt error in run_drop_size_dist! 1 1 2023/06/29 14:04:58 fatal in module run_pamtra Error in run_rt! got job 1 got job 2 got job 3 got job 4 got job 5 got job 6 got job 7 got job 8 got job 9

mariomech commented 1 year ago

Hi Sam,

you got that right. If the hydrometeor mixing ratio in a layer for a specific hydrometeor type the content is below a defined threshold (default = 1.d-10), the dropsize distribution calculation is skipped.

You need to check which of the two parameters has non-reasonable values. We had that for other NWP models as well and had to apply some checks. Cheers Mario

DaveOri commented 1 year ago

Mario is of course right, that error should not be raised because the routine should not have been called in the first place due to the minimum mixing ratio threshold.

Also I am a little confused, because your descriptorFile uses moment_in 13 and the error is raised for moment_in 23. Can you post a minimal code to reproduce the issue?

ephraims28 commented 1 year ago

When I ran it successfully I was using a moment_in of 13. I got the error when using a moment_in of 23.

I'll look through the data I'm inputting into pamtra. Based on your info, my guess is that there are gridpoints where the hydro_q is above the 1^-10 threshold, but the hydro_reff is still zero.

If that doesn't work, I can post code to reproduce the issue.

ephraims28 commented 1 year ago

So I was able to get everything to work by modifying the input data like this:

data["QCLOUD"][data["QCLOUD"]<=1e-9] = 0 data["RE_CLOUD"][data["QCLOUD"]<=1e-9] = 0

data["QICE"][data["QICE"]<=1e-9] = 0 data["RE_ICE"][data["QICE"]<=1e-9] = 0