[MITgcm-support] time continuous source for ptracers: how to use ptracers_forcing_surf.F
Martin Losch
Martin.Losch at awi.de
Mon Dec 4 09:38:01 EST 2017
Hi Camille,
did you get an answer?
Q1: the R in RBCS stands for restoring and restoring is what the package does, i.e. neglecting all advection, mixing and other sources you have for you tracer T: dT/ dt = lambda * (T_r - T). lambe = 1/tauRelax. Let n+1 be the new time step and we do simple Euler forward stepping (which we don’t in practice), then you get: (T(n+1)-T(n))/deltaT = (T_r - T(n))/tauRelax. Only if tauRelax = deltaT you get T(n+1) = T_r (the prescribed value), which is what you want. Any tauRelax > deltaT will give something different.
Q2: My understanding of the RBCS package is, that the mask specifies, where you restore to your tracer field, i.e. if you only want to restore in one grid cell, then your mask should have only zeros and a 1 in your favorite cell (i,j,k=25,80,1)
Q3: should be possible, but if you have point source, then you may encounter numerical instabilities, as you did in your simulation.
I think using ptracers_forcings_surf.F is the better option ...
Martin
> On 26. Nov 2017, at 01:54, Camille Mazoyer <mazoyer at univ-tln.fr> wrote:
>
> Hi all,
>
> Thanks Martin for your answer. I tried to use ptracers_forcing_surf.F but I didn't manage to make it work: anyway, using rbcs may be more flexible. So I'm trying to understand it.
> So I would like to use RBCS package for one tracer, and I would like to have a continuous source at (i=25, j=80, k=1) for a value of 100.0 units, for example. I have several questions with rbcs.
> my data.rbcs is:
>
> &RBCS_PARM01
> relaxMaskFile(3) = 'ptracers_mask.bin',
> rbcsForcingPeriod = 0.,
> useRBCtemp = .FALSE.,
> useRBCsalt = .FALSE.,
> /
>
> &RBCS_PARM02
> useRBCptrnum(1)=.TRUE.,
> tauRelaxPTR(1) = 3600.,
> relaxPtracerFile(1) = 'ptracers.bin',
> /
>
> and my data.ptracers is:
> &PTRACERS_PARM01
> PTRACERS_numInUse=1,
> PTRACERS_Iter0= 0000141840,
> PTRACERS_taveFreq=60.0,
> # tracer 1
> PTRACERS_names(1)='PT',
> PTRACERS_long_names(1)='Passive tracer',
> PTRACERS_units(1)='no units',
> PTRACERS_advScheme(1)=77,
> PTRACERS_useKPP(1)=.TRUE. ,
> PTRACERS_initialFile(1)='ptracers.bin',
> &
>
> Here are my questions:
> 1) I don't understand very well how to choose tauRelaxPTR values. My dt time step is 10s, and if I use tauRelaxPTR=10.0 s (for continuous source), my run explodes. I see that my run doesn't explode when tauRelaxPTR is from around 3600.0 seconds, but at this value, the continuous source (i=25,j=80,k=1) is around 90.0 after 1 hour, whereas in my relaxPtracerFile I wanted a value of 100 at this point. (see attach file). I thought that tauRelaxPTR was the timelapse to reach the value written in relaxPtracerFile ? How to do to reach 100 units more precisely in my source cell?
> 2) I would like to know your advices for the choice of the mask matrix in ptracers_mask.bin. For my test, I choose a mask value of exp( −0.8x), with x the distance to my source cell (i=25,j=80,k=1). I was inspired by this pdf, see page 92/160: http://digitool.library.mcgill.ca/R/?func=dbin-jump-full&object_id=132855&local_base=GEN01-MCG02
>
> 3) Just to know: ptracers.bin contained a matrix of 0 everywhere except a value of 100 units in my source cell (i=25,j=80,k=1). Can we have a continuous source for only one cell?
> Thank you very much for your advices,
>
> Camille
>
>
> Le 10/10/2017 à 13:13, Martin Losch a écrit :
>> 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
>> _______________________________________________
>> MITgcm-support mailing list
>>
>> MITgcm-support at mitgcm.org
>> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support
>
> --
> ------------------------------------------
> 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