From 92519b5980245180050d343393be845e612ed2e5 Mon Sep 17 00:00:00 2001 From: Lawrence Takacs Date: Tue, 23 Aug 2022 12:07:30 -0400 Subject: [PATCH 1/4] Updates for lowest-model-level forcing Collections. Also, some quickplot fixes --- DynCore_GridCompMod.F90 | 96 +++++++++++++++++++++++++++++++---------- 1 file changed, 73 insertions(+), 23 deletions(-) diff --git a/DynCore_GridCompMod.F90 b/DynCore_GridCompMod.F90 index 7ab22b2..7b5057c 100644 --- a/DynCore_GridCompMod.F90 +++ b/DynCore_GridCompMod.F90 @@ -1067,6 +1067,24 @@ Subroutine SetServices ( gc, rc ) VLOCATION = MAPL_VLocationCenter, RC=STATUS ) VERIFY_(STATUS) + call MAPL_AddExportSpec ( gc, & + SHORT_NAME = 'DUDTPHY', & + LONG_NAME = 'tendency_of_eastward_wind_due_to_physics', & + UNITS = 'm/s/s', & + DIMS = MAPL_DimsHorzVert, & + FIELD_TYPE = MAPL_VectorField, & + VLOCATION = MAPL_VLocationCenter, RC=STATUS ) + VERIFY_(STATUS) + + call MAPL_AddExportSpec ( gc, & + SHORT_NAME = 'DVDTPHY', & + LONG_NAME = 'tendency_of_northward_wind_due_to_physics', & + UNITS = 'm/s/s', & + DIMS = MAPL_DimsHorzVert, & + FIELD_TYPE = MAPL_VectorField, & + VLOCATION = MAPL_VLocationCenter, RC=STATUS ) + VERIFY_(STATUS) + call MAPL_AddExportSpec ( gc, & SHORT_NAME = 'DUDTANA', & LONG_NAME = 'tendency_of_eastward_wind_due_to_analysis', & @@ -2809,8 +2827,6 @@ subroutine Run(gc, import, export, clock, rc) real(r8), allocatable :: trsum1(:) ! Global Sum of Tracers before Add_Incs real(r8), allocatable :: trsum2(:) ! Global Sum of Tracers after Add_Incs - real(kind=4), pointer :: dudtana(:,:,:) - real(kind=4), pointer :: dvdtana(:,:,:) real(kind=4), pointer :: dtdtana(:,:,:) real(kind=4), pointer :: ddpdtana(:,:,:) real(kind=4), pointer :: qctmp (:,:,:) @@ -3503,15 +3519,11 @@ subroutine Run(gc, import, export, clock, rc) ! DUDTANA ! ------- - call MAPL_GetPointer ( export, dudtana, 'DUDTANA', rc=status ) - VERIFY_(STATUS) - if( associated(dudtana) ) dudtana = ua +! Note: Calculation of DUDTANA moved to ADD_INCS to account for AtoD & DtoA transformations ! DVDTANA ! ------- - call MAPL_GetPointer ( export, dvdtana, 'DVDTANA', rc=status ) - VERIFY_(STATUS) - if( associated(dvdtana) ) dvdtana = va +! Note: Calculation of DVDTANA moved to ADD_INCS to account for AtoD & DtoA transformations ! DTDTANA ! ------- @@ -3634,7 +3646,7 @@ subroutine Run(gc, import, export, clock, rc) ! ----------------------- delpold = delp ! Old Pressure Thickness - call ADD_INCS ( STATE,IMPORT,DT,IS_WEIGHTED=IS_WEIGHTED ) + call ADD_INCS ( STATE,IMPORT,EXPORT,DT,'ANA ADD_INCS',IS_WEIGHTED=IS_WEIGHTED ) if (DYN_DEBUG) call DEBUG_FV_STATE('ANA ADD_INCS',STATE) @@ -3798,21 +3810,11 @@ subroutine Run(gc, import, export, clock, rc) ! DUDTANA ! ------- - call MAPL_GetPointer ( export, dudtana, 'DUDTANA', rc=status ) - VERIFY_(STATUS) - if( associated(dudtana) ) then - dummy = ua - dudtana = (dummy-dudtana)/dt - endif +! Note: Calculation of DUDTANA moved to ADD_INCS to account for AtoD & DtoA transformations ! DVDTANA ! ------- - call MAPL_GetPointer ( export, dvdtana, 'DVDTANA', rc=status ) - VERIFY_(STATUS) - if( associated(dvdtana) ) then - dummy = va - dvdtana = (dummy-dvdtana)/dt - endif +! Note: Calculation of DVDTANA moved to ADD_INCS to account for AtoD & DtoA transformations ! DTDTANA ! ------- @@ -6278,7 +6280,7 @@ subroutine RunAddIncs(gc, import, export, clock, rc) ! Add Diabatic Forcing to State Variables ! --------------------------------------- - call ADD_INCS ( STATE,IMPORT,DT ) + call ADD_INCS ( STATE,IMPORT,EXPORT,DT,'PHYSICS ADD_INCS' ) if (DYN_DEBUG) call DEBUG_FV_STATE('PHYSICS ADD_INCS',STATE) @@ -6750,7 +6752,7 @@ subroutine RunAddIncs(gc, import, export, clock, rc) end subroutine RunAddIncs !----------------------------------------------------------------------- - subroutine ADD_INCS ( STATE,IMPORT,DT,IS_WEIGHTED,RC ) + subroutine ADD_INCS ( STATE,IMPORT,EXPORT,DT,STRING,IS_WEIGHTED,RC ) use fms_mod, only: set_domain, nullify_domain use fv_diagnostics_mod, only: prt_maxmin @@ -6761,7 +6763,9 @@ subroutine ADD_INCS ( STATE,IMPORT,DT,IS_WEIGHTED,RC ) type(DynState), pointer :: STATE type(ESMF_State), intent(INOUT) :: IMPORT + type(ESMF_State), intent(INOUT) :: EXPORT real(FVPRC), intent(IN ) :: DT + character(len=*), intent(IN ) :: STRING integer, optional, intent(OUT ) :: RC logical, optional, intent(IN ) :: is_weighted @@ -6780,6 +6784,7 @@ subroutine ADD_INCS ( STATE,IMPORT,DT,IS_WEIGHTED,RC ) real(r4), allocatable :: fvQOLD(:,:,:), QTEND(:,:,:) real(r8), allocatable :: DPNEW(:,:,:),DPOLD(:,:,:) + real(REAL8), allocatable :: ua(:,:,:), va(:,:,:) real(REAL8), allocatable :: tend_ua(:,:,:), tend_va(:,:,:) real(REAL8), allocatable :: tend_un(:,:,:), tend_vn(:,:,:) @@ -6956,6 +6961,8 @@ subroutine ADD_INCS ( STATE,IMPORT,DT,IS_WEIGHTED,RC ) ! **** while IMPORT Tendencies are on the A-Grid **** ! ********************************************************************** + ALLOCATE( ua(is:ie ,js:je ,km) ) + ALLOCATE( va(is:ie ,js:je ,km) ) ALLOCATE( tend_ua(is:ie ,js:je ,km) ) ALLOCATE( tend_va(is:ie ,js:je ,km) ) ALLOCATE( tend_un(is:ie ,js:je+1,km) ) @@ -6980,12 +6987,55 @@ subroutine ADD_INCS ( STATE,IMPORT,DT,IS_WEIGHTED,RC ) ! Put the wind tendencies on the Native Dynamics grid ! --------------------------------------------------- call Agrid_To_Native( tend_ua, tend_va, tend_un, tend_vn ) + call getAgridWinds( STATE%VARS%U, STATE%VARS%V, ua, va, rotate=.true.) + + if( trim(STRING) == 'ANA ADD_INCS' ) then + call ESMFL_StateGetPointerToData ( EXPORT,TEND,'DUDTANA',RC=STATUS ) + VERIFY_(STATUS) + if( associated(TEND) ) tend = ua(is:ie,js:je,1:km) + call ESMFL_StateGetPointerToData ( EXPORT,TEND,'DVDTANA',RC=STATUS ) + VERIFY_(STATUS) + if( associated(TEND) ) tend = va(is:ie,js:je,1:km) + endif + + if( trim(STRING) == 'PHYSICS ADD_INCS' ) then + call ESMFL_StateGetPointerToData ( EXPORT,TEND,'DUDTPHY',RC=STATUS ) + VERIFY_(STATUS) + if( associated(TEND) ) tend = ua(is:ie,js:je,1:km) + call ESMFL_StateGetPointerToData ( EXPORT,TEND,'DVDTPHY',RC=STATUS ) + VERIFY_(STATUS) + if( associated(TEND) ) tend = va(is:ie,js:je,1:km) + endif ! Add the wind tendencies to the control variables ! ------------------------------------------------ STATE%VARS%U = STATE%VARS%U + DT*TEND_UN(is:ie,js:je,1:km) STATE%VARS%V = STATE%VARS%V + DT*TEND_VN(is:ie,js:je,1:km) + ! Put the wind tendencies back on A-Grid (for consistency with wind output) + ! ------------------------------------------------------------------------- + call getAgridWinds( STATE%VARS%U, STATE%VARS%V, ua, va, rotate=.true.) + + if( trim(STRING) == 'ANA ADD_INCS' ) then + call ESMFL_StateGetPointerToData ( EXPORT,TEND,'DUDTANA',RC=STATUS ) + VERIFY_(STATUS) + if( associated(TEND) ) tend = ( ua(is:ie,js:je,1:km)-tend )/DT + call ESMFL_StateGetPointerToData ( EXPORT,TEND,'DVDTANA',RC=STATUS ) + VERIFY_(STATUS) + if( associated(TEND) ) tend = ( va(is:ie,js:je,1:km)-tend )/DT + endif + + if( trim(STRING) == 'PHYSICS ADD_INCS' ) then + call ESMFL_StateGetPointerToData ( EXPORT,TEND,'DUDTPHY',RC=STATUS ) + VERIFY_(STATUS) + if( associated(TEND) ) tend = ( ua(is:ie,js:je,1:km)-tend )/DT + call ESMFL_StateGetPointerToData ( EXPORT,TEND,'DVDTPHY',RC=STATUS ) + VERIFY_(STATUS) + if( associated(TEND) ) tend = ( va(is:ie,js:je,1:km)-tend )/DT + endif + + DEALLOCATE( ua ) + DEALLOCATE( va ) DEALLOCATE( tend_ua ) DEALLOCATE( tend_va ) DEALLOCATE( tend_un ) From e13a1bf7ec04ef111b4e946fe5c8a24ecaf561dc Mon Sep 17 00:00:00 2001 From: Scott Rabenhorst Date: Thu, 29 Sep 2022 11:48:44 -0400 Subject: [PATCH 2/4] Fix incorrect pressure weighted accumulated mass flux units --- DynCore_GridCompMod.F90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DynCore_GridCompMod.F90 b/DynCore_GridCompMod.F90 index 7ab22b2..6d626f0 100644 --- a/DynCore_GridCompMod.F90 +++ b/DynCore_GridCompMod.F90 @@ -993,17 +993,17 @@ Subroutine SetServices ( gc, rc ) VERIFY_(STATUS) call MAPL_AddExportSpec ( gc, & - SHORT_NAME = 'MX', & + SHORT_NAME = 'MX', & LONG_NAME = 'pressure_weighted_accumulated_eastward_mass_flux', & - UNITS = 'Pa m+2 s-1', & + UNITS = 'Pa m+2', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, RC=STATUS ) VERIFY_(STATUS) call MAPL_AddExportSpec ( gc, & - SHORT_NAME = 'MY', & + SHORT_NAME = 'MY', & LONG_NAME = 'pressure_weighted_accumulated_northward_mass_flux', & - UNITS = 'Pa m+2 s-1', & + UNITS = 'Pa m+2', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, RC=STATUS ) VERIFY_(STATUS) @@ -1011,7 +1011,7 @@ Subroutine SetServices ( gc, rc ) call MAPL_AddExportSpec ( gc, & SHORT_NAME = 'MFX', & LONG_NAME = 'pressure_weighted_accumulated_eastward_mass_flux', & - UNITS = 'Pa m+2 s-1', & + UNITS = 'Pa m+2', & PRECISION = ESMF_KIND_R8, & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, RC=STATUS ) @@ -1020,7 +1020,7 @@ Subroutine SetServices ( gc, rc ) call MAPL_AddExportSpec ( gc, & SHORT_NAME = 'MFY', & LONG_NAME = 'pressure_weighted_accumulated_northward_mass_flux', & - UNITS = 'Pa m+2 s-1', & + UNITS = 'Pa m+2', & PRECISION = ESMF_KIND_R8, & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, RC=STATUS ) From 54943e4e7406d733baa7c5032b30bb423d90de15 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Wed, 5 Apr 2023 15:07:57 -0400 Subject: [PATCH 3/4] Fixes for CI --- .circleci/config.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cd43706..e58b49e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,9 @@ version: 2.1 -# Anchor to prevent forgetting to update a version -baselibs_version: &baselibs_version v7.5.0 +# Anchors to prevent forgetting to update a version +baselibs_version: &baselibs_version v7.7.0 +bcs_version: &bcs_version v10.25.0 + orbs: ci: geos-esm/circleci-tools@1 @@ -19,6 +21,7 @@ workflows: baselibs_version: *baselibs_version repo: GEOSgcm checkout_fixture: true + fixture_branch: release/v10 mepodevelop: true persist_workspace: true # Needs to be true to run fv3/gcm experiment, costs extra - ci/run_fv3: @@ -43,6 +46,7 @@ workflows: baselibs_version: *baselibs_version repo: GEOSfvdycore checkout_fixture: true + fixture_branch: release/v1 mepodevelop: false persist_workspace: true # Needs to be true to run fv3/gcm experiment, costs extra - ci/run_fv3: From c2d05163002c32c40efd61cc1d3245098cf95eb0 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Wed, 5 Apr 2023 15:24:12 -0400 Subject: [PATCH 4/4] Add label enforcer --- .github/workflows/enforce-labels.yml | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/enforce-labels.yml diff --git a/.github/workflows/enforce-labels.yml b/.github/workflows/enforce-labels.yml new file mode 100644 index 0000000..6e1720e --- /dev/null +++ b/.github/workflows/enforce-labels.yml @@ -0,0 +1,29 @@ +name: Enforce PR Labels + +on: + pull_request: + types: [opened, labeled, unlabeled, edited, synchronize] + +jobs: + require-label: + runs-on: ubuntu-latest + steps: + - uses: mheap/github-action-required-labels@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + mode: minimum + count: 1 + labels: "0 diff,0 diff trivial,Non 0-diff,0 diff structural,0-diff trivial,Not 0-diff,0-diff,automatic,0-diff uncoupled" + add_comment: true + blocking-label: + runs-on: ubuntu-latest + steps: + - uses: mheap/github-action-required-labels@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + mode: exactly + count: 0 + labels: "Contingent - DNA,Needs Lead Approval,Contingent -- Do Not Approve" + add_comment: true