Skip to content

Commit

Permalink
Merge pull request #137 from SamuelTrahanNOAA/merge_gsl_develop_to_RR…
Browse files Browse the repository at this point in the history
…FS_dev-20220314

Merge gsl/develop to RRFS_dev
  • Loading branch information
SamuelTrahanNOAA authored Mar 15, 2022
2 parents cb33319 + d8db18b commit f0d6dcc
Show file tree
Hide file tree
Showing 158 changed files with 2,743 additions and 3,915 deletions.
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ set(SCHEMES_OPENMP_OFF ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/mo_
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/mo_rrtmgp_constants.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/mo_rrtmgp_util_reorder.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/mo_gas_concentrations.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/kernels-openacc/mo_gas_optics_kernels.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/mo_rrtmgp_util_string.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/kernels/mo_gas_optics_kernels.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/kernels/mo_rrtmgp_util_reorder_kernels.F90
Expand Down Expand Up @@ -108,8 +107,6 @@ set(SCHEMES_OPENMP_OFF ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/mo_
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/mo_rte_sw.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/mo_fluxes.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/mo_rte_lw.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/kernels-openacc/mo_rte_solver_kernels.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/kernels-openacc/mo_optical_props_kernels.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/mo_rte_util_array.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/kernels/mo_rte_solver_kernels.F90
${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/kernels/mo_optical_props_kernels.F90
Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# These owners will be the default owners for everything in the repo.
#* @defunkt
* @SamuelTrahanNOAA @DomHeinzeller
* @SamuelTrahanNOAA @tanyasmirnova @christinaholtNOAA @joeolson42 @hannahcbarnes @mdtoyNOAA @haiqinli @zhanglikate

# Order is important. The last matching pattern has the most precedence.
# So if a pull request only touches javascript files, only these owners
Expand Down
12 changes: 6 additions & 6 deletions physics/GFS_DCNV_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@
kind = len=*
intent = out
[errflg]
standard_name = ccpp_error_flag
long_name = error flag for error handling in CCPP
units = flag
standard_name = ccpp_error_code
long_name = error code for error handling in CCPP
units = 1
dimensions = ()
type = integer
intent = out
Expand Down Expand Up @@ -708,9 +708,9 @@
kind = len=*
intent = out
[errflg]
standard_name = ccpp_error_flag
long_name = error flag for error handling in CCPP
units = flag
standard_name = ccpp_error_code
long_name = error code for error handling in CCPP
units = 1
dimensions = ()
type = integer
intent = out
12 changes: 6 additions & 6 deletions physics/GFS_GWD_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@
kind = len=*
intent = out
[errflg]
standard_name = ccpp_error_flag
long_name = error flag for error handling in CCPP
units = flag
standard_name = ccpp_error_code
long_name = error code for error handling in CCPP
units = 1
dimensions = ()
type = integer
intent = out
Expand Down Expand Up @@ -383,9 +383,9 @@
kind = len=*
intent = out
[errflg]
standard_name = ccpp_error_flag
long_name = error flag for error handling in CCPP
units = flag
standard_name = ccpp_error_code
long_name = error code for error handling in CCPP
units = 1
dimensions = ()
type = integer
intent = out
76 changes: 66 additions & 10 deletions physics/GFS_MP_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ end subroutine GFS_MP_generic_pre_init
!! \htmlinclude GFS_MP_generic_pre_run.html
!!
subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl, &
ntrac, gt0, gq0, save_t, save_q, errmsg, errflg)
ntrac, gt0, gq0, save_t, save_q, num_dfi_radar, errmsg, errflg)
!
use machine, only: kind_phys

implicit none
integer, intent(in) :: im, levs, ntcw, nncl, ntrac
integer, intent(in) :: im, levs, ntcw, nncl, ntrac, num_dfi_radar
logical, intent(in) :: ldiag3d, qdiag3d, do_aw
real(kind=kind_phys), dimension(:,:), intent(in) :: gt0
real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0
Expand All @@ -35,12 +35,14 @@ subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl,
errmsg = ''
errflg = 0

if (ldiag3d .or. do_aw) then
if (ldiag3d .or. do_aw .or. num_dfi_radar>0) then
do k=1,levs
do i=1,im
save_t(i,k) = gt0(i,k)
enddo
enddo
endif
if (ldiag3d .or. do_aw) then
if(qdiag3d) then
do n=1,ntrac
do k=1,levs
Expand Down Expand Up @@ -91,28 +93,36 @@ subroutine GFS_MP_generic_post_run(
graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp, totprcp, totice, &
totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, pwat, &
drain_cpl, dsnow_cpl, lsm, lsm_ruc, lsm_noahmp, raincprv, rainncprv, iceprv, snowprv, &
graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, &
dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d, lssav, &
errmsg, errflg)
graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, dfi_radar_max_intervals, &
dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d, lssav, num_dfi_radar, fh_dfi_radar, &
index_of_process_dfi_radar, ix_dfi_radar, dfi_radar_tten, radar_tten_limits, fhour, errmsg, errflg)
!
use machine, only: kind_phys

implicit none

integer, intent(in) :: im, levs, kdt, nrcm, nncl, ntcw, ntrac
integer, intent(in) :: im, levs, kdt, nrcm, nncl, ntcw, ntrac, num_dfi_radar, index_of_process_dfi_radar
integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires
logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm
integer, intent(in) :: index_of_temperature,index_of_process_mp

integer :: dfi_radar_max_intervals
real(kind=kind_phys), intent(in) :: fh_dfi_radar(:), fhour
real(kind=kind_phys), intent(in) :: radar_tten_limits(:)
integer :: ix_dfi_radar(:)
real(kind=kind_phys), dimension(:,:), intent(inout) :: gt0

real(kind=kind_phys), intent(in) :: dtf, frain, con_g, rainmin
real(kind=kind_phys), dimension(:), intent(in) :: rain1, xlat, xlon, tsfc
real(kind=kind_phys), dimension(:), intent(inout) :: ice, snow, graupel, rainc
real(kind=kind_phys), dimension(:), intent(in) :: rain0, ice0, snow0, graupel0
real(kind=kind_phys), dimension(:,:), intent(in) :: rann
real(kind=kind_phys), dimension(:,:), intent(in) :: gt0, prsl, save_t, del
real(kind=kind_phys), dimension(:,:), intent(in) :: prsl, save_t, del
real(kind=kind_phys), dimension(:,:), intent(in) :: prsi, phii
real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0, save_q

real(kind=kind_phys), dimension(:,:,:), intent(in) :: dfi_radar_tten

real(kind=kind_phys), dimension(:), intent(in ) :: sr
real(kind=kind_phys), dimension(:), intent(inout) :: rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, &
srflag, cnvprcp, totprcp, totice, totsnw, totgrp, cnvprcpb, &
Expand Down Expand Up @@ -150,10 +160,10 @@ subroutine GFS_MP_generic_post_run(
real(kind=kind_phys), parameter :: p850 = 85000.0_kind_phys
! *DH

integer :: i, k, ic, itrac, idtend
integer :: i, k, ic, itrac, idtend, itime, idtend_radar, idtend_mp

real(kind=kind_phys), parameter :: zero = 0.0_kind_phys, one = 1.0_kind_phys
real(kind=kind_phys) :: crain, csnow, onebg, tem, total_precip, tem1, tem2
real(kind=kind_phys) :: crain, csnow, onebg, tem, total_precip, tem1, tem2, ttend
real(kind=kind_phys), dimension(im) :: domr, domzr, domip, doms, t850, work1

! Initialize CCPP error handling variables
Expand Down Expand Up @@ -244,6 +254,52 @@ subroutine GFS_MP_generic_post_run(

endif

do itime=1,num_dfi_radar
if(ix_dfi_radar(itime)<1) cycle
if(fhour<fh_dfi_radar(itime)) cycle
if(fhour>=fh_dfi_radar(itime+1)) cycle
exit
enddo
if_radar: if(itime<=num_dfi_radar) then
radar_k: do k=3,levs-2 ! Avoid model top and bottom in case DA forgets to
radar_i: do i=1,im
ttend = dfi_radar_tten(i,k,itime)
if_active: if (ttend>-19) then
ttend = max(ttend,radar_tten_limits(1))
ttend = min(ttend,radar_tten_limits(2))

! add radar temp tendency
! there is radar coverage
gt0(i,k) = save_t(i,k) + ttend*dtp
end if if_active
end do radar_i
end do radar_k
if(ldiag3d) then
idtend_radar = dtidx(index_of_temperature,index_of_process_dfi_radar)
idtend_mp = dtidx(index_of_temperature,index_of_process_mp)
if(idtend_radar>0 .or. idtend_mp>0) then
if(idtend_mp>0) then
dtend(:,1:2,idtend_mp) = dtend(:,1:2,idtend_mp) + (gt0(:,1:2)-save_t(:,1:2))*frain
endif
do k=3,levs-2 ! Avoid model top and bottom in case DA forgets to
do i=1,im
ttend = dfi_radar_tten(i,k,itime)
if (ttend>-19) then
if(idtend_radar>0) then
dtend(i,k,idtend_radar) = dtend(i,k,idtend_radar) + (gt0(i,k)-save_t(i,k)) * frain
endif
else if(idtend_mp>0) then
dtend(i,k,idtend_mp) = dtend(i,k,idtend_mp) + (gt0(i,k)-save_t(i,k)) * frain
endif
enddo
enddo
if(idtend_mp>0) then
dtend(:,levs-1:levs,idtend_mp) = dtend(:,levs-1:levs,idtend_mp) + (gt0(:,levs-1:levs)-save_t(:,levs-1:levs))*frain
endif
endif
endif
endif if_radar

t850(1:im) = gt0(1:im,1)

do k = 1, levs-1
Expand Down
79 changes: 73 additions & 6 deletions physics/GFS_MP_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@
type = real
kind = kind_phys
intent = inout
[num_dfi_radar]
standard_name = number_of_radar_derived_temperature_or_convection_suppression_intervals
long_name = number of time ranges with radar-derived microphysics temperature tendencies or radar-derived convection suppression
units = count
dimensions = ()
type = integer
intent = in
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand All @@ -104,9 +111,9 @@
kind = len=*
intent = out
[errflg]
standard_name = ccpp_error_flag
long_name = error flag for error handling in CCPP
units = flag
standard_name = ccpp_error_code
long_name = error code for error handling in CCPP
units = 1
dimensions = ()
type = integer
intent = out
Expand Down Expand Up @@ -727,6 +734,66 @@
type = real
kind = kind_phys
intent = in
[dfi_radar_max_intervals]
standard_name = maximum_number_of_radar_derived_temperature_or_convection_suppression_intervals
long_name = maximum allowed number of time ranges with radar-derived microphysics temperature tendencies or radar-derived convection suppression
units = count
dimensions = ()
type = integer
intent = in
[num_dfi_radar]
standard_name = number_of_radar_derived_temperature_or_convection_suppression_intervals
long_name = number of time ranges with radar-derived microphysics temperature tendencies or radar-derived convection suppression
units = count
dimensions = ()
type = integer
intent = in
[fh_dfi_radar]
standard_name = forecast_lead_times_bounding_radar_derived_temperature_or_convection_suppression_intervals
long_name = forecast lead times bounding radar derived temperature or convection suppression intervals
units = h
dimensions = (maximum_number_of_radar_derived_temperature_or_convection_suppression_intervals_plus_one)
type = real
kind = kind_phys
intent = in
[ix_dfi_radar]
standard_name = indices_with_radar_derived_temperature_or_convection_suppression_data
long_name = indices with radar derived temperature or convection suppression data
units = index
dimensions = (maximum_number_of_radar_derived_temperature_or_convection_suppression_intervals)
type = integer
intent = in
[dfi_radar_tten]
standard_name = radar_derived_microphysics_temperature_tendency
long_name = radar-derived microphysics temperature tendency
units = K s-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_radar_derived_temperature_or_convection_suppression_intervals)
type = real
kind = kind_phys
intent = in
[fhour]
standard_name = forecast_time
long_name = current forecast time
units = h
dimensions = ()
type = real
kind = kind_phys
intent = in
[radar_tten_limits]
standard_name = allowed_bounds_of_radar_prescribed_tendencies
long_name = allowed bounds of prescribed microphysics temperature tendencies
units = K s-1
dimensions = (2)
type = real
kind = kind_phys
intent = in
[index_of_process_dfi_radar]
standard_name = index_of_radar_derived_microphysics_temperature_forcing_in_cumulative_change_index
long_name = index of radar-derived microphysics temperature forcing in second dimension of array cumulative change index
units = index
dimensions = ()
type = integer
intent = in
[dtend]
standard_name = cumulative_change_of_state_variables
long_name = diagnostic tendencies for state variables
Expand Down Expand Up @@ -786,9 +853,9 @@
kind = len=*
intent = out
[errflg]
standard_name = ccpp_error_flag
long_name = error flag for error handling in CCPP
units = flag
standard_name = ccpp_error_code
long_name = error code for error handling in CCPP
units = 1
dimensions = ()
type = integer
intent = out
Expand Down
12 changes: 6 additions & 6 deletions physics/GFS_PBL_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,9 @@
kind = len=*
intent = out
[errflg]
standard_name = ccpp_error_flag
long_name = error flag for error handling in CCPP
units = flag
standard_name = ccpp_error_code
long_name = error code for error handling in CCPP
units = 1
dimensions = ()
type = integer
intent = out
Expand Down Expand Up @@ -1238,9 +1238,9 @@
kind = len=*
intent = out
[errflg]
standard_name = ccpp_error_flag
long_name = error flag for error handling in CCPP
units = flag
standard_name = ccpp_error_code
long_name = error code for error handling in CCPP
units = 1
dimensions = ()
type = integer
intent = out
12 changes: 6 additions & 6 deletions physics/GFS_SCNV_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@
kind = len=*
intent = out
[errflg]
standard_name = ccpp_error_flag
long_name = error flag for error handling in CCPP
units = flag
standard_name = ccpp_error_code
long_name = error code for error handling in CCPP
units = 1
dimensions = ()
type = integer
intent = out
Expand Down Expand Up @@ -672,9 +672,9 @@
kind = len=*
intent = out
[errflg]
standard_name = ccpp_error_flag
long_name = error flag for error handling in CCPP
units = flag
standard_name = ccpp_error_code
long_name = error code for error handling in CCPP
units = 1
dimensions = ()
type = integer
intent = out
6 changes: 3 additions & 3 deletions physics/GFS_cloud_diagnostics.meta
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@
kind = len=*
intent = out
[errflg]
standard_name = ccpp_error_flag
long_name = error flag for error handling in CCPP
units = flag
standard_name = ccpp_error_code
long_name = error code for error handling in CCPP
units = 1
dimensions = ()
type = integer
intent = out
Loading

0 comments on commit f0d6dcc

Please sign in to comment.