<p><b>mpetersen@lanl.gov</b> 2010-05-14 13:04:36 -0600 (Fri, 14 May 2010)</p><p>Merged trunk to branch.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/z_level_mrp/mpas/src/core_ocean/module_test_cases.F
===================================================================
--- branches/ocean_projects/z_level_mrp/mpas/src/core_ocean/module_test_cases.F        2010-05-14 18:09:25 UTC (rev 275)
+++ branches/ocean_projects/z_level_mrp/mpas/src/core_ocean/module_test_cases.F        2010-05-14 19:04:36 UTC (rev 276)
@@ -96,16 +96,11 @@
block_ptr => block_ptr % next
end do
- ! mrp 100507: This whole section is just temporary
- ! print some diagnostics
+ ! Initialize z-level grid variables from h, read in from input file.
block_ptr => domain % blocklist
do while (associated(block_ptr))
h => block_ptr % time_levs(1) % state % h % array
- u => block_ptr % time_levs(1) % state % u % array
- rho => block_ptr % time_levs(1) % state % rho % array
tracers => block_ptr % time_levs(1) % state % tracers % array
-
- u_src => block_ptr % mesh % u_src % array
xCell => block_ptr % mesh % xCell % array
yCell => block_ptr % mesh % yCell % array
@@ -118,46 +113,40 @@
nVertices = block_ptr % mesh % nVertices
nVertLevels = block_ptr % mesh % nVertLevels
- ! mrp 100426: initialize z-level variables.
- if (config_vert_grid_type.eq.'zlevel') then
- ! These should eventually be in an input file. For now
- ! I just read them in from h(:,1).
- hZLevel = h(:,1)
- zTopZLevel(1) = 0.0
- do iLevel = 1,nVertLevels
- zMidZLevel(iLevel) = zTopZLevel(iLevel)-0.5*hZLevel(iLevel)
- zTopZLevel(iLevel+1) = zTopZLevel(iLevel)- hZLevel(iLevel)
- enddo
- if (config_vert_grid_type.eq.'isopycnal') then
- print *, ' Using isopycnal coordinates'
- elseif (config_vert_grid_type.eq.'zlevel') then
- print *, ' Using z-level coordinates'
- else
- print *, ' Incorrect choice of config_vert_grid_type:',&
- config_vert_grid_type
- call dmpar_abort(dminfo)
- endif
-
- tracers = 0.0
- do iCell = 1,nCells
+ if (config_vert_grid_type.eq.'zlevel') then
+ ! These should eventually be in an input file. For now
+ ! I just read them in from h(:,1).
+ hZLevel = h(:,1)
+ zTopZLevel(1) = 0.0
do iLevel = 1,nVertLevels
- ! for 20 layer test
- tracers(index_salinity,iLevel,iCell) = 1.4 + iLevel*0.6 ! salinity
- tracers(index_temperature,iLevel,iCell) = 5.0 ! temperature
-
- tracers(index_tracer1,iLevel,iCell) = 1.0
- tracers(index_tracer2,iLevel,iCell) = &
- (yCell(iCell)/4000.e3 + xCell(iCell)/2500.e3 )/2.0
-
- rho(iLevel,iCell) = 1000.0*( 1.0 &
- - 2.5e-4*tracers(index_temperature,iLevel,iCell) &
- + 7.6e-4*tracers(index_salinity,iLevel,iCell))
+ zMidZLevel(iLevel) = zTopZLevel(iLevel)-0.5*hZLevel(iLevel)
+ zTopZLevel(iLevel+1) = zTopZLevel(iLevel)- hZLevel(iLevel)
enddo
- enddo
+ if (config_vert_grid_type.eq.'isopycnal') then
+ print *, ' Using isopycnal coordinates'
+ elseif (config_vert_grid_type.eq.'zlevel') then
+ print *, ' Using z-level coordinates'
+ else
+ print *, ' Incorrect choice of config_vert_grid_type:',&
+ config_vert_grid_type
+ call dmpar_abort(dminfo)
+ endif
- endif
- ! mrp 100426 end: initialize z-level variables.
+ !tracers = 0.0
+ !do iCell = 1,nCells
+ ! do iLevel = 1,nVertLevels
+ ! ! for 20 layer test
+ ! tracers(index_temperature,iLevel,iCell) = 5.0 ! temperature
+ ! tracers(index_salinity,iLevel,iCell) = 1.4 + iLevel*0.6 ! salinity
+ ! tracers(index_tracer1,iLevel,iCell) = 1.0
+ ! tracers(index_tracer2,iLevel,iCell) = &
+ ! (yCell(iCell)/4000.e3 + xCell(iCell)/2500.e3 )/2.0
+ ! enddo
+ !enddo
+ endif
+
+ ! print some diagnostics
print '(10a)', 'ilevel',&
' rho ',&
' min u max u ',&
@@ -173,7 +162,6 @@
hZLevel(iLevel),zMidZlevel(iLevel),zTopZlevel(iLevel)
enddo
- ! print some diagnostics
print '(10a)', 'itracer ilevel min tracer max tracer'
do iTracer=1,num_tracers
do iLevel = 1,nVertLevels
Modified: branches/ocean_projects/z_level_mrp/mpas/src/core_ocean/module_time_integration.F
===================================================================
--- branches/ocean_projects/z_level_mrp/mpas/src/core_ocean/module_time_integration.F        2010-05-14 18:09:25 UTC (rev 275)
+++ branches/ocean_projects/z_level_mrp/mpas/src/core_ocean/module_time_integration.F        2010-05-14 19:04:36 UTC (rev 276)
@@ -494,7 +494,7 @@
do k=2,nVertLevels
fluxVertTop(k) = config_vert_viscosity &
* ( u(k-1,iEdge) - u(k,iEdge) ) &
- / (zMidEdge(k-1,iEdge) -zMidEdge(k,iEdge))
+ / (zMidEdge(k-1,iEdge) - zMidEdge(k,iEdge))
enddo
do k=1,nVertLevels
tend_u(k,iEdge) = tend_u(k,iEdge) &
Modified: branches/ocean_projects/z_level_mrp/mpas/src/framework/module_io_input.F
===================================================================
--- branches/ocean_projects/z_level_mrp/mpas/src/framework/module_io_input.F        2010-05-14 18:09:25 UTC (rev 275)
+++ branches/ocean_projects/z_level_mrp/mpas/src/framework/module_io_input.F        2010-05-14 19:04:36 UTC (rev 276)
@@ -103,6 +103,7 @@
type (exchange_list), pointer :: sendEdgeList, recvEdgeList
type (exchange_list), pointer :: sendVertexList, recvVertexList
type (exchange_list), pointer :: sendVertLevelList, recvVertLevelList
+ type (exchange_list), pointer :: sendVertLevelP1List, recvVertLevelP1List
type (exchange_list), pointer :: send1Halo, recv1Halo
type (exchange_list), pointer :: send2Halo, recv2Halo
type (graph) :: partial_global_graph_info
@@ -693,7 +694,28 @@
deallocate(local_vertlevel_list)
deallocate(needed_vertlevel_list)
+ if (domain % dminfo % my_proc_id == 0) then
+ allocate(local_vertlevel_list(nVertLevels+1))
+ do i=1,nVertLevels+1
+ local_vertlevel_list(i) = i
+ end do
+ else
+ allocate(local_vertlevel_list(0))
+ end if
+ allocate(needed_vertlevel_list(nVertLevels+1))
+ do i=1,nVertLevels+1
+ needed_vertlevel_list(i) = i
+ end do
+ call dmpar_get_owner_list(domain % dminfo, &
+ size(local_vertlevel_list), size(needed_vertlevel_list), &
+ local_vertlevel_list, needed_vertlevel_list, &
+ sendVertLevelP1List, recvVertLevelP1List)
+
+ deallocate(local_vertlevel_list)
+ deallocate(needed_vertlevel_list)
+
+
!
! Read and distribute all fields given ownership lists and exchange lists (maybe already in block?)
!
@@ -765,7 +787,7 @@
readCellStart, nReadCells, readEdgeStart, nReadEdges, readVertexStart, nReadVertices, &
readVertLevelStart, nReadVertLevels, &
sendCellList, recvCellList, sendEdgeList, recvEdgeList, sendVertexList, recvVertexList, &
- sendVertLevelList, recvVertLevelList)
+ sendVertLevelList, recvVertLevelList, sendVertLevelP1List, recvVertLevelP1List)
call io_input_finalize(input_obj, domain % dminfo)
@@ -977,7 +999,8 @@
sendCellsList, recvCellsList, &
sendEdgesList, recvEdgesList, &
sendVerticesList, recvVerticesList, &
- sendVertLevelsList, recvVertLevelsList)
+ sendVertLevelsList, recvVertLevelsList, &
+ sendVertLevelsP1List, recvVertLevelsP1List)
implicit none
@@ -990,6 +1013,7 @@
type (exchange_list), pointer :: sendEdgesList, recvEdgesList
type (exchange_list), pointer :: sendVerticesList, recvVerticesList
type (exchange_list), pointer :: sendVertLevelsList, recvVertLevelsList
+ type (exchange_list), pointer :: sendVertLevelsP1List, recvVertLevelsP1List
type (field1dInteger) :: int1d
type (field2dInteger) :: int2d
Modified: branches/ocean_projects/z_level_mrp/mpas/src/framework/module_io_output.F
===================================================================
--- branches/ocean_projects/z_level_mrp/mpas/src/framework/module_io_output.F        2010-05-14 18:09:25 UTC (rev 275)
+++ branches/ocean_projects/z_level_mrp/mpas/src/framework/module_io_output.F        2010-05-14 19:04:36 UTC (rev 276)
@@ -23,6 +23,7 @@
type (exchange_list), pointer :: sendEdgesList, recvEdgesList
type (exchange_list), pointer :: sendVerticesList, recvVerticesList
type (exchange_list), pointer :: sendVertLevelsList, recvVertLevelsList
+ type (exchange_list), pointer :: sendVertLevelsP1List, recvVertLevelsP1List
end type io_output_object
@@ -66,6 +67,8 @@
nullify(output_obj % recvVerticesList)
nullify(output_obj % sendVertLevelsList)
nullify(output_obj % recvVertLevelsList)
+ nullify(output_obj % sendVertLevelsP1List)
+ nullify(output_obj % recvVertLevelsP1List)
output_obj % validExchangeLists = .false.
#include "output_dim_inits.inc"
@@ -110,6 +113,7 @@
integer, dimension(:), pointer :: neededEdgeList
integer, dimension(:), pointer :: neededVertexList
integer, dimension(:), pointer :: neededVertLevelList
+ integer, dimension(:), pointer :: neededVertLevelP1List
integer, dimension(:,:), pointer :: cellsOnCell, edgesOnCell, verticesOnCell, &
cellsOnEdge, verticesOnEdge, edgesOnEdge, cellsOnVertex, edgesOnVertex
integer, dimension(:,:), pointer :: cellsOnCell_save, edgesOnCell_save, verticesOnCell_save, &
@@ -210,6 +214,7 @@
allocate(neededEdgeList(nEdgesGlobal))
allocate(neededVertexList(nVerticesGlobal))
allocate(neededVertLevelList(nVertLevelsGlobal))
+ allocate(neededVertLevelP1List(nVertLevelsGlobal+1))
do i=1,nCellsGlobal
neededCellList(i) = i
end do
@@ -222,11 +227,15 @@
do i=1,nVertLevelsGlobal
neededVertLevelList(i) = i
end do
+ do i=1,nVertLevelsGlobal+1
+ neededVertLevelP1List(i) = i
+ end do
else
allocate(neededCellList(0))
allocate(neededEdgeList(0))
allocate(neededVertexList(0))
allocate(neededVertLevelList(0))
+ allocate(neededVertLevelP1List(0))
end if
if (.not. output_obj % validExchangeLists) then
@@ -250,6 +259,11 @@
neededVertLevelList, neededVertLevelList, &
output_obj % sendVertLevelsList, output_obj % recvVertLevelsList)
+ call dmpar_get_owner_list(domain % dminfo, &
+ size(neededVertLevelP1List), size(neededVertLevelP1List), &
+ neededVertLevelP1List, neededVertLevelP1List, &
+ output_obj % sendVertLevelsP1List, output_obj % recvVertLevelsP1List)
+
output_obj % validExchangeLists = .true.
end if
Modified: branches/ocean_projects/z_level_mrp/mpas/src/registry/gen_inc.c
===================================================================
--- branches/ocean_projects/z_level_mrp/mpas/src/registry/gen_inc.c        2010-05-14 18:09:25 UTC (rev 275)
+++ branches/ocean_projects/z_level_mrp/mpas/src/registry/gen_inc.c        2010-05-14 19:04:36 UTC (rev 276)
@@ -576,20 +576,30 @@
fortprintf(fd, " allocate(s %% %s %% ioinfo)</font>
<font color="red">", var_ptr->name_in_code);
fortprintf(fd, " allocate(s %% %s %% array(", var_ptr->name_in_code);
dimlist_ptr = var_ptr->dimlist;
- if (!strncmp(dimlist_ptr->dim->name_in_file, "nCells", 1024) ||
- !strncmp(dimlist_ptr->dim->name_in_file, "nEdges", 1024) ||
- !strncmp(dimlist_ptr->dim->name_in_file, "nVertices", 1024))
- fortprintf(fd, "b %% mesh %% %s + 1", dimlist_ptr->dim->name_in_code);
- else
- fortprintf(fd, "b %% mesh %% %s", dimlist_ptr->dim->name_in_code);
- dimlist_ptr = dimlist_ptr->next;
- while (dimlist_ptr) {
+ if (dimlist_ptr->dim->constant_value < 0) {
if (!strncmp(dimlist_ptr->dim->name_in_file, "nCells", 1024) ||
!strncmp(dimlist_ptr->dim->name_in_file, "nEdges", 1024) ||
!strncmp(dimlist_ptr->dim->name_in_file, "nVertices", 1024))
- fortprintf(fd, ", b %% mesh %% %s + 1", dimlist_ptr->dim->name_in_code);
+ fortprintf(fd, "b %% mesh %% %s + 1", dimlist_ptr->dim->name_in_code);
else
- fortprintf(fd, ", b %% mesh %% %s", dimlist_ptr->dim->name_in_code);
+ fortprintf(fd, "b %% mesh %% %s", dimlist_ptr->dim->name_in_code);
+ }
+ else {
+ fortprintf(fd, "%i", dimlist_ptr->dim->constant_value);
+ }
+ dimlist_ptr = dimlist_ptr->next;
+ while (dimlist_ptr) {
+ if (dimlist_ptr->dim->constant_value < 0) {
+ if (!strncmp(dimlist_ptr->dim->name_in_file, "nCells", 1024) ||
+ !strncmp(dimlist_ptr->dim->name_in_file, "nEdges", 1024) ||
+ !strncmp(dimlist_ptr->dim->name_in_file, "nVertices", 1024))
+ fortprintf(fd, ", b %% mesh %% %s + 1", dimlist_ptr->dim->name_in_code);
+ else
+ fortprintf(fd, ", b %% mesh %% %s", dimlist_ptr->dim->name_in_code);
+ }
+ else {
+ fortprintf(fd, ", %i", dimlist_ptr->dim->constant_value);
+ }
dimlist_ptr = dimlist_ptr->next;
}
fortprintf(fd, "))</font>
<font color="gray">");
@@ -1024,10 +1034,7 @@
fortprintf(fd, ", block %% mesh %% %s, &</font>
<font color="red">", lastdim->dim->name_in_code);
if (is_derived_dim(lastdim->dim->name_in_code)) {
- split_derived_dim_string(lastdim->dim->name_in_code, &cp1, &cp2);
- fortprintf(fd, " send%sList, recv%sList)</font>
<font color="red">", cp1, cp1);
- free(cp1);
- free(cp2);
+ fortprintf(fd, " send%sList, recv%sList)</font>
<font color="black">", lastdim->dim->name_in_file+1, lastdim->dim->name_in_file+1);
}
else
fortprintf(fd, " send%sList, recv%sList)</font>
<font color="gray">", lastdim->dim->name_in_code+1, lastdim->dim->name_in_code+1);
@@ -1537,7 +1544,7 @@
if (is_derived_dim(lastdim->dim->name_in_code)) {
split_derived_dim_string(lastdim->dim->name_in_code, &cp1, &cp2);
fortprintf(fd, ", n%sGlobal%s, &</font>
<font color="red">", cp1, cp2);
- fortprintf(fd, " output_obj %% send%sList, output_obj %% recv%sList)</font>
<font color="blue">", cp1, cp1);
+ fortprintf(fd, " output_obj %% send%sList, output_obj %% recv%sList)</font>
<font color="black">", lastdim->dim->name_in_file+1, lastdim->dim->name_in_file+1);
free(cp1);
free(cp2);
}
</font>
</pre>