\hypertarget{gdncvarputattrchar_8f90}{}\section{gtdata/gtdata\+\_\+netcdf/gdncvarputattrchar.f90 File Reference}
\label{gdncvarputattrchar_8f90}\index{gtdata/gtdata\+\_\+netcdf/gdncvarputattrchar.\+f90@{gtdata/gtdata\+\_\+netcdf/gdncvarputattrchar.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{gdncvarputattrchar_8f90_a2f40a2d3561dc21770eb0a99194d07ba}{gdncvarputattrchar} (var, name, val, xtype, err)
\end{DoxyCompactItemize}


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



Definition at line 14 of file gdncvarputattrchar.\+f90.



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


\begin{DoxyCode}
14   \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}
15   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__internal}{gtdata\_netcdf\_internal}\textcolor{keywordtype}{, only}: \hyperlink{namespacegtdata__netcdf__internal_afe013c8012ec100bf1e94e5147c340de}{vtable\_lookup}
16   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__file__generic}{gtdata\_netcdf\_file\_generic}\textcolor{keywordtype}{, only}: 
      \hyperlink{gdncfiledefinemode_8f90_afbd7b3565fcb4698e5f7eadf62fb4b35}{gdncfiledefinemode}
17   \textcolor{keywordtype}{use }netcdf\textcolor{keywordtype}{, only}: &
18     & nf90\_global, &
19     & nf90\_noerr, &
20     & nf90\_put\_att, &
21     & nf90\_del\_att
22   \textcolor{keywordtype}{use }\hyperlink{namespacedc__url}{dc\_url}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__url_a373b7d2195c21ebf1458e79ad72dce0d}{gt\_plus}
23   \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}
24   \textcolor{keywordtype}{use }dc\_string\textcolor{keywordtype}{, only}: get\_array
25   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__netcdf__generic}{gtdata\_netcdf\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__netcdf__generic_1_1put__attr}{put\_attr}
26   \textcolor{keywordtype}{implicit none}
27   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable}{gd\_nc\_variable}), \textcolor{keywordtype}{intent(in)}:: var
28   \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}:: name
29   \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}:: val
30   \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: xtype
31   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
32   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: ip(:)
33   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: rp(:)
34   \textcolor{keywordtype}{double precision}, \textcolor{keywordtype}{pointer}:: dp(:)
35   \textcolor{keywordtype}{integer}:: stat
36   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__netcdf__types_1_1gd__nc__variable__entry}{gd\_nc\_variable\_entry}):: ent
37 \textcolor{keywordflow}{continue}
38   stat = \hyperlink{namespacegtdata__netcdf__internal_afe013c8012ec100bf1e94e5147c340de}{vtable\_lookup}(var, ent)
39   \textcolor{keywordflow}{if} (stat /= nf90\_noerr) \textcolor{keywordflow}{goto} 999
40   \textcolor{keywordflow}{if} (len(val) == 0) \textcolor{keywordflow}{then}
41     \textcolor{keywordflow}{if} (name(1:1) == \hyperlink{namespacedc__url_a373b7d2195c21ebf1458e79ad72dce0d}{gt\_plus}) \textcolor{keywordflow}{then}
42       stat = nf90\_del\_att(ent%fileid, nf90\_global, name = name(2:))
43     \textcolor{keywordflow}{else}
44       stat = nf90\_del\_att(ent%fileid, ent%varid, name = name)
45 \textcolor{keywordflow}{    endif}
46     \textcolor{keywordflow}{goto} 999
47 \textcolor{keywordflow}{  endif}
48   \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(xtype) ) \textcolor{keywordflow}{then}
49     \textcolor{keywordflow}{select case}(xtype)
50     \textcolor{keywordflow}{case}(\textcolor{stringliteral}{"INTEGER"}, \textcolor{stringliteral}{"integer"}, \textcolor{stringliteral}{"int"})
51       \textcolor{keywordflow}{goto} 200
52     \textcolor{keywordflow}{case}(\textcolor{stringliteral}{"REAL"}, \textcolor{stringliteral}{"real"}, \textcolor{stringliteral}{"float"})
53       \textcolor{keywordflow}{goto} 300
54     \textcolor{keywordflow}{case}(\textcolor{stringliteral}{"DOUBLEPRECISION"}, \textcolor{stringliteral}{"DOUBLE"}, \textcolor{stringliteral}{"double"})
55       \textcolor{keywordflow}{goto} 400
56 \textcolor{keywordflow}{    end select}
57 \textcolor{keywordflow}{  end if}
58 
59   stat = \hyperlink{gdncfiledefinemode_8f90_afbd7b3565fcb4698e5f7eadf62fb4b35}{gdncfiledefinemode}( ent % fileid )
60   \textcolor{keywordflow}{if} (stat /= nf90\_noerr) \textcolor{keywordflow}{goto} 999
61   \textcolor{keywordflow}{if} (name(1:1) == \hyperlink{namespacedc__url_a373b7d2195c21ebf1458e79ad72dce0d}{gt\_plus}) \textcolor{keywordflow}{then}
62     stat = nf90\_put\_att(ent%fileid, nf90\_global, name(2:), trim(val) )
63   \textcolor{keywordflow}{else}
64     stat = nf90\_put\_att(ent%fileid, ent%varid, name, trim(val) )
65 \textcolor{keywordflow}{  endif}
66 
67 999 \textcolor{keywordflow}{continue}
68   \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}(stat, \textcolor{stringliteral}{'GDNcVarPutAttrChar'}, err, cause\_c=name)
69   \textcolor{keywordflow}{return}
70 
71 200 \textcolor{keywordflow}{continue}
72   \textcolor{keyword}{call }get\_array(ip, val)
73   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(ip)) \textcolor{keywordflow}{then}
74     \textcolor{keyword}{call }\hyperlink{interfacegtdata__netcdf__generic_1_1put__attr}{put\_attr}(var, name, ip, err)
75     \textcolor{keyword}{deallocate}(ip)
76 \textcolor{keywordflow}{  endif}
77   \textcolor{keywordflow}{return}
78 
79 300 \textcolor{keywordflow}{continue}
80   \textcolor{keyword}{call }get\_array(rp, val)
81   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(rp)) \textcolor{keywordflow}{then}
82     \textcolor{keyword}{call }\hyperlink{interfacegtdata__netcdf__generic_1_1put__attr}{put\_attr}(var, name, rp, err)
83     \textcolor{keyword}{deallocate}(rp)
84 \textcolor{keywordflow}{  endif}
85   \textcolor{keywordflow}{return}
86 
87 400 \textcolor{keywordflow}{continue}
88   \textcolor{keyword}{call }get\_array(dp, val)
89   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(dp)) \textcolor{keywordflow}{then}
90     \textcolor{keyword}{call }\hyperlink{interfacegtdata__netcdf__generic_1_1put__attr}{put\_attr}(var, name, dp, err)
91     \textcolor{keyword}{deallocate}(dp)
92 \textcolor{keywordflow}{  endif}
93   \textcolor{keywordflow}{return}
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{gdncvarputattrchar_8f90_a2f40a2d3561dc21770eb0a99194d07ba_cgraph}
\end{center}
\end{figure}
