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 sfc_nst.f, sfc_nst.meta, module_nst_water_prop.f90 and flake_… #588

Merged
merged 43 commits into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
55d395f
Updated sfc_nst.f, sfc_nst.meta, module_nst_water_prop.f90 and flake_…
YihuaWu-NOAA Mar 8, 2021
8c60ce5
Remove/replace interstitial zorl composites with persistent versions
climbfuji Mar 17, 2021
f1d12c5
Merge branch 'master' of https://github.com/NCAR/ccpp-physics into re…
climbfuji Mar 17, 2021
20e1ae8
Merge branch 'master' of https://github.com/NCAR/ccpp-physics into re…
climbfuji Mar 18, 2021
26340ba
Updated sfc_nst.f & sfc_nst.meta
YihuaWu-NOAA Mar 18, 2021
17ccdcf
Updated sfc_nst.f to remove unnecessary statements
YihuaWu-NOAA Mar 18, 2021
0ee9504
Merge remote-tracking branch 'upstream/master' into flake
YihuaWu-NOAA Apr 1, 2021
465167f
Removed a line not needed
YihuaWu-NOAA Apr 1, 2021
8f78249
Added comments to briefily describe some temporary variables in the code
YihuaWu-NOAA Apr 1, 2021
68bf580
Speed up aeerosol interpolation and Noah MP initialization using OpenMP
climbfuji Apr 2, 2021
15575af
Merge branch 'master' of https://github.com/NCAR/ccpp-physics into th…
climbfuji Apr 2, 2021
c8b70e9
physics/GFS_debug.*: add roughness length variables to GFS_checkland
climbfuji Apr 2, 2021
f4cf862
Cleanup formatting and unused variables in physics/GFS_suite_intersti…
climbfuji Apr 2, 2021
347104a
physics/GFS_phys_time_vary.fv3.F90: remove variable that was used for…
climbfuji Apr 2, 2021
edc9194
Temporary commit: conditionally set zorlx variables to huge in GFS_su…
climbfuji Apr 2, 2021
bc78c25
Merge branch 'master' of https://github.com/NCAR/ccpp-physics into re…
climbfuji Apr 2, 2021
267748a
Rename Fortran variables and CCPP standard names / long names of surf…
climbfuji Apr 5, 2021
3f953f5
physics/GFS_debug.F90: rename Sfcprop%zorlw to Sfcprop%zorlwav, remov…
climbfuji Apr 5, 2021
7f42a8f
Merge branch 'remove_zorl_interstitial' of https://github.com/climbfu…
climbfuji Apr 5, 2021
7f70536
physics/GFS_debug.*: rename land surface composite DDT members from _…
climbfuji Apr 5, 2021
222ffe6
Merge branch 'master' of https://github.com/NCAR/ccpp-physics into th…
climbfuji Apr 9, 2021
56c8d3a
Do not use OpenMP in physics/aerinterp.F90 with gfortran (compatibili…
climbfuji Apr 9, 2021
6b99742
Bugfix in physics/GFS_phys_time_vary.fv3.F90, add missing 'if (iaercl…
climbfuji Apr 9, 2021
334e245
Updating to head of upstream
YihuaWu-NOAA Apr 12, 2021
7adb61f
Fixed conflicts
YihuaWu-NOAA Apr 12, 2021
e1f6417
Fixed errors created during merge processes
YihuaWu-NOAA Apr 13, 2021
6a08c3a
Fixed some code errors caused during merging processes
YihuaWu-NOAA Apr 13, 2021
dfeb51c
Merge branch 'flake' of https://github.com/YihuaWu-NOAA/ccpp-physics …
YihuaWu-NOAA Apr 13, 2021
a81cdb9
Corrected merge error
YihuaWu-NOAA Apr 13, 2021
2742ece
Merge branch 'flake' of https://github.com/YihuaWu-NOAA/ccpp-physics …
YihuaWu-NOAA Apr 13, 2021
5411d4d
Fixed some issues
YihuaWu-NOAA Apr 13, 2021
8cd133d
Modified code based on Moorthi's commits: recoded the polynomial equ…
YihuaWu-NOAA Apr 14, 2021
e46fe37
Merge branch 'rename_surface_composites_ocean_water' of https://githu…
climbfuji Apr 14, 2021
80ae761
Recoded the polynomial equation and redefined lake as use_flake
YihuaWu-NOAA Apr 14, 2021
bc75cd5
Merge branch 'flake' of https://github.com/YihuaWu-NOAA/ccpp-physics …
YihuaWu-NOAA Apr 14, 2021
26aa3d6
Merge pull request #623 from climbfuji/zorl_ocnwat_merra2_combined
climbfuji Apr 15, 2021
e20ad29
Corrected the orders of three parameters
YihuaWu-NOAA Apr 15, 2021
aa73104
Updated to head of upstream
YihuaWu-NOAA Apr 15, 2021
3163fbc
Merge branch 'flake' of https://github.com/YihuaWu-NOAA/ccpp-physics …
YihuaWu-NOAA Apr 15, 2021
59ab0cd
Updated flake physics
YihuaWu-NOAA Apr 15, 2021
b53829d
Updated flake physics
YihuaWu-NOAA Apr 16, 2021
b657923
Merge branch 'flake' of https://github.com/YihuaWu-NOAA/ccpp-physics …
YihuaWu-NOAA Apr 16, 2021
2d3b3c4
Reserved a part of the code
YihuaWu-NOAA Apr 16, 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
17 changes: 15 additions & 2 deletions physics/flake_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ SUBROUTINE flake_driver_run ( &
REAL (KIND = kind_phys) :: &
lake_depth_max, T_bot_2_in, T_bot_2_out, dxlat,tb,tr,tt,temp,Kbar, DelK


REAL (KIND = kind_phys) :: x, y

INTEGER :: i,ipr,iter

LOGICAL :: lflk_botsed_use
Expand Down Expand Up @@ -237,9 +240,19 @@ SUBROUTINE flake_driver_run ( &
! else
! T_sfc(i) = tsurf(i)
! endif
T_sfc(i) = 0.2*tt + 0.8* tsurf(i)
T_sfc(i) = 0.1*tt + 0.9* tsurf(i)
endif

x = 0.03279*julian
if(xlat(i) .ge. 0.0) then
y = 0.0034*x**5 -0.1241*x**4+1.6231*x**3-8.8666*x**2+17.206*x-4.2929
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is bad coding practice for coding a polynomial. Better way is like
((((ax+b)*x+c)*x+d)*x+e)*x+f

T_sfc(i) = T_sfc(i) + 0.3*y
tb = tb + 0.05*y
else
y = 0.0034*x**5 -0.1241*x**4+1.6231*x**3-8.8666*x**2+17.206*x-4.2929
T_sfc(i) = T_sfc(i) - 0.3*y
tb = tb - 0.05*y
endif
T_bot(i) = tb
T_B1(i) = tb

Expand Down Expand Up @@ -275,7 +288,7 @@ SUBROUTINE flake_driver_run ( &
! print*,'inside flake driver'
! print*, julian,xlat(i),w_albedo(I),w_extinc(i),lakedepth(i),elev(i),tb,tt,tsurf(i),T_sfc(i)

endif !lake fraction and depth
endif !lake
endif !flag
enddo
1001 format ( 'At icount=', i5, ' x = ', f5.2,5x, 'y = ', &
Expand Down
7 changes: 4 additions & 3 deletions physics/module_nst_water_prop.f90
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ subroutine get_dtzm_point(xt,xz,dt_cool,zc,z1,z2,dtm)
end subroutine get_dtzm_point

!>\ingroup waterprop
subroutine get_dtzm_2d(xt,xz,dt_cool,zc,wet,z1,z2,nx,ny,nth,dtm)
subroutine get_dtzm_2d(xt,xz,dt_cool,zc,wet,lake,z1,z2,nx,ny,nth,dtm)
!subroutine get_dtzm_2d(xt,xz,dt_cool,zc,wet,icy,z1,z2,nx,ny,dtm)
! ===================================================================== !
! !
Expand All @@ -682,6 +682,7 @@ subroutine get_dtzm_2d(xt,xz,dt_cool,zc,wet,z1,z2,nx,ny,nth,dtm)
! dt_cool - real, sub-layer cooling amount 1 !
! zc - sub-layer cooling thickness 1 !
! wet - logical, flag for wet point (ocean or lake) 1 !
! lake - logical, flag for lake point only 1 !
! icy - logical, flag for ice point (ocean or lake) 1 !
! nx - integer, dimension in x-direction (zonal) 1 !
! ny - integer, dimension in y-direction (meridional) 1 !
Expand All @@ -697,7 +698,7 @@ subroutine get_dtzm_2d(xt,xz,dt_cool,zc,wet,z1,z2,nx,ny,nth,dtm)

integer, intent(in) :: nx,ny, nth
real (kind=kind_phys), dimension(nx,ny), intent(in) :: xt,xz,dt_cool,zc
logical, dimension(nx,ny), intent(in) :: wet
logical, dimension(nx,ny), intent(in) :: wet, lake
! logical, dimension(nx,ny), intent(in) :: wet,icy
real (kind=kind_phys), intent(in) :: z1,z2
real (kind=kind_phys), dimension(nx,ny), intent(out) :: dtm
Expand All @@ -713,7 +714,7 @@ subroutine get_dtzm_2d(xt,xz,dt_cool,zc,wet,z1,z2,nx,ny,nth,dtm)

dtm(i,j) = zero ! initialize dtm

if ( wet(i,j) ) then
if ( wet(i,j) .and. .not. lake(i,j)) then
!
! get the mean warming in the range of z=z1 to z=z2
!
Expand Down
46 changes: 30 additions & 16 deletions physics/sfc_nst.f
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ module sfc_nst

! \brief This subroutine is empty since there are no procedures that need to be done to initialize the GFS NSST code.
!! This subroutine is empty since there are no procedures that need to be done to initialize the GFS NSST code.
!!
!! \section arg_table_sfc_nst_init Argument Table
!!
subroutine sfc_nst_init
end subroutine sfc_nst_init

! \brief This subroutine is empty since there are no procedures that need to be done to finalize the GFS NSST code.
!! This subroutine is empty since there are no procedures that need to be done to finalize the GFS NSST code.
!! \section arg_table_sfc_nst_finalize Argument Table
!!
subroutine sfc_nst_finalize
end subroutine sfc_nst_finalize
Expand All @@ -28,7 +31,7 @@ end subroutine sfc_nst_finalize
subroutine sfc_nst_run &
& ( im, hvap, cp, hfus, jcal, eps, epsm1, rvrdm1, rd, rhw0, & ! --- inputs:
& pi, sbc, ps, u1, v1, t1, q1, tref, cm, ch, &
& prsl1, prslki, prsik1, prslk1, wet, xlon, sinlat, &
& prsl1, prslki, prsik1, prslk1, wet, lake, xlon, sinlat, &
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe be "lake" is bad name here I recommend using something like "use_flake".
Please note that NSST operates on lakes in the absence of "flake model". May be it even needs to operate with the "flake model" also.

Copy link
Collaborator

Choose a reason for hiding this comment

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

An additional question is whether "flake" and "nsst" models should coexist? I think DA over lakes needs nsst (needs to determine lake skin temperature). Does flake provide skin temperature? Radiation needs skin temperature too.

Copy link
Contributor

Choose a reason for hiding this comment

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

An additional question is whether "flake" and "nsst" models should coexist? I think DA over lakes needs nsst (needs to determine lake skin temperature). Does flake provide skin temperature? Radiation needs skin temperature too.

@YihuaWu-NOAA @SMoorthi-emc : Agree with Moorthi, it is a topic to discuss and the decide if whether "flake" and "nsst" models should coexist?

& stress, &
& sfcemis, dlwflx, sfcnsw, rain, timestep, kdt, solhr,xcosz, &
& wind, flag_iter, flag_guess, nstf_name1, nstf_name4, &
Expand All @@ -47,7 +50,7 @@ subroutine sfc_nst_run &
! call sfc_nst !
! inputs: !
! ( im, ps, u1, v1, t1, q1, tref, cm, ch, !
! prsl1, prslki, wet, xlon, sinlat, stress, !
! prsl1, prslki, wet, lake, xlon, sinlat, stress, !
! sfcemis, dlwflx, sfcnsw, rain, timestep, kdt,solhr,xcosz, !
! wind, flag_iter, flag_guess, nstf_name1, nstf_name4, !
! nstf_name5, lprnt, ipr, !
Expand Down Expand Up @@ -94,6 +97,7 @@ subroutine sfc_nst_run &
! prsik1 - real, im !
! prslk1 - real, im !
! wet - logical, =T if any ocn/lake water (F otherwise) im !
! lake - logical, =T if any lake otherwise ocn
! icy - logical, =T if any ice im !
! xlon - real, longitude (radians) im !
! sinlat - real, sin of latitude im !
Expand Down Expand Up @@ -194,7 +198,8 @@ subroutine sfc_nst_run &
real (kind=kind_phys), intent(in) :: timestep
real (kind=kind_phys), intent(in) :: solhr

logical, dimension(im), intent(in) :: flag_iter, flag_guess, wet
logical, dimension(im), intent(in) :: flag_iter, flag_guess, wet, &
& lake
! &, icy
logical, intent(in) :: lprnt

Expand Down Expand Up @@ -259,14 +264,14 @@ subroutine sfc_nst_run &
!
do i = 1, im
! flag(i) = wet(i) .and. .not.icy(i) .and. flag_iter(i)
flag(i) = wet(i) .and. flag_iter(i)
flag(i) = wet(i) .and. flag_iter(i) .and. .not. lake(i)
enddo
!
! save nst-related prognostic fields for guess run
!
do i=1, im
! if(wet(i) .and. .not.icy(i) .and. flag_guess(i)) then
if(wet(i) .and. flag_guess(i)) then
if(wet(i) .and. flag_guess(i) .and. .not. lake(i)) then
xt_old(i) = xt(i)
xs_old(i) = xs(i)
xu_old(i) = xu(i)
Expand Down Expand Up @@ -582,7 +587,7 @@ subroutine sfc_nst_run &
! restore nst-related prognostic fields for guess run
do i=1, im
! if (wet(i) .and. .not.icy(i)) then
if (wet(i)) then
if (wet(i) .and. .not. lake(i)) then
if (flag_guess(i)) then ! when it is guess of
xt(i) = xt_old(i)
xs(i) = xs_old(i)
Expand Down Expand Up @@ -655,10 +660,14 @@ module sfc_nst_pre
!! The NSST scheme is one of the three schemes used to represent the
!! surface in the GFS physics suite. The other two are the Noah land
!! surface model and the sice simplified ice model.
!!
!! \section arg_table_sfc_nst_init Argument Table
!!
subroutine sfc_nst_pre_init
end subroutine sfc_nst_pre_init

!! \section arg_table_sfc_nst_finalize Argument Table
!!
subroutine sfc_nst_pre_finalize
end subroutine sfc_nst_pre_finalize

Expand All @@ -668,7 +677,7 @@ end subroutine sfc_nst_pre_finalize
!> \section NSST_general_pre_algorithm General Algorithm
!! @{
subroutine sfc_nst_pre_run
& (im, wet, tsfc_wat, tsurf_wat, tseal, xt, xz, dt_cool,
& (im, wet, lake, tsfc_wat, tsurf_wat, tseal, xt, xz, dt_cool,
& z_c, tref, cplflx, oceanfrac, nthreads, errmsg, errflg)

use machine , only : kind_phys
Expand All @@ -680,7 +689,7 @@ subroutine sfc_nst_pre_run

! --- inputs:
integer, intent(in) :: im, nthreads
logical, dimension(im), intent(in) :: wet
logical, dimension(im), intent(in) :: wet, lake
real (kind=kind_phys), dimension(im), intent(in) ::
& tsfc_wat, xt, xz, dt_cool, z_c, oceanfrac
logical, intent(in) :: cplflx
Expand All @@ -707,7 +716,7 @@ subroutine sfc_nst_pre_run
errflg = 0

do i=1,im
if (wet(i)) then
if (wet(i) .and. .not. lake(i)) then
! tem = (oro(i)-oro_uf(i)) * rlapse
! DH* 20190927 simplyfing this code because tem is zero
!tem = zero
Expand All @@ -722,10 +731,11 @@ subroutine sfc_nst_pre_run
! update tsfc & tref with T1 from OGCM & NSST Profile if coupled
!
if (cplflx) then
call get_dtzm_2d (xt, xz, dt_cool, &
& z_c, wet, zero, omz1, im, 1, nthreads, dtzm)
call get_dtzm_2d (xt, xz, dt_cool,
& z_c, wet, lake, zero, omz1, im, 1,
& nthreads, dtzm)
do i=1,im
if (wet(i) .and. oceanfrac(i) > zero) then
if (wet(i) .and. oceanfrac(i) > zero .and. .not. lake(i)) then
! dnsst = tsfc_wat(i) - tref(i) ! retrive/get difference of Ts and Tf
tref(i) = tsfc_wat(i) - dtzm(i) ! update Tf with T1 and NSST T-Profile
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this safe, replacing

tref(i) = max(tgice, tsfco(i) - dtzm(i))

with

tref(i) = tsfc_wat(i) - dtzm(i)

? Is it guaranteed that tsfc_wat(i) - dtzm(i) is larger or equal to tgice? Or is that condition no longer needed?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I am concerned about this line too, @YihuaWu-NOAA can you explain why the original code does not work for flake model?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this safe, replacing

tref(i) = max(tgice, tsfco(i) - dtzm(i))

with

tref(i) = tsfc_wat(i) - dtzm(i)

? Is it guaranteed that tsfc_wat(i) - dtzm(i) is larger or equal to tgice? Or is that condition no longer needed?

@climbfuji @junwang-noaa : tref(i) = max(tgice, tsfco(i) - dtzm(i)) needs to be used/kept.

! tsfc_wat(i) = max(271.2,tref(i) + dnsst) ! get Ts updated due to Tf update
Expand Down Expand Up @@ -754,11 +764,15 @@ module sfc_nst_post

! \defgroup GFS_NSST_POST GFS Near-Surface Sea Temperature Post
!! \brief Brief description of the parameterization
!!
!! \section arg_table_sfc_nst_post_init Argument Table
!!
subroutine sfc_nst_post_init
end subroutine sfc_nst_post_init

! \brief Brief description of the subroutine
!!
!! \section arg_table_sfc_nst_post_finalize Argument Table
!!
subroutine sfc_nst_post_finalize
end subroutine sfc_nst_post_finalize
Expand All @@ -773,7 +787,7 @@ end subroutine sfc_nst_post_finalize
! \section NSST_detailed_post_algorithm Detailed Algorithm
! @{
subroutine sfc_nst_post_run &
& ( im, rlapse, tgice, wet, icy, oro, oro_uf, nstf_name1, &
& ( im, rlapse, tgice, wet, lake,icy, oro, oro_uf, nstf_name1, &
& nstf_name4, nstf_name5, xt, xz, dt_cool, z_c, tref, xlon, &
& tsurf_wat, tsfc_wat, nthreads, dtzm, errmsg, errflg &
& )
Expand All @@ -787,7 +801,7 @@ subroutine sfc_nst_post_run &

! --- inputs:
integer, intent(in) :: im, nthreads
logical, dimension(im), intent(in) :: wet, icy
logical, dimension(im), intent(in) :: wet, icy, lake
real (kind=kind_phys), intent(in) :: rlapse, tgice
real (kind=kind_phys), dimension(im), intent(in) :: oro, oro_uf
integer, intent(in) :: nstf_name1, nstf_name4, nstf_name5
Expand Down Expand Up @@ -828,12 +842,12 @@ subroutine sfc_nst_post_run &
if (nstf_name1 > 1) then
zsea1 = 0.001_kp*real(nstf_name4)
zsea2 = 0.001_kp*real(nstf_name5)
call get_dtzm_2d (xt, xz, dt_cool, z_c, wet, zsea1, zsea2, &
call get_dtzm_2d (xt, xz, dt_cool, z_c, wet, lake, zsea1, zsea2, &
& im, 1, nthreads, dtzm)
do i = 1, im
! if (wet(i) .and. .not.icy(i)) then
! if (wet(i) .and. (frac_grid .or. .not. icy(i))) then
if (wet(i)) then
if (wet(i) .and. .not. lake(i)) then
tsfc_wat(i) = max(tgice, tref(i) + dtzm(i))
! tsfc_wat(i) = max(271.2, tref(i) + dtzm(i)) - &
! (oro(i)-oro_uf(i))*rlapse
Expand Down
Loading