igfuw / UWLCM

University of Warsaw Lagrangian Cloud Model
GNU General Public License v3.0
6 stars 13 forks source link

Add option to set aerosol distribution with command line arguments #116

Closed claresinger closed 4 years ago

claresinger commented 4 years ago

I want to run experiments that vary the shape/size of the initial aerosol distribution. To do this it would be very helpful to not have to recompile each time when I change e.g. mean_rd of the lognormal aerosol distribution as is the case with current master. I created a solution to this e.g. https://github.com/igfuw/UWLCM/compare/master...claresinger:aerosol_rico_newmaster. But a better solution would be to have this as an option, but still keep the default DYCOMS or RICO aerosol distribution as the default. I'm not sure how to do this. Some help would be appreciated.

pdziekan commented 4 years ago

Unelegant, but simplest method I can think of:

  1. set default values of command line arguments n/mean_rd/kappa to be negative
  2. these arguments are passed to setopts_micro (in opts_lgrngn.hpp) within the user_params struct
  3. in setopts_micro: if n/mean_rd/kappa in user_params is negative, use the default value for this case from case_ptr; else use the value from user_params
claresinger commented 4 years ago

Thanks @pdziekan. It won't be beautiful, but should be simple enough. I will start working on this next week!