Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure SEAICETHERMO components and make sea ice grid comps built as DSOs #868

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
esma_set_this()

set (srcs
GEOS_CICE4ColumnPhysGridComp.F90 GEOS_OpenWaterGridComp.F90
GEOS_SaltWaterGridComp.F90 GEOS_SimpleSeaiceGridComp.F90
GEOS_SeaiceInterfaceGridComp.F90
GEOS_OpenWaterGridComp.F90
GEOS_SaltWaterGridComp.F90
GEOS_SimpleSeaiceGridComp.F90
GEOS_ObioGridComp.F90)

esma_add_library (${this}
SRCS ${srcs}
DEPENDENCIES GEOS_Shared MAPL CICE4 esmf NetCDF::NetCDF_Fortran)
SUBCOMPONENTS GEOS_CICE4ColumnPhysGridComp GEOS_SeaiceInterfaceGridComp
DEPENDENCIES GEOS_Shared MAPL esmf NetCDF::NetCDF_Fortran)

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
esma_set_this ()

set (SRCS
GEOS_CICE4ColumnPhysGridComp.F90
)

esma_add_library (${this}
SRCS ${SRCS}
DEPENDENCIES GEOS_Shared MAPL CICE4
TYPE SHARED
)

Original file line number Diff line number Diff line change
Expand Up @@ -5759,3 +5759,11 @@ subroutine CICEReOrder8(Packed, UnPacked, MSK, Pdim, Udim, LM, DIR)
end do
end do
end subroutine CICEReOrder8

subroutine SetServices(gc, rc)
use ESMF
use GEOS_CICE4ColumnPhysGridComp, only : mySetservices=>SetServices
type(ESMF_GridComp) :: gc
integer, intent(out) :: rc
call mySetServices(gc,rc=rc)
end subroutine
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ module GEOS_SaltwaterGridCompMod

use GEOS_OpenwaterGridCompMod, only : OpenWaterSetServices => SetServices
use GEOS_SimpleSeaiceGridCompMod, only : SimpleSeaiceSetServices => SetServices
use GEOS_CICE4ColumnPhysGridComp, only : CICE4ColumnPhysSetServices => SetServices
use GEOS_SeaiceInterfaceGridComp, only : SeaiceInterfaceSetServices => SetServices
use GEOS_ObioGridCompMod, only : ObioSetServices => SetServices

implicit none
Expand Down Expand Up @@ -102,6 +100,7 @@ subroutine SetServices ( GC, RC )
integer :: DO_CICE_THERMO ! default (=0) is to run saltwater, with no LANL CICE Thermodynamics
logical :: seaIceT_extData ! default (=.FALSE.) is to NOT use data sea ice thickness from ExtData

character(len=ESMF_MAXSTR) :: sharedObj
character(len = 2) :: suffix

!=============================================================================
Expand Down Expand Up @@ -144,14 +143,13 @@ subroutine SetServices ( GC, RC )
! sea-ice first and openwater second
! changing order requires also changing indices of ICE and WATER (sub-tiles at the top)
if(DO_CICE_THERMO == 0) then
I = MAPL_AddChild(GC, NAME='SEAICETHERMO', SS=SimpleSeaiceSetServices, RC=STATUS)
VERIFY_(STATUS)
I = MAPL_AddChild(GC, NAME='SEAICETHERMO', SS=SimpleSeaiceSetServices, _RC)
elseif(DO_CICE_THERMO == 1) then
I = MAPL_AddChild(GC, NAME='SEAICETHERMO', SS=CICE4ColumnPhysSetServices, RC=STATUS)
VERIFY_(STATUS)
call MAPL_GetResource ( MAPL, sharedObj, Label="GEOS_CICE4ColumnPhysGridComp:", DEFAULT="libGEOS_CICE4ColumnPhysGridComp.so", _RC)
I = MAPL_AddChild('SEAICETHERMO','setservices_', parentGC=GC, sharedObj=sharedObj, _RC)
else
I = MAPL_AddChild(GC, NAME='SEAICETHERMO', SS=SeaiceInterfaceSetServices, RC=STATUS)
VERIFY_(STATUS)
call MAPL_GetResource ( MAPL, sharedObj, Label="GEOS_SeaiceInterfaceGridComp:", DEFAULT="libGEOS_SeaiceInterfaceGridComp.so", _RC)
I = MAPL_AddChild('SEAICETHERMO','setservices_', parentGC=GC, sharedObj=sharedObj, _RC)
endif

I = MAPL_AddChild(GC, NAME='OPENWATER', SS=OpenWaterSetServices, _RC)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
esma_set_this ()

set (SRCS
GEOS_SeaiceInterfaceGridComp.F90
)

esma_add_library (${this}
SRCS ${SRCS}
DEPENDENCIES GEOS_Shared MAPL
TYPE SHARED
)

Original file line number Diff line number Diff line change
Expand Up @@ -3120,4 +3120,10 @@ end subroutine RetrieveTransforms

end module GEOS_SeaiceInterfaceGridComp


subroutine SetServices(gc, rc)
use ESMF
use GEOS_SeaiceInterfaceGridComp, only : mySetservices=>SetServices
type(ESMF_GridComp) :: gc
integer, intent(out) :: rc
call mySetServices(gc,rc=rc)
end subroutine
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ esma_set_this ()

esma_add_library (${this}
SRCS GEOS_CICEDynaGridComp.F90
DEPENDENCIES MAPL CICE4 esmf)
DEPENDENCIES MAPL CICE4 esmf
TYPE SHARED)

target_compile_definitions(${this} PRIVATE DIAGOUT MODIFY_TOPOGRAPHY USE_R8)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2893,3 +2893,11 @@ end subroutine Finalize


end module GEOS_CICEDynaGridCompMod

subroutine SetServices(gc, rc)
use ESMF
use GEOS_CICEDynaGridCompMod, only : mySetservices=>SetServices
type(ESMF_GridComp) :: gc
integer, intent(out) :: rc
call mySetServices(gc, rc=rc)
end subroutine
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ module GEOS_SeaIceGridCompMod
use MAPL
#ifdef BUILD_MIT_OCEAN
use GEOS_MITDynaGridCompMod, only : GEOSMITSeaIceSetServices => SetServices
#else
use GEOS_CICEDynaGridCompMod, only : CICE4SeaIceSetServices => SetServices
#endif
use GEOS_DataSeaIceGridCompMod, only : DataSeaIceSetServices => SetServices
use ice_prescribed_mod, only : ice_nudging
Expand Down Expand Up @@ -123,12 +121,12 @@ subroutine SetServices ( GC, RC )
call MAPL_GetResource ( MAPL, SEAICE_NAME, Label="SEAICE_NAME:", DEFAULT="CICE4", __RC__ )
select case (trim(SEAICE_NAME))
case ("CICE4")
ICE = MAPL_AddChild(GC, NAME=SEAICE_NAME, SS=CICE4SeaIceSetServices, __RC__)
call MAPL_GetResource ( MAPL, sharedObj, Label="GEOSCICEDyna_GridComp:", DEFAULT="libGEOSCICEDyna_GridComp.so", __RC__ )
ICE = MAPL_AddChild(SEAICE_NAME,'setservices_', parentGC=GC, sharedObj=sharedObj, __RC__)
case ("CICE6")
call MAPL_GetResource ( MAPL, sharedObj, Label="CICE_GEOSPLUG:", DEFAULT="libCICE_GEOSPlug.so", __RC__ )
ICE = MAPL_AddChild(SEAICE_NAME,'setservices_', parentGC=GC, sharedObj=sharedObj, __RC__)

!ICE = MAPL_AddChild(GC, NAME=SEAICE_NAME, SS=CICE6SeaIceSetServices, __RC__)
case default
charbuf_ = "SEAICE_NAME: " // trim(SEAICE_NAME) // " is not implemented, ABORT!"
call WRITE_PARALLEL(charbuf_)
Expand Down
Loading