30 integer,
intent(in) :: lensfc, rank
31 integer,
intent(in) :: landmask(lensfc)
32 real,
intent(in) :: swe(lensfc), snd(lensfc)
33 real,
intent(out) :: density(lensfc)
40 if (snd(n) > 0.001 )
then
41 density(n) = swe(n)/snd(n)
47 where (density < 0.0001) density = 0.1
50 if (count(landmask==2) > 0)
then
52 dens_mean = sum(density, mask = (landmask==2 )) &
54 print *,
'mean density on rank ', rank,
': ', dens_mean
57 print *,
'no snow on rank ', rank,
' using default density ', dens_mean
61 where( swe <= 0.001 ) density = dens_mean
subroutine, public calc_density(lensfc, landmask, swe, snd, rank, density)
This subroutine calculates snow density from forecast fields.