Leeds-MONC / monc

MONC (Leeds fork)
BSD 3-Clause "New" or "Revised" License
5 stars 18 forks source link

MONC hack for full aerosol processing in warm clouds #52

Open eers1 opened 3 years ago

eers1 commented 3 years ago

Running MONC with CASIM in full aerosol processing (process_level=2) and warm clouds (l_warm=.true.) causes the run to fail with a segmentation fault. The error comes from number_q_fields not matching up because it tries to assign ice_mass, snow_mass and graupel_mass, even though it is warm processes only (this comes from the tendency diagnostics in the damping component). An example of the CASIM settings in MONC that provide this error, sct_trial_output.txt:

number_q_fields = 12 
option=22000
l_warm=.true.
aerosol_option=1
iopt-act=3
iopt_inuc=0
process_level=2

Note that with ice options turned on, the error doesn't happen because you are counting the ice fields in number_q_fields anyway.

Adrian Hill has added a couple of hacks to a branch taken from the head of the MOSRS trunk to work around this. The hacks do two things:

  1. prevent the tendency diagnostics (forcing l_qdiag=false)
  2. force all the CASIM process rates to be allocated

The branch is here https://code.metoffice.gov.uk/trac/monc/browser/main/branches/dev/adrianhill/r8794_aeroproc_l_warm_test and he has so far tested it on this case https://code.metoffice.gov.uk/trac/monc/browser/main/branches/dev/adrianhill/r8794_aeroproc_l_warm_test/testcases/kidtestcase/casim_testing-Cu-4-0.mcf The changes are made in the following components: casim_profile_dgs, damping, diffusion, forcing, pwadvection, simplecloud, stepfields, tvdadvection.

I have tried just adding the changes as is to my branch but it didn't compile due to the differences from the MOSRS head of trunk and our repository here. Some additional changes are required to use Adrian's hack. Since this was added to the head of the trunk, which only works with CASIM vn0.4 (r8361) and above, it might require one of these later versions of CASIM but I'm not sure.