Skip to content

Commit

Permalink
More bugfixes for optional arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
climbfuji committed Apr 27, 2024
1 parent e73d7c8 commit caaa77f
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ subroutine GFS_radiation_surface_run ( &

call setalb (slmsk, lsm, lsm_noahmp, lsm_ruc, use_cice_alb, snodi, sncovr, sncovr_ice, &
snoalb, zorl, coszen, tsfg, tsfa, hprime, frac_grid, lakefrac, &
! snoalb, zorl, coszen, tsfg, tsfa, hprime, frac_grid, min_seaice, &
alvsf, alnsf, alvwf, alnwf, facsf, facwf, fice, tisfc, &
albdvis_lnd, albdnir_lnd, albivis_lnd, albinir_lnd, &
albdvis_ice, albdnir_ice, albivis_ice, albinir_ice, &
Expand Down
4 changes: 2 additions & 2 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,&
slmsk, dx, si

real(kind=kind_phys), dimension(:,:), intent(in) :: prsi, prsl, prslk, &
tgrs, sfc_wts
tgrs
real(kind=kind_phys), dimension(:,:), intent(in), optional :: &
mg_cld, effrr_in, &
cnvw_in, cnvc_in, &
sppt_wts
sppt_wts, sfc_wts

real(kind=kind_phys), dimension(:,:,:), intent(in) :: qgrs
real(kind=kind_phys), dimension(:,:,:), intent(inout) :: aer_nm
Expand Down
9 changes: 5 additions & 4 deletions physics/Interstitials/UFS_SCM_NEPTUNE/gcycle.F90
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@ subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, fn_nml,
real(kind=kind_phys), intent(in) :: fhcyc, phour, landfrac(:), lakefrac(:), &
min_seaice, min_lakeice, &
xlat_d(:), xlon_d(:)
real(kind=kind_phys), intent(inout) :: smc(:,:), &
slc(:,:), &
stc(:,:), &
real(kind=kind_phys), intent(inout), optional :: &
smois(:,:), &
sh2o(:,:), &
tslb(:,:), &
tref(:)
real(kind=kind_phys), intent(inout) :: smc(:,:), &
slc(:,:), &
stc(:,:), &
tiice(:,:), &
tg3(:), &
tref(:), &
tsfc(:), &
tsfco(:), &
tisfc(:), &
Expand Down
18 changes: 13 additions & 5 deletions physics/MP/GFDL/fv_sat_adj.F90
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ end subroutine fv_sat_adj_finalize
!! \section arg_table_fv_sat_adj_run Argument Table
!! \htmlinclude fv_sat_adj_run.html
!!
subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, isc, iec, kmp, km, kmdelz, js, je, jsd, jed, jsc, jec, &
subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, isc1, iec1, isc2, iec2, kmp, km, kmdelz, js, je, jsd, jed, jsc1, jec1, jsc2, jec2, &
ng, hydrostatic, fast_mp_consv, te0_2d, te0, ngas, qvi, qv, ql, qi, qr, &
qs, qg, hs, peln, delz, delp, pt, pkz, q_con, akap, cappa, area, dtdt, &
out_dt, last_step, do_qa, qa, &
Expand All @@ -245,25 +245,33 @@ subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, isc, iec, kmp, km, kmdelz
integer, intent(in) :: ie
integer, intent(in) :: isd
integer, intent(in) :: ied
integer, intent(in) :: isc
integer, intent(in) :: iec
integer, intent(in) :: isc1
integer, intent(in) :: iec1
integer, intent(in) :: isc2
integer, intent(in) :: iec2
integer, intent(in) :: kmp
integer, intent(in) :: km
integer, intent(in) :: kmdelz
integer, intent(in) :: js
integer, intent(in) :: je
integer, intent(in) :: jsd
integer, intent(in) :: jed
integer, intent(in) :: jsc
integer, intent(in) :: jec
integer, intent(in) :: jsc1
integer, intent(in) :: jec1
integer, intent(in) :: jsc2
integer, intent(in) :: jec2
integer, intent(in) :: ng
logical, intent(in) :: hydrostatic
logical, intent(in) :: fast_mp_consv
real(kind=kind_dyn), intent(inout) :: te0_2d(is:ie, js:je)
real(kind=kind_dyn), intent( out) :: te0(isd:ied, jsd:jed, 1:km)
! If multi-gases physics are not used, ngas is one and qvi identical to qv
integer, intent(in) :: ngas
#ifdef MULTI_GASES
real(kind=kind_dyn), intent(inout), optional :: qvi(isd:ied, jsd:jed, 1:km, 1:ngas)
#else
real(kind=kind_dyn), intent(inout), optional :: qvi(:,:,:,:)
#endif
real(kind=kind_dyn), intent(inout) :: qv(isd:ied, jsd:jed, 1:km)
real(kind=kind_dyn), intent(inout) :: ql(isd:ied, jsd:jed, 1:km)
real(kind=kind_dyn), intent(inout) :: qi(isd:ied, jsd:jed, 1:km)
Expand Down
76 changes: 52 additions & 24 deletions physics/MP/GFDL/fv_sat_adj.meta
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,29 @@
dimensions = ()
type = integer
intent = in
[isc]
standard_name = starting_x_direction_index_alloc
[isc1]
standard_name = starting_x_direction_index_alloc1
long_name = starting X direction index for allocation
units = count
dimensions = ()
type = integer
intent = in
[iec]
standard_name = ending_x_direction_index_alloc
[iec1]
standard_name = ending_x_direction_index_alloc1
long_name = ending X direction index for allocation
units = count
dimensions = ()
type = integer
intent = in
[isc2]
standard_name = starting_x_direction_index_alloc2
long_name = starting X direction index for allocation
units = count
dimensions = ()
type = integer
intent = in
[iec2]
standard_name = ending_x_direction_index_alloc2
long_name = ending X direction index for allocation
units = count
dimensions = ()
Expand Down Expand Up @@ -214,15 +228,29 @@
dimensions = ()
type = integer
intent = in
[jsc]
standard_name = starting_y_direction_index_alloc
[jsc1]
standard_name = starting_y_direction_index_alloc1
long_name = starting X direction index for allocation
units = count
dimensions = ()
type = integer
intent = in
[jec]
standard_name = ending_y_direction_index_alloc
[jec1]
standard_name = ending_y_direction_index_alloc1
long_name = ending X direction index for allocation
units = count
dimensions = ()
type = integer
intent = in
[jsc2]
standard_name = starting_y_direction_index_alloc2
long_name = starting X direction index for allocation
units = count
dimensions = ()
type = integer
intent = in
[jec2]
standard_name = ending_y_direction_index_alloc2
long_name = ending X direction index for allocation
units = count
dimensions = ()
Expand Down Expand Up @@ -276,7 +304,7 @@
standard_name = gas_tracers_for_multi_gas_physics_at_Lagrangian_surface
long_name = gas tracers for multi gas physics at Lagrangian surface
units = kg kg-1
dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics,1:number_of_gases_for_multi_gases_physics)
dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics,1:number_of_gases_for_multi_gases_physics)
type = real
kind = kind_dyn
intent = inout
Expand All @@ -285,103 +313,103 @@
standard_name = water_vapor_specific_humidity_at_Lagrangian_surface
long_name = water vapor specific humidity updated by fast physics at Lagrangian surface
units = kg kg-1
dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics)
dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics)
type = real
kind = kind_dyn
intent = inout
[ql]
standard_name = cloud_liquid_water_specific_humidity_at_Lagrangian_surface
long_name = cloud liquid water specific humidity updated by fast physics at Lagrangian surface
units = kg kg-1
dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics)
dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics)
type = real
kind = kind_dyn
intent = inout
[qi]
standard_name = cloud_ice_specific_humidity_at_Lagrangian_surface
long_name = cloud ice specific humidity updated by fast physics at Lagrangian surface
units = kg kg-1
dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics)
dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics)
type = real
kind = kind_dyn
intent = inout
[qr]
standard_name = cloud_rain_specific_humidity_at_Lagrangian_surface
long_name = cloud rain specific humidity updated by fast physics at Lagrangian surface
units = kg kg-1
dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics)
dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics)
type = real
kind = kind_dyn
intent = inout
[qs]
standard_name = cloud_snow_specific_humidity_at_Lagrangian_surface
long_name = cloud snow specific humidity updated by fast physics at Lagrangian surface
units = kg kg-1
dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics)
dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics)
type = real
kind = kind_dyn
intent = inout
[qg]
standard_name = cloud_graupel_specific_humidity_at_Lagrangian_surface
long_name = cloud graupel specific humidity updated by fast physics at Lagrangian surface
units = kg kg-1
dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics)
dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics)
type = real
kind = kind_dyn
intent = inout
[hs]
standard_name = surface_geopotential_at_Lagrangian_surface
long_name = surface geopotential at Lagrangian surface
units = m2 s-2
dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc)
dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1)
type = real
kind = kind_dyn
intent = in
[peln]
standard_name = log_pressure_at_Lagrangian_surface
long_name = logarithm of pressure at Lagrangian surface
units = Pa
dimensions = (starting_x_direction_index:ending_x_direction_index,1:vertical_dimension_for_fast_physics_plus_one,starting_y_direction_index:ending_y_direction_index)
dimensions = (starting_x_direction_index_alloc2:ending_x_direction_index_alloc2,1:vertical_dimension_for_fast_physics_plus_one,starting_y_direction_index_alloc2:ending_y_direction_index_alloc2)
type = real
kind = kind_dyn
intent = in
[delz]
standard_name = thickness_at_Lagrangian_surface
long_name = thickness at Lagrangian_surface
units = m
dimensions = (starting_x_direction_index:ending_x_direction_index,starting_y_direction_index:ending_y_direction_index,1:vertical_dimension_for_thickness_at_Lagrangian_surface)
dimensions = (starting_x_direction_index_alloc2:ending_x_direction_index_alloc2,starting_y_direction_index_alloc2:ending_y_direction_index_alloc2,1:vertical_dimension_for_thickness_at_Lagrangian_surface)
type = real
kind = kind_dyn
intent = in
[delp]
standard_name = pressure_thickness_at_Lagrangian_surface
long_name = pressure thickness at Lagrangian surface
units = Pa
dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics)
dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics)
type = real
kind = kind_dyn
intent = in
[pt]
standard_name = virtual_temperature_at_Lagrangian_surface
long_name = virtual temperature at Lagrangian surface
units = K
dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics)
dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics)
type = real
kind = kind_dyn
intent = inout
[pkz]
standard_name = finite_volume_mean_edge_pressure_raised_to_the_power_of_kappa
long_name = finite-volume mean edge pressure in Pa raised to the power of kappa
units = 1
dimensions = (starting_x_direction_index:ending_x_direction_index,starting_y_direction_index:ending_y_direction_index,1:vertical_dimension_for_fast_physics)
dimensions = (starting_x_direction_index_alloc2:ending_x_direction_index_alloc2,starting_y_direction_index_alloc2:ending_y_direction_index_alloc2,1:vertical_dimension_for_fast_physics)
type = real
kind = kind_dyn
intent = inout
[q_con]
standard_name = cloud_condensed_water_specific_humidity_at_Lagrangian_surface
long_name = cloud condensed water specific humidity updated by fast physics at Lagrangian surface
units = kg kg-1
dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_condensed_water_at_Lagrangian_surface)
dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_condensed_water_at_Lagrangian_surface)
type = real
kind = kind_dyn
intent = inout
Expand All @@ -405,7 +433,7 @@
standard_name = cell_area_for_fast_physics
long_name = area of the grid cell for fast physics
units = m2
dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc)
dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1)
type = real
kind = kind_grid
intent = in
Expand Down Expand Up @@ -442,7 +470,7 @@
standard_name = cloud_fraction_at_Lagrangian_surface
long_name = cloud fraction at Lagrangian surface
units = none
dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics)
dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics)
type = real
kind = kind_dyn
intent = out
Expand Down
3 changes: 2 additions & 1 deletion physics/Radiation/radiation_surface.f
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,9 @@ subroutine setalb &
& lakefrac, &
& slmsk, snodi, zorlf, coszf, tsknf, tairf, hprif, &
& alvsf, alnsf, alvwf, alnwf, facsf, facwf, fice, tisfc, &
& icealbdvis, icealbdnir, icealbivis, icealbinir, &
& sncovr, sncovr_ice, snoalb, albPpert ! sfc-perts, mgehne
real (kind=kind_phys), dimension(:), intent(in), optional :: &
& icealbdvis, icealbdnir, icealbivis, icealbinir
real (kind=kind_phys), intent(in) :: pertalb, con_ttp! sfc-perts, mgehne
real (kind=kind_phys), dimension(:), intent(in) :: &
& fracl, fraco, fraci
Expand Down
2 changes: 1 addition & 1 deletion physics/photochem/module_ozphys.F90
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ subroutine run_o3prog_2015(this, con_1ovg, dt, p, t, dp, ozpl, oz, do_diag, do3_
real(kind_phys), intent(inout), dimension(:,:) :: &
oz ! Ozone concentration updated by physics
logical, intent(in) :: do_diag
real(kind_phys), intent(inout), dimension(:,:) :: &
real(kind_phys), intent(inout), dimension(:,:), optional :: &
do3_dt_prd, & ! Physics tendency: production and loss effect
do3_dt_ozmx, & ! Physics tendency: ozone mixing ratio effect
do3_dt_temp, & ! Physics tendency: temperature effect
Expand Down

0 comments on commit caaa77f

Please sign in to comment.