<p><b>dwj07@fsu.edu</b> 2012-11-02 06:30:14 -0600 (Fri, 02 Nov 2012)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Update to cesm coupling branch.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/cesm_coupling/src/Makefile
===================================================================
--- branches/ocean_projects/cesm_coupling/src/Makefile        2012-11-01 23:04:28 UTC (rev 2292)
+++ branches/ocean_projects/cesm_coupling/src/Makefile        2012-11-02 12:30:14 UTC (rev 2293)
@@ -1,22 +1,23 @@
.SUFFIXES: .F .c .o
ifeq "$(CESM)" "true"
+include $(CASEROOT)/Macros
RM = rm -f
CPP = cpp -C -P -traditional
+FC=$(MPIFC)
+CC=$(MPICC)
NETCDF=$(NETCDF_PATH)
PNETCDF=$(PNETCDF_PATH)
PIO=$(EXEROOT)/pio
-FC=$(MPIFC)
-CC=$(MPICC)
FILE_OFFSET = -DOFFSET64BIT
-CPPFLAGS = $(MODEL_FORMULATION) -DUNDERSCORE $(FILE_OFFSET) $(ZOLTAN_DEFINE) -DMPAS_CESM
-CPPINCLUDES = -I$(EXEROOT)/ocn/source/inc -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
-FFLAGS = -qrealsize=8
-FCINCLUDES = -I$(EXEROOT)/ocn/source/inc -I$(EXEROOT)/csm_share -I$(EXEROOT)/gptl -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
-LIBS = -L$(PIO) -L$(PNETCDF)/lib -L$(NETCDF)/lib -lpio -lpnetcdf -lnetcdf
-include $(CASEROOT)/Macros
+CPPFLAGS += $(MODEL_FORMULATION) $(FILE_OFFSET) $(ZOLTAN_DEFINE) -DMPAS_CESM -D_MPI# -DUNDERSCORE
+CPPINCLUDES += -I$(EXEROOT)/ocn/source/inc -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
+FCINCLUDES += -I$(EXEROOT)/ocn/source/inc -I$(EXEROOT)/csm_share -I$(EXEROOT)/gptl -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
+LIBS += -L$(PIO) -L$(PNETCDF)/lib -L$(NETCDF)/lib -lpio -lpnetcdf -lnetcdf
all:
+        @echo $(CPPINCLUDES)
+        @echo $(FCINCLUDES)
        ( $(MAKE) mpas RM="$(RM)" CPP="$(CPP)" NETCDF="$(NETCDF)" PNETCDF="$(PNETCDF)" \
         PIO="$(PIO)" FC="$(FC)" CC="$(CC)" SFC="$(SFC)" SCC="$(SCC)" \
         CPPFLAGS="$(CPPFLAGS)" CPPINCLUDES="$(CPPINCLUDES)" FCINCLUDES="$(FCINCLUDES)" )
@@ -28,12 +29,13 @@
mpas: reg_includes externals frame ops dycore drver
ifeq "$(CESM)" "true"
+        ar ru lib$(CORE).a external/esmf_time_f90/*.o
        ar ru lib$(CORE).a framework/*.o
        ar ru lib$(CORE).a operators/*.o
        ar ru lib$(CORE).a core_$(CORE)/*.o
        ar ru lib$(CORE).a $(CORE)_cesm_driver/*.o
else
-        $(LINKER) $(LDFLAGS) -o $(CORE)_model.exe driver/*.o -L. -ldycore -lops -lframework $(LIBS) -I./external/esmf_time_f90 -L./external/esmf_time_f90 -lmpas_esmf_time
+        $(LINKER) $(LDFLAGS) -o $(CORE)_model.exe driver/*.o -L. -ldycore -lops -lframework $(LIBS) -I./external/esmf_time_f90 -L./external/esmf_time_f90 -lesmf_time
endif
reg_includes:
@@ -41,27 +43,26 @@
        ( cd inc; $(CPP) ../core_$(CORE)/Registry | ../registry/parse > Registry.processed)
externals: reg_includes
-        ( cd external; $(MAKE) )
-        #( cd external; $(MAKE) FC="$(FC)" SFC="$(SFC)" CC="$(CC)" SCC="$(SCC)" FFLAGS="$(FFLAGS)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" NETCDF="$(NETCDF)" CORE="$(CORE)" )
+        ( cd external; $(MAKE) FC="$(FC)" SFC="$(SFC)" CC="$(CC)" SCC="$(SCC)" FFLAGS="$(FFLAGS)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" NETCDF="$(NETCDF)" CORE="$(CORE)" )
frame: reg_includes externals
-        ( cd framework; $(MAKE) all )
+        ( cd framework; $(MAKE) CPPFLAGS="$(CPPFLAGS)" CPPINCLUDES="$(CPPINCLUDES)" all )
        ln -sf framework/libframework.a libframework.a
ops: reg_includes externals frame
-        ( cd operators; $(MAKE) all )
+        ( cd operators; $(MAKE) CPPFLAGS="$(CPPFLAGS)" CPPINCLUDES="$(CPPINCLUDES)" all )
        ln -sf operators/libops.a libops.a
dycore: reg_includes externals frame ops
-        ( cd core_$(CORE); $(MAKE) all )
+        ( cd core_$(CORE); $(MAKE) CPPFLAGS="$(CPPFLAGS)" CPPINCLUDES="$(CPPINCLUDES)" all )
        ln -sf core_$(CORE)/libdycore.a libdycore.a
ifeq "$(CESM)" "true"
drver: reg_includes externals frame ops dycore
-        ( cd $(CORE)_cesm_driver; $(MAKE) all )
+        ( cd $(CORE)_cesm_driver; $(MAKE) CPPFLAGS="$(CPPFLAGS)" CPPINCLUDES="$(CPPINCLUDES)" all )
else
drver: reg_includes externals frame ops dycore
-        ( cd driver; $(MAKE) all )
+        ( cd driver; $(MAKE) CPPFLAGS="$(CPPFLAGS)" CPPINCLUDES="$(CPPINCLUDES)" all )
endif
clean:
@@ -72,9 +73,6 @@
        ( cd operators; $(MAKE) clean )
        ( cd inc; rm -f *.inc Registry.processed )
        if [ -d core_$(CORE) ] ; then \
-                ( cd core_$(CORE); $(MAKE) clean ) \
+         ( cd core_$(CORE); $(MAKE) clean ) \
        fi;
-        if [ -d $(CORE)_cesm_driver ] ; then \
-                ( cd $(CORE)_cesm_driver; $(MAKE) clean ) \
-        fi;
        ( cd driver; $(MAKE) clean )
Modified: branches/ocean_projects/cesm_coupling/src/framework/mpas_io.F
===================================================================
--- branches/ocean_projects/cesm_coupling/src/framework/mpas_io.F        2012-11-01 23:04:28 UTC (rev 2292)
+++ branches/ocean_projects/cesm_coupling/src/framework/mpas_io.F        2012-11-02 12:30:14 UTC (rev 2293)
@@ -176,7 +176,7 @@
type (fieldlist_type), pointer :: next => null()
end type fieldlist_type
-#ifdef MPAS_CESM
+#ifdef MPAS_CESM
type (iosystem_desc_t), pointer, private, save :: pio_iosystem
#else
type (iosystem_desc_t), private, save :: pio_iosystem
@@ -184,16 +184,13 @@
type (decomplist_type), pointer, private :: decomp_list => null()
type (dm_info), private :: local_dminfo
+
contains
subroutine MPAS_io_set_iosys(io_system)
-
type (iosystem_desc_t), pointer :: io_system
-#ifdef MPAS_CESM
pio_iosystem => io_system
-#endif
-
end subroutine MPAS_io_set_iosys
subroutine MPAS_io_init(dminfo, io_task_count, io_task_stride, ierr)
@@ -205,12 +202,10 @@
integer, intent(in) :: io_task_stride
integer, intent(out), optional :: ierr
-! write(0,*) 'Called MPAS_io_init()'
if (present(ierr)) ierr = MPAS_IO_NOERR
local_dminfo = dminfo
-!write(0,*) 'MGD PIO_init'
#ifndef MPAS_CESM
call PIO_init(local_dminfo % my_proc_id, & ! comp_rank
local_dminfo % comm, & ! comp_comm
@@ -523,7 +518,6 @@
logical :: found
integer :: pio_ierr
-! write(0,*) 'Called MPAS_io_inq_var()'
if (present(ierr)) ierr = MPAS_IO_NOERR
! Sanity checks
@@ -939,9 +933,6 @@
return
end if
-! write(0,*) 'Assigning ', size(indices), ' indices for ', trim(fieldname)
-
-
!
! Check whether the field has been defined
!
@@ -1056,7 +1047,7 @@
pio_type = PIO_int
else if (field_cursor % fieldhandle % field_type == MPAS_IO_CHAR) then
pio_type = PIO_char
-!!!!!!!! PIO DOES NOT SUPPORT LOGICAL !!!!!!!!
+ !!!!!!! PIO DOES NOT SUPPORT LOGICAL !!!!!!!!
end if
allocate(dimlist(ndims))
@@ -3423,11 +3414,13 @@
end do
!write(0,*) 'MGD PIO_finalize'
+#ifndef MPAS_CESM
call PIO_finalize(pio_iosystem, pio_ierr)
if (pio_ierr /= PIO_noerr) then
if (present(ierr)) ierr = MPAS_IO_ERR_PIO
return
end if
+#endif
end subroutine MPAS_io_finalize
Modified: branches/ocean_projects/cesm_coupling/src/ocean_cesm_driver/ocn_comp_mct.F
===================================================================
--- branches/ocean_projects/cesm_coupling/src/ocean_cesm_driver/ocn_comp_mct.F        2012-11-01 23:04:28 UTC (rev 2292)
+++ branches/ocean_projects/cesm_coupling/src/ocean_cesm_driver/ocn_comp_mct.F        2012-11-02 12:30:14 UTC (rev 2293)
@@ -32,6 +32,7 @@
use mpas_framework
use mpas_core
use mpas_kind_types
+
!
! !PUBLIC MEMBER FUNCTIONS:
implicit none
@@ -63,7 +64,8 @@
cpl_write_history, &! flag id for write history
cpl_write_tavg, &! flag id for write tavg
cpl_diag_global, &! flag id for computing diagnostics
- cpl_diag_transp ! flag id for computing diagnostics
+ cpl_diag_transp, &! flag id for computing diagnostics
+ my_task
real (kind=RKIND), dimension(:,:,:,:), allocatable :: SBUFF_SUM ! accumulated sum of send buffer quantities
! for averaging before being sent
@@ -131,8 +133,10 @@
character(len=StrKIND) :: nml_filename
integer :: lbnum
- type (iosystem_desc_t), pointer :: pio_io_system
+! type (iosystem_desc_t), pointer, private :: io_system
+ type (iosystem_desc_t), pointer :: io_system
+
!-----------------------------------------------------------------------
!
! set cdata pointers
@@ -204,13 +208,25 @@
call t_startf('mpas-o_init')
nml_filename = "mpaso.in"
+
+ write(6,*) 'Getting iosys pointer'
+ io_system => shr_pio_getiosys(ocnid)
+ write(6,*) 'Setting iosys pointer'
+ call mpas_io_set_iosys(io_system)
+
+
+ write(6,*) 'Init framework'
call mpas_framework_init(dminfo, domain, mpi_communicator_ocn, nml_filename)
- pio_io_system => shr_pio_getiosys(OCNID)
- call mpas_io_set_iosys(pio_io_system)
+ my_task = dminfo % my_proc_id
+
+
+ write(6,*) 'Input state'
call mpas_input_state_for_domain(domain)
+ write(6,*) 'Init core'
call mpas_core_init(domain, timeStamp)
+ write(6,*) 'Init complete'
!-----------------------------------------------------------------------
!
@@ -742,13 +758,16 @@
call mct_aVect_zero(dom_o%data)
allocate(data(lsize))
+        write(0,*) 'Lsize == ', lsize
+
!-------------------------------------------------------------------
!
! Determine global gridpoint number attribute, GlobGridNum, which is set automatically by MCT
!
!-------------------------------------------------------------------
-! call mct_gsMap_orderedPoints(gsMap_o, my_task, idata)
+ call mct_gsMap_orderedPoints(gsMap_o, my_task, idata)
+        write(0,*) 'size....', size(idata)
call mct_gGrid_importIAttr(dom_o,'GlobGridNum',idata,lsize)
!-------------------------------------------------------------------
@@ -801,8 +820,7 @@
do while(associated(block_ptr))
do i = 1, block_ptr % mesh % nCellsSolve
n = n + 1
- data(n) = block_ptr % mesh % areaCell % array(i)
-! data(n) = block_ptr % mesh % areaCell % array(i) / (sphere_radius * sphere_radius)
+ data(n) = block_ptr % mesh % areaCell % array(i) / (block_ptr % mesh % sphere_radius * block_ptr % mesh % sphere_radius)
end do
block_ptr => block_ptr % next
end do
</font>
</pre>