Skip to content

Commit e4d4f92

Browse files
committed
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physics into feature/ccpp_prebuild_opt_args
2 parents c72e2d6 + 89ddce7 commit e4d4f92

20 files changed

+236
-221
lines changed

CODEOWNERS

Lines changed: 181 additions & 186 deletions
Large diffs are not rendered by default.

physics/CONV/Grell_Freitas/cu_gf_deep.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ subroutine cu_gf_deep_run( &
316316
real(kind=kind_phys), dimension (its:ite,kts:kte) :: pwdper, massflx
317317
integer :: nv
318318
!$acc declare create(chem,chem_cup,chem_up,chem_down,dellac,dellac2,chem_c,chem_pw,chem_pwd, &
319-
!$acc chem_pwav,chem_psum,pwdper,massflux)
319+
!$acc chem_pwav,chem_psum,pwdper,massflx)
320320

321321
real(kind=kind_phys), dimension (its:ite,kts:kte) :: &
322322
entr_rate_2d,mentrd_rate_2d,he,hes,qes,z, heo,heso,qeso,zo, &

physics/GWD/gwdps.meta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@
381381
dimensions = (horizontal_loop_extent)
382382
type = real
383383
kind = kind_phys
384-
intent = out
384+
intent = inout
385385
[ldiag_ugwp]
386386
standard_name = flag_for_unified_gravity_wave_physics_diagnostics
387387
long_name = flag for CIRES UGWP Diagnostics

physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers)
127127
type = real
128128
kind = kind_phys
129-
intent = in
129+
intent = inout
130130
[dtidx]
131131
standard_name = cumulative_change_of_state_variables_outer_index
132132
long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index

physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.F90

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ subroutine GFS_MP_generic_post_run(
2727
totprcp, totice, totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, &
2828
pwat, frzr, frzrb, frozr, frozrb, tsnowp, tsnowpb, rhonewsn1, exticeden, &
2929
drain_cpl, dsnow_cpl, lsm, lsm_ruc, lsm_noahmp, raincprv, rainncprv, iceprv, snowprv, &
30-
graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, dfi_radar_max_intervals, &
30+
graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, &
3131
dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d,dqdt_qmicro, lssav, num_dfi_radar, &
3232
fh_dfi_radar,index_of_process_dfi_radar, ix_dfi_radar, dfi_radar_tten, radar_tten_limits, fhour, prevsq, &
3333
iopt_lake, iopt_lake_clm, lkm, use_lake_model, errmsg, errflg)
@@ -43,10 +43,9 @@ subroutine GFS_MP_generic_post_run(
4343
integer, intent(in) :: index_of_temperature,index_of_process_mp,use_lake_model(:)
4444
integer, intent(in) :: imfshalcnv,imfshalcnv_gf,imfdeepcnv,imfdeepcnv_gf,imfdeepcnv_samf
4545
integer, dimension (:), intent(in) :: htop
46-
integer :: dfi_radar_max_intervals
4746
real(kind=kind_phys), intent(in) :: fh_dfi_radar(:), fhour, con_t0c
4847
real(kind=kind_phys), intent(in) :: radar_tten_limits(:)
49-
integer :: ix_dfi_radar(:)
48+
integer, intent(in) :: ix_dfi_radar(:)
5049
real(kind=kind_phys), dimension(:,:), intent(inout) :: gt0,refl_10cm
5150

5251
real(kind=kind_phys), intent(in) :: dtf, frain, con_g, rainmin, rhowater

physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@
430430
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers)
431431
type = real
432432
kind = kind_phys
433-
intent = inout
433+
intent = in
434434
[rain0]
435435
standard_name = lwe_thickness_of_explicit_rain_amount
436436
long_name = explicit rain on physics timestep
@@ -791,13 +791,6 @@
791791
type = real
792792
kind = kind_phys
793793
intent = in
794-
[dfi_radar_max_intervals]
795-
standard_name = maximum_number_of_radar_derived_temperature_or_convection_suppression_intervals
796-
long_name = maximum allowed number of time ranges with radar-derived microphysics temperature tendencies or radar-derived convection suppression
797-
units = count
798-
dimensions = ()
799-
type = integer
800-
intent = in
801794
[num_dfi_radar]
802795
standard_name = number_of_radar_derived_temperature_or_convection_suppression_intervals
803796
long_name = number of time ranges with radar-derived microphysics temperature tendencies or radar-derived convection suppression

physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ subroutine GFS_surface_composites_post_run (
4141
logical, intent(in) :: cplflx, frac_grid, cplwav2atm, frac_ice
4242
logical, intent(in) :: lheatstrg
4343
logical, dimension(:), intent(in) :: flag_cice, dry, icy
44-
logical, dimension(:), intent(inout) :: wet
44+
logical, dimension(:), intent(in) :: wet
4545
integer, dimension(:), intent(in) :: islmsk, use_lake_model
4646
real(kind=kind_phys), dimension(:), intent(in) :: wind, t1, q1, prsl1, landfrac, lakefrac, oceanfrac, &
4747
cd_wat, cd_lnd, cd_ice, cdq_wat, cdq_lnd, cdq_ice, rb_wat, rb_lnd, rb_ice, stress_wat, &

physics/Interstitials/UFS_SCM_NEPTUNE/sfcsub.F

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7670,7 +7670,7 @@ subroutine clima(lugb,iy,im,id,ih,fh,len,lsoil,slmskl,slmskw, &
76707670
! points. so for efficiency, don't have fixrdc try to
76717671
! find a value at landice points as defined by the vet type (vet).
76727672
allocate(slmask_noice(len))
7673-
slmask_noice = 1.0
7673+
slmask_noice = slmskl
76747674
do i = 1, len
76757675
if (nint(vet(i)) < 1 .or.
76767676
& nint(vet(i)) == landice_cat) then

physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ SUBROUTINE mynnedmf_wrapper_run( &
172172
implicit none
173173
!-------------------------------------------------------------------
174174

175-
real(kind_phys) :: huge
175+
real(kind_phys), intent(in) :: huge
176176
character(len=*), intent(out) :: errmsg
177177
integer, intent(out) :: errflg
178178

@@ -291,7 +291,7 @@ SUBROUTINE mynnedmf_wrapper_run( &
291291
real(kind_phys), dimension(:), intent(inout), optional :: frp
292292
logical, intent(in) :: mix_chem, enh_mix, rrfs_sd
293293
real(kind_phys), dimension(:,:,:), intent(inout), optional :: chem3d
294-
real(kind_phys), dimension(:,: ), intent(inout), optional :: vdep
294+
real(kind_phys), dimension(:,: ), intent(in), optional :: vdep
295295
real(kind_phys), dimension(im) :: emis_ant_no
296296

297297
!MYNN-2D

physics/PBL/SATMEDMF/satmedmfvdif.meta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@
503503
dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max)
504504
type = real
505505
kind = kind_phys
506-
intent = in
506+
intent = inout
507507
optional = True
508508
[dtidx]
509509
standard_name = cumulative_change_of_state_variables_outer_index

physics/PBL/SATMEDMF/satmedmfvdifq.meta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@
625625
dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max)
626626
type = real
627627
kind = kind_phys
628-
intent = in
628+
intent = inout
629629
optional = True
630630
[dtidx]
631631
standard_name = cumulative_change_of_state_variables_outer_index

physics/PBL/SHOC/moninshoc.meta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@
456456
dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max)
457457
type = real
458458
kind = kind_phys
459-
intent = in
459+
intent = inout
460460
optional = True
461461
[dtidx]
462462
standard_name = cumulative_change_of_state_variables_outer_index

physics/PBL/YSU/ysuvdif.meta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@
466466
dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max)
467467
type = real
468468
kind = kind_phys
469-
intent = in
469+
intent = inout
470470
optional = True
471471
[dtidx]
472472
standard_name = cumulative_change_of_state_variables_outer_index

physics/SFC_Layer/UFS/sfc_diag.meta

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@
218218
dimensions = (horizontal_loop_extent)
219219
type = real
220220
kind = kind_phys
221-
intent = inout
221+
intent = in
222222
[tskin]
223223
standard_name = surface_skin_temperature
224224
long_name = surface skin temperature
@@ -316,7 +316,7 @@
316316
long_name = model 2m diagnostics use the temperature and humidity calculated by the lake model
317317
units = flag
318318
dimensions = ()
319-
type = integer
319+
type = logical
320320
intent = in
321321
[wind]
322322
standard_name = wind_speed_at_lowest_model_layer

physics/SFC_Layer/UFS/sfc_diag_post.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, opt_diag, dry, lssav, dtf, co
2828
logical , dimension(:), intent(in) :: dry
2929
real(kind=kind_phys), dimension(:), intent(in) :: pgr, u10m, v10m
3030
real(kind=kind_phys), dimension(:), intent(inout) :: t2m, q2m, tmpmin, tmpmax, spfhmin, spfhmax
31-
real(kind=kind_phys), dimension(:), intent(inout), optional :: t2mmp, q2mp
31+
real(kind=kind_phys), dimension(:), intent(in), optional :: t2mmp, q2mp
3232
real(kind=kind_phys), dimension(:), intent(inout) :: wind10mmax, u10mmax, v10mmax, dpt2m
3333

3434
character(len=*), intent(out) :: errmsg

physics/SFC_Layer/UFS/sfc_diag_post.meta

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
dimensions = (horizontal_loop_extent)
9797
type = real
9898
kind = kind_phys
99-
intent = out
99+
intent = in
100100
optional = True
101101
[q2mp]
102102
standard_name = specific_humidity_at_2m_from_noahmp
@@ -105,7 +105,7 @@
105105
dimensions = (horizontal_loop_extent)
106106
type = real
107107
kind = kind_phys
108-
intent = out
108+
intent = in
109109
optional = True
110110
[t2m]
111111
standard_name = air_temperature_at_2m

physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,6 +2013,8 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in
20132013
chuc = 0.
20142014
chv2 = 0.
20152015
rb = 0.
2016+
laisun = 0.
2017+
laisha = 0.
20162018

20172019
cdmnv = 0.0
20182020
ezpdv = 0.0
@@ -2263,7 +2265,8 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in
22632265
csigmaf1, & !out
22642266
!jref:start
22652267
qc ,qsfc ,psfc , & !in
2266-
q2v ,chv2, chleaf, chuc) !inout
2268+
q2v ,chv2 ,chleaf ,chuc , &
2269+
rb) !out
22672270

22682271
! new coupling code
22692272

@@ -3712,7 +3715,8 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , &
37123715
t2mv ,psnsun ,psnsha ,canhs , & !out
37133716
csigmaf1, & !out
37143717
qc ,qsfc ,psfc , & !in
3715-
q2v ,cah2 ,chleaf ,chuc ) !inout
3718+
q2v ,cah2 ,chleaf ,chuc , & !inout
3719+
rb) !out
37163720

37173721
! --------------------------------------------------------------------------------------------------
37183722
! use newton-raphson iteration to solve for vegetation (tv) and
@@ -3836,6 +3840,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , &
38363840
real (kind=kind_phys), intent(out) :: chuc !< under canopy exchange coefficient
38373841
real (kind=kind_phys), intent(out) :: canhs !< canopy heat storage change (w/m2)
38383842
real (kind=kind_phys), intent(out) :: q2v !<
3843+
real (kind=kind_phys), intent(out) :: rb !< bulk leaf boundary layer resistance (s/m)
38393844
real (kind=kind_phys) :: cah !< sensible heat conductance, canopy air to zlvl air (m/s)
38403845
real (kind=kind_phys) :: u10v !< 10 m wind speed in eastward dir (m/s)
38413846
real (kind=kind_phys) :: v10v !< 10 m wind speed in eastward dir (m/s)
@@ -3852,7 +3857,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , &
38523857
real (kind=kind_phys) :: z0mo !roughness length for intermediate output only (m)
38533858
real (kind=kind_phys) :: z0h !roughness length, sensible heat (m)
38543859
real (kind=kind_phys) :: z0hg !roughness length, sensible heat (m)
3855-
real (kind=kind_phys) :: rb !bulk leaf boundary layer resistance (s/m)
38563860
real (kind=kind_phys) :: ramc !aerodynamic resistance for momentum (s/m)
38573861
real (kind=kind_phys) :: rahc !aerodynamic resistance for sensible heat (s/m)
38583862
real (kind=kind_phys) :: rawc !aerodynamic resistance for water vapor (s/m)

physics/SFC_Models/Land/Noahmp/noahmpdrv.F90

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ subroutine noahmpdrv_run &
157157
sncovr1, qsurf, gflux, drain, evap, hflx, ep, runoff, &
158158
cmm, chh, evbs, evcw, sbsno, pah, ecan, etran, edir, snowc,&
159159
stm, snohf,smcwlt2, smcref2, wet1, t2mmp, q2mp,zvfun, &
160-
ztmax, errmsg, errflg, &
160+
ztmax, rca, errmsg, errflg, &
161161
canopy_heat_storage_ccpp, &
162162
rainfall_ccpp, &
163163
sw_absorbed_total_ccpp, &
@@ -400,6 +400,8 @@ subroutine noahmpdrv_run &
400400
real(kind=kind_phys), dimension(:) , intent(out), optional :: q2mp ! combined q2m from tiles
401401
real(kind=kind_phys), dimension(:) , intent(out) :: zvfun !
402402
real(kind=kind_phys), dimension(:) , intent(out) :: ztmax ! thermal roughness length
403+
real(kind=kind_phys), dimension(:) , intent(out) :: rca ! total canopy/stomatal resistance (s/m)
404+
403405
character(len=*) , intent(out) :: errmsg
404406
integer , intent(out) :: errflg
405407

@@ -623,7 +625,7 @@ subroutine noahmpdrv_run &
623625
real (kind=kind_phys) :: canopy_heat_storage ! out | within-canopy heat [W/m2]
624626
real (kind=kind_phys) :: spec_humid_sfc_veg ! out | surface specific humidty over vegetation [kg/kg]
625627
real (kind=kind_phys) :: spec_humid_sfc_bare ! out | surface specific humidty over bare soil [kg/kg]
626-
628+
627629
real (kind=kind_phys) :: ustarx ! inout |surface friction velocity
628630
real (kind=kind_phys) :: prslkix ! in exner function
629631
real (kind=kind_phys) :: prsik1x ! in exner function
@@ -948,6 +950,10 @@ subroutine noahmpdrv_run &
948950
ch_vegetated = 0.0
949951
ch_bare_ground = ch_noahmp
950952
canopy_heat_storage = 0.0
953+
lai_sunlit = 0.0
954+
lai_shaded = 0.0
955+
rs_sunlit = 0.0
956+
rs_shaded = 0.0
951957

952958
else ! not glacier
953959

@@ -1056,7 +1062,17 @@ subroutine noahmpdrv_run &
10561062
chxy (i) = ch_noahmp
10571063
zorl (i) = z0_total * 100.0 ! convert to cm
10581064
ztmax (i) = z0h_total
1059-
1065+
1066+
!LAI-scale canopy resistance based on weighted sunlit shaded fraction
1067+
if(rs_sunlit .le. 0.0 .or. rs_shaded .le. 0.0 .or. &
1068+
lai_sunlit .eq. 0.0 .or. lai_shaded .eq. 0.0) then
1069+
rca(i) = parameters%rsmax
1070+
else !calculate LAI-scale canopy conductance (1/Rs)
1071+
rca(i) = ((1.0/(rs_sunlit+leaf_air_resistance)*lai_sunlit) + &
1072+
((1.0/(rs_shaded+leaf_air_resistance))*lai_shaded))
1073+
rca(i) = max((1.0/rca(i)),parameters%rsmin) !resistance
1074+
end if
1075+
10601076
smc (i,:) = soil_moisture_vol
10611077
slc (i,:) = soil_liquid_vol
10621078
snowxy (i) = float(snow_levels)

physics/SFC_Models/Land/Noahmp/noahmpdrv.meta

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,6 +1402,14 @@
14021402
type = real
14031403
kind = kind_phys
14041404
intent = out
1405+
[rca]
1406+
standard_name = aerodynamic_resistance_in_canopy
1407+
long_name = canopy resistance
1408+
units = s m-1
1409+
dimensions = (horizontal_loop_extent)
1410+
type = real
1411+
kind = kind_phys
1412+
intent = out
14051413
[errmsg]
14061414
standard_name = ccpp_error_message
14071415
long_name = error message for error handling in CCPP

physics/photochem/module_ozphys.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ subroutine run_o3prog_2015(this, con_1ovg, dt, p, t, dp, ozpl, oz, do_diag, do3_
306306

307307
! Diagnostics (optional)
308308
if (do_diag) then
309-
do3_dt_prd(:,iLev) = (prod(:,1)-prod(:,2)*prod(:,6))*dt
310-
do3_dt_ozmx(:,iLev) = (oz(:,iLev) - ozib(:))
309+
do3_dt_prd(:,iLev) = prod(:,1) * dt
310+
do3_dt_ozmx(:,iLev) = prod(:,2) * (oz(:,iLev) - prod(:,6)) * dt
311311
do3_dt_temp(:,iLev) = prod(:,3)*(t(:,iLev)-prod(:,5))*dt
312312
do3_dt_ohoz(:,iLev) = prod(:,4) * (colo3(:,iLev)-coloz(:,iLev))*dt
313313
endif

0 commit comments

Comments
 (0)