Skip to content
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MPAS-v8.4.2-1.18
MPAS-v8.4.2-1.19
====

The Model for Prediction Across Scales (MPAS) is a collaborative project for
Expand Down
460 changes: 354 additions & 106 deletions src/core_atmosphere/Registry.xml

Large diffs are not rendered by default.

31 changes: 21 additions & 10 deletions src/core_atmosphere/dynamics/mpas_atm_time_integration.F
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ subroutine mpas_atm_dynamics_init(domain)

type (domain_type), intent(inout) :: domain

#ifdef MPAS_CAM_DYCORE
#if defined(MPAS_CAM_DYCORE) || defined(MPAS_UFS_DYCORE)
! Used in allocating scratch fields for physics tendencies
type (mpas_pool_type), pointer :: tend_physics
type (field2DReal), pointer :: tend_ru_physicsField, tend_rtheta_physicsField, tend_rho_physicsField
Expand Down Expand Up @@ -307,7 +307,7 @@ subroutine mpas_atm_dynamics_init(domain)
real (kind=RKIND), dimension(:,:), pointer :: deformation_coef_s
#endif

#ifdef MPAS_CAM_DYCORE
#if defined(MPAS_CAM_DYCORE) || defined(MPAS_UFS_DYCORE)
nullify(tend_physics)
call mpas_pool_get_subpool(domain % blocklist % structs, 'tend_physics', tend_physics)

Expand All @@ -319,6 +319,17 @@ subroutine mpas_atm_dynamics_init(domain)

call mpas_pool_get_field(tend_physics, 'tend_ru_physics', tend_ru_physicsField)
call mpas_allocate_scratch_field(tend_ru_physicsField)
#ifdef MPAS_UFS_DYCORE
!
! Under UFS these fields persist for the whole run: the UFS coupling layer
! (atmos_coupling.F90::ufs_physics_to_mpas) overwrites tend_ru_physics and
! tend_rtheta_physics before every dynamics step, while tend_rho_physics are not
! (yet) used and must stay zero.
!
tend_rtheta_physicsField % array(:,:) = 0.0_RKIND
tend_rho_physicsField % array(:,:) = 0.0_RKIND
tend_ru_physicsField % array(:,:) = 0.0_RKIND
#endif
Comment thread
clark-evans marked this conversation as resolved.
Resolved
#endif

#ifdef MPAS_OPENACC
Expand Down Expand Up @@ -1493,7 +1504,7 @@ subroutine mpas_atm_dynamics_finalize(domain)

type (domain_type), intent(inout) :: domain

#ifdef MPAS_CAM_DYCORE
#if defined(MPAS_CAM_DYCORE) || defined(MPAS_UFS_DYCORE)
! Used in allocating scratch fields for physics tendencies
type (mpas_pool_type), pointer :: tend_physics
type (field2DReal), pointer :: tend_ru_physicsField, tend_rtheta_physicsField, tend_rho_physicsField
Expand Down Expand Up @@ -1569,7 +1580,7 @@ subroutine mpas_atm_dynamics_finalize(domain)
#endif


#ifdef MPAS_CAM_DYCORE
#if defined(MPAS_CAM_DYCORE) || defined(MPAS_UFS_DYCORE)
nullify(tend_physics)
call mpas_pool_get_subpool(domain % blocklist % structs, 'tend_physics', tend_physics)

Expand Down Expand Up @@ -1933,7 +1944,7 @@ subroutine atm_srk3(domain, dt, itimestep, exchange_halo_group)
real (kind=RKIND), dimension(:,:), pointer :: rho_pp, rtheta_pp, ru_p, rw_p, pv_edge, rho_edge
real (kind=RKIND) :: theta_local, fac_m

#ifndef MPAS_CAM_DYCORE
#if !defined(MPAS_CAM_DYCORE) && !defined(MPAS_UFS_DYCORE)
! Used in allocating scratch fields for physics tendencies
type (field2DReal), pointer :: tend_ru_physicsField, tend_rtheta_physicsField, tend_rho_physicsField
#endif
Expand Down Expand Up @@ -2031,7 +2042,7 @@ subroutine atm_srk3(domain, dt, itimestep, exchange_halo_group)
end do
!$acc end parallel

#ifndef MPAS_CAM_DYCORE
#if !defined(MPAS_CAM_DYCORE) && !defined(MPAS_UFS_DYCORE)
call mpas_pool_get_field(tend_physics, 'tend_rtheta_physics', tend_rtheta_physicsField)
call mpas_allocate_scratch_field(tend_rtheta_physicsField)

Expand Down Expand Up @@ -2169,7 +2180,7 @@ subroutine atm_srk3(domain, dt, itimestep, exchange_halo_group)
#endif

#else
#ifndef MPAS_CAM_DYCORE
#if !defined(MPAS_CAM_DYCORE) && !defined(MPAS_UFS_DYCORE)
!
! If no physics are being used, simply zero-out the physics tendency fields
!
Expand Down Expand Up @@ -2679,7 +2690,7 @@ subroutine atm_srk3(domain, dt, itimestep, exchange_halo_group)
deallocate(qtot) ! we are finished with these now

!$acc exit data delete(tend_rtheta_physics,tend_rho_physics,tend_ru_physics)
#ifndef MPAS_CAM_DYCORE
#if !defined(MPAS_CAM_DYCORE) && !defined(MPAS_UFS_DYCORE)
call mpas_deallocate_scratch_field(tend_rtheta_physicsField)
call mpas_deallocate_scratch_field(tend_rho_physicsField)
call mpas_deallocate_scratch_field(tend_ru_physicsField)
Expand Down Expand Up @@ -5056,7 +5067,7 @@ subroutine atm_advance_scalars_work(nCells, num_scalars, dt, &
do k=1,nVertLevels
do iScalar=1,num_scalars
scalar_tend_column(iScalar,k) = 0.0_RKIND
#ifndef DO_PHYSICS
#if !defined(DO_PHYSICS) && !defined(MPAS_UFS_DYCORE)
scalar_tend_save(iScalar,k,iCell) = 0.0_RKIND ! testing purposes - we have no sources or sinks
#endif
end do
Expand Down Expand Up @@ -5394,7 +5405,7 @@ subroutine atm_advance_scalars_mono_work(field_name, block, state, nCells, nEdge
do k = 1,nVertLevels
do iScalar = 1,num_scalars

#ifndef DO_PHYSICS
#if !defined(DO_PHYSICS) && !defined(MPAS_UFS_DYCORE)
scalar_tend(iScalar,k,iCell) = 0.0_RKIND ! testing purposes - we have no sources or sinks
#endif
scalars_old(iScalar,k,iCell) = scalars_old(iScalar,k,iCell)+dt*scalar_tend(iScalar,k,iCell) / rho_zz_old(k,iCell)
Expand Down
6 changes: 5 additions & 1 deletion src/external/ezxml/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@

add_library(ezxml ezxml.c)
if(MPAS_UFS_DYCORE)
add_library(ezxml ezxml_shim.c ezxml.c)
else()
add_library(ezxml ezxml.c)
endif()
add_library(${PROJECT_NAME}::external::ezxml ALIAS ezxml)
target_include_directories(ezxml PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)

Expand Down
29 changes: 29 additions & 0 deletions src/external/ezxml/ezxml_shim.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "ezxml_shim.h"

ezxml_t shim_parse_file(const char *file) {
return ezxml_parse_file(file);
}

ezxml_t shim_child(ezxml_t xml, const char *name) {
return ezxml_child(xml, name);
}

ezxml_t shim_next(ezxml_t xml) {
return xml ? xml->next : (ezxml_t)0;
}

const char *shim_name(ezxml_t xml) {
return xml ? xml->name : (const char *)0;
}

const char *shim_txt(ezxml_t xml) {
return xml ? xml->txt : "";
}
Comment thread
clark-evans marked this conversation as resolved.
Resolved

const char *shim_attr(ezxml_t xml, const char *attrname) {
return ezxml_attr(xml, attrname);
}

void shim_free(ezxml_t xml) {
ezxml_free(xml);
}
22 changes: 22 additions & 0 deletions src/external/ezxml/ezxml_shim.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef EZXML_SHIM_H
#define EZXML_SHIM_H

#include "ezxml.h"

#ifdef __cplusplus
extern "C" {
#endif

ezxml_t shim_parse_file(const char *file);
ezxml_t shim_child(ezxml_t xml, const char *name);
ezxml_t shim_next(ezxml_t xml); /* next element with the SAME tag name */
const char *shim_name(ezxml_t xml);
const char *shim_txt(ezxml_t xml);
const char *shim_attr(ezxml_t xml, const char *attrname);
void shim_free(ezxml_t xml);

#ifdef __cplusplus
}
#endif

#endif /* EZXML_SHIM_H */
Loading