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

Updated land perturbation scheme #148

Merged
merged 34 commits into from
Aug 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6587ec6
update to pre-existing land perts scheme, ready for addition of the n…
ClaraDraper-NOAA Mar 20, 2020
c136caf
updates to land perts scheme, so that namelist input and control_type…
ClaraDraper-NOAA Mar 25, 2020
b0315a7
minor bug fix GFS_typedefs.meta
ClaraDraper-NOAA Mar 26, 2020
8c7305c
updating .gitmodules to my repository for ccpp-physics
ClaraDraper-NOAA Mar 26, 2020
069b58e
Revert "updating .gitmodules to my repository for ccpp-physics"
ClaraDraper-NOAA Mar 26, 2020
5a20c62
update gitmodules to point to my ccpp
ClaraDraper-NOAA Mar 26, 2020
1cef958
ccpp updates to old sfc pert team - does not compile
ClaraDraper-NOAA Apr 1, 2020
142a549
replace my fork with NCAR to fix clone
ClaraDraper-NOAA Apr 1, 2020
472f674
correcting missed ccp push
ClaraDraper-NOAA Apr 8, 2020
a5c653a
Phil's ccpp changes
ClaraDraper-NOAA Apr 8, 2020
6da74eb
correcting to my ccpp branch
ClaraDraper-NOAA Apr 15, 2020
5c2669b
rebasing ccpp for upstream changes
ClaraDraper-NOAA Apr 16, 2020
ef26a23
Merge commit '9b5a420cf6878cd9db391337d68c252cc0c2a905' into csd-fv3-…
ClaraDraper-NOAA Apr 16, 2020
5c57a58
minor bug fix
ClaraDraper-NOAA Apr 16, 2020
4cc6e04
Lndp updates, including moving around the calling structure.
ClaraDraper-NOAA Jun 25, 2020
c2b4d20
Merge commit '6c217fcbebf026a91fb178cf98a11a27cf5fe19f' into csd-fv3-…
ClaraDraper-NOAA Jun 30, 2020
03332e0
lndp clean-up
ClaraDraper-NOAA Jul 20, 2020
35df12e
lndp submodule clean-up
ClaraDraper-NOAA Jul 20, 2020
458e5be
Updated submodules for merge.
ClaraDraper-NOAA Jul 20, 2020
f52214d
Merge commit 'f053db29aff82456d081dda17a4962dd93ab39c5' into csd-fv3-…
ClaraDraper-NOAA Jul 20, 2020
02160db
Merge commit 'f053db29aff82456d081dda17a4962dd93ab39c5' into csd-fv3-…
ClaraDraper-NOAA Jul 20, 2020
4856f8f
cleaning-up messed up commit.
ClaraDraper-NOAA Jul 26, 2020
2fdca27
Merge branch 'temp' into csd-fv3-sfcpert
ClaraDraper-NOAA Jul 26, 2020
bba8815
Fixed typo in vegfrac name
ClaraDraper-NOAA Jul 27, 2020
dee00b4
reverting to NCAR's ccpp-framework repository.
ClaraDraper-NOAA Jul 28, 2020
e268506
ccpp/physics merge to latest
ClaraDraper-NOAA Aug 11, 2020
25a039e
Merge commit '1959bdedfa2149bf668b85771b8840db665745ec' into csd-fv3-…
ClaraDraper-NOAA Aug 11, 2020
9aa3e37
Merge commit '0975bb669bb911d2eec9cd6cf5c3dd8a78108dcf' into csd-fv3-…
ClaraDraper-NOAA Aug 25, 2020
60d6b32
updated submodules
ClaraDraper-NOAA Aug 25, 2020
e56e33a
deleted GFS_land_perts.F90 (moved to stochastic_physics)
ClaraDraper-NOAA Aug 25, 2020
3177ce1
Removing FV3 dependency from stochastic_physics, and into wrapper
ClaraDraper-NOAA Aug 26, 2020
6e6658e
Fix linker problem in gfsphysics/CMakeLists.txt by removing physics/p…
climbfuji Aug 11, 2020
71ca8e4
edits to compile with gnumake
ClaraDraper-NOAA Aug 27, 2020
4e6e1b0
Revert change to .gitmodules for ccpp-physics and update submodule po…
ClaraDraper-NOAA Aug 30, 2020
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.git
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reverting .gitmodules to where it was originally (the new version in this PR is how it should be, no need to add .git and also good to remove the unnecessary double whitespace and the trailing whitespace below.

branch = master
url = https://github.com/NCAR/ccpp-physics
branch = master
7 changes: 5 additions & 2 deletions atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ subroutine update_atmos_radiation_physics (Atmos)
#endif

!--- call stochastic physics pattern generation / cellular automata
call stochastic_physics_wrapper(IPD_Control, IPD_Data, Atm_block)
call stochastic_physics_wrapper(IPD_Control, IPD_Data, Atm_block, ierr)
if (ierr/=0) call mpp_error(FATAL, 'Call to stochastic_physics_wrapper failed')

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding these error checks.


!--- if coupled, assign coupled fields

Expand Down Expand Up @@ -628,7 +630,8 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step)
#endif

!--- Initialize stochastic physics pattern generation / cellular automata for first time step
call stochastic_physics_wrapper(IPD_Control, IPD_Data, Atm_block)
call stochastic_physics_wrapper(IPD_Control, IPD_Data, Atm_block, ierr)
if (ierr/=0) call mpp_error(FATAL, 'Call to stochastic_physics_wrapper failed')

Atmos%Diag => IPD_Diag

Expand Down
2 changes: 1 addition & 1 deletion ccpp/framework
Submodule framework updated 0 files
1 change: 0 additions & 1 deletion gfsphysics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ endif()
set(CCPP_SOURCES
physics/mersenne_twister.f
physics/namelist_soilveg.f
physics/physparam.f
physics/set_soilveg.f

physics/noahmp_tables.f90
Expand Down
1 change: 1 addition & 0 deletions gfsphysics/GFS_layer/GFS_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ subroutine GFS_time_vary_step (Model, Statein, Stateout, Sfcprop, Coupling, &
if (mod(Model%kdt,Model%nscyc) == 1) THEN
call gcycle (nblks, Model, Grid(:), Sfcprop(:), Cldprop(:))
endif
! if not updating surface params through fcast, perturb params once at start of fcast
endif

!--- determine if diagnostics buckets need to be cleared
Expand Down
55 changes: 26 additions & 29 deletions gfsphysics/GFS_layer/GFS_physics_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ subroutine GFS_physics_driver &
real :: pshltr,QCQ,rh02
real(kind=kind_phys), allocatable, dimension(:,:) :: den

real(kind=kind_phys) :: lndp_vgf
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point we agreed to no longer accept changes to IPD unless they are backports of GFS v16 implementation bug fixes. Just mentioning it here, but I am not going to ask you to change anything.

!! Initialize local variables (for debugging purposes only,
!! because the corresponding variables Interstitial(nt)%...
!! are reset to zero every time).
Expand Down Expand Up @@ -928,34 +929,28 @@ subroutine GFS_physics_driver &
! alb1d(i) = zero
vegf1d(i) = zero
enddo
if (Model%do_sfcperts) then
if (Model%pertz0(1) > zero) then
z01d(:) = Model%pertz0(1) * Coupling%sfc_wts(:,1)
! if (me == 0) print*,'Coupling%sfc_wts(:,1) min and max',minval(Coupling%sfc_wts(:,1)),maxval(Coupling%sfc_wts(:,1))
! if (me == 0) print*,'z01d min and max ',minval(z01d),maxval(z01d)
endif
if (Model%pertzt(1) > zero) then
zt1d(:) = Model%pertzt(1) * Coupling%sfc_wts(:,2)
endif
if (Model%pertshc(1) > zero) then
bexp1d(:) = Model%pertshc(1) * Coupling%sfc_wts(:,3)
endif
if (Model%pertlai(1) > zero) then
xlai1d(:) = Model%pertlai(1) * Coupling%sfc_wts(:,4)
endif
! --- do the albedo percentile calculation in GFS_radiation_driver instead --- !
! if (Model%pertalb(1) > zero) then
! do i=1,im
! call cdfnor(Coupling%sfc_wts(i,5),cdfz)
! alb1d(i) = cdfz
! enddo
! endif
if (Model%pertvegf(1) > zero) then
do i=1,im
call cdfnor(Coupling%sfc_wts(i,6),cdfz)
vegf1d(i) = cdfz
enddo
endif
lndp_vgf=-999.

if (Model%lndp_type==1) then
do k =1,Model%n_var_lndp
select case(Model%lndp_var_list(k))
case ('rz0')
z01d(:) = Model%lndp_prt_list(k)* Coupling%sfc_wts(:,k)
case ('rzt')
zt1d(:) = Model%lndp_prt_list(k)* Coupling%sfc_wts(:,k)
case ('shc')
bexp1d(:) = Model%lndp_prt_list(k) * Coupling%sfc_wts(:,k)
case ('lai')
xlai1d(:) = Model%lndp_prt_list(k)* Coupling%sfc_wts(:,k)
case ('vgf')
! note that the pertrubed vegfrac is being used in sfc_drv, but not sfc_diff
do i=1,im
call cdfnor(Coupling%sfc_wts(i,k),cdfz)
vegf1d(i) = cdfz
enddo
lndp_vgf = Model%lndp_prt_list(k)
end select
enddo
endif
!*## CCPP ##
!
Expand Down Expand Up @@ -1856,6 +1851,7 @@ subroutine GFS_physics_driver &
! &,' pgr=',pgr(ipr),' sfcemis=',sfcemis(ipr)

!## CCPP ##* sfc_drv.f/lsm_noah_run

call sfc_drv &
! --- inputs:
(im, lsoil, Statein%pgr, &
Expand All @@ -1867,7 +1863,8 @@ subroutine GFS_physics_driver &
Sfcprop%shdmin, Sfcprop%shdmax, Sfcprop%snoalb, &
Radtend%sfalb, flag_iter, flag_guess, Model%lheatstrg, &
Model%isot, Model%ivegsrc, &
bexp1d, xlai1d, vegf1d, Model%pertvegf, &
bexp1d, xlai1d, vegf1d,lndp_vgf, &

! --- input/output:
weasd3(:,1), snowd3(:,1), tsfc3(:,1), tprcp3(:,1), &
Sfcprop%srflag, smsoil, stsoil, slsoil, Sfcprop%canopy, &
Expand Down
21 changes: 13 additions & 8 deletions gfsphysics/GFS_layer/GFS_radiation_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,7 @@ subroutine GFS_radiation_driver &

! mg, sfc perts
real(kind=kind_phys), dimension(size(Grid%xlon,1)) :: alb1d
real(kind=kind_phys) :: lndp_alb
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as for GFS_physics_driver.F90.


real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+ltp) :: cldtausw
real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+ltp) :: cldtaulw
Expand Down Expand Up @@ -1846,14 +1847,18 @@ subroutine GFS_radiation_driver &
! --- scale random patterns for surface perturbations with
! perturbation size
! --- turn vegetation fraction pattern into percentile pattern
alb1d(:) = zero
if (Model%do_sfcperts) then
if (Model%pertalb(1) > zero) then
do i=1,im
call cdfnor(Coupling%sfc_wts(i,5),alb1d(i))
enddo
alb1d(:) = 0.
lndp_alb = -999.
if (Model%lndp_type ==1) then
do k =1,Model%n_var_lndp
if (Model%lndp_var_list(k) == 'alb') then
do i=1,im
call cdfnor(Coupling%sfc_wts(i,k),alb1d(i))
lndp_alb = Model%lndp_prt_list(k)
enddo
endif
enddo
endif
endif
! mg, sfc-perts
!*## CCPP ##

Expand All @@ -1870,7 +1875,7 @@ subroutine GFS_radiation_driver &
Sfcprop%alnsf, Sfcprop%alvwf, Sfcprop%alnwf, &
Sfcprop%facsf, Sfcprop%facwf, Sfcprop%fice, &
Sfcprop%tisfc, IM, &
alb1d, Model%pertalb, & ! mg, sfc-perts
alb1d, lndp_alb, & ! mg, sfc-perts
sfcalb) ! --- outputs

!> -# Approximate mean surface albedo from vis- and nir- diffuse values.
Expand Down
55 changes: 23 additions & 32 deletions gfsphysics/GFS_layer/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,6 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: skebu_wts (:,:) => null() !
real (kind=kind_phys), pointer :: skebv_wts (:,:) => null() !
real (kind=kind_phys), pointer :: sfc_wts (:,:) => null() ! mg, sfc-perts
integer :: nsfcpert=6 !< number of sfc perturbations

!--- aerosol surface emissions for Thompson microphysics
real (kind=kind_phys), pointer :: nwfa2d (:) => null() !< instantaneous water-friendly sfc aerosol source
Expand Down Expand Up @@ -1045,14 +1044,14 @@ module GFS_typedefs
logical :: do_shum
logical :: do_skeb
integer :: skeb_npass
logical :: do_sfcperts
integer :: nsfcpert=6
real(kind=kind_phys) :: pertz0(5) ! mg, sfc-perts
real(kind=kind_phys) :: pertzt(5) ! mg, sfc-perts
real(kind=kind_phys) :: pertshc(5) ! mg, sfc-perts
real(kind=kind_phys) :: pertlai(5) ! mg, sfc-perts
real(kind=kind_phys) :: pertalb(5) ! mg, sfc-perts
real(kind=kind_phys) :: pertvegf(5) ! mg, sfc-perts
integer :: lndp_type
integer :: n_var_lndp
character(len=3) :: lndp_var_list(6) ! dimension here must match n_var_max_lndp in stochy_nml_def
real(kind=kind_phys) :: lndp_prt_list(6) ! dimension here must match n_var_max_lndp in stochy_nml_def
! also previous code had dimension 5 for each pert, to allow
! multiple patterns. It wasn't fully coded (and wouldn't have worked
! with nlndp>1, so I just dropped it). If we want to code it properly,
! we'd need to make this dim(6,5).
!--- tracer handling
character(len=32), pointer :: tracer_names(:) !< array of initialized tracers from dynamic core
integer :: ntrac !< number of tracers
Expand Down Expand Up @@ -1948,6 +1947,8 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: uustar_ocean(:) => null() !<
real (kind=kind_phys), pointer :: vdftra(:,:,:) => null() !<
real (kind=kind_phys), pointer :: vegf1d(:) => null() !<
real (kind=kind_phys) :: lndp_vgf !<

integer, pointer :: vegtype(:) => null() !<
real (kind=kind_phys), pointer :: w_upi(:,:) => null() !<
real (kind=kind_phys), pointer :: wcbmax(:) => null() !<
Expand Down Expand Up @@ -2800,9 +2801,9 @@ subroutine coupling_create (Coupling, IM, Model)
Coupling%skebv_wts = clear_val
endif

!--- stochastic physics option
if (Model%do_sfcperts) then
allocate (Coupling%sfc_wts (IM,Model%nsfcpert))
!--- stochastic land perturbation option
if (Model%lndp_type .NE. 0) then
allocate (Coupling%sfc_wts (IM,Model%n_var_lndp))
Coupling%sfc_wts = clear_val
endif

Expand Down Expand Up @@ -3314,15 +3315,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
logical :: use_zmtnblck = .false.
logical :: do_shum = .false.
logical :: do_skeb = .false.
integer :: skeb_npass = 11
logical :: do_sfcperts = .false. ! mg, sfc-perts
integer :: nsfcpert = 6 ! mg, sfc-perts
real(kind=kind_phys) :: pertz0 = -999.
real(kind=kind_phys) :: pertzt = -999.
real(kind=kind_phys) :: pertshc = -999.
real(kind=kind_phys) :: pertlai = -999.
real(kind=kind_phys) :: pertalb = -999.
real(kind=kind_phys) :: pertvegf = -999.
integer :: skeb_npass = 11
integer :: lndp_type = 0
integer :: n_var_lndp = 0

!--- aerosol scavenging factors
character(len=20) :: fscav_aero(20) = 'default'
Expand Down Expand Up @@ -3399,7 +3394,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
do_deep, jcap, &
cs_parm, flgmin, cgwf, ccwf, cdmbgwd, sup, ctei_rm, crtrh, &
dlqf, rbcr, shoc_parm, psauras, prauras, wminras, &
do_sppt, do_shum, do_skeb, do_sfcperts, &
do_sppt, do_shum, do_skeb, lndp_type, n_var_lndp, &
!--- Rayleigh friction
prslrd0, ral_ts, ldiag_ugwp, do_ugwp, do_tofd, &
! --- Ferrier-Aligo
Expand Down Expand Up @@ -4007,21 +4002,15 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%e0fac = e0fac

!--- stochastic physics options
! do_sppt, do_shum, do_skeb and do_sfcperts are namelist variables in group
! do_sppt, do_shum, do_skeb and lndp_type are namelist variables in group
! 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%use_zmtnblck = use_zmtnblck
Model%do_shum = do_shum
Model%do_skeb = do_skeb
Model%do_sfcperts = do_sfcperts ! mg, sfc-perts
Model%nsfcpert = nsfcpert ! mg, sfc-perts
Model%pertz0 = pertz0
Model%pertzt = pertzt
Model%pertshc = pertshc
Model%pertlai = pertlai
Model%pertalb = pertalb
Model%pertvegf = pertvegf
Model%lndp_type = lndp_type
Model%n_var_lndp = n_var_lndp

!--- cellular automata options
Model%nca = nca
Expand Down Expand Up @@ -5075,7 +5064,8 @@ subroutine control_print(Model)
print *, ' do_sppt : ', Model%do_sppt
print *, ' do_shum : ', Model%do_shum
print *, ' do_skeb : ', Model%do_skeb
print *, ' do_sfcperts : ', Model%do_sfcperts
print *, ' lndp_type : ', Model%lndp_type
print *, ' n_var_lndp : ', Model%n_var_lndp
print *, ' '
print *, 'cellular automata'
print *, ' nca : ', Model%nca
Expand Down Expand Up @@ -7015,6 +7005,7 @@ subroutine interstitial_phys_reset (Interstitial, Model)
Interstitial%uustar_ocean = huge
Interstitial%vdftra = clear_val
Interstitial%vegf1d = clear_val
Interstitial%lndp_vgf = clear_val
Interstitial%vegtype = 0
Interstitial%wcbmax = clear_val
Interstitial%weasd_ice = huge
Expand Down
Loading