Skip to content
Snippets Groups Projects
Commit e9c3f7ee authored by Magdalena Sophia Fritz's avatar Magdalena Sophia Fritz
Browse files

redirect rsl.* output

parent 1b93bfd4
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
#ifdef _WIN32 #ifdef _WIN32
#include <Winsock2.h> #include <Winsock2.h>
#else
#include <unistd.h>
#endif #endif
#ifdef NCEP_DEBUG_MULTIDIR #ifdef NCEP_DEBUG_MULTIDIR
// # include <errno.h> // # include <errno.h>
...@@ -38,6 +40,7 @@ void RSL_LITE_ERROR_DUP1 ( int *me , int *size ) ...@@ -38,6 +40,7 @@ void RSL_LITE_ERROR_DUP1 ( int *me , int *size )
char filename[256] ; char filename[256] ;
char dirname[256] ; char dirname[256] ;
char hostname[256] ; char hostname[256] ;
char output_dir[256] = "/jetfs/scratch/mfritz/data/LES_simulations/output/"; // Set the desired directory path
/* redirect standard out and standard error based on compile options*/ /* redirect standard out and standard error based on compile options*/
...@@ -48,21 +51,21 @@ void RSL_LITE_ERROR_DUP1 ( int *me , int *size ) ...@@ -48,21 +51,21 @@ void RSL_LITE_ERROR_DUP1 ( int *me , int *size )
# ifndef RSL0_ONLY # ifndef RSL0_ONLY
if ( *size < ORIG_RSL_CUTOFF ) if ( *size < ORIG_RSL_CUTOFF )
{ {
sprintf(filename,"rsl.out.%04d",*me) ; sprintf(filename,"%s/rsl.out.%04d", output_dir, *me) ;
} }
else else
{ {
sprintf(filename,"rsl.out.%08d",*me) ; sprintf(filename,"%s/rsl.out.%08d", output_dir, *me) ;
} }
# else # else
if (*me == 0) if (*me == 0)
{ {
if ( *size < ORIG_RSL_CUTOFF ) if ( *size < ORIG_RSL_CUTOFF )
{ {
sprintf(filename,"rsl.out.%04d",*me) ; sprintf(filename,"%s/rsl.out.%04d", output_dir, *me) ;
} }
else { else {
sprintf(filename,"rsl.out.%08d",*me) ; sprintf(filename,"%s/rsl.out.%08d", output_dir, *me) ;
} }
} }
else else
...@@ -91,21 +94,21 @@ void RSL_LITE_ERROR_DUP1 ( int *me , int *size ) ...@@ -91,21 +94,21 @@ void RSL_LITE_ERROR_DUP1 ( int *me , int *size )
# ifndef RSL0_ONLY # ifndef RSL0_ONLY
if ( *size < ORIG_RSL_CUTOFF ) if ( *size < ORIG_RSL_CUTOFF )
{ {
sprintf(filename,"rsl.error.%04d",*me) ; sprintf(filename,"%s/rsl.error.%04d", output_dir, *me) ;
} }
else else
{ {
sprintf(filename,"rsl.error.%08d",*me) ; sprintf(filename,"%s/rsl.error.%08d", output_dir, *me) ;
} }
# else # else
if (*me == 0) if (*me == 0)
{ {
if ( *size < ORIG_RSL_CUTOFF ) if ( *size < ORIG_RSL_CUTOFF )
{ {
sprintf(filename,"rsl.error.%04d",*me) ; sprintf(filename,"%s/rsl.error.%04d", output_dir, *me) ;
} }
else { else {
sprintf(filename,"rsl.error.%08d",*me) ; sprintf(filename,"%s/rsl.error.%08d", output_dir, *me) ;
} }
} }
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment