<p><b>mpetersen@lanl.gov</b> 2012-10-17 11:36:32 -0600 (Wed, 17 Oct 2012)</p><p>branch commit, basin_pbc_mrp: Some minor alterations for sigma coordinates.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/basin_pbc_mrp/namelist.basin
===================================================================
--- branches/ocean_projects/basin_pbc_mrp/namelist.basin        2012-10-17 17:34:51 UTC (rev 2217)
+++ branches/ocean_projects/basin_pbc_mrp/namelist.basin        2012-10-17 17:36:32 UTC (rev 2218)
@@ -1 +1 @@
-link namelists/namelist.Ilicak2_overflow_sigma
\ No newline at end of file
+link namelists/namelist.global_realistic
\ No newline at end of file

Modified: branches/ocean_projects/basin_pbc_mrp/namelists/namelist.Ilicak2_overflow
===================================================================
--- branches/ocean_projects/basin_pbc_mrp/namelists/namelist.Ilicak2_overflow        2012-10-17 17:34:51 UTC (rev 2217)
+++ branches/ocean_projects/basin_pbc_mrp/namelists/namelist.Ilicak2_overflow        2012-10-17 17:36:32 UTC (rev 2218)
@@ -6,7 +6,7 @@
   bottom_topography = 'Ilicak2_overflow'
   initial_conditions = 'Ilicak2_overflow'
   eliminate_inland_seas=.false.
-  l_woce = .false.
+  load_woce_IC = .false.
   write_OpenDX_flag = .false.
   monthly_forcing = .false.
   cut_domain_from_sphere = .false.

Modified: branches/ocean_projects/basin_pbc_mrp/namelists/namelist.Ilicak2_overflow_sigma
===================================================================
--- branches/ocean_projects/basin_pbc_mrp/namelists/namelist.Ilicak2_overflow_sigma        2012-10-17 17:34:51 UTC (rev 2217)
+++ branches/ocean_projects/basin_pbc_mrp/namelists/namelist.Ilicak2_overflow_sigma        2012-10-17 17:36:32 UTC (rev 2218)
@@ -2,11 +2,11 @@
   nVertLevelsMOD = 10
   on_a_sphere = 'NO'
   sphere_radius = 0.0
-  zLevel_thickness = 'zero'
-  bottom_topography = 'Ilicak2_overflow'
+  zLevel_thickness = 'equally_spaced'
+  bottom_topography = 'Ilicak2_overflow_sigma'
   initial_conditions = 'Ilicak2_overflow_sigma'
   eliminate_inland_seas=.false.
-  l_woce = .false.
+  load_woce_IC = .false.
   write_OpenDX_flag = .false.
   monthly_forcing = .false.
   cut_domain_from_sphere = .false.

Modified: branches/ocean_projects/basin_pbc_mrp/namelists/namelist.global_realistic
===================================================================
--- branches/ocean_projects/basin_pbc_mrp/namelists/namelist.global_realistic        2012-10-17 17:34:51 UTC (rev 2217)
+++ branches/ocean_projects/basin_pbc_mrp/namelists/namelist.global_realistic        2012-10-17 17:36:32 UTC (rev 2218)
@@ -6,7 +6,7 @@
   bottom_topography = 'realistic_ETOPO'
   initial_conditions = 'realistic_WOCE'
   eliminate_inland_seas=.true.
-  l_woce = .true.
+  load_woce_IC = .true.
   write_OpenDX_flag = .false.
   monthly_forcing = .true.
   cut_domain_from_sphere = .false.

Modified: branches/ocean_projects/basin_pbc_mrp/src/basin.F
===================================================================
--- branches/ocean_projects/basin_pbc_mrp/src/basin.F        2012-10-17 17:34:51 UTC (rev 2217)
+++ branches/ocean_projects/basin_pbc_mrp/src/basin.F        2012-10-17 17:36:32 UTC (rev 2218)
@@ -107,7 +107,7 @@
 
 ! Variables in namelist file
 character (len=32) :: on_a_sphere, zLevel_thickness,bottom_topography, initial_conditions
-logical :: eliminate_inland_seas, l_woce, write_OpenDX_flag, monthly_forcing, &amp;
+logical :: eliminate_inland_seas, load_woce_IC, write_OpenDX_flag, monthly_forcing, &amp;
    cut_domain_from_sphere, solid_boundary_in_y, solid_boundary_in_x
 integer :: nVertLevelsMOD, top_layers_without_land 
 real (kind=8) :: sphere_radius, h_total_max, u_src_max, f0, beta, omega, Lx
@@ -115,7 +115,7 @@
 ! specify namelist
 namelist /basin/ nVertLevelsMOD, on_a_sphere, sphere_radius, &amp;
    zLevel_thickness, bottom_topography, initial_conditions, &amp;
-   eliminate_inland_seas, l_woce, write_OpenDX_flag, monthly_forcing, &amp;
+   eliminate_inland_seas, load_woce_IC, write_OpenDX_flag, monthly_forcing, &amp;
    cut_domain_from_sphere, solid_boundary_in_y, solid_boundary_in_x, &amp;
    top_layers_without_land, h_total_max, u_src_max, f0, beta, omega, Lx
 
@@ -137,7 +137,7 @@
 initial_conditions = 'realistic_WOCE'
 
 eliminate_inland_seas=.true.
-l_woce = .true.
+load_woce_IC = .true.
 write_OpenDX_flag = .false.
 monthly_forcing = .true.
 cut_domain_from_sphere = .false.
@@ -219,16 +219,36 @@
 ! check the mesh
 call error_checking
 
-write(6,*) ' getting woce t and s '
+if (load_woce_IC) then
+   write(6,*) ' getting woce t and s '
 
-call read_TS_init(nlon, nlat, ndepth,fileNameT, fileNameS, fileNameU)
-write(6,*) ' TS INIT ', nlon, nlat, ndepth
-allocate(t_lon(nlon), t_lat(nlat), depth_t(ndepth), TEMP(nlon,nlat,ndepth), SALT(nlon,nlat,ndepth))
-allocate(TAUX(nlon,nlat), TAUY(nlon,nlat))
-allocate(mTEMP(nlat,ndepth), mSALT(nlat,ndepth))
-call read_TS_fields(t_lon, t_lat, depth_t, TEMP, SALT, TAUX, TAUY)
-call read_TS_finalize()
+   allocate(t_lon(nlon), t_lat(nlat), depth_t(ndepth), TEMP(nlon,nlat,ndepth), SALT(nlon,nlat,ndepth))
+   allocate(TAUX(nlon,nlat), TAUY(nlon,nlat))
+   allocate(mTEMP(nlat,ndepth), mSALT(nlat,ndepth))
 
+   call read_TS_init(nlon, nlat, ndepth,fileNameT, fileNameS, fileNameU)
+   write(6,*) ' TS INIT ', nlon, nlat, ndepth
+   call read_TS_fields(t_lon, t_lat, depth_t, TEMP, SALT, TAUX, TAUY)
+   call read_TS_finalize()
+
+   do k=1,ndepth
+     ndata = 0; temp_t=0; temp_s=0
+     do j=1,nlat
+     do i=1,nlon
+       if(TEMP(i,j,k).gt.-10.0) then
+         ndata = ndata + 1
+         temp_t = temp_t + TEMP(i,j,k)
+         temp_s = temp_s + SALT(i,j,k)
+       endif
+     enddo
+     enddo
+     mTEMP(:,k) = temp_t / float(ndata)
+     mSALT(:,k) = temp_s / float(ndata)
+     write(6,*) ndata,mTemp(1,k),mSalt(1,k)
+   enddo
+
+endif
+
 if(monthly_forcing) then
   allocate(SST_MONTHLY(nlon,nlat,nMonths), SSS_MONTHLY(nlon,nlat,nMonths))
   allocate(TAUX_MONTHLY(nlon,nlat,nMonths), TAUY_MONTHLY(nlon,nlat,nMonths))
@@ -342,22 +362,6 @@
   call read_MONTHLY_finalize()
 end if
 
-do k=1,ndepth
-     ndata = 0; temp_t=0; temp_s=0
-     do j=1,nlat
-     do i=1,nlon
-       if(TEMP(i,j,k).gt.-10.0) then
-         ndata = ndata + 1
-         temp_t = temp_t + TEMP(i,j,k)
-         temp_s = temp_s + SALT(i,j,k)
-       endif
-     enddo
-     enddo
-     mTEMP(:,k) = temp_t / float(ndata)
-     mSALT(:,k) = temp_s / float(ndata)
-     write(6,*) ndata,mTemp(1,k),mSalt(1,k)
-enddo
-
 ! generate initial conditions
 call get_init_conditions
 
@@ -526,8 +530,6 @@
       enddo
    enddo  
 
-   maxLevelCellNew(1:nCellsNew) = nVertLevelsMOD
-
 elseif (initial_conditions.eq.'isopycnal') then
 
    fEdgeNew(:) = 0.0
@@ -766,11 +768,11 @@
 enddo
 
 ! update T and S field with WOCE data
-if(l_woce) then
+if(load_woce_IC) then
 iNoData = 0
 do iCell=1,nCellsNew
   hNew(1,:,iCell) = dz(:)
-  if(mod(iCell,100).eq.0) write(6,*) 'l_woce t and s',iCell
+  if(mod(iCell,100).eq.0) write(6,*) 'load_woce_IC t and s',iCell
   rlon = lonCellNew(iCell)/dtr
   rlat = latCellNew(iCell)/dtr
   ix = nint(rlon/0.1 - 0.05) + nlon + 1
@@ -854,7 +856,7 @@
   do iMonth=1,nMonths
   iNoData = 0
   do iCell=1,nCellsNew
-    if(mod(iCell,100).eq.0) write(6,*) 'l_woce t and s RESTORE',iCell
+    if(mod(iCell,100).eq.0) write(6,*) 'load_woce_IC t and s RESTORE',iCell
     rlon = lonCellNew(iCell)/dtr
     rlat = latCellNew(iCell)/dtr
     ix = nint(rlon/0.1 - 0.05) + nlon + 1
@@ -927,7 +929,7 @@
   salinityRestoreMonthlyNew(:,:) = 0.0
 end if
 
-endif  ! l_woce
+endif  ! load_woce_IC
 
 !repeat
 !do iMonth=1,12
@@ -1540,7 +1542,28 @@
 
     enddo
 
+elseif (bottom_topography.eq.'Ilicak2_overflow_sigma') then
 
+    ridgeDepth = 500.0
+    do iCell = 1,nCells
+      ! From Mehmet Ilicak:
+      ! depth=2000
+      ! val1 = 500 is top of ridge
+      ! h(i,j) = val1 + 0.5*(depth-val1) * (1.0+TANH((lon(i,j)-40000.0)/7000.0)) 
+      bottomDepth(iCell) = ridgeDepth + 0.5*(h_total_max-ridgeDepth) * (1.0+tanh((yCell(iCell)-40000.0)/7000.0)) 
+
+      if (bottomDepth(iCell).lt.0.0.or. &amp;
+          bottomDepth(iCell).gt.refBottomDepth(nVertLevelsMOD)) then
+         print *, 'error: bottomDepth cannot be less than zero or greater than refBottomDepth(nVertLevels)'
+         print *, 'iCell, bottomDepth(iCell):', iCell, bottomDepth(iCell)
+         exit
+      end if
+  
+    enddo
+
+    ! for sigma coordinates, set kmt to the max level.
+    kmt = nVertLevelsMOD
+
 elseif (bottom_topography.eq.'flat_bottom') then
 
    kmt = nVertLevelsMOD
@@ -1827,6 +1850,7 @@
 deallocate(lonVertex)
 deallocate(dcEdge)
 deallocate(dvEdge)
+!deallocate(bottomDepth)
 
 end subroutine map_vectors
 

</font>
</pre>