From a2819cd281bd3ea496ca420d1f75a23bf1741883 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Fri, 19 Jul 2024 07:19:47 -0600 Subject: [PATCH 01/24] (cleanup) Remove swirl_ray.c from restart demo --- .../demo/2d/swirl_restart/CMakeLists.txt | 1 - .../demo/2d/swirl_restart/swirl_ray.c | 372 ------------------ .../demo/2d/swirl_restart/swirl_user.cpp | 2 - 3 files changed, 375 deletions(-) delete mode 100644 applications/demo/2d/swirl_restart/swirl_ray.c diff --git a/applications/demo/2d/swirl_restart/CMakeLists.txt b/applications/demo/2d/swirl_restart/CMakeLists.txt index 6a146c066..fa17dc10d 100644 --- a/applications/demo/2d/swirl_restart/CMakeLists.txt +++ b/applications/demo/2d/swirl_restart/CMakeLists.txt @@ -19,7 +19,6 @@ add_executable(swirl_restart swirl_user.cpp swirl.cpp swirl_options.c - swirl_ray.c $ ) diff --git a/applications/demo/2d/swirl_restart/swirl_ray.c b/applications/demo/2d/swirl_restart/swirl_ray.c deleted file mode 100644 index 872b698cf..000000000 --- a/applications/demo/2d/swirl_restart/swirl_ray.c +++ /dev/null @@ -1,372 +0,0 @@ -/* - Copyright (c) 2012-2022 Carsten Burstedde, Donna Calhoun, Scott Aiton - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "swirl_user.h" - -#include "../all/advection_user.h" - -#include -#include - - -typedef struct point -{ - double x; - double y; -} point_t; - - -typedef enum -{ - SWIRL_RAY_LINE, - SWIRL_RAY_CIRCLE, - SWIRL_RAY_TYPE_LAST -} swirl_ray_type_t; - -typedef struct swirl_ray -{ - swirl_ray_type_t rtype; - double xy[2]; - union - { - struct - { - double vec[2]; - } line; - struct - { - double radius; - } circle; - } r; -} swirl_ray_t; - - -static -int point_in_quad(point_t p0, point_t pll, point_t pur) -{ - int intx = (pll.x <= p0.x) && (p0.x < pur.x); - int inty = (pll.y <= p0.y) && (p0.y < pur.y); - - int found = (intx != 0) && (inty != 0); - return found; -} - -static -double distance(point_t p0, point_t p1) -{ - double dx = p0.x - p1.x; - double dy = p0.y - p1.y; - double d = sqrt(dx*dx + dy*dy); - return d; -} - -static -int segment_intersect(point_t p0, point_t p1, - point_t q0, point_t q1, - point_t *r) -{ - /* Find the intersection of two line segments p(s), q(t) - with endpoints (p0,p1) and (q0,q1) (in R^2) - - Idea : - - * Parameterize line segments as - - p(s) = p0 + (p1-p0)*s, s \in [0,1] - q(t) = q0 + (q1-q0)*t, t \in [0,1] - - * Set p(s)=q(t) to get 2x2 linear system A*x=b in unknowns x=(s,t) - * Solve linear system. Note : Explicit inverse of A is used. - * Check : Segments will intersect if both s,t in [0,1] - */ - /* Coefficients of A */ - double a11 = p1.x - p0.x; - double a21 = p1.y - p0.y; - double a12 = -(q1.x - q0.x); - double a22 = -(q1.y - q0.y); - - /* Right hand side b */ - point_t b = {q0.x - p0.x, q0.y - p0.y}; - - /* Compute determinant of A */ - double det = a22*a11 - a12*a21; - int found_intersection = 0; - if (det == 0) - { - /* Segments are co-linear or parallel */ - found_intersection = 0; - return 0; - } - - /* Solve linear system A*x = b : Use explicit inverse of - 2x2 matrix. */ - double s = (a22*b.x - a12*b.y)/det; - double t = (-a21*b.x + a11*b.y)/det; - - /* Check to see if segments intersect */ - if ((0 <= s && s < 1) && (0 <= t && t < 1)) - found_intersection = 1; - - /* Compute intersection of lines (even if segments don't intersect) */ - r->x = q0.x + (q1.x - q0.x)*t; - r->y = q0.y + (q1.y - q0.y)*t; - - return found_intersection; -} - - -int swirl_intersect_ray (fclaw_domain_t *domain, - fclaw_patch_t * patch, - int blockno, - int patchno, - void *ray, - double *integral, - void* user) -{ - - fclaw_global_t *glob = (fclaw_global_t*) user; - - /* assert that ray is a valid swirl_ray_t */ - fclaw_ray_t *fclaw_ray = (fclaw_ray_t *) ray; - - int id; - swirl_ray_t *swirl_ray = (swirl_ray_t*) fclaw_ray_get_ray(fclaw_ray,&id); - FCLAW_ASSERT(swirl_ray != NULL); - FCLAW_ASSERT(swirl_ray->rtype == SWIRL_RAY_LINE); /* Circles not there yet. */ - - if (patchno >= 0) - { - /* We are at a leaf and the patch is a valid patch of the domain. - * Based on the patch, the domain, the blockno and the information stored - * in the swirl_ray_t we defined, we now have to set *integral to be the - * contribution of this ray-patch combination to the ray integral. - * We should return 1 (even though a leaf return value is ignored). */ - - /* This is a dummy example. We add the ray's x component for each patch. - Truly, this example must be updated to compute the exact ray integral. */ - // *integral = swirl_ray->r.line.vec[0]; - - /* DAC : Updated to consider intersection of ray with quadrant. Contribution to the - integral is the length of the ray segment that in the quad. - - Next step : consider parameterized curve. */ - - /* Get data on current patch */ - int mx,my,mbc; - double xlower,ylower,dx,dy; - fclaw_clawpatch_2d_grid_data(glob,patch,&mx,&my,&mbc, - &xlower,&ylower,&dx,&dy); - - if (swirl_ray->rtype == SWIRL_RAY_LINE) - { - /* Check to see if line segment intersections one of four edges. */ - point_t p0 = {swirl_ray->xy[0], swirl_ray->xy[1]}; - point_t p1 = {p0.x + swirl_ray->r.line.vec[0], - p0.y + swirl_ray->r.line.vec[1]}; - - double xupper = xlower + dx*mx; - double yupper = ylower + dy*my; - double qx[5] = {xlower, xupper, xupper, xlower, xlower}; - double qy[5] = {ylower, ylower, yupper, yupper, ylower}; - - point_t r; - int istart = -1, iend = -1; - point_t r0, r1; - /* Check intersection of ray with each edge of quadrant */ - for(int i = 0; i < 4; i++) - { - point_t q0 = {qx[i],qy[i]}; - point_t q1 = {qx[i+1],qy[i+1]}; - - int found = segment_intersect(p0,p1,q0,q1,&r); - if (found != 0) - { - if (istart < 0) - { - istart = i; - r0 = r; - } - else - { - iend = i; - r1 = r; - break; - } - } - } - /* Four cases */ - int found_intersection = 0; - point_t pstart, pend; - if (istart < 0 && iend < 0) - { - /* No intersection found */ - //fclaw_global_essentialf("No intersection found\n"); - *integral = 0; - } - else if (istart >= 0 && iend >= 0) - { - /* Ray enters and exits quad */ - //fclaw_global_essentialf("Ray enters and exits quad\n"); - pstart = r0; - pend = r1; - found_intersection = 1; - } - else - { - /* Ray starts or ends in quad */ - point_t pll = {xlower,ylower}; - point_t pur = {xupper, yupper}; - if (point_in_quad(p0,pll,pur) != 0) - { - pstart = p0; - pend = r0; - } - else if (point_in_quad(p1,pll,pur) != 0) - { - //fclaw_global_essentialf("Ray starts outside quad and enters\n"); - pstart = r0; - pend = p1; - } - found_intersection = 1; - } - if (found_intersection != 0) - { - /* This could be replaced by an integral along a curve in the patch */ - *integral = distance(pstart,pend); - - if (0) - { - printf("%5d %f\n",patchno,*integral); - printf("pstart : %f %f\n",pstart.x,pstart.y); - printf("pend : %f %f\n",pend.x,pend.y); - printf("\n"); - } - } - } /* end of ray type line */ - return 1; - } - else - { - /* We are not at a leaf and the patch is an artificial patch containing all - * standard patch information except for the pointer to the next patch and - * user-data of any kind. Only the FCLAW2D_PATCH_CHILDID and the - * FCLAW2D_PATCH_ON_BLOCK_FACE_* flags are set. - * Based on this, we now can run a test to check if the ray and the patch - * intersect. - * We return 0 if we are certain that the ray does not intersect any - * descendant of this patch. - * We return 1 if the test concludes that the ray may intersect the patch. - * This test may be overinclusive / false positive to optimize for speed. - * - * The purpose of this test is to remove irrelevant ancestor - * patch-ray-combinations early on to avoid unnecessary computations. - * We do not need to assign to the integral value for ancestor patches. */ - - /* This is a dummy example. Truly, implement a fast and over-inclusive test - * to see if this ray may possibly intersect the patch and return the answer. */ - return 1; - } -} - - -static int nlines = 3; - - -/* Virtual function for setting rays */ -static -void swirl_allocate_and_define_rays(fclaw_global_t *glob, - fclaw_ray_t** rays, - int* num_rays) -{ - *num_rays = nlines; - - /* We let the user allocate an array of rays, although what is inside the - generic ray type is left opaque. This is destroy in matching FREE, - below. */ - - //*rays = (fclaw2d_ray_t*) FCLAW_ALLOC(fclaw2d_ray_t,*num_rays); - *rays = fclaw_ray_allocate_rays(*num_rays); - fclaw_ray_t *ray_vec = *rays; - for (int i = 0; i < nlines; ++i) - { - //fclaw_global_essentialf("ray_initialize : Setting up ray %d : \n",i); - swirl_ray_t *sr = (swirl_ray_t*) FCLAW_ALLOC(swirl_ray_t,1); - sr->rtype = SWIRL_RAY_LINE; - -#if 0 - sr->xy[0] = 0.; - sr->xy[1] = 0.; - sr->r.line.vec[0] = cos (i * M_PI / (nlines-1)); - sr->r.line.vec[1] = sin (i * M_PI / (nlines-1)); -#else - /* End points are on a semi-circle in x>0,y>0 quad */ - FCLAW_ASSERT(nlines >= 2); - sr->xy[0] = 0; //-0.1; - sr->xy[1] = 0; //-0.1; - double R = 2.0; - double dth = M_PI/(2*nlines); - sr->r.line.vec[0] = R*cos ((i+0.5) * dth); - sr->r.line.vec[1] = R*sin ((i+0.5) * dth); -#endif - - fclaw_ray_t *ray = &ray_vec[i]; - int id = i + 1; - fclaw_ray_set_ray(ray,id, sr); - } -} - - -static -void swirl_deallocate_rays(fclaw_global_t *glob, - fclaw_ray_t** rays, - int* num_rays) -{ - fclaw_ray_t *ray_vec = *rays; - for(int i = 0; i < *num_rays; i++) - { - /* Retrieve rays set above and deallocate them */ - int id; - fclaw_ray_t *ray = &ray_vec[i]; - swirl_ray_t *rs = (swirl_ray_t*) fclaw_ray_get_ray(ray,&id); - FCLAW_ASSERT(rs != NULL); - FCLAW_FREE(rs); - rs = NULL; - } - /* Match FCLAW_ALLOC, above */ - *num_rays = fclaw_ray_deallocate_rays(rays); -} - -void swirl_initialize_rays(fclaw_global_t* glob) -{ - /* Set up rays */ - fclaw_ray_vtable_t* rays_vt = fclaw_ray_vt(glob); - - rays_vt->allocate_and_define = swirl_allocate_and_define_rays; - rays_vt->deallocate = swirl_deallocate_rays; - - rays_vt->integrate = swirl_intersect_ray; -} - - diff --git a/applications/demo/2d/swirl_restart/swirl_user.cpp b/applications/demo/2d/swirl_restart/swirl_user.cpp index e0379f623..527f4fe0f 100644 --- a/applications/demo/2d/swirl_restart/swirl_user.cpp +++ b/applications/demo/2d/swirl_restart/swirl_user.cpp @@ -48,8 +48,6 @@ void swirl_link_solvers(fclaw_global_t *glob) fclaw_vtable_t *vt = fclaw_vt(glob); vt->problem_setup = &swirl_problem_setup; /* Version-independent */ - swirl_initialize_rays(glob); - const user_options_t* user = swirl_get_options(glob); if (user->claw_version == 4) { From 7af2469d53f89de63e65188545249ea5ddf96fa6 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Fri, 19 Jul 2024 08:47:27 -0600 Subject: [PATCH 02/24] (cleanup) Remove unused variables --- src/solvers/fc2d_clawpack5/fortran_source/clawpack5_flux2.f | 4 ++-- src/solvers/fc2d_clawpack5/fortran_source/clawpack5_step2.f90 | 2 +- .../fc2d_clawpack5/fortran_source/clawpack5_step2_wrap.f | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/solvers/fc2d_clawpack5/fortran_source/clawpack5_flux2.f b/src/solvers/fc2d_clawpack5/fortran_source/clawpack5_flux2.f index 977591d12..6074ea1fc 100644 --- a/src/solvers/fc2d_clawpack5/fortran_source/clawpack5_flux2.f +++ b/src/solvers/fc2d_clawpack5/fortran_source/clawpack5_flux2.f @@ -54,8 +54,8 @@ subroutine clawpack5_flux2(ixy,maxm,meqn,maux,mbc,mx, c where A^* represents either A^- or A^+. c c - use clawpack5_amr_module, only : mwaves, mcapa, method, - & mthlim, use_fwaves + use clawpack5_amr_module, only : mwaves, method, mthlim, + & use_fwaves implicit none external rpn2, rpt2 diff --git a/src/solvers/fc2d_clawpack5/fortran_source/clawpack5_step2.f90 b/src/solvers/fc2d_clawpack5/fortran_source/clawpack5_step2.f90 index d3e043f75..f8560ef09 100644 --- a/src/solvers/fc2d_clawpack5/fortran_source/clawpack5_step2.f90 +++ b/src/solvers/fc2d_clawpack5/fortran_source/clawpack5_step2.f90 @@ -14,7 +14,7 @@ SUBROUTINE clawpack5_step2(maxm,meqn,maux,mbc,mx,my,qold,aux,dx,dy,dt, & ! Converted to f90 2012-1-04 (KTM) ! - use clawpack5_amr_module, only : mwaves, mcapa, method,mthlim + use clawpack5_amr_module, only : mwaves, mcapa implicit none diff --git a/src/solvers/fc2d_clawpack5/fortran_source/clawpack5_step2_wrap.f b/src/solvers/fc2d_clawpack5/fortran_source/clawpack5_step2_wrap.f index 3507180b3..fc4ec2d8a 100644 --- a/src/solvers/fc2d_clawpack5/fortran_source/clawpack5_step2_wrap.f +++ b/src/solvers/fc2d_clawpack5/fortran_source/clawpack5_step2_wrap.f @@ -9,7 +9,7 @@ subroutine clawpack5_step2_wrap(maxm, meqn, maux, mbc, external rpn2,rpt2, flux2 integer maxm,meqn,maux,mbc,mcapa,mwaves,mx,my, mwork - integer maxmx, maxmy, level, ierror, use_fwaves + integer maxmx, maxmy, level, ierror integer method(7), mthlim(mwaves) integer block_corner_count(0:3) From fd813463c9768e740328f2d46c5c00c5f8a17dc2 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Sun, 21 Jul 2024 15:52:11 -0700 Subject: [PATCH 03/24] (elliptic/heat) Fix 'uninitialized variable' warnings --- .../elliptic/heat/fortran/heat_qexact.f90 | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/applications/elliptic/heat/fortran/heat_qexact.f90 b/applications/elliptic/heat/fortran/heat_qexact.f90 index 9f5c209e7..da3fcbf3f 100644 --- a/applications/elliptic/heat/fortran/heat_qexact.f90 +++ b/applications/elliptic/heat/fortran/heat_qexact.f90 @@ -70,6 +70,11 @@ SUBROUTINE heat_qexact_complete(x,y,q,qlap,grad,flag) double precision q1, qx1, qy1, qlap1, x0p,y0p integer id + q = 0 + qx = 0 + qy = 0 + qlap = 0 + if (example .eq. 0) then q = x qx = 1 @@ -125,15 +130,14 @@ SUBROUTINE heat_qexact_complete(x,y,q,qlap,grad,flag) endif elseif (example .eq. 4) then q = 0 - qx = 0 - qy = 0 - qlap = 0 do id = 1,m_polar x0p = x0_polar(id) y0p = y0_polar(id) r = sqrt((x-x0p)**2 + (y-y0p)**2) theta = atan2(y-y0p,x-x0p) q1 = 1 - hsmooth(id,r,theta) + qlap1 = 0 + qx1 = 0 if (flag .ge. 1) then !! Assume mapping is T(r,theta) t1(1) = cos(theta) @@ -152,9 +156,13 @@ SUBROUTINE heat_qexact_complete(x,y,q,qlap,grad,flag) endif endif q = q + q1 - qx = qx + qx1 - qy = qy + qy1 - qlap = qlap + qlap1 + if (flag .ge. 1) then + qx = qx + qx1 + qy = qy + qy1 + if (flag .eq. 2) then + qlap = qlap + qlap1 + endif + endif enddo endif if (flag .ge. 1) then @@ -185,6 +193,8 @@ subroutine heat_fort_beta(x,y,b,grad) DOUBLE PRECISION bx, by + bx = 0 + by = 0 if (beta_choice .eq. 0) then b = 1 bx = 0 From 9fee8e8a0227701e3cf5cdaf3e88b84a003c32e4 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Sun, 21 Jul 2024 16:18:04 -0700 Subject: [PATCH 04/24] (heat_phasefield) Fix compiler warnings about unitialized variables --- .../heat_phasefield/heat/fortran/heat_apply_bc.f90 | 10 ++++++++++ .../heat_phasefield/heat/fortran/heat_eval_bc.f90 | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/applications/elliptic/heat_phasefield/heat/fortran/heat_apply_bc.f90 b/applications/elliptic/heat_phasefield/heat/fortran/heat_apply_bc.f90 index e7f3f2b77..21b7d34c8 100644 --- a/applications/elliptic/heat_phasefield/heat/fortran/heat_apply_bc.f90 +++ b/applications/elliptic/heat_phasefield/heat/fortran/heat_apply_bc.f90 @@ -51,6 +51,10 @@ subroutine heat_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & end do end do + + !! Assume Dirichlet BCs to suppress compiler warnings. + a = 1 + b = 0 do iface = 0,3 if (intersects_bc(iface) .ne. 0) then idir = iface/2 !! direction : 0 or 1 @@ -99,6 +103,9 @@ subroutine heat_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & ic = mx !! cell center i1 = mx+1 ig = mx+1 + else + write(6,*) 'heat_apply_bc : ic, i1, ig may not be initialized' + stop endif !! location at interface x = xlower + (i1 - 1)*dx @@ -125,6 +132,9 @@ subroutine heat_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & jc = my j1 = my+1 jg = my+1 + else + write(6,*) 'heat_apply_bc : jc, j1, jg may not be initialized' + stop endif !! location at interface y = ylower + (j1 - 1)*dy diff --git a/applications/elliptic/heat_phasefield/heat/fortran/heat_eval_bc.f90 b/applications/elliptic/heat_phasefield/heat/fortran/heat_eval_bc.f90 index ddbfc6354..64e59fe55 100644 --- a/applications/elliptic/heat_phasefield/heat/fortran/heat_eval_bc.f90 +++ b/applications/elliptic/heat_phasefield/heat/fortran/heat_eval_bc.f90 @@ -18,6 +18,10 @@ double precision function heat_fort_eval_bc(iface,t,x,y) qn = normals(iface,1)*grad(1) + normals(iface,2)*grad(2) !! bc_type is set in options .ini file as [multigrid] boundary_conditions + + !! Assume Dirichlet conditions (to suppress compiler warnings) + a = 1 + b = 0 if (bctype(iface) .eq. 1) then a = 1 b = 0 From 812ea2d1c565393a70e2f27d8b7e2132543e403b Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Sun, 21 Jul 2024 16:29:46 -0700 Subject: [PATCH 05/24] (elliptic/heat) Fix compiler warnings --- .../elliptic/heat_phasefield/heat/fortran/heat_apply_bc.f90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/applications/elliptic/heat_phasefield/heat/fortran/heat_apply_bc.f90 b/applications/elliptic/heat_phasefield/heat/fortran/heat_apply_bc.f90 index 21b7d34c8..dbe822529 100644 --- a/applications/elliptic/heat_phasefield/heat/fortran/heat_apply_bc.f90 +++ b/applications/elliptic/heat_phasefield/heat/fortran/heat_apply_bc.f90 @@ -53,8 +53,6 @@ subroutine heat_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & !! Assume Dirichlet BCs to suppress compiler warnings. - a = 1 - b = 0 do iface = 0,3 if (intersects_bc(iface) .ne. 0) then idir = iface/2 !! direction : 0 or 1 @@ -66,6 +64,9 @@ subroutine heat_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & elseif (bctype(iface) .eq. 2) then a = 0 b = 1 + else + write(6,*) 'heat_apply_bc : bctype(iface) is not valid' + stop endif if (idir == 0) then From 1976d17d55e380fe51be4a3a12ff31c5a30b0ff7 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Sun, 21 Jul 2024 16:40:12 -0700 Subject: [PATCH 06/24] (elliptic/heat_phasefield) Fix compiler warnings --- .../phasefield/fortran/phasefield_apply_bc.f90 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/applications/elliptic/heat_phasefield/phasefield/fortran/phasefield_apply_bc.f90 b/applications/elliptic/heat_phasefield/phasefield/fortran/phasefield_apply_bc.f90 index 5bfebd9c5..4df057335 100644 --- a/applications/elliptic/heat_phasefield/phasefield/fortran/phasefield_apply_bc.f90 +++ b/applications/elliptic/heat_phasefield/phasefield/fortran/phasefield_apply_bc.f90 @@ -67,6 +67,9 @@ subroutine phasefield_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & elseif (bctype(iface) .eq. 2) then a = 0 b = 1 + else + write(6,*) 'phasefield_apply_bc : bctype(iface) not valid' + stop endif if (idir == 0) then @@ -104,6 +107,9 @@ subroutine phasefield_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & ic = mx !! cell center i1 = mx+1 ig = mx+1 + else + write(6,*) 'phasefield_appy_bc: ic, i1, ig not initialized' + stop endif !! location at interface x = xlower + (i1 - 1)*dx @@ -130,6 +136,9 @@ subroutine phasefield_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & jc = my j1 = my+1 jg = my+1 + else + write(6,*) 'phasefield_appy_bc: jc, j1, jg not initialized' + stop endif !! location at interface y = ylower + (j1 - 1)*dy From a660c5e37b42650d9fb7aab94114f4e5ea347be7 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Sun, 21 Jul 2024 16:43:30 -0700 Subject: [PATCH 07/24] (elliptic/poisson) fix compiler warnings --- .../elliptic/poisson/fortran/poisson_qexact.f90 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/applications/elliptic/poisson/fortran/poisson_qexact.f90 b/applications/elliptic/poisson/fortran/poisson_qexact.f90 index d6269f202..93fa444f1 100644 --- a/applications/elliptic/poisson/fortran/poisson_qexact.f90 +++ b/applications/elliptic/poisson/fortran/poisson_qexact.f90 @@ -79,6 +79,9 @@ SUBROUTINE poisson_qexact_complete(example,x,y,q,qlap,grad,flag) double precision q1, qx1, qy1, qlap1, x0p,y0p integer id + qlap = 0 + qx = 0 + qy = 0 if (example .eq. 0) then q = x**2 + y**2 qx = 2*x @@ -161,9 +164,13 @@ SUBROUTINE poisson_qexact_complete(example,x,y,q,qlap,grad,flag) endif endif q = q + q1 - qx = qx + qx1 - qy = qy + qy1 - qlap = qlap + qlap1 + if (flag .ge. 1) then + qx = qx + qx1 + qy = qy + qy1 + if (flag .eq. 2) then + qlap = qlap + qlap1 + endif + endif enddo endif if (flag .ge. 1) then @@ -206,6 +213,9 @@ subroutine poisson_fort_beta(x,y,b,grad) b = 1 + x*y bx = y by = x + else + write(6,*) 'poisson_qexact : Invalid beta choice' + stop endif grad(1) = bx From 126ae14ca8db1efb9de77f0fda85d119caf5f1a9 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Sun, 21 Jul 2024 16:50:51 -0700 Subject: [PATCH 08/24] (elliptic/phasefield) Fix compiler warnings --- .../elliptic/phasefield/fortran/phasefield_apply_bc.f90 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/applications/elliptic/phasefield/fortran/phasefield_apply_bc.f90 b/applications/elliptic/phasefield/fortran/phasefield_apply_bc.f90 index 5bfebd9c5..b0039dc2a 100644 --- a/applications/elliptic/phasefield/fortran/phasefield_apply_bc.f90 +++ b/applications/elliptic/phasefield/fortran/phasefield_apply_bc.f90 @@ -67,6 +67,9 @@ subroutine phasefield_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & elseif (bctype(iface) .eq. 2) then a = 0 b = 1 + else + write(6,*) 'phasefield_apply_bc : bctype(iface) is not valid' + stop endif if (idir == 0) then @@ -104,6 +107,9 @@ subroutine phasefield_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & ic = mx !! cell center i1 = mx+1 ig = mx+1 + else + write(6,*) 'phasefield_apply_bc : ic, i1, ig are not initialized' + stop endif !! location at interface x = xlower + (i1 - 1)*dx @@ -130,6 +136,9 @@ subroutine phasefield_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & jc = my j1 = my+1 jg = my+1 + else + write(6,*) 'phasefield_apply_bc : jc, j1, jg are not initialized' + stop endif !! location at interface y = ylower + (j1 - 1)*dy From 2ec624d40adb86df9218893e1ebdd888415c259a Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Sun, 21 Jul 2024 16:58:11 -0700 Subject: [PATCH 09/24] (elliptic/heat_phasefield) Fix compiler warnings --- .../heat_phasefield/heat/fortran/heat_qexact.f90 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/applications/elliptic/heat_phasefield/heat/fortran/heat_qexact.f90 b/applications/elliptic/heat_phasefield/heat/fortran/heat_qexact.f90 index 9f5c209e7..899d11a69 100644 --- a/applications/elliptic/heat_phasefield/heat/fortran/heat_qexact.f90 +++ b/applications/elliptic/heat_phasefield/heat/fortran/heat_qexact.f90 @@ -70,6 +70,9 @@ SUBROUTINE heat_qexact_complete(x,y,q,qlap,grad,flag) double precision q1, qx1, qy1, qlap1, x0p,y0p integer id + qx = 0 + qy = 0 + qlap = 0 if (example .eq. 0) then q = x qx = 1 @@ -152,9 +155,13 @@ SUBROUTINE heat_qexact_complete(x,y,q,qlap,grad,flag) endif endif q = q + q1 - qx = qx + qx1 - qy = qy + qy1 - qlap = qlap + qlap1 + if (flag .eq. 1) then + qx = qx + qx1 + qy = qy + qy1 + if (flag .eq. 2) then + qlap = qlap + qlap1 + endif + endif enddo endif if (flag .ge. 1) then @@ -197,6 +204,9 @@ subroutine heat_fort_beta(x,y,b,grad) b = 1 + x*y bx = y by = x + else + write(6,*) 'heat_fort_beta : beta choice is invalid' + stop endif grad(1) = bx From 06ce290c9393a6f460d9a6334aeba7f1b1168543 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Sun, 21 Jul 2024 17:23:35 -0700 Subject: [PATCH 10/24] (fc2d_thunderegg) Fix compiler warnings --- .../fort_4.6/thunderegg_apply_bc_default.f90 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/solvers/fc2d_thunderegg/fort_4.6/thunderegg_apply_bc_default.f90 b/src/solvers/fc2d_thunderegg/fort_4.6/thunderegg_apply_bc_default.f90 index 18109fab1..0cb72c779 100644 --- a/src/solvers/fc2d_thunderegg/fort_4.6/thunderegg_apply_bc_default.f90 +++ b/src/solvers/fc2d_thunderegg/fort_4.6/thunderegg_apply_bc_default.f90 @@ -32,6 +32,9 @@ subroutine thunderegg_fort_apply_bc_default(blockno, mx, my,mbc,meqn,xlower,ylow elseif (bctype(iface) .eq. 2) then a = 0 b = 1 + else + write(6,*) 'thunderegg_apply_bc_default : bctype(iface) is not valid' + stop endif if (idir == 0) then @@ -53,6 +56,9 @@ subroutine thunderegg_fort_apply_bc_default(blockno, mx, my,mbc,meqn,xlower,ylow elseif (iface .eq. 1) then i1 = mx+1 ig = mx+1 + else + write(6,*) 'thunderegg_fort_apply_bc_default : i1, ig not initialized' + stop endif !! location at interface x = xlower + (i1 - 1)*dx @@ -73,6 +79,9 @@ subroutine thunderegg_fort_apply_bc_default(blockno, mx, my,mbc,meqn,xlower,ylow elseif (iface .eq. 3) then j1 = my+1 jg = my+1 + else + write(6,*) 'thunderegg_fort_apply_bc_default : j1, jg not initialized' + stop endif !! location at interface y = ylower + (j1 - 1)*dy From c109f1aa0a0b7f3acffb9fe3766785c2b2c0b18c Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Sun, 21 Jul 2024 17:33:52 -0700 Subject: [PATCH 11/24] (clawpack/tranport/2d/all) Fix compiler warnings --- .../clawpack/transport/2d/all/clawpack46_rpt2cons_manifold.f | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/clawpack/transport/2d/all/clawpack46_rpt2cons_manifold.f b/applications/clawpack/transport/2d/all/clawpack46_rpt2cons_manifold.f index 6a7119445..b3f5a1c01 100644 --- a/applications/clawpack/transport/2d/all/clawpack46_rpt2cons_manifold.f +++ b/applications/clawpack/transport/2d/all/clawpack46_rpt2cons_manifold.f @@ -5,7 +5,7 @@ subroutine clawpack46_rpt2cons_manifold(ixy,maxm,meqn, implicit none - integer ixy, maxm, meqn,mwaves,mbc,mx,imp, maux + integer ixy, maxm, meqn,mwaves,mbc,mx,imp double precision ql(1-mbc:maxm+mbc, meqn) double precision qr(1-mbc:maxm+mbc, meqn) From 40cde8baad8d982e40f37cc47457c066f59137a4 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Sun, 21 Jul 2024 17:38:13 -0700 Subject: [PATCH 12/24] (clawpack/euler/2d/quadrants) Fix compiler warnings --- .../clawpack/euler/2d/quadrants/user_4.6/qinit.f | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/applications/clawpack/euler/2d/quadrants/user_4.6/qinit.f b/applications/clawpack/euler/2d/quadrants/user_4.6/qinit.f index f1cd66411..fe3f0591a 100644 --- a/applications/clawpack/euler/2d/quadrants/user_4.6/qinit.f +++ b/applications/clawpack/euler/2d/quadrants/user_4.6/qinit.f @@ -63,10 +63,18 @@ subroutine clawpack46_qinit(maxmx,maxmy,meqn,mbc,mx,my, xcell = xlower + (i-0.5d0)*dx do j = 1-mbc,my+mbc ycell = ylower + (j-0.5d0)*dy - if (xcell.ge.xs .and. ycell.ge.ys) iq = 1 - if (xcell.lt.xs .and. ycell.ge.ys) iq = 2 - if (xcell.lt.xs .and. ycell.lt.ys) iq = 3 - if (xcell.ge.xs .and. ycell.lt.ys) iq = 4 + if (xcell .ge. xs .and. ycell .ge. ys) then + iq = 1 + elseif (xcell .lt. xs .and. ycell .ge. ys) then + iq = 2 + elseif (xcell .lt. xs .and. ycell .lt. ys) then + iq = 3 + elseif (xcell .ge. xs .and. ycell .lt. ys) then + iq = 4 + else + write(6,*) "qinit.f : invalid point value" + stop + endif q(i,j,1) = rpr(iq) q(i,j,2) = rpr(iq)*rpu(iq) q(i,j,3) = rpr(iq)*rpv(iq) From c1182204a602e59233dbde3435d99343e3028b5d Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Sun, 21 Jul 2024 17:57:06 -0700 Subject: [PATCH 13/24] (clawpack/shallow/2d/sphere) Fix compiler warnings --- .../shallow/2d/sphere/user_4.6/rpn2swsphere_fwave.f90 | 10 ++++------ .../shallow/2d/sphere/user_4.6/sphere_b4step2.f90 | 1 - .../shallow/2d/sphere/user_4.6/sphere_setaux.f90 | 2 +- .../clawpack/shallow/2d/sphere/user_5.0/rpt2swq.f90 | 5 ++--- .../shallow/2d/sphere/user_5.0/rpt2swq_fwave.f90 | 5 ++--- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/applications/clawpack/shallow/2d/sphere/user_4.6/rpn2swsphere_fwave.f90 b/applications/clawpack/shallow/2d/sphere/user_4.6/rpn2swsphere_fwave.f90 index 45d21745c..308d0f01c 100644 --- a/applications/clawpack/shallow/2d/sphere/user_4.6/rpn2swsphere_fwave.f90 +++ b/applications/clawpack/shallow/2d/sphere/user_4.6/rpn2swsphere_fwave.f90 @@ -42,14 +42,12 @@ SUBROUTINE clawpack46_rpn2_fwave(ixy,maxm,meqn,mwaves, & integer :: i, m, mw, mq, ioff double precision :: enx, eny, enz, etx,ety,etz - double precision :: hunl, hunr, hutl, hutr - double precision :: gamma, amn, apn, df, dy, qn + double precision :: hunl, hunr + double precision :: gamma, amn, apn, df, dy double precision :: erx, ery, erz, h1, h3, hi, him1, hu1, hu3 double precision :: s0, s03, s1, s3, sfract double precision :: hL, hR, huL, huR, bL, bR, hvL, hvR - double precision :: uL, vL, uR, vR, phiR, phiL, sL, sR - double precision :: uhat, chat double precision :: sw(mwaves), fw(meqn,mwaves) double precision szm(3), szp(3), z, sdk @@ -327,8 +325,8 @@ SUBROUTINE simple_riemann(hR,huR,hvR, br, hL,huL,hvl,bL, s,fwave) common /swe_model_parms/ grav DOUBLE PRECISION :: fluxdiff(3),beta(3), hbar, fl(3), fr(3) - double precision :: psiL, psiR, sL, sR, vhat, ul, vl, ur, vr - double precision :: hsq, uhat, chat, phir, phil + double precision :: psiL, psiR, vhat, ul, vl, ur, vr + double precision :: uhat,chat fwave = 0 s = 0 diff --git a/applications/clawpack/shallow/2d/sphere/user_4.6/sphere_b4step2.f90 b/applications/clawpack/shallow/2d/sphere/user_4.6/sphere_b4step2.f90 index d5f85ad8a..ee003b6f9 100644 --- a/applications/clawpack/shallow/2d/sphere/user_4.6/sphere_b4step2.f90 +++ b/applications/clawpack/shallow/2d/sphere/user_4.6/sphere_b4step2.f90 @@ -8,7 +8,6 @@ subroutine clawpack46_b4step2(maxmx,maxmy,mbc,mx,my,meqn,q, & double precision q(1-mbc:maxmx+mbc,1-mbc:maxmy+mbc, meqn) double precision aux(1-mbc:maxmx+mbc,1-mbc:maxmy+mbc, maux) - double precision xlow,ylow double precision erx, ery, erz, qn integer i,j diff --git a/applications/clawpack/shallow/2d/sphere/user_4.6/sphere_setaux.f90 b/applications/clawpack/shallow/2d/sphere/user_4.6/sphere_setaux.f90 index aef2844a5..a6ced9ec8 100644 --- a/applications/clawpack/shallow/2d/sphere/user_4.6/sphere_setaux.f90 +++ b/applications/clawpack/shallow/2d/sphere/user_4.6/sphere_setaux.f90 @@ -25,7 +25,7 @@ subroutine sphere_setaux(mx,my,mbc,xlower,ylower, & common /swe_example/ example integer i,j,m - double precision dxdy, xc, yc, xp, yp,zp, rp + double precision dxdy, xc, yc double precision bmount integer blockno, fc2d_clawpack46_get_block diff --git a/applications/clawpack/shallow/2d/sphere/user_5.0/rpt2swq.f90 b/applications/clawpack/shallow/2d/sphere/user_5.0/rpt2swq.f90 index 1900fa04b..52606cba9 100644 --- a/applications/clawpack/shallow/2d/sphere/user_5.0/rpt2swq.f90 +++ b/applications/clawpack/shallow/2d/sphere/user_5.0/rpt2swq.f90 @@ -37,9 +37,8 @@ subroutine clawpack5_rpt2(ixy,imp,maxm,meqn,mwaves,maux, & common /comxyt/ dtcom,dxcom,dycom,tcom,icom,jcom double precision delta(4) - double precision a1, a2, a3, dx, dy, bn - double precision erx, ery, erz - integer i, j, m, i1, mw, ioff, ix1, ixm1 + double precision a1, a2, a3, dx + integer i, m, i1, mw, ioff, ix1, ixm1 if (ixy .eq. 1) then diff --git a/applications/clawpack/shallow/2d/sphere/user_5.0/rpt2swq_fwave.f90 b/applications/clawpack/shallow/2d/sphere/user_5.0/rpt2swq_fwave.f90 index bae234972..e344ae838 100644 --- a/applications/clawpack/shallow/2d/sphere/user_5.0/rpt2swq_fwave.f90 +++ b/applications/clawpack/shallow/2d/sphere/user_5.0/rpt2swq_fwave.f90 @@ -37,9 +37,8 @@ subroutine clawpack5_rpt2_fwave(ixy,imp,maxm,meqn,mwaves, maux,& common /comxyt/ dtcom,dxcom,dycom,tcom,icom,jcom double precision delta(4) - double precision a1, a2, a3, dx, dy, bn - double precision erx, ery, erz - integer i, j, m, i1, mw, ioff, ix1, ixm1 + double precision a1, a2, a3, dx + integer i, m, i1, mw, ioff, ix1, ixm1 if (ixy .eq. 1) then From fbf1cef7746e88ac4f675683c0f93e218b1066b9 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Mon, 22 Jul 2024 12:53:57 -0700 Subject: [PATCH 14/24] (elliptic/allencahn) Fix compiler warnings --- .../allencahn/fortran/allencahn_apply_bc.f90 | 9 ++++++++ .../allencahn/fortran/allencahn_eval_bc.f90 | 3 +++ .../allencahn/fortran/allencahn_qexact.f90 | 22 ++++++++++++++----- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/applications/elliptic/allencahn/fortran/allencahn_apply_bc.f90 b/applications/elliptic/allencahn/fortran/allencahn_apply_bc.f90 index 57e044d11..e8f422bd7 100644 --- a/applications/elliptic/allencahn/fortran/allencahn_apply_bc.f90 +++ b/applications/elliptic/allencahn/fortran/allencahn_apply_bc.f90 @@ -80,6 +80,9 @@ subroutine allencahn_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & elseif (bctype(iface) .eq. 2) then a = 0 b = 1 + else + write(6,*) 'allencahn_apply_bc : Invalid bctype choice' + stop endif if (idir == 0) then @@ -117,6 +120,9 @@ subroutine allencahn_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & ic = mx !! cell center i1 = mx+1 ig = mx+1 + else + write(6,*) 'allencahn_apply_bc : ic, i1, ig not initialized' + stop endif !! location at interface x = xlower + (i1 - 1)*dx @@ -143,6 +149,9 @@ subroutine allencahn_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & jc = my j1 = my+1 jg = my+1 + else + write(6,*) 'allencahn_apply_bc : jc, j1, jg not initialized' + stop endif !! location at interface y = ylower + (j1 - 1)*dy diff --git a/applications/elliptic/allencahn/fortran/allencahn_eval_bc.f90 b/applications/elliptic/allencahn/fortran/allencahn_eval_bc.f90 index 834e48ef3..2b0add3a8 100644 --- a/applications/elliptic/allencahn/fortran/allencahn_eval_bc.f90 +++ b/applications/elliptic/allencahn/fortran/allencahn_eval_bc.f90 @@ -24,6 +24,9 @@ double precision function allencahn_fort_eval_bc(iface,t,x,y) elseif (bctype(iface) .eq. 2) then a = 0 b = 1 + else + write(6,*) 'allencahn_eval_bc : Invalid bctype' + stop endif allencahn_fort_eval_bc = a*q + b*qn diff --git a/applications/elliptic/allencahn/fortran/allencahn_qexact.f90 b/applications/elliptic/allencahn/fortran/allencahn_qexact.f90 index d35f3e0b2..5bea9d520 100644 --- a/applications/elliptic/allencahn/fortran/allencahn_qexact.f90 +++ b/applications/elliptic/allencahn/fortran/allencahn_qexact.f90 @@ -70,6 +70,8 @@ SUBROUTINE allencahn_qexact_complete(x,y,q,qlap,grad,flag) double precision q1, qx1, qy1, qlap1, x0p,y0p integer id + qx = 0 + qy = 0 if (example .eq. 0) then q = x**2 + y**2 qx = 2*x @@ -127,13 +129,13 @@ SUBROUTINE allencahn_qexact_complete(x,y,q,qlap,grad,flag) q = 0 qx = 0 qy = 0 - qlap = 0 + qlap = 0 do id = 1,m_polar x0p = x0_polar(id) y0p = y0_polar(id) r = sqrt((x-x0p)**2 + (y-y0p)**2) theta = atan2(y-y0p,x-x0p) - q1 = 1 - hsmooth(id,r,theta) + q1 = 1 - hsmooth(id,r,theta) if (flag .ge. 1) then !! Assume mapping is T(r,theta) t1(1) = cos(theta) @@ -152,10 +154,17 @@ SUBROUTINE allencahn_qexact_complete(x,y,q,qlap,grad,flag) endif endif q = q + q1 - qx = qx + qx1 - qy = qy + qy1 - qlap = qlap + qlap1 + if (flag .ge. 1) then + qx = qx + qx1 + qy = qy + qy1 + if (flag .eq. 2) then + qlap = qlap + qlap1 + endif + endif enddo + else + write(6,*) 'allencahn_qexact : Invalid example choice' + stop endif if (flag .ge. 1) then grad(1) = qx @@ -197,6 +206,9 @@ subroutine allencahn_fort_beta(x,y,b,grad) b = 1 + x*y bx = y by = x + else + write(6,*) 'allencahn_beta : Invalid beta choice' + stop endif grad(1) = bx From cecb7cff22fdad8eb8b0920efc0cd20dac28f585 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Mon, 22 Jul 2024 12:57:08 -0700 Subject: [PATCH 15/24] (elliptic/heat) Fix compiler warnings --- applications/elliptic/heat/fortran/heat_apply_bc.f90 | 9 +++++++++ applications/elliptic/heat/fortran/heat_eval_bc.f90 | 3 +++ 2 files changed, 12 insertions(+) diff --git a/applications/elliptic/heat/fortran/heat_apply_bc.f90 b/applications/elliptic/heat/fortran/heat_apply_bc.f90 index e7f3f2b77..4b97db29c 100644 --- a/applications/elliptic/heat/fortran/heat_apply_bc.f90 +++ b/applications/elliptic/heat/fortran/heat_apply_bc.f90 @@ -62,6 +62,9 @@ subroutine heat_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & elseif (bctype(iface) .eq. 2) then a = 0 b = 1 + else + write(6,*) 'heat_apply_bc : Invalid bctype' + stop endif if (idir == 0) then @@ -99,6 +102,9 @@ subroutine heat_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & ic = mx !! cell center i1 = mx+1 ig = mx+1 + else + write(6,*) 'heat_apply_bc : ic, i1, or ig not initialized' + stop endif !! location at interface x = xlower + (i1 - 1)*dx @@ -125,6 +131,9 @@ subroutine heat_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & jc = my j1 = my+1 jg = my+1 + else + write(6,*) 'heat_apply_bc : jc, j1, or jg not initialized' + stop endif !! location at interface y = ylower + (j1 - 1)*dy diff --git a/applications/elliptic/heat/fortran/heat_eval_bc.f90 b/applications/elliptic/heat/fortran/heat_eval_bc.f90 index ddbfc6354..681203f4e 100644 --- a/applications/elliptic/heat/fortran/heat_eval_bc.f90 +++ b/applications/elliptic/heat/fortran/heat_eval_bc.f90 @@ -24,6 +24,9 @@ double precision function heat_fort_eval_bc(iface,t,x,y) elseif (bctype(iface) .eq. 2) then a = 0 b = 1 + else + write(6,*) 'heat_eval_bc : Invalid bctype' + stop endif heat_fort_eval_bc = a*q + b*qn From c8efd6847ea21ee325842c6d4fb40a2569f5e2f2 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Mon, 22 Jul 2024 13:23:53 -0700 Subject: [PATCH 16/24] (elliptic/poisson) Fix compiler warnings --- .../elliptic/poisson/fortran/poisson_apply_bc.f90 | 9 +++++++++ .../elliptic/poisson/fortran/poisson_eval_bc.f90 | 3 +++ 2 files changed, 12 insertions(+) diff --git a/applications/elliptic/poisson/fortran/poisson_apply_bc.f90 b/applications/elliptic/poisson/fortran/poisson_apply_bc.f90 index 9e9c4ddf9..e5a20437e 100644 --- a/applications/elliptic/poisson/fortran/poisson_apply_bc.f90 +++ b/applications/elliptic/poisson/fortran/poisson_apply_bc.f90 @@ -80,6 +80,9 @@ subroutine poisson_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & elseif (bctype(iface) .eq. 2) then a = 0 b = 1 + else + write(6,*) 'poisson_apply_bc : Invalid bctype choice' + stop endif if (idir == 0) then @@ -117,6 +120,9 @@ subroutine poisson_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & ic = mx !! cell center i1 = mx+1 ig = mx+1 + else + write(6,*) 'poisson_apply_bc : ic, i1, or ig not initialized' + stop endif !! location at interface x = xlower + (i1 - 1)*dx @@ -143,6 +149,9 @@ subroutine poisson_fort_apply_bc(blockno, mx, my,mbc,mfields,xlower,ylower, & jc = my j1 = my+1 jg = my+1 + else + write(6,*) 'poisson_apply_bc : jc, j1, or jg not initialized' + stop endif !! location at interface y = ylower + (j1 - 1)*dy diff --git a/applications/elliptic/poisson/fortran/poisson_eval_bc.f90 b/applications/elliptic/poisson/fortran/poisson_eval_bc.f90 index d0fa80057..579afeb83 100644 --- a/applications/elliptic/poisson/fortran/poisson_eval_bc.f90 +++ b/applications/elliptic/poisson/fortran/poisson_eval_bc.f90 @@ -24,6 +24,9 @@ double precision function poisson_fort_eval_bc(iface,t,x,y) elseif (bctype(iface) .eq. 2) then a = 0 b = 1 + else + write(6,*) 'poisson_eval_bc : Invalid choice for bctype' + stop endif poisson_fort_eval_bc = a*q + b*qn From 2a24459952905e224849847fb0ab7c8bb9d07c35 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Mon, 22 Jul 2024 13:40:36 -0700 Subject: [PATCH 17/24] (fc3d_clawpack46) Fix compiler warnings --- .../fortran_source/fc3d_clawpack46_step3_wrap.f90 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/solvers/fc3d_clawpack46/fortran_source/fc3d_clawpack46_step3_wrap.f90 b/src/solvers/fc3d_clawpack46/fortran_source/fc3d_clawpack46_step3_wrap.f90 index 482c01784..81e23d460 100644 --- a/src/solvers/fc3d_clawpack46/fortran_source/fc3d_clawpack46_step3_wrap.f90 +++ b/src/solvers/fc3d_clawpack46/fortran_source/fc3d_clawpack46_step3_wrap.f90 @@ -40,10 +40,6 @@ subroutine clawpack46_step3_wrap(maxm, meqn, maux, mbc, & double precision :: dtcom, dxcom,dycom,dzcom, tcom integer :: icom, jcom, kcom common /comxyzt/ dtcom,dxcom,dycom,dzcom, tcom,icom,jcom, kcom - - integer jfix, kfix - double precision kappa - ierror = 0 !! This should be set to actual time, in case the user wants it From 4688825e1700bfbe033226007ce399da381cc42f Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Mon, 22 Jul 2024 14:04:02 -0700 Subject: [PATCH 18/24] (clawpatch/fort3_4.6) Fix compiler warnings --- src/patches/clawpatch/fort3_4.6/fclaw3d_clawpatch46_copy.f90 | 2 -- .../clawpatch/fort3_4.6/fclaw3d_clawpatch46_interpolate.f90 | 4 ---- .../clawpatch/fort3_4.6/fclaw3dx_clawpatch46_average.f90 | 3 +-- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/patches/clawpatch/fort3_4.6/fclaw3d_clawpatch46_copy.f90 b/src/patches/clawpatch/fort3_4.6/fclaw3d_clawpatch46_copy.f90 index 37c8cc113..672e2c7ed 100644 --- a/src/patches/clawpatch/fort3_4.6/fclaw3d_clawpatch46_copy.f90 +++ b/src/patches/clawpatch/fort3_4.6/fclaw3d_clawpatch46_copy.f90 @@ -22,8 +22,6 @@ subroutine fclaw3d_clawpatch46_fort_copy_face(mx,my,mz,mbc, & integer mq, k integer i,j - integer a(2,2), f(2) - !!call fclaw3d_clawpatch_build_transform_same(transform_ptr, a, f) if (iface .eq. 0) then diff --git a/src/patches/clawpatch/fort3_4.6/fclaw3d_clawpatch46_interpolate.f90 b/src/patches/clawpatch/fort3_4.6/fclaw3d_clawpatch46_interpolate.f90 index 0d1c33fdf..51e118973 100644 --- a/src/patches/clawpatch/fort3_4.6/fclaw3d_clawpatch46_interpolate.f90 +++ b/src/patches/clawpatch/fort3_4.6/fclaw3d_clawpatch46_interpolate.f90 @@ -46,7 +46,6 @@ subroutine fclaw3d_clawpatch46_fort_interpolate_face & integer :: rr3 parameter(rr3 = 8) integer :: i2(0:rr3-1),j2(0:rr3-1),k2(0:rr3-1) - logical :: fclaw3d_clawpatch_is_valid_interp logical :: skip_this_grid integer :: a(3,3), f(3) @@ -385,12 +384,9 @@ subroutine fclaw3d_clawpatch46_fort_interpolate2fine & integer :: ii, jj, kk, i,j,k, i1, i2, j1, j2, k1, k2, ig, jg, kg, mq, mth integer :: ic,jc,kc,ic_add, jc_add, kc_add, ifine, jfine, kfine - integer :: i_start_fine, j_start_fine, k_start_fine double precision :: qc, shiftx, shifty, shiftz, sl, sr, gradx, grady, gradz double precision :: fclaw2d_clawpatch_compute_slopes - logical :: lower_x, lower_y, lower_z - integer :: p8est_refineFactor,refratio p8est_refineFactor = 2 diff --git a/src/patches/clawpatch/fort3_4.6/fclaw3dx_clawpatch46_average.f90 b/src/patches/clawpatch/fort3_4.6/fclaw3dx_clawpatch46_average.f90 index 7782a4368..c48cfb178 100644 --- a/src/patches/clawpatch/fort3_4.6/fclaw3dx_clawpatch46_average.f90 +++ b/src/patches/clawpatch/fort3_4.6/fclaw3dx_clawpatch46_average.f90 @@ -50,7 +50,6 @@ SUBROUTINE fclaw3dx_clawpatch46_fort_average_face(mx,my,mz,mbc,meqn, & INTEGER :: rr2 PARAMETER(rr2 = 4) INTEGER, DIMENSION(0:rr2-1) :: i2, j2 - !! DOUBLE PRECISION :: kc LOGICAL :: fclaw2d_clawpatch_is_valid_average, skip_this_grid DOUBLE PRECISION :: vf_sum @@ -192,7 +191,7 @@ subroutine fclaw3dx_clawpatch46_fort_average_corner(mx,my,mz,mbc,meqn, & INTEGER :: i2(0:rr2-1),j2(0:rr2-1) INTEGER :: i1,j1,m, k - DOUBLE PRECISION :: vf_sum, kc + DOUBLE PRECISION :: vf_sum r2 = refratio*refratio if (r2 .ne. rr2) then From cdc1fea06c63595e8340da4585ef83bdce93d297 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Mon, 22 Jul 2024 14:23:26 -0700 Subject: [PATCH 19/24] (clawpack/shallow/sphere) Fix compiler warnings --- .../clawpack/shallow/2d/sphere/user_4.6/rpt2swq.f90 | 5 ++--- .../clawpack/shallow/2d/sphere/user_4.6/rpt2swq_fwave.f90 | 5 ++--- .../clawpack/shallow/2d/sphere/user_5.0/rpn2swsphere.f90 | 2 +- .../shallow/2d/sphere/user_5.0/rpn2swsphere_fwave.f90 | 6 ++---- .../clawpack/shallow/2d/sphere/user_5.0/sphere_b4step2.f90 | 5 ----- .../clawpack/shallow/2d/sphere/user_5.0/sphere_qinit.f90 | 4 +--- .../clawpack/shallow/2d/sphere/user_5.0/sphere_setaux.f90 | 2 +- 7 files changed, 9 insertions(+), 20 deletions(-) diff --git a/applications/clawpack/shallow/2d/sphere/user_4.6/rpt2swq.f90 b/applications/clawpack/shallow/2d/sphere/user_4.6/rpt2swq.f90 index fa570cbb2..c49f0d885 100644 --- a/applications/clawpack/shallow/2d/sphere/user_4.6/rpt2swq.f90 +++ b/applications/clawpack/shallow/2d/sphere/user_4.6/rpt2swq.f90 @@ -37,9 +37,8 @@ subroutine clawpack46_rpt2(ixy,maxm,meqn,mwaves,mbc,mx, & common /comxyt/ dtcom,dxcom,dycom,tcom,icom,jcom double precision delta(4) - double precision a1, a2, a3, dx, dy, bn - double precision erx, ery, erz - integer i, j, m, i1, mw, ioff, ix1, ixm1 + double precision a1, a2, a3, dx + integer i, m, i1, mw, ioff, ix1, ixm1 if (ixy .eq. 1) then diff --git a/applications/clawpack/shallow/2d/sphere/user_4.6/rpt2swq_fwave.f90 b/applications/clawpack/shallow/2d/sphere/user_4.6/rpt2swq_fwave.f90 index d94b7341a..903b19ba1 100644 --- a/applications/clawpack/shallow/2d/sphere/user_4.6/rpt2swq_fwave.f90 +++ b/applications/clawpack/shallow/2d/sphere/user_4.6/rpt2swq_fwave.f90 @@ -40,9 +40,8 @@ subroutine clawpack46_rpt2_fwave(ixy,maxm,meqn,mwaves,mbc,mx, & common /comxyt/ dtcom,dxcom,dycom,tcom,icom,jcom double precision delta(4) - double precision a1, a2, a3, dx, dy, bn - double precision erx, ery, erz - integer i, j, m, i1, mw, ioff, ix1, ixm1 + double precision a1, a2, a3, dx + integer i, m, i1, mw, ioff, ix1, ixm1 if (ixy .eq. 1) then diff --git a/applications/clawpack/shallow/2d/sphere/user_5.0/rpn2swsphere.f90 b/applications/clawpack/shallow/2d/sphere/user_5.0/rpn2swsphere.f90 index bd89391d2..608dcb8b5 100644 --- a/applications/clawpack/shallow/2d/sphere/user_5.0/rpn2swsphere.f90 +++ b/applications/clawpack/shallow/2d/sphere/user_5.0/rpn2swsphere.f90 @@ -27,7 +27,7 @@ subroutine clawpack5_rpn2(ixy,maxm,meqn,mwaves,maux, mbc,mx,& double precision amn, erx, ery, erz, apn integer ioff, m, mw, i - double precision dx, dy, qn + double precision dx, dy double precision grav diff --git a/applications/clawpack/shallow/2d/sphere/user_5.0/rpn2swsphere_fwave.f90 b/applications/clawpack/shallow/2d/sphere/user_5.0/rpn2swsphere_fwave.f90 index d545c4548..71d9bb375 100644 --- a/applications/clawpack/shallow/2d/sphere/user_5.0/rpn2swsphere_fwave.f90 +++ b/applications/clawpack/shallow/2d/sphere/user_5.0/rpn2swsphere_fwave.f90 @@ -42,14 +42,12 @@ SUBROUTINE clawpack5_rpn2_fwave(ixy,maxm,meqn,mwaves, maux, & integer :: i, m, mw, mq, ioff double precision :: enx, eny, enz, etx,ety,etz - double precision :: hunl, hunr, hutl, hutr - double precision :: gamma, amn, apn, df, dy, qn + double precision :: hunl, hunr + double precision :: gamma, amn, apn, df, dy double precision :: erx, ery, erz, h1, h3, hi, him1, hu1, hu3 double precision :: s0, s03, s1, s3, sfract double precision :: hL, hR, huL, huR, bL, bR, hvL, hvR - double precision :: uL, vL, uR, vR, phiR, phiL, sL, sR - double precision :: uhat, chat double precision :: sw(mwaves), fw(meqn,mwaves) double precision szm(3), szp(3), z, sdk diff --git a/applications/clawpack/shallow/2d/sphere/user_5.0/sphere_b4step2.f90 b/applications/clawpack/shallow/2d/sphere/user_5.0/sphere_b4step2.f90 index 8dcc40e2e..f425ab313 100644 --- a/applications/clawpack/shallow/2d/sphere/user_5.0/sphere_b4step2.f90 +++ b/applications/clawpack/shallow/2d/sphere/user_5.0/sphere_b4step2.f90 @@ -8,15 +8,10 @@ subroutine clawpack5_b4step2(mbc,mx,my,meqn,q, & double precision q(meqn,1-mbc:mx+mbc,1-mbc:my+mbc) double precision aux(maux,1-mbc:mx+mbc,1-mbc:my+mbc) - double precision xlow,ylow double precision erx, ery, erz, qn integer i,j - !! # We may not even need this if we project out the correct surface - !! # normal from the velocities. - return - do i=1,mx do j=1,my !! Surface normal diff --git a/applications/clawpack/shallow/2d/sphere/user_5.0/sphere_qinit.f90 b/applications/clawpack/shallow/2d/sphere/user_5.0/sphere_qinit.f90 index e1b5a8ad5..b3b231588 100644 --- a/applications/clawpack/shallow/2d/sphere/user_5.0/sphere_qinit.f90 +++ b/applications/clawpack/shallow/2d/sphere/user_5.0/sphere_qinit.f90 @@ -33,13 +33,11 @@ subroutine clawpack5_qinit(meqn,mbc,mx,my, & double precision xc,yc,xlow,ylow,xp,yp,zp, w, qval double precision phi, phi0, width - double precision theta, q1, R, u0, Rsphere, d + double precision theta, q1, R, u0, d integer blockno, fc2d_clawpack5_get_block integer*8 cont, fclaw_map_get_context - character(len=12) :: fname - cont = fclaw_map_get_context() diff --git a/applications/clawpack/shallow/2d/sphere/user_5.0/sphere_setaux.f90 b/applications/clawpack/shallow/2d/sphere/user_5.0/sphere_setaux.f90 index 186e53a4f..187b1f160 100644 --- a/applications/clawpack/shallow/2d/sphere/user_5.0/sphere_setaux.f90 +++ b/applications/clawpack/shallow/2d/sphere/user_5.0/sphere_setaux.f90 @@ -25,7 +25,7 @@ subroutine sphere5_setaux(mx,my,mbc,xlower,ylower, & common /swe_example/ example integer i,j,m - double precision dxdy, xc, yc, xp, yp,zp, rp + double precision dxdy, xc, yc double precision bmount integer blockno, fc2d_clawpack5_get_block From 815aae43f11c2bf99483dbb3ba849980080530a4 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Mon, 22 Jul 2024 14:33:13 -0700 Subject: [PATCH 20/24] (clawpack/euler/quadrants) Fix compiler warnings --- .../euler/2d/quadrants/user_5.0/qinit.f90 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/applications/clawpack/euler/2d/quadrants/user_5.0/qinit.f90 b/applications/clawpack/euler/2d/quadrants/user_5.0/qinit.f90 index 4c65326cd..0c5e50167 100644 --- a/applications/clawpack/euler/2d/quadrants/user_5.0/qinit.f90 +++ b/applications/clawpack/euler/2d/quadrants/user_5.0/qinit.f90 @@ -54,10 +54,18 @@ SUBROUTINE clawpack5_qinit(meqn,mbc,mx,my, & xcell = xlower + (i-0.5d0)*dx DO j = 1-mbc,my+mbc ycell = ylower + (j-0.5d0)*dy - IF (xcell.GE.xs .AND. ycell.GE.ys) iq = 1 - IF (xcell.LT.xs .AND. ycell.GE.ys) iq = 2 - IF (xcell.LT.xs .AND. ycell.LT.ys) iq = 3 - IF (xcell.GE.xs .AND. ycell.LT.ys) iq = 4 + IF (xcell.GE.xs .AND. ycell.GE.ys) then + iq = 1 + ELSEIF (xcell.LT.xs .AND. ycell.GE.ys) then + iq = 2 + ELSEIF (xcell.LT.xs .AND. ycell.LT.ys) then + iq = 3 + ELSEIF (xcell.GE.xs .AND. ycell.LT.ys) then + iq = 4 + ELSE + write(6,*) 'qinit : (xs,ys) not in domain' + stop + ENDIF q(1,i,j) = rpr(iq) q(2,i,j) = rpr(iq)*rpu(iq) q(3,i,j) = rpr(iq)*rpv(iq) From e08232fbed26195fd0ddd47eb01d843fee0558e3 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Mon, 22 Jul 2024 14:44:11 -0700 Subject: [PATCH 21/24] (euler/3dx/rp) Fix compiler warnings --- .../clawpack/euler/3dx/rp/rpn3_euler.f90 | 4 ---- .../euler/3dx/rp/rpn3_euler_mapped.f90 | 14 -------------- .../euler/3dx/rp/rpt3_euler_mapped.f90 | 3 --- .../euler/3dx/rp/rptt3_euler_mapped.f90 | 18 +----------------- 4 files changed, 1 insertion(+), 38 deletions(-) diff --git a/applications/clawpack/euler/3dx/rp/rpn3_euler.f90 b/applications/clawpack/euler/3dx/rp/rpn3_euler.f90 index 82d22009c..c39731aa7 100644 --- a/applications/clawpack/euler/3dx/rp/rpn3_euler.f90 +++ b/applications/clawpack/euler/3dx/rp/rpn3_euler.f90 @@ -322,8 +322,4 @@ SUBROUTINE clawpack46_rpn3(ixyz,maxm,meqn,mwaves,maux,mbc,mx,ql,qr, & END IF ! Entropy fix -108 format(A,'ixyz=',I2, '; imp = ',I2, '; i = ', I2) -109 format(5E24.16) - - END SUBROUTINE clawpack46_rpn3 diff --git a/applications/clawpack/euler/3dx/rp/rpn3_euler_mapped.f90 b/applications/clawpack/euler/3dx/rp/rpn3_euler_mapped.f90 index b0ff49c0c..3ea8a840b 100644 --- a/applications/clawpack/euler/3dx/rp/rpn3_euler_mapped.f90 +++ b/applications/clawpack/euler/3dx/rp/rpn3_euler_mapped.f90 @@ -312,22 +312,8 @@ subroutine clawpack46_rpn3_mapped(ixyz,maxm,meqn,mwaves,maux,mbc,mx,& apdq_cart(m,i) = area*apdq(m) amdq_cart(m,i) = area*amdq(m) end do - - -!! do m=1,meqn -!! amdq_cart(m,i) = 0.d0 -!! apdq_cart(m,i) = 0.d0 -!! do mws = 1,mwaves -!! amdq_cart(m,i) = amdq_cart(m,i) + min(s(mws,i),0.d0)*wave(m,mws) -!! apdq_cart(m,i) = apdq_cart(m,i) + max(s(mws,i),0.d0)*wave(m,mws) -!! enddo -!! enddo - enddo !! end of i loop over 1d sweep array -108 format(A,'ixyz=',I2,'; i = ',I2) -109 format(5E24.16) - return end subroutine clawpack46_rpn3_mapped diff --git a/applications/clawpack/euler/3dx/rp/rpt3_euler_mapped.f90 b/applications/clawpack/euler/3dx/rp/rpt3_euler_mapped.f90 index 9f1cf43ec..257dc9381 100644 --- a/applications/clawpack/euler/3dx/rp/rpt3_euler_mapped.f90 +++ b/applications/clawpack/euler/3dx/rp/rpt3_euler_mapped.f90 @@ -243,9 +243,6 @@ subroutine clawpack46_rpt3_mapped(ixyz,icoor,ilr,maxm,meqn,mwaves,maux,mbc, & enddo !! end of i loop -108 format(A,'ixyz=',I2,'; icoor=',I2,'; ilr = ',I2,'; i=',I2) -109 format(5E24.16) - 1001 format(A,3E24.16) 1002 format(A,I5) 1003 format('icom = ',I5,'; jcom = ',I5,'; kcom = ',I5) diff --git a/applications/clawpack/euler/3dx/rp/rptt3_euler_mapped.f90 b/applications/clawpack/euler/3dx/rp/rptt3_euler_mapped.f90 index e0344d926..91402fd57 100644 --- a/applications/clawpack/euler/3dx/rp/rptt3_euler_mapped.f90 +++ b/applications/clawpack/euler/3dx/rp/rptt3_euler_mapped.f90 @@ -81,28 +81,12 @@ subroutine clawpack46_rptt3_mapped(ixyz,icoor,ilr,impt,maxm,meqn,mwaves,& common /comxyzt/ dtcom,dxcom,dycom,dzcom,tcom,icom,jcom,kcom double precision wave(5,3),s_rot(3), bsasdq(5), uvw(3) - double precision uvw_cart(3), rot(9), wave_cart(5,3) + double precision uvw_cart(3), rot(9) integer i, j, mws, m, i1, info double precision uvw2, pres, enth, area integer locrot, locarea, irot -!! integer mv,mu,mw - -!! IF(ixyz == 1)THEN -!! mu = 2 -!! mv = 3 -!! mw = 4 -!! ELSE IF(ixyz == 2)THEN -!! mu = 3 -!! mv = 4 -!! mw = 2 -!! ELSE -!! mu = 4 -!! mv = 2 -!! mw = 3 -!! ENDIF - call get_aux_locations_tt(ixyz,icoor,mcapa,locrot,locarea,irot) !! # Solve Riemann problem in the second coordinate direction From 0f1e2c155477ecfa5d76735946dcc955bb26648a Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Mon, 22 Jul 2024 15:20:07 -0700 Subject: [PATCH 22/24] Fix compiler warnings --- src/fclaw_corner_neighbors.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fclaw_corner_neighbors.c b/src/fclaw_corner_neighbors.c index f127efedb..66da53adc 100644 --- a/src/fclaw_corner_neighbors.c +++ b/src/fclaw_corner_neighbors.c @@ -92,6 +92,9 @@ int find_edge(int corner, int intersects[], int faces[]) face_0 = faces[0]; face_1 = faces[1]; break; + default: + fclaw_global_essentialf("fclaw_corner_neighbors : face_X not initialized"); + exit(0); } FCLAW_ASSERT(face_0 != non_intersecting_face); FCLAW_ASSERT(face_1 != non_intersecting_face); From 86801978aef9246912385bd11642e4f8191c8ed3 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Mon, 22 Jul 2024 15:27:28 -0700 Subject: [PATCH 23/24] (demo) Fix compiler warnings --- .../clawpack/advection/2d/swirl/swirl_ray.c | 5 +- .../filament_swirl/filament_swirl_split.cpp | 4 +- .../demo/2d/filament_swirl/user_run.c | 206 +----------------- 3 files changed, 6 insertions(+), 209 deletions(-) diff --git a/applications/clawpack/advection/2d/swirl/swirl_ray.c b/applications/clawpack/advection/2d/swirl/swirl_ray.c index 872b698cf..03e81aa5a 100644 --- a/applications/clawpack/advection/2d/swirl/swirl_ray.c +++ b/applications/clawpack/advection/2d/swirl/swirl_ray.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2012-2022 Carsten Burstedde, Donna Calhoun, Scott Aiton + Copyright (c) 2012-2024 Carsten Burstedde, Donna Calhoun, Scott Aiton All rights reserved. Redistribution and use in source and binary forms, with or without @@ -218,7 +218,8 @@ int swirl_intersect_ray (fclaw_domain_t *domain, } /* Four cases */ int found_intersection = 0; - point_t pstart, pend; + point_t pstart = {0,0}; + point_t pend = {0,0}; if (istart < 0 && iend < 0) { /* No intersection found */ diff --git a/applications/demo/2d/filament_swirl/filament_swirl_split.cpp b/applications/demo/2d/filament_swirl/filament_swirl_split.cpp index 31202bf44..bda2400c5 100644 --- a/applications/demo/2d/filament_swirl/filament_swirl_split.cpp +++ b/applications/demo/2d/filament_swirl/filament_swirl_split.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2012-2023 Carsten Burstedde, Donna Calhoun, Scott Aiton +Copyright (c) 2012-2024 Carsten Burstedde, Donna Calhoun, Scott Aiton All rights reserved. Redistribution and use in source and binary forms, with or without @@ -161,7 +161,7 @@ main (int argc, char **argv) /* MPI COMMs */ int size, rank; - sc_MPI_Comm mpicomm = fclaw_app_get_mpi_size_rank (app, &size, &rank); + fclaw_app_get_mpi_size_rank (app, &size, &rank); /* Globs */ fclaw_global_t *filament_glob = fclaw_global_new_comm (subcomm, size, rank); diff --git a/applications/demo/2d/filament_swirl/user_run.c b/applications/demo/2d/filament_swirl/user_run.c index a43343f5e..4b8525854 100644 --- a/applications/demo/2d/filament_swirl/user_run.c +++ b/applications/demo/2d/filament_swirl/user_run.c @@ -1,5 +1,5 @@ /* -Copyright (c) 2012-2022 Carsten Burstedde, Donna Calhoun, Scott Aiton +Copyright (c) 2012-2024 Carsten Burstedde, Donna Calhoun, Scott Aiton All rights reserved. Redistribution and use in source and binary forms, with or without @@ -301,210 +301,6 @@ double outstyle_1(outstyle_1_context_t* ctx, double t_pause, fclaw_global_t *glo return ctx->final_time; } -static -void outstyle_3(fclaw_global_t *glob) -{ - fclaw_domain_t** domain = &glob->domain; - - int init_flag = 1; - fclaw_diagnostics_gather(glob,init_flag); - init_flag = 0; - - int iframe = 0; - fclaw_output_frame(glob,iframe); - - - const fclaw_options_t *fclaw_opt = fclaw_get_options(glob); - double initial_dt = fclaw_opt->initial_dt; - - - //fclaw2d_time_sync_reset(glob,fclaw_opt->minlevel,fclaw_opt->maxlevel,1); - - double t0 = 0; - double dt_minlevel = initial_dt; - glob->curr_time = t0; - int nstep_outer = fclaw_opt->nout; - int nstep_inner = fclaw_opt->nstep; - int nregrid_interval = fclaw_opt->regrid_interval; - int level_factor = pow_int(2,fclaw_opt->maxlevel-fclaw_opt->minlevel); - if (!fclaw_opt->subcycle) - { - if (fclaw_opt->advance_one_step) - { - if (!fclaw_opt->outstyle_uses_maxlevel) - { - /* Multiply nout/nstep by 2^(maxlevel-minlevel) so that - a given nout/nstep pair works for both subcycled - and non-subcycled cases. - Note : Regrid_interval remains unchanged.*/ - - nstep_outer *= level_factor; - nstep_inner *= level_factor; /* Only produce nout/nstep output files */ - } - } - } - - int n = 0; - double t_curr = t0; - while (n < nstep_outer) - { - double dt_step = dt_minlevel; - if (!fclaw_opt->subcycle && fclaw_opt->advance_one_step) - { - /* if domain->global_maxlevel < fclaw_opt->maxlevel, this choice - of time step will take more steps than necessary on - finest level. */ - dt_step /= level_factor; - } - - /* In case we have to reject this step */ - if (!fclaw_opt->use_fixed_dt) - { - save_time_step(glob); - } - - /* Get current domain data since it may change during regrid */ - glob->curr_dt = dt_step; - double maxcfl_step = fclaw_advance_all_levels(glob, t_curr,dt_step); - - /* This is a collective communication - everybody needs to wait here. */ - if (fclaw_opt->reduce_cfl) - { - /* If we are taking a variable time step, we have to reduce the - maxcfl so that every processor takes the same size dt */ - fclaw_timer_start (&glob->timers[FCLAW_TIMER_CFL_COMM]); - maxcfl_step = fclaw_domain_global_maximum (*domain, maxcfl_step); - fclaw_timer_stop (&glob->timers[FCLAW_TIMER_CFL_COMM]); - } - - double tc = t_curr + dt_step; - int level2print = (fclaw_opt->advance_one_step && fclaw_opt->outstyle_uses_maxlevel) ? - fclaw_opt->maxlevel : fclaw_opt->minlevel; - - fclaw_global_productionf("Level %d (%d-%d) step %5d : dt = %12.3e; maxcfl (step) = " \ - "%12.6f; Final time = %12.4f\n", - level2print, - (*domain)->global_minlevel, - (*domain)->global_maxlevel, - n+1,dt_step,maxcfl_step, tc); - - if (fclaw_opt->reduce_cfl & (maxcfl_step > fclaw_opt->max_cfl)) - { - if (!fclaw_opt->use_fixed_dt) - { - fclaw_global_productionf(" WARNING : Maximum CFL exceeded; retaking time step\n"); - restore_time_step(glob); - - dt_minlevel = dt_minlevel*fclaw_opt->desired_cfl/maxcfl_step; - - /* Go back to start of loop without incrementing step counter or - current time. */ - continue; - } - else - { - fclaw_global_productionf(" WARNING : Maximum CFL exceeded\n"); - } - } - - /* We are happy with this time step */ - t_curr = tc; - glob->curr_time = t_curr; - - /* New time step, which should give a cfl close to the desired cfl. */ - if (!fclaw_opt->use_fixed_dt) - { - dt_minlevel = dt_minlevel*fclaw_opt->desired_cfl/maxcfl_step; - } - - n++; /* Increment outer counter */ - - if (fclaw_opt->regrid_interval > 0) - { - if (n % nregrid_interval == 0) - { - fclaw_global_infof("regridding at step %d\n",n); - fclaw_regrid(glob); - } - } - - if (fclaw_opt->advance_one_step) - { - //fclaw2d_diagnostics_gather(glob,init_flag); - } - - if (n % nstep_inner == 0) - { - iframe++; - fclaw_diagnostics_gather(glob,init_flag); - fclaw_output_frame(glob,iframe); - } - } -} - - -static -void outstyle_4(fclaw_global_t *glob) -{ - - /* Write out an initial time file */ - int iframe = 0; - fclaw_output_frame(glob,iframe); - - int init_flag = 1; - fclaw_diagnostics_gather(glob,init_flag); - init_flag = 0; - - const fclaw_options_t *fclaw_opt = fclaw_get_options(glob); - double initial_dt = fclaw_opt->initial_dt; - int nstep_outer = fclaw_opt->nout; - int nstep_inner = fclaw_opt->nstep; - double dt_minlevel = initial_dt; - - double t0 = 0; - double t_curr = t0; - glob->curr_time = t_curr; - int n = 0; - while (n < nstep_outer) - { - /* Get current domain data since it may change during regrid */ - fclaw_advance_all_levels(glob, t_curr, dt_minlevel); - - int level2print = (fclaw_opt->advance_one_step && fclaw_opt->outstyle_uses_maxlevel) ? - fclaw_opt->maxlevel : fclaw_opt->minlevel; - - fclaw_global_productionf("Level %d step %5d : dt = %12.3e; Final time = %16.6e\n", - level2print, - n+1,dt_minlevel, t_curr+dt_minlevel); - - t_curr += dt_minlevel; - n++; - - glob->curr_time = t_curr; - - if (fclaw_opt->regrid_interval > 0) - { - if (n % fclaw_opt->regrid_interval == 0) - { - fclaw_global_infof("regridding at step %d\n",n); - - fclaw_regrid(glob); - } - } - else - { - /* Only use the initial grid */ - } - - if (n % nstep_inner == 0) - { - fclaw_diagnostics_gather(glob,init_flag); - iframe++; - fclaw_output_frame(glob,iframe); - } - } -} - /* ------------------------------------------------------------------ Public interface From 402d2040ae8288f02f00b89ac00fe79ceaff9107 Mon Sep 17 00:00:00 2001 From: donnaaboise Date: Mon, 22 Jul 2024 16:02:21 -0700 Subject: [PATCH 24/24] (demo/restart) Remove swirl_ray file --- applications/demo/2d/swirl_restart/Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/applications/demo/2d/swirl_restart/Makefile.am b/applications/demo/2d/swirl_restart/Makefile.am index 1aef69e75..93aab65a1 100644 --- a/applications/demo/2d/swirl_restart/Makefile.am +++ b/applications/demo/2d/swirl_restart/Makefile.am @@ -5,7 +5,6 @@ bin_PROGRAMS += applications/demo/2d/swirl_restart/swirl applications_demo_2d_swirl_restart_swirl_SOURCES = \ applications/demo/2d/swirl_restart/swirl_user.cpp \ applications/demo/2d/swirl_restart/swirl_user.h \ - applications/demo/2d/swirl_restart/swirl_ray.c \ applications/demo/2d/swirl_restart/swirl_options.c \ applications/demo/2d/swirl_restart/swirl.cpp \ applications/demo/2d/swirl_restart/psi.f \