Skip to content

Commit 2d2f1a6

Browse files
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into prog_closure
2 parents 48f4274 + f13ed4e commit 2d2f1a6

30 files changed

+285
-128
lines changed

physics/GFS_MP_generic_post.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ subroutine GFS_MP_generic_post_run(
3131
errmsg, errflg)
3232
!
3333
use machine, only: kind_phys
34-
34+
use calpreciptype_mod, only: calpreciptype
3535
implicit none
3636

3737
integer, intent(in) :: im, levs, kdt, nrcm, nncl, ntcw, ntrac, num_dfi_radar, index_of_process_dfi_radar

physics/calpreciptype.f90

+45-35
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
!>\file calpreciptype.f90
22
!! This file contains the subroutines that calculates dominant precipitation type.
33

4+
module calpreciptype_mod
5+
contains
46
!>\ingroup gfs_calpreciptype
57
!! Foure algorithms are called to calculate dominant precipitation type, and the
68
!!tallies are sumed in calwxt_dominant().
@@ -26,17 +28,18 @@ subroutine calpreciptype(kdt,nrcm,im,ix,lm,lp1,randomno, &
2628
! --------------------------------------------------------------------
2729
use funcphys, only : fpvs,ftdp,fpkap,ftlcl,stma,fthe
2830
use physcons
31+
use machine , only : kind_phys
2932
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3033
implicit none
3134
!
32-
real, parameter :: pthresh = 0.0, oneog = 1.0/con_g
35+
real(kind=kind_phys), parameter :: pthresh = 0.0, oneog = 1.0/con_g
3336
integer,parameter :: nalg = 5
3437
!
3538
! declare variables.
3639
!
3740
integer,intent(in) :: kdt,nrcm,im,ix,lm,lp1
38-
real,intent(in) :: xlat(im),xlon(im)
39-
real,intent(in) :: randomno(ix,nrcm)
41+
real(kind=kind_phys),intent(in) :: xlat(im),xlon(im)
42+
real(kind=kind_phys),intent(in) :: randomno(ix,nrcm)
4043
real(kind=kind_phys),dimension(im), intent(in) :: prec,tskin
4144
real(kind=kind_phys),dimension(ix,lm), intent(in) :: gt0,gq0,prsl
4245
real(kind=kind_phys),dimension(ix,lp1),intent(in) :: prsi,phii
@@ -220,8 +223,9 @@ subroutine calpreciptype(kdt,nrcm,im,ix,lm,lp1,randomno, &
220223
!! This subroutine computes precipitation type using a decision tree approach that uses
221224
!! variables such as integrated wet bulb temperatue below freezing and lowest layer
222225
!! temperature (Baldwin et al. 1994 \cite baldwin_et_al_1994)
223-
subroutine calwxt(lm,lp1,t,q,pmid,pint, &
224-
d608,rog,epsq,zint,iwx,twet)
226+
subroutine calwxt(lm,lp1,t,q,pmid,pint, &
227+
d608,rog,epsq,zint,iwx,twet)
228+
use machine , only : kind_phys
225229
!
226230
! file: calwxt.f
227231
! written: 11 november 1993, michael baldwin
@@ -247,10 +251,10 @@ subroutine calwxt(lm,lp1,t,q,pmid,pint, &
247251
! t,q,pmid,htm,lmh,zint
248252
!
249253
integer,intent(in) :: lm,lp1
250-
real,dimension(lm),intent(in) :: t,q,pmid,twet
251-
real,dimension(lp1),intent(in) :: zint,pint
254+
real(kind=kind_phys),dimension(lm),intent(in) :: t,q,pmid,twet
255+
real(kind=kind_phys),dimension(lp1),intent(in) :: zint,pint
252256
integer,intent(out) :: iwx
253-
real,intent(in) :: d608,rog,epsq
257+
real(kind=kind_phys),intent(in) :: d608,rog,epsq
254258

255259

256260
! output:
@@ -264,10 +268,10 @@ subroutine calwxt(lm,lp1,t,q,pmid,pint, &
264268
!
265269
! internal:
266270
!
267-
! real, allocatable :: twet(:)
268-
real, parameter :: d00=0.0
271+
! real(kind=kind_phys), allocatable :: twet(:)
272+
real(kind=kind_phys), parameter :: d00=0.0
269273
integer karr,licee
270-
real tcold,twarm
274+
real(kind=kind_phys) tcold,twarm
271275

272276
! subroutines called:
273277
! wetbulb
@@ -282,7 +286,7 @@ subroutine calwxt(lm,lp1,t,q,pmid,pint, &
282286
!
283287

284288
integer l,lice,iwrml,ifrzl
285-
real psfck,tdchk,a,tdkl,tdpre,tlmhk,twrmk,areas8,areap4, &
289+
real(kind=kind_phys) psfck,tdchk,a,tdkl,tdpre,tlmhk,twrmk,areas8,areap4, &
286290
surfw,surfc,dzkl,area1,pintk1,pintk2,pm150,pkl,tkl,qkl
287291

288292
! allocate ( twet(lm) )
@@ -486,27 +490,28 @@ subroutine calwxt_ramer(lm,lp1,t,q,pmid,rh,td,pint,ptyp)
486490
! use params_mod
487491
! use ctlblk_mod
488492
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
493+
use machine , only : kind_phys
489494
implicit none
490495
!
491-
real,parameter :: twice=266.55,rhprcp=0.80,deltag=1.02, &
496+
real(kind=kind_phys),parameter :: twice=266.55,rhprcp=0.80,deltag=1.02, &
492497
& emelt=0.045,rlim=0.04,slim=0.85
493-
real,parameter :: twmelt=273.15,tz=273.15,efac=1.0 ! specify in params now
498+
real(kind=kind_phys),parameter :: twmelt=273.15,tz=273.15,efac=1.0 ! specify in params now
494499
!
495500
integer*4 i, k1, lll, k2, toodry
496501
!
497-
real xxx ,mye, icefrac
502+
real(kind=kind_phys) xxx ,mye, icefrac
498503
integer, intent(in) :: lm,lp1
499-
real,dimension(lm), intent(in) :: t,q,pmid,rh,td
500-
real,dimension(lp1),intent(in) :: pint
504+
real(kind=kind_phys),dimension(lm), intent(in) :: t,q,pmid,rh,td
505+
real(kind=kind_phys),dimension(lp1),intent(in) :: pint
501506
integer, intent(out) :: ptyp
502507
!
503-
real,dimension(lm) :: tq,pq,rhq,twq
508+
real(kind=kind_phys),dimension(lm) :: tq,pq,rhq,twq
504509
!
505510
integer j,l,lev,ii
506-
real rhmax,twmax,ptop,dpdrh,twtop,rhtop,wgt1,wgt2, &
511+
real(kind=kind_phys) rhmax,twmax,ptop,dpdrh,twtop,rhtop,wgt1,wgt2, &
507512
rhavg,dtavg,dpk,ptw,pbot
508-
! real b,qtmp,rate,qc
509-
real,external :: xmytw
513+
! real(kind=kind_phys) b,qtmp,rate,qc
514+
!
510515
!
511516
! initialize.
512517
icefrac = -9999.
@@ -521,7 +526,7 @@ subroutine calwxt_ramer(lm,lp1,t,q,pmid,rh,td,pint,ptyp)
521526
! causing problems later in this subroutine
522527
! qtmp=max(h1m12,q(l))
523528
! rhqtmp(lev)=qtmp/qc
524-
rhq(lev) = rh(l)
529+
rhq(lev) = rh(l)
525530
pq(lev) = pmid(l) * 0.01
526531
tq(lev) = t(l)
527532
enddo
@@ -753,10 +758,11 @@ subroutine calwxt_ramer(lm,lp1,t,q,pmid,rh,td,pint,ptyp)
753758
!--------------------------------------------------------------------------
754759
function xmytw(t,td,p)
755760
!
761+
use machine , only : kind_phys
756762
implicit none
757763
!
758764
integer*4 cflag, l
759-
real f, c0, c1, c2, k, kd, kw, ew, t, td, p, ed, fp, s, &
765+
real(kind=kind_phys) f, c0, c1, c2, k, kd, kw, ew, t, td, p, ed, fp, s, &
760766
& de, xmytw
761767
data f, c0, c1, c2 /0.0006355, 26.66082, 0.0091379024, 6106.3960/
762768
!
@@ -877,19 +883,20 @@ function xmytw(t,td,p)
877883
!! \cite bourgouin_2000.
878884
!of aes (canada) 1992
879885
subroutine calwxt_bourg(lm,lp1,rn,g,t,q,pmid,pint,zint,ptype)
886+
use machine , only : kind_phys
880887
implicit none
881888
!
882889
! input:
883890
integer,intent(in) :: lm,lp1
884-
real,intent(in) :: g,rn(2)
885-
real,intent(in), dimension(lm) :: t, q, pmid
886-
real,intent(in), dimension(lp1) :: pint, zint
891+
real(kind=kind_phys),intent(in) :: g,rn(2)
892+
real(kind=kind_phys),intent(in), dimension(lm) :: t, q, pmid
893+
real(kind=kind_phys),intent(in), dimension(lp1) :: pint, zint
887894
!
888895
! output:
889896
integer, intent(out) :: ptype
890897
!
891898
integer ifrzl,iwrml,l,lhiwrm
892-
real pintk1,areane,tlmhk,areape,pintk2,surfw,area1,dzkl,psfck,r1,r2
899+
real(kind=kind_phys) pintk1,areane,tlmhk,areape,pintk2,surfw,area1,dzkl,psfck,r1,r2
893900
!
894901
! initialize weather type array to zero (ie, off).
895902
! we do this since we want ptype to represent the
@@ -1076,6 +1083,7 @@ subroutine calwxt_revised(lm,lp1,t,q,pmid,pint, &
10761083
! use params_mod
10771084
! use ctlblk_mod
10781085
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1086+
use machine , only : kind_phys
10791087
implicit none
10801088
!
10811089
! list of variables needed
@@ -1087,9 +1095,9 @@ subroutine calwxt_revised(lm,lp1,t,q,pmid,pint, &
10871095
! t,q,pmid,htm,lmh,zint
10881096

10891097
integer,intent(in) :: lm,lp1
1090-
real,dimension(lm),intent(in) :: t,q,pmid,twet
1091-
real,dimension(lp1),intent(in) :: pint,zint
1092-
real,intent(in) :: d608,rog,epsq
1098+
real(kind=kind_phys),dimension(lm),intent(in) :: t,q,pmid,twet
1099+
real(kind=kind_phys),dimension(lp1),intent(in) :: pint,zint
1100+
real(kind=kind_phys),intent(in) :: d608,rog,epsq
10931101
! output:
10941102
! iwx - instantaneous weather type.
10951103
! acts like a 4 bit binary
@@ -1101,12 +1109,12 @@ subroutine calwxt_revised(lm,lp1,t,q,pmid,pint, &
11011109
integer, intent(out) :: iwx
11021110
! internal:
11031111
!
1104-
real, parameter :: d00=0.0
1112+
real(kind=kind_phys), parameter :: d00=0.0
11051113
integer karr,licee
1106-
real tcold,twarm
1114+
real(kind=kind_phys) tcold,twarm
11071115
!
11081116
integer l,lmhk,lice,iwrml,ifrzl
1109-
real psfck,tdchk,a,tdkl,tdpre,tlmhk,twrmk,areas8,areap4,area1, &
1117+
real(kind=kind_phys) psfck,tdchk,a,tdkl,tdpre,tlmhk,twrmk,areas8,areap4,area1, &
11101118
surfw,surfc,dzkl,pintk1,pintk2,pm150,qkl,tkl,pkl,area0,areap0
11111119

11121120
! subroutines called:
@@ -1316,14 +1324,15 @@ subroutine calwxt_dominant(nalg,rain,freezr,sleet,snow, &
13161324
! algorithms and sums them up to give a dominant type
13171325
!
13181326
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1327+
use machine , only : kind_phys
13191328
implicit none
13201329
!
13211330
! input:
13221331
integer,intent(in) :: nalg
1323-
real,intent(out) :: doms,domr,domzr,domip
1332+
real(kind=kind_phys),intent(out) :: doms,domr,domzr,domip
13241333
integer,dimension(nalg),intent(in) :: rain,snow,sleet,freezr
13251334
integer l
1326-
real totsn,totip,totr,totzr
1335+
real(kind=kind_phys) totsn,totip,totr,totzr
13271336
!--------------------------------------------------------------------------
13281337
! print* , 'into dominant'
13291338
domr = 0.
@@ -1377,3 +1386,4 @@ subroutine calwxt_dominant(nalg,rain,freezr,sleet,snow, &
13771386
return
13781387
end
13791388
!! @}
1389+
end module calpreciptype_mod

physics/cires_orowam2017.f

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
module cires_orowam2017
2+
contains
13
subroutine oro_wam_2017(im, levs,npt,ipt, kref,kdt,me,master,
24
& dtp,dxres, taub, u1, v1, t1, xn, yn, bn2, rho, prsi, prsL,
35
& del, sigma, hprime, gamma, theta,
@@ -384,3 +386,4 @@ subroutine ugwpv0_tofd1d(levs, sigflt, elvmax, zsurf,
384386
enddo
385387
!
386388
end subroutine ugwpv0_tofd1d
389+
end module cires_orowam2017

physics/cires_ugwp.F90

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ module cires_ugwp
1616
use machine, only: kind_phys
1717

1818
use cires_ugwpv0_module, only: knob_ugwp_version, cires_ugwpv0_mod_init, cires_ugwpv0_mod_finalize
19-
19+
use ugwp_driver_v0
2020
use gwdps, only: gwdps_run
21+
use cires_ugwp_triggers
2122

2223
implicit none
2324

physics/cires_ugwp_triggers.F90

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
module cires_ugwp_triggers
2+
contains
13
!
24
subroutine slat_geos5_tamp_v0(im, tau_amp, xlatdeg, tau_gw)
35
!=================
@@ -97,3 +99,4 @@ subroutine init_nazdir_v0(naz, xaz, yaz)
9799
yaz(4) =-1.0 !S
98100
endif
99101
end subroutine init_nazdir_v0
102+
end module cires_ugwp_triggers

physics/cires_ugwpv1_oro.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module cires_ugwpv1_oro
2-
2+
use cires_ugwpv1_sporo
33
contains
44

55
subroutine orogw_v1 (im, km, imx, me, master, dtp, kdt, do_tofd, &

physics/cires_ugwpv1_sporo.F90

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
1+
module cires_ugwpv1_sporo
2+
contains
23
subroutine oro_spectral_solver(im, levs,npt,ipt, kref,kdt,me,master, &
34
dtp,dxres, taub, u1, v1, t1, xn, yn, bn2, rho, prsi, prsL, &
45
del, sigma, hprime, gamma, theta, &
@@ -349,3 +350,4 @@ subroutine oro_meanflow(nz, nzi, u1, v1, t1, pint, pmid, &
349350

350351
end subroutine oro_meanflow
351352

353+
end module cires_ugwpv1_sporo

0 commit comments

Comments
 (0)