Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/yury/s2s3 merge #293

Merged
merged 14 commits into from
Jun 12, 2020
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
2 changes: 1 addition & 1 deletion Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protocol = git
required = True
repo_url = git@github.com:GEOS-ESM/MOM5.git
local_path = ./GEOSogcm_GridComp/GEOSocean_GridComp/GuestOcean_GridComp/MOM_GEOS5PlugMod/@mom
tag = geos/v1.0.1
tag = geos/v1.0.2
protocol = git

[externals_description]
Expand Down
5 changes: 5 additions & 0 deletions GEOS_GcmGridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,11 @@ subroutine Initialize ( GC, IMPORT, EXPORT, CLOCK, RC )
call MAPL_AddRecord(CMAPL, ALARMS, (/MAPL_Write2Ram/), rc=status)
VERIFY_(STATUS)

call MAPL_GetObjectFromGC ( GCS(OGCM), CMAPL, RC=STATUS)
VERIFY_(STATUS)
call MAPL_AddRecord(CMAPL, ALARMS, (/MAPL_Write2Ram/), rc=status)
VERIFY_(STATUS)

GCM_INTERNAL_STATE%replayStartAlarm = replayStartAlarm
GCM_INTERNAL_STATE%replayStopAlarm = replayStopAlarm
GCM_INTERNAL_STATE%replayCycleAlarm = replayCycleAlarm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2475,6 +2475,15 @@ subroutine SetServices ( GC, RC )
RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddExportSpec(GC, &
LONG_NAME = 'foundation_salinity_for_interface_layer', &
UNITS = 'PSU', &
SHORT_NAME = 'SS_FOUND', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddExportSpec(GC, &
LONG_NAME = 'net_heating_in_warm_layer', &
UNITS = 'W m-2', &
Expand Down Expand Up @@ -4918,6 +4927,7 @@ subroutine RUN2 ( GC, IMPORT, EXPORT, CLOCK, RC )
real, pointer, dimension(:,:) :: BCOOL => NULL()
real, pointer, dimension(:,:) :: TDEL => NULL()
real, pointer, dimension(:,:) :: TS_FOUND => NULL()
real, pointer, dimension(:,:) :: SS_FOUND => NULL()
real, pointer, dimension(:,:) :: QWARM => NULL()
real, pointer, dimension(:,:) :: SWWARM => NULL()
real, pointer, dimension(:,:) :: LANGM => NULL()
Expand Down Expand Up @@ -5188,6 +5198,7 @@ subroutine RUN2 ( GC, IMPORT, EXPORT, CLOCK, RC )
real, pointer, dimension(:) :: BCOOL_TILE => NULL()
real, pointer, dimension(:) :: TDEL_TILE => NULL()
real, pointer, dimension(:) :: TS_FOUND_TILE => NULL()
real, pointer, dimension(:) :: SS_FOUND_TILE => NULL()
real, pointer, dimension(:) :: QWARM_TILE => NULL()
real, pointer, dimension(:) :: SWWARM_TILE => NULL()
real, pointer, dimension(:) :: LANGM_TILE => NULL()
Expand Down Expand Up @@ -5954,6 +5965,7 @@ subroutine RUN2 ( GC, IMPORT, EXPORT, CLOCK, RC )
call MAPL_GetPointer(EXPORT , BCOOL , 'BCOOL' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT , TDEL , 'TDEL' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT , TS_FOUND, 'TS_FOUND', RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT , SS_FOUND, 'SS_FOUND', RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT , QWARM , 'QWARM' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT , SWWARM , 'SWWARM' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(EXPORT , LANGM , 'LANGM' , RC=STATUS); VERIFY_(STATUS)
Expand Down Expand Up @@ -6579,6 +6591,7 @@ subroutine RUN2 ( GC, IMPORT, EXPORT, CLOCK, RC )
call MKTILE(BCOOL, BCOOL_TILE , NT, RC=STATUS); VERIFY_(STATUS)
call MKTILE(TDEL, TDEL_TILE , NT, RC=STATUS); VERIFY_(STATUS)
call MKTILE(TS_FOUND,TS_FOUND_TILE , NT, RC=STATUS); VERIFY_(STATUS)
call MKTILE(SS_FOUND,SS_FOUND_TILE , NT, RC=STATUS); VERIFY_(STATUS)
call MKTILE(QWARM, QWARM_TILE , NT, RC=STATUS); VERIFY_(STATUS)
call MKTILE(SWWARM, SWWARM_TILE , NT, RC=STATUS); VERIFY_(STATUS)
call MKTILE(LANGM, LANGM_TILE , NT, RC=STATUS); VERIFY_(STATUS)
Expand Down Expand Up @@ -7116,6 +7129,11 @@ subroutine RUN2 ( GC, IMPORT, EXPORT, CLOCK, RC )
VERIFY_(STATUS)
endif

if(associated( SS_FOUND)) then
call MAPL_LocStreamTransform( LOCSTREAM, SS_FOUND, SS_FOUND_TILE, RC=STATUS)
VERIFY_(STATUS)
endif

if(associated( QWARM)) then
call MAPL_LocStreamTransform( LOCSTREAM, QWARM, QWARM_TILE, RC=STATUS)
VERIFY_(STATUS)
Expand Down Expand Up @@ -7912,6 +7930,7 @@ subroutine RUN2 ( GC, IMPORT, EXPORT, CLOCK, RC )
if(associated(BCOOL_TILE )) deallocate(BCOOL_TILE )
if(associated(TDEL_TILE )) deallocate(TDEL_TILE )
if(associated(TS_FOUND_TILE )) deallocate(TS_FOUND_TILE )
if(associated(SS_FOUND_TILE )) deallocate(SS_FOUND_TILE )
if(associated(QWARM_TILE )) deallocate(QWARM_TILE )
if(associated(SWWARM_TILE )) deallocate(SWWARM_TILE )
if(associated(LANGM_TILE )) deallocate(LANGM_TILE )
Expand Down Expand Up @@ -9149,6 +9168,11 @@ subroutine DOTYPE(type,RC)
VERIFY_(STATUS)
end if

if(associated(SS_FOUND_TILE)) then
call FILLOUT_TILE(GEX(type), 'SS_FOUND', SS_FOUND_TILE, XFORM, RC=STATUS)
VERIFY_(STATUS)
end if

if(associated(QWARM_TILE)) then
call FILLOUT_TILE(GEX(type), 'QWARM', QWARM_TILE, XFORM, RC=STATUS)
VERIFY_(STATUS)
Expand Down
10 changes: 10 additions & 0 deletions GEOSogcm_GridComp/GEOS_OgcmGridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,16 @@ subroutine SetServices ( GC, RC )
SRC_ID = SEAICE, &
RC=STATUS )
VERIFY_(STATUS)

if(DUAL_OCEAN) then
call MAPL_AddConnectivity ( GC, &
SRC_NAME = (/'FRACICE'/), &
DST_NAME = (/'FRACICEd'/), &
DST_ID = OCEAN, &
SRC_ID = SEAICEd, &
RC=STATUS )
VERIFY_(STATUS)
endif

if(DO_DATASEAONLY==0) then
call MAPL_AddConnectivity ( GC, &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ subroutine SetServices ( GC, RC )
SHORT_NAME = 'PENUVR', &
LONG_NAME = 'net_downward_penetrating_direct_UV_flux', &
UNITS = 'W m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=status )
VERIFY_(status)
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'PENPAR', &
Expand Down Expand Up @@ -332,9 +332,20 @@ subroutine SetServices ( GC, RC )
UNITS = 'W m-2', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
RC=STATUS )
VERIFY_(STATUS)

if (dual_ocean) then
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'FRACICEd', &
LONG_NAME = 'fractional_cover_of_seaice', &
UNITS = '1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
endif

! ! Need to have this internal state to fill in orphan points:

call MAPL_AddInternalSpec(GC, &
Expand Down Expand Up @@ -491,19 +502,19 @@ subroutine SetServices ( GC, RC )
SHORT_NAME = 'RAIN', &
LONG_NAME = 'ocean_rainfall',&
UNITS = 'kg m-2 s-1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=status )
VERIFY_(status)
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddExportSpec(GC, &
SHORT_NAME = 'SNOW', &
LONG_NAME = 'ocean_snowfall',&
UNITS = 'kg m-2 s-1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)

! Exports of child

Expand Down Expand Up @@ -911,6 +922,7 @@ subroutine Run ( gc, import, export, clock, rc )
real, pointer :: SNOW(:,:)
real, pointer :: SFLX(:,:)
real, pointer :: FI(:,:)
real, pointer :: FId(:,:)

! Pointers to exports of child

Expand All @@ -932,6 +944,7 @@ subroutine Run ( gc, import, export, clock, rc )
integer :: NUM
real, allocatable :: WGHT(:,:)
real :: DT, TAU_SST
real :: TAU_SST_UNDER_ICE
real, pointer :: LONS (:,:)
real, pointer :: LATS (:,:)
real, parameter :: OrphanSalinity=34.0
Expand Down Expand Up @@ -1090,6 +1103,7 @@ subroutine Run ( gc, import, export, clock, rc )

if (dual_ocean) then
call MAPL_GetPointer(GEX(OCNd), TWd, 'TW' , alloc=.true., RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(IMPORT, FId, 'FRACICEd' , RC=STATUS); VERIFY_(STATUS)
end if

if(DO_DATASEA==0) then
Expand Down Expand Up @@ -1153,7 +1167,7 @@ subroutine Run ( gc, import, export, clock, rc )
SFLX = FSALT * WGHT

! This stress forces the ocean, combined with sea ice bottom stress later

!------------------------------------------------------------------------
TAUX = TAUXi * WGHT
TAUY = TAUYi * WGHT

Expand Down Expand Up @@ -1232,7 +1246,10 @@ subroutine Run ( gc, import, export, clock, rc )
call MAPL_GetPointer(GIM(OCNd), FI , 'FRACICE' , RC=STATUS)
VERIFY_(STATUS)

call MAPL_GetResource(STATE,TAU_SST, Label="TAU_SST:", default=86400.0 ,RC=STATUS)
call MAPL_GetResource(STATE,TAU_SST, Label="TAU_SST:", default=432000.0 ,RC=STATUS)
VERIFY_(status)

call MAPL_GetResource(STATE,TAU_SST_UNDER_ICE, Label="TAU_SST_UNDER_ICE:", default=86400.0 ,RC=STATUS)
VERIFY_(status)

! we should have valid pointers to TW and TWd by now
Expand All @@ -1245,6 +1262,14 @@ subroutine Run ( gc, import, export, clock, rc )

end where

where(MASK > 0.0 .and. FI >= 0.05 .and. FId > FI)
! 0.054 (C/psu) is the ratio between the freezing temperature and salinity of brine.
! -0.054*SW gives salinity dependent freezing temperature
! ideally this const should be from the ocean model, but doing so is difficult here
DEL_TEMP = ((-0.054*SW+MAPL_TICE) - TW)*DT/(DT+TAU_SST_UNDER_ICE)

end where

! put it back to MOM
call ESMF_GridCompRun( GCS(OCN), importState=GIM(OCN), &
exportState=GEX(OCN), clock=CLOCK, phase=2, userRC=STATUS )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ module MOM_GEOS5PlugMod
use ocean_model_mod, only: ocean_model_data_get
use ocean_model_mod, only: mom4_get_latlon_UVsurf, mom4_get_UVsurfB
use ocean_model_mod, only: mom4_get_thickness, mom4_get_tsurf, mom4_get_ssurf
use ocean_model_mod, only: mom4_get_pointers_to_variables, mom4_get_streamfunction
use ocean_model_mod, only: mom4_get_pointers_to_variables, mom4_get_streamfunction, mom4_get_mld
use ocean_model_mod, only: mom4_get_prog_tracer_index, mom4_put_prog_tracer, mom4_get_prog_tracer
use ocean_model_mod, only: mom4_get_diag_tracer_index, mom4_get_diag_tracer
use ocean_model_mod, only: mom4_get_temperature_index, mom4_get_salinity_index, &
mom4_get_uv, mom4_get_latlon_uv, mom4_get_density
use ocean_model_mod, only: mom4_get_3D_tmask, mom4_set_swheat, mom4_set_swheat_fr
use ocean_vert_kpp_mom4p1_mod, only: mom4_get_hblt

! This was added for a to b; Balaji was reluctant to expose ice_grid_mod.

use mpp_parameter_mod, only: AGRID, SCALAR_PAIR
Expand Down Expand Up @@ -1042,7 +1042,7 @@ subroutine Initialize ( GC, IMPORT, EXPORT, CLOCK, RC )
pbo = real(merge(tsource = 1.0e-04*tmp2, fsource = real(MAPL_UNDEF), mask = (mask(:, :, 1) > 0.0)),kind=G5KIND)
end if

call mom4_get_hblt(Tmp2)
tmp2=mom4_get_mld()
OMLDAMAX = real(merge(tsource = tmp2, fsource = real(MAPL_UNDEF), mask = (mask(:, :, 1) > 0.0)), kind=G5KIND)

deallocate(Tmp2)
Expand Down Expand Up @@ -1732,7 +1732,7 @@ subroutine Run ( gc, import, export, clock, rc )
end where
end if

call mom4_get_hblt(U)
U=mom4_get_mld()
if(HR==0 .and. MN==0 .and. SC==0) then
OMLDAMAX = real(U, kind = G5KIND)
else
Expand Down Expand Up @@ -2109,7 +2109,7 @@ subroutine Record ( gc, import, export, clock, rc )

call MAPL_TimerOn(MAPL,"TOTAL")

doRecord = MAPL_RecordAlarmIsRinging(MAPL, RC=status)
doRecord = MAPL_RecordAlarmIsRinging(MAPL, MODE=MAPL_Write2Disk, RC=status)
VERIFY_(STATUS)

if (doRecord) then
Expand Down