From setareh.rahimi at gmail.com Wed Nov 1 12:59:46 2023 From: setareh.rahimi at gmail.com (Setareh Rahimi) Date: Wed, 1 Nov 2023 22:29:46 +0330 Subject: [ncl-talk] Cross section plot for AOD In-Reply-To: References: Message-ID: Hi Dave, Thanks for your advice. It seems that there is no defined coordinate for "level". I checked the coordinate for the level for another variable but found nothing, below is a summary of the tested variable as you suggested: -------------------------------------------------------------------------------------------------------------------------------------------------------- Variable: d Type: float Total Size: 294887880 bytes 73721970 values Number of Dimensions: 4 Dimensions and sizes: [Time | 49] x [bottom_top | 30] x [south_north | 229] x [west_east | 219] Coordinates: Number Of Attributes: 6 FieldType : 104 MemoryOrder : XYZ description : dust loss by wet deposition for size 5 units : ug/kg-dryair stagger : coordinates : XLONG XLAT XTIME -------------------------------------------------------------------------------------------------------------------------------------------------------- here is prinVarSummary for AOD : Variable: AOD550_3D Type: float Total Size: 6018120 bytes 1504530 values Number of Dimensions: 4 Dimensions and sizes: [Time | 1] x [level | 30] x [south_north | 229] x [west_east | 219] Coordinates: Time: [ 24.. 24] Number Of Attributes: 3 description : AOD550_3D long_name : AOD550_3D _FillValue : 9.96921e+36 -------------------------------------------------------------------------------------------------------------------------------------------------------- So in this case what is your suggestion, please? kind regards, On Sun, Oct 29, 2023 at 10:07?PM Dave Allured - NOAA Affiliate < dave.allured at noaa.gov> wrote: > Find the level coordinate on one of your input variables, and attach a > copy to AOD after the AOD calculation. It should be something like > "aod&level = input&level". Please refer to the section on coordinate > variables in the user manual. If you have trouble, then please show > printVarSummary for AOD, and for one of the input variables that has levels. > > > On Sun, Oct 29, 2023 at 11:10?AM Setareh Rahimi via ncl-talk < > ncl-talk at mailman.ucar.edu> wrote: > >> Dear all, >> I have calculated Aerosol Optical Depth (AOD) from WRF-Chem output using >> "TAUAER2" and "TAUAER3" (script attached). I would like to plot AOD for a >> specific latitude, on height. So after calculating AOD, I used *"gsn_csm_pres_hgt" >> *to do so. However, I have got the below error: >> >> *fatal: Dimension (level) of (AOD550_3D) does not have an associated >> coordinate variable* >> >> >> >> So how can I remove this error, please? >> >> Thanks in advance. >> >> >> S.Rahimi >> > -- S.Rahimi -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.allured at noaa.gov Wed Nov 1 13:15:14 2023 From: dave.allured at noaa.gov (Dave Allured - NOAA Affiliate) Date: Wed, 1 Nov 2023 13:15:14 -0600 Subject: [ncl-talk] Cross section plot for AOD In-Reply-To: References: Message-ID: Setareh, it looks like you are starting with processed data files that did not preserve the original level coordinates. Please go back to your original data source and get the numeric height values for the 30 levels. Add those levels as a new coordinate variable in your current input files. There is more than one way to do that. Be careful to use and verify the correct ordering, up or down. Note that the actual name of a level or height dimension is not fixed and can change between files. Above, "bottom_top" and "level" are the same thing. -------------- next part -------------- An HTML attachment was scrubbed... URL: From setareh.rahimi at gmail.com Wed Nov 1 13:31:10 2023 From: setareh.rahimi at gmail.com (Setareh Rahimi) Date: Wed, 1 Nov 2023 23:01:10 +0330 Subject: [ncl-talk] Cross section plot for AOD In-Reply-To: References: Message-ID: Thanks for your reply. It is WRF-Chem out put that I am using. So this is the original data file. So what should I do please? On Wed, Nov 1, 2023 at 22:45 Dave Allured - NOAA Affiliate < dave.allured at noaa.gov> wrote: > Setareh, it looks like you are starting with processed data files that did > not preserve the original level coordinates. Please go back to your > original data source and get the numeric height values for the 30 levels. > Add those levels as a new coordinate variable in your current input files. > There is more than one way to do that. Be careful to use and verify the > correct ordering, up or down. > > Note that the actual name of a level or height dimension is not fixed and > can change between files. Above, "bottom_top" and "level" are the same > thing. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.allured at noaa.gov Wed Nov 1 13:41:58 2023 From: dave.allured at noaa.gov (Dave Allured - NOAA Affiliate) Date: Wed, 1 Nov 2023 13:41:58 -0600 Subject: [ncl-talk] Cross section plot for AOD In-Reply-To: References: Message-ID: Please contact the original data provider and ask them how to get the level or height coordinates. If you do not find this in your WRF output file, then I suspect that WRF provides this as ancilliary data in a separate file. But I do not know how they actually do it. On Wed, Nov 1, 2023 at 1:31?PM Setareh Rahimi wrote: > Thanks for your reply. It is WRF-Chem out put that I am using. So this is > the original data file. So what should I do please? > > On Wed, Nov 1, 2023 at 22:45 Dave Allured - NOAA Affiliate < > dave.allured at noaa.gov> wrote: > >> Setareh, it looks like you are starting with processed data files that >> did not preserve the original level coordinates. Please go back to your >> original data source and get the numeric height values for the 30 levels. >> Add those levels as a new coordinate variable in your current input files. >> There is more than one way to do that. Be careful to use and verify the >> correct ordering, up or down. >> >> Note that the actual name of a level or height dimension is not fixed and >> can change between files. Above, "bottom_top" and "level" are the same >> thing. >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From setareh.rahimi at gmail.com Wed Nov 1 13:55:29 2023 From: setareh.rahimi at gmail.com (Setareh Rahimi) Date: Wed, 1 Nov 2023 23:25:29 +0330 Subject: [ncl-talk] Cross section plot for AOD In-Reply-To: References: Message-ID: OK Dave, thanks for your advice, I will do that and let you know the result. Best wishes, On Wed, Nov 1, 2023 at 11:12?PM Dave Allured - NOAA Affiliate < dave.allured at noaa.gov> wrote: > Please contact the original data provider and ask them how to get the > level or height coordinates. If you do not find this in your WRF output > file, then I suspect that WRF provides this as ancilliary data in a > separate file. But I do not know how they actually do it. > > > On Wed, Nov 1, 2023 at 1:31?PM Setareh Rahimi > wrote: > >> Thanks for your reply. It is WRF-Chem out put that I am using. So this is >> the original data file. So what should I do please? >> >> On Wed, Nov 1, 2023 at 22:45 Dave Allured - NOAA Affiliate < >> dave.allured at noaa.gov> wrote: >> >>> Setareh, it looks like you are starting with processed data files that >>> did not preserve the original level coordinates. Please go back to your >>> original data source and get the numeric height values for the 30 levels. >>> Add those levels as a new coordinate variable in your current input files. >>> There is more than one way to do that. Be careful to use and verify the >>> correct ordering, up or down. >>> >>> Note that the actual name of a level or height dimension is not fixed >>> and can change between files. Above, "bottom_top" and "level" are the same >>> thing. >>> >> -- S.Rahimi -------------- next part -------------- An HTML attachment was scrubbed... URL: From zeinabsalah at gmail.com Fri Nov 3 23:39:35 2023 From: zeinabsalah at gmail.com (Zeinab Salah) Date: Sat, 4 Nov 2023 07:39:35 +0200 Subject: [ncl-talk] error in plotting storm track Message-ID: Dear All, We try to plot the track of storm from WRF output using the attached ncl script. The attached figure results in, but just points without lines, and gets the warning of " warning:gsnAddCyclic is not a valid resource in map at this time". We used one WRF file with a 3 hours interval, and the number of points in x and y directions are 99. The logfile of the script is attached Thank you in advance. Best regards, Zeinab -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- Copyright (C) 1995-2015 - All Rights Reserved University Corporation for Atmospheric Research NCAR Command Language Version 6.3.0 The use of this software is governed by a License Agreement. See http://www.ncl.ucar.edu/ for more details. (0) Check input data:1 .ne. 25 warning:gsnAddCyclic is not a valid resource in map at this time (0) dot:19.3146,34.8235 (0) dot:19.3146,34.8235 (0) dot:19.3146,34.9299 (0) dot:19.3146,34.8235 (0) dot:19.3146,34.717 (0) dot:19.5739,34.717 (0) dot:23.9824,29.334 (0) dot:24.501,30.01 (0) dot:19.3146,34.6103 (0) dot:19.3146,34.0751 (0) dot:19.3146,33.9676 (0) dot:19.3146,33.9676 (0) dot:19.3146,33.9676 (0) dot:19.3146,34.1824 (0) dot:19.3146,34.1824 (0) dot:19.3146,34.2896 (0) dot:19.3146,34.6103 (0) dot:19.3146,34.5036 (0) dot:19.3146,34.5036 (0) dot:19.3146,34.2896 (0) dot:32.0214,31.0153 (0) dot:30.7248,36.717 (0) dot:19.3146,33.86 (0) dot:19.3146,33.86 (0) dot:19.3146,33.86 (0) Eye:4946 (0) Eye:4946 (0) Eye:5045 (0) Eye:4946 (0) Eye:4847 (0) Eye:4849 (0) Eye:32 (0) Eye:630 (0) Eye:4748 (0) Eye:4253 (0) Eye:4154 (0) Eye:4154 (0) Eye:4154 (0) Eye:4352 (0) Eye:4352 (0) Eye:4451 (0) Eye:4748 (0) Eye:4649 (0) Eye:4649 (0) Eye:4451 (0) Eye:1579 (0) Eye:6816 (0) Eye:4055 (0) Eye:4055 (0) Eye:4055 -------------- next part -------------- A non-text attachment was scrubbed... Name: WRF_track_1.ncl Type: application/octet-stream Size: 4952 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: track.ps Type: application/postscript Size: 172836 bytes Desc: not available URL: From setareh.rahimi at gmail.com Fri Nov 10 01:04:33 2023 From: setareh.rahimi at gmail.com (Setareh Rahimi) Date: Fri, 10 Nov 2023 11:34:33 +0330 Subject: [ncl-talk] Save output as a NetCDF or tiff file Message-ID: Dear all, I have calculated Aerosol Optical Depth (AOD) from WRF-Chem output using "TAUAER2" and "TAUAER3" variables (script attached). Instead of using the created AOD to plot it, I would like to save the AOD as a NetCDF or tiff file. So how can I do this, please? I have another question. How can I extract one variable from the model output and save it as a NetCDF or tiff file? Please help me with these issues. Kind regards, -- S.Rahimi -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: aod Type: application/octet-stream Size: 6985 bytes Desc: not available URL: From shea at ucar.edu Fri Nov 10 09:46:50 2023 From: shea at ucar.edu (Dennis Shea) Date: Fri, 10 Nov 2023 09:46:50 -0700 Subject: [ncl-talk] Save output as a NetCDF or tiff file In-Reply-To: References: Message-ID: netCDF operator 'ncks' to extract a variable from a netCDF file and copy it to another %> ncks -v xxx Model.nc XXX.nc where 'xxx' is the name of the variable on the model file =============================== AOD *system* ("/bin/rm -f AOD.nc") ; remove any pre-existing file ncdf = *addfile* ("AOD.nc" ,"c") ; open output netCDF file ;=================================================================== ; create global attributes of the file (optional) ;=================================================================== fAtt = True ; assign file attributes fAtt at title = "Derived AOD" fAtt at creation_date = *systemfunc* ("date") *fileattdef* ( ncdf, fAtt ) ; copy file attributes ;=================================================================== ; make time an UNLIMITED dimension; recommended for most applications ;=================================================================== *filedimdef* (ncdf,"time",-1,True) ;=================================================================== ; output variables directly; NCL will call appropriate functions ; to write the meta data associated with each variable ;=================================================================== ncdf->AOD = AOD ================================ See *https://www.ncl.ucar.edu/Applications/method_1.shtml * On Fri, Nov 10, 2023 at 1:02?AM Setareh Rahimi via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Dear all, > I have calculated Aerosol Optical Depth (AOD) from WRF-Chem output using > "TAUAER2" and "TAUAER3" variables (script attached). Instead of using the > created AOD to plot it, I would like to save the AOD as a NetCDF or tiff > file. So how can I do this, please? > I have another question. How can I extract one variable from the model > output and save it as a NetCDF or tiff file? > Please help me with these issues. > 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: From setareh.rahimi at gmail.com Fri Nov 10 13:41:02 2023 From: setareh.rahimi at gmail.com (Setareh Rahimi) Date: Sat, 11 Nov 2023 00:11:02 +0330 Subject: [ncl-talk] Save output as a NetCDF or tiff file In-Reply-To: References: Message-ID: Thank you so much for your help. How can I assign lat/lon to the AOD, please? I used the below lines in the script but received the following error: " fatal:(XLAT) is not a named dimension in variable (a2)". system("/bin/rm -f AOD550_2D.nc") ; remove any pre-existing file ncdf = addfile("AOD550_2D.nc" ,"c") ; open output netCDF file ;=================================================================== ; create global attributes of the file (optional) ;=================================================================== fAtt = True ; assign file attributes fAtt at title = "Derived AOD" fAtt at creation_date = systemfunc ("date") fileattdef( ncdf, fAtt ) ; copy file attributes ;=================================================================== ; make time an UNLIMITED dimension; recommended for most applications ;=================================================================== filedimdef(ncdf,"time",-1,True) ;=================================================================== ; output variables directly; NCL will call appropriate functions ; to write the meta data associated with each variable ;=================================================================== ncdf->AOD550_2D = AOD550_2D ncdf->a2 = a2(0,:,:,:) AOD550_2D!0 = "lat" AOD550_2D!1 = "lon" AOD550_2D&lat = a2&XLAT =========================================================================================== here is printVarSummary of "a2" Variable: a2 Type: float Total Size: 144434880 bytes 36108720 values Number of Dimensions: 4 Dimensions and sizes: [Time | 24] x [bottom_top | 30] x [south_north | 229] x [west_east | 219] Coordinates: Time: [ 0.. 23] Number Of Attributes: 6 coordinates : XLONG XLAT XTIME stagger : units : ? description : bin 2 layer optical thickness MemoryOrder : XYZ FieldType : 104 On Fri, Nov 10, 2023 at 8:17?PM Dennis Shea wrote: > netCDF operator 'ncks' to extract a variable from a netCDF file and copy > it to another > > %> ncks -v xxx Model.nc XXX.nc > > where 'xxx' is the name of the variable on the model file > =============================== > AOD > > *system* ("/bin/rm -f AOD.nc") ; remove any pre-existing file > ncdf = *addfile* ("AOD.nc" ,"c") ; open output netCDF file > > ;=================================================================== > ; create global attributes of the file (optional) > ;=================================================================== > fAtt = True ; assign file attributes > fAtt at title = "Derived AOD" > fAtt at creation_date = *systemfunc* ("date") > *fileattdef* ( ncdf, fAtt ) ; copy file attributes > > ;=================================================================== > ; make time an UNLIMITED dimension; recommended for most applications > ;=================================================================== > *filedimdef* (ncdf,"time",-1,True) > > ;=================================================================== > ; output variables directly; NCL will call appropriate functions > ; to write the meta data associated with each variable > ;=================================================================== > ncdf->AOD = AOD > > ================================ > See > *https://www.ncl.ucar.edu/Applications/method_1.shtml > * > > On Fri, Nov 10, 2023 at 1:02?AM Setareh Rahimi via ncl-talk < > ncl-talk at mailman.ucar.edu> wrote: > >> Dear all, >> I have calculated Aerosol Optical Depth (AOD) from WRF-Chem output using >> "TAUAER2" and "TAUAER3" variables (script attached). Instead of using the >> created AOD to plot it, I would like to save the AOD as a NetCDF or tiff >> file. So how can I do this, please? >> I have another question. How can I extract one variable from the model >> output and save it as a NetCDF or tiff file? >> Please help me with these issues. >> 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 >> > -- S.Rahimi -------------- next part -------------- An HTML attachment was scrubbed... URL: From shea at ucar.edu Sun Nov 12 16:28:48 2023 From: shea at ucar.edu (Dennis Shea) Date: Sun, 12 Nov 2023 16:28:48 -0700 Subject: [ncl-talk] Save output as a NetCDF or tiff file In-Reply-To: References: Message-ID: See copy_VarCoords On Fri, Nov 10, 2023 at 1:39?PM Setareh Rahimi wrote: > Thank you so much for your help. How can I assign lat/lon to the AOD, > please? > I used the below lines in the script but received the following error: " fatal:(XLAT) > is not a named dimension in variable (a2)". > > > > system("/bin/rm -f AOD550_2D.nc") ; remove any pre-existing file > > ncdf = addfile("AOD550_2D.nc" ,"c") ; open output netCDF file > > > ;=================================================================== > > ; create global attributes of the file (optional) > > ;=================================================================== > > fAtt = True ; assign file attributes > > fAtt at title = "Derived AOD" > > fAtt at creation_date = systemfunc ("date") > > > fileattdef( ncdf, fAtt ) ; copy file attributes > > > ;=================================================================== > > ; make time an UNLIMITED dimension; recommended for most applications > > ;=================================================================== > > filedimdef(ncdf,"time",-1,True) > > > ;=================================================================== > > ; output variables directly; NCL will call appropriate functions > > ; to write the meta data associated with each variable > > ;=================================================================== > > ncdf->AOD550_2D = AOD550_2D > > > ncdf->a2 = a2(0,:,:,:) > > AOD550_2D!0 = "lat" > > AOD550_2D!1 = "lon" > > AOD550_2D&lat = a2&XLAT > > =========================================================================================== > here is printVarSummary of "a2" > > Variable: a2 > > Type: float > > Total Size: 144434880 bytes > > 36108720 values > > Number of Dimensions: 4 > > Dimensions and sizes: [Time | 24] x [bottom_top | 30] x [south_north | > 229] x [west_east | 219] > > Coordinates: > > Time: [ 0.. 23] > > Number Of Attributes: 6 > > coordinates : XLONG XLAT XTIME > > stagger : > > units : ? > > description : bin 2 layer optical thickness > > MemoryOrder : XYZ > > FieldType : 104 > > > > On Fri, Nov 10, 2023 at 8:17?PM Dennis Shea wrote: > >> netCDF operator 'ncks' to extract a variable from a netCDF file and copy >> it to another >> >> %> ncks -v xxx Model.nc XXX.nc >> >> where 'xxx' is the name of the variable on the model file >> =============================== >> AOD >> >> *system* ("/bin/rm -f AOD.nc") ; remove any pre-existing file >> ncdf = *addfile* ("AOD.nc" ,"c") ; open output netCDF file >> >> ;=================================================================== >> ; create global attributes of the file (optional) >> ;=================================================================== >> fAtt = True ; assign file attributes >> fAtt at title = "Derived AOD" >> fAtt at creation_date = *systemfunc* ("date") >> *fileattdef* ( ncdf, fAtt ) ; copy file attributes >> >> ;=================================================================== >> ; make time an UNLIMITED dimension; recommended for most applications >> ;=================================================================== >> *filedimdef* (ncdf,"time",-1,True) >> >> ;=================================================================== >> ; output variables directly; NCL will call appropriate functions >> ; to write the meta data associated with each variable >> ;=================================================================== >> ncdf->AOD = AOD >> >> ================================ >> See >> *https://www.ncl.ucar.edu/Applications/method_1.shtml >> * >> >> On Fri, Nov 10, 2023 at 1:02?AM Setareh Rahimi via ncl-talk < >> ncl-talk at mailman.ucar.edu> wrote: >> >>> Dear all, >>> I have calculated Aerosol Optical Depth (AOD) from WRF-Chem output using >>> "TAUAER2" and "TAUAER3" variables (script attached). Instead of using the >>> created AOD to plot it, I would like to save the AOD as a NetCDF or tiff >>> file. So how can I do this, please? >>> I have another question. How can I extract one variable from the model >>> output and save it as a NetCDF or tiff file? >>> Please help me with these issues. >>> 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 >>> >> > > -- > S.Rahimi > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From setareh.rahimi at gmail.com Mon Nov 13 01:23:23 2023 From: setareh.rahimi at gmail.com (Setareh Rahimi) Date: Mon, 13 Nov 2023 11:53:23 +0330 Subject: [ncl-talk] Save output as a NetCDF or tiff file In-Reply-To: References: Message-ID: Thanks Dennis, but the page is not available! On Mon, Nov 13, 2023 at 2:58?AM Dennis Shea wrote: > See copy_VarCoords > > On Fri, Nov 10, 2023 at 1:39?PM Setareh Rahimi > wrote: > >> Thank you so much for your help. How can I assign lat/lon to the AOD, >> please? >> I used the below lines in the script but received the following error: " fatal:(XLAT) >> is not a named dimension in variable (a2)". >> >> >> >> system("/bin/rm -f AOD550_2D.nc") ; remove any pre-existing >> file >> >> ncdf = addfile("AOD550_2D.nc" ,"c") ; open output netCDF file >> >> >> ;=================================================================== >> >> ; create global attributes of the file (optional) >> >> ;=================================================================== >> >> fAtt = True ; assign file attributes >> >> fAtt at title = "Derived AOD" >> >> fAtt at creation_date = systemfunc ("date") >> >> >> fileattdef( ncdf, fAtt ) ; copy file attributes >> >> >> ;=================================================================== >> >> ; make time an UNLIMITED dimension; recommended for most >> applications >> >> ;=================================================================== >> >> filedimdef(ncdf,"time",-1,True) >> >> >> ;=================================================================== >> >> ; output variables directly; NCL will call appropriate functions >> >> ; to write the meta data associated with each variable >> >> ;=================================================================== >> >> ncdf->AOD550_2D = AOD550_2D >> >> >> ncdf->a2 = a2(0,:,:,:) >> >> AOD550_2D!0 = "lat" >> >> AOD550_2D!1 = "lon" >> >> AOD550_2D&lat = a2&XLAT >> >> =========================================================================================== >> here is printVarSummary of "a2" >> >> Variable: a2 >> >> Type: float >> >> Total Size: 144434880 bytes >> >> 36108720 values >> >> Number of Dimensions: 4 >> >> Dimensions and sizes: [Time | 24] x [bottom_top | 30] x [south_north | >> 229] x [west_east | 219] >> >> Coordinates: >> >> Time: [ 0.. 23] >> >> Number Of Attributes: 6 >> >> coordinates : XLONG XLAT XTIME >> >> stagger : >> >> units : ? >> >> description : bin 2 layer optical thickness >> >> MemoryOrder : XYZ >> >> FieldType : 104 >> >> >> >> On Fri, Nov 10, 2023 at 8:17?PM Dennis Shea wrote: >> >>> netCDF operator 'ncks' to extract a variable from a netCDF file and >>> copy it to another >>> >>> %> ncks -v xxx Model.nc XXX.nc >>> >>> where 'xxx' is the name of the variable on the model file >>> =============================== >>> AOD >>> >>> *system* ("/bin/rm -f AOD.nc") ; remove any pre-existing file >>> ncdf = *addfile* ("AOD.nc" ,"c") ; open output netCDF file >>> >>> ;=================================================================== >>> ; create global attributes of the file (optional) >>> ;=================================================================== >>> fAtt = True ; assign file attributes >>> fAtt at title = "Derived AOD" >>> fAtt at creation_date = *systemfunc* ("date") >>> *fileattdef* ( ncdf, fAtt ) ; copy file attributes >>> >>> ;=================================================================== >>> ; make time an UNLIMITED dimension; recommended for most applications >>> ;=================================================================== >>> *filedimdef* (ncdf,"time",-1,True) >>> >>> ;=================================================================== >>> ; output variables directly; NCL will call appropriate functions >>> ; to write the meta data associated with each variable >>> ;=================================================================== >>> ncdf->AOD = AOD >>> >>> ================================ >>> See >>> *https://www.ncl.ucar.edu/Applications/method_1.shtml >>> * >>> >>> On Fri, Nov 10, 2023 at 1:02?AM Setareh Rahimi via ncl-talk < >>> ncl-talk at mailman.ucar.edu> wrote: >>> >>>> Dear all, >>>> I have calculated Aerosol Optical Depth (AOD) from WRF-Chem output >>>> using "TAUAER2" and "TAUAER3" variables (script attached). Instead of using >>>> the created AOD to plot it, I would like to save the AOD as a NetCDF or >>>> tiff file. So how can I do this, please? >>>> I have another question. How can I extract one variable from the model >>>> output and save it as a NetCDF or tiff file? >>>> Please help me with these issues. >>>> 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 >>>> >>> >> >> -- >> S.Rahimi >> >> -- S.Rahimi -------------- next part -------------- An HTML attachment was scrubbed... URL: From shea at ucar.edu Mon Nov 13 17:56:53 2023 From: shea at ucar.edu (Dennis Shea) Date: Mon, 13 Nov 2023 17:56:53 -0700 Subject: [ncl-talk] Save output as a NetCDF or tiff file In-Reply-To: References: Message-ID: By netCDF definition, a coordinate variable must be one-dimensional: The XLAT, XLONG variables are three dimensional. Time | 24] x [south_north | 229] x [west_east | 219] As with the WRF files, these must be written as regular variables. ncdf->XLAT = XLAT ncdf->XLONG = XLONG Most commonly, the XLAT/XLONG variables do not vary with time. Hence some users just write the initial values as a two-dimensional variable ncdf->XLAT = XLAT(0,:,:) ncdf->XLONG = XLONG(0,:,:) On Mon, Nov 13, 2023 at 1:21?AM Setareh Rahimi wrote: > Thanks Dennis, but the page is not available! > > On Mon, Nov 13, 2023 at 2:58?AM Dennis Shea wrote: > >> See copy_VarCoords >> >> On Fri, Nov 10, 2023 at 1:39?PM Setareh Rahimi >> wrote: >> >>> Thank you so much for your help. How can I assign lat/lon to the AOD, >>> please? >>> I used the below lines in the script but received the following error: " fatal:(XLAT) >>> is not a named dimension in variable (a2)". >>> >>> >>> >>> system("/bin/rm -f AOD550_2D.nc") ; remove any pre-existing >>> file >>> >>> ncdf = addfile("AOD550_2D.nc" ,"c") ; open output netCDF file >>> >>> >>> ;=================================================================== >>> >>> ; create global attributes of the file (optional) >>> >>> ;=================================================================== >>> >>> fAtt = True ; assign file attributes >>> >>> fAtt at title = "Derived AOD" >>> >>> fAtt at creation_date = systemfunc ("date") >>> >>> >>> fileattdef( ncdf, fAtt ) ; copy file attributes >>> >>> >>> ;=================================================================== >>> >>> ; make time an UNLIMITED dimension; recommended for most >>> applications >>> >>> ;=================================================================== >>> >>> filedimdef(ncdf,"time",-1,True) >>> >>> >>> ;=================================================================== >>> >>> ; output variables directly; NCL will call appropriate functions >>> >>> ; to write the meta data associated with each variable >>> >>> ;=================================================================== >>> >>> ncdf->AOD550_2D = AOD550_2D >>> >>> >>> ncdf->a2 = a2(0,:,:,:) >>> >>> AOD550_2D!0 = "lat" >>> >>> AOD550_2D!1 = "lon" >>> >>> AOD550_2D&lat = a2&XLAT >>> >>> =========================================================================================== >>> here is printVarSummary of "a2" >>> >>> Variable: a2 >>> >>> Type: float >>> >>> Total Size: 144434880 bytes >>> >>> 36108720 values >>> >>> Number of Dimensions: 4 >>> >>> Dimensions and sizes: [Time | 24] x [bottom_top | 30] x [south_north | >>> 229] x [west_east | 219] >>> >>> Coordinates: >>> >>> Time: [ 0.. 23] >>> >>> Number Of Attributes: 6 >>> >>> coordinates : XLONG XLAT XTIME >>> >>> stagger : >>> >>> units : ? >>> >>> description : bin 2 layer optical thickness >>> >>> MemoryOrder : XYZ >>> >>> FieldType : 104 >>> >>> >>> >>> On Fri, Nov 10, 2023 at 8:17?PM Dennis Shea wrote: >>> >>>> netCDF operator 'ncks' to extract a variable from a netCDF file and >>>> copy it to another >>>> >>>> %> ncks -v xxx Model.nc XXX.nc >>>> >>>> where 'xxx' is the name of the variable on the model file >>>> =============================== >>>> AOD >>>> >>>> *system* ("/bin/rm -f AOD.nc") ; remove any pre-existing file >>>> ncdf = *addfile* ("AOD.nc" ,"c") ; open output netCDF file >>>> >>>> ;=================================================================== >>>> ; create global attributes of the file (optional) >>>> ;=================================================================== >>>> fAtt = True ; assign file attributes >>>> fAtt at title = "Derived AOD" >>>> fAtt at creation_date = *systemfunc* ("date") >>>> *fileattdef* ( ncdf, fAtt ) ; copy file attributes >>>> >>>> ;=================================================================== >>>> ; make time an UNLIMITED dimension; recommended for most applications >>>> ;=================================================================== >>>> *filedimdef* (ncdf,"time",-1,True) >>>> >>>> ;=================================================================== >>>> ; output variables directly; NCL will call appropriate functions >>>> ; to write the meta data associated with each variable >>>> ;=================================================================== >>>> ncdf->AOD = AOD >>>> >>>> ================================ >>>> See >>>> *https://www.ncl.ucar.edu/Applications/method_1.shtml >>>> * >>>> >>>> On Fri, Nov 10, 2023 at 1:02?AM Setareh Rahimi via ncl-talk < >>>> ncl-talk at mailman.ucar.edu> wrote: >>>> >>>>> Dear all, >>>>> I have calculated Aerosol Optical Depth (AOD) from WRF-Chem output >>>>> using "TAUAER2" and "TAUAER3" variables (script attached). Instead of using >>>>> the created AOD to plot it, I would like to save the AOD as a NetCDF or >>>>> tiff file. So how can I do this, please? >>>>> I have another question. How can I extract one variable from the model >>>>> output and save it as a NetCDF or tiff file? >>>>> Please help me with these issues. >>>>> 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 >>>>> >>>> >>> >>> -- >>> S.Rahimi >>> >>> > > -- > S.Rahimi > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From setareh.rahimi at gmail.com Mon Nov 13 23:45:24 2023 From: setareh.rahimi at gmail.com (Setareh Rahimi) Date: Tue, 14 Nov 2023 10:15:24 +0330 Subject: [ncl-talk] Save output as a NetCDF or tiff file In-Reply-To: References: Message-ID: Thank you for your help! but I still receive this error : fatal:Variable (XLAT) is undefined fatal:["Execute.c":8637]:Execute: Error occurred at or near line 186 in file aod fatal:Variable (XLONG) is undefined fatal:["Execute.c":8637]:Execute: Error occurred at or near line 187 in file aod On Tue, Nov 14, 2023 at 4:27?AM Dennis Shea wrote: > By netCDF definition, a coordinate variable must be one-dimensional: > > The XLAT, XLONG variables are three dimensional. > > Time | 24] x [south_north | 229] x [west_east | 219] > > As with the WRF files, these must be written as regular variables. > > ncdf->XLAT = XLAT > ncdf->XLONG = XLONG > > Most commonly, the XLAT/XLONG variables do not vary with time. Hence some > users just write the initial values as a two-dimensional variable > > ncdf->XLAT = XLAT(0,:,:) > ncdf->XLONG = XLONG(0,:,:) > > > > On Mon, Nov 13, 2023 at 1:21?AM Setareh Rahimi > wrote: > >> Thanks Dennis, but the page is not available! >> >> On Mon, Nov 13, 2023 at 2:58?AM Dennis Shea wrote: >> >>> See copy_VarCoords >>> >>> On Fri, Nov 10, 2023 at 1:39?PM Setareh Rahimi >>> wrote: >>> >>>> Thank you so much for your help. How can I assign lat/lon to the AOD, >>>> please? >>>> I used the below lines in the script but received the following error: >>>> " fatal:(XLAT) is not a named dimension in variable (a2)". >>>> >>>> >>>> >>>> system("/bin/rm -f AOD550_2D.nc") ; remove any pre-existing >>>> file >>>> >>>> ncdf = addfile("AOD550_2D.nc" ,"c") ; open output netCDF file >>>> >>>> >>>> >>>> ;=================================================================== >>>> >>>> ; create global attributes of the file (optional) >>>> >>>> >>>> ;=================================================================== >>>> >>>> fAtt = True ; assign file attributes >>>> >>>> fAtt at title = "Derived AOD" >>>> >>>> fAtt at creation_date = systemfunc ("date") >>>> >>>> >>>> fileattdef( ncdf, fAtt ) ; copy file attributes >>>> >>>> >>>> >>>> ;=================================================================== >>>> >>>> ; make time an UNLIMITED dimension; recommended for most >>>> applications >>>> >>>> >>>> ;=================================================================== >>>> >>>> filedimdef(ncdf,"time",-1,True) >>>> >>>> >>>> >>>> ;=================================================================== >>>> >>>> ; output variables directly; NCL will call appropriate functions >>>> >>>> ; to write the meta data associated with each variable >>>> >>>> >>>> ;=================================================================== >>>> >>>> ncdf->AOD550_2D = AOD550_2D >>>> >>>> >>>> ncdf->a2 = a2(0,:,:,:) >>>> >>>> AOD550_2D!0 = "lat" >>>> >>>> AOD550_2D!1 = "lon" >>>> >>>> AOD550_2D&lat = a2&XLAT >>>> >>>> =========================================================================================== >>>> here is printVarSummary of "a2" >>>> >>>> Variable: a2 >>>> >>>> Type: float >>>> >>>> Total Size: 144434880 bytes >>>> >>>> 36108720 values >>>> >>>> Number of Dimensions: 4 >>>> >>>> Dimensions and sizes: [Time | 24] x [bottom_top | 30] x [south_north | >>>> 229] x [west_east | 219] >>>> >>>> Coordinates: >>>> >>>> Time: [ 0.. 23] >>>> >>>> Number Of Attributes: 6 >>>> >>>> coordinates : XLONG XLAT XTIME >>>> >>>> stagger : >>>> >>>> units : ? >>>> >>>> description : bin 2 layer optical thickness >>>> >>>> MemoryOrder : XYZ >>>> >>>> FieldType : 104 >>>> >>>> >>>> >>>> On Fri, Nov 10, 2023 at 8:17?PM Dennis Shea wrote: >>>> >>>>> netCDF operator 'ncks' to extract a variable from a netCDF file and >>>>> copy it to another >>>>> >>>>> %> ncks -v xxx Model.nc XXX.nc >>>>> >>>>> where 'xxx' is the name of the variable on the model file >>>>> =============================== >>>>> AOD >>>>> >>>>> *system* ("/bin/rm -f AOD.nc") ; remove any pre-existing file >>>>> ncdf = *addfile* ("AOD.nc" ,"c") ; open output netCDF file >>>>> >>>>> ;=================================================================== >>>>> ; create global attributes of the file (optional) >>>>> ;=================================================================== >>>>> fAtt = True ; assign file attributes >>>>> fAtt at title = "Derived AOD" >>>>> fAtt at creation_date = *systemfunc* ("date") >>>>> *fileattdef* ( ncdf, fAtt ) ; copy file attributes >>>>> >>>>> ;=================================================================== >>>>> ; make time an UNLIMITED dimension; recommended for most applications >>>>> ;=================================================================== >>>>> *filedimdef* (ncdf,"time",-1,True) >>>>> >>>>> ;=================================================================== >>>>> ; output variables directly; NCL will call appropriate functions >>>>> ; to write the meta data associated with each variable >>>>> ;=================================================================== >>>>> ncdf->AOD = AOD >>>>> >>>>> ================================ >>>>> See >>>>> *https://www.ncl.ucar.edu/Applications/method_1.shtml >>>>> * >>>>> >>>>> On Fri, Nov 10, 2023 at 1:02?AM Setareh Rahimi via ncl-talk < >>>>> ncl-talk at mailman.ucar.edu> wrote: >>>>> >>>>>> Dear all, >>>>>> I have calculated Aerosol Optical Depth (AOD) from WRF-Chem output >>>>>> using "TAUAER2" and "TAUAER3" variables (script attached). Instead of using >>>>>> the created AOD to plot it, I would like to save the AOD as a NetCDF or >>>>>> tiff file. So how can I do this, please? >>>>>> I have another question. How can I extract one variable from the >>>>>> model output and save it as a NetCDF or tiff file? >>>>>> Please help me with these issues. >>>>>> 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 >>>>>> >>>>> >>>> >>>> -- >>>> S.Rahimi >>>> >>>> >> >> -- >> S.Rahimi >> >> -- S.Rahimi -------------- next part -------------- An HTML attachment was scrubbed... URL: From shea at ucar.edu Tue Nov 14 05:57:43 2023 From: shea at ucar.edu (Dennis Shea) Date: Tue, 14 Nov 2023 05:57:43 -0700 Subject: [ncl-talk] Save output as a NetCDF or tiff file In-Reply-To: References: Message-ID: Read XLAT and XLONG from the source WRF file. On Mon, Nov 13, 2023 at 11:43?PM Setareh Rahimi wrote: > Thank you for your help! but I still receive this error : > > fatal:Variable (XLAT) is undefined > > fatal:["Execute.c":8637]:Execute: Error occurred at or near line 186 in > file aod > > > fatal:Variable (XLONG) is undefined > > fatal:["Execute.c":8637]:Execute: Error occurred at or near line 187 in > file aod > > > > On Tue, Nov 14, 2023 at 4:27?AM Dennis Shea wrote: > >> By netCDF definition, a coordinate variable must be one-dimensional: >> >> The XLAT, XLONG variables are three dimensional. >> >> Time | 24] x [south_north | 229] x [west_east | 219] >> >> As with the WRF files, these must be written as regular variables. >> >> ncdf->XLAT = XLAT >> ncdf->XLONG = XLONG >> >> Most commonly, the XLAT/XLONG variables do not vary with time. Hence some >> users just write the initial values as a two-dimensional variable >> >> ncdf->XLAT = XLAT(0,:,:) >> ncdf->XLONG = XLONG(0,:,:) >> >> >> >> On Mon, Nov 13, 2023 at 1:21?AM Setareh Rahimi >> wrote: >> >>> Thanks Dennis, but the page is not available! >>> >>> On Mon, Nov 13, 2023 at 2:58?AM Dennis Shea wrote: >>> >>>> See copy_VarCoords >>>> >>>> On Fri, Nov 10, 2023 at 1:39?PM Setareh Rahimi < >>>> setareh.rahimi at gmail.com> wrote: >>>> >>>>> Thank you so much for your help. How can I assign lat/lon to the AOD, >>>>> please? >>>>> I used the below lines in the script but received the following error: >>>>> " fatal:(XLAT) is not a named dimension in variable (a2)". >>>>> >>>>> >>>>> >>>>> system("/bin/rm -f AOD550_2D.nc") ; remove any pre-existing >>>>> file >>>>> >>>>> ncdf = addfile("AOD550_2D.nc" ,"c") ; open output netCDF file >>>>> >>>>> >>>>> >>>>> ;=================================================================== >>>>> >>>>> ; create global attributes of the file (optional) >>>>> >>>>> >>>>> ;=================================================================== >>>>> >>>>> fAtt = True ; assign file attributes >>>>> >>>>> fAtt at title = "Derived AOD" >>>>> >>>>> fAtt at creation_date = systemfunc ("date") >>>>> >>>>> >>>>> fileattdef( ncdf, fAtt ) ; copy file attributes >>>>> >>>>> >>>>> >>>>> ;=================================================================== >>>>> >>>>> ; make time an UNLIMITED dimension; recommended for most >>>>> applications >>>>> >>>>> >>>>> ;=================================================================== >>>>> >>>>> filedimdef(ncdf,"time",-1,True) >>>>> >>>>> >>>>> >>>>> ;=================================================================== >>>>> >>>>> ; output variables directly; NCL will call appropriate functions >>>>> >>>>> ; to write the meta data associated with each variable >>>>> >>>>> >>>>> ;=================================================================== >>>>> >>>>> ncdf->AOD550_2D = AOD550_2D >>>>> >>>>> >>>>> ncdf->a2 = a2(0,:,:,:) >>>>> >>>>> AOD550_2D!0 = "lat" >>>>> >>>>> AOD550_2D!1 = "lon" >>>>> >>>>> AOD550_2D&lat = a2&XLAT >>>>> >>>>> =========================================================================================== >>>>> here is printVarSummary of "a2" >>>>> >>>>> Variable: a2 >>>>> >>>>> Type: float >>>>> >>>>> Total Size: 144434880 bytes >>>>> >>>>> 36108720 values >>>>> >>>>> Number of Dimensions: 4 >>>>> >>>>> Dimensions and sizes: [Time | 24] x [bottom_top | 30] x [south_north >>>>> | 229] x [west_east | 219] >>>>> >>>>> Coordinates: >>>>> >>>>> Time: [ 0.. 23] >>>>> >>>>> Number Of Attributes: 6 >>>>> >>>>> coordinates : XLONG XLAT XTIME >>>>> >>>>> stagger : >>>>> >>>>> units : ? >>>>> >>>>> description : bin 2 layer optical thickness >>>>> >>>>> MemoryOrder : XYZ >>>>> >>>>> FieldType : 104 >>>>> >>>>> >>>>> >>>>> On Fri, Nov 10, 2023 at 8:17?PM Dennis Shea wrote: >>>>> >>>>>> netCDF operator 'ncks' to extract a variable from a netCDF file and >>>>>> copy it to another >>>>>> >>>>>> %> ncks -v xxx Model.nc XXX.nc >>>>>> >>>>>> where 'xxx' is the name of the variable on the model file >>>>>> =============================== >>>>>> AOD >>>>>> >>>>>> *system* ("/bin/rm -f AOD.nc") ; remove any pre-existing file >>>>>> ncdf = *addfile* ("AOD.nc" ,"c") ; open output netCDF file >>>>>> >>>>>> ;=================================================================== >>>>>> ; create global attributes of the file (optional) >>>>>> ;=================================================================== >>>>>> fAtt = True ; assign file attributes >>>>>> fAtt at title = "Derived AOD" >>>>>> fAtt at creation_date = *systemfunc* ("date") >>>>>> *fileattdef* ( ncdf, fAtt ) ; copy file attributes >>>>>> >>>>>> ;=================================================================== >>>>>> ; make time an UNLIMITED dimension; recommended for most applications >>>>>> ;=================================================================== >>>>>> *filedimdef* (ncdf,"time",-1,True) >>>>>> >>>>>> ;=================================================================== >>>>>> ; output variables directly; NCL will call appropriate functions >>>>>> ; to write the meta data associated with each variable >>>>>> ;=================================================================== >>>>>> ncdf->AOD = AOD >>>>>> >>>>>> ================================ >>>>>> See >>>>>> *https://www.ncl.ucar.edu/Applications/method_1.shtml >>>>>> * >>>>>> >>>>>> On Fri, Nov 10, 2023 at 1:02?AM Setareh Rahimi via ncl-talk < >>>>>> ncl-talk at mailman.ucar.edu> wrote: >>>>>> >>>>>>> Dear all, >>>>>>> I have calculated Aerosol Optical Depth (AOD) from WRF-Chem output >>>>>>> using "TAUAER2" and "TAUAER3" variables (script attached). Instead of using >>>>>>> the created AOD to plot it, I would like to save the AOD as a NetCDF or >>>>>>> tiff file. So how can I do this, please? >>>>>>> I have another question. How can I extract one variable from the >>>>>>> model output and save it as a NetCDF or tiff file? >>>>>>> Please help me with these issues. >>>>>>> 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 >>>>>>> >>>>>> >>>>> >>>>> -- >>>>> S.Rahimi >>>>> >>>>> >>> >>> -- >>> S.Rahimi >>> >>> > > -- > S.Rahimi > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From setareh.rahimi at gmail.com Tue Nov 14 07:11:37 2023 From: setareh.rahimi at gmail.com (Setareh Rahimi) Date: Tue, 14 Nov 2023 17:41:37 +0330 Subject: [ncl-talk] Save output as a NetCDF or tiff file In-Reply-To: References: Message-ID: Thank you for your help! It worked. On Tue, Nov 14, 2023 at 4:27?PM Dennis Shea wrote: > Read XLAT and XLONG from the source WRF file. > > On Mon, Nov 13, 2023 at 11:43?PM Setareh Rahimi > wrote: > >> Thank you for your help! but I still receive this error : >> >> fatal:Variable (XLAT) is undefined >> >> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 186 in >> file aod >> >> >> fatal:Variable (XLONG) is undefined >> >> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 187 in >> file aod >> >> >> >> On Tue, Nov 14, 2023 at 4:27?AM Dennis Shea wrote: >> >>> By netCDF definition, a coordinate variable must be one-dimensional: >>> >>> The XLAT, XLONG variables are three dimensional. >>> >>> Time | 24] x [south_north | 229] x [west_east | 219] >>> >>> As with the WRF files, these must be written as regular variables. >>> >>> ncdf->XLAT = XLAT >>> ncdf->XLONG = XLONG >>> >>> Most commonly, the XLAT/XLONG variables do not vary with time. Hence >>> some users just write the initial values as a two-dimensional variable >>> >>> ncdf->XLAT = XLAT(0,:,:) >>> ncdf->XLONG = XLONG(0,:,:) >>> >>> >>> >>> On Mon, Nov 13, 2023 at 1:21?AM Setareh Rahimi >>> wrote: >>> >>>> Thanks Dennis, but the page is not available! >>>> >>>> On Mon, Nov 13, 2023 at 2:58?AM Dennis Shea wrote: >>>> >>>>> See copy_VarCoords >>>>> >>>>> On Fri, Nov 10, 2023 at 1:39?PM Setareh Rahimi < >>>>> setareh.rahimi at gmail.com> wrote: >>>>> >>>>>> Thank you so much for your help. How can I assign lat/lon to the AOD, >>>>>> please? >>>>>> I used the below lines in the script but received the >>>>>> following error: " fatal:(XLAT) is not a named dimension in variable >>>>>> (a2)". >>>>>> >>>>>> >>>>>> >>>>>> system("/bin/rm -f AOD550_2D.nc") ; remove any >>>>>> pre-existing file >>>>>> >>>>>> ncdf = addfile("AOD550_2D.nc" ,"c") ; open output netCDF file >>>>>> >>>>>> >>>>>> >>>>>> ;=================================================================== >>>>>> >>>>>> ; create global attributes of the file (optional) >>>>>> >>>>>> >>>>>> ;=================================================================== >>>>>> >>>>>> fAtt = True ; assign file attributes >>>>>> >>>>>> fAtt at title = "Derived AOD" >>>>>> >>>>>> fAtt at creation_date = systemfunc ("date") >>>>>> >>>>>> >>>>>> fileattdef( ncdf, fAtt ) ; copy file attributes >>>>>> >>>>>> >>>>>> >>>>>> ;=================================================================== >>>>>> >>>>>> ; make time an UNLIMITED dimension; recommended for most >>>>>> applications >>>>>> >>>>>> >>>>>> ;=================================================================== >>>>>> >>>>>> filedimdef(ncdf,"time",-1,True) >>>>>> >>>>>> >>>>>> >>>>>> ;=================================================================== >>>>>> >>>>>> ; output variables directly; NCL will call appropriate functions >>>>>> >>>>>> ; to write the meta data associated with each variable >>>>>> >>>>>> >>>>>> ;=================================================================== >>>>>> >>>>>> ncdf->AOD550_2D = AOD550_2D >>>>>> >>>>>> >>>>>> ncdf->a2 = a2(0,:,:,:) >>>>>> >>>>>> AOD550_2D!0 = "lat" >>>>>> >>>>>> AOD550_2D!1 = "lon" >>>>>> >>>>>> AOD550_2D&lat = a2&XLAT >>>>>> >>>>>> =========================================================================================== >>>>>> here is printVarSummary of "a2" >>>>>> >>>>>> Variable: a2 >>>>>> >>>>>> Type: float >>>>>> >>>>>> Total Size: 144434880 bytes >>>>>> >>>>>> 36108720 values >>>>>> >>>>>> Number of Dimensions: 4 >>>>>> >>>>>> Dimensions and sizes: [Time | 24] x [bottom_top | 30] x [south_north >>>>>> | 229] x [west_east | 219] >>>>>> >>>>>> Coordinates: >>>>>> >>>>>> Time: [ 0.. 23] >>>>>> >>>>>> Number Of Attributes: 6 >>>>>> >>>>>> coordinates : XLONG XLAT XTIME >>>>>> >>>>>> stagger : >>>>>> >>>>>> units : ? >>>>>> >>>>>> description : bin 2 layer optical thickness >>>>>> >>>>>> MemoryOrder : XYZ >>>>>> >>>>>> FieldType : 104 >>>>>> >>>>>> >>>>>> >>>>>> On Fri, Nov 10, 2023 at 8:17?PM Dennis Shea wrote: >>>>>> >>>>>>> netCDF operator 'ncks' to extract a variable from a netCDF file and >>>>>>> copy it to another >>>>>>> >>>>>>> %> ncks -v xxx Model.nc XXX.nc >>>>>>> >>>>>>> where 'xxx' is the name of the variable on the model file >>>>>>> =============================== >>>>>>> AOD >>>>>>> >>>>>>> *system* ("/bin/rm -f AOD.nc") ; remove any pre-existing file >>>>>>> ncdf = *addfile* ("AOD.nc" ,"c") ; open output netCDF file >>>>>>> >>>>>>> ;=================================================================== >>>>>>> ; create global attributes of the file (optional) >>>>>>> ;=================================================================== >>>>>>> fAtt = True ; assign file attributes >>>>>>> fAtt at title = "Derived AOD" >>>>>>> fAtt at creation_date = *systemfunc* ("date") >>>>>>> *fileattdef* ( ncdf, fAtt ) ; copy file attributes >>>>>>> >>>>>>> ;=================================================================== >>>>>>> ; make time an UNLIMITED dimension; recommended for most applications >>>>>>> ;=================================================================== >>>>>>> *filedimdef* (ncdf,"time",-1,True) >>>>>>> >>>>>>> ;=================================================================== >>>>>>> ; output variables directly; NCL will call appropriate functions >>>>>>> ; to write the meta data associated with each variable >>>>>>> ;=================================================================== >>>>>>> ncdf->AOD = AOD >>>>>>> >>>>>>> ================================ >>>>>>> See >>>>>>> *https://www.ncl.ucar.edu/Applications/method_1.shtml >>>>>>> * >>>>>>> >>>>>>> On Fri, Nov 10, 2023 at 1:02?AM Setareh Rahimi via ncl-talk < >>>>>>> ncl-talk at mailman.ucar.edu> wrote: >>>>>>> >>>>>>>> Dear all, >>>>>>>> I have calculated Aerosol Optical Depth (AOD) from WRF-Chem output >>>>>>>> using "TAUAER2" and "TAUAER3" variables (script attached). Instead of using >>>>>>>> the created AOD to plot it, I would like to save the AOD as a NetCDF or >>>>>>>> tiff file. So how can I do this, please? >>>>>>>> I have another question. How can I extract one variable from the >>>>>>>> model output and save it as a NetCDF or tiff file? >>>>>>>> Please help me with these issues. >>>>>>>> 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 >>>>>>>> >>>>>>> >>>>>> >>>>>> -- >>>>>> S.Rahimi >>>>>> >>>>>> >>>> >>>> -- >>>> S.Rahimi >>>> >>>> >> >> -- >> S.Rahimi >> >> -- S.Rahimi -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvigh at ucar.edu Mon Nov 20 21:28:01 2023 From: jvigh at ucar.edu (Jonathan Vigh) Date: Mon, 20 Nov 2023 21:28:01 -0700 Subject: [ncl-talk] NetCDF filter error: bad id or parameters or duplicate filter Message-ID: Greetings NCL'ers, Has anyone ever encountered an error like this before when defining a filevar for a NetCDF file? *fatal:["NclNetCDF4.c":5409]:NetCDF: Filter error: bad id or parameters or duplicate filterfatal:["NclAdvancedFile.c":6126]:AdvancedFileAddVar: Error adding variable as type: * The line of code that this is coming from is where the file variable is being defined: filevardef(fout, "CYCLONE_ATCF_stormid",typeof(CYCLONE_ATCF_stormid) ,"cyclone") The variable is of type string and I am using the advanced features to write out strings: setfileoption("nc","FileStructure","Advanced") setfileoption("nc","Format","NetCDF4") Variable: CYCLONE_ATCF_stormid Type: string Total Size: 3328 bytes 416 values Number of Dimensions: 1 Dimensions and sizes: [416] Coordinates: Number Of Attributes: 4 units : none description : ATCF STORM ID used to designate a given storm in the Best Track dataset b-deck file and the Storm Table (e.g. 'AL012013') long_name : BT_STORM_stormid _FillValue : (0) string I did not get this error previously, but my machine was recently upgraded to Debian Bookworm and now this error is occurring both for the RAL-built NCL binary and the one from conda forge. I do *not* get the error when running on a machine that hasn't been upgraded to the new OS. I've boiled the script down to a standalone test script in case anyone would like to try it (see attached). Thanks, Jonathan Jonathan Vigh Project Scientist II, Joint Numerical Testbed Research Applications Laboratory (RAL) National Center for Atmospheric Research (NCAR) P.O. Box 3000 tel: +1 (303) 497-8205 Boulder, CO 80307-3000 fax: +1 (303) 497-8171Jonathan's Staff Web Page (CV, publications, etc.)Tropical Cyclone Guidance Project (real-time hurricane data) Tropical Cyclone Data Project (FLIGHT+, VDM+, TC-OBS datasets) HurricaneRiskCalculator?? (Now available -- Personalized hurricane wind hazard assessments for decision support) During COVID-19, my working day is likely different from your working day. Please do not feel obliged to reply to this email outside of your normal working hours. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test_write.ncl Type: application/octet-stream Size: 4575 bytes Desc: not available URL: From setareh.rahimi at gmail.com Thu Nov 23 12:21:00 2023 From: setareh.rahimi at gmail.com (Setareh Rahimi) Date: Thu, 23 Nov 2023 22:51:00 +0330 Subject: [ncl-talk] Plot land use Message-ID: Dear all, I need to plot a land use plot for my study area, which is derived from the WPS. I would like to have a plot like this one : https://www.ncl.ucar.edu/Applications/Scripts/vegland_3.ncl So I tried to modify the codes (attached), but I failed. I do not need to use the following file: "Majority_Land_Cover_Type_1_MOD12C1" which has been used with this script sample. As you can see from the example some variables are dependent on the aforementioned file. So how can I have such a plot for my study area, please? Best wishes, -- S.Rahimi -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: p Type: application/octet-stream Size: 4943 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: geo_em.d04.nc Type: application/octet-stream Size: 678651 bytes Desc: not available URL: From setareh.rahimi at gmail.com Fri Nov 24 03:05:48 2023 From: setareh.rahimi at gmail.com (Setareh Rahimi) Date: Fri, 24 Nov 2023 13:35:48 +0330 Subject: [ncl-talk] Plot observed data on simulated data Message-ID: Dear all, How can I plot observation data over simulated data (like the attached image) from the WRF model, please? Kind regards, -- S.Rahimi -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: s.png Type: image/png Size: 377284 bytes Desc: not available URL: From asphilli at ucar.edu Mon Nov 27 10:44:46 2023 From: asphilli at ucar.edu (Adam Phillips) Date: Mon, 27 Nov 2023 10:44:46 -0700 Subject: [ncl-talk] Plot observed data on simulated data In-Reply-To: References: Message-ID: Hi Setareh, See examples 8/9 here: https://www.ncl.ucar.edu/Applications/polyg.shtml#ex8 These examples are rather complex. They show one coloring polymarkers by their location values and overlaying them on a blank map. (You will be overlaying them on a regular color filled map.) Hope that helps! Adam On Fri, Nov 24, 2023 at 3:03?AM Setareh Rahimi via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > > Dear all, > > How can I plot observation data over simulated data (like the attached > image) from the WRF model, please? > 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 > -- Adam Phillips Associate Scientist IV, Climate Analysis Section Climate and Global Dynamics Laboratory National Center for Atmospheric Research www.cgd.ucar.edu/staff/asphilli/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvigh at ucar.edu Mon Nov 27 12:27:50 2023 From: jvigh at ucar.edu (Jonathan Vigh) Date: Mon, 27 Nov 2023 12:27:50 -0700 Subject: [ncl-talk] NetCDF filter error: bad id or parameters or duplicate filter In-Reply-To: References: Message-ID: Hi NCL'ers, My issue has been resolved. NCAR's IT person for my lab was able to build a version for RAL that uses the "correct" NetCDF library. I'm sharing this information in case someone else runs into the same issue. The IT person compared the shared libraries linked in to each version (i.e. using "ldd") and made a guess as to the culprit. Given the error message itself comes from the netcdf c library, it was a pretty safe bet. >From his email: "Well, the short answer is to "use netcdf-c-4.8.0". The long answer involves knowing how to build ncl and all of its dependencies which is a beast. He built it with gdal and vis5d which are optional but needed by folks in RAL (or have been in the past). Newer GDAL builds require the PROJ library at v6 or greater (PROJ is at 9.x) while NCL cannot use PROJ greater than 7 and greater than 5 requires hacking a ncl file (minor hack, but still). That's just one example. All the shared libs *and* the shared-libs' shared-libs have to match up exactly or ncl won't build." I am not sure why the conda-provided version of NCL also had this issue (maybe something related to my path?). It makes me wonder if a service update of NCL is in order to ensure it continues working on new OSs. Best regards, Jonathan Jonathan Vigh Project Scientist II, Joint Numerical Testbed Research Applications Laboratory (RAL) National Center for Atmospheric Research (NCAR) P.O. Box 3000 tel: +1 (303) 497-8205 Boulder, CO 80307-3000 fax: +1 (303) 497-8171Jonathan's Staff Web Page (CV, publications, etc.)Tropical Cyclone Guidance Project (real-time hurricane data) Tropical Cyclone Data Project (FLIGHT+, VDM+, TC-OBS datasets) HurricaneRiskCalculator?? (Now available -- Personalized hurricane wind hazard assessments for decision support) During COVID-19, my working day is likely different from your working day. Please do not feel obliged to reply to this email outside of your normal working hours. On Mon, Nov 20, 2023 at 9:28?PM Jonathan Vigh wrote: > Greetings NCL'ers, > > Has anyone ever encountered an error like this before when defining a > filevar for a NetCDF file? > > > *fatal:["NclNetCDF4.c":5409]:NetCDF: Filter error: bad id or parameters or > duplicate filterfatal:["NclAdvancedFile.c":6126]:AdvancedFileAddVar: Error > adding variable as type: * > > The line of code that this is coming from is where the file variable is > being defined: > filevardef(fout, "CYCLONE_ATCF_stormid",typeof(CYCLONE_ATCF_stormid) > ,"cyclone") > > The variable is of type string and I am using the advanced features to > write out strings: > setfileoption("nc","FileStructure","Advanced") > setfileoption("nc","Format","NetCDF4") > > Variable: CYCLONE_ATCF_stormid > Type: string > Total Size: 3328 bytes > 416 values > Number of Dimensions: 1 > Dimensions and sizes: [416] > Coordinates: > Number Of Attributes: 4 > units : none > description : ATCF STORM ID used to designate a given storm in the Best > Track dataset b-deck file and the Storm Table (e.g. 'AL012013') > long_name : BT_STORM_stormid > _FillValue : > (0) string > > I did not get this error previously, but my machine was recently upgraded > to Debian Bookworm and now this error is occurring both for the RAL-built > NCL binary and the one from conda forge. > > I do *not* get the error when running on a machine that hasn't been > upgraded to the new OS. I've boiled the script down to a standalone test > script in case anyone would like to try it (see attached). > > Thanks, > Jonathan > > > > > Jonathan Vigh > Project Scientist II, Joint Numerical Testbed > Research Applications Laboratory (RAL) > National Center for Atmospheric Research (NCAR) > P.O. Box 3000 tel: +1 (303) 497-8205 > Boulder, CO 80307-3000 fax: +1 (303) 497-8171Jonathan's Staff Web Page (CV, publications, etc.)Tropical Cyclone Guidance Project (real-time hurricane data) > > Tropical Cyclone Data Project (FLIGHT+, VDM+, TC-OBS datasets) > > HurricaneRiskCalculator?? (Now available -- Personalized hurricane wind hazard assessments for decision support) > > During COVID-19, my working day is likely different from your working day. Please do not feel obliged to reply to this email outside of your normal working hours. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.graffino at tim.it Tue Nov 28 12:03:56 2023 From: g.graffino at tim.it (Giorgio Graffino) Date: Tue, 28 Nov 2023 20:03:56 +0100 (CET) Subject: [ncl-talk] Weighted standard deviation Message-ID: <2e0fab3b.1d8d.18c175109d0.Webtop.59@tim.it> Hello NCL people, ? I was surprised to find no NCL functions to compute weighted standard deviation. Is there one or do I need to make my own? ? Related question: is the standard deviation in dim_standardize weighted? That would probably make a difference when standardazing across the latitude. ? Thanks, Giorgio -------------- next part -------------- An HTML attachment was scrubbed... URL: From shea at ucar.edu Tue Nov 28 14:43:42 2023 From: shea at ucar.edu (Dennis Shea) Date: Tue, 28 Nov 2023 14:43:42 -0700 Subject: [ncl-talk] Weighted standard deviation In-Reply-To: <2e0fab3b.1d8d.18c175109d0.Webtop.59@tim.it> References: <2e0fab3b.1d8d.18c175109d0.Webtop.59@tim.it> Message-ID: Sorry: [1] As you noted, there is no function to compute the weighted standard deviation. [2] The standard deviation in *dim_standardize* is not weighted. NCL has functions to compute the weighted mean(s)\ EG: *dim_avg_wgt_n_Wrap * On Tue, Nov 28, 2023 at 12:04?PM Giorgio Graffino via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Hello NCL people, > > > > I was surprised to find no NCL functions to compute weighted standard > deviation. Is there one or do I need to make my own? > > > > Related question: is the standard deviation in dim_standardize weighted? > That would probably make a difference when standardazing across the > latitude. > > > > Thanks, > > Giorgio > _______________________________________________ > 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: