Skip to content

Commit

Permalink
Add missing OPTIONAL Fortran attribute in internal routines: physics/…
Browse files Browse the repository at this point in the history
…MP/Thompson/module_mp_thompson.F90 physics/PBL/MYNN_EDMF/module_bl_mynn.F90 physics/SFC_Layer/MYNN/module_sf_mynn.F90
  • Loading branch information
climbfuji committed Apr 30, 2024
1 parent 2818226 commit b9fd2d8
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 30 deletions.
7 changes: 4 additions & 3 deletions physics/MP/Thompson/module_mp_thompson.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1046,9 +1046,10 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, &
re_cloud, re_ice, re_snow
REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT):: pfils, pflls
INTEGER, INTENT(IN) :: rand_perturb_on, kme_stoch, n_var_spp
REAL, DIMENSION(:,:), INTENT(IN) :: rand_pert
REAL, DIMENSION(:), INTENT(IN) :: spp_prt_list, spp_stddev_cutoff
CHARACTER(len=10), DIMENSION(:), INTENT(IN) :: spp_var_list
REAL, DIMENSION(:,:), INTENT(IN), OPTIONAL :: rand_pert
REAL, DIMENSION(:), INTENT(IN), OPTIONAL :: spp_prt_list
REAL, DIMENSION(:), INTENT(IN) :: spp_stddev_cutoff
CHARACTER(len=10), DIMENSION(:), INTENT(IN), OPTIONAL :: spp_var_list
INTEGER, INTENT(IN):: has_reqc, has_reqi, has_reqs
#if ( WRF_CHEM == 1 )
REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT):: &
Expand Down
31 changes: 18 additions & 13 deletions physics/PBL/MYNN_EDMF/module_bl_mynn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -466,21 +466,23 @@ SUBROUTINE mynn_bl_driver( &
real(kind_phys), dimension(:,:), intent(in):: ozone
real(kind_phys), dimension(:), intent(in):: ust, &
&ch,qsfc,ps,wspd
real(kind_phys), dimension(:,:), intent(inout), optional :: &
&Qke,Tsq,Qsq,Cov
real(kind_phys), dimension(:,:), intent(inout) :: &
&Qke,Tsq,Qsq,Cov,qke_adv
&qke_adv
real(kind_phys), dimension(:,:), intent(inout) :: &
&rublten,rvblten,rthblten,rqvblten,rqcblten, &
&rqiblten,rqsblten,rqniblten,rqncblten, &
&rqnwfablten,rqnifablten,rqnbcablten
real(kind_phys), dimension(:,:), intent(inout) :: dozone
real(kind_phys), dimension(:,:), intent(in) :: rthraten

real(kind_phys), dimension(:,:), intent(out) :: exch_h,exch_m
real(kind_phys), dimension(:,:), intent(out), optional :: exch_h,exch_m
real(kind_phys), dimension(:), intent(in) :: xland, &
&ts,znt,hfx,qfx,uoce,voce

!These 10 arrays are only allocated when bl_mynn_output > 0
real(kind_phys), dimension(:,:), intent(inout) :: &
real(kind_phys), dimension(:,:), intent(inout), optional :: &
& edmf_a,edmf_w,edmf_qt,edmf_thl,edmf_ent,edmf_qc, &
& sub_thl3D,sub_sqv3D,det_thl3D,det_sqv3D

Expand All @@ -493,32 +495,35 @@ SUBROUTINE mynn_bl_driver( &
real(kind_phys), dimension(ims:ime) :: psig_bl,psig_shcu

integer,dimension(:),intent(INOUT) :: &
&KPBL,ktop_plume
&KPBL
integer,dimension(:),intent(INOUT), optional :: &
&ktop_plume

real(kind_phys), dimension(:), intent(out) :: &
real(kind_phys), dimension(:), intent(out), optional :: &
&maxmf,maxwidth,ztop_plume

real(kind_phys), dimension(:,:), intent(inout) :: el_pbl
real(kind_phys), dimension(:,:), intent(inout), optional :: el_pbl

real(kind_phys), dimension(:,:), intent(inout) :: &
real(kind_phys), dimension(:,:), intent(inout), optional :: &
&qWT,qSHEAR,qBUOY,qDISS,dqke
! 3D budget arrays are not allocated when tke_budget == 0
! 1D (local) budget arrays are used for passing between subroutines.
real(kind_phys), dimension(kts:kte) :: &
&qwt1,qshear1,qbuoy1,qdiss1,dqke1,diss_heat

real(kind_phys), dimension(:,:), intent(out) :: Sh3D,Sm3D
real(kind_phys), dimension(:,:), intent(out), optional :: Sh3D,Sm3D

real(kind_phys), dimension(:,:), intent(inout) :: &
real(kind_phys), dimension(:,:), intent(inout), optional :: &
&qc_bl,qi_bl,cldfra_bl
real(kind_phys), dimension(kts:kte) :: qc_bl1D,qi_bl1D, &
&cldfra_bl1D,qc_bl1D_old,qi_bl1D_old,cldfra_bl1D_old

! smoke/chemical arrays
integer, intent(IN ) :: nchem, kdvel, ndvel
real(kind_phys), dimension(:,:,:), intent(INOUT) :: chem3d
real(kind_phys), dimension(:,:), intent(IN) :: vdep
real(kind_phys), dimension(:), intent(IN) :: frp,EMIS_ANT_NO
real(kind_phys), dimension(:,:,:), intent(INOUT), optional :: chem3d
real(kind_phys), dimension(:,:), intent(IN), optional :: vdep
real(kind_phys), dimension(:), intent(IN), optional :: frp
real(kind_phys), dimension(:), intent(IN) :: EMIS_ANT_NO
!local
real(kind_phys), dimension(kts:kte ,nchem) :: chem1
real(kind_phys), dimension(kts:kte+1,nchem) :: s_awchem1
Expand Down Expand Up @@ -575,7 +580,7 @@ SUBROUTINE mynn_bl_driver( &

! Stochastic fields
integer, intent(IN) :: spp_pbl
real(kind_phys), dimension(:,:), intent(IN) :: pattern_spp_pbl
real(kind_phys), dimension(:,:), intent(IN), optional :: pattern_spp_pbl
real(kind_phys), dimension(KTS:KTE) :: rstoch_col

! Substepping TKE
Expand Down
34 changes: 20 additions & 14 deletions physics/SFC_Layer/MYNN/module_sf_mynn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ SUBROUTINE SFCLAY_mynn( &
th3d,pi3d

!GJF: This array must be assumed-shape since it is conditionally-allocated
REAL(kind_phys), DIMENSION( :,: ), &
REAL(kind_phys), DIMENSION( :,: ), OPTIONAL, &
INTENT(IN) :: pattern_spp_sfc
!===================================
! 2D VARIABLES
Expand All @@ -304,21 +304,23 @@ SUBROUTINE SFCLAY_mynn( &
REAL(kind_phys), DIMENSION( ims:ime ) , &
INTENT(INOUT) :: HFLX,HFX, &
QFLX,QFX, &
LH, &
MOL,RMOL, &
RMOL, &
QSFC, &
QGH, &
ZNT, &
ZOL, &
USTM, &
CPM, &
CHS2, &
CQS2, &
CHS, &
CH, &
FLHC,FLQC, &
GZ1OZ0,WSPD, &
PSIM,PSIH, &
PSIM,PSIH
REAL(kind_phys), DIMENSION( ims:ime ), OPTIONAL , &
INTENT(INOUT) :: USTM, &
CHS2, &
CQS2, &
LH, &
ZOL, &
MOL, &
WSTAR

LOGICAL, DIMENSION( ims:ime ), INTENT(IN) :: &
Expand Down Expand Up @@ -607,18 +609,20 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, &
RMOL
REAL(kind_phys), DIMENSION( ims:ime ), &
INTENT(INOUT) :: HFLX,QFLX, &
LH,MOL, &
QGH,QSFC, &
ZNT, &
ZOL, &
CPM, &
CHS2,CQS2, &
CHS,CH, &
FLHC,FLQC, &
GZ1OZ0, &
WSPD, &
PSIM, &
PSIH, &
PSIH
REAL(kind_phys), DIMENSION( ims:ime ), OPTIONAL, &
INTENT(INOUT) :: MOL, &
ZOL, &
LH, &
CHS2,CQS2, &
USTM

LOGICAL, DIMENSION( ims:ime ), INTENT(IN) :: &
Expand Down Expand Up @@ -656,8 +660,10 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, &
!--------------------------------------------
!JOE-additinal output
REAL(kind_phys), DIMENSION( ims:ime ), &
& INTENT(OUT) :: wstar, &
& qstar
& INTENT(OUT) :: qstar
REAL(kind_phys), DIMENSION( ims:ime ), OPTIONAL, &
& INTENT(OUT) :: wstar

!JOE-end

! CCPP error handling
Expand Down

0 comments on commit b9fd2d8

Please sign in to comment.