<p><b>ringler@lanl.gov</b> 2012-04-26 15:03:30 -0600 (Thu, 26 Apr 2012)</p><p><br>
code to interpolate monthly forcing data to day-of-month<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/monthly_forcing/src/core_ocean/mpas_ocn_monthly_forcing.F
===================================================================
--- branches/ocean_projects/monthly_forcing/src/core_ocean/mpas_ocn_monthly_forcing.F        2012-04-26 18:45:50 UTC (rev 1819)
+++ branches/ocean_projects/monthly_forcing/src/core_ocean/mpas_ocn_monthly_forcing.F        2012-04-26 21:03:30 UTC (rev 1820)
@@ -105,6 +105,7 @@
real (kind=RKIND), dimension(:,:), pointer :: windStress
integer :: iCell, iEdge, nCells, nEdges, nMonths, k
integer :: iMonth, iMonthP1, iDayInMonth, ierr
+ real (kind=RKIND) :: data, dataP1, weight, weightP1
err = 0
@@ -128,12 +129,24 @@
iMonthP1 = mod(iMonth + 1, nMonths) + 1
+ weight = 1.0 - (iDayInMonth-1) / 30.0
+ weightP1 = 1.0 - weight
+
do iCell=1,nCells
! Interpolate between iMonth and iMonthP1 records, using iDayInMonth
+ data = temperatureRestoreMonthly(iCell,iMonth)
+ dataP1 = temperatureRestoreMonthly(iCell,iMonthP1)
+ temperatureRestore(iCell) = data * weight + dataP1 * weightP1
+ data = salinityRestoreMonthly(iCell,iMonth)
+ dataP1 = salinityRestoreMonthly(iCell,iMonthP1)
+ salinityRestore(iCell) = data * weight + dataP1 * weightP1
end do
do iEdge=1,nEdges
! Interpolate between iMonth and iMonthP1 records, using iDayInMonth
+ data = windStressMonthly(1,iEdge,iMonth)
+ dataP1 = windStressMonthly(1,iEdge,iMonthP1)
+ windStress(1,iEdge) = data * weight + dataP1 * weightP1
end do
!--------------------------------------------------------------------
</font>
</pre>