Skip to content

Commit

Permalink
Merge pull request #492 from GEOS-ESM/bugfix/mathomp4/491-fix-clone
Browse files Browse the repository at this point in the history
Fixes #491. Fix for cloning in setup scripts
  • Loading branch information
sdrabenh authored Jul 17, 2023
2 parents 7b6e720 + b51c95f commit 3df86fa
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 19 deletions.
11 changes: 7 additions & 4 deletions gcm_setup
Original file line number Diff line number Diff line change
Expand Up @@ -2917,7 +2917,7 @@ if ( $OGCM == 1 ) then
set OGCM = TRUE
# Now we need to find out if we are running MOM or MOM6 by looking
# at OCEAN_NAME: val and checking if it is MOM or MOM6
set OCEAN_MODEL = `grep "OCEAN_NAME" ${OLDHOMDIR}/AGCM.rc | cut -d: -f2 | tr -d ' '`
set OCNMODEL = `grep "OCEAN_NAME" ${OLDHOMDIR}/AGCM.rc | cut -d: -f2 | tr -d ' '`
else if ( $OGCM == 0 ) then
set OGCM = FALSE
else
Expand Down Expand Up @@ -2984,7 +2984,9 @@ HOMDIR/gcm_emip.setup
HOMDIR/logging.yaml
EOF

if( $OGCM == TRUE & "$OCNMODEL" != MIT ) then
if( $OGCM == TRUE ) then

if ("$OCNMODEL" != "MIT" ) then

# Some files are common to both MOM and MOM6
cat >> $FILES_TO_PROCESS << EOF
Expand All @@ -2993,16 +2995,17 @@ HOMDIR/diag_table
HOMDIR/__init__.py
EXPDIR/plot/plotocn.j
EOF
endif

# Some files are specific to MOM
if ( $OCEAN_MODEL == "MOM" ) then
if ( "$OCNMODEL" == "MOM" ) then
cat >> $FILES_TO_PROCESS << EOF
HOMDIR/field_table
EOF
endif

# Some files are specific to MOM6
if ( $OCEAN_MODEL == "MOM6" ) then
if ( "$OCNMODEL" == "MOM6" ) then
cat >> $FILES_TO_PROCESS << EOF
HOMDIR/MOM_override
HOMDIR/MOM_input
Expand Down
14 changes: 9 additions & 5 deletions geoschemchem_setup
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ if( $AGCM_IM == "c540" ) then
set NUM_READERS = 6
set JOB_SGMT = 00000001
set NUM_SGMT = 1
set ATMOS_RES = CF540x6C
set ATMOS_RES = CF0540x6C
set CNV_NX = 8
set POST_NDS = 32
set USE_SHMEM = 1
Expand Down Expand Up @@ -2895,6 +2895,7 @@ endif
# ---------------------
# (By default, ENABLE_TR is TRUE in RC/GEOS_ChemGridComp.rc)


#######################################################################
# Modify MOM input files to match HEARTBEAT
#######################################################################
Expand Down Expand Up @@ -3121,7 +3122,7 @@ if ( $OGCM == 1 ) then
set OGCM = TRUE
# Now we need to find out if we are running MOM or MOM6 by looking
# at OCEAN_NAME: val and checking if it is MOM or MOM6
set OCEAN_MODEL = `grep "OCEAN_NAME" ${OLDHOMDIR}/AGCM.rc | cut -d: -f2 | tr -d ' '`
set OCNMODEL = `grep "OCEAN_NAME" ${OLDHOMDIR}/AGCM.rc | cut -d: -f2 | tr -d ' '`
else if ( $OGCM == 0 ) then
set OGCM = FALSE
else
Expand Down Expand Up @@ -3188,7 +3189,9 @@ HOMDIR/gcm_emip.setup
HOMDIR/logging.yaml
EOF

if( $OGCM == TRUE & "$OCNMODEL" != MIT ) then
if( $OGCM == TRUE ) then

if ("$OCNMODEL" != "MIT" ) then

# Some files are common to both MOM and MOM6
cat >> $FILES_TO_PROCESS << EOF
Expand All @@ -3197,16 +3200,17 @@ HOMDIR/diag_table
HOMDIR/__init__.py
EXPDIR/plot/plotocn.j
EOF
endif

# Some files are specific to MOM
if ( $OCEAN_MODEL == "MOM" ) then
if ( "$OCNMODEL" == "MOM" ) then
cat >> $FILES_TO_PROCESS << EOF
HOMDIR/field_table
EOF
endif

# Some files are specific to MOM6
if ( $OCEAN_MODEL == "MOM6" ) then
if ( "$OCNMODEL" == "MOM6" ) then
cat >> $FILES_TO_PROCESS << EOF
HOMDIR/MOM_override
HOMDIR/MOM_input
Expand Down
13 changes: 8 additions & 5 deletions gmichem_setup
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,7 @@ if( $AGCM_IM == "c540" ) then
set NUM_READERS = 6
set JOB_SGMT = 00000001
set NUM_SGMT = 1
set ATMOS_RES = CF540x6C
set ATMOS_RES = CF0540x6C
set CNV_NX = 8
set POST_NDS = 32
set USE_SHMEM = 1
Expand Down Expand Up @@ -3328,7 +3328,7 @@ if ( $OGCM == 1 ) then
set OGCM = TRUE
# Now we need to find out if we are running MOM or MOM6 by looking
# at OCEAN_NAME: val and checking if it is MOM or MOM6
set OCEAN_MODEL = `grep "OCEAN_NAME" ${OLDHOMDIR}/AGCM.rc | cut -d: -f2 | tr -d ' '`
set OCNMODEL = `grep "OCEAN_NAME" ${OLDHOMDIR}/AGCM.rc | cut -d: -f2 | tr -d ' '`
else if ( $OGCM == 0 ) then
set OGCM = FALSE
else
Expand Down Expand Up @@ -3395,7 +3395,9 @@ HOMDIR/gcm_emip.setup
HOMDIR/logging.yaml
EOF

if( $OGCM == TRUE & "$OCNMODEL" != MIT ) then
if( $OGCM == TRUE ) then

if ("$OCNMODEL" != "MIT" ) then

# Some files are common to both MOM and MOM6
cat >> $FILES_TO_PROCESS << EOF
Expand All @@ -3404,16 +3406,17 @@ HOMDIR/diag_table
HOMDIR/__init__.py
EXPDIR/plot/plotocn.j
EOF
endif

# Some files are specific to MOM
if ( $OCEAN_MODEL == "MOM" ) then
if ( "$OCNMODEL" == "MOM" ) then
cat >> $FILES_TO_PROCESS << EOF
HOMDIR/field_table
EOF
endif

# Some files are specific to MOM6
if ( $OCEAN_MODEL == "MOM6" ) then
if ( "$OCNMODEL" == "MOM6" ) then
cat >> $FILES_TO_PROCESS << EOF
HOMDIR/MOM_override
HOMDIR/MOM_input
Expand Down
13 changes: 8 additions & 5 deletions stratchem_setup
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ if( $AGCM_IM == "c540" ) then
set NUM_READERS = 6
set JOB_SGMT = 00000001
set NUM_SGMT = 1
set ATMOS_RES = CF540x6C
set ATMOS_RES = CF0540x6C
set CNV_NX = 8
set POST_NDS = 32
set USE_SHMEM = 1
Expand Down Expand Up @@ -3034,7 +3034,7 @@ if ( $OGCM == 1 ) then
set OGCM = TRUE
# Now we need to find out if we are running MOM or MOM6 by looking
# at OCEAN_NAME: val and checking if it is MOM or MOM6
set OCEAN_MODEL = `grep "OCEAN_NAME" ${OLDHOMDIR}/AGCM.rc | cut -d: -f2 | tr -d ' '`
set OCNMODEL = `grep "OCEAN_NAME" ${OLDHOMDIR}/AGCM.rc | cut -d: -f2 | tr -d ' '`
else if ( $OGCM == 0 ) then
set OGCM = FALSE
else
Expand Down Expand Up @@ -3101,7 +3101,9 @@ HOMDIR/gcm_emip.setup
HOMDIR/logging.yaml
EOF

if( $OGCM == TRUE & "$OCNMODEL" != MIT ) then
if( $OGCM == TRUE ) then

if ("$OCNMODEL" != "MIT" ) then

# Some files are common to both MOM and MOM6
cat >> $FILES_TO_PROCESS << EOF
Expand All @@ -3110,16 +3112,17 @@ HOMDIR/diag_table
HOMDIR/__init__.py
EXPDIR/plot/plotocn.j
EOF
endif

# Some files are specific to MOM
if ( $OCEAN_MODEL == "MOM" ) then
if ( "$OCNMODEL" == "MOM" ) then
cat >> $FILES_TO_PROCESS << EOF
HOMDIR/field_table
EOF
endif

# Some files are specific to MOM6
if ( $OCEAN_MODEL == "MOM6" ) then
if ( "$OCNMODEL" == "MOM6" ) then
cat >> $FILES_TO_PROCESS << EOF
HOMDIR/MOM_override
HOMDIR/MOM_input
Expand Down

0 comments on commit 3df86fa

Please sign in to comment.