CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
module_mp_tempo_cfgs.F90
2 !! tempo configs
3
4 implicit none
5 private
6
8
12
13 ! tempo configuration flags for init
14 type :: ty_tempo_cfgs
15 logical :: aerosolaware_flag = .true. !! flag to run aerosol-aware microphysics
16 logical :: hailaware_flag = .true. !! flag to run hail-aware microphysics
17 logical :: ml_for_bl_nc_flag = .false. !! flag to run machine-learning prediction for subgrid cloud number concentration
18 logical :: ml_for_nc_flag = .false. !! flag to run machine-learning prediction for tempo cloud number concentration
19 logical :: semi_sedi_flag = .false. !! flag for semi-lagrangian sedimentation
20 logical :: refl10cm_from_melting_flag = .false. !! flag to calculate reflectivity for melting snow and graupel
21 logical :: turn_off_micro_flag = .false. !! flag to turn off all microphysical processes
22 logical :: cloud_condensation_flag = .true. !! flag to control cloud condensation
23 logical :: verbose = .false. !! flag to turn on verbose print statements
24 logical :: check_tables = .false. !! flag to turn on check for lookup tables
25 character(len=32) :: single_moment_nc_opt = 'land' !! option for single moment cloud number concentration when land input is not present (options include 'land' that uses the parameter nt_c_l, 'ocean' that uses nt_c_o, or string value in m^-3, e.g. '10.e6')
26 ! flags to turn on/off diagnostic output
27 logical :: refl10cm_flag = .true. !! flag to output 10cm reflectivity
28 logical :: re_cloud_flag = .true. !! flag to output cloud effective radius
29 logical :: re_ice_flag = .true. !! flag to output ice effective radius
30 logical :: re_snow_flag = .true. !! flag to output snow effective radius
31 logical :: max_hail_diameter_flag = .true. !! flag to output maximum hail diameter
32 logical :: rain_med_vol_diam_flag = .false. !! flag to output median volume diameter for rain
33 logical :: graupel_med_vol_diam_flag = .false. !! flag to output median volume diameter for graupel
34 logical :: cloud_number_mixing_ratio_flag = .false. !! flag to output cloud number mixing ratio
35
36 contains
37 procedure :: get_nc_val => resolve_nc_value
38 end type
39
40 ! tempo lookup table filenames
42 character(len=100) :: ccn_table_name = 'ccn_activate.bin' !! ccn table name
43 character(len=100) :: qrqg_table_name = 'qr_acr_qg_data_tempo_v3' !! rain-graupel collection table name
44 character(len=100) :: qrqs_table_name = 'qr_acr_qs_data_tempo_v3' !! rain-snow collection table name
45 character(len=100) :: freezewater_table_name = 'freeze_water_data_tempo_v3' !! freeze water collection table name
46 end type
47
48 contains
49
50 real function resolve_nc_value(this, val_land, val_ocean)
51 !! resolve the cloud number concentration value based on the input option
52
53 class(ty_tempo_cfgs), intent(in) :: this
54 real, intent(in) :: val_land, val_ocean
55 integer :: read_status
56
57 select case (trim(adjustl(this%single_moment_nc_opt)))
58 case ('land')
59 resolve_nc_value = val_land
60 case ('ocean')
61 resolve_nc_value = val_ocean
62 case default
63 ! try to extract a real number from the string
64 read(this%single_moment_nc_opt, *, iostat=read_status) resolve_nc_value
65
66 ! catch typos
67 if (read_status /= 0) then
68 resolve_nc_value = val_land
69 ! write(*,*) "invalid input: ", trim(this%single_moment_nc_opt)
70 ! error stop "config error: single_moment_nc_opt must be 'land', 'ocean', or a number."
71 end if
72 end select
73 end function resolve_nc_value
74
75end module module_mp_tempo_cfgs