@@ -55,6 +55,9 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc)
55
55
character (len= CS) :: fldname
56
56
character (len= CS), allocatable :: flds(:), oflds(:), aflds(:), iflds(:)
57
57
character (len=* ) , parameter :: subname= ' (esmFldsExchange_ufs)'
58
+
59
+ ! component name
60
+ character (len= CS) :: lnd_name = ' '
58
61
!- -------------------------------------
59
62
60
63
rc = ESMF_SUCCESS
@@ -76,6 +79,13 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc)
76
79
write (msgString,' (A,i6,A)' ) trim (subname)// ' : maptype is ' ,maptype,' , ' // mapnames(maptype)
77
80
call ESMF_LogWrite(trim (msgString), ESMF_LOGMSG_INFO)
78
81
82
+ ! determine which land model is present
83
+ if (is_local% wrap% comp_present(complnd)) then
84
+ call NUOPC_CompAttributeGet(gcomp, name= " LND_model" , value= cvalue, rc= rc)
85
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
86
+ lnd_name = trim (cvalue)
87
+ end if
88
+
79
89
if (trim (coupling_mode) == ' ufs.nfrac.aoflux' .or. trim (coupling_mode) == ' ufs.frac.aoflux' ) then
80
90
med_aoflux_to_ocn = .true.
81
91
else
@@ -773,6 +783,28 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc)
773
783
end do
774
784
deallocate (flds)
775
785
786
+
787
+ if (lnd_name == ' lm4' ) then
788
+ allocate (flds(4 ))
789
+ flds = (/ ' Faxa_swndr' , ' Faxa_swndf' , ' Faxa_swvdr' , ' Faxa_swvdf' / )
790
+ do n = 1 ,size (flds)
791
+ fldname = trim (flds(n))
792
+ if (phase == ' advertise' ) then
793
+ if (is_local% wrap% comp_present(compatm) .and. is_local% wrap% comp_present(complnd)) then
794
+ call addfld_from(compatm , fldname)
795
+ call addfld_to(complnd , fldname)
796
+ end if
797
+ else
798
+ if ( fldchk(is_local% wrap% FBexp(complnd) , fldname, rc= rc) .and. &
799
+ fldchk(is_local% wrap% FBImp(compatm,compatm), fldname, rc= rc)) then
800
+ call addmap_from(compatm, fldname, complnd, maptype, ' one' , ' unset' )
801
+ call addmrg_to(complnd, fldname, mrg_from= compatm, mrg_fld= fldname, mrg_type= ' copy' )
802
+ end if
803
+ end if
804
+ end do
805
+ deallocate (flds)
806
+ end if ! lm4
807
+
776
808
end subroutine esmFldsExchange_ufs
777
809
778
810
end module esmFldsExchange_ufs_mod
0 commit comments