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

merge dev/emc #4

Merged
merged 1 commit into from
Dec 6, 2019
Merged
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
40 changes: 30 additions & 10 deletions config_src/nuopc_driver/mom_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ module MOM_cap_mod
integer :: export_slice = 1
character(len=256) :: tmpstr
logical :: write_diagnostics = .false.
logical :: overwrite_timeslice = .false.
character(len=32) :: runtype !< run type
integer :: logunit !< stdout logging unit number
logical :: profile_memory = .true.
Expand Down Expand Up @@ -278,6 +279,21 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc)
file=__FILE__)) &
return

overwrite_timeslice = .false.
call NUOPC_CompAttributeGet(gcomp, name="OverwriteSlice", value=value, &
isPresent=isPresent, isSet=isSet, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
return
if (isPresent .and. isSet) overwrite_timeslice=(trim(value)=="true")
write(logmsg,*) overwrite_timeslice
call ESMF_LogWrite('MOM_cap:OverwriteSlice = '//trim(logmsg), ESMF_LOGMSG_INFO, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
return

profile_memory = .false.
call NUOPC_CompAttributeGet(gcomp, name="ProfileMemory", value=value, &
isPresent=isPresent, isSet=isSet, rc=rc)
Expand Down Expand Up @@ -741,7 +757,13 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
file=__FILE__)) &
return ! bail out

if (len_trim(scalar_field_name) > 0) then
call fld_list_add(fldsToOcn_num, fldsToOcn, trim(scalar_field_name), "will_provide")
call fld_list_add(fldsFrOcn_num, fldsFrOcn, trim(scalar_field_name), "will_provide")
end if

if (cesm_coupled) then
!TODO: check if still needed
if (len_trim(scalar_field_name) > 0) then
call fld_list_add(fldsToOcn_num, fldsToOcn, trim(scalar_field_name), "will_provide")
call fld_list_add(fldsFrOcn_num, fldsFrOcn, trim(scalar_field_name), "will_provide")
Expand Down Expand Up @@ -1488,13 +1510,11 @@ subroutine DataInitialize(gcomp, rc)
ocean_state => ocean_internalstate%ptr%ocean_state_type_ptr
call get_ocean_grid(ocean_state, ocean_grid)

if (cesm_coupled) then
call mom_export(ocean_public, ocean_grid, ocean_state, exportState, clock, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
return ! bail out
endif
call mom_export(ocean_public, ocean_grid, ocean_state, exportState, clock, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
return ! bail out

call ESMF_StateGet(exportState, itemCount=fieldCount, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
Expand Down Expand Up @@ -1537,7 +1557,7 @@ subroutine DataInitialize(gcomp, rc)

if(write_diagnostics) then
call NUOPC_Write(exportState, fileNamePrefix='field_init_ocn_export_', &
timeslice=import_slice, relaxedFlag=.true., rc=rc)
overwrite=overwrite_timeslice,timeslice=import_slice, relaxedFlag=.true., rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
Expand Down Expand Up @@ -1691,7 +1711,7 @@ subroutine ModelAdvance(gcomp, rc)

if (write_diagnostics) then
call NUOPC_Write(importState, fileNamePrefix='field_ocn_import_', &
timeslice=import_slice, relaxedFlag=.true., rc=rc)
overwrite=overwrite_timeslice,timeslice=import_slice, relaxedFlag=.true., rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
Expand Down Expand Up @@ -1847,7 +1867,7 @@ subroutine ModelAdvance(gcomp, rc)

if (write_diagnostics) then
call NUOPC_Write(exportState, fileNamePrefix='field_ocn_export_', &
timeslice=export_slice, relaxedFlag=.true., rc=rc)
overwrite=overwrite_timeslice,timeslice=export_slice, relaxedFlag=.true., rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
Expand Down