~fluidity-core/fluidity/shallow-water-dev

« back to all changes in this revision

Viewing changes to femtools/Mixing_Statistics.F90

  • Committer: colin.cotter at ac
  • Date: 2012-02-13 14:24:01 UTC
  • mfrom: (3565.1.362 fluidity)
  • Revision ID: colin.cotter@imperial.ac.uk-20120213142401-fz23s9jmvc8jjiy6
MergedĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
    real :: tolerance, total_volume, current_time
99
99
    real, dimension(:), pointer :: mixing_bin_bounds
100
100
    character(len = OPTION_PATH_LEN) :: func
101
 
    type(scalar_field) :: lumped_mass
 
101
    type(scalar_field) :: cv_mass
102
102
    integer, dimension(2) :: shape_option
103
103
 
104
104
    call get_option(trim(complete_field_path(sfield%option_path)) &
125
125
        FLAbort("Unable to determine mixing bin bounds type")  
126
126
    end if   
127
127
 
128
 
    call allocate(lumped_mass, sfield%mesh, name="MixingLumpedMass")
129
 
    call zero(lumped_mass)
130
 
    call compute_lumped_mass(Xfield, lumped_mass)
 
128
    call allocate(cv_mass, sfield%mesh, name="MixingCVMass")
 
129
    call zero(cv_mass)
 
130
    call compute_cv_mass(Xfield, cv_mass)
131
131
 
132
132
    f_mix_fraction = 0.0
133
133
    total_volume = 0.0
135
135
       if(node_owned(sfield, j)) then
136
136
          do i=1,size(f_mix_fraction)
137
137
             if(node_val(sfield, j) >= (mixing_bin_bounds(i)-tolerance)) then
138
 
                f_mix_fraction(i) = f_mix_fraction(i) + node_val(lumped_mass, j)
 
138
                f_mix_fraction(i) = f_mix_fraction(i) + node_val(cv_mass, j)
139
139
             end if
140
140
          end do
141
 
          total_volume = total_volume + node_val(lumped_mass, j)
 
141
          total_volume = total_volume + node_val(cv_mass, j)
142
142
       end if
143
143
    end do
144
144
 
165
165
       call allsum(f_mix_fraction(i))
166
166
    end do
167
167
 
168
 
    call deallocate(lumped_mass)
 
168
    call deallocate(cv_mass)
169
169
    deallocate(mixing_bin_bounds)
170
170
 
171
171
  end subroutine control_volume_mixing