~fluidity-core/fluidity/sea-ice-branch

« back to all changes in this revision

Viewing changes to assemble/Zoltan_callbacks.F90

  • Committer: Simon Mouradian
  • Date: 2012-10-19 10:35:59 UTC
  • mfrom: (3520.32.371 fluidity)
  • Revision ID: simon.mouradian06@imperial.ac.uk-20121019103559-y36qa47phc69q8sc
mergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
    ierr = ZOLTAN_OK
65
65
  end function zoltan_cb_owned_node_count
66
66
 
67
 
 
68
67
  subroutine zoltan_cb_get_owned_nodes(data, num_gid_entries, num_lid_entries, global_ids, local_ids, wgt_dim, obj_wgts, ierr)
69
68
    integer(zoltan_int), dimension(*), intent(in) :: data ! not used
70
69
    integer(zoltan_int), intent(in) :: num_gid_entries, num_lid_entries 
75
74
    integer(zoltan_int), intent(out) :: ierr
76
75
    
77
76
    integer :: count, i
78
 
    real(zoltan_float) :: max_obj_wgt
 
77
    real(zoltan_float) :: max_obj_wgt, min_obj_wgt
79
78
    
80
79
    ewrite(1,*) "In zoltan_cb_get_owned_nodes"
81
80
    
96
95
    if(zoltan_global_migrate_extruded_mesh) then
97
96
       ! weight the nodes according to the number of nodes in the column beneath it
98
97
       max_obj_wgt = 1.0
99
 
       do i=1,count
 
98
       do i = 1, count
100
99
          obj_wgts(i) = float(row_length(zoltan_global_columns_sparsity, i))
101
100
          max_obj_wgt = max(max_obj_wgt, obj_wgts(i))
102
101
       end do
103
102
       ! normalise according to the most nodes in a column
104
 
       do i=1,count
 
103
       do i = 1, count
105
104
          obj_wgts(i) = obj_wgts(i)/max_obj_wgt
106
105
       end do
107
106
    else
108
 
       do i=1,count
 
107
       do i = 1, count
109
108
          obj_wgts(i) = 1.0
110
109
       end do
111
110
    end if
 
111
 
 
112
    if(zoltan_global_field_weighted_partitions) then
 
113
       max_obj_wgt = 1.0
 
114
       min_obj_wgt = 0.0
 
115
       do i = 1, count
 
116
          obj_wgts(i) = node_val(zoltan_global_field_weighted_partition_values,i)
 
117
          max_obj_wgt = max(max_obj_wgt, obj_wgts(i))
 
118
          min_obj_wgt = min(min_obj_wgt, obj_wgts(i))
 
119
       end do
 
120
 
 
121
       if((max_obj_wgt > 1.0) .OR. (min_obj_wgt < 0.0)) then
 
122
        FLExit("0.0 <= FieldWeightedPartitionValues <= 1.0: condition not satisfied")
 
123
       end if
 
124
 
 
125
    end if
112
126
    
113
127
    ierr = ZOLTAN_OK
114
128
  end subroutine zoltan_cb_get_owned_nodes
115
129
 
116
 
 
117
130
  subroutine zoltan_cb_get_num_edges(data, num_gid_entries, num_lid_entries, num_obj, global_ids, local_ids, num_edges, ierr)  
118
131
    integer(zoltan_int), dimension(*), intent(in) :: data 
119
132
    integer(zoltan_int), intent(in) :: num_gid_entries, num_lid_entries, num_obj
150
163
    ierr = ZOLTAN_OK
151
164
  end subroutine zoltan_cb_get_num_edges
152
165
 
153
 
 
154
166
  subroutine zoltan_cb_get_edge_list(data, num_gid_entries, num_lid_entries, num_obj, global_ids, local_ids, &
155
167
       &  num_edges, nbor_global_id, nbor_procs, wgt_dim, ewgts, ierr)
156
168
    integer(zoltan_int), intent(in) :: data