[MITgcm-support] obcs for ptracers

Martin Losch Martin.Losch at awi.de
Mon Apr 28 03:05:44 EDT 2008


Hi Nataliya,
you can turn on/off the Orlanski BCs for each boundary indivually, so  
you can set "useOrlanskiEast = .false" if the eastern boundary is  
your ptracers boundary of interest and have the others  
(useOrlanskiWest/North/South) set to ".true.".

If you want to have Orlanski for dynamic variables (u/v/t/s) and  
still use ptracers at the same boundary you could try commenting out  
this check (the entire if block). It should work as ptracers does not  
affect the dynamics variables.

This whole Orlanski-business is not sorted out properly, sorry.

Martin
On 25 Apr 2008, at 16:08, Nataliya Stashchuk wrote:

> Martin,
>
> Yes, at three other boundaries I use Orlanski radiation conditions.  
> This means that at present it is impossible to use tracers for my  
> investigation.
>
> What you could recommend?
>
> Many thanks,
>
> Nataliya
>
> -----Original Message-----
> From: mitgcm-support-bounces at mitgcm.org [mailto:mitgcm-support- 
> bounces at mitgcm.org] On Behalf Of Martin Losch
> Sent: 25 April 2008 14:34
> To: mitgcm-support at mitgcm.org
> Subject: Re: [MITgcm-support] obcs for ptracers
>
> Nataliya,
> see comments below:
> On 25 Apr 2008, at 14:48, Nataliya Stashchuk wrote:
>
>> Martin,
>>
>> I am very sorry but I still have problems with tracers.
>>
>> 1.In programme obcs_calc.F I can't find line
>>                          OBEptr(J,K,bi,bj,iTracer) =
>>       &           pTracer(I_obc-1,J,K,bi,bj,iTracer)
>>       &           *_maskW(I_obc,J,K,bi,bj)
> Then you must have old code. In the current code it's on line 234
>>
>>
>> Here we have OBE for t,s,u,v,w,eta but not for tracers.
>>
>> 2. I tried to introduced tracers data at the boundary as you
>> suggested before via file data.ptracers
>>
>> &PTRACERS_PARM01
>> PTRACERS_ref=60*0.,61*1.,
>> PTRACERS_numInUse=1,
>> PTRACERS_initialFile='Tracer.init',
>> PTRACERS_names(1)='Tr',
>>
>> But I got error message:
>> STOP ABNORMAL END: S/R OBCS_CHECK statement executed
>>
>> Could you help?
>>
> No, unless you provide the full error message (in STDERR.0000, last
> 20 lines of "STDOUT", etc.), but probably you are trying to use
> ptracers together with the orlanski radiation condition, that's not
> yet implemented.
>
> M.
>
>>
>> Nataliya
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: mitgcm-support-bounces at mitgcm.org [mailto:mitgcm-support-
>> bounces at mitgcm.org] On Behalf Of Martin Losch
>> Sent: 24 April 2008 15:36
>> To: mitgcm-support at mitgcm.org
>> Subject: Re: [MITgcm-support] obcs for ptracers
>>
>> This is what you need to do:
>> 1. in your "code" directory, edit package.conf to include a line
>> "ptracers"
>> 2. In obcs_calc.F (not in obcs_calc.f) look for the code-block that
>> starts with #ifdef ALLOW_PTRACERS, for an eastern boundary you need
>> to replace the line
>>              OBEptr(J,K,bi,bj,iTracer) =
>>       &           pTracer(I_obc-1,J,K,bi,bj,iTracer)
>>       &           *_maskW(I_obc,J,K,bi,bj)
>> with what you want to have there, e.g
>>              OBEptr(J,K,bi,bj,iTracer) = 1.
>> 3. in your build directory, run
>> genmake2 (or make makefile) && make CLEAN && make depend && make
>> 4. in your run directory create a data.ptracers as you suggest, there
>> are more runtime flags that you can set, see PTRACERS_PARAMS.h and
>> ptracers_readparms.F, there is PTRACER_ref, which can be used to
>> prescribe an initial profile just like tRef, sRef.
>> The output files will be either ptracer.*.nc (if you use mnc/netcdf)
>> or PTRACER01.*.data/meta if you don't
>>
>> But again, you can do all this via input files (also the open
>> boundary conditions for T and S). This avoids editing obcs_calc.F
>>
>> Martin
>>
>> On 24 Apr 2008, at 16:25, Nataliya Stashchuk wrote:
>>
>>> Martin,
>>>
>>> Please, confirm that at first I must prepare file data.ptracers in
>>> which I show initial field for tracer as Tracer.init and than
>>> all results for tracer will be in files starting with Tr.
>>>
>>> -------------------------------------------------------------------- 
>>> -
>>> -
>>> ----------------------
>>> # This set-up is supposed to mimic salinity. That is, initially
>>> # PTRACER(:,:,:,1) is identical to salinity, except that the
>>> # open boundary conditions are different, so that PTRACER(:,:,:,1)
>>> evolves
>>> # differently than salinity.
>>>  &PTRACERS_PARM01
>>>  PTRACERS_numInUse=1,
>>>  PTRACERS_initialFile='Tracer.init',
>>>  PTRACERS_names(1)='Tr',
>>>  &
>>> -------------------------------------------------------------------- 
>>> -
>>> -
>>> ------------------------------
>>> Than in obcs_calc.F I must add one new line to fix tracer as 1 with
>>> name OBETr()
>>>
>>>
>>>          DO K=1,Nr
>>>           DO J=1-Oly,sNy+Oly
>>>             I_obc=OB_Ie(J,bi,bj)
>>>              IF (I_obc.ne.0) THEN
>>>               OBEu(J,K,bi,bj)=0.
>>>                OBEv(J,K,bi,bj)=0.
>>>
>>>               OBEt(J,K,bi,bj)=10.
>>>               OBEs(J,K,bi,bj)=10.
>>>
>>>               OBETr(J,K,bi,bj)=1.
>>>
>>>      Many thanks,
>>>
>>> Nataliya
>>>
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: mitgcm-support-bounces at mitgcm.org [mailto:mitgcm-support-
>>> bounces at mitgcm.org] On Behalf Of Martin Losch
>>> Sent: 24 April 2008 15:01
>>> To: mitgcm-support at mitgcm.org
>>> Subject: Re: [MITgcm-support] obcs for ptracers
>>>
>>> You can do that in quite the same way as for T and S:
>>> either you hard-code is in obcs_calc (instead OBCt=10. you use
>>> OBSptr=2. or so),
>>> or you prescribe a file with these open boundary conditions as done
>>> in exp4 (I prefer this, because you won't have to recompile the
>>> code).
>>>
>>> Martin
>>> On 24 Apr 2008, at 15:50, Nataliya Stashchuk wrote:
>>>
>>>> Martin,
>>>>
>>>> In verification/exp4/input data.ptracers  I found the following:
>>>> ------------------------------------------------------------------- 
>>>> -
>>>> -
>>>> -
>>>> ----------------------------------------------
>>>>
>>>> # This set-up is supposed to mimic salinity. That is, initially
>>>> # PTRACER(:,:,:,1) is identical to salinity, except that the
>>>> # open boundary conditions are different, so that PTRACER(:,:,:,1)
>>>> evolves
>>>> # differently than salinity.
>>>>  &PTRACERS_PARM01
>>>>  PTRACERS_numInUse=1,
>>>>  PTRACERS_initialFile='S.init',
>>>>  PTRACERS_names(1)='salt_mimic',
>>>>  &
>>>> ------------------------------------------------------------------- 
>>>> -
>>>> -
>>>> -
>>>> ------------------------------------------------
>>>> This means that in this experiment salinity is used as a tracer. In
>>>> such a case it is very simple to fix tracer at open boundary
>>>> condition.
>>>> For example if I want to fix temperature as 10 and salinity
>>>> (tracer) as 1 at eastern boundary I can change two last lines in
>>>> obcs_calc.F like this
>>>>
>>>> ------------------------------------------------------------------- 
>>>> -
>>>> -
>>>> -
>>>> ------------------------
>>>>
>>>> #ifdef ALLOW_OBCS_EAST
>>>> C     Eastern OB
>>>> #ifdef ALLOW_DEBUG
>>>>       IF (debugMode) CALL DEBUG_MSG('OBCS_CALC: East',myThid)
>>>> #endif
>>>>       IF (useOrlanskiEast) THEN
>>>> #ifdef ALLOW_ORLANSKI
>>>>         CALL ORLANSKI_EAST(
>>>>      &          bi, bj, futureTime,
>>>>      &          uVel, vVel, wVel, theta, salt,
>>>>      &          myThid )
>>>> #endif
>>>>       ELSE
>>>>         DO K=1,Nr
>>>>           DO J=1-Oly,sNy+Oly
>>>>             I_obc=OB_Ie(J,bi,bj)
>>>>             IF (I_obc.ne.0) THEN
>>>>               OBEu(J,K,bi,bj)=0.
>>>>               OBEv(J,K,bi,bj)=0.
>>>>
>>>>               OBEt(J,K,bi,bj)=10.
>>>>               OBEs(J,K,bi,bj)=1.
>>>>
>>>> ------------------------------------------------------------------- 
>>>> -
>>>> -
>>>> -
>>>> ----------------------------------------------------
>>>>
>>>> In my case I use both T and S to find density. Thus I will use
>>>> tracer as additional variable and I must fix its value at a
>>>> boundary.
>>>>
>>>> How I can do this?
>>>>
>>>> Nataliya
>>>>
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: mitgcm-support-bounces at mitgcm.org [mailto:mitgcm-support-
>>>> bounces at mitgcm.org] On Behalf Of Martin Losch
>>>> Sent: 24 April 2008 13:28
>>>> To: mitgcm-support at mitgcm.org
>>>> Subject: Re: [MITgcm-support] obcs for ptracers
>>>>
>>>> Nataliya,
>>>> I am not quite sure what exactly it is that you want to do, but you
>>>> can do two things to prescribe tracer concentration:
>>>> 1. with the rbcs package you can restore to some climatology (or
>>>> fixed in time) fields with a certain time scale
>>>> 2. with the obcs package you can prescribe open boundary values
>>>> (also
>>>> for passive tracers in ptracers), see verification/exp4 for a  
>>>> simple
>>>> example.
>>>>
>>>> Martin
>>>>
>>>> On 24 Apr 2008, at 13:31, Nataliya Stashchuk wrote:
>>>>
>>>>> Dear MITgcm users,
>>>>>
>>>>>
>>>>>
>>>>> The temperature and salinity  are fixed at one of the open
>>>>> boundaries in my computation area. EOS is used as Knudsen   
>>>>> equation
>>>>> for density in my runs.
>>>>>
>>>>>
>>>>>
>>>>> I will be happy to use the tracer in my investigation and need to
>>>>> fix the value of the tracer at the open boundary during the  
>>>>> run. My
>>>>> investigation of ptracer  pkg did not give me a clue how to do
>>>>> this. Could you help?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>>
>>>>>
>>>>> Nataliya
>>>>>
>>>>> _______________________________________________
>>>>> MITgcm-support mailing list
>>>>> MITgcm-support at mitgcm.org
>>>>> http://mitgcm.org/mailman/listinfo/mitgcm-support
>>>>
>>>> _______________________________________________
>>>> MITgcm-support mailing list
>>>> MITgcm-support at mitgcm.org
>>>> http://mitgcm.org/mailman/listinfo/mitgcm-support
>>>>
>>>> _______________________________________________
>>>> MITgcm-support mailing list
>>>> MITgcm-support at mitgcm.org
>>>> http://mitgcm.org/mailman/listinfo/mitgcm-support
>>>
>>> _______________________________________________
>>> MITgcm-support mailing list
>>> MITgcm-support at mitgcm.org
>>> http://mitgcm.org/mailman/listinfo/mitgcm-support
>>>
>>> _______________________________________________
>>> MITgcm-support mailing list
>>> MITgcm-support at mitgcm.org
>>> http://mitgcm.org/mailman/listinfo/mitgcm-support
>>
>> _______________________________________________
>> MITgcm-support mailing list
>> MITgcm-support at mitgcm.org
>> http://mitgcm.org/mailman/listinfo/mitgcm-support
>>
>> _______________________________________________
>> MITgcm-support mailing list
>> MITgcm-support at mitgcm.org
>> http://mitgcm.org/mailman/listinfo/mitgcm-support
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support




More information about the MITgcm-support mailing list