[ncl-talk] How to convert the value of a NetCDF file to zero

Dennis Shea shea at ucar.edu
Mon Jan 22 20:28:58 MST 2024


Hi Setareh,

Use the seterah2.ncl script as a guide for what you wish to accomplish.

Please read some NCL documentation. Then, try to write a test script.

The following may be useful.



*getind_latlon2d
<https://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml>region_ind
<https://www.ncl.ucar.edu/Document/Functions/Contributed/region_ind.shtml>*


*Good luck*


*ncl-team*



On Mon, Jan 22, 2024 at 1:19 AM Setareh Rahimi <setareh.rahimi at gmail.com>
wrote:

> So many thanks for your help. I have another question please. If I want to
> do the same thing only for specific range of lat/lon, how can I do that?
> For example lat(30,40), and Lon (0,20)?
>
> Would you please kindly advise me in this regard?
>
> Kind regards.
>
> S.Rahimi
>
>
>
> On Sun, Jan 21, 2024 at 18:44 Dennis Shea <shea at ucar.edu> wrote:
>
>> Attached is a script that does what you requested.
>>
>>
>> On Sat, Jan 20, 2024 at 6:40 AM Setareh Rahimi via ncl-talk <
>> ncl-talk at mailman.ucar.edu> wrote:
>>
>>>
>>> Dear NCL users,
>>>
>>> I have a NetCDF file (attached) that contains some variables. I
>>> would like to change the values of all variables to zero for all grid
>>> points. So how can I do this using NCL, please?
>>>
>>> This file is an input file for the WRF-Chem model, and I do not want to
>>> change the format of the file, only want to change the values to zero.
>>>
>>> Please kindly advise me in this regard.
>>>
>>> Thanks in advance.
>>> Kind regards,
>>> --
>>> S.Rahimi
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at mailman.ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20240122/863f6548/attachment.htm>


More information about the ncl-talk mailing list