Here is an outline for adding dcs to the namelist in cesm1_2_2 code.
1) The namelist definition file must be
modified (bld/namelist_files/namelist_definition.xml). The new
variable should be added near the other micro_mg_*
variables (around line 1541). The entry could be:
Autoconversion size threshold
Default: 400.e-6
This gives the new variable the name micro_mg_dcs. That's the
name you'll add to user_nl_cam.
2) The namelist is read by micro_mg_cam_readnl (in micro_mg_cam.F90).
A declaration for micro_mg_dcs needs to be added there around line 51,
e.g.,
real(r8) :: micro_mg_dcs=400.e-6_r8
Note that by initializing micro_mg_dcs to 400.e-6_r8 this value will
be used as the default if the user does not override this by
setting a value in user_nl_cam.
3) micro_mg_dcs needs to be added to the namelist declaration in
micro_mg_cam_readnl (around line 157), e.g.,
namelist /micro_mg_nl/ micro_mg_version, micro_mg_sub_version, &
micro_mg_do_cldice, micro_mg_do_cldliq, micro_mg_dcs
4) After the namelist is read there needs to be an mpibcast
statement so that all tasks get the value. This is in
micro_mg_cam_readnl after line 200, e.g.,
call mpibcast(micro_mg_dcs, 1, mpir8, 0, mpicom)
After this call is executed the module data for micro_mg_dcs will have been
been set in all tasks.
5) The call to the micro_mg1_0 version of micro_mg_init is made
from micro_mg1_0_init_intr. The value of micro_mg_dcs needs to be
passed through this interface. For example line 689 should look like
rhmini, micro_mg_dcs, errstring)
6) Now go to the micro_mg_init subroutine in micro_mg1_0.F90 and add the
dummy argument for dcs, e.g., line 150 should read
rhmini_in, dcs_in, errstring)
And add the corresponding declaration for the new argument near line 170:
real(r8), intent(in) :: dcs_in
7) Finally at line 277 the hardcoded value of dcs is replaced by
Dcs = dcs_in