Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5a4c5ee
merge escomp/cmeps master (#5)
DeniseWorthen Apr 17, 2020
49b7cec
merge escomp/cmeps master (#6)
DeniseWorthen Apr 17, 2020
b9c1d6e
Revert "merge escomp/cmeps master (#5)"
DeniseWorthen Apr 17, 2020
6b9fec8
Merge remote-tracking branch 'NCAR/master'
DeniseWorthen Apr 17, 2020
7e01f7c
merge (#7)
DeniseWorthen May 9, 2020
3035e07
merge master (#10)
DeniseWorthen May 12, 2020
6643005
Merge remote-tracking branch 'upstream/master'
DeniseWorthen Jun 7, 2020
c8caaff
update esmFldsExchange for frac grid
DeniseWorthen Jun 7, 2020
4b53826
remove commented out code; add TODO in prep_atm
DeniseWorthen Jun 7, 2020
0895485
remove bilinr method for Sa_pslv
DeniseWorthen Jun 11, 2020
7e59a90
minor cleanup coupling mode for nems
DeniseWorthen Jun 13, 2020
a7f79b4
fix Makefile,remove unneeded nems code in prep_atm
DeniseWorthen Jun 15, 2020
d6a1ea4
add two small fixes from datm branch
DeniseWorthen Jun 17, 2020
0255a58
changes for si_ifrac
DeniseWorthen Jun 18, 2020
37fa3b9
Merge remote-tracking branch 'upstream/master'
DeniseWorthen Jun 22, 2020
7eb1539
Merge branch 'master' into feature/fracgridwk2
DeniseWorthen Jun 22, 2020
22e1b26
add ability to read dbug_flag from nems.configure MED_attributes
DeniseWorthen Jun 23, 2020
4da898b
Merge branch 'feature/fracgridwk2' of https://github.com/DeniseWorthe…
DeniseWorthen Jun 23, 2020
713fe36
introduce mapping_mode
DeniseWorthen Jun 23, 2020
fe57ceb
add comments
DeniseWorthen Jun 23, 2020
9250cd5
rename mapping_mode to maptype for consistency
DeniseWorthen Jun 23, 2020
04a3747
remove use of ifrac_nstod in fraction_mod
DeniseWorthen Jun 25, 2020
f727af2
add prep_ocn with app specific custom merge routines
DeniseWorthen Jun 25, 2020
94b7b26
update default value of PIO_REARR_COMM_MAX_PEND_REQ_COMP2IO
jedwards4b Jun 26, 2020
e0b838a
add fix from datm for nextsw_cday not being present
DeniseWorthen Jun 26, 2020
cd203d2
remove aoflux fields from exchange unless using nems_orig_data
DeniseWorthen Jun 28, 2020
554964a
move med_fraction_init and set into first_call for
DeniseWorthen Jun 28, 2020
85438fa
revert change to med.F90 in DataInitialize
DeniseWorthen Jun 28, 2020
49572f0
remove TODO in history write
DeniseWorthen Jun 29, 2020
62898dc
update prep_ocn for bulk fluxes in nems_data_orig
DeniseWorthen Jun 30, 2020
49c13b8
add variables for dictionary for cice6
DeniseWorthen Jul 1, 2020
9814e4b
Merge remote-tracking branch 'upstream/master' into feature/fracgridwk2
DeniseWorthen Jul 1, 2020
198e00a
update Si_t alias for cesm + cice6
DeniseWorthen Jul 1, 2020
66cb2d8
spell surface correctly
DeniseWorthen Jul 1, 2020
905e8e2
add entries to eliminate ifdefs in CICE6 nuopc cap
DeniseWorthen Jul 4, 2020
a2838cf
changes required for CESM in med.F90.
DeniseWorthen Jul 5, 2020
2e18eb8
update mediator/Makefile to compile esmf 8.1.0 (#12)
DeniseWorthen Jul 8, 2020
318e441
Revert "update mediator/Makefile to compile esmf 8.1.0 (#12)"
DeniseWorthen Jul 9, 2020
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
8 changes: 6 additions & 2 deletions cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1985,10 +1985,14 @@
<entry id="PIO_REARR_COMM_MAX_PEND_REQ_COMP2IO">
<type>integer</type>
<valid_values></valid_values>
<default_value>0</default_value>
<default_value>-2</default_value>
<group>run_pio</group>
<file>env_run.xml</file>
<desc>pio rearranger communication max pending requests (comp2io) : 0 implies that CIME internally calculates the value ( = max(64, 2 * PIO_NUMTASKS) ), -1 implies no bound on max pending requests </desc>
<desc>pio rearranger communication max pending requests (io2comp) :
-2 implies that CIME internally calculates the value ( = 64),
-1 implies no bound on max pending requests
0 implies that MPI_ALLTOALL will be used
</desc>
</entry>

<entry id="PIO_REARR_COMM_ENABLE_HS_COMP2IO">
Expand Down
2 changes: 1 addition & 1 deletion mediator/esmFlds.F90
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module esmflds
! Set coupling mode
!-----------------------------------------------

character(len=10), public :: coupling_mode ! valid values are [cesm,nems_orig,nems_frac,hafs]
character(len=CS), public :: coupling_mode ! valid values are [cesm,nems_orig,nems_frac,nems_orig_data,hafs]

!-----------------------------------------------
! PUblic methods
Expand Down
120 changes: 45 additions & 75 deletions mediator/esmFldsExchange_nems_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc)
use esmflds , only : compmed, compatm, compocn, compice, comprof, ncomps
use esmflds , only : mapbilnr, mapconsf, mapconsd, mappatch
use esmflds , only : mapfcopy, mapnstod, mapnstod_consd, mapnstod_consf
use esmflds , only : coupling_mode, mapuv_with_cart3d
use esmflds , only : coupling_mode, mapuv_with_cart3d, mapnames
use esmflds , only : fldListTo, fldListFr, fldListMed_aoflux, fldListMed_ocnalb
use med_internalstate_mod , only : mastertask, logunit

Expand All @@ -41,7 +41,8 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc)
integer , intent(inout) :: rc

! local variables:
integer :: i, n
integer :: i, n, maptype
character(len=CX) :: msgString
character(len=CL) :: cvalue
character(len=CS) :: fldname
character(len=CS), allocatable :: flds(:)
Expand All @@ -53,6 +54,15 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc)
! Initialize if use 3d cartesian mapping for u,v
mapuv_with_cart3d = .false.

! Set maptype according to coupling_mode
if (trim(coupling_mode) == 'nems_orig' .or. trim(coupling_mode) == 'nems_orig_data') then
maptype = mapnstod_consf
else
maptype = mapconsf
end if
write(msgString,'(A,i6,A)') trim(subname)//': maptype is ',maptype,', '//mapnames(maptype)
call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)

!=====================================================================
! scalar information
!=====================================================================
Expand All @@ -73,26 +83,28 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc)
call addfld(fldListFr(compocn)%flds, 'So_omask')
call addmap(fldListFr(compocn)%flds, 'So_omask', compice, mapfcopy, 'unset', 'unset')

! atm and ocn fields required for atm/ocn flux calculation'
allocate(flds(6))
flds = (/'Sa_u ','Sa_v ','Sa_z ','Sa_tbot','Sa_pbot','Sa_shum'/)
do n = 1,size(flds)
fldname = trim(flds(n))
call addfld(fldListFr(compatm)%flds, trim(fldname))
call addmap(fldListFr(compatm)%flds, trim(fldname), compocn, mapnstod_consf, 'none', 'unset')
end do
deallocate(flds)

! unused fields needed by the atm/ocn flux computation
allocate(flds(13))
flds = (/'So_tref ', 'So_qref ','So_u10 ', 'So_ustar ','So_ssq ', &
'So_re ', 'So_duu10n','Faox_lwup', 'Faox_sen ','Faox_lat ', &
'Faox_evap', 'Faox_taux','Faox_tauy'/)
do n = 1,size(flds)
fldname = trim(flds(n))
call addfld(fldListMed_aoflux%flds, trim(fldname))
end do
deallocate(flds)
if ( trim(coupling_mode) == 'nems_orig_data') then
! atm and ocn fields required for atm/ocn flux calculation'
allocate(flds(6))
flds = (/'Sa_u ','Sa_v ', 'Sa_z ', 'Sa_tbot', 'Sa_pbot', 'Sa_shum'/)
do n = 1,size(flds)
fldname = trim(flds(n))
call addfld(fldListFr(compatm)%flds, trim(fldname))
call addmap(fldListFr(compatm)%flds, trim(fldname), compocn, maptype, 'none', 'unset')
end do
deallocate(flds)

! unused fields needed by the atm/ocn flux computation
allocate(flds(13))
flds = (/'So_tref ', 'So_qref ','So_u10 ', 'So_ustar ','So_ssq ', &
'So_re ', 'So_duu10n','Faox_lwup', 'Faox_sen ','Faox_lat ', &
'Faox_evap', 'Faox_taux','Faox_tauy'/)
do n = 1,size(flds)
fldname = trim(flds(n))
call addfld(fldListMed_aoflux%flds, trim(fldname))
end do
deallocate(flds)
end if

! unused fields from ice - but that are needed to be realized by the cice cap
call addfld(fldListFr(compice)%flds, 'Si_avsdf')
Expand All @@ -107,8 +119,8 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc)
!=====================================================================

! to atm: fractions (computed in med_phases_prep_atm)
call addfld(fldListFr(compice)%flds, 'Si_ifrac')
call addfld(fldListTo(compatm)%flds, 'Si_ifrac')
call addfld(fldListTo(compatm)%flds, 'So_ofrac')

! to atm: unmerged from ice
! - zonal surface stress, meridional surface stress
Expand All @@ -127,35 +139,25 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc)
fldname = trim(flds(n))
call addfld(fldListFr(compice)%flds, trim(fldname))
call addfld(fldListTo(compatm)%flds, trim(fldname))
call addmap(fldListFr(compice)%flds, trim(fldname), compatm, mapnstod_consf, 'ifrac', 'unset')
call addmap(fldListFr(compice)%flds, trim(fldname), compatm, maptype, 'ifrac', 'unset')
call addmrg(fldListTo(compatm)%flds, trim(fldname), mrg_from1=compice, mrg_fld1=trim(fldname), mrg_type1='copy')
end do
deallocate(flds)

! to atm: unmerged surface temperatures from ocn
call addfld(fldListFr(compocn)%flds, 'So_t')
call addfld(fldListTo(compatm)%flds, 'So_t')
call addmap(fldListFr(compocn)%flds, 'So_t', compatm, mapnstod_consf, 'ofrac', 'unset')
call addmap(fldListFr(compocn)%flds, 'So_t', compatm, maptype, 'ofrac', 'unset')
call addmrg(fldListTo(compatm)%flds, 'So_t', mrg_from1=compocn, mrg_fld1='So_t', mrg_type1='copy')

!=====================================================================
! FIELDS TO OCEAN (compocn)
!=====================================================================

! to ocn: fractional ice coverage wrt ocean from ice
call addfld(fldListFr(compice)%flds, 'Si_ifrac')
call addfld(fldListTo(compocn)%flds, 'Si_ifrac')
call addmap(fldListFr(compice)%flds, 'Si_ifrac', compocn, mapfcopy, 'unset', 'unset')
call addmrg(fldListTo(compocn)%flds, 'Si_ifrac', mrg_from1=compice, mrg_fld1='Si_ifrac', mrg_type1='copy')

! to ocn: sea level pressure from atm
call addfld(fldListTo(compocn)%flds, 'Sa_pslv')
call addfld(fldListFr(compatm)%flds, 'Sa_pslv')
if (trim(coupling_mode) == 'nems_orig' .or. trim(coupling_mode) == 'nems_orig_data') then
call addmap(fldListFr(compatm)%flds, 'Sa_pslv', compocn, mapnstod_consf, 'none', 'unset')
else
call addmap(fldListFr(compatm)%flds, 'Sa_pslv', compocn, mapbilnr, 'none', 'unset')
end if
call addmap(fldListFr(compatm)%flds, 'Sa_pslv', compocn, maptype, 'none', 'unset')
call addmrg(fldListTo(compocn)%flds, 'Sa_pslv', mrg_from1=compatm, mrg_fld1='Sa_pslv', mrg_type1='copy')

! to ocn: from atm (custom merge in med_phases_prep_ocn)
Expand All @@ -174,52 +176,32 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc)
fldname = trim(flds(n))
call addfld(fldListTo(compocn)%flds, trim(fldname))
call addfld(fldListFr(compatm)%flds, trim(fldname))
if (trim(coupling_mode) == 'nems_orig' .or. trim(coupling_mode) == 'nems_orig_data') then
call addmap(fldListFr(compatm)%flds, trim(fldname), compocn, mapnstod_consf, 'none', 'unset')
else
call addmap(fldListFr(compatm)%flds, trim(fldname), compocn, mapconsf, 'none', 'unset')
end if
call addmap(fldListFr(compatm)%flds, trim(fldname), compocn, maptype, 'none', 'unset')
end do
deallocate(flds)

! to ocn: merged sensible heat flux (custom merge in med_phases_prep_ocn)
call addfld(fldListTo(compocn)%flds, 'Faxa_sen')
call addfld(fldListFr(compatm)%flds, 'Faxa_sen')
if (trim(coupling_mode) == 'nems_orig' .or. trim(coupling_mode) == 'nems_orig_data') then
call addmap(fldListFr(compatm)%flds, 'Faxa_sen', compocn, mapnstod_consf, 'none', 'unset')
else
call addmap(fldListFr(compatm)%flds, 'Faxa_sen', compocn, mapconsf, 'none', 'unset')
end if
call addmap(fldListFr(compatm)%flds, 'Faxa_sen', compocn, maptype, 'none', 'unset')

! to ocn: surface latent heat flux and evaporation water flux (custom merge in med_phases_prep_ocn)
call addfld(fldListTo(compocn)%flds, 'Faxa_evap')
call addfld(fldListFr(compatm)%flds, 'Faxa_lat')
if (trim(coupling_mode) == 'nems_orig' .or. trim(coupling_mode) == 'nems_orig_data') then
call addmap(fldListFr(compatm)%flds, 'Faxa_lat', compocn, mapnstod_consf, 'none', 'unset')
else
call addmap(fldListFr(compatm)%flds, 'Faxa_lat', compocn, mapconsf, 'none', 'unset')
end if
call addmap(fldListFr(compatm)%flds, 'Faxa_lat', compocn, maptype, 'none', 'unset')

! to ocn: merge zonal surface stress (custom merge calculation in med_phases_prep_ocn)
call addfld(fldListTo(compocn)%flds, 'Foxx_taux')
call addfld(fldListFr(compice)%flds, 'Fioi_taux')
call addfld(fldListFr(compatm)%flds, 'Faxa_taux')
if (trim(coupling_mode) == 'nems_orig' .or. trim(coupling_mode) == 'nems_orig_data') then
call addmap(fldListFr(compatm)%flds, 'Faxa_taux', compocn, mapnstod_consf, 'none', 'unset')
else
call addmap(fldListFr(compatm)%flds, 'Faxa_taux', compocn, mapconsf, 'none', 'unset')
end if
call addmap(fldListFr(compatm)%flds, 'Faxa_taux', compocn, maptype, 'none', 'unset')
call addmap(fldListFr(compice)%flds, 'Fioi_taux', compocn, mapfcopy, 'unset', 'unset')

! to ocn: meridional surface stress (custom merge calculation in med_phases_prep_ocn)
call addfld(fldListTo(compocn)%flds, 'Foxx_tauy')
call addfld(fldListFr(compice)%flds, 'Fioi_tauy')
call addfld(fldListFr(compatm)%flds, 'Faxa_tauy')
if (trim(coupling_mode) == 'nems_orig' .or. trim(coupling_mode) == 'nems_orig_data') then
call addmap(fldListFr(compatm)%flds, 'Faxa_tauy', compocn, mapnstod_consf, 'none', 'unset')
else
call addmap(fldListFr(compatm)%flds, 'Faxa_tauy', compocn, mapconsf, 'none', 'unset')
end if
call addmap(fldListFr(compatm)%flds, 'Faxa_tauy', compocn, maptype, 'none', 'unset')
call addmap(fldListFr(compice)%flds, 'Fioi_tauy', compocn, mapfcopy, 'unset', 'unset')

! to ocn: net shortwave radiation from med (custom merge in med_phases_prep_ocn)
Expand Down Expand Up @@ -271,11 +253,7 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc)
fldname = trim(flds(n))
call addfld(fldListFr(compatm)%flds, trim(fldname))
call addfld(fldListTo(compice)%flds, trim(fldname))
if (trim(coupling_mode) == 'nems_orig' .or. trim(coupling_mode) == 'nems_orig_data') then
call addmap(fldListFr(compatm)%flds, trim(fldname), compice, mapnstod_consf, 'none', 'unset')
else
call addmap(fldListFr(compatm)%flds, trim(fldname), compice, mapconsf, 'none', 'unset')
end if
call addmap(fldListFr(compatm)%flds, trim(fldname), compice, maptype, 'none', 'unset')
call addmrg(fldListTo(compice)%flds, trim(fldname), mrg_from1=compatm, mrg_fld1=trim(fldname), mrg_type1='copy')
end do
deallocate(flds)
Expand All @@ -293,15 +271,7 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc)
fldname = trim(flds(n))
call addfld(fldListTo(compice)%flds, trim(fldname))
call addfld(fldListFr(compatm)%flds, trim(fldname))
if (trim(coupling_mode) == 'nems_orig' .or. trim(coupling_mode) == 'nems_orig_data') then
call addmap(fldListFr(compatm)%flds, trim(fldname), compice, mapnstod_consf, 'none', 'unset')
else
if (trim(fldname) == 'Sa_u' .or. trim(fldname) == 'Sa_v') then
call addmap(fldListFr(compatm)%flds, trim(fldname), compice, mappatch, 'none', 'unset')
else
call addmap(fldListFr(compatm)%flds, trim(fldname), compice, mapbilnr, 'none', 'unset')
end if
end if
call addmap(fldListFr(compatm)%flds, trim(fldname), compice, maptype, 'none', 'unset')
call addmrg(fldListTo(compice)%flds, trim(fldname), mrg_from1=compatm, mrg_fld1=trim(fldname), mrg_type1='copy')
end do
deallocate(flds)
Expand Down
2 changes: 1 addition & 1 deletion mediator/fd_cesm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@
description: sea-ice export to atm
#
- standard_name: Si_t
alias: sea_ice_temperature
alias: sea_ice_surface_temperature
canonical_units: K
description: sea-ice export
#
Expand Down
48 changes: 46 additions & 2 deletions mediator/fd_nems.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,22 @@
# section: atmosphere export
#-----------------------------------
#
- standard_name: Faxa_bcph
canonical_units: kg m-2 s-1
description: atmosphere export
#
- standard_name: Faxa_dstdry
canonical_units: kg m-2 s-1
description: atmosphere export
#
- standard_name: Faxa_dstwet
canonical_units: kg m-2 s-1
description: atmosphere export
#
#-----------------------------------
# section: atmosphere export
#-----------------------------------
#
- standard_name: Faxa_swdn
alias: mean_down_sw_flx
canonical_units: W m-2
Expand Down Expand Up @@ -105,7 +121,11 @@
- standard_name: Sa_pslv
alias: inst_pres_height_surface
canonical_units: Pa
description: atmosphere export - instataneous pressure land and sea surface
description: atmosphere export - instantaneous pressure land and sea surface
#
- standard_name: Sa_ptem
canonical_units: K
description: atmosphere export - bottom layer potential temperature
#
- standard_name: Sa_shum
alias: inst_spec_humid_height_lowest
Expand Down Expand Up @@ -200,6 +220,18 @@
canonical_units: N m-2
description: sea-ice export - air ice meridional stress
#
- standard_name: Fioi_bcphi
canonical_units: kg m-2 s-1
description: sea-ice export to ocean - hydrophilic black carbon flux to ocean
#
- standard_name: Fioi_bcpho
canonical_units: kg m-2 s-1
description: sea-ice export to ocean - hydrophobic black carbon flux to ocean
#
- standard_name: Fioi_flxdst
canonical_units: kg m-2 s-1
description: sea-ice export to ocean - dust aerosol flux to ocean
#
- standard_name: Fioi_melth
alias: net_heat_flx_to_ocn
canonical_units: W m-2
Expand All @@ -210,6 +242,11 @@
canonical_units: kg m-2 s-1
description: sea-ice export to ocean - fresh water to ocean (h2o flux from melting)
#
- standard_name: Fioi_meltw_wiso
alias: mean_fresh_water_to_ocean_rate_wiso
canonical_units: kg m-2 s-1
description: sea-ice export to ocean - fresh water to ocean (h2o flux from melting) for 16O, 18O, HDO
#
- standard_name: Fioi_salt
alias: mean_salt_rate
canonical_units: kg m-2 s-1
Expand Down Expand Up @@ -280,6 +317,10 @@
canonical_units: 1
description: sea-ice export - ice mask
#
- standard_name: Si_qref
canonical_units: kg kg-1
description: sea-ice export to atm
#
- standard_name: Si_t
alias: sea_ice_surface_temperature
canonical_units: K
Expand All @@ -299,6 +340,10 @@
description: sea-ice export
volume of ice per unit area
#
- standard_name: Si_snowh
canonical_units: m
description: sea-ice export - surface_snow_water_equivalent
#
- standard_name: Si_vsno
alias: mean_snow_volume
canonical_units: m
Expand Down Expand Up @@ -453,7 +498,6 @@
canonical_units: N m-2
description: ocean import - meridional surface stress to ocean
#
#
#-----------------------------------
# mediator fields
#-----------------------------------
Expand Down
Loading