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

Code update for HR4_roughness, background diffusivity and shallow convection #119

Merged
merged 56 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
c18c6d4
CCPP scheme simulator.
Jan 30, 2023
f9abb73
Fix file rename typo
Jan 30, 2023
ef0d369
Added MPI commands to ccpp_scheme_simulator
Jan 31, 2023
fd72b35
Work in progress...
Feb 3, 2023
ffd26ab
Some changes
Feb 6, 2023
112ac89
Some small cleanup
Feb 7, 2023
6a4c4b1
More OO changes. Will split into load_data and ccpp_scheme components…
Feb 9, 2023
be4cc2e
More OO changes
Feb 10, 2023
7001ef9
Split scheme into load and simulator components.
Feb 13, 2023
8bc8ec9
Small bug fix to nml
Feb 13, 2023
6db4af5
Remove dimension for tracer, handle tracers individualy, not with sta…
Feb 13, 2023
147cbac
Fixed bug in interpolation routine.
Feb 14, 2023
a296389
Moew changes
Feb 17, 2023
e49f1f6
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into ccpp…
Apr 5, 2023
a3933a5
CCPP scheme simulator
May 4, 2023
833b990
Merge branch 'ufs/dev-gf' into ufs-dev-PR64
grantfirl May 4, 2023
3ba2924
Merge branch 'main' into ufs-dev-PR64
grantfirl May 8, 2023
6e53907
Merge commit 'd474c2' into ufs-dev-PR26
grantfirl May 9, 2023
2515b27
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into HEAD
May 30, 2023
5d49f79
Reorganization of scheme simulator. Now stateless.
Jun 1, 2023
d8a5b1f
Merge pull request #1015 from grantfirl/ufs-dev-PR64
grantfirl Jun 13, 2023
6f12331
Merge branch 'main' into ufs-dev-PR26
grantfirl Jun 13, 2023
4d69108
fix bug in scm_sfc_flux_spec.F90
grantfirl Jun 14, 2023
6cfaad5
Merge branch 'update_HR2' into ufs-dev-PR65
grantfirl Jun 26, 2023
93e0c8d
Merge commit '81e3f5e36' into ufs-dev-PR71
grantfirl Jun 26, 2023
bc94a0f
Merge remote-tracking branch 'joe-fork/mynn_snowfix' into ufs-dev-PR71
grantfirl Jun 26, 2023
92c8a9e
Merge pull request #1016 from grantfirl/ufs-dev-PR26
grantfirl Jun 29, 2023
c5566ab
Merge branch 'main' into ufs-dev-PR65
grantfirl Jun 29, 2023
ce731f2
Merge branch 'main' into ufs-dev-PR71
grantfirl Jun 29, 2023
12d4fc2
Working as expected!
Jul 7, 2023
6ceffe3
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into HEAD
Jul 7, 2023
9b77c4e
Merge pull request #1020 from grantfirl/ufs-dev-PR65
grantfirl Jul 7, 2023
9465b6f
Housekeeping
Jul 11, 2023
c61a2a6
GNU bug found in SCM CI
Jul 13, 2023
8e5646e
Some cleanup.
Jul 18, 2023
7e8cd3a
Merge branch 'main' into ufs-dev-PR71
grantfirl Jul 19, 2023
e3c00d3
Renamed scheme simulator suite simulator
Jul 19, 2023
2d6d44c
Omission from previous commit
Jul 19, 2023
5ab1a5b
Add ability to use constant forcing data when one-dimensional data is…
Jul 19, 2023
07a25fe
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into HEAD
Aug 1, 2023
215ba6d
Merge pull request #996 from dustinswales/ccpp_scheme_sim
dustinswales Aug 1, 2023
1e7542a
Merge branch 'main' into ufs-dev-PR71
grantfirl Aug 3, 2023
fa96015
Merge pull request #1021 from grantfirl/ufs-dev-PR71
grantfirl Aug 3, 2023
4e45989
Code update for HR4_roughness
Qingfu-Liu Oct 16, 2023
3debf89
Code update for HR4_roughness
Qingfu-Liu Oct 16, 2023
c2b1301
Code update for HR4_roughness
Qingfu-Liu Oct 16, 2023
2fc24ca
Merge remote-tracking branch 'upstream/ufs/dev' into HR4_roughness
Qingfu-Liu Nov 28, 2023
91da6a0
Merge https://github.com/Qingfu-Liu/ccpp-physics into HR4_roughness
Qingfu-Liu Nov 28, 2023
562377c
remove files from old version
Qingfu-Liu Nov 28, 2023
12cd9c6
update files satmedmfvdifq.F samfshalcnv.f sfc_diff.f
Qingfu-Liu Nov 28, 2023
225848c
Merge remote-tracking branch 'upstream/ufs/dev' into HR4_roughness
Qingfu-Liu Dec 1, 2023
d65507a
Fix CI 2
Qingfu-Liu Dec 14, 2023
fa9931a
Merge remote-tracking branch 'upstream/ufs/dev' into HR4_roughness
Qingfu-Liu Jan 10, 2024
26ecb3d
Merge remote-tracking branch 'upstream/ufs/dev' into HR4_roughness
Qingfu-Liu Jan 16, 2024
97e3b1c
update surface physics z0 from waves
Qingfu-Liu Jan 18, 2024
327fbaa
Merge remote-tracking branch 'upstream/ufs/dev' into HR4_roughness
Qingfu-Liu Jan 26, 2024
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
Prev Previous commit
Next Next commit
Fixed bug in interpolation routine.
  • Loading branch information
dustinswales committed Feb 14, 2023
commit 147cbac00de18dbf4d705d235ec90fcde9dd4ba3
57 changes: 40 additions & 17 deletions physics/ccpp_scheme_simulator.F90
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ module ccpp_scheme_simulator
integer :: iactive_scheme
integer :: proc_start, proc_end
logical :: active_time_split_process=.false.
logical :: in_pre_active = .true.
logical :: in_post_active = .false.

! Set to true in data was loaded into "physics_process"
logical :: do_ccpp_scheme_simulator=.false.
Expand All @@ -103,7 +105,7 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti
index_of_process_shortwave, index_of_process_scnv, &
index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, &
index_of_temperature, index_of_x_wind, index_of_y_wind, ntqv, gt0, gu0, gv0, gq0, &
errmsg, errflg)
dtdq_pbl, dtdq_mp, errmsg, errflg)

! Inputs
integer, intent(in) :: kdt, ntqv, index_of_process_dcnv, &
Expand All @@ -118,7 +120,7 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti

! Outputs
real(kind_phys), intent(inout), dimension(:,:) :: gt0, gu0, gv0
real(kind_phys), intent(inout), dimension(:,:) :: gq0
real(kind_phys), intent(inout), dimension(:,:) :: gq0, dtdq_pbl, dtdq_mp
character(len=*),intent(out) :: errmsg
integer, intent(out) :: errflg

Expand Down Expand Up @@ -181,13 +183,22 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti
dvdt(:,:) = 0.
dqdt(:,:) = 0.

if (in_pre_active) then
proc_start = 1
proc_end = iactive_scheme-1
endif
if (in_post_active) then
proc_start = iactive_scheme
proc_end = size(physics_process)
endif

! Internal physics timestep evolution.
do iprc = proc_start,proc_end
if (iprc == iactive_scheme .and. active_time_split_process) then
proc_start = iactive_scheme
exit
print*,'Reached active process. ', iprc
else
print*,'Simulating ',iprc,' of ',proc_end
endif
print*,'Simulating ',iprc,' of ',proc_end

do iCol = 1,nCol
! Reset locals
Expand Down Expand Up @@ -233,31 +244,45 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti
gu1(iCol,:) = gu1(iCol,:) + (dudt(iCol,:) + physics_process(iprc)%tend1d%u)*dtp
gv1(iCol,:) = gv1(iCol,:) + (dvdt(iCol,:) + physics_process(iprc)%tend1d%v)*dtp
gq1(iCol,:) = gq1(iCol,:) + (dqdt(iCol,:) + physics_process(iprc)%tend1d%q)*dtp
dTdt(iCol,:) = 0.
dudt(iCol,:) = 0.
dvdt(iCol,:) = 0.
dqdt(iCol,:) = 0.
!dTdt(iCol,:) = 0.
!dudt(iCol,:) = 0.
!dvdt(iCol,:) = 0.
!dqdt(iCol,:) = 0.
! Accumulate tendencies, update later?
else
dTdt(iCol,:) = dTdt(iCol,:) + physics_process(iprc)%tend1d%T
dudt(iCol,:) = dudt(iCol,:) + physics_process(iprc)%tend1d%u
dvdt(iCol,:) = dvdt(iCol,:) + physics_process(iprc)%tend1d%v
dqdt(iCol,:) = dqdt(iCol,:) + physics_process(iprc)%tend1d%q
endif
! These are needed by samfshalcnv
if (trim(physics_process(iprc)%name) == "PBL") then
dtdq_pbl(iCol,:) = physics_process(iprc)%tend1d%q
endif
if (trim(physics_process(iprc)%name) == "cldMP") then
dtdq_mp(iCol,:) = physics_process(iprc)%tend1d%q
endif
enddo
!
do iLay=1,nLay
write(*,'(i3,6f13.6)') ilay, gt0(iCol,iLay) , gt1(iCol,iLay) , dTdt(iCol,iLay)*dtp,physics_process(iprc)%tend1d%T(iLay),physics_process(iprc)%tend2d%T(iLay,3),physics_process(iprc)%tend2d%T(iLay,4)
!write(*,'(i3,4f13.6)') ilay, gq0(iCol,iLay) , gq1(iCol,iLay) , dqdt(iCol,iLay)*dtp, physics_process(iprc)%tend1d%q(iLay)*dtp
enddo
gt0(iCol,:) = gt1(iCol,:) + dTdt(iCol,:)*dtp
gu0(iCol,:) = gu1(iCol,:) + dudt(iCol,:)*dtp
gv0(iCol,:) = gv1(iCol,:) + dvdt(iCol,:)*dtp
gq0(iCol,:) = gq1(iCol,:) + dqdt(iCol,:)*dtp
enddo

if (iprc == proc_end) then
proc_start = 1
if (in_pre_active) then
in_pre_active = .false.
in_post_active = .true.
endif

if (size(physics_process)+1 == iprc) then
in_pre_active = .true.
in_post_active = .false.
endif

!
end subroutine ccpp_scheme_simulator_run

Expand All @@ -276,7 +301,6 @@ function linterp_1D(this, var_name, year, month, day, hour, minute, second) resu

! Interpolation weights
call this%cmp_time_wts(year, month, day, hour, minute, second, w1, w2, ti, tf)
print*,w1,w2,ti,tf

select case(var_name)
case("T")
Expand Down Expand Up @@ -353,10 +377,9 @@ subroutine cmp_time_wts(this, year, month, day, hour, minute, second, w1, w2, ti
real(kind_phys) :: hrofday

hrofday = hour*3600. + minute*60. + second
ti = findloc(abs(this%tend2d%time-hrofday),minval(abs(this%tend2d%time-hrofday)))
if (hrofday - this%tend2d%time(ti(1)) .le. 0) ti = ti-1
tf = ti + 1
w1 = (this%tend2d%time(tf(1))-hrofday) / (this%tend2d%time(tf(1)) - this%tend2d%time(ti(1)))
ti = max(hour,1)
tf = min(ti + 1,24)
w1 = ((hour+1)*3600 - hrofday)/3600
w2 = 1 - w1

end subroutine cmp_time_wts
Expand Down
16 changes: 16 additions & 0 deletions physics/ccpp_scheme_simulator.meta
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,22 @@
type = real
kind = kind_phys
intent = inout
[dtdq_pbl]
standard_name = instantaneous_tendency_of_specific_humidity_due_to_PBL
long_name = instantaneous_tendency_of_specific_humidity_due_to_PBL
units = kg kg-1 s-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
[dtdq_mp]
standard_name = instantaneous_tendency_of_specific_humidity_due_to_microphysics
long_name = moisture tendency due to microphysics
units = kg kg-1 s-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down
5 changes: 1 addition & 4 deletions physics/load_ccpp_scheme_sim.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module load_ccpp_scheme_sim
use machine, only: kind_phys
use netcdf
use ccpp_scheme_simulator, only: do_ccpp_scheme_simulator, physics_process, active_name,&
iactive_scheme, proc_start, proc_end, active_time_split_process
iactive_scheme, active_time_split_process
#ifdef MPI
use mpi
#endif
Expand Down Expand Up @@ -430,9 +430,6 @@ subroutine load_ccpp_scheme_sim_init(mpirank, mpiroot, mpicomm, nlunit, nml_file
! Part B) Populate physics_process type.
!
! #######################################################################################
! Default process extent (no time-split physics processes)
proc_start = 1
proc_end = nPhysProcess

! Allocate
allocate(physics_process(nPhysProcess))
Expand Down