Skip to content

Commit

Permalink
Merge pull request #542 from GEOS-ESM/feature/mathomp4/specific-mom6
Browse files Browse the repository at this point in the history
Use specific MOM6 Resolutions
  • Loading branch information
mathomp4 authored Nov 27, 2023
2 parents 9051c71 + 3aff6ce commit 966db1e
Show file tree
Hide file tree
Showing 4 changed files with 306 additions and 214 deletions.
127 changes: 75 additions & 52 deletions gcm_setup
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,6 @@ if( $OGCM == TRUE ) then
set MOM5 = "#DELETE"
set DEFAULT_HISTORY_TEMPLATE="HISTORY.AOGCM.rc.tmpl"
set MIT = "#DELETE"
set OCEAN_NAME="MOM6"
else if ( "$OCNMODEL" == "MIT" ) then
set OCEAN_NAME="MIT"
set OGCM_GRID_TYPE = llc
Expand Down Expand Up @@ -755,17 +754,8 @@ if( $OGCM == TRUE ) then
else
goto CORSLV
endif
else
if ( $OCEAN_NAME == "MOM" ) then
set Resolution = `echo 360 200`
else if ( $OCEAN_NAME == "MOM6" ) then
# c12 MOM6 is default 72x36
if( $AGCM_IM == "c12" ) then
set Resolution = `echo 72 36`
else
set Resolution = `echo 360 210`
endif
endif
else if ( $OCEAN_NAME == "MOM" ) then
set Resolution = `echo 360 200`

echo "Enter the Ocean Lat/Lon ${C1}Horizontal Resolution${CN}: ${C2}IM JM${CN} (Default:" $Resolution")"
set Resolution = `echo $<`
Expand All @@ -774,16 +764,7 @@ if( $OGCM == TRUE ) then
set OGCM_IM = $Resolution[1]
set OGCM_JM = $Resolution[2]
else
if ( $OCEAN_NAME == "MOM" ) then
set Resolution = `echo 360 200`
else if ( $OCEAN_NAME == "MOM6" ) then
# c12 MOM6 is default 72x36
if( $AGCM_IM == "c12" ) then
set Resolution = `echo 72 36`
else
set Resolution = `echo 360 210`
endif
endif
set Resolution = `echo 360 200`

if( $num == 0 ) then
set OGCM_IM = $Resolution[1]
Expand All @@ -793,6 +774,41 @@ if( $OGCM == TRUE ) then
endif
endif

else if ( "$OCNMODEL" == "MOM6" ) then
# For MOM6 we currently have only 3 allowed ocean resolutions based on the
# atmospheric resolution. The allowed are:
#
# Atm Res Atm NXxNY Atm IMxJM Ocean NXxNY Ocean IMxJM Ocean LM
# ------- --------- --------- ----------- ----------- --------
# c12 1x6 12x72 3x2 72x36 50
# c90 5x36 90x540 90x2 540x458 50
# c180 30x36 180x1080 36x30 1440x1080 75
#
# See https://github.com/GEOS-ESM/GEOSgcm/wiki/Coupled-model-configurations-(GEOS-MOM6)

if ( $AGCM_IM == "c12" ) then
set OGCM_NX = 3
set OGCM_NY = 2
set OGCM_IM = 72
set OGCM_JM = 36
set OGCM_LM = 50
else if ( $AGCM_IM == "c90" ) then
set OGCM_NX = 90
set OGCM_NY = 2
set OGCM_IM = 540
set OGCM_JM = 458
set OGCM_LM = 50
else if ( $AGCM_IM == "c180" ) then
set OGCM_NX = 36
set OGCM_NY = 30
set OGCM_IM = 1440
set OGCM_JM = 1080
set OGCM_LM = 75
else
echo
echo "ERROR: MOM6 is currently only supported for c12, c90, and c180 atmospheric resolutions"
exit 1
endif
endif

set IMO = ${OGCM_IM}
Expand Down Expand Up @@ -825,17 +841,14 @@ if( $OGCM == TRUE ) then
set OSTIA = "#DELETE"
set OCEANOUT = "#DELETE"

echo "Enter the Ocean Model ${C1}Vertical Resolution${CN}: ${C2}LM${CN} (Default: 50)"
set OGCM_LM = $<
if( .$OGCM_LM == . ) then
set OGCM_LM = 50
endif
# We only ask this if not MOM6
if ( "$OCNMODEL" != "MOM6" ) then
echo "Enter the Ocean Model ${C1}Vertical Resolution${CN}: ${C2}LM${CN} (Default: 50)"
set OGCM_LM = $<
if( .$OGCM_LM == . ) then
set OGCM_LM = 50
endif

# At the moment c12 MOM6 is default 3x2 ocean (and 1x6 atmos)
if( $AGCM_IM == "c12" ) then
set OGCM_NX = 3
set OGCM_NY = 2
else
set OGCM_NX = 36
set OGCM_NY = 10
endif
Expand Down Expand Up @@ -1049,10 +1062,10 @@ if( $AGCM_IM == "c12" ) then
set AGCM_IM = 12
set AGCM_JM = `expr $AGCM_IM \* 6`
# C12 MOM6 should be 1x6 to match the default 3x2 ocean layout
if ( $OCEAN_NAME == "MOM6") then
set NX = 1
if ( "$OCNMODEL" == "MOM6") then
set NX = 1
else
set NX = 2
set NX = 2
endif
set NY = `expr $NX \* 6`
set HYDROSTATIC = $USE_HYDROSTATIC
Expand Down Expand Up @@ -1107,18 +1120,22 @@ if( $AGCM_IM == "c90" ) then
set AGCM_IM = 90
set AGCM_JM = `expr $AGCM_IM \* 6`
if( $OGCM == TRUE ) then
if( "$OCNMODEL" == "MIT" ) then
set NX = 10
set NY = 36
else
set NX = $OGCM_NY
set NY = $OGCM_NX
endif
set OCEAN_DT = $DT
if( "$OCNMODEL" == "MIT" ) then
set NX = 10
set NY = 36
else if ( "$OCNMODEL" == "MOM6") then
# For MOM6 c90 means atm NXxNY = 5x36
set NX = 5
set NY = 36
else
set NX = $OGCM_NY
set NY = $OGCM_NX
endif
set OCEAN_DT = $DT
else
set NX = 3
set NY = `expr $NX \* 6`
set OCEAN_DT = $IRRAD_DT
set NX = 3
set NY = `expr $NX \* 6`
set OCEAN_DT = $IRRAD_DT
endif
set HYDROSTATIC = $USE_HYDROSTATIC
set HIST_IM = `expr $AGCM_IM \* 4`
Expand All @@ -1136,13 +1153,19 @@ if( $AGCM_IM == "c180" ) then
set AGCM_IM = 180
set AGCM_JM = `expr $AGCM_IM \* 6`
if( $OGCM == TRUE ) then
set NX = $OGCM_NY
set NY = $OGCM_NX
set OCEAN_DT = $DT
if ( "$OCNMODEL" == "MOM6") then
# For MOM6 c180 means atm NXxNY = 30x36
set NX = 30
set NY = 36
else
set NX = $OGCM_NY
set NY = $OGCM_NX
endif
set OCEAN_DT = $DT
else
set NX = 6
set NY = `expr $NX \* 6`
set OCEAN_DT = $IRRAD_DT
set NX = 6
set NY = `expr $NX \* 6`
set OCEAN_DT = $IRRAD_DT
endif
set HYDROSTATIC = $USE_HYDROSTATIC
set HIST_IM = `expr $AGCM_IM \* 4`
Expand Down
131 changes: 77 additions & 54 deletions geoschemchem_setup
Original file line number Diff line number Diff line change
Expand Up @@ -614,14 +614,14 @@ if( $OGCM == TRUE ) then
# Ocean Model
# -----------
OCNMODEL:
echo "Choose an ${C1}Ocean Model${CN}: (Default: ${C2}MOM5${CN})"
echo "Choose an ${C1}Ocean Model${CN}: (Default: ${C2}MOM6${CN})"
echo " ${C2}MOM5${CN}"
echo " ${C2}MOM6${CN}"
echo " ${C2}MIT${CN}"

set OCNMODEL = $<
if ( .$OCNMODEL == . ) then
set OCNMODEL = "MOM5"
set OCNMODEL = "MOM6"
else
set OCNMODEL = `echo $OCNMODEL | tr "[:lower:]" "[:upper:]"`

Expand Down Expand Up @@ -653,7 +653,6 @@ if( $OGCM == TRUE ) then
set MOM5 = "#DELETE"
set DEFAULT_HISTORY_TEMPLATE="HISTORY.AOGCM.rc.tmpl"
set MIT = "#DELETE"
set OCEAN_NAME="MOM6"
else if ( "$OCNMODEL" == "MIT" ) then
set OCEAN_NAME="MIT"
set OGCM_GRID_TYPE = llc
Expand Down Expand Up @@ -755,17 +754,8 @@ if( $OGCM == TRUE ) then
else
goto CORSLV
endif
else
if ( $OCEAN_NAME == "MOM" ) then
set Resolution = `echo 360 200`
else if ( $OCEAN_NAME == "MOM6" ) then
# c12 MOM6 is default 72x36
if( $AGCM_IM == "c12" ) then
set Resolution = `echo 72 36`
else
set Resolution = `echo 360 210`
endif
endif
else if ( $OCEAN_NAME == "MOM" ) then
set Resolution = `echo 360 200`

echo "Enter the Ocean Lat/Lon ${C1}Horizontal Resolution${CN}: ${C2}IM JM${CN} (Default:" $Resolution")"
set Resolution = `echo $<`
Expand All @@ -774,16 +764,7 @@ if( $OGCM == TRUE ) then
set OGCM_IM = $Resolution[1]
set OGCM_JM = $Resolution[2]
else
if ( $OCEAN_NAME == "MOM" ) then
set Resolution = `echo 360 200`
else if ( $OCEAN_NAME == "MOM6" ) then
# c12 MOM6 is default 72x36
if( $AGCM_IM == "c12" ) then
set Resolution = `echo 72 36`
else
set Resolution = `echo 360 210`
endif
endif
set Resolution = `echo 360 200`

if( $num == 0 ) then
set OGCM_IM = $Resolution[1]
Expand All @@ -793,6 +774,41 @@ if( $OGCM == TRUE ) then
endif
endif

else if ( "$OCNMODEL" == "MOM6" ) then
# For MOM6 we currently have only 3 allowed ocean resolutions based on the
# atmospheric resolution. The allowed are:
#
# Atm Res Atm NXxNY Atm IMxJM Ocean NXxNY Ocean IMxJM Ocean LM
# ------- --------- --------- ----------- ----------- --------
# c12 1x6 12x72 3x2 72x36 50
# c90 5x36 90x540 90x2 540x458 50
# c180 30x36 180x1080 36x30 1440x1080 75
#
# See https://github.com/GEOS-ESM/GEOSgcm/wiki/Coupled-model-configurations-(GEOS-MOM6)

if ( $AGCM_IM == "c12" ) then
set OGCM_NX = 3
set OGCM_NY = 2
set OGCM_IM = 72
set OGCM_JM = 36
set OGCM_LM = 50
else if ( $AGCM_IM == "c90" ) then
set OGCM_NX = 90
set OGCM_NY = 2
set OGCM_IM = 540
set OGCM_JM = 458
set OGCM_LM = 50
else if ( $AGCM_IM == "c180" ) then
set OGCM_NX = 36
set OGCM_NY = 30
set OGCM_IM = 1440
set OGCM_JM = 1080
set OGCM_LM = 75
else
echo
echo "ERROR: MOM6 is currently only supported for c12, c90, and c180 atmospheric resolutions"
exit 1
endif
endif

set IMO = ${OGCM_IM}
Expand Down Expand Up @@ -825,17 +841,14 @@ if( $OGCM == TRUE ) then
set OSTIA = "#DELETE"
set OCEANOUT = "#DELETE"

echo "Enter the Ocean Model ${C1}Vertical Resolution${CN}: ${C2}LM${CN} (Default: 50)"
set OGCM_LM = $<
if( .$OGCM_LM == . ) then
set OGCM_LM = 50
endif
# We only ask this if not MOM6
if ( "$OCNMODEL" != "MOM6" ) then
echo "Enter the Ocean Model ${C1}Vertical Resolution${CN}: ${C2}LM${CN} (Default: 50)"
set OGCM_LM = $<
if( .$OGCM_LM == . ) then
set OGCM_LM = 50
endif

# At the moment c12 MOM6 is default 3x2 ocean (and 1x6 atmos)
if( $AGCM_IM == "c12" ) then
set OGCM_NX = 3
set OGCM_NY = 2
else
set OGCM_NX = 36
set OGCM_NY = 10
endif
Expand Down Expand Up @@ -1050,10 +1063,10 @@ if( $AGCM_IM == "c12" ) then
set AGCM_IM = 12
set AGCM_JM = `expr $AGCM_IM \* 6`
# C12 MOM6 should be 1x6 to match the default 3x2 ocean layout
if ( $OCEAN_NAME == "MOM6") then
set NX = 1
if ( "$OCNMODEL" == "MOM6") then
set NX = 1
else
set NX = 2
set NX = 2
endif
set NY = `expr $NX \* 6`
set HYDROSTATIC = $USE_HYDROSTATIC
Expand Down Expand Up @@ -1109,18 +1122,22 @@ if( $AGCM_IM == "c90" ) then
set AGCM_IM = 90
set AGCM_JM = `expr $AGCM_IM \* 6`
if( $OGCM == TRUE ) then
if( "$OCNMODEL" == "MIT" ) then
set NX = 10
set NY = 36
else
set NX = $OGCM_NY
set NY = $OGCM_NX
endif
set OCEAN_DT = $DT
if( "$OCNMODEL" == "MIT" ) then
set NX = 10
set NY = 36
else if ( "$OCNMODEL" == "MOM6") then
# For MOM6 c90 means atm NXxNY = 5x36
set NX = 5
set NY = 36
else
set NX = $OGCM_NY
set NY = $OGCM_NX
endif
set OCEAN_DT = $DT
else
set NX = 4
set NY = `expr $NX \* 6`
set OCEAN_DT = $IRRAD_DT
set NX = 3
set NY = `expr $NX \* 6`
set OCEAN_DT = $IRRAD_DT
endif
set LONG_DT = $DT
set GEOSCHEMCHEM_DT = `expr $DT \* 2`
Expand All @@ -1141,13 +1158,19 @@ if( $AGCM_IM == "c180" ) then
set AGCM_IM = 180
set AGCM_JM = `expr $AGCM_IM \* 6`
if( $OGCM == TRUE ) then
set NX = $OGCM_NY
set NY = $OGCM_NX
set OCEAN_DT = $DT
if ( "$OCNMODEL" == "MOM6") then
# For MOM6 c180 means atm NXxNY = 30x36
set NX = 30
set NY = 36
else
set NX = $OGCM_NY
set NY = $OGCM_NX
endif
set OCEAN_DT = $DT
else
set NX = 6
set NY = `expr $NX \* 6`
set OCEAN_DT = $IRRAD_DT
set NX = 6
set NY = `expr $NX \* 6`
set OCEAN_DT = $IRRAD_DT
endif
set HYDROSTATIC = $USE_HYDROSTATIC
set HIST_IM = `expr $AGCM_IM \* 4`
Expand Down
Loading

0 comments on commit 966db1e

Please sign in to comment.