Skip to content
Open
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
39 changes: 33 additions & 6 deletions GEOS_OceanGridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module GEOS_OceanGridCompMod
integer :: OCN
integer :: OCNd
logical :: DUAL_OCEAN
logical :: DO_DATA_ATM4OCN

contains

Expand Down Expand Up @@ -101,6 +102,8 @@ subroutine SetServices ( GC, RC )
call MAPL_GetResource (MAPL, DO_DATASEA, Label="USE_DATASEA:" , DEFAULT=1, _RC)
call MAPL_GetResource (MAPL, OrphanDepth, Label="OGCM_TOP_LAYER:" , DEFAULT=10.0, _RC)

call MAPL_GetResource (MAPL, DO_DATA_ATM4OCN, Label="USE_DATA_ATM4OCN:", DEFAULT=.FALSE., _RC)

if(DO_DATASEA/=0) then
OCEAN_NAME="DATASEA"
OCN = MAPL_AddChild(GC, NAME=OCEAN_NAME, SS=DataSeaSetServices, _RC)
Expand Down Expand Up @@ -188,11 +191,11 @@ subroutine SetServices ( GC, RC )

if(DO_DATASEA==0) then
call MAPL_TerminateImport ( GC, SHORT_NAME= &
[character(len=9) :: 'TAUX ','TAUY ', &
'PENUVR','PENPAR','PENUVF','PENPAF', 'DRNIR', 'DFNIR', &
'DISCHARGE', 'LWFLX', 'SHFLX', 'QFLUX', 'RAIN', 'SNOW', &
'SFLX','SWHEAT'], & ! do not terminate import of PEN_OCN since it is not used in the `plug'
CHILD=OCN, _RC)
[character(len=9) :: 'TAUX ','TAUY ', &
'PENUVR','PENPAR','PENUVF','PENPAF', 'DRNIR', 'DFNIR', &
'DISCHARGE','CALVING','LWFLX', 'SHFLX', 'QFLUX', 'RAIN', 'SNOW', &
'SFLX','SWHEAT'], & ! do not terminate import of PEN_OCN since it is not used in the `plug'
CHILD=OCN, _RC)
end if

! Set the Initialize, Run, Finalize entry points
Expand Down Expand Up @@ -421,6 +424,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
real, pointer :: DFNIRi(:,:)
real, pointer :: HEATi(:,:,:)
real, pointer :: DISCHARGEi(:,:)
real, pointer :: CALVINGi(:,:)
real, pointer :: LWFLXi(:,:)
real, pointer :: SHFLXi(:,:)
real, pointer :: QFLUXi(:,:)
Expand All @@ -446,6 +450,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
real, pointer :: HEATe (:,:,:)
real, pointer :: FROCEANe (:,:)
real, pointer :: DISCHARGEe(:,:)
real, pointer :: CALVINGe(:,:)
real, pointer :: LWFLXe(:,:)
real, pointer :: SWFLXe(:,:)
real, pointer :: SHFLXe(:,:)
Expand All @@ -467,6 +472,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
real, pointer :: DFNIR(:,:)
real, pointer :: HEAT(:,:,:)
real, pointer :: DISCHARGE(:,:)
real, pointer :: CALVING(:,:)
real, pointer :: LWFLX(:,:)
real, pointer :: SHFLX(:,:)
real, pointer :: QFLUX(:,:)
Expand Down Expand Up @@ -620,6 +626,10 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
call MAPL_GetPointer(IMPORT, FRESH, 'FRESH' , _RC)
call MAPL_GetPointer(IMPORT, FSALT, 'FSALT' , _RC)

if(DO_DATA_ATM4OCN) then
call MAPL_GetPointer(IMPORT, CALVINGi, 'CALVING', _RC)
endif

! Get pointers from ImExState
!----------------------------
if(DO_DATASEA==0) then
Expand All @@ -633,6 +643,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
call MAPL_GetPointer(GIM(OCN), DFNIR, 'DFNIR' , _RC)
call MAPL_GetPointer(GIM(OCN), HEAT, 'SWHEAT', _RC)
call MAPL_GetPointer(GIM(OCN), DISCHARGE, 'DISCHARGE', _RC)
call MAPL_GetPointer(GIM(OCN), CALVING, 'CALVING', _RC)
call MAPL_GetPointer(GIM(OCN), LWFLX, 'LWFLX' , _RC)
call MAPL_GetPointer(GIM(OCN), SHFLX, 'SHFLX' , _RC)
call MAPL_GetPointer(GIM(OCN), QFLUX, 'QFLUX' , _RC)
Expand Down Expand Up @@ -681,6 +692,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
call MAPL_GetPointer(EXPORT, TAUYe, 'TAUY' , _RC)
call MAPL_GetPointer(EXPORT, HEATe, 'SWHEAT' , _RC)
call MAPL_GetPointer(EXPORT, DISCHARGEe, 'DISCHARGE', _RC)
call MAPL_GetPointer(EXPORT, CALVINGe, 'CALVING', _RC)
call MAPL_GetPointer(EXPORT, LWFLXe, 'LWFLX' , _RC)
call MAPL_GetPointer(EXPORT, SWFLXe, 'SWFLX' , _RC)
call MAPL_GetPointer(EXPORT, SHFLXe, 'SHFLX' , _RC)
Expand All @@ -690,6 +702,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
call MAPL_GetPointer(EXPORT, SFLXe, 'SFLX' , _RC)
call MAPL_GetPointer(EXPORT, PEN_OCNe, 'PEN_OCN', _RC)


if(associated(FROCEANe)) FROCEANe = FROCEAN

! Allocate space for temporary arrays
Expand Down Expand Up @@ -720,7 +733,20 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
PENPAF = PENPAFi * WGHT
DRNIR = DRNIRi * WGHT
DFNIR = DFNIRi * WGHT
DISCHARGE = DISCHARGEi * WGHT
if(DO_DATA_ATM4OCN) then
DISCHARGE = DISCHARGEi
CALVING = CALVINGi
! may not be needed
where(DISCHARGE < 0.0)
DISCHARGE = 0.0
endwhere
where(CALVING < 0.0)
CALVING = 0.0
endwhere
else
DISCHARGE = DISCHARGEi * WGHT
CALVING = 0.0
endif
LWFLX = LWFLXi * WGHT
QFLUX = QFLUXi * WGHT
SHFLX = (SHFLXi-FHOCN) * WGHT
Expand Down Expand Up @@ -753,6 +779,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
if (associated(TAUXe)) TAUXe = TAUX
if (associated(TAUYe)) TAUYe = TAUY
if (associated(DISCHARGEe)) DISCHARGEe = DISCHARGE
if (associated(CALVINGe)) CALVINGe = CALVING
if (associated(LWFLXe)) LWFLXe = LWFLX
if (associated(SWFLXe)) SWFLXe = PENUVR+PENPAR+PENUVF+PENPAF+DRNIR+DFNIR
if (associated(SHFLXe)) SHFLXe = SHFLX
Expand Down
2 changes: 2 additions & 0 deletions GEOS_Ocean_StateSpecs.rc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ DRNIR | W m-2 | xy | N |
DFNIR | W m-2 | xy | N | | | net_surface_downwelling_nir_diffuse_flux
SWHEAT | W m-2 | xyz | C | | | solar_heating_rate
DISCHARGE | kg m-2 s-1 | xy | N | | | river_discharge_at_ocean_points
CALVING | kg m-2 s-1 | xy | N | DO_DATA_ATM4OCN | | ice_calving_at_ocean_points_from_datm
TR | 1 | xyz | C | trim(OCEAN_NAME) == 'MOM' | MAPL_BundleItem | tracer_mixing_ratios
TRFLUX | X | xy | N | trim(OCEAN_NAME) == 'MOM' | MAPL_BundleItem | surface_fluxes_of_tracers
LWFLX | W m-2 | xy | N | | | surface_net_downward_longwave_flux
Expand Down Expand Up @@ -53,6 +54,7 @@ TAUY | N m-2 | xy | N |
SWHEAT | W m-2 | xyz | C | | solar_heating_rate
RFLUX | W m-2 | xy | N | | downward_radiative_heat_flux_at_ocean_bottom
DISCHARGE | kg m-2 s-1 | xy | N | | river_discharge_at_ocean_points
CALVING | kg m-2 s-1 | xy | N | | ice_calving_at_ocean_points
FROCEAN | 1 | xy | N | | fraction_of_gridbox_covered_by_ocean
LWFLX | W m-2 | xy | N | | surface_net_downward_longwave_flux
SWFLX | W m-2 | xy | N | | surface_net_downward_shortwave_flux
Expand Down
3 changes: 3 additions & 0 deletions MOM6_GEOSPlug/MOM6_GEOSPlug.F90
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
REAL_, pointer :: DRNIR(:,:) => null()
REAL_, pointer :: DFNIR(:,:) => null()
REAL_, pointer :: DISCHARGE(:,:) => null()
REAL_, pointer :: CALVING(:,:) => null()
REAL_, pointer :: AICE(:,:) => null()
REAL_, pointer :: TAUXBOT(:,:) => null()
REAL_, pointer :: TAUYBOT(:,:) => null()
Expand Down Expand Up @@ -692,6 +693,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
call MAPL_GetPointer(IMPORT, DRNIR, 'DRNIR' , _RC)
call MAPL_GetPointer(IMPORT, DFNIR, 'DFNIR' , _RC)
call MAPL_GetPointer(IMPORT, DISCHARGE,'DISCHARGE', _RC)
call MAPL_GetPointer(IMPORT, CALVING, 'CALVING', _RC)
call MAPL_GetPointer(IMPORT, AICE, 'AICE', _RC)
call MAPL_GetPointer(IMPORT, TAUXBOT, 'TAUXBOT', _RC)
call MAPL_GetPointer(IMPORT, TAUYBOT, 'TAUYBOT', _RC)
Expand Down Expand Up @@ -745,6 +747,7 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
Boundary%fprec (isc:iec,jsc:jec)= real(SNOW, kind=KIND(Boundary%p)) ! Frozen precipitation: both positive down
Boundary%salt_flux (isc:iec,jsc:jec)=-real(SFLX, kind=KIND(Boundary%p)) ! Salt flux: MOM positive up, GEOS positive down
Boundary%runoff (isc:iec,jsc:jec)= real(DISCHARGE, kind=KIND(Boundary%p)) ! mass flux of liquid runoff [kg m-2 s-1]
Boundary%calving (isc:iec,jsc:jec)= real(CALVING, kind=KIND(Boundary%p)) ! mass flux of solid runoff [kg m-2 s-1]

! All shortwave components are positive down in MOM and in GEOS
!--------------------------------------------------------------
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 @@ -25,6 +25,7 @@ PENPAF | W m-2 | xy | N | net_downward_penetrating_diffuse_PAR_
DRNIR | W m-2 | xy | N | net_surface_downwelling_nir_beam_flux
DFNIR | W m-2 | xy | N | net_surface_downwelling_nir_diffuse_flux
DISCHARGE | kg m-2 s-1 | xy | N | river_discharge_at_ocean_points
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
Expand Down
Loading