Skip to content

Commit

Permalink
more realkind changes
Browse files Browse the repository at this point in the history
	modified:   src/physics/carma/models/cirrus/carma_model_mod.F90
	modified:   src/physics/carma/models/cirrus/growevapl.F90
	modified:   src/physics/carma/models/cirrus_dust/carma_model_mod.F90
	modified:   src/physics/carma/models/cirrus_dust/growevapl.F90
	modified:   src/physics/carma/models/dust/carma_model_mod.F90
	modified:   src/physics/carma/models/meteor_impact/carma_model_flags_mod.F90
	modified:   src/physics/carma/models/meteor_impact/carma_model_mod.F90
	modified:   src/physics/carma/models/meteor_smoke/carma_model_mod.F90
	modified:   src/physics/carma/models/mixed_sulfate/carma_model_mod.F90
	modified:   src/physics/carma/models/pmc/carma_model_mod.F90
	modified:   src/physics/carma/models/pmc_sulfate/carma_model_mod.F90
	modified:   src/physics/carma/models/sea_salt/carma_model_mod.F90
	modified:   src/physics/carma/models/tholin/carma_model_mod.F90
	modified:   test/system/TR8.sh

	modified:   .gitmodules
  • Loading branch information
fvitt committed Nov 20, 2024
1 parent 687c0fe commit 1c4ae8b
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 48 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

[submodule "carma"]
path = src/physics/carma/base
url = https://github.com/ESCOMP/CARMA_base.git
url = https://github.com/fvitt/CARMA_base.git
fxrequired = AlwaysRequired
fxtag = carma4_07
fxDONOTUSEurl = https://github.com/ESCOMP/CARMA_base.git
fxtag = fe31ecd
fxDONOTUSEurl = https://github.com/fvitt/CARMA_base.git

[submodule "pumas"]
path = src/physics/pumas
Expand Down
8 changes: 4 additions & 4 deletions src/physics/carma/models/cirrus/carma_model_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ subroutine CARMA_DefineModel(carma, rc)
! Read in the tables.
call wrap_inq_varid(fid, 'wavelength', wave_vid)
call wrap_get_var_realx(fid, wave_vid, warren_wave)
warren_wave = warren_wave * 1e-4 ! um -> cm
warren_wave = warren_wave * 1e-4_r8 ! um -> cm

call wrap_inq_varid(fid, 'm_real', real_vid)
call wrap_get_var_realx(fid, real_vid, warren_real)
Expand Down Expand Up @@ -1344,7 +1344,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
! Now integrate the snow distribution. We know the snow amount, but need an effective radius
! to determine the snow number.
sub_d = 2._f * (r(NBIN) + (dr(NBIN) / 2._f)) * shapeFactor
sub_dd = (snow_max_d * 1e-4 - sub_d) / NINTS_SNOW
sub_dd = (snow_max_d * 1e-4_r8 - sub_d) / NINTS_SNOW
sub_d = sub_d + sub_dd / 2._f

remainder = 0._f
Expand All @@ -1361,7 +1361,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
! m = aD^2.1
!
! NOTE: This needs to match the density assumption made in the detrained ice bins.
remainder = remainder + nsnow / lambda * 4.22e-3_f * (sub_d**2.1)
remainder = remainder + nsnow / lambda * 4.22e-3_f * (sub_d**2.1_r8)

sub_d = sub_d + sub_dd
end do
Expand All @@ -1374,7 +1374,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
! Now integrate the snow distribution. We know the snow amount, but need an effective radius
! to determine the snow number.
snow_d = 2._f * ((r(NBIN) + dr(NBIN) / 2._f))
sub_dd = (snow_max_d * 1e-4 - snow_d) / NINTS_SNOW
sub_dd = (snow_max_d * 1e-4_r8 - snow_d) / NINTS_SNOW
sub_d = snow_d + (sub_dd / 2._f)

snow_r3 = 0._f
Expand Down
2 changes: 1 addition & 1 deletion src/physics/carma/models/cirrus/growevapl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ subroutine growevapl(carma, cstate, iz, rc)

if( x .lt. 1._f )then
growlg(ibin,igroup) = dmdt(ibin)/pc(iz,ibin,iepart) &
* ( ar(ibin) - 0.5*dela(ibin)*x + &
* ( ar(ibin) - 0.5_r8*dela(ibin)*x + &
(x/2._f - x**2/3._f)*a6(ibin) )
else
growlg(ibin,igroup) = dmdt(ibin) / dm(ibin,igroup)
Expand Down
12 changes: 6 additions & 6 deletions src/physics/carma/models/cirrus_dust/carma_model_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ subroutine CARMA_DefineModel(carma, rc)
! Read in the tables.
call wrap_inq_varid(fid, 'wavelength', wave_vid)
call wrap_get_var_realx(fid, wave_vid, warren_wave)
warren_wave = warren_wave * 1e-4 ! um -> cm
warren_wave = warren_wave * 1e-4_r8 ! um -> cm

call wrap_inq_varid(fid, 'm_real', real_vid)
call wrap_get_var_realx(fid, real_vid, warren_real)
Expand Down Expand Up @@ -1386,7 +1386,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
! Now integrate the snow distribution. We know the snow amount, but need an effective radius
! to determine the snow number.
sub_d = 2._f * (r(NBIN) + (dr(NBIN) / 2._f)) * shapeFactor
sub_dd = (snow_max_d * 1e-4 - sub_d) / NINTS_SNOW
sub_dd = (snow_max_d * 1e-4_r8 - sub_d) / NINTS_SNOW
sub_d = sub_d + sub_dd / 2._f

remainder = 0._f
Expand All @@ -1403,7 +1403,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
! m = aD^2.1
!
! NOTE: This needs to match the density assumption made in the detrained ice bins.
remainder = remainder + nsnow / lambda * 4.22e-3_f * (sub_d**2.1)
remainder = remainder + nsnow / lambda * 4.22e-3_f * (sub_d**2.1_r8)

sub_d = sub_d + sub_dd
end do
Expand All @@ -1416,7 +1416,7 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
! Now integrate the snow distribution. We know the snow amount, but need an effective radius
! to determine the snow number.
snow_d = 2._f * ((r(NBIN) + dr(NBIN) / 2._f))
sub_dd = (snow_max_d * 1e-4 - snow_d) / NINTS_SNOW
sub_dd = (snow_max_d * 1e-4_r8 - snow_d) / NINTS_SNOW
sub_d = snow_d + (sub_dd / 2._f)

snow_r3 = 0._f
Expand Down Expand Up @@ -2570,7 +2570,7 @@ subroutine CARMA_SurfaceWind(carma, state, icol, ilat, ilon, ielem, igroup, ibin
* sqrt(1._r8 + .006_r8/rhop(ibin)/GRAV/(r(ibin)*2._r8)**2.5_r8) &
/ sqrt(1.928_r8*(1331._r8*(r(ibin)*2._r8)**1.56_r8 + .38_r8)**.092_r8 - 1._r8)
else
uth = uthfact*1.e-2_r8* 0.13_r8 * sqrt(rhop(ibin)*GRAV*(.75e-4_r8)*2./rhoa) &
uth = uthfact*1.e-2_r8* 0.13_r8 * sqrt(rhop(ibin)*GRAV*(.75e-4_r8)*2._r8/rhoa) &
* sqrt(1._r8 + .006_r8/rhop(ibin)/GRAV/((.75e-4_r8)*2._r8)**2.5_r8) &
/ sqrt(1.928_r8*(1331._r8*((.75e-4_r8)*2._r8)**1.56_r8 + .38_r8)**.092_r8 - 1._r8)
endif
Expand Down Expand Up @@ -2703,7 +2703,7 @@ subroutine WeibullWind(u, uth, n, uwb, wbk)
if (present(wbk)) then
k = wbk
else
k = 0.94*u**0.5_r8 ! follow Grini and Zender, 2004JGR
k = 0.94_r8*u**0.5_r8 ! follow Grini and Zender, 2004JGR
! k = 2.5_r8 ! Lansing's estimate
end if

Expand Down
2 changes: 1 addition & 1 deletion src/physics/carma/models/cirrus_dust/growevapl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ subroutine growevapl(carma, cstate, iz, rc)

if( x .lt. 1._f )then
growlg(ibin,igroup) = dmdt(ibin)/pc(iz,ibin,iepart) &
* ( ar(ibin) - 0.5*dela(ibin)*x + &
* ( ar(ibin) - 0.5_r8*dela(ibin)*x + &
(x/2._f - x**2/3._f)*a6(ibin) )
else
growlg(ibin,igroup) = dmdt(ibin) / dm(ibin,igroup)
Expand Down
4 changes: 2 additions & 2 deletions src/physics/carma/models/dust/carma_model_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ subroutine CARMAMODEL_SurfaceWind(carma, state, icol, ielem, igroup, ibin, cam_i
* sqrt(1._r8 + .006_r8/rhop(ibin)/GRAV/(r(ibin)*2._r8)**2.5_r8) &
/ sqrt(1.928_r8*(1331._r8*(r(ibin)*2._r8)**1.56_r8 + .38_r8)**.092_r8 - 1._r8)
else
uth = uthfact*1.e-2_r8* 0.13_r8 * sqrt(rhop(ibin)*GRAV*(.75e-4_r8)*2./rhoa) &
uth = uthfact*1.e-2_r8* 0.13_r8 * sqrt(rhop(ibin)*GRAV*(.75e-4_r8)*2._r8/rhoa) &
* sqrt(1._r8 + .006_r8/rhop(ibin)/GRAV/((.75e-4_r8)*2._r8)**2.5_r8) &
/ sqrt(1.928_r8*(1331._r8*((.75e-4_r8)*2._r8)**1.56_r8 + .38_r8)**.092_r8 - 1._r8)
endif
Expand Down Expand Up @@ -853,7 +853,7 @@ subroutine WeibullWind(u, uth, n, uwb, wbk)
if (present(wbk)) then
k = wbk
else
k = 0.94*u**0.5_r8 ! follow Grini and Zender, 2004JGR
k = 0.94_r8*u**0.5_r8 ! follow Grini and Zender, 2004JGR
! k = 2.5_r8 ! Lansing's estimate
end if

Expand Down
20 changes: 10 additions & 10 deletions src/physics/carma/models/meteor_impact/carma_model_flags_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ module carma_model_flags_mod
!
! Create a public definition of any new namelist variables that you wish to have,
! and default them to an inital value.
real(r8), public :: carma_emis_dust = 0._r8 !! Total dust emission for the event (kg)
real(r8), public :: carma_emis_soot = 0._r8 !! Total soot emission for the event (kg)
integer, public :: carma_emis_startdate = 1 !! start year and day of year (yyyyddd)
integer, public :: carma_emis_stopdate = 1 !! stop year and day of year (yyyyddd)
integer, public :: carma_emis_starttime = 0 !! start time of day (s)
integer, public :: carma_emis_stoptime = 0 !! stop time of day (s)
real(r8), public :: carma_emis_minlat = -90. !! minimum latitude
real(r8), public :: carma_emis_maxlat = 90. !! maximum latitude
real(r8), public :: carma_emis_minlon = 0. !! minimum longitude
real(r8), public :: carma_emis_maxlon = 360. !! maximum longitude
real(r8), public :: carma_emis_dust = 0._r8 !! Total dust emission for the event (kg)
real(r8), public :: carma_emis_soot = 0._r8 !! Total soot emission for the event (kg)
integer, public :: carma_emis_startdate = 1 !! start year and day of year (yyyyddd)
integer, public :: carma_emis_stopdate = 1 !! stop year and day of year (yyyyddd)
integer, public :: carma_emis_starttime = 0 !! start time of day (s)
integer, public :: carma_emis_stoptime = 0 !! stop time of day (s)
real(r8), public :: carma_emis_minlat = -90._r8 !! minimum latitude
real(r8), public :: carma_emis_maxlat = 90._r8 !! maximum latitude
real(r8), public :: carma_emis_minlon = 0._r8 !! minimum longitude
real(r8), public :: carma_emis_maxlon = 360._r8 !! maximum longitude
logical, public :: carma_fractal_soot = .false. !! fractal Soot

contains
Expand Down
8 changes: 4 additions & 4 deletions src/physics/carma/models/meteor_impact/carma_model_mod.F90
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,10 @@ subroutine CARMAMODEL_InitializeModel(carma, lq_carma, pbuf2d, rc)

! NOTE: The dust distribution has not been specified yet, but it should be different
! from the soot.
real(kind=f), parameter :: rm_dust = 0.11 ! dust mean radius (um)
real(kind=f), parameter :: sigma_dust = 1.6 ! dust variance
real(kind=f), parameter :: rm_soot = 0.11 ! soot mean radius (um)
real(kind=f), parameter :: sigma_soot = 1.6 ! soot variance
real(kind=f), parameter :: rm_dust = 0.11_r8 ! dust mean radius (um)
real(kind=f), parameter :: sigma_dust = 1.6_r8 ! dust variance
real(kind=f), parameter :: rm_soot = 0.11_r8 ! soot mean radius (um)
real(kind=f), parameter :: sigma_soot = 1.6_r8 ! soot variance

integer :: i
real(kind=f) :: r(NBIN)
Expand Down
6 changes: 3 additions & 3 deletions src/physics/carma/models/meteor_smoke/carma_model_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ subroutine CARMAMODEL_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in,
end if
end do

if (abs((state%lat(icol) / DEG2RAD) - 90.0) <= 0.00001_r8) then
if (abs((state%lat(icol) / DEG2RAD) - 90.0_r8) <= 0.00001_r8) then
rfScale(icol) = carma_escale_grf(carma_escale_nLats, doy)
end if

Expand Down Expand Up @@ -576,15 +576,15 @@ subroutine CARMAMODEL_InitializeModel(carma, lq_carma, pbuf2d, rc)
carma_emis_ilev_max = carma_emis_nLevs

do ilev = 1, carma_emis_nLevs
if (carma_emis_rate(ilev) <= 0.0) then
if (carma_emis_rate(ilev) <= 0.0_r8) then
carma_emis_ilev_min = ilev + 1
else
exit
endif
end do

do ilev = carma_emis_nLevs, 1, -1
if (carma_emis_rate(ilev) <= 0.0) then
if (carma_emis_rate(ilev) <= 0.0_r8) then
carma_emis_ilev_max = ilev - 1
else
exit
Expand Down
6 changes: 3 additions & 3 deletions src/physics/carma/models/mixed_sulfate/carma_model_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ subroutine CARMAMODEL_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in,
end if
end do

if (abs((state%lat(icol) / DEG2RAD) - 90.0) <= 0.00001_r8) then
if (abs((state%lat(icol) / DEG2RAD) - 90.0_r8) <= 0.00001_r8) then
rfScale(icol) = carma_escale_grf(carma_escale_nLats, doy)
end if

Expand Down Expand Up @@ -655,15 +655,15 @@ subroutine CARMAMODEL_InitializeModel(carma, lq_carma, pbuf2d, rc)
carma_emis_ilev_max = carma_emis_nLevs

do ilev = 1, carma_emis_nLevs
if (carma_emis_rate(ilev) <= 0.0) then
if (carma_emis_rate(ilev) <= 0.0_r8) then
carma_emis_ilev_min = ilev + 1
else
exit
endif
end do

do ilev = carma_emis_nLevs, 1, -1
if (carma_emis_rate(ilev) <= 0.0) then
if (carma_emis_rate(ilev) <= 0.0_r8) then
carma_emis_ilev_max = ilev - 1
else
exit
Expand Down
8 changes: 4 additions & 4 deletions src/physics/carma/models/pmc/carma_model_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ subroutine CARMAMODEL_DefineModel(carma, rc)
! Read in the tables.
call wrap_inq_varid(fid, 'wavelength', wave_vid)
call wrap_get_var_realx(fid, wave_vid, warren_wave)
warren_wave = warren_wave * 1e-4 ! um -> cm
warren_wave = warren_wave * 1e-4_r8 ! um -> cm

call wrap_inq_varid(fid, 'm_real', real_vid)
call wrap_get_var_realx(fid, real_vid, warren_real)
Expand Down Expand Up @@ -562,7 +562,7 @@ subroutine CARMAMODEL_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in,
end if
end do

if (abs((state%lat(icol) / DEG2RAD) - 90.0) <= 0.00001_r8) then
if (abs((state%lat(icol) / DEG2RAD) - 90.0_r8) <= 0.00001_r8) then
rfScale(icol) = carma_escale_grf(carma_escale_nLats, doy)
end if

Expand Down Expand Up @@ -693,15 +693,15 @@ subroutine CARMAMODEL_InitializeModel(carma, lq_carma, pbuf2d, rc)
carma_emis_ilev_max = carma_emis_nLevs

do ilev = 1, carma_emis_nLevs
if (carma_emis_rate(ilev) <= 0.0) then
if (carma_emis_rate(ilev) <= 0.0_r8) then
carma_emis_ilev_min = ilev + 1
else
exit
endif
end do

do ilev = carma_emis_nLevs, 1, -1
if (carma_emis_rate(ilev) <= 0.0) then
if (carma_emis_rate(ilev) <= 0.0_r8) then
carma_emis_ilev_max = ilev - 1
else
exit
Expand Down
8 changes: 4 additions & 4 deletions src/physics/carma/models/pmc_sulfate/carma_model_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ subroutine CARMA_DefineModel(carma, rc)
! Read in the tables.
call wrap_inq_varid(fid, 'wavelength', wave_vid)
call wrap_get_var_realx(fid, wave_vid, warren_wave)
warren_wave = warren_wave * 1e-4 ! um -> cm
warren_wave = warren_wave * 1e-4_r8 ! um -> cm

call wrap_inq_varid(fid, 'm_real', real_vid)
call wrap_get_var_realx(fid, real_vid, warren_real)
Expand Down Expand Up @@ -617,7 +617,7 @@ subroutine CARMA_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in, tend
end if
end do

if (abs((state%lat(icol) / DEG2RAD) - 90.0) <= 0.00001_r8) then
if (abs((state%lat(icol) / DEG2RAD) - 90.0_r8) <= 0.00001_r8) then
rfScale(icol) = carma_escale_grf(carma_escale_nLats, doy)
end if

Expand Down Expand Up @@ -753,15 +753,15 @@ subroutine CARMA_InitializeModel(carma, lq_carma, rc)
carma_emis_ilev_max = carma_emis_nLevs

do ilev = 1, carma_emis_nLevs
if (carma_emis_rate(ilev) <= 0.0) then
if (carma_emis_rate(ilev) <= 0.0_r8) then
carma_emis_ilev_min = ilev + 1
else
exit
endif
end do

do ilev = carma_emis_nLevs, 1, -1
if (carma_emis_rate(ilev) <= 0.0) then
if (carma_emis_rate(ilev) <= 0.0_r8) then
carma_emis_ilev_max = ilev - 1
else
exit
Expand Down
6 changes: 3 additions & 3 deletions src/physics/carma/models/sea_salt/carma_model_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ subroutine CARMAMODEL_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in,
!**********************************
! wet sea salt radius at RH = 80%
!**********************************
r80cm = (c1 * (r(ibin)) ** c2 / (c3 * r(ibin) ** c4 - log10(0.8)) + (r(ibin))**3) ** (1./3.) ! [cm]
r80cm = (c1 * (r(ibin)) ** c2 / (c3 * r(ibin) ** c4 - log10(0.8_r8)) + (r(ibin))**3) ** (1._r8/3._r8) ! [cm]
rdrycm = r(ibin) ! [cm]
r80 = r80cm *1.e4_r8 ! [um]
rdry = rdrycm*1.e4_r8 ! [um]
Expand Down Expand Up @@ -552,7 +552,7 @@ subroutine CARMAMODEL_EmitParticle(carma, ielem, ibin, icnst, dt, state, cam_in,
!Monahan
B_mona = (0.38_r8 - log10(r80)) / 0.65_r8
Monahan = 1.373_r8 * (u10in**3.41_r8) * r80**(-3._r8) * &
(1._r8 + 0.057 *r80**1.05_r8) * 10._r8 ** (1.19_r8 * exp(-1. * B_mona**2)) ! dF/dr
(1._r8 + 0.057_r8 *r80**1.05_r8) * 10._r8 ** (1.19_r8 * exp(-1._r8 * B_mona**2)) ! dF/dr

!Smith
u14 = u10in * (1._r8 + cd_smith**0.5_r8 / xkar * log(14._r8 / 10._r8)) ! 14 meter wind
Expand Down Expand Up @@ -846,7 +846,7 @@ subroutine WeibullWind(u, uth, n, uwb, wbk)
if (present(wbk)) then
k = wbk
else
k = 0.94*u**0.5_r8 ! follow Grini and Zender, 2004JGR
k = 0.94_r8*u**0.5_r8 ! follow Grini and Zender, 2004JGR
! k = 2.5_r8 ! Lansing's estimate
end if

Expand Down
Empty file modified src/physics/carma/models/tholin/carma_model_mod.F90
100755 → 100644
Empty file.
4 changes: 4 additions & 0 deletions test/system/TR8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/components/cam/src/physics/cam
rc=$?
ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/components/cam/src/physics/camrt
rc=`expr $? + $rc`
ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/components/cam/src/physics/carma
rc=`expr $? + $rc`
ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/components/cam/src/physics/rrtmg -s aer_src
rc=`expr $? + $rc`
ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/components/cam/src/physics/rrtmgp -s data,ext
Expand All @@ -27,6 +29,8 @@ ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/src/physics/cam
rc=$?
ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/src/physics/camrt
rc=`expr $? + $rc`
ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/src/physics/carma
rc=$?
ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/src/physics/rrtmg -s aer_src
rc=`expr $? + $rc`
ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/src/physics/rrtmgp -s data,ext
Expand Down

0 comments on commit 1c4ae8b

Please sign in to comment.