-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add gigataj grid comp #954
base: develop
Are you sure you want to change the base?
Conversation
added feature without regridding to latlon
@@ -8,6 +8,13 @@ set (alldirs | |||
GEOSwgcm_GridComp | |||
) | |||
|
|||
option(BUILD_WITH_GIGATRAJ "Build GEOSgcm with Gigatraj" ON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this to default to ON
? Might be best to initially add it as an optional feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will make if OFF as default. The on is just for my own convenience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely needs to be OFF as default.
option(BUILD_WITH_GIGATRAJ "Build GEOSgcm with Gigatraj" ON) | |
option(BUILD_WITH_GIGATRAJ "Build GEOSgcm with Gigatraj" OFF) |
@@ -0,0 +1,9 @@ | |||
esma_set_this() | |||
|
|||
set (dependencies MAPL esmf geos_giga metsources filters gigatraj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be best to use ESMF::ESMF
or at least ESMF
here. The all lowercase isn't really official (though we do support it).
option(BUILD_WITH_GIGATRAJ "Build GEOSgcm with Gigatraj" ON) | ||
|
||
if (BUILD_WITH_GIGATRAJ) | ||
add_definitions (-DHAS_GIGATRAJ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit of an anti pattern for CMake. It should get attached to the target that needs the definition. Possibly ${this}
#ifdef HAS_GIGATRAJ | ||
use GEOS_GigatrajGridCompMod, only: GigaTraj_SetServices => SetServices | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance this can use DSO instead? Then we don't need the $ifdef and can instead just use information in the RC file to load the component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, the gridcomp itself is rather small. Why not always build it and just have runtime conditionals (defaulting to off) to control use.
#ifdef HAS_GIGATRAJ | ||
gigatraj = MAPL_AddChild(GC, NAME='GIGATRAJ', SS=GigaTraj_SetServices, RC=STATUS) | ||
VERIFY_(STATUS) | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, if we use DSO this can be turned into a run-time if
instead of a compile time #ifdef
.
|
||
#ifdef HAS_GIGATRAJ | ||
! use agcm export as gigatraj's import to get the initial state. | ||
! it only runs at the begining of the first time step | ||
call ESMF_GridCompRun ( GCS(gigatraj), importState=GEX(AGCM), exportState=GEX(gigatraj), clock=clock, phase=1, userRC=status ) | ||
VERIFY_(STATUS) | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a runtime conditional.
#ifdef HAS_GIGATRAJ | ||
! use agcm export as gigatraj's import | ||
call ESMF_GridCompRun ( GCS(gigatraj), importState=GEX(AGCM), exportState=GEX(gigatraj), clock=clock, phase=2, userRC=status ) | ||
VERIFY_(STATUS) | ||
#endif | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be a duplicate of the call above. Why is it run twice?
#ifdef HAS_GIGATRAJ | ||
call MAPL_AddExportSpec(GC, & | ||
SHORT_NAME = 'OMEGA', & | ||
CHILD_ID = SDYN, & | ||
RC = STATUS) | ||
VERIFY_(STATUS) | ||
call MAPL_AddExportSpec(GC, & | ||
SHORT_NAME = 'PL', & | ||
CHILD_ID = SDYN, & | ||
RC = STATUS) | ||
VERIFY_(STATUS) | ||
call MAPL_AddExportSpec(GC, & | ||
SHORT_NAME = 'TH', & | ||
CHILD_ID = SDYN, & | ||
RC = STATUS) | ||
VERIFY_(STATUS) | ||
#endif | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run-time conditional.
@@ -0,0 +1,9 @@ | |||
esma_set_this() | |||
|
|||
set (dependencies MAPL esmf geos_giga metsources filters gigatraj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set (dependencies MAPL esmf geos_giga metsources filters gigatraj) | |
set (dependencies MAPL ESMF::ESMF geos_giga metsources filters gigatraj) |
@@ -0,0 +1,187 @@ | |||
module GEOS_Giga_InterOpMod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs documentation as to what it is for. Nothing big - just a few sentences at the top explaining.
No description provided.