Skip to content

Commit

Permalink
Merge pull request #723 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
GitFlow: develop into main
  • Loading branch information
mathomp4 authored Mar 10, 2023
2 parents 4689e6a + 68d5bbb commit 135a085
Show file tree
Hide file tree
Showing 54 changed files with 29,978 additions and 20,451 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1

# Anchors to prevent forgetting to update a version
baselibs_version: &baselibs_version v7.7.0
bcs_version: &bcs_version v10.23.0
bcs_version: &bcs_version v10.25.0

orbs:
ci: geos-esm/circleci-tools@1
Expand Down
222 changes: 111 additions & 111 deletions GEOS_GcmGridComp.F90

Large diffs are not rendered by default.

410 changes: 250 additions & 160 deletions GEOSagcm_GridComp/GEOS_AgcmGridComp.F90

Large diffs are not rendered by default.

1,026 changes: 464 additions & 562 deletions GEOSagcm_GridComp/GEOSphysics_GridComp/GEOS_PhysicsGridComp.F90

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,28 @@ set (srcs
ncar_gwd/linear_1d_operators.F90
ncar_gwd/interpolate_data.F90
ncar_gwd/vdiff_lu_solver.F90
ncar_gwd/cesm_const_mod.F90
ncar_gwd/coords_1d.F90
ncar_gwd/gw_utils.F90
ncar_gwd/gw_diffusion.F90
ncar_gwd/gw_common.F90
ncar_gwd/gw_convect.F90
ncar_gwd/gw_rdg.F90
ncar_gwd/gw_oro.F90
ncar_gwd/gw_drag.F90
)

set (resource_files
GWD_GridComp.rc
)



install( FILES ${resource_files}
DESTINATION etc
)

esma_add_library (${this} SRCS ${srcs} DEPENDENCIES GEOS_Shared MAPL esmf NetCDF::NetCDF_Fortran)

# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(${this} PRIVATE OpenMP::OpenMP_Fortran)
endif ()
1,380 changes: 949 additions & 431 deletions GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSgwd_GridComp/GEOS_GwdGridComp.F90

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use_threads: .FALSE.
135 changes: 70 additions & 65 deletions GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSgwd_GridComp/gw_drag.F90
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module gw_drag

implicit none

!save
private ! Make default type private to the module
!
! PUBLIC: interfaces
Expand Down Expand Up @@ -177,26 +176,34 @@ subroutine gw_intr (pcols, pver, dt, pgwv,

I_LOOP: do i = 1, pcols

! zero net tendencies prior to runs
do k = 1, pver
dudt_gwd_dev(i,k) = 0.
dvdt_gwd_dev(i,k) = 0.
dtdt_gwd_dev(i,k) = 0.
dudt_org_dev(i,k) = 0.
dvdt_org_dev(i,k) = 0.
dtdt_org_dev(i,k) = 0.
utbsrc_dev(i,k) = 0.
vtbsrc_dev(i,k) = 0.
ttbsrc_dev(i,k) = 0.
taubx_dev(i,k) = 0.
tauby_dev(i,k) = 0.
feb_dev(i,k) = 0.
fepb_dev(i,k) = 0.
end do
taubkgx_dev(i) = 0.
taubkgy_dev(i) = 0.
taugwdx_dev(i) = 0.
taugwdy_dev(i) = 0.

! Assign newtonian cooling coefficients
! -------------------------------------
do k = 0, pver
alpha(k) = 0.0
dback(k) = 0.0
end do

! Determine the bounds of the background and orographic stress regions
ktoporo = 0

ktopbg = 0

kbotoro = pver

do k = 0, pver
if (pref_dev(k+1) .lt. 40000.) then
kbotbg = k ! spectrum source at 400 mb
end if
end do

do k = 0, pver
! Profiles of background state variables
call gw_prof(i, k, pcols, pver, &
Expand All @@ -207,7 +214,14 @@ subroutine gw_intr (pcols, pver, dt, pgwv,
!-----------------------------------------------------------------------------
! Non-orographic backgound gravity wave spectrum
!-----------------------------------------------------------------------------
if (pgwv > 0) then
if (effgwbkg > 0.0 .and. pgwv > 0) then

ktopbg = 0
do k = 0, pver
if (pref_dev(k+1) .lt. 40000.) then
kbotbg = k ! spectrum source at 400 mb
end if
end do

! Determine the wave source for a background spectrum at ~400 mb

Expand Down Expand Up @@ -245,66 +259,53 @@ subroutine gw_intr (pcols, pver, dt, pgwv,
taubkgx_dev(i) = tau0x
taubkgy_dev(i) = tau0y

else

! zero net tendencies if no spectrum computed

do k = 1, pver
dudt_gwd_dev(i,k) = 0.
dvdt_gwd_dev(i,k) = 0.
dtdt_gwd_dev(i,k) = 0.
utbsrc_dev(i,k) = 0.
vtbsrc_dev(i,k) = 0.
ttbsrc_dev(i,k) = 0.
taubx_dev(i,k) = 0.
tauby_dev(i,k) = 0.
feb_dev(i,k) = 0.
fepb_dev(i,k) = 0.
end do
taubkgx_dev(i) = 0.
taubkgy_dev(i) = 0.

end if

!-----------------------------------------------------------------------------
! Orographic stationary gravity wave
!-----------------------------------------------------------------------------
if (effgworo > 0.0) then

ktoporo = 0
kbotoro = pver

! Determine the orographic wave source

call gw_oro (i, pcols, pver, pgwv, &
u_dev, v_dev, t_dev, sgh_dev, pmid_dev, &
pint_dev, pdel_dev, zm_dev, nm, &
kldv, kldvmn, ksrc, ksrcmn, rdpldv, &
tau, ubi, ubm, xv, yv, &
kbotoro, rlat_dev )
call gw_oro (i, pcols, pver, pgwv, &
u_dev, v_dev, t_dev, sgh_dev, pmid_dev, &
pint_dev, pdel_dev, zm_dev, nm, &
kldv, kldvmn, ksrc, ksrcmn, rdpldv, &
tau, ubi, ubm, xv, yv, &
kbotoro, rlat_dev )

! Solve for the drag profile

call gw_drag_prof (i, pcols, pver, &
pgwv, 0, kbotoro, ktoporo, c, u_dev, &
v_dev, t_dev, pint_dev, pdel_dev, rpdel_dev, lnpint_dev,&
rlat_dev, rhoi, ni, ti, nm, dt, &
alpha, dback, kldv, kldvmn, ksrc, ksrcmn, &
rdpldv, tau, ubi, ubm, xv, yv, &
utgw, vtgw, ttgw, tauox_dev, tauoy_dev, feo_dev, &
fepo_dev, utosrc, vtosrc, ttosrc, &
tau0x, tau0y, effgworo )
call gw_drag_prof (i, pcols, pver, &
pgwv, 0, kbotoro, ktoporo, c, u_dev, &
v_dev, t_dev, pint_dev, pdel_dev, rpdel_dev, lnpint_dev,&
rlat_dev, rhoi, ni, ti, nm, dt, &
alpha, dback, kldv, kldvmn, ksrc, ksrcmn, &
rdpldv, tau, ubi, ubm, xv, yv, &
utgw, vtgw, ttgw, tauox_dev, tauoy_dev, feo_dev, &
fepo_dev, utosrc, vtosrc, ttosrc, &
tau0x, tau0y, effgworo )

! Add the orographic tendencies to the spectrum tendencies
! Compute the temperature tendency from energy conservation (includes spectrum).

do k = 1, pver
dudt_org_dev(i,k) = utgw(k)
dvdt_org_dev(i,k) = vtgw(k)
dtdt_org_dev(i,k) = ttgw(k)
dudt_gwd_dev(i,k) = dudt_gwd_dev(i,k) + utgw(k)
dvdt_gwd_dev(i,k) = dvdt_gwd_dev(i,k) + vtgw(k)
dtdt_gwd_dev(i,k) = dtdt_gwd_dev(i,k) + ttgw(k)
end do
do k = 1, pver
dudt_org_dev(i,k) = utgw(k)
dvdt_org_dev(i,k) = vtgw(k)
dtdt_org_dev(i,k) = ttgw(k)
dudt_gwd_dev(i,k) = dudt_gwd_dev(i,k) + utgw(k)
dvdt_gwd_dev(i,k) = dvdt_gwd_dev(i,k) + vtgw(k)
dtdt_gwd_dev(i,k) = dtdt_gwd_dev(i,k) + ttgw(k)
end do

taugwdx_dev(i) = tau0x
taugwdy_dev(i) = tau0y
taugwdx_dev(i) = tau0x
taugwdy_dev(i) = tau0y

end if

end do I_LOOP
rc = 0
Expand Down Expand Up @@ -668,12 +669,16 @@ subroutine gw_bgnd (i, pcols, pver, cw, &
latdeg = rlat(i)*180./PI_GWD
!
if (-15.3 < latdeg .and. latdeg < 15.3) then
!!AMM flat_gw = 1.2*dexp(-dble((abs(latdeg)-3.)/8.0)**2)
!!AMM if (flat_gw < 1.2 .and. abs(latdeg) <= 3.) flat_gw = 1.2
!!AMM flat_gw = 2.5*dexp(-dble((abs(latdeg)-3.)/8.0)**2)
!!AMM if (flat_gw < 2.5 .and. abs(latdeg) <= 3.) flat_gw = 2.5
flat_gw = bgstressmax*dexp(-dble((abs(latdeg)-3.)/8.0)**2)
if (flat_gw < bgstressmax .and. abs(latdeg) <= 3.) flat_gw = bgstressmax
if (bgstressmax == 0.0) then
flat_gw = 0.10
else
!!AMM flat_gw = 1.2*dexp(-dble((abs(latdeg)-3.)/8.0)**2)
!!AMM if (flat_gw < 1.2 .and. abs(latdeg) <= 3.) flat_gw = 1.2
!!AMM flat_gw = 2.5*dexp(-dble((abs(latdeg)-3.)/8.0)**2)
!!AMM if (flat_gw < 2.5 .and. abs(latdeg) <= 3.) flat_gw = 2.5
flat_gw = bgstressmax*dexp(-dble((abs(latdeg)-3.)/8.0)**2)
if (flat_gw < bgstressmax .and. abs(latdeg) <= 3.) flat_gw = bgstressmax
end if
else if (latdeg > -31. .and. latdeg <= -15.3) then
flat_gw = 0.10
else if (latdeg < 31. .and. latdeg >= 15.3) then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, &
parameter(mdir=8, FDIR=mdir/(PI+PI))
integer nwdir(mdir)
data nwdir/6,7,5,8,2,3,1,4/
save nwdir
!
LOGICAL ICRILV(IM)
!
Expand Down

This file was deleted.

Loading

0 comments on commit 135a085

Please sign in to comment.