Rules for coupling ISSM and MITgcm:

* 
>>>> CREATE A FILE WITH ALL THE NAMES AND TAGS FOR THE INFORMATION EXCHANGE INCLUDING:
CouplingTime           1           Real*8  10001000
IceModelTime           1           Real*8  10001001
OceanModelTime         1           Real*8  10001002
Nx                     1           Integer 10001003
Ny                     1           Integer 10001004
xC                     Nx*Ny       Real*8  10001005
yC                     Nx*Ny       Real*8  10001006
IceBase                Nx*Ny       Real*8  10001007
OceanMelt              Nx*Ny       Real*8  10001008

>>>> INITIALIZATION FROM SCRATCH

Initialization:
IceModelTime   = 0
OceanModelTime = 0

  I1. ISSM sends CouplingTime
      (the interval at which we couple)

  I2. MITgcm sends grid size (NX and NY)

  I3. MITgcm sends grid coordinates of center of cells
      (longitude -180 <= XC < 180 and latitude YC)

  I4. ISSM sends ice model time IceTimeTag

  I5. MITgcm sends ocean model time OceanTimeTag

  I6. ISSM sends IceModelTime=0 base to MITgcm
      (base should be 9999 in areas not covered by ice grid)

  I7. MITgcm integrates from OceanModelTime=0
                          to OceanModelTime=CouplingTime

First Coupling Exchange:
IceModelTime   = 0
OceanModelTime = CouplingTime

  C1. ISSM sends ice model time IceTimeTag

  C2. MITgcm sends ocean model time OceanTimeTag

  C3. MITgcm sends
      0 <= OceanModelTime < CouplingTime
      time-mean melt rate to ISSM
  
  C4. ISSM sends IceModelTime=0 base to MITgcm
      (this is duplicate of Initialization)

  C5i. ISSM integrates from IceModelTime=0
                         to IceModelTime=CouplingTime

  C5o. MITgcm integrates from OceanModelTime=CouplingTime
                           to OceanModelTime=2*CouplingTime

...

Coupling Exchange N:
IceModelTime   = (N-1) * CouplingTime
OceanModelTime =   N   * CouplingTime

  C1. ISSM sends ice model time IceTimeTag

  C2. MITgcm sends ocean model time OceanTimeTag

  C3. MITgcm sends
      (N-1)*CouplingTime <= OceanModelTime < N*CouplingTime
      time-mean melt rate to ISSM
  
  C4. ISSM sends IceModelTime=(N-1)*CouplingTime base to MITgcm

  C5i. ISSM integrates from IceModelTime=(N-1)*CouplingTime
                         to IceModelTime=N*CouplingTime

  C5o. MITgcm integrates from OceanModelTime=N*CouplingTime
                           to OceanModelTime=(N+1)*CouplingTime

Termination:
IceModelTime   =   N   * CouplingTime
OceanModelTime = (N+1) * CouplingTime

  C1. ISSM sends ice model time IceTimeTag

  C2. MITgcm sends ocean model time OceanTimeTag

  C3. MITgcm sends
      N*CouplingTime <= OceanModelTime < (N+1)*CouplingTime
      time-mean melt rate to ISSM
  
  C4i. ISSM saves to restart files the IceModelTime=N state and
       the N*CouplingTime to (N+1)*CouplingTime mean melt rate

  C4o. MITgcm saves to restart files
       the OceanModelTime=(N+1)*CouplingTime state


>>>> RESTART FROM SAVED STATE

Initialization:
IceModelTime   =   N   * CouplingTime
OceanModelTime = (N+1) * CouplingTime

  I1. ISSM sends CouplingTime

  I2. MITgcm sends grid size (NX and NY)

  I3. MITgcm sends grid coordinates (XC and YC)

  I4i. ISSM reads from restart files the IceModelTime=N state and
       the N*CouplingTime to (N+1)*CouplingTime mean melt rate

  I4o. MITgcm reads from restart files
       the OceanModelTime=(N+1)*CouplingTime state

  I5. ISSM sends ice model time IceTimeTag

  I6. MITgcm sends ocean model time OceanTimeTag

  I7. ISSM sends IceModelTime=N base to MITgcm

  I8i. ISSM integrates from IceModelTime=N*CouplingTime
                         to IceModelTime=(N+1)*CouplingTime

  I8o. MITgcm integrates from OceanModelTime=(N+1)*CouplingTime
                          to OceanModelTime=(N+2)*CouplingTime

First Coupling Exchange:
IceModelTime   = (N+1)   * CouplingTime
OceanModelTime = (N+2) * CouplingTime

  C1. ISSM sends ice model time IceTimeTag

  C2. MITgcm sends ocean model time OceanTimeTag

  C3. MITgcm sends
      (N+1)*CouplingTime <= OceanModelTime < (N+2)*CouplingTime
      time-mean melt rate to ISSM
  
  C4. ISSM sends IceModelTime=(N+1)*CouplingTime base to MITgcm

  C5i. ISSM integrates from IceModelTime=(N+1)*CouplingTime
                         to IceModelTime=(N+2)*CouplingTime

  C5o. MITgcm integrates from OceanModelTime=(N+2)*CouplingTime
                           to OceanModelTime=(N+3)*CouplingTime

...


TODO/WISH LIST
* finish initialization 
   - MITgcm runs 1 time step with ocean ice base, not from ISSM
* do other time steps (coupling time = N)
* ISSM works on interpolation
* 1 + 1 = 2 (so pickup working)
* change MITgcm to include new base and changes in ocean
* make sure that RunCoupledMITgcmISSM and RunCoupledMITgcmISSM2
  can produce the same results!
