Skip to content

Commit

Permalink
Update mom_cap.F90 and mom_cap_methods.F90 to use case_name.
Browse files Browse the repository at this point in the history
  • Loading branch information
binli2337 committed Jan 23, 2025
1 parent 7609ae3 commit 585dcad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions config_src/drivers/nuopc_cap/mom_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1758,8 +1758,10 @@ subroutine ModelAdvance(gcomp, rc)
!---------------
! Import data
!---------------
call NUOPC_CompAttributeGet(gcomp, name='case_name', value=casename, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

call mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary, rc=rc)
call mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary, casename, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

!---------------
Expand Down Expand Up @@ -1831,8 +1833,6 @@ subroutine ModelAdvance(gcomp, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

if (cesm_coupled) then
call NUOPC_CompAttributeGet(gcomp, name='case_name', value=casename, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call ESMF_GridCompGet(gcomp, vm=vm, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call ESMF_VMGet(vm, localPet=localPet, rc=rc)
Expand Down
5 changes: 3 additions & 2 deletions config_src/drivers/nuopc_cap/mom_cap_methods.F90
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ end subroutine mom_set_geomtype
!> This function has a few purposes:
!! (1) it imports surface fluxes using data from the mediator; and
!! (2) it can apply restoring in SST and SSS.
subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary, rc)
subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary, casename, rc)
type(ocean_public_type) , intent(in) :: ocean_public !< Ocean surface state
type(ocean_grid_type) , intent(in) :: ocean_grid !< Ocean model grid
character(ESMF_MAXSTR) , intent(in) :: casename !< Case name for the experiment
type(ESMF_State) , intent(inout) :: importState !< incoming data from mediator
type(ice_ocean_boundary_type) , intent(inout) :: ice_ocean_boundary !< Ocean boundary forcing
integer , intent(inout) :: rc !< Return code
Expand Down Expand Up @@ -352,7 +353,7 @@ subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary,
ig = i + ocean_grid%isc - isc
!rotate
do ib = 1, nsc
if(abs(stkx(i,j,ib)-fillValue) <= 0.01) then
if( (trim(casename) == "ufs.hafs") .and. (abs(stkx(i,j,ib)-fillValue) <= 0.01) ) then
ice_ocean_boundary%ustkb(i,j,ib) = 0.0
ice_ocean_boundary%vstkb(i,j,ib) = 0.0
else
Expand Down

0 comments on commit 585dcad

Please sign in to comment.