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
20 changes: 16 additions & 4 deletions main/depend.common
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ module_physics_init.o: \
module_mp_sbu_ylin.o \
module_mp_wsm3.o \
module_mp_wsm5.o \
module_mp_wsm6.o \
physics_mmm/mp_wsm6.o \
module_mp_wsm6r.o \
module_mp_etanew.o \
module_mp_fer_hires.o \
Expand Down Expand Up @@ -1423,9 +1423,10 @@ module_mp_wdm5.o: \


module_mp_wsm6.o: \
../share/module_model_constants.o \
module_mp_radar.o

ccpp_kind_types.o \
physics_mmm/mp_wsm6_effectRad.o \
physics_mmm/mp_radar.o \
physics_mmm/mp_wsm6.o

module_mp_wdm6.o: \
../share/module_model_constants.o \
Expand Down Expand Up @@ -1488,6 +1489,17 @@ module_mp_gsfcgce_4ice_nuwrf.o: \
module_mp_radar.o \


physics_mmm/mp_wsm6.o: \
ccpp_kind_types.o \
physics_mmm/mp_radar.o \
physics_mmm/module_libmassv.o


physics_mmm/mp_wsm6_effectRad.o: \
ccpp_kind_types.o \
physics_mmm/mp_wsm6.o


physics_mmm/bl_ysu.o: \
ccpp_kind_types.o

Expand Down
6 changes: 4 additions & 2 deletions phys/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,13 @@ DIAGNOSTIC_MODULES_EM = \
module_diag_solar.o

PHYSMMM_MODULES = \
physics_mmm/module_libmassv.o \
physics_mmm/mp_wsm6.o \
physics_mmm/mp_wsm6_effectRad.o \
physics_mmm/mp_radar.o \
physics_mmm/bl_gwdo.o \
physics_mmm/bl_ysu.o



OBJS =

LIBTARGET = physics
Expand Down
9 changes: 9 additions & 0 deletions phys/module_microphysics_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,10 @@ SUBROUTINE microphysics_driver( &
REAL :: constants_irrigation,tloc,irr_start,phase
INTEGER, OPTIONAL, DIMENSION( ims:ime , jms:jme ), INTENT(INOUT) :: irr_rand_field

! To accommodate shared physics
character*256 :: errmsg
integer :: errflg

!---------------------------------------------------------------------
! check for microphysics type. We need a clean way to
! specify these things!
Expand Down Expand Up @@ -2329,9 +2333,14 @@ SUBROUTINE microphysics_driver( &
,has_reqc=has_reqc & ! for radiation +
,has_reqi=has_reqi &
,has_reqs=has_reqs &
,re_qc_bg=re_qc_bg,re_qi_bg=re_qi_bg &
,re_qs_bg=re_qs_bg &
,re_qc_max=re_qc_max,re_qi_max=re_qi_max &
,re_qs_max=re_qs_max &
,re_cloud=re_cloud &
,re_ice=re_ice &
,re_snow=re_snow & ! for radiation -
,errmsg=errmsg, errflg=errflg &
,IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde &
,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme &
,ITS=its,ITE=ite, JTS=jts,JTE=jte, KTS=kts,KTE=kte &
Expand Down
2,866 changes: 212 additions & 2,654 deletions phys/module_mp_wsm6.F

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions phys/module_physics_init.F
Original file line number Diff line number Diff line change
Expand Up @@ -4375,7 +4375,7 @@ SUBROUTINE mp_init(RAINNC,SNOWNC,GRAUPELNC,config_flags,restart,warm_rain,
!------------------------------------------------------------------
USE module_mp_wsm3
USE module_mp_wsm5
USE module_mp_wsm6
USE mp_wsm6
USE module_mp_wsm7
USE module_mp_etanew
USE module_mp_fer_hires
Expand Down Expand Up @@ -4446,6 +4446,10 @@ SUBROUTINE mp_init(RAINNC,SNOWNC,GRAUPELNC,config_flags,restart,warm_rain,
logical :: nssl_density_on
INTEGER :: i_err

! To accommodate shared physics
character*256 :: errmsg
integer :: errflg

warm_rain = .false.
adv_moist_cond = .true.
itf=min0(ite,ide-1)
Expand Down Expand Up @@ -4474,7 +4478,7 @@ SUBROUTINE mp_init(RAINNC,SNOWNC,GRAUPELNC,config_flags,restart,warm_rain,
CASE (WSM5SCHEME)
CALL wsm5init(rhoair0,rhowater,rhosnow,cliq,cpv, allowed_to_read )
CASE (WSM6SCHEME)
CALL wsm6init(rhoair0,rhowater,rhosnow,cliq,cpv, config_flags%hail_opt,allowed_to_read )
CALL mp_wsm6_init(rhoair0,rhowater,rhosnow,cliq,cpv,config_flags%hail_opt,errmsg,errflg)
CASE (WSM7SCHEME)
CALL wsm7init(rhoair0,rhowater,rhosnow,cliq,cpv, allowed_to_read )
CASE (ETAMPNEW)
Expand Down
91 changes: 91 additions & 0 deletions phys/physics_mmm/module_libmassv.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
!=================================================================================================================
module module_libmassv

implicit none


interface vrec
module procedure vrec_d
module procedure vrec_s
end interface

interface vsqrt
module procedure vsqrt_d
module procedure vsqrt_s
end interface

integer, parameter, private :: R4KIND = selected_real_kind(6)
integer, parameter, private :: R8KIND = selected_real_kind(12)

contains


!=================================================================================================================
subroutine vrec_d(y,x,n)
!=================================================================================================================
integer,intent(in):: n
real(kind=R8KIND),dimension(*),intent(in):: x
real(kind=R8KIND),dimension(*),intent(out):: y

integer:: j
!-----------------------------------------------------------------------------------------------------------------

do j=1,n
y(j)=real(1.0,kind=R8KIND)/x(j)
enddo

end subroutine vrec_d

!=================================================================================================================
subroutine vrec_s(y,x,n)
!=================================================================================================================
integer,intent(in):: n
real(kind=R4KIND),dimension(*),intent(in):: x
real(kind=R4KIND),dimension(*),intent(out):: y

integer:: j
!-----------------------------------------------------------------------------------------------------------------

do j=1,n
y(j)=real(1.0,kind=R4KIND)/x(j)
enddo

end subroutine vrec_s

!=================================================================================================================
subroutine vsqrt_d(y,x,n)
!=================================================================================================================
integer,intent(in):: n
real(kind=R8KIND),dimension(*),intent(in):: x
real(kind=R8KIND),dimension(*),intent(out):: y

integer:: j
!-----------------------------------------------------------------------------------------------------------------

do j=1,n
y(j)=sqrt(x(j))
enddo

end subroutine vsqrt_d

!=================================================================================================================
subroutine vsqrt_s(y,x,n)
!=================================================================================================================

integer,intent(in):: n
real(kind=R4KIND),dimension(*),intent(in):: x
real(kind=R4KIND),dimension(*),intent(out):: y

integer:: j

!-----------------------------------------------------------------------------------------------------------------

do j=1,n
y(j)=sqrt(x(j))
enddo

end subroutine vsqrt_s

!=================================================================================================================
end module module_libmassv
!=================================================================================================================
Loading