<p><b>dwj07@fsu.edu</b> 2013-01-03 09:47:54 -0700 (Thu, 03 Jan 2013)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Merging trunk to branch<br>
</p><hr noshade><pre><font color="gray">Index: branches/ocean_projects/namelist_cleanup
===================================================================
--- branches/ocean_projects/namelist_cleanup        2013-01-02 18:15:20 UTC (rev 2372)
+++ branches/ocean_projects/namelist_cleanup        2013-01-03 16:47:54 UTC (rev 2373)
Property changes on: branches/ocean_projects/namelist_cleanup
___________________________________________________________________
Modified: svn:mergeinfo
## -3,6 +3,7 ##
/branches/ocean_projects/ale_split_exp:1437-1483
/branches/ocean_projects/ale_vert_coord:1225-1383
/branches/ocean_projects/ale_vert_coord_new:1387-1428
+/branches/ocean_projects/cesm_coupling:2147-2344
/branches/ocean_projects/gmvar:1214-1514,1517-1738
/branches/ocean_projects/imp_vert_mix_error:1847-1887
/branches/ocean_projects/imp_vert_mix_mrp:754-986
## -24,3 +25,4 ##
/branches/omp_blocks/multiple_blocks:1803-2084
/branches/source_renaming:1082-1113
/branches/time_manager:924-962
+/trunk/mpas:2318-2372
\ No newline at end of property
Modified: branches/ocean_projects/namelist_cleanup/src/Makefile
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/Makefile        2013-01-02 18:15:20 UTC (rev 2372)
+++ branches/ocean_projects/namelist_cleanup/src/Makefile        2013-01-03 16:47:54 UTC (rev 2373)
@@ -1,34 +1,45 @@
.SUFFIXES: .F .c .o
+ifeq "$(CESM)" "true"
+
+ifeq "$(CORE)" "ocean"
+include Makefile.in.CESM_OCN
+endif
+
+else
+
all: mpas
+
mpas: reg_includes externals frame ops dycore drver
        $(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
+externals: reg_includes
+        ( cd external; $(MAKE) FC="$(FC)" SFC="$(SFC)" CC="$(CC)" SCC="$(SCC)" FFLAGS="$(FFLAGS)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" NETCDF="$(NETCDF)" CORE="$(CORE)" )
+
+drver: reg_includes externals frame ops dycore
+        ( cd driver; $(MAKE) CPPFLAGS="$(CPPFLAGS)" CPPINCLUDES="$(CPPINCLUDES)" all )
+endif
+
reg_includes:
        ( cd registry; $(MAKE) CC="$(SCC)" )
        ( cd inc; $(CPP) ../core_$(CORE)/Registry | ../registry/parse > Registry.processed)
-externals: reg_includes
-        ( 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
-drver: reg_includes externals frame ops dycore
-        ( cd driver; $(MAKE) all )
clean:
-        $(RM) $(CORE)_model.exe libframework.a libops.a libdycore.a
+        $(RM) $(CORE)_model.exe libframework.a libops.a libdycore.a lib$(CORE).a *.o
        ( cd registry; $(MAKE) clean )
        ( cd external; $(MAKE) clean )
        ( cd framework; $(MAKE) clean )
Copied: branches/ocean_projects/namelist_cleanup/src/Makefile.in.CESM_OCN (from rev 2372, trunk/mpas/src/Makefile.in.CESM_OCN)
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/Makefile.in.CESM_OCN         (rev 0)
+++ branches/ocean_projects/namelist_cleanup/src/Makefile.in.CESM_OCN        2013-01-03 16:47:54 UTC (rev 2373)
@@ -0,0 +1,32 @@
+include $(CASEROOT)/Macros
+RM = rm -f
+CPP = cpp -C -P -traditional
+FC=$(MPIFC)
+CC=$(MPICC)
+NETCDF=$(NETCDF_PATH)
+PNETCDF=$(PNETCDF_PATH)
+PIO=$(EXEROOT)/pio
+FILE_OFFSET = -DOFFSET64BIT
+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)" )
+
+mpas: reg_includes externals frame ops dycore drver
+        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
+
+externals:
+
+drver: reg_includes externals frame ops dycore
+        ( cd $(CORE)_cesm_driver; $(MAKE) CPPFLAGS="$(CPPFLAGS)" CPPINCLUDES="$(CPPINCLUDES)" all )
+
Index: branches/ocean_projects/namelist_cleanup/src/core_ocean
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean        2013-01-02 18:15:20 UTC (rev 2372)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean        2013-01-03 16:47:54 UTC (rev 2373)
Property changes on: branches/ocean_projects/namelist_cleanup/src/core_ocean
___________________________________________________________________
Modified: svn:mergeinfo
## -3,6 +3,7 ##
/branches/ocean_projects/ale_split_exp/src/core_ocean:1437-1483
/branches/ocean_projects/ale_vert_coord/src/core_ocean:1225-1383
/branches/ocean_projects/ale_vert_coord_new/src/core_ocean:1387-1428
+/branches/ocean_projects/cesm_coupling/src/core_ocean:2147-2344
/branches/ocean_projects/gmvar/src/core_ocean:1214-1514,1517-1738
/branches/ocean_projects/imp_vert_mix_error/src/core_ocean:1847-1887
/branches/ocean_projects/imp_vert_mix_mrp/src/core_ocean:754-986
## -26,3 +27,4 ##
/branches/omp_blocks/openmp_test/src/core_ocean_elements:2161-2201
/branches/source_renaming/src/core_ocean:1082-1113
/branches/time_manager/src/core_ocean:924-962
+/trunk/mpas/src/core_ocean:2318-2372
\ No newline at end of property
Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/Registry
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/Registry        2013-01-02 18:15:20 UTC (rev 2372)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/Registry        2013-01-03 16:47:54 UTC (rev 2373)
@@ -1,7 +1,6 @@
%
% namelist type namelist_record name default_value
%
-
namelist integer sw_model config_test_case 0
namelist logical time_management config_do_restart .false.
Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_global_diagnostics.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_global_diagnostics.F        2013-01-02 18:15:20 UTC (rev 2372)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_global_diagnostics.F        2013-01-03 16:47:54 UTC (rev 2373)
@@ -421,27 +421,27 @@
! write out the data to files
if (dminfo % my_proc_id == IO_NODE) then
fileID = getFreeUnit()
- open(fileID,file='stats_min.txt',ACCESS='append')
+ open(fileID,file='stats_min.txt',STATUS='UNKNOWN', POSITION='append')
write (fileID,'(100es24.14)') mins(1:nVariables)
close (fileID)
- open(fileID,file='stats_max.txt',ACCESS='append')
+ open(fileID,file='stats_max.txt',STATUS='UNKNOWN', POSITION='append')
write (fileID,'(100es24.14)') maxes(1:nVariables)
close (fileID)
- open(fileID,file='stats_sum.txt',ACCESS='append')
+ open(fileID,file='stats_sum.txt',STATUS='UNKNOWN', POSITION='append')
write (fileID,'(100es24.14)') sums(1:nVariables)
close (fileID)
- open(fileID,file='stats_avg.txt',ACCESS='append')
+ open(fileID,file='stats_avg.txt',STATUS='UNKNOWN', POSITION='append')
write (fileID,'(100es24.14)') averages(1:nVariables)
close (fileID)
- open(fileID,file='stats_time.txt',ACCESS='append')
+ open(fileID,file='stats_time.txt',STATUS='UNKNOWN', POSITION='append')
write (fileID,'(i10,10x,a,100es24.14)') timeIndex, &
state % xtime % scalar, dt, &
CFLNumberGlobal
close (fileID)
- open(fileID,file='stats_colmin.txt',ACCESS='append')
+ open(fileID,file='stats_colmin.txt',STATUS='UNKNOWN', POSITION='append')
write (fileID,'(100es24.14)') verticalSumMins(1:nVariables)
close (fileID)
- open(fileID,file='stats_colmax.txt',ACCESS='append')
+ open(fileID,file='stats_colmax.txt',STATUS='UNKNOWN', POSITION='append')
write (fileID,'(100es24.14)') verticalSumMaxes(1:nVariables)
close (fileID)
end if
Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_mpas_core.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_mpas_core.F        2013-01-02 18:15:20 UTC (rev 2372)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_mpas_core.F        2013-01-03 16:47:54 UTC (rev 2373)
@@ -123,7 +123,7 @@
if (.not.config_do_restart) call ocn_init_split_timestep(domain)
- write (0,'(a,a10)'), ' Vertical coordinate movement is: ',config_vert_coord_movement
+ write (0,'(a,a10)') ' Vertical coordinate movement is: ',config_vert_coord_movement
if (config_vert_coord_movement.ne.'isopycnal'.and. &
config_vert_coord_movement.ne.'fixed'.and. &
@@ -133,7 +133,7 @@
call mpas_dmpar_abort(dminfo)
endif
- write (0,'(a,a)'), ' Pressure type is: ',trim(config_pressure_gradient_type)
+ write (0,'(a,a)') ' Pressure type is: ',trim(config_pressure_gradient_type)
if (config_pressure_gradient_type.ne.'pressure_and_zmid'.and. &
config_pressure_gradient_type.ne.'MontgomeryPotential') then
write (0,*) ' Incorrect choice of config_pressure_gradient_type.'
@@ -195,11 +195,19 @@
type (MPAS_Time_Type) :: startTime, stopTime, alarmStartTime
type (MPAS_TimeInterval_type) :: runDuration, timeStep, alarmTimeStep
+ character(len=StrKIND) :: restartTimeStamp
integer :: ierr
- call mpas_set_time(curr_time=startTime, dateTimeString=config_start_time, ierr=ierr)
+ if(config_start_time == 'file') then
+ open(22,file='restart_timestamp',form='formatted',status='old')
+ read(22,*) restartTimeStamp
+ close(22)
+ call mpas_set_time(curr_time=startTime, dateTimeString=restartTimeStamp, ierr=ierr)
+ else
+ call mpas_set_time(curr_time=startTime, dateTimeString=config_start_time, ierr=ierr)
+ end if
+
call mpas_set_timeInterval(timeStep, dt=dt, ierr=ierr)
-
if (trim(config_run_duration) /= "none") then
call mpas_set_timeInterval(runDuration, timeString=config_run_duration, ierr=ierr)
call mpas_create_clock(clock, startTime=startTime, timeStep=timeStep, runDuration=runDuration, ierr=ierr)
Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_time_average.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_time_average.F        2013-01-02 18:15:20 UTC (rev 2372)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_time_average.F        2013-01-03 16:47:54 UTC (rev 2373)
@@ -11,7 +11,7 @@
subroutine ocn_time_average_init(state)!{{{
type (state_type), intent(inout) :: state
- real, pointer :: nAccumulate
+ real (kind=RKIND), pointer :: nAccumulate
real (kind=RKIND), dimension(:), pointer :: acc_ssh, acc_sshVar
real (kind=RKIND), dimension(:,:), pointer :: acc_uReconstructZonal, acc_uReconstructMeridional, acc_uReconstructZonalVar, acc_uReconstructMeridionalVar
@@ -45,7 +45,7 @@
type (state_type), intent(inout) :: state
type (state_type), intent(in) :: old_state
- real, pointer :: nAccumulate, old_nAccumulate
+ real (kind=RKIND), pointer :: nAccumulate, old_nAccumulate
real (kind=RKIND), dimension(:), pointer :: ssh
real (kind=RKIND), dimension(:,:), pointer :: uReconstructZonal, uReconstructMeridional, u
@@ -99,7 +99,7 @@
subroutine ocn_time_average_normalize(state)!{{{
type (state_type), intent(inout) :: state
- real, pointer :: nAccumulate
+ real (kind=RKIND), pointer :: nAccumulate
real (kind=RKIND), dimension(:), pointer :: acc_ssh, acc_sshVar
real (kind=RKIND), dimension(:,:), pointer :: acc_uReconstructZonal, acc_uReconstructMeridional, acc_uReconstructZonalVar, acc_uReconstructMeridionalVar
Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_time_integration.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_time_integration.F        2013-01-02 18:15:20 UTC (rev 2372)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_time_integration.F        2013-01-03 16:47:54 UTC (rev 2373)
@@ -85,6 +85,8 @@
real (kind=RKIND), intent(in) :: dt
character(len=*), intent(in) :: timeStamp
+ real (kind=RKIND) :: nanCheck
+
type (dm_info) :: dminfo
type (block_type), pointer :: block
@@ -98,7 +100,9 @@
do while (associated(block))
block % state % time_levs(2) % state % xtime % scalar = timeStamp
- if (isNaN(sum(block % state % time_levs(2) % state % u % array))) then
+ nanCheck = sum(block % state % time_levs(2) % state % u % array)
+
+ if (nanCheck /= nanCheck) then
write(0,*) 'Abort: NaN detected'
call mpas_dmpar_abort(dminfo)
endif
Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_tracer_advection_mono.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_tracer_advection_mono.F        2013-01-02 18:15:20 UTC (rev 2372)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_tracer_advection_mono.F        2013-01-03 16:47:54 UTC (rev 2373)
@@ -199,7 +199,7 @@
iCell = advCellsForEdge(i,iEdge)
do k = 1, maxLevelCell(iCell)
tracer_weight = lowOrderAdvectionMask(k, iEdge) * adv_coefs_2nd(i,iEdge) &
- + highOrderAdvectionMask(k, iEdge) * (adv_coefs(i,iEdge) + coef_3rd_order*sign(1.,uh(k,iEdge))*adv_coefs_3rd(i,iEdge))
+ + highOrderAdvectionMask(k, iEdge) * (adv_coefs(i,iEdge) + coef_3rd_order*sign(1.0_RKIND,uh(k,iEdge))*adv_coefs_3rd(i,iEdge))
tracer_weight = uh(k,iEdge)*tracer_weight
high_order_horiz_flux(k,iEdge) = high_order_horiz_flux(k,iEdge) + tracer_weight* tracer_cur(k,iCell)
@@ -214,8 +214,8 @@
do iCell = 1, nCells
do k = 2, maxLevelCell(iCell)
! dwj 02/03/12 Ocean and Atmosphere are different in vertical
-! flux_upwind = max(0.,w(k,iCell))*tracer_cur(k-1,iCell) + min(0.,w(k,iCell))*tracer_cur(k,iCell)
- flux_upwind = min(0.,w(k,iCell))*tracer_cur(k-1,iCell) + max(0.,w(k,iCell))*tracer_cur(k,iCell)
+! flux_upwind = max(0.0_RKIND,w(k,iCell))*tracer_cur(k-1,iCell) + min(0.0_RKIND,w(k,iCell))*tracer_cur(k,iCell)
+ flux_upwind = min(0.0_RKIND,w(k,iCell))*tracer_cur(k-1,iCell) + max(0.0_RKIND,w(k,iCell))*tracer_cur(k,iCell)
upwind_tendency(k-1,iCell) = upwind_tendency(k-1,iCell) + flux_upwind
upwind_tendency(k ,iCell) = upwind_tendency(k ,iCell) - flux_upwind
high_order_vert_flux(k,iCell) = high_order_vert_flux(k,iCell) - flux_upwind
@@ -227,8 +227,8 @@
! it is negative
do k = 1, maxLevelCell(iCell)
! dwj 02/03/12 Ocean and Atmosphere are different in vertical
-! flux_incoming (k,iCell) = -(min(0.,high_order_vert_flux(k+1,iCell))-max(0.,high_order_vert_flux(k,iCell)))
-! flux_outgoing(k,iCell) = -(max(0.,high_order_vert_flux(k+1,iCell))-min(0.,high_order_vert_flux(k,iCell)))
+! flux_incoming (k,iCell) = -(min(0.0_RKIND,high_order_vert_flux(k+1,iCell))-max(0.0_RKIND,high_order_vert_flux(k,iCell)))
+! flux_outgoing(k,iCell) = -(max(0.0_RKIND,high_order_vert_flux(k+1,iCell))-min(0.0_RKIND,high_order_vert_flux(k,iCell)))
flux_incoming (k, iCell) = max(0.0_RKIND, high_order_vert_flux(k+1, iCell)) - min(0.0_RKIND, high_order_vert_flux(k, iCell))
flux_outgoing(k, iCell) = min(0.0_RKIND, high_order_vert_flux(k+1, iCell)) - max(0.0_RKIND, high_order_vert_flux(k, iCell))
@@ -247,7 +247,7 @@
invAreaCell2 = 1.0 / areaCell(cell2)
do k = 1, maxLevelEdgeTop(iEdge)
- flux_upwind = dvEdge(iEdge) * (max(0.,uh(k,iEdge))*tracer_cur(k,cell1) + min(0.,uh(k,iEdge))*tracer_cur(k,cell2))
+ flux_upwind = dvEdge(iEdge) * (max(0.0_RKIND,uh(k,iEdge))*tracer_cur(k,cell1) + min(0.0_RKIND,uh(k,iEdge))*tracer_cur(k,cell2))
high_order_horiz_flux(k,iEdge) = high_order_horiz_flux(k,iEdge) - flux_upwind
end do ! k loop
end do ! iEdge loop
@@ -280,10 +280,10 @@
tracer_upwind_new = (tracer_cur(k,iCell)*h(k,iCell) + dt*upwind_tendency(k,iCell)) * inv_h_new(k,iCell)
scale_factor = (tracer_max(k,iCell)-tracer_upwind_new)/(tracer_max_new-tracer_upwind_new+eps)
- flux_incoming(k,iCell) = min( 1.0, max( 0.0, scale_factor) )
+ flux_incoming(k,iCell) = min( 1.0_RKIND, max( 0.0_RKIND, scale_factor) )
scale_factor = (tracer_upwind_new-tracer_min(k,iCell))/(tracer_upwind_new-tracer_min_new+eps)
- flux_outgoing(k,iCell) = min( 1.0, max( 0.0, scale_factor) )
+ flux_outgoing(k,iCell) = min( 1.0_RKIND, max( 0.0_RKIND, scale_factor) )
end do ! k loop
end do ! iCell loop
@@ -293,8 +293,8 @@
cell2 = cellsOnEdge(2,iEdge)
do k = 1, maxLevelEdgeTop(iEdge)
flux = high_order_horiz_flux(k,iEdge)
- flux = max(0.,flux) * min(flux_outgoing(k,cell1), flux_incoming(k,cell2)) &
- + min(0.,flux) * min(flux_incoming(k,cell1), flux_outgoing(k,cell2))
+ flux = max(0.0_RKIND,flux) * min(flux_outgoing(k,cell1), flux_incoming(k,cell2)) &
+ + min(0.0_RKIND,flux) * min(flux_incoming(k,cell1), flux_outgoing(k,cell2))
high_order_horiz_flux(k,iEdge) = flux
end do ! k loop
end do ! iEdge loop
@@ -304,10 +304,10 @@
do k = 2, maxLevelCell(iCell)
flux = high_order_vert_flux(k,iCell)
! dwj 02/03/12 Ocean and Atmosphere are different in vertical.
-! flux = max(0.,flux) * min(flux_outgoing(k-1,iCell), flux_incoming(k ,iCell)) &
-! + min(0.,flux) * min(flux_outgoing(k ,iCell), flux_incoming(k-1,iCell))
- flux = max(0.,flux) * min(flux_outgoing(k ,iCell), flux_incoming(k-1,iCell)) &
- + min(0.,flux) * min(flux_outgoing(k-1,iCell), flux_incoming(k ,iCell))
+! flux = max(0.0_RKIND,flux) * min(flux_outgoing(k-1,iCell), flux_incoming(k ,iCell)) &
+! + min(0.0_RKIND,flux) * min(flux_outgoing(k ,iCell), flux_incoming(k-1,iCell))
+ flux = max(0.0_RKIND,flux) * min(flux_outgoing(k ,iCell), flux_incoming(k-1,iCell)) &
+ + min(0.0_RKIND,flux) * min(flux_outgoing(k-1,iCell), flux_incoming(k ,iCell))
high_order_vert_flux(k,iCell) = flux
end do ! k loop
end do ! iCell loop
Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_tracer_advection_std_hadv.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_tracer_advection_std_hadv.F        2013-01-02 18:15:20 UTC (rev 2372)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_tracer_advection_std_hadv.F        2013-01-03 16:47:54 UTC (rev 2373)
@@ -91,7 +91,7 @@
iCell = advCellsForEdge(i,iEdge)
do k=1,grid % nVertLevels
tracer_weight = lowOrderAdvectionMask(k, iEdge) * adv_coefs_2nd(i,iEdge) &
- + highOrderAdvectionMask(k, iEdge) * (adv_coefs(i,iEdge) + coef_3rd_order*sign(1.,uh(k,iEdge))*adv_coefs_3rd(i,iEdge))
+ + highOrderAdvectionMask(k, iEdge) * (adv_coefs(i,iEdge) + coef_3rd_order*sign(1.0_RKIND,uh(k,iEdge))*adv_coefs_3rd(i,iEdge))
do iTracer=1,num_tracers
flux_arr(iTracer,k) = flux_arr(iTracer,k) + tracer_weight* tracers(iTracer,k,iCell)
end do
Modified: branches/ocean_projects/namelist_cleanup/src/framework/mpas_configure.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/framework/mpas_configure.F        2013-01-02 18:15:20 UTC (rev 2372)
+++ branches/ocean_projects/namelist_cleanup/src/framework/mpas_configure.F        2013-01-03 16:47:54 UTC (rev 2373)
@@ -7,11 +7,12 @@
contains
- subroutine mpas_read_namelist(dminfo)
+ subroutine mpas_read_namelist(dminfo, nml_filename)
implicit none
type (dm_info), intent(in) :: dminfo
+ character (len=*), optional :: nml_filename
integer :: funit, ierr
@@ -23,8 +24,13 @@
#include "config_set_defaults.inc"
if (dminfo % my_proc_id == IO_NODE) then
- write(0,*) 'Reading namelist.input'
- open(funit,file='namelist.input',status='old',form='formatted')
+ if (present(nml_filename)) then
+ write(0,*) 'Reading ', trim(nml_filename)
+ open(funit,file=trim(nml_filename),status='old',form='formatted')
+ else
+ write(0,*) 'Reading namelist.input'
+ open(funit,file='namelist.input',status='old',form='formatted')
+ end if
#include "config_namelist_reads.inc"
close(funit)
Modified: branches/ocean_projects/namelist_cleanup/src/framework/mpas_dmpar.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/framework/mpas_dmpar.F        2013-01-02 18:15:20 UTC (rev 2372)
+++ branches/ocean_projects/namelist_cleanup/src/framework/mpas_dmpar.F        2013-01-03 16:47:54 UTC (rev 2373)
@@ -98,7 +98,9 @@
write(0,'(a,i5,a,i5,a)') 'task ', mpi_rank, ' of ', mpi_size, &
' is running'
+#ifndef MPAS_CESM
call open_streams(dminfo % my_proc_id)
+#endif
dminfo % info = MPI_INFO_NULL
#else
Modified: branches/ocean_projects/namelist_cleanup/src/framework/mpas_framework.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/framework/mpas_framework.F        2013-01-02 18:15:20 UTC (rev 2372)
+++ branches/ocean_projects/namelist_cleanup/src/framework/mpas_framework.F        2013-01-03 16:47:54 UTC (rev 2373)
@@ -13,7 +13,7 @@
contains
- subroutine mpas_framework_init(dminfo, domain, mpi_comm)
+ subroutine mpas_framework_init(dminfo, domain, mpi_comm, nml_filename, io_system)
implicit none
@@ -21,13 +21,16 @@
type (domain_type), pointer :: domain
integer, intent(in), optional :: mpi_comm
+ character (len=*), optional :: nml_filename
+ type (iosystem_desc_t), optional, pointer :: io_system
+
integer :: pio_num_iotasks
integer :: pio_stride
allocate(dminfo)
call mpas_dmpar_init(dminfo, mpi_comm)
- call mpas_read_namelist(dminfo)
+ call mpas_read_namelist(dminfo, nml_filename)
call mpas_allocate_domain(domain, dminfo)
@@ -38,19 +41,20 @@
if (pio_num_iotasks == 0) then
pio_num_iotasks = domain % dminfo % nprocs
end if
- call MPAS_io_init(dminfo, pio_num_iotasks, pio_stride)
+ call MPAS_io_init(dminfo, pio_num_iotasks, pio_stride, io_system)
end subroutine mpas_framework_init
- subroutine mpas_framework_finalize(dminfo, domain)
+ subroutine mpas_framework_finalize(dminfo, domain, io_system)
implicit none
type (dm_info), pointer :: dminfo
type (domain_type), pointer :: domain
+ type (iosystem_desc_t), optional, pointer :: io_system
- call MPAS_io_finalize()
+ call MPAS_io_finalize(io_system)
call mpas_deallocate_domain(domain)
Modified: branches/ocean_projects/namelist_cleanup/src/framework/mpas_io.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/framework/mpas_io.F        2013-01-02 18:15:20 UTC (rev 2372)
+++ branches/ocean_projects/namelist_cleanup/src/framework/mpas_io.F        2013-01-03 16:47:54 UTC (rev 2373)
@@ -176,21 +176,21 @@
type (fieldlist_type), pointer :: next => null()
end type fieldlist_type
- type (iosystem_desc_t), private, save :: pio_iosystem
+ type (iosystem_desc_t), pointer, private, save :: pio_iosystem
type (decomplist_type), pointer, private :: decomp_list => null()
type (dm_info), private :: local_dminfo
contains
+ subroutine MPAS_io_init(dminfo, io_task_count, io_task_stride, io_system, ierr)
- subroutine MPAS_io_init(dminfo, io_task_count, io_task_stride, ierr)
-
implicit none
type (dm_info), intent(in) :: dminfo
integer, intent(in) :: io_task_count
integer, intent(in) :: io_task_stride
+ type (iosystem_desc_t), optional, pointer :: io_system
integer, intent(out), optional :: ierr
! write(0,*) 'Called MPAS_io_init()'
@@ -198,17 +198,22 @@
local_dminfo = dminfo
+ if(present(io_system)) then
+ pio_iosystem => io_system
+ else
!write(0,*) 'MGD PIO_init'
- call PIO_init(local_dminfo % my_proc_id, & ! comp_rank
- local_dminfo % comm, & ! comp_comm
- io_task_count, & ! num_iotasks
- 0, & ! num_aggregator
- io_task_stride, & ! stride
- PIO_rearr_box, & ! rearr
- pio_iosystem) ! iosystem
+ allocate(pio_iosystem)
+ call PIO_init(local_dminfo % my_proc_id, & ! comp_rank
+ local_dminfo % comm, & ! comp_comm
+ io_task_count, & ! num_iotasks
+ 0, & ! num_aggregator
+ io_task_stride, & ! stride
+ PIO_rearr_box, & ! rearr
+ pio_iosystem) ! iosystem
+
+ call pio_seterrorhandling(pio_iosystem, PIO_BCAST_ERROR)
+ end if
- call pio_seterrorhandling(pio_iosystem, PIO_BCAST_ERROR)
-
end subroutine MPAS_io_init
@@ -913,9 +918,12 @@
type (fieldlist_type), pointer :: field_cursor
integer :: pio_type
- integer :: ndims, pd
- integer :: i, i1, i2, i3, i4, i5, indx
- integer, dimension(:), pointer :: dimlist, compdof
+ integer :: ndims
+ integer (kind=PIO_OFFSET) :: pd, indx
+ integer :: i
+ integer (kind=PIO_OFFSET) :: i1, i2, i3, i4, i5
+ integer, dimension(:), pointer :: dimlist
+ integer (kind=PIO_OFFSET), dimension(:), pointer :: compdof
type (decomplist_type), pointer :: decomp_cursor, new_decomp
! write(0,*) 'Called MPAS_io_set_var_indices()'
@@ -928,8 +936,6 @@
end if
! write(0,*) 'Assigning ', size(indices), ' indices for ', trim(fieldname)
-
-
!
! Check whether the field has been defined
!
@@ -1044,7 +1050,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))
@@ -1053,11 +1059,11 @@
do i=1,ndims-1
dimlist(i) = field_cursor % fieldhandle % dims(i) % dimsize
new_decomp % decomphandle % dims(i) = dimlist(i)
- pd = pd * dimlist(i)
+ pd = pd * int(dimlist(i),PIO_OFFSET)
end do
new_decomp % decomphandle % dims(ndims) = field_cursor % fieldhandle % dims(ndims) % dimsize
dimlist(ndims) = size(indices)
- pd = pd * dimlist(ndims)
+ pd = pd * int(dimlist(ndims),PIO_OFFSET)
allocate(compdof(pd))
@@ -1069,10 +1075,10 @@
do i2=1,dimlist(2)
do i1=1,dimlist(1)
compdof(indx) = i1 &
- + (i2-1)*dimlist(1) &
- + (i3-1)*dimlist(2)*dimlist(1) &
- + (i4-1)*dimlist(3)*dimlist(2)*dimlist(1) &
- + (indices(i5)-1)*dimlist(4)*dimlist(3)*dimlist(2)*dimlist(1)
+ + (i2-1)*int(dimlist(1),PIO_OFFSET) &
+ + (i3-1)*int(dimlist(2),PIO_OFFSET)*int(dimlist(1),PIO_OFFSET) &
+ + (i4-1)*int(dimlist(3),PIO_OFFSET)*int(dimlist(2),PIO_OFFSET)*int(dimlist(1),PIO_OFFSET) &
+ + int(indices(i5)-1,PIO_OFFSET)*int(dimlist(4),PIO_OFFSET)*int(dimlist(3),PIO_OFFSET)*int(dimlist(2),PIO_OFFSET)*int(dimlist(1),PIO_OFFSET)
indx = indx + 1
end do
end do
@@ -1085,9 +1091,9 @@
do i2=1,dimlist(2)
do i1=1,dimlist(1)
compdof(indx) = i1 &
- + (i2-1)*dimlist(1) &
- + (i3-1)*dimlist(2)*dimlist(1) &
- + (indices(i4)-1)*dimlist(3)*dimlist(2)*dimlist(1)
+ + (i2-1)*int(dimlist(1),PIO_OFFSET) &
+ + (i3-1)*int(dimlist(2),PIO_OFFSET)*int(dimlist(1),PIO_OFFSET) &
+ + int(indices(i4)-1,PIO_OFFSET)*int(dimlist(3),PIO_OFFSET)*int(dimlist(2),PIO_OFFSET)*int(dimlist(1),PIO_OFFSET)
indx = indx + 1
end do
end do
@@ -1097,7 +1103,7 @@
do i3=1,dimlist(3)
do i2=1,dimlist(2)
do i1=1,dimlist(1)
- compdof(indx) = i1 + (i2-1)*dimlist(1) + (indices(i3)-1)*dimlist(2)*dimlist(1)
+ compdof(indx) = i1 + (i2-1)*int(dimlist(1),PIO_OFFSET) + int(indices(i3)-1,PIO_OFFSET)*int(dimlist(2),PIO_OFFSET)*int(dimlist(1),PIO_OFFSET)
indx = indx + 1
end do
end do
@@ -1105,13 +1111,13 @@
else if (ndims == 2) then
do i2=1,dimlist(2)
do i1=1,dimlist(1)
- compdof(indx) = i1 + (indices(i2)-1)*dimlist(1)
+ compdof(indx) = i1 + int(indices(i2)-1,PIO_OFFSET)*int(dimlist(1),PIO_OFFSET)
indx = indx + 1
end do
end do
else if (ndims == 1) then
do i1=1,dimlist(1)
- compdof(indx) = indices(i1)
+ compdof(indx) = int(indices(i1),PIO_OFFSET)
indx = indx + 1
end do
end if
@@ -3385,10 +3391,11 @@
end subroutine MPAS_io_close
- subroutine MPAS_io_finalize(ierr)
+ subroutine MPAS_io_finalize(io_system, ierr)
implicit none
+ type (iosystem_desc_t), optional, pointer :: io_system
integer, intent(out), optional :: ierr
integer :: pio_ierr
@@ -3411,10 +3418,13 @@
end do
!write(0,*) 'MGD PIO_finalize'
- call PIO_finalize(pio_iosystem, pio_ierr)
- if (pio_ierr /= PIO_noerr) then
- if (present(ierr)) ierr = MPAS_IO_ERR_PIO
- return
+ if(.not.present(io_system)) then
+ call PIO_finalize(pio_iosystem, pio_ierr)
+ if (pio_ierr /= PIO_noerr) then
+ if (present(ierr)) ierr = MPAS_IO_ERR_PIO
+ return
+ end if
+ deallocate(pio_iosystem)
end if
end subroutine MPAS_io_finalize
Modified: branches/ocean_projects/namelist_cleanup/src/framework/mpas_io_input.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/framework/mpas_io_input.F        2013-01-02 18:15:20 UTC (rev 2372)
+++ branches/ocean_projects/namelist_cleanup/src/framework/mpas_io_input.F        2013-01-03 16:47:54 UTC (rev 2373)
@@ -94,7 +94,7 @@
type (graph) :: partial_global_graph_info
type (MPAS_Time_type) :: startTime
- character(len=StrKIND) :: timeStamp
+ character(len=StrKIND) :: timeStamp, restartTimeStamp
character(len=StrKIND) :: filename
integer :: nHalos
@@ -103,9 +103,18 @@
if (config_do_restart) then
! this get followed by set is to ensure that the time is in standard format
- call mpas_set_time(curr_time=startTime, dateTimeString=config_start_time)
+ if(trim(config_start_time) == 'file') then
+ open(22,file='restart_timestamp',form='formatted',status='old')
+ read(22,*) restartTimeStamp
+ close(22)
+
+ else
+ restartTimeStamp = config_start_time
+ end if
+
+ write(0,*) 'RestartTimeStamp ', trim(restartTimeStamp)
+ call mpas_set_time(curr_time=startTime, dateTimeString=restartTimeStamp)
call mpas_get_time(curr_time=startTime, dateTimeString=timeStamp)
-
call mpas_insert_string_suffix(trim(config_restart_name), timeStamp, filename)
input_obj % filename = trim(filename)
@@ -256,11 +265,17 @@
! If doing a restart, we need to decide which time slice to read from the
! restart file
!
- input_obj % time = MPAS_seekStream(input_obj % io_stream, config_start_time, MPAS_STREAM_EXACT_TIME, timeStamp, ierr)
+ input_obj % time = MPAS_seekStream(input_obj % io_stream, restartTimeStamp, MPAS_STREAM_EXACT_TIME, timeStamp, ierr)
if (ierr == MPAS_IO_ERR) then
- write(0,*) 'Error: restart file '//trim(filename)//' did not contain time '//trim(config_start_time)
+ write(0,*) 'Error: restart file '//trim(filename)//' did not contain time '//trim(restartTimeStamp)
call mpas_dmpar_abort(domain % dminfo)
end if
+
+! input_obj % time = MPAS_seekStream(input_obj % io_stream, config_start_time, MPAS_STREAM_EXACT_TIME, timeStamp, ierr)
+! if (ierr == MPAS_IO_ERR) then
+! write(0,*) 'Error: restart file '//trim(filename)//' did not contain time '//trim(config_start_time)
+! call mpas_dmpar_abort(domain % dminfo)
+! end if
!write(0,*) 'MGD DEBUGGING time = ', input_obj % time
write(0,*) 'Restarting model from time ', trim(timeStamp)
end if
Modified: branches/ocean_projects/namelist_cleanup/src/framework/mpas_io_output.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/framework/mpas_io_output.F        2013-01-02 18:15:20 UTC (rev 2372)
+++ branches/ocean_projects/namelist_cleanup/src/framework/mpas_io_output.F        2013-01-03 16:47:54 UTC (rev 2373)
@@ -48,6 +48,9 @@
else if (trim(stream) == 'RESTART') then
if(present(outputSuffix)) then
call mpas_insert_string_suffix(config_restart_name, outputSuffix, tempfilename)
+ open(22,file='restart_timestamp',form='formatted',status='replace')
+ write(22,*) outputSuffix
+ close(22)
else
tempfilename = config_restart_name
end if
Modified: branches/ocean_projects/namelist_cleanup/src/framework/mpas_timekeeping.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/framework/mpas_timekeeping.F        2013-01-02 18:15:20 UTC (rev 2372)
+++ branches/ocean_projects/namelist_cleanup/src/framework/mpas_timekeeping.F        2013-01-03 16:47:54 UTC (rev 2373)
@@ -116,6 +116,9 @@
character (len=*), intent(in) :: calendar
+#ifdef MPAS_CESM
+ TheCalendar = defaultCal % Type % caltype - 1
+#else
if (trim(calendar) == 'gregorian') then
TheCalendar = MPAS_GREGORIAN
call ESMF_Initialize(defaultCalendar=ESMF_CAL_GREGORIAN)
@@ -128,6 +131,7 @@
else
write(0,*) 'ERROR: mpas_timekeeping_init: Invalid calendar type'
end if
+#endif
end subroutine mpas_timekeeping_init
@@ -136,7 +140,9 @@
implicit none
+#ifndef MPAS_CESM
call ESMF_Finalize()
+#endif
end subroutine mpas_timekeeping_finalize
</font>
</pre>