Commit 23c9abaf authored by Johannes Spazier's avatar Johannes Spazier

Some minor changes needed for interaction with tomcat server.

parent 04ef2c31
......@@ -4,8 +4,8 @@ CC=g++
NVCC=nvcc
CFLAGS=-O3 -I.
ARCH?=compute_20
CODE?=sm_21
ARCH?=compute_13
CODE?=sm_13
NVFLAGS=$(CFLAGS) -gencode arch=$(ARCH),code=$(CODE)
CPPS=$(wildcard *.cpp)
......@@ -17,17 +17,14 @@ OBJECTS=$(patsubst %.cpp, %.o, $(CPPS) ) $(patsubst %.cu,%.o,$(CUS) )
all: EasyWave
EasyWave: $(OBJECTS) link.o
$(NVCC) -o $@ $^
EasyWave: $(OBJECTS)
$(NVCC) -o $@ $^ -lrt
%.o: %.cpp *.h
$(CC) -c $(CFLAGS) -o $@ $<
%.o: %.cu *.cuh *.h
$(NVCC) -dc $(NVFLAGS) -x cu -o $@ $<
link.o: $(CU_OBJS)
$(NVCC) -dlink $(NVFLAGS) -o $@ $^
$(NVCC) -c $(NVFLAGS) -x cu -o $@ $<
clean:
rm -f EasyWave *.o
......@@ -284,6 +284,8 @@ int CGpuNode::copyIntermediate() {
CUDA_CALL( cudaMemcpy2D( h + off, dp.nJ * sizeof(float), data.h + (vgpu.gt) * data.params.pI + dp.lpad, pitch, dp.nJ * sizeof(float), vgpu.size, cudaMemcpyDeviceToHost ) );
CUDA_CALL( cudaMemcpy2D( tArr + off, dp.nJ * sizeof(float), data.tArr + (vgpu.gt) * data.params.pI + dp.lpad, pitch, dp.nJ * sizeof(float), vgpu.size, cudaMemcpyDeviceToHost ) );
}
/* copy finished */
......
......@@ -104,8 +104,8 @@ int ewLoadBathymetry()
int rgL, rgR, rgT, rgB;
/* TODO: How do we know how many steps are necessary? Assume one grid extension each 5 steps for now. */
int numIter = ceil( Par.timeMax / Par.dt / 5.0 );
/* TODO: How do we know how many steps are necessary? Assume one grid extension each 10 steps for now. */
int numIter = ceil( Par.timeMax / Par.dt / 8.0 );
rgL = My_max( 0, Imin - numIter );
rgR = My_min( Imax + numIter, NLon - 1 );
......@@ -133,7 +133,7 @@ int ewLoadBathymetry()
LatMin = LatMinSec;
LatMax = LatMaxSec;
printf_v("rgL, rgR, rgT, rgB: %u %u %u %u\n", rgL, rgR, rgT, rgB );
printf_v("range: %lf %lf %lf %lf\n", LonMinSec, LonMaxSec, LatMinSec, LatMaxSec );
/* upon here NLot and NLat are set according to the desired section */
int NLonBase = NLon;
......
......@@ -95,6 +95,26 @@ int ewOut2D()
fwrite( &ftmp, sizeof(float), 1, fp );
}
}
sprintf( record, "%s.2D.%5.5d.time", Par.modelName, Par.time );
fp = fopen( record, "wb" );
fwrite( "DSBB", 4, 1, fp );
fwrite( &nOutI, sizeof(short), 1, fp );
fwrite( &nOutJ, sizeof(short), 1, fp );
fwrite( &lonOutMin, sizeof(double), 1, fp );
fwrite( &lonOutMax, sizeof(double), 1, fp );
fwrite( &latOutMin, sizeof(double), 1, fp );
fwrite( &latOutMax, sizeof(double), 1, fp );
dtmp = -1.; fwrite( &dtmp, sizeof(double), 1, fp );
dtmp = +1.; fwrite( &dtmp, sizeof(double), 1, fp );
for( j=Jmin; j<=Jmax; j++ ) {
for( i=Imin; i<=Imax; i++ ) {
ftmp = (float)Node(idx(j,i), iTime) / 60;
if( ftmp < 0 ) ftmp = NAN;
fwrite( &ftmp, sizeof(float), 1, fp );
}
}
fclose( fp );
// updating contents file
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment