Skip to content

Commit

Permalink
Switch to another version of the code that works with 64 bit
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelTrahanNOAA committed May 5, 2022
1 parent e7c42c7 commit 63020ec
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 48 deletions.
4 changes: 2 additions & 2 deletions physics/GFS_rrtmgp_cloud_overlap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ subroutine GFS_rrtmgp_cloud_overlap_run(nCol, nLev, yearlen, doSWrad, doLWrad,
! Cloud overlap parameter
!
if (iovr == iovr_dcorr .or. iovr == iovr_exp .or. iovr == iovr_exprand) then
call get_alpha_exper(nCol, nLev, iovr, iovr_exprand, deltaZc*0.001_kind_phys, de_lgth, cld_frac, cloud_overlap_param)
call get_alpha_exper(nCol, nLev, iovr, iovr_exprand, deltaZc*0.001, de_lgth, cld_frac, cloud_overlap_param)
else
de_lgth(:) = 0.
cloud_overlap_param(:,:) = 0.
Expand All @@ -110,7 +110,7 @@ subroutine GFS_rrtmgp_cloud_overlap_run(nCol, nLev, yearlen, doSWrad, doLWrad,
!
if (imfdeepcnv == imfdeepcnv_samf .or. imfdeepcnv == imfdeepcnv_gf) then
if (iovr_convcld == iovr_dcorr .or. iovr_convcld == iovr_exp .or. iovr_convcld == iovr_exprand) then
call get_alpha_exper(nCol, nLev, iovr_convcld, iovr_exprand, deltaZc*0.001_kind_phys, de_lgth, cld_cnv_frac, cnv_cloud_overlap_param)
call get_alpha_exper(nCol, nLev, iovr_convcld, iovr_exprand, deltaZc*0.001, de_lgth, cld_cnv_frac, cnv_cloud_overlap_param)
else
de_lgth(:) = 0.
cnv_cloud_overlap_param(:,:) = 0.
Expand Down
10 changes: 5 additions & 5 deletions physics/GFS_suite_interstitial_4.F90
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, tracers_total, ntr
qc_mp(i,k) = (clw(i,k,2)-save_qc(i,k)) / (one-spechum(i,k))
!> - Convert number concentration from moist to dry
nc_mp(i,k) = gq0(i,k,ntlnc) / (one-spechum(i,k))
nc_mp(i,k) = max(zero, nc_mp(i,k) + make_DropletNumber(real(qc_mp(i,k) * rho), real(nwfa(i,k)*rho)) * orho)
nc_mp(i,k) = max(zero, nc_mp(i,k) + make_DropletNumber(qc_mp(i,k) * rho, nwfa(i,k)*rho) * orho)
!> - Convert number concentrations from dry to moist
gq0(i,k,ntlnc) = nc_mp(i,k) / (one+qv_mp(i,k))
endif
Expand All @@ -233,7 +233,7 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, tracers_total, ntr
qi_mp(i,k) = (clw(i,k,1)-save_qi(i,k)) / (one-spechum(i,k))
!> - Convert number concentration from moist to dry
ni_mp(i,k) = gq0(i,k,ntinc) / (one-spechum(i,k))
ni_mp(i,k) = max(zero, ni_mp(i,k) + make_IceNumber(real(qi_mp(i,k) * rho), real(save_tcp(i,k)) * orho))
ni_mp(i,k) = max(zero, ni_mp(i,k) + make_IceNumber(qi_mp(i,k) * rho, save_tcp(i,k)) * orho)
!> - Convert number concentrations from dry to moist
gq0(i,k,ntinc) = ni_mp(i,k) / (one+qv_mp(i,k))
endif
Expand All @@ -249,13 +249,13 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, tracers_total, ntr
!> - Update cloud water mixing ratio
qc_mp(i,k) = (clw(i,k,2)-save_qc(i,k))
!> - Update cloud water number concentration
gq0(i,k,ntlnc) = max(zero, gq0(i,k,ntlnc) + make_DropletNumber(real(qc_mp(i,k) * rho), real(nwfa(i,k)*rho)) * orho)
gq0(i,k,ntlnc) = max(zero, gq0(i,k,ntlnc) + make_DropletNumber(qc_mp(i,k) * rho, nwfa(i,k)*rho) * orho)
endif
if (ntinc>0) then
!> - Update cloud ice mixing ratio
qi_mp(i,k) = (clw(i,k,1)-save_qi(i,k))
!> - Update cloud ice number concentration
gq0(i,k,ntinc) = max(zero, gq0(i,k,ntinc) + make_IceNumber(real(qi_mp(i,k) * rho), real(save_tcp(i,k))) * orho)
gq0(i,k,ntinc) = max(zero, gq0(i,k,ntinc) + make_IceNumber(qi_mp(i,k) * rho, save_tcp(i,k)) * orho)
endif
enddo
enddo
Expand Down Expand Up @@ -290,4 +290,4 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, tracers_total, ntr

end subroutine GFS_suite_interstitial_4_run

end module GFS_suite_interstitial_4
end module GFS_suite_interstitial_4
4 changes: 0 additions & 4 deletions physics/cires_ugwp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@ module cires_ugwp

use cires_ugwpv0_module, only: knob_ugwp_version, cires_ugwpv0_mod_init, cires_ugwpv0_mod_finalize
use ugwp_driver_v0

use gwdps, only: gwdps_run

use cires_ugwp_triggers

use ugwp_driver_v0

implicit none

private
Expand Down
2 changes: 1 addition & 1 deletion physics/cires_ugwpv1_oro.F90
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module cires_ugwpv1_oro
use cires_ugwpv1_sporo
use cires_ugwpv1_sporo
contains

subroutine orogw_v1 (im, km, imx, me, master, dtp, kdt, do_tofd, &
Expand Down
2 changes: 2 additions & 0 deletions physics/hedmf.f
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
!> This module contains the CCPP-compliant hybrid eddy-diffusivity mass-flux
!! scheme.
module hedmf

use tridi_mod
use mfpbl_mod

contains

!> \section arg_table_hedmf_init Argument Table
Expand Down
14 changes: 7 additions & 7 deletions physics/maximum_hourly_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ subroutine max_fields(phil,ref3D,grav,im,levs,refd,tk,refd263k)
real (kind=kind_phys), intent(in) :: grav
real (kind=kind_phys), intent(in),dimension(:,:) :: phil,ref3D,tk
integer :: i,k,ll,ipt,kpt
real(kind_phys) :: dbz1avg,zmidp1,zmidloc,refl,fact
real(kind_phys), dimension(im,levs) :: z
real(kind_phys), dimension(im) :: zintsfc
real(kind_phys), dimension(:), intent(inout) :: refd,refd263k
REAL(kind_phys) :: dbz1(2),dbzk,dbzk1
real :: dbz1avg,zmidp1,zmidloc,refl,fact
real, dimension(im,levs) :: z
real, dimension(im) :: zintsfc
real, dimension(:), intent(inout) :: refd,refd263k
REAL :: dbz1(2),dbzk,dbzk1
logical :: counter
do i=1,im
do k=1,levs
Expand Down Expand Up @@ -185,7 +185,7 @@ subroutine max_fields(phil,ref3D,grav,im,levs,refd,tk,refd263k)
dbz1avg=dbz1(2)+(dbz1(2)-dbz1(1))*fact
!-- Convert to dBZ (10*logZ) as the last step
if (dbz1avg>0.01) then
dbz1avg=10.*log10(dbz1avg)
dbz1avg=10.*alog10(dbz1avg)
else
dbz1avg=-35.
endif
Expand Down Expand Up @@ -214,7 +214,7 @@ subroutine max_fields(phil,ref3D,grav,im,levs,refd,tk,refd263k)
dbz1avg=maxval(dbz1)
!-- Convert to dBZ (10*logZ) as the last step
if (dbz1avg>0.01) then
dbz1avg=10.*log10(dbz1avg)
dbz1avg=10.*alog10(dbz1avg)
else
dbz1avg=-35.
endif
Expand Down
23 changes: 18 additions & 5 deletions physics/module_bl_mynn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1384,11 +1384,9 @@ SUBROUTINE boulac_length0(k,kts,kte,zw,dz,qtke,theta,lb1,lb2)
dld = min(dld,zw(k+1))!not used in PBL anyway, only free atmos
lb1 = min(dlu,dld) !minimum
!JOE-fight floating point errors
#ifdef SINGLE_PREC
!JM: keep up the fight, JOE
dlu=MAX(0.1,MIN(dlu,1000.))
dld=MAX(0.1,MIN(dld,1000.))
#endif
lb2 = sqrt(dlu*dld) !average - biased towards smallest
!lb2 = 0.5*(dlu+dld) !average

Expand Down Expand Up @@ -1542,11 +1540,9 @@ SUBROUTINE boulac_length(kts,kte,zw,dz,qtke,theta,lb1,lb2)
dld(iz) = min(dld(iz),zw(iz+1))!not used in PBL anyway, only free atmos
lb1(iz) = min(dlu(iz),dld(iz)) !minimum
!JOE-fight floating point errors
#ifdef SINGLE_PREC
!JM: keep up the fight, JOE
dlu(iz)=MAX(0.1,MIN(dlu(iz),1000.))
dld(iz)=MAX(0.1,MIN(dld(iz),1000.))
#endif
lb2(iz) = sqrt(dlu(iz)*dld(iz)) !average - biased towards smallest
!lb2(iz) = 0.5*(dlu(iz)+dld(iz)) !average

Expand Down Expand Up @@ -2955,8 +2951,12 @@ SUBROUTINE mym_condensation (kts,kte, &
zagl = zagl + dz(k)

!CLOUD WATER AND ICE
IF (q1k < 0.) THEN !unstaurated
IF (q1k < 0.) THEN !unsaturated
#ifdef SINGLE_PREC
ql_water = sgm(k)*EXP(1.2*q1k-1.)
#else
ql_water = sgm(k)*EXP(1.2*q1k-1)
#endif
ql_ice = sgm(k)*EXP(1.2*q1k-1.)
!Reduce ice mixing ratios in the upper troposphere
! low_weight = MIN(MAX(p(k)-40000.0, 0.0),40000.0)/40000.0
Expand Down Expand Up @@ -7608,15 +7608,28 @@ FUNCTION qsat_blend(t, P, waterice)

IF ((t .GE. 273.16) .OR. (wrt .EQ. 'w')) THEN
ESL = J0+XC*(J1+XC*(J2+XC*(J3+XC*(J4+XC*(J5+XC*(J6+XC*(J7+XC*J8)))))))
#ifdef SINGLE_PREC
qsat_blend = 0.622*ESL/max((P-ESL),1.0E-7_kind_phys)
#else
qsat_blend = 0.622*ESL/(P-ESL)
#endif
ELSE IF (t .LE. 253.) THEN
ESI = K0+XC*(K1+XC*(K2+XC*(K3+XC*(K4+XC*(K5+XC*(K6+XC*(K7+XC*K8)))))))
#ifdef SINGLE_PREC
qsat_blend = 0.622*ESI/max((P-ESI),1.0E-7_kind_phys)
#else
qsat_blend = 0.622*ESI/(P-ESI)
#endif
ELSE
ESL = J0+XC*(J1+XC*(J2+XC*(J3+XC*(J4+XC*(J5+XC*(J6+XC*(J7+XC*J8)))))))
ESI = K0+XC*(K1+XC*(K2+XC*(K3+XC*(K4+XC*(K5+XC*(K6+XC*(K7+XC*K8)))))))
#ifdef SINGLE_PREC
RSLF = 0.622*ESL/max((P-ESL),1.0E-7_kind_phys)
RSIF = 0.622*ESI/max((P-ESI),1.0E-7_kind_phys)
#else
RSLF = 0.622*ESL/(P-ESL)
RSIF = 0.622*ESI/(P-ESI)
#endif
chi = (273.16-t)/20.16
qsat_blend = (1.-chi)*RSLF + chi*RSIF
END IF
Expand Down
4 changes: 2 additions & 2 deletions physics/module_sf_mynn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2804,8 +2804,8 @@ SUBROUTINE znot_m_v6(uref, znotm)
! znotm(meter): areodynamical roughness scale over water
!

REAL, INTENT(IN) :: uref
REAL, INTENT(OUT):: znotm
REAL(kind=kind_phys), INTENT(IN) :: uref
REAL(kind=kind_phys), INTENT(OUT):: znotm
real(kind=kind_phys), parameter :: p13 = -1.296521881682694e-02,&
& p12 = 2.855780863283819e-01, p11 = -1.597898515251717e+00,&
& p10 = -8.396975715683501e+00, &
Expand Down
4 changes: 2 additions & 2 deletions physics/module_sf_noahmplsm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ subroutine noahmp_sflx (parameters, &
logical :: dveg_active !< flag to run dynamic vegetation
logical :: crop_active !< flag to run crop model
! add canopy heat storage (C.He added based on GY Niu's communication)
real (kind=kind_phys) :: canhs ! canopy heat storage change w/m2
real :: canhs ! canopy heat storage change w/m2
! maximum lai/sai used for some parameterizations based on plant growthi


Expand Down Expand Up @@ -4494,7 +4494,7 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , &
if(opt_sfc == 3) then
call sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur , & !in
zlvl ,tgb ,thsfc_loc,prslkix,prsik1x ,prslk1x ,z0m , & !in
zpd ,snowh,shdfac ,garea1 ,.false. ,0.0_kind_phys,ivgtyp , & !in
zpd ,snowh,shdfac ,garea1 ,.false. ,0.0,ivgtyp , & !in
ustarx ,fm ,fh ,fm2 ,fh2 , & !inout
z0h ,fv ,csigmaf0,cm ,ch ) !out

Expand Down
5 changes: 2 additions & 3 deletions physics/module_sf_ruclsm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7603,11 +7603,10 @@ END SUBROUTINE SOILIN
!>\ingroup lsm_ruc_group
!> This function calculates the liquid saturation vapor mixing ratio as
!! a function of temperature and pressure (from Thompson scheme).
FUNCTION RSLF(P,T)
REAL FUNCTION RSLF(P,T)

IMPLICIT NONE
REAL(kind_phys), INTENT(IN):: P, T
REAL(kind_phys) :: RSLF
REAL, INTENT(IN):: P, T
REAL:: ESL,X
REAL, PARAMETER:: C0= .611583699E03
REAL, PARAMETER:: C1= .444606896E02
Expand Down
24 changes: 11 additions & 13 deletions physics/module_soil_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ module module_soil_pre

!tgs Initialize RUC LSM levels, soil temp/moisture

use machine, only: kind_phys

implicit none

private
Expand All @@ -28,8 +26,8 @@ SUBROUTINE init_soil_depth_3 ( zs , dzs , num_soil_levels )

INTEGER, INTENT(IN) :: num_soil_levels

REAL(kind_phys), DIMENSION(1:num_soil_levels), INTENT(OUT) :: zs, dzs
REAL(kind_phys), DIMENSION(1:num_soil_levels) :: zs2
REAL, DIMENSION(1:num_soil_levels), INTENT(OUT) :: zs, dzs
REAL, DIMENSION(1:num_soil_levels) :: zs2

INTEGER :: l

Expand Down Expand Up @@ -92,21 +90,21 @@ SUBROUTINE init_soil_3_real ( tsk , tmn , smois , tslb , &
INTEGER , DIMENSION(1:num_st_levels_input) , INTENT(INOUT) :: st_levels_input
INTEGER , DIMENSION(1:num_sm_levels_input) , INTENT(INOUT) :: sm_levels_input

REAL(kind_phys) , DIMENSION(ims:ime,1:num_st_levels_alloc,jms:jme) , INTENT(INOUT) :: st_input
REAL(kind_phys) , DIMENSION(ims:ime,1:num_sm_levels_alloc,jms:jme) , INTENT(INOUT) :: sm_input
REAL(kind_phys) , DIMENSION(ims:ime,jms:jme) , INTENT(IN) :: landmask , sst
REAL , DIMENSION(ims:ime,1:num_st_levels_alloc,jms:jme) , INTENT(INOUT) :: st_input
REAL , DIMENSION(ims:ime,1:num_sm_levels_alloc,jms:jme) , INTENT(INOUT) :: sm_input
REAL , DIMENSION(ims:ime,jms:jme) , INTENT(IN) :: landmask , sst

REAL(kind_phys) , DIMENSION(ims:ime,jms:jme) , INTENT(IN) :: tmn
REAL(kind_phys) , DIMENSION(ims:ime,jms:jme) , INTENT(INOUT) :: tsk
REAL(kind_phys) , DIMENSION(num_soil_layers) :: zs , dzs
REAL , DIMENSION(ims:ime,jms:jme) , INTENT(IN) :: tmn
REAL , DIMENSION(ims:ime,jms:jme) , INTENT(INOUT) :: tsk
REAL , DIMENSION(num_soil_layers) :: zs , dzs

REAL(kind_phys) , DIMENSION(ims:ime,num_soil_layers,jms:jme) , INTENT(OUT) :: tslb , smois
REAL , DIMENSION(ims:ime,num_soil_layers,jms:jme) , INTENT(OUT) :: tslb , smois

REAL(kind_phys) , ALLOCATABLE , DIMENSION(:) :: zhave
REAL , ALLOCATABLE , DIMENSION(:) :: zhave

logical :: debug_print = .false.
INTEGER :: i , j , l , lout , lin , lwant , lhave, k
REAL(kind_phys) :: temp
REAL :: temp

! Allocate the soil layer array used for interpolating.

Expand Down
2 changes: 1 addition & 1 deletion physics/radiation_gases.f
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ subroutine gas_init &
endif
do k = 1, LOZ
pkstr(k) = fpkapx(pstr(k)*100.0_kind_phys)
pkstr(k) = fpkapx(pstr(k)*100.0)
enddo
endif ! end if_ioznflg_block
Expand Down
2 changes: 0 additions & 2 deletions physics/satmedmfvdif.F
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
!! eddy-diffusion mass-flux (TKE-EDMF) parameterization (by Jongil Han).

module satmedmfvdif

use tridi_mod
use mfscu_mod
use mfpblt_mod

contains

!> \section arg_table_satmedmfvdif_init Argument Table
Expand Down
2 changes: 1 addition & 1 deletion physics/surface_perturbation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ subroutine cdfnor(z,cdfz)
cdfz = 0.5
else
x = 0.5*z*z
call cdfgam(x,0.5_kind_phys,del,iflag, cdfx)
call cdfgam(x,0.5,del,iflag, cdfx)
if (iflag.ne.0) return
if (z.gt.0.0) then
cdfz = 0.5+0.5*cdfx
Expand Down

0 comments on commit 63020ec

Please sign in to comment.