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

Sm nov222021 #824

Merged
merged 47 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
738ce45
Merge branch 'SM_Sept21_PR' of https://github.com/SMoorthi-emc/ccpp-p…
SMoorthi-emc Oct 1, 2021
cc1cbe7
Merge branch 'SM_Sept21_PR' of https://github.com/SMoorthi-emc/ccpp-p…
SMoorthi-emc Oct 1, 2021
24884b0
Merge branch 'SM_Sep142021' of https://github.com/SMoorthi-emc/ccpp-p…
SMoorthi-emc Oct 5, 2021
949ca84
reverting to my versions of GFS_rrtmgp_*post.F90 files
SMoorthi-emc Oct 10, 2021
215c80e
additional updates to emissivity calculation etc
SMoorthi-emc Oct 15, 2021
3d9b79c
updating .gitmodules
SMoorthi-emc Oct 20, 2021
c557c33
Merge branch 'SM_Sep142021' of https://github.com/SMoorthi-emc/ccpp-p…
SMoorthi-emc Oct 20, 2021
6ae5461
after merging wiht SM_Sept21_PR
SMoorthi-emc Oct 20, 2021
c4c8bad
changes consistent with branch SM_Sept21_PR
SMoorthi-emc Oct 20, 2021
52ca358
Merge remote-tracking branch 'upstream/main' into SM_Sep142021
SMoorthi-emc Oct 25, 2021
d71cd82
Merge remote-tracking branch 'upstream/main' into SM_Sep142021
SMoorthi-emc Oct 27, 2021
7482c15
Merge remote-tracking branch 'upstream/main' into SM_Sep142021
SMoorthi-emc Oct 28, 2021
3d9d437
Merge remote-tracking branch 'upstream/main' into SM_Sep142021
SMoorthi-emc Oct 29, 2021
c458be1
after merging with ccpp/main
SMoorthi-emc Nov 4, 2021
3233eba
after submodule sync
SMoorthi-emc Nov 4, 2021
cf05d9d
Merge branch 'SM_Sep142021' of https://github.com/SMoorthi-emc/ccpp-p…
SMoorthi-emc Nov 8, 2021
a34ad95
Merge remote-tracking branch 'upstream/main' into SM_Sep142021
SMoorthi-emc Nov 10, 2021
5ea113c
Merge remote-tracking branch 'upstream/main' into SM_Sep142021
SMoorthi-emc Nov 12, 2021
25f84dc
Merge remote-tracking branch 'upstream/main' into SM_Sep142021
SMoorthi-emc Nov 19, 2021
ce37043
Merge branch 'SM_Sep142021' of https://github.com/SMoorthi-emc/ccpp-p…
SMoorthi-emc Nov 20, 2021
4cbfa30
Merge remote-tracking branch 'upstream/main' into SM_Sep142021
SMoorthi-emc Nov 23, 2021
7822e9c
Merge remote-tracking branch 'upstream/main' into SM_Nov222021
SMoorthi-emc Nov 24, 2021
49bf5c4
some cosmetic change in mg3
SMoorthi-emc Nov 24, 2021
c41612c
adding/removing some blanks in sfc_sice
SMoorthi-emc Nov 30, 2021
d88751b
Merge remote-tracking branch 'upstream/main' into SM_Nov222021
SMoorthi-emc Dec 1, 2021
f51ee84
Merge remote-tracking branch 'upstream/main' into SM_Nov222021
SMoorthi-emc Dec 2, 2021
4c62ee2
cleanup/fix GFS_surface_composites
SMoorthi-emc Dec 5, 2021
083a2ff
Merge remote-tracking branch 'upstream/main' into SM_Nov222021
SMoorthi-emc Dec 6, 2021
b8a6380
after merging with ccpp-physics/main
SMoorthi-emc Dec 10, 2021
326b852
Merge remote-tracking branch 'upstream/main' into SM_Nov222021
SMoorthi-emc Dec 11, 2021
7aa8caa
some cosmetic change in a routine
SMoorthi-emc Dec 11, 2021
52709ac
Merge remote-tracking branch 'upstream/main' into SM_Nov222021
SMoorthi-emc Dec 13, 2021
2de6ce3
Merge remote-tracking branch 'upstream/main' into SM_Nov222021
SMoorthi-emc Dec 14, 2021
61d6292
Merge remote-tracking branch 'upstream/main' into SM_Nov222021
SMoorthi-emc Dec 16, 2021
08a5dcc
Merge remote-tracking branch 'upstream/main' into SM_Nov222021
SMoorthi-emc Dec 20, 2021
07dc9c1
after merge with ccpp-hysics/main
SMoorthi-emc Dec 22, 2021
9cce481
Merge remote-tracking branch 'upstream/main' into SM_Nov222021
SMoorthi-emc Dec 23, 2021
8434333
testing with zorli related change
SMoorthi-emc Dec 25, 2021
12763d6
Merge remote-tracking branch 'upstream/main' into SM_Nov222021
SMoorthi-emc Dec 28, 2021
baad60a
Merge remote-tracking branch 'upstream/main' into SM_Nov222021
SMoorthi-emc Dec 30, 2021
cc0b5dd
Merge remote-tracking branch 'upstream/main' into SM_Nov222021
SMoorthi-emc Jan 5, 2022
88fcf4c
updating GFS_surface_composites to address crash in cpld_debug_p7
SMoorthi-emc Jan 6, 2022
01a91fa
reverting some change
SMoorthi-emc Jan 6, 2022
30a7afd
still more mods
SMoorthi-emc Jan 6, 2022
7a70875
yet more mods
SMoorthi-emc Jan 6, 2022
d187957
Merge remote-tracking branch 'upstream/main' into SM_Nov222021
SMoorthi-emc Jan 7, 2022
8d97f46
fix a typo
SMoorthi-emc Jan 7, 2022
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
34 changes: 17 additions & 17 deletions physics/GFS_rrtmgp_lw_post.F90
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module GFS_rrtmgp_lw_post
module GFS_rrtmgp_lw_post
use machine, only: kind_phys
use module_radlw_parameters, only: topflw_type, sfcflw_type
use mo_heating_rates, only: compute_heating_rate
use radiation_tools, only: check_error_msg
implicit none

public GFS_rrtmgp_lw_post_init,GFS_rrtmgp_lw_post_run,GFS_rrtmgp_lw_post_finalize

contains
Expand All @@ -25,18 +25,18 @@ subroutine GFS_rrtmgp_lw_post_run (nCol, nLev, lslwr, do_lw_clrsky_hr, save_diag
fluxlwDOWN_clrsky, raddt, cldsa, mtopa, mbota, cld_frac, cldtaulw, fluxr, sfcdlw, &
sfculw, sfcflw, tsflw, htrlw, htrlwu, topflw, htrlwc, errmsg, errflg)

! Inputs
integer, intent(in) :: &
! Inputs
integer, intent(in) :: &
nCol, & ! Horizontal loop extent
nLev, & ! Number of vertical layers
iSFC, & ! Vertical index for surface level
iTOA ! Vertical index for TOA level
logical, intent(in) :: &
lslwr, & ! Logical flags for lw radiation calls
do_lw_clrsky_hr, & ! Output clear-sky SW heating-rate?
save_diag ! Output radiation diagnostics?
do_lw_clrsky_hr, & ! Output clear-sky SW heating-rate?
save_diag ! Output radiation diagnostics?
real(kind_phys), intent(in) :: &
fhlwr ! Frequency for SW radiation
fhlwr ! Frequency for SW radiation
real(kind_phys), dimension(nCol), intent(in) :: &
tsfa ! Lowest model layer air temperature for radiation (K)
real(kind_phys), dimension(nCol, nLev), intent(in) :: &
Expand All @@ -50,23 +50,23 @@ subroutine GFS_rrtmgp_lw_post_run (nCol, nLev, lslwr, do_lw_clrsky_hr, save_diag
real(kind_phys), intent(in) :: &
raddt ! Radiation time step
real(kind_phys), dimension(nCol,5), intent(in) :: &
cldsa ! Fraction of clouds for low, middle, high, total and BL
cldsa ! Fraction of clouds for low, middle, high, total and BL
integer, dimension(nCol,3), intent(in) ::&
mbota, & ! vertical indices for low, middle and high cloud tops
mtopa ! vertical indices for low, middle and high cloud bases
real(kind_phys), dimension(nCol,nLev), intent(in) :: &
cld_frac, & ! Total cloud fraction in each layer
cldtaulw ! approx 10.mu band layer cloud optical depth
cldtaulw ! approx 10.mu band layer cloud optical depth

real(kind=kind_phys), dimension(:,:), intent(inout) :: fluxr

! Outputs (mandatory)
real(kind_phys), dimension(nCol), intent(inout) :: &
sfcdlw, & ! Total sky sfc downward lw flux (W/m2)
sfculw, & ! Total sky sfc upward lw flux (W/m2)
tsflw ! surface air temp during lw calculation (K)
type(sfcflw_type), dimension(nCol), intent(inout) :: &
sfcflw ! LW radiation fluxes at sfc
sfcflw ! LW radiation fluxes at sfc
real(kind_phys), dimension(nCol,nLev), intent(inout) :: &
htrlw, & ! LW all-sky heating rate
htrlwu ! Heating-rate updated in-between radiation calls.
Expand All @@ -80,7 +80,7 @@ subroutine GFS_rrtmgp_lw_post_run (nCol, nLev, lslwr, do_lw_clrsky_hr, save_diag
! Outputs (optional)
real(kind_phys),dimension(nCol, nLev),intent(inout),optional :: &
htrlwc ! Longwave clear-sky heating-rate (K/sec)

! Local variables
integer :: i, j, k, itop, ibtc
real(kind_phys) :: tem0d, tem1, tem2
Expand All @@ -92,7 +92,7 @@ subroutine GFS_rrtmgp_lw_post_run (nCol, nLev, lslwr, do_lw_clrsky_hr, save_diag

if (.not. lslwr) return
! #######################################################################################
! Compute LW heating-rates.
! Compute LW heating-rates.
! #######################################################################################
! Clear-sky heating-rate (optional)
if (do_lw_clrsky_hr) then
Expand All @@ -102,7 +102,7 @@ subroutine GFS_rrtmgp_lw_post_run (nCol, nLev, lslwr, do_lw_clrsky_hr, save_diag
p_lev, & ! IN - Pressure @ layer-interfaces (Pa)
htrlwc)) ! OUT - Longwave clear-sky heating rate (K/sec)
endif

! All-sky heating-rate (mandatory)
call check_error_msg('GFS_rrtmgp_post',compute_heating_rate( &
fluxlwUP_allsky, & ! IN - RRTMGP upward longwave all-sky flux profiles (W/m2)
Expand Down Expand Up @@ -136,8 +136,8 @@ subroutine GFS_rrtmgp_lw_post_run (nCol, nLev, lslwr, do_lw_clrsky_hr, save_diag

! #######################################################################################
! Save LW diagnostics
! - For time averaged output quantities (including total-sky and clear-sky SW and LW
! fluxes at TOA and surface; conventional 3-domain cloud amount, cloud top and base
! - For time averaged output quantities (including total-sky and clear-sky SW and LW
! fluxes at TOA and surface; conventional 3-domain cloud amount, cloud top and base
! pressure, and cloud top temperature; aerosols AOD, etc.), store computed results in
! corresponding slots of array fluxr with appropriate time weights.
! - Collect the fluxr data for wrtsfc
Expand Down
58 changes: 30 additions & 28 deletions physics/GFS_rrtmgp_sw_post.F90
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module GFS_rrtmgp_sw_post
module GFS_rrtmgp_sw_post
use machine, only: kind_phys
use module_radiation_aerosols, only: NSPC1
use module_radsw_parameters, only: topfsw_type, sfcfsw_type, cmpfsw_type
use mo_heating_rates, only: compute_heating_rate
use radiation_tools, only: check_error_msg
use rrtmgp_sw_gas_optics, only: sw_gas_props
implicit none

public GFS_rrtmgp_sw_post_init,GFS_rrtmgp_sw_post_run,GFS_rrtmgp_sw_post_finalize

contains
Expand All @@ -31,25 +31,25 @@ subroutine GFS_rrtmgp_sw_post_run (nCol, nLev, nDay, idxday, lsswr, do_sw_clrsky
nirbmdi, nirdfdi, visbmdi, visdfdi, nirbmui, nirdfui, visbmui, visdfui, sfcnsw, &
sfcdsw, htrsw, sfcfsw, topfsw, htrswc, scmpsw, errmsg, errflg)

! Inputs
integer, intent(in) :: &
nCol, & ! Horizontal loop extent
! Inputs
integer, intent(in) :: &
nCol, & ! Horizontal loop extent
nLev, & ! Number of vertical layers
nDay, & ! Number of daylit columns
iSFC, & ! Vertical index for surface level
iTOA ! Vertical index for TOA level
integer, intent(in), dimension(nday) :: &
idxday ! Index array for daytime points
logical, intent(in) :: &
lsswr, & ! Call SW radiation?
do_sw_clrsky_hr, & ! Output clear-sky SW heating-rate?
save_diag ! Output radiation diagnostics?
logical, intent(in) :: &
lsswr, & ! Call SW radiation?
do_sw_clrsky_hr, & ! Output clear-sky SW heating-rate?
save_diag ! Output radiation diagnostics?
real(kind_phys), intent(in) :: &
fhswr ! Frequency for SW radiation
real(kind_phys), dimension(nCol), intent(in) :: &
t_lay, & ! Temperature at model layer centers (K)
coszen, & ! Cosine(SZA)
coszdg ! Cosine(SZA), daytime
coszen, & ! Cosine(SZA)
coszdg ! Cosine(SZA), daytime
real(kind_phys), dimension(nCol, nLev+1), intent(in) :: &
p_lev ! Pressure @ model layer-interfaces (Pa)
real(kind_phys), dimension(sw_gas_props%get_nband(),ncol), intent(in) :: &
Expand All @@ -65,9 +65,9 @@ subroutine GFS_rrtmgp_sw_post_run (nCol, nLev, nDay, idxday, lsswr, do_sw_clrsky
real(kind_phys), intent(in) :: &
raddt ! Radiation time step
real(kind_phys), dimension(nCol,NSPC1), intent(in) :: &
aerodp ! Vertical integrated optical depth for various aerosol species
aerodp ! Vertical integrated optical depth for various aerosol species
real(kind_phys), dimension(nCol,5), intent(in) :: &
cldsa ! Fraction of clouds for low, middle, high, total and BL
cldsa ! Fraction of clouds for low, middle, high, total and BL
integer, dimension(nCol,3), intent(in) ::&
mbota, & ! vertical indices for low, middle and high cloud tops
mtopa ! vertical indices for low, middle and high cloud bases
Expand All @@ -81,10 +81,10 @@ subroutine GFS_rrtmgp_sw_post_run (nCol, nLev, nDay, idxday, lsswr, do_sw_clrsky
! nirbm - downward nir direct beam flux (W/m2)
! nirdf - downward nir diffused flux (W/m2)
! visbm - downward uv+vis direct beam flux (W/m2)
! visdf - downward uv+vis diffused flux (W/m2)
! visdf - downward uv+vis diffused flux (W/m2)

real(kind=kind_phys), dimension(:,:), intent(inout) :: fluxr

! Outputs (mandatory)
real(kind_phys), dimension(nCol), intent(inout) :: &
nirbmdi, & ! sfc nir beam sw downward flux (W/m2)
Expand All @@ -94,7 +94,7 @@ subroutine GFS_rrtmgp_sw_post_run (nCol, nLev, nDay, idxday, lsswr, do_sw_clrsky
nirbmui, & ! sfc nir beam sw upward flux (W/m2)
nirdfui, & ! sfc nir diff sw upward flux (W/m2)
visbmui, & ! sfc uv+vis beam sw upward flux (W/m2)
visdfui, & ! sfc uv+vis diff sw upward flux (W/m2)
visdfui, & ! sfc uv+vis diff sw upward flux (W/m2)
sfcnsw, & ! total sky sfc netsw flx into ground
sfcdsw !
real(kind_phys), dimension(nCol,nLev), intent(inout) :: &
Expand All @@ -111,7 +111,7 @@ subroutine GFS_rrtmgp_sw_post_run (nCol, nLev, nDay, idxday, lsswr, do_sw_clrsky
! Outputs (optional)
real(kind_phys),dimension(nCol, nLev),intent(inout),optional :: &
htrswc ! Clear-sky heating rate (K/s)

! Local variables
integer :: i, j, k, itop, ibtc
real(kind_phys) :: tem0d, tem1, tem2
Expand Down Expand Up @@ -182,15 +182,17 @@ subroutine GFS_rrtmgp_sw_post_run (nCol, nLev, nDay, idxday, lsswr, do_sw_clrsky
htrsw(:,:) = 0.0
sfcfsw = sfcfsw_type( 0.0, 0.0, 0.0, 0.0 )
topfsw = topfsw_type( 0.0, 0.0, 0.0 )
nirbmdi(:) = 0.0
nirdfdi(:) = 0.0
visbmdi(:) = 0.0
visdfdi(:) = 0.0
nirbmui(:) = 0.0
nirdfui(:) = 0.0
visbmui(:) = 0.0
visdfui(:) = 0.0

do i=1,nCol
nirbmdi(i) = 0.0
nirdfdi(i) = 0.0
visbmdi(i) = 0.0
visdfdi(i) = 0.0
nirbmui(i) = 0.0
nirdfui(i) = 0.0
visbmui(i) = 0.0
visdfui(i) = 0.0
enddo

if (do_sw_clrsky_hr) then
htrswc(:,:) = 0
endif
Expand Down Expand Up @@ -236,7 +238,7 @@ subroutine GFS_rrtmgp_sw_post_run (nCol, nLev, nDay, idxday, lsswr, do_sw_clrsky
fluxr(i,27) = fluxr(i,27) + nirdfdi(i) * tem0d ! nir diff sw dn
! SW clear-sky fluxes
fluxr(i,29) = fluxr(i,29) + topfsw(i)%upfx0 * tem0d
fluxr(i,31) = fluxr(i,31) + sfcfsw(i)%upfx0 * tem0d
fluxr(i,31) = fluxr(i,31) + sfcfsw(i)%upfx0 * tem0d
fluxr(i,32) = fluxr(i,32) + sfcfsw(i)%dnfx0 * tem0d
endif
enddo
Expand Down
35 changes: 18 additions & 17 deletions physics/GFS_surface_composites.F90
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, fra
uustar_wat(i) = uustar(i)
tsfc_wat(i) = tsfco(i)
tsurf_wat(i) = tsfco(i)
zorlo(i) = max(1.0e-5, min(one, zorlo(i)))
! DH*
else
zorlo(i) = huge
Expand All @@ -233,6 +234,7 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, fra
tsurf_ice(i) = tisfc(i)
ep1d_ice(i) = zero
gflx_ice(i) = zero
zorli(i) = max(1.0e-5, min(one, zorli(i)))
! DH*
else
zorli(i) = huge
Expand All @@ -256,39 +258,38 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, fra
endif
enddo
!
if (.not. cplflx .or. kdt == 1) then
if (frac_grid) then
do i=1,im
if (dry(i)) then
if (icy(i)) then
if (frac_grid) then
do i=1,im
if (dry(i)) then
if (icy(i)) then
if (kdt == 1 .or. (.not. cplflx .or. lakefrac(i) > zero)) then
tem = one / (cice(i)*(one-frland(i)))
snowd_ice(i) = max(zero, (snowd(i) - snowd_lnd(i)*frland(i)) * tem)
weasd_ice(i) = max(zero, (weasd(i) - weasd_lnd(i)*frland(i)) * tem)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Moorthi, with RUC LSM snowd_ice and weasd_ice should not be recomputed here because they are computed internally. I think we have to add to the condition in brackets: lsm /= lsm_ruc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Tanya,
I think all LSM's are called after calling this routine. As long as grid mean values are computed correctly, there should be no issue. When the coupled model is used, it is different. This loop takes care of the case when there is a new icy points if they happen to be defined within this routine.
Moorthi

Copy link
Collaborator

Choose a reason for hiding this comment

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

Moorthi, the snow depth on the land and ice fractions could be very different, and because RUC LSM computes both weasd_ice and weasd_lnd, it wants to carry them along separately. Therefore, they should not be recomputed here from the grid mean when RUC LSM is used. The grid mean snow depth could be used as the diagnostics variable, convenient for plotting.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I originally wanted to do this computation on only new icy points, but unfortunately, there is no memory of previous "icy" points. I should also point out that "sfc_sice.f" also computes ice point variables, just like RUC does. While the computation here is not necessary for the icy points that remain icy, it does not hurt.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Again, this is not special to RUC as what you stated is true for non-RUC also as in those cases ice is computed in sfc_sice.f
Well, I welcome anyone to come up with better alternative.
I should point out that this is already happening in the current code- so this should not be a point for rejecting my update as it improves on what currently exists.

endif
elseif (icy(i)) then
endif
elseif (icy(i)) then
if (kdt == 1 .or. (.not. cplflx .or. lakefrac(i) > zero)) then
tem = one / cice(i)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, with RUC LSM it should not be done.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just disagree.

snowd_lnd(i) = zero
snowd_ice(i) = snowd(i) * tem
weasd_lnd(i) = zero
weasd_ice(i) = weasd(i) * tem
endif
enddo
else
do i=1,im
if (dry(i)) then
snowd_lnd(i) = snowd(i)
weasd_lnd(i) = weasd(i)
snowd_ice(i) = zero
weasd_ice(i) = zero
elseif (icy(i)) then
endif
enddo
else
do i=1,im
if (icy(i)) then
if (kdt == 1 .or. (.not. cplflx .or. lakefrac(i) > zero)) then
snowd_lnd(i) = zero
weasd_lnd(i) = zero
tem = one / cice(i)
snowd_ice(i) = snowd(i) * tem
weasd_ice(i) = weasd(i) * tem
endif
enddo
endif
endif
enddo
endif

! write(0,*)' minmax of ice snow=',minval(snowd_ice),maxval(snowd_ice)
Expand Down
Loading