Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5beead0
Update CMEPS (#58)
DeniseWorthen Oct 29, 2021
8b117b4
Update CMEPS (#60)
DeniseWorthen Dec 16, 2021
959c64e
Update CMEPS for wave slow loop coupling and provide hooks for S2SW c…
DeniseWorthen Feb 3, 2022
df272f1
Merge remote-tracking branch 'escomp/master' into feature/fixup_commi…
DeniseWorthen Feb 3, 2022
763405c
Update CMEPS; refactor esmFieldsExchange_nems and default_masks (#65)
DeniseWorthen May 2, 2022
424a086
Update CMEPS to its ESCOMP/master branch 20220607 commit (#67)
uturuncoglu Jun 9, 2022
94c5e8d
add bilnr_nstod mapping between ocn/ice/waves (#68)
DeniseWorthen Jun 22, 2022
f9f7541
Add field exchanges required by wave-ice coupling (#69)
DeniseWorthen Jul 27, 2022
aabe844
Update CMEPS to latest ESCOMP/master (#72)
DeniseWorthen Oct 28, 2022
56d71e4
Merge remote-tracking branch 'escomp/master' into feature/updcmeps
DeniseWorthen Nov 8, 2022
8763c77
fix unresolved merge conflict
DeniseWorthen Nov 8, 2022
01deceb
update CMEPS (#75)
DeniseWorthen Nov 16, 2022
70877f7
Merge remote-tracking branch 'origin/emc/develop' into feature/updcmeps
DeniseWorthen Nov 27, 2022
220a011
Merge remote-tracking branch 'remotes/escomp/master' into feature/upd…
DeniseWorthen Nov 27, 2022
7c76290
Merge remote-tracking branch 'JEdwards/LL_fldList' into feature/updcmeps
DeniseWorthen Nov 27, 2022
c6a597f
fix wave elevation spectrum for UFS
DeniseWorthen Nov 27, 2022
736bce6
Merge remote-tracking branch 'ESCOMP/LL_fldList' into feature/updcmeps
DeniseWorthen Nov 28, 2022
b5d91b8
Merge remote-tracking branch 'ESCOMP/LL_fldList' into feature/updcmeps
DeniseWorthen Nov 28, 2022
4abc4b3
Merge remote-tracking branch 'escomp/master' into feature/updcmeps
DeniseWorthen Dec 1, 2022
57b6c0e
fix compile error
DeniseWorthen Dec 1, 2022
28199a1
fix mapping for ocn-wav
DeniseWorthen Dec 1, 2022
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
22 changes: 11 additions & 11 deletions mediator/esmFlds.F90
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ subroutine med_fldList_AddMrg(flds, fldname, mrg_from, mrg_fld, mrg_type, mrg_fr
! ----------------------------------------------

newfld => med_fldList_GetFld(flds, fldname, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (chkerr(rc,__LINE__,u_FILE_u)) return
newfld%merge_fields(mrg_from) = mrg_fld
newfld%merge_types(mrg_from) = mrg_type
if (present(mrg_fracname)) then
Expand Down Expand Up @@ -346,7 +346,7 @@ end function med_fldList_GetFld

subroutine med_fldList_addmap_from(index, fldname, destcomp, maptype, mapnorm, mapfile)
integer, intent(in) :: index
character(len=*) , intent(in) :: fldname
character(len=*) , intent(in) :: fldname
integer , intent(in) :: destcomp
integer , intent(in) :: maptype
character(len=*) , intent(in) :: mapnorm
Expand All @@ -359,7 +359,7 @@ end subroutine med_fldList_addmap_from
!================================================================================

subroutine med_fldList_addmap_aoflux(fldname, destcomp, maptype, mapnorm, mapfile)
character(len=*) , intent(in) :: fldname
character(len=*) , intent(in) :: fldname
integer , intent(in) :: destcomp
integer , intent(in) :: maptype
character(len=*) , intent(in) :: mapnorm
Expand All @@ -372,7 +372,7 @@ end subroutine med_fldList_addmap_aoflux
!================================================================================

subroutine med_fldList_addmap_ocnalb(fldname, destcomp, maptype, mapnorm, mapfile)
character(len=*) , intent(in) :: fldname
character(len=*) , intent(in) :: fldname
integer , intent(in) :: destcomp
integer , intent(in) :: maptype
character(len=*) , intent(in) :: mapnorm
Expand All @@ -390,7 +390,7 @@ subroutine med_fldList_AddMap(fields, fldname, destcomp, maptype, mapnorm, mapfi

! intput/output variables
type(med_fldList_entry_type) , intent(in), target :: fields
character(len=*) , intent(in) :: fldname
character(len=*) , intent(in) :: fldname
integer , intent(in) :: destcomp
integer , intent(in) :: maptype
character(len=*) , intent(in) :: mapnorm
Expand All @@ -406,7 +406,7 @@ subroutine med_fldList_AddMap(fields, fldname, destcomp, maptype, mapnorm, mapfi
if (present(mapfile)) lmapfile = mapfile

newfld => med_fldList_GetFld(fields, fldname, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (chkerr(rc,__LINE__,u_FILE_u)) return
! Note - default values are already set for the fld entries - so only non-default
! values need to be set below
! If mapindex is mapfcopy - create a redistribution route handle
Expand Down Expand Up @@ -704,7 +704,7 @@ subroutine med_fld_GetFldInfo(newfld, compsrc, stdname, shortname, mapindex, map

! local variables
integer :: lrc
integer :: lcompsrc
integer :: lcompsrc
character(len=*), parameter :: subname='(med_fld_GetFldInfo)'
lrc = ESMF_SUCCESS

Expand Down Expand Up @@ -851,7 +851,7 @@ subroutine med_fldList_Document_Mapping(logunit, med_coupling_active)
mapindex = newfld%mapindex(ndst)
if ( mapindex /= mapunset) then
call med_fld_GetFldInfo(newfld, compsrc=ndst, stdname=fldname, mapnorm=mapnorm, mapfile=mapfile, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (chkerr(rc,__LINE__,u_FILE_u)) return

if (trim(mapnorm) == 'unset') then
cvalue = ' mapping '//trim(compname(nsrc))//'->'//trim(compname(ndst)) //' '//trim(fldname) // &
Expand Down Expand Up @@ -882,7 +882,7 @@ subroutine med_fldList_Document_Mapping(logunit, med_coupling_active)
call med_fld_GetFldInfo(newfld, compsrc=ndst, mapindex=mapindex, rc=rc)
if ( mapindex /= mapunset) then
call med_fld_GetFldInfo(newfld, stdname=fldname, compsrc=ndst, mapnorm=mapnorm, mapfile=mapfile, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (chkerr(rc,__LINE__,u_FILE_u)) return

if (trim(mapnorm) == 'unset') then
cvalue = ' mapping '//trim(compname(nsrc))//'->'//trim(compname(ndst)) //' '//trim(fldname) // &
Expand Down Expand Up @@ -946,7 +946,7 @@ subroutine med_fldList_Document_Merging(logunit, med_coupling_active)
newfld => fldListTo(ndst)%fields
do while(associated(newfld))
call med_fld_GetFldInfo(newfld, stdname=dst_field, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (chkerr(rc,__LINE__,u_FILE_u)) return

! Loop over all possible source components for destination component field
mrgstr = ' '
Expand All @@ -955,7 +955,7 @@ subroutine med_fldList_Document_Merging(logunit, med_coupling_active)
if (nsrc /= ndst .and. med_coupling_active(nsrc,ndst)) then
src_comp = compname(nsrc)
call med_fld_GetFldInfo(newfld, compsrc=nsrc, merge_fields=merge_field, merge_type=merge_type, merge_fracname=merge_frac, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (chkerr(rc,__LINE__,u_FILE_u)) return

if (merge_type == 'merge' .or. merge_type == 'sum_with_weights') then
string = trim(merge_frac)//'*'//trim(merge_field)//'('//trim(src_comp)//')'
Expand Down
50 changes: 35 additions & 15 deletions mediator/esmFldsExchange_nems_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc)
use esmFlds , only : addmap_from => med_fldList_addmap_from
use esmFlds , only : addfld_aoflux => med_fldList_addfld_aoflux
use esmFlds , only : addmap_aoflux => med_fldList_addmap_aoflux

use med_internalstate_mod , only : InternalState, mastertask, logunit

! input/output parameters:
Expand Down Expand Up @@ -576,7 +576,7 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc)
else
if ( fldchk(is_local%wrap%FBexp(compocn) , trim(fldname), rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav,compwav), trim(fldname), rc=rc)) then
call addmap_from(compwav, trim(fldname), compocn, mapfcopy, 'unset', 'unset')
call addmap_from(compwav, trim(fldname), compocn, mapbilnr_nstod, 'one', 'unset')
call addmrg_to(compocn, trim(fldname), mrg_from=compwav, mrg_fld=trim(fldname), mrg_type='copy')
end if
end if
Expand Down Expand Up @@ -671,6 +671,20 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc)
end do
deallocate(flds)

if (phase == 'advertise') then
if (is_local%wrap%comp_present(compice) .and. is_local%wrap%comp_present(compwav)) then
call addfld_from(compwav, 'Sw_elevation_spectrum')
call addfld_to(compice, 'Sw_elevation_spectrum')
end if
else
if ( fldchk(is_local%wrap%FBExp(compice) , 'Sw_elevation_spectrum', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compwav,compwav), 'Sw_elevation_spectrum', rc=rc)) then
call addmap_from(compwav, 'Sw_elevation_spectrum', compice, mapbilnr_nstod, 'one', 'unset')
call addmrg_to(compice, 'Sw_elevation_spectrum', mrg_from=compwav, &
mrg_fld='Sw_elevation_spectrum', mrg_type='copy')
end if
end if

!=====================================================================
! FIELDS TO WAV (compwav)
!=====================================================================
Expand All @@ -695,19 +709,25 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc)
end do
deallocate(flds)

! to wav: sea ice fraction
if (phase == 'advertise') then
if (is_local%wrap%comp_present(compice) .and. is_local%wrap%comp_present(compwav)) then
call addfld_from(compice, 'Si_ifrac')
call addfld_to(compwav, 'Si_ifrac')
! to wav: sea ice fraction, thickness and floe diameter
allocate(flds(3))
flds = (/'Si_ifrac ', 'Si_floediam', 'Si_thick '/)
do n = 1,size(flds)
fldname = trim(flds(n))
if (phase == 'advertise') then
if (is_local%wrap%comp_present(compice) .and. is_local%wrap%comp_present(compwav)) then
call addfld_from(compice, trim(fldname))
call addfld_to(compwav, trim(fldname))
end if
else
if ( fldchk(is_local%wrap%FBexp(compwav) , 'Si_ifrac', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compice,compice), 'Si_ifrac', rc=rc)) then
call addmap_from(compice, 'Si_ifrac', compwav, mapfcopy , 'unset', 'unset')
call addmrg_to(compwav, 'Si_ifrac', mrg_from=compice, mrg_fld='Si_ifrac', mrg_type='copy')
else
if ( fldchk(is_local%wrap%FBexp(compwav) , trim(fldname), rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compice,compice), trim(fldname), rc=rc)) then
call addmap_from(compice, trim(fldname), compwav, mapbilnr_nstod , 'one', 'unset')
call addmrg_to(compwav, trim(fldname), mrg_from=compice, mrg_fld=trim(fldname), mrg_type='copy')
end if
end if
end if
end do
deallocate(flds)

! to wav: zonal sea water velocity from ocn
! to wav: meridional sea water velocity from ocn
Expand All @@ -724,7 +744,7 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc)
else
if ( fldchk(is_local%wrap%FBexp(compwav) , trim(fldname), rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compocn,compocn), trim(fldname), rc=rc)) then
call addmap_from(compocn, trim(fldname), compwav, mapfcopy , 'unset', 'unset')
call addmap_from(compocn, trim(fldname), compwav, mapbilnr_nstod , 'one', 'unset')
call addmrg_to(compwav, trim(fldname), mrg_from=compocn, mrg_fld=trim(fldname), mrg_type='copy')
end if
end if
Expand All @@ -741,7 +761,7 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc)
flds = (/'Sa_z ', 'Sa_topo ', 'Sa_tbot ', 'Sa_pbot ', &
'Sa_shum ', 'Sa_u ', 'Sa_v ', 'Faxa_lwdn ', &
'Sa_ptem ', 'Sa_dens ', 'Faxa_swdn ', 'Sa_pslv ', &
'Faxa_snowc', 'Faxa_snowl', 'Faxa_rainc', 'Faxa_rainl', &
'Faxa_snowc', 'Faxa_snowl', 'Faxa_rainc', 'Faxa_rainl', &
'Faxa_swndr', 'Faxa_swndf', 'Faxa_swvdr', 'Faxa_swvdf', &
'Faxa_swnet'/)
else
Expand Down
8 changes: 4 additions & 4 deletions mediator/med_map_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,10 @@ subroutine med_map_routehandles_initfrom_field(n1, n2, fldsrc, flddst, mapindex,
call ESMF_LogWrite(trim(string), ESMF_LOGMSG_INFO)

polemethod=ESMF_POLEMETHOD_ALLAVG
if (trim(coupling_mode) == 'cesm') then
if (n1 == compwav .or. n2 == compwav) then
polemethod = ESMF_POLEMETHOD_NONE ! todo: remove this when ESMF tripolar mapping fix is in place.
endif
if (trim(coupling_mode) == 'cesm' .or. trim(coupling_mode(1:4)) == 'nems') then
if (n1 == compwav .or. n2 == compwav) then
polemethod = ESMF_POLEMETHOD_NONE ! todo: remove this when ESMF tripolar mapping fix is in place.
endif
end if

! Create route handle
Expand Down
2 changes: 1 addition & 1 deletion mediator/med_phases_aofluxes_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ module med_phases_aofluxes_mod
integer :: lsize ! local size
integer , pointer :: mask (:) => null() ! integer ocn domain mask: 0 <=> inactive cell
real(R8) , pointer :: rmask (:) => null() ! real ocn domain mask: 0 <=> inactive cell
real(R8) , pointer :: garea (:) => null() ! atm grid area
real(R8) , pointer :: garea (:) => null() ! atm grid area
end type aoflux_in_type

type aoflux_out_type
Expand Down
2 changes: 1 addition & 1 deletion mediator/med_phases_post_atm_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module med_phases_post_atm_mod
! Mediator phase for post atm calculations, maps atm->ice, atm->lnd, atm->ocn
! and atm->wav
!-----------------------------------------------------------------------------

implicit none
private

Expand Down
4 changes: 2 additions & 2 deletions ufs/ccpp/data/MED_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@
[use_med_flux]
standard_name = do_mediator_atmosphere_ocean_fluxes
long_name = flag for using atmosphere-ocean fluxes form mediator (default false)
units = flag
units = flag
dimensions = ()
type = logical
[ivegsrc]
Expand Down Expand Up @@ -1234,7 +1234,7 @@
name = MED_typedefs
type = module
relative_path = ../../../../../FV3/ccpp/physics/physics
dependencies = machine.F,physcons.F90,physparam.f
Comment thread
uturuncoglu marked this conversation as resolved.
dependencies = machine.F,physcons.F90

[ccpp-arg-table]
name = MED_typedefs
Expand Down