From 445a2ee3cc594768c75ee07727aa5df0a5a60d32 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Wed, 1 Nov 2023 20:18:38 -0400 Subject: [PATCH 1/7] update CI benchmarks due to Microphysics changes (#2647) this reflects the sneut5 changes --- .../sdc_det_plt00040_extrema.out | 130 +++++++++--------- .../ci-benchmarks/wdmerger_collision_2D.out | 46 +++---- 2 files changed, 88 insertions(+), 88 deletions(-) diff --git a/Exec/science/Detonation/ci-benchmarks/sdc_det_plt00040_extrema.out b/Exec/science/Detonation/ci-benchmarks/sdc_det_plt00040_extrema.out index b23a288448..c194eb241b 100644 --- a/Exec/science/Detonation/ci-benchmarks/sdc_det_plt00040_extrema.out +++ b/Exec/science/Detonation/ci-benchmarks/sdc_det_plt00040_extrema.out @@ -1,79 +1,79 @@ plotfile = det_x_plt00040 time = 5.1558159133685604e-06 variables minimum value maximum value - density 185259613.21 216639295.98 - xmom -76364812859 2.9487648003e+16 + density 185260007.35 216603859.01 + xmom -95478048133 2.952359112e+16 ymom 0 0 zmom 0 0 - rho_E 1.3062473824e+26 2.7890630574e+26 - rho_e 1.3062473824e+26 2.7748033958e+26 - Temp 50000004.458 7845854782 - rho_H1 2.1207015241e-22 0.020000144873 - rho_He3 0.0017224909604 0.021023115362 - rho_He4 94365290.111 200001891.25 - rho_C12 0.020000000212 21243051.967 - rho_N14 1.9999977239e-22 0.020000190213 - rho_O16 0.019999999996 19209.485639 - rho_Ne20 0.019999999996 9734.6358293 - rho_Mg24 0.019999999996 23306.635461 - rho_Si28 0.019999999996 2013766.0467 - rho_S32 0.019999999996 1654854.387 - rho_Ar36 0.019999999996 821077.40202 - rho_Ca40 0.019999999996 724428.55057 - rho_Ti44 0.019999999996 34137.672926 - rho_Cr48 0.019999999996 78094.207516 - rho_Fe52 0.019999999996 277975.05929 - rho_Fe54 0.019999999996 94999519.274 - rho_Ni56 0.019999999996 2236723.6985 - rho_n 2.1207015241e-22 234580.251 - rho_p 0.019999995434 3609846.1745 - rho_enuc -4.6916352344e+29 3.5793978339e+32 - pressure 5.5236728673e+25 1.1610546577e+26 - kineng 0 2.0430835425e+24 - soundspeed 612864631.35 895226082.4 - Gamma_1 1.359975607 1.3820247131 - MachNumber 0 0.16100811998 - uplusc 612864631.35 999536286.21 - uminusc -895226453.03 -612859846.92 - entropy 98214771.47 336273518.24 + rho_E 1.3062473824e+26 2.7893784124e+26 + rho_e 1.3062473824e+26 2.7751326191e+26 + Temp 50000004.458 7845854705.7 + rho_H1 2.1201861478e-22 0.020000095466 + rho_He3 0.0017223648459 0.021020296724 + rho_He4 94359149.148 200001396.77 + rho_C12 0.020000000212 21135001.4 + rho_N14 1.9999995691e-22 0.020000140467 + rho_O16 0.019999999996 19209.47908 + rho_Ne20 0.019999999996 3349.1035562 + rho_Mg24 0.019999999996 23321.472036 + rho_Si28 0.019999999996 2015667.384 + rho_S32 0.019999999996 1656663.9647 + rho_Ar36 0.019999999996 822084.74368 + rho_Ca40 0.019999999996 724953.65136 + rho_Ti44 0.019999999996 34186.713944 + rho_Cr48 0.019999999996 78116.705288 + rho_Fe52 0.019999999996 278123.66002 + rho_Fe54 0.019999999996 95005859.534 + rho_Ni56 0.019999999996 2240472.8392 + rho_n 2.1201861478e-22 234580.1967 + rho_p 0.019999995434 3610168.2963 + rho_enuc -4.6893837946e+29 3.5767389644e+32 + pressure 5.5236728673e+25 1.1610545314e+26 + kineng 0 2.0470929988e+24 + soundspeed 612864631.35 895226075.34 + Gamma_1 1.3599756433 1.381960389 + MachNumber 0 0.16110289957 + uplusc 612864631.35 999987726.83 + uminusc -895226515.48 -612861097.59 + entropy 98214771.47 336273485.1 magvort 0 0 - divu -97902.982158 33744.686211 - eint_E 6.5312369121e+17 1.3804344246e+18 - eint_e 6.5312369121e+17 1.3804344246e+18 - logden 8.267780753 8.3357372357 - StateErr_0 185259613.21 216639295.98 - StateErr_1 50000004.458 7845854782 + divu -97832.499193 33854.491885 + eint_E 6.5312369121e+17 1.3804344055e+18 + eint_e 6.5312369121e+17 1.3804344055e+18 + logden 8.2677816769 8.3356661897 + StateErr_0 185260007.35 216603859.01 + StateErr_1 50000004.458 7845854705.7 StateErr_2 1e-30 9.9999779304e-11 X(H1) 1e-30 9.9999779304e-11 - X(He3) 8.9859771063e-12 9.9999601234e-11 - X(He4) 0.48406305162 0.9999999982 - X(C12) 1.0000000106e-10 0.10016992833 - X(N14) 1e-30 1.0000000525e-10 - X(O16) 9.999999998e-11 9.6047401986e-05 - X(Ne20) 9.999999998e-11 4.5902903915e-05 - X(Mg24) 9.999999998e-11 0.00011109993006 - X(Si28) 9.999999998e-11 0.010051430746 - X(S32) 9.999999998e-11 0.0083423100958 - X(Ar36) 9.999999998e-11 0.004162785426 - X(Ca40) 9.999999998e-11 0.0037083550771 - X(Ti44) 9.999999998e-11 0.00017290662768 - X(Cr48) 9.999999998e-11 0.00040059772358 - X(Fe52) 9.999999998e-11 0.001337522714 - X(Fe54) 9.999999998e-11 0.46488979858 - X(Ni56) 9.999999998e-11 0.010324644421 - X(n) 1e-30 0.0011729007238 - X(p) 9.9999977087e-11 0.017592929732 - abar 4.000000001 6.7312458561 - Ye 0.49998677577 0.50001556472 - x_velocity -381.82392939 138572160.27 + X(He3) 8.9859545625e-12 9.9999601234e-11 + X(He4) 0.48404147545 0.9999999982 + X(C12) 1.0000000106e-10 0.099684649962 + X(N14) 1e-30 1.0000000376e-10 + X(O16) 9.999999998e-11 9.604736089e-05 + X(Ne20) 9.999999998e-11 1.5796271283e-05 + X(Mg24) 9.999999998e-11 0.00011117769044 + X(Si28) 9.999999998e-11 0.010055309829 + X(S32) 9.999999998e-11 0.0083464912692 + X(Ar36) 9.999999998e-11 0.0041653171252 + X(Ca40) 9.999999998e-11 0.0037092925282 + X(Ti44) 9.999999998e-11 0.00017295237305 + X(Cr48) 9.999999998e-11 0.00040072134633 + X(Fe52) 9.999999998e-11 0.0013379984809 + X(Fe54) 9.999999998e-11 0.46490189727 + X(Ni56) 9.999999998e-11 0.010343642304 + X(n) 1e-30 0.001172900562 + X(p) 9.9999976982e-11 0.017595041218 + abar 4.000000001 6.7313807923 + Ye 0.49998670441 0.50001557764 + x_velocity -477.39024664 138675067.71 y_velocity 0 0 z_velocity 0 0 - t_sound_t_enuc 3.4412406672e-13 0.97497430527 - enuc -2.4944881551e+21 1.6522384906e+24 - magvel 0 138572160.27 - radvel -381.82392939 138572160.27 + t_sound_t_enuc 3.4412406672e-13 0.97457997209 + enuc -2.4932951549e+21 1.6512812749e+24 + magvel 0 138675067.71 + radvel -477.39024664 138675067.71 circvel 0 2 - magmom 0 2.9487648003e+16 + magmom 0 2.952359112e+16 angular_momentum_x 0 0 angular_momentum_y 0 0 angular_momentum_z 0 0 diff --git a/Exec/science/wdmerger/ci-benchmarks/wdmerger_collision_2D.out b/Exec/science/wdmerger/ci-benchmarks/wdmerger_collision_2D.out index a933d102df..583ca7a221 100644 --- a/Exec/science/wdmerger/ci-benchmarks/wdmerger_collision_2D.out +++ b/Exec/science/wdmerger/ci-benchmarks/wdmerger_collision_2D.out @@ -1,29 +1,29 @@ plotfile = plt00095 time = 1.25 variables minimum value maximum value - density 8.7136176158e-05 13348283.786 - xmom -4.4636648292e+14 1.4969028735e+15 - ymom -1.8931343553e+15 1.9807937913e+15 + density 8.7135998023e-05 13349624.654 + xmom -4.4629220454e+14 1.4948722092e+15 + ymom -1.8932804713e+15 1.9800362776e+15 zmom 0 0 - rho_E 7.7947390767e+11 5.6568077669e+24 - rho_e 7.4321344551e+11 5.6343409475e+24 - Temp 100000 3972527783.9 - rho_He4 8.7136176158e-17 1473.9666386 - rho_C12 3.4854470463e-05 5030539.1488 - rho_O16 5.2281705694e-05 7778301.6377 - rho_Ne20 8.7136176158e-17 1023673.1153 - rho_Mg24 8.7136176158e-17 1040419.2782 - rho_Si28 8.7136176158e-17 4251082.0739 - rho_S32 8.7136176158e-17 2179431.2961 - rho_Ar36 8.7136176158e-17 497747.48798 - rho_Ca40 8.7136176158e-17 382056.037 - rho_Ti44 8.7136176158e-17 1576.0930955 - rho_Cr48 8.7136176158e-17 1467.9139369 - rho_Fe52 8.7136176158e-17 14831.710059 - rho_Ni56 8.7136176158e-17 182702.27304 - phiGrav -4.6147467267e+17 -2.2055818332e+16 - grav_x -461195258.85 -48603.568291 - grav_y -444709392.81 392306861.64 + rho_E 7.7947791091e+11 5.6312993863e+24 + rho_e 7.4321769431e+11 5.6091061285e+24 + Temp 100000 3973709195.6 + rho_He4 8.7135998023e-17 1471.0785014 + rho_C12 3.4854399209e-05 5032772.3673 + rho_O16 5.2281598813e-05 7783080.7527 + rho_Ne20 8.7135998023e-17 1161332.3207 + rho_Mg24 8.7135998023e-17 911291.08467 + rho_Si28 8.7135998023e-17 4232085.8582 + rho_S32 8.7135998023e-17 2178683.3718 + rho_Ar36 8.7135998023e-17 497876.89184 + rho_Ca40 8.7135998023e-17 382091.02967 + rho_Ti44 8.7135998023e-17 1576.9103687 + rho_Cr48 8.7135998023e-17 1467.9934268 + rho_Fe52 8.7135998023e-17 14829.058965 + rho_Ni56 8.7135998023e-17 182703.46769 + phiGrav -4.6147569719e+17 -2.2055818436e+16 + grav_x -461192616.69 -48603.579942 + grav_y -444702950.05 392305631.78 grav_z 0 0 - rho_enuc -7.6356851771e+21 5.7259582003e+26 + rho_enuc -7.53321893e+21 4.9655988047e+26 From da3e4b7d916dc2242e5a22d137b6bf9fe4efc75f Mon Sep 17 00:00:00 2001 From: Max Katz Date: Thu, 2 Nov 2023 12:45:50 -0400 Subject: [PATCH 2/7] Convert RadInterpBndryData routines to C++ (#2638) This PR combines the six boundary interpolation routines into one loop. The loop structure is designed in such a way that all six 2D faces are automatically recoverable, even though we write it as if it is 3D. --- Source/radiation/_interpbndry/Make.package | 4 - .../_interpbndry/RADINTERPBNDRYDATA_F.H | 186 ----- .../_interpbndry/RadInterpBndryData.cpp | 264 ++++-- .../_interpbndry/RadInterpBndryData_1d.F90 | 106 --- .../_interpbndry/RadInterpBndryData_2d.F90 | 351 -------- .../_interpbndry/RadInterpBndryData_3d.F90 | 753 ------------------ 6 files changed, 218 insertions(+), 1446 deletions(-) delete mode 100644 Source/radiation/_interpbndry/RADINTERPBNDRYDATA_F.H delete mode 100644 Source/radiation/_interpbndry/RadInterpBndryData_1d.F90 delete mode 100644 Source/radiation/_interpbndry/RadInterpBndryData_2d.F90 delete mode 100644 Source/radiation/_interpbndry/RadInterpBndryData_3d.F90 diff --git a/Source/radiation/_interpbndry/Make.package b/Source/radiation/_interpbndry/Make.package index 28b5c8ac99..5120ca1ec5 100644 --- a/Source/radiation/_interpbndry/Make.package +++ b/Source/radiation/_interpbndry/Make.package @@ -4,7 +4,3 @@ CA_BASE=EXE C$(CA_BASE)_sources += RadInterpBndryData.cpp RadBndryData.cpp C$(CA_BASE)_headers += RadInterpBndryData.H RadBndryData.H RadBoundCond.H - -ca_F90$(CA_BASE)_sources += RadInterpBndryData_$(DIM)d.F90 - -ca_F$(CA_BASE)_headers += RADINTERPBNDRYDATA_F.H diff --git a/Source/radiation/_interpbndry/RADINTERPBNDRYDATA_F.H b/Source/radiation/_interpbndry/RADINTERPBNDRYDATA_F.H deleted file mode 100644 index bed644330a..0000000000 --- a/Source/radiation/_interpbndry/RADINTERPBNDRYDATA_F.H +++ /dev/null @@ -1,186 +0,0 @@ -#ifndef CASTRO_RADINTERPBNDRY_F_H -#define CASTRO_RADINTERPBNDRY_F_H - -/*************************************************************/ - -#if defined(RAD_INTERP) - -#if defined(BL_LANG_FORT) - -# define FORT_BDINTERPXLO bdintrpxlo2 -# define FORT_BDINTERPXHI bdintrpxhi2 -# if (AMREX_SPACEDIM > 1) -# define FORT_BDINTERPYLO bdintrpylo2 -# define FORT_BDINTERPYHI bdintrpyhi2 -# endif -# if (AMREX_SPACEDIM > 2) -# define FORT_BDINTERPZLO bdintrpzlo2 -# define FORT_BDINTERPZHI bdintrpzhi2 -# endif - -#else - -#if defined(BL_FORT_USE_LOWERCASE) -# define FORT_BDINTERPXLO bdintrpxlo2 -# define FORT_BDINTERPXHI bdintrpxhi2 -# if (AMREX_SPACEDIM > 1) -# define FORT_BDINTERPYLO bdintrpylo2 -# define FORT_BDINTERPYHI bdintrpyhi2 -# endif -# if (AMREX_SPACEDIM > 2) -# define FORT_BDINTERPZLO bdintrpzlo2 -# define FORT_BDINTERPZHI bdintrpzhi2 -# endif -#elif defined(BL_FORT_USE_UPPERCASE) -# define FORT_BDINTERPXLO BDINTRPXLO2 -# define FORT_BDINTERPXHI BDINTRPXHI2 -# if (AMREX_SPACEDIM > 1) -# define FORT_BDINTERPYLO BDINTRPYLO2 -# define FORT_BDINTERPYHI BDINTRPYHI2 -# endif -# if (AMREX_SPACEDIM > 2) -# define FORT_BDINTERPZLO BDINTRPZLO2 -# define FORT_BDINTERPZHI BDINTRPZHI2 -# endif -#elif defined(BL_FORT_USE_UNDERSCORE) -# define FORT_BDINTERPXLO bdintrpxlo2_ -# define FORT_BDINTERPXHI bdintrpxhi2_ -# if (AMREX_SPACEDIM > 1) -# define FORT_BDINTERPYLO bdintrpylo2_ -# define FORT_BDINTERPYHI bdintrpyhi2_ -# endif -# if (AMREX_SPACEDIM > 2) -# define FORT_BDINTERPZLO bdintrpzlo2_ -# define FORT_BDINTERPZHI bdintrpzhi2_ -# endif -#endif - -#include - -typedef void BDInterpFunc(amrex::Real* bndr, ARLIM_P(blo), ARLIM_P(bhi), - const int* lo, const int* hi, - ARLIM_P(cblo), ARLIM_P(cbhi), - const int* nvar, const int* ratio, - const int* not_covered, - const int* mask, ARLIM_P(mlo), ARLIM_P(mhi), - const amrex::Real* crse, ARLIM_P(clo), ARLIM_P(chi), - amrex::Real* derives); -#ifdef __cplusplus -extern "C" -{ -#endif - - BDInterpFunc FORT_BDINTERPXLO; - BDInterpFunc FORT_BDINTERPXHI; - -#if (AMREX_SPACEDIM > 1) - BDInterpFunc FORT_BDINTERPYLO; - BDInterpFunc FORT_BDINTERPYHI; -#endif - -#if (AMREX_SPACEDIM > 2) - BDInterpFunc FORT_BDINTERPZLO; - BDInterpFunc FORT_BDINTERPZHI; -#endif -#ifdef __cplusplus -} -#endif - -#endif - -/*************************************************************/ - -#else /*RAD_INTERP*/ - -/*************************************************************/ - -#if defined(BL_LANG_FORT) - -# define FORT_BDINTERPXLO bdintrpxlo -# define FORT_BDINTERPXHI bdintrpxhi -# if (AMREX_SPACEDIM > 1) -# define FORT_BDINTERPYLO bdintrpylo -# define FORT_BDINTERPYHI bdintrpyhi -# endif -# if (AMREX_SPACEDIM > 2) -# define FORT_BDINTERPZLO bdintrpzlo -# define FORT_BDINTERPZHI bdintrpzhi -# endif - -#else - -#if defined(BL_FORT_USE_LOWERCASE) -# define FORT_BDINTERPXLO bdintrpxlo -# define FORT_BDINTERPXHI bdintrpxhi -# if (AMREX_SPACEDIM > 1) -# define FORT_BDINTERPYLO bdintrpylo -# define FORT_BDINTERPYHI bdintrpyhi -# endif -# if (AMREX_SPACEDIM > 2) -# define FORT_BDINTERPZLO bdintrpzlo -# define FORT_BDINTERPZHI bdintrpzhi -# endif -#elif defined(BL_FORT_USE_UPPERCASE) -# define FORT_BDINTERPXLO BDINTRPXLO -# define FORT_BDINTERPXHI BDINTRPXHI -# if (AMREX_SPACEDIM > 1) -# define FORT_BDINTERPYLO BDINTRPYLO -# define FORT_BDINTERPYHI BDINTRPYHI -# endif -# if (AMREX_SPACEDIM > 2) -# define FORT_BDINTERPZLO BDINTRPZLO -# define FORT_BDINTERPZHI BDINTRPZHI -# endif -#elif defined(BL_FORT_USE_UNDERSCORE) -# define FORT_BDINTERPXLO bdintrpxlo_ -# define FORT_BDINTERPXHI bdintrpxhi_ -# if (AMREX_SPACEDIM > 1) -# define FORT_BDINTERPYLO bdintrpylo_ -# define FORT_BDINTERPYHI bdintrpyhi_ -# endif -# if (AMREX_SPACEDIM > 2) -# define FORT_BDINTERPZLO bdintrpzlo_ -# define FORT_BDINTERPZHI bdintrpzhi_ -# endif -#endif - -#include - -typedef void BDInterpFunc(amrex::Real* bndr, ARLIM_P(blo), ARLIM_P(bhi), - const int* lo, const int* hi, - ARLIM_P(cblo), ARLIM_P(cbhi), - const int* nvar, const int* ratio, - const int* not_covered, - const int* mask, ARLIM_P(mlo), ARLIM_P(mhi), - const amrex::Real* crse, ARLIM_P(clo), ARLIM_P(chi), - amrex::Real* derives); -#ifdef __cplusplus -extern "C" -{ -#endif - - BDInterpFunc FORT_BDINTERPXLO; - BDInterpFunc FORT_BDINTERPXHI; - -#if (AMREX_SPACEDIM > 1) - BDInterpFunc FORT_BDINTERPYLO; - BDInterpFunc FORT_BDINTERPYHI; -#endif - -#if (AMREX_SPACEDIM > 2) - BDInterpFunc FORT_BDINTERPZLO; - BDInterpFunc FORT_BDINTERPZHI; -#endif -#ifdef __cplusplus -} -#endif - -#endif - -/*************************************************************/ - -#endif /*RAD_INTERP*/ - -/*************************************************************/ - -#endif diff --git a/Source/radiation/_interpbndry/RadInterpBndryData.cpp b/Source/radiation/_interpbndry/RadInterpBndryData.cpp index 2e24aa7061..8161eecaf6 100644 --- a/Source/radiation/_interpbndry/RadInterpBndryData.cpp +++ b/Source/radiation/_interpbndry/RadInterpBndryData.cpp @@ -2,35 +2,9 @@ #include #include #include -#include using namespace amrex; -static BDInterpFunc* bdfunc[2*AMREX_SPACEDIM]; -static int bdfunc_set = 0; - -static void bdfunc_init() -{ - Orientation xloface(0,Orientation::low); - Orientation xhiface(0,Orientation::high); - - bdfunc[xloface] = FORT_BDINTERPXLO; - bdfunc[xhiface] = FORT_BDINTERPXHI; -#if (AMREX_SPACEDIM > 1) - Orientation yloface(1,Orientation::low); - Orientation yhiface(1,Orientation::high); - bdfunc[yloface] = FORT_BDINTERPYLO; - bdfunc[yhiface] = FORT_BDINTERPYHI; -#endif -#if (AMREX_SPACEDIM > 2) - Orientation zloface(2,Orientation::low); - Orientation zhiface(2,Orientation::high); - bdfunc[zloface] = FORT_BDINTERPZLO; - bdfunc[zhiface] = FORT_BDINTERPZHI; -#endif - -} - #if (AMREX_SPACEDIM == 2) #define NUMDERIV 2 #endif @@ -111,8 +85,6 @@ RadInterpBndryData::setBndryValues(BndryRegister& crse, int c_start, int bnd_start, int num_comp, IntVect& ratio, const BCRec& bc) { - if (! bdfunc_set) bdfunc_init(); - // check that boxarrays are identical BL_ASSERT( grids.size() ); BL_ASSERT( grids == fine.boxArray() ); @@ -131,8 +103,8 @@ RadInterpBndryData::setBndryValues(BndryRegister& crse, int c_start, int grd = mfi.index(); const Box& fine_bx = grids[grd]; Box crse_bx = amrex::coarsen(fine_bx,ratio); - const int* cblo = crse_bx.loVect(); - const int* cbhi = crse_bx.hiVect(); + auto cblo = crse_bx.loVect3d(); + auto cbhi = crse_bx.hiVect3d(); int mxlen = crse_bx.longside() + 2; if (pow(mxlen,(float)AMREX_SPACEDIM-1) > tmplen) { delete [] derives; @@ -146,8 +118,8 @@ RadInterpBndryData::setBndryValues(BndryRegister& crse, int c_start, derives = new Real[tmplen*NUMDERIV]; #endif } - const int* lo = fine_bx.loVect(); - const int* hi = fine_bx.hiVect(); + auto lo = fine_bx.loVect3d(); + auto hi = fine_bx.hiVect3d(); const FArrayBox& fine_grd = fine[mfi]; for (OrientationIter fi; fi; ++fi) { @@ -157,26 +129,226 @@ RadInterpBndryData::setBndryValues(BndryRegister& crse, int c_start, geom.isPeriodic(dir)) { // internal or periodic edge, interpolate from crse data const Mask& mask = *masks[face][grd]; - const int* mlo = mask.loVect(); - const int* mhi = mask.hiVect(); - const int* mdat = mask.dataPtr(); + Array4 const mask_arr = mask.array(); const FArrayBox& crse_fab = crse[face][mfi]; - const int* clo = crse_fab.loVect(); - const int* chi = crse_fab.hiVect(); - const Real* cdat = crse_fab.dataPtr(c_start); + Array4 const crse_arr = crse_fab.array(c_start); + + int clo[3], chi[3], flo[3], fhi[3]; + + for (int d = 0; d < 3; ++d) { + clo[d] = cblo[d]; + chi[d] = cbhi[d]; + flo[d] = lo[d]; + fhi[d] = hi[d]; + + // For the face we're operating on, we want to make + // sure that we're only operating on the ghost zone + // immediately adjacent to the boundary. + + if (d == dir) { + if (face.isLow()) { + clo[d] -= 1; + flo[d] -= 1; + chi[d] = clo[d]; + fhi[d] = flo[d]; + } + else { + chi[d] += 1; + fhi[d] += 1; + clo[d] = chi[d]; + flo[d] = fhi[d]; + } + } + } + + int ratiox = 1; + int ratioy = 1; + int ratioz = 1; + + if (dir != 0) { + ratiox = ratio[0]; + } + +#if AMREX_SPACEDIM >= 2 + if (dir != 1) { + ratioy = ratio[1]; + } +#endif + +#if AMREX_SPACEDIM == 3 + if (dir != 2) { + ratioz = ratio[2]; + } +#endif FArrayBox& bnd_fab = bndry[face][mfi]; - const int* blo = bnd_fab.loVect(); - const int* bhi = bnd_fab.hiVect(); - Real* bdat = bnd_fab.dataPtr(bnd_start); + Array4 const bdry = bnd_fab.array(bnd_start); int is_not_covered = RadBndryData::not_covered; - bdfunc[face](bdat,ARLIM(blo),ARLIM(bhi), - lo,hi,ARLIM(cblo),ARLIM(cbhi), - &num_comp,ratio.getVect(),&is_not_covered, - mdat,ARLIM(mlo),ARLIM(mhi), - cdat,ARLIM(clo),ARLIM(chi),derives); + + for (int n = 0; n < num_comp; ++n) { + + // Note that only two of these three loops will do something + // nontrivial, depending on which face we are working on. + + for (int kc = clo[2]; kc <= chi[2]; ++kc) { + int k = (dir == 2) ? flo[2] : ratioz * kc; + + for (int jc = clo[1]; jc <= chi[1]; ++jc) { + int j = (dir == 1) ? flo[1] : ratioy * jc; + + for (int ic = clo[0]; ic <= chi[0]; ++ic) { + int i = (dir == 0) ? flo[0] : ratiox * ic; + + Real dcdx = 0.0_rt; + Real dcdy = 0.0_rt; + Real dcdz = 0.0_rt; + + Real dcdx2 = 0.0_rt; + Real dcdy2 = 0.0_rt; + Real dcdz2 = 0.0_rt; + + Real dcdxy = 0.0_rt; + Real dcdxz = 0.0_rt; + Real dcdyz = 0.0_rt; + + if (dir != 0) { + dcdx = 0.5_rt * (crse_arr(ic+1,jc,kc,n) - crse_arr(ic-1,jc,kc,n)); + dcdx2 = 0.5_rt * (crse_arr(ic+1,jc,kc,n) - 2.0_rt * crse_arr(ic,jc,kc,n) + crse_arr(ic-1,jc,kc,n)); + } + +#if AMREX_SPACEDIM >= 2 + if (dir != 1) { + dcdy = 0.5_rt * (crse_arr(ic,jc+1,kc,n) - crse_arr(ic,jc-1,kc,n)); + dcdy2 = 0.5_rt * (crse_arr(ic,jc+1,kc,n) - 2.0_rt * crse_arr(ic,jc,kc,n) + crse_arr(ic,jc-1,kc,n)); + } +#endif + +#if AMREX_SPACEDIM == 3 + if (dir != 2) { + dcdz = 0.5_rt * (crse_arr(ic,jc,kc+1,n) - crse_arr(ic,jc,kc-1,n)); + dcdz2 = 0.5_rt * (crse_arr(ic,jc,kc+1,n) - 2.0_rt * crse_arr(ic,jc,kc,n) + crse_arr(ic,jc,kc-1,n)); + } +#endif + +#if AMREX_SPACEDIM == 3 + if (dir == 0) { + dcdyz = 0.25_rt * (crse_arr(ic,jc+1,kc+1,n) - crse_arr(ic,jc-1,kc+1,n) + + crse_arr(ic,jc-1,kc-1,n) - crse_arr(ic,jc+1,kc-1,n)); + } + + if (dir == 1) { + dcdxz = 0.25_rt * (crse_arr(ic+1,jc,kc+1,n) - crse_arr(ic-1,jc,kc+1,n) + + crse_arr(ic-1,jc,kc-1,n) - crse_arr(ic+1,jc,kc-1,n)); + } + + if (dir == 2) { + dcdxy = 0.25_rt * (crse_arr(ic+1,jc+1,kc,n) - crse_arr(ic-1,jc+1,kc,n) + + crse_arr(ic-1,jc-1,kc,n) - crse_arr(ic+1,jc-1,kc,n)); + } +#endif + + if (dir != 0) { + if (mask_arr(i-1,j,k) != is_not_covered) { + dcdx = crse_arr(ic+1,jc,kc,n) - crse_arr(ic,jc,kc,n); + dcdx2 = 0.0_rt; + } + if (mask_arr(i+ratiox,j,k) != is_not_covered) { + dcdx = crse_arr(ic,jc,kc,n) - crse_arr(ic-1,jc,kc,n); + dcdx2 = 0.0_rt; + } + if (mask_arr(i-1,j,k) != is_not_covered && mask_arr(i+ratiox,j,k) != is_not_covered) { + dcdx = 0.0_rt; + } + } + +#if AMREX_SPACEDIM >= 2 + if (dir != 1) { + if (mask_arr(i,j-1,k) != is_not_covered) { + dcdy = crse_arr(ic,jc+1,kc,n) - crse_arr(ic,jc,kc,n); + dcdy2 = 0.0_rt; + } + if (mask_arr(i,j+ratioy,k) != is_not_covered) { + dcdy = crse_arr(ic,jc,kc,n) - crse_arr(ic,jc-1,kc,n); + dcdy2 = 0.0_rt; + } + if (mask_arr(i,j-1,k) != is_not_covered && mask_arr(i,j+ratioy,k) != is_not_covered) { + dcdy = 0.0_rt; + } + } +#endif + +#if AMREX_SPACEDIM == 3 + if (dir != 2) { + if (mask_arr(i,j,k-1) != is_not_covered) { + dcdz = crse_arr(ic,jc,kc+1,n) - crse_arr(ic,jc,kc,n); + dcdz2 = 0.0_rt; + } + if (mask_arr(i,j,k+ratioz) != is_not_covered) { + dcdz = crse_arr(ic,jc,kc,n) - crse_arr(ic,jc,kc-1,n); + dcdz2 = 0.0_rt; + } + if (mask_arr(i,j,k-1) != is_not_covered && mask_arr(i,j,k+ratioz) != is_not_covered) { + dcdz = 0.0_rt; + } + } +#endif + +#if AMREX_SPACEDIM == 3 + if (dir == 0) { + if ((mask_arr(i,j+ratioy,k+ratioz) != is_not_covered) || + (mask_arr(i,j-1 ,k+ratioz) != is_not_covered) || + (mask_arr(i,j+ratioy,k-1 ) != is_not_covered) || + (mask_arr(i,j-1 ,k-1 ) != is_not_covered)) { + dcdyz = 0.0_rt; + } + } + + if (dir == 1) { + if ((mask_arr(i+ratiox,j,k+ratioz) != is_not_covered) || + (mask_arr(i-1 ,j,k+ratioz) != is_not_covered) || + (mask_arr(i+ratiox,j,k-1 ) != is_not_covered) || + (mask_arr(i-1 ,j,k-1 ) != is_not_covered)) { + dcdxz = 0.0_rt; + } + } + + if (dir == 2) { + if ((mask_arr(i+ratiox,j+ratioy,k) != is_not_covered) || + (mask_arr(i-1 ,j+ratioy,k) != is_not_covered) || + (mask_arr(i+ratiox,j-1 ,k) != is_not_covered) || + (mask_arr(i-1 ,j-1 ,k) != is_not_covered)) { + dcdxy = 0.0_rt; + } + } +#endif + + for (int koff = 0; koff < ratioz; ++koff) { + Real zz = (koff - 0.5_rt * ratioz + 0.5_rt) / ratioz; + int kk = (dir == 2) ? flo[2] : ratioz * kc + koff; + + for (int joff = 0; joff < ratioy; ++joff) { + Real yy = (joff - 0.5_rt * ratioy + 0.5_rt) / ratioy; + int jj = (dir == 1) ? flo[1] : ratioy * jc + joff; + + for (int ioff = 0; ioff < ratiox; ++ioff) { + Real xx = (ioff - 0.5_rt * ratiox + 0.5_rt) / ratiox; + int ii = (dir == 0) ? flo[0] : ratiox * ic + ioff; + + bdry(ii,jj,kk,n) = crse_arr(ic,jc,kc,n) + + xx * dcdx + xx * xx * dcdx2 + + yy * dcdy + yy * yy * dcdy2 + + zz * dcdz + zz * zz * dcdz2 + + xx * yy * dcdxy + xx * zz * dcdxz + yy * zz * dcdyz; + } + } + } + } + } + } + + } // num_comp } else { // physical bndry, copy from ghost region of // corresponding grid diff --git a/Source/radiation/_interpbndry/RadInterpBndryData_1d.F90 b/Source/radiation/_interpbndry/RadInterpBndryData_1d.F90 deleted file mode 100644 index 293d146038..0000000000 --- a/Source/radiation/_interpbndry/RadInterpBndryData_1d.F90 +++ /dev/null @@ -1,106 +0,0 @@ -#include -#include -#include -#include -#include - -#define SDIM 1 - -! --------------------------------------------------------------- -! :: FORT_BDINTERPXLO : Interpolation on Xlo Face -! :: Quadratic Interpolation from crse data -! :: in directions transverse to face of grid -! :: -! :: Inputs/Outputs: -! :: bdry <= fine grid bndry data strip -! :: DIMS(bdry) => index limits of bdry -! :: lo,hi => index limits of grd interior -! :: DIMS(cb) => index limits of coarsened grid interior -! :: nvar => number of variables to interpolate -! :: ratios(2) => refinement ratios -! :: not_covered => mask is set to this value if cell is not -! :: covered by another fine grid and not outside the domain. -! :: mask => fine grid mask bndry strip -! :: DIMS(mask) => index limits of mask array -! :: crse => crse grid bndry data strip -! :: DIMS(crse) => index limits of crse array -! :: derives => crse grid tmp array -! --------------------------------------------------------------- - -subroutine FORT_BDINTERPXLO(bdry,DIMS(bdry), & - lo,hi,DIMS(cb),nvar,ratios,not_covered, & - mask,DIMS(mask),crse,DIMS(crse),derives) - - integer nvar, ratios(2), not_covered - integer lo(SDIM), hi(SDIM) - integer DIMDEC(bdry) - integer DIMDEC(mask) - integer DIMDEC(crse) - integer DIMDEC(cb) - REAL_T bdry(DIMV(bdry),nvar) - REAL_T derives(1) - integer mask(DIMV(mask)) - REAL_T crse(DIMV(crse),nvar) - - integer i, ic, n - - ic = ARG_L1(cb)-1 - i = lo(1)-1 - - do n = 1, nvar - ! interpolate to fine grid - bdry(i,n) = crse(ic,n) - enddo - - return -end subroutine FORT_BDINTERPXLO - - -! --------------------------------------------------------------- -! :: FORT_BDINTERPXHI : Interpolation on Xhi Face -! :: Quadratic Interpolation from crse data -! :: in directions transverse to face of grid -! :: -! :: Inputs/Outputs: -! :: bdry <= fine grid bndry data strip -! :: DIMS(bdry) => index limits of bdry -! :: lo,hi => index limits of grd interior -! :: DIMS(cb) => index limits of coarsened grid interior -! :: nvar => number of variables to interpolate -! :: ratios(2) => refinement ratios -! :: not_covered => mask is set to this value if cell is not -! :: covered by another fine grid and not outside the domain. -! :: mask => fine grid mask bndry strip -! :: DIMS(mask) => index limits of mask array -! :: crse => crse grid bndry data strip -! :: DIMS(crse) => index limits of crse array -! :: derives => crse grid tmp array -! --------------------------------------------------------------- - -subroutine FORT_BDINTERPXHI (bdry,DIMS(bdry), & - lo,hi,DIMS(cb),nvar,ratios,not_covered, & - mask,DIMS(mask),crse,DIMS(crse),derives) - - integer nvar, ratios(2), not_covered - integer lo(SDIM), hi(SDIM) - integer DIMDEC(bdry) - integer DIMDEC(mask) - integer DIMDEC(cb) - integer DIMDEC(crse) - REAL_T bdry(DIMV(bdry),nvar) - REAL_T derives(1) - integer mask(DIMV(mask)) - REAL_T crse(DIMV(crse),nvar) - - integer i, ic, n - - ic = ARG_H1(cb)+1 - i = hi(1)+1 - - do n = 1, nvar - ! interpolate to fine grid - bdry(i,n) = crse(ic,n) - enddo - - return -end subroutine FORT_BDINTERPXHI diff --git a/Source/radiation/_interpbndry/RadInterpBndryData_2d.F90 b/Source/radiation/_interpbndry/RadInterpBndryData_2d.F90 deleted file mode 100644 index e2198b178a..0000000000 --- a/Source/radiation/_interpbndry/RadInterpBndryData_2d.F90 +++ /dev/null @@ -1,351 +0,0 @@ -#include -#include -#include -#include -#include - -#define SDIM 2 -#define NUMDERIV 2 -#define XDER 1 -#define X2DER 2 - - -! --------------------------------------------------------------- -! :: FORT_BDINTERPXLO : Interpolation on Xlo Face -! :: Quadratic Interpolation from crse data -! :: in directions transverse to face of grid -! :: -! :: Inputs/Outputs: -! :: bdry <= fine grid bndry data strip -! :: DIMS(bdry) => index limits of bdry -! :: lo,hi => index limits of grd interior -! :: DIMS(cb) => index limits of coarsened grid interior -! :: nvar => number of variables to interpolate -! :: ratios(2) => refinement ratios -! :: not_covered => mask is set to this value if cell is not -! :: covered by another fine grid and not outside the domain. -! :: mask => fine grid mask bndry strip -! :: DIMS(mask) => index limits of mask array -! :: crse => crse grid bndry data strip -! :: DIMS(crse) => index limits of crse array -! :: derives => crse grid tmp array -! --------------------------------------------------------------- - -subroutine FORT_BDINTERPXLO (bdry,DIMS(bdry), & - lo,hi,DIMS(cb),nvar,ratios,not_covered, & - mask,DIMS(mask),crse,DIMS(crse),derives) - - integer nvar, ratios(2), not_covered - integer lo(SDIM), hi(SDIM) - integer DIMDEC(bdry) - integer DIMDEC(mask) - integer DIMDEC(crse) - integer DIMDEC(cb) - REAL_T bdry(DIMV(bdry),nvar) - REAL_T derives(DIM2(cb),NUMDERIV) - integer mask(DIMV(mask)) - REAL_T crse(DIMV(crse),nvar) - - REAL_T xx, ainterp - integer i, j, ic, jc, off, n - integer jclo, jchi, ratioy - - ratioy = ratios(2) - - jclo = ARG_L2(cb) - jchi = ARG_H2(cb) - ic = ARG_L1(cb)-1 - i = lo(1)-1 - - do n = 1, nvar - ! define interp coefs - do jc = jclo, jchi - j = ratioy*jc - derives(jc,XDER) = half * (crse(ic,jc+1,n) - crse(ic,jc-1,n)) - derives(jc,X2DER) = half * (crse(ic,jc+1,n) & - - crse(ic,jc ,n) * two & - + crse(ic,jc-1,n)) - - if (mask(i,j-1) .ne. not_covered) then - derives(jc,XDER) = crse(ic,jc+1,n) - crse(ic,jc ,n) - derives(jc,X2DER) = zero - endif - if (mask(i,j+ratioy) .ne. not_covered) then - derives(jc,XDER) = crse(ic,jc ,n) - crse(ic,jc-1,n) - derives(jc,X2DER) = zero - endif - if (mask(i,j-1) .ne. not_covered .and. & - mask(i,j+ratioy) .ne. not_covered) then - derives(jc,XDER) = zero - endif - enddo - - ! interpolate to fine grid - do off = 0, ratioy - 1 - xx = (off - half * ratioy + half)/ratioy - do jc = jclo, jchi - j = ratioy*jc + off - bdry(i,j,n) = crse(ic,jc,n) & - + derives(jc,XDER) *xx & - + derives(jc,X2DER)*xx**2 - enddo - enddo - enddo - - return -end subroutine FORT_BDINTERPXLO - - -! --------------------------------------------------------------- -! :: FORT_BDINTERPXHI : Interpolation on Xhi Face -! :: Quadratic Interpolation from crse data -! :: in directions transverse to face of grid -! :: -! :: Inputs/Outputs: -! :: bdry <= fine grid bndry data strip -! :: DIMS(bdry) => index limits of bdry -! :: lo,hi => index limits of grd interior -! :: DIMS(cb) => index limits of coarsened grid interior -! :: nvar => number of variables to interpolate -! :: ratios(2) => refinement ratios -! :: not_covered => mask is set to this value if cell is not -! :: covered by another fine grid and not outside the domain. -! :: mask => fine grid mask bndry strip -! :: DIMS(mask) => index limits of mask array -! :: crse => crse grid bndry data strip -! :: DIMS(crse) => index limits of crse array -! :: derives => crse grid tmp array -! --------------------------------------------------------------- - -subroutine FORT_BDINTERPXHI (bdry,DIMS(bdry), & - lo,hi,DIMS(cb),nvar,ratios,not_covered, & - mask,DIMS(mask),crse,DIMS(crse),derives) - - integer nvar, ratios(2), not_covered - integer lo(SDIM), hi(SDIM) - integer DIMDEC(bdry) - integer DIMDEC(mask) - integer DIMDEC(cb) - integer DIMDEC(crse) - REAL_T bdry(DIMV(bdry),nvar) - REAL_T derives(DIM2(cb),NUMDERIV) - integer mask(DIMV(mask)) - REAL_T crse(DIMV(crse),nvar) - - REAL_T xx, ainterp - integer i, j, ic, jc, off, n - integer jclo, jchi, ratioy - - ratioy = ratios(2) - - jclo = ARG_L2(cb) - jchi = ARG_H2(cb) - ic = ARG_H1(cb)+1 - i = hi(1)+1 - - do n = 1, nvar - ! define interp coefs - do jc = jclo, jchi - j = ratioy*jc - derives(jc,XDER) = half * (crse(ic,jc+1,n) - crse(ic,jc-1,n)) - derives(jc,X2DER) = half * (crse(ic,jc+1,n) & - - crse(ic,jc ,n) * two & - + crse(ic,jc-1,n)) - - if (mask(i,j-1) .ne. not_covered) then - derives(jc,XDER) = crse(ic,jc+1,n) - crse(ic,jc ,n) - derives(jc,X2DER) = zero - endif - if (mask(i,j+ratioy) .ne. not_covered) then - derives(jc,XDER) = crse(ic,jc ,n) - crse(ic,jc-1,n) - derives(jc,X2DER) = zero - endif - if (mask(i,j-1) .ne. not_covered .and. & - mask(i,j+ratioy) .ne. not_covered) then - derives(jc,XDER) = zero - endif - enddo - - ! interpolate to fine grid - do off = 0, ratioy - 1 - xx = (off - half * ratioy + half)/ratioy - do jc = jclo, jchi - j = ratioy*jc + off - bdry(i,j,n) = crse(ic,jc,n) & - + derives(jc,XDER) *xx & - + derives(jc,X2DER)*xx**2 - enddo - enddo - enddo - - return -end subroutine FORT_BDINTERPXHI - - -! --------------------------------------------------------------- -! :: FORT_BDINTERPYLO : Interpolation on Ylo Face -! :: Quadratic Interpolation from crse data -! :: in directions transverse to face of grid -! :: -! :: Inputs/Outputs: -! :: bdry <= fine grid bndry data strip -! :: DIMS(bdry) => index limits of bdry -! :: lo,hi => index limits of grd interior -! :: DIMS(cb) => index limits of coarsened grid interior -! :: nvar => number of variables to interpolate -! :: ratios(2) => refinement ratios -! :: not_covered => mask is set to this value if cell is not -! :: covered by another fine grid and not outside the domain. -! :: mask => fine grid mask bndry strip -! :: DIMS(mask) => index limits of mask array -! :: crse => crse grid bndry data strip -! :: DIMS(crse) => index limits of crse array -! :: derives => crse grid tmp array -! --------------------------------------------------------------- - -subroutine FORT_BDINTERPYLO (bdry,DIMS(bdry), & - lo,hi,DIMS(cb),nvar,ratios,not_covered, & - mask,DIMS(mask),crse,DIMS(crse),derives) - - integer nvar, ratios(2), not_covered - integer lo(SDIM), hi(SDIM) - integer DIMDEC(bdry) - integer DIMDEC(mask) - integer DIMDEC(cb) - integer DIMDEC(crse) - REAL_T bdry(DIMV(bdry),nvar) - REAL_T derives(DIM1(cb),NUMDERIV) - integer mask(DIMV(mask)) - REAL_T crse(DIMV(crse),nvar) - REAL_T xx, ainterp - integer i, j, ic, jc, off, n - integer iclo, ichi, ratiox - - ratiox = ratios(1) - - iclo = ARG_L1(cb) - ichi = ARG_H1(cb) - jc = ARG_L2(cb)-1 - j = lo(2)-1 - - do n = 1, nvar - ! define interp coefs - do ic = iclo, ichi - i = ratiox*ic - derives(ic,XDER) = half * (crse(ic+1,jc,n) - crse(ic-1,jc,n)) - derives(ic,X2DER) = half * (crse(ic+1,jc,n) & - - crse(ic ,jc,n) * two & - + crse(ic-1,jc,n)) - if (mask(i-1,j) .ne. not_covered) then - derives(ic,XDER) = crse(ic+1,jc,n) - crse(ic ,jc,n) - derives(ic,X2DER) = zero - endif - if (mask(i+ratiox,j) .ne. not_covered) then - derives(ic,XDER) = crse(ic ,jc,n) - crse(ic-1,jc,n) - derives(ic,X2DER) = zero - endif - if (mask(i-1,j) .ne. not_covered .and. & - mask(i+ratiox,j) .ne. not_covered) then - derives(ic,XDER) = zero - endif - enddo - - ! interpolate to fine grid - do off = 0, ratiox - 1 - xx = (off - half * ratiox + half)/ratiox - do ic = iclo, ichi - i = ratiox*ic + off - bdry(i,j,n) = crse(ic,jc,n) & - + derives(ic,XDER) *xx & - + derives(ic,X2DER)*xx**2 - enddo - enddo - enddo - - return -end subroutine FORT_BDINTERPYLO - - -! --------------------------------------------------------------- -! :: FORT_BDINTERPYHI : Interpolation on Yhi Face -! :: Quadratic Interpolation from crse data -! :: in directions transverse to face of grid -! :: -! :: Inputs/Outputs: -! :: bdry <= fine grid bndry data strip -! :: DIMS(bdry) => index limits of bdry -! :: lo,hi => index limits of grd interior -! :: DIMS(cb) => index limits of coarsened grid interior -! :: nvar => number of variables to interpolate -! :: ratios(2) => refinement ratios -! :: not_covered => mask is set to this value if cell is not -! :: covered by another fine grid and not outside the domain. -! :: mask => fine grid mask bndry strip -! :: DIMS(mask) => index limits of mask array -! :: crse => crse grid bndry data strip -! :: DIMS(crse) => index limits of crse array -! :: derives => crse grid tmp array -! --------------------------------------------------------------- - -subroutine FORT_BDINTERPYHI (bdry,DIMS(bdry), & - lo,hi,DIMS(cb),nvar,ratios,not_covered, & - mask,DIMS(mask),crse,DIMS(crse),derives) - - integer nvar, ratios(2), not_covered - integer lo(SDIM), hi(SDIM) - integer DIMDEC(bdry) - integer DIMDEC(mask) - integer DIMDEC(cb) - integer DIMDEC(crse) - REAL_T bdry(DIMV(bdry),nvar) - REAL_T derives(DIM1(cb),NUMDERIV) - integer mask(DIMV(mask)) - REAL_T crse(DIMV(crse),nvar) - REAL_T xx, ainterp - integer i, j, ic, jc, off, n - integer iclo, ichi, ratiox - - ratiox = ratios(1) - - iclo = ARG_L1(cb) - ichi = ARG_H1(cb) - jc = ARG_H2(cb)+1 - j = hi(2)+1 - - do n = 1, nvar - ! define interp coefs - do ic = iclo, ichi - i = ratiox*ic - derives(ic,XDER) = half * (crse(ic+1,jc,n) - crse(ic-1,jc,n)) - derives(ic,X2DER) = half * (crse(ic+1,jc,n) & - - crse(ic ,jc,n) * two & - + crse(ic-1,jc,n)) - if (mask(i-1,j) .ne. not_covered) then - derives(ic,XDER) = crse(ic+1,jc,n) - crse(ic ,jc,n) - derives(ic,X2DER) = zero - endif - if (mask(i+ratiox,j) .ne. not_covered) then - derives(ic,XDER) = crse(ic ,jc,n) - crse(ic-1,jc,n) - derives(ic,X2DER) = zero - endif - if (mask(i-1,j) .ne. not_covered .and. & - mask(i+ratiox,j) .ne. not_covered) then - derives(ic,XDER) = zero - endif - enddo - - ! interpolate to fine grid - do off = 0, ratiox - 1 - xx = (off - half * ratiox + half)/ratiox - do ic = iclo, ichi - i = ratiox*ic + off - bdry(i,j,n) = crse(ic,jc,n) & - + derives(ic,XDER) *xx & - + derives(ic,X2DER)*xx**2 - enddo - enddo - enddo - - return -end subroutine FORT_BDINTERPYHI - diff --git a/Source/radiation/_interpbndry/RadInterpBndryData_3d.F90 b/Source/radiation/_interpbndry/RadInterpBndryData_3d.F90 deleted file mode 100644 index 95b2250a76..0000000000 --- a/Source/radiation/_interpbndry/RadInterpBndryData_3d.F90 +++ /dev/null @@ -1,753 +0,0 @@ -#include -#include -#include -#include -#include - -#define SDIM 3 -#define NUMDERIV 5 -#define XDER 1 -#define YDER 2 -#define X2DER 3 -#define Y2DER 4 -#define XYDER 5 - -! --------------------------------------------------------------- -! :: FORT_BDINTERPXLO : Interpolation on Xlo Face -! :: Quadratic Interpolation from crse data -! :: in directions transverse to face of grid -! :: -! :: Inputs/Outputs: -! :: bdry <= fine grid bndry data strip -! :: DIMS(bdry) => index limits of bdry -! :: lo,hi => index limits of grd interior -! :: DIMS(cb) => index limits of coarsened grid interior -! :: nvar => number of variables to interpolate -! :: ratios(3) => refinement ratios -! :: not_covered => mask is set to this value if cell is not -! :: covered by another fine grid and not outside the domain. -! :: mask => fine grid mask bndry strip -! :: DIMS(mask) => index limits of mask array -! :: crse => crse grid bndry data strip -! :: DIMS(crse) => index limits of crse array -! :: derives => crse grid tmp array for derivatives -! --------------------------------------------------------------- - -subroutine FORT_BDINTERPXLO (bdry,DIMS(bdry), & - lo,hi,DIMS(cb),nvar,ratios,not_covered, & - mask,DIMS(mask),crse,DIMS(crse),derives) - - integer nvar, ratios(3), not_covered - integer lo(SDIM), hi(SDIM) - integer DIMDEC(bdry) - integer DIMDEC(cb) - integer DIMDEC(mask) - integer DIMDEC(crse) - REAL_T bdry(DIMV(bdry),nvar) - REAL_T derives(DIM23(cb),NUMDERIV) - integer mask(DIMV(mask)) - REAL_T crse(DIMV(crse),nvar) - - REAL_T xx, yy, ainterp - integer i, j, k, ic, jc, kc, joff, koff, n - integer jclo, jchi, kclo, kchi, ratioy, ratioz - - ratioy = ratios(2) - ratioz = ratios(3) - - kclo = ARG_L3(cb) - kchi = ARG_H3(cb) - jclo = ARG_L2(cb) - jchi = ARG_H2(cb) - ic = ARG_L1(cb)-1 - i = lo(1)-1 - - do n = 1, nvar - ! define interp coefs - do kc = kclo, kchi - k = ratioz*kc - do jc = jclo, jchi - j = ratioy*jc - derives(jc,kc,XDER) = half*(crse(ic,jc+1,kc,n) - crse(ic,jc-1,kc,n)) - derives(jc,kc,X2DER) = half*(crse(ic,jc+1,kc,n) - two*crse(ic,jc,kc,n) & - + crse(ic,jc-1,kc,n)) - derives(jc,kc,YDER) = half*(crse(ic,jc,kc+1,n) - crse(ic,jc,kc-1,n)) - derives(jc,kc,Y2DER) = half*(crse(ic,jc,kc+1,n) - two*crse(ic,jc,kc,n) & - + crse(ic,jc,kc-1,n)) - derives(jc,kc,XYDER) = fourth*(crse(ic,jc+1,kc+1,n) - crse(ic,jc-1,kc+1,n) & - + crse(ic,jc-1,kc-1,n) - crse(ic,jc+1,kc-1,n)) - - if (mask(i,j-1,k) .ne. not_covered) then - derives(jc,kc,XDER) = crse(ic,jc+1,kc,n) - crse(ic,jc,kc,n) - derives(jc,kc,X2DER) = zero - endif - if (mask(i,j+ratioy,k) .ne. not_covered) then - derives(jc,kc,XDER) = crse(ic,jc,kc,n) - crse(ic,jc-1,kc,n) - derives(jc,kc,X2DER) = zero - endif - if (mask(i,j-1,k) .ne. not_covered .and. & - mask(i,j+ratioy,k) .ne. not_covered) then - derives(jc,kc,XDER) = zero - endif - - if (mask(i,j,k-1) .ne. not_covered) then - derives(jc,kc,YDER) = crse(ic,jc,kc+1,n) - crse(ic,jc,kc,n) - derives(jc,kc,Y2DER) = zero - endif - if (mask(i,j,k+ratioz) .ne. not_covered) then - derives(jc,kc,YDER) = crse(ic,jc,kc,n) - crse(ic,jc,kc-1,n) - derives(jc,kc,Y2DER) = zero - endif - if (mask(i,j,k-1) .ne. not_covered .and. & - mask(i,j,k+ratioz) .ne. not_covered) then - derives(jc,kc,YDER) = zero - endif - if (( mask(i,j+ratioy,k+ratioz) .ne. not_covered ) .or. & - ( mask(i,j-1,k+ratioz) .ne. not_covered ) .or. & - ( mask(i,j+ratioy,k-1) .ne. not_covered ) .or. & - ( mask(i,j-1,k-1) .ne. not_covered ) ) then - - derives(jc,kc,XYDER) = zero - endif - enddo - enddo - - ! interpolate to fine grid - do koff = 0, ratioz - 1 - yy = (koff - half * ratioz + half)/ratioz - do kc = kclo,kchi - k = ratioz*kc + koff - do joff = 0, ratioy - 1 - xx = (joff - half * ratioy + half)/ratioy - do jc = jclo, jchi - j = ratioy*jc + joff - bdry(i,j,k,n) = crse(ic,jc,kc,n) + xx*derives(jc,kc,XDER) & - + derives(jc,kc,X2DER)*xx**2 + yy*derives(jc,kc,YDER) & - + derives(jc,kc,Y2DER)*yy**2 + xx*yy*derives(jc,kc,XYDER) - enddo - enddo - enddo - enddo - enddo - - return -end subroutine FORT_BDINTERPXLO - - -! --------------------------------------------------------------- -! :: FORT_BDINTERPXHI : Interpolation on Xhi Face -! :: Quadratic Interpolation from crse data -! :: in directions transverse to face of grid -! :: -! :: Inputs/Outputs: -! :: bdry <= fine grid bndry data strip -! :: DIMS(bdry) => index limits of bdry -! :: lo,hi => index limits of grd interior -! :: DIMS(cb) => index limits of coarsened grid interior -! :: nvar => number of variables to interpolate -! :: ratios(3) => refinement ratios -! :: not_covered => mask is set to this value if cell is not -! :: covered by another fine grid and not outside the domain. -! :: mask => fine grid mask bndry strip -! :: DIMS(mask) => index limits of mask array -! :: crse => crse grid bndry data strip -! :: DIMS(crse) => index limits of crse array -! :: derives => crse grid tmp array for derivatives -! --------------------------------------------------------------- - -subroutine FORT_BDINTERPXHI (bdry,DIMS(bdry), & - lo,hi,DIMS(cb),nvar,ratios,not_covered, & - mask,DIMS(mask),crse,DIMS(crse),derives) - - integer nvar, ratios(3), not_covered - integer lo(SDIM), hi(SDIM) - integer DIMDEC(bdry) - integer DIMDEC(cb) - integer DIMDEC(mask) - integer DIMDEC(crse) - REAL_T bdry(DIMV(bdry),nvar) - REAL_T derives(DIM23(cb),NUMDERIV) - integer mask(DIMV(mask)) - REAL_T crse(DIMV(crse),nvar) - - REAL_T xx, yy, ainterp - integer i, j, k, ic, jc, kc, joff, koff, n - integer jclo, jchi, kclo, kchi, ratioy, ratioz - - ratioy = ratios(2) - ratioz = ratios(3) - - kclo = ARG_L3(cb) - kchi = ARG_H3(cb) - jclo = ARG_L2(cb) - jchi = ARG_H2(cb) - ic = ARG_H1(cb)+1 - i = hi(1)+1 - - do n = 1, nvar - ! define interp coefs - do kc = kclo, kchi - k = ratioz*kc - do jc = jclo, jchi - j = ratioy*jc - derives(jc,kc,XDER) = half*(crse(ic,jc+1,kc,n) - crse(ic,jc-1,kc,n)) - derives(jc,kc,X2DER) = half*(crse(ic,jc+1,kc,n) - two*crse(ic,jc,kc,n) & - + crse(ic,jc-1,kc,n)) - derives(jc,kc,YDER) = half*(crse(ic,jc,kc+1,n) - crse(ic,jc,kc-1,n)) - derives(jc,kc,Y2DER) = half*(crse(ic,jc,kc+1,n) - two*crse(ic,jc,kc,n) & - + crse(ic,jc,kc-1,n)) - derives(jc,kc,XYDER) = fourth*(crse(ic,jc+1,kc+1,n) - crse(ic,jc-1,kc+1,n) & - + crse(ic,jc-1,kc-1,n) - crse(ic,jc+1,kc-1,n)) - - if (mask(i,j-1,k) .ne. not_covered) then - derives(jc,kc,XDER) = crse(ic,jc+1,kc,n) - crse(ic,jc,kc,n) - derives(jc,kc,X2DER) = zero - endif - if (mask(i,j+ratioy,k) .ne. not_covered) then - derives(jc,kc,XDER) = crse(ic,jc,kc,n) - crse(ic,jc-1,kc,n) - derives(jc,kc,X2DER) = zero - endif - if (mask(i,j-1,k) .ne. not_covered .and. & - mask(i,j+ratioy,k) .ne. not_covered) then - derives(jc,kc,XDER) = zero - endif - - if (mask(i,j,k-1) .ne. not_covered) then - derives(jc,kc,YDER) = crse(ic,jc,kc+1,n) - crse(ic,jc,kc,n) - derives(jc,kc,Y2DER) = zero - endif - if (mask(i,j,k+ratioz) .ne. not_covered) then - derives(jc,kc,YDER) = crse(ic,jc,kc,n) - crse(ic,jc,kc-1,n) - derives(jc,kc,Y2DER) = zero - endif - if (mask(i,j,k-1) .ne. not_covered .and. & - mask(i,j,k+ratioz) .ne. not_covered) then - derives(jc,kc,YDER) = zero - endif - if (( mask(i,j+ratioy,k+ratioz) .ne. not_covered ) .or. & - ( mask(i,j-1,k+ratioz) .ne. not_covered ) .or. & - ( mask(i,j+ratioy,k-1) .ne. not_covered ) .or. & - ( mask(i,j-1,k-1) .ne. not_covered ) ) then - - derives(jc,kc,XYDER) = zero - endif - enddo - enddo - - ! interpolate to fine grid - do koff = 0, ratioz - 1 - yy = (koff - half * ratioz + half)/ratioz - do kc = kclo,kchi - k = ratioz*kc + koff - do joff = 0, ratioy - 1 - xx = (joff - half * ratioy + half)/ratioy - do jc = jclo, jchi - j = ratioy*jc + joff - bdry(i,j,k,n) = crse(ic,jc,kc,n) + xx*derives(jc,kc,XDER) & - + derives(jc,kc,X2DER)*xx**2 + yy*derives(jc,kc,YDER) & - + derives(jc,kc,Y2DER)*yy**2 + xx*yy*derives(jc,kc,XYDER) - enddo - enddo - enddo - enddo - enddo - - return -end subroutine FORT_BDINTERPXHI - - -! --------------------------------------------------------------- -! :: FORT_BDINTERPYLO : Interpolation on Ylo Face -! :: Quadratic Interpolation from crse data -! :: in directions transverse to face of grid -! :: -! :: Inputs/Outputs: -! :: bdry <= fine grid bndry data strip -! :: DIMS(bdry) => index limits of bdry -! :: lo,hi => index limits of grd interior -! :: DIMS(cb) => index limits of coarsened grid interior -! :: nvar => number of variables to interpolate -! :: ratios(3) => refinement ratios -! :: not_covered => mask is set to this value if cell is not -! :: covered by another fine grid and not outside the domain. -! :: mask => fine grid mask bndry strip -! :: DIMS(mask) => index limits of mask array -! :: crse => crse grid bndry data strip -! :: DIMS(crse) => index limits of crse array -! :: derives => crse grid tmp array for derivatives -! --------------------------------------------------------------- - -subroutine FORT_BDINTERPYLO (bdry,DIMS(bdry), & - lo,hi,DIMS(cb),nvar,ratios,not_covered, & - mask,DIMS(mask),crse,DIMS(crse),derives) - - integer nvar, ratios(3), not_covered - integer lo(SDIM), hi(SDIM) - integer DIMDEC(bdry) - integer DIMDEC(cb) - integer DIMDEC(mask) - integer DIMDEC(crse) - REAL_T bdry(DIMV(bdry),nvar) - REAL_T derives(DIM13(cb),NUMDERIV) - integer mask(DIMV(mask)) - REAL_T crse(DIMV(crse),nvar) - - REAL_T xx, yy, ainterp - integer i, j, k, ic, jc, kc, ioff, koff, n - integer iclo, ichi, kclo, kchi, ratiox, ratioz - - ratiox = ratios(1) - ratioz = ratios(3) - - kclo = ARG_L3(cb) - kchi = ARG_H3(cb) - iclo = ARG_L1(cb) - ichi = ARG_H1(cb) - jc = ARG_L2(cb)-1 - j = lo(2)-1 - - do n = 1, nvar - ! define interp coefs - do kc = kclo, kchi - k = ratioz*kc - do ic = iclo, ichi - i = ratiox*ic - derives(ic,kc,XDER) = half*(crse(ic+1,jc,kc,n) - crse(ic-1,jc,kc,n)) - derives(ic,kc,X2DER) = half*(crse(ic+1,jc,kc,n) - two*crse(ic,jc,kc,n) & - + crse(ic-1,jc,kc,n)) - derives(ic,kc,YDER) = half*(crse(ic,jc,kc+1,n) - crse(ic,jc,kc-1,n)) - derives(ic,kc,Y2DER) = half*(crse(ic,jc,kc+1,n) - two*crse(ic,jc,kc,n) & - + crse(ic,jc,kc-1,n)) - derives(ic,kc,XYDER) = fourth*(crse(ic+1,jc,kc+1,n) - crse(ic-1,jc,kc+1,n) & - + crse(ic-1,jc,kc-1,n) - crse(ic+1,jc,kc-1,n)) - - if (mask(i-1,j,k) .ne. not_covered) then - derives(ic,kc,XDER) = crse(ic+1,jc,kc,n) - crse(ic,jc,kc,n) - derives(ic,kc,X2DER) = zero - endif - if (mask(i+ratiox,j,k) .ne. not_covered) then - derives(ic,kc,XDER) = crse(ic,jc,kc,n) - crse(ic-1,jc,kc,n) - derives(ic,kc,X2DER) = zero - endif - if (mask(i-1,j,k) .ne. not_covered .and. & - mask(i+ratiox,j,k) .ne. not_covered) then - derives(ic,kc,XDER) = zero - endif - - if (mask(i,j,k-1) .ne. not_covered) then - derives(ic,kc,YDER) = crse(ic,jc,kc+1,n) - crse(ic,jc,kc,n) - derives(ic,kc,Y2DER) = zero - endif - if (mask(i,j,k+ratioz) .ne. not_covered) then - derives(ic,kc,YDER) = crse(ic,jc,kc,n) - crse(ic,jc,kc-1,n) - derives(ic,kc,Y2DER) = zero - endif - if (mask(i,j,k-1) .ne. not_covered .and. & - mask(i,j,k+ratioz) .ne. not_covered) then - derives(ic,kc,YDER) = zero - endif - if (( mask(i+ratiox,j,k+ratioz) .ne. not_covered ) .or. & - ( mask(i-1,j,k+ratioz) .ne. not_covered ) .or. & - ( mask(i+ratiox,j,k-1) .ne. not_covered ) .or. & - ( mask(i-1,j,k-1) .ne. not_covered ) ) then - - derives(ic,kc,XYDER) = zero - endif - enddo - enddo - - ! interpolate to fine grid - do koff = 0, ratioz - 1 - yy = (koff - half * ratioz + half)/ratioz - do kc = kclo,kchi - k = ratioz*kc + koff - do ioff = 0, ratiox - 1 - xx = (ioff - half * ratiox + half)/ratiox - do ic = iclo, ichi - i = ratiox*ic + ioff - bdry(i,j,k,n) = crse(ic,jc,kc,n) + xx*derives(ic,kc,XDER) & - + derives(ic,kc,X2DER)*xx**2 + yy*derives(ic,kc,YDER) & - + derives(ic,kc,Y2DER)*yy**2 + xx*yy*derives(ic,kc,XYDER) - enddo - enddo - enddo - enddo - enddo - - return -end subroutine FORT_BDINTERPYLO - - -! --------------------------------------------------------------- -! :: FORT_BDINTERPYHI : Interpolation on Yhi Face -! :: Quadratic Interpolation from crse data -! :: in directions transverse to face of grid -! :: -! :: Inputs/Outputs: -! :: bdry <= fine grid bndry data strip -! :: DIMS(bdry) => index limits of bdry -! :: lo,hi => index limits of grd interior -! :: DIMS(cb) => index limits of coarsened grid interior -! :: nvar => number of variables to interpolate -! :: ratios(3) => refinement ratios -! :: not_covered => mask is set to this value if cell is not -! :: covered by another fine grid and not outside the domain. -! :: mask => fine grid mask bndry strip -! :: DIMS(mask) => index limits of mask array -! :: crse => crse grid bndry data strip -! :: DIMS(crse) => index limits of crse array -! :: derives => crse grid tmp array for derivatives -! --------------------------------------------------------------- - -subroutine FORT_BDINTERPYHI (bdry,DIMS(bdry), & - lo,hi,DIMS(cb),nvar,ratios,not_covered, & - mask,DIMS(mask),crse,DIMS(crse),derives) - - integer nvar, ratios(3), not_covered - integer lo(SDIM), hi(SDIM) - integer DIMDEC(bdry) - integer DIMDEC(cb) - integer DIMDEC(mask) - integer DIMDEC(crse) - REAL_T bdry(DIMV(bdry),nvar) - REAL_T derives(DIM13(cb),NUMDERIV) - integer mask(DIMV(mask)) - REAL_T crse(DIMV(crse),nvar) - - REAL_T xx, yy, ainterp - integer i, j, k, ic, jc, kc, ioff, koff, n - integer iclo, ichi, kclo, kchi, ratiox, ratioz - - ratiox = ratios(1) - ratioz = ratios(3) - - kclo = ARG_L3(cb) - kchi = ARG_H3(cb) - iclo = ARG_L1(cb) - ichi = ARG_H1(cb) - jc = ARG_H2(cb)+1 - j = hi(2)+1 - - do n = 1, nvar - ! define interp coefs - do kc = kclo, kchi - k = ratioz*kc - do ic = iclo, ichi - i = ratiox*ic - derives(ic,kc,XDER) = half*(crse(ic+1,jc,kc,n) - crse(ic-1,jc,kc,n)) - derives(ic,kc,X2DER) = half*(crse(ic+1,jc,kc,n) - two*crse(ic,jc,kc,n) & - + crse(ic-1,jc,kc,n)) - derives(ic,kc,YDER) = half*(crse(ic,jc,kc+1,n) - crse(ic,jc,kc-1,n)) - derives(ic,kc,Y2DER) = half*(crse(ic,jc,kc+1,n) - two*crse(ic,jc,kc,n) & - + crse(ic,jc,kc-1,n)) - derives(ic,kc,XYDER) = fourth*(crse(ic+1,jc,kc+1,n) - crse(ic-1,jc,kc+1,n) & - + crse(ic-1,jc,kc-1,n) - crse(ic+1,jc,kc-1,n)) - - if (mask(i-1,j,k) .ne. not_covered) then - derives(ic,kc,XDER) = crse(ic+1,jc,kc,n) - crse(ic,jc,kc,n) - derives(ic,kc,X2DER) = zero - endif - if (mask(i+ratiox,j,k) .ne. not_covered) then - derives(ic,kc,XDER) = crse(ic,jc,kc,n) - crse(ic-1,jc,kc,n) - derives(ic,kc,X2DER) = zero - endif - if (mask(i-1,j,k) .ne. not_covered .and. & - mask(i+ratiox,j,k) .ne. not_covered) then - derives(ic,kc,XDER) = zero - endif - - if (mask(i,j,k-1) .ne. not_covered) then - derives(ic,kc,YDER) = crse(ic,jc,kc+1,n) - crse(ic,jc,kc,n) - derives(ic,kc,Y2DER) = zero - endif - if (mask(i,j,k+ratioz) .ne. not_covered) then - derives(ic,kc,YDER) = crse(ic,jc,kc,n) - crse(ic,jc,kc-1,n) - derives(ic,kc,Y2DER) = zero - endif - if (mask(i,j,k-1) .ne. not_covered .and. & - mask(i,j,k+ratioz) .ne. not_covered) then - derives(ic,kc,YDER) = zero - endif - - if (( mask(i+ratiox,j,k+ratioz) .ne. not_covered ) .or. & - ( mask(i-1,j,k+ratioz) .ne. not_covered ) .or. & - ( mask(i+ratiox,j,k-1) .ne. not_covered ) .or. & - ( mask(i-1,j,k-1) .ne. not_covered ) ) then - - derives(ic,kc,XYDER) = zero - endif - enddo - enddo - - ! interpolate to fine grid - do koff = 0, ratioz - 1 - yy = (koff - half * ratioz + half)/ratioz - do kc = kclo,kchi - k = ratioz*kc + koff - do ioff = 0, ratiox - 1 - xx = (ioff - half * ratiox + half)/ratiox - do ic = iclo, ichi - i = ratiox*ic + ioff - bdry(i,j,k,n) = crse(ic,jc,kc,n) + xx*derives(ic,kc,XDER) & - + derives(ic,kc,X2DER)*xx**2 + yy*derives(ic,kc,YDER) & - + derives(ic,kc,Y2DER)*yy**2 + xx*yy*derives(ic,kc,XYDER) - enddo - enddo - enddo - enddo - enddo - - return -end subroutine FORT_BDINTERPYHI - - -! --------------------------------------------------------------- -! :: FORT_BDINTERPZLO : Interpolation on Zlo Face -! :: Quadratic Interpolation from crse data -! :: in directions transverse to face of grid -! :: -! :: Inputs/Outputs: -! :: bdry <= fine grid bndry data strip -! :: DIMS(bdry) => index limits of bdry -! :: lo,hi => index limits of grd interior -! :: DIMS(cb) => index limits of coarsened grid interior -! :: nvar => number of variables to interpolate -! :: ratios(3) => refinement ratios -! :: not_covered => mask is set to this value if cell is not -! :: covered by another fine grid and not outside the domain. -! :: mask => fine grid mask bndry strip -! :: DIMS(mask) => index limits of mask array -! :: crse => crse grid bndry data strip -! :: DIMS(crse) => index limits of crse array -! :: derives => crse grid tmp array for derivatives -! --------------------------------------------------------------- - -subroutine FORT_BDINTERPZLO (bdry,DIMS(bdry), & - lo,hi,DIMS(cb),nvar,ratios,not_covered, & - mask,DIMS(mask),crse,DIMS(crse),derives) - - integer nvar, ratios(3), not_covered - integer lo(SDIM), hi(SDIM) - integer DIMDEC(bdry) - integer DIMDEC(cb) - integer DIMDEC(mask) - integer DIMDEC(crse) - REAL_T bdry(DIMV(bdry),nvar) - REAL_T derives(DIM12(cb),NUMDERIV) - integer mask(DIMV(mask)) - REAL_T crse(DIMV(crse),nvar) - - REAL_T xx, yy, ainterp - integer i, j, k, ic, jc, kc, ioff, joff, n - integer iclo, ichi, jclo, jchi, ratiox, ratioy - - ratiox = ratios(1) - ratioy = ratios(2) - - jclo = ARG_L2(cb) - jchi = ARG_H2(cb) - iclo = ARG_L1(cb) - ichi = ARG_H1(cb) - kc = ARG_L3(cb)-1 - k = lo(3)-1 - - do n = 1, nvar - ! define interp coefs - do jc = jclo, jchi - j = ratioy*jc - do ic = iclo, ichi - i = ratiox*ic - - derives(ic,jc,XDER) = half*(crse(ic+1,jc,kc,n) - crse(ic-1,jc,kc,n) ) - derives(ic,jc,X2DER) = half*(crse(ic+1,jc,kc,n) - two*crse(ic,jc,kc,n) + crse(ic-1,jc,kc,n) ) - derives(ic,jc,YDER) = half*(crse(ic,jc+1,kc,n) - crse(ic,jc-1,kc,n) ) - derives(ic,jc,Y2DER) = half*(crse(ic,jc+1,kc,n) - two*crse(ic,jc,kc,n) + crse(ic,jc-1,kc,n) ) - derives(ic,jc,XYDER) = fourth*(crse(ic+1,jc+1,kc,n) - crse(ic-1,jc+1,kc,n) & - + crse(ic-1,jc-1,kc,n) - crse(ic+1,jc-1,kc,n)) - - if (mask(i-1,j,k) .ne. not_covered) then - derives(ic,jc,XDER) = crse(ic+1,jc,kc,n) - crse(ic,jc,kc,n) - derives(ic,jc,X2DER) = zero - endif - if (mask(i+ratiox,j,k) .ne. not_covered) then - derives(ic,jc,XDER) = crse(ic,jc,kc,n) - crse(ic-1,jc,kc,n) - derives(ic,jc,X2DER) = zero - endif - if (mask(i-1,j,k) .ne. not_covered .and. & - mask(i+ratiox,j,k) .ne. not_covered) then - derives(ic,jc,XDER) = zero - endif - - if (mask(i,j-1,k) .ne. not_covered) then - derives(ic,jc,YDER) = crse(ic,jc+1,kc,n) - crse(ic,jc,kc,n) - derives(ic,jc,Y2DER) = zero - endif - if (mask(i,j+ratioy,k) .ne. not_covered) then - derives(ic,jc,YDER) = crse(ic,jc,kc,n) - crse(ic,jc-1,kc,n) - derives(ic,jc,Y2DER) = zero - endif - if (mask(i,j-1,k) .ne. not_covered .and. & - mask(i,j+ratioy,k) .ne. not_covered) then - derives(ic,jc,YDER) = zero - endif - - if (( mask(i+ratiox,j+ratioy,k) .ne. not_covered ) .or. & - ( mask(i-1,j+ratioy,k) .ne. not_covered ) .or. & - ( mask(i+ratiox,j-1,k) .ne. not_covered ) .or. & - ( mask(i-1,j-1,k) .ne. not_covered ) ) then - - derives(ic,jc,XYDER) = zero - endif - enddo - enddo - - ! interpolate to fine grid - do joff = 0, ratioy - 1 - yy = (joff - half * ratioy + half)/ratioy - do jc = jclo,jchi - j = ratioy*jc + joff - do ioff = 0, ratiox - 1 - xx = (ioff - half * ratiox + half)/ratiox - do ic = iclo, ichi - i = ratiox*ic + ioff - bdry(i,j,k,n) = crse(ic,jc,kc,n) + xx*derives(ic,jc,XDER) & - + derives(ic,jc,X2DER)*xx**2 + yy*derives(ic,jc,YDER) & - + derives(ic,jc,Y2DER)*yy**2 + xx*yy*derives(ic,jc,XYDER) - enddo - enddo - enddo - enddo - enddo - - return -end subroutine FORT_BDINTERPZLO - - -! --------------------------------------------------------------- -! :: FORT_BDINTERPZHI : Interpolation on Zhi Face -! :: Quadratic Interpolation from crse data -! :: in directions transverse to face of grid -! :: -! :: Inputs/Outputs: -! :: bdry <= fine grid bndry data strip -! :: DIMS(bdry) => index limits of bdry -! :: lo,hi => index limits of grd interior -! :: DIMS(cb) => index limits of coarsened grid interior -! :: nvar => number of variables to interpolate -! :: ratios(3) => refinement ratios -! :: not_covered => mask is set to this value if cell is not -! :: covered by another fine grid and not outside the domain. -! :: mask => fine grid mask bndry strip -! :: DIMS(mask) => index limits of mask array -! :: crse => crse grid bndry data strip -! :: DIMS(crse) => index limits of crse array -! :: derives => crse grid tmp array for derivatives -! --------------------------------------------------------------- - -subroutine FORT_BDINTERPZHI (bdry,DIMS(bdry), & - lo,hi,DIMS(cb),nvar,ratios,not_covered, & - mask,DIMS(mask),crse,DIMS(crse),derives) - - integer nvar, ratios(3), not_covered - integer lo(SDIM), hi(SDIM) - integer DIMDEC(bdry) - integer DIMDEC(cb) - integer DIMDEC(mask) - integer DIMDEC(crse) - REAL_T bdry(DIMV(bdry),nvar) - REAL_T derives(DIM12(cb),NUMDERIV) - integer mask(DIMV(mask)) - REAL_T crse(DIMV(crse),nvar) - - REAL_T xx, yy, ainterp - integer i, j, k, ic, jc, kc, ioff, joff, n - integer iclo, ichi, jclo, jchi, ratiox, ratioy - - ratiox = ratios(1) - ratioy = ratios(2) - - jclo = ARG_L2(cb) - jchi = ARG_H2(cb) - iclo = ARG_L1(cb) - ichi = ARG_H1(cb) - kc = ARG_H3(cb)+1 - k = hi(3)+1 - - do n = 1, nvar - ! define interp coefs - do jc = jclo, jchi - j = ratioy*jc - do ic = iclo, ichi - i = ratiox*ic - derives(ic,jc,XDER) = half*(crse(ic+1,jc,kc,n) - crse(ic-1,jc,kc,n)) - derives(ic,jc,X2DER) = half*(crse(ic+1,jc,kc,n) - two*crse(ic,jc,kc,n) & - + crse(ic-1,jc,kc,n)) - derives(ic,jc,YDER) = half*(crse(ic,jc+1,kc,n) - crse(ic,jc-1,kc,n)) - derives(ic,jc,Y2DER) = half*(crse(ic,jc+1,kc,n) - two*crse(ic,jc,kc,n) & - + crse(ic,jc-1,kc,n)) - derives(ic,jc,XYDER) = fourth*(crse(ic+1,jc+1,kc,n) - crse(ic-1,jc+1,kc,n) & - + crse(ic-1,jc-1,kc,n) - crse(ic+1,jc-1,kc,n)) - - if (mask(i-1,j,k) .ne. not_covered) then - derives(ic,jc,XDER) = crse(ic+1,jc,kc,n) - crse(ic,jc,kc,n) - derives(ic,jc,X2DER) = zero - endif - if (mask(i+ratiox,j,k) .ne. not_covered) then - derives(ic,jc,XDER) = crse(ic,jc,kc,n) - crse(ic-1,jc,kc,n) - derives(ic,jc,X2DER) = zero - endif - if (mask(i-1,j,k) .ne. not_covered .and. & - mask(i+ratiox,j,k) .ne. not_covered) then - derives(ic,jc,XDER) = zero - endif - - if (mask(i,j-1,k) .ne. not_covered) then - derives(ic,jc,YDER) = crse(ic,jc+1,kc,n) - crse(ic,jc,kc,n) - derives(ic,jc,Y2DER) = zero - endif - if (mask(i,j+ratioy,k) .ne. not_covered) then - derives(ic,jc,YDER) = crse(ic,jc,kc,n) - crse(ic,jc-1,kc,n) - derives(ic,jc,Y2DER) = zero - endif - if (mask(i,j-1,k) .ne. not_covered .and. & - mask(i,j+ratioy,k) .ne. not_covered) then - derives(ic,jc,YDER) = zero - endif - if (( mask(i+ratiox,j+ratioy,k) .ne. not_covered ) .or. & - ( mask(i-1,j+ratioy,k) .ne. not_covered ) .or. & - ( mask(i+ratiox,j-1,k) .ne. not_covered ) .or. & - ( mask(i-1,j-1,k) .ne. not_covered ) ) then - - derives(ic,jc,XYDER) = zero - endif - enddo - enddo - - ! interpolate to fine grid - do joff = 0, ratioy - 1 - yy = (joff - half * ratioy + half)/ratioy - do jc = jclo,jchi - j = ratioy*jc + joff - do ioff = 0, ratiox - 1 - xx = (ioff - half * ratiox + half)/ratiox - do ic = iclo, ichi - i = ratiox*ic + ioff - bdry(i,j,k,n) = crse(ic,jc,kc,n) + xx*derives(ic,jc,XDER) & - + derives(ic,jc,X2DER)*xx**2 + yy*derives(ic,jc,YDER) & - + derives(ic,jc,Y2DER)*yy**2 + xx*yy*derives(ic,jc,XYDER) - enddo - enddo - enddo - enddo - enddo - - return -end subroutine FORT_BDINTERPZHI - -#undef NUMDERIV -#undef XDER -#undef YDER -#undef X2DER -#undef Y2DER -#undef XYDER - From 640a8312af78dab91c89bb9547b7a058997fde1c Mon Sep 17 00:00:00 2001 From: Max Katz Date: Fri, 3 Nov 2023 08:00:43 -0400 Subject: [PATCH 3/7] Remove RAD_F.H (#2648) --- Source/driver/Castro.cpp | 1 - Source/hydro/Castro_ctu_rad.cpp | 1 - Source/radiation/MGFLD.cpp | 1 - Source/radiation/MGFLDRadSolver.cpp | 3 - Source/radiation/MGRadBndry.cpp | 2 - Source/radiation/Make.package | 2 - Source/radiation/RAD_F.H | 85 ----------------------------- Source/radiation/RadBndry.cpp | 2 - Source/radiation/RadMultiGroup.cpp | 2 - Source/radiation/RadPlotvar.cpp | 2 - Source/radiation/RadSolve.cpp | 1 - Source/radiation/Radiation.cpp | 1 - Source/radiation/SGRadSolver.cpp | 3 - 13 files changed, 106 deletions(-) delete mode 100644 Source/radiation/RAD_F.H diff --git a/Source/driver/Castro.cpp b/Source/driver/Castro.cpp index 39e836b3f0..7721244b93 100644 --- a/Source/driver/Castro.cpp +++ b/Source/driver/Castro.cpp @@ -24,7 +24,6 @@ #ifdef RADIATION #include -#include #endif #ifdef AMREX_PARTICLES diff --git a/Source/hydro/Castro_ctu_rad.cpp b/Source/hydro/Castro_ctu_rad.cpp index 00ee52923e..464f52226a 100644 --- a/Source/hydro/Castro_ctu_rad.cpp +++ b/Source/hydro/Castro_ctu_rad.cpp @@ -3,7 +3,6 @@ #include "Radiation.H" #include "RadHydro.H" -#include "RAD_F.H" #include "fluxlimiter.H" using namespace amrex; diff --git a/Source/radiation/MGFLD.cpp b/Source/radiation/MGFLD.cpp index 8709ad344e..9be9efb67c 100644 --- a/Source/radiation/MGFLD.cpp +++ b/Source/radiation/MGFLD.cpp @@ -1,5 +1,4 @@ #include -#include #include #include #include diff --git a/Source/radiation/MGFLDRadSolver.cpp b/Source/radiation/MGFLDRadSolver.cpp index c622affdf7..250de9b1ae 100644 --- a/Source/radiation/MGFLDRadSolver.cpp +++ b/Source/radiation/MGFLDRadSolver.cpp @@ -5,9 +5,6 @@ #include #include - -#include - #include #include diff --git a/Source/radiation/MGRadBndry.cpp b/Source/radiation/MGRadBndry.cpp index 84d08e3273..f69f4ac773 100644 --- a/Source/radiation/MGRadBndry.cpp +++ b/Source/radiation/MGRadBndry.cpp @@ -10,8 +10,6 @@ #include #endif -#include - using namespace amrex; int MGRadBndry::ngroups = 1; diff --git a/Source/radiation/Make.package b/Source/radiation/Make.package index 93c5f935d9..5a0023f4da 100644 --- a/Source/radiation/Make.package +++ b/Source/radiation/Make.package @@ -29,8 +29,6 @@ CEXE_headers += HABEC.H CEXE_headers += filter.H CEXE_headers += filt_prim.H -FEXE_headers += RAD_F.H - CEXE_sources += trace_ppm_rad.cpp CEXE_headers += fluxlimiter.H diff --git a/Source/radiation/RAD_F.H b/Source/radiation/RAD_F.H deleted file mode 100644 index a1768d1aa1..0000000000 --- a/Source/radiation/RAD_F.H +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef CASTRO_RAD_F_H -#define CASTRO_RAD_F_H - -#include - -#ifdef BL_FORT_USE_UNDERSCORE -# define FORT_RADBNDRY2 rbndr2_ - -#elif defined(BL_FORT_USE_UPPERCASE) - -# define FORT_RADBNDRY2 RBNDR2 - -#endif - -#include - -#ifdef __cplusplus -extern "C" { -#endif - void ca_filt_prim - (const int lo[], const int hi[], - BL_FORT_FAB_ARG(Stmp), - BL_FORT_FAB_ARG(Snew), - BL_FORT_FAB_ARG(mask), - const int* filter_prim_T, const int* filter_prim_S, - const int* domlo, const int* domhi, - const amrex::Real* delta, const amrex::Real* xlo, const amrex::Real* problo, - const amrex::Real* time, const int* level); -#ifdef __cplusplus -} -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - - void ca_flux_face2center - (const int lo[], const int hi[], - BL_FORT_FAB_ARG(test), - const BL_FORT_FAB_ARG(flx), - const amrex::Real* x, const int* xlo, const int* xhi, - const int* ntest, const int* idim, const int* iflx); - -#ifdef __cplusplus -} -#endif -// - -#ifdef __cplusplus -extern "C" { -#endif - void fkpn(const int* lo, const int* hi, - BL_FORT_FAB_ARG_3D(fkp), - amrex::Real con, amrex::Real em, amrex::Real en, - amrex::Real ep, amrex::Real xnu, amrex::Real tf, - BL_FORT_FAB_ARG_3D(temp), - BL_FORT_FAB_ARG_3D(state), - amrex::Real temp_offset); - - void rosse1(const int* lo, const int* hi, - amrex::Real con, amrex::Real em, amrex::Real en, - amrex::Real ep, amrex::Real nu, - amrex::Real tf, amrex::Real kfloor, - BL_FORT_FAB_ARG_3D(state), - BL_FORT_FAB_ARG_3D(kappar)); - - void rosse1s(const int* lo, const int* hi, - amrex::Real con, amrex::Real em, amrex::Real en, - amrex::Real ep, amrex::Real scon, - amrex::Real sem, amrex::Real sen, - amrex::Real sep, amrex::Real nu, - amrex::Real tf, amrex::Real kfloor, - BL_FORT_FAB_ARG_3D(state), - BL_FORT_FAB_ARG_3D(kappar)); - - void FORT_RADBNDRY2(amrex::Real* bf, ARLIM_P(blo), ARLIM_P(bhi), - int* tfab, ARLIM_P(dlo), ARLIM_P(dhi), - const amrex::Real* dx, const amrex::Real* xlo, const amrex::Real& time); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/Source/radiation/RadBndry.cpp b/Source/radiation/RadBndry.cpp index 47af9e86f8..aa742febef 100644 --- a/Source/radiation/RadBndry.cpp +++ b/Source/radiation/RadBndry.cpp @@ -9,8 +9,6 @@ #include #endif -#include - using namespace amrex; int RadBndry::first = 1; diff --git a/Source/radiation/RadMultiGroup.cpp b/Source/radiation/RadMultiGroup.cpp index 6d10bced88..83a1811ffc 100644 --- a/Source/radiation/RadMultiGroup.cpp +++ b/Source/radiation/RadMultiGroup.cpp @@ -4,8 +4,6 @@ #include -#include - #include #include diff --git a/Source/radiation/RadPlotvar.cpp b/Source/radiation/RadPlotvar.cpp index 15ed08f304..33b90393a7 100644 --- a/Source/radiation/RadPlotvar.cpp +++ b/Source/radiation/RadPlotvar.cpp @@ -2,8 +2,6 @@ #include #include -#include - using namespace amrex; void Radiation::save_lambda_in_plotvar(int level, const Array& lambda) diff --git a/Source/radiation/RadSolve.cpp b/Source/radiation/RadSolve.cpp index ea8e78d0df..372384d415 100644 --- a/Source/radiation/RadSolve.cpp +++ b/Source/radiation/RadSolve.cpp @@ -7,7 +7,6 @@ #include // for access to static physical constants only #include #include -#include #include diff --git a/Source/radiation/Radiation.cpp b/Source/radiation/Radiation.cpp index f1932f2a74..81a69d64bd 100644 --- a/Source/radiation/Radiation.cpp +++ b/Source/radiation/Radiation.cpp @@ -5,7 +5,6 @@ #include #include -#include #include #include diff --git a/Source/radiation/SGRadSolver.cpp b/Source/radiation/SGRadSolver.cpp index 7ad805a38c..eca2c5db37 100644 --- a/Source/radiation/SGRadSolver.cpp +++ b/Source/radiation/SGRadSolver.cpp @@ -5,9 +5,6 @@ #include #include - -#include - #include #ifdef _OPENMP From a73a6ce687e8c907bdb205e68ae116da10dc01a7 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 10 Nov 2023 11:18:35 -0500 Subject: [PATCH 4/7] update benchmarks to reflect sneut5 fixes (#2649) --- .../sdc_det_plt00040_extrema.out | 130 +++++++++--------- .../ci-benchmarks/wdmerger_collision_2D.out | 46 +++---- 2 files changed, 88 insertions(+), 88 deletions(-) diff --git a/Exec/science/Detonation/ci-benchmarks/sdc_det_plt00040_extrema.out b/Exec/science/Detonation/ci-benchmarks/sdc_det_plt00040_extrema.out index c194eb241b..b23a288448 100644 --- a/Exec/science/Detonation/ci-benchmarks/sdc_det_plt00040_extrema.out +++ b/Exec/science/Detonation/ci-benchmarks/sdc_det_plt00040_extrema.out @@ -1,79 +1,79 @@ plotfile = det_x_plt00040 time = 5.1558159133685604e-06 variables minimum value maximum value - density 185260007.35 216603859.01 - xmom -95478048133 2.952359112e+16 + density 185259613.21 216639295.98 + xmom -76364812859 2.9487648003e+16 ymom 0 0 zmom 0 0 - rho_E 1.3062473824e+26 2.7893784124e+26 - rho_e 1.3062473824e+26 2.7751326191e+26 - Temp 50000004.458 7845854705.7 - rho_H1 2.1201861478e-22 0.020000095466 - rho_He3 0.0017223648459 0.021020296724 - rho_He4 94359149.148 200001396.77 - rho_C12 0.020000000212 21135001.4 - rho_N14 1.9999995691e-22 0.020000140467 - rho_O16 0.019999999996 19209.47908 - rho_Ne20 0.019999999996 3349.1035562 - rho_Mg24 0.019999999996 23321.472036 - rho_Si28 0.019999999996 2015667.384 - rho_S32 0.019999999996 1656663.9647 - rho_Ar36 0.019999999996 822084.74368 - rho_Ca40 0.019999999996 724953.65136 - rho_Ti44 0.019999999996 34186.713944 - rho_Cr48 0.019999999996 78116.705288 - rho_Fe52 0.019999999996 278123.66002 - rho_Fe54 0.019999999996 95005859.534 - rho_Ni56 0.019999999996 2240472.8392 - rho_n 2.1201861478e-22 234580.1967 - rho_p 0.019999995434 3610168.2963 - rho_enuc -4.6893837946e+29 3.5767389644e+32 - pressure 5.5236728673e+25 1.1610545314e+26 - kineng 0 2.0470929988e+24 - soundspeed 612864631.35 895226075.34 - Gamma_1 1.3599756433 1.381960389 - MachNumber 0 0.16110289957 - uplusc 612864631.35 999987726.83 - uminusc -895226515.48 -612861097.59 - entropy 98214771.47 336273485.1 + rho_E 1.3062473824e+26 2.7890630574e+26 + rho_e 1.3062473824e+26 2.7748033958e+26 + Temp 50000004.458 7845854782 + rho_H1 2.1207015241e-22 0.020000144873 + rho_He3 0.0017224909604 0.021023115362 + rho_He4 94365290.111 200001891.25 + rho_C12 0.020000000212 21243051.967 + rho_N14 1.9999977239e-22 0.020000190213 + rho_O16 0.019999999996 19209.485639 + rho_Ne20 0.019999999996 9734.6358293 + rho_Mg24 0.019999999996 23306.635461 + rho_Si28 0.019999999996 2013766.0467 + rho_S32 0.019999999996 1654854.387 + rho_Ar36 0.019999999996 821077.40202 + rho_Ca40 0.019999999996 724428.55057 + rho_Ti44 0.019999999996 34137.672926 + rho_Cr48 0.019999999996 78094.207516 + rho_Fe52 0.019999999996 277975.05929 + rho_Fe54 0.019999999996 94999519.274 + rho_Ni56 0.019999999996 2236723.6985 + rho_n 2.1207015241e-22 234580.251 + rho_p 0.019999995434 3609846.1745 + rho_enuc -4.6916352344e+29 3.5793978339e+32 + pressure 5.5236728673e+25 1.1610546577e+26 + kineng 0 2.0430835425e+24 + soundspeed 612864631.35 895226082.4 + Gamma_1 1.359975607 1.3820247131 + MachNumber 0 0.16100811998 + uplusc 612864631.35 999536286.21 + uminusc -895226453.03 -612859846.92 + entropy 98214771.47 336273518.24 magvort 0 0 - divu -97832.499193 33854.491885 - eint_E 6.5312369121e+17 1.3804344055e+18 - eint_e 6.5312369121e+17 1.3804344055e+18 - logden 8.2677816769 8.3356661897 - StateErr_0 185260007.35 216603859.01 - StateErr_1 50000004.458 7845854705.7 + divu -97902.982158 33744.686211 + eint_E 6.5312369121e+17 1.3804344246e+18 + eint_e 6.5312369121e+17 1.3804344246e+18 + logden 8.267780753 8.3357372357 + StateErr_0 185259613.21 216639295.98 + StateErr_1 50000004.458 7845854782 StateErr_2 1e-30 9.9999779304e-11 X(H1) 1e-30 9.9999779304e-11 - X(He3) 8.9859545625e-12 9.9999601234e-11 - X(He4) 0.48404147545 0.9999999982 - X(C12) 1.0000000106e-10 0.099684649962 - X(N14) 1e-30 1.0000000376e-10 - X(O16) 9.999999998e-11 9.604736089e-05 - X(Ne20) 9.999999998e-11 1.5796271283e-05 - X(Mg24) 9.999999998e-11 0.00011117769044 - X(Si28) 9.999999998e-11 0.010055309829 - X(S32) 9.999999998e-11 0.0083464912692 - X(Ar36) 9.999999998e-11 0.0041653171252 - X(Ca40) 9.999999998e-11 0.0037092925282 - X(Ti44) 9.999999998e-11 0.00017295237305 - X(Cr48) 9.999999998e-11 0.00040072134633 - X(Fe52) 9.999999998e-11 0.0013379984809 - X(Fe54) 9.999999998e-11 0.46490189727 - X(Ni56) 9.999999998e-11 0.010343642304 - X(n) 1e-30 0.001172900562 - X(p) 9.9999976982e-11 0.017595041218 - abar 4.000000001 6.7313807923 - Ye 0.49998670441 0.50001557764 - x_velocity -477.39024664 138675067.71 + X(He3) 8.9859771063e-12 9.9999601234e-11 + X(He4) 0.48406305162 0.9999999982 + X(C12) 1.0000000106e-10 0.10016992833 + X(N14) 1e-30 1.0000000525e-10 + X(O16) 9.999999998e-11 9.6047401986e-05 + X(Ne20) 9.999999998e-11 4.5902903915e-05 + X(Mg24) 9.999999998e-11 0.00011109993006 + X(Si28) 9.999999998e-11 0.010051430746 + X(S32) 9.999999998e-11 0.0083423100958 + X(Ar36) 9.999999998e-11 0.004162785426 + X(Ca40) 9.999999998e-11 0.0037083550771 + X(Ti44) 9.999999998e-11 0.00017290662768 + X(Cr48) 9.999999998e-11 0.00040059772358 + X(Fe52) 9.999999998e-11 0.001337522714 + X(Fe54) 9.999999998e-11 0.46488979858 + X(Ni56) 9.999999998e-11 0.010324644421 + X(n) 1e-30 0.0011729007238 + X(p) 9.9999977087e-11 0.017592929732 + abar 4.000000001 6.7312458561 + Ye 0.49998677577 0.50001556472 + x_velocity -381.82392939 138572160.27 y_velocity 0 0 z_velocity 0 0 - t_sound_t_enuc 3.4412406672e-13 0.97457997209 - enuc -2.4932951549e+21 1.6512812749e+24 - magvel 0 138675067.71 - radvel -477.39024664 138675067.71 + t_sound_t_enuc 3.4412406672e-13 0.97497430527 + enuc -2.4944881551e+21 1.6522384906e+24 + magvel 0 138572160.27 + radvel -381.82392939 138572160.27 circvel 0 2 - magmom 0 2.952359112e+16 + magmom 0 2.9487648003e+16 angular_momentum_x 0 0 angular_momentum_y 0 0 angular_momentum_z 0 0 diff --git a/Exec/science/wdmerger/ci-benchmarks/wdmerger_collision_2D.out b/Exec/science/wdmerger/ci-benchmarks/wdmerger_collision_2D.out index 583ca7a221..a933d102df 100644 --- a/Exec/science/wdmerger/ci-benchmarks/wdmerger_collision_2D.out +++ b/Exec/science/wdmerger/ci-benchmarks/wdmerger_collision_2D.out @@ -1,29 +1,29 @@ plotfile = plt00095 time = 1.25 variables minimum value maximum value - density 8.7135998023e-05 13349624.654 - xmom -4.4629220454e+14 1.4948722092e+15 - ymom -1.8932804713e+15 1.9800362776e+15 + density 8.7136176158e-05 13348283.786 + xmom -4.4636648292e+14 1.4969028735e+15 + ymom -1.8931343553e+15 1.9807937913e+15 zmom 0 0 - rho_E 7.7947791091e+11 5.6312993863e+24 - rho_e 7.4321769431e+11 5.6091061285e+24 - Temp 100000 3973709195.6 - rho_He4 8.7135998023e-17 1471.0785014 - rho_C12 3.4854399209e-05 5032772.3673 - rho_O16 5.2281598813e-05 7783080.7527 - rho_Ne20 8.7135998023e-17 1161332.3207 - rho_Mg24 8.7135998023e-17 911291.08467 - rho_Si28 8.7135998023e-17 4232085.8582 - rho_S32 8.7135998023e-17 2178683.3718 - rho_Ar36 8.7135998023e-17 497876.89184 - rho_Ca40 8.7135998023e-17 382091.02967 - rho_Ti44 8.7135998023e-17 1576.9103687 - rho_Cr48 8.7135998023e-17 1467.9934268 - rho_Fe52 8.7135998023e-17 14829.058965 - rho_Ni56 8.7135998023e-17 182703.46769 - phiGrav -4.6147569719e+17 -2.2055818436e+16 - grav_x -461192616.69 -48603.579942 - grav_y -444702950.05 392305631.78 + rho_E 7.7947390767e+11 5.6568077669e+24 + rho_e 7.4321344551e+11 5.6343409475e+24 + Temp 100000 3972527783.9 + rho_He4 8.7136176158e-17 1473.9666386 + rho_C12 3.4854470463e-05 5030539.1488 + rho_O16 5.2281705694e-05 7778301.6377 + rho_Ne20 8.7136176158e-17 1023673.1153 + rho_Mg24 8.7136176158e-17 1040419.2782 + rho_Si28 8.7136176158e-17 4251082.0739 + rho_S32 8.7136176158e-17 2179431.2961 + rho_Ar36 8.7136176158e-17 497747.48798 + rho_Ca40 8.7136176158e-17 382056.037 + rho_Ti44 8.7136176158e-17 1576.0930955 + rho_Cr48 8.7136176158e-17 1467.9139369 + rho_Fe52 8.7136176158e-17 14831.710059 + rho_Ni56 8.7136176158e-17 182702.27304 + phiGrav -4.6147467267e+17 -2.2055818332e+16 + grav_x -461195258.85 -48603.568291 + grav_y -444709392.81 392306861.64 grav_z 0 0 - rho_enuc -7.53321893e+21 4.9655988047e+26 + rho_enuc -7.6356851771e+21 5.7259582003e+26 From edad6c8f724352fb70d74c93c28ac84c248f2995 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 10 Nov 2023 11:53:19 -0500 Subject: [PATCH 5/7] update the nse_interp interface (#2650) this syncs up with the new Microphysics changes --- Exec/reacting_tests/nse_test/problem_initialize_state_data.H | 5 ++++- Exec/science/massive_star/problem_initialize_state_data.H | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Exec/reacting_tests/nse_test/problem_initialize_state_data.H b/Exec/reacting_tests/nse_test/problem_initialize_state_data.H index 7bd1476e04..43b6666355 100644 --- a/Exec/reacting_tests/nse_test/problem_initialize_state_data.H +++ b/Exec/reacting_tests/nse_test/problem_initialize_state_data.H @@ -67,8 +67,11 @@ void problem_initialize_state_data (int i, int j, int k, Real abar; Real dq; Real dyedt; + Real dabardt; + Real dbeadt; + Real e_nu; - nse_interp(T, problem::rho0, ye, abar, dq, dyedt, burn_state.xn); + nse_interp(T, problem::rho0, ye, abar, dq, dyedt, dabardt, dbeadt, e_nu, burn_state.xn); #elif defined(NSE_NET) Real eps = 1.e-10_rt; bool input_ye_is_valid = true; diff --git a/Exec/science/massive_star/problem_initialize_state_data.H b/Exec/science/massive_star/problem_initialize_state_data.H index 177bc3289f..51b4a9e38d 100644 --- a/Exec/science/massive_star/problem_initialize_state_data.H +++ b/Exec/science/massive_star/problem_initialize_state_data.H @@ -82,10 +82,13 @@ void problem_initialize_state_data (int i, int j, int k, Real abar; Real dq; Real dyedt; + Real dabardt; + Real dbeadt; + Real e_nu; Real xn[NumSpec]; nse_interp(state(i,j,k,UTEMP), state(i,j,k,URHO), - state(i,j,k,UFX+AuxZero::iye), abar, dq, dyedt, xn); + state(i,j,k,UFX+AuxZero::iye), abar, dq, dyedt, dabardt, dbeadt, e_nu, xn); state(i,j,k,UFX+AuxZero::iabar) = abar; state(i,j,k,UFX+AuxZero::ibea) = dq; From b720d68fae8fc1fa05575f05dd31b9e33c524aff Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Tue, 14 Nov 2023 11:40:29 -0500 Subject: [PATCH 6/7] switch external _parameters from logical to int (#2651) --- Source/reactions/_parameters | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/reactions/_parameters b/Source/reactions/_parameters index e15f939404..c8a9ba797b 100644 --- a/Source/reactions/_parameters +++ b/Source/reactions/_parameters @@ -1,4 +1,4 @@ @namespace: integrator # Do not subtract the initial energy in the integrator -subtract_internal_energy logical .false. 100 +subtract_internal_energy int 0 100 From bc5fe8d2574f988ccedf5f60d86cbd3caec720e4 Mon Sep 17 00:00:00 2001 From: Zhi Chen <62574124+zhichen3@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:38:02 -0500 Subject: [PATCH 7/7] make n14 optional for detonation setup (#2656) --- Exec/science/Detonation/problem_initialize.H | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Exec/science/Detonation/problem_initialize.H b/Exec/science/Detonation/problem_initialize.H index d1e8a6d732..58205bbf24 100644 --- a/Exec/science/Detonation/problem_initialize.H +++ b/Exec/science/Detonation/problem_initialize.H @@ -16,7 +16,7 @@ void problem_initialize () problem::in14 = network_spec_index("nitrogen-14"); problem::io16 = network_spec_index("oxygen-16"); - if (problem::ihe4 < 0 || problem::ic12 < 0 || problem::in14 < 0 || problem::io16 < 0) { + if (problem::ihe4 < 0 || problem::ic12 < 0 || problem::io16 < 0) { amrex::Error("ERROR: species indices not found"); } @@ -51,9 +51,15 @@ void problem_initialize () } problem::xn[problem::ic12] = amrex::max(problem::cfrac, problem::smallx); - problem::xn[problem::in14] = amrex::max(problem::nfrac, problem::smallx); problem::xn[problem::io16] = amrex::max(problem::ofrac, problem::smallx); - problem::xn[problem::ihe4] = 1.0_rt - problem::cfrac - problem::nfrac - problem::ofrac - (NumSpec - 3) * problem::smallx; + + if (problem::in14 >= 0) { + problem::xn[problem::in14] = amrex::max(problem::nfrac, problem::smallx); + problem::xn[problem::ihe4] = 1.0_rt - problem::cfrac - problem::nfrac - problem::ofrac - (NumSpec - 3) * problem::smallx; + } + else { + problem::xn[problem::ihe4] = 1.0_rt - problem::cfrac - problem::ofrac - (NumSpec - 2) * problem::smallx; + } // Set the ambient material