From tabishumaransari at gmail.com Thu Jan 5 09:22:07 2023 From: tabishumaransari at gmail.com (Tabish Ansari) Date: Thu, 5 Jan 2023 17:22:07 +0100 Subject: [ncl-talk] reordering variable attributes Message-ID: Hi I'm getting an error "pio_support::pio_die:: myrank= -1 : ERROR" in the CAM-Chem model when using new emission files. The only difference between the new files and the old ones that work smoothly seems to be the order of variable attributes. These are the details of the old file that works: netcdf edgar_HTAPv3_BIGALK_repaired2 { dimensions: time = UNLIMITED ; // (228 currently) lon = 144 ; lat = 96 ; variables: float time(time) ; time:standard_name = "time" ; time:long_name = "time" ; time:units = "days since 1997-01-01 00:00:00+0:00" ; time:calendar = "gregorian" ; time:axis = "T" ; time:_FillValue = 9.96921e+36f ; int date(time) ; date:units = "YYYYMMDD" ; date:long_name = "Date" ; double lon(lon) ; lon:units = "degrees_east" ; lon:long_name = "longitude" ; lon:axis = "X" ; lon:standard_name = "longitude" ; double lat(lat) ; lat:units = "degrees_north" ; lat:long_name = "latitude" ; lat:axis = "Y" ; lat:standard_name = "latitude" ; float HTAPv3_1_International_Shipping(time, lat, lon) ; HTAPv3_1_International_Shipping:units = "molecules/cm2/s" ; HTAPv3_1_International_Shipping:description = "International_Shipping" ; HTAPv3_1_International_Shipping:long_name = "International Shipping" ; HTAPv3_1_International_Shipping:remap = "remapped via ESMF_regrid_with_weights: First-order Conservative" ; HTAPv3_1_International_Shipping:missing_value = 9.96921e+36f ; HTAPv3_1_International_Shipping:_FillValue = 9.96921e+36f ; float HTAPv3_2_1_Domestic_Aviation(time, lat, lon) ; HTAPv3_2_1_Domestic_Aviation:units = "molecules/cm2/s" ; HTAPv3_2_1_Domestic_Aviation:description = "Domestic_Aviation" ; HTAPv3_2_1_Domestic_Aviation:long_name = "Domestic Aviation" ; HTAPv3_2_1_Domestic_Aviation:remap = "remapped via ESMF_regrid_with_weights: First-order Conservative" ; HTAPv3_2_1_Domestic_Aviation:missing_value = 9.96921e+36f ; HTAPv3_2_1_Domestic_Aviation:_FillValue = 9.96921e+36f ; } and here are the details of the new file that doesn't work: dimensions: time = UNLIMITED ; // (228 currently) lon = 144 ; lat = 96 ; variables: float time(time) ; time:standard_name = "time" ; time:long_name = "time" ; time:units = "days since 1997-01-01 00:00:00+0:00" ; time:calendar = "gregorian" ; time:axis = "T" ; time:_FillValue = 9.96921e+36f ; int date(time) ; date:units = "YYYYMMDD" ; date:long_name = "Date" ; double lon(lon) ; lon:units = "degrees_east" ; lon:long_name = "longitude" ; lon:axis = "X" ; lon:standard_name = "longitude" ; double lat(lat) ; lat:units = "degrees_north" ; lat:long_name = "latitude" ; lat:axis = "Y" ; lat:standard_name = "latitude" ; float HTAPv3_1_International_Shipping(time, lat, lon) ; HTAPv3_1_International_Shipping:remap = "remapped via ESMF_regrid_with_weights: First-order Conservative" ; HTAPv3_1_International_Shipping:long_name = "International Shipping" ; HTAPv3_1_International_Shipping:description = "International_Shipping" ; HTAPv3_1_International_Shipping:units = "molecules/cm2/s" ; HTAPv3_1_International_Shipping:missing_value = 9.96921e+36f ; HTAPv3_1_International_Shipping:_FillValue = 9.96921e+36f ; float HTAPv3_2_1_Domestic_Aviation(time, lat, lon) ; HTAPv3_2_1_Domestic_Aviation:remap = "remapped via ESMF_regrid_with_weights: First-order Conservative" ; HTAPv3_2_1_Domestic_Aviation:long_name = "Domestic Aviation" ; HTAPv3_2_1_Domestic_Aviation:description = "Domestic_Aviation" ; HTAPv3_2_1_Domestic_Aviation:units = "molecules/cm2/s" ; HTAPv3_2_1_Domestic_Aviation:missing_value = 9.96921e+36f ; HTAPv3_2_1_Domestic_Aviation:_FillValue = 9.96921e+36f ; float HTAPv3_2_2_International_Aviation(time, lat, lon) ; HTAPv3_2_2_International_Aviation:remap = "remapped via ESMF_regrid_with_weights: First-order Conservative" ; HTAPv3_2_2_International_Aviation:long_name = "International Aviation" ; HTAPv3_2_2_International_Aviation:description = "International_Aviation" ; HTAPv3_2_2_International_Aviation:units = "molecules/cm2/s" ; HTAPv3_2_2_International_Aviation:missing_value = 9.96921e+36f ; HTAPv3_2_2_International_Aviation:_FillValue = 9.96921e+36f ; } Therefore, I want to change the order of the variable attributes to that in the old file. Is there a way I can achieve this in NCL? Thank you with kind regards, Tabish ------------------------------- Dr Tabish Ansari Research Associate Air Quality Modelling Group IASS-Potsdam Germany -------------- next part -------------- An HTML attachment was scrubbed... URL: From brownrig at ucar.edu Thu Jan 5 09:44:36 2023 From: brownrig at ucar.edu (Rick Brownrigg) Date: Thu, 5 Jan 2023 09:44:36 -0700 Subject: [ncl-talk] reordering variable attributes In-Reply-To: References: Message-ID: Hi Tabish, I would be very surprised if the attribute ordering was the issue. The only reference to those symbols PIO_SUPPORT/PIO_DIE in NCL that I can find are coming from the ESMF library. That library in turn integrates a PIO package (parallel I/O for NetCDF). Are you attempting to regrid the file? Here's a thread from a user forum that seems relevant to what you are doing -- perhaps there may be a clue in there? https://bb.cgd.ucar.edu/cesm/threads/pio_support-pio_die-myrank-1-error-pionfget_mod-f90-in-some-f-case.5663/ I hope that helps... Rick On Thu, Jan 5, 2023 at 9:22 AM Tabish Ansari via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Hi > > I'm getting an error "pio_support::pio_die:: myrank= -1 : ERROR" in the > CAM-Chem model when using new emission files. The only difference between > the new files and the old ones that work smoothly seems to be the order of > variable attributes. > > These are the details of the old file that works: > netcdf edgar_HTAPv3_BIGALK_repaired2 { > dimensions: > time = UNLIMITED ; // (228 currently) > lon = 144 ; > lat = 96 ; > variables: > float time(time) ; > time:standard_name = "time" ; > time:long_name = "time" ; > time:units = "days since 1997-01-01 00:00:00+0:00" ; > time:calendar = "gregorian" ; > time:axis = "T" ; > time:_FillValue = 9.96921e+36f ; > int date(time) ; > date:units = "YYYYMMDD" ; > date:long_name = "Date" ; > double lon(lon) ; > lon:units = "degrees_east" ; > lon:long_name = "longitude" ; > lon:axis = "X" ; > lon:standard_name = "longitude" ; > double lat(lat) ; > lat:units = "degrees_north" ; > lat:long_name = "latitude" ; > lat:axis = "Y" ; > lat:standard_name = "latitude" ; > float HTAPv3_1_International_Shipping(time, lat, lon) ; > HTAPv3_1_International_Shipping:units = "molecules/cm2/s" ; > HTAPv3_1_International_Shipping:description = > "International_Shipping" ; > HTAPv3_1_International_Shipping:long_name = "International > Shipping" ; > HTAPv3_1_International_Shipping:remap = "remapped via > ESMF_regrid_with_weights: First-order Conservative" ; > HTAPv3_1_International_Shipping:missing_value = > 9.96921e+36f ; > HTAPv3_1_International_Shipping:_FillValue = 9.96921e+36f ; > float HTAPv3_2_1_Domestic_Aviation(time, lat, lon) ; > HTAPv3_2_1_Domestic_Aviation:units = "molecules/cm2/s" ; > HTAPv3_2_1_Domestic_Aviation:description = > "Domestic_Aviation" ; > HTAPv3_2_1_Domestic_Aviation:long_name = "Domestic > Aviation" ; > HTAPv3_2_1_Domestic_Aviation:remap = "remapped via > ESMF_regrid_with_weights: First-order Conservative" ; > HTAPv3_2_1_Domestic_Aviation:missing_value = 9.96921e+36f ; > HTAPv3_2_1_Domestic_Aviation:_FillValue = 9.96921e+36f ; > } > > and here are the details of the new file that doesn't work: > > dimensions: > time = UNLIMITED ; // (228 currently) > lon = 144 ; > lat = 96 ; > variables: > float time(time) ; > time:standard_name = "time" ; > time:long_name = "time" ; > time:units = "days since 1997-01-01 00:00:00+0:00" ; > time:calendar = "gregorian" ; > time:axis = "T" ; > time:_FillValue = 9.96921e+36f ; > int date(time) ; > date:units = "YYYYMMDD" ; > date:long_name = "Date" ; > double lon(lon) ; > lon:units = "degrees_east" ; > lon:long_name = "longitude" ; > lon:axis = "X" ; > lon:standard_name = "longitude" ; > double lat(lat) ; > lat:units = "degrees_north" ; > lat:long_name = "latitude" ; > lat:axis = "Y" ; > lat:standard_name = "latitude" ; > float HTAPv3_1_International_Shipping(time, lat, lon) ; > HTAPv3_1_International_Shipping:remap = "remapped via > ESMF_regrid_with_weights: First-order Conservative" ; > HTAPv3_1_International_Shipping:long_name = "International > Shipping" ; > HTAPv3_1_International_Shipping:description = > "International_Shipping" ; > HTAPv3_1_International_Shipping:units = "molecules/cm2/s" ; > HTAPv3_1_International_Shipping:missing_value = > 9.96921e+36f ; > HTAPv3_1_International_Shipping:_FillValue = 9.96921e+36f ; > float HTAPv3_2_1_Domestic_Aviation(time, lat, lon) ; > HTAPv3_2_1_Domestic_Aviation:remap = "remapped via > ESMF_regrid_with_weights: First-order Conservative" ; > HTAPv3_2_1_Domestic_Aviation:long_name = "Domestic > Aviation" ; > HTAPv3_2_1_Domestic_Aviation:description = > "Domestic_Aviation" ; > HTAPv3_2_1_Domestic_Aviation:units = "molecules/cm2/s" ; > HTAPv3_2_1_Domestic_Aviation:missing_value = 9.96921e+36f ; > HTAPv3_2_1_Domestic_Aviation:_FillValue = 9.96921e+36f ; > float HTAPv3_2_2_International_Aviation(time, lat, lon) ; > HTAPv3_2_2_International_Aviation:remap = "remapped via > ESMF_regrid_with_weights: First-order Conservative" ; > HTAPv3_2_2_International_Aviation:long_name = > "International Aviation" ; > HTAPv3_2_2_International_Aviation:description = > "International_Aviation" ; > HTAPv3_2_2_International_Aviation:units = > "molecules/cm2/s" ; > HTAPv3_2_2_International_Aviation:missing_value = > 9.96921e+36f ; > HTAPv3_2_2_International_Aviation:_FillValue = > 9.96921e+36f ; > } > > > Therefore, I want to change the order of the variable attributes to that > in the old file. Is there a way I can achieve this in NCL? > > Thank you > > with kind regards, > > Tabish > > ------------------------------- > Dr Tabish Ansari > Research Associate > Air Quality Modelling Group > IASS-Potsdam > Germany > _______________________________________________ > 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 tabishumaransari at gmail.com Thu Jan 5 11:51:16 2023 From: tabishumaransari at gmail.com (Tabish Ansari) Date: Thu, 5 Jan 2023 19:51:16 +0100 Subject: [ncl-talk] reordering variable attributes In-Reply-To: References: Message-ID: Hi Rick, Thanks very much for your reply. I have indeed used the ESMF regrid function in NCL to generate these files. The raw files were at a different resolution. They look OK when viewed through ncdump -h or ncview. But the model somehow doesn't accept them. I does accept the file which only contains 2 variables, whose header is shown in blue in the previous email. But when I add a third variable to it and write it out as a new file, I get the error again. Between the two files, the only difference I could spot was the order of attributes. But I will look further into it. Thanks again and kind regards, Tabish ------------------------------- Dr Tabish Ansari Research Associate Air Quality Modelling Group IASS-Potsdam Germany On Thu, 5 Jan 2023 at 17:44, Rick Brownrigg wrote: > Hi Tabish, > > I would be very surprised if the attribute ordering was the issue. The > only reference to those symbols PIO_SUPPORT/PIO_DIE in NCL that I can find > are coming from the ESMF library. That library in turn integrates a PIO > package (parallel I/O for NetCDF). Are you attempting to regrid the file? > > Here's a thread from a user forum that seems relevant to what you are > doing -- perhaps there may be a clue in there? > > > https://bb.cgd.ucar.edu/cesm/threads/pio_support-pio_die-myrank-1-error-pionfget_mod-f90-in-some-f-case.5663/ > > I hope that helps... > Rick > > > On Thu, Jan 5, 2023 at 9:22 AM Tabish Ansari via ncl-talk < > ncl-talk at mailman.ucar.edu> wrote: > >> Hi >> >> I'm getting an error "pio_support::pio_die:: myrank= -1 : ERROR" in the >> CAM-Chem model when using new emission files. The only difference between >> the new files and the old ones that work smoothly seems to be the order of >> variable attributes. >> >> These are the details of the old file that works: >> netcdf edgar_HTAPv3_BIGALK_repaired2 { >> dimensions: >> time = UNLIMITED ; // (228 currently) >> lon = 144 ; >> lat = 96 ; >> variables: >> float time(time) ; >> time:standard_name = "time" ; >> time:long_name = "time" ; >> time:units = "days since 1997-01-01 00:00:00+0:00" ; >> time:calendar = "gregorian" ; >> time:axis = "T" ; >> time:_FillValue = 9.96921e+36f ; >> int date(time) ; >> date:units = "YYYYMMDD" ; >> date:long_name = "Date" ; >> double lon(lon) ; >> lon:units = "degrees_east" ; >> lon:long_name = "longitude" ; >> lon:axis = "X" ; >> lon:standard_name = "longitude" ; >> double lat(lat) ; >> lat:units = "degrees_north" ; >> lat:long_name = "latitude" ; >> lat:axis = "Y" ; >> lat:standard_name = "latitude" ; >> float HTAPv3_1_International_Shipping(time, lat, lon) ; >> HTAPv3_1_International_Shipping:units = "molecules/cm2/s" >> ; >> HTAPv3_1_International_Shipping:description = >> "International_Shipping" ; >> HTAPv3_1_International_Shipping:long_name = >> "International Shipping" ; >> HTAPv3_1_International_Shipping:remap = "remapped via >> ESMF_regrid_with_weights: First-order Conservative" ; >> HTAPv3_1_International_Shipping:missing_value = >> 9.96921e+36f ; >> HTAPv3_1_International_Shipping:_FillValue = 9.96921e+36f >> ; >> float HTAPv3_2_1_Domestic_Aviation(time, lat, lon) ; >> HTAPv3_2_1_Domestic_Aviation:units = "molecules/cm2/s" ; >> HTAPv3_2_1_Domestic_Aviation:description = >> "Domestic_Aviation" ; >> HTAPv3_2_1_Domestic_Aviation:long_name = "Domestic >> Aviation" ; >> HTAPv3_2_1_Domestic_Aviation:remap = "remapped via >> ESMF_regrid_with_weights: First-order Conservative" ; >> HTAPv3_2_1_Domestic_Aviation:missing_value = 9.96921e+36f >> ; >> HTAPv3_2_1_Domestic_Aviation:_FillValue = 9.96921e+36f ; >> } >> >> and here are the details of the new file that doesn't work: >> >> dimensions: >> time = UNLIMITED ; // (228 currently) >> lon = 144 ; >> lat = 96 ; >> variables: >> float time(time) ; >> time:standard_name = "time" ; >> time:long_name = "time" ; >> time:units = "days since 1997-01-01 00:00:00+0:00" ; >> time:calendar = "gregorian" ; >> time:axis = "T" ; >> time:_FillValue = 9.96921e+36f ; >> int date(time) ; >> date:units = "YYYYMMDD" ; >> date:long_name = "Date" ; >> double lon(lon) ; >> lon:units = "degrees_east" ; >> lon:long_name = "longitude" ; >> lon:axis = "X" ; >> lon:standard_name = "longitude" ; >> double lat(lat) ; >> lat:units = "degrees_north" ; >> lat:long_name = "latitude" ; >> lat:axis = "Y" ; >> lat:standard_name = "latitude" ; >> float HTAPv3_1_International_Shipping(time, lat, lon) ; >> HTAPv3_1_International_Shipping:remap = "remapped via >> ESMF_regrid_with_weights: First-order Conservative" ; >> HTAPv3_1_International_Shipping:long_name = >> "International Shipping" ; >> HTAPv3_1_International_Shipping:description = >> "International_Shipping" ; >> HTAPv3_1_International_Shipping:units = "molecules/cm2/s" >> ; >> HTAPv3_1_International_Shipping:missing_value = >> 9.96921e+36f ; >> HTAPv3_1_International_Shipping:_FillValue = 9.96921e+36f >> ; >> float HTAPv3_2_1_Domestic_Aviation(time, lat, lon) ; >> HTAPv3_2_1_Domestic_Aviation:remap = "remapped via >> ESMF_regrid_with_weights: First-order Conservative" ; >> HTAPv3_2_1_Domestic_Aviation:long_name = "Domestic >> Aviation" ; >> HTAPv3_2_1_Domestic_Aviation:description = >> "Domestic_Aviation" ; >> HTAPv3_2_1_Domestic_Aviation:units = "molecules/cm2/s" ; >> HTAPv3_2_1_Domestic_Aviation:missing_value = 9.96921e+36f >> ; >> HTAPv3_2_1_Domestic_Aviation:_FillValue = 9.96921e+36f ; >> float HTAPv3_2_2_International_Aviation(time, lat, lon) ; >> HTAPv3_2_2_International_Aviation:remap = "remapped via >> ESMF_regrid_with_weights: First-order Conservative" ; >> HTAPv3_2_2_International_Aviation:long_name = >> "International Aviation" ; >> HTAPv3_2_2_International_Aviation:description = >> "International_Aviation" ; >> HTAPv3_2_2_International_Aviation:units = >> "molecules/cm2/s" ; >> HTAPv3_2_2_International_Aviation:missing_value = >> 9.96921e+36f ; >> HTAPv3_2_2_International_Aviation:_FillValue = >> 9.96921e+36f ; >> } >> >> >> Therefore, I want to change the order of the variable attributes to that >> in the old file. Is there a way I can achieve this in NCL? >> >> Thank you >> >> with kind regards, >> >> Tabish >> >> ------------------------------- >> Dr Tabish Ansari >> Research Associate >> Air Quality Modelling Group >> IASS-Potsdam >> Germany >> _______________________________________________ >> 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 opioronald123 at gmail.com Wed Jan 18 03:12:54 2023 From: opioronald123 at gmail.com (Ronald Opio) Date: Wed, 18 Jan 2023 13:12:54 +0300 Subject: [ncl-talk] conform function changes values Message-ID: Hello colleagues. I have used the NCL conform function to change the dimensions of a surface temperature file. The "real" file has a resolution of 1-day while the modified file (work-around) has a resolution of 6-hours. See the file attached. I notice that the temperature profile has changed completely and yet I expected that it would remain the same. Does anyone have any idea of how this can be corrected? I have also attached the script I used FYI. Best, Ronald. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TS_5.png Type: image/png Size: 241012 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: conform.ncl Type: application/octet-stream Size: 1273 bytes Desc: not available URL: From shea at ucar.edu Wed Jan 18 21:33:04 2023 From: shea at ucar.edu (Dennis Shea) Date: Wed, 18 Jan 2023 21:33:04 -0700 Subject: [ncl-talk] conform function changes values In-Reply-To: References: Message-ID: What are the dimensions of PS and T ? printVarSummary (TS) printVarSummary (PS) On Wed, Jan 18, 2023 at 3:13 AM Ronald Opio via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Hello colleagues. > > I have used the NCL conform function to change the dimensions of a surface > temperature file. The "real" file has a resolution of 1-day while the > modified file (work-around) has a resolution of 6-hours. See the > file attached. > > I notice that the temperature profile has changed completely and yet I > expected that it would remain the same. Does anyone have any idea of how > this can be corrected? > > I have also attached the script I used FYI. > > Best, > Ronald. > _______________________________________________ > 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 opioronald123 at gmail.com Thu Jan 19 00:54:11 2023 From: opioronald123 at gmail.com (Ronald Opio) Date: Thu, 19 Jan 2023 10:54:11 +0300 Subject: [ncl-talk] conform function changes values In-Reply-To: References: Message-ID: Hello Dennis. Please see the file attached herein. It has all file dimensions plus the min and max of each variable. Notice that the min and max change when the file is conformed. On Thu, Jan 19, 2023 at 7:33 AM Dennis Shea wrote: > What are the dimensions of PS and T ? > > printVarSummary (TS) > printVarSummary (PS) > > On Wed, Jan 18, 2023 at 3:13 AM Ronald Opio via ncl-talk < > ncl-talk at mailman.ucar.edu> wrote: > >> Hello colleagues. >> >> I have used the NCL conform function to change the dimensions of a >> surface temperature file. The "real" file has a resolution of 1-day while >> the modified file (work-around) has a resolution of 6-hours. See the >> file attached. >> >> I notice that the temperature profile has changed completely and yet I >> expected that it would remain the same. Does anyone have any idea of how >> this can be corrected? >> >> I have also attached the script I used FYI. >> >> Best, >> Ronald. >> _______________________________________________ >> 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: -------------- next part -------------- Copyright (C) 1995-2019 - All Rights Reserved University Corporation for Atmospheric Research NCAR Command Language Version 6.6.2 The use of this software is governed by a License Agreement. See http://www.ncl.ucar.edu/ for more details. (0) opening files (0) reading in variables Variable: TS Type: float Total Size: 538583040 bytes 134645760 values Number of Dimensions: 3 Dimensions and sizes: [time | 7305] x [lat | 96] x [lon | 192] Coordinates: time: [60265.5..67569.5] lat: [-88.57216851400727..88.57216851400727] lon: [ 0..358.125] Number Of Attributes: 9 standard_name : surface_temperature long_name : Surface Temperature comment : Temperature of the lower boundary of the atmosphere units : K cell_methods : area: time: mean cell_measures : area: areacella history : 2019-12-02T19:04:59Z altered by CMOR: replaced missing value flag (-9e+33) and corresponding data with standard missing value (1e+20). 2019-12-02T19:04:59Z altered by CMOR: Inverted axis: lat. missing_value : 1e+20 _FillValue : 1e+20 (0) Surface Temperature (K) : min=197.637 max=324.622 (0) ============================================================================= Variable: PS Type: float Total Size: 2154332160 bytes 538583040 values Number of Dimensions: 3 Dimensions and sizes: [time | 29220] x [lat | 96] x [lon | 192] Coordinates: time: [60265.25..67570] lat: [-88.57216851400727..88.57216851400727] lon: [ 0..358.125] Number Of Attributes: 10 standard_name : air_temperature long_name : Near-Surface Air Temperature comment : near-surface (usually, 2 meter) air temperature units : K cell_methods : area: mean time: point cell_measures : area: areacella history : 2020-06-04T08:56:14Z altered by CMOR: Treated scalar dimension: 'height'. 2020-06-04T08:56:14Z altered by CMOR: replaced missing value flag (-9e+33) and corresponding data with standard missing value (1e+20). 2020-06-04T08:56:14Z altered by CMOR: Inverted axis: lat. coordinates : height missing_value : 1e+20 _FillValue : 1e+20 (0) Near-Surface Air Temperature (K) : min=199.034 max=327.316 (0) ============================================================================= (0) conforming file (0) preparing final file Variable: TS_6hr Type: float Total Size: 2154332160 bytes 538583040 values Number of Dimensions: 3 Dimensions and sizes: [time | 29220] x [lat | 96] x [lon | 192] Coordinates: time: [60265.25..67570] lat: [-88.57216851400727..88.57216851400727] lon: [ 0..358.125] Number Of Attributes: 9 missing_value : 1e+20 history : 2019-12-02T19:04:59Z altered by CMOR: replaced missing value flag (-9e+33) and corresponding data with standard missing value (1e+20). 2019-12-02T19:04:59Z altered by CMOR: Inverted axis: lat. cell_measures : area: areacella cell_methods : area: time: mean units : K comment : Temperature of the lower boundary of the atmosphere long_name : Surface Temperature standard_name : surface_temperature _FillValue : 1e+20 (0) Surface Temperature (K) : min=226.313 max=319.402 From tabishumaransari at gmail.com Thu Jan 26 06:45:51 2023 From: tabishumaransari at gmail.com (Tabish Ansari) Date: Thu, 26 Jan 2023 14:45:51 +0100 Subject: [ncl-talk] converting string into a variable name Message-ID: Hi I have several systematically named variables that I want to refer to by generating the corresponding string via a loop. I'm able to generate a string that exactly matches the variable name but I'm unable to perform any operations over the variables by referring to the string. Here's my code: begin y1 = ispan(0,1000,1) y2 = ispan(1000,2000,1) y3 = ispan(2000,3000,1) y4 = ispan(3000,4000,1) y5 = ispan(4000,5000,1) y6 = ispan(5000,6000,1) y7 = ispan(6000,7000,1) y8 = ispan(7000,8000,1) y9 = ispan(8000,9000,1) y10 = ispan(9000,10000,1) y11 = ispan(10000,11000,1) y12 = ispan(11000,12000,1) y13 = ispan(12000,13000,1) y14 = ispan(13000,14000,1) y15 = ispan(14000,15000,1) y16 = ispan(15000,16000,1) y17 = ispan(16000,17000,1) y18 = ispan(17000,18000,1) y19 = ispan(18000,19000,1) do i = 1,19 var = "y"+tostring(i) M = max($var$) m = min($var$) print(M+" "+m) end do end I get a syntax error with this. Is it possible to achieve the same thing through some other syntax in an efficient way? Thanks a lot. Tabish ------------------------------- Dr Tabish Ansari Research Associate Air Quality Modelling Group IASS-Potsdam Germany -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.allured at noaa.gov Thu Jan 26 07:09:05 2023 From: dave.allured at noaa.gov (Dave Allured - NOAA Affiliate) Date: Thu, 26 Jan 2023 09:09:05 -0500 Subject: [ncl-talk] converting string into a variable name In-Reply-To: References: Message-ID: Tabish, NCL string references work for file variables, but not for in-memory variables. See NCL reference manual, section "String references". On Thu, Jan 26, 2023 at 8:46 AM Tabish Ansari via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Hi > > I have several systematically named variables that I want to refer to by > generating the corresponding string via a loop. I'm able to generate a > string that exactly matches the variable name but I'm unable to perform any > operations over the variables by referring to the string. > > Here's my code: > > begin > y1 = ispan(0,1000,1) > y2 = ispan(1000,2000,1) > y3 = ispan(2000,3000,1) > y4 = ispan(3000,4000,1) > y5 = ispan(4000,5000,1) > y6 = ispan(5000,6000,1) > y7 = ispan(6000,7000,1) > y8 = ispan(7000,8000,1) > y9 = ispan(8000,9000,1) > y10 = ispan(9000,10000,1) > y11 = ispan(10000,11000,1) > y12 = ispan(11000,12000,1) > y13 = ispan(12000,13000,1) > y14 = ispan(13000,14000,1) > y15 = ispan(14000,15000,1) > y16 = ispan(15000,16000,1) > y17 = ispan(16000,17000,1) > y18 = ispan(17000,18000,1) > y19 = ispan(18000,19000,1) > > do i = 1,19 > var = "y"+tostring(i) > M = max($var$) > m = min($var$) > print(M+" "+m) > end do > > end > > I get a syntax error with this. Is it possible to achieve the same thing > through some other syntax in an efficient way? > > Thanks a lot. > > Tabish > > > ------------------------------- > Dr Tabish Ansari > Research Associate > Air Quality Modelling Group > IASS-Potsdam > Germany > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.allured at noaa.gov Thu Jan 26 07:15:13 2023 From: dave.allured at noaa.gov (Dave Allured - NOAA Affiliate) Date: Thu, 26 Jan 2023 09:15:13 -0500 Subject: [ncl-talk] converting string into a variable name In-Reply-To: References: Message-ID: Tabish, for your example, you could use a simple array instead of individually named variables. y = new (20, integer) y(1) = ispan(0,1000,1) y(2) = ispan(1000,2000,1) y(3) = ispan(2000,3000,1) --- etc. --- do i = 1,19 M = max(y(i)) m = min(y(i)) --- etc. --- Note that NCL uses zero-based arrays, so this example ignores y(0) to keep your original indexing scheme from 1 to 19. On Thu, Jan 26, 2023 at 9:09 AM Dave Allured - NOAA Affiliate < dave.allured at noaa.gov> wrote: > Tabish, NCL string references work for file variables, but not for > in-memory variables. See NCL reference manual, section "String references". > > > On Thu, Jan 26, 2023 at 8:46 AM Tabish Ansari via ncl-talk < > ncl-talk at mailman.ucar.edu> wrote: > >> Hi >> >> I have several systematically named variables that I want to refer to by >> generating the corresponding string via a loop. I'm able to generate a >> string that exactly matches the variable name but I'm unable to perform any >> operations over the variables by referring to the string. >> >> Here's my code: >> >> begin >> y1 = ispan(0,1000,1) >> y2 = ispan(1000,2000,1) >> y3 = ispan(2000,3000,1) >> y4 = ispan(3000,4000,1) >> y5 = ispan(4000,5000,1) >> y6 = ispan(5000,6000,1) >> y7 = ispan(6000,7000,1) >> y8 = ispan(7000,8000,1) >> y9 = ispan(8000,9000,1) >> y10 = ispan(9000,10000,1) >> y11 = ispan(10000,11000,1) >> y12 = ispan(11000,12000,1) >> y13 = ispan(12000,13000,1) >> y14 = ispan(13000,14000,1) >> y15 = ispan(14000,15000,1) >> y16 = ispan(15000,16000,1) >> y17 = ispan(16000,17000,1) >> y18 = ispan(17000,18000,1) >> y19 = ispan(18000,19000,1) >> >> do i = 1,19 >> var = "y"+tostring(i) >> M = max($var$) >> m = min($var$) >> print(M+" "+m) >> end do >> >> end >> >> I get a syntax error with this. Is it possible to achieve the same thing >> through some other syntax in an efficient way? >> >> Thanks a lot. >> >> Tabish >> >> >> ------------------------------- >> Dr Tabish Ansari >> Research Associate >> Air Quality Modelling Group >> IASS-Potsdam >> Germany >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brownrig at ucar.edu Thu Jan 26 07:19:46 2023 From: brownrig at ucar.edu (Rick Brownrigg) Date: Thu, 26 Jan 2023 07:19:46 -0700 Subject: [ncl-talk] converting string into a variable name In-Reply-To: References: Message-ID: Tabish, David: I see David has already replied regarding string references and file variables. Another thought I was working on was to use Lists. It's probably overkill for your example; something like: l = NewList("fifo") ListPush(l, ispan(0,1000,1)) ListPush(l, ispan(1000,2000,1)) ListPush(l, ispan(2000,3000,1)) numl = ListCount(l) do i = 1,numl var := ListPop(l) M = max(var) m = min(var) print(M+" "+m) end do Rick On Thu, Jan 26, 2023 at 7:15 AM Dave Allured - NOAA Affiliate via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Tabish, for your example, you could use a simple array instead of > individually named variables. > > y = new (20, integer) > y(1) = ispan(0,1000,1) > y(2) = ispan(1000,2000,1) > y(3) = ispan(2000,3000,1) > --- etc. --- > > do i = 1,19 > M = max(y(i)) > m = min(y(i)) > --- etc. --- > > Note that NCL uses zero-based arrays, so this example ignores y(0) to keep > your original indexing scheme from 1 to 19. > > > On Thu, Jan 26, 2023 at 9:09 AM Dave Allured - NOAA Affiliate < > dave.allured at noaa.gov> wrote: > >> Tabish, NCL string references work for file variables, but not for >> in-memory variables. See NCL reference manual, section "String references". >> >> >> On Thu, Jan 26, 2023 at 8:46 AM Tabish Ansari via ncl-talk < >> ncl-talk at mailman.ucar.edu> wrote: >> >>> Hi >>> >>> I have several systematically named variables that I want to refer to by >>> generating the corresponding string via a loop. I'm able to generate a >>> string that exactly matches the variable name but I'm unable to perform any >>> operations over the variables by referring to the string. >>> >>> Here's my code: >>> >>> begin >>> y1 = ispan(0,1000,1) >>> y2 = ispan(1000,2000,1) >>> y3 = ispan(2000,3000,1) >>> y4 = ispan(3000,4000,1) >>> y5 = ispan(4000,5000,1) >>> y6 = ispan(5000,6000,1) >>> y7 = ispan(6000,7000,1) >>> y8 = ispan(7000,8000,1) >>> y9 = ispan(8000,9000,1) >>> y10 = ispan(9000,10000,1) >>> y11 = ispan(10000,11000,1) >>> y12 = ispan(11000,12000,1) >>> y13 = ispan(12000,13000,1) >>> y14 = ispan(13000,14000,1) >>> y15 = ispan(14000,15000,1) >>> y16 = ispan(15000,16000,1) >>> y17 = ispan(16000,17000,1) >>> y18 = ispan(17000,18000,1) >>> y19 = ispan(18000,19000,1) >>> >>> do i = 1,19 >>> var = "y"+tostring(i) >>> M = max($var$) >>> m = min($var$) >>> print(M+" "+m) >>> end do >>> >>> end >>> >>> I get a syntax error with this. Is it possible to achieve the same thing >>> through some other syntax in an efficient way? >>> >>> Thanks a lot. >>> >>> Tabish >>> >>> >>> ------------------------------- >>> Dr Tabish Ansari >>> Research Associate >>> Air Quality Modelling Group >>> IASS-Potsdam >>> Germany >>> >> _______________________________________________ > 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: