Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

# Anchors in case we need to override the defaults from the orb
#baselibs_version: &baselibs_version v8.9.0
#baselibs_version: &baselibs_version v8.14.0
#bcs_version: &bcs_version v12.0.0

orbs:
Expand All @@ -10,6 +10,7 @@ orbs:
workflows:
build-test:
jobs:
# Build GEOSgcm
- ci/build:
name: build-GEOSgcm-on-<< matrix.compiler >>
context:
Expand All @@ -23,7 +24,7 @@ workflows:
# V12 code uses a special branch for now.
fixture_branch: feature/sdrabenh/gcm_v12
# We comment out this as it will "undo" the fixture_branch
#mepodevelop: false
#mepodevelop: true
persist_workspace: true # Needs to be true to run fv3/gcm experiment, costs extra
- ci/run_fv3:
name: run-FV3-on-<< matrix.compiler >>-with-GEOSgcm
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/enforce-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,25 @@ jobs:
require-label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v2
- uses: mheap/github-action-required-labels@v5
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"
labels: "0 diff,0 diff trivial,Non 0-diff,0 diff structural,0-diff trivial,Not 0-diff,0-diff,automatic,0-diff uncoupled,github_actions"
add_comment: true
message: "This PR is being prevented from merging because you have not added one of our required labels: {{ provided }}. Please add one so that the PR can be merged."

blocking-label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v2
- uses: mheap/github-action-required-labels@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
mode: exactly
count: 0
labels: "Contingent - DNA,Needs Lead Approval,Contingent -- Do Not Approve"
add_comment: true
message: "This PR is being prevented from merging because you have added one of our blocking labels: {{ provided }}. You'll need to remove it before this PR can be merged."
2 changes: 1 addition & 1 deletion .github/workflows/push-to-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
fetch-depth: 0
- name: Run the action
uses: devops-infra/action-pull-request@v0.4
uses: devops-infra/action-pull-request@v0.5.5
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: feature/sdrabenh/gcm_v12
Expand Down
36 changes: 18 additions & 18 deletions AdvCore_GridCompMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
!
! !MODULE: AdvCore_GridCompMod
!
! !DESCRIPTION:
! !DESCRIPTION:
! This a MAPL component that can be used in
! either with offline or online applications to advect an arbitrary set
! of constituents.
Expand All @@ -21,7 +21,7 @@
! which this component is taken may be found in:
!
! \begin{quote}
! Lin, S.-J. 2004, A vertically Lagrangian Finite-Volume Dynamical
! Lin, S.-J. 2004, A vertically Lagrangian Finite-Volume Dynamical
! Core for Global Models. {\em Mon. Wea. Rev.}, {\bf 132}, 2293-2307.
! \end{quote}
!
Expand All @@ -46,7 +46,7 @@
! state. Each Field in the Bundle is tested for ``Friendliness'' to
! advection; if friendly it is advected and its values updated.
!
! Currently no Export capability is implemented.
! Currently no Export capability is implemented.
!
! !INTERFACE:

Expand All @@ -60,7 +60,7 @@ module AdvCore_GridCompMod
use m_set_eta, only: set_eta
use mpp_mod, only: mpp_pe, mpp_root_pe
use fv_arrays_mod, only: fv_atmos_type, FVPRC, REAL4, REAL8
use fms_mod, only: fms_init, set_domain, nullify_domain
use fms_mod, only: fms_init
use fv_control_mod, only: fv_init1, fv_init2, fv_end
use fv_tracer2d_mod, only: offline_tracer_advection
use fv_mp_mod, only: is,ie, js,je, is_master, tile
Expand Down Expand Up @@ -139,7 +139,7 @@ subroutine SetServices(GC, rc)

! Get my name and set-up traceback handle
! ---------------------------------------

call ESMF_GridCompGet( GC, NAME=COMP_NAME, vm=vm, RC=STATUS )
VERIFY_(STATUS)
Iam = trim(COMP_NAME) // 'SetServices'
Expand Down Expand Up @@ -195,7 +195,7 @@ subroutine SetServices(GC, rc)

call MAPL_AddImportSpec ( gc, &
SHORT_NAME = 'PLE1', &
LONG_NAME = 'pressure_at_layer_edges_after_advection', &
LONG_NAME = 'pressure_at_layer_edges_after_advection', &
UNITS = 'Pa', &
PRECISION = ESMF_KIND_R8, &
DIMS = MAPL_DimsHorzVert, &
Expand All @@ -218,7 +218,7 @@ subroutine SetServices(GC, rc)
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, RC=STATUS )
VERIFY_(STATUS)


! 3D Tracers
do ntracer=1,ntracers
Expand Down Expand Up @@ -256,7 +256,7 @@ subroutine SetServices(GC, rc)
call MAPL_GridCompSetEntryPoint ( gc, ESMF_METHOD_FINALIZE, Finalize, RC=status)
VERIFY_(STATUS)

! Check if AdvCore is running without FV3_DynCoreIsRunning, if yes then setup the MAPL Grid
! Check if AdvCore is running without FV3_DynCoreIsRunning, if yes then setup the MAPL Grid
! ----------------------------------------------------------------------------
call MAPL_GetObjectFromGC (GC, MAPL, RC=STATUS )
VERIFY_(STATUS)
Expand Down Expand Up @@ -341,7 +341,7 @@ subroutine SetServices(GC, rc)
call fv_init2(FV_Atm, dt, grids_on_my_pe, p_split)
end if

! Ending with a Generic SetServices call is a MAPL requirement
! Ending with a Generic SetServices call is a MAPL requirement
!-------------------------------------------------------------
call MAPL_GenericSetServices ( GC, rc=STATUS)
VERIFY_(STATUS)
Expand All @@ -360,7 +360,7 @@ end subroutine SetServices
subroutine Initialize(GC, IMPORT, EXPORT, CLOCK, RC)
!
! !INPUT/OUTPUT PARAMETERS:
type(ESMF_GridComp), intent(inout) :: GC ! Gridded component
type(ESMF_GridComp), intent(inout) :: GC ! Gridded component
type(ESMF_State), intent(inout) :: IMPORT ! Import state
type(ESMF_State), intent(inout) :: EXPORT ! Export state
type(ESMF_Clock), intent(inout) :: CLOCK ! The clock
Expand All @@ -371,8 +371,8 @@ subroutine Initialize(GC, IMPORT, EXPORT, CLOCK, RC)
! !DESCRIPTION:
! This initialization routine creates the import and export states,
! as well as the internal state, which is attached to the component.
! It also determines the distribution (and therefore the grid)
! and performs allocations of persistent data,
! It also determines the distribution (and therefore the grid)
! and performs allocations of persistent data,
!
!EOP
!=============================================================================
Expand All @@ -389,7 +389,7 @@ subroutine Initialize(GC, IMPORT, EXPORT, CLOCK, RC)
logical :: gridCreated
type(ESMF_Grid) :: grid

! Begin...
! Begin...

! Get the target components name and set-up traceback handle.
! -----------------------------------------------------------
Expand Down Expand Up @@ -452,7 +452,7 @@ end subroutine Initialize
subroutine Run(GC, IMPORT, EXPORT, CLOCK, RC)
!
! !INPUT/OUTPUT PARAMETERS:
type(ESMF_GridComp), intent(inout) :: GC ! Gridded component
type(ESMF_GridComp), intent(inout) :: GC ! Gridded component
type(ESMF_State), intent(inout) :: IMPORT ! Import state
type(ESMF_State), intent(inout) :: EXPORT ! Export state
type(ESMF_Clock), intent(inout) :: CLOCK ! The clock
Expand All @@ -461,7 +461,7 @@ subroutine Run(GC, IMPORT, EXPORT, CLOCK, RC)
integer, optional, intent( out) :: RC ! Error code
!
! !DESCRIPTION:
!
!
! The Run method advanced the advection one long time step, as
! specified in the configuration. This may be broken down int a
! number of internal, small steps, also configurable.
Expand Down Expand Up @@ -696,7 +696,7 @@ subroutine Run(GC, IMPORT, EXPORT, CLOCK, RC)
end if

if (allocated(biggerlist)) then
deallocate(biggerlist)
deallocate(biggerlist)
end if

firstRun=.false.
Expand Down Expand Up @@ -772,7 +772,7 @@ subroutine Run(GC, IMPORT, EXPORT, CLOCK, RC)
call global_integral(TMASS1, TRACERS, PLE1, IM,JM,LM, NQ)
endif

! Conserve Specific Mass of Constituents Keeping Mixing_Ratio Constant WRT_Dry_Air
! Conserve Specific Mass of Constituents Keeping Mixing_Ratio Constant WRT_Dry_Air
! --------------------------------------------------------------------------------
if (rpt_mass) then
do N=1,NQ
Expand Down Expand Up @@ -878,7 +878,7 @@ end subroutine Run
subroutine Finalize(GC, IMPORT, EXPORT, CLOCK, RC)
!
! !INPUT/OUTPUT PARAMETERS:
type(ESMF_GridComp), intent(inout) :: GC ! Gridded component
type(ESMF_GridComp), intent(inout) :: GC ! Gridded component
type(ESMF_State), intent(inout) :: IMPORT ! Import state
type(ESMF_State), intent(inout) :: EXPORT ! Export state
type(ESMF_Clock), intent(inout) :: CLOCK ! The clock
Expand Down
62 changes: 19 additions & 43 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,37 +111,27 @@ if (BUILD_GEOS_GTFV3_INTERFACE)
SRCS ${srcs}
SUBCOMPONENTS fvdycore
DEPENDENCIES ${dependencies}
DEPENDENCIES FMS::fms
DEPENDENCIES geos_gtfv3_interface_py) # Make the main library depend on the Python library
else ()
esma_add_library (${this}
SRCS ${srcs}
SUBCOMPONENTS fvdycore
DEPENDENCIES ${dependencies})
DEPENDENCIES ${dependencies}
DEPENDENCIES FMS::fms)
endif ()

if (FV_PRECISION STREQUAL R4)
target_link_libraries (${this} PUBLIC FMS::fms_r4)
target_compile_definitions (${this} PRIVATE SINGLE_FV OVERLOAD_R4)
elseif (FV_PRECISION STREQUAL R4R8) # FV is R4 but FMS is R8
# fvdycore needs r4 .mod interfaces
get_target_property(inc_r4 FMS::fms_r4 INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(${this} PRIVATE $<BUILD_INTERFACE:${inc_r4}>)

# But fvdycore should not *compile* with fms_r8 includes
target_link_libraries(${this} PUBLIC $<LINK_ONLY:FMS::fms_r8>)

target_compile_definitions (${this} PRIVATE SINGLE_FV OVERLOAD_R4)

# This tells CMake that we need these targets built before we can build
add_dependencies(${this} FMS::fms_r4 FMS::fms_r8)
elseif (FV_PRECISION STREQUAL R8)
target_link_libraries (${this} PUBLIC FMS::fms_r8)
if (FV_PRECISION STREQUAL R8)
string(REPLACE " " ";" tmp ${FREAL8})
foreach(flag ${tmp})
target_compile_options (${this} PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:${flag}>)
endforeach()
endif ()

if (FV_PRECISION MATCHES R4)
target_compile_definitions (${this} PRIVATE -DSINGLE_FV -DOVERLOAD_R4)
endif ()

message(STATUS "Building FV as ${FV_PRECISION}")

#set (CMAKE_Fortran_FLAGS_RELEASE "${GEOS_Fortran_FLAGS_VECT}")
Expand Down Expand Up @@ -193,31 +183,17 @@ ecbuild_add_executable (
SOURCES interp_restarts_bin.F90
LIBS ${this} OpenMP::OpenMP_Fortran)

# If we are doing R4R8 we also need add_dependencies for both fms_r4 and fms_r8
# for all our executables that link to ${this} because of the way we set up the
# main library above.
if (FV_PRECISION STREQUAL R4R8)
foreach(executable
StandAlone_FV3_Dycore.x
rs_scale.x
StandAlone_AdvCore.x
StandAlone_DynAdvCore.x
c2c.x
interp_restarts.x
interp_restarts_bin.x)

# fvdycore needs r4 .mod interfaces
get_target_property(inc_r4 FMS::fms_r4 INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(${executable} PRIVATE $<BUILD_INTERFACE:${inc_r4}>)

# But fvdycore should not *compile* with FMS::fms_r8 includes
target_link_libraries(${executable} $<LINK_ONLY:FMS::fms_r8>)

# This tells CMake that we need these targets built before we can build
add_dependencies(${executable} FMS::fms_r4 FMS::fms_r8)
endforeach()
endif ()

# Note this macro requires ESMA_cmake v4.19.0 or later
include(check_fms1_io_support)
check_fms1_io_support(FMS1_IO_SUPPORTED)
if(FMS1_IO_SUPPORTED)
message(STATUS "Using deprecated FMS1 I/O for ${this}")
target_compile_definitions (${this} PRIVATE FMS1_IO)
target_compile_definitions (interp_restarts.x PRIVATE FMS1_IO)
target_compile_definitions (interp_restarts_bin.x PRIVATE FMS1_IO)
else()
message(STATUS "Using FMS2 I/O for ${this}")
endif()

if (BUILD_GEOS_GTFV3_INTERFACE)
ecbuild_add_executable (
Expand Down
Loading