This can be done with @loc. From the manual:
Note that the transformation @LOC can be used to locate non-constant values, too, as the following example illustrates:
Example: locating non-constant values
Determine the depth of maximum salinity.
yes? LET max_salt = salt[Z=@MAX]
yes? LET zero_at_max = salt - max_salt
yes? LET depth_of_max = zero_at_max[Z=@LOC:0]
> On Mar 16, 2022, at 7:35 AM, saurabh rathore <rohitsrb2020@xxxxxxxxx> wrote:
>
> Dear Ferreters
> G'day
>
> I want to locate the depth of maximum of AMOC in my model data. Here is the data
>
> name title I J K L
> ATLMOC ATL[I=@SUM,K=@RSUM] ... 1:331 1:75 1:140
>
> !!!!! for finding maximum of ATLMOC for a fixed latitude (J=246) and depth level range (K=36:65) for time (L=140) !!!!!!!!
>
> list ATLMOC[j=246,k=36:65@max,l=140]
> results = 1.670E+07
>
> !!! Now I want to locate the depth of this maximum at j=246 and l=140 but this command is not working and it is not showing any value !!!!!!
> list ATLMOC[j=246,k=@loc:16700000,l=140]
>
> VARIABLE : DEPTH (m) of 16700000 in ATL[I=@SUM,K=@RSUM] (m)
> X=0.5:360.5, Z=0:6004
> FILENAME : moc140.nc
> Y : 246
> DEPTH (m): 0 to 6004 (location of 16700000)
> TIME : 02-JUL-0140 12:00 NOLEAP
> ....
>
> One can see the depth and its level (k) for the maximum value by
>
> list ATLMOC[j=246,k=36:65,l=140]
>
> 333.9 / 36: 8.721E+06
> 370.7 / 37: 9.703E+06
> 411.8 / 38: 1.076E+07
> 457.6 / 39: 1.186E+07
> 508.6 / 40: 1.296E+07
> 565.3 / 41: 1.399E+07
> 628 / 42: 1.486E+07
> 697.3 / 43: 1.565E+07
> 773.4 / 44: 1.632E+07
> 856.7 / 45: 1.670E+07 !!! depth level of maximum value !!!!!1
> 947.4 / 46: 1.660E+07
> 1045.9 / 47: 1.601E+07
> 1152 / 48: 1.506E+07
> 1265.9 / 49: 1.395E+07
> 1387.4 / 50: 1.277E+07
> 1516.4 / 51: 1.150E+07
> 1652.6 / 52: 1.006E+07
> 1795.7 / 53: 8.410E+06
> 1945.3 / 54: 6.652E+06
> 2101 / 55: 4.997E+06
> 2262.4 / 56: 3.281E+06
> 2429 / 57: 1.515E+06
> 2600.4 / 58: -3.571E+05
> 2776 / 59: -1.591E+06
> 2955.6 / 60: -2.326E+06
> 3138.6 / 61: -2.764E+06
> 3324.6 / 62: -2.772E+06
> 3513.4 / 63: -2.801E+06
> 3704.7 / 64: -2.813E+06
> 3898 / 65: -2.774E+06
>
> So I want to know how to locate the depth for the maximum value? I can not understand what mistake I am doing for this simple calculation.
>
> Thanks in advance.
>
> Cheers, Saurabh
>
> --
>
>
> REGARDS
>
> Saurabh Rathore
> Research Scholar (PhD.)
> Centre For Oceans, Rivers, Atmosphere & Land Science Technology
> Indian Institute Of Technology, Kharagpur
> contact :- 91- 8345984434
(Still) working at home: +1 206-228-7330 (m)