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

SCAM capability needs to be tested and verified functional #856

Closed
jedwards4b opened this issue Nov 30, 2016 · 7 comments
Closed

SCAM capability needs to be tested and verified functional #856

jedwards4b opened this issue Nov 30, 2016 · 7 comments
Assignees

Comments

@jedwards4b
Copy link
Contributor

Moved from CESM-DEVELOPMENT issue 65

@jedwards4b
Copy link
Contributor Author

Also CESM-DEVELOPMENT issue 93
http://bugs.cgd.ucar.edu/show_bug.cgi?id=1951

@mvertens
Copy link
Contributor

mvertens commented Sep 4, 2017

The actually contents of this issue is the following:

Ben Sanderson reports on the following issue... (on 2014-03-17 20:03:09 MDT)

Hi all,

I’ve been hitting this strange bug over the last week that occasionally sets ocn_point to 1 in my land-based scam column, but I think I’ve found the problem - and I think it’s one which is general to SCM mode.

I’m using the CESM1.2 release code. In shr_dmodel_mod.F90, where the code finds the coordinates in the ocean domain file which match the scam coordinates, the current code does two loops, through the first dimension of the latitude array and the first dimension of the longitude array:

  !--- start with wraparound ---                                                                  
   ni = 1
   mind = abs(lscmlon - (lon(1,1)+360.0_r8))
   do i=1,nxg
      dist = abs(lscmlon - lon(i,1))
      if (dist < mind) then
         mind = dist
         ni = i
      endif
enddo

   nj = -1
   mind = 1.0e20
   do j=1,nyg
      dist = abs(scmlat - lat(1,j))
      if (dist < mind) then
         mind = dist
         nj = j
      endif
   enddo

———————

The problem is, when the array varies jointly in latitude and longitude (like, for example the T31 greenland centered grid that I’m using), this doesn’t converge to the true minimum - it can be some distance off. My simulation for the Black Forest, Germany site at (50.1N,7.5E) was being placed in the North Sea at (52.8N,2.6E), and so the model was erroneously turning off CLM. My simulation in Siberia was even more dramatically misplaced into the middle of the Arctic ocean.

So, a complete search over the whole array appears to fix the problem:

—————————
ni = 1
nj = 1

   mind = 1.0e20
   do i=1,nxg
   do j=1,nyg
      dist = abs(lscmlon - lon(i,j)) + abs(scmlat - lat(i,j))
      if (dist < mind) then
         mind = dist
         ni = i
         nj = j
      endif
   enddo
   enddo

———————————

Hope this is of some help!
Ben

@mvertens
Copy link
Contributor

mvertens commented Sep 4, 2017

In addition from CESM-Development#65 - the following additional information is provided:

After a quick review for re-implementation in datm8, it looks like shr_scam_getCloseLatLon doesn't handle the wraparound lon properly. it also may not reset lons to [0,360] if lon values are ever less than -360. these probably don't cause any serious problems but could be fixed quite easily too. it also assumes a 2d regular lat lon grid. this could also easily be extended to more general grids.

@mvertens
Copy link
Contributor

mvertens commented Sep 4, 2017

@jtruesdal @jedwards4b - should this be added to the cesm2 release? Is it reasonable to run SCAM on a displaced pole grid? I'm not sure what Ben was doing - but we should sort it out now as we reimplement scam within the CIME scripts.

@rljacob
Copy link
Member

rljacob commented Sep 4, 2017

Alerting @bogensch

@jtruesdal
Copy link
Contributor

Thanks Ben for your investigation and code mods. I think the deficiencies noted should be fixed. Now that SCAM functionality has been enhanced to act as a single column CESM I think the share code should return the proper column data for the supported grid types. If everyone's agreed I will be happy to put a PR together for this. I will touch base with Mariana and Jim regarding ideas for extending the code for more general grids.

@rljacob
Copy link
Member

rljacob commented Nov 29, 2017

@mvertens says this is completed.

@rljacob rljacob closed this as completed Nov 29, 2017
@rljacob rljacob removed the ready label Nov 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants