Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wav2ocn and ocn2wav maps are still needed in some cases #498

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
16 changes: 16 additions & 0 deletions cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1405,6 +1405,22 @@
<desc>rof2ocn runoff mapping file</desc>
</entry>

<entry id="OCN2WAV_SMAPNAME">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want something of the form

char
mapping
MED_attributes
ocn to wav mapping, 'unset' or 'idmap' are normal possible values

unset
idmap

And set samegrid_ocn_wav in buildnml. It doesn't make sense to have idmap be the default value if the two are on different grids.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, do we really want to have these as xml variables - or just add them in as namelist variables in case the user might want to change them?

Copy link
Collaborator Author

@jedwards4b jedwards4b Aug 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe there is a format error in your comment - if you meant to include xml can you wrap it in <CODE></CODE>.
Also I don't see a variable samegrid_ocn_wav in the cmeps buildnml. I'm not sure what you want.

<type>char</type>
<default_value>idmap</default_value>
<group>run_domain</group>
<file>env_run.xml</file>
<desc>ocn2wav state mapping file</desc>
</entry>

<entry id="WAV2OCN_SMAPNAME">
<type>char</type>
<default_value>idmap</default_value>
<group>run_domain</group>
<file>env_run.xml</file>
<desc>wav2ocn state mapping file</desc>
</entry>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above.

<entry id="EPS_FRAC">
<type>char</type>
<default_value>1.0e-02</default_value>
Expand Down
26 changes: 26 additions & 0 deletions cime_config/namelist_definition_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2303,6 +2303,32 @@
</values>
</entry>

<entry id="ocn2wav_smapname" modify_via_xml="OCN2WAV_SMAPNAME">
<type>char</type>
<category>mapping</category>
<input_pathname>abs</input_pathname>
<group>MED_attributes</group>
<desc>
ocn to wav state mapping file for states
</desc>
<values>
<value>$OCN2WAV_SMAPNAME</value>
</values>
</entry>

<entry id="wav2ocn_smapname" modify_via_xml="WAV2OCN_SMAPNAME">
<type>char</type>
<category>mapping</category>
<input_pathname>abs</input_pathname>
<group>MED_attributes</group>
<desc>
wav to ocn state mapping file for states
</desc>
<values>
<value>$WAV2OCN_SMAPNAME</value>
</values>
</entry>

<!-- =========================== -->
<!-- ALLCOMP attributes -->
<!-- =========================== -->
Expand Down
14 changes: 12 additions & 2 deletions mediator/esmFldsExchange_cesm_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ module esmFldsExchange_cesm_mod
character(len=CX) :: rof2lnd_map = 'unset'
character(len=CX) :: lnd2rof_map = 'unset'

! optional mapping files
character(len=CX) :: wav2ocn_map ='unset'
character(len=CX) :: ocn2wav_map = 'unset'

! no mapping files (value is 'idmap' or 'unset')
character(len=CX) :: atm2ice_map = 'unset'
character(len=CX) :: atm2ocn_map = 'unset'
Expand All @@ -84,9 +88,7 @@ module esmFldsExchange_cesm_mod
character(len=CX) :: ice2wav_map = 'unset'
character(len=CX) :: lnd2atm_map = 'unset'
character(len=CX) :: ocn2atm_map = 'unset'
character(len=CX) :: ocn2wav_map = 'unset'
character(len=CX) :: rof2ocn_map = 'unset'
character(len=CX) :: wav2ocn_map = 'unset'

logical :: mapuv_with_cart3d ! Map U/V vector wind fields from ATM to OCN/ICE by rotating in Cartesian 3D space and then back
logical :: flds_i2o_per_cat ! Ice thickness category fields passed to OCN
Expand Down Expand Up @@ -202,6 +204,14 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (maintask) write(logunit, '(a)') trim(subname)//'rof2ocn_ice_rmapname = '// trim(rof2ocn_ice_rmap)

call NUOPC_CompAttributeGet(gcomp, name='wav2ocn_smapname', value=wav2ocn_map, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (maintask) write(logunit, '(a)') trim(subname)//'wav2ocn_smapname = '// trim(wav2ocn_map)
call NUOPC_CompAttributeGet(gcomp, name='ocn2wav_smapname', value=ocn2wav_map, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (maintask) write(logunit, '(a)') trim(subname)//'ocn2wav_smapname = '// trim(ocn2wav_map)


! uv cart3d mapping
call NUOPC_CompAttributeGet(gcomp, name='mapuv_with_cart3d', value=cvalue, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
Expand Down
Loading