50 INTEGER,
PARAMETER :: KBB=601
51 INTEGER,
PARAMETER :: KBBM1=kbb-1
54 REAL(SP),
DIMENSION(KBB) :: PHY_Z
55 REAL(SP),
DIMENSION(KBB) :: RHOZ
57 REAL(SP),
DIMENSION(KBB) :: RHOA
59 REAL(SP),
DIMENSION(KBM1) :: ZM
60 REAL(SP),
DIMENSION(KBM1) :: RHOS
62 REAL(SP),
DIMENSION(KBB) :: FCOUNT
64 INTEGER :: I,K,status,IERR,IB
65 REAL(SP) :: Z_TOP, Z_BOTTOM,SBUF
69 REAL(SP),
DIMENSION(KBB,NPROCS) :: RHOA_RCV, FCOUNT_RCV
76 IF(
dbg_set(
dbg_log))
WRITE(ipt,*)
"! Recalculating mean density in pressure coordinates" 80 IF(wetting_drying_on)
THEN 83 z_top = maxval(
el(1:m))
85 z_bottom = hmax+spacing(hmax)
91 deltz=(z_bottom + z_top)/float(kbbm1)
94 phy_z(k)= z_top - float(k-1)*deltz
100 phy_z(1)=nearest(z_top,-1.0_sp)
102 phy_z(kbb)=nearest(-z_bottom,1.0_sp)
114 zm(1:kbm1)=
zz(i,1:kbm1)*
d(i)+
el(i)
115 rhos =
rho1(i,1:kbm1)
120 IF(-
h(i).LE.phy_z(k) .AND.
el(i) .GE. phy_z(k))
THEN 121 fcount(k) = fcount(k) + 1.0_sp
122 rhoa(k)=rhoa(k)+rhoz(k)
130 IF(minval(fcount) .LT. 1.0_sp)
THEN 131 IF(
dbg_set(
dbg_log))
WRITE(ipt,*)
"FOUND NO DATA AT DEPTH:",phy_z(minloc(fcount,1))
132 CALL fatal_error(
"RHO_PMEAN: In Serial case, found fcount LT 0.0!")
145 IF(wetting_drying_on.and.
iswetn(i)==0)cycle
147 zm(k)=
zz(i,k)*
d(i)+
el(i)
real(sp), dimension(:), allocatable, target d
real(sp), dimension(:), allocatable, target h
real(sp), dimension(:), allocatable, target el
logical function dbg_set(vrb)
real(sp), dimension(:,:), allocatable, target rho1
subroutine sinter_extrp_none(X, A, Y, B, M1, N1)
subroutine fatal_error(ER1, ER2, ER3, ER4)
subroutine n2e3d(NVAR, EVAR)
integer, parameter dbg_sbr
real(sp), dimension(:,:), allocatable, target zz
real(sp), dimension(:,:), allocatable, target rmean
real(sp), dimension(:,:), allocatable, target rmean1
integer, parameter dbg_log
integer, dimension(:), allocatable iswetn