[MITgcm-support] KPP diffusion of ptracers

Martin Losch martin.losch at awi.de
Wed Aug 10 02:48:36 EDT 2016


Hi Hadar,

I think this is a “feature” of the model: KPPghatK is i filled in kpp_output.F but S/R kpp_output is called from S/R do_the_model_io only in online model (here’s the call in do_the_model_io.F):

#ifdef ALLOW_KPP
C     Do KPP diagnostics.
      IF ( useKPP .AND. .NOT.useOffLine )
     &     CALL KPP_OUTPUT( myTime, myIter, myThid )
#endif

You can probably just change the if-condition to “IF ( useKPP ) CALL KPP_OUTPUT …”

KPPgTR01 is filled in gad_calc_rhs.F near line 697. Can’t see, why that should be all zero in an offline run, if ghat is non-zero, but if you have a look at kpp_transport_ptr, you’ll see that in the offline case things are a little different than in the online case. Maybe that helps ...

Martin

> On 09 Aug 2016, at 18:42, Hadar Berman <hadarberman at gmail.com> wrote:
> 
> Hi Martin,
> 
> Here are my data.pkg and data.ptracers files:
> 
> data.pkg:
> # Packages
> &PACKAGES
>  useGMRedi=.FALSE.,
>  useKPP=.TRUE.,
>  useMNC=.TRUE.,
>  useOBCS= .TRUE.,
>  useRBCS= .FALSE.,
>  useDIAGNOSTICS=.TRUE.,
>  usePTRACERS=.TRUE.,
>  useGCHEM=.TRUE.,
>  useOffLine=.TRUE.,
> &
> 
> data.ptracers:
> &PTRACERS_PARM01
> PTRACERS_numInUse=5,
> PTRACERS_Iter0= 9020160,
> # tracer 1 - nitrate
> PTRACERS_names(1)='NO3',
> PTRACERS_units(1)='mmol N/m^3',
> PTRACERS_advScheme(1)=33,
> PTRACERS_diffKh(1)=0.E3,
> PTRACERS_diffKr(1)=1.E-5,
> PTRACERS_useGMRedi(1)=.FALSE.,
> PTRACERS_useKPP(1)=.TRUE.,
> PTRACERS_initialFile(1)='../input/NO3init_300.bin',
> # tracer 2 - DON
> PTRACERS_names(2)='DON',
> PTRACERS_units(2)='mmol N/m^3',
> PTRACERS_advScheme(2)=33,
> PTRACERS_diffKh(2)=0.E3,
> PTRACERS_diffKr(2)=1.E-5,
> PTRACERS_useGMRedi(2)=.FALSE.,
> PTRACERS_useKPP(2)=.TRUE.,
> PTRACERS_initialFile(2)='../input/DONinit_300.bin',
> # tracer 3 - ZOO1P
> PTRACERS_names(3)='ZOO1P',
> PTRACERS_units(3)='mmol P/m^3'
> PTRACERS_advScheme(3)=33,
> PTRACERS_diffKh(3)=0.E3,
> PTRACERS_diffKr(3)=1.E-5,
> PTRACERS_useGMRedi(3)=.FALSE.,
> PTRACERS_useKPP(3)=.TRUE.,
> PTRACERS_initialFile(3)='../input/ZOOinit_300.bin',
> # tracer 4 - PON   
> PTRACERS_names(4)='PON',
> PTRACERS_units(4)='mmol N/m^3',
> PTRACERS_advScheme(4)=33,
> PTRACERS_diffKh(4)=0.E3,
> PTRACERS_diffKr(4)=1.E-5,
> PTRACERS_useGMRedi(4)=.FALSE.,
> PTRACERS_useKPP(4)=.TRUE.,
> PTRACERS_initialFile(4)='../input/PONinit_300.bin',
> # tracer 5 - PHYT01
> PTRACERS_names(5)='Phy01',
> PTRACERS_units(5)='mmol P/m^3'
> PTRACERS_advScheme(5)=33,
> PTRACERS_diffKh(5)=0.E3,
> PTRACERS_diffKr(5)=1.E-5,
> PTRACERS_useGMRedi(5)=.FALSE.,
> PTRACERS_useKPP(5)=.TRUE.,
> PTRACERS_initialFile(5)='../input/PHYinit_300.bin',
> &
> 
> Thanks for your help,
> 
> Hadar.
> 
> On Aug 9, 2016, at 19:00, mitgcm-support-request at mitgcm.org wrote:
>> 
>> ------------------------------
>> 
>> Message: 2
>> Date: Tue, 9 Aug 2016 17:00:40 +0200
>> From: Martin Losch <martin.losch at awi.de>
>> To: MITgcm Support <mitgcm-support at mitgcm.org>
>> Subject: Re: [MITgcm-support] KPP diffusion of ptracers
>> Message-ID: <53CF7745-7A2D-425C-929E-E9B1D0CC0D59 at awi.de>
>> Content-Type: text/plain; charset="windows-1252"
>> 
>> Hi Hadar,
>> 
>> I haven?t run the model in offline mode yet, but what do your data.pkg and data.ptracers look like?
>> 
>> Martin
>> 
>>> On 07 Aug 2016, at 18:35, Hadar Berman <hadarberman at gmail.com> wrote:
>>> 
>>> Hello,
>>> 
>>> I am building an ecological model for the Gulf of Elat using the darwin pkg after I configured it for my use. I am using the version MITgcm_c65n. I am running this model in offline mode, with input files for KPP, velocities, salt and temperature (see attached data.off). I am trying to see the diffusion due to the kpp scheme with the diagnostics package, and it seems that the output from the diagnostics package of KPPgTr01 is all zeros. Using the offline pkg KPPghatK is not written - I get an error in STDERR of:
>>> 
>>> (PID.TID 0000.0001) - WARNING -   diag.#   128 : KPPghatK (#   1 ) in outp.Stream: KPPghatK
>>> (PID.TID 0000.0001) - WARNING -   has not been filled (ndiag=  0 )
>>> (PID.TID 0000.0001) WARNING DIAGNOSTICS_OUT  => write ZEROS instead
>>> 
>>> But I tried to print the values in offline_get_diffus.F and they are non zero there. 
>>> I tried to check this issue also in the online model, and here I do get non-zero values for KPPghatK (it is written into the diagnostics pkg in this case), but KPPgTr01 is still all zeros. Tracer 1 is not all zeros.
>>> 
>>> I can?t seem to understand why this is the output, since KPPg is not zero as far as I can tell.
>>> 
>>> These are the data files for the offline model:
>>> 
>>> data:
>>> 
>>> # ===================
>>> # | Model parameters |
>>> # ====================
>>> #
>>> # Continuous equation parameters
>>> &PARM01
>>> tRef               = 25.1802,25.0046,24.5519,23.8771,23.3200,22.8004,22.4412,22.2013,22.0148,21.8971,21.8289,21.7756,21.7318,21.6987,21.6644,21.6436,21.6331,21.6271,21.6216,21.6149,21.6078,21.5973,21.5984,21.5975,21.5944,21.5897,21.5834,21.5821,21.5821,21.5821,21.5821,21.5821,
>>> sRef               = 40.3499,40.3473,40.3498,40.3558,40.3449,40.3549,40.3713,40.3862,40.4040,40.4214,40.4385,40.4526,40.4659,40.4809,40.4995,40.5211,40.5407,40.5525,40.5559,40.5590,40.5621,40.5655,40.5687,40.5719,40.5761,40.5825,40.5909,40.5933,40.5933,40.5933,40.5933,40.5933,
>>> viscAh             = 0.,
>>> viscAz             = 5.e-4,
>>> diffKzT            = 1.e-5,
>>> diffKzS            = 1.e-5, 
>>> viscA4             = 0.,
>>> diffKhT            = 0.,
>>> diffKhS            = 0.,
>>> viscC2smag         = 2.5,
>>> viscAhGridMax      = 0.5,
>>> f0                 = 7.22E-5,
>>> beta               = 0.,
>>> gravity            = 9.81,
>>> gBaro              = 9.81,
>>> convertFW2Salt     = -1.,
>>> rigidLid           = .FALSE.,
>>> implicitFreeSurface= .TRUE.,
>>> implicitDiffusion  = .TRUE.,
>>> useCDscheme        = .FALSE.,
>>> useJamartWetPoints = .TRUE.,
>>> # eosType            = 'MDJWF',
>>> implicitViscosity  = .TRUE.,
>>> no_slip_bottom     = .TRUE.,
>>> no_slip_sides      = .FALSE.,
>>> bottomDragQuadratic=  2e-3,
>>> nonHydrostatic     = .FALSE.,
>>> tempAdvScheme      = 33,
>>> saltAdvScheme      = 33,
>>> staggerTimeStep    = .true.,
>>> hFacMin            =.05,
>>> hFacMindz          = 10.,
>>> readBinaryPrec     = 64,
>>> debuglevel         = 2,
>>> globalFiles        = .TRUE.,
>>> useSingleCpuIO     = .TRUE.,
>>> &
>>> 
>>> # Elliptic solver parameters
>>> &PARM02
>>> cg2dMaxIters        = 200,
>>> cg2dTargetResidual  = 1.E-12,
>>> cg3dMaxIters        = 300,
>>> cg3dTargetResidual  = 1.E-8,
>>> &
>>> 
>>> # Time stepping parameters
>>> &PARM03
>>> nIter0=9020160,
>>> nTimeSteps=10,
>>> deltaTtracer=500.,
>>> deltaTClock=500.,
>>> abEps      = 0.1,
>>> pChkptFreq=2592000.,
>>> dumpFreq=500.,
>>> dumpInitAndLast = .TRUE.,
>>> periodicExternalForcing = .TRUE.,
>>> taveFreq= 2592000.,
>>> externForcingPeriod = 1800.0,
>>> externForcingCycle = 31104000.0,
>>> monitorFreq=86400.,
>>> forcing_in_AB = .FALSE.,
>>> pickupStrictlyMatch=.False.,
>>> &	
>>> 
>>> # Gridding parameters
>>> &PARM04
>>> usingCartesianGrid      = .TRUE.,
>>> usingSphericalPolarGrid = .FALSE.,
>>> delX   = 112*300,
>>> delY   = 680*300,
>>> delZ  = 10, 10, 15, 15, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 50, 70, 100, 130, 170, 220, 240, 270,
>>> &
>>> 
>>> # Input datasets
>>> 
>>> &PARM05
>>> bathyFile       = '../input/Rbath300_nTiran.bin', 
>>> &
>>> 
>>> 
>>> data.kpp:
>>> 
>>> # KPP parameters
>>> &KPP_PARM01
>>> # KPPmixingMaps - if true, include KPP diagnostic maps in STDOUT
>>> # KPPwriteState - if true, write KPP state to file
>>> # kpp_dumpFreq  - KPP dump frequency. (s)
>>> KPPmixingMaps   = .FALSE.,
>>> KPPwriteState   = .TRUE.,
>>> #kpp_dumpFreq    = 43200.0,
>>> #kpp_freq = 50.,
>>> &
>>> 
>>> 
>>> data.off:
>>> 
>>> &OFFLINE_PARM01
>>> UvelFile= '../run_physical_30min/uVeltave',
>>> VvelFile= '../run_physical_30min/vVeltave',
>>> WvelFile= '../run_physical_30min/wVeltave',
>>> # ConvFile= '../input/input_off/Convtave',
>>> SaltFile= '../run_physical_30min/Stave',
>>> ThetFile= '../run_physical_30min/Ttave',
>>> KPP_DiffSFile= '../run_physical_30min/KPPdiffKzS-T',
>>> KPP_ghatKFile= '../run_physical_30min/KPPghatKS-T',
>>> &
>>> 
>>> &OFFLINE_PARM02
>>> offlineIter0=9020160,
>>> offlineLoadPrec=32,
>>> deltaToffline=100.,
>>> offlineForcingPeriod=1800.0,
>>> offlineForcingCycle=31104000.0,
>>> &
>>> 
>>> 
>>> Thanks for your help,
>>> Hadar Berman.
>>> _______________________________________________
>>> 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
>> 
>> 
>> End of MITgcm-support Digest, Vol 158, Issue 2
>> **********************************************
> 
> 
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support




More information about the MITgcm-support mailing list