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

fix cpl_scalars #6

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
491b5c6
update ccpp
DeniseWorthen Nov 17, 2023
aeb1dfc
Revert "update ccpp"
DeniseWorthen Nov 17, 2023
06bc8e7
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Nov 20, 2023
e045ba6
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Nov 27, 2023
1bf307c
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Dec 4, 2023
e3ef1c4
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Dec 4, 2023
f5bdf74
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Dec 8, 2023
a3d0301
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Jan 26, 2024
f038d35
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Feb 3, 2024
9667ceb
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Feb 9, 2024
67465da
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Feb 13, 2024
4596682
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Mar 1, 2024
4c6659e
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Mar 12, 2024
58d0960
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Mar 19, 2024
20e14d8
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Mar 29, 2024
e960d11
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Apr 1, 2024
fda1252
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Apr 4, 2024
f2b50f3
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen May 29, 2024
14f6386
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Jun 13, 2024
64fb5ce
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Jun 25, 2024
2b18063
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Jul 8, 2024
65fec7d
HR4 Gravity Wave Drag Update (#836)
Qingfu-Liu Jul 10, 2024
aa65033
Merge branch 'NOAA-EMC:develop' into develop
DeniseWorthen Jul 15, 2024
ecfa66e
fix issues w/ cplscalars
DeniseWorthen Jul 15, 2024
3581423
hotfix to apply the cubed sphere a2b_edge.F90 bug fix (#858)
jkbk2004 Jul 16, 2024
8d715d5
Merge remote-tracking branch 'upstream/develop' into HEAD
DeniseWorthen Jul 16, 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
2 changes: 1 addition & 1 deletion atmos_cubed_sphere
18 changes: 17 additions & 1 deletion ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,7 @@ module GFS_typedefs
logical :: do_gsl_drag_ls_bl !< flag for GSL drag (mesoscale GWD and blocking only)
logical :: do_gsl_drag_ss !< flag for GSL drag (small-scale GWD only)
logical :: do_gsl_drag_tofd !< flag for GSL drag (turbulent orog form drag only)
logical :: do_gwd_opt_psl !< flag for PSL drag (mesoscale GWD and blocking only)
logical :: do_ugwp_v1 !< flag for version 1 ugwp GWD
logical :: do_ugwp_v1_orog_only !< flag for version 1 ugwp GWD (orographic drag only)
logical :: do_ugwp_v1_w_gsldrag !< flag for version 1 ugwp with OGWD of GSL
Expand Down Expand Up @@ -1213,6 +1214,8 @@ module GFS_typedefs
real(kind=kind_phys) :: ccwf(2) !< multiplication factor for critical cloud
!< workfunction for RAS
real(kind=kind_phys) :: cdmbgwd(4) !< multiplication factors for cdmb, gwd and NS gwd, tke based enhancement
real(kind=kind_phys) :: alpha_fd !< alpha coefficient for turbulent orographic form drag
real(kind=kind_phys) :: psl_gwd_dx_factor !< multiplication factors for grid spacing
real(kind=kind_phys) :: sup !< supersaturation in pdf cloud when t is very low
real(kind=kind_phys) :: ctei_rm(2) !< critical cloud top entrainment instability criteria
!< (used if mstrat=.true.)
Expand Down Expand Up @@ -3652,6 +3655,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
logical :: do_gsl_drag_ls_bl = .false. !< flag for GSL drag (mesoscale GWD and blocking only)
logical :: do_gsl_drag_ss = .false. !< flag for GSL drag (small-scale GWD only)
logical :: do_gsl_drag_tofd = .false. !< flag for GSL drag (turbulent orog form drag only)
logical :: do_gwd_opt_psl = .false. !< flag for PSL drag (mesoscale GWD and blocking only)
logical :: do_ugwp_v1 = .false. !< flag for version 1 ugwp GWD
logical :: do_ugwp_v1_orog_only = .false. !< flag for version 1 ugwp GWD (orographic drag only)
logical :: do_ugwp_v1_w_gsldrag = .false. !< flag for version 1 ugwp GWD (orographic drag only)
Expand Down Expand Up @@ -3755,6 +3759,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
real(kind=kind_phys) :: ccwf(2) = (/1.0d0,1.0d0/) !< multiplication factor for critical cloud
!< workfunction for RAS
real(kind=kind_phys) :: cdmbgwd(4) = (/2.0d0,0.25d0,1.0d0,1.0d0/) !< multiplication factors for cdmb, gwd, and NS gwd, tke based enhancement
real(kind=kind_phys) :: alpha_fd = 12.0 !< alpha coefficient for turbulent orographic form drag
real(kind=kind_phys) :: psl_gwd_dx_factor = 6.0 !< multiplication factors for grid spacing
real(kind=kind_phys) :: sup = 1.0 !< supersaturation in pdf cloud (IMP_physics=98) when t is very low
!< or ice super saturation in SHOC (when do_shoc=.true.)
real(kind=kind_phys) :: ctei_rm(2) = (/10.0d0,10.0d0/) !< critical cloud top entrainment instability criteria
Expand Down Expand Up @@ -4065,6 +4071,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
gwd_opt, do_ugwp_v0, do_ugwp_v0_orog_only, &
do_ugwp_v0_nst_only, &
do_gsl_drag_ls_bl, do_gsl_drag_ss, do_gsl_drag_tofd, &
do_gwd_opt_psl, &
do_ugwp_v1, do_ugwp_v1_orog_only, do_ugwp_v1_w_gsldrag, &
ugwp_seq_update, var_ric, coef_ric_l, coef_ric_s, hurr_pbl, &
do_myjsfc, do_myjpbl, &
Expand All @@ -4073,7 +4080,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
shinhong, do_ysu, dspheat, lheatstrg, lseaspray, cnvcld, &
xr_cnvcld, random_clds, shal_cnv, imfshalcnv, imfdeepcnv, &
isatmedmf, do_deep, jcap, &
cs_parm, flgmin, cgwf, ccwf, cdmbgwd, sup, ctei_rm, crtrh, &
cs_parm, flgmin, cgwf, ccwf, cdmbgwd, alpha_fd, &
psl_gwd_dx_factor, &
sup, ctei_rm, crtrh, &
dlqf, rbcr, shoc_parm, psauras, prauras, wminras, &
do_sppt, do_shum, do_skeb, &
do_spp, n_var_spp, &
Expand Down Expand Up @@ -4919,6 +4928,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%cgwf = cgwf
Model%ccwf = ccwf
Model%cdmbgwd = cdmbgwd
Model%alpha_fd = alpha_fd
Model%psl_gwd_dx_factor = psl_gwd_dx_factor
Model%sup = sup
Model%ctei_rm = ctei_rm
Model%crtrh = crtrh
Expand Down Expand Up @@ -4966,6 +4977,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%do_gsl_drag_ls_bl = do_gsl_drag_ls_bl
Model%do_gsl_drag_ss = do_gsl_drag_ss
Model%do_gsl_drag_tofd = do_gsl_drag_tofd
Model%do_gwd_opt_psl = do_gwd_opt_psl
Model%do_ugwp_v1 = do_ugwp_v1
Model%do_ugwp_v1_orog_only = do_ugwp_v1_orog_only
Model%do_ugwp_v1_w_gsldrag = do_ugwp_v1_w_gsldrag
Expand All @@ -4981,6 +4993,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%do_gsl_drag_tofd = .true.
Model%do_gsl_drag_ss = .true.
Model%do_ugwp_v1_orog_only = .false.
Model%do_gwd_opt_psl = .true.
endif

Model%do_myjsfc = do_myjsfc
Expand Down Expand Up @@ -6783,6 +6796,8 @@ subroutine control_print(Model)
print *, ' cgwf : ', Model%cgwf
print *, ' ccwf : ', Model%ccwf
print *, ' cdmbgwd : ', Model%cdmbgwd
print *, ' alpha_fd : ', Model%alpha_fd
print *, ' psl_gwd_dx_factor : ', Model%psl_gwd_dx_factor
print *, ' sup : ', Model%sup
print *, ' ctei_rm : ', Model%ctei_rm
print *, ' crtrh : ', Model%crtrh
Expand All @@ -6803,6 +6818,7 @@ subroutine control_print(Model)
print *, ' do_gsl_drag_ls_bl : ', Model%do_gsl_drag_ls_bl
print *, ' do_gsl_drag_ss : ', Model%do_gsl_drag_ss
print *, ' do_gsl_drag_tofd : ', Model%do_gsl_drag_tofd
print *, ' do_gwd_opt_psl : ', Model%do_gwd_opt_psl
print *, ' do_ugwp_v1 : ', Model%do_ugwp_v1
print *, ' do_ugwp_v1_orog_only : ', Model%do_ugwp_v1_orog_only
print *, ' do_ugwp_v1_w_gsldrag : ', Model%do_ugwp_v1_w_gsldrag
Expand Down
20 changes: 20 additions & 0 deletions ccpp/data/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -5626,6 +5626,13 @@
dimensions = (4)
type = real
kind = kind_phys
[alpha_fd]
standard_name = alpha_coefficient_for_turbulent_orographic_form_drag
long_name = alpha coefficient for Beljaars et al turbulent orographic form drag
units = 1
dimensions = ()
type = real
kind = kind_phys
[ccwf]
standard_name = tunable_parameter_for_critical_cloud_workfunction_in_relaxed_arakawa_schubert_deep_convection
long_name = multiplication factor for tical_cloud_workfunction
Expand Down Expand Up @@ -7445,6 +7452,19 @@
units = flag
dimensions = ()
type = logical
[do_gwd_opt_psl]
standard_name = do_gsl_drag_suite_with_psl_gwd_option
long_name = flag to activate PSL drag suite - mesoscale GWD and blocking
units = flag
dimensions = ()
type = logical
[psl_gwd_dx_factor]
standard_name = effective_grid_spacing_of_psl_gwd_suite
long_name = multiplication of grid spacing
units = 1
dimensions = ()
type = real
kind = kind_phys
[do_ugwp_v1]
standard_name = flag_for_ugwp_version_1
long_name = flag to activate ver 1 CIRES UGWP
Expand Down
2 changes: 1 addition & 1 deletion ccpp/framework
Submodule framework updated 42 files
+49 −0 .github/workflows/python.yaml
+3 −0 pytest.ini
+73 −11 scripts/ccpp_capgen.py
+342 −22 scripts/ccpp_datafile.py
+1 −1 scripts/ccpp_fortran_to_metadata.py
+37 −2 scripts/ccpp_suite.py
+216 −183 scripts/constituents.py
+91 −0 scripts/fortran_tools/offline_check_fortran_vs_metadata.py
+17 −3 scripts/fortran_tools/parse_fortran_file.py
+78 −5 scripts/host_cap.py
+33 −14 scripts/metadata_table.py
+13 −7 scripts/metavar.py
+0 −1 scripts/parse_tools/parse_source.py
+3 −3 scripts/suite_objects.py
+367 −37 src/ccpp_constituent_prop_mod.F90
+27 −0 test/advection_test/cld_ice.F90
+1 −0 test/advection_test/cld_ice.meta
+21 −0 test/advection_test/cld_liq.F90
+1 −0 test/advection_test/cld_liq.meta
+2 −0 test/advection_test/run_test
+392 −61 test/advection_test/test_host.F90
+3 −1 test/advection_test/test_host_mod.F90
+3 −0 test/advection_test/test_reports.py
+3 −1 test/capgen_test/run_test
+5 −5 test/capgen_test/temp_adjust.F90
+14 −0 test/capgen_test/temp_adjust.meta
+3 −1 test/capgen_test/temp_set.F90
+14 −0 test/capgen_test/temp_set.meta
+5 −4 test/capgen_test/test_reports.py
+1 −0 test/hash_table_tests/test_hash.F90
+1 −0 test/unit_tests/sample_files/test_host.meta
+96 −0 test/unit_tests/sample_scheme_files/duplicate_dyn_const.F90
+104 −0 test/unit_tests/sample_scheme_files/duplicate_dyn_const.meta
+75 −0 test/unit_tests/sample_scheme_files/dyn_const_not_present.F90
+104 −0 test/unit_tests/sample_scheme_files/dyn_const_not_present.meta
+100 −0 test/unit_tests/sample_scheme_files/dyn_const_not_present_nested.F90
+104 −0 test/unit_tests/sample_scheme_files/dyn_const_not_present_nested.meta
+21 −0 test/unit_tests/sample_scheme_files/temp_adjust.F90
+1 −0 test/unit_tests/sample_scheme_files/temp_adjust.meta
+35 −0 test/unit_tests/test_metadata_scheme_file.py
+3 −0 test/unit_tests/test_metadata_table.py
+2 −2 test/var_compatibility_test/test_reports.py
2 changes: 1 addition & 1 deletion cpl/module_cplscalars.F90
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ subroutine State_SetScalar(scalar_value, scalar_id, State, flds_scalar_name, fld
if (mytask == 0) then
call ESMF_FieldGet(lfield, farrayPtr = farrayptr, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
if (scalar_id < 0 .or. scalar_id > flds_scalar_num) then
if (scalar_id <= 0 .or. scalar_id > flds_scalar_num) then
call ESMF_LogWrite(trim(subname)//": ERROR in scalar_id", ESMF_LOGMSG_INFO)
rc = ESMF_FAILURE
return
Expand Down
24 changes: 16 additions & 8 deletions fv3_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ subroutine InitializeAdvertise(gcomp, rc)
call ESMF_LogWrite(trim(subname)//' flds_scalar_name = '//trim(flds_scalar_name), ESMF_LOGMSG_INFO)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
endif

call NUOPC_CompAttributeGet(gcomp, name="ScalarFieldCount", value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
if (isPresent .and. isSet) then
Expand All @@ -313,14 +312,23 @@ subroutine InitializeAdvertise(gcomp, rc)
call ESMF_LogWrite(trim(subname)//' : flds_scalar_index_ny = '//trim(msgString), ESMF_LOGMSG_INFO)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
endif
call NUOPC_CompAttributeGet(gcomp, name="ScalarFieldIdxGridNTile", value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
if (isPresent .and. isSet) then
read(cvalue,*) flds_scalar_index_ntile
write(msgString,*) flds_scalar_index_ntile
call ESMF_LogWrite(trim(subname)//' : flds_scalar_index_ntile = '//trim(msgString), ESMF_LOGMSG_INFO)
! tile index must be present if indices for nx and ny are non-zero
if (flds_scalar_index_nx /= 0 .and. flds_scalar_index_ny /=0 ) then
call NUOPC_CompAttributeGet(gcomp, name="ScalarFieldIdxGridNTile", isPresent=isPresent, isSet=isSet, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
endif
if (.not. isPresent .and. .not. isSet) then
if (mype == 0)write(*,*)'ERROR : ScalarFieldIdxGridNTile must be set'
call ESMF_LogWrite('ERROR : ScalarFieldIdxGridNTile must be set', ESMF_LOGMSG_ERROR)
rc = ESMF_FAILURE
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
else
call NUOPC_CompAttributeGet(gcomp, name="ScalarFieldIdxGridNTile", value=cvalue, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
read(cvalue,*) flds_scalar_index_ntile
write(msgString,*) flds_scalar_index_ntile
call ESMF_LogWrite(trim(subname)//' : flds_scalar_index_ntile = '//trim(msgString), ESMF_LOGMSG_INFO)
endif
end if

!------------------------------------------------------------------------
! get config variables
Expand Down