diff --git a/drivers/cpl/nuopc/glc_comp_nuopc.F90 b/drivers/cpl/nuopc/glc_comp_nuopc.F90 index c3f6f9d1..60530e9b 100644 --- a/drivers/cpl/nuopc/glc_comp_nuopc.F90 +++ b/drivers/cpl/nuopc/glc_comp_nuopc.F90 @@ -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 @@ -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 diff --git a/drivers/cpl/nuopc/glc_import_export.F90 b/drivers/cpl/nuopc/glc_import_export.F90 index fe9e2db3..c4c0ee81 100644 --- a/drivers/cpl/nuopc/glc_import_export.F90 +++ b/drivers/cpl/nuopc/glc_import_export.F90 @@ -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 @@ -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)