Skip to content

Commit

Permalink
Merge pull request #2066 from billsacks/glc2ocn_separate_liq_ice
Browse files Browse the repository at this point in the history
Separate liq and ice in glc2ocn mapping, and fix glc2ocn mapping bug

Two changes in this PR:

(1) Main change: Separate the mapping of liquid and ice runoff from
glc2ocn. This parallels a similar change made for the rof2ocn
mapping. This is needed in CESM with POP, because the ice runoff still
needs smoothing, but the liquid runoff should now be nearest neighbor to
coastal points without smoothing. (Fixes ESMCI/cime#1940)

In addition to making the code changes to support this separation, I
have regenerated all glc2ocn mapping files for CESM (using commit
b013b57). The liquid mapping files are completely different from before
(now nearest-neighbor to coastal points, rather than nearest-neighbor
with smoothing). The ice mapping files are slightly different from
before because of a slightly changed process for generating these files
(now nearest-neighbor to coastal points followed by smoothing, rather
than nearest-neighbor to any point followed by smoothing; also, the
mappings to gx3v7 now use rmax=500000 rather than 300000 to agree with
rof -> ocn maps).

For ACME, I point to the same mapping files for liquid and ice; I
haven't changed these mapping files (similarly to what's done for
rof2ocn mapping files).

(2) Small but important change, which changes answers substantially for
cases with a 2-way-coupled, evolving ice sheet: Do NOT use normalization
in doing glc2ocn runoff mapping. (Fixes ESMCI/cime#2063)

This bug only affects runs with a 2-way-coupled, evolving ice sheet
(which, at least in CESM, only involves runs done by a few members of
the Land Ice Working Group; I'm not sure about E3SM). I have done a
quick investigation of the impact of this bug. I found that (for a run
with 4-km Greenland and gx1v7 ocean) the runoff reaching the ocean was
too low by a factor of 2-3. However, it looks like there could be
significant spatial variability in this bug's impact - so the actual
impact would depend on exactly where the runoff (calving and basal melt)
is generated. In addition, the impact of this bug would differ with
different glc and ocn resolutions.

Test suite: scripts_regression_tests on yellowstone
Also ran a bunch of J compset (all-active except data atmosphere) tests
in CESM: see comment below for details.

Test baseline: n/a

Test namelist changes: splits glc2ocn_rmapname into glc2ocn_liq_rmapname
and glc2ocn_ice_rmapname; splits glc2ocn_rmaptype into
glc2ocn_liq_rmaptype and glc2ocn_ice_rmaptype.

Test status: climate changing - just for cases with 2-way-coupled,
evolving ice sheet (in CESM, this means compsets that have CISM2%EVOLVE)

Fixes ESMCI/cime#1940
Fixes ESMCI/cime#2063

User interface changes?: Splits GLC2OCN_RMAPNAME xml variable into
GLC2OCN_LIQ_RMAPNAME and GLC2OCN_ICE_RMAPNAME, and similarly for
GLC2OCN_RMAPTYPE

Update gh-pages html (Y/N)?: N

Code review:
  • Loading branch information
mvertens authored Nov 27, 2017
2 parents 31ee7aa + 78a696a commit 221a9b1
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 22 deletions.
3 changes: 2 additions & 1 deletion driver-mct/cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ def write_seq_maps_file(case, nmlgen, confdir):
# The following is only approriate for config_grids.xml version 2.0 or later
grid_version = Grids().get_version()
if grid_version >= 2.0:
ignore_idmaps = ["rof2ocn_fmapname", "glc2ice_rmapname", "glc2ocn_rmapname"]
ignore_idmaps = ["rof2ocn_fmapname", "glc2ice_rmapname",
"glc2ocn_liq_rmapname", "glc2ocn_ice_rmapname"]
group_variables = nmlgen.get_group_variables("seq_maps")
for name in group_variables:
value = group_variables[name]
Expand Down
25 changes: 21 additions & 4 deletions driver-mct/cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1620,21 +1620,38 @@
<desc>glc2ice runoff mapping file decomp type</desc>
</entry>

<entry id="GLC2OCN_RMAPNAME">
<entry id="GLC2OCN_LIQ_RMAPNAME">
<type>char</type>
<default_value>idmap</default_value>
<group>run_domain</group>
<file>env_run.xml</file>
<desc>glc2ocn runoff mapping file</desc>
<desc>glc2ocn runoff mapping file for liquid runoff</desc>
</entry>

<entry id="GLC2OCN_RMAPTYPE">
<entry id="GLC2OCN_LIQ_RMAPTYPE">
<type>char</type>
<valid_values>X,Y</valid_values>
<default_value>Y</default_value>
<group>run_domain</group>
<file>env_run.xml</file>
<desc>glc2ocn runoff mapping file decomp type</desc>
<desc>glc2ocn runoff mapping file decomp type for liquid runoff</desc>
</entry>

<entry id="GLC2OCN_ICE_RMAPNAME">
<type>char</type>
<default_value>idmap</default_value>
<group>run_domain</group>
<file>env_run.xml</file>
<desc>glc2ocn runoff mapping file for ice runoff</desc>
</entry>

<entry id="GLC2OCN_ICE_RMAPTYPE">
<type>char</type>
<valid_values>X,Y</valid_values>
<default_value>Y</default_value>
<group>run_domain</group>
<file>env_run.xml</file>
<desc>glc2ocn runoff mapping file decomp type for ice runoff</desc>
</entry>

<entry id="OCN2WAV_SMAPNAME">
Expand Down
40 changes: 35 additions & 5 deletions driver-mct/cime_config/namelist_definition_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3544,20 +3544,20 @@
</values>
</entry>

<entry id="glc2ocn_rmapname" modify_via_xml="GLC2OCN_RMAPNAME">
<entry id="glc2ocn_liq_rmapname" modify_via_xml="GLC2OCN_LIQ_RMAPNAME">
<type>char</type>
<category>mapping</category>
<input_pathname>abs</input_pathname>
<group>seq_maps</group>
<desc>
glc to ocn runoff conservative mapping file
glc to ocn runoff conservative mapping file for liquid runoff
</desc>
<values>
<value>$GLC2OCN_RMAPNAME</value>
<value>$GLC2OCN_LIQ_RMAPNAME</value>
</values>
</entry>

<entry id="glc2ocn_rmaptype" modify_via_xml="GLC2OCN_RMAPTYPE">
<entry id="glc2ocn_liq_rmaptype" modify_via_xml="GLC2OCN_LIQ_RMAPTYPE">
<type>char</type>
<category>mapping</category>
<group>seq_maps</group>
Expand All @@ -3569,7 +3569,37 @@
grid.
</desc>
<values>
<value>$GLC2OCN_RMAPTYPE</value>
<value>$GLC2OCN_LIQ_RMAPTYPE</value>
<value bfbflag="on">X</value>
</values>
</entry>

<entry id="glc2ocn_ice_rmapname" modify_via_xml="GLC2OCN_ICE_RMAPNAME">
<type>char</type>
<category>mapping</category>
<input_pathname>abs</input_pathname>
<group>seq_maps</group>
<desc>
glc to ocn runoff conservative mapping file for ice runoff
</desc>
<values>
<value>$GLC2OCN_ICE_RMAPNAME</value>
</values>
</entry>

<entry id="glc2ocn_ice_rmaptype" modify_via_xml="GLC2OCN_ICE_RMAPTYPE">
<type>char</type>
<category>mapping</category>
<group>seq_maps</group>
<desc>
The type of mapping desired, either "source" or "destination" mapping.
X is associated with rearrangement of the source grid to the
destination grid and then local mapping. Y is associated with mapping
on the source grid and then rearrangement and sum to the destination
grid.
</desc>
<values>
<value>$GLC2OCN_ICE_RMAPTYPE</value>
<value bfbflag="on">X</value>
</values>
</entry>
Expand Down
44 changes: 32 additions & 12 deletions driver-mct/main/prep_ocn_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ module prep_ocn_mod
public :: prep_ocn_get_mapper_Rr2o_liq
public :: prep_ocn_get_mapper_Rr2o_ice
public :: prep_ocn_get_mapper_SFi2o
public :: prep_ocn_get_mapper_Rg2o
public :: prep_ocn_get_mapper_Rg2o_liq
public :: prep_ocn_get_mapper_Rg2o_ice
public :: prep_ocn_get_mapper_Sw2o

!--------------------------------------------------------------------------
Expand All @@ -77,7 +78,8 @@ module prep_ocn_mod
type(seq_map), pointer :: mapper_Rr2o_liq
type(seq_map), pointer :: mapper_Rr2o_ice
type(seq_map), pointer :: mapper_SFi2o
type(seq_map), pointer :: mapper_Rg2o
type(seq_map), pointer :: mapper_Rg2o_liq
type(seq_map), pointer :: mapper_Rg2o_ice
type(seq_map), pointer :: mapper_Sw2o

! attribute vectors
Expand Down Expand Up @@ -170,7 +172,8 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc
allocate(mapper_Rr2o_liq)
allocate(mapper_Rr2o_ice)
allocate(mapper_SFi2o)
allocate(mapper_Rg2o)
allocate(mapper_Rg2o_liq)
allocate(mapper_Rg2o_ice)
allocate(mapper_Sw2o)

if (ocn_present) then
Expand Down Expand Up @@ -322,11 +325,19 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc
if (glc_c2_ocn) then
if (iamroot_CPLID) then
write(logunit,*) ' '
write(logunit,F00) 'Initializing mapper_Rg2o'
write(logunit,F00) 'Initializing mapper_Rg2o_liq'
end if
call seq_map_init_rcfile(mapper_Rg2o, glc(1), ocn(1), &
'seq_maps.rc', 'glc2ocn_rmapname:', 'glc2ocn_rmaptype:',samegrid_og, &
'mapper_Rg2o initialization',esmf_map_flag)
call seq_map_init_rcfile(mapper_Rg2o_liq, glc(1), ocn(1), &
'seq_maps.rc', 'glc2ocn_liq_rmapname:', 'glc2ocn_liq_rmaptype:',samegrid_og, &
'mapper_Rg2o_liq initialization',esmf_map_flag)

if (iamroot_CPLID) then
write(logunit,*) ' '
write(logunit,F00) 'Initializing mapper_Rg2o_ice'
end if
call seq_map_init_rcfile(mapper_Rg2o_ice, glc(1), ocn(1), &
'seq_maps.rc', 'glc2ocn_ice_rmapname:', 'glc2ocn_ice_rmaptype:',samegrid_og, &
'mapper_Rg2o_ice initialization',esmf_map_flag)
endif
call shr_sys_flush(logunit)

Expand Down Expand Up @@ -1234,7 +1245,11 @@ subroutine prep_ocn_calc_g2x_ox(timer)
call t_drvstartf (trim(timer),barrier=mpicom_CPLID)
do egi = 1,num_inst_glc
g2x_gx => component_get_c2x_cx(glc(egi))
call seq_map_map(mapper_Rg2o, g2x_gx, g2x_ox(egi), norm=.true.)
call seq_map_map(mapper_Rg2o_liq, g2x_gx, g2x_ox(egi), &
fldlist=seq_flds_g2o_liq_fluxes, norm=.false.)

call seq_map_map(mapper_Rg2o_ice, g2x_gx, g2x_ox(egi), &
fldlist=seq_flds_g2o_ice_fluxes, norm=.false.)
enddo
call t_drvstopf (trim(timer))
end subroutine prep_ocn_calc_g2x_ox
Expand Down Expand Up @@ -1335,10 +1350,15 @@ function prep_ocn_get_mapper_SFi2o()
prep_ocn_get_mapper_SFi2o => mapper_SFi2o
end function prep_ocn_get_mapper_SFi2o

function prep_ocn_get_mapper_Rg2o()
type(seq_map), pointer :: prep_ocn_get_mapper_Rg2o
prep_ocn_get_mapper_Rg2o => mapper_Rg2o
end function prep_ocn_get_mapper_Rg2o
function prep_ocn_get_mapper_Rg2o_liq()
type(seq_map), pointer :: prep_ocn_get_mapper_Rg2o_liq
prep_ocn_get_mapper_Rg2o_liq => mapper_Rg2o_liq
end function prep_ocn_get_mapper_Rg2o_liq

function prep_ocn_get_mapper_Rg2o_ice()
type(seq_map), pointer :: prep_ocn_get_mapper_Rg2o_ice
prep_ocn_get_mapper_Rg2o_ice => mapper_Rg2o_ice
end function prep_ocn_get_mapper_Rg2o_ice

function prep_ocn_get_mapper_Sw2o()
type(seq_map), pointer :: prep_ocn_get_mapper_Sw2o
Expand Down
14 changes: 14 additions & 0 deletions driver-mct/shr/seq_flds_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ module seq_flds_mod
character(CXX) :: seq_flds_g2x_states_to_lnd
character(CXX) :: seq_flds_g2x_fluxes
character(CXX) :: seq_flds_g2x_fluxes_to_lnd
character(CXX) :: seq_flds_g2o_liq_fluxes
character(CXX) :: seq_flds_g2o_ice_fluxes
character(CXX) :: seq_flds_x2g_states
character(CXX) :: seq_flds_x2g_fluxes

Expand Down Expand Up @@ -315,6 +317,8 @@ subroutine seq_flds_set(nmlfile, ID, infodata)
character(CXX) :: g2x_states_to_lnd = ''
character(CXX) :: g2x_fluxes = ''
character(CXX) :: g2x_fluxes_to_lnd = ''
character(CXX) :: g2o_liq_fluxes = ''
character(CXX) :: g2o_ice_fluxes = ''
character(CXX) :: x2g_states = ''
character(CXX) :: x2g_fluxes = ''
character(CXX) :: xao_albedo = ''
Expand Down Expand Up @@ -2242,6 +2246,9 @@ subroutine seq_flds_set(nmlfile, ID, infodata)

name = 'Fogg_rofl'
call seq_flds_add(g2x_fluxes,trim(name))
! Don't need to add this to x2o_fluxes, because Foxx_rofl is already added in the
! course of adding Forr_rofl
call seq_flds_add(g2o_liq_fluxes,trim(name))
longname = 'glc liquid runoff flux to ocean'
stdname = 'glacier_liquid_runoff_flux_to_ocean'
units = 'kg m-2 s-1'
Expand All @@ -2250,6 +2257,9 @@ subroutine seq_flds_set(nmlfile, ID, infodata)

name = 'Fogg_rofi'
call seq_flds_add(g2x_fluxes,trim(name))
! Don't need to add this to x2o_fluxes, because Foxx_rofi is already added in the
! course of adding Forr_rofi
call seq_flds_add(g2o_ice_fluxes,trim(name))
longname = 'glc frozen runoff flux to ocean'
stdname = 'glacier_frozen_runoff_flux_to_ocean'
units = 'kg m-2 s-1'
Expand All @@ -2258,6 +2268,8 @@ subroutine seq_flds_set(nmlfile, ID, infodata)

name = 'Figg_rofi'
call seq_flds_add(g2x_fluxes,trim(name))
! Don't need to add this to x2i_fluxes, because Fixx_rofi is already added in the
! course of adding Firr_rofi
longname = 'glc frozen runoff_iceberg flux to ice'
stdname = 'glacier_frozen_runoff_flux_to_seaice'
units = 'kg m-2 s-1'
Expand Down Expand Up @@ -3217,6 +3229,8 @@ subroutine seq_flds_set(nmlfile, ID, infodata)
seq_flds_x2o_fluxes = trim(x2o_fluxes)
seq_flds_g2x_fluxes = trim(g2x_fluxes)
seq_flds_g2x_fluxes_to_lnd = trim(g2x_fluxes_to_lnd)
seq_flds_g2o_liq_fluxes = trim(g2o_liq_fluxes)
seq_flds_g2o_ice_fluxes = trim(g2o_ice_fluxes)
seq_flds_x2g_fluxes = trim(x2g_fluxes)
seq_flds_xao_fluxes = trim(xao_fluxes)
seq_flds_r2x_fluxes = trim(r2x_fluxes)
Expand Down

0 comments on commit 221a9b1

Please sign in to comment.