\hypertarget{gdncvarputattrint_8f90}{}\section{gtdata/gtdata\+\_\+netcdf/gdncvarputattrint.f90 File Reference}
\label{gdncvarputattrint_8f90}\index{gtdata/gtdata\+\_\+netcdf/gdncvarputattrint.\+f90@{gtdata/gtdata\+\_\+netcdf/gdncvarputattrint.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{gdncvarputattrint_8f90_ae8977f43cbcc55da9f9319e3704c2c36}{gdncvarputattrint} (var, name, value, err)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{gdncvarputattrint_8f90_ae8977f43cbcc55da9f9319e3704c2c36}\label{gdncvarputattrint_8f90_ae8977f43cbcc55da9f9319e3704c2c36}} 
\index{gdncvarputattrint.\+f90@{gdncvarputattrint.\+f90}!gdncvarputattrint@{gdncvarputattrint}}
\index{gdncvarputattrint@{gdncvarputattrint}!gdncvarputattrint.\+f90@{gdncvarputattrint.\+f90}}
\subsubsection{\texorpdfstring{gdncvarputattrint()}{gdncvarputattrint()}}
{\footnotesize\ttfamily subroutine gdncvarputattrint (\begin{DoxyParamCaption}\item[{type(gd\+\_\+nc\+\_\+variable), intent(in)}]{var,  }\item[{character(len = $\ast$), intent(in)}]{name,  }\item[{integer, dimension(\+:), intent(in)}]{value,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})}



Definition at line 4 of file gdncvarputattrint.\+f90.



References gdncfiledefinemode(), dc\+\_\+url\+::gt\+\_\+plus, dc\+\_\+error\+::storeerror(), and gtdata\+\_\+netcdf\+\_\+internal\+::vtable\+\_\+lookup().


\begin{DoxyCode}
4   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__types}{gtdata\_netcdf\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable}{gd\_nc\_variable}, 
      \hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable__entry}{gd\_nc\_variable\_entry}
5   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__file__generic}{gtdata\_netcdf\_file\_generic}\textcolor{keywordtype}{, only}: 
      \hyperlink{gdncfiledefinemode_8f90_afbd7b3565fcb4698e5f7eadf62fb4b35}{gdncfiledefinemode}
6   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__internal}{gtdata\_netcdf\_internal}\textcolor{keywordtype}{, only}: \hyperlink{namespacegtdata__netcdf__internal_afe013c8012ec100bf1e94e5147c340de}{vtable\_lookup}
7   \textcolor{keywordtype}{use }netcdf\textcolor{keywordtype}{, only}: &
8     & nf90\_put\_att, &
9     & nf90\_noerr, &
10     & nf90\_del\_att, &
11     & nf90\_enotindefine, &
12     & nf90\_global
13     \textcolor{keywordtype}{use }\hyperlink{namespacedc__url}{dc\_url}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__url_a373b7d2195c21ebf1458e79ad72dce0d}{gt\_plus}
14     \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}
15     \textcolor{keywordtype}{implicit none}
16     \textcolor{keywordtype}{type}(\hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable}{gd\_nc\_variable}), \textcolor{keywordtype}{intent(in)}:: var
17     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}:: name
18     \textcolor{keywordtype}{type}(\hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable__entry}{gd\_nc\_variable\_entry}):: ent
19     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}:: \textcolor{keywordtype}{value}(:)
20     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
21     \textcolor{keywordtype}{integer}:: stat
22     \textcolor{keywordflow}{continue}
23     stat = \hyperlink{namespacegtdata__netcdf__internal_afe013c8012ec100bf1e94e5147c340de}{vtable\_lookup}(var, ent)
24     \textcolor{keywordflow}{if} (stat /= nf90\_noerr) \textcolor{keywordflow}{goto} 999
25     \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(\textcolor{keywordtype}{value}) == 0) \textcolor{keywordflow}{then}
26       \textcolor{keywordflow}{if} (name(1:1) == \hyperlink{namespacedc__url_a373b7d2195c21ebf1458e79ad72dce0d}{gt\_plus}) \textcolor{keywordflow}{then}
27         stat = nf90\_del\_att(ent%fileid, nf90\_global, name(2:))
28       \textcolor{keywordflow}{else}
29         stat = nf90\_del\_att(ent%fileid, ent%varid, name)
30 \textcolor{keywordflow}{      endif}
31       \textcolor{keywordflow}{goto} 999
32 \textcolor{keywordflow}{    endif}
33     stat = \hyperlink{gdncfiledefinemode_8f90_afbd7b3565fcb4698e5f7eadf62fb4b35}{gdncfiledefinemode}(ent%fileid)
34     \textcolor{keywordflow}{if} (stat /= nf90\_noerr) \textcolor{keywordflow}{goto} 999
35     \textcolor{keywordflow}{if} (name(1:1) == \hyperlink{namespacedc__url_a373b7d2195c21ebf1458e79ad72dce0d}{gt\_plus}) \textcolor{keywordflow}{then}
36       stat = nf90\_put\_att(ent%fileid, nf90\_global, name(2:), \textcolor{keywordtype}{value})
37     \textcolor{keywordflow}{else}
38       stat = nf90\_put\_att(ent%fileid, ent%varid, name, \textcolor{keywordtype}{value})
39 \textcolor{keywordflow}{    endif}
40 999 \textcolor{keywordflow}{continue}
41     \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}(stat, \textcolor{stringliteral}{'GDNcVarPutAttrInt'}, err)
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{gdncvarputattrint_8f90_ae8977f43cbcc55da9f9319e3704c2c36_cgraph}
\end{center}
\end{figure}
