Skip to content

Commit

Permalink
Major reorganization. Added schemes for cloud-optics and gas optics. …
Browse files Browse the repository at this point in the history
…Added RRTMGP active gases to gfs_physics_nml.
  • Loading branch information
dustinswales committed Jun 5, 2019
1 parent f86636b commit a4bdffe
Show file tree
Hide file tree
Showing 15 changed files with 5,183 additions and 5,083 deletions.
68 changes: 68 additions & 0 deletions physics/GFS_rrtmgp_gas_optics.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
module GFS_rrtmgp_gas_optics
use machine, only: kind_phys
use GFS_typedefs, only: GFS_control_type,GFS_radtend_type
contains

!! \section arg_table_GFS_rrtmgp_gas_optics_init Argument Table
!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional |
!! |--------------|-----------------------------------|---------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------|
!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F |
!! | Radtend | GFS_radtend_type_instance | Fortran DDT containing FV3-GFS radiation tendencies | DDT | 0 | GFS_radtend_type | | inout | F |
!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F |
!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F |
!!
! #########################################################################################
! SUBROUTINE GFS_rrtmgp_gas_optics_init()
! #########################################################################################
subroutine GFS_rrtmgp_gas_optics_init(Model, Radtend, errmsg, errflg)
! Inputs
type(GFS_control_type), intent(in) :: &
Model ! DDT containing model control parameters
type(GFS_radtend_type), intent(inout) :: &
Radtend ! Fortran DDT containing FV3-GFS radiation tendencies
! Outputs
character(len=*), intent(out) :: &
errmsg ! Error message
integer, intent(out) :: &
errflg ! Error flag

! Local variables
character(len=1) :: tempstr
integer :: ij, count
integer,dimension(Model%ngases,2) :: gasIndices

! Initialize
errmsg = ''
errflg = 0


! Which gases are active? Provided via physics namelist.
if (len(Model%active_gases) .gt. 0) then

! Pull out gas names from list...
! First grab indices in character array corresponding to start:end of gas name.
gasIndices(1,1)=1
count=1
do ij=1,len(Model%active_gases)
tempstr=trim(Model%active_gases(ij:ij))
if (tempstr .eq. '_') then
gasIndices(count,2)=ij-1
gasIndices(count+1,1)=ij+1
count=count+1
endif
enddo
gasIndices(Model%ngases,2)=len(trim(Model%active_gases))
! Now extract the gas names
do ij=1,Model%ngases
Radtend%active_gases(ij) = Model%active_gases(gasIndices(ij,1):gasIndices(ij,2))
enddo
endif
end subroutine GFS_rrtmgp_gas_optics_init
!
subroutine GFS_rrtmgp_gas_optics_run()
end subroutine GFS_rrtmgp_gas_optics_run
!
subroutine GFS_rrtmgp_gas_optics_finalize()
end subroutine GFS_rrtmgp_gas_optics_finalize
!
end module GFS_rrtmgp_gas_optics
218 changes: 0 additions & 218 deletions physics/GFS_rrtmgp_lw.F90

This file was deleted.

2 changes: 1 addition & 1 deletion physics/GFS_rrtmgp_lw_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module GFS_rrtmgp_lw_post
use mo_gas_optics_rrtmgp, only: ty_gas_optics_rrtmgp
use mo_fluxes_byband, only: ty_fluxes_byband
use mo_heating_rates, only: compute_heating_rate
use rrtmgp_aux, only: check_error_msg
use rrtmgp_lw_gas_optics, only: check_error_msg
implicit none

public GFS_rrtmgp_lw_post_init,GFS_rrtmgp_lw_post_run,GFS_rrtmgp_lw_post_finalize
Expand Down
8 changes: 2 additions & 6 deletions physics/GFS_rrtmgp_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module GFS_rrtmgp_pre
! RRTMGP types
use mo_gas_optics_rrtmgp, only: ty_gas_optics_rrtmgp
use mo_gas_concentrations, only: ty_gas_concs
use rrtmgp_aux, only: check_error_msg
use rrtmgp_lw_gas_optics, only: check_error_msg

real(kind_phys), parameter :: &
amd = 28.9644_kind_phys, & ! Molecular weight of dry-air (g/mol)
Expand All @@ -66,11 +66,7 @@ module GFS_rrtmgp_pre
public GFS_rrtmgp_pre_run,GFS_rrtmgp_pre_init,GFS_rrtmgp_pre_finalize

contains

!> \defgroup GFS_rrtmgp_pre GFS RRTMGP Scheme Pre
!! @{
!! \section arg_table_GFS_rrtmgp_pre_init Argument Table
!!

subroutine GFS_rrtmgp_pre_init ()
end subroutine GFS_rrtmgp_pre_init

Expand Down
218 changes: 0 additions & 218 deletions physics/GFS_rrtmgp_sw.F90

This file was deleted.

2 changes: 1 addition & 1 deletion physics/GFS_rrtmgp_sw_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module GFS_rrtmgp_sw_post
use mo_gas_optics_rrtmgp, only: ty_gas_optics_rrtmgp
use mo_fluxes_byband, only: ty_fluxes_byband
use mo_heating_rates, only: compute_heating_rate
use rrtmgp_aux, only: check_error_msg
use rrtmgp_sw_gas_optics, only: check_error_msg
implicit none

public GFS_rrtmgp_sw_post_init,GFS_rrtmgp_sw_post_run,GFS_rrtmgp_sw_post_finalize
Expand Down
Loading

0 comments on commit a4bdffe

Please sign in to comment.