Skip to content

Commit

Permalink
Merge pull request #122 from climbfuji/gfdlmp-slow-physics
Browse files Browse the repository at this point in the history
GFDL cloud microphysics (slow processes)
  • Loading branch information
climbfuji authored Jul 16, 2018
2 parents 439679b + e90039e commit acca340
Show file tree
Hide file tree
Showing 6 changed files with 1,949 additions and 1,631 deletions.
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ set(CCPP_LIB_DIRS "" CACHE FILEPATH "Path to ccpp library")
link_directories(${CCPP_LIB_DIRS})
list(APPEND LIBS "ccpp")

# Add the required preprocessor flags so that cmake can sort out the dependencies
# DH* this should go into the calling CMakeLists.txt of the host model *DH
ADD_DEFINITIONS(-DNEMS_GSM)

#------------------------------------------------------------------------------
# Set the sources: physics schemes
include(./CCPP_SCHEMES.cmake)
Expand Down
2 changes: 1 addition & 1 deletion physics/GFS_debug.F90
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup
do impi=0,mpisize-1
do iomp=0,ompsize-1
if (mpirank==impi .and. omprank==iomp) then
call Interstitial%mprint(mpirank,omprank,Tbd%blkno)
call Interstitial%mprint(Model,mpirank,omprank,Tbd%blkno)
end if
#ifdef OPENMP
!$OMP BARRIER
Expand Down
35 changes: 22 additions & 13 deletions physics/GFS_suite_interstitial.F90
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,26 @@ end subroutine GFS_suite_interstitial_phys_reset_finalize
!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional |
!! |----------------|--------------------------------------------------------|---------------------------------------------------------|---------------|------|-----------------------|-----------|--------|----------|
!! | Interstitial | FV3-GFS_Interstitial_type | derived type GFS_interstitial_type in FV3 | DDT | 0 | GFS_interstitial_type | | inout | F |
!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F |
!! | errmsg | error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F |
!! | errflg | error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F |
!!
subroutine GFS_suite_interstitial_phys_reset_run (Interstitial, errmsg, errflg)
subroutine GFS_suite_interstitial_phys_reset_run (Interstitial, Model, errmsg, errflg)

use GFS_typedefs, only: GFS_interstitial_type
use GFS_typedefs, only: GFS_control_type, GFS_interstitial_type

implicit none

! interface variables
type(GFS_interstitial_type), intent(inout) :: Interstitial
type(GFS_control_type), intent(in) :: Model
character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg

errmsg = ''
errflg = 0

call Interstitial%phys_reset()
call Interstitial%phys_reset(Model)

end subroutine GFS_suite_interstitial_phys_reset_run

Expand Down Expand Up @@ -100,6 +102,7 @@ end subroutine GFS_suite_interstitial_1_finalize
!! | rhbtop | critical_relative_humidity_at_top_of_atmosphere | critical relative humidity at the top of atmosphere | frac | 0 | real | kind_phys | out | F |
!! | frain | dynamics_to_physics_timestep_ratio | ratio of dynamics timestep to physics timestep | none | 0 | real | kind_phys | out | F |
!! | islmsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | out | F |
!! | frland | land_area_fraction | land area fraction | frac | 1 | real | kind_phys | out | F |
!! | work1 | grid_size_related_coefficient_used_in_scale-sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | out | F |
!! | work2 | grid_size_related_coefficient_used_in_scale-sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | out | F |
!! | dudt | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | out | F |
Expand All @@ -111,7 +114,7 @@ end subroutine GFS_suite_interstitial_1_finalize
!! | errflg | error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F |
!!
subroutine GFS_suite_interstitial_1_run (Model, Grid, Sfcprop, Statein, Diag, rhbbot, rhpbl, rhbtop, frain, islmsk, &
work1, work2, dudt, dvdt, dtdt, dtdtc, dqdt, errmsg, errflg)
frland, work1, work2, dudt, dvdt, dtdt, dtdtc, dqdt, errmsg, errflg)

use machine, only: kind_phys
use physcons, only: dxmin, dxinv
Expand All @@ -128,7 +131,8 @@ subroutine GFS_suite_interstitial_1_run (Model, Grid, Sfcprop, Statein, Diag, rh

real(kind=kind_phys), intent(out) :: rhbbot, rhpbl, rhbtop, frain
integer, dimension(size(Grid%xlon,1)), intent(out) :: islmsk
real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: work1, work2
real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: frland
real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: work1, work2
real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs), intent(out) :: dudt, dvdt, dtdt, dtdtc
real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs,Model%ntrac), intent(out) :: dqdt
character(len=*), intent(out) :: errmsg
Expand All @@ -149,16 +153,21 @@ subroutine GFS_suite_interstitial_1_run (Model, Grid, Sfcprop, Statein, Diag, rh

do i = 1, size(Grid%xlon,1)
islmsk(i) = nint(Sfcprop%slmsk(i))
work1(i) = (log(Grid%area(i)) - dxmin) * dxinv
work1(i) = max(0.0, min(1.0,work1(i)))
work2(i) = 1.0 - work1(i)
Diag%psurf(i) = Statein%pgr(i)
if (islmsk(i) == 1) then
frland(i) = 1.0
else
frland(i) = 0.0
endif
work1(i) = (log(Grid%area(i)) - dxmin) * dxinv
work1(i) = max(0.0, min(1.0,work1(i)))
work2(i) = 1.0 - work1(i)
Diag%psurf(i) = Statein%pgr(i)
end do

dudt(:,:) = 0.
dvdt(:,:) = 0.
dtdt(:,:) = 0.
dtdtc(:,:) = 0.
dudt(:,:) = 0.
dvdt(:,:) = 0.
dtdt(:,:) = 0.
dtdtc(:,:) = 0.
dqdt(:,:,:) = 0.

end subroutine GFS_suite_interstitial_1_run
Expand Down
Loading

0 comments on commit acca340

Please sign in to comment.