<p><b>akt@lanl.gov</b> 2013-01-31 11:10:12 -0700 (Thu, 31 Jan 2013)</p><p>Initial added cice files<br>
</p><hr noshade><pre><font color="gray">Added: branches/cice_projects/initial_cice_core/src/core_cice/mpas_cice_convert_to_CICE.F
===================================================================
--- branches/cice_projects/initial_cice_core/src/core_cice/mpas_cice_convert_to_CICE.F                                (rev 0)
+++ branches/cice_projects/initial_cice_core/src/core_cice/mpas_cice_convert_to_CICE.F        2013-01-31 18:10:12 UTC (rev 2406)
@@ -0,0 +1,48 @@
+module cice_convert_to_CICE
+
+  implicit none
+
+  ! vertical layer numbers
+  integer :: &amp;
+       nilyr , &amp;
+       nslyr
+
+  ! number of tracers
+  integer :: ntrcr
+
+  ! tracer array start positions
+  integer :: &amp;
+       nt_Tsfc , &amp;
+       nt_qice , &amp;
+       nt_qsno
+
+
+
+
+contains
+
+  !-------------------------------------------------------------------------
+
+  subroutine init_convert_to_CICE(domain)
+
+    type (domain_type), intent(in) :: domain 
+
+    ! vertical layer numbers
+    nilyr = domain % blocklist % mesh % nIceLayers
+    nslyr = domain % blocklist % mesh % nSnowLayers
+
+    ! tracer array start positions and tracer number
+    nt_Tsfc = 1           ! index tracers, starting with Tsfc = 1
+    ntrcr = 1             ! count tracers, starting with Tsfc = 1
+    
+    nt_qice = ntrcr + 1
+    ntrcr = ntrcr + nilyr ! qice in nilyr layers
+    
+    nt_qsno = ntrcr + 1
+    ntrcr = ntrcr + nslyr ! qsno in nslyr layers
+
+  end subroutine init_convert_to_CICE
+
+  !-------------------------------------------------------------------------
+
+end module cice_convert_to_CICE

Added: branches/cice_projects/initial_cice_core/src/core_cice/mpas_cice_init.F
===================================================================
--- branches/cice_projects/initial_cice_core/src/core_cice/mpas_cice_init.F                                (rev 0)
+++ branches/cice_projects/initial_cice_core/src/core_cice/mpas_cice_init.F        2013-01-31 18:10:12 UTC (rev 2406)
@@ -0,0 +1,23 @@
+module cice_init
+
+  implicit none
+
+
+contains
+
+  !-------------------------------------------------------------------------
+  
+  subroutine init_data(domain)
+
+    use cice_convert_to_CICE
+
+    type (domain_type), intent(in) :: domain 
+
+    init_convert_to_CICE(domain)
+
+
+  end subroutine init_data
+
+  !-------------------------------------------------------------------------
+
+end module cice_init

Added: branches/cice_projects/initial_cice_core/src/core_cice/mpas_cice_timestep.F
===================================================================
--- branches/cice_projects/initial_cice_core/src/core_cice/mpas_cice_timestep.F                                (rev 0)
+++ branches/cice_projects/initial_cice_core/src/core_cice/mpas_cice_timestep.F        2013-01-31 18:10:12 UTC (rev 2406)
@@ -0,0 +1,125 @@
+module cice_timestep
+
+  use mpas_grid_types
+  use cice_convert_to_CICE
+
+  implicit none
+
+
+contains
+
+  !-------------------------------------------------------------------------
+
+  subroutine mpas_timestep(domain, itimestep, dt, timeStamp)
+
+    type (domain_type), intent(inout) :: domain 
+    integer, intent(in) :: itimestep
+    real (kind=RKIND), intent(in) :: dt
+    character(len=*), intent(in) :: timeStamp
+
+    call step_therm1(domain, dt)
+
+
+
+  end subroutine mpas_timestep
+
+  !-------------------------------------------------------------------------
+
+  subroutine step_therm1(domain, dt)
+
+    type (domain_type), intent(inout) :: domain 
+    real (kind=RKIND), intent(in) :: dt
+    integer :: nCells, nCategories
+    integer :: iCell
+
+    type (struct_type) :: flux, state, tracer, mesh
+
+    ! original non-local variables
+    real(kind=RKIND), dimension(1,1,1) :: &amp;
+         aice     , &amp;
+         sst      , &amp;
+         Tf       , &amp;
+         strocnxT , &amp;
+         strocnyT , &amp;
+         rside    , &amp;
+         frzmlt
+
+    real(kind=RKIND), dimension(:,:,:,:), allocatable :: &amp;
+         vicen , &amp;
+         vsnon
+
+    real(kind=RKIND), dimension(:,:,:,:,:), allocatable :: &amp;
+         trcrn
+
+    ! original step_therm1 variables
+    real(kind=RKIND), dimension(1,1) :: &amp;
+         Tbot, &amp;
+         fbot
+
+    mesh   =&gt; domain % blocklist % mesh
+    flux   =&gt; domain % blocklist % flux
+    staten =&gt; domain % blocklist % state
+    tracer =&gt; domain % blocklist % tracer
+
+    nCells      = meshnnCells
+    nCategories = mesh % nCategories
+
+    allocate(vicen(1,1,nCategories,1))
+    allocate(vsnon(1,1,nCategories,1))
+    allocate(trcrn(1,1,ntrcr,nCategories,1))
+
+    ! loop over all cells
+    do iCell = 1, nCells
+
+       ! state variable conversion
+       aice(1,1,1)    = state % iceAreaCell % array(iCell)
+       vicen(1,1,:,1) = state % iceVolumeCell % array(iCell,:)
+       vsnon(1,1,:,1) = state % snowVolumeCell % array(iCell,:)
+
+       ! flux varible conversion
+       sst(1,1,1)    = flux % seaSurfaceTemperature % array(iCell)
+       Tf(1,1,1)     = flux % seaFreezingTemperature % array(iCell)
+       rside(1,1,1)  = flux % iceLateralMeltFraction % array(iCell)
+       frzmlt(1,1,1) = flux % seaFreezeMeltPotential % array(iCell)
+
+       strocnxT(1,1,1) = c0
+       strocnyT(1,1,1) = c0
+
+       ! tracer conversion
+       trcrn(1,1,nt_qice:nt_qice+nilyr-1,:,1) = tracer % iceVolumeLayerTracers % array(index_iceEnthalpy,:,iCell,:)
+       trcrn(1,1,nt_qsno:nt_qsno+nilyr-1,:,1) = tracer % snowVolumeLayerTracers % array(index_snowEnthalpy,:,iCell,:)
+
+       !!! BEGIN ORIGINAL CICE CALL
+       !call frzmlt_bottom_lateral(1, 1,                                 &amp;
+       !                           1, 1, 1, 1,                           &amp;
+       !                           ntrcr,             dt,                &amp;
+       !                           aice    (:,:,:),   frzmlt  (:,:,:),   &amp;
+       !                           vicen   (:,:,:,1), vsnon   (:,:,:,:), &amp;
+       !                           trcrn   (:,:,1:ntrcr,:,:),            &amp;
+       !                           sst     (:,:,:),   Tf      (:,:,:),   &amp;
+       !                           strocnxT(:,:,:),   strocnyT(:,:,:),   &amp;
+       !                           Tbot,              fbot,              &amp;
+       !                           rside   (:,:,:))
+       !!! END ORIGINAL CICE CALL
+
+       ! state variable back conversion
+       state % iceAreaCell % array(iCell)      = aice(1,1,1)
+       state % iceVolumeCell % array(iCell,:)  = vicen(1,1,:,1)
+       state % snowVolumeCell % array(iCell,:) = vsnon(1,1,:,1)
+
+       ! tracer back conversion
+       tracer % iceVolumeLayerTracers % array(index_iceEnthalpy,:,iCell,:)   = trcrn(1,1,nt_qice:nt_qice+nilyr-1,:,1)
+       tracer % snowVolumeLayerTracers % array(index_snowEnthalpy,:,iCell,:) = trcrn(1,1,nt_qsno:nt_qsno+nilyr-1,:,1)
+
+    enddo ! iCell
+
+    ! clean up original variables
+    deallocate(vicen)
+    deallocate(vsnon)
+    deallocate(trcrn)
+
+  end subroutine step_therm1
+
+  !-------------------------------------------------------------------------
+
+end module cice_timestep

</font>
</pre>