~fluidity-core/fluidity/sea-ice-coupling

« back to all changes in this revision

Viewing changes to assemble/Diagnostic_Fields_Matrices.F90

  • Committer: Simon Mouradian
  • Date: 2012-05-30 09:08:23 UTC
  • mfrom: (3520.32.274 fluidity)
  • Revision ID: simon.mouradian06@imperial.ac.uk-20120530090823-pq0fgemjpqn72j8d
mergeĀ fromĀ lp:fluidity

Show diffs side-by-side

added added

removed removed

Lines of Context:
184
184
      type(vector_field), pointer :: field, x
185
185
 
186
186
      type(csr_sparsity) :: divergence_sparsity
187
 
      type(block_csr_matrix) :: CT_m
 
187
      type(block_csr_matrix), pointer :: CT_m
188
188
 
189
189
      character(len=FIELD_NAME_LEN) :: field_name
190
190
 
200
200
      call allocate(ctfield, div%mesh, name="CTField")
201
201
 
202
202
      divergence_sparsity=make_sparsity(div%mesh, field%mesh, "DivergenceSparsity")
 
203
      allocate(CT_m)
203
204
      call allocate(CT_m, divergence_sparsity, (/1, field%dim/), name="DivergenceMatrix" )
204
205
      call allocate(ct_rhs, div%mesh, name="CTRHS")
205
206
 
219
220
      call petsc_solve(div, mass, ctfield)
220
221
 
221
222
      call deallocate(CT_m)
 
223
      deallocate(CT_m)
222
224
      call deallocate(ct_rhs)
223
225
      call deallocate(ctfield)
224
226
      call deallocate(divergence_sparsity)
235
237
      type(scalar_field), pointer :: field
236
238
 
237
239
      type(csr_sparsity) :: divergence_sparsity
238
 
      type(block_csr_matrix) :: CT_m
 
240
      type(block_csr_matrix), pointer :: CT_m
239
241
 
240
242
      character(len=FIELD_NAME_LEN) :: field_name
241
243
 
252
254
 
253
255
      ! Sparsity of C^T - the transpose of the gradient operator.
254
256
      divergence_sparsity=make_sparsity(field%mesh, grad%mesh, "DivergenceSparsity")
 
257
      allocate(CT_m)
255
258
      call allocate(CT_m, divergence_sparsity, (/1, grad%dim/), name="DivergenceMatrix" )
256
259
 
257
260
      mass_sparsity=make_sparsity(grad%mesh, grad%mesh, "MassSparsity")
269
272
 
270
273
      call deallocate(divergence_sparsity)
271
274
      call deallocate(CT_m)
 
275
      deallocate(CT_m)
272
276
      call deallocate(mass_sparsity)
273
277
      call deallocate(mass)
274
278
      call deallocate(cfield)
336
340
      integer :: i, stat
337
341
 
338
342
      type(csr_sparsity) :: divergence_sparsity
339
 
      type(block_csr_matrix) :: ct_m
 
343
      type(block_csr_matrix), pointer :: ct_m
340
344
 
341
345
      type(csr_sparsity) :: mass_sparsity
342
346
      type(csr_matrix) :: mass
378
382
 
379
383
         ! Allocate sparsity patterns, C^T matrix and C^T RHS for current state
380
384
         divergence_sparsity=make_sparsity(sum_velocity_divergence%mesh, u%mesh, "DivergenceSparsity")
 
385
         allocate(ct_m)
381
386
         call allocate(ct_m, divergence_sparsity, (/1, u%dim/), name="DivergenceMatrix" )
382
387
         call allocate(ct_rhs, sum_velocity_divergence%mesh, name="CTRHS")
383
388
         
406
411
         call addto(ctfield, temp)
407
412
 
408
413
         call deallocate(ct_m)
 
414
         deallocate(ct_m)
409
415
         call deallocate(ct_rhs)
410
416
         call deallocate(divergence_sparsity)
411
417