<p><b>duda</b> 2011-09-07 11:12:04 -0600 (Wed, 07 Sep 2011)</p><p>BRANCH COMMIT<br>
<br>
Update sst-update initialization code to process either SKINTEMP or SST,<br>
whichever is found in the input files.<br>
<br>
Fix issue with missing data near poles when the transformed y coordinate<br>
for a grid cell was slightly below or above the bottom or top edge of the<br>
SST data set, respectively.<br>
<br>
M    src/core_init_nhyd_atmos/module_test_cases.F<br>
</p><hr noshade><pre><font color="gray">Modified: branches/atmos_physics/src/core_init_nhyd_atmos/module_test_cases.F
===================================================================
--- branches/atmos_physics/src/core_init_nhyd_atmos/module_test_cases.F        2011-09-07 17:00:48 UTC (rev 983)
+++ branches/atmos_physics/src/core_init_nhyd_atmos/module_test_cases.F        2011-09-07 17:12:04 UTC (rev 984)
@@ -4044,7 +4044,7 @@
 
       call output_state_init(sfc_update_obj, domain, &quot;SFC&quot;)
 
-      ! Loop over all times, interpolating the SKINTEMP field from each intermediate file
+      ! Loop over all times, interpolating the SST/SKINTEMP field from each intermediate file
       curr_time = MPAS_getClockTime(fg_clock, MPAS_NOW) 
       do while (curr_time &lt;= stop_time)
          call MPAS_getTime(curr_time, dateTimeString=timeString)
@@ -4057,11 +4057,11 @@
             exit
          end if
 
-         ! Scan through all fields in the file, looking for the SKINTEMP field
+         ! Scan through all fields in the file, looking for the SST or SKINTEMP field
          call read_next_met_field(field, istatus)
          do while (istatus == 0)
 
-            if (index(field % field, 'SKINTEMP') /= 0) then
+            if (index(field % field, 'SKINTEMP') /= 0 .or. index(field % field, 'SST') /= 0) then
 
                ! Interpolation routines use real(kind=RKIND), so copy from default real array
                allocate(slab_r8(field % nx, field % ny))
@@ -4086,11 +4086,16 @@
                                lon1 = real(field % startlon))
                end if
    
-               ! Interpolate SKINTEMP field to each MPAS grid cell
+               ! Interpolate SST/SKINTEMP field to each MPAS grid cell
                do iCell=1,grid % nCells
                   lat = grid % latCell % array(iCell) * DEG_PER_RAD
                   lon = grid % lonCell % array(iCell) * DEG_PER_RAD
                   call latlon_to_ij(proj, lat, lon, x, y)
+                  if (y &lt; 0.5) then
+                     y = 1.0
+                  else if (y &gt;= real(field%ny)+0.5) then
+                     y = real(field % ny)
+                  end if
                   if (x &lt; 0.5) then
                      lon = lon + 360.0
                      call latlon_to_ij(proj, lat, lon, x, y)

</font>
</pre>