Changeset 0f89116 in flex_extract.git for Source/Python/Mods/disaggregation.py


Ignore:
Timestamp:
Dec 19, 2019, 8:07:12 PM (4 years ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
a73c0f6
Parents:
0d99607
Message:

diverse changes due to PEP8 style guide and eliminating grib2flexpart; removed unused parameter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Source/Python/Mods/disaggregation.py

    r44174de r0f89116  
    247247            # geometric mean, restricted such that non-negativity is guaranteed
    248248            # according to Eq. (25)
    249             fip1=min( 3.*g[i] , 3.*g[i+1] , np.sqrt(g[i+1]*g[i]) )
     249            fip1 = min(3. * g[i], 3. * g[i + 1], np.sqrt(g[i + 1] * g[i]))
    250250
    251251            # the function value at the first sub-grid point (fi1) is determined
     
    281281                # the monotonicity filter corrects the value at (fim1) by
    282282                # substituting (fim1) with (fmon), see Eq. (27), (28) and (29)
    283                 fmon = min(3.*g[i-2], \
    284                            3.*g[i-1], \
    285                            np.sqrt(max(0,(18./13.*g[i-2] - 5./13.*f[-7]) *
    286                                          (18./13.*g[i-1] - 5./13.*f[-1]))))
     283                fmon = min(3. * g[i - 2],
     284                           3. * g[i - 1],
     285                           np.sqrt(max(0, (18. / 13. * g[i - 2] - 5. / 13. * f[-7]) *
     286                                       (18. / 13. * g[i - 1] - 5. / 13. * f[-1]))))
    287287
    288288                # recomputation of the sub-grid interval values while the
     
    295295                f[-2] = f[-3]+(f[-1]-fmon)/3.
    296296
    297             f.extend([0.,0.,0.])
     297            f.extend([0., 0., 0.])
    298298
    299299        # otherwise the sub-grid values are calculated and added to the list
     
    306306            # geometric mean, restricted such that non-negativity is guaranteed
    307307            # according to Eq. (25)
    308             fip1 = min( 3.*g[i] , 3.*g[i+1] , np.sqrt(g[i+1]*g[i]) )
     308            fip1 = min(3. * g[i], 3. * g[i + 1], np.sqrt(g[i + 1] * g[i]))
    309309
    310310            # the function value at the first sub-grid point (fi1) is determined
     
    324324                # the monotonicity filter corrects the value at (fim1) by
    325325                # substituting (fim1) with fmon, see Eq. (27), (28) and (29)
    326                 fmon = min(3.*g[i-2], \
    327                            3.*g[i-1], \
    328                            np.sqrt(max(0,(18./13.*g[i-2] - 5./13.*f[-7]) *
    329                                          (18./13.*g[i-1] - 5./13.*f[-1]))))
     326                fmon = min(3. * g[i - 2],
     327                           3. * g[i - 1],
     328                           np.sqrt(max(0, (18. / 13. * g[i - 2] - 5. / 13. * f[-7]) *
     329                                       (18. / 13. * g[i - 1] - 5. / 13. * f[-1]))))
    330330
    331331                # recomputation of the sub-grid interval values while the
     
    358358            # the monotonicity filter corrects the value at (fim1) by
    359359            # substituting (fim1) with (fmon), see Eq. (27), (28) and (29)
    360             fmon = min(3.*g[-3], \
    361                        3.*g[-2], \
    362                        np.sqrt(max(0,(18./13.*g[-3] - 5./13.*f[-7]) *
    363                                      (18./13.*g[-2] - 5./13.*f[-1]))))
     360            fmon = min(3. * g[-3],
     361                       3. * g[-2],
     362                       np.sqrt(max(0, (18. / 13. * g[-3] - 5. / 13. * f[-7]) *
     363                                   (18. / 13. * g[-2] - 5. / 13. * f[-1]))))
    364364
    365365            # recomputation of the sub-grid interval values while the
     
    372372            f[-2] = f[-3]+(f[-1]-fmon)/3.
    373373
    374         f.extend([0.,0.,0.])
     374        f.extend([0., 0., 0.])
    375375
    376376    # otherwise the sub-grid values are calculated and added to the list
     
    397397            # the monotonicity filter corrects the value at (fim1) by
    398398            # substituting (fim1) with (fmon), see Eq. (27), (28) and (29)
    399             fmon = min(3.*g[-3], \
    400                        3.*g[-2], \
    401                        np.sqrt(max(0,(18./13.*g[-3] - 5./13.*f[-7]) *
    402                                      (18./13.*g[-2] - 5./13.*f[-1]))))
     399            fmon = min(3. * g[-3],
     400                       3. * g[-2],
     401                       np.sqrt(max(0, (18. / 13. * g[-3] - 5. / 13. * f[-7]) *
     402                                   (18. / 13. * g[-2] - 5. / 13. * f[-1]))))
    403403
    404404            # recomputation of the sub-grid interval values while the
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG