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

UFS-dev PR#184 #1073

Merged
merged 53 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
1c6c1d8
Resolve argument mismatch errors when using gfortran
DusanJovic-NOAA Mar 24, 2022
bd588f9
Merge remote-tracking branch 'origin/main' into no_arg_mismatch
DusanJovic-NOAA Apr 8, 2022
f5c5073
Merge remote-tracking branch 'origin/main' into no_arg_mismatch
DusanJovic-NOAA May 13, 2022
a90b957
Merge remote-tracking branch 'origin/main' into no_arg_mismatch
DusanJovic-NOAA Jun 14, 2022
6c87d3e
Merge remote-tracking branch 'origin/main' into no_arg_mismatch
DusanJovic-NOAA Jul 5, 2022
02eb368
Merge remote-tracking branch 'origin/main' into no_arg_mismatch
DusanJovic-NOAA Jul 19, 2022
16ef7f2
Declare variables passed to w3nco library as double precission
DusanJovic-NOAA Jul 19, 2022
696c0ea
More argument mismatch fixes
DusanJovic-NOAA Jul 20, 2022
9da6d0e
Merge remote-tracking branch 'origin/main' into no_arg_mismatch
DusanJovic-NOAA Aug 10, 2022
2686cd1
Merge remote-tracking branch 'origin/main' into no_arg_mismatch
DusanJovic-NOAA Sep 28, 2022
d1e061d
Merge branch 'ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Oct 13, 2022
3302938
Merge branch 'ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Oct 17, 2022
af99a17
Merge branch 'ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Nov 7, 2022
92b8c85
If MPI is used, find package
climbfuji Nov 7, 2022
6c34d5b
Merge branch 'no_arg_mismatch' of https://github.com/DusanJovic-NOAA/…
climbfuji Nov 7, 2022
f943d20
Fixed cmake if/endif mismatch
DusanJovic-NOAA Nov 18, 2022
61e03a8
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Dec 15, 2022
0df1328
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Dec 30, 2022
8c83308
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Mar 16, 2023
347d745
Use mpi_f08 in rrtmgp_lw_main and rrtmgp_sw_main
DusanJovic-NOAA Mar 16, 2023
13c0276
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Mar 29, 2023
a372112
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Apr 26, 2023
a4054ff
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA May 4, 2023
c2763f5
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Jun 8, 2023
b4cb573
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Jun 13, 2023
37fd3fb
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Aug 4, 2023
7307e1a
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Aug 28, 2023
bf68db2
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Sep 15, 2023
53d394d
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Nov 1, 2023
8e52a61
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Nov 3, 2023
360a612
Update GFS_phys_time_vary.fv3.F90 to compile without '-fallow-argumen…
DusanJovic-NOAA Nov 3, 2023
ce64f1a
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Dec 18, 2023
c2f80ab
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Jan 4, 2024
531cd86
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Jan 16, 2024
47d4bff
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Feb 7, 2024
bac1994
Change the type of mpi communicator in few more files
DusanJovic-NOAA Feb 7, 2024
8c68c2f
Fix mpi use statement
DusanJovic-NOAA Feb 7, 2024
dbef1a7
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Feb 26, 2024
bb9b90f
Update MPI find_package and check if MPI F08 module is supported
DusanJovic-NOAA Feb 26, 2024
0cb5d97
Remove C from MPI find_package
DusanJovic-NOAA Feb 27, 2024
e1db7f2
In physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.m…
climbfuji Mar 8, 2024
26f9514
In physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F…
climbfuji Mar 8, 2024
743dc85
correctly convert from flashes per five minutes to flashes per minute
SamuelTrahanNOAA Mar 11, 2024
7e74ada
correct the meta file
SamuelTrahanNOAA Mar 11, 2024
c97a968
Merge pull request #16 from SamuelTrahanNOAA/dom-flash-correctly
climbfuji Mar 11, 2024
1497772
Introduce namelist flag to convection/cloud/radiation interaction in …
lisa-bengtsson Mar 12, 2024
8dff959
Merge pull request #181 from grantfirl/csawv2_gjf
grantfirl Mar 14, 2024
2f15ae9
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physi…
climbfuji Mar 14, 2024
9f4a96b
Merge pull request #182 from climbfuji/feature/fix_units_flashes_per_…
grantfirl Mar 18, 2024
94596b3
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Mar 18, 2024
9839680
Merge pull request #160 from DusanJovic-NOAA/no_arg_mismatch
dustinswales Mar 19, 2024
7fa5593
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physi…
lisa-bengtsson Mar 19, 2024
a3760b8
Merge branch 'cloudPR' into ufs-dev-PR184
grantfirl May 23, 2024
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
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.3)
cmake_minimum_required(VERSION 3.10)

project(ccpp_physics
VERSION 5.0.0
Expand All @@ -8,6 +8,13 @@ project(ccpp_physics
set(PACKAGE "ccpp-physics")
set(AUTHORS "Grant Firl" "Dustin Swales" "Man Zhang" "Mike Kavulich" )

#------------------------------------------------------------------------------
# Set MPI flags for Fortran with MPI F08 interface
find_package(MPI REQUIRED Fortran)
if(NOT MPI_Fortran_HAVE_F08_MODULE)
message(FATAL_ERROR "MPI implementation does not support the Fortran 2008 mpi_f08 interface")
endif()

#------------------------------------------------------------------------------
# Set OpenMP flags for C/C++/Fortran
if (OPENMP)
Expand Down
9 changes: 1 addition & 8 deletions physics/GWD/cires_tauamf_data.F90
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ subroutine gfs_idate_calendar(idate, fhour, ddd, fddd)
integer :: jdow, jdoy, jday
real(8) :: rinc(5)
real(4) :: rinc4(5)
integer :: w3kindreal, w3kindint

integer :: iw3jdn
integer :: jd1, jddd
Expand All @@ -196,13 +195,7 @@ subroutine gfs_idate_calendar(idate, fhour, ddd, fddd)
rinc(1:5) = 0.
rinc(2) = fhour
!
call w3kind(w3kindreal,w3kindint)
if(w3kindreal==4) then
rinc4 = rinc
call w3movdat(rinc4, idat,jdat)
else
call w3movdat(rinc, idat,jdat)
endif
call w3movdat(rinc, idat,jdat)
! jdate(8)- date and time (yr, mo, day, [tz], hr, min, sec)
jdow = 0
jdoy = 0
Expand Down
4 changes: 2 additions & 2 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.F90
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling,
nthreads, blkno, errmsg, errflg)

#ifdef MPI
use mpi
use mpi_f08
#endif
#ifdef _OPENMP
use omp_lib
Expand Down Expand Up @@ -1055,7 +1055,7 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup
nthreads, blkno, errmsg, errflg)

#ifdef MPI
use mpi
use mpi_f08
#endif
#ifdef _OPENMP
use omp_lib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,6 @@ subroutine GFS_phys_time_vary_timestep_init (
real(kind_phys) :: rannie(cny)
real(kind_phys) :: rndval(cnx*cny*nrcm)
real(kind_dbl_prec) :: rinc(5)
real(kind_sngl_prec) :: rinc4(5)

! Initialize CCPP error handling variables
errmsg = ''
Expand All @@ -813,7 +812,7 @@ subroutine GFS_phys_time_vary_timestep_init (
!$OMP shared(ozpl,ddy_o3,h2o_phys,jindx1_h,jindx2_h,h2opl,ddy_h,iaerclm,master) &
!$OMP shared(levs,prsl,iccn,jindx1_ci,jindx2_ci,ddy_ci,iindx1_ci,iindx2_ci) &
!$OMP shared(ddx_ci,in_nm,ccn_nm,do_ugwp_v1,jindx1_tau,jindx2_tau,ddy_j1tau) &
!$OMP shared(ddy_j2tau,tau_amf,iflip,ozphys,rjday,n1,n2,idat,jdat,rinc,rinc4) &
!$OMP shared(ddy_j2tau,tau_amf,iflip,ozphys,rjday,n1,n2,idat,jdat,rinc) &
!$OMP shared(w3kindreal,w3kindint,jdow,jdoy,jday) &
!$OMP private(iseed,iskip,i,j,k)

Expand Down Expand Up @@ -873,13 +872,7 @@ subroutine GFS_phys_time_vary_timestep_init (
idat(5)=idate(1)
rinc=0.
rinc(2)=fhour
call w3kind(w3kindreal,w3kindint)
if(w3kindreal==4) then
rinc4=rinc
CALL w3movdat(rinc4,idat,jdat)
else
CALL w3movdat(rinc,idat,jdat)
endif
CALL w3movdat(rinc,idat,jdat)
jdow = 0
jdoy = 0
jday = 0
Expand Down
6 changes: 3 additions & 3 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module GFS_rrtmg_pre
!>\section rrtmg_pre_gen General Algorithm
subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,&
ltp, imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_c3, me, ncnd, ntrac, &
num_p3d, npdf3d, &
num_p3d, npdf3d, xr_cnvcld, &
ncnvcld3d,ntqv, ntcw,ntiw, ntlnc, ntinc, ntrnc, ntsnc, ntccn, top_at_1,&
ntrw, ntsw, ntgl, nthl, ntwa, ntoz, ntsmoke, ntdust, ntcoarsepm, &
ntclamt, nleffr, nieffr, nseffr, lndp_type, kdt, &
Expand Down Expand Up @@ -129,7 +129,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,&
uni_cld, effr_in, do_mynnedmf, &
lmfshal, lmfdeep2, pert_clds, lcrick,&
lcnorm, top_at_1, lextop, mraerosol
logical, intent(in) :: rrfs_sd, aero_dir_fdb
logical, intent(in) :: rrfs_sd, aero_dir_fdb, xr_cnvcld

logical, intent(in) :: nssl_ccn_on, nssl_invertccn
integer, intent(in) :: spp_rad
Expand Down Expand Up @@ -981,7 +981,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,&
& iovr_dcorr, iovr_exp, iovr_exprand, idcor, idcor_con, &
& idcor_hogan, idcor_oreopoulos, lcrick, lcnorm, &
& imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_c3, do_mynnedmf, &
& lgfdlmprad, &
& lgfdlmprad, xr_cnvcld, &
& uni_cld, lmfshal, lmfdeep2, cldcov, clouds1, &
& effrl, effri, effrr, effrs, effr_in, &
& effrl_inout, effri_inout, effrs_inout, &
Expand Down
7 changes: 7 additions & 0 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@
dimensions = ()
type = logical
intent = in
[xr_cnvcld]
standard_name = flag_for_suspended_convective_clouds_in_Xu_Randall
long_name = flag for using suspended convective clouds in Xu Randall
units = flag
dimensions = ()
type = logical
intent = in
[ltp]
standard_name = extra_top_layer
long_name = extra top layer for radiation
Expand Down
18 changes: 3 additions & 15 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.fv3.F90
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,8 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr,

real(kind=kind_phys), parameter :: con_24 = 24.0_kind_phys
real(kind=kind_phys), parameter :: con_hr = 3600.0_kind_phys
real(kind=kind_sngl_prec) :: rinc4(5)
real(kind=kind_dbl_prec) :: rinc8(5)

integer :: w3kindreal,w3kindint
integer :: iw3jdn
integer :: jd0, jd1
real :: fjd
Expand All @@ -115,19 +113,9 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr,

!--- jdat is being updated directly inside of FV3GFS_cap.F90
!--- update calendars and triggers
call w3kind(w3kindreal,w3kindint)
if (w3kindreal == 8) then
rinc8(1:5) = 0
call w3difdat(jdat,idat,4,rinc8)
sec = rinc8(4)
else if (w3kindreal == 4) then
rinc4(1:5) = 0
call w3difdat(jdat,idat,4,rinc4)
sec = rinc4(4)
else
write(0,*)' FATAL ERROR: Invalid w3kindreal'
call abort
endif
rinc8(1:5) = 0
call w3difdat(jdat,idat,4,rinc8)
sec = rinc8(4)
phour = sec/con_hr
!--- set current bucket hour
zhour = phour
Expand Down
18 changes: 3 additions & 15 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.scm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,8 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr, &

real(kind=kind_phys), parameter :: con_24 = 24.0_kind_phys
real(kind=kind_phys), parameter :: con_hr = 3600.0_kind_phys
real(kind=kind_sngl_prec) :: rinc4(5)
real(kind=kind_dbl_prec) :: rinc8(5)

integer :: w3kindreal,w3kindint
integer :: iw3jdn
integer :: jd0, jd1
real :: fjd
Expand All @@ -114,19 +112,9 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr, &
!--- jdat is being updated directly inside of the time integration
!--- loop of scm.F90
!--- update calendars and triggers
call w3kind(w3kindreal,w3kindint)
if (w3kindreal == 8) then
rinc8(1:5) = 0
call w3difdat(jdat,idat,4,rinc8)
sec = rinc8(4)
else if (w3kindreal == 4) then
rinc4(1:5) = 0
call w3difdat(jdat,idat,4,rinc4)
sec = rinc4(4)
else
write(0,*)' FATAL ERROR: Invalid w3kindreal'
call abort
endif
rinc8(1:5) = 0
call w3difdat(jdat,idat,4,rinc8)
sec = rinc8(4)
phour = sec/con_hr
!--- set current bucket hour
zhour = phour
Expand Down
51 changes: 22 additions & 29 deletions physics/Interstitials/UFS_SCM_NEPTUNE/iccninterp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ SUBROUTINE read_cidata (me, master)
integer, intent(in) :: me
integer, intent(in) :: master
!--- locals
integer :: ncerr
integer :: i, n, k, ncid, varid,j,it
real(kind=kind_phys), allocatable, dimension(:) :: hyam,hybm
real(kind=4), allocatable, dimension(:,:,:) :: ci_ps
Expand All @@ -31,29 +32,29 @@ SUBROUTINE read_cidata (me, master)
allocate (ciplin(lonscip,latscip,kcipl,timeci))
allocate (ccnin(lonscip,latscip,kcipl,timeci))
allocate (ci_pres(lonscip,latscip,kcipl,timeci))
call nf_open("cam5_4_143_NAAI_monclimo2.nc", NF90_NOWRITE, ncid)
call nf_inq_varid(ncid, "lat", varid)
call nf_get_var(ncid, varid, ci_lat)
call nf_inq_varid(ncid, "lon", varid)
call nf_get_var(ncid, varid, ci_lon)
call nf_inq_varid(ncid, "PS", varid)
call nf_get_var(ncid, varid, ci_ps)
call nf_inq_varid(ncid, "hyam", varid)
call nf_get_var(ncid, varid, hyam)
call nf_inq_varid(ncid, "hybm", varid)
call nf_get_var(ncid, varid, hybm)
call nf_inq_varid(ncid, "NAAI", varid)
call nf_get_var(ncid, varid, ciplin)
ncerr = nf90_open("cam5_4_143_NAAI_monclimo2.nc", NF90_NOWRITE, ncid)
ncerr = nf90_inq_varid(ncid, "lat", varid)
ncerr = nf90_get_var(ncid, varid, ci_lat)
ncerr = nf90_inq_varid(ncid, "lon", varid)
ncerr = nf90_get_var(ncid, varid, ci_lon)
ncerr = nf90_inq_varid(ncid, "PS", varid)
ncerr = nf90_get_var(ncid, varid, ci_ps)
ncerr = nf90_inq_varid(ncid, "hyam", varid)
ncerr = nf90_get_var(ncid, varid, hyam)
ncerr = nf90_inq_varid(ncid, "hybm", varid)
ncerr = nf90_get_var(ncid, varid, hybm)
ncerr = nf90_inq_varid(ncid, "NAAI", varid)
ncerr = nf90_get_var(ncid, varid, ciplin)
do it = 1,timeci
do k=1, kcipl
ci_pres(:,:,k,it)=hyam(k)*1.e5+hybm(k)*ci_ps(:,:,it)
end do
end do
call nf_close(ncid)
call nf_open("cam5_4_143_NPCCN_monclimo2.nc", NF90_NOWRITE, ncid)
call nf_inq_varid(ncid, "NPCCN", varid)
call nf_get_var(ncid, varid, ccnin)
call nf_close(ncid)
ncerr = nf90_close(ncid)
ncerr = nf90_open("cam5_4_143_NPCCN_monclimo2.nc", NF90_NOWRITE, ncid)
ncerr = nf90_inq_varid(ncid, "NPCCN", varid)
ncerr = nf90_get_var(ncid, varid, ccnin)
ncerr = nf90_close(ncid)
!---
deallocate (hyam, hybm, ci_ps)
if (me == master) then
Expand Down Expand Up @@ -128,7 +129,7 @@ END SUBROUTINE setindxci
SUBROUTINE ciinterpol(me,npts,IDATE,FHOUR,jindx1,jindx2,ddy, &
iindx1,iindx2,ddx,lev, prsl, ciplout,ccnout)
!
USE MACHINE, ONLY : kind_phys
USE MACHINE, ONLY : kind_phys, kind_dbl_prec
use iccn_def
implicit none
integer i1,i2, iday,j,j1,j2,l,npts,nc,n1,n2,lev,k,i
Expand All @@ -144,10 +145,8 @@ SUBROUTINE ciinterpol(me,npts,IDATE,FHOUR,jindx1,jindx2,ddy, &
real(kind=kind_phys) ccnout(npts,lev),ccnpm(npts,kcipl)
real(kind=kind_phys) cipres(npts,kcipl), prsl(npts,lev)
real(kind=kind_phys) rjday
real(kind=kind_dbl_prec) rinc(5)
integer jdow, jdoy, jday
real(8) RINC(5)
real(4) rinc4(5)
integer w3kindreal,w3kindint
!
IDAT=0
IDAT(1)=IDATE(4)
Expand All @@ -156,13 +155,7 @@ SUBROUTINE ciinterpol(me,npts,IDATE,FHOUR,jindx1,jindx2,ddy, &
IDAT(5)=IDATE(1)
RINC=0.
RINC(2)=FHOUR
call w3kind(w3kindreal,w3kindint)
if(w3kindreal==4) then
rinc4=rinc
CALL W3MOVDAT(RINC4,IDAT,JDAT)
else
CALL W3MOVDAT(RINC,IDAT,JDAT)
endif
CALL W3MOVDAT(RINC,IDAT,JDAT)
!
jdow = 0
jdoy = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ module maximum_hourly_diagnostics
real(kind=kind_phys), parameter ::PQ0=379.90516E0, A2A=17.2693882, A3=273.16, A4=35.86, RHmin=1.0E-6
! *DH

! Conversion from flashes per five minutes to flashes per minute.
real(kind=kind_phys), parameter :: scaling_factor = 0.2

contains

#if 0
Expand Down Expand Up @@ -195,7 +198,10 @@ subroutine lightning_threat_indices
endif

IF ( ltg1 .LT. clim1 ) ltg1 = 0.


! Scale to flashes per minue
ltg1 = ltg1 * scaling_factor

IF ( ltg1 .GT. ltg1_max(i) ) THEN
ltg1_max(i) = ltg1
ENDIF
Expand All @@ -208,14 +214,19 @@ subroutine lightning_threat_indices
ltg2 = coef2 * totice_colint(i)

IF ( ltg2 .LT. clim2 ) ltg2 = 0.

! Scale to flashes per minute
ltg2 = ltg2 * scaling_factor

IF ( ltg2 .GT. ltg2_max(i) ) THEN
ltg2_max(i) = ltg2
ENDIF

! This calculation is already in flashes per minute.
ltg3_max(i) = 0.95 * ltg1_max(i) + 0.05 * ltg2_max(i)

IF ( ltg3_max(i) .LT. clim3 ) ltg3_max(i) = 0.
! Thus, we must scale clim3. The compiler will optimize this away.
IF ( ltg3_max(i) .LT. clim3 * scaling_factor ) ltg3_max(i) = 0.
enddo

end subroutine lightning_threat_indices
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,23 +296,23 @@
[ltg1_max]
standard_name = lightning_threat_index_1
long_name = lightning threat index 1
units = flashes 5 min-1
units = flashes min-1
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
[ltg2_max]
standard_name = lightning_threat_index_2
long_name = lightning threat index 2
units = flashes 5 min-1
units = flashes min-1
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
[ltg3_max]
standard_name = lightning_threat_index_3
long_name = lightning threat index 3
units = flashes 5 min-1
units = flashes min-1
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
Expand Down
Loading
Loading