Skip to content

Commit

Permalink
Merge branch 'NOAA-EMC:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
rmontuoro authored Nov 5, 2021
2 parents c6449b9 + c8140b2 commit 19eb9b6
Show file tree
Hide file tree
Showing 21 changed files with 959 additions and 993 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ set_target_properties(fv3atm PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT
target_include_directories(fv3atm INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>
$<INSTALL_INTERFACE:mod>)

if(MULTI_GASES)
list(APPEND _fv3atm_defs_private MULTI_GASES)
endif()

target_link_libraries(fv3atm PUBLIC fv3
fv3ccpp
stochastic_physics
Expand Down
24 changes: 17 additions & 7 deletions atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,9 @@ subroutine atmos_timestep_diagnostics(Atmos)
if(.not. GFS_control%first_time_step) then
pmaxloc = 0.0d0
recvbuf = 0.0d0
psum = 0.0d0
pcount = 0.0d0
maxabs = 0.0d0
psum = 0.0d0
pcount = 0.0d0
maxabs = 0.0d0

! Put pgr stats in pmaxloc, psum, and pcount:
pmaxloc(1) = GFS_Control%tile_num
Expand All @@ -434,11 +434,11 @@ subroutine atmos_timestep_diagnostics(Atmos)
do i=1,count
pdiff = GFS_data(nb)%Statein%pgr(i)-GFS_data(nb)%Intdiag%old_pgr(i)
adiff = abs(pdiff)
psum = psum+adiff
psum = psum + adiff
if(adiff>=maxabs) then
maxabs=adiff
pmaxloc(2:3)=(/ ATM_block%index(nb)%ii(i), ATM_block%index(nb)%jj(i) /)
pmaxloc(4:7)=(/ pdiff, GFS_data(nb)%Statein%pgr(i), &
pmaxloc(2:3) = (/ ATM_block%index(nb)%ii(i), ATM_block%index(nb)%jj(i) /)
pmaxloc(4:7) = (/ pdiff, GFS_data(nb)%Statein%pgr(i), &
GFS_data(nb)%Grid%xlat(i), GFS_data(nb)%Grid%xlon(i) /)
endif
enddo
Expand Down Expand Up @@ -1642,6 +1642,7 @@ subroutine assign_importdata(jdat, rc)
! real(kind=GFS_kind_phys), parameter :: hsmax = 100.0 !< maximum snow depth (m) allowed
real(kind=GFS_kind_phys), parameter :: himax = 1.0e12 !< maximum ice thickness allowed
real(kind=GFS_kind_phys), parameter :: hsmax = 1.0e12 !< maximum snow depth (m) allowed
real(kind=GFS_kind_phys), parameter :: con_sbc = 5.670400e-8_GFS_kind_phys !< stefan-boltzmann
!
!------------------------------------------------------------------------------
!
Expand Down Expand Up @@ -2479,7 +2480,7 @@ subroutine assign_importdata(jdat, rc)

! update sea ice related fields:
if( lcpl_fice ) then
!$omp parallel do default(shared) private(i,j,nb,ix)
!$omp parallel do default(shared) private(i,j,nb,ix,tem)
do j=jsc,jec
do i=isc,iec
nb = Atm_block%blkno(i,j)
Expand All @@ -2490,6 +2491,15 @@ subroutine assign_importdata(jdat, rc)
GFS_data(nb)%Coupling%hsnoin_cpl(ix) = min(hsmax, GFS_data(nb)%Coupling%hsnoin_cpl(ix) &
/ (GFS_data(nb)%Sfcprop%fice(ix)*GFS_data(nb)%Sfcprop%oceanfrac(ix)))
GFS_data(nb)%Sfcprop%zorli(ix) = z0ice
tem = GFS_data(nb)%Sfcprop%tisfc(ix) * GFS_data(nb)%Sfcprop%tisfc(ix)
tem = con_sbc * tem * tem
if (GFS_data(nb)%Coupling%ulwsfcin_cpl(ix) > zero) then
GFS_data(nb)%Sfcprop%emis_ice(ix) = GFS_data(nb)%Coupling%ulwsfcin_cpl(ix) / tem
GFS_data(nb)%Sfcprop%emis_ice(ix) = max(0.9, min(one, GFS_data(nb)%Sfcprop%emis_ice(ix)))
else
GFS_data(nb)%Sfcprop%emis_ice(ix) = 0.96
endif
GFS_data(nb)%Coupling%ulwsfcin_cpl(ix) = tem * GFS_data(nb)%Sfcprop%emis_ice(ix)
else
GFS_data(nb)%Sfcprop%tisfc(ix) = GFS_data(nb)%Sfcprop%tsfco(ix)
GFS_data(nb)%Sfcprop%fice(ix) = zero
Expand Down
8 changes: 7 additions & 1 deletion ccpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/framework/cmake")
#------------------------------------------------------------------------------
# Call to CCPP code generator
if(DEBUG)
# Enable debugging features in auto-generated physics caps
set(_ccpp_debug_arg "--debug")
# Enable verbose output from ccpp_prebuild.py
set(_ccpp_verbose_arg "--verbose")
endif()
if(DEFINED CCPP_SUITES)
set(_ccpp_suites_arg "--suites=${CCPP_SUITES}")
Expand All @@ -31,7 +34,7 @@ endif()
execute_process(COMMAND ${Python_EXECUTABLE}
"framework/scripts/ccpp_prebuild.py"
"--config=config/ccpp_prebuild_config.py"
"--builddir=${CMAKE_CURRENT_BINARY_DIR}" ${_ccpp_suites_arg} ${_ccpp_debug_arg}
"--builddir=${CMAKE_CURRENT_BINARY_DIR}" ${_ccpp_suites_arg} ${_ccpp_debug_arg} ${_ccpp_verbose_arg}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/ccpp_prebuild.out
ERROR_FILE ${CMAKE_CURRENT_BINARY_DIR}/ccpp_prebuild.err
Expand Down Expand Up @@ -86,6 +89,9 @@ if(MULTI_GASES)
add_definitions(-DMULTI_GASES)
endif()

if(IDEA_PHYS)
add_definitions(-DIDEA_PHYS)
endif()
#------------------------------------------------------------------------------
# Build CCPP framework and physics

Expand Down
82 changes: 0 additions & 82 deletions ccpp/config/ccpp_prebuild_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@
'physics/physics/sfc_cice.f',
'physics/physics/sfc_diff.f',
'physics/physics/sfc_drv.f',
'physics/physics/sfc_noah_wrfv4_interstitial.F90',
'physics/physics/sfc_noah_wrfv4.F90',
'physics/physics/sfc_noahmp_drv.F90',
'physics/physics/flake_driver.F90',
'physics/physics/sfc_nst.f',
Expand Down Expand Up @@ -238,86 +236,6 @@
# Directory where the suite definition files are stored
SUITES_DIR = 'suites'

# Optional arguments - only required for schemes that use
# optional arguments. ccpp_prebuild.py will throw an exception
# if it encounters a scheme subroutine with optional arguments
# if no entry is made here. Possible values are: 'all', 'none',
# or a list of standard_names: [ 'var1', 'var3' ].
OPTIONAL_ARGUMENTS = {
'rrtmg_sw' : {
'rrtmg_sw_run' : [
'tendency_of_air_temperature_due_to_shortwave_heating_assuming_clear_sky_on_radiation_time_step_and_radiation_levels',
'components_of_surface_downward_shortwave_fluxes',
'cloud_liquid_water_path',
'mean_effective_radius_for_liquid_cloud',
'cloud_ice_water_path',
'mean_effective_radius_for_ice_cloud',
'cloud_rain_water_path',
'mean_effective_radius_for_rain_drop',
'cloud_snow_water_path',
'mean_effective_radius_for_snow_flake',
],
},
'rrtmg_lw' : {
'rrtmg_lw_run' : [
'tendency_of_air_temperature_due_to_longwave_heating_assuming_clear_sky_on_radiation_time_step_and_radiation_levels',
'cloud_liquid_water_path',
'mean_effective_radius_for_liquid_cloud',
'cloud_ice_water_path',
'mean_effective_radius_for_ice_cloud',
'cloud_rain_water_path',
'mean_effective_radius_for_rain_drop',
'cloud_snow_water_path',
'mean_effective_radius_for_snow_flake',
],
},
'mp_thompson' : {
'mp_thompson_init' : [
'mass_number_concentration_of_cloud_liquid_water_particles_in_air',
'mass_number_concentration_of_hygroscopic_aerosols',
'mass_number_concentration_of_nonhygroscopic_ice_nucleating_aerosols',
'tendency_of_hygroscopic_aerosols_at_surface_adjacent_layer',
'tendency_of_nonhygroscopic_ice_nucleating_aerosols_at_surface_adjacent_layer',
# DH* 2020-06-01: turn off calculation of effective radii, now done in GFS_rrtmg_pre
#'effective_radius_of_stratiform_cloud_liquid_water_particle',
#'effective_radius_of_stratiform_cloud_ice_particle',
#'effective_radius_of_stratiform_cloud_snow_particle',
# *DH 2020-06-01
],
'mp_thompson_run' : [
'mass_number_concentration_of_cloud_liquid_water_particles_in_air_of_new_state',
'mass_number_concentration_of_hygroscopic_aerosols_of_new_state',
'mass_number_concentration_of_nonhygroscopic_ice_nucleating_aerosols_of_new_state',
'tendency_of_hygroscopic_aerosols_at_surface_adjacent_layer',
'tendency_of_nonhygroscopic_ice_nucleating_aerosols_at_surface_adjacent_layer',
# DH* 2020-06-01: turn off calculation of effective radii, now done in GFS_rrtmg_pre
#'effective_radius_of_stratiform_cloud_liquid_water_particle',
#'effective_radius_of_stratiform_cloud_ice_particle',
#'effective_radius_of_stratiform_cloud_snow_particle',
# *DH 2020-06-01
],
},
'rrtmgp_sw_rte' : {
'rrtmgp_sw_rte_run' : [
'components_of_surface_downward_shortwave_fluxes',
],
},
'GFS_rrtmgp_sw_post' : {
'GFS_rrtmgp_sw_post_run' : [
'tendency_of_air_temperature_due_to_shortwave_heating_assuming_clear_sky_on_radiation_timestep',
'components_of_surface_downward_shortwave_fluxes',
],
},
'GFS_rrtmgp_lw_post' : {
'GFS_rrtmgp_lw_post_run' : [
'tendency_of_air_temperature_due_to_longwave_heating_assuming_clear_sky_on_radiation_timestep',
],
},
#'subroutine_name_1' : 'all',
#'subroutine_name_2' : 'none',
#'subroutine_name_2' : [ 'var1', 'var3'],
}

# Directory where to write static API to
STATIC_API_DIR = '{build_dir}/physics'
STATIC_API_SRCFILE = '{build_dir}/physics/CCPP_STATIC_API.sh'
Expand Down
12 changes: 6 additions & 6 deletions ccpp/data/CCPP_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -219,18 +219,18 @@ subroutine interstitial_create (Interstitial, is, ie, isd, ied, js, je, jsd, jed
! For multi-gases physics
Interstitial%nwat = nwat
! If ngas, rilist and cpilist are present, then
! multi-gases physics are used. If not, set ngas=1
! multi-gases physics are used. If not, set ngas=0
! (safe value), allocate rilist/cpilist and set to zero
if(present(ngas)) then
Interstitial%ngas = ngas
else
Interstitial%ngas = 1
Interstitial%ngas = 0
end if
allocate(Interstitial%rilist(1:Interstitial%ngas))
allocate(Interstitial%cpilist(1:Interstitial%ngas))
allocate(Interstitial%rilist(0:Interstitial%ngas))
allocate(Interstitial%cpilist(0:Interstitial%ngas))
if (present(rilist)) then
Interstitial%rilist = rilist(1:Interstitial%ngas)
Interstitial%cpilist = cpilist(1:Interstitial%ngas)
Interstitial%rilist = rilist(0:Interstitial%ngas)
Interstitial%cpilist = cpilist(0:Interstitial%ngas)
else
Interstitial%rilist = 0.0
Interstitial%cpilist = 0.0
Expand Down
3 changes: 2 additions & 1 deletion ccpp/data/CCPP_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,10 @@
standard_name = gas_tracers_for_multi_gas_physics_at_Lagrangian_surface
long_name = gas tracers for multi gas physics at Lagrangian surface
units = kg kg-1
dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics,1:number_of_gases_for_multi_gases_physics)
dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics,0:number_of_gases_for_multi_gases_physics)
type = real
kind = kind_dyn
active = (number_of_gases_for_multi_gases_physics > 0)
[qv]
standard_name = water_vapor_specific_humidity_at_Lagrangian_surface
long_name = water vapor specific humidity updated by fast physics at Lagrangian surface
Expand Down
Loading

0 comments on commit 19eb9b6

Please sign in to comment.