4Misc_Start4Platform@ X"$"ROGIXX Rt^ !4winspoolHP LaserJet 200 color M251 PCL 6HPLaserJet200colorM251nwHP LaserJet 200 color M251 PCL C 4dXXA4)DINU"@ 0W@ SMTJ0 IUPH!xMOA`T‰x)^8m ń`B(z!|>~$G7org%ka]H6}Iwv^C@fG`A%kJҖlES<qRo!z|8OiBk|OԻttkh4a^\ɇkI HZ:.19^"wzJOdNMVF1離.`Ei?t[Ap4Ga:@rK`bE]@kɛy9&tMb٬26=K# +V;}tvj>xVJ/oJ{);i5VQ䯘.[٬^X"?|]~"pt.<Hu\[٣~| B?}yO%3M?^&kf 6F_Ï*0JzS7@dŒ"xwcGC';ew޷wtq &""""""" yx X"$"ROGIXX Rt^ !4winspoolHP LaserJet 200 color M251 PCL 6HPLaserJet200colorM251nwHP LaserJet 200 color M251 PCL C 4dXXA4)DINU"@ 0W@ SMTJ0 IUPH!xMOA`T‰x)^8m ń`B(z!|>~$G7org%ka]H6}Iwv^C@fG`A%kJҖlES<qRo!z|8OiBk|OԻttkh4a^\ɇkI HZ:.19^"wzJOdNMVF1離.`Ei?t[Ap4Ga:@rK`bE]@kɛy9&tMb٬26=K# +V;}tvj>xVJ/oJ{);i5VQ䯘.[٬^X"?|]~"pt.<Hu\[٣~| B?}yO%3M?^&kf 6F_Ï*0JzS7@dŒ"xwcGC';ew޷wtq &""""""" yx X"$"ROGIXX  Rt^ !4winspoolHP LaserJet 200 color M251 PCL 6HPLaserJet200colorM251nwHP LaserJet 200 color M251 PCL C 4dXXA4)DINU"@ 0W@ SMTJ0 IUPH!xMOA`T‰x)^8m ń`B(z!|>~$G7org%ka]H6}Iwv^C@fG`A%kJҖlES<qRo!z|8OiBk|OԻttkh4a^\ɇkI HZ:.19^"wzJOdNMVF1離.`Ei?t[Ap4Ga:@rK`bE]@kɛy9&tMb٬26=K# +V;}tvj>xVJ/oJ{);i5VQ䯘.[٬^X"?|]~"pt.<Hu\[٣~| B?}yO%3M?^&kf 6F_Ï*0JzS7@dŒ"xwcGC';ew޷wtq &""""""" yx X"$" ROGIXX Rt^ !4winspoolHP LaserJet 200 color M251 PCL 6HPLaserJet200colorM251nwHP LaserJet 200 color M251 PCL C 4dXXA4)DINU"@ 0W@ SMTJ0 IUPH!xMOA`T‰x)^8m ń`B(z!|>~$G7org%ka]H6}Iwv^C@fG`A%kJҖlES<qRo!z|8OiBk|OԻttkh4a^\ɇkI HZ:.19^"wzJOdNMVF1離.`Ei?t[Ap4Ga:@rK`bE]@kɛy9&tMb٬26=K# +V;}tvj>xVJ/oJ{);i5VQ䯘.[٬^X"?|]~"pt.<Hu\[٣~| B?}yO%3M?^&kf 6F_Ï*0JzS7@dŒ"xwcGC';ew޷wtq &""""""" yx^Graph*daWDashSettings#  !5 cNormal@ Arial<HHHH$$5 cNormal@ Arial<HHHH$$444444 +RNormal@ Arial<HHHH$$4 4 4 4 4 4 homeSKdS2C:Users:JonnyC:OneDrive:Igor Pro:IGOR tools:C:Users:JonnyC:OneDrive:Igor Pro:IGOR toolsX"9+0 w@)d(Sw!8%dFTw8%wFTw;ZvޒvvVS:d!@ VS:`vLvcc  5IGOR_toolsSKdS2C:Users:JonnyC:OneDrive:Igor Pro:IGOR tools:C:Users:JonnyC:OneDrive:Igor Pro:IGOR toolsX"9.0 w@&d(Sw!h%dFTwh%wFTw;ZvޒvvVS:d!@P VS:`vLvcc  5ncgenPathYQdS2C:Program Files (x86):WaveMetrics:Igor Pro Folder:C:Program Files (x86):WaveMetrics:Igor Pro FolderX"960 w@ d(Sw!%dFTw%wFTw;ZvޒvvVS:d!@ VS:`vLvcc  5rbatPath>6dS2C:Users:JonnyC:Desktop:C:Users:JonnyC:Desktop@(dX"9(0 w@$d(Sw!%dFTw%wFTw;ZvޒvvVS:d!@H `VS:`vLvcc  5RecentWindowsAdvanced Topics.ihfHelp BrowserNCGEN_Dtable:NCGEN_data,NCGEN_dim1,...NCGEN_Gtable:NCGEN_Gname,NCGEN_GdataNetCDF_Maker.ipfncgen_demo 4Misc_EndTXOPState_Start Data Browser88on)GizmosPeakFunctions2EN_dim1,...&HDF5  0IgorGIS!NetCDFAccess ilOASISSileScatNLayvcc GBLoadWave?Data Browserroot z88@4XOPState_EndV_FlagS_value !E07+Ydata????-QA+vw@K>В?v?'@`@B7}@Z(@A|Ax*Aٸy?@`@Y"A/AT[AOAɓAxA@!@;AQAdrAH7vATAAyEADŽB8@ AjNAA4AA}Ah BB ncgen|`v P7!7NCGEN_okayNCGEN_OS?NCGEN_viewNCGEN_inputpw TL w cNCGEN_outputw TL w cNCGEN_filetw TL w cNCGEN_nctypew TL w cnc3lg 7INCGEN_Lname7????"p7timeparticle sizeparticle concentration'(K P 7ԁNCGEN_sName7????#7timesizepsd @ 7[+NCGEN_dim47????$"7@ 7[+NCGEN_dim37????%0!7hE 7[+NCGEN_dim27????& 7Ydata]O  7[+NCGEN_dim17????'p 7XdataYdataXdata 1S 7[+NCGEN_data7????(!7XdataYdatadataset2D aC !7ԌNCGEN_offset7????)!7000sqC p!7ԌNCGEN_scaling7????*"7111N 07ԌNCGEN_units7????+7secmicronscm-3 zO p7ԌNCGEN_fillVal7????,!7-9999-9999-9999 d@P"7NCGEN_format7????-7ڍ0 79NCGEN_Gdata7????.7example entriesput in relavent text in these boxesadd extra rows if required 2LMMMM3yp#7NCGEN_Gname7????/&7ConventionsTitleInstitutionSourceHistoryReferencesComment !(29 *z[d TXET????ZNetCDF_Maker.ipfNetCDF_Maker.ipf#pragma rtGlobals=1 #pragma version = 1.3 #pragma IgorVersion = 6.20 //======================================================= // NetCDF file Maker // makes a GUI for making NetCDF files from IGOR data // also scales data using scale factor and offset if input // this does NOT convert compressed data into integer format etc // You need to have the ncgen.exe files installed //======================================================= //======================================================= // Copyright (C) 2016 // Jonathan Crosier (SEAES, University of Manchester, UK) // j.crosier@manchester.ac.uk // // and // // Ken Aikin (NOAA/ESRL/CSD Tropospheric Chemistry Division, Boulder, CO) // kenneth.c.aikin@noaa.gov //======================================================= //======================================================= // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . //======================================================= // Using windows: // Get prebuilt netcdf binaries from the following: // http://www.unidata.ucar.edu/software/netcdf/docs/winbin.html //======================================================= // Using a MAC: // Installing ncgen: // install Xcode and Xcode Command Line Tools // Install MacPorts (package management system) // sudo port install netcdf (need admin access). May need to add /opt/local/bin to $PATH variable to find ncgen for command line operation //======================================================= // Some useful websites: // How to install netcdf libraries: http://www.unidata.ucar.edu/support/help/MailArchives/netcdf/msg11807.html // General netcdf info: http://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html // Xcode installation: http://railsapps.github.io/xcode-command-line-tools.html // MacPorts installation: https://www.macports.org/install.php //======================================================= static strconstant KS_NCGEN_GLB_TITLES="Conventions;Title;Institution;Source;History;References;Comment;" static strconstant KS_NCGEN_OS_WINDOWS = "WINDOWS" static strconstant KS_NCGEN_OS_MAC = "MAC" static constant K_NCGEN_OS_MAC = 0 static constant K_NCGEN_OS_WINDOWS = 1 //======================================================= // Add commnad to panel Menu menu "NCGEN" //puts the panels on the IGOR menus "NCGEN build", /Q, buildMakeNCGENGUI() "NCGEN panel", /Q, MakeNCGEN_win(4) "NCGEN Global Vars", /Q, MakeNCGEN_win(2) "NCGEN Data Table", /Q, MakeNCGEN_win(1) end //======================================================= // this calls the functions which make the panel and globals function buildMakeNCGENGUI() DFRef StartDir=GetDataFolderDFR() newdatafolder/o/s root:ncgen MakeNCGEN_run() MakeNCGEN_win(7) Setdatafolder StartDir end //======================================================= // makes the globals for the panels Function MakeNCGEN_run() string/g NCGEN_input="" string/g NCGEN_output="" string/g NCGEN_file="" string/g NCGEN_nctype = "classic" variable/G NCGEN_okay=0 variable/g NCGEN_OS=stringmatch(IgorInfo(2),KS_NCGEN_OS_WINDOWS) variable/g NCGEN_view = 1 if(!waveexists(NCGEN_data)) make /o/n=0/t NCGEN_data,NCGEN_dim1,NCGEN_dim2,NCGEN_dim3,NCGEN_dim4,NCGEN_sName,NCGEN_Lname make /o/n=0/t NCGEN_format,NCGEN_fillVal,NCGEN_units,NCGEN_scaling,NCGEN_offset make /o/n=(itemsinlist(KS_NCGEN_GLB_TITLES))/t NCGEN_Gname=stringfromlist(p,KS_NCGEN_GLB_TITLES),NCGEN_Gdata endif end //======================================================= // makes/recalls the various windows Function MakeNCGEN_win(WinID) variable WinID if(WinID&1) if (!wintype("NCGEN_Dtable")) execute("NCGEN_Dtable()") else dowindow /f NCGEN_Dtable endif endif if(WinID&2) if (!wintype("NCGEN_Gtable")) execute("NCGEN_Gtable()") else dowindow /f NCGEN_Gtable endif endif if(WinID&4) if (!wintype("NCGEN_panel")) execute("NCGEN_panel()") else dowindow /f NCGEN_panel endif endif end //======================================================= // makes the main panel Window NCGEN_panel() : Panel PauseUpdate; Silent 1 // ceate a panel NewPanel/k=1 /W=(80,70,450,190) as "CDL and netCDF file creater" ModifyPanel fixedsize=1,noedit=1 // file IO SetDrawEnv fsize= 9 DrawText 326,23,"PC only" SetVariable NCGEN_input,pos={10,10},size={280,16},title="ncgen folder",value= root:ncgen:NCGEN_input,noedit=1 SetVariable NCGEN_output,pos={10,35},size={280,16},title="output folder",value= root:ncgen:NCGEN_output,noedit=1 Button NCGEN_input_button, pos={300,8}, size={20,20},title="\W649",proc=NCGEN_setinput Button NCGEN_output_button, pos={300,33}, size={20,20},title="\W649",proc=NCGEN_setoutput SetVariable NCGEN_file,pos={10,60},size={230,16},title="Filename (without extension)",value= root:ncgen:NCGEN_file // status lights TitleBox NCGEN_exe, pos={30,85}, size={20,20},title="ncgen",labelBack=(50000,50000,50000) TitleBox NCGEN_access, pos={90,85}, size={20,20},title="access",labelBack=(50000,50000,50000) // netcdf format specifications PopupMenu NCGEN_format, pos={250,85},size={100,20},title="Format:",Proc=NCGEN_set_format,bodyWidth=80 PopupMenu NCGEN_format, mode=1,value= "nc3: classic;nc4: netCDF-4;nc5: 64-bit-data;nc6: 64-bit-offset;nc7: netCDF-4 classicmodel" // the main button to start making the netCDF Button NCGEN_make,pos={150,85},size={80,20},proc=NCGEN_maker,title="Do it!" // view output in new window CheckBox NCGEN_viewOutput,pos={250,60},size={32,14},title="view output" CheckBox NCGEN_viewOutput,mode=0,variable= root:ncgen:NCGEN_view // check if we need to disable MS WINDOWS only controls NCGEN_checkPlatform() EndMacro //======================================================= Function NCGEN_set_format(ctrlName,popNum,popStr) : PopupMenuControl String ctrlName Variable popNum // which item is currently selected (1-based) String popStr // contents of current popup item as string Svar/Z nctype=root:ncgen:NCGEN_nctype nctype = stringfromlist(0,popStr,":") End //======================================================= function NCGEN_checkPlatform() #if defined(MACINTOSH) SetVariable NCGEN_input,disable=2 Button NCGEN_input_button,disable=2 #else SetVariable NCGEN_input,disable=0 Button NCGEN_input_button,disable=0 #endif end //======================================================= // makes the table for data types window NCGEN_Dtable() : Table pauseupdate; silent 1 if(datafolderexists("root:ncgen")) String StartDir=GetDataFolder(1) setdatafolder root:ncgen Edit/k=1/W=(6,62,885.75,243.5) NCGEN_data,NCGEN_dim1,NCGEN_dim2,NCGEN_dim3,NCGEN_dim4,NCGEN_sName,NCGEN_Lname AppendToTable NCGEN_fillVal,NCGEN_units,NCGEN_scaling,NCGEN_offset ModifyTable title(NCGEN_data)="Data Waves",title(NCGEN_dim1)="Dimension1",title(NCGEN_dim2)="Dimension2",title(NCGEN_dim3)="Dimension3" ModifyTable title(NCGEN_dim4)="Dimension4",title(NCGEN_sName)="Short Name",title(NCGEN_Lname)="Long Name" ModifyTable title(NCGEN_fillVal)="Fill Value",title(NCGEN_units)="Data units",title(NCGEN_scaling)="Scale Factor",title(NCGEN_offset)="Offset" Setdatafolder StartDir endif end //======================================================= // makes the table for the global attributes window NCGEN_Gtable() : Table pauseupdate; silent 1 if(datafolderexists("root:ncgen")) String StartDir=GetDataFolder(1) setdatafolder root:ncgen Edit/k=1/W=(6,62,885.75,243.5) NCGEN_Gname,NCGEN_Gdata ModifyTable title(NCGEN_Gname)="Global Attribute Name",title(NCGEN_Gdata)="Global Attribute Data" ModifyTable autosize(NCGEN_Gname)={0,0,-1,0,0},width(NCGEN_Gdata)=350 Setdatafolder StartDir endif end //======================================================= // this function checks that ncgen.exe is found, and that it is in a read/write location Function NCGEN_check_install() SVAR NCGEN_input=root:ncgen:NCGEN_input NVAR NCGEN_okay=root:ncgen:NCGEN_okay // check the path contains ncgen variable ncgen_result = 0 Newpath/O/Q/Z ncgenPath, NCGEN_input if(V_flag==0) String FileList = IndexedFile(ncgenPath, -1, ".exe") variable i,j=itemsinlist(FileList) for(i=0;i0) Open/P=ncgenPath/Z fileID as "ncgen.tmp" if(V_flag==0) Close fileID DeleteFile/P=ncgenPath "ncgen.tmp" readwrite_result = 1 endif endif // set a status light if(readwrite_result) TitleBox NCGEN_access,labelBack=(30000,65000,30000) else TitleBox NCGEN_access,labelBack=(65000,30000,30000) endif NCGEN_okay=(readwrite_result&ncgen_result)? 1 : 0 End //======================================================= // sets the path to ncgen Function NCGEN_setinput(ControlName) : ButtonControl String ControlName // get the path svar NCGEN_input=root:ncgen:NCGEN_input NCGEN_input="" Newpath/O/Q/Z/M="Browse to the folder containing ncgen" ncgenPath if(V_Flag==0) Pathinfo ncgenPath variable len = strlen(s_path) NCGEN_input = S_path[0,len-2] endif NCGEN_check_install() End //======================================================= // set the output path for the netCDF files Function NCGEN_setoutput(ControlName) : ButtonControl String ControlName // get the path svar NCGEN_output=root:ncgen:NCGEN_output NCGEN_output="" Newpath/O/Q/Z/M="Browse to the folder for the output netCDF file" ncgenPath if(V_Flag==0) Pathinfo ncgenPath variable len = strlen(s_path) NCGEN_output = S_path[0,len-2] endif End //======================================================= // makes the CDL file, makes teh batch file and calls the batch file function NCGEN_maker(controlName) : ButtonControl string controlName // check the folder containing globals exists if(!datafolderexists("root:ncgen")) Doalert 0, "Igor NCGEN data folder not found. Please rebuild!" return 0 endif // reference globals svar NCGEN_input=root:ncgen:NCGEN_input svar NCGEN_output=root:ncgen:NCGEN_output svar NCGEN_file=root:ncgen:NCGEN_file nvar NCGEN_OS=root:ncgen:NCGEN_OS nvar NCGEN_okay=root:ncgen:NCGEN_okay // check ncgen is present when using windows if(NCGEN_OS==K_NCGEN_OS_WINDOWS) NCGEN_check_install() if(NCGEN_okay==0) Doalert 0, "ncgen not found, or not in write access folder. Aborting!" Setdatafolder StartDir return 0 endif elseif(NCGEN_OS==K_NCGEN_OS_MAC) NCGEN_okay=1 endif // check output paths and names have been specified if(strlen(NCGEN_output)==0) Doalert 0, "No output path set. Aborting!" return 0 endif if(strlen(NCGEN_file)==0) Doalert 0, "No output file name set. Aborting!" return 0 endif // convert MAC path to wondows paths for batch file operations String ncgenPath = ParseFilePath(5, NCGEN_input, "\\", 0, 0) String outputPath = ParseFilePath(5, NCGEN_output, "\\", 0, 0) // create the ascii CDL file variable error = CDL_build(NCGEN_file,outputPath) if(error) Doalert 0, "Error encountered during cdl build. See history area for details." else if(NCGEN_OS==K_NCGEN_OS_MAC) // convert MAC path to Unix path for shell script operations String outputPathUnix = ParseFilePath(5, NCGEN_output, "/", 0, 0) // create the shell script file which calls ncgen NCGEN_shell(NCGEN_file, NCGEN_output, outputPathUnix) // KA Modified for Mac version. Writes a shell script // make shell script executable. ExecuteScriptText/Z "do shell script \"cd "+outputPathUnix+"; chmod 744 "+NCGEN_file+".sh\"" // KA // execute the shell script file which calls ncgen ExecuteScriptText /Z "do shell script \""+outputPathUnix+"/"+NCGEN_file+".sh\"" // KA Modified for Mac version. Deletefile/Z NCGEN_output+"\\"+NCGEN_file+".sh" // KA Modified for Mac version elseif(NCGEN_OS==K_NCGEN_OS_WINDOWS) // execute the batch file which calls ncgen NCGEN_batch(NCGEN_file,outputPath,ncgenPath) ExecuteScriptText "\""+outputPath+"\\"+NCGEN_file+".bat\"" Deletefile/Z "\""+outputPath+"\\"+NCGEN_file+".bat\"" endif // show the output file in a new window? nvar viewoutput = root:ncgen:NCGEN_view if(viewoutput==1) Newpath/O/Q/Z ncgenPath, NCGEN_output pathinfo/show ncgenPath endif endif end //======================================================= // makes the batch file with the ncgen.exe call function NCGEN_batch(filename,folder,input) string filename,folder,input variable ref Svar/Z nctype=root:ncgen:NCGEN_nctype newpath /O /Q /Z batPath,folder Open /P=batPath /Z ref as filename+".bat" fprintf ref, "move /y \"%s\" \"%s\"\r\n",folder+"\\"+filename+".cdl",input fprintf ref, "cd/D \"%s\"\r\n",input fprintf ref, "ncgen -k %s -b -o \"%s\" \"%s\"\r\n",nctype, filename+".nc",filename+".cdl" fprintf ref, "move /y \"%s\" \"%s\"\r\n",filename+".nc",folder fprintf ref, "del %s\r\n",filename+".cdl" // fprintf ref, "@pause" close ref end //======================================================= // makes the shell script with the ncgen call. Assumes that ncgen is installed in default location of /usr/local/bin // KA Modified for Mac version. function NCGEN_shell(filename,folder, unixFolder) // Pass in folder which is the Mac pathstring, and unixFolder, which is the Mac path converted to Unix string filename,folder,unixFolder variable ref Svar/Z nctype=root:ncgen:NCGEN_nctype newpath /O/Q/Z shellFilePath,folder Open /P=shellFilePath /Z ref as filename+".sh" fprintf ref, "cd \"%s\"\n",unixFolder fprintf ref, "/opt/local/bin/ncgen -k %s -b -o \"%s\" \"%s\"\n",nctype, filename+".nc",filename+".cdl" // need full path because 'do shell script' doesn't use $PATH variable since that is customized to specific computers. fprintf ref, "rm %s\n",filename+".cdl" close ref end //======================================================= // makes the CDL formatted file function CDL_build(filename,folder) string filename,folder variable i,j,ii,jj,iii,jjj,iiii,jjjj,iiiii,jjjjj,ref,pos1,pos2,off,scale,len string dataListStr,dataStr1,dataStr2,outStr,info variable error = 1 string EOL="" // save the data folder String savedDataFolder = GetDataFolder(1) SetDataFolder root:ncgen // references the data wave/z/t NCGEN_data,NCGEN_dim1,NCGEN_dim2,NCGEN_dim3,NCGEN_dim4,NCGEN_sName,NCGEN_Lname wave/z/t NCGEN_format,NCGEN_fillVal,NCGEN_units,NCGEN_scaling,NCGEN_offset wave/z/t NCGEN_Gname,NCGEN_Gdata // Get the OS in order to set the correct end of line ("\n" for windows, "\r\n" for MAC) nvar NCGEN_OS // Get the desired netcdf type, as this determines if we need to check for "unsigned" formats or not svar NCGEN_nctype // restore the datafolder SetDataFolder savedDataFolder // check ncgen is present when using windows if(NCGEN_OS==K_NCGEN_OS_WINDOWS) EOL="\r\n" elseif(NCGEN_OS==K_NCGEN_OS_MAC) EOL="\n" endif if(!waveexists(NCGEN_data)) print "NCGEN info waves not found. Rebuild ncgen in Igor." return error endif // strip out blanks for data and dimension names as these can be blank NCGEN_data=replacestring(" ",NCGEN_data[p],"") NCGEN_dim1=replacestring(" ",NCGEN_dim1[p],"") NCGEN_dim2=replacestring(" ",NCGEN_dim2[p],"") NCGEN_dim3=replacestring(" ",NCGEN_dim3[p],"") NCGEN_dim4=replacestring(" ",NCGEN_dim4[p],"") // check for bad wave references and presence of all implied dimensions in the data list dataListStr = "data;dim1;dim2;dim3;dim4;" jj=itemsinlist(dataListStr) for(ii=0;ii0) if(!waveexists($(SourceRef[i]))) print "Bad wave reference in input table for "+stringfromlist(ii,dataListStr)+" in row "+num2str(i)+"." return error elseif(StringMatch(stringfromlist(ii,dataListStr), "dim*" )==1) if(NCGEN_TextWave_search(NCGEN_data, SourceRef[i]) == 0) Print "Dimensional data for "+stringfromlist(ii,dataListStr)+" for row "+num2str(i)+" not in data list of input table." return error endif endif endif endfor endfor // opens the file newpath /O /Q /Z ncgenPath,folder Open /P=ncgenPath /Z ref as filename+".cdl" fprintf ref, "netcdf %s { \r\n",filename fprintf ref, "\r\n" // outputs dimension information fprintf ref, "dimensions:" + EOL + EOL j=dimsize(NCGEN_data,0) for(i=0;i0) fprintf ref,",%s",NCGEN_sName[CDLfindstr(NCGEN_data,NCGEN_dim2[i])] endif if(strlen(NCGEN_dim3[i])>0) fprintf ref,",%s",NCGEN_sName[CDLfindstr(NCGEN_data,NCGEN_dim3[i])] endif if(strlen(NCGEN_dim4[i])>0) fprintf ref,",%s",NCGEN_sName[CDLfindstr(NCGEN_data,NCGEN_dim4[i])] endif fprintf ref,");" + EOL // outputs the attributes fprintf ref,"\t\t%s:%s = \"%s\";" + EOL, NCGEN_sName[i],"long_name",NCGEN_Lname[i] fprintf ref,"\t\t%s:%s = \"%s\";" + EOL, NCGEN_sName[i],"units",NCGEN_units[i] fprintf ref,"\t\t%s:%s = %s;" + EOL, NCGEN_sName[i],"_FillValue",NCGEN_fillVal[i] fprintf ref,"\t\t%s:%s = %s;" + EOL, NCGEN_sName[i],"scale_factor",NCGEN_scaling[i] fprintf ref,"\t\t%s:%s = %s;" + EOL, NCGEN_sName[i],"add_offset",NCGEN_offset[i] else Close ref Print "Data not found. Check wave reference for "+NCGEN_data[i]+" in netcdf input table." return error endif fprintf ref, EOL endfor // output global attributes fprintf ref, "//global attributes" + EOL for(i=0;i