Skip to content

Commit 6cec693

Browse files
Merge pull request NOAA-EMC#9 from JiliDong-NOAA/develop
sync with develop
2 parents c5e2354 + a01627f commit 6cec693

13 files changed

+821
-870
lines changed

.gitmodules

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
branch = main
55
[submodule "ccpp/physics"]
66
path = ccpp/physics
7-
url = https://github.com/NCAR/ccpp-physics
8-
branch = main
7+
url = https://github.com/ufs-community/ccpp-physics
8+
branch = ufs/dev
99
[submodule "upp"]
1010
path = upp
1111
url = https://github.com/NOAA-EMC/UPP

CMakeLists.txt

+2-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ add_subdirectory(atmos_cubed_sphere)
2525
if(INLINE_POST)
2626
set(BUILD_POSTEXEC OFF)
2727
add_subdirectory(upp)
28-
set(POST_SRC io/inline_post.F90 io/post_nems_routines.F90 io/post_fv3.F90)
29-
else()
30-
set(POST_SRC io/inline_post_stub.F90)
31-
list(APPEND _fv3atm_defs_private NO_INLINE_POST)
28+
set(POST_SRC io/post_nems_routines.F90 io/post_fv3.F90)
29+
list(APPEND _fv3atm_defs_private INLINE_POST)
3230
endif()
3331

3432
if(CCPP_32BIT)

ccpp/data/GFS_typedefs.F90

+28-2
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,9 @@ module GFS_typedefs
756756
logical :: norad_precip !< radiation precip flag for Ferrier/Moorthi
757757
logical :: lwhtr !< flag to output lw heating rate (Radtend%lwhc)
758758
logical :: swhtr !< flag to output sw heating rate (Radtend%swhc)
759+
logical :: lrseeds !< flag to use host-provided random seeds
760+
integer :: nrstreams !< number of random number streams in host-provided random seed array
761+
logical :: lextop !< flag for using an extra top layer for radiation
759762

760763
! RRTMGP
761764
logical :: do_RRTMGP !< Use RRTMGP
@@ -883,6 +886,7 @@ module GFS_typedefs
883886

884887
!--- Thompson's microphysical parameters
885888
logical :: ltaerosol !< flag for aerosol version
889+
logical :: mraerosol !< flag for merra2_aerosol_aware
886890
logical :: lradar !< flag for radar reflectivity
887891
real(kind=kind_phys) :: nsradar_reset !< seconds between resetting radar reflectivity calculation
888892
real(kind=kind_phys) :: ttendlim !< temperature tendency limiter per time step in K/s
@@ -1501,6 +1505,7 @@ module GFS_typedefs
15011505
integer, pointer :: icsdlw (:) => null() !< (rad. only) radiations. if isubcsw/isubclw (input to init)
15021506
!< (rad. only) are set to 2, the arrays contains provided
15031507
!< (rad. only) random seeds for sub-column clouds generators
1508+
integer, pointer :: rseeds (:,:) => null() !< (rad. only) random seeds provided by host
15041509

15051510
!--- In
15061511
real (kind=kind_phys), pointer :: ozpl (:,:,:) => null() !< ozone forcing data
@@ -2784,7 +2789,7 @@ subroutine coupling_create (Coupling, IM, Model)
27842789
endif
27852790

27862791
!--- needed for Thompson's aerosol option
2787-
if(Model%imp_physics == Model%imp_physics_thompson .and. Model%ltaerosol) then
2792+
if(Model%imp_physics == Model%imp_physics_thompson .and. (Model%ltaerosol .or. Model%mraerosol)) then
27882793
allocate (Coupling%nwfa2d (IM))
27892794
allocate (Coupling%nifa2d (IM))
27902795
Coupling%nwfa2d = clear_val
@@ -2984,6 +2989,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
29842989
logical :: norad_precip = .false. !< radiation precip flag for Ferrier/Moorthi
29852990
logical :: lwhtr = .true. !< flag to output lw heating rate (Radtend%lwhc)
29862991
logical :: swhtr = .true. !< flag to output sw heating rate (Radtend%swhc)
2992+
logical :: lrseeds = .false. !< flag to use host-provided random seeds
2993+
integer :: nrstreams = 2 !< number of random number streams in host-provided random seed array
2994+
logical :: lextop = .false. !< flag for using an extra top layer for radiation
29872995
! RRTMGP
29882996
logical :: do_RRTMGP = .false. !< Use RRTMGP?
29892997
character(len=128) :: active_gases = '' !< Character list of active gases used in RRTMGP
@@ -3069,6 +3077,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
30693077

30703078
!--- Thompson microphysical parameters
30713079
logical :: ltaerosol = .false. !< flag for aerosol version
3080+
logical :: mraerosol = .false. !< flag for merra2_aerosol_aware
30723081
logical :: lradar = .false. !< flag for radar reflectivity
30733082
real(kind=kind_phys) :: nsradar_reset = -999.0 !< seconds between resetting radar reflectivity calculation, set to <0 for every time step
30743083
real(kind=kind_phys) :: ttendlim = -999.0 !< temperature tendency limiter, set to <0 to deactivate
@@ -3471,7 +3480,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
34713480
use_LW_jacobian, doGP_lwscat, damp_LW_fluxadj, lfnc_k, &
34723481
lfnc_p0, iovr_convcld, doGP_sgs_cnv, doGP_sgs_mynn, &
34733482
! IN CCN forcing
3474-
iccn, &
3483+
iccn, mraerosol, &
34753484
!--- microphysical parameterizations
34763485
imp_physics, psautco, prautco, evpco, wminco, &
34773486
fprcp, pdfflag, mg_dcs, mg_qcvar, mg_ts_auto_ice, mg_rhmini, &
@@ -3877,6 +3886,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
38773886
Model%ccnorm = ccnorm
38783887
Model%lwhtr = lwhtr
38793888
Model%swhtr = swhtr
3889+
Model%lrseeds = lrseeds
3890+
Model%nrstreams = nrstreams
3891+
Model%lextop = (ltp > 0)
38803892

38813893
! RRTMGP
38823894
Model%do_RRTMGP = do_RRTMGP
@@ -4010,6 +4022,11 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
40104022

40114023
!--- Thompson MP parameters
40124024
Model%ltaerosol = ltaerosol
4025+
Model%mraerosol = mraerosol
4026+
if (Model%ltaerosol .and. Model%mraerosol) then
4027+
write(0,*) 'Logic error: Only one Thompson aerosol option can be true, either ltaerosol or mraerosol)'
4028+
stop
4029+
end if
40134030
Model%lradar = lradar
40144031
Model%nsradar_reset = nsradar_reset
40154032
Model%ttendlim = ttendlim
@@ -5297,6 +5314,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
52975314
end if
52985315
if (Model%me == Model%master) print *,' Using Thompson double moment microphysics', &
52995316
' ltaerosol = ',Model%ltaerosol, &
5317+
' mraerosol = ',Model%mraerosol, &
53005318
' ttendlim =',Model%ttendlim, &
53015319
' ext_diag_thompson =',Model%ext_diag_thompson, &
53025320
' dt_inner =',Model%dt_inner, &
@@ -5756,6 +5774,9 @@ subroutine control_print(Model)
57565774
print *, ' norad_precip : ', Model%norad_precip
57575775
print *, ' lwhtr : ', Model%lwhtr
57585776
print *, ' swhtr : ', Model%swhtr
5777+
print *, ' lrseeds : ', Model%lrseeds
5778+
print *, ' nrstreams : ', Model%nrstreams
5779+
print *, ' lextop : ', Model%lextop
57595780
if (Model%do_RRTMGP) then
57605781
print *, ' rrtmgp_nrghice : ', Model%rrtmgp_nrghice
57615782
print *, ' do_GPsw_Glw : ', Model%do_GPsw_Glw
@@ -5798,6 +5819,7 @@ subroutine control_print(Model)
57985819
if (Model%imp_physics == Model%imp_physics_wsm6 .or. Model%imp_physics == Model%imp_physics_thompson) then
57995820
print *, ' Thompson microphysical parameters'
58005821
print *, ' ltaerosol : ', Model%ltaerosol
5822+
print *, ' mraerosol : ', Model%mraerosol
58015823
print *, ' lradar : ', Model%lradar
58025824
print *, ' nsradar_reset : ', Model%nsradar_reset
58035825
print *, ' lrefres : ', Model%lrefres
@@ -6246,6 +6268,10 @@ subroutine tbd_create (Tbd, IM, Model)
62466268
allocate (Tbd%icsdlw (IM))
62476269
Tbd%icsdsw = zero
62486270
Tbd%icsdlw = zero
6271+
if (Model%lrseeds) then
6272+
allocate (Tbd%rseeds(IM,Model%nrstreams))
6273+
Tbd%rseeds = zero
6274+
endif
62496275
endif
62506276

62516277
!--- DFI radar forcing

ccpp/data/GFS_typedefs.meta

+32-1
Original file line numberDiff line numberDiff line change
@@ -3279,6 +3279,24 @@
32793279
units = flag
32803280
dimensions = ()
32813281
type = logical
3282+
[lrseeds]
3283+
standard_name = do_host_provided_random_seeds
3284+
long_name = flag to use host-provided random seeds
3285+
units = flag
3286+
dimensions = ()
3287+
type = logical
3288+
[nrstreams]
3289+
standard_name = number_of_host_provided_random_number_streams
3290+
long_name = number of host-provided random number streams
3291+
units = count
3292+
dimensions = ()
3293+
type = integer
3294+
[lextop]
3295+
standard_name = do_extra_top_layer_for_radiation
3296+
long_name = use an extra top layer for radiation
3297+
units = flag
3298+
dimensions = ()
3299+
type = logical
32823300
[active_gases]
32833301
standard_name = active_gases_used_by_RRTMGP
32843302
long_name = active gases used by RRTMGP
@@ -4024,6 +4042,12 @@
40244042
units = flag
40254043
dimensions = ()
40264044
type = logical
4045+
[mraerosol]
4046+
standard_name = do_merra2_aerosol_awareness
4047+
long_name = flag for merra2 aerosol-aware physics for example the thompson microphysics
4048+
units = flag
4049+
dimensions = ()
4050+
type = logical
40274051
[lradar]
40284052
standard_name = flag_for_radar_reflectivity
40294053
long_name = flag for radar reflectivity
@@ -6623,6 +6647,13 @@
66236647
dimensions = (horizontal_loop_extent)
66246648
type = integer
66256649
active = (flag_for_lw_clouds_sub_grid_approximation == 2 .or. flag_for_sw_clouds_grid_approximation == 2)
6650+
[rseeds]
6651+
standard_name = random_number_seeds_from_host
6652+
long_name = random number seeds from host
6653+
units = none
6654+
dimensions = (horizontal_loop_extent, number_of_host_provided_random_number_streams)
6655+
type = integer
6656+
active = ((flag_for_lw_clouds_sub_grid_approximation == 2 .or. flag_for_sw_clouds_grid_approximation == 2) .and. do_host_provided_random_seeds)
66266657
[tau_amf]
66276658
standard_name = absolute_momentum_flux_due_to_nonorographic_gravity_wave_drag
66286659
long_name = ngw_absolute_momentum_flux
@@ -8637,7 +8668,7 @@
86378668
[LTP]
86388669
standard_name = extra_top_layer
86398670
long_name = extra top layer for radiation
8640-
units = none
8671+
units = count
86418672
dimensions = ()
86428673
type = integer
86438674
[con_cliq]

ccpp/driver/GFS_diagnostics.F90

+66-40
Original file line numberDiff line numberDiff line change
@@ -3472,51 +3472,77 @@ subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop
34723472

34733473
!--------------------------aerosols
34743474
if (Model%ntwa>0) then
3475-
idx = idx + 1
3476-
ExtDiag(idx)%axes = 3
3477-
ExtDiag(idx)%name = 'nwfa'
3478-
ExtDiag(idx)%desc = 'number concentration of water-friendly aerosols'
3479-
ExtDiag(idx)%unit = 'kg-1'
3480-
ExtDiag(idx)%mod_name = 'gfs_phys'
3481-
allocate (ExtDiag(idx)%data(nblks))
3482-
do nb = 1,nblks
3483-
ExtDiag(idx)%data(nb)%var3 => Statein(nb)%qgrs(:,:,Model%ntwa)
3484-
enddo
3475+
if (Model%ltaerosol) then
3476+
idx = idx + 1
3477+
ExtDiag(idx)%axes = 3
3478+
ExtDiag(idx)%name = 'nwfa'
3479+
ExtDiag(idx)%desc = 'number concentration of water-friendly aerosols'
3480+
ExtDiag(idx)%unit = 'kg-1'
3481+
ExtDiag(idx)%mod_name = 'gfs_phys'
3482+
allocate (ExtDiag(idx)%data(nblks))
3483+
do nb = 1,nblks
3484+
ExtDiag(idx)%data(nb)%var3 => Statein(nb)%qgrs(:,:,Model%ntwa)
3485+
enddo
34853486

3486-
idx = idx + 1
3487-
ExtDiag(idx)%axes = 2
3488-
ExtDiag(idx)%name = 'nwfa2d'
3489-
ExtDiag(idx)%desc = 'water-friendly surface aerosol source'
3490-
ExtDiag(idx)%unit = 'kg-1 s-1'
3491-
ExtDiag(idx)%mod_name = 'gfs_sfc'
3492-
allocate (ExtDiag(idx)%data(nblks))
3493-
do nb = 1,nblks
3494-
ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%nwfa2d
3495-
enddo
3487+
idx = idx + 1
3488+
ExtDiag(idx)%axes = 2
3489+
ExtDiag(idx)%name = 'nwfa2d'
3490+
ExtDiag(idx)%desc = 'water-friendly surface aerosol source'
3491+
ExtDiag(idx)%unit = 'kg-1 s-1'
3492+
ExtDiag(idx)%mod_name = 'gfs_sfc'
3493+
allocate (ExtDiag(idx)%data(nblks))
3494+
do nb = 1,nblks
3495+
ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%nwfa2d
3496+
enddo
3497+
elseif (Model%mraerosol) then
3498+
idx = idx + 1
3499+
ExtDiag(idx)%axes = 3
3500+
ExtDiag(idx)%name = 'nwfa'
3501+
ExtDiag(idx)%desc = 'number concentration of water-friendly aerosols'
3502+
ExtDiag(idx)%unit = 'kg-1'
3503+
ExtDiag(idx)%mod_name = 'gfs_phys'
3504+
allocate (ExtDiag(idx)%data(nblks))
3505+
do nb = 1,nblks
3506+
ExtDiag(idx)%data(nb)%var3 => Stateout(nb)%gq0(:,:,Model%ntwa)
3507+
enddo
3508+
endif
34963509
endif
34973510

34983511
if (Model%ntia>0) then
3499-
idx = idx + 1
3500-
ExtDiag(idx)%axes = 3
3501-
ExtDiag(idx)%name = 'nifa'
3502-
ExtDiag(idx)%desc = 'number concentration of ice-friendly aerosols'
3503-
ExtDiag(idx)%unit = 'kg-1'
3504-
ExtDiag(idx)%mod_name = 'gfs_phys'
3505-
allocate (ExtDiag(idx)%data(nblks))
3506-
do nb = 1,nblks
3507-
ExtDiag(idx)%data(nb)%var3 => Statein(nb)%qgrs(:,:,Model%ntia)
3508-
enddo
3512+
if (Model%ltaerosol) then
3513+
idx = idx + 1
3514+
ExtDiag(idx)%axes = 3
3515+
ExtDiag(idx)%name = 'nifa'
3516+
ExtDiag(idx)%desc = 'number concentration of ice-friendly aerosols'
3517+
ExtDiag(idx)%unit = 'kg-1'
3518+
ExtDiag(idx)%mod_name = 'gfs_phys'
3519+
allocate (ExtDiag(idx)%data(nblks))
3520+
do nb = 1,nblks
3521+
ExtDiag(idx)%data(nb)%var3 => Statein(nb)%qgrs(:,:,Model%ntia)
3522+
enddo
35093523

3510-
idx = idx + 1
3511-
ExtDiag(idx)%axes = 2
3512-
ExtDiag(idx)%name = 'nifa2d'
3513-
ExtDiag(idx)%desc = 'ice-friendly surface aerosol source'
3514-
ExtDiag(idx)%unit = 'kg-1 s-1'
3515-
ExtDiag(idx)%mod_name = 'gfs_sfc'
3516-
allocate (ExtDiag(idx)%data(nblks))
3517-
do nb = 1,nblks
3518-
ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%nifa2d
3519-
enddo
3524+
idx = idx + 1
3525+
ExtDiag(idx)%axes = 2
3526+
ExtDiag(idx)%name = 'nifa2d'
3527+
ExtDiag(idx)%desc = 'ice-friendly surface aerosol source'
3528+
ExtDiag(idx)%unit = 'kg-1 s-1'
3529+
ExtDiag(idx)%mod_name = 'gfs_sfc'
3530+
allocate (ExtDiag(idx)%data(nblks))
3531+
do nb = 1,nblks
3532+
ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%nifa2d
3533+
enddo
3534+
else if (Model%mraerosol) then
3535+
idx = idx + 1
3536+
ExtDiag(idx)%axes = 3
3537+
ExtDiag(idx)%name = 'nifa'
3538+
ExtDiag(idx)%desc = 'number concentration of ice-friendly aerosols'
3539+
ExtDiag(idx)%unit = 'kg-1'
3540+
ExtDiag(idx)%mod_name = 'gfs_phys'
3541+
allocate (ExtDiag(idx)%data(nblks))
3542+
do nb = 1,nblks
3543+
ExtDiag(idx)%data(nb)%var3 => Stateout(nb)%gq0(:,:,Model%ntia)
3544+
enddo
3545+
end if
35203546
endif
35213547

35223548
! Extended diagnostics from Thompson MP

0 commit comments

Comments
 (0)