Skip to content

Commit 86f57ab

Browse files
committed
Cleanup: removal of redundant 'return' statements before an 'end subroutine' statement
1 parent 0b02804 commit 86f57ab

File tree

14 files changed

+16
-184
lines changed

14 files changed

+16
-184
lines changed

src/CPL/CLM_cpl/module_clm_HYDRO.F

+4-12
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ subroutine clm_cpl_HYDRO()
210210
write(6,*) "end of drive ndhms"
211211
#endif
212212

213-
return
214213
end subroutine clm_cpl_HYDRO
215214

216215
subroutine Toclm3d (v1d_out,nn,kk1,z1_in,ix,jx,kk2,z2,v2_in)
@@ -235,7 +234,6 @@ subroutine Toclm3d (v1d_out,nn,kk1,z1_in,ix,jx,kk2,z2,v2_in)
235234
call Toclm2d(v1(:,:,k),ix,jx,v1d_out(:,k),nn)
236235
end do
237236

238-
return
239237
end subroutine Toclm3d
240238

241239
subroutine Toclm2d(v1,ix,jx,v1d_out,nn)
@@ -266,7 +264,6 @@ subroutine Toclm2d(v1,ix,jx,v1d_out,nn)
266264
write(6,*) "after scatter_1d_r"
267265

268266
#endif
269-
return
270267
end subroutine Toclm2d
271268

272269
subroutine TO1d(vg2d,v1d,nx,ny)
@@ -280,7 +277,6 @@ subroutine TO1d(vg2d,v1d,nx,ny)
280277
v1d(n) = vg2d(i,j)
281278
enddo
282279
enddo
283-
return
284280
end subroutine TO1d
285281

286282
subroutine clm2ND3d (v1d_in,nn,kk1,z1_in,ix,jx,kk2,z2,vout)
@@ -302,8 +298,6 @@ subroutine clm2ND3d (v1d_in,nn,kk1,z1_in,ix,jx,kk2,z2,vout)
302298
end do
303299
call Interp3D (z1(1:kk1),v1,kk1,z2(1:kk2),vout,ix,jx,kk2)
304300

305-
306-
return
307301
end subroutine clm2ND3d
308302

309303
subroutine clm2ND2d (v1d_in,nn,vout,ix,jx)
@@ -346,7 +340,6 @@ subroutine clm2ND2d (v1d_in,nn,vout,ix,jx)
346340
! domain decomposition
347341
call decompose_data_real(v2d_g,vout)
348342

349-
return
350343
end subroutine clm2ND2d
351344

352345
subroutine Interp3D (z1,v1,kk1,z,vout,ix,jx,kk)
@@ -366,8 +359,8 @@ subroutine Interp3D (z1,v1,kk1,z,vout,ix,jx,kk)
366359
do j = 1, jx
367360
do i = 1, ix
368361
do k = 1, kk
369-
! call interpLayer(abs(Z1),v1(i,j,1:kk1),kk1,abs( Z(k) ),vout(i,j,k))
370-
call interpLayer(Z1(1:kk1),v1(i,j,1:kk1),kk1,Z(k),vout(i,j,k))
362+
! call interpLayer(abs(Z1),v1(i,j,1:kk1),kk1,abs( Z(k) ),vout(i,j,k))
363+
call interpLayer(Z1(1:kk1),v1(i,j,1:kk1),kk1,Z(k),vout(i,j,k))
371364
end do
372365
end do
373366
end do
@@ -408,7 +401,7 @@ subroutine interpLayer(inZ,inV,inK,outZ,outV)
408401
if(inZ(k1) .eq. inZ(k2)) then
409402
write(6,*) "FATAL ERROR: inZ(k1)=inZ(k2) ", inZ(k1),inZ(k2)
410403
!stop 99
411-
stop("FATAL ERROR: In module_clm_HYDRO.F interpLayer()- inZ(k1)=inZ(k2)")
404+
stop("FATAL ERROR: In module_clm_HYDRO.F interpLayer()- inZ(k1)=inZ(k2)")
412405
end if
413406
w1 = (outZ-inZ(k1))/(inZ(k2)-inZ(k1))
414407
w2 = (inZ(k2)-outZ)/(inZ(k2)-inZ(k1))
@@ -692,7 +685,6 @@ subroutine output_nc(array,idim,jdim, var_name, file_name)
692685
iret = nf_inq_varid(ncid,var_name,varid)
693686
iret = nf_put_var_real(ncid,varid,array)
694687
iret=nf_close(ncid)
695-
return
696688
end subroutine output_nc
697689

698690
subroutine g2c_2d(lbc, ubc, lbl, ubl, lbg, ubg, num2d, carr, garr, &
@@ -995,7 +987,7 @@ subroutine g2c_2d_tmp(lbc, ubc, lbl, ubl, lbg, ubg, num2d, carr, garr, &
995987
!w_yw = scale_c2l(c) * scale_l2g(l) * wtgcell(c)
996988
w_yw = scale_c2l(c) * scale_l2g(l)
997989
if(w_yw .ne. 0) then
998-
if(abs(garr(g,j)) .gt. minv .and. abs(garr(g,j)) .lt. maxv) then
990+
if(abs(garr(g,j)) .gt. minv .and. abs(garr(g,j)) .lt. maxv) then
999991
! carr(c,j) = garr(g,j) / w_yw *sumwt(g)
1000992
yw_r = garr(g,j) / w_yw
1001993
if(yw_r .gt. 0) then

src/CPL/Noah_cpl/module_hrldas_HYDRO.F

-3
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ subroutine hrldas_cpl_HYDRO(STC,SMC,SH2OX,infxsrt,sfcheadrt,soldrain,ii,jj,kk, q
133133
!? not sure for the following
134134
! grid%xice(its:ite,jts:jte) = rt_domain(did)%sice
135135

136-
137-
return
138136
end subroutine hrldas_cpl_HYDRO
139137

140138
subroutine hrldas_cpl_HYDRO_ini(STC,SMC,SH2OX,infxsrt,sfcheadrt,soldrain,ii,jj,kk,kt,dt, olddate,zsoil)
@@ -234,7 +232,6 @@ subroutine hrldas_cpl_HYDRO_ini(STC,SMC,SH2OX,infxsrt,sfcheadrt,soldrain,ii,jj,k
234232
#endif
235233
endif
236234

237-
return
238235
end subroutine hrldas_cpl_HYDRO_ini
239236

240237
subroutine open_print_mpp(iunit)

src/Data_Rec/module_namelist.F

-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,6 @@ subroutine read_rt_nlst(nlst)
554554
if(channel_option .eq. 4) nlst%rtFlag = 0
555555
! if(CHANRTSWCRT .eq. 0 .and. SUBRTSWCRT .eq. 0 .and. OVRTSWCRT .eq. 0 .and. GWBASESWCRT .eq. 0) nlst%rtFlag = 0
556556
if(SUBRTSWCRT .eq. 0 .and. OVRTSWCRT .eq. 0 .and. GWBASESWCRT .eq. 0) nlst%rtFlag = 0
557-
return
558557
end subroutine read_rt_nlst
559558

560559
subroutine rt_nlst_check(nlst)

src/Land_models/Noah/HRLDAS_COLLECT_DATA/lib/module_grib1.F

+2-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ subroutine grib1_parameter_text_information(sec1, name, units, description)
3030
name = trim(grib1_parameter_table(sec1%parameter)%abbr)
3131
units = trim(grib1_parameter_table(sec1%parameter)%units)
3232
description = trim(grib1_parameter_table(sec1%parameter)%name)
33-
return
3433

3534
end subroutine grib1_parameter_text_information
3635

@@ -353,7 +352,6 @@ subroutine grib1_unpack_sec1(buffer, buffsize, iskip, sec1)
353352
write(sec1%hdate, '(I4.4,"-",I2.2,"-",I2.2,"_",I2.2,":",I2.2,":",I2.2)') &
354353
sec1%year, sec1%month, sec1%day, sec1%hour, sec1%minute, 00
355354

356-
return
357355
end subroutine grib1_unpack_sec1
358356

359357
!=================================================================================
@@ -609,7 +607,7 @@ end subroutine grib1_unpack_sec4
609607

610608
subroutine grib1_unpack_sec5(buffer, buffsize, iskip)
611609
implicit none
612-
! Real simple. Just check for the "7777" flag which marks the end of the
610+
! Real simple. Just check for the "7777" flag which marks the end of the
613611
! GRIB1 record.
614612
integer, intent(in) :: buffsize
615613
character(len=1), dimension(buffsize), intent(in) :: buffer
@@ -888,7 +886,7 @@ subroutine GRIB1_SGUP_BITMAP(grib, array, bitmap, nx, ny)
888886
889887
890888
891-
! Unpack the data according to packing parameters DFAC, BFAC, and XEC4(1),
889+
! Unpack the data according to packing parameters DFAC, BFAC, and XEC4(1),
892890
! and masked by the bitmap BITMAP.
893891
nn = 0
894892
do i = 1, ndat

src/Land_models/NoahMP/HRLDAS_forcing/lib/module_grib1.F

+2-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ subroutine grib1_parameter_text_information(sec1, name, units, description)
2727
name = trim(grib1_parameter_table(sec1%parameter)%abbr)
2828
units = trim(grib1_parameter_table(sec1%parameter)%units)
2929
description = trim(grib1_parameter_table(sec1%parameter)%name)
30-
return
3130

3231
end subroutine grib1_parameter_text_information
3332

@@ -350,7 +349,6 @@ subroutine grib1_unpack_sec1(buffer, buffsize, iskip, sec1)
350349
write(sec1%hdate, '(I4.4,"-",I2.2,"-",I2.2,"_",I2.2,":",I2.2,":",I2.2)') &
351350
sec1%year, sec1%month, sec1%day, sec1%hour, sec1%minute, 00
352351

353-
return
354352
end subroutine grib1_unpack_sec1
355353

356354
!=================================================================================
@@ -612,7 +610,7 @@ end subroutine grib1_unpack_sec4
612610

613611
subroutine grib1_unpack_sec5(buffer, buffsize, iskip)
614612
implicit none
615-
! Real simple. Just check for the "7777" flag which marks the end of the
613+
! Real simple. Just check for the "7777" flag which marks the end of the
616614
! GRIB1 record.
617615
integer, intent(in) :: buffsize
618616
character(len=1), dimension(buffsize), intent(in) :: buffer
@@ -891,7 +889,7 @@ subroutine GRIB1_SGUP_BITMAP(grib, array, bitmap, nx, ny)
891889
892890
893891
894-
! Unpack the data according to packing parameters DFAC, BFAC, and XEC4(1),
892+
! Unpack the data according to packing parameters DFAC, BFAC, and XEC4(1),
895893
! and masked by the bitmap BITMAP.
896894
nn = 0
897895
do i = 1, ndat

src/MPP/CPL_WRF.F

-7
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ subroutine CPL_LAND_INIT(istart,iend,jstart,jend)
104104
p_left_right = coords(1)
105105

106106
initialized = .false. ! land model need to be initialized.
107-
return
108107
END subroutine CPL_LAND_INIT
109108

110109
subroutine send_info()
@@ -133,7 +132,6 @@ subroutine send_info()
133132

134133
call MPI_barrier( HYDRO_COMM_WORLD ,ierr)
135134

136-
return
137135
end subroutine send_info
138136

139137
subroutine find_left()
@@ -150,7 +148,6 @@ subroutine find_left()
150148
return
151149
endif
152150
end do
153-
return
154151
end subroutine find_left
155152

156153
subroutine find_right()
@@ -167,7 +164,6 @@ subroutine find_right()
167164
return
168165
endif
169166
end do
170-
return
171167
end subroutine find_right
172168

173169
subroutine find_up()
@@ -184,7 +180,6 @@ subroutine find_up()
184180
return
185181
endif
186182
end do
187-
return
188183
end subroutine find_up
189184

190185
subroutine find_down()
@@ -201,7 +196,6 @@ subroutine find_down()
201196
return
202197
endif
203198
end do
204-
return
205199
end subroutine find_down
206200

207201
! stop the job due to the fatal error.
@@ -212,6 +206,5 @@ subroutine fatal_error_stop(msg)
212206
call flush(error_unit)
213207
CALL MPI_Abort(HYDRO_COMM_WORLD, 1, ierr)
214208
call MPI_Finalize(ierr)
215-
return
216209
end subroutine fatal_error_stop
217210
END MODULE MODULE_CPL_LAND

0 commit comments

Comments
 (0)