optional variables in mp_thompson_run

Submitted by Anning.Cheng on Mon, 08/30/2021 - 12:46

HI, there:

Do you have any idea on how to control the optional variables in mp_thompson_run? The reason I am asking is that I would like to call mp_thompson_run with a set of optional variables, so that mp_thompson_run can detect them and call a new module. 

Thank you,

Anning

Hi Anning,

glad you are asking. Support for optional arguments will be dropped entirely from CCPP framework, which means that the CCPP entry points (e.g. mp_thompson_run) will no longer accept optional arguments. There are many good reasons for this. You can control what Thompson MP is supposed to do by using logicals and assumed-size array declarations. For example, use
 

logical, intent(in) :: use_merra2
real(kind_phys), dimension(:,:), intent(in) :: some_merra2_aerosol_data

and then only access some_merra2_aerosol_data if use_merra2 is .true.

Hope this helps.

HI, Dom:

Good to know.   But It might take some time to happen. I need to work on the old code to test.

I need to input nifa and nwfa, not nifa2d and nwfa2d. When ltaerosol is set to false, all those variables are gone. mp_thompson_run is called in cap. Do you know where can I turn on input nifa and nwfa at this situation.

Thank you!

Anning

They are always "on" = present in the sense of an optional argument. This is hardwired in ccpp_prebuild_config.py, and you can't change it. The choice you have is to allocate them or not, based on some runtime flags. If you just want to fill nwfa and nifa, but have zero emissions (nwfa2d and nifa2d - the latter is zero all the time anyway), then the easiest would be to use the existing ltaerosol flag and add one additional flag that sets nwfa2d = 0 instead of what it is doing now.

The Thompson init phase will accept whatever aerosol distribution you give it when ltaerosol is true, it will only use default profiles if nwfa and nifa are zero everywhere.