ESCOMP / CMEPS

NUOPC Community Mediator for Earth Prediction Systems
https://escomp.github.io/CMEPS/
22 stars 78 forks source link

Model specific mask values #93

Open danrosen25 opened 4 years ago

danrosen25 commented 4 years ago

I would like to move away from hard coding mask values based on the coupling_mode (see code in med_map_mod.F90). Several applications use multiple compset configurations, each would require a new 'coupling_mode' setting. I think esmFld.F90 variables such as compocn_omask, compocn_lmask, compatm_lmask, etc make the most sense and these variables can be configured by the app_mode files (e.g. esmFldsExchange_cesm_mod.F90). The defaults should be the 'ispval_mask' value.

Current Code Example

if (trim(coupling_mode) == 'cesm') then
  dstMaskValue = ispval_mask
  srcMaskValue = ispval_mask
  if (n1 == compocn .or. n1 == compice) srcMaskValue = 0
  if (n2 == compocn .or. n2 == compice) dstMaskValue = 0
  else if (coupling_mode(1:4) == 'nems') then
    if (n1 == compatm .and. (n2 == compocn .or. n2 == compice)) then
      srcMaskValue = 1
      dstMaskValue = 0
uturuncoglu commented 3 years ago

@danrosen25 @mvertens @jedwards4b this is fixed by introducing name of the model component. So, it looks like following now.

         else if (trim(coupling_mode) == 'hafs') then
             dstMaskValue = ispval_mask
             srcMaskValue = ispval_mask
             if (n1 == compatm .and. n2 == compocn) then
                if (trim(atm_name) /= 'datm') then
                  srcMaskValue = 1
                end if
                dstMaskValue = 0
             elseif (n1 == compocn .and. n2 == compatm) then
                srcMaskValue = 0
             endif
          end if