Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion physics/GFS_PBL_generic.f90
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ subroutine GFS_PBL_generic_pre_finalize()
end subroutine GFS_PBL_generic_pre_finalize

!> \brief This scheme sets up the vertically diffused tracer array for any PBL scheme based on the microphysics scheme chosen
#if 0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose in wrapping the metadata tables in this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Fortran standard actually forbids lines longer than 250-ish characters, independent whether it is free format or not. This also applies to comments. Most compilers ignore the line length limitation for comments, but PGI does not (and NAG neither I believe). Wrapping them in #if0 means that the tables get suppressed in the code that gets compiled.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes. Thanks for the reminder.

!! \section arg_table_GFS_PBL_generic_pre_run Argument Table
!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional |
!! |------------------------------|--------------------------------------------------------|-------------------------------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------|
Expand Down Expand Up @@ -40,6 +41,7 @@ end subroutine GFS_PBL_generic_pre_finalize
!! | 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 |
!!
#endif
subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, imp_physics, imp_physics_gfdl, imp_physics_thompson, &
imp_physics_wsm6, ltaerosol, qgrs, qgrs_water_vapor, qgrs_liquid_cloud, qgrs_ice_cloud, qgrs_ozone, &
qgrs_cloud_droplet_num_conc, qgrs_cloud_ice_num_conc, qgrs_water_aer_num_conc, qgrs_ice_aer_num_conc, qgrs_rain, &
Expand Down Expand Up @@ -139,7 +141,7 @@ subroutine GFS_PBL_generic_post_finalize ()
end subroutine GFS_PBL_generic_post_finalize



#if 0
!> \section arg_table_GFS_PBL_generic_post_run Argument Table
!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional |
!! |------------------------------|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------|
Expand Down Expand Up @@ -208,6 +210,7 @@ end subroutine GFS_PBL_generic_post_finalize
!! | 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 |
!!
#endif
subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, ntoz, imp_physics, imp_physics_gfdl, imp_physics_thompson, &
imp_physics_wsm6, ltaerosol, cplflx, lssav, ldiag3d, lsidea, hybedmf, dvdftra, dusfc1, dvsfc1, dtsfc1, dqsfc1, dtf, &
dudt, dvdt, dtdt, htrsw, htrlw, xmu,&
Expand Down
32 changes: 22 additions & 10 deletions physics/GFS_stochastics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ end subroutine GFS_stochastics_finalize
!! | do_skeb | flag_for_stochastic_skeb_option | flag for stochastic skeb option | flag | 0 | logical | | in | F |
!! | zmtnblck | level_of_dividing_streamline | level of the dividing streamline | none | 1 | real | kind_phys | in | F |
!! | sppt_wts | weights_for_stochastic_surface_physics_perturbation | weights for stochastic surface physics perturbation | none | 2 | real | kind_phys | inout | F |
!! | sppt_wts_inv | weights_for_stochastic_surface_physics_perturbation_flipped | weights for stochastic surface physics perturbation, flipped | none | 2 | real | kind_phys | out | F |
!! | skebu_wts | weights_for_stochastic_skeb_perturbation_of_x_wind | weights for stochastic skeb perturbation of x wind | none | 2 | real | kind_phys | in | F |
!! | skebv_wts | weights_for_stochastic_skeb_perturbation_of_y_wind | weights for stochastic skeb perturbation of y wind | none | 2 | real | kind_phys | in | F |
!! | shum_wts | weights_for_stochastic_shum_perturbation | weights for stochastic shum perturbation | none | 2 | real | kind_phys | in | F |
!! | sppt_wts_inv | weights_for_stochastic_surface_physics_perturbation_flipped | weights for stochastic surface physics perturbation, flipped | none | 2 | real | kind_phys | inout | F |
!! | skebu_wts_inv | weights_for_stochastic_skeb_perturbation_of_x_wind_flipped | weights for stochastic skeb perturbation of x wind, flipped | none | 2 | real | kind_phys | inout | F |
!! | skebv_wts_inv | weights_for_stochastic_skeb_perturbation_of_y_wind_flipped | weights for stochastic skeb perturbation of y wind, flipped | none | 2 | real | kind_phys | inout | F |
!! | shum_wts_inv | weights_for_stochastic_shum_perturbation_flipped | weights for stochastic shum perturbation, flipped | none | 2 | real | kind_phys | inout | F |
!! | diss_est | dissipation_estimate_of_air_temperature_at_model_layers | dissipation estimate model layer mean temperature | K | 2 | real | kind_phys | in | F |
!! | ugrs | x_wind | zonal wind | m s-1 | 2 | real | kind_phys | in | F |
!! | vgrs | y_wind | meridional wind | m s-1 | 2 | real | kind_phys | in | F |
Expand Down Expand Up @@ -60,8 +63,9 @@ end subroutine GFS_stochastics_finalize
! 6) performs surface data cycling via the GFS gcycle routine
!-------------------------------------------------------------------------
subroutine GFS_stochastics_run (im, km, do_sppt, use_zmtnblck, do_shum, do_skeb, &
zmtnblck, sppt_wts, sppt_wts_inv, skebu_wts, &
skebv_wts, shum_wts, diss_est, &
zmtnblck, sppt_wts, skebu_wts, skebv_wts, shum_wts,&
sppt_wts_inv, skebu_wts_inv, skebv_wts_inv, &
shum_wts_inv, diss_est, &
ugrs, vgrs, tgrs, qgrs, gu0, gv0, gt0, gq0, dtdtr, &
rain, rainc, tprcp, totprcp, cnvprcp, &
cplflx, rain_cpl, snow_cpl, drain_cpl, dsnow_cpl, &
Expand All @@ -78,14 +82,18 @@ subroutine GFS_stochastics_run (im, km, do_sppt, use_zmtnblck, do_shum, do_skeb,
logical, intent(in) :: do_shum
logical, intent(in) :: do_skeb
real(kind_phys), dimension(1:im), intent(in) :: zmtnblck
! sppt_wts only allocated if do_sppt == .true. (sppt_wts_inv is always allocated)
! sppt_wts only allocated if do_sppt == .true.
real(kind_phys), dimension(:,:), intent(inout) :: sppt_wts
real(kind_phys), dimension(1:im,1:km), intent(out) :: sppt_wts_inv
! skebu_wts, skebv_wts only allocated if do_skeb == .true.
real(kind_phys), dimension(:,:), intent(in) :: skebu_wts
real(kind_phys), dimension(:,:), intent(in) :: skebv_wts
! shum_wts only allocated if do_shum == .true.
real(kind_phys), dimension(:,:), intent(in) :: shum_wts
! inverse/flipped weights are always allocated
real(kind_phys), dimension(1:im,1:km), intent(inout) :: sppt_wts_inv
real(kind_phys), dimension(1:im,1:km), intent(inout) :: skebu_wts_inv
real(kind_phys), dimension(1:im,1:km), intent(inout) :: skebv_wts_inv
real(kind_phys), dimension(1:im,1:km), intent(inout) :: shum_wts_inv
real(kind_phys), dimension(1:im,1:km), intent(in) :: diss_est
real(kind_phys), dimension(1:im,1:km), intent(in) :: ugrs
real(kind_phys), dimension(1:im,1:km), intent(in) :: vgrs
Expand Down Expand Up @@ -172,16 +180,20 @@ subroutine GFS_stochastics_run (im, km, do_sppt, use_zmtnblck, do_shum, do_skeb,
endif

endif

if (do_shum) then
gq0(:,:) = gq0(:,:)*(1.0 + shum_wts(:,:))
do k=1,km
gq0(:,k) = gq0(:,k)*(1.0 + shum_wts(:,k))
shum_wts_inv(:,km-k+1) = shum_wts(:,k)
end do
endif

if (do_skeb) then
do k=1,km
gu0(:,k) = gu0(:,k)+skebu_wts(:,k)*(diss_est(:,k))
gv0(:,k) = gv0(:,k)+skebv_wts(:,k)*(diss_est(:,k))
! print*,'in do skeb',skebu_wts(1,k),diss_est(1,k)
gu0(:,k) = gu0(:,k)+skebu_wts(:,k)*(diss_est(:,k))
gv0(:,k) = gv0(:,k)+skebv_wts(:,k)*(diss_est(:,k))
skebu_wts_inv(:,km-k+1) = skebu_wts(:,k)
skebv_wts_inv(:,km-k+1) = skebv_wts(:,k)
enddo
endif

Expand Down
Loading