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

Introduce optional arguments in ccpp schemes and metadata #189

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
457d2ca
Bug fix: remove invalid active attribute in several metadata files
climbfuji Mar 22, 2024
f6082ba
Introduce namelist flag to convection/cloud/radiation interaction in …
lisa-bengtsson Mar 12, 2024
27683db
Add missing optional attribute to metadata files ONLY
climbfuji Apr 3, 2024
778930d
Add missing optional attribute to conditionally allocated variables, …
climbfuji Apr 3, 2024
d1e97a1
Add missing optional attribute to conditionally allocated variables, …
climbfuji Apr 4, 2024
bbc16cd
Add missing optional attribute to conditionally allocated variables, …
climbfuji Apr 14, 2024
e5b77db
Bug fix for physics/MP/GFDL/fv_sat_adj.*: use correct allocation of v…
climbfuji Apr 18, 2024
c0f1c60
Revert many false optional arguments in metadata files
climbfuji Apr 19, 2024
240e3cf
Add optional in physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_s…
climbfuji Apr 22, 2024
7d34ce5
Add optional in physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre…
climbfuji Apr 22, 2024
97bbc31
Add optional in .//physics/GWD/cires_ugwp.F90
climbfuji Apr 22, 2024
9a82538
Add optional in physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_inter…
climbfuji Apr 22, 2024
19fcb91
Add optional .//physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_clou…
climbfuji Apr 22, 2024
000365e
Add optional .//physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_v…
climbfuji Apr 22, 2024
f24c558
Add optional .//physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_clou…
climbfuji Apr 22, 2024
7bc2486
Bug fixes in physics/GWD/cires_ugwp.F90 and physics/Interstitials/UFS…
climbfuji Apr 22, 2024
eb64212
More bug fixes in physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cl…
climbfuji Apr 22, 2024
4e100f8
Add optional attribute to GWD files.
dustinswales Apr 23, 2024
1abc810
Add optional attribute to smoke/dust files.
dustinswales Apr 23, 2024
26937e4
Add optional attribute to MP files.
dustinswales Apr 23, 2024
f8f8c2c
Add optional attribute to Convection files, and MP file omitted from …
dustinswales Apr 23, 2024
5f0ca0b
Add optional attribute to Radiation files.
dustinswales Apr 23, 2024
acbda85
Add optional attribute to PBL files.
dustinswales Apr 23, 2024
6846533
Add optional attribute to Surface Model files.
dustinswales Apr 23, 2024
ce18ef5
Add optional attribute to Surface Layer files.
dustinswales Apr 23, 2024
671aedd
Add optional attribute to Interstitial schemes.
dustinswales Apr 23, 2024
5eb6f69
Some cleanup, after using Courtney's new scipt
dustinswales Apr 24, 2024
0df24f8
Omission from previous commit
dustinswales Apr 24, 2024
c0d52ca
Merge pull request #19 from dustinswales/opt_args
climbfuji Apr 24, 2024
e73d7c8
Small bug fixes in physics/SFC_Models/Lake/Flake/flake_driver.F90 and…
climbfuji Apr 24, 2024
caaa77f
More bugfixes for optional arguments
climbfuji Apr 27, 2024
2818226
Add optional attribute to several variables in mp_gt_driver
climbfuji Apr 29, 2024
b9fd2d8
Add missing OPTIONAL Fortran attribute in internal routines: physics/…
climbfuji Apr 30, 2024
7b6a23e
Add missing optional attributes in physics/CONV/Grell_Freitas/cu_gf_d…
climbfuji May 1, 2024
5551899
No opt flags for gcycle.F90 with Intel
climbfuji May 7, 2024
ef9b15f
Comment out block to nullify local pointers at the end of mp_thompson…
climbfuji May 7, 2024
cafda68
Remove mistakenly added physics/TODO_DONE.txt
climbfuji May 7, 2024
67789c9
Add optional arguments to physics/CONV/C3/cu_c3*
climbfuji May 7, 2024
81793d1
Reduce optimization for mynnedmf_wrapper.F90
climbfuji May 10, 2024
e2c1010
Bug fix for merra2 aerosol setup in physics/MP/Thompson/mp_thompson.F90
climbfuji May 10, 2024
c72e2d6
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physi…
climbfuji May 10, 2024
e4d4f92
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physi…
climbfuji May 20, 2024
7e59eba
Bug fixes in NoahMP LSM and Noah LSM: rca is an optional argument
climbfuji May 20, 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
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ SET_PROPERTY(SOURCE ${SCHEMES} ${CAPS}
# Lower optimization for certain schemes when compiling with Intel in Release mode
if(CMAKE_BUILD_TYPE STREQUAL "Release" AND ${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
# Define a list of schemes that need lower optimization with Intel in Release mode
set(SCHEME_NAMES_LOWER_OPTIMIZATION module_sf_mynn.F90)
set(SCHEME_NAMES_LOWER_OPTIMIZATION module_sf_mynn.F90
mynnedmf_wrapper.F90
gcycle.F90)
foreach(SCHEME_NAME IN LISTS SCHEME_NAMES_LOWER_OPTIMIZATION)
set(SCHEMES_TMP ${SCHEMES})
# Need to determine the name of the scheme with its path
Expand Down
11 changes: 7 additions & 4 deletions physics/CONV/C3/cu_c3_deep.F90
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ subroutine cu_c3_deep_run( &
real(kind=kind_phys), dimension (its:) &
,intent (in ) :: rand_mom,rand_vmas
!$acc declare copyin(rand_clos,rand_mom,rand_vmas)
real(kind=kind_phys), intent(in), dimension (its:) :: ca_deep(:)
real(kind=kind_phys), intent(in), dimension (its:), optional :: ca_deep(:)
integer, intent(in) :: do_capsuppress
real(kind=kind_phys), intent(in), dimension(:) :: cap_suppress_j
!$acc declare create(cap_suppress_j)
Expand All @@ -188,7 +188,10 @@ subroutine cu_c3_deep_run( &
frh_out,rainevap
real(kind=kind_phys), dimension (its:,kts:) &
,intent (in ) :: &
tmf, qmicro, sigmain, forceqv_spechum
tmf
real(kind=kind_phys), dimension (its:,kts:) &
,intent (in ), optional :: &
qmicro, sigmain, forceqv_spechum
real(kind=kind_phys), dimension (its:) &
,intent (inout ) :: &
pre,xmb_out
Expand Down Expand Up @@ -223,7 +226,7 @@ subroutine cu_c3_deep_run( &
q,qo,zuo,zdo,zdm
!$acc declare sigmaout
real(kind=kind_phys), dimension (its:,kts:) &
,intent (out) :: &
,intent (out), optional :: &
sigmaout
real(kind=kind_phys), dimension (its:) &
,intent (in ) :: &
Expand Down Expand Up @@ -376,7 +379,7 @@ subroutine cu_c3_deep_run( &
!$acc ktopdby,kbconx,ierr2,ierr3,kbmax)

integer, dimension (its:), intent(inout) :: ierr
integer, dimension (its:), intent(in) :: csum
integer, dimension (its:), intent(in), optional :: csum
logical, intent(in) :: do_ca, progsigma
logical, intent(in) :: flag_init, flag_restart
!$acc declare copy(ierr) copyin(csum)
Expand Down
76 changes: 40 additions & 36 deletions physics/CONV/C3/cu_c3_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,19 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
real (kind=kind_phys), intent(in) :: g,cp,fv,r_d,xlv,r_v,betascu,betamcu,betadcu
logical, intent(in ) :: ldiag3d
logical, intent(in ) :: progsigma
real(kind=kind_phys), intent(inout) :: dtend(:,:,:)
real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:)
!$acc declare copy(dtend)
integer, intent(in) :: dtidx(:,:), &
index_of_x_wind, index_of_y_wind, index_of_temperature, &
index_of_process_scnv, index_of_process_dcnv, ntqv, ntcw, ntiw
!$acc declare copyin(dtidx)
real(kind=kind_phys), dimension( : , : ), intent(in ) :: forcet,forceqv_spechum,w,phil,delp
real(kind=kind_phys), dimension ( : , : ), intent(in ) :: sigmain,qmicro
real(kind=kind_phys), dimension( : , : ), intent(in ), optional :: forcet,forceqv_spechum
real(kind=kind_phys), dimension( : , : ), intent(in ) :: w,phil,delp
real(kind=kind_phys), dimension ( : , : ), intent(in ), optional :: sigmain,qmicro
real(kind=kind_phys), dimension( : , : ), intent(inout ) :: t,us,vs
real(kind=kind_phys), dimension( : , : ), intent(inout ) :: qci_conv
real(kind=kind_phys), dimension( : , : ), intent(inout ), optional :: qci_conv
real(kind=kind_phys), dimension( : , : ), intent(out ) :: cnvw_moist,cnvc
real(kind=kind_phys), dimension ( : , : ), intent(out ) :: sigmaout
real(kind=kind_phys), dimension ( : , : ), intent(out ), optional :: sigmaout
real(kind=kind_phys), dimension( : , : ), intent(inout ) :: cliw, clcw
real(kind=kind_phys), dimension ( : , : , :), intent(in ) :: tmf
!$acc declare copyin(forcet,forceqv_spechum,w,phil)
Expand All @@ -134,27 +135,31 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
integer, intent(in) :: dfi_radar_max_intervals
real(kind=kind_phys), intent(in) :: fhour, fh_dfi_radar(:)
integer, intent(in) :: num_dfi_radar, ix_dfi_radar(:)
real(kind=kind_phys), intent(in) :: cap_suppress(:,:)
real(kind=kind_phys), intent(in), optional :: cap_suppress(:,:)
!$acc declare copyin(fh_dfi_radar,ix_dfi_radar,cap_suppress)

integer, dimension (:), intent(out) :: hbot,htop,kcnv
integer, dimension (:), intent(in) :: xland
real(kind=kind_phys), dimension (:), intent(in) :: pbl,maxMF
real(kind=kind_phys), dimension (:), intent(in) :: pbl
real(kind=kind_phys), dimension (:), intent(in), optional :: maxMF
!$acc declare copyout(hbot,htop,kcnv)
!$acc declare copyin(xland,pbl)
integer, dimension (im) :: tropics
!$acc declare create(tropics)
! ruc variable
real(kind=kind_phys), dimension (:), intent(in) :: hfx2,qfx2,psuri,ca_deep
real(kind=kind_phys), dimension (:,:), intent(out) :: ud_mf,dd_mf,dt_mf
real(kind=kind_phys), dimension (:), intent(out) :: raincv,cld1d,maxupmf,rainevap
real(kind=kind_phys), dimension (:), intent(in) :: hfx2,qfx2,psuri
real(kind=kind_phys), dimension (:), intent(in), optional :: ca_deep
real(kind=kind_phys), dimension (:,:), intent(out), optional :: ud_mf
real(kind=kind_phys), dimension (:,:), intent(out) :: dd_mf,dt_mf
real(kind=kind_phys), dimension (:), intent(out) :: raincv,cld1d,rainevap
real(kind=kind_phys), dimension (:), intent(out), optional :: maxupmf
real(kind=kind_phys), dimension (:,:), intent(in) :: t2di,p2di
!$acc declare copyin(hfx2,qfx2,psuri,t2di,p2di)
!$acc declare copyout(ud_mf,dd_mf,dt_mf,raincv,cld1d)
! Specific humidity from FV3
real(kind=kind_phys), dimension (:,:), intent(in) :: qv2di_spechum
real(kind=kind_phys), dimension (:,:), intent(inout) :: qv_spechum
real(kind=kind_phys), dimension (:), intent(inout) :: aod_gf
real(kind=kind_phys), dimension (:), intent(inout), optional :: aod_gf
!$acc declare copyin(qv2di_spechum) copy(qv_spechum,aod_gf)
! Local water vapor mixing ratios and cloud water mixing ratios
real(kind=kind_phys), dimension (im,km) :: qv2di, qv, forceqv, cnvw
Expand All @@ -165,7 +170,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
real(kind=kind_phys), intent(in ) :: dt

integer, intent(in ) :: imfshalcnv
integer, dimension(:), intent(inout) :: cactiv,cactiv_m
integer, dimension(:), intent(inout), optional :: cactiv,cactiv_m
!$acc declare copy(cactiv,cactiv_m)

character(len=*), intent(out) :: errmsg
Expand Down Expand Up @@ -841,30 +846,29 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
,ca_deep &
,mconv &
,omeg &

,cactiv &
,cnvwt &
,zu &
,zd &
,zdm & ! hli
,edt &
,edtm & ! hli
,xmb &
,xmbm &
,xmbs &
,pret &
,outu &
,outv &
,outt &
,outq &
,outqc &
,kbcon &
,ktop &
,cupclw &
,frhd &
,rainevap &
,ierr &
,ierrc &
,cactiv &
,cnvwt &
,zu &
,zd &
,zdm & ! hli
,edt &
,edtm & ! hli
,xmb &
,xmbm &
,xmbs &
,pret &
,outu &
,outv &
,outt &
,outq &
,outqc &
,kbcon &
,ktop &
,cupclw &
,frhd &
,rainevap &
,ierr &
,ierrc &
! the following should be set to zero if not available
,rand_mom & ! for stochastics mom, if temporal and spatial patterns exist
,rand_vmas & ! for stochastics vertmass, if temporal and spatial patterns exist
Expand Down
15 changes: 15 additions & 0 deletions physics/CONV/C3/cu_c3_driver.meta
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,15 @@
dimensions = (horizontal_loop_extent)
type = integer
intent = inout
optional = True
[cactiv_m]
standard_name = counter_for_grell_freitas_mid_level_convection
long_name = mid-level cloud convective activity memory
units = none
dimensions = (horizontal_loop_extent)
type = integer
intent = inout
optional = True
[g]
standard_name = gravitational_acceleration
long_name = gravitational acceleration
Expand Down Expand Up @@ -219,6 +221,7 @@
type = real
kind = kind_phys
intent = in
optional = True
[forceqv_spechum]
standard_name = tendendy_of_specific_humidity_due_to_nonphysics
long_name = moisture tendency due to dynamics only
Expand All @@ -227,6 +230,7 @@
type = real
kind = kind_phys
intent = in
optional = True
[tmf]
standard_name = tendency_of_vertically_diffused_tracer_concentration
long_name = updated tendency of the tracers due to vertical diffusion in PBL scheme
Expand All @@ -243,6 +247,7 @@
type = real
kind = kind_phys
intent = in
optional = True
[sigmain]
standard_name = prognostic_updraft_area_fraction_in_convection
long_name = convective updraft area fraction
Expand All @@ -251,6 +256,7 @@
type = real
kind = kind_phys
intent = in
optional = True
[sigmaout]
standard_name = updraft_area_fraction_updated_by_physics
long_name = convective updraft area fraction updated by physics
Expand All @@ -259,6 +265,7 @@
type = real
kind = kind_phys
intent = out
optional = True
[betascu]
standard_name = tuning_param_for_shallow_cu
long_name = tuning param for shallow cu in case prognostic closure is used
Expand Down Expand Up @@ -438,6 +445,7 @@
type = real
kind = kind_phys
intent = inout
optional = True
[cliw]
standard_name = ice_water_mixing_ratio_convective_transport_tracer
long_name = ratio of mass of ice water to mass of dry air plus vapor (without condensates) in the convectively transported tracer array
Expand Down Expand Up @@ -470,6 +478,7 @@
type = real
kind = kind_phys
intent = out
optional = True
[dd_mf]
standard_name = instantaneous_atmosphere_downdraft_convective_mass_flux
long_name = (downdraft mass flux) * delt
Expand Down Expand Up @@ -531,6 +540,7 @@
type = real
kind = kind_phys
intent = inout
optional = True
[dtidx]
standard_name = cumulative_change_of_state_variables_outer_index
long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index
Expand Down Expand Up @@ -616,6 +626,7 @@
type = real
kind = kind_phys
intent = inout
optional = True
[fhour]
standard_name = forecast_time
long_name = current forecast time
Expand Down Expand Up @@ -661,6 +672,7 @@
type = real
kind = kind_phys
intent = in
optional = True
[ca_deep]
standard_name = cellular_automata_area_fraction_for_deep_convection_from_coupled_process
long_name = fraction of cellular automata for deep convection
Expand All @@ -669,6 +681,7 @@
type = real
kind = kind_phys
intent = in
optional = True
[rainevap]
standard_name = physics_field_for_coupling
long_name = physics_field_for_coupling
Expand All @@ -685,6 +698,7 @@
type = real
kind = kind_phys
intent = out
optional = True
[maxMF]
standard_name = maximum_mass_flux
long_name = maximum mass flux within a column
Expand All @@ -693,6 +707,7 @@
type = real
kind = kind_phys
intent = in
optional = True
[do_mynnedmf]
standard_name = flag_for_mellor_yamada_nakanishi_niino_pbl_scheme
long_name = flag to activate MYNN-EDMF
Expand Down
15 changes: 8 additions & 7 deletions physics/CONV/C3/cu_c3_driver_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ subroutine cu_c3_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m
real(kind_phys), intent(in) :: t(:,:)
real(kind_phys), intent(in) :: q(:,:)
real(kind_phys), dimension(:),intent(in) :: garea
real(kind_phys), intent(out) :: prevst(:,:)
real(kind_phys), intent(out) :: prevsq(:,:)
integer, intent(in) :: cactiv(:)
integer, intent(in) :: cactiv_m(:)
real(kind_phys), intent(out) :: conv_act(:)
real(kind_phys), intent(out) :: conv_act_m(:)
real(kind_phys), intent(out), optional :: prevst(:,:)
real(kind_phys), intent(out), optional :: prevsq(:,:)
integer, intent(in), optional :: cactiv(:)
integer, intent(in), optional :: cactiv_m(:)
real(kind_phys), intent(out), optional :: conv_act(:)
real(kind_phys), intent(out), optional :: conv_act_m(:)
! for Radar reflectivity
real(kind_phys), intent(in) :: dt
real(kind_phys), intent(in) :: raincv(:), maxupmf(:)
real(kind_phys), intent(in) :: raincv(:)
real(kind_phys), intent(in), optional :: maxupmf(:)
real(kind_phys), intent(inout) :: refl_10cm(:,:)
character(len=*), intent(out) :: errmsg
!$acc declare copyin(t,q,cactiv,cactiv_m) copyout(prevst,prevsq,conv_act,conv_act_m)
Expand Down
7 changes: 7 additions & 0 deletions physics/CONV/C3/cu_c3_driver_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
type = real
kind = kind_phys
intent = out
optional = True
[prevsq]
standard_name = specific_humidity_on_previous_timestep
long_name = moisture from previous time step
Expand All @@ -53,20 +54,23 @@
type = real
kind = kind_phys
intent = out
optional = True
[cactiv]
standard_name = counter_for_grell_freitas_convection
long_name = convective activity memory
units = none
dimensions = (horizontal_loop_extent)
type = integer
intent = in
optional = True
[cactiv_m]
standard_name = counter_for_grell_freitas_mid_level_convection
long_name = midlevel convective activity memory
units = none
dimensions = (horizontal_loop_extent)
type = integer
intent = in
optional = True
[conv_act]
standard_name = consecutive_calls_for_grell_freitas_convection
long_name = Memory counter for GF
Expand All @@ -75,6 +79,7 @@
type = real
kind = kind_phys
intent = out
optional = True
[conv_act_m]
standard_name = consecutive_calls_for_grell_freitas_mid_level_convection
long_name = Memory counter for GF midlevel
Expand All @@ -83,6 +88,7 @@
type = real
kind = kind_phys
intent = out
optional = True
[dt]
standard_name = timestep_for_physics
long_name = physics time step
Expand Down Expand Up @@ -115,6 +121,7 @@
type = real
kind = kind_phys
intent = in
optional = True
[refl_10cm]
standard_name = radar_reflectivity_10cm
long_name = instantaneous refl_10cm
Expand Down
Loading
Loading