[MITgcm-devel] ptracers / SOM problem
Oliver Jahn
jahn at MIT.EDU
Sun Mar 18 17:44:52 EDT 2012
Hi Ryan,
not sure what is going on here. Some ideas:
1. The pointer that _Ptracers_som expands to
(PTR_ISTATE_ARR(iPtr)%som_P) needs to be allocated for each
ptracer that uses it. This is done in ptracers_init_fixed. Make
sure this is called (and only once) before your reset routine.
Looks like it probably is.
2. Try rebuilding everything. The compiler can get confused about the
modules.
3. Make sure you have enough memory. SOM uses 9 extra tracers for each
ptracer.
You've probably thought of all or some of these, it is the only thing I
can think of right now. If it doesn't help, maybe point me to where
your code is and I'll have a look.
Cheers,
Oliver
On 2012-03-12 16:37, Ryan Abernathey wrote:
> Hi MITgcm developers,
>
> I have added a very simple feature to the ptracers package: the ability to periodically reset the ptracers to their initial concentration. The code works fine, except when the 2nd-order moment (Prather) advection scheme is in use. In this case, the resetting code causes the model to crash hard. I am wondering if someone who understands the SOM code better than me can offer any insight. What I am trying to do is very simple, and I don't understand the source of the error.
>
> Thanks a lot!
> -Ryan
>
>
> I have narrowed the problem down to a single line of code (indicated with a comment) within this block. (Most of this code was poached from ptracers_init_varia.F.) It evidently doesn't like it when I try to reset the values of the _Ptracers_som variable.
>
> #ifdef PTRACERS_ALLOW_DYN_STATE
> IF ( PTRACERS_SOM_Advection(iTracer) ) THEN
> WRITE(msgBuf,'(A,I3,A)')'PTRACERS_RESET: iTracer = ',
> & iTracer,
> & ' : resetting 2nd-order moments'
> CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
> & SQUEEZE_RIGHT, myThid )
> DO n = 1,nSOM
> DO k=1,Nr
> DO j=1-OLy,sNy+OLy
> DO i=1-OLx,sNx+OLx
> c This next line is what causes the crash
> _Ptracers_som(i,j,k,bi,bj,n,iTracer) = 0. _d 0
> ENDDO
> ENDDO
> ENDDO
> ENDDO
> CALL GAD_EXCH_SOM( _Ptracers_som(:,:,:,:,:,:,iTracer),
> & Nr, myThid )
> ENDIF
> #endif /* PTRACERS_ALLOW_DYN_STATE */
>
>
> The error begins as...
>
> MPI: On host r217i0n15, Program /nobackupp1/rpaberna/GCM/channel_new/200x400x40/build/mitgcmuv, Rank 126, Process 4391 received signal SIGSEGV(11)
> MPI: --------stack traceback-------
> *** glibc detected *** ./mitgcmuv: malloc(): memory corruption (fast): 0x000000000bdf09d0 ***
>
> ...continues with an enormous stack dump, and ends with the following somewhat useful information
>
> MPI: #1 0x00002aaaaafcce8c in mpi_sgi_system (command=<value optimized out>)
> MPI: at sig.c:98
> MPI: #2 MPI_SGI_stacktraceback (command=<value optimized out>) at sig.c:353
> MPI: #3 0x00002aaaaafcd4d3 in first_arriver_handler (
> MPI: stack_trace_sem=<value optimized out>, signo=<value optimized out>)
> MPI: at sig.c:511
> MPI: #4 slave_sig_handler (stack_trace_sem=<value optimized out>,
> MPI: signo=<value optimized out>) at sig.c:595
> MPI: #5<signal handler called>
> MPI: #6 0x000000000056e9b5 in ptracers_reset_ ()
> MPI: #7 0x0000000000569b5f in ptracers_output_ ()
> MPI: #8 0x000000000060d189 in do_the_model_io_ ()
> MPI: #9 0x000000000065349e in initialise_varia_ ()
> MPI: #10 0x000000000066ebfc in the_main_loop_ ()
> MPI: #11 0x000000000066ee4c in the_model_main_ ()
> MPI: #12 0x00000000005dd2ed in MAIN__ ()
> MPI: #13 0x0000000000009fe0 in ?? ()
> MPI: #14 0x0000000000000000 in ?? ()
>
>
> _______________________________________________
> MITgcm-devel mailing list
> MITgcm-devel at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-devel
More information about the MITgcm-devel
mailing list