Skip to content

Commit

Permalink
Merge pull request NCAR#317 from climbfuji/master_update_from_gmtb_de…
Browse files Browse the repository at this point in the history
…velop_20190909

master: update from gmtb develop 2019/09/09
  • Loading branch information
climbfuji committed Sep 13, 2019
2 parents c7bc295 + 856b6f1 commit 12c416a
Show file tree
Hide file tree
Showing 218 changed files with 44,664 additions and 11,107 deletions.
81 changes: 2 additions & 79 deletions physics/GFS_DCNV_generic.F90

Large diffs are not rendered by default.

644 changes: 644 additions & 0 deletions physics/GFS_DCNV_generic.meta

Large diffs are not rendered by default.

120 changes: 120 additions & 0 deletions physics/GFS_GWD_generic.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
!> \file GFS_GWD_generic.f
!! This file contains the CCPP-compliant orographic gravity wave
!! drag pre interstitial codes.

module GFS_GWD_generic_pre

contains

!> \section arg_table_GFS_GWD_generic_pre_init Argument Table
!!
subroutine GFS_GWD_generic_pre_init()
end subroutine GFS_GWD_generic_pre_init

!! \section arg_table_GFS_GWD_generic_pre_run Argument Table
!! \htmlinclude GFS_GWD_generic_pre_run.html
!!
!! \section general General Algorithm
!! \section detailed Detailed Algorithm
!! @{
subroutine GFS_GWD_generic_pre_run( &
& im, levs, nmtvr, mntvar, &
& hprime, oc, oa4, clx, theta, &
& sigma, gamma, elvmax, lssav, ldiag3d, &
& dtdt, dt3dt, dtf, errmsg, errflg)

use machine, only : kind_phys
implicit none

integer, intent(in) :: im, levs, nmtvr
real(kind=kind_phys), intent(in) :: mntvar(im,nmtvr)

real(kind=kind_phys), intent(out) :: &
& hprime(im), oc(im), oa4(im,4), clx(im,4), &
& theta(im), sigma(im), gamma(im), elvmax(im)

logical, intent(in) :: lssav, ldiag3d
real(kind=kind_phys), intent(in) :: dtdt(im,levs)
! dt3dt only allocated only if ldiag3d is .true.
real(kind=kind_phys), intent(inout) :: dt3dt(:,:)
real(kind=kind_phys), intent(in) :: dtf

character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg

integer :: i, k

! Initialize CCPP error handling variables
errmsg = ''
errflg = 0

if (nmtvr == 14) then ! current operational - as of 2014
hprime(:) = mntvar(:,1)
oc(:) = mntvar(:,2)
oa4(:,1) = mntvar(:,3)
oa4(:,2) = mntvar(:,4)
oa4(:,3) = mntvar(:,5)
oa4(:,4) = mntvar(:,6)
clx(:,1) = mntvar(:,7)
clx(:,2) = mntvar(:,8)
clx(:,3) = mntvar(:,9)
clx(:,4) = mntvar(:,10)
theta(:) = mntvar(:,11)
gamma(:) = mntvar(:,12)
sigma(:) = mntvar(:,13)
elvmax(:) = mntvar(:,14)
elseif (nmtvr == 10) then
hprime(:) = mntvar(:,1)
oc(:) = mntvar(:,2)
oa4(:,1) = mntvar(:,3)
oa4(:,2) = mntvar(:,4)
oa4(:,3) = mntvar(:,5)
oa4(:,4) = mntvar(:,6)
clx(:,1) = mntvar(:,7)
clx(:,2) = mntvar(:,8)
clx(:,3) = mntvar(:,9)
clx(:,4) = mntvar(:,10)
elseif (nmtvr == 6) then
hprime(:) = mntvar(:,1)
oc(:) = mntvar(:,2)
oa4(:,1) = mntvar(:,3)
oa4(:,2) = mntvar(:,4)
oa4(:,3) = mntvar(:,5)
oa4(:,4) = mntvar(:,6)
clx(:,1) = 0.0
clx(:,2) = 0.0
clx(:,3) = 0.0
clx(:,4) = 0.0
else
hprime = 0
oc = 0
oa4 = 0
clx = 0
theta = 0
gamma = 0
sigma = 0
elvmax = 0
endif ! end if_nmtvr

if (lssav) then
if (ldiag3d) then
do k=1,levs
do i=1,im
dt3dt(i,k) = dt3dt(i,k) - dtdt(i,k)*dtf
enddo
enddo
endif
endif

end subroutine GFS_GWD_generic_pre_run
!> @}

! \ingroup GFS_ogwd
! \brief Brief description of the subroutine
!
!> \section arg_table_GFS_GWD_generic_pre_finalize Argument Table
!!
subroutine GFS_GWD_generic_pre_finalize()
end subroutine GFS_GWD_generic_pre_finalize

end module GFS_GWD_generic_pre
178 changes: 178 additions & 0 deletions physics/GFS_GWD_generic.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
[ccpp-arg-table]
name = GFS_GWD_generic_pre_init
type = scheme

########################################################################
[ccpp-arg-table]
name = GFS_GWD_generic_pre_run
type = scheme
[im]
standard_name = horizontal_loop_extent
long_name = horizontal dimension
units = count
dimensions = ()
type = integer
intent = in
optional = F
[levs]
standard_name = vertical_dimension
long_name = vertical layer dimension
units = count
dimensions = ()
type = integer
intent = in
optional = F
[nmtvr]
standard_name = number_of_statistical_measures_of_subgrid_orography
long_name = number of statistical measures of subgrid orography
units = count
dimensions = ()
type = integer
intent = in
optional = F
[mntvar]
standard_name = statistical_measures_of_subgrid_orography
long_name = array of statistical measures of subgrid orography
units = various
dimensions = (horizontal_dimension,number_of_statistical_measures_of_subgrid_orography)
type = real
kind = kind_phys
intent = in
optional = F
[hprime]
standard_name = standard_deviation_of_subgrid_orography
long_name = standard deviation of subgrid orography
units = m
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = out
optional = F
[oc]
standard_name = convexity_of_subgrid_orography
long_name = convexity of subgrid orography
units = none
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = out
optional = F
[oa4]
standard_name = asymmetry_of_subgrid_orography
long_name = asymmetry of subgrid orography
units = none
dimensions = (horizontal_dimension,4)
type = real
kind = kind_phys
intent = out
optional = F
[clx]
standard_name = fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height
long_name = horizontal fraction of grid box covered by subgrid orography higher than critical height
units = frac
dimensions = (horizontal_dimension,4)
type = real
kind = kind_phys
intent = out
optional = F
[theta]
standard_name = angle_from_east_of_maximum_subgrid_orographic_variations
long_name = angle with_respect to east of maximum subgrid orographic variations
units = degrees
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = out
optional = F
[sigma]
standard_name = slope_of_subgrid_orography
long_name = slope of subgrid orography
units = none
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = out
optional = F
[gamma]
standard_name = anisotropy_of_subgrid_orography
long_name = anisotropy of subgrid orography
units = none
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = out
optional = F
[elvmax]
standard_name = maximum_subgrid_orography
long_name = maximum of subgrid orography
units = m
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = out
optional = F
[lssav]
standard_name = flag_diagnostics
long_name = logical flag for storing diagnostics
units = flag
dimensions = ()
type = logical
intent = in
optional = F
[ldiag3d]
standard_name = flag_diagnostics_3D
long_name = flag for 3d diagnostic fields
units = flag
dimensions = ()
type = logical
intent = in
optional = F
[dtdt]
standard_name = tendency_of_air_temperature_due_to_model_physics
long_name = updated tendency of the temperature
units = K s-1
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[dt3dt]
standard_name = cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag
long_name = cumulative change in temperature due to orographic gravity wave drag
units = K
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[dtf]
standard_name = time_step_for_dynamics
long_name = dynamics timestep
units = s
dimensions = ()
type = real
kind = kind_phys
intent = in
optional = F
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
units = none
dimensions = ()
type = character
kind = len=*
intent = out
optional = F
[errflg]
standard_name = ccpp_error_flag
long_name = error flag for error handling in CCPP
units = flag
dimensions = ()
type = integer
intent = out
optional = F

########################################################################
[ccpp-arg-table]
name = GFS_GWD_generic_pre_finalize
type = scheme
Loading

0 comments on commit 12c416a

Please sign in to comment.