[MITgcm-support] High-frequency time series output at a single domain point for computation of a power spectrum
Martin Losch
Martin.Losch at awi.de
Tue Mar 29 02:06:37 EDT 2022
Hi Paul,
You need to read the mask in global_ocean.cs32x15 as
dat = np.fromfile('regMask_lat24.bin', dtype='>f8’) (because readBinaryPrec=64, in data)
Then it just contains 1.,2.,3., in a field with Nx=192, Ny=32, corresponding to the data.diagnostics.
nSetRegMskFile=1, sets number of layers in mask file
The 3 different floats 1.,2.,3. define the different regions (try to plot the cubed sphere field, another hurdle to take). South of 24S (1), North of 24N (3) and in between (2).
set_regMask(1:3) = 1, 1, 1,
means that all 3 regions are defined in layer 1 (which is the only layer in this case)
val_regMask(1:3) = 1., 2., 3.,
defines the identifier for the three regions that you find in the regMask_lat24.bin (they should match with what’s in the file, otherwise it does not work).
stat_region(1:3,5) = 1, 3, 0,
tells the model over which regions (now by index) to do the averages (in this case south of 24S (index=1) , north of 24N (index=3), and global(index=0) ).
The model then does the “statistics” (mean/min/max/std) for these three regions, for all vertical levels together, and for each vertical level individually.
Martin
> On 28. Mar 2022, at 18:15, Burns, Paul <P.Burns2 at exeter.ac.uk> wrote:
>
> Hi Martin,
>
> Apologies for the delay, I've been distracted by other tasks. I've just got around to sorting this out again. I have a couple of remaining questions:
> • If I set nSetRegMskFile=1, and so compute my statistics at only 1 level, how do I choose the level? I can't see an obvious way to choose the level.
>
> • To try and understand what is happening, I downloaded the binary file regMask_lat24.bin and read it into Python (using dat = np.fromfile('regMask_lat24.bin', dtype='>f4') ). The array 'dat' has length Nx*Ny*2, where Nx and Ny are the number of points along x and y coordinates, respectively. First of all, following your advice I was expecting dat to have length Nx*Ny..? The values in dat are strange, with non-integers appearing, whereas I was expecting only 0s and 1s. So either I have read in the binary incorrectly, or I am missing some information about how this works.
>
>
> Many thanks,
> Paul
>
>
>
> Dr Paul Burns MInstP FRMetS
> Research Fellow
> Geophysical and Astrophysical Fluid Dynamics Group
> Department of Mathematics
> Harrison Building
> University of Exeter
>
> From: MITgcm-support <mitgcm-support-bounces at mitgcm.org> on behalf of Martin Losch <Martin.Losch at awi.de>
> Sent: 27 January 2022 07:00
> To: mitgcm-support at mitgcm.org <mitgcm-support at mitgcm.org>
> Subject: Re: [MITgcm-support] High-frequency time series output at a single domain point for computation of a power spectrum
>
> CAUTION: This email originated from outside of the organisation. Do not click links or open attachments unless you recognise the sender and know the content is safe.
>
> The mask array “regMask_lat24.bin” (it’s in input) has the same horizontal dimensions as the model domain, plus a 3rd dimension of the length nSetRegMskFile. In the examples this is just one and there is only 1 level (you can see that because in input the 2D bathymetry files have the same size as regMask_lat24.bin). In theory you could have multiple levels in case you want to do averages of overlapping regions.
>
> Martin
> From: MITgcm-support <mitgcm-support-bounces at mitgcm.org> on behalf of Burns, Paul <P.Burns2 at exeter.ac.uk>
> Sent: Wednesday, January 26, 2022 11:07
> To: MITgcm-support at mitgcm.org
> Subject: Re: [MITgcm-support] High-frequency time series output at a single domain point for computation of a power spectrum
>
> Hi Martin,
>
> That's great. It looks like the stats part of the Diagnostics package is worth a try. It might be worth me looking at time series at different isolated domain points in the future.
>
> I had a look at the global_ocean.cs32x15 example. Do you know if the mask array should have the same dimensions as the model domain?
>
> Many thanks for your help,
> Paul
>
>
> Dr Paul Burns MInstP FRMetS
> Research Fellow
> Geophysical and Astrophysical Fluid Dynamics Group
> Department of Mathematics
> Harrison Building
> University of Exeter
>
> From: MITgcm-support <mitgcm-support-bounces at mitgcm.org> on behalf of Martin Losch <Martin.Losch at awi.de>
> Sent: 25 January 2022 18:30
> To: MITgcm Support <mitgcm-support at mitgcm.org>
> Subject: Re: [MITgcm-support] High-frequency time series output at a single domain point for computation of a power spectrum
>
> CAUTION: This email originated from outside of the organisation. Do not click links or open attachments unless you recognise the sender and know the content is safe.
>
>
> Hi Paul,
>
> you can use the statistics part of the diagnostics package and specify a mask for your spefict grid point. The masking is used in verification/global_ocean.cs32x15/input.seaice/data.diagnostics (DIAG_STATIS_PARMS) , but I agree the diagnostics package is not always straightforward.
>
> If it’s just this one-time thing, I would probably just add a print statement at the right place (o:
>
> Martin
>
> > On 25. Jan 2022, at 13:17, Burns, Paul <P.Burns2 at exeter.ac.uk> wrote:
> >
> > Hi,
> >
> > I am using MITgcm and subscribed to the mailing list. I need to write out timeseries at high time frequency and at a single point in the domain, in order to compute a power spectrum. I am currently using the Diagnostics package to write out state fields, but I am unclear how to modify my setup to write out timeseries data at a single point.
> >
> > I would be grateful if someone could advise me about how to go about this? The Diagnostics package is complex.
> >
> >
> > Many thanks,
> > Paul
> >
> >
> >
> >
> > Dr Paul Burns MInstP FRMetS
> > Research Fellow
> > Geophysical and Astrophysical Fluid Dynamics Group
> > Department of Mathematics
> > Harrison Building
> > University of Exeter
> >
> > _______________________________________________
> > MITgcm-support mailing list
> > MITgcm-support at mitgcm.org
> > https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmailman.mitgcm.org%2Fmailman%2Flistinfo%2Fmitgcm-support&data=04%7C01%7CP.Burns2%40exeter.ac.uk%7Ce0d16f86b9f446d29cdf08d9e030d7ad%7C912a5d77fb984eeeaf321334d8f04a53%7C0%7C0%7C637787322844758474%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=UlMaeZBBwEBPNNxJXe31QVk9%2FrGERTToeMs5NsLDsGQ%3D&reserved=0
>
> _______________________________________________
> 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