Welcome to the new DiscussCESM forum!
We are still working on the website migration, so you may experience downtime during this process.

Existing users, please reset your password before logging in here: https://xenforo.cgd.ucar.edu/cesm/index.php?lost-password/

HOW TO add SST anomaly IN SLAB OCEAN MODEL(cesm1.0.6 E compset)

Hi there,The experiment I am trying to run is adding sst anomaly in some region (say tropical Pacific) and see its evolution and impact. As I know from this forum, I should modify code in docn_comp_mod.F90. But either somtp(:) or o2x%rAttr(kt,:) is 1D arrays. My question is how to read and convert 2D arrays containing sst in real map grid in to these kinds of 1D array.
Code:
<a name="609"></a>   case('SOM')<a name="610"></a>
      lsize = mct_avect_lsize(o2x)<a name="611"></a>
      do n = 1,SDOCN%nstreams<a name="612"></a>
         call <a href="http://www.cesm.ucar.edu/models/cesm1.0/cesm/cesmAbrowser/html_code/csm_share/shr_dmodel_mod.F90.html#SHR_DMODEL_TRANSLATEAV">shr_dmodel_translateAV</a><a href="http://www.cesm.ucar.edu/models/cesm1.0/cesm/cesmAbrowser/html_code/docn/docn_comp_mod.F90.html#DOCN_COMP_RUN" target="bottom_target"><img src="http://www.cesm.ucar.edu/models/cesm1.0/cesm/cesmAbrowser/gif/cyan.gif" alt="" border="0" /></a><a name="SHR_DMODEL_TRANSLATEAV_8"></a>(SDOCN%avs(n),avstrm,avifld,avofld,rearr)<a name="613"></a>
      enddo<a name="614"></a>
      if (firstcall) then<a name="615"></a>
         do n = 1,lsize<a name="616"></a>
            if (.not. read_restart) then<a name="617"></a>
               somtp(n) = o2x%rAttr(kt,n) + TkFrz<a name="618"></a>
            endif<a name="619"></a>
            o2x%rAttr(kt,n) = somtp(n)<a name="620"></a>
            o2x%rAttr(kq,n) = 0.0_r8<a name="621"></a>
         enddo<br /><br />
Thanks,Jian
 

dbailey

CSEG and Liaisons
Staff member
You should be able to access the lats and lons in 1D vectors as well. I would use these to add the anomaly for a particular region. Look at what is done for the mask.Dave
 
Hi Dave,Thanks for your reply.  After browsing some code files, I found lon/lat could be accessed as following
Code:
klon = mct_aVect_indexRA(ggrid%data,'lon')
    lon(:) = ggrid%data%rAttr(klon,:)<br /><br />It took me some time to found this method. So I am wondering where could i find the detail structure of ggrid <br />and what attributes are associated with it.<br /><br />When I print lon/lat, I see the interval is 1deg. But when I check the output nc file, <br />the data is on 320*384 grid. This also puzzles me.<br /><br />Jian
 
Top