Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mzhangw committed Jun 24, 2024
1 parent 8525a7e commit 9b53b71
Show file tree
Hide file tree
Showing 25 changed files with 354 additions and 479 deletions.
3 changes: 0 additions & 3 deletions physics/GWD/ugwpv1_gsldrag.F90
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ module ugwpv1_gsldrag
!>@brief The subroutine initializes the unified UGWP
!> \section arg_table_ugwpv1_gsldrag_init Argument Table
!! \htmlinclude ugwpv1_gsldrag_init.html
!!
! -----------------------------------------------------------------------
!
subroutine ugwpv1_gsldrag_init ( &
me, master, nlunit, input_nml_file, logunit, &
fn_nml2, jdat, lonr, latr, levs, ak, bk, dtp, &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@ module GFS_ccpp_suite_sim_pre
public GFS_ccpp_suite_sim_pre_run, load_ccpp_suite_sim
contains

! ######################################################################################
!
! SUBROUTINE GFS_ccpp_suite_sim_pre_run
!
! ######################################################################################
!> \section arg_table_GFS_ccpp_suite_sim_pre_run
!> \section arg_table_GFS_ccpp_suite_sim_pre_run Argument Table
!! \htmlinclude GFS_ccpp_suite_sim_pre_run.html
!!
subroutine GFS_ccpp_suite_sim_pre_run(do_ccpp_suite_sim, dtend, ntqv, dtidx, dtp, &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module GFS_cloud_diagnostics
!! This was bundled together with the prognostic cloud modules within the RRTMG implementation.
!! For the RRTMGP implementation we propose to keep these diagnostics independent.
!> @{
!> \section arg_table_GFS_cloud_diagnostics_run
!> \section arg_table_GFS_cloud_diagnostics_run Argument Table
!! \htmlinclude GFS_cloud_diagnostics_run.html
!!
subroutine GFS_cloud_diagnostics_run(nCol, nLev, iovr, iovr_rand, iovr_maxrand, &
Expand Down
51 changes: 24 additions & 27 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.F90
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
! ###########################################################################################
!> \file GFS_physics_post.F90
!!
!! This module contains GFS specific calculations (e.g. diagnostics) and suite specific
Expand All @@ -13,10 +12,7 @@ module GFS_physics_post
public GFS_physics_post_run
contains

! ###########################################################################################
! SUBROUTINE GFS_physics_post_run
! ###########################################################################################
!! \section arg_table_GFS_physics_post_run Argument Table
!> \section arg_table_GFS_physics_post_run Argument Table
!! \htmlinclude GFS_physics_post_run.html
!!
subroutine GFS_physics_post_run(nCol, nLev, ntoz, ntracp100, nprocess, nprocess_summed, &
Expand All @@ -26,39 +22,39 @@ subroutine GFS_physics_post_run(nCol, nLev, ntoz, ntracp100, nprocess, nprocess_

! Inputs
integer, intent(in) :: &
nCol, & ! Horizontal dimension
nLev, & ! Number of vertical layers
ntoz, & ! Index for ozone mixing ratio
ntracp100, & ! Number of tracers plus 100
nprocess, & ! Number of processes that cause changes in state variables
nprocess_summed,& ! Number of causes in dtidx per tracer summed for total physics tendency
ip_physics, & ! Index for process in diagnostic tendency output
ip_photochem, & ! Index for process in diagnostic tendency output
ip_prod_loss, & ! Index for process in diagnostic tendency output
ip_ozmix, & ! Index for process in diagnostic tendency output
ip_temp, & ! Index for process in diagnostic tendency output
ip_overhead_ozone ! Index for process in diagnostic tendency output
nCol, & !< Horizontal dimension
nLev, & !< Number of vertical layers
ntoz, & !< Index for ozone mixing ratio
ntracp100, & !< Number of tracers plus 100
nprocess, & !< Number of processes that cause changes in state variables
nprocess_summed,& !< Number of causes in dtidx per tracer summed for total physics tendency
ip_physics, & !< Index for process in diagnostic tendency output
ip_photochem, & !< Index for process in diagnostic tendency output
ip_prod_loss, & !< Index for process in diagnostic tendency output
ip_ozmix, & !< Index for process in diagnostic tendency output
ip_temp, & !< Index for process in diagnostic tendency output
ip_overhead_ozone !< Index for process in diagnostic tendency output
integer, intent(in), dimension(:,:) :: &
dtidx ! Bookkeeping indices for GFS diagnostic tendencies
dtidx !< Bookkeeping indices for GFS diagnostic tendencies
logical, intent(in) :: &
ldiag3d ! Flag for 3d diagnostic fields
ldiag3d !< Flag for 3d diagnostic fields
logical, intent(in), dimension(:) :: &
is_photochem ! Flags for photochemistry processes to sum
is_photochem !< Flags for photochemistry processes to sum

! Inputs (optional)
real(kind=kind_phys), intent(in), dimension(:,:), pointer, optional :: &
do3_dt_prd, & ! Physics tendency: production and loss effect
do3_dt_ozmx, & ! Physics tendency: ozone mixing ratio effect
do3_dt_temp, & ! Physics tendency: temperature effect
do3_dt_ohoz ! Physics tendency: overhead ozone effect
do3_dt_prd, & !< Physics tendency: production and loss effect
do3_dt_ozmx, & !< Physics tendency: ozone mixing ratio effect
do3_dt_temp, & !< Physics tendency: temperature effect
do3_dt_ohoz !< Physics tendency: overhead ozone effect

! Outputs
real(kind=kind_phys), intent(inout), dimension(:,:,:) :: &
dtend ! Diagnostic tendencies for state variables
dtend !< Diagnostic tendencies for state variables
character(len=*), intent(out) :: &
errmsg ! CCPP error message
errmsg !< CCPP error message
integer, intent(out) :: &
errflg ! CCPP error flag
errflg !< CCPP error flag

! Locals
integer :: idtend, ichem, iphys, itrac
Expand Down Expand Up @@ -123,6 +119,7 @@ subroutine GFS_physics_post_run(nCol, nLev, ntoz, ntracp100, nprocess, nprocess_

contains

!>
subroutine sum_it(isum,itrac,sum_me)
integer, intent(in) :: isum ! third index of dtend of summary process
integer, intent(in) :: itrac ! tracer or state variable being summed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ module GFS_rad_time_vary

contains

!>\defgroup mod_GFS_rad_time_vary GFS Radiation Time Update
!! This module contains code related to GFS radiation setup.
!> @{
!> This module contains code related to GFS radiation setup.
!> \section arg_table_GFS_rad_time_vary_timestep_init Argument Table
!! \htmlinclude GFS_rad_time_vary_timestep_init.html
!!
subroutine GFS_rad_time_vary_timestep_init (lrseeds, rseeds, &
lslwr, lsswr, isubc_lw, isubc_sw, icsdsw, icsdlw, cnx, cny, isc, jsc, &
imap, jmap, sec, kdt, imp_physics, imp_physics_zhao_carr, ipsd0, ipsdlim,&
Expand Down Expand Up @@ -97,6 +94,5 @@ subroutine GFS_rad_time_vary_timestep_init (lrseeds, rseeds,
endif

end subroutine GFS_rad_time_vary_timestep_init
!> @}

end module GFS_rad_time_vary
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ module GFS_rad_time_vary

contains

!>\defgroup mod_GFS_rad_time_vary GFS Radiation Time Update
!! This module contains code related to GFS radiation setup.
!> @{
!> This module contains code related to GFS radiation setup.
!> \section arg_table_GFS_rad_time_vary_timestep_init Argument Table
!! \htmlinclude GFS_rad_time_vary_timestep_init.html
!!
subroutine GFS_rad_time_vary_timestep_init (lrseeds, rseeds, &
lslwr, lsswr, isubc_lw, isubc_sw, icsdsw, icsdlw, cnx, cny, isc, jsc, &
imap, jmap, sec, kdt, imp_physics, imp_physics_zhao_carr, ipsd0, ipsdlim,&
Expand Down Expand Up @@ -97,6 +94,5 @@ subroutine GFS_rad_time_vary_timestep_init (lrseeds, rseeds,
endif

end subroutine GFS_rad_time_vary_timestep_init
!> @}

end module GFS_rad_time_vary
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ module GFS_radiation_surface

contains

!>\defgroup GFS_radiation_surface_mod GFS Radiation Surface Module
!! This module contains calls to module_radiation_surface::setemis() to set up
!! surface emissivity for LW radiation and to module_radiation_surface::setalb()
!! to set up surface albedo for SW radiation.
!> @{
!> \section arg_table_GFS_radiation_surface_init Argument Table
!! \htmlinclude GFS_radiation_surface_init.html
!!
subroutine GFS_radiation_surface_init (me, ialb, iems, semis_file, con_pi, errmsg, errflg)

use module_radiation_surface, only: sfc_init
Expand Down Expand Up @@ -192,5 +189,4 @@ subroutine GFS_radiation_surface_run ( &

end subroutine GFS_radiation_surface_run

!> @}
end module GFS_radiation_surface
39 changes: 11 additions & 28 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.F90
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
!> \file GFS_rrtmgp_cloud_mp.F90
!!
!> \defgroup GFS_rrtmgp_cloud_mp GFS_rrtmgp_cloud_mp.F90
!!
!! \brief This module contains the interface for ALL cloud microphysics assumptions and
!! This module contains the interface for ALL cloud microphysics assumptions and
!! the RRTMGP radiation scheme. Specific details below in subroutines.
!!
module GFS_rrtmgp_cloud_mp
Expand Down Expand Up @@ -31,17 +28,11 @@ module GFS_rrtmgp_cloud_mp

contains

!>\defgroup gfs_rrtmgp_cloud_mp_mod GFS RRTMGP Cloud MP Module
!! \section arg_table_GFS_rrtmgp_cloud_mp_run
!> \section arg_table_GFS_rrtmgp_cloud_mp_run Argument Table
!! \htmlinclude GFS_rrtmgp_cloud_mp_run_html
!!
!> \ingroup GFS_rrtmgp_cloud_mp
!!
!! Here the cloud-radiative properties (optical-path, particle-size and sometimes cloud-
!! fraction) are computed for cloud producing physics schemes (e.g GFDL-MP, Thompson-MP,
!! MYNN-EDMF-pbl, GF-convective, and SAMF-convective clouds).
!!
!! \section GFS_rrtmgp_cloud_mp_run
subroutine GFS_rrtmgp_cloud_mp_run(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldice, &
i_cldrain, i_cldsnow, i_cldgrpl, i_cldtot, i_cldliq_nc, i_cldice_nc, i_twa, kdt, &
imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_samf, doSWrad, doLWrad, effr_in, lmfshal, &
Expand Down Expand Up @@ -310,8 +301,7 @@ subroutine GFS_rrtmgp_cloud_mp_run(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldic

end subroutine GFS_rrtmgp_cloud_mp_run

!> \ingroup GFS_rrtmgp_cloud_mp
!! Compute cloud radiative properties for Grell-Freitas convective cloud scheme.
!> Compute cloud radiative properties for Grell-Freitas convective cloud scheme.
!! (Adopted from module_SGSCloud_RadPre)
!!
!! - The total convective cloud condensate is partitoned by phase, using temperature, into
Expand Down Expand Up @@ -390,8 +380,7 @@ subroutine cloud_mp_GF(nCol, nLev, lsmask, t_lay, p_lev, p_lay, qs_lay, relhum,
enddo
end subroutine cloud_mp_GF

!> \ingroup GFS_rrtmgp_cloud_mp
!! Compute cloud radiative properties for MYNN-EDMF PBL cloud scheme.
!> Compute cloud radiative properties for MYNN-EDMF PBL cloud scheme.
!! (Adopted from module_SGSCloud_RadPre)
!!
!! - Cloud-fraction, liquid, and ice condensate mixing-ratios from MYNN-EDMF cloud scheme
Expand Down Expand Up @@ -463,8 +452,7 @@ subroutine cloud_mp_MYNN(nCol, nLev, lsmask, t_lay, p_lev, p_lay, qs_lay, relhum
end subroutine cloud_mp_MYNN


!> \ingroup GFS_rrtmgp_cloud_mp
!! Compute cloud radiative properties for SAMF convective cloud scheme.
!> Compute cloud radiative properties for SAMF convective cloud scheme.
!!
!! - The total-cloud convective mixing-ratio is partitioned by phase into liquid/ice
!! cloud properties. LWP and IWP are computed.
Expand Down Expand Up @@ -527,8 +515,7 @@ subroutine cloud_mp_SAMF(nCol, nLev, t_lay, p_lev, p_lay, qs_lay, relhum,

end subroutine cloud_mp_SAMF

!> \ingroup GFS_rrtmgp_cloud_mp
!! This routine computes the cloud radiative properties for a "unified cloud".
!> This routine computes the cloud radiative properties for a "unified cloud".
!! - "unified cloud" implies that the cloud-fraction is PROVIDED.
!! - The cloud water path is computed for all provided cloud mixing-ratios and hydrometeors.
!! - If particle sizes are provided, they are used. If not, default values are assigned.
Expand Down Expand Up @@ -658,8 +645,8 @@ subroutine cloud_mp_uni(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldice, i_cldrai
enddo ! nLev

end subroutine cloud_mp_uni
!> \ingroup GFS_rrtmgp_cloud_mp
!! This routine computes the cloud radiative properties for the Thompson cloud micro-

!> This routine computes the cloud radiative properties for the Thompson cloud micro-
!! physics scheme.
!!
!! - The cloud water path is computed for all provided cloud mixing-ratios and hydrometeors.
Expand Down Expand Up @@ -791,8 +778,7 @@ subroutine cloud_mp_thompson(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldice, i_c

end subroutine cloud_mp_thompson

!> \ingroup GFS_rrtmgp_cloud_mp
!! This function computes the cloud-fraction following.
!> This function computes the cloud-fraction following.
!! Xu-Randall(1996) A Semiempirical Cloudiness Parameterization for Use in Climate Models
!! https://doi.org/10.1175/1520-0469(1996)053<3084:ASCPFU>2.0.CO;2
!!
Expand Down Expand Up @@ -835,11 +821,8 @@ function cld_frac_XuRandall(p_lay, qs_lay, relhum, cld_mr, alpha)
return
end function

! ######################################################################################
! This routine is a wrapper to update the Thompson effective particle sizes used by the
! RRTMGP radiation scheme.
!
! ######################################################################################
!> This routine is a wrapper to update the Thompson effective particle sizes used by the
!! RRTMGP radiation scheme.
subroutine cmp_reff_Thompson(nLev, nCol, i_cldliq, i_cldice, i_cldsnow, i_cldice_nc, &
i_cldliq_nc, i_twa, q_lay, p_lay, t_lay, tracer, con_eps, con_rd, ltaerosol, &
mraerosol, lsmask, effrin_cldliq, effrin_cldice, effrin_cldsnow)
Expand Down
18 changes: 4 additions & 14 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.F90
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
!> \file GFS_rrtmgp_post.F90
!!
!> \defgroup GFS_rrtmgp_post GFS_rrtmgp_post.F90
!!
!! \brief RRTMGP post-processing routine.
!! RRTMGP post-processing routine.
!!
module GFS_rrtmgp_post
use machine, only: kind_phys
Expand All @@ -15,23 +12,16 @@ module GFS_rrtmgp_post
public GFS_rrtmgp_post_run

contains
! ########################################################################################
!>\defgroup gfs_rrtmgp_post_mod GFS RRTMGP Post Module
!> \section arg_table_GFS_rrtmgp_post_run

!> \section arg_table_GFS_rrtmgp_post_run Argument Table
!! \htmlinclude GFS_rrtmgp_post.html
!!
!! \ingroup GFS_rrtmgp_post
!!
!! \brief The all-sky radiation tendency is computed, the clear-sky tendency is computed
!!The all-sky radiation tendency is computed, the clear-sky tendency is computed
!! if requested.
!!
!! RRTMGP surface and TOA fluxes are copied to fields that persist between radiation/physics
!! calls.
!!
!! (optional) Save additional diagnostics.
!!
!! \section GFS_rrtmgp_post_run
! ########################################################################################
subroutine GFS_rrtmgp_post_run (nCol, nLev, nDay, iSFC, iTOA, idxday, doLWrad, doSWrad, &
do_lw_clrsky_hr, do_sw_clrsky_hr, save_diag, fhlwr, fhswr, sfc_alb_nir_dir, &
sfc_alb_nir_dif, sfc_alb_uvvis_dir, sfc_alb_uvvis_dif, p_lev, tsfa, coszen, coszdg, &
Expand Down
Loading

0 comments on commit 9b53b71

Please sign in to comment.