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

Cld perts #233

Merged
merged 42 commits into from
Mar 21, 2021
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a47e0ce
Merge pull request #1 from NOAA-EMC/develop
pjpegion Dec 6, 2019
295f1da
Merge pull request #2 from NOAA-EMC/develop
pjpegion Jan 22, 2020
ae32865
Merge pull request #3 from NOAA-EMC/develop
pjpegion Mar 19, 2020
77dbecb
Merge pull request #4 from NOAA-EMC/develop
pjpegion May 5, 2020
84ba585
addition of cloud perts
pjpegion May 5, 2020
c788280
updates to latest fv3_atm with ccpp
pjpegion May 6, 2020
e6072e2
Merge pull request #5 from NOAA-EMC/develop
pjpegion Dec 2, 2020
d978a2f
merge with develop
pjpegion Dec 2, 2020
7a30acc
update submodule pointer to my fork
pjpegion Dec 2, 2020
80af57f
add temporary diagnostic for land perts
pjpegion Dec 14, 2020
4b8ed3d
update submodules
pjpegion Dec 14, 2020
4fcfc4e
modifictations to CMakelists, still not building properly
pjpegion Dec 22, 2020
f3b9837
Merge remote-tracking branch 'upstream/develop' into develop
pjpegion Dec 23, 2020
5037f12
merge with upstream NOAA-EMC
pjpegion Dec 23, 2020
e13835d
Merge branch 'develop' into cld_perts
pjpegion Dec 23, 2020
cafaad1
merge with EMC fork
pjpegion Jan 6, 2021
158645e
merge with develop
pjpegion Jan 6, 2021
15d00c6
update cmake lists and typedefs for cld_perts
pjpegion Jan 6, 2021
f2f931b
update submodules
pjpegion Jan 6, 2021
db8684e
update submodules
pjpegion Jan 12, 2021
613003a
Merge remote-tracking branch 'upstream/develop' into cld_perts
pjpegion Jan 12, 2021
4bae420
update ccpp-physics submodule
pjpegion Jan 22, 2021
c4cbd5f
update with remove of IPD commit
pjpegion Jan 29, 2021
dda08fc
update with EMC fork
pjpegion Feb 1, 2021
b7f26aa
remove MKL from CmakeLists.txt
pjpegion Feb 2, 2021
06eba2c
remove test CMake file
pjpegion Feb 5, 2021
7e90b58
remove unused coupler_main.F90
pjpegion Feb 5, 2021
768e52b
merge with EMC
pjpegion Feb 16, 2021
a16337e
merge with latest from EMC
pjpegion Feb 26, 2021
5c3549c
revert CmakeLists.txt
pjpegion Feb 26, 2021
745727b
point to correct branch of rrtmgp and fix Cmakelists.txt
pjpegion Mar 3, 2021
5db5ffe
fix Cmakelists.txt
pjpegion Mar 3, 2021
d7fae0c
merge with EMC develop
pjpegion Mar 4, 2021
b901cce
fix CMakeLists.txt
pjpegion Mar 4, 2021
bc8df8e
Address Dom code review
pjpegion Mar 15, 2021
5831d0c
Merge remote-tracking branch 'upstream/develop' into cld_perts
pjpegion Mar 15, 2021
b735531
Merge remote-tracking branch 'upstream/develop' into cld_perts
pjpegion Mar 16, 2021
955037b
update ccpp from upstream
pjpegion Mar 18, 2021
9a30885
Merge remote-tracking branch 'upstream/develop' into cld_perts
pjpegion Mar 18, 2021
147559b
update ccpp_physics submodule
pjpegion Mar 18, 2021
bb6bc4b
point to updated NCAR/ccpp-physics
pjpegion Mar 19, 2021
5d13a9d
revert gitmodules
pjpegion Mar 19, 2021
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
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
branch = master
[submodule "ccpp/physics"]
path = ccpp/physics
url = https://github.com/NCAR/ccpp-physics
branch = master
url = https://github.com/pjpegion/ccpp-physics
branch = pert_clds_mp
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ add_dependencies(fv3atm ccppdriver ccppdata ccppphys ccpp)
target_link_libraries(fv3atm PUBLIC ccppdriver ccppdata ccppphys ccpp)

target_include_directories(fv3atm PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/stochastic_physics)
target_include_directories(fv3atm PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../stochastic_physics)
target_compile_definitions(fv3atm PRIVATE "${_fv3atm_defs_private}")

target_link_libraries(fv3atm PUBLIC fv3dycore
Expand Down Expand Up @@ -192,7 +193,7 @@ endif()
### Install
###############################################################################
install(
TARGETS fv3atm fv3dycore io ${CCPP_LIBRARIES} cpl stochastic_physics stochastic_physics_wrapper
TARGETS fv3atm fv3dycore io ${CCPP_LIBRARIES} cpl stochastic_physics_wrapper
EXPORT fv3atm-config
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
Expand Down
5 changes: 3 additions & 2 deletions atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,7 @@ end subroutine update_atmos_model_state
! </INOUT>

subroutine atmos_model_end (Atmos)
use get_stochy_pattern_mod, only: write_stoch_restart_atm
type (atmos_data_type), intent(inout) :: Atmos
!---local variables
integer :: idx, seconds, ierr
Expand All @@ -878,12 +879,12 @@ subroutine atmos_model_end (Atmos)

call atmosphere_end (Atmos % Time, Atmos%grid, restart_endfcst)

call stochastic_physics_wrapper_end(GFS_control)

if(restart_endfcst) then
call FV3GFS_restart_write (GFS_data, GFS_restart_var, Atm_block, &
GFS_control, Atmos%domain)
call write_stoch_restart_atm('RESTART/atm_stoch.res.nc')
endif
call stochastic_physics_wrapper_end(GFS_control)

! Fast physics (from dynamics) are finalized in atmosphere_end above;
! standard/slow physics (from IPD) are finalized in CCPP_step 'finalize'.
Expand Down
12 changes: 0 additions & 12 deletions ccpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,18 +220,6 @@ else (SIONLIB)
message (STATUS "Disable SIONlib support")
endif (SIONLIB)

#------------------------------------------------------------------------------
# Set Intel MKL flags for preprocessor, compiler and linker (if defined)
if(MKL_DIR)
set (MKL_INC "-m64 -I${MKL_DIR}/include")
set (MKL_LIB "-L${MKL_DIR}/lib -Wl,-rpath,${MKL_DIR}/lib -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${MKL_INC} ${MKL_LIB}")
ADD_DEFINITIONS(-DMKL)
message (STATUS "Enable Intel MKL support")
else(MKL_DIR)
message (STATUS "Disable Intel MKL support")
endif(MKL_DIR)

#------------------------------------------------------------------------------
# Set netCDF flags for preprocessor, compiler and linker (if defined)
# Legacy settings for old make build
Expand Down
28 changes: 20 additions & 8 deletions ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1065,11 +1065,15 @@ module GFS_typedefs

!--- stochastic physics control parameters
logical :: do_sppt
logical :: pert_clds
logical :: pert_radtend
logical :: pert_mp
logical :: use_zmtnblck
logical :: do_shum
logical :: do_skeb
integer :: skeb_npass
integer :: lndp_type
real(kind=kind_phys) :: sppt_amp ! pjp cloud perturbations
integer :: n_var_lndp
logical :: lndp_each_step ! flag to indicate that land perturbations are applied at every time step,
! otherwise they are applied only after gcycle is run
Expand Down Expand Up @@ -1282,7 +1286,7 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: acvt (:) => null() !< arrays used by cnvc90 top (cnvc90.f)

!--- Stochastic physics properties calculated in physics_driver
real (kind=kind_phys), pointer :: dtdtr (:,:) => null() !< temperature change due to radiative heating per time step (K)
real (kind=kind_phys), pointer :: dtdtnp (:,:) => null() !< temperature change from physics that should not be perturbed with SPPT (k)
real (kind=kind_phys), pointer :: dtotprcp (:) => null() !< change in totprcp (diag_type)
real (kind=kind_phys), pointer :: dcnvprcp (:) => null() !< change in cnvprcp (diag_type)
real (kind=kind_phys), pointer :: drain_cpl (:) => null() !< change in rain_cpl (coupling_type)
Expand Down Expand Up @@ -1531,6 +1535,7 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: skebv_wts(:,:) => null() !< 10 meter v wind speed
real (kind=kind_phys), pointer :: sppt_wts(:,:) => null() !<
real (kind=kind_phys), pointer :: shum_wts(:,:) => null() !<
real (kind=kind_phys), pointer :: sfc_wts(:,:) => null() !<
real (kind=kind_phys), pointer :: zmtnblck(:) => null() !<mountain blocking evel
real (kind=kind_phys), pointer :: du3dt (:,:,:) => null() !< u momentum change due to physics
real (kind=kind_phys), pointer :: dv3dt (:,:,:) => null() !< v momentum change due to physics
Expand Down Expand Up @@ -1752,7 +1757,6 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: drain(:) => null() !<
real (kind=kind_phys), pointer :: drain_in_m_sm1(:) => null() !<
real (kind=kind_phys), pointer :: dtdt(:,:) => null() !<
real (kind=kind_phys), pointer :: dtdtc(:,:) => null() !<
real (kind=kind_phys), pointer :: dtsfc1(:) => null() !<
real (kind=kind_phys), pointer :: dtzm(:) => null() !<
real (kind=kind_phys), pointer :: dt_mf(:,:) => null() !<
Expand Down Expand Up @@ -3380,6 +3384,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &

!--- stochastic physics control parameters
logical :: do_sppt = .false.
logical :: pert_mp = .false.
logical :: pert_clds = .false.
logical :: pert_radtend = .true.
logical :: use_zmtnblck = .false.
logical :: do_shum = .false.
logical :: do_skeb = .false.
Expand Down Expand Up @@ -3462,6 +3469,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
dlqf, rbcr, shoc_parm, psauras, prauras, wminras, &
do_sppt, do_shum, do_skeb, &
lndp_type, n_var_lndp, lndp_each_step, &
pert_mp,pert_clds,pert_radtend, &
!--- Rayleigh friction
prslrd0, ral_ts, ldiag_ugwp, do_ugwp, do_tofd, &
! --- Ferrier-Aligo
Expand Down Expand Up @@ -4142,6 +4150,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
! physics that are parsed here and then compared in init_stochastic_physics
! to the stochastic physics namelist parametersto ensure consistency.
Model%do_sppt = do_sppt
Model%pert_mp = pert_mp
Model%pert_clds = pert_clds
Model%pert_radtend = pert_radtend
Model%use_zmtnblck = use_zmtnblck
Model%do_shum = do_shum
Model%do_skeb = do_skeb
Expand Down Expand Up @@ -5161,6 +5172,9 @@ subroutine control_print(Model)
print *, ' '
print *, 'stochastic physics'
print *, ' do_sppt : ', Model%do_sppt
print *, ' pert_mp : ', Model%pert_mp
print *, ' pert_clds : ', Model%pert_clds
print *, ' pert_radtend : ', Model%pert_radtend
print *, ' do_shum : ', Model%do_shum
print *, ' do_skeb : ', Model%do_skeb
print *, ' lndp_type : ', Model%lndp_type
Expand Down Expand Up @@ -5403,10 +5417,10 @@ subroutine tbd_create (Tbd, IM, Model)
endif

if (Model%do_sppt .or. Model%ca_global) then
allocate (Tbd%dtdtr (IM,Model%levs))
allocate (Tbd%dtdtnp (IM,Model%levs))
allocate (Tbd%dtotprcp (IM))
allocate (Tbd%dcnvprcp (IM))
Tbd%dtdtr = clear_val
Tbd%dtdtnp = clear_val
Tbd%dtotprcp = clear_val
Tbd%dcnvprcp = clear_val
endif
Expand Down Expand Up @@ -5678,7 +5692,8 @@ subroutine diag_create (Diag, IM, Model)
allocate (Diag%skebv_wts(IM,Model%levs))
allocate (Diag%sppt_wts(IM,Model%levs))
allocate (Diag%shum_wts(IM,Model%levs))
allocate (Diag%zmtnblck(IM))
allocate (Diag%sfc_wts(IM,Model%n_var_lndp))
allocate (Diag%zmtnblck(IM))
allocate (Diag%ca1 (IM))
allocate (Diag%ca2 (IM))
allocate (Diag%ca3 (IM))
Expand Down Expand Up @@ -6262,7 +6277,6 @@ subroutine interstitial_create (Interstitial, IM, Model)
allocate (Interstitial%dqsfc1 (IM))
allocate (Interstitial%drain (IM))
allocate (Interstitial%dtdt (IM,Model%levs))
allocate (Interstitial%dtdtc (IM,Model%levs))
allocate (Interstitial%dtsfc1 (IM))
allocate (Interstitial%dt_mf (IM,Model%levs))
allocate (Interstitial%dtzm (IM))
Expand Down Expand Up @@ -6956,7 +6970,6 @@ subroutine interstitial_phys_reset (Interstitial, Model)
Interstitial%drain = clear_val
Interstitial%dt_mf = clear_val
Interstitial%dtdt = clear_val
Interstitial%dtdtc = clear_val
Interstitial%dtsfc1 = clear_val
Interstitial%dtzm = clear_val
Interstitial%dudt = clear_val
Expand Down Expand Up @@ -7308,7 +7321,6 @@ subroutine interstitial_print(Interstitial, Model, mpirank, omprank, blkno)
write (0,*) 'sum(Interstitial%dqsfc1 ) = ', sum(Interstitial%dqsfc1 )
write (0,*) 'sum(Interstitial%drain ) = ', sum(Interstitial%drain )
write (0,*) 'sum(Interstitial%dtdt ) = ', sum(Interstitial%dtdt )
write (0,*) 'sum(Interstitial%dtdtc ) = ', sum(Interstitial%dtdtc )
pjpegion marked this conversation as resolved.
Show resolved Hide resolved
write (0,*) 'sum(Interstitial%dtsfc1 ) = ', sum(Interstitial%dtsfc1 )
write (0,*) 'sum(Interstitial%dtzm ) = ', sum(Interstitial%dtzm )
write (0,*) 'sum(Interstitial%dt_mf ) = ', sum(Interstitial%dt_mf )
Expand Down
47 changes: 36 additions & 11 deletions ccpp/data/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -4267,6 +4267,31 @@
units = flag
dimensions = ()
type = logical
[pert_mp]
standard_name = flag_for_stochastic_microphysics_perturbations
long_name = flag for stochastic microphysics perturbations
units = flag
dimensions = ()
type = logical
[pert_clds]
standard_name = flag_for_stochastic_cloud_fraction_perturbations
long_name = flag for stochastic cloud fraction perturbations
units = flag
dimensions = ()
type = logical
[sppt_amp]
standard_name = total_ampltiude_of_sppt_perturbation
long_name = toal ampltidue of stochastic sppt perturbation
units = none
dimensions = ()
type = real
kind = kind_phys
[pert_radtend]
standard_name = flag_for_stochastic_radiative_heating_perturbations
long_name = flag for stochastic radiative heating perturbations
units = flag
dimensions = ()
type = logical
[use_zmtnblck]
standard_name = flag_for_mountain_blocking
long_name = flag for mountain blocking
Expand Down Expand Up @@ -5386,10 +5411,10 @@
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
[dtdtr]
standard_name = tendency_of_air_temperature_due_to_radiative_heating_on_physics_time_step
long_name = temp. change due to radiative heating per time step
units = K
[dtdtnp]
standard_name = tendency_of_air_temperature_to_withold_from_sppt
long_name = temp. change from physics that should not be perturbed by sppt
units = K s-1
dimensions = (horizontal_loop_extent,vertical_dimension)
type = real
kind = kind_phys
Expand Down Expand Up @@ -6504,6 +6529,13 @@
dimensions = (horizontal_loop_extent,vertical_dimension)
type = real
kind = kind_phys
[sfc_wts]
standard_name = weights_for_stochastic_surface_physics_perturbation_flipped
long_name = weights for stochastic surface physics perturbation, flipped
units = none
dimensions = (horizontal_loop_extent,number_of_land_surface_variables_perturbed)
type = real
kind = kind_phys
[zmtnblck]
standard_name = level_of_dividing_streamline
long_name = level of the dividing streamline
Expand Down Expand Up @@ -8085,13 +8117,6 @@
dimensions = (horizontal_loop_extent,vertical_dimension)
type = real
kind = kind_phys
[dtdtc]
standard_name = tendency_of_air_temperature_due_to_radiative_heating_assuming_clear_sky
long_name = clear sky radiative (shortwave + longwave) heating rate at current time
units = K s-1
dimensions = (horizontal_loop_extent,vertical_dimension)
type = real
kind = kind_phys
[dtsfc1]
standard_name = instantaneous_surface_upward_sensible_heat_flux
long_name = surface upward sensible heat flux
Expand Down
22 changes: 22 additions & 0 deletions ccpp/driver/GFS_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2033,6 +2033,28 @@ subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop
ExtDiag(idx)%data(nb)%var3 => IntDiag(nb)%shum_wts(:,:)
enddo

idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'sfc_wts1'
ExtDiag(idx)%desc = 'perturbation amplitude'
ExtDiag(idx)%unit = 'none'
ExtDiag(idx)%mod_name = 'gfs_phys'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%sfc_wts(:,1)
enddo

idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'sfc_wts2'
ExtDiag(idx)%desc = 'perturbation amplitude'
ExtDiag(idx)%unit = 'none'
ExtDiag(idx)%mod_name = 'gfs_phys'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => IntDiag(nb)%sfc_wts(:,2)
enddo

idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'ca1'
Expand Down
Loading