Skip to content

Commit 4fc6d1e

Browse files
Remove nems grid comp (#104)
* Remove NEMS Grid Component * Remove export/import states from the main program. * Code style changes
1 parent b9d03a6 commit 4fc6d1e

6 files changed

+109
-845
lines changed

src/ESMFConvenienceMacros.h

-7
This file was deleted.

src/MAIN_NEMS.F90

+82-200
Large diffs are not rendered by default.

src/module_EARTH_GRID_COMP.F90

+23-33
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#include "ESMFConvenienceMacros.h"
2-
31
!-----------------------------------------------------------------------
42
!
53
MODULE module_EARTH_GRID_COMP
@@ -22,11 +20,7 @@ MODULE module_EARTH_GRID_COMP
2220
!
2321
! Main program
2422
! |
25-
! |
26-
! NEMS component
27-
! | |________________________.
28-
! | |
29-
! EARTH component Ensemble Coupler component
23+
! EARTH component
3024
! /|\
3125
! / | \
3226
! ATM/OCN/ICE/WAV/LND/IPM/HYD .. components
@@ -35,11 +29,11 @@ MODULE module_EARTH_GRID_COMP
3529
! | |
3630
! | (MOM6, HYCOM, etc.)
3731
! |
38-
! CORE component (FV3, etc.)
32+
! (FV3, etc.)
3933
!
4034
!-----------------------------------------------------------------------
4135
!
42-
USE ESMF
36+
use ESMF
4337

4438
use NUOPC
4539
use NUOPC_Driver, &
@@ -92,24 +86,21 @@ MODULE module_EARTH_GRID_COMP
9286
#ifdef FRONT_CMEPS
9387
use MED, only: MED_SS => SetServices
9488
#endif
95-
96-
USE module_NEMS_UTILS,ONLY: MESSAGE_CHECK
9789
!
9890
!-----------------------------------------------------------------------
9991
!
100-
IMPLICIT NONE
92+
implicit none
10193
!
10294
!-----------------------------------------------------------------------
10395
!
104-
PRIVATE
96+
private
10597
!
106-
PUBLIC :: EARTH_REGISTER
107-
PUBLIC :: VERBOSE_DIAGNOSTICS
98+
public :: earth_register
99+
public :: verbose_diagnostics
108100
!
109101
!-----------------------------------------------------------------------
110102
!
111-
112-
LOGICAL, PRIVATE :: flag_verbose_diagnostics = .false.
103+
logical, private :: flag_verbose_diagnostics = .false.
113104
logical, private :: printattr = .false.
114105

115106
character(len=*),parameter :: u_FILE_u = &
@@ -145,73 +136,72 @@ end function ChkErr
145136
!#######################################################################
146137
!-----------------------------------------------------------------------
147138
!
148-
SUBROUTINE EARTH_REGISTER(EARTH_GRID_COMP,RC_REG)
139+
SUBROUTINE EARTH_REGISTER(EARTH_GRID_COMP,RC)
149140
!
150141
!-----------------------------------------------------------------------
151142
!
152143
!------------------------
153144
!*** Argument Variables
154145
!------------------------
155146
!
156-
TYPE(ESMF_GridComp) :: EARTH_GRID_COMP !<-- The EARTH component
147+
type(ESMF_GridComp) :: EARTH_GRID_COMP !<-- The EARTH component
157148
!
158-
INTEGER,INTENT(OUT) :: RC_REG !<-- Error return code
149+
integer,intent(out) :: rc !<-- Error return code
159150
!
160151
!---------------------
161152
!*** Local Variables
162153
!---------------------
163154
!
164-
INTEGER :: RC
165155
type(ESMF_Config) :: config
166156
!
167157
!-----------------------------------------------------------------------
168158
!***********************************************************************
169159
!-----------------------------------------------------------------------
170160
!
171-
RC_REG = ESMF_SUCCESS
161+
RC = ESMF_SUCCESS
172162
!
173163
!-----------------------------------------------------------------------
174164
!***********************************************************************
175165
!-----------------------------------------------------------------------
176166
!
177167
! Derive from NUOPC_Driver
178168
call NUOPC_CompDerive(EARTH_GRID_COMP, Driver_routine_SS, rc=RC)
179-
ESMF_ERR_RETURN(RC,RC_REG)
169+
if (ChkErr(rc,__LINE__,u_FILE_u)) return
180170

181171
! specializations:
182172

183173
call NUOPC_CompSpecialize(EARTH_GRID_COMP, &
184174
specLabel=Driver_label_SetModelServices, specRoutine=SetModelServices, &
185175
rc=RC)
186-
ESMF_ERR_RETURN(RC,RC_REG)
176+
if (ChkErr(rc,__LINE__,u_FILE_u)) return
187177

188178
call NUOPC_CompSpecialize(EARTH_GRID_COMP, &
189179
specLabel=Driver_label_SetRunSequence, specRoutine=SetRunSequence, &
190180
rc=RC)
191-
ESMF_ERR_RETURN(RC,RC_REG)
181+
if (ChkErr(rc,__LINE__,u_FILE_u)) return
192182

193183
#ifndef JEDI_DRIVER
194184
! The NEMS Earth component is currently the top-level driver and
195185
! does not need to coordinate Clocks with its parent.
196-
call ESMF_MethodRemove(EARTH_GRID_COMP, Driver_label_SetRunClock, rc=RC_REG)
197-
ESMF_ERR_RETURN(RC,RC_REG)
186+
call ESMF_MethodRemove(EARTH_GRID_COMP, Driver_label_SetRunClock, rc=RC)
187+
if (ChkErr(rc,__LINE__,u_FILE_u)) return
198188
call NUOPC_CompSpecialize(EARTH_GRID_COMP, &
199-
specLabel=Driver_label_SetRunClock, specRoutine=NUOPC_NoOp, rc=RC_REG)
200-
ESMF_ERR_RETURN(RC,RC_REG)
189+
specLabel=Driver_label_SetRunClock, specRoutine=NUOPC_NoOp, rc=RC)
190+
if (ChkErr(rc,__LINE__,u_FILE_u)) return
201191
#endif
202192

203193
! register an internal initialization method
204194
call NUOPC_CompSetInternalEntryPoint(EARTH_GRID_COMP, ESMF_METHOD_INITIALIZE, &
205195
phaseLabelList=(/"IPDv04p2"/), userRoutine=ModifyCplLists, rc=rc)
206-
ESMF_ERR_RETURN(RC,RC_REG)
196+
if (ChkErr(rc,__LINE__,u_FILE_u)) return
207197

208198
! create, open, and set the config
209199
config = ESMF_ConfigCreate(rc=RC)
210-
ESMF_ERR_RETURN(RC,RC_REG)
200+
if (ChkErr(rc,__LINE__,u_FILE_u)) return
211201
call ESMF_ConfigLoadFile(config, "nems.configure", rc=RC)
212-
ESMF_ERR_RETURN(RC,RC_REG)
202+
if (ChkErr(rc,__LINE__,u_FILE_u)) return
213203
call ESMF_GridCompSet(EARTH_GRID_COMP, config=config, rc=RC)
214-
ESMF_ERR_RETURN(RC,RC_REG)
204+
if (ChkErr(rc,__LINE__,u_FILE_u)) return
215205

216206
! Load the required entries from the fd_nems.yaml file
217207
call NUOPC_FieldDictionarySetup("fd_nems.yaml", rc=rc)

0 commit comments

Comments
 (0)