Skip to content

Commit

Permalink
Merge pull request NOAA-GFDL#25 from GEOS-ESM/geos/MAPL-2.0
Browse files Browse the repository at this point in the history
Merge MAPL 2.0 code into develop
  • Loading branch information
tclune authored Feb 12, 2020
2 parents 4e7d06f + 547a4af commit 60a0728
Show file tree
Hide file tree
Showing 8 changed files with 302 additions and 307 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ endif ()

esma_add_library (${this}
SRCS ${srcs}
DEPENDENCIES MAPL_Base
DEPENDENCIES MAPL gftl-shared
INCLUDES ${extra_incs} ${INC_ESMF} ${INC_NETCDF})

if (FV_PRECISION STREQUAL R4)
Expand Down
308 changes: 125 additions & 183 deletions geos_utils/fv_regrid_c2c.F90

Large diffs are not rendered by default.

48 changes: 3 additions & 45 deletions geos_utils/fv_regridding_utils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ module fv_regridding_utils
use fv_mp_mod, only: is_master, ng
use fv_mapz_mod, only: mappm
use mpp_mod, only: mpp_error, FATAL, NOTE, mpp_broadcast,mpp_npes
!use MAPL_MOD, only: MAPL_PI_R8, MAPL_OMEGA, MAPL_GRAV, &
!MAPL_KAPPA, MAPL_RGAS, MAPL_RVAP, &
!MAPL_CP
use MAPL_MOD
use MAPL

implicit none

Expand All @@ -20,7 +17,6 @@ module fv_regridding_utils
public remap_scalar
public fv_rst
public copy_fv_rst
public simple_cs_grid_creator

real(FVPRC), parameter :: PI = MAPL_PI_R8
real(FVPRC), parameter :: OMEGA = MAPL_OMEGA
Expand All @@ -34,8 +30,8 @@ module fv_regridding_utils
type fv_var
character(len=128) :: name
integer :: nlev
real(REAL8), pointer :: ptr2d(:,:) => null()
real(REAL8), pointer :: ptr3d(:,:,:) => null()
real(FVPRC), pointer :: ptr2d(:,:) => null()
real(FVPRC), pointer :: ptr3d(:,:,:) => null()
end type fv_var

type fv_rst
Expand Down Expand Up @@ -254,43 +250,5 @@ subroutine remap_edge(q1,q2,is,ie,km,kn,ak,bk)

end subroutine remap_edge

function simple_cs_grid_creator(IM_World,JM_World,NX,NY,rc) result(esmfgrid)

integer, intent(IN) :: IM_WORLD, JM_WORLD
integer, intent(IN) :: NX, NY
integer, optional, intent(OUT) :: rc
type (ESMF_Grid) :: esmfgrid

integer, allocatable :: IMS(:), JMS(:)
integer :: n
integer :: STATUS
character(len=ESMF_MAXSTR), parameter :: Iam="simple_cs_grid_creator"

allocate( IMS(0:NX-1) )
allocate( JMS(0:NY-1) )

call MAPL_DecomposeDim ( IM_WORLD , IMS , NX , symmetric=.true. )
call MAPL_DecomposeDim ( JM_WORLD/6, JMS(0:NY/6 -1) , NY/6, symmetric=.true. )
do n=2,6
JMS((n-1)*NY/6 : n*NY/6 -1) = JMS(0:NY/6 -1)
enddo

esmfgrid = ESMF_GridCreate( &
name="dummy", &
countsPerDEDim1=IMS, &
countsPerDEDim2=JMS, &
indexFlag = ESMF_INDEX_USER, &
gridMemLBound = (/1,1/), &
gridEdgeLWidth = (/0,0/), &
gridEdgeUWidth = (/0,0/), &
coordDep1 = (/1,2/), &
coordDep2 = (/1,2/), &
rc=status)
VERIFY_(STATUS)

RETURN_(ESMF_SUCCESS)

end function simple_cs_grid_creator

end module fv_regridding_utils

5 changes: 2 additions & 3 deletions geos_utils/rs_scaleMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
module rs_scaleMod

use fv_arrays_mod
use MAPL_ConstantsMod, only: MAPL_PSDRY
use MAPL_Mod
use MAPL
use gFTL_StringIntegerMap
use ESMF
use pFIO_StringIntegerMapMod
use, intrinsic :: iso_fortran_env, only: REAL64, REAL32
! bma added
implicit none
Expand Down
2 changes: 1 addition & 1 deletion model/mapz-driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ endif ()
ecbuild_add_executable(
TARGET mapz-driver
SOURCES ${srcs}
LIBS ${FMS} ${MAPL_BASE})
LIBS ${FMS} MAPL)
target_compile_definitions(mapz-driver PRIVATE MAPL_MODE SPMD TIMING)
target_compile_options(mapz-driver PRIVATE ${TRACEBACK})
set_target_properties(${this} PROPERTIES Fortran_MODULE_DIRECTORY ${esma_include}/${this})
Loading

0 comments on commit 60a0728

Please sign in to comment.