@@ -43,8 +43,9 @@ module FVdycoreCubed_GridComp
4343 use mapl3g_generic, only: MAPL_GridCompSetEntryPoint, MAPL_GridCompGetInternalState
4444 use mapl3g_generic, only: MAPL_GridCompAddSpec, MAPL_STATEITEM_FIELDBUNDLE
4545 use mapl3g_generic, only: MAPL_UserCompSetInternalState, MAPL_UserCompGetInternalState
46+ ! use mapl3g_generic, only: MAPL_GridCompTimerStart, MAPL_GridCompTimerStop
4647 use mapl3g_VerticalStaggerLoc, only: VERTICAL_STAGGER_NONE, VERTICAL_STAGGER_CENTER, VERTICAL_STAGGER_EDGE
47- use mapl3g_Geom_API, only: MAPL_GridGet
48+ use mapl3g_Geom_API, only: MAPL_GridGetCoordinates
4849 use mapl3g_State_API, only: MAPL_StateGetPointer
4950 use mapl3g_Field_API, only: MAPL_FieldCreate
5051 use mapl3g_FieldBundle_API, only: MAPL_FieldBundleAdd
@@ -389,21 +390,6 @@ Subroutine SetServices(gc, rc)
389390 ! 6 ints: YYYY MM DD H M S
390391 ! 5 ints: I,J,K, KS (num true pressure levels), NQ (num tracers) headers
391392
392- ! ! Set the Profiling timers
393- ! call MAPL_TimerAdd(gc, name="INITIALIZE", _RC)
394- ! call MAPL_TimerAdd(gc, name="RUN", _RC)
395- ! call MAPL_TimerAdd(gc, name="RUN2", _RC)
396- ! call MAPL_TimerAdd(gc, name="-DYN_INIT", _RC)
397- ! call MAPL_TimerAdd(gc, name="--FMS_INIT", _RC)
398- ! call MAPL_TimerAdd(gc, name="--FV_INIT", _RC)
399- ! call MAPL_TimerAdd(gc, name="-DYN_ANA", _RC)
400- ! call MAPL_TimerAdd(gc, name="-DYN_PROLOGUE", _RC)
401- ! call MAPL_TimerAdd(gc, name="-DYN_CORE", _RC)
402- ! call MAPL_TimerAdd(gc, name="-DYN_EPILOGUE", _RC)
403- ! call MAPL_TimerAdd(gc, name="--FV_DYNAMICS", _RC)
404- ! call MAPL_TimerAdd(gc, name="--MASS_FIX", _RC)
405- ! call MAPL_TimerAdd(gc, name="FINALIZE", _RC)
406-
407393 ! Register services for this component
408394 call MAPL_GridCompSetEntryPoint(gc, ESMF_Method_Initialize, Initialize, _RC)
409395 call MAPL_GridCompSetEntryPoint(gc, ESMF_Method_Run, Run, phase_name= " Run" , _RC)
@@ -472,12 +458,10 @@ subroutine Initialize(gc, import, export, clock, rc)
472458 integer :: ifirst, ilast, jfirst, jlast, km
473459 integer :: i, numTracers, status
474460
475- ! ! Start the timers
476- ! call MAPL_TimerOn(MAPL, "TOTAL")
477- ! call MAPL_TimerOn(MAPL, "INITIALIZE")
478-
479461 ! Setup FMS/FV3
462+ ! call MAPL_GridCompTimerStart(gc, "DynSetup", _RC)
480463 call DynSetup(gc, _RC)
464+ ! call MAPL_GridCompTimerStop(gc, "DynSetup", _RC)
481465
482466 ! Get the private state
483467 _GET_NAMED_PRIVATE_STATE(gc, DynState, PRIVATE_STATE, self)
@@ -493,9 +477,9 @@ subroutine Initialize(gc, import, export, clock, rc)
493477 ! Set Private Internal State from Restart File
494478 call MAPL_GridCompGetInternalState(gc, internal, _RC)
495479
496- ! call MAPL_TimerOn(MAPL , "-DYN_INIT" )
480+ ! call MAPL_GridCompTimerStart(gc , "DynInit", _RC )
497481 call DynInit(self, clock, import, gc, _RC)
498- ! call MAPL_TimerOff(MAPL , "-DYN_INIT" )
482+ ! call MAPL_GridCompTimerStop(gc , "DynInit", _RC )
499483
500484 ! Create PLE and PREF EXPORT Coupling (Needs to be done only once per run)
501485 call MAPL_StateGetPointer(internal, ak, " AK" , _RC)
@@ -593,9 +577,6 @@ subroutine Initialize(gc, import, export, clock, rc)
593577
594578 ! ========End intermittent replay========================
595579
596- ! call MAPL_TimerOff(MAPL,"INITIALIZE")
597- ! call MAPL_TimerOff(MAPL,"TOTAL")
598-
599580 _RETURN(_SUCCESS)
600581 end subroutine Initialize
601582
@@ -784,7 +765,7 @@ subroutine Run(gc, import, export, clock, rc)
784765 character (len= :), allocatable :: uname, vname, tname, qname, psname, dpname, o3name, rgrid, tvar
785766
786767 ! type(MAPL_SunOrbit) :: ORBIT
787- real (r4 ), pointer :: lats(:,:), lons(:,:)
768+ real (r4 ), allocatable :: lats(:,:), lons(:,:)
788769 real (r4 ), allocatable :: ZTH(:,:), SLR(:,:)
789770
790771 real :: rc_blend_p_above, rc_blend_p_below, sclinc
@@ -814,10 +795,7 @@ subroutine Run(gc, import, export, clock, rc)
814795 call MAPL_GridCompGet(gc, grid= esmfgrid, hconfig= hconfig, logger= logger, _RC)
815796 call ESMF_GridValidate(esmfgrid, _RC)
816797
817- ! call MAPL_TimerOn(MAPL, "TOTAL")
818- ! call MAPL_TimerOn(MAPL, "RUN")
819-
820- call MAPL_GridGet(esmfgrid, longitudes= lons, latitudes= lats, _RC)
798+ call MAPL_GridGetCoordinates(esmfgrid, longitudes= lons, latitudes= lats, _RC)
821799 call MAPL_StateGetPointer(export, temp2d, " LONS" , _RC)
822800 if ( associated (temp2D) ) temp2d = lons
823801 call MAPL_StateGetPointer(export, temp2d, " LATS" , _RC)
@@ -2785,9 +2763,6 @@ subroutine Run(gc, import, export, clock, rc)
27852763
27862764 call freeTracers(self)
27872765
2788- ! call MAPL_TimerOff(MAPL, "RUN")
2789- ! call MAPL_TimerOff(MAPL, "TOTAL")
2790-
27912766 ! if (ADIABATIC) then
27922767 ! ! Fill Exports
27932768 ! call RunAddIncs(gc, import, export, clock, rc)
@@ -3724,10 +3699,6 @@ subroutine RunAddIncs(gc, import, export, clock, rc)
37243699 class(logger_t), pointer :: logger
37253700
37263701 call MAPL_GridCompGet(gc, grid= esmfgrid, logger= logger, _RC)
3727- call logger% info(" RunAddIncs:: starting..." )
3728-
3729- ! call MAPL_TimerOn(GENSTATE,"TOTAL")
3730- ! call MAPL_TimerOn(GENSTATE,"RUN2")
37313702
37323703 ! Retrieve the pointer to the internal state
37333704 _GET_NAMED_PRIVATE_STATE(gc, DynState, PRIVATE_STATE, self)
@@ -4276,10 +4247,6 @@ subroutine RunAddIncs(gc, import, export, clock, rc)
42764247
42774248 end if ! .not. SW_DYNAMICS
42784249
4279- ! call MAPL_TimerOff(GENSTATE,"RUN2")
4280- ! call MAPL_TimerOff(GENSTATE,"TOTAL")
4281-
4282- call logger% info(" RunAddIncs:: ...complete" )
42834250 _RETURN(_SUCCESS)
42844251 end subroutine RunAddIncs
42854252
@@ -4310,7 +4277,7 @@ subroutine ADD_INCS(esmfgrid, self, import, DT, is_weighted, rc)
43104277 integer :: isd, ied, jsd, jed
43114278 real (r4 ), allocatable :: fvQOLD(:,:,:), QTEND(:,:,:)
43124279 real (r4 ), pointer :: tend(:,:,:)
4313- real (r4 ), pointer , dimension (:,:) :: lons, lats
4280+ real (r4 ), allocatable , dimension (:,:) :: lons, lats
43144281 real (r8 ), allocatable :: DPNEW(:,:,:), DPOLD(:,:,:)
43154282 real (r8 ), allocatable :: tend_ua(:,:,:), tend_va(:,:,:)
43164283 real (r8 ), allocatable :: tend_un(:,:,:), tend_vn(:,:,:)
@@ -4341,7 +4308,7 @@ subroutine ADD_INCS(esmfgrid, self, import, DT, is_weighted, rc)
43414308
43424309 ! call MAPL_Get( MAPL, LONS=LONS, LATS=LATS, RC=STATUS )
43434310 ! VERIFY_(STATUS)
4344- call MAPL_GridGet (esmfgrid, latitudes= lats, longitudes= lons, _RC)
4311+ call MAPL_GridGetCoordinates (esmfgrid, latitudes= lats, longitudes= lons, _RC)
43454312
43464313 ! **********************************************************************
43474314 ! **** Use QV from FV3 init when coldstarting idealized cases ****
@@ -4788,21 +4755,11 @@ subroutine Finalize(gc, import, export, clock, rc)
47884755 integer :: status
47894756 class(logger_t), pointer :: logger
47904757
4791- call MAPL_GridCompGet(gc, logger= logger, _RC)
4792- call logger% info(" Finalize:: starting..." )
4793-
4794- ! call MAPL_TimerOn(MAPL,"TOTAL")
4795- ! call MAPL_TimerOn(MAPL,"FINALIZE")
4796-
47974758 ! Retrieve the pointer to the state
47984759 _GET_NAMED_PRIVATE_STATE(gc, DynState, PRIVATE_STATE, self)
47994760
48004761 call DynFinalize(self)
48014762
4802- ! call MAPL_TimerOff(MAPL,"FINALIZE")
4803- ! call MAPL_TimerOff(MAPL,"TOTAL")
4804-
4805- call logger% info(" Finalize:: ...complete" )
48064763 _RETURN(_SUCCESS)
48074764 end subroutine FINALIZE
48084765
@@ -4959,7 +4916,7 @@ subroutine Coldstart(gc, import, export, clock, rc)
49594916 real (REAL8), pointer :: PE1(:,:,:), PKZ(:,:,:)
49604917 real (REAL8), allocatable :: PE(:,:,:)
49614918 real (REAL4), pointer :: phis(:,:)
4962- real (REAL4), pointer :: lons(:,:), lats(:,:)
4919+ real (REAL4), allocatable :: lons(:,:), lats(:,:)
49634920
49644921 integer :: i, j, k, n, L
49654922 integer :: is, ie, js, je, ks, ke, im, jm, km, ls
@@ -5004,7 +4961,7 @@ subroutine Coldstart(gc, import, export, clock, rc)
50044961 call MAPL_GridCompGetInternalState(gc, internal, _RC)
50054962
50064963 call MAPL_GridCompGet(gc, grid= esmfgrid, _RC)
5007- call MAPL_GridGet (esmfgrid, latitudes= lats, longitudes= lons, _RC)
4964+ call MAPL_GridGetCoordinates (esmfgrid, latitudes= lats, longitudes= lons, _RC)
50084965 if (FV_Atm(1 )% flagstruct% grid_type == 4 ) then
50094966 ! Doubly-Period setup based on first LAT/LON coordinate
50104967 lons(:,:) = 0.0
0 commit comments