Skip to content

Commit

Permalink
Merge pull request #665 from GEOS-ESM/feature/wjiang/GEOS_GigaTraj
Browse files Browse the repository at this point in the history
Added support for GEOSgigatraj gridcomp
  • Loading branch information
mathomp4 authored Dec 20, 2024
2 parents a1d4ca8 + 4eb79f7 commit fd59a96
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
26 changes: 26 additions & 0 deletions AGCM.rc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,32 @@ SEAICETHERMO_INTERNAL_CHECKPOINT_TYPE: @CHECKPOINT_TYPE
@COUPLEDOCEAN_INTERNAL_CHECKPOINT_FILE: ocean_internal_checkpoint
@COUPLEDOCEAN_INTERNAL_CHECKPOINT_TYPE: @CHECKPOINT_TYPE

# GIGATRAJ RUN CONFIG
# -------------------------
#GIGATRAJ_INTERNAL_RESTART_FILE: gigatraj_internal_rst
#GIGATRAJ_INTERNAL_CHECKPOINT_FILE: gigatraj_internal_checkpoint
#GIGATRAJ_INTERNAL_CHECKPOINT_TYPE: @CHECKPOINT_TYPE
GIGATRAJ_REGRID_TO_LATLON: NO
#GIGATRAJ_PARCELS_FILE: parcels.nc4
# time interval (minutes) for integration. Default is heart beat and it must be a multiple of heart beat.
# format hhmmss
# GIGATRAJ_INTEGRATE_DT:
# time interval to rebalance the parcels, i.e, the process keeps its own parcels
# format hhmmss
GIGATRAJ_REBALANCE_DT: 001500
# time interval to write output
# format hhmmss
GIGATRAJ_OUTPUT_DT: 003000
# format :: comp[%%bundle]%field[|alias], [] is optional
GIGATRAJ_VERTICAL_COORD: DYN%PL|P
#GIGATRAJ_VERTICAL_COORD: DYN%TH|Theta
#GIGATRAJ_VERTICAL_COORD: DYN%ZL|PAlt
# using ";" to separate fields. NO blank space between chars
# format :: comp[%%bundle]%field[|alias], [] is optional
GIGATRAJ_EXTRA_FIELDS: DYN%TH|Theta;DYN%ZL|PAlt
#GIGATRAJ_EXTRA_FIELDS: DYN%PL|P;DYN%ZL|PAlt
#GIGATRAJ_EXTRA_FIELDS: DYN%PL|P;DYN%TH|Theta

# IGNI Restart Files
# ------------------
#IGNI_INTERNAL_RESTART_FILE: igni_internal_rst
Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ ecbuild_add_executable (
SOURCES GEOSgcm.F90
LIBS GEOSgcm_GridComp ESMF::ESMF OpenMP::OpenMP_Fortran
)
# NOTE Due to Gigatraj being a C++ code, CMake apparently
# gets confused if building with it and thinks GEOSgcm.x
# is a C++ code and tries to link as C++. This will fail.
# To fix this, we explicitly set the linker language to Fortran.
set_target_properties (GEOSgcm.x PROPERTIES LINKER_LANGUAGE Fortran)

ecbuild_add_executable (
TARGET idfupd.x
SOURCES idfupd.F90
LIBS GEOSgcm_GridComp ESMF::ESMF
)
set_target_properties (idfupd.x PROPERTIES LINKER_LANGUAGE Fortran)

set (CMAKE_Fortran_FLAGS_RELEASE "${GEOS_Fortran_FLAGS_VECT}")

Expand Down
6 changes: 5 additions & 1 deletion gcm_run.j
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,20 @@ cat CAP.tmp | sed -e "s?$oldstring?$newstring?g" > CAP.rc

endif

set GIGATRAJ = `grep '^\s*GIGATRAJ_PARCELS_FILE:' AGCM.rc | cut -d: -f2`

#######################################################################
# Move to Scratch Directory and Copy RC Files from Home Directory
#######################################################################

cd $SCRDIR
/bin/rm -rf *

cp -f $EXPDIR/RC/* .
cp $EXPDIR/cap_restart .
cp $EXPDIR/linkbcs .
if ($GIGATRAJ != "") then
cp $EXPDIR/$GIGATRAJ .
endif
cp -f $HOMDIR/*.rc .
cp -f $HOMDIR/*.nml .
cp -f $HOMDIR/*.yaml .
Expand Down

0 comments on commit fd59a96

Please sign in to comment.