@@ -14615,10 +14615,11 @@ end function ESMF_GridCreateShapeTileArb
14615
14615
! !INTERFACE:
14616
14616
! Private name; call using ESMF_GridCreateCubedSphere()
14617
14617
function ESMF_GridCreateCubedSphereReg(tileSize,keywordEnforcer, &
14618
- regDecompPTile, decompflagPTile, &
14619
- coordSys, coordTypeKind, &
14620
- deLabelList, staggerLocList, &
14621
- delayout, indexflag, name, transformArgs, rc)
14618
+ regDecompPTile, decompflagPTile, &
14619
+ coordSys, coordTypeKind, &
14620
+ deLabelList, staggerLocList, &
14621
+ delayout, indexflag, name, transformArgs, coordCalcFlag, &
14622
+ rc)
14622
14623
!
14623
14624
! !RETURN VALUE:
14624
14625
type(ESMF_Grid) :: ESMF_GridCreateCubedSphereReg
@@ -14636,6 +14637,7 @@ function ESMF_GridCreateCubedSphereReg(tileSize,keywordEnforcer, &
14636
14637
type(ESMF_Index_Flag), intent(in), optional :: indexflag
14637
14638
character(len=*), intent(in), optional :: name
14638
14639
type(ESMF_CubedSphereTransform_Args), intent(in), optional :: transformArgs
14640
+ type(ESMF_CubedSphereCalc_Flag),intent(in), optional :: coordCalcFlag
14639
14641
integer, intent(out), optional :: rc
14640
14642
14641
14643
!
@@ -14693,14 +14695,19 @@ function ESMF_GridCreateCubedSphereReg(tileSize,keywordEnforcer, &
14693
14695
! {\tt regDecompPTile} will be constructed accordingly.
14694
14696
! \item[{[indexflag]}]
14695
14697
! Indicates the indexing scheme to be used in the new Grid. Please see
14696
- ! Section ~\ref{const:indexflag} for the list of options. If not present,
14698
+ ! section ~\ref{const:indexflag} for the list of options. If not present,
14697
14699
! defaults to ESMF\_INDEX\_DELOCAL.
14698
14700
! \item[{[name]}]
14699
14701
! {\tt ESMF\_Grid} name.
14700
14702
! \item[{[transformArgs]}]
14701
14703
! A data type containing the stretch factor, target longitude, and target latitude
14702
- ! to perform a Schmidt transformation on the Cubed-Sphere grid. See section
14704
+ ! to perform a Schmidt transformation on the Cubed-Sphere grid.
14703
14705
! \ref{sec:usage:cubedspherewttransform} for details.
14706
+ ! \item[{[coordCalcFlag]}]
14707
+ ! A flag which controls the method used to calculate the cubed sphere coordinates.
14708
+ ! Please see section~\ref{const:cubedspherecalcflag} for a list of options. If not set,
14709
+ ! defaults to {\tt ESMF\_CUBEDSPHERECALC\_1TILE} which was the original method used
14710
+ ! to calculate coordinates.
14704
14711
! \item[{[rc]}]
14705
14712
! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
14706
14713
! \end{description}
@@ -14734,10 +14741,13 @@ function ESMF_GridCreateCubedSphereReg(tileSize,keywordEnforcer, &
14734
14741
type(ESMF_Index_Flag) :: localIndexFlag
14735
14742
type(ESMF_CoordSys_Flag) :: coordSysLocal
14736
14743
type(ESMF_TypeKind_Flag) :: coordTypeKindLocal
14744
+ type(ESMF_CubedSphereCalc_Flag) :: coordCalcFlagLocal
14737
14745
integer :: s
14738
14746
logical :: docenter, docorner
14747
+ logical :: local_algorithm
14739
14748
!real(ESMF_KIND_R8) :: starttime, endtime
14740
14749
14750
+
14741
14751
if (present(rc)) rc=ESMF_SUCCESS
14742
14752
!------------------------------------------------------------------------
14743
14753
! get global vm information
@@ -14819,7 +14829,11 @@ function ESMF_GridCreateCubedSphereReg(tileSize,keywordEnforcer, &
14819
14829
else
14820
14830
coordTypeKindLocal=ESMF_TYPEKIND_R8
14821
14831
endif
14822
-
14832
+
14833
+ ! Set default coord. calc. flag
14834
+ coordCalcFlagLocal=ESMF_CUBEDSPHERECALC_1TILE
14835
+ if (present(coordCalcFlag)) coordCalcFlagLocal= coordCalcFlag
14836
+
14823
14837
! set defaults
14824
14838
docenter = .false.
14825
14839
docorner = .false.
@@ -14977,22 +14991,26 @@ function ESMF_GridCreateCubedSphereReg(tileSize,keywordEnforcer, &
14977
14991
endif
14978
14992
endif
14979
14993
!call ESMF_VMWtime(starttime, rc=localrc)
14980
- ! Generate glocal edge coordinates and local center coordinates
14981
14994
14995
+ ! Set coordinate calc method balop's[ed on flag (by setting local_algorithm switch)
14996
+ local_algorithm=.false.
14997
+ if (coordCalcFlagLocal == ESMF_CUBEDSPHERECALC_LOCAL) local_algorithm=.true.
14998
+
14999
+ ! Generate glocal edge coordinates and local center coordinates
14982
15000
if (docenter .and. docorner) then
14983
15001
call ESMF_UtilCreateCSCoordsPar(tileSize, lonEdge=lonCornerPtrR8, &
14984
15002
latEdge=latCornerPtrR8, start=start, count=count, &
14985
15003
tile=tile, lonCenter=lonPtrR8, latCenter=latPtrR8, &
14986
- schmidtTransform=transformArgs)
15004
+ schmidtTransform=transformArgs, local_algorithm=local_algorithm )
14987
15005
elseif (docorner) then
14988
15006
call ESMF_UtilCreateCSCoordsPar(tileSize, lonEdge=lonCornerPtrR8, &
14989
15007
latEdge=latCornerPtrR8, start=start, count=count, tile=tile, &
14990
- schmidtTransform=transformArgs)
15008
+ schmidtTransform=transformArgs, local_algorithm=local_algorithm )
14991
15009
else
14992
15010
call ESMF_UtilCreateCSCoordsPar(tileSize, &
14993
15011
start=start, count=count, &
14994
15012
tile=tile, lonCenter=lonPtrR8, latCenter=latPtrR8, &
14995
- schmidtTransform=transformArgs)
15013
+ schmidtTransform=transformArgs, local_algorithm=local_algorithm )
14996
15014
endif
14997
15015
14998
15016
!call ESMF_VMWtime(endtime, rc=localrc)
@@ -15084,12 +15102,13 @@ end function ESMF_GridCreateCubedSphereReg
15084
15102
15085
15103
! !INTERFACE:
15086
15104
! Private name; call using ESMF_GridCreateCubedSphere()
15087
- function ESMF_GridCreateCubedSphereIReg(tileSize, &
15088
- countsPerDEDim1PTile, countsPerDEDim2PTile, &
15089
- keywordEnforcer, &
15090
- coordSys, coordTypeKind, &
15091
- deLabelList, staggerLocList, &
15092
- delayout, indexflag, name, transformArgs, rc)
15105
+ function ESMF_GridCreateCubedSphereIReg(tileSize, &
15106
+ countsPerDEDim1PTile, countsPerDEDim2PTile, &
15107
+ keywordEnforcer, &
15108
+ coordSys, coordTypeKind, &
15109
+ deLabelList, staggerLocList, &
15110
+ delayout, indexflag, name, transformArgs, coordCalcFlag, &
15111
+ rc)
15093
15112
!
15094
15113
! !RETURN VALUE:
15095
15114
type(ESMF_Grid) :: ESMF_GridCreateCubedSphereIReg
@@ -15107,6 +15126,7 @@ function ESMF_GridCreateCubedSphereIReg(tileSize, &
15107
15126
type(ESMF_Index_Flag), intent(in), optional :: indexflag
15108
15127
character(len=*), intent(in), optional :: name
15109
15128
type(ESMF_CubedSphereTransform_Args), intent(in), optional :: transformArgs
15129
+ type(ESMF_CubedSphereCalc_Flag),intent(in), optional :: coordCalcFlag
15110
15130
integer, intent(out), optional :: rc
15111
15131
15112
15132
!
@@ -15160,6 +15180,11 @@ function ESMF_GridCreateCubedSphereIReg(tileSize, &
15160
15180
! A data type containing the stretch factor, target longitude, and target latitude
15161
15181
! to perform a Schmidt transformation on the Cubed-Sphere grid. See section
15162
15182
! \ref{sec:usage:cubedspherewttransform} for details.
15183
+ ! \item[{[coordCalcFlag]}]
15184
+ ! A flag which controls the method used to calculate the cubed sphere coordinates.
15185
+ ! Please see section~\ref{const:cubedspherecalcflag} for a list of options. If not set,
15186
+ ! defaults to {\tt ESMF\_CUBEDSPHERECALC\_1TILE} which was the original method used
15187
+ ! to calculate coordinates.
15163
15188
! \item[{[rc]}]
15164
15189
! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
15165
15190
! \end{description}
@@ -15189,13 +15214,15 @@ function ESMF_GridCreateCubedSphereIReg(tileSize, &
15189
15214
type(ESMF_Index_Flag) :: localIndexFlag
15190
15215
type(ESMF_CoordSys_Flag) :: coordSysLocal
15191
15216
type(ESMF_TypeKind_Flag) :: coordTypeKindLocal
15217
+ type(ESMF_CubedSphereCalc_Flag) :: coordCalcFlagLocal
15192
15218
integer :: s
15193
15219
logical :: docenter, docorner
15194
15220
integer, pointer :: deBlockList(:,:,:), deToTileMap(:)
15195
15221
integer, pointer :: DeDim1(:), DeDim2(:), demap(:)
15196
15222
integer :: k,t, minIndx, minIndy
15197
15223
integer :: myde, startde, endde
15198
15224
integer :: tiles, totalelmt
15225
+ logical :: local_algorithm
15199
15226
!real(ESMF_KIND_R8) :: starttime, endtime
15200
15227
15201
15228
if (present(rc)) rc=ESMF_SUCCESS
@@ -15320,6 +15347,11 @@ function ESMF_GridCreateCubedSphereIReg(tileSize, &
15320
15347
coordTypeKindLocal=ESMF_TYPEKIND_R8
15321
15348
endif
15322
15349
15350
+ ! Set default coord. calc. flag
15351
+ coordCalcFlagLocal=ESMF_CUBEDSPHERECALC_1TILE
15352
+ if (present(coordCalcFlag)) coordCalcFlagLocal= coordCalcFlag
15353
+
15354
+
15323
15355
! set defaults
15324
15356
docenter = .false.
15325
15357
docorner = .false.
@@ -15458,22 +15490,26 @@ function ESMF_GridCreateCubedSphereIReg(tileSize, &
15458
15490
endif
15459
15491
endif
15460
15492
!call ESMF_VMWtime(starttime, rc=localrc)
15461
- ! Generate glocal edge coordinates and local center coordinates
15462
15493
15494
+ ! Set coordinate calc method balop's[ed on flag (by setting local_algorithm switch)
15495
+ local_algorithm=.false.
15496
+ if (coordCalcFlagLocal == ESMF_CUBEDSPHERECALC_LOCAL) local_algorithm=.true.
15497
+
15498
+ ! Generate glocal edge coordinates and local center coordinates
15463
15499
if (docenter .and. docorner) then
15464
15500
call ESMF_UtilCreateCSCoordsPar(tileSize, lonEdge=lonCornerPtrR8, &
15465
15501
latEdge=latCornerPtrR8, start=start, count=count, &
15466
15502
tile=tile, lonCenter=lonPtrR8, latCenter=latPtrR8, &
15467
- schmidtTransform=transformArgs)
15503
+ schmidtTransform=transformArgs, local_algorithm=local_algorithm )
15468
15504
elseif (docorner) then
15469
15505
call ESMF_UtilCreateCSCoordsPar(tileSize, lonEdge=lonCornerPtrR8, &
15470
15506
latEdge=latCornerPtrR8, start=start, count=count, tile=tile, &
15471
- schmidtTransform=transformArgs)
15507
+ schmidtTransform=transformArgs, local_algorithm=local_algorithm )
15472
15508
else
15473
15509
call ESMF_UtilCreateCSCoordsPar(tileSize, &
15474
15510
start=start, count=count, &
15475
15511
tile=tile, lonCenter=lonPtrR8, latCenter=latPtrR8, &
15476
- schmidtTransform=transformArgs)
15512
+ schmidtTransform=transformArgs, local_algorithm=local_algorithm )
15477
15513
endif
15478
15514
15479
15515
!call ESMF_VMWtime(endtime, rc=localrc)
0 commit comments