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: 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 diff --git a/DynCore_GridCompMod.F90 b/DynCore_GridCompMod.F90 index d8d669c..58f93ad 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', & @@ -2810,8 +2828,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 (:,:,:) @@ -3504,15 +3520,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 ! ------- @@ -3635,7 +3647,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) @@ -3799,21 +3811,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 ! ------- @@ -6279,7 +6281,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) @@ -6751,7 +6753,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 @@ -6762,7 +6764,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 @@ -6781,6 +6785,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(:,:,:) @@ -6957,6 +6962,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) ) @@ -6981,12 +6988,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 )