[MITgcm-support] time continuous source for ptracers: how to use ptracers_forcing_surf.F

Martin Losch Martin.Losch at awi.de
Tue Oct 10 07:13:43 EDT 2017


Hi Camille,

to compute global indices from local i,j,bi,bj you can do this (where ig,jg are now the global indices):

          jg = myYGlobalLo-1+(bj-1)*sNy+j
          ig = myXGlobalLo-1+(bi-1)*sNx+i

I “stole” this from pkg/cost/cost_test.F, where this is also used to find global indices where the “cost function” is evaluated.

Martin


> On 10. Oct 2017, at 11:20, Camille Mazoyer <mazoyer at univ-tln.fr> wrote:
> 
> Dear all,
> 
> I'm starting to work with ptracers to study passive tracers circulation in a mid closed bay. I'm starting to have nice results with it. Until now, I put an initial concentration at time t0, and then, I observe where the tracers go.
> 
> Now, I would like to add a time continuous source. I saw on the mailing list that there are two ways of doing this:
> 
> 1)- with rbcs package
> 
> 2) - modifying  ptracers_forcing_surf.F source code.
> 
> I tryed option 1 but I did'nt manage to do what I want. I think option 2 is easier (?) for starting?
> 
> => so option 2:  I see where to modify the ptracers_forcing_surf.F code (see below), but I have a question about local i,j and global i,j. I want to add a source at i=22:23, j=84:85, k=1 (surface). These are global indices. How can I know which tile, and what local indices I have to write? (because the code what local indices no?)
> 
> C Example of how to add forcing at the surface
>       DO iTrc=1,PTRACERS_numInUse
> c       IF ( PTRACERS_StepFwd(iTrc) ) THEN
>           DO j = jMin, jMax
>            DO i = iMin, iMax
> c             surfaceForcingPTr(i,j,bi,bj,iTrc) = 0. _d 0
>              surfaceForcingPTr(i,j,bi,bj,iTrc) = 0. _d 0
> c    &                        + surfaceForcingS(i,j,bi,bj)
>            ENDDO
>           ENDDO
> c       ENDIF
>       ENDDO
> 
> 
> Thanks you very much for your help,
> 
> Have a good day,
> 
> Camille
> 
> -- 
> ------------------------------------------
> Camille Mazoyer
> Phd Student
> Mediterranean Institute of Oceanology (MIO)
> Institut de Mathématiques de Toulon (IMATH)
> Université de TOULON
> Bat X - CS 60584
> 83041 TOULON cedex 9
> France
> tel: +33.4.94.14.24.50
> Email: mazoyer at univ-tln.fr
> http://mio.pytheas.univ-amu.fr/
> http://imath.fr/
> 
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support



More information about the MITgcm-support mailing list