Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UFS-dev PR#110 #125

Merged
merged 4 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions ccpp/data/CCPP_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1057,11 +1057,12 @@ subroutine gfs_interstitial_setup_tracers(Interstitial, Model)
tracers = 2
do n=2,Model%ntrac
ltest = ( n /= Model%ntcw .and. n /= Model%ntiw .and. n /= Model%ntclamt .and. &
n /= Model%ntrw .and. n /= Model%ntsw .and. n /= Model%ntrnc .and. &
n /= Model%ntsnc .and. n /= Model%ntgl .and. n /= Model%ntgnc .and. &
n /= Model%nthl .and. n /= Model%nthnc .and. n /= Model%ntgv .and. &
n /= Model%nthv .and. n /= Model%ntccn .and. n /= Model%ntccna .and. &
n /= Model%ntsigma)
n /= Model%ntrw .and. n /= Model%ntsw .and. n /= Model%ntrnc .and. &
n /= Model%ntsnc .and. n /= Model%ntgl .and. n /= Model%ntgnc .and. &
n /= Model%nthl .and. n /= Model%nthnc .and. n /= Model%ntgv .and. &
n /= Model%nthv .and. n /= Model%ntccn .and. n /= Model%ntccna .and. &
n /= Model%ntrz .and. n /= Model%ntgz .and. n /= Model%nthz .and. &
n /= Model%ntsigma)
Interstitial%otsptflag(n) = ltest
if ( ltest ) then
tracers = tracers + 1
Expand Down
42 changes: 38 additions & 4 deletions ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,7 @@ module GFS_typedefs
logical :: nssl_hail_on !< NSSL flag to activate the hail category
logical :: nssl_ccn_on !< NSSL flag to activate the CCN category
logical :: nssl_invertccn !< NSSL flag to treat CCN as activated (true) or unactivated (false)
logical :: nssl_3moment !< NSSL flag to turn on 3-moment for rain/graupel/hail

!--- Thompson's microphysical parameters
logical :: ltaerosol !< flag for aerosol version
Expand Down Expand Up @@ -1426,6 +1427,9 @@ module GFS_typedefs
integer :: ntccna !< tracer index for activated CCN
integer :: ntgv !< tracer index for graupel particle volume
integer :: nthv !< tracer index for hail particle volume
integer :: ntrz !< tracer index for rain reflectivity
integer :: ntgz !< tracer index for graupel reflectivity
integer :: nthz !< tracer index for hail reflectivity
integer :: ntke !< tracer index for kinetic energy
integer :: ntsigma !< tracer index for updraft area fraction
integer :: nto !< tracer index for oxygen ion
Expand Down Expand Up @@ -3428,6 +3432,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
logical :: nssl_hail_on = .false. !< NSSL flag to activate the hail category
logical :: nssl_ccn_on = .true. !< NSSL flag to activate the CCN category
logical :: nssl_invertccn = .true. !< NSSL flag to treat CCN as activated (true) or unactivated (false)
logical :: nssl_3moment = .false. !< NSSL flag to turn on 3-moment for rain/graupel/hail

!--- Thompson microphysical parameters
logical :: ltaerosol = .false. !< flag for aerosol version
Expand Down Expand Up @@ -3850,7 +3855,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &

!--- aerosol scavenging factors
integer, parameter :: max_scav_factors = 183
character(len=40) :: fscav_aero(max_scav_factors)
character(len=40) :: fscav_aero(max_scav_factors) = ''

real(kind=kind_phys) :: radar_tten_limits(2) = (/ limit_unspecified, limit_unspecified /)
integer :: itime
Expand Down Expand Up @@ -3902,8 +3907,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
ext_diag_thompson, dt_inner, lgfdlmprad, &
sedi_semi, decfl, &
nssl_cccn, nssl_alphah, nssl_alphahl, &
nssl_alphar, nssl_ehw0, nssl_ehlw0, &
nssl_invertccn, nssl_hail_on, nssl_ccn_on, &
nssl_alphar, nssl_ehw0, nssl_ehlw0, &
nssl_invertccn, nssl_hail_on, nssl_ccn_on, nssl_3moment, &
!--- max hourly
avg_max_length, &
!--- land/surface model control
Expand Down Expand Up @@ -4512,6 +4517,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%nssl_hail_on = nssl_hail_on
Model%nssl_ccn_on = nssl_ccn_on
Model%nssl_invertccn = nssl_invertccn
Model%nssl_3moment = nssl_3moment

!--- Thompson MP parameters
Model%ltaerosol = ltaerosol
Expand Down Expand Up @@ -5013,6 +5019,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%ntccna = get_tracer_index(Model%tracer_names, 'ccna_nc', Model%me, Model%master, Model%debug)
Model%ntgv = get_tracer_index(Model%tracer_names, 'graupel_vol',Model%me, Model%master, Model%debug)
Model%nthv = get_tracer_index(Model%tracer_names, 'hail_vol', Model%me, Model%master, Model%debug)
Model%ntrz = get_tracer_index(Model%tracer_names, 'rain_ref', Model%me, Model%master, Model%debug)
Model%ntgz = get_tracer_index(Model%tracer_names, 'graupel_ref',Model%me, Model%master, Model%debug)
Model%nthz = get_tracer_index(Model%tracer_names, 'hail_ref', Model%me, Model%master, Model%debug)
Model%ntke = get_tracer_index(Model%tracer_names, 'sgs_tke', Model%me, Model%master, Model%debug)
Model%ntsigma = get_tracer_index(Model%tracer_names, 'sigmab', Model%me, Model%master, Model%debug)
Model%nqrimef = get_tracer_index(Model%tracer_names, 'q_rimef', Model%me, Model%master, Model%debug)
Expand Down Expand Up @@ -5194,6 +5203,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
call label_dtend_tracer(Model,100+Model%ntccn,'ccn_nc','CCN number concentration','kg-1 s-1')
call label_dtend_tracer(Model,100+Model%ntgv,'graupel_vol','graupel volume','m3 kg-1 s-1')
call label_dtend_tracer(Model,100+Model%nthv,'hail_vol','hail volume','m3 kg-1 s-1')
call label_dtend_tracer(Model,100+Model%ntrz,'rain_ref','rain reflectivity','m3 kg-1 s-1')
call label_dtend_tracer(Model,100+Model%ntgz,'graupel_ref','graupel reflectivity','m3 kg-1 s-1')
call label_dtend_tracer(Model,100+Model%nthz,'hail_ref','hail reflectivity','m3 kg-1 s-1')
call label_dtend_tracer(Model,100+Model%ntke,'sgs_tke','turbulent kinetic energy','J s-1')
call label_dtend_tracer(Model,100+Model%nqrimef,'q_rimef','mass weighted rime factor','kg-1 s-1')
call label_dtend_tracer(Model,100+Model%ntwa,'liq_aero','number concentration of water-friendly aerosols','kg-1 s-1')
Expand Down Expand Up @@ -5262,7 +5274,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
itrac /= Model%ntrw .and. itrac /= Model%ntsw .and. itrac /= Model%ntrnc .and. &
itrac /= Model%ntsnc .and. itrac /= Model%ntgl .and. itrac /= Model%ntgnc .and. &
itrac /= Model%nthl .and. itrac /= Model%nthnc .and. itrac /= Model%nthv .and. &
itrac /= Model%ntgv ) then
itrac /= Model%ntgv .and. itrac /= Model%ntrz .and. itrac /= Model%ntgz .and. &
itrac /= Model%nthz ) then
call fill_dtidx(Model,dtend_select,100+itrac,Model%index_of_process_scnv,have_scnv)
call fill_dtidx(Model,dtend_select,100+itrac,Model%index_of_process_dcnv,have_dcnv)
else if(Model%ntchs<=0 .or. itrac<Model%ntchs) then
Expand Down Expand Up @@ -5395,6 +5408,24 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
write(*,*) 'NSSL micro: CCN is ON'
ENDIF
ENDIF

! add checks for nssl_3moment
IF ( ( Model%nssl_3moment ) ) THEN
IF ( Model%ntrz < 1 ) THEN
write(*,*) 'NSSL micro: 3-moment is ON, but rain_ref tracer is missing'
stop
ENDIF
IF ( Model%ntgz < 1 ) THEN
write(*,*) 'NSSL micro: 3-moment is ON, but graupel_ref tracer is missing'
stop
ENDIF
IF ( nssl_hail_on ) THEN
IF ( Model%nthz < 1 ) THEN
write(*,*) 'NSSL micro: 3-moment is ON, but hail_ref tracer is missing'
stop
ENDIF
ENDIF
ENDIF

IF ( Model%ntgl < 1 .or. Model%ntgv < 1 .or. Model%ntgnc < 1 .or. &
Model%ntsw < 1 .or. Model%ntsnc < 1 .or. &
Expand Down Expand Up @@ -6748,6 +6779,9 @@ subroutine control_print(Model)
print *, ' ntccna : ', Model%ntccna
print *, ' ntgv : ', Model%ntgv
print *, ' nthv : ', Model%nthv
print *, ' ntrz : ', Model%ntrz
print *, ' ntgz : ', Model%ntgz
print *, ' nthz : ', Model%nthz
print *, ' ntke : ', Model%ntke
print *, ' ntsigma : ', Model%ntsigma
print *, ' nto : ', Model%nto
Expand Down
72 changes: 72 additions & 0 deletions ccpp/data/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,30 @@
type = real
kind = kind_phys
active = (index_of_mass_number_concentration_of_hail_in_tracer_concentration_array > 0)
[qgrs(:,:,index_of_reflectivity_of_rain_in_tracer_concentration_array)]
standard_name = reflectivity_of_rain_in_air
long_name = reflectivity of rain
units = m6 kg-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (index_of_reflectivity_of_rain_in_tracer_concentration_array > 0)
[qgrs(:,:,index_of_reflectivity_of_graupel_in_tracer_concentration_array)]
standard_name = reflectivity_of_graupel_in_air
long_name = reflectivity of graupel
units = m6 kg-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (index_of_reflectivity_of_graupel_in_tracer_concentration_array > 0)
[qgrs(:,:,index_of_reflectivity_of_hail_in_tracer_concentration_array)]
standard_name = reflectivity_of_hail_in_air
long_name = reflectivity of hail
units = m6 kg-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (index_of_reflectivity_of_hail_in_tracer_concentration_array > 0)
[qgrs(:,:,index_of_cloud_condensation_nuclei_number_concentration_in_tracer_concentration_array)]
standard_name = cloud_condensation_nuclei_number_concentration
long_name = number concentration of cloud condensation nuclei
Expand Down Expand Up @@ -568,6 +592,30 @@
type = real
kind = kind_phys
active = ( index_of_hail_volume_in_tracer_concentration_array > 0 )
[gq0(:,:,index_of_reflectivity_of_rain_in_tracer_concentration_array)]
standard_name = reflectivity_of_rain_of_new_state
long_name = reflectivity of rain updated by physics
units = m6 kg-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = ( index_of_reflectivity_of_rain_in_tracer_concentration_array > 0 )
[gq0(:,:,index_of_reflectivity_of_graupel_in_tracer_concentration_array)]
standard_name = reflectivity_of_graupel_of_new_state
long_name = reflectivity of graupel updated by physics
units = m6 kg-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = ( index_of_reflectivity_of_graupel_in_tracer_concentration_array > 0 )
[gq0(:,:,index_of_reflectivity_of_hail_in_tracer_concentration_array)]
standard_name = reflectivity_of_hail_of_new_state
long_name = reflectivity of hail updated by physics
units = m6 kg-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = ( index_of_reflectivity_of_hail_in_tracer_concentration_array > 0 )
[gq0(:,:,index_of_cloud_area_fraction_in_atmosphere_layer_in_tracer_concentration_array)]
standard_name = cloud_area_fraction_in_atmosphere_layer_of_new_state
long_name = cloud fraction updated by physics
Expand Down Expand Up @@ -4312,6 +4360,12 @@
units = flag
dimensions = ()
type = logical
[nssl_3moment]
standard_name = nssl_3moment
long_name = 3-moment activation flag in NSSL microphysics scheme
units = flag
dimensions = ()
type = logical
[tf]
standard_name = all_ice_cloud_threshold_temperature
long_name = threshold temperature below which all cloud is ice
Expand Down Expand Up @@ -6137,6 +6191,24 @@
units = index
dimensions = ()
type = integer
[ntrz]
standard_name = index_of_reflectivity_of_rain_in_tracer_concentration_array
long_name = tracer index for rain reflectivity
units = index
dimensions = ()
type = integer
[ntgz]
standard_name = index_of_reflectivity_of_graupel_in_tracer_concentration_array
long_name = tracer index for graupel reflectivity
units = index
dimensions = ()
type = integer
[nthz]
standard_name = index_of_reflectivity_of_hail_in_tracer_concentration_array
long_name = tracer index for hail reflectivity
units = index
dimensions = ()
type = integer
[ntke]
standard_name = index_of_turbulent_kinetic_energy_in_tracer_concentration_array
long_name = tracer index for turbulent kinetic energy
Expand Down