Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GNU -Wall Warning Reduction #1049

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion physics/CONV/Grell_Freitas/cu_gf_deep.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5531,7 +5531,7 @@ subroutine get_partition_liq_ice(ierr,tn,po_cup, p_liq_ice,melting_layer
,itf,ktf,its,ite, kts,kte, cumulus )
implicit none
character *(*), intent (in) :: cumulus
integer ,intent (in ) :: itf,ktf, its,ite, kts,kte
integer ,intent (in ) :: itf,ktf, its,ite, kts,kte
real(kind=kind_phys), intent (in ), dimension(its:ite,kts:kte) :: tn,po_cup
real(kind=kind_phys), intent (inout), dimension(its:ite,kts:kte) :: p_liq_ice,melting_layer
!$acc declare copyin(tn,po_cup) copy(p_liq_ice,melting_layer)
Expand Down
76 changes: 38 additions & 38 deletions physics/GWD/cires_tauamf_data.F90
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ subroutine read_tau_amf(me, master, errmsg, errflg)
if(iernc.ne.0) then
write(errmsg,'(*(a))') "read_tau_amf: cannot open file_limb_tab data-file ", &
trim(ugwp_taufile)
print *, 'cannot open ugwp-v1 tau-file=',trim(ugwp_taufile)
print *, 'cannot open ugwp-v1 tau-file=',trim(ugwp_taufile)
errflg = 1
return
else
Expand All @@ -47,26 +47,26 @@ subroutine read_tau_amf(me, master, errmsg, errflg)
status = nf90_inquire_dimension(ncid, DimID, len =ntau_d2t )

if (me == master) print *, ntau_d1y, ntau_d2t, ' dimd of tau_ngw ugwp-v1 '
if (ntau_d2t .le. 0 .or. ntau_d1y .le. 0) then
print *, 'ugwp-v1 tau-file=', trim(ugwp_taufile)
print *, ' ugwp-v1: ', 'ntau_d2t=',ntau_d2t, 'ntau_d2t=',ntau_d1y
stop
endif
if (ntau_d2t .le. 0 .or. ntau_d1y .le. 0) then
print *, 'ugwp-v1 tau-file=', trim(ugwp_taufile)
print *, ' ugwp-v1: ', 'ntau_d2t=',ntau_d2t, 'ntau_d2t=',ntau_d1y
stop
endif

if (.not.allocated(ugwp_taulat)) allocate (ugwp_taulat(ntau_d1y ))
if (.not.allocated(days_limb)) allocate (days_limb(ntau_d2t))
if (.not.allocated(tau_limb)) allocate (tau_limb(ntau_d1y, ntau_d2t ))
if (.not.allocated(tau_limb)) allocate (tau_limb(ntau_d1y, ntau_d2t ))

iernc=nf90_inq_varid( ncid, 'DAYS', vid )
iernc=nf90_inq_varid( ncid, 'DAYS', vid )
iernc= nf90_get_var( ncid, vid, days_limb)
iernc=nf90_inq_varid( ncid, 'LATS', vid )
iernc=nf90_inq_varid( ncid, 'LATS', vid )
iernc= nf90_get_var( ncid, vid, ugwp_taulat)
iernc=nf90_inq_varid( ncid, 'ABSMF', vid )
iernc=nf90_inq_varid( ncid, 'ABSMF', vid )
iernc= nf90_get_var( ncid, vid, tau_limb)

iernc=nf90_close(ncid)
iernc=nf90_close(ncid)

endif
endif

end subroutine read_tau_amf

Expand Down Expand Up @@ -97,21 +97,21 @@ subroutine cires_indx_ugwp (npts, me, master, dlat,j1_tau,j2_tau, w1_j1tau, w2_j


j2_tau(j) = min(j2_tau(j),ntau_d1y)
j1_tau(j) = max(j2_tau(j)-1,1)
j1_tau(j) = max(j2_tau(j)-1,1)

if (j1_tau(j) /= j2_tau(j) ) then
w2_j2tau(j) = (dlat(j) - ugwp_taulat(j1_tau(j))) &
/ (ugwp_taulat(j2_tau(j))-ugwp_taulat(j1_tau(j)))
/ (ugwp_taulat(j2_tau(j))-ugwp_taulat(j1_tau(j)))
else
w2_j2tau(j) = 1.0
endif
w1_j1tau(j) = 1.0 - w2_j2tau(j)
w1_j1tau(j) = 1.0 - w2_j2tau(j)
enddo
return
end subroutine cires_indx_ugwp

subroutine tau_amf_interp(me, master, im, idate, fhour, j1_tau,j2_tau, ddy_j1, ddy_j2, tau_ddd)
use machine, only: kind_phys
use machine, only: kind_phys
implicit none

!input
Expand All @@ -135,37 +135,37 @@ subroutine tau_amf_interp(me, master, im, idate, fhour, j1_tau,j2_tau, ddy_j1, d

it1 = 2
do iday=1, ntau_d2t
if (fddd .lt. days_limb(iday) ) then
it2 = iday
exit
endif
enddo
if (fddd .lt. days_limb(iday) ) then
it2 = iday
exit
endif
enddo

it2 = min(it2,ntau_d2t)
it1 = max(it2-1,1)
if (it2 > ntau_d2t ) then
print *, ' Error in time-interpolation for tau_amf_interp '
print *, ' it1, it2, ntau_d2t ', it1, it2, ntau_d2t
print *, ' Error in time-interpolation see cires_tauamf_data.F90 '
stop
endif
it2 = min(it2,ntau_d2t)
it1 = max(it2-1,1)
if (it2 > ntau_d2t ) then
print *, ' Error in time-interpolation for tau_amf_interp '
print *, ' it1, it2, ntau_d2t ', it1, it2, ntau_d2t
print *, ' Error in time-interpolation see cires_tauamf_data.F90 '
stop
endif

w2 = (fddd-days_limb(it1))/(days_limb(it2)-days_limb(it1))
w1 = 1.0-w2
w2 = (fddd-days_limb(it1))/(days_limb(it2)-days_limb(it1))
w1 = 1.0-w2

do i=1, im
j1 = j1_tau(i)
j2 = j2_tau(i)
tx1 = tau_limb(j1, it1)*ddy_j1(i)+tau_limb(j2, it1)*ddy_j2(i)
tx2 = tau_limb(j1, it2)*ddy_j1(i)+tau_limb(j2, it2)*ddy_j2(i)
tau_ddd(i) = tx1*w1 + w2*tx2
do i=1, im
j1 = j1_tau(i)
j2 = j2_tau(i)
tx1 = tau_limb(j1, it1)*ddy_j1(i)+tau_limb(j2, it1)*ddy_j2(i)
tx2 = tau_limb(j1, it2)*ddy_j1(i)+tau_limb(j2, it2)*ddy_j2(i)
tau_ddd(i) = tx1*w1 + w2*tx2
enddo

end subroutine tau_amf_interp

subroutine gfs_idate_calendar(idate, fhour, ddd, fddd)

use machine, only: kind_phys
use machine, only: kind_phys
implicit none
! input
integer, intent(in) :: idate(4)
Expand Down
2 changes: 1 addition & 1 deletion physics/GWD/ugwp_driver_v0.F
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ SUBROUTINE GWDPS_V0(IM, km, imx, do_tofd,
IF( do_tofd ) then
axtms(:,:) = 0.0 ; aytms(:,:) = 0.0


DO I = 1,npt
J = ipt(i)
zpbl =rgrav*phil( j, kpbl(j) )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function linterp_1D(this, var_name, year, month, day, hour, min, sec) result(err
this%tend1d%q = this%tend2d%q(:,1)
endif
end select

err_message = ""
end function linterp_1D

! ####################################################################################
Expand Down Expand Up @@ -163,6 +163,7 @@ function linterp_2D(this, var_name, lon, lat, year, month, day, hour, min, sec)
case("q")
this%tend1d%q = w1*this%tend3d%q(iNearest,:,ti(1)) + w2*this%tend3d%q(iNearest,:,tf(1))
end select
err_message = ""
end function linterp_2D

! ####################################################################################
Expand Down
2 changes: 1 addition & 1 deletion physics/MP/GFDL/module_gfdl_cloud_microphys.F90
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module gfdl_cloud_microphys_mod
logical :: module_is_initialized = .false.
logical :: qsmith_tables_initialized = .false.

character (len = 17) :: mod_name = 'gfdl_cloud_microphys'
character (len = 20) :: mod_name = 'gfdl_cloud_microphys'

real, parameter :: n0r = 8.0e6, n0s = 3.0e6, n0g = 4.0e6
real, parameter :: rhos = 0.1e3, rhog = 0.4e3
Expand Down
2 changes: 1 addition & 1 deletion physics/PBL/MYNN_EDMF/module_bl_mynn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2626,7 +2626,7 @@ SUBROUTINE mym_turbulence ( &
& sh, sm, &
& El, &
& Dfm, Dfh, Dfq, Tcd, Qcd, Pdk, Pdt, Pdq, Pdc, &
& qWT1D,qSHEAR1D,qBUOY1D,qDISS1D, &
& qWT1D,qSHEAR1D,qBUOY1D,qDISS1D, &
& tke_budget, &
& Psig_bl,Psig_shcu,cldfra_bl1D, &
& bl_mynn_mixlength, &
Expand Down
22 changes: 11 additions & 11 deletions physics/SFC_Models/Lake/CLM/clm_lake.f90
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ SUBROUTINE clm_lake_run( &
enddo
do k = -nlevsnow+1,nlevsoil
t_soisno(c,k) = t_soisno3d(i,k)
h2osoi_ice(c,k) = h2osoi_ice3d(i,k)
h2osoi_ice(c,k) = h2osoi_ice3d(i,k)
h2osoi_liq(c,k) = h2osoi_liq3d(i,k)
h2osoi_vol(c,k) = h2osoi_vol3d(i,k)
z(c,k) = z3d(i,k)
Expand Down Expand Up @@ -674,20 +674,20 @@ SUBROUTINE clm_lake_run( &
savedtke12d(i) = savedtke1(c)
snowdp2d(i) = snowdp(c)
h2osno2d(i) = h2osno(c)
snl2d(i) = snl(c)
snl2d(i) = snl(c)
t_grnd2d(i) = t_grnd(c)
do k = 1,nlevlake
t_lake3d(i,k) = t_lake(c,k)
lake_icefrac3d(i,k) = lake_icefrac(c,k)
lake_icefrac3d(i,k) = lake_icefrac(c,k)
enddo
do k = -nlevsnow+1,nlevsoil
z3d(i,k) = z(c,k)
dz3d(i,k) = dz(c,k)
t_soisno3d(i,k) = t_soisno(c,k)
h2osoi_liq3d(i,k) = h2osoi_liq(c,k)
h2osoi_ice3d(i,k) = h2osoi_ice(c,k)
do k = -nlevsnow+1,nlevsoil
z3d(i,k) = z(c,k)
dz3d(i,k) = dz(c,k)
t_soisno3d(i,k) = t_soisno(c,k)
h2osoi_liq3d(i,k) = h2osoi_liq(c,k)
h2osoi_ice3d(i,k) = h2osoi_ice(c,k)
h2osoi_vol3d(i,k) = h2osoi_vol(c,k)
enddo
enddo
do k = -nlevsnow+0,nlevsoil
zi3d(i,k) = zi(c,k)
enddo
Expand Down Expand Up @@ -2301,7 +2301,7 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & !
! unlike eflx_gnet
if(abs(errsoi(c)) > .001_kind_lake) then ! 1.e-5_kind_lake) then
WRITE( message,* )'Primary soil energy conservation error in shlake &
column during Tridiagonal Solution,', 'error (W/m^2):', c, errsoi(c)
&column during Tridiagonal Solution,', 'error (W/m^2):', c, errsoi(c)
errmsg=trim(message)
errflg=1
return
Expand Down
40 changes: 20 additions & 20 deletions physics/SFC_Models/Land/Noah/set_soilveg.f
Original file line number Diff line number Diff line change
Expand Up @@ -52,35 +52,35 @@ subroutine set_soilveg(me,isot,ivet,nlunit,errmsg,errflg)

!using umd veg table
slope_data =(/0.1, 0.6, 1.0, 0.35, 0.55, 0.8,
& 0.63, 0.0, 0.0, 0.0, 0.0, 0.0,
& 0.0 , 0.0, 0.0, 0.0, 0.0, 0.0,
& 0.0 , 0.0, 0.0, 0.0, 0.0, 0.0,
& 0.0 , 0.0, 0.0, 0.0, 0.0, 0.0/)
& 0.63, 0.0, 0.0, 0.0, 0.0, 0.0,
& 0.0 , 0.0, 0.0, 0.0, 0.0, 0.0,
& 0.0 , 0.0, 0.0, 0.0, 0.0, 0.0,
& 0.0 , 0.0, 0.0, 0.0, 0.0, 0.0/)
rsmtbl =(/300.0, 175.0, 175.0, 300.0, 300.0, 70.0,
& 20.0, 225.0, 225.0, 225.0, 400.0, 20.0,
& 150.0, 0.0, 0.0, 0.0, 0.0, 0.0,
& 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
& 0.0, 0.0, 0.0, 0.0, 0.0, 0.0/)
& 20.0, 225.0, 225.0, 225.0, 400.0, 20.0,
& 150.0, 0.0, 0.0, 0.0, 0.0, 0.0,
& 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
& 0.0, 0.0, 0.0, 0.0, 0.0, 0.0/)
c-----------------------------
rgltbl =(/30.0, 30.0, 30.0, 30.0, 30.0, 65.0,
& 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
& 100.0, 0.0, 0.0, 0.0, 0.0, 0.0,
& 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
& 0.0, 0.0, 0.0, 0.0, 0.0, 0.0/)
& 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
& 100.0, 0.0, 0.0, 0.0, 0.0, 0.0,
& 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
& 0.0, 0.0, 0.0, 0.0, 0.0, 0.0/)
hstbl =(/41.69, 54.53, 51.93, 47.35, 47.35, 54.53,
& 36.35, 42.00, 42.00, 42.00, 42.00, 36.35,
& 42.00, 0.00, 0.00, 0.00, 0.00, 0.00,
& 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,
& 0.00, 0.00, 0.00, 0.00, 0.00, 0.00/)
& 36.35, 42.00, 42.00, 42.00, 42.00, 36.35,
& 42.00, 0.00, 0.00, 0.00, 0.00, 0.00,
& 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,
& 0.00, 0.00, 0.00, 0.00, 0.00, 0.00/)
! changed for version 2.6 on june 2nd 2003
! data snupx /0.080, 0.080, 0.080, 0.080, 0.080, 0.080,
! & 0.040, 0.040, 0.040, 0.040, 0.025, 0.040,
! & 0.025, 0.000, 0.000, 0.000, 0.000, 0.000,
snupx =(/0.040, 0.040, 0.040, 0.040, 0.040, 0.040,
* 0.020, 0.020, 0.020, 0.020, 0.013, 0.020,
* 0.013, 0.000, 0.000, 0.000, 0.000, 0.000,
& 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,
& 0.000, 0.000, 0.000, 0.000, 0.000, 0.000/)
* 0.020, 0.020, 0.020, 0.020, 0.013, 0.020,
* 0.013, 0.000, 0.000, 0.000, 0.000, 0.000,
& 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,
& 0.000, 0.000, 0.000, 0.000, 0.000, 0.000/)

bare =11

Expand Down
2 changes: 1 addition & 1 deletion physics/SFC_Models/Land/Noah/sflx.f
Original file line number Diff line number Diff line change
Expand Up @@ -2660,7 +2660,7 @@ subroutine snopac

! t1 = tfreez * sncovr**snoexp + t12 * (1.0 - sncovr**snoexp)
t1 = tfreez * max(0.01,sncovr**snoexp) + &
& t12 * (1.0 - max(0.01,sncovr**snoexp))
& t12 * (1.0 - max(0.01,sncovr**snoexp))

beta = 1.0
ssoil = df1 * (t1 - stc(1)) / dtot
Expand Down
Loading
Loading