From f78aa42b1b9e6f6c019fb7549e5e49771957bc52 Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Tue, 3 Dec 2019 22:25:28 +0000 Subject: [PATCH 01/16] Reset to zero coupling arrays for accumulated snow, large scale rain, and convective rain at the end of each coupling step if coupling with chemistry model. --- atmos_model.F90 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/atmos_model.F90 b/atmos_model.F90 index 23e30e76c..bb94bc163 100644 --- a/atmos_model.F90 +++ b/atmos_model.F90 @@ -1457,6 +1457,24 @@ subroutine update_atmos_chemistry(state, rc) enddo enddo + ! -- zero out accumulated fields +!$OMP parallel do default (none) & +!$OMP shared (nj, ni, Atm_block, IPD_Control, IPD_Data) & +!$OMP private (j, jb, i, ib, nb, ix) + do j = 1, nj + jb = j + Atm_block%jsc - 1 + do i = 1, ni + ib = i + Atm_block%isc - 1 + nb = Atm_block%blkno(ib,jb) + ix = Atm_block%ixp(ib,jb) + IPD_Data(nb)%coupling%rainc_cpl(ix) = zero + if (.not.IPD_Control%cplflx) then + IPD_Data(nb)%coupling%rain_cpl(ix) = zero + IPD_Data(nb)%coupling%snow_cpl(ix) = zero + end if + enddo + enddo + if (IPD_Control%debug) then ! -- diagnostics write(6,'("update_atmos: prsi - min/max/avg",3g16.6)') minval(prsi), maxval(prsi), sum(prsi)/size(prsi) From 75654acb927799a4caad875d0d900e2fdedf336a Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Tue, 3 Dec 2019 22:48:19 +0000 Subject: [PATCH 02/16] Properly set kind type of literal constants defining zero and one. --- atmos_model.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/atmos_model.F90 b/atmos_model.F90 index bb94bc163..0883d3da9 100644 --- a/atmos_model.F90 +++ b/atmos_model.F90 @@ -221,7 +221,8 @@ module atmos_model_mod logical,parameter :: flip_vc = .true. #endif - real(kind=IPD_kind_phys), parameter :: zero=0.0, one=1.0 + real(kind=IPD_kind_phys), parameter :: zero = 0.0_IPD_kind_phys, & + one = 1.0_IPD_kind_phys contains From 2870f5e2edfe211a4f926834613aa7115b50da29 Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Tue, 3 Dec 2019 23:19:57 +0000 Subject: [PATCH 03/16] Initialize to zero canopy resistance output variable in noah/osu land-surface model subdriver. --- gfsphysics/physics/sflx.f | 1 + 1 file changed, 1 insertion(+) diff --git a/gfsphysics/physics/sflx.f b/gfsphysics/physics/sflx.f index 29467fe37..f84006be9 100644 --- a/gfsphysics/physics/sflx.f +++ b/gfsphysics/physics/sflx.f @@ -251,6 +251,7 @@ subroutine sflx & runoff2 = 0.0 runoff3 = 0.0 snomlt = 0.0 + rc = 0.0 ! --- ... define local variable ice to achieve: ! sea-ice case, ice = 1 From 37fb245a137cff7519a5b1c46da5114c1c365c7f Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Tue, 3 Dec 2019 23:25:45 +0000 Subject: [PATCH 04/16] Re-implement radiation diagnostic output involving spectral band layer cloud optical depths (0.55 and 10 mu channels) to prevent floating invalid errors due to uninitialized optical depth arrays. --- gfsphysics/GFS_layer/GFS_radiation_driver.F90 | 39 +++++++++++++++---- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/gfsphysics/GFS_layer/GFS_radiation_driver.F90 b/gfsphysics/GFS_layer/GFS_radiation_driver.F90 index c7323d6bb..4a3f080f9 100644 --- a/gfsphysics/GFS_layer/GFS_radiation_driver.F90 +++ b/gfsphysics/GFS_layer/GFS_radiation_driver.F90 @@ -2116,18 +2116,41 @@ subroutine GFS_radiation_driver & Diag%fluxr(i,11-j) = Diag%fluxr(i,11-j) + tem0d * Statein%prsi(i,itop+kt) Diag%fluxr(i,14-j) = Diag%fluxr(i,14-j) + tem0d * Statein%prsi(i,ibtc+kb) Diag%fluxr(i,17-j) = Diag%fluxr(i,17-j) + tem0d * Statein%tgrs(i,itop) + enddo + enddo ! Anning adds optical depth and emissivity output - tem1 = 0. - tem2 = 0. - do k=ibtc,itop - tem1 = tem1 + cldtausw(i,k) ! approx .55 mu channel - tem2 = tem2 + cldtaulw(i,k) ! approx 10. mu channel + + if (Model%lsswr .and. (nday > 0)) then + do j = 1, 3 + do i = 1, IM + tem0d = raddt * cldsa(i,j) + itop = mtopa(i,j) - kd + ibtc = mbota(i,j) - kd + tem1 = 0. + do k=ibtc,itop + tem1 = tem1 + cldtausw(i,k) ! approx .55 um channel + enddo + Diag%fluxr(i,43-j) = Diag%fluxr(i,43-j) + tem0d * tem1 enddo - Diag%fluxr(i,43-j) = Diag%fluxr(i,43-j) + tem0d * tem1 - Diag%fluxr(i,46-j) = Diag%fluxr(i,46-j) + tem0d * (1.0-exp(-tem2)) enddo - enddo + endif + + if (Model%lslwr) then + do j = 1, 3 + do i = 1, IM + tem0d = raddt * cldsa(i,j) + itop = mtopa(i,j) - kd + ibtc = mbota(i,j) - kd + tem2 = 0. + do k=ibtc,itop + tem2 = tem2 + cldtaulw(i,k) ! approx 10. um channel + enddo + Diag%fluxr(i,46-j) = Diag%fluxr(i,46-j) + tem0d * (1.0-exp(-tem2)) + enddo + enddo + endif + endif endif ! end_if_lssav From 1c0a9bae0b72a4a2675c5559b572cb1d02274464 Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Tue, 3 Dec 2019 23:52:13 +0000 Subject: [PATCH 05/16] Reset to zero instantaneous total moisture tendency coupling array at the beginning of each coupling step if coupled with chemistry model. --- gfsphysics/GFS_layer/GFS_physics_driver.F90 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gfsphysics/GFS_layer/GFS_physics_driver.F90 b/gfsphysics/GFS_layer/GFS_physics_driver.F90 index 5b67f7faa..19c40bf24 100644 --- a/gfsphysics/GFS_layer/GFS_physics_driver.F90 +++ b/gfsphysics/GFS_layer/GFS_physics_driver.F90 @@ -3184,9 +3184,13 @@ subroutine GFS_physics_driver & dtdt(1:im,:) = Stateout%gt0(1:im,:) endif ! end if_ldiag3d/cnvgwd - if (Model%ldiag3d) then + if (Model%ldiag3d .or. Model%cplchm) then dqdt(1:im,:,1) = Stateout%gq0(1:im,:,1) - endif ! end if_ldiag3d + endif ! end if_ldiag3d/cplchm + + if (Model%cplchm) then + Coupling%dqdti(1:im,:) = zero + endif ! end if_cplchm #ifdef GFS_HYDRO call get_phi(im, ix, levs, ntrac, Stateout%gt0, Stateout%gq0, & From 735eb9eb9cf0a2dd7a39d890ef3c61259e5ccdcf Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Mon, 19 Oct 2020 17:38:30 -0500 Subject: [PATCH 06/16] Temporarily disable filling export fields during the NUOPC Realize phase since it breaks coupling with aerosol component. --- fv3_cap.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fv3_cap.F90 b/fv3_cap.F90 index 29b7c361a..b09bec3da 100644 --- a/fv3_cap.F90 +++ b/fv3_cap.F90 @@ -954,7 +954,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return end if !jw - call fillExportFields(exportData) +! call fillExportFields(exportData) endif end subroutine InitializeRealize From 59cf366bc2572f36066252404be8bd3794c3aaec Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Mon, 19 Oct 2020 17:52:38 -0500 Subject: [PATCH 07/16] Moving previous commit to a branch. This reverts commit 735eb9eb9cf0a2dd7a39d890ef3c61259e5ccdcf. --- fv3_cap.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fv3_cap.F90 b/fv3_cap.F90 index b09bec3da..29b7c361a 100644 --- a/fv3_cap.F90 +++ b/fv3_cap.F90 @@ -954,7 +954,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return end if !jw -! call fillExportFields(exportData) + call fillExportFields(exportData) endif end subroutine InitializeRealize From 603e58d61b19c7e6ad380c16867899c393b2c5e4 Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Tue, 5 Oct 2021 22:07:50 +0000 Subject: [PATCH 08/16] Update ccpp/physics submodule to point to forked repository. --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index a54f243ae..9ba05de51 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,5 +8,5 @@ branch = main [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/NCAR/ccpp-physics - branch = main + url = https://github.com/rmontuoro/ccpp-physics + branch = feature/tvd From d38ff34c1f0b11b3de5a0e90064cee532c6ad56e Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Tue, 5 Oct 2021 23:02:14 +0000 Subject: [PATCH 09/16] Update ccpp/physics submodule to introduce TVD schemes. --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 2ececb085..ed3768b9e 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 2ececb085ba72f5dac6cf296e20771f1ae970a96 +Subproject commit ed3768b9e0c5c226d79ceb52414aaed8578c7206 From adf6e9c6053e3accf07f46415d8946e240ed530c Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Wed, 6 Oct 2021 17:47:37 +0000 Subject: [PATCH 10/16] Add to CCPP interstitial datatype a new tracer index for rain water in vertically-diffused tracer array. Ensure interstitial tracer indexes are properly set for specific microphysics schemes. --- ccpp/data/GFS_typedefs.F90 | 28 +++++++++++++++++++--------- ccpp/data/GFS_typedefs.meta | 6 ++++++ 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index eb47767f8..c6d54c243 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -1971,6 +1971,7 @@ module GFS_typedefs integer :: nspc1 !< integer :: ntcwx !< integer :: ntiwx !< + integer :: ntrwx !< integer :: ntk !< integer :: ntkev !< integer :: nvdiff !< @@ -7423,6 +7424,9 @@ subroutine interstitial_setup_tracers(Interstitial, Model) Interstitial%otspt(:,:) = .true. Interstitial%nsamftrac = 0 Interstitial%ncstrac = 0 + Interstitial%ntcwx = 0 + Interstitial%ntiwx = 0 + Interstitial%ntrwx = 0 ! perform aerosol convective transport and PBL diffusion Interstitial%trans_aero = Model%cplchm .and. Model%trans_trac @@ -7455,27 +7459,33 @@ subroutine interstitial_setup_tracers(Interstitial, Model) Interstitial%nscav = Model%ntrac - Model%ncnd + 2 - Interstitial%ntcwx = Model%ntcw if (Interstitial%nvdiff == Model%ntrac) then + Interstitial%ntcwx = Model%ntcw Interstitial%ntiwx = Model%ntiw + Interstitial%ntrwx = Model%ntrw else if (Model%imp_physics == Model%imp_physics_wsm6) then + Interstitial%ntcwx = 2 Interstitial%ntiwx = 3 elseif (Model%imp_physics == Model%imp_physics_thompson) then - if(Model%ltaerosol) then - Interstitial%ntiwx = 3 - else - Interstitial%ntiwx = 3 - endif + Interstitial%ntcwx = 2 + Interstitial%ntiwx = 3 + Interstitial%ntrwx = 4 elseif (Model%imp_physics == Model%imp_physics_gfdl) then + Interstitial%ntcwx = 2 Interstitial%ntiwx = 3 + Interstitial%ntrwx = 4 ! F-A MP scheme elseif (Model%imp_physics == Model%imp_physics_fer_hires) then - Interstitial%ntiwx = 3 ! total ice or total condensate + Interstitial%ntcwx = 2 + Interstitial%ntiwx = 3 + Interstitial%ntrwx = 4 elseif (Model%imp_physics == Model%imp_physics_mg) then + Interstitial%ntcwx = 2 Interstitial%ntiwx = 3 - else - Interstitial%ntiwx = 0 + Interstitial%ntrwx = 4 + elseif (Model%imp_physics == Model%imp_physics_zhao_carr) then + Interstitial%ntcwx = 2 endif endif ! *DH diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index f623a8027..2c1f29154 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -9006,6 +9006,12 @@ units = index dimensions = () type = integer +[ntrwx] + standard_name = index_for_rain_water_vertical_diffusion_tracer + long_name = tracer index for rain water in the vertically diffused tracer array + units = index + dimensions = () + type = integer [ntk] standard_name = index_for_turbulent_kinetic_energy_convective_transport_tracer long_name = index for turbulent kinetic energy in the convectively transported tracer array From 92770f924d3ea0de13624be53e9fd826fc8d4d86 Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Wed, 6 Oct 2021 17:52:42 +0000 Subject: [PATCH 11/16] Update ccpp/physics submodule. --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index ed3768b9e..9a7131f63 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit ed3768b9e0c5c226d79ceb52414aaed8578c7206 +Subproject commit 9a7131f6318b6fdedb1ffcc015ed4e06f81e2c40 From 064c3182d4ed53a285f12739f3f468514016c042 Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Wed, 6 Oct 2021 21:18:35 +0000 Subject: [PATCH 12/16] Update ccpp/physics submodule. --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 9a7131f63..7d080b8a5 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 9a7131f6318b6fdedb1ffcc015ed4e06f81e2c40 +Subproject commit 7d080b8a595bfeb8d9fc91138c5a360134ef0503 From 05a7dfe854fc47bced128dc7cbdcb1c013c0160f Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Fri, 5 Nov 2021 17:21:38 +0000 Subject: [PATCH 13/16] Update ccpp/physics submodule. --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 975afe7a3..0014964f9 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 975afe7a33ad9902096131e7119fd63d91a450e4 +Subproject commit 0014964f9da9fbde196c7988857a92c38283a8f2 From 98e8381e91a5cc43c57864db970ec621bacc3655 Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Mon, 8 Nov 2021 18:52:29 +0000 Subject: [PATCH 14/16] Update ccpp/physics submodule. --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 0014964f9..6bc90ec03 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 0014964f9da9fbde196c7988857a92c38283a8f2 +Subproject commit 6bc90ec037c5f707b71482b5bb9fbddcaef4630e From 027007f82bda769c7b96f230de11ec80221741ed Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Mon, 8 Nov 2021 19:26:58 +0000 Subject: [PATCH 15/16] Update ccpp/physics submodule. --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 6bc90ec03..3c00f02c5 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 6bc90ec037c5f707b71482b5bb9fbddcaef4630e +Subproject commit 3c00f02c5d928d00fb64d1f77c41fb1949f66b66 From 929cff4eb550bfc6347a19b8a638c1ea8c784266 Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Tue, 9 Nov 2021 16:54:12 +0000 Subject: [PATCH 16/16] Update ccpp/physics submodule to point to authoritative repository. --- .gitmodules | 4 ++-- ccpp/physics | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 9ba05de51..a54f243ae 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,5 +8,5 @@ branch = main [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/rmontuoro/ccpp-physics - branch = feature/tvd + url = https://github.com/NCAR/ccpp-physics + branch = main diff --git a/ccpp/physics b/ccpp/physics index 3c00f02c5..d18964278 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 3c00f02c5d928d00fb64d1f77c41fb1949f66b66 +Subproject commit d189642784545b7edfeebace7b972fea25f42e20