Skip to content

Commit

Permalink
Merge pull request #2 from climbfuji/update_hafs_from_dtc_hwrf_physic…
Browse files Browse the repository at this point in the history
…s_20200619

Update support/HAFS from NCAR dtc/hwrf-physics 2020/06/19
  • Loading branch information
climbfuji authored Jun 26, 2020
2 parents 03ec64b + a8265eb commit c13b36d
Show file tree
Hide file tree
Showing 41 changed files with 17,913 additions and 768 deletions.
26 changes: 0 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,32 +156,6 @@ if (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU")
elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
# Adjust settings for bit-for-bit reproducibility of NEMSfv3gfs
if (PROJECT STREQUAL "CCPP-FV3")
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/physics/module_bfmicrophysics.f
${CMAKE_CURRENT_SOURCE_DIR}/physics/sflx.f
${CMAKE_CURRENT_SOURCE_DIR}/physics/sfc_diff.f
${CMAKE_CURRENT_SOURCE_DIR}/physics/sfc_diag.f
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_nst_model.f90
${CMAKE_CURRENT_SOURCE_DIR}/physics/calpreciptype.f90
${CMAKE_CURRENT_SOURCE_DIR}/physics/mersenne_twister.f
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_nst_water_prop.f90
${CMAKE_CURRENT_SOURCE_DIR}/physics/aer_cloud.F
${CMAKE_CURRENT_SOURCE_DIR}/physics/wv_saturation.F
${CMAKE_CURRENT_SOURCE_DIR}/physics/cldwat2m_micro.F
${CMAKE_CURRENT_SOURCE_DIR}/physics/surface_perturbation.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/radiation_aerosols.f
${CMAKE_CURRENT_SOURCE_DIR}/physics/cu_gf_deep.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/cu_gf_sh.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_bl_mynn.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_MYNNPBL_wrapper.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_sf_mynn.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_MYNNSFC_wrapper.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_MYNNrad_pre.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_MYNNrad_post.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_mp_thompson_make_number_concentrations.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_SF_JSFC.F90
${CMAKE_CURRENT_SOURCE_DIR}/physics/module_BL_MYJPBL.F90
PROPERTIES COMPILE_FLAGS "-r8 -ftz")

# Replace -xHost or -xCORE-AVX2 with -xCORE-AVX-I for certain files
set(CMAKE_Fortran_FLAGS_LOPT1 ${CMAKE_Fortran_FLAGS_OPT})
string(REPLACE "-xHOST" "-xCORE-AVX-I"
Expand Down
234 changes: 169 additions & 65 deletions physics/GFS_rrtmg_pre.F90

Large diffs are not rendered by default.

27 changes: 18 additions & 9 deletions physics/GFS_rrtmg_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@
type = GFS_radtend_type
intent = inout
optional = F
[dx]
standard_name = cell_size
long_name = relative dx for the grid cell
units = m
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[f_ice]
standard_name = fraction_of_ice_water_cloud
long_name = fraction of ice water cloud
Expand Down Expand Up @@ -427,7 +436,7 @@
standard_name = total_cloud_fraction
long_name = layer total cloud fraction
units = frac
dimensions = (horizontal_dimension,vertical_dimension)
dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation)
type = real
kind = kind_phys
intent = out
Expand All @@ -436,7 +445,7 @@
standard_name = cloud_liquid_water_path
long_name = layer cloud liquid water path
units = g m-2
dimensions = (horizontal_dimension,vertical_dimension)
dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation)
type = real
kind = kind_phys
intent = out
Expand All @@ -445,7 +454,7 @@
standard_name = mean_effective_radius_for_liquid_cloud
long_name = mean effective radius for liquid cloud
units = micron
dimensions = (horizontal_dimension,vertical_dimension)
dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation)
type = real
kind = kind_phys
intent = out
Expand All @@ -454,7 +463,7 @@
standard_name = cloud_ice_water_path
long_name = layer cloud ice water path
units = g m-2
dimensions = (horizontal_dimension,vertical_dimension)
dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation)
type = real
kind = kind_phys
intent = out
Expand All @@ -463,7 +472,7 @@
standard_name = mean_effective_radius_for_ice_cloud
long_name = mean effective radius for ice cloud
units = micron
dimensions = (horizontal_dimension,vertical_dimension)
dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation)
type = real
kind = kind_phys
intent = out
Expand All @@ -472,7 +481,7 @@
standard_name = cloud_rain_water_path
long_name = cloud rain water path
units = g m-2
dimensions = (horizontal_dimension,vertical_dimension)
dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation)
type = real
kind = kind_phys
intent = out
Expand All @@ -481,7 +490,7 @@
standard_name = mean_effective_radius_for_rain_drop
long_name = mean effective radius for rain drop
units = micron
dimensions = (horizontal_dimension,vertical_dimension)
dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation)
type = real
kind = kind_phys
intent = out
Expand All @@ -490,7 +499,7 @@
standard_name = cloud_snow_water_path
long_name = cloud snow water path
units = g m-2
dimensions = (horizontal_dimension,vertical_dimension)
dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation)
type = real
kind = kind_phys
intent = out
Expand All @@ -499,7 +508,7 @@
standard_name = mean_effective_radius_for_snow_flake
long_name = mean effective radius for snow flake
units = micron
dimensions = (horizontal_dimension,vertical_dimension)
dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation)
type = real
kind = kind_phys
intent = out
Expand Down
3 changes: 2 additions & 1 deletion physics/GFS_rrtmg_setup.F90
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ subroutine GFS_rrtmg_setup_init ( &
! =1: max/ran overlapping clouds !
! =2: maximum overlap clouds (mcica only) !
! =3: decorrelation-length overlap (mcica only) !
! =4: exponential overlap clouds
! isubc_sw/isubc_lw: sub-column cloud approx control flag (sw/lw rad) !
! =0: with out sub-column cloud approximation !
! =1: mcica sub-col approx. prescribed random seed !
Expand Down Expand Up @@ -303,7 +304,7 @@ subroutine GFS_rrtmg_setup_init ( &

call radinit &
! --- inputs:
& ( si, levr, imp_physics, me )
& ( si, levr, imp_physics, me )
! --- outputs:
! ( none )

Expand Down
16 changes: 8 additions & 8 deletions physics/GFS_rrtmg_setup.meta
Original file line number Diff line number Diff line change
Expand Up @@ -107,32 +107,32 @@
intent = in
optional = F
[iovr_sw]
standard_name = flag_for_max_random_overlap_clouds_for_shortwave_radiation
long_name = sw: max-random overlap clouds
standard_name = flag_for_cloud_overlapping_method_for_shortwave_radiation
long_name = control flag for cloud overlapping method for SW
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[iovr_lw]
standard_name = flag_for_max_random_overlap_clouds_for_longwave_radiation
long_name = lw: max-random overlap clouds
standard_name = flag_for_cloud_overlapping_method_for_longwave_radiation
long_name = control flag for cloud overlapping method for LW
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[isubc_sw]
standard_name = flag_for_sw_clouds_without_sub_grid_approximation
long_name = flag for sw clouds without sub-grid approximation
standard_name = flag_for_sw_clouds_grid_approximation
long_name = flag for sw clouds sub-grid approximation
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[isubc_lw]
standard_name = flag_for_lw_clouds_without_sub_grid_approximation
long_name = flag for lw clouds without sub-grid approximation
standard_name = flag_for_lw_clouds_sub_grid_approximation
long_name = flag for lw clouds sub-grid approximation
units = flag
dimensions = ()
type = integer
Expand Down
44 changes: 41 additions & 3 deletions physics/GFS_rrtmgp_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ module GFS_rrtmgp_pre
progcld1, & ! Zhao/Moorthi's prognostic cloud scheme
progcld3, & ! Zhao/Moorthi's prognostic cloud+pdfcld
progcld4, & ! GFDL cloud scheme
progcld5, & ! Thompson / WSM6 cloud micrphysics scheme
progcld5, & ! Ferrier Aligo microphysics scheme
progcld6, & ! Thompson cloud microphysics scheme
progclduni ! Unified cloud-scheme
use surface_perturbation, only: &
cdfnor ! Routine to compute CDF (used to compute percentiles)
Expand Down Expand Up @@ -740,10 +741,47 @@ subroutine cloud_microphysics(Model, Tbd, Grid, Sfcprop, ncol, tracer, p_lay, t_
mbota, & ! OUT - vertical indices for low, mid, hi cloud bases (NCOL,3)
de_lgth) ! OUT - clouds decorrelation length (km)
endif
! *) Thompson / WSM6 cloud micrphysics scheme
elseif(Model%imp_physics == 8 .or. Model%imp_physics == 6) then
! *) Ferrier-Aligo cloud microphysics scheme
elseif(Model%imp_physics == 15) then

call progcld5 ( & ! IN
p_lay/100., & ! IN - Pressure at model layer centers (mb)
p_lev/100., & ! IN - Pressure at model interfaces (mb)
t_lay, & ! IN - Temperature at layer centers (K)
tv_lay, & ! IN - Virtual temperature at layer centers (K)
q_lay, & ! IN - Specific humidity at layer center (kg/kg)
qs_lay, & ! IN - Saturation specific humidity at layer center (kg/kg)
relhum, & ! IN - Relative humidity at layer center (1)
tracer, & ! IN - Cloud condensate amount in layer by type ()
Grid%xlat, & ! IN - Latitude (radians)
Grid%xlon, & ! IN - Longitude (radians)
Sfcprop%slmsk, & ! IN - Land/Sea mask ()
deltaZ, & ! IN - Layer thickness (km)
deltaP/100., & ! IN - Layer thickness (hPa)
Model%ntrac-1, & ! IN - Number of tracers
Model%ntcw-1, & ! IN - Tracer index for cloud condensate (or liquid water)
Model%ntiw-1, & ! IN - Tracer index for ice
Model%ntrw-1, & ! IN - Tracer index for rain
NCOL, & ! IN - Number of horizontal gridpoints
MODEL%LEVS, & ! IN - Number of model layers
MODEL%LEVS+1, & ! IN - Number of model levels
Model%icloud, & ! IN - cloud effect to the optical depth and cloud fraction in radiation
Model%uni_cld, & ! IN - True for cloud fraction from shoc
Model%lmfshal, & ! IN - True for mass flux shallow convection
Model%lmfdeep2, & ! IN - True for mass flux deep convection
cldcov(:,1:Model%levs), & ! IN - Layer cloud fraction (used if uni_cld=.true.)
Tbd%phy_f3d(:,:,1), & ! IN - Liquid-water effective radius (microns)
Tbd%phy_f3d(:,:,2), & ! IN - Ice-water effective radius (microns)
Tbd%phy_f3d(:,:,3), & ! IN - LSnow-water effective radius (microns)
clouds, & ! OUT - Cloud properties (NCOL,Model%levs,NF_CLDS)
cldsa, & ! OUT - fraction of clouds for low, mid, hi, tot, bl (NCOL,5)
mtopa, & ! OUT - vertical indices for low, mid, hi cloud tops (NCOL,3)
mbota, & ! OUT - vertical indices for low, mid, hi cloud bases (NCOL,3)
de_lgth) ! OUT - clouds decorrelation length (km)
! *) Thompson cloud microphysics scheme
elseif(Model%imp_physics == 8) then

call progcld6 ( & ! IN
p_lay/100., & ! IN - Pressure at model layer centers (mb)
p_lev/100., & ! IN - Pressure at model interfaces (mb)
t_lay, & ! IN - Temperature at layer centers (K)
Expand Down
16 changes: 8 additions & 8 deletions physics/GFS_rrtmgp_setup.meta
Original file line number Diff line number Diff line change
Expand Up @@ -99,32 +99,32 @@
intent = in
optional = F
[iovr_sw]
standard_name = flag_for_max_random_overlap_clouds_for_shortwave_radiation
long_name = sw: max-random overlap clouds
standard_name = flag_for_cloud_overlapping_method_for_shortwave_radiation
long_name = control flag for cloud overlapping method for SW
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[iovr_lw]
standard_name = flag_for_max_random_overlap_clouds_for_longwave_radiation
long_name = lw: max-random overlap clouds
standard_name = flag_for_cloud_overlapping_method_for_longwave_radiation
long_name = control flag for cloud overlapping method for LW
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[isubc_sw]
standard_name = flag_for_sw_clouds_without_sub_grid_approximation
long_name = flag for sw clouds without sub-grid approximation
standard_name = flag_for_sw_clouds_grid_approximation
long_name = flag for sw clouds sub-grid approximation
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[isubc_lw]
standard_name = flag_for_lw_clouds_without_sub_grid_approximation
long_name = flag for lw clouds without sub-grid approximation
standard_name = flag_for_lw_clouds_sub_grid_approximation
long_name = flag for lw clouds sub-grid approximation
units = flag
dimensions = ()
type = integer
Expand Down
20 changes: 18 additions & 2 deletions physics/GFS_suite_interstitial.F90
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,8 @@ end subroutine GFS_suite_stateout_update_finalize
!!
subroutine GFS_suite_stateout_update_run (im, levs, ntrac, dtp, &
tgrs, ugrs, vgrs, qgrs, dudt, dvdt, dtdt, dqdt, &
gt0, gu0, gv0, gq0, errmsg, errflg)
gt0, gu0, gv0, gq0, ntiw, nqrimef, imp_physics, &
imp_physics_fer_hires, epsq, errmsg, errflg)

use machine, only: kind_phys

Expand All @@ -419,7 +420,9 @@ subroutine GFS_suite_stateout_update_run (im, levs, ntrac, dtp, &
integer, intent(in) :: im
integer, intent(in) :: levs
integer, intent(in) :: ntrac
real(kind=kind_phys), intent(in) :: dtp
integer, intent(in) :: imp_physics,imp_physics_fer_hires
integer, intent(in) :: ntiw, nqrimef
real(kind=kind_phys), intent(in) :: dtp, epsq

real(kind=kind_phys), dimension(im,levs), intent(in) :: tgrs, ugrs, vgrs
real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: qgrs
Expand All @@ -431,6 +434,7 @@ subroutine GFS_suite_stateout_update_run (im, levs, ntrac, dtp, &
character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg

integer :: i, k
! Initialize CCPP error handling variables
errmsg = ''
errflg = 0
Expand All @@ -439,6 +443,18 @@ subroutine GFS_suite_stateout_update_run (im, levs, ntrac, dtp, &
gu0(:,:) = ugrs(:,:) + dudt(:,:) * dtp
gv0(:,:) = vgrs(:,:) + dvdt(:,:) * dtp
gq0(:,:,:) = qgrs(:,:,:) + dqdt(:,:,:) * dtp

if (imp_physics == imp_physics_fer_hires) then
do k=1,levs
do i=1,im
if(gq0(i,k,ntiw) > epsq) then
gq0(i,k,nqrimef) = max(1., gq0(i,k,nqrimef)/gq0(i,k,ntiw))
else
gq0(i,k,nqrimef) = 1.
end if
end do
end do
end if

end subroutine GFS_suite_stateout_update_run

Expand Down
41 changes: 41 additions & 0 deletions physics/GFS_suite_interstitial.meta
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,47 @@
kind = kind_phys
intent = out
optional = F
[ntiw]
standard_name = index_for_ice_cloud_condensate
long_name = tracer index for ice water
units = index
dimensions = ()
type = integer
intent = in
optional = F
[nqrimef]
standard_name = index_for_mass_weighted_rime_factor
long_name = tracer index for mass weighted rime factor
units = index
dimensions = ()
type = integer
intent = in
optional = F
[imp_physics]
standard_name = flag_for_microphysics_scheme
long_name = choice of microphysics scheme
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[imp_physics_fer_hires]
standard_name = flag_for_fer_hires_microphysics_scheme
long_name = choice of Ferrier-Aligo microphysics scheme
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[epsq]
standard_name = minimum_value_of_specific_humidity
long_name = floor value for specific humidity
units = kg kg-1
dimensions = ()
type = real
kind = kind_phys
intent = in
optional = F
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down
Loading

0 comments on commit c13b36d

Please sign in to comment.