source: trunk/include/ncutil.h @ 7

Last change on this file since 7 was 7, checked in by jbrlod, 13 years ago

rst write

  • Property svn:eol-style set to native
File size: 2.7 KB
Line 
1//netcdf
2#ifndef NCUTIL
3#define NCUTIL
4
5#include <stdio.h>
6#include <stdlib.h>
7#include <iostream>
8#include <netcdf.h>
9
10#define YYDOUBLE //équivalent du YDOUBLE/YFLOAT de YAO
11//normalement YYDOUBLE et YBOUBLE doivent être définis en même temps
12//Verifié dans appli_start
13
14
15#ifdef YFLOAT
16#define NC_REAL NC_FLOAT
17#define nc_put_vara_real nc_put_vara_float
18#define YREAL float
19#else
20#define NC_REAL NC_DOUBLE
21#define nc_put_vara_real nc_put_vara_double
22#define YREAL double
23#endif
24
25void    handle_error (int status, char *txt);///*fonction de message d'erreur
26int Ouvre_nc(char const *var_file );///* Ouvre un fichier nc et renvoie son id var_file_id
27int Ouvre_nc_write(char const *var_file);   ///* ouvre un fichier nc pour écriture et renvoie son id var_file_id
28int Var_id(int  var_file_id,char* varn); ///*initial traceurs actifs
29
30
31void vonclire(int t,int znbval, int ynbval, int xnbval, int ncid, int varid, double vect[]);
32void vonclire(int t,int znbval, int ynbval, int xnbval, int ncid, int varid, int vect[]);
33// lire volume 3D au temps t
34// le parametre t commence de 0 et pas de 1
35// (t,znbval,ynbval,xnbval,ncid, varid):
36// lit la variable varid aux points (t,1:znbval,1:ynbval,1:xnbval) et
37// renvoie un vecteur de dim znbval*ynbval*xnbval
38
39void voncwrite(int t,int znbval,int ynbval, int xnbval, char const *var_name,int ncid,int dimids[], YREAL vect[]);
40
41
42void sonclire(int t,int ynbval, int xnbval, int ncid, int varid, double vect[]);
43void sonclire(int t,int ynbval, int xnbval, int ncid, int varid, float vect[]);
44void sonclire(int t,int ynbval, int xnbval, int ncid, int varid, int vect[]);
45// lire surface 2D au temps t
46// le parametre t commence de 0 et pas de 1
47// (t,ynbval,xnbval,ncid, varid):
48// lit la variable varid aux points (t,1:ynbval,1:xnbval) et
49// renvoie un vecteur de dim ynbval*xnbval
50void snclire(int ynbval, int xnbval, int ncid, int varid, float vect[]);
51void snclire(int ynbval, int xnbval, int ncid, int varid, double vect[]);
52
53void soncwrite(int t,int ynbval, int xnbval, char const *var_name,int ncid,int dimids[], YREAL vect[]);
54
55void zonclire(int t,int znbval, int ncid, int varid, double vect[]);
56void zonclire(int t,int znbval, int ncid, int varid, int vect[]);
57// lire surface 1D au temps t
58// le parametre t commence de 0 et pas de 1
59// (t,znbval,ncid, varid):
60// lit la variable varid aux points (t,1:znbval) et
61// renvoie un vecteur de dim znbval
62
63void znclire(int znbval, int ncid, int varid, float vect[]);
64void znclire(int znbval, int ncid, int varid, double vect[]);
65
66void zoncwrite(int t,int znbval,char const *var_name,int ncid,int dimids[], YREAL vect[]);
67
68void zncwrite(int znbval,char const *var_name,int ncid,int dimids[], YREAL vect[]);
69void sncwrite(int ynbval, int xnbval, char const *var_name,int ncid,int dimids[], YREAL vect[]);
70#endif
71
Note: See TracBrowser for help on using the repository browser.