55 TYPE(t_region
),
INTENT(INOUT),
TARGET :: region
58 INTEGER :: icont, ipcls
61 CHARACTER(CHRLEN) :: rcsidentstring
66 INTEGER :: ncont, npcls
67 INTEGER,
POINTER,
DIMENSION(:) :: pcvplagmass, pdvplagvolu
68 INTEGER,
POINTER,
DIMENSION(:,:) :: paiv
70 REAL(RFREAL) :: heatcapsum, masssum, masssumr, &
71 onethird,
pi, pir, volusum
72 REAL(RFREAL),
POINTER,
DIMENSION(:) :: pdens, pmixtvol, pspcheat
73 REAL(RFREAL),
POINTER,
DIMENSION(:,:) :: pcv, pdv
75 TYPE(t_plag) ,
POINTER :: pplag
80 rcsidentstring =
'$RCSfile: PLAG_CalcDerivedVariables.F90,v $ $Revision: 1.3 $'
82 global => region%global
85 'PLAG_CalcDerivedVariables.F90' )
89 onethird = 1.0_rfreal/3.0_rfreal
94 ilev = region%currLevel
95 npcls = region%levels(ilev)%plag%nPcls
98 npcls = region%plag%nPcls
100 ncont = region%plagInput%nCont
105 pmixtvol => region%levels(ilev)%grid%vol
106 pplag => region%levels(ilev)%plag
109 pmixtvol => region%grid%vol
117 pcvplagmass => pplag%cvPlagMass
118 pdvplagvolu => pplag%dvPlagVolu
120 pdens => region%plagInput%dens
121 pspcheat => region%plagInput%spht
129 masssum =
sum( pcv(pplag%cvPlagMass(:),ipcls) )
130 masssumr = 1.0_rfreal/masssum
135 pdv(pdvplagvolu(icont),ipcls) = pcv(pcvplagmass(icont),ipcls) / &
141 volusum =
sum( pdv(pdvplagvolu(:),ipcls) )
145 heatcapsum =
sum(pcv(pcvplagmass(:),ipcls) * pspcheat(:) )
149 pdv(dv_plag_uvel,ipcls) = pcv(cv_plag_xmom,ipcls) * masssumr
150 pdv(dv_plag_vvel,ipcls) = pcv(cv_plag_ymom,ipcls) * masssumr
151 pdv(dv_plag_wvel,ipcls) = pcv(cv_plag_zmom,ipcls) * masssumr
153 pdv(dv_plag_dens,ipcls) = masssum/volusum
154 pdv(dv_plag_diam,ipcls) = (6.0_rfreal*pir*volusum)**onethird
155 pdv(dv_plag_area,ipcls) = (9.0_rfreal*
pi *volusum/16.0_rfreal)**onethird
157 pdv(dv_plag_spht,ipcls) = heatcapsum * masssumr
158 pdv(dv_plag_temp,ipcls) = ( pcv(cv_plag_ener,ipcls)*masssumr &
159 - 0.5_rfreal*(pdv(dv_plag_uvel,ipcls)**2 &
160 +pdv(dv_plag_vvel,ipcls)**2 &
161 +pdv(dv_plag_wvel,ipcls)**2 ) )/ &
162 pdv(dv_plag_spht,ipcls)
164 pdv(dv_plag_volu,ipcls) = volusum
Tfloat sum() const
Return the sum of all the pixel values in an image.
subroutine registerfunction(global, funName, fileName)
subroutine plag_calcderivedvariables(region)
subroutine deregisterfunction(global)