Skip to content

Commit

Permalink
Merge pull request #86 from billsacks/cism_noevolve_med2glc
Browse files Browse the repository at this point in the history
Advertise import fields even with noevolve
  • Loading branch information
Katetc authored Apr 17, 2024
2 parents 67d61b2 + feaf293 commit 1e8ef7e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions drivers/cpl/nuopc/glc_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
! Set filenames which depend on instance information
call set_filenames()

! Determine if cism will evolve - if not will not import any fields from the mediator
! Determine if cism will evolve
call NUOPC_CompAttributeGet(gcomp, name="cism_evolve", value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (isPresent .and. isSet) then
Expand All @@ -214,7 +214,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
end if

! Advertise fields
call advertise_fields(gcomp, cism_evolve, num_icesheets_from_mediator, rc)
call advertise_fields(gcomp, num_icesheets_from_mediator, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

if (dbug > 5) then
Expand Down
42 changes: 21 additions & 21 deletions drivers/cpl/nuopc/glc_import_export.F90
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,12 @@ module glc_import_export
contains
!===============================================================================

subroutine advertise_fields(gcomp, cism_evolve, num_icesheets_in, rc)
subroutine advertise_fields(gcomp, num_icesheets_in, rc)

use glc_constants, only : glc_smb

! input/output variables
type(ESMF_GridComp) :: gcomp
logical , intent(in) :: cism_evolve
integer , intent(in) :: num_icesheets_in
integer , intent(out) :: rc

Expand Down Expand Up @@ -201,25 +200,26 @@ subroutine advertise_fields(gcomp, cism_evolve, num_icesheets_in, rc)
! Advertise import fields
!--------------------------------

if (cism_evolve) then
call fldlist_add(fldsToGlc_num, fldsToGlc, trim(flds_scalar_name))
call fldlist_add(fldsToGlc_num, fldsToGlc, field_in_tsrf)
call fldlist_add(fldsToGlc_num, fldsToGlc, field_in_qice)

! Now advertise import fields
do ns = 1,num_icesheets
do nf = 1,fldsToGlc_num
call NUOPC_Advertise(NStateImp(ns), standardName=fldsToGlc(nf)%stdname, &
TransferOfferGeomObject='will provide', rc=rc)
if (chkErr(rc,__LINE__,u_FILE_u)) return
if (my_task == master_task) then
write(cnum,'(i0)') ns
write(stdout,'(a)') 'Advertised import field: '//trim(fldsToGlc(nf)%stdname)//' for ice sheet '//trim(cnum)
end if
call ESMF_LogWrite(subname//'Import field'//': '//trim(fldsToGlc(nf)%stdname), ESMF_LOGMSG_INFO)
end do
enddo
end if
! Note that we advertise the import fields even if running with a non-evolving ice
! sheet; this is needed for the MED -> GLC mapping to work (which we do even for a
! non-evolving ice sheet).
call fldlist_add(fldsToGlc_num, fldsToGlc, trim(flds_scalar_name))
call fldlist_add(fldsToGlc_num, fldsToGlc, field_in_tsrf)
call fldlist_add(fldsToGlc_num, fldsToGlc, field_in_qice)

! Now advertise import fields
do ns = 1,num_icesheets
do nf = 1,fldsToGlc_num
call NUOPC_Advertise(NStateImp(ns), standardName=fldsToGlc(nf)%stdname, &
TransferOfferGeomObject='will provide', rc=rc)
if (chkErr(rc,__LINE__,u_FILE_u)) return
if (my_task == master_task) then
write(cnum,'(i0)') ns
write(stdout,'(a)') 'Advertised import field: '//trim(fldsToGlc(nf)%stdname)//' for ice sheet '//trim(cnum)
end if
call ESMF_LogWrite(subname//'Import field'//': '//trim(fldsToGlc(nf)%stdname), ESMF_LOGMSG_INFO)
end do
enddo

! Set glc_smb
! true => get surface mass balance from land model via coupler (in multiple elev classes)
Expand Down

0 comments on commit 1e8ef7e

Please sign in to comment.