Skip to content
Merged
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
162 changes: 162 additions & 0 deletions MOM6_GEOSPlug/MOM6_GEOSPlug.F90
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ module MOM6_GEOSPlugMod
ocean_state_type, &
ocean_model_get_UV_surf, &
ocean_model_get_thickness, &
ocean_model_put_prog_tracer, &
ocean_model_get_prog_tracer, &
ocean_model_get_prog_tracer_index

Expand Down Expand Up @@ -83,6 +84,8 @@ module MOM6_GEOSPlugMod
type(MOM_MAPL_Type), pointer :: Ptr
end type MOM_MAPLWrap_Type

logical :: DUAL_OCEAN

contains

!BOP
Expand Down Expand Up @@ -111,6 +114,8 @@ subroutine SetServices ( GC, RC )
character(len=ESMF_MAXSTR) :: COMP_NAME

! Locals
type (MAPL_MetaComp), pointer :: MAPL
integer :: iDUAL_OCEAN
!=============================================================================

__Iam__('SetServices')
Expand All @@ -123,13 +128,26 @@ subroutine SetServices ( GC, RC )
call ESMF_GridCompGet( GC, NAME=COMP_NAME, _RC)
Iam = trim(COMP_NAME)//'::'//'SetServices'

! Get the MAPL object
! -------------------

call MAPL_GetObjectFromGC ( GC, MAPL, RC=STATUS)
VERIFY_(STATUS)

call MAPL_GetResource(MAPL, iDUAL_OCEAN, 'DUAL_OCEAN:', default=0, RC=STATUS )
DUAL_OCEAN = iDUAL_OCEAN /= 0


! Set the Initialize, Run, Finalize entry points
! ----------------------------------------------

call MAPL_GridCompSetEntryPoint ( GC, ESMF_Method_Initialize, Initialize, _RC)
call MAPL_GridCompSetEntryPoint ( GC, ESMF_Method_Run, Run, _RC)
call MAPL_GridCompSetEntryPoint ( GC, ESMF_Method_Finalize, Finalize, _RC)
call MAPL_GridCompSetEntryPoint ( GC, ESMF_Method_WriteRestart, Record, _RC)
if (dual_ocean) then
call MAPL_GridCompSetEntryPoint ( GC, ESMF_Method_Run, Run2, _RC)
end if

!BOS

Expand All @@ -146,6 +164,7 @@ subroutine SetServices ( GC, RC )

call MAPL_TimerAdd(GC, name="INITIALIZE" , _RC)
call MAPL_TimerAdd(GC, name="RUN" , _RC)
call MAPL_TimerAdd(GC, name="RUN2" , _RC)
call MAPL_TimerAdd(GC, name="FINALIZE" , _RC)

! Generic SetServices
Expand Down Expand Up @@ -991,6 +1010,149 @@ end subroutine Run

!BOP

!!###### -- Adopted Run2 for MOM6 -- SK
! !IROUTINE: Run2 -- Run2 method, needed only when in dual_ocean mode. Apply correction to top-level MOM6 temperature, based on DEL_TEMP

! !INTERFACE:

subroutine Run2 ( GC, IMPORT, EXPORT, CLOCK, RC )

! !ARGUMENTS:

type(ESMF_GridComp), intent(INOUT) :: GC ! Gridded component
type(ESMF_State), intent(INOUT) :: IMPORT ! Import state
type(ESMF_State), intent(INOUT) :: EXPORT ! Export state
type(ESMF_Clock), intent(INOUT) :: CLOCK ! The supervisor clock
integer, optional, intent( OUT) :: RC ! Error code:

type(ESMF_State) :: INTERNAL ! Internal state

!EOP

! ErrLog Variables

character(len=ESMF_MAXSTR) :: IAm
integer :: STATUS
character(len=ESMF_MAXSTR) :: COMP_NAME

! Locals

integer :: IM, JM, LM
integer :: tracer_index
type(ice_ocean_boundary_type), pointer :: Boundary => null()
type(ocean_public_type), pointer :: Ocean => null()
type(ocean_state_type), pointer :: Ocean_State => null()
type(ocean_grid_type), pointer :: Ocean_grid => null()


! Imports
REAL_, pointer :: DEL_TEMP(:,:)

! Temporaries

real, allocatable :: T(:,:,:), tmp3(:,:,:)

! Pointers to export
REAL_, pointer :: MOM_2D_MASK(:,:)
REAL_, pointer :: AREA(:,:)

type(MAPL_MetaComp), pointer :: MAPL
type(MOM_MAPL_Type), pointer :: MOM_MAPL_internal_state
type(MOM_MAPLWrap_Type) :: wrap
integer :: isc,iec,jsc,jec
integer :: isd,ied,jsd,jed

! Begin
!------


! Get the component's name and set-up traceback handle.
! -----------------------------------------------------
Iam = "Run2"
call ESMF_GridCompGet( GC, NAME=COMP_NAME, _RC )
Iam = trim(COMP_NAME)//'::'//Iam

! Get my internal MAPL_Generic state
!-----------------------------------

call MAPL_GetObjectFromGC ( GC, MAPL, _RC)


! Profilers
!----------

call MAPL_TimerOn (MAPL,"TOTAL")
call MAPL_TimerOn (MAPL,"RUN2" )

! Get the Plug's private internal state
!--------------------------------------

CALL ESMF_UserCompGetInternalState( GC, 'MOM_MAPL_state', WRAP, STATUS )
VERIFY_(STATUS)

MOM_MAPL_internal_state => WRAP%PTR
! Aliases to MOM types
!---------------------


Boundary => MOM_MAPL_internal_state%Ice_ocean_boundary
Ocean => MOM_MAPL_internal_state%Ocean
Ocean_State => MOM_MAPL_internal_state%Ocean_State

call get_domain_extent(Ocean%Domain, isc, iec, jsc, jec)

IM=iec-isc+1
JM=jec-jsc+1

call get_ocean_grid (Ocean_state, Ocean_grid)
LM=Ocean_grid%ke

! Temporaries with MOM default reals
!-----------------------------------

allocate(Tmp3(IM,JM,LM), __STAT__) !! BY SK for a bugfix on get temp from mom6

! Get IMPORT pointers
!--------------------

call MAPL_GetPointer(IMPORT, DEL_TEMP, 'DEL_TEMP', _RC)

! Get EXPORT pointers
!--------------------
! by now this should be allocated, so 'alloc=.true.' is needed

call MAPL_GetPointer(EXPORT, MOM_2D_MASK, 'MOM_2D_MASK', _RC)
call MAPL_GetPointer(EXPORT, AREA, 'AREA', _RC)

call ocean_model_get_prog_tracer_index(Ocean_State,tracer_index,'temp')
call ocean_model_get_prog_tracer(Ocean_State,tracer_index, tmp3, isc, jsc)
T = real(tmp3,kind=GeosKind)

!ALT: Note that we modify only top level of T
! we do not need to worry about temperature units
! since we are applying difference
! some relaxation ??? here or in guest ???

where(MOM_2D_MASK(:,:) > 0.0)
T(:,:,1) = T(:,:,1) + DEL_TEMP
end where

call ocean_model_put_prog_tracer(Ocean_State,tracer_index,T)

deallocate(Tmp3)

call MAPL_TimerOff(MAPL,"RUN2" )
call MAPL_TimerOff(MAPL,"TOTAL")

! All Done
!---------


RETURN_(ESMF_SUCCESS)
end subroutine Run2

!!###### -- Adopted Run2 for MOM6 -- SK

!====================================================================

! !IROUTINE: Finalize -- Finalize method for GuestOcean wrapper
Expand Down
1 change: 1 addition & 0 deletions MOM6_GEOSPlug/MOM6_GEOSPlug_StateSpecs.rc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ CALVING | kg m-2 s-1 | xy | N | ice_calving_at_ocean_points
AICE | 1 | xy | N | ice_concentration_of_grid_cell
TAUXBOT | N m-2 | xy | N | eastward_stress_at_base_of_ice_Agrid
TAUYBOT | N m-2 | xy | N | northward_stress_at_base_of_ice_Agrid
DEL_TEMP | K | xy | N | temperature_difference_btw_model_top_level_and_obs

category: EXPORT
#------------------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions MOM6_GEOSPlug/mom6_app/1440x1080/MOM_input
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ TKE_ITIDE_MAX = 0.1 ! [W m-2] default = 1000.0
READ_TIDEAMP = True ! [Boolean] default = False
! If true, read a file (given by TIDEAMP_FILE) containing the tidal amplitude
! with INT_TIDE_DISSIPATION.
TIDEAMP_FILE = "tidal_amplitude.v20140616.nc_newtopo_config.nc" ! default = "tideamp.nc"
TIDEAMP_FILE = "tidal_amplitude.v20140616.nc" ! default = "tideamp.nc"
! The path to the file containing the spatially varying tidal amplitudes with
! INT_TIDE_DISSIPATION.
H2_FILE = "ocean_topog.nc" !
Expand All @@ -605,7 +605,7 @@ H2_FILE = "ocean_topog.nc" !
GEOTHERMAL_SCALE = 1.0 ! [W m-2 or various] default = 0.0
! The constant geothermal heat flux, a rescaling factor for the heat flux read
! from GEOTHERMAL_FILE, or 0 to disable the geothermal heating.
GEOTHERMAL_FILE = "geothermal_davies2013_v1_newtopo_config.nc" ! default = ""
GEOTHERMAL_FILE = "geothermal_davies2013_v1.nc" ! default = ""
! The file from which the geothermal heating is to be read, or blank to use a
! constant heating rate.
GEOTHERMAL_VARNAME = "geothermal_hf" ! default = "geo_heat"
Expand Down Expand Up @@ -670,7 +670,7 @@ PRESSURE_DEPENDENT_FRAZIL = True ! [Boolean] default = False
VAR_PEN_SW = True ! [Boolean] default = False
! If true, use one of the CHL_A schemes specified by OPACITY_SCHEME to determine
! the e-folding depth of incoming short wave radiation.
CHL_FILE = "seawifs-clim-1997-2010.1440x1080.v20180328_newtopo_config.nc" !
CHL_FILE = "seawifs-clim-1997-2010.1440x1080.v20180328.nc" !
! CHL_FILE is the file containing chl_a concentrations in the variable CHL_A. It
! is used when VAR_PEN_SW and CHL_FROM_FILE are true.
CHL_VARNAME = "chlor_a" ! default = "CHL_A"
Expand Down
30 changes: 28 additions & 2 deletions MOM6_GEOSPlug/mom6_app/1440x1080/MOM_override
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
! Blank file in which we can put "overrides" for parameters

LAYOUT = 36, 30
#override DT = 450.0
#override DT_THERM = 450.
#override DT = 450
#override DT_THERM = 450
HFREEZE = 2.0

! Disable checksums
Expand Down Expand Up @@ -49,8 +49,34 @@ RESTART_CHECKSUMS_REQUIRED = False
#override BBL_THICK_MIN = 10.
#override BBL_EFFIC = 0.01
#override PRESSURE_DEPENDENT_FRAZIL = False
#override USE_RIGID_SEA_ICE = False
!
! update answers

! Overrides to match results from previous MOM6 version
! See https://github.com/GEOS-ESM/MOM6/releases/tag/geos%2Fv3.2
! and https://github.com/mom-ocean/MOM6/pull/1631#issuecomment-2252914251

!!#override USE_HUYNH_STENCIL_BUG = True
!!#override EPBL_ANSWER_DATE = 20231231
!!#override TEMP_SALT_Z_INIT_FILE = "WOA05_ptemp_salt_annual.v20141007.nc"

!! New Ocean Bathymetry (OM4)

#override TIDEAMP_FILE = "tidal_amplitude.v20140616.nc"
#override GEOTHERMAL_FILE = "geothermal_davies2013_v1.nc"
#override CHL_FILE = "seawifs-clim-1997-2010.1440x1080.v20180328.nc"

!! Updates for MLD !! SK

#override FOX_KEMPER_ML_RESTRAT_COEF = 1.0
#override MLE_FRONT_LENGTH = 500.0
#override MLE%USE_BODNER23 = True
#override MLE%CR = 0.038
#override MLE%BLD_DECAYING_TFILTER = 8.64E+04
#override MLE%MLD_DECAYING_TFILTER = 2.592E+06



! see https://github.com/GEOS-ESM/MOM6/issues/15
#override MEKE_POSITIVE = True
Loading