From f78aa42b1b9e6f6c019fb7549e5e49771957bc52 Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Tue, 3 Dec 2019 22:25:28 +0000 Subject: [PATCH 1/9] 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 2/9] 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 3/9] 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 4/9] 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 5/9] 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 6/9] 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 7/9] 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 985aeee7be1a0d0a9e343019194da5e6825fb185 Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Tue, 15 Mar 2022 13:44:39 +0000 Subject: [PATCH 8/9] Point ccpp/physics submodule to forked repository. --- .gitmodules | 4 ++-- ccpp/physics | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6bb663df1..cce0501fc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,8 +8,8 @@ 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 = bugfix/thompson-tracer-index [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP diff --git a/ccpp/physics b/ccpp/physics index 979324a89..c34da796b 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 979324a89894133473c4663fc490d04cdce57ac0 +Subproject commit c34da796bed574ce96fdbe3ba32706fe7961fc00 From ee2a733645610e457f3222ea29f545b6e38b22fb Mon Sep 17 00:00:00 2001 From: Raffaele Montuoro Date: Tue, 22 Mar 2022 15:25:39 +0000 Subject: [PATCH 9/9] 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 cce0501fc..6bb663df1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,8 +8,8 @@ branch = main [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/rmontuoro/ccpp-physics - branch = bugfix/thompson-tracer-index + url = https://github.com/NCAR/ccpp-physics + branch = main [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP diff --git a/ccpp/physics b/ccpp/physics index 69be5f3bb..4a9b26c6f 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 69be5f3bb89b11abf1a84d8055c13871a0624d37 +Subproject commit 4a9b26c6f53267e89ee2836e5295a32dfc03016e