@@ -36,7 +36,7 @@ module m_data_output
3636
3737 implicit none
3838
39- private;
39+ private;
4040 public :: s_initialize_data_output_module, &
4141 s_open_run_time_information_file, &
4242 s_open_com_files, &
@@ -157,24 +157,20 @@ contains
157157 write (3 , ' (A)' ) ' ' ; write (3 , ' (A)' ) ' '
158158
159159 ! Generating table header for the stability criteria to be outputted
160- if (cfl_dt) then
161- if (viscous) then
162- write (3 , ' (A)' ) ' Time-steps dt = Time ICFL ' // &
163- ' Max VCFL Max Rc Min ='
164- else
165- write (3 , ' (A)' ) ' Time-steps dt Time ' // &
166- ' ICFL Max '
167- end if
168- else
169- if (viscous) then
170- write (3 , ' (A)' ) ' Time-steps Time ICFL ' // &
171- ' Max VCFL Max Rc Min '
172- else
173- write (3 , ' (A)' ) ' Time-steps Time ' // &
174- ' ICFL Max '
175- end if
160+ write (3 , ' (13X,A8,13X,A10,13X,A10,13X,A10,)' , advance= " no" ) &
161+ trim (' Time-steps' ), trim (' dt' ), trim (' Time' ), trim (' ICFL Max' )
162+
163+ if (viscous) then
164+ write (3 , ' (13X,A10,13X,A16)' , advance= " no" ) &
165+ trim (' VCFL Max' ), trim (' Rc Min' )
176166 end if
177167
168+ if (surface_tension) then
169+ write (3 , ' (13X,A10)' , advance= " no" ) trim (' CCFL Max' )
170+ end if
171+
172+ write (3 , * ) ! new line
173+
178174 end subroutine s_open_run_time_information_file
179175
180176 !> This opens a formatted data file where the root processor
@@ -295,8 +291,12 @@ contains
295291
296292 call s_compute_speed_of_sound(pres, rho, gamma, pi_inf, H, alpha, vel_sum, 0._wp , c)
297293
298- if (viscous) then
299- call s_compute_stability_from_dt(vel, c, rho, Re, j, k, l, icfl_sf, vcfl_sf, Rc_sf)
294+ if (viscous .and. surface_tension) then
295+ call s_compute_stability_from_dt(vel, c, rho, Re, j, k, l, icfl_sf, vcfl_sf= vcfl_sf, Rc_sf= Rc_sf, ccfl_sf= ccfl_sf)
296+ elseif (viscous) then
297+ call s_compute_stability_from_dt(vel, c, rho, Re, j, k, l, icfl_sf, vcfl_sf= vcfl_sf, Rc_sf= Rc_sf)
298+ elseif (surface_tension) then
299+ call s_compute_stability_from_dt(vel, c, rho, Re, j, k, l, icfl_sf, ccfl_sf= ccfl_sf)
300300 else
301301 call s_compute_stability_from_dt(vel, c, rho, Re, j, k, l, icfl_sf)
302302 end if
@@ -311,17 +311,18 @@ contains
311311
312312#ifdef _CRAYFTN
313313 $:GPU_UPDATE(host= ' [icfl_sf]' )
314-
315- if (viscous) then
316- $:GPU_UPDATE(host= ' [vcfl_sf,Rc_sf]' )
317- end if
318-
319314 icfl_max_loc = maxval (icfl_sf)
320315
321316 if (viscous) then
317+ $:GPU_UPDATE(host= ' [vcfl_sf,Rc_sf]' )
322318 vcfl_max_loc = maxval (vcfl_sf)
323319 Rc_min_loc = minval (Rc_sf)
324320 end if
321+
322+ if (surface_tension) then
323+ $:GPU_UPDATE(host= ' [ccfl_sf]' )
324+ ccfl_max_loc = maxval (ccfl_sf)
325+ end if
325326#else
326327 #:call GPU_PARALLEL(copyout= ' [icfl_max_loc]' , copyin= ' [icfl_sf]' )
327328 icfl_max_loc = maxval (icfl_sf)
@@ -332,20 +333,29 @@ contains
332333 Rc_min_loc = minval (Rc_sf)
333334 #:endcall GPU_PARALLEL
334335 end if
336+
337+ if (surface_tension) then
338+ #:call GPU_PARALLEL(copyout= ' [ccfl_max_loc]' , copyin= ' [ccfl_sf]' )
339+ ccfl_max_loc = maxval (ccfl_sf)
340+ #:endcall GPU_PARALLEL
341+ end if
335342#endif
336343
337344 ! Determining global stability criteria extrema at current time- step
338345 if (num_procs > 1 ) then
339346 call s_mpi_reduce_stability_criteria_extrema(icfl_max_loc, &
340347 vcfl_max_loc, &
341348 Rc_min_loc, &
349+ ccfl_max_loc, &
342350 icfl_max_glb, &
343351 vcfl_max_glb, &
344- Rc_min_glb)
352+ Rc_min_glb, &
353+ ccfl_max_glb)
345354 else
346355 icfl_max_glb = icfl_max_loc
347356 if (viscous) vcfl_max_glb = vcfl_max_loc
348357 if (viscous) Rc_min_glb = Rc_min_loc
358+ if (surface_tension) ccfl_max_glb = ccfl_max_loc
349359 end if
350360
351361 ! Determining the stability criteria extrema over all the time- steps
@@ -356,18 +366,28 @@ contains
356366 if (Rc_min_glb < Rc_min) Rc_min = Rc_min_glb
357367 end if
358368
369+ if (surface_tension) then
370+ if (ccfl_max_glb > ccfl_max) ccfl_max = ccfl_max_glb
371+ end if
372+
359373 ! Outputting global stability criteria extrema at current time- step
360374 if (proc_rank == 0 ) then
375+ write (3 , ' (13X,I8,13X,F10.6,13X,F10.6,13X,F10.6)' , advance= " no" ) &
376+ t_step, dt, t_step* dt, icfl_max_glb
377+
361378 if (viscous) then
362- write (3 , ' (6X,I8,F10.6,6X,6X,F10.6,6X,F9.6,6X,F9.6,6X,F10.6)' ) &
363- t_step, dt, t_step* dt, icfl_max_glb, &
379+ write (3 , ' (13X,F10.6,13X,ES16.6)' , advance= " no" ) &
364380 vcfl_max_glb, &
365381 Rc_min_glb
366- else
367- write (3 , ' (13X,I8,14X,F10.6,14X,F10.6,13X,F9.6)' ) &
368- t_step, dt, t_step* dt, icfl_max_glb
369382 end if
370383
384+ if (surface_tension) then
385+ write (3 , ' (13X,F10.6)' , advance= " no" ) &
386+ ccfl_max_glb
387+ end if
388+
389+ write (3 , * ) ! new line
390+
371391 if (.not. f_approx_equal(icfl_max_glb, icfl_max_glb)) then
372392 call s_mpi_abort(' ICFL is NaN. Exiting.' )
373393 elseif (icfl_max_glb > 1._wp ) then
@@ -383,6 +403,15 @@ contains
383403 call s_mpi_abort(' VCFL is greater than 1.0. Exiting.' )
384404 end if
385405 end if
406+
407+ if (surface_tension) then
408+ if (.not. f_approx_equal(ccfl_max_glb, ccfl_max_glb)) then
409+ call s_mpi_abort(' CCFL is NaN. Exiting.' )
410+ elseif (ccfl_max_glb > 1._wp ) then
411+ print * , ' ccfl' , ccfl_max_glb
412+ call s_mpi_abort(' CCFL is greater than 1.0. Exiting.' )
413+ end if
414+ end if
386415 end if
387416
388417 call s_mpi_barrier()
@@ -1756,7 +1785,8 @@ contains
17561785
17571786 write (3 , ' (A,F9.6)' ) ' ICFL Max: ' , icfl_max
17581787 if (viscous) write (3 , ' (A,F9.6)' ) ' VCFL Max: ' , vcfl_max
1759- if (viscous) write (3 , ' (A,F10.6)' ) ' Rc Min: ' , Rc_min
1788+ if (viscous) write (3 , ' (A,ES16.6)' ) ' Rc Min: ' , Rc_min
1789+ if (surface_tension) write (3 , ' (A,F10.6)' ) ' CCFL Max: ' , ccfl_max
17601790
17611791 call cpu_time(run_time)
17621792
@@ -1805,7 +1835,12 @@ contains
18051835 @:ALLOCATE(Rc_sf (0 :m, 0 :n, 0 :p))
18061836
18071837 vcfl_max = 0._wp
1808- Rc_min = 1.e3_wp
1838+ Rc_min = 1.e12_wp
1839+ end if
1840+
1841+ if (surface_tension) then
1842+ @:ALLOCATE(ccfl_sf(0 :m, 0 :n, 0 :p))
1843+ ccfl_max = 0._wp
18091844 end if
18101845 end if
18111846
@@ -1841,6 +1876,9 @@ contains
18411876 if (viscous) then
18421877 @:DEALLOCATE(vcfl_sf, Rc_sf)
18431878 end if
1879+ if (surface_tension) then
1880+ @:DEALLOCATE(ccfl_sf)
1881+ end if
18441882 end if
18451883
18461884 if (down_sample) then
0 commit comments