Skip to content

Commit

Permalink
Address review comments from Grant Firl on inten inout
Browse files Browse the repository at this point in the history
  • Loading branch information
lisa-bengtsson committed Feb 26, 2025
1 parent 375aa85 commit 43807e6
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 10 deletions.
17 changes: 16 additions & 1 deletion physics/CONV/SAMF/samfdeepcnv.f
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, &
real(kind=kind_phys), intent(in) :: tmf(:,:,:),q(:,:)
real(kind=kind_phys), dimension (:), intent(in), optional :: maxMF
real(kind=kind_phys), intent(out) :: rainevap(:)
real(kind=kind_phys), intent(out), optional :: sigmaout(:,:), &
real(kind=kind_phys), intent(inout), optional :: sigmaout(:,:), &
& omegaout(:,:)
logical, intent(in) :: do_ca,ca_closure,ca_entr,ca_trigger
integer, intent(inout) :: kcnv(:)
Expand Down Expand Up @@ -401,6 +401,21 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, &
enddo
enddo
!
if (present(sigmaout)) then
do k = 1, km
do i = 1, im
sigmaout(i,k) = 0.0
enddo
enddo
endif
if (present(omegaout)) then
do k = 1, km
do i = 1, im
omegaout(i,k) = 0.0
enddo
enddo
endif

if (hwrf_samfdeep) then
do i=1,im
scaldfunc(i)=-1.0
Expand Down
4 changes: 2 additions & 2 deletions physics/CONV/SAMF/samfdeepcnv.meta
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = out
intent = inout
optional = True
[omegain]
standard_name = prognostic_updraft_velocity_in_convection
Expand All @@ -478,7 +478,7 @@
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = out
intent = inout
optional = True
[betascu]
standard_name = tuning_param_for_shallow_cu
Expand Down
21 changes: 18 additions & 3 deletions physics/CONV/SAMF/samfshalcnv.f
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, &
real(kind=kind_phys), intent(out) :: rn(:), &
& cnvw(:,:), cnvc(:,:), dt_mf(:,:)
!
real(kind=kind_phys), intent(out), optional :: ud_mf(:,:), &
& sigmaout(:,:), omegaout(:,:)
real(kind=kind_phys), intent(out), optional :: ud_mf(:,:)
real(kind=kind_phys), intent(inout), optional :: sigmaout(:,:), &
& omegaout(:,:)
real(kind=kind_phys), intent(in) :: clam, c0s, c1, &
& asolfac, evef, pgcon
logical, intent(in) :: hwrf_samfshal,first_time_step, &
Expand Down Expand Up @@ -352,7 +353,21 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, &
enddo
endif
!!

if (present(sigmaout)) then
do k = 1, km
do i = 1, im
sigmaout(i,k) = 0.0
enddo
enddo
endif
if (present(omegaout)) then
do k = 1, km
do i = 1, im
omegaout(i,k) = 0.0
enddo
enddo
endif

!> - Return to the calling routine if deep convection is present or the surface buoyancy flux is negative.
totflg = .true.
do i=1,im
Expand Down
4 changes: 2 additions & 2 deletions physics/CONV/SAMF/samfshalcnv.meta
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = out
intent = inout
optional = True
[omegain]
standard_name = prognostic_updraft_velocity_in_convection
Expand All @@ -510,7 +510,7 @@
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = out
intent = inout
optional = True
[betascu]
standard_name = tuning_param_for_shallow_cu
Expand Down
2 changes: 1 addition & 1 deletion physics/CONV/progomega_calc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ subroutine progomega_calc(first_time_step,flag_restart,im,km,kbcon1,ktcon,omegai
real(kind=kind_phys), intent(in) :: delt,grav,bb1,bb2
real(kind=kind_phys), intent(in) :: omegain(im,km), del(im,km),zi(im,km)
real(kind=kind_phys), intent(in) :: drag(im,km),buo(im,km),wush(im,km),tentr(im,km)
real(kind=kind_phys), intent(out) :: omegaout(im,km)
real(kind=kind_phys), intent(inout) :: omegaout(im,km)
logical, intent(in) :: cnvflg(im),first_time_step,flag_restart
real(kind=kind_phys) :: termA(im,km),termB(im,km),termC(im,km),omega(im,km)
real(kind=kind_phys) :: RHS(im,km),Kd(im,km)
Expand Down
2 changes: 1 addition & 1 deletion physics/CONV/progsigma_calc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ subroutine progsigma_calc (im,km,flag_init,flag_restart,flag_shallow,&
real(kind=kind_phys), intent(in) :: sigmain(im,km)

! intent out
real(kind=kind_phys), intent(out) :: sigmaout(im,km)
real(kind=kind_phys), intent(inout) :: sigmaout(im,km)
real(kind=kind_phys), intent(out) :: sigmab(im)


Expand Down

0 comments on commit 43807e6

Please sign in to comment.