Skip to content

Commit 9a8a640

Browse files
committed
Fix ranges. -foo:foo has size 2*foo + 1
1 parent 19bb2db commit 9a8a640

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

components/eam/src/physics/cam/gw/gw_common.F90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,6 @@ subroutine gw_drag_prof(ncol, ngwv, src_level, tend_level, do_taper, dt, &
865865
!------------------------------------------------------------------------
866866

867867
! Initialize gravity wave drag tendencies to zero.
868-
869868
utgw = 0._r8
870869
vtgw = 0._r8
871870
taucd = 0._r8

components/eamxx/src/physics/gw/tests/infra/gw_test_data.hpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct GwInit : public PhysicsTestData {
2929

3030
GwInit(Int pver_, Int pgwv_, Real dc_, bool orographic_only_, bool do_molec_diff_, bool tau_0_ubc_, Int nbot_molec_, Int ktop_, Int kbotbg_, Real fcrit2_, Real kwv_) :
3131
PhysicsTestData({
32-
{pgwv_ * 2},
32+
{pgwv_*2 + 1},
3333
{pver_ + 1}
3434
},
3535
{
@@ -69,9 +69,9 @@ struct GwdComputeTendenciesFromStressDivergenceData : public PhysicsTestData {
6969
PhysicsTestData({
7070
{ncol_},
7171
{ncol_, init_.pver},
72-
{ncol_, 2*init_.pgwv},
73-
{ncol_, 2*init_.pgwv, init_.pver + 1},
74-
{ncol_, init_.pver, 2*ngwv_},
72+
{ncol_, 2*init_.pgwv + 1},
73+
{ncol_, 2*init_.pgwv + 1, init_.pver + 1},
74+
{ncol_, init_.pver, 2*ngwv_ + 1},
7575
{ncol_}
7676
},
7777
{
@@ -160,9 +160,9 @@ struct GwdComputeStressProfilesAndDiffusivitiesData : public PhysicsTestData {
160160
GwdComputeStressProfilesAndDiffusivitiesData(Int ncol_, Int ngwv_, GwInit init_) :
161161
PhysicsTestData({
162162
{ncol_, init_.pver + 1},
163-
{ncol_, init_.pgwv*2},
163+
{ncol_, init_.pgwv*2 + 1},
164164
{ncol_, init_.pver},
165-
{ncol_, init_.pgwv*2, init_.pver + 1},
165+
{ncol_, init_.pgwv*2 + 1, init_.pver + 1},
166166
{ncol_}
167167
},
168168
{
@@ -192,9 +192,9 @@ struct GwdProjectTauData : public PhysicsTestData {
192192

193193
GwdProjectTauData(Int ncol_, Int ngwv_, GwInit init_) :
194194
PhysicsTestData({
195-
{ncol_, init_.pgwv*2, init_.pver + 1},
195+
{ncol_, init_.pgwv*2 + 1, init_.pver + 1},
196196
{ncol_, init_.pver + 1},
197-
{ncol_, init_.pgwv*2},
197+
{ncol_, init_.pgwv*2 + 1},
198198
{ncol_},
199199
{ncol_, init_.pver + 1, 4},
200200
{ncol_}
@@ -230,8 +230,8 @@ struct GwdPrecalcRhoiData : public PhysicsTestData {
230230
PhysicsTestData({
231231
{ncol_, init_.pver},
232232
{ncol_, init_.pver + 1},
233-
{ncol_, init_.pver, ngwv_*2},
234-
{ncol_, init_.pgwv*2},
233+
{ncol_, init_.pver, ngwv_*2 + 1},
234+
{ncol_, init_.pgwv*2 + 1},
235235
{ncol_, init_.pver, pcnst_},
236236
{ncol_}
237237
},
@@ -271,11 +271,11 @@ struct GwDragProfData : public PhysicsTestData {
271271
{ncol_},
272272
{ncol_, init_.pver},
273273
{ncol_, init_.pver + 1},
274-
{ncol_, init_.pgwv*2},
274+
{ncol_, init_.pgwv*2 + 1},
275275
{ncol_, init_.pver, pcnst_},
276-
{ncol_, init_.pgwv*2, init_.pver + 1},
276+
{ncol_, init_.pgwv*2 + 1, init_.pver + 1},
277277
{ncol_, init_.pver + 1, 4},
278-
{ncol_, init_.pver, ngwv_*2},
278+
{ncol_, init_.pver, ngwv_*2 + 1},
279279
{ncol_}
280280
},
281281
{
@@ -352,7 +352,7 @@ struct GwFrontGwSourcesData : public PhysicsTestData {
352352
GwFrontGwSourcesData(Int ncol_, Int ngwv_, Int kbot_, GwFrontInitData init_) :
353353
PhysicsTestData({
354354
{ncol_, init_.init.pver},
355-
{ncol_, init_.init.pgwv*2, init_.init.pver}
355+
{ncol_, init_.init.pgwv*2 + 1, init_.init.pver + 1}
356356
},
357357
{
358358
{&frontgf},
@@ -377,10 +377,10 @@ struct GwCmSrcData : public PhysicsTestData {
377377
GwCmSrcData(Int ncol_, Int ngwv_, Int kbot_, GwFrontInitData init_) :
378378
PhysicsTestData({
379379
{ncol_, init_.init.pver},
380-
{ncol_, init_.init.pgwv*2, init_.init.pver + 1},
380+
{ncol_, init_.init.pgwv*2 + 1, init_.init.pver + 1},
381381
{ncol_, init_.init.pver + 1},
382382
{ncol_},
383-
{ncol_, init_.init.pgwv*2},
383+
{ncol_, init_.init.pgwv*2 + 1},
384384
{ncol_}
385385
},
386386
{

0 commit comments

Comments
 (0)